Skip to content

Commit 9bc3cb2

Browse files
authored
Another fix attempt for the CMake build from the root directory of Boost (#209)
Fixes #206
1 parent 57fa101 commit 9bc3cb2

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ jobs:
5151
cxxstd: "20,23"
5252
os: ubuntu-24.04
5353
install: clang-19 llvm-19 libclang-rt-19-dev libc++-19-dev libc++abi-19-dev clang-tools-19
54-
# - toolset: clang
55-
# cxxstd: "03,11,14,17,2a"
56-
# os: macos-10.15
57-
# cxxflags: "cxxflags=-fsanitize=address,undefined -fno-sanitize-recover=undefined"
58-
# linkflags: "linkflags=-fsanitize=address,undefined"
5954

6055
runs-on: ${{matrix.os}}
6156

@@ -110,7 +105,7 @@ jobs:
110105
cd ../boost-root/libs/pfr
111106
mkdir build_module
112107
cd build_module
113-
cmake -DBUILD_TESTING=1 -DBOOST_USE_MODULES=1 -DCMAKE_CXX_COMPILER=clang++-19 -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++ -DCMAKE_CXX_STANDARD=23 -DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=0e5b6991-d74f-4b3d-a41c-cf096e0b2508 -G Ninja ..
108+
cmake -DBUILD_TESTING=1 -DBOOST_USE_MODULES=1 -DCMAKE_CXX_COMPILER=clang++-19 -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++ -DCMAKE_CXX_STANDARD=23 -DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=0e5b6991-d74f-4b3d-a41c-cf096e0b2508 -G Ninja ../test/cmake_subdir_test
114109
cmake --build .
115110
ctest -V
116111
cd ..
@@ -122,7 +117,7 @@ jobs:
122117
cd ../boost-root/libs/pfr
123118
mkdir build_module
124119
cd build_module
125-
cmake -DBOOST_USE_MODULES=1 -DBUILD_TESTING=1 -GNinja -DCMAKE_CXX_COMPILER=clang++-19 ..
120+
cmake -DBOOST_USE_MODULES=1 -DBUILD_TESTING=1 -GNinja -DCMAKE_CXX_COMPILER=clang++-19 ../test/cmake_subdir_test
126121
cmake --build .
127122
ctest -V
128123
cd ..
@@ -243,7 +238,7 @@ jobs:
243238
cd ../boost-root/libs/pfr
244239
mkdir build_module
245240
cd build_module
246-
cmake -DBOOST_USE_MODULES=1 -DBUILD_TESTING=1 -DCMAKE_CXX_STANDARD=23 -DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=0e5b6991-d74f-4b3d-a41c-cf096e0b2508 -G Ninja ..
241+
cmake -DBOOST_USE_MODULES=1 -DBUILD_TESTING=1 -DCMAKE_CXX_STANDARD=23 -DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=0e5b6991-d74f-4b3d-a41c-cf096e0b2508 -G Ninja ../test/cmake_subdir_test
247242
cmake --build .
248243
ctest --no-tests=error -V
249244
cd ..
@@ -258,7 +253,7 @@ jobs:
258253
cd ../boost-root/libs/pfr
259254
mkdir build_module
260255
cd build_module
261-
cmake -DBOOST_USE_MODULES=1 -DBUILD_TESTING=1 -DCMAKE_CXX_STANDARD=20 -G Ninja ..
256+
cmake -DBOOST_USE_MODULES=1 -DBUILD_TESTING=1 -DCMAKE_CXX_STANDARD=20 -G Ninja ../test/cmake_subdir_test
262257
cmake --build .
263258
ctest --no-tests=error -V
264259
cd ..

test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ file(GLOB CORE_RUN_FILES "core/run/*.cpp")
1010
foreach (testsourcefile ${CORE_RUN_FILES})
1111
get_filename_component(testname ${testsourcefile} NAME_WLE)
1212
add_executable(pfr_core_${testname} ${testsourcefile})
13-
target_link_libraries(pfr_core_${testname} Boost::pfr)
13+
target_link_libraries(pfr_core_${testname} Boost::pfr Boost::core)
1414
target_include_directories(pfr_core_${testname} PRIVATE ../../../)
1515
add_test(NAME pfr_core_${testname} COMMAND pfr_core_${testname})
1616
add_dependencies(tests pfr_core_${testname})
@@ -21,7 +21,7 @@ foreach (testsourcefile ${CORE_NAME_RUN_FILES})
2121
get_filename_component(testname ${testsourcefile} NAME_WLE)
2222
add_executable(pfr_corename_${testname} ${testsourcefile})
2323
target_compile_features(pfr_corename_${testname} PUBLIC cxx_std_20)
24-
target_link_libraries(pfr_corename_${testname} Boost::pfr)
24+
target_link_libraries(pfr_corename_${testname} Boost::pfr Boost::core)
2525
target_include_directories(pfr_corename_${testname} PRIVATE ../../../)
2626
add_test(NAME pfr_corename_${testname} COMMAND pfr_corename_${testname})
2727
add_dependencies(tests pfr_corename_${testname})
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (c) 2016-2025 Antony Polukhin
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
4+
5+
cmake_minimum_required(VERSION 3.5...4.0)
6+
7+
project(pfr_subdir_test LANGUAGES CXX)
8+
9+
add_subdirectory(../../../assert boostorg/assert)
10+
add_subdirectory(../../../core boostorg/core)
11+
add_subdirectory(../../../config boostorg/config)
12+
add_subdirectory(../../../static_assert boostorg/static_assert)
13+
add_subdirectory(../../../throw_exception boostorg/throw_exception)
14+
15+
add_subdirectory(../../ boostorg/pfr)

0 commit comments

Comments
 (0)