acc is now built with cmake instead of the old build script. This was mainly done to fix compilation on Puhti where I had problems linking flex even though it is available. As an added bonus the code is now safer to build since all dependencies are now rigorously tracked by cmake and make, and f.ex. change in the compiler now forces also the whole library to be rebuilt (which is the behaviour we want)

This commit is contained in:
jpekkila
2019-09-24 16:57:19 +03:00
parent a91da8388c
commit 72af2cf31d
5 changed files with 38 additions and 16 deletions

11
acc/src/CMakeLists.txt Normal file
View File

@@ -0,0 +1,11 @@
## Compile the Astaroth Code compiler
find_package(BISON)
find_package(FLEX 2.5.5 REQUIRED)
bison_target(acc_parser acc.y ${CMAKE_CURRENT_BINARY_DIR}/acc.tab.c)
flex_target(acc_lexer acc.l ${CMAKE_CURRENT_BINARY_DIR}/acc.yy.c)
add_flex_bison_dependency(acc_lexer acc_parser)
add_executable(acc code_generator.c ${BISON_acc_parser_OUTPUTS} ${FLEX_acc_lexer_OUTPUTS})
target_include_directories(acc PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(acc ${FLEX_LIBRARIES})