diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 73f81564..f868a983 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -27,11 +27,13 @@ if(BISON_VERSION VERSION_GREATER_EQUAL "3.7") set(BISON_FLAGS "${BISON_FLAGS} -Wcounterexamples") endif() -bison_target(asm_parser "asm/parser.y" - "${CMAKE_CURRENT_BINARY_DIR}/asm/parser.cpp" - COMPILE_FLAGS "${BISON_FLAGS}") +bison_target(ASM_PARSER "asm/parser.y" + "${PROJECT_SOURCE_DIR}/src/asm/parser.cpp" + COMPILE_FLAGS "${BISON_FLAGS}" + DEFINES_FILE "${PROJECT_SOURCE_DIR}/src/asm/parser.hpp" +) add_executable(rgbasm $ - "${BISON_asm_parser_OUTPUT_SOURCE}" + "${BISON_ASM_PARSER_OUTPUT_SOURCE}" "asm/actions.cpp" "asm/charmap.cpp" "asm/fixpoint.cpp" @@ -52,14 +54,14 @@ add_executable(rgbasm $ "opmath.cpp" "verbosity.cpp" ) -cmake_path(GET BISON_asm_parser_OUTPUT_HEADER PARENT_PATH parser_header_dir) -target_include_directories(rgbasm PRIVATE "${parser_header_dir}") -bison_target(linker_script_parser "link/script.y" - "${CMAKE_CURRENT_BINARY_DIR}/link/script.cpp" - COMPILE_FLAGS "${BISON_FLAGS}") +bison_target(LINKER_SCRIPT_PARSER "link/script.y" + "${PROJECT_SOURCE_DIR}/src/link/script.cpp" + COMPILE_FLAGS "${BISON_FLAGS}" + DEFINES_FILE "${PROJECT_SOURCE_DIR}/src/link/script.hpp" +) add_executable(rgblink $ - "${BISON_linker_script_parser_OUTPUT_SOURCE}" + "${BISON_LINKER_SCRIPT_PARSER_OUTPUT_SOURCE}" "link/assign.cpp" "link/fstack.cpp" "link/lexer.cpp" @@ -78,8 +80,6 @@ add_executable(rgblink $ "opmath.cpp" "verbosity.cpp" ) -cmake_path(GET BISON_linker_script_parser_OUTPUT_HEADER PARENT_PATH parser_header_dir) -target_include_directories(rgblink PRIVATE "${parser_header_dir}") add_executable(rgbfix $ "fix/fix.cpp"