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. #401

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ tools/codecov
coverage-report
.cache
venv
.pytest_cache
.pytest_cache
!*.jam
38 changes: 0 additions & 38 deletions Jamfile

This file was deleted.

52 changes: 52 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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 ;

# Special builds for Boost Histogram:
#
# Generate coverage data: b2 cxxstd=latest coverage=on test//all
# Test without exceptions and rtti: b2 cxxstd=latest exception-handling=off rtti=off test//minimal
# Test with sanitizers: b2 toolset=clang cxxstd=latest histogram_ubasan test

constant boost_dependencies :
/boost/config//boost_config
/boost/core//boost_core
/boost/math//boost_math_tr1
/boost/mp11//boost_mp11
/boost/serialization//boost_serialization
/boost/throw_exception//boost_throw_exception
/boost/variant2//boost_variant2 ;

project /boost/histogram
: common-requirements
<include>include
: requirements
<toolset>clang:<cxxflags>"-Wsign-compare -Wstrict-aliasing -fstrict-aliasing -Wvexing-parse -Wfloat-conversion"
<toolset>darwin:<cxxflags>"-Wsign-compare -Wstrict-aliasing -fstrict-aliasing -Wvexing-parse -Wfloat-conversion"
<toolset>gcc:<cxxflags>"-Wsign-compare -Wstrict-aliasing -fstrict-aliasing -Wfloat-conversion"
<toolset>msvc:<cxxflags>"/bigobj"
<toolset>intel-win:<cxxflags>"/bigobj"
<local-visibility>hidden
: default-build
<warnings>extra
;

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

call-if : boost-library histogram
;

path-constant THIS_PATH : . ;

# only works with clang because of -fsanitize-blacklist
variant histogram_ubasan : debug :
<cxxflags>"-fno-omit-frame-pointer -O0 -fno-inline -fsanitize=address,leak,undefined -fno-sanitize-recover=all -fsanitize-blacklist=$(THIS_PATH)/tools/blacklist.supp"
<linkflags>"-fsanitize=address,leak,undefined"
;

12 changes: 6 additions & 6 deletions doc/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ path-constant THIS_PATH : . ;

doxygen reference
:
$(THIS_PATH)/../../../boost/histogram.hpp
[ glob $(THIS_PATH)/../../../boost/histogram/*.hpp ]
[ glob $(THIS_PATH)/../../../boost/histogram/accumulators/*.hpp ]
[ glob $(THIS_PATH)/../../../boost/histogram/algorithm/*.hpp ]
[ glob $(THIS_PATH)/../../../boost/histogram/axis/*.hpp ]
[ glob $(THIS_PATH)/../../../boost/histogram/utility/*.hpp ]
$(THIS_PATH)/../include/boost/histogram.hpp
[ glob $(THIS_PATH)/../include/boost/histogram/*.hpp ]
[ glob $(THIS_PATH)/../include/boost/histogram/accumulators/*.hpp ]
[ glob $(THIS_PATH)/../include/boost/histogram/algorithm/*.hpp ]
[ glob $(THIS_PATH)/../include/boost/histogram/axis/*.hpp ]
[ glob $(THIS_PATH)/../include/boost/histogram/utility/*.hpp ]
:
<doxygen:param>QUIET=YES
<doxygen:param>WARNINGS=YES
Expand Down
8 changes: 7 additions & 1 deletion examples/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

require-b2 5.0.1 ;

import-search /boost/config/checks ;

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

project
: requirements
<library>/boost/histogram//boost_histogram
[ requires
cxx14_constexpr cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx11_user_defined_literals
# list could go on...
]
<library>/boost/format//boost_format
;

alias cxx14 :
Expand Down
11 changes: 8 additions & 3 deletions test/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

require-b2 5.0.1 ;

import-search /boost/config/checks ;

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

if ! [ python.configured ]
{
Expand All @@ -21,6 +25,7 @@ path-constant THIS_PATH : . ;

project
: requirements
<library>/boost/histogram//boost_histogram
[ requires
cxx14_constexpr cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx11_user_defined_literals
# list could go on...
Expand Down Expand Up @@ -149,9 +154,9 @@ alias math :
[ run utility_jeffreys_interval_test.cpp ]
: <warnings>off
;
alias accumulators : [ run boost_accumulators_support_test.cpp ] : <warnings>off ;
alias accumulators : [ run boost_accumulators_support_test.cpp : : : <library>/boost/accumulators//boost_accumulators ] : <warnings>off ;
alias range : [ run boost_range_support_test.cpp ] : <warnings>off ;
alias units : [ run boost_units_support_test.cpp ] : <warnings>off ;
alias units : [ run boost_units_support_test.cpp : : : <library>/boost/units//boost_units ] : <warnings>off ;
alias serialization :
[ run accumulators_serialization_test.cpp libserial : $(THIS_PATH) ]
[ run detail_array_wrapper_serialization_test.cpp libserial ]
Expand Down
Loading