3 # Do this until cmake has a define for ARMv8
4 INCLUDE(CheckCXXSourceCompiles)
5 CHECK_CXX_SOURCE_COMPILES("
9 int main() { return 0; }" IS_AARCH64)
11 set(HHVM_WHOLE_ARCHIVE_LIBRARIES
16 if (ENABLE_ZEND_COMPAT)
17 add_definitions("-DENABLE_ZEND_COMPAT=1")
18 list(APPEND HHVM_WHOLE_ARCHIVE_LIBRARIES hphp_ext_zend_compat)
24 -Wl,-u,_register_fastcgi_server
25 -Wl,-all_load ${HHVM_WHOLE_ARCHIVE_LIBRARIES})
28 -Wl,--whole-archive ${HHVM_WHOLE_ARCHIVE_LIBRARIES} -Wl,--no-whole-archive)
32 -Wl,-uregister_libevent_server,-uregister_fastcgi_server
33 -Wl,--whole-archive ${HHVM_WHOLE_ARCHIVE_LIBRARIES} -Wl,--no-whole-archive)
36 set(HHVM_LINK_LIBRARIES
48 LIST(APPEND HHVM_LINK_LIBRARIES hphp_thrift)
49 LIST(APPEND HHVM_LINK_LIBRARIES hphp_proxygen)
52 if(NOT CMAKE_BUILD_TYPE)
53 set(CMAKE_BUILD_TYPE "Release")
54 message(STATUS "Build type not specified: cmake build type Release.")
57 # Look for the chrpath tool so we can warn if it's not there
58 SET(FOUND_CHRPATH OFF)
59 IF(UNIX AND NOT APPLE)
60 find_program(CHRPATH chrpath)
61 IF (NOT CHRPATH STREQUAL "CHRPATH-NOTFOUND")
64 ENDIF(UNIX AND NOT APPLE)
66 LIST(APPEND CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}")
69 if(EXISTS "/opt/local/var/macports/")
70 LIST (APPEND CMAKE_PREFIX_PATH "/opt/local")
71 LIST (APPEND CMAKE_LIBRARY_PATH "/opt/local/lib/x86_64")
76 include(HPHPFunctions)
79 add_definitions(-D_REENTRANT=1 -D_PTHREADS=1 -D__STDC_FORMAT_MACROS -DFOLLY_HAVE_WEAK_SYMBOLS=1)
82 add_definitions(-D_GNU_SOURCE)
85 if(${CMAKE_BUILD_TYPE} MATCHES "Release")
86 add_definitions(-DRELEASE=1)
87 add_definitions(-DNDEBUG)
88 message("Generating Release build")
90 add_definitions(-DDEBUG)
91 message("Generating DEBUG build")
95 add_definitions(-DDEBUG_MEMORY_LEAK=1)
99 add_definitions(-DDEBUG_APC_LEAK=1)
103 add_definitions(-DALWAYS_ASSERT=1)
107 add_definitions(-DHOTPROFILER=1)
110 if(EXECUTION_PROFILER)
111 add_definitions(-DEXECUTION_PROFILER=1)
114 if(ENABLE_FULL_SETLINE)
115 add_definitions(-DENABLE_FULL_SETLINE=1)
119 add_definitions(-DSKIP_USER_CHANGE=1)
123 add_definitions(-DUSE_TRACE=1)
127 # We have to be a little more permissive in some cases.
128 add_definitions(-fpermissive)
130 # Skip deprecation warnings in OpenSSL.
131 add_definitions(-DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_6)
133 # Just assume we have sched.h
134 add_definitions(-DFOLLY_HAVE_SCHED_H=1)
136 # Enable weak linking
137 add_definitions(-DMACOSX_DEPLOYMENT_TARGET=10.6)
141 add_definitions(-DENABLE_FASTCGI=1)
144 if(DISABLE_HARDWARE_COUNTERS)
145 add_definitions(-DNO_HARDWARE_COUNTERS=1)
149 # Allows a packed tv build
150 add_definitions(-DPACKED_TV=1)
153 # enable the OSS options if we have any
154 add_definitions(-DHPHP_OSS=1)
156 # later versions of binutils don't play well without automake
157 add_definitions(-DPACKAGE=hhvm -DPACKAGE_VERSION=Release)
159 if (NOT LIBSQLITE3_LIBRARY)
160 include_directories("${TP_DIR}/libsqlite3")
163 if (NOT DOUBLE_CONVERSION_LIBRARY)
164 include_directories("${TP_DIR}/double-conversion/src")
168 include_directories("${TP_DIR}/lz4")
171 if (NOT LIBZIP_INCLUDE_DIR_ZIP)
172 include_directories("${TP_DIR}/libzip")
175 include_directories("${TP_DIR}/fastlz")
176 include_directories("${TP_DIR}/timelib")
177 include_directories("${TP_DIR}/libafdt/src")
178 include_directories("${TP_DIR}/libmbfl")
179 include_directories("${TP_DIR}/libmbfl/mbfl")
180 include_directories("${TP_DIR}/libmbfl/filter")
181 include_directories("${TP_DIR}/folly")
182 include_directories(${TP_DIR})
184 include_directories(${HPHP_HOME}/hphp)
185 include_directories(${HPHP_HOME})