-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
124 lines (103 loc) · 3.67 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
cmake_minimum_required(VERSION 3.10)
project(bliss_benchmark VERSION 1.0
DESCRIPTION "Benchmark for sortedness on various indexes"
LANGUAGES CXX
)
set(BUILD_TESTING OFF CACHE BOOL "Disable testing" FORCE)
set(LEVELDB_BUILD_TESTS OFF CACHE BOOL "Disable LevelDB tests" FORCE)
include(ExternalProject)
message(STATUS "CXX : ${CMAKE_CXX_COMPILER}")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
enable_testing()
if(CMAKE_BUILD_TYPE STREQUAL Debug)
ADD_DEFINITIONS(-DDEBUG)
endif()
# =============================================================================
# HEADER git-submodules
# =============================================================================
find_package(Git QUIET)
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_SUBMOD_RESULT
)
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
endif()
endif()
# =============================================================================
# HEADER external
# add external libs (after git submodule init)
# =============================================================================
add_subdirectory(external)
add_subdirectory(tests)
# =============================================================================
# HEADER bliss
# Bliss lib files
# =============================================================================
option(COMPILE_COLUMNSKETCHES "compile_column_sketches" OFF)
add_library(bliss OBJECT
${CMAKE_SOURCE_DIR}/src/bliss/util/timer.h
${CMAKE_SOURCE_DIR}/src/bliss/util/reader.h
${CMAKE_SOURCE_DIR}/src/bliss/util/args.h
${CMAKE_SOURCE_DIR}/src/bliss/util/config.h
${CMAKE_SOURCE_DIR}/src/bliss/bliss_index.h
${CMAKE_SOURCE_DIR}/src/bliss/bench_lipp.h
${CMAKE_SOURCE_DIR}/src/bliss/bench_alex.h
${CMAKE_SOURCE_DIR}/src/bliss/bench_btree.h
${CMAKE_SOURCE_DIR}/src/bliss/bench_imprints.h
${CMAKE_SOURCE_DIR}/src/bliss/bench_columnsketches.h
${CMAKE_SOURCE_DIR}/src/bliss/bench_skiplist.h
${CMAKE_SOURCE_DIR}/src/bliss/bench_byteslice.h
${CMAKE_SOURCE_DIR}/src/bliss/bench_pgm.h
${CMAKE_SOURCE_DIR}/src/bliss/bench_art.h
${CMAKE_SOURCE_DIR}/src/bliss/bench_leveldb.h
)
target_compile_features(bliss PUBLIC
cxx_std_17
)
target_link_libraries(bliss PUBLIC
spdlog::spdlog
cxxopts
alex
lipp
tlx
byteslice
imprints
skiplist
pgm
art
)
if(COMPILE_COLUMNSKETCHES)
target_link_libraries(bliss PUBLIC
columnsketches
)
endif()
target_include_directories(bliss PUBLIC
${CMAKE_SOURCE_DIR}/src
)
target_compile_options(bliss PUBLIC
"-Wall"
"-Wextra"
"-fstack-protector-strong"
"-fexceptions"
"-fasynchronous-unwind-tables"
"-march=native"
)
target_include_directories(bliss PUBLIC
${CMAKE_SOURCE_DIR}/src
)
# =============================================================================
# HEADER bliss
# Executable and linking libraries
# =============================================================================
add_executable(bliss_bench src/bliss_bench.cpp)
target_link_libraries(bliss_bench PUBLIC
bliss
)
add_subdirectory(${CMAKE_SOURCE_DIR}/external/leveldb_bliss)
target_include_directories(bliss PUBLIC ${CMAKE_SOURCE_DIR}/external/leveldb_bliss/include)
target_link_libraries(bliss PRIVATE leveldb)
include_directories(${CMAKE_SOURCE_DIR}/external/leveldb_bliss/include)