-
Notifications
You must be signed in to change notification settings - Fork 376
/
CMakeLists.txt
238 lines (200 loc) · 8.72 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
add_compile_flags("C;CXX" "-Wno-unused" "-Wno-unused-result")
if(CC_HAS_WNO_TAUTOLOGICAL_COMPARE)
add_compile_flags("C;CXX" "-Wno-tautological-compare")
endif()
file(GLOB all_sources *.c *.cc)
set_source_files_compile_flags(${all_sources})
include_directories(${PROJECT_SOURCE_DIR}/src)
include_directories(${PROJECT_BINARY_DIR}/src)
include_directories(${PROJECT_SOURCE_DIR}/src/box)
include_directories(${CMAKE_SOURCE_DIR}/third_party)
include_directories(${ICU_INCLUDE_DIRS})
include_directories(${CURL_INCLUDE_DIRS})
add_library(unit STATIC unit.c)
add_executable(heap.test heap.c)
target_link_libraries(heap.test unit)
add_executable(heap_iterator.test heap_iterator.c)
target_link_libraries(heap_iterator.test unit)
add_executable(stailq.test stailq.c)
target_link_libraries(stailq.test unit)
add_executable(uri.test uri.c unit.c)
target_link_libraries(uri.test uri unit)
add_executable(queue.test queue.c)
add_executable(mhash.test mhash.c)
target_link_libraries(mhash.test unit)
add_executable(mhash_bytemap.test mhash_bytemap.c)
target_link_libraries(mhash_bytemap.test unit)
add_executable(rope_basic.test rope_basic.c)
target_link_libraries(rope_basic.test salad)
add_executable(rope_avl.test rope_avl.c)
target_link_libraries(rope_avl.test salad)
add_executable(rope_stress.test rope_stress.c)
target_link_libraries(rope_stress.test salad)
add_executable(rope.test rope.c)
target_link_libraries(rope.test salad)
add_executable(int96.test int96.cc)
add_executable(bit.test bit.c bit.c)
target_link_libraries(bit.test bit)
add_executable(bitset_basic.test bitset_basic.c)
target_link_libraries(bitset_basic.test bitset)
add_executable(bitset_iterator.test bitset_iterator.c)
target_link_libraries(bitset_iterator.test bitset)
add_executable(bitset_index.test bitset_index.c)
target_link_libraries(bitset_index.test bitset)
add_executable(base64.test base64.c)
target_link_libraries(base64.test misc unit)
add_executable(uuid.test uuid.c)
target_link_libraries(uuid.test uuid unit)
add_executable(bps_tree.test bps_tree.cc)
target_link_libraries(bps_tree.test small misc)
add_executable(bps_tree_iterator.test bps_tree_iterator.cc)
target_link_libraries(bps_tree_iterator.test small misc)
add_executable(rtree.test rtree.cc)
target_link_libraries(rtree.test salad small)
add_executable(rtree_iterator.test rtree_iterator.cc)
target_link_libraries(rtree_iterator.test salad small)
add_executable(rtree_multidim.test rtree_multidim.cc)
target_link_libraries(rtree_multidim.test salad small)
add_executable(light.test light.cc)
target_link_libraries(light.test small)
add_executable(bloom.test bloom.cc)
target_link_libraries(bloom.test salad)
add_executable(vclock.test vclock.cc)
target_link_libraries(vclock.test vclock unit)
add_executable(xrow.test xrow.cc)
target_link_libraries(xrow.test xrow unit rt)
add_executable(decimal.test decimal.c)
target_link_libraries(decimal.test core unit)
add_executable(fiber.test fiber.cc)
set_source_files_properties(fiber.cc PROPERTIES COMPILE_FLAGS -O0)
target_link_libraries(fiber.test core unit rt)
if (NOT ENABLE_GCOV)
# This test is known to be broken with GCOV
add_executable(guard.test guard.cc)
target_link_libraries(guard.test core unit rt)
endif ()
add_executable(fiber_stress.test fiber_stress.cc)
target_link_libraries(fiber_stress.test core rt)
add_executable(fiber_cond.test fiber_cond.c unit.c)
target_link_libraries(fiber_cond.test core rt)
add_executable(fiber_channel.test fiber_channel.cc unit.c)
target_link_libraries(fiber_channel.test core rt)
add_executable(fiber_channel_stress.test fiber_channel_stress.cc)
target_link_libraries(fiber_channel_stress.test core rt)
add_executable(cbus_stress.test cbus_stress.c)
target_link_libraries(cbus_stress.test core stat rt)
add_executable(cbus.test cbus.c)
target_link_libraries(cbus.test core unit stat rt)
add_executable(coio.test coio.cc)
target_link_libraries(coio.test core eio bit uri unit rt)
if (ENABLE_BUNDLED_MSGPUCK)
set(MSGPUCK_DIR ${PROJECT_SOURCE_DIR}/src/lib/msgpuck/)
add_executable(msgpack.test
${MSGPUCK_DIR}/test/msgpuck.c
${MSGPUCK_DIR}/test/test.c)
set_source_files_properties(
${MSGPUCK_DIR}/test/msgpuck.c
${MSGPUCK_DIR}/test/test.c
PROPERTIES COMPILE_FLAGS "-I${MSGPUCK_DIR}/test")
target_link_libraries(msgpack.test ${MSGPUCK_LIBRARIES})
endif ()
add_executable(scramble.test scramble.c)
target_link_libraries(scramble.test scramble rt)
add_executable(guava.test guava.c)
target_link_libraries(guava.test salad small)
add_executable(find_path.test find_path.c
${CMAKE_SOURCE_DIR}/src/find_path.c
)
add_executable(reflection_c.test reflection_c.c unit.c
${CMAKE_SOURCE_DIR}/src/lib/core/reflection.c)
add_executable(reflection_cxx.test reflection_cxx.cc unit.c
${CMAKE_SOURCE_DIR}/src/lib/core/reflection.c)
add_executable(csv.test csv.c)
target_link_libraries(csv.test csv)
add_executable(json.test json.c)
target_link_libraries(json.test json unit ${ICU_LIBRARIES})
add_executable(rmean.test rmean.cc)
target_link_libraries(rmean.test stat unit rt)
add_executable(histogram.test histogram.c)
target_link_libraries(histogram.test stat unit)
add_executable(ratelimit.test ratelimit.c)
target_link_libraries(ratelimit.test unit)
add_executable(luaT_tuple_new.test luaT_tuple_new.c)
target_link_libraries(luaT_tuple_new.test unit box server core misc
${CURL_LIBRARIES} ${LIBYAML_LIBRARIES} ${READLINE_LIBRARIES}
${ICU_LIBRARIES} ${LUAJIT_LIBRARIES})
add_executable(luaL_iterator.test luaL_iterator.c)
target_link_libraries(luaL_iterator.test unit server coll core misc
${CURL_LIBRARIES} ${LIBYAML_LIBRARIES} ${READLINE_LIBRARIES}
${ICU_LIBRARIES} ${LUAJIT_LIBRARIES} dl)
add_executable(say.test say.c)
target_link_libraries(say.test core unit rt)
set(ITERATOR_TEST_SOURCES
vy_iterators_helper.c
${PROJECT_SOURCE_DIR}/src/box/vy_stmt.c
${PROJECT_SOURCE_DIR}/src/box/vy_upsert.c
${PROJECT_SOURCE_DIR}/src/box/vy_history.c
${PROJECT_SOURCE_DIR}/src/box/vy_mem.c
${PROJECT_SOURCE_DIR}/src/box/vy_cache.c)
set(ITERATOR_TEST_LIBS core tuple xrow unit)
add_executable(vy_mem.test vy_mem.c ${ITERATOR_TEST_SOURCES})
target_link_libraries(vy_mem.test ${ITERATOR_TEST_LIBS} dl rt)
add_executable(vy_point_lookup.test
vy_point_lookup.c
vy_iterators_helper.c
vy_log_stub.c
${PROJECT_SOURCE_DIR}/src/box/vy_point_lookup.c
${PROJECT_SOURCE_DIR}/src/box/vy_write_iterator.c
${PROJECT_SOURCE_DIR}/src/box/vy_stmt.c
${PROJECT_SOURCE_DIR}/src/box/vy_mem.c
${PROJECT_SOURCE_DIR}/src/box/vy_run.c
${PROJECT_SOURCE_DIR}/src/box/vy_range.c
${PROJECT_SOURCE_DIR}/src/box/vy_tx.c
${PROJECT_SOURCE_DIR}/src/box/vy_read_set.c
${PROJECT_SOURCE_DIR}/src/box/vy_upsert.c
${PROJECT_SOURCE_DIR}/src/box/vy_history.c
${PROJECT_SOURCE_DIR}/src/box/vy_lsm.c
${PROJECT_SOURCE_DIR}/src/box/vy_cache.c
${PROJECT_SOURCE_DIR}/src/box/index_def.c
${PROJECT_SOURCE_DIR}/src/box/schema_def.c
${PROJECT_SOURCE_DIR}/src/box/identifier.c
)
target_link_libraries(vy_point_lookup.test core tuple xrow xlog unit dl rt)
add_executable(column_mask.test
column_mask.c)
target_link_libraries(column_mask.test tuple unit rt)
add_executable(vy_write_iterator.test
vy_write_iterator.c
${PROJECT_SOURCE_DIR}/src/box/vy_run.c
${PROJECT_SOURCE_DIR}/src/box/vy_upsert.c
${PROJECT_SOURCE_DIR}/src/box/vy_write_iterator.c
${ITERATOR_TEST_SOURCES}
)
target_link_libraries(vy_write_iterator.test xlog ${ITERATOR_TEST_LIBS} dl rt)
add_executable(vy_cache.test vy_cache.c ${ITERATOR_TEST_SOURCES})
target_link_libraries(vy_cache.test ${ITERATOR_TEST_LIBS} dl rt)
add_executable(coll.test coll.cpp)
target_link_libraries(coll.test coll unit misc dl rt)
add_executable(tuple_bigref.test tuple_bigref.c)
target_link_libraries(tuple_bigref.test tuple unit rt)
add_executable(checkpoint_schedule.test
checkpoint_schedule.c
${PROJECT_SOURCE_DIR}/src/box/checkpoint_schedule.c
)
target_link_libraries(checkpoint_schedule.test m unit)
add_executable(sio.test sio.c)
target_link_libraries(sio.test unit core rt)
add_executable(crypto.test crypto.c)
target_link_libraries(crypto.test crypto unit rt)
add_executable(swim.test swim.c swim_test_transport.c swim_test_ev.c
swim_test_utils.c ${PROJECT_SOURCE_DIR}/src/version.c)
target_link_libraries(swim.test unit swim rt)
add_executable(swim_proto.test swim_proto.c swim_test_transport.c swim_test_ev.c
swim_test_utils.c ${PROJECT_SOURCE_DIR}/src/version.c)
target_link_libraries(swim_proto.test unit swim rt)
add_executable(swim_errinj.test swim_errinj.c swim_test_transport.c
swim_test_ev.c swim_test_utils.c
${PROJECT_SOURCE_DIR}/src/version.c)
target_link_libraries(swim_errinj.test unit swim rt)
add_executable(merger.test merger.test.c)
target_link_libraries(merger.test unit core box)