mirror of
https://github.com/boostorg/cmake.git
synced 2026-01-19 04:02:15 +00:00
Add tests for compatibility targets (Boost::boost, Boost::disable_autolinking, etc)
This commit is contained in:
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
@@ -474,6 +474,22 @@ jobs:
|
||||
cmake --build . --target install
|
||||
cmake --install .
|
||||
|
||||
- name: Test add_subdirectory compatibility targets
|
||||
run: |
|
||||
cd ../boost-root/tools/cmake/test/add_subdir_compat
|
||||
mkdir __build__ && cd __build__
|
||||
cmake -DBoost_VERBOSE=ON -DBUILD_SHARED_LIBS=${{matrix.shared}} ..
|
||||
cmake --build .
|
||||
ctest --output-on-failure --no-tests=error
|
||||
|
||||
- name: Test add_subdirectory(EXCLUDE_FROM_ALL) compatibility targets
|
||||
run: |
|
||||
cd ../boost-root/tools/cmake/test/add_subdir_exc_compat
|
||||
mkdir __build__ && cd __build__
|
||||
cmake -DBoost_VERBOSE=ON -DBUILD_SHARED_LIBS=${{matrix.shared}} ..
|
||||
cmake --build .
|
||||
ctest --output-on-failure --no-tests=error
|
||||
|
||||
posix-target-check:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
21
test/add_subdir_compat/CMakeLists.txt
Normal file
21
test/add_subdir_compat/CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
# Copyright 2018-2024 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.20)
|
||||
|
||||
project(boost_add_sibdir_compat_test LANGUAGES CXX)
|
||||
|
||||
include(CTest)
|
||||
|
||||
set(BOOST_INCLUDE_LIBRARIES smart_ptr timer)
|
||||
set(BOOST_ENABLE_COMPATIBILITY_TARGETS ON)
|
||||
|
||||
add_subdirectory(../../../.. deps/boost)
|
||||
|
||||
add_executable(main main.cpp)
|
||||
target_link_libraries(main Boost::boost Boost::timer Boost::disable_autolinking)
|
||||
|
||||
add_test(NAME main COMMAND main)
|
||||
|
||||
install(TARGETS main)
|
||||
12
test/add_subdir_compat/main.cpp
Normal file
12
test/add_subdir_compat/main.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
// Copyright 2019, 2024 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/timer/timer.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
boost::shared_ptr<boost::timer::cpu_timer> timer = boost::make_shared<boost::timer::cpu_timer>();
|
||||
timer->stop();
|
||||
}
|
||||
20
test/add_subdir_exc_compat/CMakeLists.txt
Normal file
20
test/add_subdir_exc_compat/CMakeLists.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
# Copyright 2018-2024 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.20)
|
||||
|
||||
project(boost_add_sibdir_exc_compat_test LANGUAGES CXX)
|
||||
|
||||
include(CTest)
|
||||
|
||||
set(BOOST_ENABLE_COMPATIBILITY_TARGETS ON)
|
||||
|
||||
add_subdirectory(../../../.. deps/boost EXCLUDE_FROM_ALL)
|
||||
|
||||
add_executable(main main.cpp)
|
||||
target_link_libraries(main Boost::boost Boost::timer Boost::disable_autolinking)
|
||||
|
||||
add_test(NAME main COMMAND main)
|
||||
|
||||
install(TARGETS main)
|
||||
12
test/add_subdir_exc_compat/main.cpp
Normal file
12
test/add_subdir_exc_compat/main.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
// Copyright 2019, 2024 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/timer/timer.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
boost::shared_ptr<boost::timer::cpu_timer> timer = boost::make_shared<boost::timer::cpu_timer>();
|
||||
timer->stop();
|
||||
}
|
||||
Reference in New Issue
Block a user