-
Notifications
You must be signed in to change notification settings - Fork 86
/
CMakeLists.txt
72 lines (57 loc) · 2.16 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
# Generated by `boostdep --cmake lockfree`
# Copyright 2020 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.5...3.16)
project(boost_lockfree VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
option(BOOST_LOCKFREE_BUILD_TESTS "Build boost::lockfree tests" OFF)
option(BOOST_LOCKFREE_USE_FILE_SET "Use FILE_SET for boost::lockfree" OFF)
if (NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
add_library(boost_lockfree INTERFACE)
add_library(Boost::lockfree ALIAS boost_lockfree)
target_include_directories(boost_lockfree INTERFACE include)
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.23 AND BOOST_LOCKFREE_USE_FILE_SET)
set(Headers
include/boost/lockfree/spsc_queue.hpp
include/boost/lockfree/policies.hpp
include/boost/lockfree/queue.hpp
include/boost/lockfree/lockfree_forward.hpp
include/boost/lockfree/detail/atomic.hpp
include/boost/lockfree/detail/copy_payload.hpp
include/boost/lockfree/detail/freelist.hpp
include/boost/lockfree/detail/parameter.hpp
include/boost/lockfree/detail/prefix.hpp
include/boost/lockfree/detail/tagged_ptr.hpp
include/boost/lockfree/detail/tagged_ptr_dcas.hpp
include/boost/lockfree/detail/tagged_ptr_ptrcompression.hpp
include/boost/lockfree/detail/uses_optional.hpp
include/boost/lockfree/stack.hpp
)
target_sources(boost_lockfree PUBLIC FILE_SET HEADERS FILES ${Headers} )
endif()
target_compile_features(boost_lockfree INTERFACE cxx_std_14)
set_target_properties( boost_lockfree PROPERTIES CMAKE_CXX_STANDARD_REQUIRED 14)
target_link_libraries(boost_lockfree
INTERFACE
Boost::align
Boost::assert
Boost::atomic
Boost::config
Boost::core
Boost::parameter
Boost::predef
Boost::static_assert
Boost::utility
)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_link_libraries(boost_lockfree
INTERFACE atomic
)
endif()
endif()
if( BOOST_LOCKFREE_BUILD_TESTS OR BUILD_TESTING )
add_subdirectory(test)
endif()