Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake build creates scanner and parser with debug #69

Open
schwehr opened this issue Aug 9, 2018 · 1 comment
Open

CMake build creates scanner and parser with debug #69

schwehr opened this issue Aug 9, 2018 · 1 comment

Comments

@schwehr
Copy link
Contributor

schwehr commented Aug 9, 2018

It would be great to have an option to easily enable debug flex and bison output, but I don't think the default should be for debugging builds. lib/CMakeLists.txt has the flex option -d for debug and the bison build has -t for debug. The debug bison build with 3.0.2 on debian testing likes to emit a lot of extra newlines to stderr that I was unable to figure out how to disable.

IF(UNIX)
    add_custom_command(
        OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/scanner.c
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
        COMMAND ${UD_FLEX} -d -Put -o scanner.c scanner.l
        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scanner.l)
    add_custom_command(
        OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/parser.c
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
        COMMAND ${UD_BISON} -t -p ut -o parser.c parser.y
        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/parser.y)
    set_source_files_properties(parser.c
        PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scanner.c)
endif()
@schwehr
Copy link
Contributor Author

schwehr commented Aug 12, 2018

5452323 in PR #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant