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

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
35 changes: 35 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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/assert//boost_assert
/boost/config//boost_config
/boost/core//boost_core
/boost/integer//boost_integer
/boost/io//boost_io
/boost/lambda//boost_lambda
/boost/math//boost_math_tr1
/boost/move//boost_move
/boost/mpl//boost_mpl
/boost/preprocessor//boost_preprocessor
/boost/static_assert//boost_static_assert
/boost/type_traits//boost_type_traits
/boost/typeof//boost_typeof ;

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

explicit
[ alias boost_units : : : : <library>$(boost_dependencies) ]
[ alias all : boost_units example test test_headers ]
;

call-if : boost-library units
;

32 changes: 16 additions & 16 deletions doc/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,24 @@ rule run_doxygen ( target : files * : name )

run_doxygen units_reference
:
[ glob $(here)/../../../boost/units/*.hpp :
$(here)/../../../boost/units/physical_dimensions.hpp ]
[ glob $(here)/../include/boost/units/*.hpp :
$(here)/../include/boost/units/physical_dimensions.hpp ]
:
"Units Reference"
;

run_doxygen si_reference
:
$(here)/../../../boost/units/systems/si.hpp
[ path.glob-tree $(here)/../../../boost/units/systems/si : *.hpp : detail ]
$(here)/../include/boost/units/systems/si.hpp
[ path.glob-tree $(here)/../include/boost/units/systems/si : *.hpp : detail ]
:
"SI System Reference"
;

run_doxygen cgs_reference
:
$(here)/../../../boost/units/systems/cgs.hpp
[ path.glob-tree $(here)/../../../boost/units/systems/cgs : *.hpp : detail ]
$(here)/../include/boost/units/systems/cgs.hpp
[ path.glob-tree $(here)/../include/boost/units/systems/cgs : *.hpp : detail ]
:
"CGS System Reference"
;
Expand All @@ -81,7 +81,7 @@ rule make_base_units_doc ( directory : name )
{
run_doxygen $(directory)_base_units_reference
:
[ path.glob-tree $(here)/../../../boost/units/base_units/$(directory) : *.hpp : detail conversions.hpp ]
[ path.glob-tree $(here)/../include/boost/units/base_units/$(directory) : *.hpp : detail conversions.hpp ]
:
"$(name) Base Units Reference"
;
Expand All @@ -102,45 +102,45 @@ all_base_units_doc = $(all_base_units_doc)_base_units_reference ;

run_doxygen dimensions_reference
:
$(here)/../../../boost/units/physical_dimensions.hpp
[ path.glob-tree $(here)/../../../boost/units/physical_dimensions : *.hpp : detail ]
$(here)/../include/boost/units/physical_dimensions.hpp
[ path.glob-tree $(here)/../include/boost/units/physical_dimensions : *.hpp : detail ]
:
"Dimensions Reference"
;

run_doxygen trig_reference
:
#../../../boost/units/systems/trig.hpp
[ path.glob-tree $(here)/../../../boost/units/systems/angle : *.hpp : detail ]
[ path.glob-tree $(here)/../include/boost/units/systems/angle : *.hpp : detail ]
:
"Trigonometry and Angle System Reference"
;

run_doxygen temperature_reference
:
[ path.glob-tree $(here)/../../../boost/units/systems/temperature : *.hpp : detail ]
[ path.glob-tree $(here)/../include/boost/units/systems/temperature : *.hpp : detail ]
:
"Temperature System Reference"
;

run_doxygen information_reference
:
$(here)/../../../boost/units/systems/information.hpp
[ path.glob-tree $(here)/../../../boost/units/systems/information : *.hpp : detail prefixes.hpp ]
$(here)/../include/boost/units/systems/information.hpp
[ path.glob-tree $(here)/../include/boost/units/systems/information : *.hpp : detail prefixes.hpp ]
:
"Information System Reference"
;

run_doxygen abstract_reference
:
$(here)/../../../boost/units/systems/abstract.hpp
$(here)/../include/boost/units/systems/abstract.hpp
:
"Abstract System Reference"
;

rule less ( a b )
{
if [ path.basename $(a) ] < [ path.basename $(b) ]
if [ path.basename $(a) ] < [ path.basename $(b) ]
{
return true ;
}
Expand Down Expand Up @@ -181,7 +181,7 @@ rule generate-qbk ( target : sources * : properties * )
}
}

make base_units.qbk : [ path.glob-tree $(here)/../../../boost/units/base_units : *.hpp : detail conversions.hpp ] : @generate-qbk ;
make base_units.qbk : [ path.glob-tree $(here)/../include/boost/units/base_units : *.hpp : detail conversions.hpp ] : @generate-qbk ;
explicit base_units ;

install base_units_install : base_units.qbk : <location>. ;
Expand Down
14 changes: 8 additions & 6 deletions example/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@
# http://www.boost.org/LICENSE_1_0.txt

import testing ;
import path ;

project boost/units/example :
: requirements <include>$(BOOST_ROOT) <include>../../.. <warnings>all
project :
: requirements <warnings>all
<library>/boost/units//boost_units
;

files = [ path.glob . : *.cpp : performance.* runtime_unit.* ] ;
files = [ glob *.cpp : performance.* runtime_unit.* ] ;

for local file in $(files)
{
run $(file) ;
}

compile performance.cpp ;
run runtime_unit.cpp : <runtime_unit_input.txt ;
path-constant HERE : . ;

compile performance.cpp /boost/timer//boost_timer /boost/ublas//boost_ublas : <define>BOOST_TIMER_ENABLE_DEPRECATED ;
run runtime_unit.cpp : <$(HERE)/runtime_unit_input.txt ;
18 changes: 9 additions & 9 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ warning-compilers =
<toolset>msvc
;

project boost/units/test :
project :
requirements
<implicit-dependency>/boost//headers
<library>/boost/units//boost_units
<toolset>msvc:<asynch-exceptions>on
$(warning-compilers)\:$(warning-options)
# This warning comes from the test library.
Expand All @@ -43,16 +43,16 @@ run test_conversion.cpp ;
run test_base_dimension.cpp ;
run test_absolute.cpp ;
run test_default_conversion.cpp ;
run test_cmath.cpp ;
run test_limits.cpp ;
run test_cmath.cpp /boost/math//boost_math_tr1 ;
run test_limits.cpp /boost/math//boost_math_tr1 ;
run test_custom_unit.cpp ;
run test_scaled_conversion.cpp ;
run test_lambda.cpp ;
run test_sqrt_scaled_unit.cpp ;
run test_lambda.cpp /boost/lambda//boost_lambda ;
run test_sqrt_scaled_unit.cpp /boost/math//boost_math_tr1 ;
run test_scaled_unit.cpp ;
run test_output.cpp /boost//regex/<warnings-as-errors>off : : : <test-info>always_show_run_output ;
run test_trig.cpp ;
run test_information_units.cpp ;
run test_output.cpp /boost/regex//boost_regex/<warnings-as-errors>off : : : <test-info>always_show_run_output ;
run test_trig.cpp /boost/math//boost_math_tr1 ;
run test_information_units.cpp /boost/multiprecision//boost_multiprecision ;

compile-fail fail_implicit_conversion.cpp ;
compile-fail fail_quantity_construct.cpp ;
Expand Down
15 changes: 9 additions & 6 deletions test_headers/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ import print ;
import sequence ;
import feature ;

project boost/units/test_headers :
requirements <include>$(BOOST_ROOT) <include>../../..
;
project : requirements <library>/boost/units//boost_units ;

headers = [ path.glob-tree ../../../boost/units : *.hpp : detail ] ;
path-constant INCLUDE_DIR : ../include ;
headers = [ path.glob-tree $(INCLUDE_DIR)/boost/units : *.hpp : detail ] ;

for local file in $(headers)
{
Expand All @@ -27,7 +26,7 @@ for local file in $(headers)
<define>BOOST_UNITS_HEADER_NAME=$(file)
<dependency>$(file)
: # test name
[ regex.replace [ path.relative-to ../../.. $(file) ] "/" "_" ] ;
[ regex.replace [ path.relative-to $(INCLUDE_DIR) $(file) ] "/" "_" ] ;
}

feature.feature <generate-include-all-order> : forward reverse : incidental ;
Expand All @@ -43,8 +42,12 @@ rule generate-include-all ( target : sources * : properties * )

for local file in $(sources)
{
print.text "#include <$(file:G=)>
if $(file:S) = ".hpp"
{
local f = [ path.relative-to $(INCLUDE_DIR) $(file:G=) ] ;
print.text "#include <$(f)>
" : overwrite ;
}
}

}
Expand Down