d776975c82
This reverts commit 8bf8e13796.
Not behaving as it's supposed to. Revert until I can figure that out.
62 linhas
2.0 KiB
CMake
62 linhas
2.0 KiB
CMake
option(ENABLE_ZEND_COMPAT "Enable Zend source compatibility (beta)" OFF)
|
|
|
|
set(ZEND_COMPAT_PROJECTS)
|
|
set(ZEND_COMPAT_BUILD_DIRS)
|
|
set(ZEND_COMPAT_EXCLUDE_IDLS)
|
|
set(ZEND_COMPAT_LINK_LIBRARIES)
|
|
|
|
# Look for projects
|
|
set(EZC_DIR "${HPHP_HOME}/hphp/runtime/ext_zend_compat/")
|
|
file(GLOB ezc_projects RELATIVE ${EZC_DIR} "${EZC_DIR}/*")
|
|
foreach(ezc_project ${ezc_projects})
|
|
get_filename_component(ezc_name ${ezc_project} NAME)
|
|
if ((NOT ${ezc_name} STREQUAL "php-src") AND (IS_DIRECTORY "${EZC_DIR}/${ezc_name}"))
|
|
list(APPEND ZEND_COMPAT_PROJECTS ${ezc_name})
|
|
endif()
|
|
endforeach()
|
|
|
|
if (ENABLE_ZEND_COMPAT)
|
|
foreach(ezc_project ${ZEND_COMPAT_PROJECTS})
|
|
if (${ezc_project} STREQUAL "yaml")
|
|
find_package(LibYaml)
|
|
if (LibYaml_INCLUDE_DIRS)
|
|
list(APPEND ZEND_COMPAT_BUILD_DIRS "${EZC_DIR}/yaml")
|
|
include_directories(${LibYaml_INCLUDE_DIRS})
|
|
list(APPEND ZEND_COMPAT_LINK_LIBRARIES ${LibYaml_LIBRARIES})
|
|
else()
|
|
list(APPEND ZEND_COMPAT_EXCLUDE_IDLS "yaml.idl.json")
|
|
endif()
|
|
elseif (${ezc_project} STREQUAL "mongo")
|
|
include_directories("${EZC_DIR}/mongo/mcon")
|
|
list(APPEND ZEND_COMPAT_BUILD_DIRS "${EZC_DIR}/mongo")
|
|
else()
|
|
list(APPEND ZEND_COMPAT_BUILD_DIRS "${EZC_DIR}/${ezc_project}")
|
|
endif()
|
|
endforeach()
|
|
|
|
if (ZEND_COMPAT_BUILD_DIRS)
|
|
list(APPEND ZEND_COMPAT_BUILD_DIRS "${EZC_DIR}/php-src")
|
|
include_directories("${EZC_DIR}/php-src")
|
|
include_directories("${EZC_DIR}/php-src/main")
|
|
include_directories("${EZC_DIR}/php-src/Zend")
|
|
include_directories("${EZC_DIR}/php-src/TSRM")
|
|
endif()
|
|
else()
|
|
foreach(ezc_project ${ZEND_COMPAT_PROJECTS})
|
|
list(APPEND ZEND_COMPAT_EXCLUDE_IDLS "${ezc_project}.idl.json")
|
|
endforeach()
|
|
endif()
|
|
|
|
# This is really ugly, but cmake's list(FIND)
|
|
# doesn't entirely work the way it should
|
|
macro(ZEND_COMPAT_STRIP_IDLS IDLS)
|
|
foreach(idl ${${IDLS}})
|
|
get_filename_component(idl_name ${idl} NAME)
|
|
foreach(f ${ARGV})
|
|
if (${idl_name} STREQUAL ${f})
|
|
list(REMOVE_ITEM ${IDLS} ${idl})
|
|
endif()
|
|
endforeach()
|
|
endforeach()
|
|
endmacro()
|