-
Notifications
You must be signed in to change notification settings - Fork 107
/
CMakeLists.txt
675 lines (603 loc) · 23.8 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
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
# Copyright 2021-2024 Andrey Semashev
#
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.5...3.16)
project(BoostLog VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
include(CheckCXXSourceCompiles)
set(BOOST_LOG_NO_THREADS OFF CACHE BOOL "Disable multithreading support in Boost.Log")
set(BOOST_LOG_WITHOUT_CHAR OFF CACHE BOOL "Disable support for narrow character logging in Boost.Log")
set(BOOST_LOG_WITHOUT_WCHAR_T OFF CACHE BOOL "Disable support for wide character logging in Boost.Log")
set(BOOST_LOG_WITHOUT_DEFAULT_FACTORIES OFF CACHE BOOL "Disable default factories for filters and formatters in Boost.Log")
set(BOOST_LOG_WITHOUT_SETTINGS_PARSERS OFF CACHE BOOL "Disable settings, filter and formatter parsers in Boost.Log")
if (WIN32)
set(BOOST_LOG_NO_QUERY_PERFORMANCE_COUNTER OFF CACHE BOOL "Disable using QueryPerformanceCounter API on Windows in Boost.Log")
set(BOOST_LOG_WITHOUT_DEBUG_OUTPUT OFF CACHE BOOL "Disable support for debugger output on Windows in Boost.Log")
set(BOOST_LOG_WITHOUT_EVENT_LOG OFF CACHE BOOL "Disable support for event log on Windows in Boost.Log")
endif()
set(BOOST_LOG_WITHOUT_IPC OFF CACHE BOOL "Disable support for inter-process communication in Boost.Log")
set(BOOST_LOG_WITHOUT_SYSLOG OFF CACHE BOOL "Disable support for syslog API in Boost.Log")
set(BOOST_LOG_USE_NATIVE_SYSLOG OFF CACHE BOOL "Force-enable using native syslog API in Boost.Log")
set(BOOST_LOG_USE_COMPILER_TLS OFF CACHE BOOL "Enable using compiler-specific intrinsics for thread-local storage in Boost.Log")
set(BOOST_LOG_REGEX_BACKENDS "std::regex" "Boost.Regex" "Boost.Xpressive")
set(BOOST_LOG_USE_REGEX_BACKEND "Boost.Regex" CACHE STRING "Regular expressions backend to use in Boost.Log")
set_property(CACHE BOOST_LOG_USE_REGEX_BACKEND PROPERTY STRINGS ${BOOST_LOG_REGEX_BACKENDS})
if (NOT BOOST_LOG_USE_REGEX_BACKEND IN_LIST BOOST_LOG_REGEX_BACKENDS)
message(FATAL_ERROR "BOOST_LOG_USE_REGEX_BACKEND must be one of: ${BOOST_LOG_REGEX_BACKENDS}")
endif()
if (NOT BOOST_LOG_NO_THREADS)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
endif()
# Note: We can't use the Boost::library targets in the configure checks as they may not yet be included
# by the superproject when this CMakeLists.txt is included. We also don't want to hardcode include paths
# of the needed libraries and their dependencies, recursively, as this is too fragile and requires maintenance.
# Instead, we collect include paths of all libraries and use them in the configure checks. This works faster
# if there is a unified Boost include tree in the filesystem (i.e. if `b2 headers` was run or we're in the
# official monolithic Boost distribution tree).
include(cmake/BoostLibraryIncludes.cmake)
set(CMAKE_REQUIRED_INCLUDES ${BOOST_LIBRARY_INCLUDES})
check_cxx_source_compiles("#include <${CMAKE_CURRENT_SOURCE_DIR}/../config/checks/architecture/x86.cpp>\nint main() {}" BOOST_LOG_TARGET_X86)
set(CMAKE_REQUIRED_DEFINITIONS "-DBOOST_ALL_NO_LIB")
check_cxx_source_compiles("#include <${CMAKE_CURRENT_SOURCE_DIR}/config/atomic-int32/atomic_int32.cpp>" BOOST_LOG_HAS_LOCK_FREE_ATOMIC_INT32)
unset(CMAKE_REQUIRED_DEFINITIONS)
if (BOOST_LOG_TARGET_X86)
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
set(boost_log_ssse3_cflags "/arch:SSE2")
set(boost_log_avx2_cflags "/arch:AVX")
endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
if (WIN32)
set(boost_log_ssse3_cflags "/QxSSSE3")
set(boost_log_avx2_cflags "/arch:CORE-AVX2")
else()
set(boost_log_ssse3_cflags "-xSSSE3")
set(boost_log_avx2_cflags "-xCORE-AVX2 -fabi-version=0")
endif()
else()
set(boost_log_ssse3_cflags "-msse -msse2 -msse3 -mssse3")
set(boost_log_avx2_cflags "-mavx -mavx2")
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
string(APPEND boost_log_avx2_cflags " -fabi-version=0")
endif()
endif()
set(CMAKE_REQUIRED_FLAGS "${boost_log_ssse3_cflags}")
check_cxx_source_compiles("#include <${CMAKE_CURRENT_SOURCE_DIR}/config/x86-ext/ssse3.cpp>" BOOST_LOG_COMPILER_HAS_SSSE3)
unset(CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_FLAGS "${boost_log_avx2_cflags}")
check_cxx_source_compiles("#include <${CMAKE_CURRENT_SOURCE_DIR}/config/x86-ext/avx2.cpp>" BOOST_LOG_COMPILER_HAS_AVX2)
unset(CMAKE_REQUIRED_FLAGS)
endif()
if (NOT BOOST_LOG_WITHOUT_SYSLOG AND NOT BOOST_LOG_USE_NATIVE_SYSLOG)
check_cxx_source_compiles("#include <${CMAKE_CURRENT_SOURCE_DIR}/config/native-syslog/native_syslog.cpp>" BOOST_LOG_HAS_NATIVE_SYSLOG)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
# Solaris headers are broken and cannot be included in C++03 when _XOPEN_SOURCE=600. At the same time, they cannot be included with _XOPEN_SOURCE=500 in C++11 and later.
# This is because the system headers check the C language version and error out if the version does not match. We have to test if we can request _XOPEN_SOURCE=600.
check_cxx_source_compiles("#include <${CMAKE_CURRENT_SOURCE_DIR}/config/xopen-source-600/xopen_source_600.cpp>" BOOST_LOG_HAS_XOPEN_SOURCE_600)
endif()
unset(CMAKE_REQUIRED_INCLUDES)
set(boost_log_common_public_defines
# NOTE:
# We deactivate autolinking, because cmake based builds don't need it
# and we don't implement name mangling for the library file anyway.
# Ususally the parent CMakeLists.txt file should already have globally defined BOOST_ALL_NO_LIB
BOOST_LOG_NO_LIB
)
set(boost_log_common_private_defines
__STDC_CONSTANT_MACROS
BOOST_SPIRIT_USE_PHOENIX_V3=1
BOOST_THREAD_DONT_USE_CHRONO=1 # Don't introduce false dependency on Boost.Chrono
)
set(boost_log_private_defines
BOOST_LOG_BUILDING_THE_LIB
)
set(boost_log_setup_private_defines
BOOST_LOG_SETUP_BUILDING_THE_LIB
)
if (BUILD_SHARED_LIBS)
list(APPEND boost_log_common_public_defines BOOST_LOG_DYN_LINK)
list(APPEND boost_log_private_defines BOOST_LOG_DLL)
list(APPEND boost_log_setup_private_defines BOOST_LOG_SETUP_DLL)
else()
list(APPEND boost_log_common_public_defines BOOST_LOG_STATIC_LINK)
endif()
set(boost_log_sources
src/alignment_gap_between.hpp
src/attribute_name.cpp
src/attribute_set_impl.hpp
src/attribute_set.cpp
src/attribute_value_set.cpp
src/bit_tools.hpp
src/code_conversion.cpp
src/stateless_allocator.hpp
src/unique_ptr.hpp
src/core.cpp
src/record_ostream.cpp
src/severity_level.cpp
src/global_logger_storage.cpp
src/named_scope.cpp
src/process_name.cpp
src/process_id.cpp
src/thread_id.cpp
src/id_formatting.hpp
src/murmur3.hpp
src/timer.cpp
src/exceptions.cpp
src/default_attribute_names.cpp
src/default_sink.hpp
src/default_sink.cpp
src/text_ostream_backend.cpp
src/text_file_backend.cpp
src/text_multifile_backend.cpp
src/thread_specific.cpp
src/once_block.cpp
src/timestamp.cpp
src/threadsafe_queue.cpp
src/event.cpp
src/trivial.cpp
src/spirit_encoding.hpp
src/spirit_encoding.cpp
src/format_parser.cpp
src/date_time_format_parser.cpp
src/named_scope_format_parser.cpp
src/permissions.cpp
src/dump.cpp
)
if (BOOST_LOG_COMPILER_HAS_SSSE3)
set(boost_log_sources_ssse3 src/dump_ssse3.cpp)
set_source_files_properties(${boost_log_sources_ssse3} PROPERTIES COMPILE_FLAGS "${boost_log_ssse3_cflags}")
list(APPEND boost_log_private_defines BOOST_LOG_USE_SSSE3)
endif()
if (BOOST_LOG_COMPILER_HAS_AVX2)
set(boost_log_sources_avx2 src/dump_avx2.cpp)
set_source_files_properties(${boost_log_sources_avx2} PROPERTIES COMPILE_FLAGS "${boost_log_avx2_cflags}")
list(APPEND boost_log_private_defines BOOST_LOG_USE_AVX2)
endif()
if (NOT BOOST_LOG_WITHOUT_SYSLOG)
list(APPEND boost_log_sources src/syslog_backend.cpp)
if (BOOST_LOG_USE_NATIVE_SYSLOG OR BOOST_LOG_HAS_NATIVE_SYSLOG)
list(APPEND boost_log_common_private_defines BOOST_LOG_USE_NATIVE_SYSLOG)
endif()
endif()
if (WIN32)
list(APPEND boost_log_sources
src/windows/light_rw_mutex.cpp
src/windows/is_debugger_present.cpp
)
list(APPEND boost_log_common_private_defines
# Disable warnings about using 'insecure' standard C functions.
# These affect MSVC C/C++ library headers, which are used by various compilers.
_SCL_SECURE_NO_WARNINGS
_SCL_SECURE_NO_DEPRECATE
_CRT_SECURE_NO_WARNINGS
_CRT_SECURE_NO_DEPRECATE
)
if (NOT BOOST_LOG_WITHOUT_DEBUG_OUTPUT)
list(APPEND boost_log_sources src/windows/debug_output_backend.cpp)
endif()
if (NOT BOOST_LOG_WITHOUT_IPC)
list(APPEND boost_log_sources
src/windows/auto_handle.hpp
src/windows/object_name.cpp
src/windows/utf_code_conversion.hpp
src/windows/mapped_shared_memory.hpp
src/windows/mapped_shared_memory.cpp
src/windows/ipc_sync_wrappers.hpp
src/windows/ipc_sync_wrappers.cpp
src/windows/ipc_reliable_message_queue.cpp
)
list(APPEND boost_log_private_libs
secur32
)
endif()
if (NOT BOOST_LOG_WITHOUT_EVENT_LOG)
# Find message compiler (mc)
if (NOT CMAKE_MC_COMPILER AND DEFINED ENV{MC} AND EXISTS "$ENV{MC}" AND NOT IS_DIRECTORY "$ENV{MC}")
set(CMAKE_MC_COMPILER "$ENV{MC}")
endif()
if (NOT CMAKE_MC_COMPILER)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(mc_executable "windmc.exe")
else()
set(mc_executable "mc.exe")
endif()
if (CMAKE_RC_COMPILER)
# Use resource compiler directory as a hint. CMake will initialize CMAKE_RC_COMPILER
# automatically based on environment variables, and message compiler typically resides
# in the same directory in the Windows SDK installation. Reusing resource compiler
# directory also provides user's choice of Windows SDK version and host and target
# architecture.
get_filename_component(rc_compiler_path "${CMAKE_RC_COMPILER}" DIRECTORY)
list(APPEND mc_search_hints "${rc_compiler_path}")
endif()
if (CMAKE_CXX_COMPILER)
# Message compiler can be located next to the compiler, e.g. on MinGW installations.
get_filename_component(cxx_compiler_path "${CMAKE_CXX_COMPILER}" DIRECTORY)
list(APPEND mc_search_hints "${cxx_compiler_path}")
endif()
message(DEBUG "Boost.Log: ${mc_executable} search hints: ${mc_search_hints}")
find_program(CMAKE_MC_COMPILER "${mc_executable}" HINTS "${mc_search_hints}")
if (CMAKE_MC_COMPILER STREQUAL "CMAKE_MC_COMPILER-NOTFOUND")
message(STATUS "Boost.Log: Message compiler ${mc_executable} not found, event log support will be disabled.")
unset(CMAKE_MC_COMPILER)
else()
message(STATUS "Boost.Log: Message compiler found: ${CMAKE_MC_COMPILER}")
endif()
endif()
if (CMAKE_MC_COMPILER)
add_custom_command(
OUTPUT
"${CMAKE_CURRENT_BINARY_DIR}/src/windows/simple_event_log.h"
"${CMAKE_CURRENT_BINARY_DIR}/src/windows/simple_event_log.rc"
COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/src/windows"
COMMAND "${CMAKE_MC_COMPILER}"
-h "${CMAKE_CURRENT_BINARY_DIR}/src/windows"
-r "${CMAKE_CURRENT_BINARY_DIR}/src/windows"
"${CMAKE_CURRENT_SOURCE_DIR}/src/windows/simple_event_log.mc"
MAIN_DEPENDENCY
"${CMAKE_CURRENT_SOURCE_DIR}/src/windows/simple_event_log.mc"
COMMENT
"Building src/windows/simple_event_log.mc"
VERBATIM
)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Workaround for a windres.exe issue on MinGW-w64: by default, it uses popen to pipe preprocessed
# output from the preprocessor, but popen is buggy on non-English Windows systems and causes
# compilation errors such as:
#
# windres.exe: can't open file `page:': Invalid argument
#
# This option forces windres.exe to use a temporary file instead.
# https://github.com/boostorg/log/pull/231
list(APPEND CMAKE_RC_FLAGS "--use-temp-file")
endif()
list(APPEND boost_log_sources
"${CMAKE_CURRENT_BINARY_DIR}/src/windows/simple_event_log.h"
"${CMAKE_CURRENT_BINARY_DIR}/src/windows/simple_event_log.rc"
src/windows/event_log_registry.hpp
src/windows/event_log_backend.cpp
)
list(APPEND boost_log_private_libs
psapi
)
else()
set(BOOST_LOG_WITHOUT_EVENT_LOG ON)
endif()
endif()
else()
if (NOT BOOST_LOG_WITHOUT_IPC)
list(APPEND boost_log_sources
src/posix/object_name.cpp
src/posix/ipc_sync_wrappers.hpp
src/posix/ipc_reliable_message_queue.cpp
)
endif()
endif()
if (CYGWIN)
# Boost.Interprocess does not compile on Cygwin: https://github.com/boostorg/interprocess/issues/242
set(BOOST_LOG_WITHOUT_IPC ON)
list(APPEND boost_log_common_private_defines
__USE_W32_SOCKETS
_XOPEN_SOURCE=600
)
endif()
if (WIN32 OR CYGWIN)
list(APPEND boost_log_common_private_defines
BOOST_USE_WINDOWS_H
WIN32_LEAN_AND_MEAN
NOMINMAX
SECURITY_WIN32
)
list(APPEND boost_log_private_libs
ws2_32
mswsock
advapi32
)
list(APPEND boost_log_setup_private_libs
ws2_32
)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND boost_log_common_private_defines _XOPEN_SOURCE=600)
list(APPEND boost_log_private_libs rt)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
list(APPEND boost_log_private_libs rt)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "HP-UX")
list(APPEND boost_log_common_private_defines _XOPEN_SOURCE=600)
list(APPEND boost_log_private_libs ipv6)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
if (BOOST_LOG_HAS_XOPEN_SOURCE_600)
list(APPEND boost_log_common_private_defines _XOPEN_SOURCE=600)
else()
list(APPEND boost_log_common_private_defines _XOPEN_SOURCE=500)
endif()
list(APPEND boost_log_common_private_defines __EXTENSIONS__)
list(APPEND boost_log_private_libs
socket
nsl
)
endif()
if (BOOST_LOG_USE_REGEX_BACKEND STREQUAL "Boost.Regex")
set(boost_log_regex_backend_private_libs Boost::regex)
list(APPEND boost_log_common_private_defines BOOST_LOG_USE_BOOST_REGEX)
elseif (BOOST_LOG_USE_REGEX_BACKEND STREQUAL "Boost.Xpressive")
set(boost_log_regex_backend_private_libs Boost::xpressive)
list(APPEND boost_log_common_private_defines BOOST_LOG_USE_BOOST_XPRESSIVE)
else()
list(APPEND boost_log_common_private_defines BOOST_LOG_USE_STD_REGEX)
endif()
if (BOOST_LOG_NO_THREADS)
list(APPEND boost_log_common_public_defines BOOST_LOG_NO_THREADS)
endif()
if (BOOST_LOG_WITHOUT_CHAR)
list(APPEND boost_log_common_public_defines BOOST_LOG_WITHOUT_CHAR)
endif()
if (BOOST_LOG_WITHOUT_WCHAR_T)
list(APPEND boost_log_common_public_defines BOOST_LOG_WITHOUT_WCHAR_T)
endif()
if (BOOST_LOG_WITHOUT_DEFAULT_FACTORIES)
list(APPEND boost_log_setup_private_defines BOOST_LOG_WITHOUT_DEFAULT_FACTORIES)
endif()
if (BOOST_LOG_WITHOUT_SETTINGS_PARSERS)
list(APPEND boost_log_setup_private_defines BOOST_LOG_WITHOUT_SETTINGS_PARSERS)
endif()
if (BOOST_LOG_WITHOUT_SYSLOG)
list(APPEND boost_log_common_private_defines BOOST_LOG_WITHOUT_SYSLOG)
endif()
if (BOOST_LOG_WITHOUT_IPC)
list(APPEND boost_log_common_private_defines BOOST_LOG_WITHOUT_IPC)
endif()
if (WIN32)
if (BOOST_LOG_NO_QUERY_PERFORMANCE_COUNTER)
list(APPEND boost_log_common_private_defines BOOST_LOG_NO_QUERY_PERFORMANCE_COUNTER)
endif()
if (BOOST_LOG_WITHOUT_DEBUG_OUTPUT)
list(APPEND boost_log_common_private_defines BOOST_LOG_WITHOUT_DEBUG_OUTPUT)
endif()
if (BOOST_LOG_WITHOUT_EVENT_LOG)
list(APPEND boost_log_common_private_defines BOOST_LOG_WITHOUT_EVENT_LOG)
endif()
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
list(APPEND boost_log_common_private_cxxflags
/bigobj
/wd4503 # decorated name length exceeded, name was truncated
/wd4456 # declaration of 'A' hides previous local declaration
/wd4459 # declaration of 'A' hides global declaration
/wd4003 # not enough actual parameters for macro 'X' - caused by BOOST_PP_IS_EMPTY and BOOST_PP_IS_BEGIN_PARENS which are used by Fusion
)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
# Disable Intel warnings:
# warning #177: function "X" was declared but never referenced
# warning #780: using-declaration ignored -- it refers to the current namespace
# warning #2196: routine is both "inline" and "noinline"
# remark #1782: #pragma once is obsolete. Use #ifndef guard instead.
# remark #193: zero used for undefined preprocessing identifier "X"
# remark #304: access control not specified ("public" by default)
# remark #981: operands are evaluated in unspecified order
# remark #1418: external function definition with no prior declaration
# Mostly comes from Boost.Phoenix: warning #411: class "X" defines no constructor to initialize the following: reference member "Y"...
# warning #734: "X" (declared at line N of "file.hpp"), required for copy that was eliminated, is inaccessible
# warning #279: controlling expression is constant
if (WIN32)
list(APPEND boost_log_common_private_cxxflags
"/Qwd177,780,2196,1782,193,304,981,1418,411,734,279"
)
else()
list(APPEND boost_log_common_private_cxxflags
"-wd177,780,2196,1782,193,304,981,1418,411,734,279"
)
endif()
endif()
if ((WIN32 OR CYGWIN) AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
list(APPEND boost_log_common_private_linkflags
-Wl,--enable-auto-import
)
endif()
add_library(boost_log
${boost_log_sources}
${boost_log_sources_ssse3}
${boost_log_sources_avx2}
)
if (BOOST_SUPERPROJECT_VERSION)
set_target_properties(boost_log PROPERTIES VERSION "${BOOST_SUPERPROJECT_VERSION}")
endif()
set(boost_log_install_targets boost_log)
add_library(Boost::log ALIAS boost_log)
target_compile_features(boost_log
PUBLIC
cxx_static_assert
PRIVATE
cxx_lambdas
)
target_include_directories(boost_log
PUBLIC
include
PRIVATE
src
"${CMAKE_CURRENT_BINARY_DIR}/src"
)
target_link_libraries(boost_log
PUBLIC
Boost::assert
Boost::config
Boost::core
Boost::date_time
Boost::filesystem
Boost::function_types
Boost::fusion
Boost::intrusive
Boost::move
Boost::mpl
Boost::parameter
Boost::phoenix
Boost::predef
Boost::preprocessor
Boost::proto
Boost::range
Boost::smart_ptr
Boost::system
Boost::throw_exception
Boost::type_index
Boost::type_traits
Boost::utility
PRIVATE
Boost::align
Boost::asio
Boost::bind
Boost::exception
Boost::interprocess
Boost::optional
Boost::random
Boost::spirit
${boost_log_regex_backend_private_libs}
)
if (WIN32 OR CYGWIN)
target_link_libraries(boost_log
PUBLIC
Boost::winapi
)
endif()
if (NOT BOOST_LOG_NO_THREADS)
target_link_libraries(boost_log
PUBLIC
Boost::atomic
Boost::thread
)
endif()
target_compile_definitions(boost_log
PUBLIC
${boost_log_common_public_defines}
${boost_log_public_defines}
PRIVATE
${boost_log_common_private_defines}
${boost_log_private_defines}
)
target_compile_options(boost_log
PRIVATE
${boost_log_common_private_cxxflags}
)
target_link_libraries(boost_log
PUBLIC
${boost_log_public_libs}
PRIVATE
${boost_log_private_libs}
${boost_log_common_private_linkflags}
)
# An alias target for Boost::log but with all optional dependencies (i.e. for support headers)
add_library(boost_log_with_support INTERFACE)
add_library(Boost::log_with_support ALIAS boost_log_with_support)
target_link_libraries(boost_log_with_support
INTERFACE
Boost::log
Boost::exception
Boost::regex
Boost::spirit
Boost::xpressive
)
set(boost_log_setup_public_deps
Boost::log
Boost::assert
Boost::config
Boost::core
Boost::iterator
Boost::move
Boost::optional
Boost::parameter
Boost::phoenix
Boost::preprocessor
Boost::property_tree
Boost::smart_ptr
Boost::type_traits
)
if (NOT BOOST_LOG_WITHOUT_SETTINGS_PARSERS)
set(boost_log_setup_sources
src/setup/parser_utils.hpp
src/setup/parser_utils.cpp
src/setup/init_from_stream.cpp
src/setup/init_from_settings.cpp
src/setup/settings_parser.cpp
src/setup/filter_parser.cpp
src/setup/formatter_parser.cpp
)
if (NOT BOOST_LOG_WITHOUT_DEFAULT_FACTORIES)
list(APPEND boost_log_setup_sources
src/setup/default_filter_factory.hpp
src/setup/default_filter_factory.cpp
src/setup/matches_relation_factory.cpp
src/setup/default_formatter_factory.hpp
src/setup/default_formatter_factory.cpp
)
endif()
add_library(boost_log_setup ${boost_log_setup_sources})
if (BOOST_SUPERPROJECT_VERSION)
set_target_properties(boost_log_setup PROPERTIES VERSION "${BOOST_SUPERPROJECT_VERSION}")
endif()
list(APPEND boost_log_install_targets boost_log_setup)
target_compile_features(boost_log_setup
PUBLIC
cxx_static_assert
cxx_uniform_initialization
PRIVATE
cxx_lambdas
)
target_include_directories(boost_log_setup
PUBLIC
include
PRIVATE
src
)
target_link_libraries(boost_log_setup
PUBLIC
${boost_log_setup_public_deps}
PRIVATE
Boost::asio
Boost::bind
Boost::date_time
Boost::exception
Boost::filesystem
Boost::io
Boost::spirit
Boost::throw_exception
Boost::utility
)
if (NOT BOOST_LOG_WITHOUT_DEFAULT_FACTORIES)
target_link_libraries(boost_log_setup
PRIVATE
Boost::fusion
Boost::mpl
${boost_log_regex_backend_private_libs}
)
endif()
target_compile_definitions(boost_log_setup
PUBLIC
${boost_log_common_public_defines}
PRIVATE
${boost_log_common_private_defines}
${boost_log_setup_private_defines}
)
target_compile_options(boost_log_setup
PRIVATE
${boost_log_common_private_cxxflags}
)
target_link_libraries(boost_log_setup
PRIVATE
${boost_log_setup_private_libs}
${boost_log_common_private_linkflags}
)
else()
add_library(boost_log_setup INTERFACE)
target_include_directories(boost_log_setup INTERFACE include)
target_compile_definitions(boost_log_setup INTERFACE ${boost_log_common_public_defines})
target_link_libraries(boost_log_setup INTERFACE ${boost_log_setup_public_deps})
endif()
add_library(Boost::log_setup ALIAS boost_log_setup)
if (BOOST_SUPERPROJECT_VERSION AND NOT CMAKE_VERSION VERSION_LESS 3.13)
boost_install(TARGETS ${boost_log_install_targets} VERSION "${BOOST_SUPERPROJECT_VERSION}" HEADER_DIRECTORY include)
endif()