-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
57 lines (46 loc) · 1.43 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
project(nnbtree)
cmake_minimum_required(VERSION 3.0)
# -march=native used to detect CPU flags and use corrosponding flush instruction
set(CMAKE_CXX_FLAGS "-march=native -g")
# Require C++17
set(CMAKE_CXX_STANDARD_REQUIRED on)
set(CMAKE_CXX_STANDARD 17)
# nnbtree shared library
include_directories(
include
include/nnbtree
include/fast_fair
)
set(NNBTREE_HEAD_LIST
include
include/nnbtree
include/fast_fair
)
set(NNBTREE_SRC
src/index_btree.cc
src/environment.cc
src/numa_config.cc
)
add_library(nnbtree SHARED ${NNBTREE_SRC})
target_link_libraries(nnbtree pmem pmemobj pthread)
target_include_directories(nnbtree PUBLIC ${NNBTREE_HEAD_LIST})
# simple test
add_executable(simple_test tests/test.cc)
target_link_libraries(simple_test nnbtree rt m)
# 如何增加编译选项-DMIXED?
add_executable(simple_test_mixed tests/test.cc)
target_link_libraries(simple_test_mixed nnbtree rt m)
# microbench
add_executable(microbench tests/micro_bench.cc)
target_link_libraries(microbench nnbtree)
target_include_directories(microbench PUBLIC ${NNBTREE_HEAD_LIST})
add_test(microbench microbench)
# multibench
add_executable(multibench tests/multi_bench.cc)
target_link_libraries(multibench nnbtree)
target_include_directories(multibench PUBLIC ${NNBTREE_HEAD_LIST})
add_test(multibench multibench)
#spinlock_test
add_executable(spinlock_test tests/spinlock_test.cc)
target_link_libraries(spinlock_test pthread)
add_test(spinlock_test spinlock_test)