mirror of
https://github.com/boostorg/boost-ci.git
synced 2026-01-19 04:02:12 +00:00
Convert the header-only library to a compiled library which additionally depends (privately) on another compiled library (Boost.Atomic chosen as it has few other dependencies). This reproduces the runtime link failure of #155 when compiling shared libraries.
32 lines
885 B
CMake
32 lines
885 B
CMake
# Copyright 2018-2021 Peter Dimov
|
|
# Copyright 2021-2025 Alexander Grund
|
|
# Distributed under the Boost Software License, Version 1.0.
|
|
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
|
|
|
|
cmake_minimum_required(VERSION 3.5...3.16)
|
|
|
|
project(boost_ci VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
|
|
|
add_library(boost_boost_ci src/boost_ci.cpp)
|
|
add_library(Boost::boost_ci ALIAS boost_boost_ci)
|
|
|
|
if(NOT CMAKE_VERSION VERSION_LESS "3.19")
|
|
file(GLOB_RECURSE headers include/*.hpp)
|
|
target_sources(boost_boost_ci PRIVATE ${headers})
|
|
endif()
|
|
|
|
target_include_directories(boost_boost_ci PUBLIC include)
|
|
|
|
target_link_libraries(boost_boost_ci
|
|
PUBLIC Boost::config
|
|
PRIVATE Boost::atomic
|
|
)
|
|
|
|
if(BUILD_SHARED_LIBS)
|
|
target_compile_definitions(boost_boost_ci PUBLIC BOOST_BOOST_CI_DYN_LINK)
|
|
endif()
|
|
|
|
if(BUILD_TESTING)
|
|
add_subdirectory(test)
|
|
endif()
|