2 # Build a DSO in dso_test, only to be used for testing
3 # on linux of zend extensions loaded dynamically through a DSO.
5 # See http://www.cmake.org/cmake/help/v3.0/command/add_custom_command.html
6 # See http://www.cmake.org/cmake/help/v3.0/command/add_custom_target.html
9 if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
10 # As we're generating cmake files (when calling hphpize), we can't do a
11 # standard out-of-source build.
13 # Also, as this is included from the root cmake, rather than added with
14 # add_directory(), the '_CURRENT' vars are set to the root dir, so not
16 set(SOURCE_DIR "${CMAKE_SOURCE_DIR}/hphp/test/dso_test")
21 "${SOURCE_DIR}/config.cmake"
24 FILE(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/hphp/test/dso_test")
25 FILE(COPY ${FILE_LIST} DESTINATION "${CMAKE_BINARY_DIR}/hphp/test/dso_test")
27 set(HPHPIZE_EXE "${CMAKE_BINARY_DIR}/hphp/tools/hphpize/hphpize")
28 set(HPHPIZE_CMAKE "${CMAKE_BINARY_DIR}/hphp/tools/hphpize/hphpize.cmake")
29 set(HPHPIZE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake")
32 DEPENDS dso_test.so hhvm
39 # The output from hphpize and cmake is just discarded;
40 # the presumption is that it has been debugged and "just works".
42 COMMAND chmod 755 ${HPHPIZE_EXE}
43 COMMAND HHVM_HPHPIZE_CMAKE=${HPHPIZE_CMAKE}
44 /bin/sh ${HPHPIZE_EXE} > /dev/null
45 COMMAND cmake -DHHVM_DSO_TEST_MODE=On . > /dev/null
49 WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/hphp/test/dso_test"
51 COMMENT "Making dso_test.so"
52 DEPENDS ${HPHPIZE_CMAKE} ${HPHPIZE_EXE}