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
19 -Wl,-u,_register_libevent_server
20 -Wl,-all_load ${HHVM_WHOLE_ARCHIVE_LIBRARIES})
23 -Wl,-uregister_libevent_server
24 -Wl,--whole-archive ${HHVM_WHOLE_ARCHIVE_LIBRARIES} -Wl,--no-whole-archive)
28 -Wl,-uregister_libevent_server,-uregister_fastcgi_server
29 -Wl,--whole-archive ${HHVM_WHOLE_ARCHIVE_LIBRARIES} -Wl,--no-whole-archive)
32 set(HHVM_LINK_LIBRARIES
44 LIST(APPEND HHVM_LINK_LIBRARIES hphp_thrift)
45 LIST(APPEND HHVM_LINK_LIBRARIES hphp_proxygen)
48 if(NOT CMAKE_BUILD_TYPE)
49 set(CMAKE_BUILD_TYPE "Release")
52 IF(NOT DEFINED CMAKE_PREFIX_PATH)
53 message(STATUS "CMAKE_PREFIX_PATH was missing, proceeding anyway")
56 # Look for the chrpath tool so we can warn if it's not there
57 find_program(CHRPATH chrpath)
58 IF (CHRPATH STREQUAL "CHRPATH-NOTFOUND")
59 SET(FOUND_CHRPATH OFF)
60 message(WARNING "chrpath not found, rpath will not be stripped from installed binaries")
65 LIST(APPEND CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}")
68 if(EXISTS "/opt/local/var/macports/")
69 LIST (APPEND CMAKE_PREFIX_PATH "/opt/local")
70 LIST (APPEND CMAKE_LIBRARY_PATH "/opt/local/lib/x86_64")
75 include(HPHPFunctions)
78 add_definitions(-D_REENTRANT=1 -D_PTHREADS=1 -D__STDC_FORMAT_MACROS -DFOLLY_HAVE_WEAK_SYMBOLS=1)
81 add_definitions(-D_GNU_SOURCE)
84 if(${CMAKE_BUILD_TYPE} MATCHES "Release")
85 add_definitions(-DRELEASE=1)
86 add_definitions(-DNDEBUG)
87 message("Generating Release build")
89 add_definitions(-DDEBUG)
90 message("Generating DEBUG build")
94 add_definitions(-DDEBUG_MEMORY_LEAK=1)
98 add_definitions(-DDEBUG_APC_LEAK=1)
102 add_definitions(-DALWAYS_ASSERT=1)
106 add_definitions(-DHOTPROFILER=1)
109 if(EXECUTION_PROFILER)
110 add_definitions(-DEXECUTION_PROFILER=1)
113 if(ENABLE_FULL_SETLINE)
114 add_definitions(-DENABLE_FULL_SETLINE=1)
118 add_definitions(-DSKIP_USER_CHANGE=1)
122 # We have to be a little more permissive in some cases.
123 add_definitions(-fpermissive)
125 # Skip deprecation warnings in OpenSSL.
126 add_definitions(-DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_6)
128 # Just assume we have sched.h
129 add_definitions(-DFOLLY_HAVE_SCHED_H=1)
131 # Enable weak linking
132 add_definitions(-DMACOSX_DEPLOYMENT_TARGET=10.6)
136 add_definitions(-DENABLE_FASTCGI=1)
139 if(DISABLE_HARDWARE_COUNTERS)
140 add_definitions(-DNO_HARDWARE_COUNTERS=1)
143 # enable the OSS options if we have any
144 add_definitions(-DHPHP_OSS=1)
146 # later versions of binutils don't play well without automake
147 add_definitions(-DPACKAGE=hhvm -DPACKAGE_VERSION=Release)
149 include_directories(${HPHP_HOME}/hphp)
150 include_directories(${HPHP_HOME})