summaryrefslogtreecommitdiffstats
path: root/src/msg/CMakeLists.txt
blob: e8cc3fdabdf675e9dd93be5c54045a381d3fa751 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
set(msg_srcs
  DispatchQueue.cc
  Message.cc
  Messenger.cc
  Connection.cc
  msg_types.cc
  compressor_registry.cc)

list(APPEND msg_srcs
  async/AsyncConnection.cc
  async/AsyncMessenger.cc
  async/Protocol.cc
  async/ProtocolV1.cc
  async/ProtocolV2.cc
  async/Event.cc
  async/EventSelect.cc
  async/PosixStack.cc
  async/Stack.cc
  async/crypto_onwire.cc
  async/compression_onwire.cc
  async/frames_v2.cc
  async/net_handler.cc)

if(LINUX)
  list(APPEND msg_srcs
    async/EventEpoll.cc)
elseif(FREEBSD OR APPLE)
  list(APPEND msg_srcs
    async/EventKqueue.cc)
endif(LINUX)

if(WIN32)
  list(APPEND msg_srcs
    async/EventPoll.cc)
endif(WIN32)

if(HAVE_RDMA)
  list(APPEND msg_srcs
    async/rdma/Infiniband.cc
    async/rdma/RDMAConnectedSocketImpl.cc
    async/rdma/RDMAIWARPConnectedSocketImpl.cc
    async/rdma/RDMAServerSocketImpl.cc
    async/rdma/RDMAIWARPServerSocketImpl.cc
    async/rdma/RDMAStack.cc)
endif()

add_library(common-msg-objs OBJECT ${msg_srcs})
target_compile_definitions(common-msg-objs PRIVATE
  $<TARGET_PROPERTY:fmt::fmt,INTERFACE_COMPILE_DEFINITIONS>)
target_include_directories(common-msg-objs PRIVATE ${OPENSSL_INCLUDE_DIR})

if(WITH_DPDK)
  set(async_dpdk_srcs
    async/dpdk/ARP.cc
    async/dpdk/DPDK.cc
    async/dpdk/dpdk_rte.cc
    async/dpdk/DPDKStack.cc
    async/dpdk/EventDPDK.cc
    async/dpdk/IP.cc
    async/dpdk/net.cc
    async/dpdk/IPChecksum.cc
    async/dpdk/Packet.cc
    async/dpdk/TCP.cc
    async/dpdk/UserspaceEvent.cc
    async/dpdk/ethernet.cc)
  add_library(common_async_dpdk STATIC
    ${async_dpdk_srcs})
  target_link_libraries(common_async_dpdk PRIVATE
    dpdk::dpdk)
  # Stack.cc includes DPDKStack.h, which includes rte_config.h indirectly
  target_include_directories(common-msg-objs PRIVATE
    $<TARGET_PROPERTY:dpdk::dpdk,INTERFACE_INCLUDE_DIRECTORIES>)
endif(WITH_DPDK)