-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
79 lines (66 loc) · 3.03 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
cmake_minimum_required(VERSION 3.22)
project(ads VERSION 1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS OFF)
# main program
add_executable(ads_programm ads.cpp
rmq/util/io.h)
target_include_directories(ads_programm PRIVATE .)
target_compile_features(ads_programm PUBLIC cxx_std_20)
target_compile_options(ads_programm PUBLIC -Wall -Wextra -Wpedantic -O3 -g -march=native)
# exe for generating rmq instances
add_executable(generate_rmq rmq/util/generate_example.cpp)
target_include_directories(generate_rmq PRIVATE .)
target_compile_features(generate_rmq PUBLIC cxx_std_20)
target_compile_options(generate_rmq PUBLIC -Wall -Wextra -Wpedantic -O3 -g -march=native)
# exe for generating pd instances
add_executable(generate_pd pd/util/generate_example.cpp)
target_include_directories(generate_pd PRIVATE .)
target_compile_features(generate_pd PUBLIC cxx_std_20)
target_compile_options(generate_pd PUBLIC -Wall -Wextra -Wpedantic -O3 -g -march=native)
# rmq tests
set(GTEST_ROOT /usr/src/googletest)
find_path(GTEST_ROOT googletest/CMakeLists.txt HINTS ${GTEST_ROOT})
if (NOT ${GTEST_ROOT} STREQUAL GTEST_ROOT-NOTFOUND)
enable_testing()
add_subdirectory(${GTEST_ROOT} ${CMAKE_BINARY_DIR}/googletest EXCLUDE_FROM_ALL)
add_executable(rmq_test rmq/tests/test.cpp)
target_include_directories(rmq_test PRIVATE .)
target_link_libraries(rmq_test gtest_main -fsanitize=leak -fsanitize=address -fsanitize=undefined)
include(GoogleTest)
gtest_discover_tests(rmq_test)
endif()
# pd tests
if (NOT ${GTEST_ROOT} STREQUAL GTEST_ROOT-NOTFOUND)
enable_testing()
add_executable(pd_test pd/tests/test.cpp)
target_include_directories(pd_test PRIVATE .)
target_link_libraries(pd_test gtest_main -fsanitize=leak -fsanitize=address -fsanitize=undefined)
include(GoogleTest)
gtest_discover_tests(pd_test)
endif()
# pd benchmarks
set(PD_IMPLS "manual;x_fast_trie;y_fast_trie")
foreach(impl ${PD_IMPLS})
string(TOUPPER ${impl} impl_uc)
add_executable(benchmark_${impl} pd/tests/pd_benchmark.cpp
pd/implementation/${impl}.hpp)
target_include_directories(benchmark_${impl} PRIVATE .)
target_compile_definitions(benchmark_${impl} PRIVATE -D ${impl_uc})
target_compile_features(benchmark_${impl} PUBLIC cxx_std_20)
target_compile_options(benchmark_${impl} PUBLIC -Wall -Wextra -Wpedantic -O3 -g -march=native)
target_link_libraries(benchmark_${impl} PRIVATE)
endforeach()
#rmq benchmarks
set(RMQ_IMPLS "nlogn;linear")
foreach(impl ${RMQ_IMPLS})
string(TOUPPER ${impl} impl_uc)
add_executable(benchmark_${impl} rmq/tests/rmq_benchmark.cpp
rmq/implementation/${impl}.hpp)
target_include_directories(benchmark_${impl} PRIVATE .)
target_compile_definitions(benchmark_${impl} PRIVATE -D ${impl_uc})
target_compile_features(benchmark_${impl} PUBLIC cxx_std_20)
target_compile_options(benchmark_${impl} PUBLIC -Wall -Wextra -Wpedantic -O3 -g -march=native)
target_link_libraries(benchmark_${impl} PRIVATE)
endforeach()