Files
nudt-compiler-cpp/src/frontend/CMakeLists.txt
2026-03-12 15:37:27 +08:00

18 lines
428 B
CMake

add_library(frontend STATIC
AntlrDriver.cpp
SyntaxTreePrinter.cpp
)
target_link_libraries(frontend PUBLIC
build_options
${ANTLR4_RUNTIME_TARGET}
)
# 自动纳入构建目录中的 Lexer/Parser 生成源码(若存在)
file(GLOB_RECURSE ANTLR4_GENERATED_SOURCES CONFIGURE_DEPENDS
"${ANTLR4_GENERATED_DIR}/*.cpp"
)
if(ANTLR4_GENERATED_SOURCES)
target_sources(frontend PRIVATE ${ANTLR4_GENERATED_SOURCES})
endif()