-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCMakeLists.txt
84 lines (76 loc) · 2.79 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
cmake_minimum_required(VERSION 3.0)
enable_testing()
project(L5RDMA CXX)
IF (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release
CACHE STRING "Choose the type of build : None Debug Release RelWithDebInfo."
FORCE)
ENDIF (NOT CMAKE_BUILD_TYPE)
set(CMAKE_CXX_STANDARD 17)
#set(CMAKE_CXX_COMPILER clang++)
#set(WARNINGS "-Weverything -Wno-c++98-compat -Wno-shadow-field-in-constructor -Wno-documentation-unknown-command -Wno-shadow -Wno-padded")
set(WARNINGS "-Wall -Wextra -Wnon-virtual-dtor -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict")
set(WARNINGS "${WARNINGS} -Wnull-dereference -Wold-style-cast -Wuseless-cast -Wdouble-promotion")
set(WARNINGS "${WARNINGS} -Wformat=2 -Wshadow=local -Wodr")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic ${WARNINGS} -fshow-column -pipe -march=native")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0 -DDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address -fsanitize=leak")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -flto -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -fno-omit-frame-pointer")
file(GLOB COMMON_SOURCES
datastructures/*.cpp
rdma/*.cpp
transports/*.cpp
util/*.cpp
util/socket/*.cpp
)
file(GLOB COMMON_HEADERS
datastructures/*.h
rdma/*.h
transports/*.h
util/*.h
util/socket/*.h
)
SET(LINK_LIBRARIES
ibverbs
rt
pthread
rdmacm
tbb
)
add_library(l5rdma-common STATIC ${COMMON_SOURCES} ${COMMON_HEADERS})
target_include_directories(l5rdma-common PUBLIC .)
target_include_directories(l5rdma-common SYSTEM PUBLIC ext/libibverbscpp)
target_link_libraries(l5rdma-common ${LINK_LIBRARIES})
SET(EXECUTABLES
p2pBench
point2PointBench
parallelP2PBench
rawCommandBench
indirectWriteBench
multiclientPollingBench
multiclientRecvVsPoll
many2OneBench
zeroCopyBench
ycsbWorkloadCBench
manySlowSendersBench
ycsbBandwidthBench
ycsbParallelBandwidthBench
bandwidthBench
bufferBandwidthBench
blockedBandwidthBench
)
foreach (exe ${EXECUTABLES})
add_executable(${exe} ${exe}.cpp)
target_link_libraries(${exe} l5rdma-common)
target_include_directories(${exe} PRIVATE .)
endforeach ()
file(GLOB tests "test/*Test.cpp")
foreach (test ${tests})
get_filename_component(testName ${test} NAME_WE)
add_executable(${testName} ${test})
target_link_libraries(${testName} l5rdma-common)
target_include_directories(${testName} PRIVATE .)
add_test(${testName} ${testName})
endforeach ()