Skip to content

Commit

Permalink
Add support for modular build structure. (#274)
Browse files Browse the repository at this point in the history
* Make the library modular usable.

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Add missing import-search for cconfig/predef checks.

* Add requires-b2 check to top-level build file.

* Bump B2 require to 5.2

* Change all <source> references to <library>.

* Update copyright dates.

* Move inter-lib dependencies to a project variable and into the build targets.

* Update build deps.
  • Loading branch information
grafikrobot authored Aug 22, 2024
1 parent f86ddcc commit 495539c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 8 deletions.
34 changes: 34 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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/config//boost_config
/boost/container_hash//boost_container_hash
/boost/core//boost_core
/boost/function_types//boost_function_types
/boost/functional//boost_functional
/boost/mpl//boost_mpl
/boost/preprocessor//boost_preprocessor
/boost/static_assert//boost_static_assert
/boost/tuple//boost_tuple
/boost/type_traits//boost_type_traits
/boost/typeof//boost_typeof
/boost/utility//boost_utility ;

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

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

call-if : boost-library fusion
;

18 changes: 10 additions & 8 deletions test/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
# bring in rules for testing
import testing ;
import os ;
import ../../config/checks/config : requires ;
import-search /boost/config/checks ;
import config : requires ;

if [ os.environ CI ]
{
Expand All @@ -19,14 +20,15 @@ if [ os.environ CI ]

project
: requirements
<library>/boost/fusion//boost_fusion
$(CI_DEFINES)
;

{
test-suite fusion :

[ run algorithm/all.cpp ]
[ run algorithm/any.cpp ]
[ run algorithm/all.cpp : : : <library>/boost/lambda//boost_lambda ]
[ run algorithm/any.cpp : : : <library>/boost/lambda//boost_lambda ]
[ run algorithm/clear.cpp ]
[ run algorithm/copy.cpp ]
[ run algorithm/count.cpp ]
Expand All @@ -44,8 +46,8 @@ project
[ run algorithm/iter_fold.cpp ]
[ run algorithm/move.cpp : :
: [ requires cxx11_rvalue_references ] ]
[ run algorithm/none.cpp ]
[ run algorithm/pop_back.cpp ]
[ run algorithm/none.cpp : : : <library>/boost/lambda//boost_lambda ]
[ run algorithm/pop_back.cpp : : : <library>/boost/array//boost_array ]
[ run algorithm/pop_front.cpp ]
[ run algorithm/push_back.cpp ]
[ run algorithm/push_front.cpp ]
Expand Down Expand Up @@ -76,7 +78,7 @@ project
[ run sequence/as_vector.cpp ]
[ run sequence/boost_tuple.cpp ]
[ run sequence/boost_tuple_iterator.cpp ]
[ run sequence/cons.cpp ]
[ run sequence/cons.cpp : : : <library>/boost/lambda//boost_lambda ]
[ run sequence/convert_boost_tuple.cpp ]
[ run sequence/convert_deque.cpp ]
[ run sequence/convert_list.cpp ]
Expand Down Expand Up @@ -134,7 +136,7 @@ project
[ run sequence/set.cpp ]
[ run sequence/single_view.cpp ]
[ run sequence/std_pair.cpp ]
[ run sequence/boost_array.cpp ]
[ run sequence/boost_array.cpp : : : <library>/boost/array//boost_array ]
[ run sequence/array.cpp ]
[ run sequence/std_array.cpp : :
: [ requires cxx11_hdr_array ] ]
Expand Down Expand Up @@ -241,7 +243,7 @@ project
[ compile sequence/github-159.cpp ]
[ run sequence/github-176.cpp ]

[ compile sequence/size.cpp ]
[ compile sequence/size.cpp : <library>/boost/array//boost_array ]

[ run functional/fused.cpp ]
[ run functional/fused_function_object.cpp ]
Expand Down

0 comments on commit 495539c

Please sign in to comment.