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