build(build): 拆分子目录 CMakeLists 并规范目标命名

This commit is contained in:
Lane0218
2025-12-27 15:10:35 +08:00
parent 35da726b00
commit 6de56f107b
13 changed files with 276 additions and 14 deletions

View File

@@ -0,0 +1,18 @@
add_library(frontend STATIC
AntlrDriver.cpp
AstBuilder.cpp
)
target_link_libraries(frontend PUBLIC
build_options
ast
"${ANTLR4_RUNTIME_TARGET}"
)
# 自动纳入构建目录中的 ANTLR 生成源码(若存在)
file(GLOB ANTLR4_GENERATED_SOURCES CONFIGURE_DEPENDS
"${ANTLR4_GENERATED_DIR}/*.cpp"
)
if(ANTLR4_GENERATED_SOURCES)
target_sources(frontend PRIVATE ${ANTLR4_GENERATED_SOURCES})
endif()