Permalink
Browse files

Move flex and bison package finding to the main root and check the ve…

…rsion of flex for the --header-file, really this is XHP which has this requirement
  • Loading branch information...
1 parent f88c396 commit 8688583dabd38ffcaacbb1f02a4c60959b1f3864 @scottmac scottmac committed Feb 21, 2010
Showing with 8 additions and 5 deletions.
  1. +8 −2 CMake/HPHPFindLibs.cmake
  2. +0 −3 src/CMakeLists.txt
View
@@ -157,13 +157,19 @@ FIND_LIBRARY (BINUTIL_LIB iberty)
FIND_LIBRARY (DL_LIB dl)
if (BFD_LIB STREQUAL "BFD_LIB-NOTFOUND")
- message(FATAL_ERROR "You need to install binutils")
+ message(FATAL_ERROR "You need to install binutils")
endif()
if (BINUTIL_LIB STREQUAL "BINUTIL_LIB-NOTFOUND")
- message(FATAL_ERROR "You need to install binutils")
+ message(FATAL_ERROR "You need to install binutils")
endif()
+find_package(BISON REQUIRED)
+find_package(FLEX REQUIRED)
+
+if (${FLEX_VERSION} VERSION_LESS 2.5.33)
+ message(FATAL_ERROR "Flex is too old, found ${FLEX_VERSION} and we need 2.5.33")
+endif()
include_directories(${HPHP_HOME}/src)
include_directories(${HPHP_HOME}/src/lib/system/gen)
View
@@ -73,9 +73,6 @@ endforeach(t ${HPHP_EXCLUDE_FILES})
#list(REMOVE_ITEM CXX_SOURCES "${CXX_NOOPT_SOURCES}")
-find_package(BISON REQUIRED)
-find_package(FLEX REQUIRED)
-
FLEX_TARGET(HphpScanner ${CMAKE_CURRENT_SOURCE_DIR}/cpp/eval/parser/hphp.x ${CMAKE_CURRENT_SOURCE_DIR}/cpp/eval/parser/lex.eval_.cpp COMPILE_FLAGS " -w -i -Peval_")
BISON_TARGET(HphpParser ${CMAKE_CURRENT_SOURCE_DIR}/cpp/eval/parser/hphp.y ${CMAKE_CURRENT_SOURCE_DIR}/cpp/eval/parser/hphp.tab.cpp COMPILE_FLAGS " -v -d -p eval_")
ADD_FLEX_BISON_DEPENDENCY(HphpScanner HphpParser)

0 comments on commit 8688583

Please sign in to comment.