Add CMake defines to enable tracing lexer and parser

This commit is contained in:
ISSOtm
2020-10-12 09:02:21 +02:00
parent 0836f67d42
commit 71d8aeb4c2

View File

@@ -27,6 +27,8 @@ include_directories("${PROJECT_SOURCE_DIR}/include")
option(SANITIZERS "Build with sanitizers enabled" OFF) option(SANITIZERS "Build with sanitizers enabled" OFF)
option(MORE_WARNINGS "Turn on more warnings" OFF) option(MORE_WARNINGS "Turn on more warnings" OFF)
option(TRACE_PARSER "Trace parser execution" OFF)
option(TRACE_LEXER "Trace lexer execution" OFF)
if(MSVC) if(MSVC)
add_compile_options(/W1 /MP) add_compile_options(/W1 /MP)
@@ -69,3 +71,11 @@ set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED True) set(CMAKE_C_STANDARD_REQUIRED True)
add_subdirectory(src) add_subdirectory(src)
if(TRACE_PARSER)
target_compile_definitions(rgbasm PRIVATE -DYYDEBUG)
endif()
if(TRACE_LEXER)
target_compile_definitions(rgbasm PRIVATE -DLEXER_DEBUG)
endif()