Merge pull request #7 from grafikrobot/modular

Add support for modular build structure.
This commit is contained in:
jzmaddock 2024-08-17 18:24:15 +01:00 committed by GitHub
commit 91e2f15b8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 235 additions and 264 deletions

View File

@ -7,6 +7,7 @@ on:
- master
- develop
- feature/**
- modular
env:
UBSAN_OPTIONS: print_stacktrace=1
@ -56,22 +57,16 @@ jobs:
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=../tools/${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
BOOST_BRANCH=develop && ( test "${GITHUB_REF_NAME}" == "master" || test "${GITHUB_REF_NAME}" == "modular" ) && BOOST_BRANCH=${GITHUB_REF_NAME} || true
BOOST_GIT=https://github.com/${GITHUB_REPOSITORY/auto_index/boost}.git
echo BOOST_GIT: ${BOOST_GIT}
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
git clone -b $BOOST_BRANCH --depth 1 "${BOOST_GIT}" boost-root
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python3 tools/boostdep/depinst/depinst.py -I examples --git_args "--jobs 3" $LIBRARY
git submodule update --init
rm -rf tools/auto_index/*
cp -r $GITHUB_WORKSPACE/* tools/auto_index
./bootstrap.sh
./b2 -d0 headers
@ -83,7 +78,7 @@ jobs:
- name: Run tests
run: |
cd ../boost-root
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release
./b2 -j3 tools/auto_index//all toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release
windows:
strategy:
@ -110,21 +105,18 @@ jobs:
shell: cmd
run: |
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=../tools/%%~nxi
echo LIBRARY: %LIBRARY%
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
echo GITHUB_REF: %GITHUB_REF%
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
set BOOST_BRANCH=develop
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
if "%GITHUB_REF_NAME%" == "master" set BOOST_BRANCH=master
if "%GITHUB_REF_NAME%" == "modular" set BOOST_BRANCH=modular
set BOOST_GIT=https://github.com/%GITHUB_REPOSITORY:auto_index=boost%.git
echo BOOST_GIT: %BOOST_GIT%
echo BOOST_BRANCH: %BOOST_BRANCH%
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
git clone -b %BOOST_BRANCH% --depth 1 %BOOST_GIT% boost-root
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY:/=\%\
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py -I examples --git_args "--jobs 3" %LIBRARY%
git submodule update --init
rd /s/q tools\auto_index
xcopy /s /e /q %GITHUB_WORKSPACE% tools\auto_index\
cmd /c bootstrap
b2 -d0 headers
@ -132,4 +124,4 @@ jobs:
shell: cmd
run: |
cd ../boost-root
b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release embed-manifest-via=linker
b2 -j3 tools/auto_index//all toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release embed-manifest-via=linker

29
build.jam Normal file
View File

@ -0,0 +1,29 @@
# Copyright René Ferdinand Rivera Morell 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 ;
import option ;
import path ;
local DIST_DIR = [ option.get distdir ] ;
DIST_DIR ?= [ option.get build-dir ] ;
DIST_DIR ?= [ path.join $(BOOST_ROOT) dist ] ;
DIST_DIR ?= dist ;
DIST_DIR = [ path.root [ path.make $(DIST_DIR) ] [ path.pwd ] ] ;
project /boost/auto_index ;
explicit
[ install dist-bin
: build//auto_index/<link>static
: <install-type>EXE <location>$(DIST_DIR)/bin
: release ]
[ alias auto_index : build//auto_index ]
[ alias all : auto_index test dist-bin ]
;
# Install distribution files/execs by default.
alias dist : dist-bin ;

View File

@ -6,30 +6,13 @@
# http://www.boost.org/LICENSE_1_0.txt)
#==============================================================================
import quickbook ;
import modules ;
import boostcpp ;
import path ;
import option ;
local DIST_DIR = [ option.get distdir ] ;
DIST_DIR ?= [ option.get build-dir ] ;
DIST_DIR ?= [ path.join $(BOOST_ROOT) dist ] ;
DIST_DIR = [ path.root [ path.make $(DIST_DIR) ] [ path.pwd ] ] ;
local DIST_BIN = [ path.join $(DIST_DIR) bin ] ;
exe auto_index :
../src/auto_index.cpp
../src/file_scanning.cpp
../src/index_generator.cpp
../src/tiny_xml.cpp
/boost//regex
/boost//filesystem
/boost//system
/boost//program_options
: <define>BOOST_ALL_NO_LIB=1 <link>static release ;
install aii : auto_index : <location>. ;
explicit aii ;
install i : auto_index : <location>$(DIST_BIN) ;
exe auto_index :
../src/auto_index.cpp
../src/file_scanning.cpp
../src/index_generator.cpp
../src/tiny_xml.cpp
/boost/regex//boost_regex
/boost/filesystem//boost_filesystem
/boost/system//boost_system
/boost/program_options//boost_program_options
: <define>BOOST_ALL_NO_LIB=1 <link>static release ;

View File

@ -15,11 +15,6 @@ boostbook standalone
:
auto_index
:
# Path for links to Boost:
<xsl:param>boost.root=../../../..
# Path for libraries index:
<xsl:param>boost.libraries=$(boost-root)/libs/libraries.htm
# Some general style settings:
<xsl:param>table.footnote.number.format=1
<xsl:param>footnote.number.format=1
@ -83,6 +78,3 @@ boostbook standalone
;
install pdf-install : standalone : <install-type>PDF <location>. <name>auto_index.pdf ;

View File

@ -12,56 +12,31 @@ import toolset ;
import type ;
path-constant ROOT : ../../.. ;
path-constant HERE : . ;
exe line_compare_tool : text_diff.cpp ;
actions auto-index
{
"$(>[1])" "--prefix=$(ROOT)" "--in=$(>[2])" "--script=$(>[3])" "--out=$(<[1])"
}
rule auto-index-test ( target-name : input-file : script-file : output-file ? : options * )
{
local project = [ project.current ] ;
local t =
[ targets.create-typed-target RUN
: $(project)
: $(target-name)
: [ alias autoindex : ../build//auto_index : release ]
: $(requirements)
<location-prefix>$(target-name).test
<testing.arg>--prefix=$(ROOT)
<testing.arg>$(options)
<testing.arg>--in=$(HERE)/$(input-file)
<testing.arg>--script=$(HERE)/$(script-file)
<testing.arg>--out=$(HERE)/$(target-name).out
<preserve-test-targets>on
<dependency>Jamfile.v2
<dependency>$(input-file)
<dependency>$(script-file)
]
make $(target-name)._out
: ../build//auto_index/<variant>release
$(input-file)
$(script-file)
: @auto-index
: <location-prefix>$(target-name).test
<dependency>Jamfile.v2
;
local n = [ $(t).name ] ;
#ECHO n: $(n) ;
t +=
[ targets.create-typed-target RUN
: $(project)
: $(target-name)_check
: [ alias lct : line_compare_tool : release ]
: $(requirements)
<location-prefix>$(target-name).test
<testing.arg>$(HERE)/$(target-name).out
<testing.arg>$(HERE)/$(target-name).gold
<preserve-test-targets>on
<dependency>$(n)
<dependency>Jamfile.v2
<dependency>$(input-file)
<dependency>$(script-file)
]
testing.run text_diff.cpp
:
: $(target-name)._out
$(target-name).gold
: <preserve-test-targets>on
<dependency>Jamfile.v2
: $(target-name)_check
;
modules.poke testing : .all-tests : \$\(all-tests\) $(t) ;
return $(t) ;
}
auto-index-test test1 : type_traits.docbook : index.idx ;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long