diff options
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 82e77e4d..8622a958 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -167,7 +167,6 @@ endif () set(USE_SANITIZER FALSE) function(SANITIZER NAME FLAGS) if (${NAME}) - message("HERE ${NAME} ${FLAGS}") if (USE_SANITIZER) message(FATAL_ERROR "Only one sanitizer allowed") endif() @@ -181,8 +180,9 @@ SANITIZER(USE_MSAN "-fsanitize=memory") SANITIZER(USE_LSAN "-fsanitize=leak") SANITIZER(USE_UBSAN "-fsanitize=undefined -fno-sanitize-recover") -find_package(BISON 3.0) -if (RUN_BISON AND BISON_FOUND) +find_package(BISON) +if (RUN_BISON AND BISON_FOUND AND (NOT ${BISON_VERSION} VERSION_LESS "3.0")) + message(STATUS "Using generated bison parser") set(WAST_PARSER_GEN_CC ${WABT_BINARY_DIR}/wast-parser-gen.cc) BISON_TARGET(WAST_PARSER_GEN_CC ${WABT_SOURCE_DIR}/src/wast-parser.y @@ -190,6 +190,7 @@ if (RUN_BISON AND BISON_FOUND) COMPILE_FLAGS --defines=${WABT_BINARY_DIR}/wast-parser-gen.hh ) else () + message(STATUS "Using prebuilt bison parser") set(WAST_PARSER_GEN_CC src/prebuilt/wast-parser-gen.cc) include_directories(src/prebuilt) endif () @@ -205,8 +206,9 @@ if (COMPILER_IS_CLANG OR COMPILER_IS_GNU) endif () set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${WABT_SOURCE_DIR}/cmake) -find_package(RE2C 0.16) -if (RUN_RE2C AND RE2C_EXECUTABLE) +find_package(RE2C) +if (RUN_RE2C AND RE2C_EXECUTABLE AND (NOT ${RE2C_VERSION} VERSION_LESS "0.16")) + message(STATUS "Using generated re2c lexer") set(WAST_LEXER_CC ${WABT_SOURCE_DIR}/src/wast-lexer.cc) set(WAST_LEXER_GEN_CC ${WABT_BINARY_DIR}/wast-lexer-gen.cc) RE2C_TARGET( @@ -216,6 +218,7 @@ if (RUN_RE2C AND RE2C_EXECUTABLE) OPTIONS -bc8 ) else () + message(STATUS "Using prebuilt re2c lexer") set(WAST_LEXER_GEN_CC src/prebuilt/wast-lexer-gen.cc) endif () |