Move getTry to subclasses.
[folly.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.4.0 FATAL_ERROR)
2
3 # includes
4 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
5 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
6
7 # package information
8 set(PACKAGE_NAME      "folly")
9 set(PACKAGE_VERSION   "0.58.0-dev")
10 set(PACKAGE_STRING    "${PACKAGE_NAME} ${PACKAGE_VERSION}")
11 set(PACKAGE_TARNAME   "${PACKAGE_NAME}-${PACKAGE_VERSION}")
12 set(PACKAGE_BUGREPORT "https://github.com/facebook/folly/issues")
13
14 # 150+ tests in the root folder anyone? No? I didn't think so.
15 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
16
17 project(${PACKAGE_NAME} CXX)
18
19 if (MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920)
20   set(MSVC_IS_2017 ON)
21 elseif (MSVC_VERSION EQUAL 1900)
22   set(MSVC_IS_2017 OFF)
23 else()
24   message(FATAL_ERROR "This build script only supports building Folly on 64-bit Windows with Visual Studio 2015 or Visual Studio 2017. MSVC version '${MSVC_VERSION}' is not supported.")
25 endif()
26
27 # Check target architecture
28 if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
29   message(FATAL_ERROR "Folly requires a 64bit target architecture.")
30 endif()
31 if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
32   message(FATAL_ERROR "The CMake build should only be used on Windows. For every other platform, use the makefile.")
33 endif()
34
35 set(FOLLY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/folly")
36
37 # Generate a few tables and create the main config file.
38 find_package(PythonInterp REQUIRED)
39 add_custom_command(
40   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/folly/build/EscapeTables.cpp
41   COMMAND ${PYTHON_EXECUTABLE} "${FOLLY_DIR}/build/generate_escape_tables.py"
42   DEPENDS ${FOLLY_DIR}/build/generate_escape_tables.py
43   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/folly/build/
44   COMMENT "Generating the escape tables..." VERBATIM
45 )
46 add_custom_command(
47   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/folly/build/FormatTables.cpp
48   COMMAND ${PYTHON_EXECUTABLE} "${FOLLY_DIR}/build/generate_format_tables.py"
49   DEPENDS ${FOLLY_DIR}/build/generate_format_tables.py
50   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/folly/build/
51   COMMENT "Generating the format tables..." VERBATIM
52 )
53 add_custom_command(
54   OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/folly/build/GroupVarintTables.cpp"
55   COMMAND ${PYTHON_EXECUTABLE} "${FOLLY_DIR}/build/generate_varint_tables.py"
56   DEPENDS ${FOLLY_DIR}/build/generate_varint_tables.py
57   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/folly/build/
58   COMMENT "Generating the group varint tables..." VERBATIM
59 )
60
61 include(folly-deps) # Find the required packages
62 if (LIBPTHREAD_FOUND)
63   set(FOLLY_HAVE_PTHREAD ON)
64 endif()
65 configure_file(
66   ${CMAKE_CURRENT_SOURCE_DIR}/CMake/folly-config.h.cmake
67   ${CMAKE_CURRENT_BINARY_DIR}/folly/folly-config.h
68 )
69
70 include(FollyCompiler)
71 include(FollyFunctions)
72
73 # Main folly library files
74 auto_sources(files "*.cpp" "RECURSE" "${FOLLY_DIR}")
75 auto_sources(hfiles "*.h" "RECURSE" "${FOLLY_DIR}")
76
77 # No need for tests or benchmarks, and we can't build most experimental stuff.
78 REMOVE_MATCHES_FROM_LISTS(files hfiles
79   MATCHES
80     "/build/"
81     "/experimental/exception_tracer/"
82     "/experimental/hazptr/bench/"
83     "/experimental/hazptr/example/"
84     "/experimental/logging/example/"
85     "/experimental/symbolizer/"
86     "/futures/exercises/"
87     "/test/"
88     "/tools/"
89     "Benchmark.cpp$"
90     "Test.cpp$"
91   IGNORE_MATCHES
92     "/Benchmark.cpp$"
93 )
94 list(REMOVE_ITEM files
95   ${FOLLY_DIR}/Poly.cpp
96   ${FOLLY_DIR}/Subprocess.cpp
97   ${FOLLY_DIR}/SingletonStackTrace.cpp
98   ${FOLLY_DIR}/experimental/JSONSchemaTester.cpp
99   ${FOLLY_DIR}/experimental/RCUUtils.cpp
100   ${FOLLY_DIR}/experimental/io/AsyncIO.cpp
101   ${FOLLY_DIR}/experimental/io/HugePageUtil.cpp
102   ${FOLLY_DIR}/futures/test/Benchmark.cpp
103 )
104 list(REMOVE_ITEM hfiles
105   ${FOLLY_DIR}/Fingerprint.h
106   ${FOLLY_DIR}/Poly.h
107   ${FOLLY_DIR}/Poly-inl.h
108   ${FOLLY_DIR}/detail/PolyDetail.h
109   ${FOLLY_DIR}/detail/TypeList.h
110   ${FOLLY_DIR}/detail/SlowFingerprint.h
111   ${FOLLY_DIR}/detail/FingerprintPolynomial.h
112   ${FOLLY_DIR}/experimental/RCURefCount.h
113   ${FOLLY_DIR}/experimental/RCUUtils.h
114   ${FOLLY_DIR}/experimental/io/AsyncIO.h
115   ${FOLLY_DIR}/poly/Nullable.h
116   ${FOLLY_DIR}/poly/Regular.h
117 )
118
119 add_library(folly_base OBJECT
120   ${files} ${hfiles}
121   ${CMAKE_CURRENT_BINARY_DIR}/folly/folly-config.h
122   ${CMAKE_CURRENT_BINARY_DIR}/folly/build/EscapeTables.cpp
123   ${CMAKE_CURRENT_BINARY_DIR}/folly/build/FormatTables.cpp
124   ${CMAKE_CURRENT_BINARY_DIR}/folly/build/GroupVarintTables.cpp
125 )
126 auto_source_group(folly ${FOLLY_DIR} ${files} ${hfiles})
127 apply_folly_compile_options_to_target(folly_base)
128 target_include_directories(folly_base PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
129 # Add the generated files to the correct source group.
130 source_group("folly" FILES ${CMAKE_CURRENT_BINARY_DIR}/folly/folly-config.h)
131 source_group("folly\\build" FILES
132   ${CMAKE_CURRENT_BINARY_DIR}/folly/build/EscapeTables.cpp
133   ${CMAKE_CURRENT_BINARY_DIR}/folly/build/FingerprintTables.cpp
134   ${CMAKE_CURRENT_BINARY_DIR}/folly/build/FormatTables.cpp
135   ${CMAKE_CURRENT_BINARY_DIR}/folly/build/GroupVarintTables.cpp
136 )
137
138 set(FOLLY_SHINY_DEPENDENCIES
139   Boost::chrono
140   Boost::context
141   Boost::date_time
142   Boost::filesystem
143   Boost::program_options
144   Boost::regex
145   Boost::system
146   OpenSSL::SSL
147   OpenSSL::Crypto
148 )
149
150 set(FOLLY_LINK_LIBRARIES
151   ${DOUBLE_CONVERSION_LIBRARY}
152 )
153
154 set(FOLLY_INCLUDE_DIRECTORIES
155   ${DOUBLE_CONVERSION_INCLUDE_DIR}
156 )
157
158 if(TARGET gflags)
159   set(FOLLY_SHINY_DEPENDENCIES ${FOLLY_SHINY_DEPENDENCIES} gflags)
160 else()
161   set(FOLLY_LINK_LIBRARIES ${FOLLY_LINK_LIBRARIES} ${LIBGFLAGS_LIBRARY})
162   set(FOLLY_INCLUDE_DIRECTORIES ${FOLLY_INCLUDE_DIRECTORIES} ${LIBGFLAGS_INCLUDE_DIR})
163 endif()
164
165 if(TARGET glog::glog)
166   set(FOLLY_SHINY_DEPENDENCIES ${FOLLY_SHINY_DEPENDENCIES} glog::glog)
167 else()
168   set(FOLLY_LINK_LIBRARIES ${FOLLY_LINK_LIBRARIES} ${LIBGLOG_LIBRARY})
169   set(FOLLY_INCLUDE_DIRECTORIES ${FOLLY_INCLUDE_DIRECTORIES} ${LIBGLOG_INCLUDE_DIR})
170 endif()
171
172 if(TARGET event)
173   set(FOLLY_SHINY_DEPENDENCIES ${FOLLY_SHINY_DEPENDENCIES} event)
174 else()
175   set(FOLLY_LINK_LIBRARIES ${FOLLY_LINK_LIBRARIES} ${LIBEVENT_LIB})
176   set(FOLLY_INCLUDE_DIRECTORIES ${FOLLY_INCLUDE_DIRECTORIES} ${LIBEVENT_INCLUDE_DIR})
177 endif()
178
179
180 set(FOLLY_LINK_LIBRARIES
181   ${FOLLY_LINK_LIBRARIES}
182   Iphlpapi.lib
183   Ws2_32.lib
184
185   ${FOLLY_SHINY_DEPENDENCIES}
186 )
187
188 target_include_directories(folly_base
189   PUBLIC
190     ${FOLLY_INCLUDE_DIRECTORIES}
191     $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
192 )
193
194 foreach (LIB ${FOLLY_SHINY_DEPENDENCIES})
195   target_include_directories(folly_base PUBLIC $<TARGET_PROPERTY:${LIB},INCLUDE_DIRECTORIES>)
196   target_compile_definitions(folly_base PUBLIC $<TARGET_PROPERTY:${LIB},INTERFACE_COMPILE_DEFINITIONS>)
197 endforeach()
198
199 if (FOLLY_HAVE_PTHREAD)
200   target_include_directories(folly_base PUBLIC ${LIBPTHREAD_INCLUDE_DIRS})
201   list(APPEND FOLLY_LINK_LIBRARIES ${LIBPTHREAD_LIBRARIES})
202 endif()
203
204 # Now to generate the fingerprint tables
205 add_executable(GenerateFingerprintTables
206   ${FOLLY_DIR}/build/GenerateFingerprintTables.cpp
207   $<TARGET_OBJECTS:folly_base>
208 )
209 target_link_libraries(GenerateFingerprintTables PRIVATE ${FOLLY_LINK_LIBRARIES})
210 target_include_directories(GenerateFingerprintTables PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
211 add_dependencies(GenerateFingerprintTables folly_base)
212 apply_folly_compile_options_to_target(GenerateFingerprintTables)
213 set_property(TARGET GenerateFingerprintTables PROPERTY FOLDER "Build")
214 source_group("" FILES ${FOLLY_DIR}/build/GenerateFingerprintTables.cpp)
215
216 # Compile the fingerprint tables.
217 add_custom_command(
218   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/folly/build/FingerprintTables.cpp
219   COMMAND GenerateFingerprintTables
220   DEPENDS GenerateFingerprintTables
221   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/folly/build/
222   COMMENT "Generating the fingerprint tables..."
223 )
224 add_library(folly_fingerprint STATIC
225   ${CMAKE_CURRENT_BINARY_DIR}/folly/build/FingerprintTables.cpp
226   ${FOLLY_DIR}/Fingerprint.h
227   ${FOLLY_DIR}/detail/SlowFingerprint.h
228   ${FOLLY_DIR}/detail/FingerprintPolynomial.h
229   $<TARGET_OBJECTS:folly_base>
230 )
231 target_link_libraries(folly_fingerprint PRIVATE ${FOLLY_LINK_LIBRARIES})
232 target_include_directories(folly_fingerprint PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
233 add_dependencies(folly_fingerprint folly_base)
234 apply_folly_compile_options_to_target(folly_fingerprint)
235
236 # We want to generate a single library and target for folly, but we needed a
237 # two-stage compile for the fingerprint tables, so we create a phony source
238 # file that we modify whenever the base libraries change, causing folly to be
239 # re-linked, making things happy.
240 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/folly_dep.cpp
241   COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/folly_dep.cpp
242   DEPENDS folly_base folly_fingerprint
243 )
244 add_library(folly ${CMAKE_CURRENT_BINARY_DIR}/folly_dep.cpp $<TARGET_OBJECTS:folly_base>)
245 apply_folly_compile_options_to_target(folly)
246 source_group("" FILES ${CMAKE_CURRENT_BINARY_DIR}/folly_dep.cpp)
247
248 target_link_libraries(folly PUBLIC ${FOLLY_LINK_LIBRARIES})
249 target_include_directories(folly PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
250
251 install(TARGETS folly
252   EXPORT folly
253   RUNTIME DESTINATION bin
254   LIBRARY DESTINATION lib
255   ARCHIVE DESTINATION lib)
256 auto_install_files(folly ${FOLLY_DIR}
257   ${hfiles}
258   ${FOLLY_DIR}/Fingerprint.h
259   ${FOLLY_DIR}/detail/SlowFingerprint.h
260   ${FOLLY_DIR}/detail/FingerprintPolynomial.h
261 )
262 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/folly/folly-config.h DESTINATION include/folly)
263 install(
264   EXPORT folly
265   DESTINATION share/folly
266   NAMESPACE Folly::
267   FILE folly-targets.cmake
268 )
269
270 # We need a wrapper config file to do the find_package calls to ensure
271 # that all our dependencies are available to link against.
272 file(
273   COPY ${CMAKE_CURRENT_SOURCE_DIR}/CMake/folly-deps.cmake
274   DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/
275 )
276 file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/folly-deps.cmake "\ninclude(folly-targets.cmake)\n")
277 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/folly-deps.cmake DESTINATION share/folly RENAME folly-config.cmake)
278
279 option(BUILD_TESTS "If enabled, compile the tests." OFF)
280 option(BUILD_BROKEN_TESTS "If enabled, compile tests that are known to be broken." OFF)
281 option(BUILD_HANGING_TESTS "If enabled, compile tests that are known to hang." OFF)
282 option(BUILD_SLOW_TESTS "If enabled, compile tests that take a while to run in debug mode." OFF)
283 if (BUILD_TESTS)
284   find_package(GMock MODULE REQUIRED)
285
286   add_library(folly_test_support
287     ${FOLLY_DIR}/test/DeterministicSchedule.cpp
288     ${FOLLY_DIR}/test/DeterministicSchedule.h
289     ${FOLLY_DIR}/test/SingletonTestStructs.cpp
290     ${FOLLY_DIR}/test/SocketAddressTestHelper.cpp
291     ${FOLLY_DIR}/test/SocketAddressTestHelper.h
292     ${FOLLY_DIR}/experimental/logging/test/TestLogHandler.cpp
293     ${FOLLY_DIR}/experimental/logging/test/TestLogHandler.h
294     ${FOLLY_DIR}/futures/test/TestExecutor.cpp
295     ${FOLLY_DIR}/futures/test/TestExecutor.h
296     ${FOLLY_DIR}/io/async/test/BlockingSocket.h
297     ${FOLLY_DIR}/io/async/test/MockAsyncServerSocket.h
298     ${FOLLY_DIR}/io/async/test/MockAsyncSocket.h
299     ${FOLLY_DIR}/io/async/test/MockAsyncSSLSocket.h
300     ${FOLLY_DIR}/io/async/test/MockAsyncTransport.h
301     ${FOLLY_DIR}/io/async/test/MockAsyncUDPSocket.h
302     ${FOLLY_DIR}/io/async/test/MockTimeoutManager.h
303     ${FOLLY_DIR}/io/async/test/ScopedBoundPort.cpp
304     ${FOLLY_DIR}/io/async/test/ScopedBoundPort.h
305     ${FOLLY_DIR}/io/async/test/SocketPair.cpp
306     ${FOLLY_DIR}/io/async/test/SocketPair.h
307     ${FOLLY_DIR}/io/async/test/TestSSLServer.cpp
308     ${FOLLY_DIR}/io/async/test/TestSSLServer.h
309     ${FOLLY_DIR}/io/async/test/TimeUtil.cpp
310     ${FOLLY_DIR}/io/async/test/TimeUtil.h
311     ${FOLLY_DIR}/io/async/test/UndelayedDestruction.h
312     ${FOLLY_DIR}/io/async/test/Util.h
313   )
314   target_compile_definitions(folly_test_support
315     PUBLIC
316       ${LIBGMOCK_DEFINES}
317   )
318   target_include_directories(folly_test_support
319     PUBLIC
320       ${LIBGMOCK_INCLUDE_DIR}
321   )
322   target_link_libraries(folly_test_support
323     PUBLIC
324       Boost::thread
325       folly
326       ${LIBGMOCK_LIBRARY}
327   )
328   apply_folly_compile_options_to_target(folly_test_support)
329
330   folly_define_tests(
331     DIRECTORY chrono/test/
332       TEST chrono_conv_test SOURCES ConvTest.cpp
333
334     DIRECTORY compression/test/
335       TEST compression_test SOURCES CompressionTest.cpp
336
337     DIRECTORY container/test/
338       TEST access_test SOURCES AccessTest.cpp
339       TEST array_test SOURCES ArrayTest.cpp
340       TEST enumerate_test SOURCES EnumerateTest.cpp
341       TEST evicting_cache_map_test SOURCES EvictingCacheMapTest.cpp
342       TEST foreach_test SOURCES ForeachTest.cpp
343       TEST merge_test SOURCES MergeTest.cpp
344       TEST sparse_byte_set_test SOURCES SparseByteSetTest.cpp
345
346     DIRECTORY concurrency/test/
347       TEST cache_locality_test SOURCES CacheLocalityTest.cpp
348
349     DIRECTORY executors/test/
350       TEST async_helpers_test SOURCES AsyncTest.cpp
351       TEST codel_test SOURCES CodelTest.cpp
352       TEST executor_test SOURCES ExecutorTest.cpp
353       TEST fiber_io_executor_test SOURCES FiberIOExecutorTest.cpp
354       TEST global_executor_test SOURCES GlobalExecutorTest.cpp
355       TEST serial_executor_test SOURCES SerialExecutorTest.cpp
356       TEST thread_pool_executor_test SOURCES ThreadPoolExecutorTest.cpp
357       TEST threaded_executor_test SOURCES ThreadedExecutorTest.cpp
358
359     DIRECTORY executors/task_queue/test/
360       TEST unbounded_blocking_queue_test SOURCES UnboundedBlockingQueueTest.cpp
361
362     DIRECTORY experimental/test/
363       TEST autotimer_test SOURCES AutoTimerTest.cpp
364       TEST bits_test_2 SOURCES BitsTest.cpp
365       TEST bitvector_test SOURCES BitVectorCodingTest.cpp
366       TEST dynamic_parser_test SOURCES DynamicParserTest.cpp
367       TEST eliasfano_test SOURCES EliasFanoCodingTest.cpp
368       TEST event_count_test SOURCES EventCountTest.cpp
369       TEST function_scheduler_test_2 SOURCES FunctionSchedulerTest.cpp
370       TEST future_dag_test SOURCES FutureDAGTest.cpp
371       TEST json_schema_test SOURCES JSONSchemaTest.cpp
372       TEST lock_free_ring_buffer_test SOURCES LockFreeRingBufferTest.cpp
373       #TEST nested_command_line_app_test SOURCES NestedCommandLineAppTest.cpp
374       #TEST program_options_test SOURCES ProgramOptionsTest.cpp
375       # Depends on liburcu
376       #TEST read_mostly_shared_ptr_test SOURCES ReadMostlySharedPtrTest.cpp
377       #TEST ref_count_test SOURCES RefCountTest.cpp
378       TEST stringkeyed_test SOURCES StringKeyedTest.cpp
379       TEST test_util_test SOURCES TestUtilTest.cpp
380       TEST tuple_ops_test SOURCES TupleOpsTest.cpp
381
382     DIRECTORY experimental/io/test/
383       # Depends on libaio
384       #TEST async_io_test SOURCES AsyncIOTest.cpp
385       TEST fs_util_test SOURCES FsUtilTest.cpp
386
387     DIRECTORY experimental/logging/test/
388       TEST async_file_writer_test SOURCES AsyncFileWriterTest.cpp
389       TEST config_parser_test SOURCES ConfigParserTest.cpp
390       TEST config_update_test SOURCES ConfigUpdateTest.cpp
391       TEST file_handler_factory_test SOURCES FileHandlerFactoryTest.cpp
392       TEST glog_formatter_test SOURCES GlogFormatterTest.cpp
393       TEST immediate_file_writer_test SOURCES ImmediateFileWriterTest.cpp
394       TEST log_category_test SOURCES LogCategoryTest.cpp
395       TEST logger_db_test SOURCES LoggerDBTest.cpp
396       TEST logger_test SOURCES LoggerTest.cpp
397       TEST log_level_test SOURCES LogLevelTest.cpp
398       TEST log_message_test SOURCES LogMessageTest.cpp
399       TEST log_name_test SOURCES LogNameTest.cpp
400       TEST log_stream_test SOURCES LogStreamTest.cpp
401       TEST printf_test SOURCES PrintfTest.cpp
402       TEST rate_limiter_test SOURCES RateLimiterTest.cpp
403       TEST standard_log_handler_test SOURCES StandardLogHandlerTest.cpp
404       TEST xlog_test
405         HEADERS
406           XlogHeader1.h
407           XlogHeader2.h
408         SOURCES
409           XlogFile1.cpp
410           XlogFile2.cpp
411           XlogTest.cpp
412
413     DIRECTORY fibers/test/
414       TEST fibers_test SOURCES FibersTest.cpp
415
416     DIRECTORY functional/test/
417       TEST apply_tuple_test SOURCES ApplyTupleTest.cpp
418       TEST partial_test SOURCES PartialTest.cpp
419
420     DIRECTORY futures/test/
421       TEST barrier_test SOURCES BarrierTest.cpp
422       TEST callback_lifetime_test SOURCES CallbackLifetimeTest.cpp
423       TEST collect_test SOURCES CollectTest.cpp
424       TEST context_test SOURCES ContextTest.cpp
425       TEST core_test SOURCES CoreTest.cpp
426       TEST ensure_test SOURCES EnsureTest.cpp
427       TEST fsm_test SOURCES FSMTest.cpp
428       TEST filter_test SOURCES FilterTest.cpp
429       TEST future_splitter_test SOURCES FutureSplitterTest.cpp
430       # MSVC SFINAE bug
431       #TEST future_test SOURCES FutureTest.cpp
432       TEST header_compile_test SOURCES HeaderCompileTest.cpp
433       TEST interrupt_test SOURCES InterruptTest.cpp
434       TEST map_test SOURCES MapTest.cpp
435       TEST non_copyable_lambda_test SOURCES NonCopyableLambdaTest.cpp
436       TEST poll_test SOURCES PollTest.cpp
437       TEST promise_test SOURCES PromiseTest.cpp
438       TEST reduce_test SOURCES ReduceTest.cpp
439       # MSVC SFINAE bug
440       #TEST retrying_test SOURCES RetryingTest.cpp
441       TEST self_destruct_test SOURCES SelfDestructTest.cpp
442       TEST shared_promise_test SOURCES SharedPromiseTest.cpp
443       TEST test_executor_test SOURCES TestExecutorTest.cpp
444       TEST then_compile_test
445         HEADERS
446           ThenCompileTest.h
447         SOURCES
448           ThenCompileTest.cpp
449       TEST then_test SOURCES ThenTest.cpp
450       TEST timekeeper_test SOURCES TimekeeperTest.cpp
451       TEST times_test SOURCES TimesTest.cpp
452       TEST unwrap_test SOURCES UnwrapTest.cpp
453       TEST via_test SOURCES ViaTest.cpp
454       TEST wait_test SOURCES WaitTest.cpp
455       TEST when_test SOURCES WhenTest.cpp
456       TEST while_do_test SOURCES WhileDoTest.cpp
457       TEST will_equal_test SOURCES WillEqualTest.cpp
458       TEST window_test SOURCES WindowTest.cpp
459
460     DIRECTORY gen/test/
461       # MSVC bug can't resolve initializer_list constructor properly
462       #TEST base_test SOURCES BaseTest.cpp
463       TEST combine_test SOURCES CombineTest.cpp
464       TEST parallel_map_test SOURCES ParallelMapTest.cpp
465       TEST parallel_test SOURCES ParallelTest.cpp
466
467     DIRECTORY hash/test/
468       TEST checksum_test SOURCES ChecksumTest.cpp
469       TEST hash_test SOURCES HashTest.cpp
470       TEST spooky_hash_v1_test SOURCES SpookyHashV1Test.cpp
471       TEST spooky_hash_v2_test SOURCES SpookyHashV2Test.cpp
472
473     DIRECTORY io/test/
474       TEST iobuf_test SOURCES IOBufTest.cpp
475       TEST iobuf_cursor_test SOURCES IOBufCursorTest.cpp
476       TEST iobuf_queue_test SOURCES IOBufQueueTest.cpp
477       TEST record_io_test SOURCES RecordIOTest.cpp
478       TEST ShutdownSocketSetTest HANGING
479         SOURCES ShutdownSocketSetTest.cpp
480
481     DIRECTORY io/async/test/
482       TEST async_test
483         CONTENT_DIR certs/
484         HEADERS
485           AsyncSocketTest.h
486           AsyncSSLSocketTest.h
487         SOURCES
488           AsyncPipeTest.cpp
489           AsyncSocketExceptionTest.cpp
490           AsyncSocketTest.cpp
491           AsyncSocketTest2.cpp
492           AsyncSSLSocketTest.cpp
493           AsyncSSLSocketTest2.cpp
494           AsyncSSLSocketWriteTest.cpp
495           AsyncTransportTest.cpp
496           # This is disabled because it depends on things that don't exist
497           # on Windows.
498           #EventHandlerTest.cpp
499           # The async signal handler is not supported on Windows.
500           #AsyncSignalHandlerTest.cpp
501       TEST async_timeout_test SOURCES AsyncTimeoutTest.cpp
502       TEST AsyncUDPSocketTest SOURCES AsyncUDPSocketTest.cpp
503       TEST DelayedDestructionTest SOURCES DelayedDestructionTest.cpp
504       TEST DelayedDestructionBaseTest SOURCES DelayedDestructionBaseTest.cpp
505       TEST DestructorCheckTest SOURCES DestructorCheckTest.cpp
506       TEST EventBaseTest SOURCES EventBaseTest.cpp
507       TEST EventBaseLocalTest SOURCES EventBaseLocalTest.cpp
508       TEST HHWheelTimerTest SOURCES HHWheelTimerTest.cpp
509       TEST HHWheelTimerSlowTests SLOW
510         SOURCES HHWheelTimerSlowTests.cpp
511       TEST NotificationQueueTest SOURCES NotificationQueueTest.cpp
512       TEST RequestContextTest SOURCES RequestContextTest.cpp
513       TEST ScopedEventBaseThreadTest SOURCES ScopedEventBaseThreadTest.cpp
514       TEST ssl_session_test SOURCES SSLSessionTest.cpp
515       TEST writechain_test SOURCES WriteChainAsyncTransportWrapperTest.cpp
516
517     DIRECTORY io/async/ssl/test/
518       TEST ssl_errors_test SOURCES SSLErrorsTest.cpp
519
520     DIRECTORY lang/test/
521       TEST bits_test SOURCES BitsTest.cpp
522
523     DIRECTORY memory/test/
524       TEST arena_test SOURCES ArenaTest.cpp
525       TEST thread_cached_arena_test SOURCES ThreadCachedArenaTest.cpp
526       TEST mallctl_helper_test SOURCES MallctlHelperTest.cpp
527
528     DIRECTORY portability/test/
529       TEST constexpr_test SOURCES ConstexprTest.cpp
530       TEST libgen-test SOURCES LibgenTest.cpp
531       TEST openssl_portability_test SOURCES OpenSSLPortabilityTest.cpp
532       TEST time-test SOURCES TimeTest.cpp
533
534     DIRECTORY ssl/test/
535       TEST openssl_hash_test SOURCES OpenSSLHashTest.cpp
536
537     DIRECTORY stats/test/
538       TEST histogram_test SOURCES HistogramTest.cpp
539       TEST timeseries_histogram_test SOURCES TimeseriesHistogramTest.cpp
540       TEST timeseries_test SOURCES TimeseriesTest.cpp
541
542     DIRECTORY synchronization/test/
543       TEST baton_test SOURCES BatonTest.cpp
544       TEST call_once_test SOURCES CallOnceTest.cpp
545       TEST lifo_sem_test SOURCES LifoSemTests.cpp
546
547     DIRECTORY system/test/
548       TEST memory_mapping_test SOURCES MemoryMappingTest.cpp
549       TEST shell_test SOURCES ShellTest.cpp
550       #TEST subprocess_test SOURCES SubprocessTest.cpp
551       TEST thread_id_test SOURCES ThreadIdTest.cpp
552       TEST thread_name_test SOURCES ThreadNameTest.cpp
553
554     DIRECTORY test/
555       TEST ahm_int_stress_test SOURCES AHMIntStressTest.cpp
556       TEST arena_smartptr_test SOURCES ArenaSmartPtrTest.cpp
557       TEST ascii_check_test SOURCES AsciiCaseInsensitiveTest.cpp
558       TEST atomic_bit_set_test SOURCES AtomicBitSetTest.cpp
559       TEST atomic_hash_array_test SOURCES AtomicHashArrayTest.cpp
560       TEST atomic_hash_map_test HANGING
561         SOURCES AtomicHashMapTest.cpp
562       TEST atomic_linked_list_test SOURCES AtomicLinkedListTest.cpp
563       TEST atomic_struct_test SOURCES AtomicStructTest.cpp
564       TEST atomic_unordered_map_test SOURCES AtomicUnorderedMapTest.cpp
565       TEST bit_iterator_test SOURCES BitIteratorTest.cpp
566       TEST cacheline_padded_test SOURCES CachelinePaddedTest.cpp
567       TEST clock_gettime_wrappers_test SOURCES ClockGettimeWrappersTest.cpp
568       TEST concurrent_skip_list_test SOURCES ConcurrentSkipListTest.cpp
569       TEST container_traits_test SOURCES ContainerTraitsTest.cpp
570       TEST conv_test SOURCES ConvTest.cpp
571       TEST cpu_id_test SOURCES CpuIdTest.cpp
572       TEST demangle_test SOURCES DemangleTest.cpp
573       TEST deterministic_schedule_test SOURCES DeterministicScheduleTest.cpp
574       TEST discriminated_ptr_test SOURCES DiscriminatedPtrTest.cpp
575       TEST dynamic_test SOURCES DynamicTest.cpp
576       TEST dynamic_converter_test SOURCES DynamicConverterTest.cpp
577       TEST dynamic_other_test SOURCES DynamicOtherTest.cpp
578       TEST endian_test SOURCES EndianTest.cpp
579       TEST exception_test SOURCES ExceptionTest.cpp
580       TEST exception_wrapper_test SOURCES ExceptionWrapperTest.cpp
581       TEST expected_test SOURCES ExpectedTest.cpp
582       TEST fbvector_test SOURCES FBVectorTest.cpp
583       TEST file_test SOURCES FileTest.cpp
584       #TEST file_lock_test SOURCES FileLockTest.cpp
585       TEST file_util_test HANGING
586         SOURCES FileUtilTest.cpp
587       TEST fingerprint_test SOURCES FingerprintTest.cpp
588       TEST format_other_test SOURCES FormatOtherTest.cpp
589       TEST format_test SOURCES FormatTest.cpp
590       TEST function_scheduler_test SOURCES FunctionSchedulerTest.cpp
591       TEST function_test BROKEN
592         SOURCES FunctionTest.cpp
593       TEST function_ref_test SOURCES FunctionRefTest.cpp
594       TEST futex_test SOURCES FutexTest.cpp
595       TEST group_varint_test SOURCES GroupVarintTest.cpp
596       TEST group_varint_test_ssse3 SOURCES GroupVarintTest.cpp
597       TEST has_member_fn_traits_test SOURCES HasMemberFnTraitsTest.cpp
598       TEST indestructible_test SOURCES IndestructibleTest.cpp
599       TEST indexed_mem_pool_test BROKEN
600         SOURCES IndexedMemPoolTest.cpp
601       # MSVC Preprocessor stringizing raw string literals bug
602       #TEST json_test SOURCES JsonTest.cpp
603       TEST json_other_test
604         CONTENT_DIR json_test_data/
605         SOURCES
606           JsonOtherTest.cpp
607       TEST lazy_test SOURCES LazyTest.cpp
608       TEST lock_traits_test SOURCES LockTraitsTest.cpp
609       TEST locks_test SOURCES SmallLocksTest.cpp SpinLockTest.cpp
610       TEST logging_test SOURCES LoggingTest.cpp
611       TEST math_test SOURCES MathTest.cpp
612       TEST map_util_test SOURCES MapUtilTest.cpp
613       TEST memcpy_test SOURCES MemcpyTest.cpp
614       TEST memory_idler_test SOURCES MemoryIdlerTest.cpp
615       TEST memory_test SOURCES MemoryTest.cpp
616       TEST move_wrapper_test SOURCES MoveWrapperTest.cpp
617       TEST mpmc_pipeline_test SOURCES MPMCPipelineTest.cpp
618       TEST mpmc_queue_test SLOW
619         SOURCES MPMCQueueTest.cpp
620       TEST network_address_test HANGING
621         SOURCES
622           IPAddressTest.cpp
623           MacAddressTest.cpp
624           SocketAddressTest.cpp
625       TEST optional_test SOURCES OptionalTest.cpp
626       TEST packed_sync_ptr_test HANGING
627         SOURCES PackedSyncPtrTest.cpp
628       TEST padded_test SOURCES PaddedTest.cpp
629       #TEST poly_test SOURCES PolyTest.cpp
630       TEST portability_test SOURCES PortabilityTest.cpp
631       TEST producer_consumer_queue_test SLOW
632         SOURCES ProducerConsumerQueueTest.cpp
633       TEST r_w_spin_lock_test SOURCES RWSpinLockTest.cpp
634       TEST random_test SOURCES RandomTest.cpp
635       TEST range_test SOURCES RangeTest.cpp
636       TEST safe_assert_test SOURCES SafeAssertTest.cpp
637       TEST scope_guard_test SOURCES ScopeGuardTest.cpp
638       # Heavily dependent on drand and srand48
639       #TEST shared_mutex_test SOURCES SharedMutexTest.cpp
640       TEST singleton_test SOURCES SingletonTest.cpp
641       TEST singleton_test_global SOURCES SingletonTestGlobal.cpp
642       TEST singleton_thread_local_test SOURCES SingletonThreadLocalTest.cpp
643       TEST singletonvault_c_test SOURCES SingletonVaultCTest.cpp
644       TEST small_vector_test SOURCES small_vector_test.cpp
645       TEST sorted_vector_types_test SOURCES sorted_vector_test.cpp
646       TEST string_test SOURCES StringTest.cpp
647       TEST synchronized_test SOURCES SynchronizedTest.cpp
648       TEST thread_cached_int_test SOURCES ThreadCachedIntTest.cpp
649       TEST thread_local_test SOURCES ThreadLocalTest.cpp
650       TEST timeout_queue_test SOURCES TimeoutQueueTest.cpp
651       TEST token_bucket_test SOURCES TokenBucketTest.cpp
652       TEST traits_test SOURCES TraitsTest.cpp
653       TEST try_test SOURCES TryTest.cpp
654       TEST unit_test SOURCES UnitTest.cpp
655       TEST uri_test SOURCES UriTest.cpp
656       TEST varint_test SOURCES VarintTest.cpp
657   )
658 endif()