Skip to content

Commit

Permalink
Add support for modular build structure. (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
grafikrobot authored Aug 24, 2024
1 parent 6039165 commit e1e908e
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ jobs:
cd ..
git clone -b $BOOST_BRANCH --depth 10 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init --depth 10 --jobs 2 tools/boostdep tools/inspect libs/filesystem
git submodule update --init --depth 10 --jobs 2 tools/boostdep libs/filesystem tools/inspect
python tools/boostdep/depinst/depinst.py --git_args "--depth 10 --jobs 3" filesystem
rm -rf libs/$LIBRARY/*
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
python tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--depth 10 --jobs 3" $LIBRARY
./bootstrap.sh
./b2 -d0 headers
./b2 -j4 variant=debug tools/inspect/build
./b2 variant=debug tools/inspect/build
- name: Run tests
run: |
cd ../boost-root
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release "${{matrix.cxxflags}}" "${{matrix.linkflags}}" "${{matrix.launcher}}"
./b2 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release "${{matrix.cxxflags}}" "${{matrix.linkflags}}" "${{matrix.launcher}}"
dist/bin/inspect libs/$LIBRARY
- name: Test boost namespace stripping
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
git clone -b %BOOST_BRANCH% --depth 10 https://github.com/boostorg/boost.git boost-root
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
git submodule update --init tools/boostdep
git submodule update --init --depth 10 --jobs 2 tools/boostdep
python tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs 3" %LIBRARY%
cmd /c bootstrap
b2 -d0 headers
Expand Down
20 changes: 20 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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 ;

project /boost/pfr
: common-requirements
<include>include
;

explicit
[ alias boost_pfr : : : : <library>$(boost_dependencies) ]
[ alias all : boost_pfr test ]
;

call-if : boost-library pfr
;

6 changes: 3 additions & 3 deletions doc/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ project pfr/doc ;

#
# Common params for doxygen
#
#

local doxygen_params =
<doxygen:param>EXTRACT_ALL=NO
Expand All @@ -43,8 +43,8 @@ local doxygen_params =

doxygen autodoc_pfr
:
[ glob ../../../boost/pfr.hpp ]
[ glob ../../../boost/pfr/*.hpp ]
[ glob ../include/boost/pfr.hpp ]
[ glob ../include/boost/pfr/*.hpp ]
:
$(doxygen_params)
<xsl:param>"boost.doxygen.reftitle=Reference Section of PFR"
Expand Down
6 changes: 5 additions & 1 deletion test/config/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
# http://www.boost.org/LICENSE_1_0.txt)
#

import-search /boost/config/checks ;

import python ;
import testing ;
import ../../config/checks/config : requires ;
import config : requires ;

project
: source-location .
: requirements
<library>/boost/config//boost_config
<library>/boost/preprocessor//boost_preprocessor
<define>BOOST_PFR_DETAIL_STRICT_RVALUE_TESTING=1
;

Expand Down
13 changes: 10 additions & 3 deletions test/core/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@
# http://www.boost.org/LICENSE_1_0.txt)
#

import-search /boost/config/checks ;

import python ;
import testing ;
import ../../config/checks/config : requires ;
import config : requires ;

project
: source-location .
: requirements
<library>/boost/config//boost_config
<library>/boost/core//boost_core
<library>/boost/container_hash//boost_container_hash
<library>/boost/type_index//boost_type_index

<define>BOOST_PFR_DETAIL_STRICT_RVALUE_TESTING=1
[ requires cxx14_constexpr ]
;
Expand Down Expand Up @@ -73,7 +80,7 @@ local BLACKLIST_TESTS_FOR_LOOPHOLE =
tie_anonymous_const_field # boost::pfr::structure_tie gives compile time error on const fields
;

# Those tests are either
# Those tests are either
# * reflecting a non literal type
# * or calling boost::pfr::get and the result is a user defined structure
local BLACKLIST_TESTS_FOR_CLASSIC =
Expand All @@ -99,7 +106,7 @@ for local source_file in [ glob ./run/*.cpp ] [ glob ../../example/*.cpp ]
{
local target_name = $(source_file[1]:B) ;
pfr_tests += [ run $(source_file) : : : $(STRUCTURED_BINDING_ENGINE) : $(target_name)_sb ] ;

if ! $(target_name) in $(BLACKLIST_TESTS_FOR_LOOPHOLE)
{
pfr_tests += [ run $(source_file) : : : $(LOOPHOLE_ENGINE) : $(target_name)_lh ] ;
Expand Down
5 changes: 4 additions & 1 deletion test/core_name/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
# The way to make it union and UB free by X-Ryl669, https://github.com/X-Ryl669
#

import-search /boost/config/checks ;

import testing ;
import ../../config/checks/config : requires ;
import config : requires ;

########## BEGIN of helpers to detect C++20 features support

Expand Down Expand Up @@ -38,6 +40,7 @@ explicit compiler_supports_cxx20_nontype_tplarg ;
project
: source-location .
: requirements
<library>/boost/core//boost_core
<define>BOOST_PFR_DETAIL_STRICT_RVALUE_TESTING=1
[ check-target-builds ../core_name//compiler_supports_cxx20_address_of_non_static_member_tplarg : : [ check-target-builds ../core_name//compiler_supports_cxx20_nontype_tplarg : : <build>no ] ]
;
Expand Down

0 comments on commit e1e908e

Please sign in to comment.