diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 03910910..34bc1a93 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,10 +1,10 @@ find_package(FLEX REQUIRED) -execute_process(COMMAND flex scan.l WORKING_DIRECTORY src) +flex_target(scan src/scan.l src/lex.yy.c COMPILE_FLAGS --header-file="src/lex.yy.h") add_library(picrin SHARED src/blob.c src/bool.c src/char.c src/codegen.c src/cont.c src/error.c - src/file.c src/gc.c src/init.c src/lex.yy.c src/lib.c src/load.c src/macro.c + src/file.c src/gc.c src/init.c src/lib.c src/load.c src/macro.c src/number.c src/pair.c src/port.c src/proc.c src/read.c src/state.c src/string.c src/symbol.c src/system.c src/time.c src/var.c src/vector.c - src/vm.c src/write.c) + src/vm.c src/write.c ${PROJECT_SOURCE_DIR}/src/lex.yy.c) target_link_libraries(picrin m xfile) diff --git a/src/scan.l b/src/scan.l index 8c4cd5c5..055aff98 100644 --- a/src/scan.l +++ b/src/scan.l @@ -29,7 +29,6 @@ %option noyywrap %option extra-type="struct parser_control *" -%option header-file="lex.yy.h" %option never-interactive /* comment */