From 2d9a2419f9e2086a0d65fc7118f609c2ff635fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Ferdinand=20Rivera=20Morell?= Date: Thu, 26 Jun 2025 11:42:29 -0500 Subject: [PATCH] Add support for modular build structure. (#16) * Make the library modular usable. * Switch to library requirements instead of source. As source puts extra source in install targets. * Add requires-b2 check to top-level build file. * Bump B2 require to 5.2 * Change all references to . * Update copyright dates. * Move inter-lib dependencies to a project variable and into the build targets. * 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. * Add missing deps. * Add missing deps. * Explicit g++-* compiler to avoid mismatch errors, and for consistency. * Fix gcc availability on some OS versions. * Undo explicit g++ compiler specification. * Switch to cxxstd. * Add missing fetch of deps. --- .appveyor.yml | 2 + .github/workflows/ci.yml | 139 ++++++++++++++++++++++++--------------- build.jam | 21 ++++++ test/Jamfile | 5 +- 4 files changed, 112 insertions(+), 55 deletions(-) create mode 100644 build.jam diff --git a/.appveyor.yml b/.appveyor.yml index a23563d..1f1949f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -46,6 +46,8 @@ install: - git submodule init libs/config - git submodule init libs/core - git submodule init libs/headers + - git submodule init libs/static_assert + - git submodule init libs/throw_exception - git submodule init libs/type_traits - git submodule init tools/build - git submodule init tools/boost_install diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea8c6c2..c8d78bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,97 +14,133 @@ jobs: matrix: include: - toolset: gcc-4.8 - standard: "03,11" - os: ubuntu-18.04 + cxxstd: "03,11" + os: ubuntu-latest + container: ubuntu:18.04 install: g++-4.8 - toolset: gcc-5 - standard: "03,11,14,1z" - os: ubuntu-18.04 + cxxstd: "03,11,14,1z" + os: ubuntu-latest + container: ubuntu:18.04 install: g++-5 - toolset: gcc-6 - standard: "03,11,14,1z" - os: ubuntu-18.04 + cxxstd: "03,11,14,1z" + os: ubuntu-latest + container: ubuntu:18.04 install: g++-6 - toolset: gcc-7 - standard: "03,11,14,17" - os: ubuntu-18.04 + cxxstd: "03,11,14,17" + os: ubuntu-latest + container: ubuntu:18.04 - toolset: gcc-8 - standard: "03,11,14,17,2a" - os: ubuntu-18.04 + cxxstd: "03,11,14,17,2a" + os: ubuntu-latest + container: ubuntu:18.04 install: g++-8 - toolset: gcc-9 - standard: "03,11,14,17,2a" - os: ubuntu-18.04 + cxxstd: "03,11,14,17,2a" + os: ubuntu-latest + container: ubuntu:20.04 - toolset: gcc-10 - standard: "03,11,14,17,2a" - os: ubuntu-20.04 + cxxstd: "03,11,14,17,2a" + os: ubuntu-latest + container: ubuntu:20.04 install: g++-10 - toolset: gcc-11 - standard: "03,11,14,17,2a" - os: ubuntu-20.04 + cxxstd: "03,11,14,17,2a" + os: ubuntu-latest + container: ubuntu:24.04 install: g++-11 - toolset: clang compiler: clang++-3.9 - standard: "03,11,14" - os: ubuntu-18.04 + cxxstd: "03,11,14" + os: ubuntu-latest + container: ubuntu:18.04 install: clang-3.9 - toolset: clang compiler: clang++-4.0 - standard: "03,11,14" - os: ubuntu-18.04 + cxxstd: "03,11,14" + os: ubuntu-latest + container: ubuntu:18.04 install: clang-4.0 - toolset: clang compiler: clang++-5.0 - standard: "03,11,14,1z" - os: ubuntu-18.04 + cxxstd: "03,11,14,1z" + os: ubuntu-latest + container: ubuntu:18.04 install: clang-5.0 - toolset: clang compiler: clang++-6.0 - standard: "03,11,14,17" - os: ubuntu-18.04 + cxxstd: "03,11,14,17" + os: ubuntu-latest + container: ubuntu:18.04 install: clang-6.0 - toolset: clang compiler: clang++-7 - standard: "03,11,14,17" - os: ubuntu-18.04 + cxxstd: "03,11,14,17" + os: ubuntu-latest + container: ubuntu:18.04 install: clang-7 - toolset: clang compiler: clang++-8 - standard: "03,11,14,17" - os: ubuntu-20.04 + cxxstd: "03,11,14,17" + os: ubuntu-latest + container: ubuntu:20.04 install: clang-8 - toolset: clang compiler: clang++-9 - standard: "03,11,14,17,2a" - os: ubuntu-20.04 + cxxstd: "03,11,14,17,2a" + os: ubuntu-latest + container: ubuntu:20.04 install: clang-9 - toolset: clang compiler: clang++-10 - standard: "03,11,14,17,2a" - os: ubuntu-20.04 + cxxstd: "03,11,14,17,2a" + 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,2a" - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 install: clang-12 - toolset: clang - standard: "03,11,14,17,2a" - os: macos-10.15 + cxxstd: "03,11,14,17,2a" + os: macos-latest runs-on: ${{matrix.os}} + container: + image: ${{matrix.container}} + volumes: + - /node20217:/node20217:rw,rshared + - ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }} steps: - - uses: actions/checkout@v2 + - name: Setup container environment + if: matrix.container + run: | + apt-get update + 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 install ${{matrix.install}} + run: sudo apt-get -y install ${{matrix.install}} + + - uses: actions/checkout@v2 - name: Setup Boost run: | @@ -116,9 +152,11 @@ jobs: git submodule init libs/config git submodule init libs/core git submodule init libs/headers + git submodule init libs/static_assert + git submodule init libs/throw_exception git submodule init libs/type_traits - git submodule init tools/build git submodule init tools/boost_install + git submodule init tools/build git submodule update ./bootstrap.sh ./b2 -d0 headers @@ -131,29 +169,21 @@ jobs: - name: Run tests run: | cd ../boost - ./b2 -j3 libs/io/test toolset=${{matrix.toolset}} cxxstd=${{matrix.standard}} variant=debug,release + ./b2 -j3 libs/io/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release windows: strategy: fail-fast: false matrix: include: - - toolset: msvc-14.1 - standard: "14,17,latest" - target: 32,64 - os: windows-2016 - - toolset: msvc-14.2 - standard: "14,17,latest" - target: 32,64 - os: windows-2019 - toolset: msvc-14.3 cxxstd: "14,17,latest" addrmd: 32,64 os: windows-2022 - toolset: gcc - standard: "03,11,14,17,2a" + cxxstd: "03,11,14,17,2a" target: 64 - os: windows-2019 + os: windows-2022 runs-on: ${{matrix.os}} @@ -170,11 +200,12 @@ jobs: git submodule init libs/assert git submodule init libs/config git submodule init libs/core - git submodule init libs/static_assert - git submodule init libs/type_traits git submodule init libs/headers - git submodule init tools/build + git submodule init libs/static_assert + git submodule init libs/throw_exception + git submodule init libs/type_traits git submodule init tools/boost_install + git submodule init tools/build git submodule update cmd /c bootstrap b2 -d0 headers @@ -183,4 +214,4 @@ jobs: shell: cmd run: | cd ../boost - b2 -j3 libs/io/test toolset=${{matrix.toolset}} cxxstd=${{matrix.standard}} address-model=${{matrix.target}} variant=debug,release + b2 -j3 libs/io/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.target}} variant=debug,release diff --git a/build.jam b/build.jam new file mode 100644 index 0000000..8153e9b --- /dev/null +++ b/build.jam @@ -0,0 +1,21 @@ +# 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 ; + +project /boost/io + ; + +explicit + [ alias boost_io : : : + : include $(boost_dependencies) ] + [ alias all : boost_io test ] + ; + +call-if : boost-library io + ; diff --git a/test/Jamfile b/test/Jamfile index ffc9160..4f1e816 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -8,7 +8,10 @@ import testing ; -project : requirements pedantic on ; +project : requirements pedantic on + /boost/core//boost_core + /boost/type_traits//boost_type_traits + ; run ios_state_unit_test.cpp ; run ios_state_test.cpp ;