2 # +----------------------------------------------------------------------+
4 # +----------------------------------------------------------------------+
5 # | Copyright (c) 2010 Facebook, Inc. (http://www.facebook.com) |
6 # | Copyright (c) 1997-2010 The PHP Group |
7 # +----------------------------------------------------------------------+
8 # | This source file is subject to version 3.01 of the PHP license, |
9 # | that is bundled with this package in the file LICENSE, and is |
10 # | available through the world-wide-web at the following url: |
11 # | http://www.php.net/license/3_01.txt |
12 # | If you did not receive a copy of the PHP license and are unable to |
13 # | obtain it through the world-wide-web, please send a note to |
14 # | license@php.net so we can mail you a copy immediately. |
15 # +----------------------------------------------------------------------+
18 if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/facebook")
19 # I'm sorry, but facebook's internal repo has the top level dir stored inside
20 # of hphp/, so we need to pull that one in first if it exists
21 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7 FATAL_ERROR)
22 get_filename_component(HPHP_HOME "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE)
23 set(ENABLE_EXTENSION_PGSQL OFF CACHE INTERNAL "" FORCE)
24 set(TP_DIR "${HPHP_HOME}/hphp/public_tld/third-party/")
25 set(TP_BUILD_DIR "${TP_DIR}")
26 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/facebook/CMake"
27 "${CMAKE_CURRENT_SOURCE_DIR}/public_tld/CMake"
31 include(HHVMExtensionConfig)
32 # Before we do anything else, we'll configure the extensions,
33 # so that the defines take effect globally.
34 file(GLOB subdirs ${CMAKE_CURRENT_SOURCE_DIR}/runtime/ext/*)
35 foreach (dir ${subdirs})
36 if (IS_DIRECTORY ${dir})
37 if (EXISTS "${dir}/config.cmake")
38 set(HRE_CURRENT_EXT_PATH "${dir}")
39 include("${dir}/config.cmake")
43 HHVM_EXTENSION_RESOLVE_DEPENDENCIES()
45 if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/facebook")
51 include(HHVMGenerateConfig)
52 HHVM_GENERATE_CONFIG("${CMAKE_CURRENT_BINARY_DIR}/util/hphp-config.h")
56 FIND_PATH(LIBC_INCLUDE_PATH stdlib.h)
58 # Detect the architecture-specific include directory
59 IF("${CMAKE_LIBRARY_ARCHITECTURE}" STREQUAL "")
60 # For CentOS/Red Hat where they store it directly in /usr/include
61 SET(ARCH_INCLUDE_PATH "${LIBC_INCLUDE_PATH}/bits")
63 FIND_PATH(ARCH_INCLUDE_PATH ${CMAKE_LIBRARY_ARCHITECTURE})
64 SET(ARCH_INCLUDE_PATH "${ARCH_INCLUDE_PATH}/${CMAKE_LIBRARY_ARCHITECTURE}")
67 set_property(DIRECTORY
68 PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH
69 "${LIBC_INCLUDE_PATH}/stdlib.h"
70 "${LIBC_INCLUDE_PATH}/string.h"
71 "${LIBC_INCLUDE_PATH}/ansidecl.h"
72 "${LIBC_INCLUDE_PATH}/bfd.h"
73 "${LIBC_INCLUDE_PATH}/libelf.h"
74 "${LIBC_INCLUDE_PATH}/elf.h"
75 "${LIBC_INCLUDE_PATH}/gelf.h"
76 "${LIBC_INCLUDE_PATH}/resolv.h"
77 "${ARCH_INCLUDE_PATH}"
78 "${CCLIENT_INCLUDE_PATH}"
79 "${JEMALLOC_INCLUDE_DIR}/jemalloc"
80 "${ONIGURUMA_INCLUDE_DIR}/onigposix.h"
81 "${ONIGURUMA_INCLUDE_DIR}/oniguruma.h"
82 "${LIBPNG_INCLUDE_DIRS}/png.h"
83 "${LDAP_INCLUDE_DIR}/ldap.h"
84 "${LIBSQLITE3_INCLUDE_DIR}/sqlite3ext.h"
86 "${CMAKE_BINARY_DIR}")
88 # XED headers need to be wrapped in extern "C"
89 if (LibXed_INCLUDE_DIR)
90 set_property(DIRECTORY
91 APPEND PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH
92 "${LibXed_INCLUDE_DIR}")
96 # Only thing to do directly in tools is install this one script. Tools also has
97 # its own Makefile, so just do it here instead of dealing with moving that all
99 install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/tools/oss-repo-mode
100 RENAME hhvm-repo-mode
104 add_definitions("-DHHVM")
105 add_definitions("-DUSE_CMAKE")
109 add_subdirectory(tools/hfsort)
110 add_subdirectory(tools/version)
111 add_subdirectory(tools/tc-print)
113 add_subdirectory(compiler)
114 add_subdirectory(hack)
115 add_subdirectory(hhbbc)
116 add_subdirectory(neo)
117 add_subdirectory(parser)
119 add_subdirectory(runtime)
120 add_subdirectory(runtime/ext)
121 if (ENABLE_ZEND_COMPAT)
122 add_subdirectory(runtime/ext_zend_compat)
124 add_subdirectory(system)
125 add_subdirectory(util)
126 add_subdirectory(ppc64-asm)
127 add_subdirectory(vixl)
128 add_subdirectory(zend)
130 add_subdirectory(hhvm)
132 option(TEST_BIN "Create the HHVM test binary" OFF)
134 add_subdirectory(test)
137 add_subdirectory(tools/gdb)
140 add_subdirectory(tools/hphpize)