Add support for modular build structure. (#12)

* 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 <source> references to <library>.

* Update copyright dates.

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

* Adjust doc build to avoid boost-root references.

* Update build deps.

* 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.

* Fix non-existent containers.

* This lib now only works for C++11.

* Undo explicit g++ compiler specification.

* Move container spec up for display purpouses.
This commit is contained in:
René Ferdinand Rivera Morell
2025-06-26 09:08:36 -05:00
committed by GitHub
parent 258aeaa6c1
commit ff0934f6a3
5 changed files with 89 additions and 44 deletions

View File

@@ -34,22 +34,26 @@ jobs:
install: g++-6
- toolset: gcc-7
cxxstd: "11,14,17"
os: ubuntu-20.04
install: g++-7
container: ubuntu:18.04
os: ubuntu-latest
- toolset: gcc-8
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
container: ubuntu:18.04
os: ubuntu-latest
install: g++-8
- toolset: gcc-9
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
container: ubuntu:20.04
os: ubuntu-latest
- toolset: gcc-10
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
container: ubuntu:20.04
os: ubuntu-latest
install: g++-10
- toolset: gcc-11
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
container: ubuntu:24.04
os: ubuntu-latest
install: g++-11
- toolset: gcc-12
cxxstd: "11,14,17,20,2b"
@@ -57,7 +61,7 @@ jobs:
install: g++-12
- toolset: gcc-13
cxxstd: "11,14,17,20,2b"
container: ubuntu:23.04
container: ubuntu:24.04
os: ubuntu-latest
install: g++-13
- toolset: clang
@@ -81,37 +85,44 @@ jobs:
- toolset: clang
compiler: clang++-6.0
cxxstd: "11,14,17"
os: ubuntu-20.04
container: ubuntu:20.04
os: ubuntu-latest
install: clang-6.0
- toolset: clang
compiler: clang++-7
cxxstd: "11,14,17"
os: ubuntu-20.04
container: ubuntu:20.04
os: ubuntu-latest
install: clang-7
- toolset: clang
compiler: clang++-8
cxxstd: "11,14,17"
os: ubuntu-20.04
container: ubuntu:20.04
os: ubuntu-latest
install: clang-8
- toolset: clang
compiler: clang++-9
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
container: ubuntu:20.04
os: ubuntu-latest
install: clang-9
- toolset: clang
compiler: clang++-10
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
container: ubuntu:20.04
os: ubuntu-latest
install: clang-10
- toolset: clang
compiler: clang++-11
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
container: ubuntu:20.04
os: ubuntu-latest
install: clang-11
- toolset: clang
compiler: clang++-12
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
container: ubuntu:20.04
os: ubuntu-latest
install: clang-12
- toolset: clang
compiler: clang++-13
@@ -134,46 +145,55 @@ jobs:
- toolset: clang
compiler: clang++-16
cxxstd: "11,14,17,20,2b"
container: ubuntu:23.04
container: ubuntu:24.04
os: ubuntu-latest
install: clang-16
- toolset: clang
compiler: clang++-17
cxxstd: "11,14,17,20,2b"
container: ubuntu:23.10
container: ubuntu:24.04
os: ubuntu-latest
install: clang-17
- toolset: clang
cxxstd: "11,14,17,2a"
os: macos-11
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-12
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-13
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-14
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-15
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 python3 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 update
sudo apt-get -y install ${{matrix.install}}
run: sudo apt-get -y install ${{matrix.install}}
- uses: actions/checkout@v3
- name: Setup Boost
run: |
@@ -212,14 +232,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
@@ -231,7 +243,7 @@ jobs:
- toolset: gcc
cxxstd: "11,14,17,2a"
addrmd: 64
os: windows-2019
os: windows-2022
runs-on: ${{matrix.os}}

28
build.jam Normal file
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/mpl//boost_mpl
/boost/preprocessor//boost_preprocessor
/boost/scope_exit//boost_scope_exit
/boost/type_traits//boost_type_traits
/boost/typeof//boost_typeof
/boost/utility//boost_utility ;
project /boost/local_function
;
explicit
[ alias boost_local_function : : :
: <include>include <library>$(boost_dependencies) ]
[ alias all : boost_local_function example test ]
;
call-if : boost-library local_function
;

View File

@@ -12,8 +12,8 @@ path-constant images_location : html ;
path-constant here : . ;
doxygen reference
: ../../../boost/local_function.hpp
../../../boost/local_function/config.hpp
: ../include/boost/local_function.hpp
../include/boost/local_function/config.hpp
: <reftitle>"Reference"
<doxygen:param>PREDEFINED="DOXYGEN"
<doxygen:param>QUIET=YES

View File

@@ -10,6 +10,7 @@ import testing ;
# Sun does not automatically detect type-of emulation mode (force it).
project :
requirements
<library>/boost/local_function//boost_local_function
<toolset>sun:<define>BOOST_TYPEOF_EMULATION
<toolset>gcc:<cxxflags>-Wno-unused-local-typedefs
<toolset>clang:<cxxflags>-Wno-unused-local-typedefs
@@ -18,7 +19,7 @@ project :
run add_cxx11_lambda.cpp ;
run add_global_functor.cpp ;
run add_local_functor.cpp ;
run add_phoenix.cpp ;
run add_phoenix.cpp : : : <library>/boost/phoenix//boost_phoenix ;
run const_block.cpp ;
compile-fail const_block_error.cpp : <variant>debug ;
@@ -43,8 +44,8 @@ run n2550_find_if.cpp ;
compile-fail noncopyable_cxx11_lambda_error.cpp ;
run noncopyable_local_function.cpp ;
run phoenix_factorial.cpp ;
run phoenix_factorial_local.cpp ;
run phoenix_factorial.cpp : : : <library>/boost/phoenix//boost_phoenix ;
run phoenix_factorial_local.cpp : : : <library>/boost/phoenix//boost_phoenix ;
# Only compile but do not run profiling programs (they take a long time to run).
exe profile_global_functor : profile_global_functor.cpp
@@ -75,8 +76,9 @@ exe profile_local_functor : profile_local_functor.cpp
exe profile_phoenix : profile_phoenix.cpp
: <library>/boost/chrono//boost_chrono
<library>/boost/system//boost_system
<library>/boost/phoenix//boost_phoenix
<link>static
;
run scope_exit.cpp ;
run scope_exit.cpp : : : <library>/boost/foreach//boost_foreach ;

View File

@@ -10,9 +10,12 @@ import testing ;
# Sun does not automatically detect type-of emulation mode (force it).
project :
requirements
<library>/boost/local_function//boost_local_function
<toolset>sun:<define>BOOST_TYPEOF_EMULATION
<toolset>gcc:<cxxflags>-Wno-unused-local-typedefs
<toolset>clang:<cxxflags>-Wno-unused-local-typedefs
<library>/boost/concept_check//boost_concept_check
<library>/boost/functional//boost_functional
;
rule vaseq ( command target )