Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for modular build structure. #25

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
36 changes: 18 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- master
- develop
- feature/**
- modular

env:
UBSAN_OPTIONS: print_stacktrace=1
Expand Down Expand Up @@ -43,6 +44,7 @@ jobs:
install: g++-10
- toolset: gcc-11
os: ubuntu-22.04
install: g++-11
- toolset: gcc-12
os: ubuntu-22.04
install: g++-12
Expand Down Expand Up @@ -157,19 +159,16 @@ jobs:
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
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/quickbook/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
git submodule update --init
rm -rf tools/quickbook/*
cp -r $GITHUB_WORKSPACE/* tools/quickbook
git submodule update --init tools/boostdep
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" ../tools/quickbook
./bootstrap.sh
./b2 -d0 headers

Expand All @@ -181,7 +180,7 @@ jobs:
- name: Run tests
run: |
cd ../boost-root
./b2 -j3 tools/quickbook/test toolset=${{matrix.toolset}} variant=debug,release
./b2 tools/quickbook//all toolset=${{matrix.toolset}} variant=debug,release

windows:
strategy:
Expand Down Expand Up @@ -211,23 +210,24 @@ jobs:
- name: Setup Boost
shell: cmd
run: |
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
echo GITHUB_REF: %GITHUB_REF%
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
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:quickbook=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
git submodule update --init
rd /s/q tools\quickbook
xcopy /s /e /q %GITHUB_WORKSPACE% tools\quickbook\
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" ../tools/quickbook
cmd /c bootstrap
b2 -d0 headers

- name: Run tests
shell: cmd
run: |
cd ../boost-root
b2 -j3 tools/quickbook/test toolset=${{matrix.toolset}} variant=debug,release embed-manifest-via=linker
b2 tools/quickbook//all toolset=${{matrix.toolset}} variant=debug,release embed-manifest-via=linker
55 changes: 22 additions & 33 deletions Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,18 @@
# http://www.boost.org/LICENSE_1_0.txt)
#==============================================================================

project quickbook
require-b2 5.2 ;

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 ?= dist ;
DIST_DIR = [ path.root [ path.make $(DIST_DIR) ] [ path.pwd ] ] ;

project /boost/quickbook
: requirements
<toolset>gcc:<c++-template-depth>300
<toolset>darwin:<c++-template-depth>300
Expand All @@ -19,39 +30,17 @@ project quickbook
<warnings>all
<define>BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE
: default-build
<cxxstd>0x
;

import boostcpp ;
import path ;
import option ;

local DIST_DIR = [ option.get distdir ] ;
if $(DIST_DIR) {
DIST_DIR = [ path.root [ path.make $(DIST_DIR) ] [ path.pwd ] ] ;
} else {
DIST_DIR = [ path.join $(BOOST_ROOT) dist ] ;
}
local DIST_BIN = [ path.join $(DIST_DIR) bin ] ;

# Install quickbook by default.

install dist-bin
:
src//quickbook
:
<install-type>EXE
<location>$(DIST_BIN)
:
release
<cxxstd>11
;

# Target for quickbook toolset's auto build.

alias quickbook
: src//quickbook
: release
explicit
[ install dist-bin
: src//quickbook/<link>static
: <install-type>EXE <location>$(DIST_DIR)/bin
: release ]
[ alias quickbook : src//quickbook/<link>static ]
[ alias all : quickbook dist test ]
;

explicit quickbook
;
# Install distribution files/execs by default.
alias dist : dist-bin ;
9 changes: 0 additions & 9 deletions build/Jamfile.v2

This file was deleted.

30 changes: 15 additions & 15 deletions src/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ exe quickbook
block_element_grammar.cpp
phrase_element_grammar.cpp
doc_info_grammar.cpp
/boost//program_options
/boost//filesystem
: #<define>QUICKBOOK_NO_DATES
<define>BOOST_FILESYSTEM_NO_DEPRECATED
<toolset>msvc:<cxxflags>/wd4355
<toolset>msvc:<cxxflags>/wd4511
<toolset>msvc:<cxxflags>/wd4512
<toolset>msvc:<cxxflags>/wd4701
<toolset>msvc:<cxxflags>/wd4702
<toolset>msvc:<cxxflags>/wd4244
<toolset>msvc:<cxxflags>/wd4267
<toolset>msvc:<cxxflags>/wd4800
<toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
<toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
<target-os>windows:<library>shell32
/boost/program_options//boost_program_options/<link>static
/boost/filesystem//boost_filesystem/<link>static
: #<define>QUICKBOOK_NO_DATES
<define>BOOST_FILESYSTEM_NO_DEPRECATED
<toolset>msvc:<cxxflags>/wd4355
<toolset>msvc:<cxxflags>/wd4511
<toolset>msvc:<cxxflags>/wd4512
<toolset>msvc:<cxxflags>/wd4701
<toolset>msvc:<cxxflags>/wd4702
<toolset>msvc:<cxxflags>/wd4244
<toolset>msvc:<cxxflags>/wd4267
<toolset>msvc:<cxxflags>/wd4800
<toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
<toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
<target-os>windows:<library>shell32
;
2 changes: 1 addition & 1 deletion test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# http://www.boost.org/LICENSE_1_0.txt)
#

project quickbook/test
project
: requirements
<toolset>msvc:<debug-symbols>off
<cxxstd>98:<build>no
Expand Down
Loading