Browse Source

Updated cmake ragel rules to build config parser with -T0 instead of -T1

personal/stbuehler/wip
Stefan Bühler 14 years ago
parent
commit
5d0d12c0bd
  1. 22
      cmake/FindRagel.cmake
  2. 2
      src/CMakeLists.txt

22
cmake/FindRagel.cmake

@ -23,15 +23,19 @@ IF(RAGEL_FOUND)
ENDIF(NOT RAGEL_FLAGS)
MACRO(RAGEL_PARSER SRCFILE)
GET_FILENAME_COMPONENT(SRCBASE "${SRCFILE}" NAME_WE)
SET(OUTFILE "${CMAKE_CURRENT_BINARY_DIR}/${SRCBASE}.c")
SET(INFILE "${CMAKE_CURRENT_SOURCE_DIR}/${SRCFILE}")
ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILE}
COMMAND "${RAGEL_EXECUTABLE}"
ARGS -C ${RAGEL_FLAGS} -o "${OUTFILE}" "${INFILE}"
DEPENDS "${INFILE}"
COMMENT "Generating ${SRCBASE}.c from ${SRCFILE}"
)
GET_FILENAME_COMPONENT(SRCBASE "${SRCFILE}" NAME_WE)
SET(OUTFILE "${CMAKE_CURRENT_BINARY_DIR}/${SRCBASE}.c")
SET(INFILE "${CMAKE_CURRENT_SOURCE_DIR}/${SRCFILE}")
SET(_flags ${ARGV1})
IF(NOT _flags)
SET(_flags ${RAGEL_FLAGS})
ENDIF(NOT _flags)
ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILE}
COMMAND "${RAGEL_EXECUTABLE}"
ARGS -C ${_flags} -o "${OUTFILE}" "${INFILE}"
DEPENDS "${INFILE}"
COMMENT "Generating ${SRCBASE}.c from ${SRCFILE}"
)
ENDMACRO(RAGEL_PARSER)
ELSE(RAGEL_FOUND)

2
src/CMakeLists.txt

@ -306,7 +306,7 @@ ENDIF(WITH_LUA)
## Build parsers by using ragel...
RAGEL_PARSER(condition_parsers.rl)
RAGEL_PARSER(config_parser.rl)
RAGEL_PARSER(config_parser.rl -T0)
RAGEL_PARSER(http_request_parser.rl)
RAGEL_PARSER(url_parser.rl)

Loading…
Cancel
Save