-
Notifications
You must be signed in to change notification settings - Fork 26
/
CMakeLists.txt
42 lines (32 loc) · 1.25 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
cmake_minimum_required(VERSION 3.2)
project(aria)
#set(CMAKE_BUILD_TYPE Debug)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -Wall -Wno-long-long -Wno-unused-variable -Wno-variadic-macros -pedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -Wall -Wno-long-long -Wno-unused-variable -Wno-variadic-macros -pedantic -O2")
set(CMAKE_CXX_STANDARD 14)
find_library(jemalloc_lib jemalloc) # jemalloc 5.0
# additional target to perform clang-format run, requires clang-format
# get all project files
file(GLOB_RECURSE ALL_SOURCE_FILES benchmark/*.h common/*.h core/*.h protocol/*.h bench*.cpp)
add_custom_target(
format
COMMAND clang-format
-style=LLVM
-i
-sort-includes
${ALL_SOURCE_FILES}
)
include_directories(${CMAKE_SOURCE_DIR})
file(GLOB_RECURSE COMMON_SOURCE_FILES common/*.cpp)
add_library(common STATIC ${COMMON_SOURCE_FILES})
if(APPLE)
find_package(glog REQUIRED)
find_package(gflags REQUIRED)
target_link_libraries(common ${jemalloc_lib} glog::glog gflags)
else()
target_link_libraries(common ${jemalloc_lib} glog gflags)
endif()
add_executable(bench_tpcc bench_tpcc.cpp)
target_link_libraries(bench_tpcc common)
add_executable(bench_ycsb bench_ycsb.cpp)
target_link_libraries(bench_ycsb common)