-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
473 lines (429 loc) · 12 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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
cmake_minimum_required(VERSION 2.8)
project(libport)
enable_language(ASM)
find_package(qibuild)
# Add a simple test:
enable_testing()
qi_sanitize_compile_flags(HIDDEN_SYMBOLS)
if (APPLE)
# Workaround clang bug http://llvm.org/bugs/show_bug.cgi?id=14116
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O1")
endif()
set(LIBPORT_COMPILATION_MODE_SPEED OFF)
set(LIBPORT_COMPILATION_MODE_DEBUG OFF)
set(LIBPORT_COMPILATION_MODE_SPACE OFF)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set(LIBPORT_COMPILATION_MODE_SPEED ON)
endif()
if (CMAKE_BUILD_TYPE STREQUAL Debug)
set(LIBPORT_COMPILATION_MODE_DEBUG ON)
endif()
if (CMAKE_BUILD_TYPE STREQUAL MinSizeRel)
set(LIBPORT_COMPILATION_MODE_SPACE ON)
endif()
find_path(LIBPORT_HAVE_XLOCALE_H xlocale.h)
qi_create_config_h(CONFIG_H
include/libport/config.h.in
libport/config.h
)
add_definitions(-D_USE_MATH_DEFINES)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/sched/libcoroutine)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
find_program(_python_executable
NAMES python2 python python.exe
NO_CMAKE_FIND_ROOT_PATH)
if (NOT _python_executable)
qi_error("needs python executable in PATH")
endif()
qi_generate_header(
${CMAKE_CURRENT_BINARY_DIR}/include/libport/format.hh
SRC include/libport/format.hh.gen
COMMAND ${_python_executable} ${CMAKE_CURRENT_SOURCE_DIR}/include/libport/format.hh.gen > ${CMAKE_CURRENT_BINARY_DIR}/include/libport/format.hh
)
set(PORT_SOURCES
lib/libport/asio-impl.hxx
lib/libport/asio-ssl.cc
lib/libport/asio.cc
lib/libport/backtrace.cc
lib/libport/base64.cc
lib/libport/buffer-stream.cc
lib/libport/cli.cc
lib/libport/csignal.cc
lib/libport/cstdio.cc
lib/libport/cstdlib.cc
lib/libport/cstring.cc
lib/libport/ctime.cc
lib/libport/damerau-levenshtein-distance.cc
lib/libport/debug.cc
lib/libport/deref.cc
lib/libport/dirent.cc
lib/libport/echo.cc
lib/libport/escape.cc
lib/libport/fd-stream.cc
lib/libport/file-library.cc
lib/libport/file-system.cc
lib/libport/fnmatch.cc
lib/libport/format.cc
lib/libport/hmac-sha1.cc
lib/libport/indent.cc
lib/libport/input-arguments.cc
lib/libport/io-stream.cc
lib/libport/ip-semaphore.cc
lib/libport/locale.cc
lib/libport/markup-ostream.cc
lib/libport/option-parser.cc
lib/libport/package-info.cc
lib/libport/path.cc
lib/libport/pid-file.cc
lib/libport/program-name.cc
lib/libport/read-stdin.cc
lib/libport/sched.cc
lib/libport/semaphore-rpl.cc
lib/libport/semaphore.cc
lib/libport/symbol.cc
lib/libport/synchronizer.cc
lib/libport/sys/utsname.cc
lib/libport/sysexits.cc
lib/libport/thread-pool.cc
lib/libport/timer.cc
lib/libport/tokenizer.cc
lib/libport/type-info.cc
lib/libport/ufloat.cc
lib/libport/umatrix.cc
lib/libport/unique-pointer.cc
lib/libport/unistd.cc
lib/libport/utime.cc
lib/libport/uvector.cc
lib/libport/version.cc
lib/libport/xalloc.cc
lib/libport/xlocale.cc
lib/libport/xltdl.cc
)
set(PORT_HEADERS
${CMAKE_CURRENT_BINARY_DIR}/include/libport/format.hh
include/libport/deref.hh
include/libport/synchronizer.hh
include/libport/timer.hxx
include/libport/cstdlib
include/libport/base64.hh
include/libport/symbol.hh
include/libport/instance-tracker.hh
include/libport/buffer-stream.hh
include/libport/cassert
include/libport/io-stream.hh
include/libport/file-system.hh
include/libport/cctype
include/libport/symbol.hxx
include/libport/boost-error.hh
include/libport/thread.hh
include/libport/escape.hxx
include/libport/hash.hh
include/libport/bind.hh
include/libport/detect-win32.h
include/libport/compilation.hh
include/libport/xlocale.hh
include/libport/locale.hxx
include/libport/uvector.hh
include/libport/ref-counted.hh
include/libport/cstdlib.hxx
include/libport/asio.hxx
include/libport/foreach.hh
include/libport/hierarchy.hh
include/libport/file-library.hh
include/libport/local-data.hxx
include/libport/pair.hxx
include/libport/exception.hh
include/libport/boost-error.hxx
include/libport/network.h
include/libport/unit-test.hh
include/libport/containers.hh
include/libport/thread-data.hh
include/libport/sched.hh
include/libport/local.mk
include/libport/debug.hxx
include/libport/exception.hxx
include/libport/ulong-fixed-point.hh
include/libport/map.hh
include/libport/intrusive-ptr.hxx
include/libport/throw-exception.hh
${CMAKE_CURRENT_BINARY_DIR}/include/libport/config.h
include/libport/pid-file.hh
include/libport/singleton-ptr.hh
include/libport/synchronizer.hxx
include/libport/intrusive-ptr.hh
include/libport/allocator-static.hh
include/libport/ref-counted.hxx
include/libport/destructible.hh
include/libport/cmath
include/libport/tr1/type_traits
include/libport/system-warning-push.hh
include/libport/bench.hh
include/libport/path.hxx
include/libport/xltdl.hh
include/libport/echo.hxx
include/libport/hmac-sha1.hh
include/libport/option-parser.hxx
include/libport/pod-cast.hxx
include/libport/local-data.hh
include/libport/ufloat.hh
include/libport/indent.hh
include/libport/valgrind.hh
include/libport/lexical-cast.hh
include/libport/xalloc.hh
include/libport/ull-fixed-point.hh
include/libport/sysexits.hh
include/libport/escape.hh
include/libport/iostream
include/libport/timer.hh
include/libport/fd-stream.hh
include/libport/attributes.hh
include/libport/pair.hh
include/libport/smart-allocated.hxx
include/libport/reserved-vector.hh
include/libport/time.hxx
include/libport/read-stdin.hh
include/libport/thread-pool.hh
include/libport/program-name.hh
include/libport/path.hh
include/libport/unique-pointer.hxx
include/libport/allocator-static.hxx
include/libport/locale.hh
include/libport/algorithm
include/libport/unistd.h
include/libport/thread.hxx
include/libport/deref.hxx
include/libport/format.hh.gen
include/libport/compiler-section.hh
include/libport/semaphore.hh
include/libport/backtrace.hxx
include/libport/cctype.hxx
include/libport/select-const.hh
include/libport/separator.hh
include/libport/csignal
include/libport/markup-ostream.hh
include/libport/type-info.hh
include/libport/version.hh
include/libport/atomic.hh
include/libport/statistics.hxx
include/libport/weak-ptr.hh
include/libport/utime.hh
include/libport/cli.hxx
include/libport/fwd.hh
include/libport/damerau-levenshtein-distance.hh
include/libport/debug.hh
include/libport/utime.hxx
include/libport/file-library.hxx
include/libport/option-parser.hh
include/libport/lockable.hxx
include/libport/fifo.hxx
include/libport/cmath.hxx
include/libport/finally.hxx
include/libport/meta.hh
include/libport/fcntl.h
include/libport/fnmatch.h
include/libport/range.hxx
include/libport/map.hxx
include/libport/windows.hh
include/libport/cast.hh
include/libport/statistics.hh
include/libport/input-arguments.hxx
include/libport/select-ref.hh
include/libport/typelist.hh
include/libport/cstring.hxx
include/libport/instance-tracker.hxx
include/libport/pod-cast.hh
include/libport/time.hh
include/libport/warning-pop.hh
include/libport/condition.hh
include/libport/visitor.hh
include/libport/cast.hxx
include/libport/semaphore.hxx
include/libport/sstream.hxx
include/libport/ctime
include/libport/smart-allocated.hh
include/libport/xltdl.hxx
include/libport/compiler.hh
include/libport/singleton-ptr.hxx
include/libport/tokenizer.hh
include/libport/finally.hh
include/libport/range.hh
include/libport/algorithm.hxx
include/libport/pthread.h
include/libport/weak-ptr.hxx
include/libport/vector.hh
include/libport/ip-semaphore.hh
include/libport/destructible.hxx
include/libport/specific-ptr.hxx
include/libport/fifo.hh
include/libport/ufloat.h
include/libport/cerrno
include/libport/pthread.hxx
include/libport/errors.hh
include/libport/fnmatch.hxx
include/libport/warning-push.hh
include/libport/cli.hh
include/libport/uffloat.hh
include/libport/semaphore.h
include/libport/echo.hh
include/libport/specific-ptr.hh
include/libport/input-arguments.hh
include/libport/reserved-vector.hxx
include/libport/traits.hh
include/libport/package-info.hh
include/libport/sstream
include/libport/lockable.hh
include/libport/export.hh
include/libport/dirent.h
include/libport/condition.hxx
include/libport/containers.hxx
include/libport/preproc.hh
include/libport/backtrace.hh
include/libport/instrument.hh
include/libport/separate.hh
include/libport/ref-pt.hh
include/libport/dlfcn.h
include/libport/cstring
include/libport/xalloc.hxx
include/libport/separate.hxx
include/libport/system-warning-pop.hh
include/libport/ufloat.hxx
include/libport/unique-pointer.hh
include/libport/asio.hh
include/libport/safe-container.hxx
include/libport/safe-container.hh
include/libport/cstdint
include/libport/netdb.h
include/libport/type-info.hxx
include/libport/umatrix.hh
include/libport/cstdio
)
set(PORT_HEADERS_SYS
include/libport/sys/socket.h
include/libport/sys/stat.h
include/libport/sys/param.h
include/libport/sys/utsname.hxx
include/libport/sys/time.hxx
include/libport/sys/types.h
include/libport/sys/stat.hxx
include/libport/sys/utsname.h
include/libport/sys/select.h
include/libport/sys/wait.h
include/libport/sys/time.h
include/libport/sys/prctl.h
)
set(PORT_HEADERS_TR1
include/libport/tr1/type_traits
)
set(PORT_HEADERS_ARPA
include/libport/arpa/inet.h
)
qi_install_header(${PORT_HEADERS} SUBFOLDER libport)
qi_install_header(${PORT_HEADERS_SYS} SUBFOLDER libport/sys)
qi_install_header(${PORT_HEADERS_ARPA} SUBFOLDER libport/arpa)
qi_install_header(${PORT_HEADERS_TR1} SUBFOLDER libport/tr1)
if (USE_BOOST_CORO)
add_definitions(-DSCHED_USE_BOOST_CORO)
set(SCHED_DEPS BOOST_COROUTINE)
else()
set(SCHED_EXTRA_SOURCES
lib/sched/libcoroutine/Base.h
lib/sched/libcoroutine/Coro.cc
lib/sched/libcoroutine/context.cc
)
endif()
set(SCHED_SOURCES
${SCHED_EXTRA_SOURCES}
lib/sched/configuration.cc
lib/sched/coroutine-hooks.cc
lib/sched/job.cc
lib/sched/scheduler.cc
lib/sched/tag.cc
lib/sched/uclibc-workaround.cc
)
if (NOT WIN32)
list(APPEND SCHED_SOURCES lib/sched/libcoroutine/asm.S)
endif()
set(SCHED_HEADERS
include/sched/exception.hh
include/sched/coroutine.hh
include/sched/local.mk
include/sched/exception.hxx
include/sched/coroutine-boost.hxx
include/sched/coroutine-hooks.hh
include/sched/coroutine-coro.hxx
include/sched/scheduler.hxx
include/sched/tag.hxx
include/sched/configuration.hh
include/sched/fwd.hh
include/sched/scheduler.hh
include/sched/job.hxx
include/sched/coroutine-local-storage.hh
include/sched/coroutine.hxx
include/sched/job.hh
include/sched/export.hh
include/sched/coroutine-local-storage.hxx
include/sched/tag.hh
)
set(SCHED_HEADERS_LIBCOROUTINE
include/sched/libcoroutine/Coro.h
include/sched/libcoroutine/amd64-ucontext.h
include/sched/libcoroutine/taskimpl.h
include/sched/libcoroutine/power-ucontext.h
include/sched/libcoroutine/Common.h
include/sched/libcoroutine/386-ucontext.h
)
qi_install_header(${SCHED_HEADERS} SUBFOLDER sched)
qi_install_header(${SCHED_HEADERS_LIBCOROUTINE} SUBFOLDER sched/libcoroutine)
set(SERIALIZE_SOURCES
lib/serialize/binary-i-serializer.cc
lib/serialize/binary-o-serializer.cc
lib/serialize/exception.cc
lib/serialize/o-serializer.cc
)
set(SERIALIZE_HEADERS
include/serialize/o-serializer.hh
include/serialize/exception.hh
include/serialize/local.mk
include/serialize/xml-i-serializer.hh
include/serialize/xml-o-serializer.hh
include/serialize/binary-i-serializer.hh
include/serialize/serialize.hh
include/serialize/fwd.hh
include/serialize/i-serializer.hh
include/serialize/binary-o-serializer.hxx
include/serialize/o-serializer.hxx
include/serialize/binary-i-serializer.hxx
include/serialize/binary-o-serializer.hh
include/serialize/i-serializer.hxx
include/serialize/export.hh
)
qi_install_header(${SERIALIZE_HEADERS} SUBFOLDER serialize)
qi_create_lib(port
SHARED
SRC ${PORT_SOURCES} ${PORT_HEADERS}
DEPENDS BOOST BOOST_CHRONO BOOST_FILESYSTEM BOOST_DATE_TIME BOOST_SYSTEM BOOST_THREAD)
set_target_properties(port
PROPERTIES
COMPILE_FLAGS -DBUILDING_LIBPORT)
if (NOT APPLE AND NOT WIN32)
qi_use_lib(port RT)
endif()
qi_stage_lib(port)
qi_create_lib(sched
SRC ${SCHED_SOURCES}
SHARED
DEPENDS port BOOST BOOST_SIGNALS BOOST_THREAD BOOST_CHRONO ${SCHED_DEPS})
set_target_properties(sched
PROPERTIES
COMPILE_FLAGS -DBUILDING_LIBSCHED)
qi_stage_lib(sched)
qi_create_lib(serialize
SHARED
SRC ${SERIALIZE_SOURCES}
DEPENDS port BOOST BOOST_THREAD BOOST_CHRONO
)
set_target_properties(serialize
PROPERTIES
COMPILE_FLAGS -DBUILDING_SERIALIZE)
qi_stage_lib(serialize)