Files
lockfree/CMakeLists.txt
Alexander Grund 1a5af26128 CMake: Fix required C++ standard
cxx_std_14 is only available since CMake 3.8
The CXX_STANDARD_REQUIRED property is a boolean, i.e. ON or OFF not a numeric value. The feature is enough to require the standard already

In the test the specification is not required as the library sets it
2025-09-06 22:10:39 +08:00

71 lines
2.2 KiB
CMake

# Generated by `boostdep --cmake lockfree`
# Copyright 2020 Peter Dimov
# Copyright 2025 Alexander Grund
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.8...3.16)
project(boost_lockfree VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
option(BOOST_LOCKFREE_BUILD_TESTS "Build boost::lockfree tests" OFF)
option(BOOST_LOCKFREE_TESTS_STRESSTEST "Build boost::lockfree with more excessive stress tests" OFF)
option(BOOST_LOCKFREE_USE_FILE_SET "Use FILE_SET for boost::lockfree" OFF)
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/spsc_value.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)
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()