forked from hhvm/hhvm-third-party
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
112 lines (96 loc) · 3.65 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#
# +----------------------------------------------------------------------+
# | HipHop for PHP |
# +----------------------------------------------------------------------+
# | Copyright (c) 2010 Facebook, Inc. (http://www.facebook.com) |
# | Copyright (c) 1997-2010 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 3.01 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available through the world-wide-web at the following url: |
# | http://www.php.net/license/3_01.txt |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | [email protected] so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
#
include(HPHPSetup)
include(FollySetup)
add_definitions("-DHHVM")
set(THIRD_PARTY_MODULES)
set(THIRD_PARTY_HEADERS)
list(APPEND THIRD_PARTY_MODULES
timelib
folly
wangle
)
if(ENABLE_FASTCGI)
list(APPEND THIRD_PARTY_MODULES proxygen)
list(APPEND THIRD_PARTY_MODULES thrift)
endif()
# Add bundled libafdt if the system one will not be used
if(NOT LIBAFDT_LIBRARY)
list(APPEND THIRD_PARTY_MODULES libafdt)
endif()
# Add bundled libmbfl if the system one will not be used
if(NOT LIBMBFL_LIBRARY)
list(APPEND THIRD_PARTY_MODULES libmbfl)
endif()
if(ENABLE_ASYNC_MYSQL)
find_package(RE2)
if(NOT RE2_LIBRARY)
message(STATUS "Building RE2 from third-party")
list(APPEND THIRD_PARTY_MODULES re2)
endif()
list(APPEND THIRD_PARTY_MODULES squangle)
list(APPEND THIRD_PARTY_MODULES webscalesqlclient)
endif()
if (ENABLE_MCROUTER)
list(APPEND THIRD_PARTY_MODULES mcrouter)
endif()
# Add bundled fastlz if the system one will not be used
if(NOT FASTLZ_LIBRARY)
list(APPEND THIRD_PARTY_MODULES fastlz)
endif()
# Add bundled libsqlite3 if the system one will not be used
if(NOT LIBSQLITE3_LIBRARY)
list(APPEND THIRD_PARTY_MODULES libsqlite3)
endif()
# Add bundled lz4 if the system one will not be used
if(NOT LZ4_LIBRARY)
list(APPEND THIRD_PARTY_MODULES lz4)
endif()
# Add bundled double-conversion if the system one will not be used
if(NOT DOUBLE_CONVERSION_LIBRARY)
list(APPEND THIRD_PARTY_MODULES double-conversion)
endif()
# Add bundled PCRE if the system one will not be used
if(NOT PCRE_LIBRARY)
list(APPEND THIRD_PARTY_MODULES pcre)
endif()
# Add bundled libzip if the system one will not be used
if(NOT LIBZIP_LIBRARY)
list(APPEND THIRD_PARTY_MODULES libzip)
endif()
function(TP_INSTALL_HEADERS TARGET SRCDIR DEST)
file(GLOB_RECURSE files "${SRCDIR}/*.h")
install(
CODE "INCLUDE(\"${HPHP_HOME}/CMake/HPHPFunctions.cmake\")
HHVM_INSTALL_HEADERS(${TARGET}
\"${CMAKE_CURRENT_SOURCE_DIR}/${SRCDIR}\"
\"\${CMAKE_INSTALL_PREFIX}/include/hphp/third-party/${DEST}\"
${files})"
COMPONENT dev)
endfunction()
foreach(MODULE ${THIRD_PARTY_MODULES})
add_subdirectory(${MODULE})
# Install headers here, rather than in the individual submodules, so that we
# can easily control the destination. Put them in include/hphp/third-party.
if(MODULE STREQUAL folly)
TP_INSTALL_HEADERS(folly folly/src/folly folly)
elseif(NOT DOUBLE_CONVERSION_LIBRARY AND MODULE STREQUAL double-conversion)
TP_INSTALL_HEADERS(double-conversion double-conversion/src/double-conversion double-conversion)
else()
TP_INSTALL_HEADERS(${MODULE} ${MODULE} ${MODULE})
endif()
endforeach()