Use thread_local instead of HPHP::ThreadLocal in xdebug
[hiphop-php.git] / CMakeLists.txt
blob99e753a44a68416df0bfe0bce68ce03dc0f814b6
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7 FATAL_ERROR)
3 # This needs to be done before any languages are enabled or
4 # projects are created.
5 INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/CMake/VisualStudioToolset.cmake")
7 # includes
8 SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
9 include_directories(${CMAKE_CURRENT_BINARY_DIR})
11 # package information
12 SET(PACKAGE_NAME      "hhvm")
13 SET(PACKAGE_VERSION   "3.14.0-dev")
14 SET(PACKAGE_STRING    "${PACKAGE_NAME} ${PACKAGE_VERSION}")
15 SET(PACKAGE_TARNAME   "${PACKAGE_NAME}-${PACKAGE_VERSION}")
16 SET(PACKAGE_BUGREPORT "https://github.com/facebook/hhvm/issues")
18 PROJECT(${PACKAGE_NAME} C CXX ASM)
19 if (MSVC)
20   enable_language(ASM_MASM)
21 endif()
23 MARK_AS_ADVANCED(CLEAR CMAKE_INSTALL_PREFIX)
24 IF(APPLE)
25   # CMake really likes finding libraries inside OS X frameworks. This can
26   # create super unexpected results, such as the LDAP framework, where the
27   # ldap.h header there just consists of "#include <ldap.h>" -- obviously
28   # assuming /usr/include appears on the include path before that framework
29   # (which wasn't really supposed to be on the include path at all). This
30   # leads to a hilarious recursive include and general fireworks. Instead,
31   # tell CMake to search frameworks *last*, if it doesn't find something in
32   # /usr (or MacPorts/Homebrew).
33   SET(CMAKE_FIND_FRAMEWORK "LAST")
34   MARK_AS_ADVANCED(CMAKE_OSX_ARCHITECTURES
35     CMAKE_OSX_DEPLOYMENT_TARGET
36     CMAKE_OSX_SYSROOT)
37 ENDIF()
39 # Check architecture OS
40 IF(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
41   MESSAGE(FATAL_ERROR "HHVM requires a 64bit OS")
42 ENDIF()
44 # If available, configure CCache
45 find_program(CCACHE_FOUND ccache)
46 if(CCACHE_FOUND)
47   set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
48   set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
49   message(STATUS "Found ccache, enabling")
50 endif(CCACHE_FOUND)
52 # 3rd party library
53 IF(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/third-party/CMakeLists.txt")
54   MESSAGE(FATAL_ERROR "third-party/CMakeLists.txt missing. "
55                       "Try updating your submodule with:
56 rm -r third-party
57 git submodule update --init --recursive
59 ENDIF()
61 INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/CMake/HPHPFunctions.cmake")
62 INCLUDE(CheckFunctionExists)
64 SET(HPHP_HOME ${CMAKE_CURRENT_SOURCE_DIR})
65 SET(TP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third-party")
66 SET(TP_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/third-party")
68 include(MSVCDefaults)
70 ADD_SUBDIRECTORY(third-party)
71 ADD_SUBDIRECTORY(hphp)
73 # use GNU install dirs (e.g. lib64 instead of lib)
74 INCLUDE(GNUInstallDirs)
76 # modules / depends
77 FILE(GLOB HHVM_CMAKE_FILES "CMake/*.cmake")
78 INSTALL(
79   FILES ${HHVM_CMAKE_FILES}
80   DESTINATION "${CMAKE_INSTALL_LIBDIR}/hhvm/CMake"
81   COMPONENT dev)