Add support for modular build structure. (#26)

* Make the library modular usable.

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Add missing b2 testing module import.

* Add requires-b2 check to top-level build file.

* Bump B2 require to 5.2

* Update copyright dates.

* Move inter-lib dependencies to a project variable and into the build targets.

* Update build deps.

* Replace GHA CI with simpler working one based on alandefreitas/cpp-actions utilities.

* Move project global include to target local include.

* Only msvc gets minor version tests.

* Redo GHA CI to undo move to cpp-actions.

* Need specific python3 for systems where regular python is not 3.

* Can't assume a specific version of clang/gcc is installed.

* Undo explicit g++ compiler specification.

* Put back C++-03 testing.

* Put back C++-03 testing.
This commit is contained in:
René Ferdinand Rivera Morell
2025-06-26 07:40:41 -05:00
committed by GitHub
parent 50a1eae942
commit d1b479f7a4
3 changed files with 86 additions and 37 deletions
+52 -32
View File
@@ -44,27 +44,32 @@ jobs:
address-model: 32,64
- toolset: gcc-8
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:18.04
install: g++-8-multilib
address-model: 32,64
- toolset: gcc-9
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:20.04
install: g++-9-multilib
address-model: 32,64
- toolset: gcc-10
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:20.04
install: g++-10-multilib
address-model: 32,64
- toolset: gcc-11
cxxstd: "03,11,14,17,20"
os: ubuntu-20.04
cxxstd: "03,11,14,17,2a"
os: ubuntu-latest
container: ubuntu:24.04
install: g++-11-multilib
address-model: 32,64
- toolset: gcc-12
cxxstd: "03,11,14,17,20,2b"
os: ubuntu-22.04
os: ubuntu-latest
container: ubuntu:22.04
install: g++-12-multilib
address-model: 32,64
- toolset: clang
@@ -88,69 +93,92 @@ jobs:
- toolset: clang
compiler: clang++-6.0
cxxstd: "03,11,14,17"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:20.04
install: clang-6.0
- toolset: clang
compiler: clang++-7
cxxstd: "03,11,14,17"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:20.04
install: clang-7
- toolset: clang
compiler: clang++-8
cxxstd: "03,11,14,17"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:20.04
install: clang-8
- toolset: clang
compiler: clang++-9
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:20.04
install: clang-9
- toolset: clang
compiler: clang++-10
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:20.04
install: clang-10
- toolset: clang
compiler: clang++-11
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:20.04
install: clang-11
- toolset: clang
compiler: clang++-12
cxxstd: "03,11,14,17,20"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:20.04
install: clang-12
- toolset: clang
compiler: clang++-13
cxxstd: "03,11,14,17,20,2b"
os: ubuntu-22.04
os: ubuntu-latest
container: ubuntu:22.04
install: clang-13
- toolset: clang
compiler: clang++-14
cxxstd: "03,11,14,17,20,2b"
os: ubuntu-22.04
os: ubuntu-latest
container: ubuntu:22.04
install: clang-14
- toolset: clang
cxxstd: "03,11,14,17,2a"
os: macos-11
cxxstd: "03,11,14,17,20"
os: macos-latest
runs-on: ${{matrix.os}}
container: ${{matrix.container}}
container:
image: ${{matrix.container}}
volumes:
- /node20217:/node20217:rw,rshared
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Setup container environment
if: matrix.container
run: |
apt-get update
apt-get -y install sudo python git g++
apt-get -y install sudo python3 git g++ curl xz-utils
- name: Install nodejs20glibc2.17
if: ${{ startsWith( matrix.container, 'ubuntu:1' ) }}
run: |
curl -LO https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz
tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217
ldd /__e/node20/bin/node
- name: Install packages
if: matrix.install
run: sudo apt-get -y install ${{matrix.install}}
- uses: actions/checkout@v3
- name: Setup Boost
run: |
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
@@ -165,7 +193,7 @@ jobs:
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
./bootstrap.sh
./b2 -d0 headers
@@ -184,14 +212,6 @@ jobs:
fail-fast: false
matrix:
include:
- toolset: msvc-14.0
cxxstd: 14,latest
addrmd: 32,64
os: windows-2019
- toolset: msvc-14.2
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2019
- toolset: msvc-14.3
cxxstd: "14,17,20,latest"
addrmd: 32,64
@@ -203,7 +223,7 @@ jobs:
- toolset: gcc
cxxstd: "03,11,14,17,2a"
addrmd: 64
os: windows-2019
os: windows-2022
runs-on: ${{matrix.os}}
@@ -224,7 +244,7 @@ jobs:
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY:/=\%\
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
cmd /c bootstrap
b2 -d0 headers
+28
View File
@@ -0,0 +1,28 @@
# Copyright René Ferdinand Rivera Morell 2023-2024
# 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)
require-b2 5.2 ;
constant boost_dependencies :
/boost/config//boost_config
/boost/conversion//boost_conversion
/boost/core//boost_core
/boost/mpl//boost_mpl
/boost/preprocessor//boost_preprocessor
/boost/throw_exception//boost_throw_exception
/boost/type_traits//boost_type_traits ;
project /boost/numeric_conversion
;
explicit
[ alias boost_numeric_conversion : : :
: <include>include <library>$(boost_dependencies) ]
[ alias all : boost_numeric_conversion test ]
;
call-if : boost-library numeric_conversion
;
+6 -5
View File
@@ -5,18 +5,19 @@
# 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)
#
# import testing ;
import testing ;
project numeric_conversion_unit_tests
:
requirements
<library>/boost/numeric_conversion//boost_numeric_conversion
<include>.
<toolset>gcc:<cxxflags>"-ftemplate-depth-300 -g0"
<toolset>darwin:<cxxflags>"-ftemplate-depth-300 -g0"
;
test-suite minimal
test-suite minimal
:
[ run bounds_test.cpp ]
[ run traits_test.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
@@ -27,10 +28,10 @@ test-suite minimal
[ run numeric_cast_traits_test.cpp ]
;
test-suite full
test-suite full
:
minimal
[ compile-fail compile_fail/built_in_numeric_cast_traits.cpp ]
[ compile-fail compile_fail/built_in_numeric_cast_traits.cpp ]
;
test-suite extra ;