Silence unused variable warnings in Ragel-generated code.

This commit is contained in:
Nicholas J. Kain 2019-01-01 01:10:34 -05:00
parent 253a97662d
commit fb143995d2

View File

@ -12,6 +12,10 @@ add_custom_command(
COMMENT "Compiling Ragel state machine: ifchd-parse.rl" COMMENT "Compiling Ragel state machine: ifchd-parse.rl"
VERBATIM VERBATIM
) )
set_property(SOURCE ${RAGEL_IFCHD_PARSE} APPEND PROPERTY GENERATED TRUE)
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set_property(SOURCE ${RAGEL_IFCHD_PARSE} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-unused-const-variable")
endif()
add_custom_command( add_custom_command(
OUTPUT ${RAGEL_CFG_PARSE} OUTPUT ${RAGEL_CFG_PARSE}
COMMAND ${RAGEL} -G2 -o ${RAGEL_CFG_PARSE} cfg.rl COMMAND ${RAGEL} -G2 -o ${RAGEL_CFG_PARSE} cfg.rl
@ -20,6 +24,10 @@ add_custom_command(
COMMENT "Compiling Ragel state machine: cfg.rl" COMMENT "Compiling Ragel state machine: cfg.rl"
VERBATIM VERBATIM
) )
set_property(SOURCE ${RAGEL_CFG_PARSE} APPEND PROPERTY GENERATED TRUE)
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set_property(SOURCE ${RAGEL_CFG_PARSE} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-unused-const-variable")
endif()
add_executable(ndhc ${RAGEL_CFG_PARSE} ${RAGEL_IFCHD_PARSE}) add_executable(ndhc ${RAGEL_CFG_PARSE} ${RAGEL_IFCHD_PARSE})
target_sources(ndhc PRIVATE target_sources(ndhc PRIVATE