-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
141 lines (114 loc) · 5.45 KB
/
CMakeLists.txt
File metadata and controls
141 lines (114 loc) · 5.45 KB
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
cmake_minimum_required(VERSION 3.14)
project(k2tree-dyn)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 99)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
# set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -Werror")
set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99 -pedantic -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition -Werror")
#set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99 -pedantic -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition")
set(CMAKE_C_FLAGS_DEBUG "-g")
#set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address")
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=c++17 -pedantic -Werror")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
#set(CMAKE_LINKER_FLAGS_DEBUG "-fsanitize=address")
option(WITH_DEBUG_STATS "Debug stats" OFF)
if(WITH_DEBUG_STATS)
add_definitions(-DDEBUG_STATS)
endif()
add_definitions(-DLIGHT_FIELDS)
set(SOURCES_REQUIRED
src/block.c
src/block_frontier.c
src/block_topology.c
src/custom_bv_handling.c
src/morton_code.c
src/queries_state.c
src/stacks.c
src/vectors.c
src/bitvector.c
src/k2node.c
)
set(SOURCES_MEM_DEFAULT
src/default_memalloc.c
)
set(SOURCES
${SOURCES_REQUIRED}
${SOURCES_MEM_DEFAULT}
)
include_directories(include)
add_library(k2dyn ${SOURCES})
target_link_libraries(k2dyn m)
add_executable(example1 example/example1.c)
add_executable(example2 example/example2.c)
add_executable(example3 example/example3.c)
add_executable(example4 example/example4.c)
add_executable(example5 example/example5.c)
add_executable(example6 example/example6.c)
add_executable(example7 example/example7.c)
target_link_libraries(example1 k2dyn)
target_link_libraries(example2 k2dyn)
target_link_libraries(example3 k2dyn)
target_link_libraries(example4 k2dyn)
target_link_libraries(example5 k2dyn)
target_link_libraries(example6 k2dyn)
target_link_libraries(example7 k2dyn)
add_executable(insertions_benchmarks benchmarks/insertions_benchmarks.cpp)
target_link_libraries(insertions_benchmarks k2dyn)
add_executable(size_benchmarks benchmarks/size_benchmarks.cpp)
target_link_libraries(size_benchmarks k2dyn)
add_executable(benchmark1 benchmarks/comparisons2/benchmark1.cpp)
target_link_libraries(benchmark1 k2dyn)
find_package(GTest QUIET)
if(GTest_FOUND)
enable_testing()
include_directories(${GTEST_INCLUDE_DIRS})
add_executable(block_test test/block_test.cpp test/block_wrapper.hpp)
add_executable(block_leak_test test/block_leak_test.cpp test/block_wrapper.hpp)
add_executable(morton_code_test test/morton_code_test.cpp)
add_executable(block_usages_test test/block_usages_test.cpp)
add_executable(debug_insertion_out_of_bounds_1_test test/debug_insertion_out_of_bounds_1_test.cpp)
add_executable(interactive_report_test test/interactive_report_test.cpp)
add_executable(bitvector_test test/bitvector_test.cpp)
add_executable(k2node_test test/k2node_test.cpp)
add_executable(lazy_scan_test test/lazy_scan_test.cpp)
add_executable(block_delete_test test/block_delete_test.cpp)
add_executable(k2node_delete_test test/k2node_delete_test.cpp)
add_executable(block_small_tests test/block_small_tests.cpp)
add_executable(k2node_small_tests test/k2node_small_tests.cpp)
add_executable(k2node_problematic_input_tests test/k2node_problematic_input_tests.cpp)
add_executable(k2node_problematic_input_tests2 test/k2node_problematic_input_tests2.cpp)
target_link_libraries(block_test ${GTEST_BOTH_LIBRARIES} pthread k2dyn)
target_link_libraries(block_leak_test ${GTEST_BOTH_LIBRARIES} pthread k2dyn)
target_link_libraries(morton_code_test ${GTEST_BOTH_LIBRARIES} pthread k2dyn )
target_link_libraries(block_usages_test ${GTEST_BOTH_LIBRARIES} pthread k2dyn )
target_link_libraries(debug_insertion_out_of_bounds_1_test k2dyn ${GTEST_BOTH_LIBRARIES} pthread)
target_link_libraries(interactive_report_test k2dyn ${GTEST_BOTH_LIBRARIES} pthread)
target_link_libraries(bitvector_test k2dyn ${GTEST_BOTH_LIBRARIES} pthread)
target_link_libraries(k2node_test k2dyn ${GTEST_BOTH_LIBRARIES} pthread)
target_link_libraries(lazy_scan_test k2dyn ${GTEST_BOTH_LIBRARIES} pthread)
target_link_libraries(block_delete_test k2dyn ${GTEST_BOTH_LIBRARIES} pthread)
target_link_libraries(k2node_delete_test k2dyn ${GTEST_BOTH_LIBRARIES} pthread)
target_link_libraries(block_small_tests k2dyn ${GTEST_BOTH_LIBRARIES} pthread)
target_link_libraries(k2node_small_tests k2dyn ${GTEST_BOTH_LIBRARIES} pthread)
target_link_libraries(k2node_problematic_input_tests k2dyn ${GTEST_BOTH_LIBRARIES} pthread)
target_link_libraries(k2node_problematic_input_tests2 k2dyn ${GTEST_BOTH_LIBRARIES} pthread)
add_test(NAME block_test COMMAND ./block_test)
add_test(NAME block_leak_test COMMAND ./block_leak_test)
add_test(NAME morton_code_test COMMAND ./morton_code_test)
add_test(NAME block_usages_test COMMAND ./block_usages_test)
add_test(NAME interactive_report_test COMMAND ./interactive_report_test)
add_test(NAME k2node_test COMMAND ./k2node_test)
add_test(NAME lazy_scan_test COMMAND ./lazy_scan_test)
add_test(NAME block_delete_test COMMAND ./block_delete_test)
add_test(NAME k2node_delete_test COMMAND ./block_delete_test)
add_test(NAME block_small_tests COMMAND ./block_small_tests)
add_test(NAME k2node_small_tests COMMAND ./k2node_small_tests)
add_test(NAME k2node_problematic_input_tests COMMAND ./k2node_problematic_input_tests)
add_test(NAME k2node_problematic_input_tests2 COMMAND ./k2node_problematic_input_tests2)
endif()