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