2018-05-03 00:55:29 +08:00
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
|
|
|
set(FLOW_SRCS
|
|
|
|
ActorCollection.actor.cpp
|
|
|
|
ActorCollection.h
|
2020-02-29 04:33:57 +08:00
|
|
|
Arena.cpp
|
2018-05-03 00:55:29 +08:00
|
|
|
Arena.h
|
|
|
|
AsioReactor.h
|
|
|
|
CompressedInt.actor.cpp
|
|
|
|
CompressedInt.h
|
|
|
|
Deque.cpp
|
|
|
|
Deque.h
|
2019-12-05 05:32:38 +08:00
|
|
|
DeterministicRandom.cpp
|
2018-05-03 00:55:29 +08:00
|
|
|
DeterministicRandom.h
|
|
|
|
Error.cpp
|
|
|
|
Error.h
|
|
|
|
EventTypes.actor.h
|
|
|
|
FastAlloc.cpp
|
|
|
|
FastAlloc.h
|
|
|
|
FastRef.h
|
|
|
|
FaultInjection.cpp
|
|
|
|
FaultInjection.h
|
2018-12-14 07:52:27 +08:00
|
|
|
FileTraceLogWriter.cpp
|
|
|
|
FileTraceLogWriter.h
|
2018-05-03 00:55:29 +08:00
|
|
|
Hash3.c
|
|
|
|
Hash3.h
|
|
|
|
IDispatched.h
|
|
|
|
IRandom.h
|
|
|
|
IThreadPool.cpp
|
|
|
|
IThreadPool.h
|
|
|
|
IndexedSet.actor.h
|
|
|
|
IndexedSet.cpp
|
|
|
|
IndexedSet.h
|
2019-01-10 07:58:18 +08:00
|
|
|
JsonTraceLogFormatter.cpp
|
|
|
|
JsonTraceLogFormatter.h
|
2018-05-03 00:55:29 +08:00
|
|
|
Knobs.cpp
|
|
|
|
Knobs.h
|
|
|
|
MetricSample.h
|
|
|
|
Net2.actor.cpp
|
|
|
|
Net2Packet.cpp
|
|
|
|
Net2Packet.h
|
|
|
|
Platform.cpp
|
|
|
|
Platform.h
|
|
|
|
Profiler.actor.cpp
|
|
|
|
Profiler.h
|
|
|
|
SignalSafeUnwind.cpp
|
|
|
|
SignalSafeUnwind.h
|
|
|
|
SimpleOpt.h
|
|
|
|
Stats.actor.cpp
|
|
|
|
Stats.h
|
|
|
|
SystemMonitor.cpp
|
|
|
|
SystemMonitor.h
|
|
|
|
TDMetric.actor.h
|
|
|
|
TDMetric.cpp
|
2020-03-05 12:14:47 +08:00
|
|
|
TLSConfig.actor.cpp
|
|
|
|
TLSConfig.actor.h
|
2018-05-03 00:55:29 +08:00
|
|
|
ThreadHelper.actor.h
|
|
|
|
ThreadHelper.cpp
|
|
|
|
ThreadPrimitives.cpp
|
|
|
|
ThreadPrimitives.h
|
|
|
|
ThreadSafeQueue.h
|
|
|
|
Trace.cpp
|
|
|
|
Trace.h
|
|
|
|
UnitTest.cpp
|
|
|
|
UnitTest.h
|
2018-12-14 07:52:27 +08:00
|
|
|
XmlTraceLogFormatter.cpp
|
2020-03-05 12:14:47 +08:00
|
|
|
XmlTraceLogFormatter.h
|
2018-05-03 00:55:29 +08:00
|
|
|
actorcompiler.h
|
2020-01-14 10:19:30 +08:00
|
|
|
crc32c.h
|
|
|
|
crc32c.cpp
|
2018-05-03 00:55:29 +08:00
|
|
|
error_definitions.h
|
2019-11-16 04:26:51 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/SourceVersion.h
|
2019-01-25 05:54:28 +08:00
|
|
|
flat_buffers.cpp
|
2020-03-05 12:14:47 +08:00
|
|
|
flat_buffers.h
|
2018-05-03 00:55:29 +08:00
|
|
|
flow.cpp
|
|
|
|
flow.h
|
|
|
|
genericactors.actor.cpp
|
|
|
|
genericactors.actor.h
|
|
|
|
network.cpp
|
|
|
|
network.h
|
2019-04-11 08:41:02 +08:00
|
|
|
serialize.cpp
|
2020-03-05 12:14:47 +08:00
|
|
|
serialize.h
|
2018-05-03 00:55:29 +08:00
|
|
|
stacktrace.amalgamation.cpp
|
2018-05-04 06:48:10 +08:00
|
|
|
stacktrace.h
|
|
|
|
version.cpp)
|
|
|
|
|
2019-11-16 04:26:51 +08:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/SourceVersion.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/SourceVersion.h)
|
2018-05-03 00:55:29 +08:00
|
|
|
|
2019-02-09 08:51:13 +08:00
|
|
|
add_flow_target(STATIC_LIBRARY NAME flow SRCS ${FLOW_SRCS})
|
2020-02-24 16:19:43 +08:00
|
|
|
target_include_directories(flow SYSTEM PUBLIC ${CMAKE_THREAD_LIBS_INIT})
|
2018-05-03 02:25:38 +08:00
|
|
|
target_include_directories(flow PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
2019-02-07 11:27:38 +08:00
|
|
|
if (NOT APPLE AND NOT WIN32)
|
2018-05-03 00:55:29 +08:00
|
|
|
set (FLOW_LIBS ${FLOW_LIBS} rt)
|
2019-02-07 11:27:38 +08:00
|
|
|
elseif(WIN32)
|
|
|
|
target_link_libraries(flow PUBLIC winmm.lib)
|
2019-12-17 00:09:10 +08:00
|
|
|
target_link_libraries(flow PUBLIC psapi.lib)
|
2018-05-03 00:55:29 +08:00
|
|
|
endif()
|
|
|
|
target_link_libraries(flow PRIVATE ${FLOW_LIBS})
|
2019-06-11 06:30:57 +08:00
|
|
|
if(USE_VALGRIND)
|
|
|
|
target_link_libraries(flow PUBLIC Valgrind)
|
|
|
|
endif()
|
2019-10-03 02:57:30 +08:00
|
|
|
# TODO(atn34) Re-enable TLS for OPEN_FOR_IDE build once #2201 is resolved
|
|
|
|
if(NOT WITH_TLS OR OPEN_FOR_IDE)
|
2019-02-06 14:20:44 +08:00
|
|
|
target_compile_definitions(flow PUBLIC TLS_DISABLED)
|
|
|
|
else()
|
2020-02-14 06:42:45 +08:00
|
|
|
target_link_libraries(flow PUBLIC OpenSSL::SSL)
|
2019-02-06 14:20:44 +08:00
|
|
|
endif()
|
2020-02-22 00:56:52 +08:00
|
|
|
target_link_libraries(flow PUBLIC boost_target Threads::Threads ${CMAKE_DL_LIBS})
|
|
|
|
if(USE_VALGRIND)
|
|
|
|
target_link_libraries(flow PUBLIC Valgrind)
|
2019-02-06 14:20:44 +08:00
|
|
|
endif()
|
2018-05-04 06:48:10 +08:00
|
|
|
|
|
|
|
if(APPLE)
|
|
|
|
find_library(IO_KIT IOKit)
|
|
|
|
find_library(CORE_FOUNDATION CoreFoundation)
|
|
|
|
target_link_libraries(flow PRIVATE ${IO_KIT} ${CORE_FOUNDATION})
|
|
|
|
endif()
|