-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
35 lines (27 loc) · 1.13 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
cmake_minimum_required(VERSION 3.19)
project(ConcurrentCollections LANGUAGES CXX)
include(FetchContent)
add_library(${PROJECT_NAME} INTERFACE
src/ccol/common.h
src/ccol/double_buffer_queue.h
src/ccol/trivial_vector.h
src/ccol/sparse_vector.h
src/ccol/spinlock.h
)
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_20)
target_include_directories(${PROJECT_NAME} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/src/")
option("${PROJECT_NAME}_BUILD_TESTS" "Should tests be built for concurrent collections." ${PROJECT_IS_TOP_LEVEL})
if(${PROJECT_NAME}_BUILD_TESTS)
fetchcontent_declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.4.0
)
fetchcontent_makeavailable(Catch2)
set(TEST_PROJECT_NAME "${PROJECT_NAME}_Tests")
add_executable(${TEST_PROJECT_NAME} tests/double_buffer_queue_test.cpp
tests/trivial_vector_test.cpp
tests/sparse_vector_test.cpp)
target_link_libraries(${TEST_PROJECT_NAME} PRIVATE ${PROJECT_NAME})
target_link_libraries(${TEST_PROJECT_NAME} PRIVATE Catch2::Catch2WithMain)
endif()