-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
66 lines (55 loc) · 1.83 KB
/
CMakeLists.txt
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
#----------------------------------------------------------------------
#----------------------------------------------------------------------
cmake_minimum_required(VERSION 3.12.0)
project(ni-grpc-sideband C CXX)
option(INCLUDE_SIDEBAND_RDMA "Include support for RDMA sideband transfers" ON)
option(SIDEBAND_STATIC "Build static library, disabled by default" OFF)
if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
cmake_policy(SET CMP0091 NEW)
add_definitions(-D_WIN32_WINNT=0x600 -bigobj)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4244 /wd4018")
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
add_definitions(-D_BUILDING_GRPC_SIDEBAND)
if (INCLUDE_SIDEBAND_RDMA)
add_definitions(-DENABLE_RDMA_SIDEBAND)
endif()
if (INCLUDE_SIDEBAND_RDMA)
add_subdirectory(third_party/easyrdma ${CMAKE_CURRENT_BINARY_DIR}/easyrdma)
endif()
find_package(Threads REQUIRED)
link_directories("." "import")
#----------------------------------------------------------------------
# Include generated *.pb.h files
#----------------------------------------------------------------------
include_directories("${CMAKE_CURRENT_BINARY_DIR}" "./src")
#----------------------------------------------------------------------
# perftest gRPC Server
#----------------------------------------------------------------------
if(SIDEBAND_STATIC)
set(LIB_TYPE STATIC)
else()
set(LIB_TYPE SHARED)
endif()
add_library(ni_grpc_sideband ${LIB_TYPE}
src/sideband_data.cc
src/sideband_sockets.cc
src/sideband_shared_memory.cc
src/sideband_rdma.cc
)
target_include_directories(ni_grpc_sideband
PUBLIC
src
moniker_src)
if (INCLUDE_SIDEBAND_RDMA)
target_link_libraries(ni_grpc_sideband
${_REFLECTION}
easyrdma
)
else()
target_link_libraries(ni_grpc_sideband
${_REFLECTION}
)
endif()