forked from NUDT-compiler/nudt-compiler-cpp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
528 B
19 lines
528 B
add_library(frontend STATIC
|
|
AntlrDriver.cpp
|
|
SyntaxTreePrinter.cpp
|
|
)
|
|
|
|
target_link_libraries(frontend PUBLIC
|
|
build_options
|
|
${ANTLR4_RUNTIME_TARGET}
|
|
)
|
|
|
|
# 自动纳入构建目录中的 Lexer/Parser 生成源码(若存在),同时兼容存储在 src/antlr4 中的已生成代码
|
|
file(GLOB_RECURSE ANTLR4_GENERATED_SOURCES CONFIGURE_DEPENDS
|
|
"${ANTLR4_GENERATED_DIR}/*.cpp"
|
|
"${PROJECT_SOURCE_DIR}/src/antlr4/*.cpp"
|
|
)
|
|
if(ANTLR4_GENERATED_SOURCES)
|
|
target_sources(frontend PRIVATE ${ANTLR4_GENERATED_SOURCES})
|
|
endif()
|