From 6155dd2e7d6d59dab4ef6a547691b71f292a71a2 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sun, 15 Mar 2015 21:08:06 +0100 Subject: [PATCH] Ensure that flex meets the version requirements fixes #8750 --- lib/config/CMakeLists.txt | 4 ++++ tools/mkclass/CMakeLists.txt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/config/CMakeLists.txt b/lib/config/CMakeLists.txt index 52cbf5640ef..9b38981e559 100644 --- a/lib/config/CMakeLists.txt +++ b/lib/config/CMakeLists.txt @@ -18,6 +18,10 @@ find_package(BISON 2.3.0 REQUIRED) find_package(FLEX 2.5.31 REQUIRED) +if("${FLEX_VERSION}" VERSION_LESS "2.5.31") + message(SEND_ERROR "Your version of flex is too old. You can specify an alternative path using -DFLEX_EXECUTABLE=/path/to/flex") +endif() + bison_target(config_parser config_parser.yy ${CMAKE_CURRENT_BINARY_DIR}/config_parser.cc) set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/config_parser.cc PROPERTY EXCLUDE_UNITY_BUILD TRUE) diff --git a/tools/mkclass/CMakeLists.txt b/tools/mkclass/CMakeLists.txt index a94c6046d56..e5beb13b6f1 100644 --- a/tools/mkclass/CMakeLists.txt +++ b/tools/mkclass/CMakeLists.txt @@ -18,6 +18,10 @@ find_package(BISON 2.3.0 REQUIRED) find_package(FLEX 2.5.31 REQUIRED) +if("${FLEX_VERSION}" VERSION_LESS "2.5.31") + message(SEND_ERROR "Your version of flex is too old. You can specify an alternative path using -DFLEX_EXECUTABLE=/path/to/flex") +endif() + bison_target(class_parser class_parser.yy ${CMAKE_CURRENT_BINARY_DIR}/class_parser.cc) flex_target(class_lexer class_lexer.ll ${CMAKE_CURRENT_BINARY_DIR}/class_lexer.cc) add_flex_bison_dependency(class_lexer class_parser)