- STCompiler 入口在 compiler/src/main.cpp,链 compiler+isa - host/ 改名 executor/,BytecodeExecutor 链 vm+isa 不链 compiler - compiler/vm 补 PUBLIC 链 isa;顶层加入 executor - CTest:版本冒烟 2 例 + isa_roundtrip(89 断言),3/3 通过
21 lines
624 B
CMake
21 lines
624 B
CMake
# CMake最低版本
|
|
cmake_minimum_required(VERSION 3.21)
|
|
|
|
# 工程名、版本号、工程描述
|
|
project(Compiler
|
|
VERSION 0.1
|
|
DESCRIPTION "ST / toml 编译器")
|
|
|
|
# 词法、语法、符号表、类型检查、codegen、链接都留在 compiler 一个库里
|
|
add_library(compiler STATIC
|
|
./src/Lexer.cpp)
|
|
|
|
target_include_directories(compiler PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
|
target_link_libraries(compiler PUBLIC isa)
|
|
|
|
# 可执行入口:STCompiler <project.toml> -o <name>.stb
|
|
add_executable(STCompiler
|
|
./src/main.cpp)
|
|
|
|
target_link_libraries(STCompiler PRIVATE compiler)
|