forked from yuhong-zhong/My-YCSB
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
83 lines (73 loc) · 2.95 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
cmake_minimum_required(VERSION 3.10)
project(My_YCSB)
set(CMAKE_CXX_STANDARD 17)
find_package(yaml-cpp REQUIRED)
include_directories(${YAML_CPP_INCLUDE_DIR})
# Debug mode
# set(CMAKE_BUILD_TYPE Debug)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -rdynamic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
# Enable all warnings and safety flags
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(
-Wall
-Wextra
-Wpedantic
# -Wshadow
# -Wnon-virtual-dtor
# -Wold-style-cast
-Wcast-align
-Wunused
-Woverloaded-virtual
-Wconversion
-Wsign-conversion
-Wnull-dereference
-Wdouble-promotion
-Wformat=2
-Wimplicit-fallthrough
-Wmisleading-indentation
-Wduplicated-cond
-Wduplicated-branches
-Wlogical-op
-Wuseless-cast
-Wno-reorder
)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
add_compile_options(
/W4
/WX
/permissive-
/sdl
/Zc:__cplusplus
/Zc:inline
/Zc:forScope
/Zc:rvalueCast
)
endif()
include_directories(/usr/local/include)
include_directories(core/include)
set(CoreSource core/client.cpp
core/measurement.cpp
core/worker.cpp
core/workload.cpp)
set(WiredTigerClientSource wiredtiger/wt_client.cpp)
add_executable(init_wt ${CoreSource} ${WiredTigerClientSource} wiredtiger/init_wt.cpp)
add_executable(run_wt ${CoreSource} ${WiredTigerClientSource} wiredtiger/run_wt.cpp)
target_link_libraries(init_wt /usr/local/lib/libwiredtiger.so pthread ${YAML_CPP_LIBRARIES})
target_link_libraries(run_wt /usr/local/lib/libwiredtiger.so pthread ${YAML_CPP_LIBRARIES})
# Add the same for RocksDB
set(RocksDBClientSource rocksdb/rocksdb_client.cpp)
add_executable(init_rocksdb ${CoreSource} ${RocksDBClientSource} rocksdb/init_rocksdb.cpp)
add_executable(run_rocksdb ${CoreSource} ${RocksDBClientSource} rocksdb/run_rocksdb.cpp)
target_link_libraries(init_rocksdb /usr/local/lib/librocksdb.so pthread ${YAML_CPP_LIBRARIES})
target_link_libraries(run_rocksdb /usr/local/lib/librocksdb.so pthread ${YAML_CPP_LIBRARIES})
set(RedisClientSource redis/redis_client.cpp)
add_executable(init_redis ${CoreSource} ${RedisClientSource} redis/init_redis.cpp)
add_executable(run_redis ${CoreSource} ${RedisClientSource} redis/run_redis.cpp)
target_link_libraries(init_redis pthread hiredis ${YAML_CPP_LIBRARIES})
target_link_libraries(run_redis pthread hiredis ${YAML_CPP_LIBRARIES})
set(MemcachedClientSource memcached/memcached_client.cpp)
add_executable(init_memcached ${CoreSource} ${MemcachedClientSource} memcached/init_memcached.cpp)
add_executable(run_memcached ${CoreSource} ${MemcachedClientSource} memcached/run_memcached.cpp)
target_link_libraries(init_memcached pthread memcached ${YAML_CPP_LIBRARIES})
target_link_libraries(run_memcached pthread memcached ${YAML_CPP_LIBRARIES})