Continue functorizing the parser
[hiphop-php.git] / hphp / system / CMakeLists.txt
blob5cbb0d9c28df1e123f6c6b5bc711395199e2453a
1 set(CXX_SOURCES "systemlib.cpp")
3 add_library(hphp_system STATIC ${CXX_SOURCES})
4 if (ENABLE_ASYNC_MYSQL)
5   add_dependencies(hphp_system webscalesqlclient)
6 endif ()
8 auto_sources(files "*.h" "${CMAKE_CURRENT_SOURCE_DIR}")
9 HHVM_PUBLIC_HEADERS(system ${files})
11 if (ENABLE_ZEND_COMPAT)
12   add_dependencies(hphp_ext_zend_compat hphp_system)
13 endif()
15 add_dependencies(hphp_runtime_static hphp_system)
16 add_dependencies(hphp_runtime_ext hphp_system)
17 add_dependencies(hphp_analysis hphp_system)
19 FILE(STRINGS "php.txt" SYSTEMLIB_CLASSES)
20 set(SYSTEMLIB_SRCS)
21 set(SYSTEMLIB_SRCS_STR)
22 foreach(cls ${SYSTEMLIB_CLASSES})
23   STRING(REGEX REPLACE "[ \t]*#.*" "" cls "${cls}")
24   if (NOT "${cls}" STREQUAL "")
25     list(APPEND SYSTEMLIB_SRCS "../../${cls}")
26     set(SYSTEMLIB_SRCS_STR "${SYSTEMLIB_SRCS_STR} ${cls}")
27   endif()
28 endforeach()
30 add_custom_command(
31   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/systemlib.php
32   DEPENDS "php.txt" ${SYSTEMLIB_SRCS}
33   COMMAND "INSTALL_DIR=${CMAKE_CURRENT_BINARY_DIR}"
34           "FBCODE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/../.."
35           "${CMAKE_CURRENT_SOURCE_DIR}/make_systemlib.sh"
36           "--install_dir=${CMAKE_CURRENT_BINARY_DIR}"
37           "--fbcode_dir=${CMAKE_CURRENT_SOURCE_DIR}/.."
38           "${SYSTEMLIB_SRCS_STR}"
39   COMMENT "Generating systemlib.php")
41 add_custom_target(
42   systemlib
43   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/systemlib.php)