Skip to content

Commit

Permalink
Add support for modular build structure. (#21)
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.

* Update dependencies.

* Bump B2 require to 5.2

* Remove repeated import-search.

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

* Adjust doc build to avoid boost-root references.

* Update build deps.
  • Loading branch information
grafikrobot authored Aug 18, 2024
1 parent db963ea commit bc85d86
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
26 changes: 26 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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 ;

constant boost_dependencies :
/boost/assert//boost_assert
/boost/config//boost_config
/boost/core//boost_core
/boost/type_traits//boost_type_traits ;

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

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

call-if : boost-library scope
;

2 changes: 1 addition & 1 deletion doc/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ local doxygen_params =

local top_level_includes =
[ glob
../../../boost/scope/*.hpp
../include/boost/scope/*.hpp
] ;


Expand Down
10 changes: 8 additions & 2 deletions test/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# https://www.boost.org/LICENSE_1_0.txt)

require-b2 5.0.1 ;

import testing ;
import path ;
import regex ;
import os ;
import ../../config/checks/config : requires ;
import-search /boost/config/checks ;
import config : requires ;

project
: requirements
<library>/boost/scope//boost_scope
<include>common

<c++-template-depth>1024
Expand Down Expand Up @@ -43,6 +47,8 @@ project
<target-os>windows:<define>_CRT_SECURE_NO_DEPRECATE
;

path-constant SCOPE_INCLUDE_DIR : ../include ;

# this rule enumerates through all the sources and invokes
# the run rule for each source, the result is a list of all
# the run rules, which we can pass on to the test_suite rule:
Expand All @@ -53,7 +59,7 @@ rule test_all

if ! [ os.environ BOOST_SCOPE_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ]
{
local headers_path = [ path.make $(BOOST_ROOT)/libs/scope/include/boost/scope ] ;
local headers_path = [ path.make $(SCOPE_INCLUDE_DIR)/boost/scope ] ;
for file in [ path.glob-tree $(headers_path) : *.hpp : detail ]
{
local rel_file = [ path.relative-to $(headers_path) $(file) ] ;
Expand Down

0 comments on commit bc85d86

Please sign in to comment.