Drop unused tc_dump_helpers_addrs.txt file
[hiphop-php.git] / hphp / CMakeLists.txt
blobdd2148138cf6171182ad29e68641f034942ccf93
2 #   +----------------------------------------------------------------------+
3 #   | HipHop for PHP                                                       |
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 add_definitions("-DHHVM")
20 if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/facebook")
21   # I'm sorry, but facebook's internal repo has the top level dir stored inside
22   # of hphp/, so we need to pull that one in first if it exists
23   CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7 FATAL_ERROR)
24   get_filename_component(HPHP_HOME "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE)
25   set(ENABLE_EXTENSION_PGSQL OFF CACHE INTERNAL "" FORCE)
26   set(TP_DIR "${HPHP_HOME}/hphp/public_tld/third-party/")
27   set(TP_BUILD_DIR "${TP_DIR}")
28   set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/facebook/CMake"
29                         "${CMAKE_CURRENT_SOURCE_DIR}/public_tld/CMake"
30                         ${CMAKE_MODULE_PATH})
31 endif()
33 include(HHVMExtensionConfig)
34 # Before we do anything else, we'll configure the extensions,
35 # so that the defines take effect globally.
36 file(GLOB subdirs ${CMAKE_CURRENT_SOURCE_DIR}/runtime/ext/*)
37 foreach (dir ${subdirs})
38   if (IS_DIRECTORY ${dir})
39     if (EXISTS "${dir}/config.cmake")
40       set(HRE_CURRENT_EXT_PATH "${dir}")
41       include("${dir}/config.cmake")
42     endif()
43   endif()
44 endforeach()
45 HHVM_EXTENSION_RESOLVE_DEPENDENCIES()
47 if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/facebook")
48   include(FBTLD)
49 endif()
51 include(HPHPSetup)
52 include(HPHPFindLibs)
53 include(HHVMGenerateConfig)
54 HHVM_GENERATE_CONFIG("${CMAKE_CURRENT_BINARY_DIR}/util/hphp-config.h")
56 if (ENABLE_COTIRE)
57   include(cotire)
58   FIND_PATH(LIBC_INCLUDE_PATH stdlib.h)
60   # Detect the architecture-specific include directory
61   IF("${CMAKE_LIBRARY_ARCHITECTURE}" STREQUAL "")
62     # For CentOS/Red Hat where they store it directly in /usr/include
63     SET(ARCH_INCLUDE_PATH "${LIBC_INCLUDE_PATH}/bits")
64   ELSE()
65     FIND_PATH(ARCH_INCLUDE_PATH ${CMAKE_LIBRARY_ARCHITECTURE})
66     SET(ARCH_INCLUDE_PATH "${ARCH_INCLUDE_PATH}/${CMAKE_LIBRARY_ARCHITECTURE}")
67   ENDIF()
69   set_property(DIRECTORY
70     PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH
71       "${LIBC_INCLUDE_PATH}/stdlib.h"
72       "${LIBC_INCLUDE_PATH}/string.h"
73       "${LIBC_INCLUDE_PATH}/ansidecl.h"
74       "${LIBC_INCLUDE_PATH}/bfd.h"
75       "${LIBC_INCLUDE_PATH}/libelf.h"
76       "${LIBC_INCLUDE_PATH}/elf.h"
77       "${LIBC_INCLUDE_PATH}/gelf.h"
78       "${LIBC_INCLUDE_PATH}/resolv.h"
79       "${ARCH_INCLUDE_PATH}"
80       "${CCLIENT_INCLUDE_PATH}"
81       "${JEMALLOC_INCLUDE_DIR}/jemalloc"
82       "${ONIGURUMA_INCLUDE_DIR}/onigposix.h"
83       "${ONIGURUMA_INCLUDE_DIR}/oniguruma.h"
84       "${LIBPNG_INCLUDE_DIRS}/png.h"
85       "${LDAP_INCLUDE_DIR}/ldap.h"
86       "${LIBSQLITE3_INCLUDE_DIR}/sqlite3ext.h"
87       "${CMAKE_SOURCE_DIR}"
88       "${CMAKE_BINARY_DIR}")
90   # XED headers need to be wrapped in extern "C"
91   if (LibXed_INCLUDE_DIR)
92     set_property(DIRECTORY
93       APPEND PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH
94         "${LibXed_INCLUDE_DIR}")
95   endif()
96 endif()
98 # Only thing to do directly in tools is install this one script. Tools also has
99 # its own Makefile, so just do it here instead of dealing with moving that all
100 # around.
101 install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/tools/oss-repo-mode
102   RENAME hhvm-repo-mode
103   DESTINATION bin
104   COMPONENT dev)
106 add_definitions("-DUSE_CMAKE")
108 enable_language(ASM)
110 link_libraries(folly)
111 if (NOT PCRE_LIBRARY)
112   link_libraries(pcre)
113 endif()
115 add_subdirectory(tools/hfsort)
116 add_subdirectory(tools/version)
117 add_subdirectory(tools/tc-print)
119 add_subdirectory(compiler)
120 add_subdirectory(hack)
121 add_subdirectory(hhbbc)
122 add_subdirectory(neo)
123 add_subdirectory(parser)
125 add_subdirectory(runtime)
126 add_subdirectory(runtime/ext)
127 if (ENABLE_ZEND_COMPAT)
128   add_subdirectory(runtime/ext_zend_compat)
129 endif()
130 add_subdirectory(system)
131 add_subdirectory(util)
132 add_subdirectory(ppc64-asm)
133 add_subdirectory(vixl)
134 add_subdirectory(zend)
136 add_subdirectory(hhvm)
138 option(TEST_BIN "Create the HHVM test binary" OFF)
139 if (TEST_BIN)
140   add_subdirectory(test)
141 endif ()
143 add_subdirectory(tools/gdb)
145 # Keep this last
146 add_subdirectory(tools/hphpize)