-
Notifications
You must be signed in to change notification settings - Fork 505
/
CMakeLists.txt
162 lines (152 loc) · 3.86 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
project (katranserver-proj)
set (CMAKE_CXX_STANDARD 17)
# thrift cmake macro
find_program(THRIFT1 thrift1)
include (${CMAKE_PREFIX_PATH}/fbthrift/ThriftLibrary.cmake)
set(THRIFT_PREFIX "katran/if")
set(THRIFT_DIR ${CMAKE_BINARY_DIR}/thrift-out/${THRIFT_PREFIX})
file(MAKE_DIRECTORY ${THRIFT_DIR})
include_directories(${CMAKE_BINARY_DIR}/thrift-out)
thrift_object(
"katran" #file_name
"KatranService" #services
"cpp2" #language
"" #options
"${CMAKE_SOURCE_DIR}/example" #file_path
"${THRIFT_DIR}" #output_path
"${THRIFT_PREFIX}" #include_prefix
)
find_library(THRIFT thrift)
find_library(THRIFTCPP2 thriftcpp2)
find_library(THRIFTPROTOCOL thriftprotocol)
find_library(CRYPTO crypto)
find_library(EVENT libevent.a event)
find_library(EVENT_CORE libevent_core.a event_core)
find_library(DL dl)
find_library(SSL ssl)
find_library(LIBIBERTY libiberty.a iberty)
find_library(LIBWANGLE libwangle.a wangle)
find_library(LIBTHRIFT_CORE libthrift-core.a thrift-core)
find_library(LIBTHRIFTFROZEN2 libthriftfrozen2.a thriftfrozen2)
find_library(LIBCONCURRENCY libconcurrency.a concurrency)
find_library(LIBTRANSPORT libtransport.a transport)
find_library(LIBASYNC libasync.a async)
find_library(LIBPROTOCOL libprotocol.a protocol)
find_library(LIBGSS gssapi_krb5)
find_library(LIBLZ4 liblz4.so lz4)
find_library(LIBSNAPPY libsnappy.a snappy)
find_library(LIBZSTD libzstd.a zstd)
find_library(LIBBOOST_CONTEXT libboost_context.a boost_context)
find_library(LIBRE2 libre2.a re2)
find_library(LIBSODIUM libsodium.a libsodium)
find_library(LIBFIZZ libfizz.a libfizz)
add_library(simple_service_handler
KatranSimpleServiceHandler.cpp
KatranSimpleServiceHandler.h
$<TARGET_OBJECTS:katran-cpp2-obj>
)
target_link_libraries(simple_service_handler
katranlb
"Folly::folly"
"${THRIFTCPP2}"
)
add_library(simple_signal_handler
KatranSimpleServiceSignalHandler.cpp
KatranSimpleServiceSignalHandler.h
)
target_link_libraries(simple_signal_handler
"Folly::folly"
"${DL}"
"${EVENT}"
)
add_executable(simple_katran_server KatranSimpleServer.cpp)
target_link_libraries(simple_katran_server
"-Wl,--start-group"
"Folly::folly"
"${THRIFT}"
"${THRIFTCPP2}"
"${THRIFTPROTOCOL}"
"${LIBTHRIFT_CORE}"
"${LIBTHRIFTFROZEN2}"
"${LIBPROTOCOL}"
"${LIBTRANSPORT}"
"${LIBCONCURRENCY}"
"${LIBASYNC}"
"${LIBWANGLE}"
"${LIBSODIUM}"
"${LIBFIZZ}"
"${LIBGSS}"
"${LIBLZ4}"
"${LIBSNAPPY}"
"${BOOST_SYSTEM}"
"${LIBBOOST_CONTEXT}"
"${DL}"
"${EVENT_CORE}"
"libevent::libevent"
"${CRYPTO}"
"${SSL}"
"${LIBIBERTY}"
"${LIBDC}"
"${GFLAGS}"
"glog::glog"
"${PTHREAD}"
"${LIBZSTD}"
mac_helpers
simple_service_handler
simple_signal_handler
"-Wl,--end-group"
)
add_library(katran_client_lib
client/KatranSimpleClient.cpp
client/KatranSimpleClient.h
$<TARGET_OBJECTS:katran-cpp2-obj>
)
target_link_libraries(katran_client_lib
katranlb
"-Wl,--start-group"
"Folly::folly"
"${LIBASYNC}"
"${THRIFT}"
"${THRIFTCPP2}"
"${THRIFTPROTOCOL}"
"${LIBTHRIFT_CORE}"
"${LIBTHRIFTFROZEN2}"
"${LIBPROTOCOL}"
"${LIBTRANSPORT}"
"glog::glog"
"${LIBRE2}"
"-Wl,--end-group"
)
add_executable(simple_katran_client client/Main.cpp)
target_link_libraries(simple_katran_client
"-Wl,--start-group"
"Folly::folly"
"${LIBCONCURRENCY}"
"${LIBASYNC}"
"${THRIFT}"
"${THRIFTCPP2}"
"${THRIFTPROTOCOL}"
"${LIBTHRIFT_CORE}"
"${LIBTHRIFTFROZEN2}"
"${LIBPROTOCOL}"
"${LIBTRANSPORT}"
"${LIBWANGLE}"
"${LIBGSS}"
"${LIBLZ4}"
"${LIBSNAPPY}"
"${BOOST_SYSTEM}"
"${LIBBOOST_CONTEXT}"
"${DL}"
"${EVENT_CORE}"
"${EVENT}"
"${CRYPTO}"
"${SSL}"
"${LIBIBERTY}"
"${LIBDC}"
"${GFLAGS}"
"glog::glog"
"${PTHREAD}"
"${LIBZSTD}"
katran_client_lib
"-Wl,--end-group"
)