-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (36 loc) · 1.22 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
# Copyright 2023 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.14...3.25)
project(rw_spinlock_test LANGUAGES CXX)
include(FetchContent)
function(fetch_boost_library name)
FetchContent_Declare(boostorg_${name} GIT_REPOSITORY https://github.com/boostorg/${name} GIT_TAG master)
FetchContent_MakeAvailable(boostorg_${name})
endfunction()
fetch_boost_library(core)
fetch_boost_library(assert)
fetch_boost_library(config)
fetch_boost_library(static_assert)
fetch_boost_library(throw_exception)
fetch_boost_library(smart_ptr)
fetch_boost_library(move)
fetch_boost_library(type_traits)
include(CTest)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads)
link_libraries(Boost::smart_ptr Boost::core Threads::Threads)
function(rws_add_test name)
add_executable(${name} ${name}.cpp)
add_test(${name} ${name})
endfunction()
set(CMAKE_CXX_STANDARD 11)
rws_add_test(rw_spinlock_test)
rws_add_test(rw_spinlock_test2)
rws_add_test(rw_spinlock_test3)
set(CMAKE_CXX_STANDARD 14)
rws_add_test(rw_spinlock_test4)
rws_add_test(rw_spinlock_test5)
rws_add_test(rw_spinlock_test6)
rws_add_test(rw_spinlock_test7)
rws_add_test(rw_spinlock_test8)