Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 28 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- toolset: gcc-14 # Do not remove! It is the only toolset that tests CMake tests down below
cxxstd: "03,11,14,17,20"
os: ubuntu-24.04
compiler: g++-14
- toolset: gcc-12
cxxstd: "03,11,14,17,2a"
os: ubuntu-22.04
Expand Down Expand Up @@ -47,6 +48,7 @@ jobs:
- toolset: clang-19 # tests misc/strip_boost_namespace.sh and modules
cxxstd: "20,23"
os: ubuntu-24.04
compiler: clang++-19
install: clang-19 llvm-19 libclang-rt-19-dev libc++-19-dev libc++abi-19-dev clang-tools-19

runs-on: ${{matrix.os}}
Expand Down Expand Up @@ -83,40 +85,44 @@ jobs:
./b2 variant=debug tools/inspect

- name: Run CMake tests
if: ${{matrix.toolset == 'gcc-14'}}
if: ${{matrix.toolset == 'gcc-14' || matrix.toolset == 'clang-19'}}
run: |
cd ../boost-root/
mkdir __build
cd __build
cmake -DBUILD_TESTING=1 -DBOOST_INCLUDE_LIBRARIES=pfr -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_C_COMPILER=gcc-14 ..
cmake --build . --target tests
ctest --output-on-failure --no-tests=error
cd ..
cmake -S . -B __build \
-DBUILD_TESTING=1 \
-DBOOST_INCLUDE_LIBRARIES=pfr \
-DCMAKE_CXX_COMPILER=${{matrix.compiler}}
cmake --build __build --target tests
ctest --test-dir __build --output-on-failure --no-tests=error
rm -rf __build

- name: Run modules tests
if: false
# if: ${{matrix.toolset == 'clang-19'}}
if: ${{matrix.toolset == 'clang-19'}}
run: |
cd ../boost-root/libs/pfr
mkdir build_module
cd build_module
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
cmake --build .
ctest -V
cd ..
cmake -S test/cmake_subdir_test -B build_module \
-GNinja \
-DBUILD_TESTING=1 \
-DBOOST_USE_MODULES=1 \
-DCMAKE_CXX_COMPILER=clang++-19 \
-DCMAKE_CXX_FLAGS=-stdlib=libc++ \
-DCMAKE_CXX_STANDARD=23 \
-DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=0e5b6991-d74f-4b3d-a41c-cf096e0b2508 \
-DCMAKE_CXX_MODULE_STD=ON
cmake --build build_module
ctest --test-dir build_module --no-tests=error -VV
rm -rf build_module

- name: Run modules tests wihtout 'import std;'
- name: Run modules tests without 'import std;'
if: ${{matrix.toolset == 'clang-19'}}
run: |
cd ../boost-root/libs/pfr
mkdir build_module
cd build_module
cmake -DBOOST_USE_MODULES=1 -DBUILD_TESTING=1 -GNinja -DCMAKE_CXX_COMPILER=clang++-19 ../test/cmake_subdir_test
cmake --build .
ctest -V
cd ..
cmake -S test/cmake_subdir_test -B build_module -GNinja \
-DBOOST_USE_MODULES=1 \
-DBUILD_TESTING=1 \
-DCMAKE_CXX_COMPILER=clang++-19
cmake --build build_module
ctest --test-dir build_module --no-tests=error -VV
rm -rf build_module

- name: Run tests
Expand Down
4 changes: 4 additions & 0 deletions include/boost/pfr/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
#define BOOST_PFR_CONFIG_HPP
#pragma once

#if defined(BOOST_USE_MODULES)
#include <compare>
#endif

#if !defined(BOOST_USE_MODULES) && (__cplusplus >= 201402L || (defined(_MSC_VER) && defined(_MSVC_LANG) && _MSC_VER > 1900))
#include <type_traits> // to get non standard platform macro definitions (__GLIBCXX__ for example)
#endif
Expand Down
1 change: 1 addition & 0 deletions modules/boost_pfr.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module;
#include <version>
#include <cstddef>
#include <cstdint>
#include <compare>

#ifdef BOOST_PFR_USE_STD_MODULE
import std;
Expand Down
1 change: 0 additions & 1 deletion modules/usage_sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

//[pfr_module_example
#include <iostream>
#include <iomanip>
#include <string>

import boost.pfr;
Expand Down
1 change: 1 addition & 0 deletions test/cmake_subdir_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ add_subdirectory(../../../mp11 boostorg/mp11)
add_subdirectory(../../../throw_exception boostorg/throw_exception)
add_subdirectory(../../../type_traits boostorg/type_traits)

enable_testing()
add_subdirectory(../../ boostorg/pfr)