From bc85d865f2300cc8b7211a90f9c1278ce66b2c52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Ferdinand=20Rivera=20Morell?= Date: Sun, 18 Aug 2024 18:10:27 -0500 Subject: [PATCH] Add support for modular build structure. (#21) * 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. --- build.jam | 26 ++++++++++++++++++++++++++ doc/Jamfile | 2 +- test/Jamfile | 10 ++++++++-- 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 build.jam diff --git a/build.jam b/build.jam new file mode 100644 index 0000000..dab25dc --- /dev/null +++ b/build.jam @@ -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 + ; + +explicit + [ alias boost_scope : : : : $(boost_dependencies) ] + [ alias all : boost_scope test ] + ; + +call-if : boost-library scope + ; + diff --git a/doc/Jamfile b/doc/Jamfile index 0c8f86c..52cedf2 100644 --- a/doc/Jamfile +++ b/doc/Jamfile @@ -56,7 +56,7 @@ local doxygen_params = local top_level_includes = [ glob - ../../../boost/scope/*.hpp + ../include/boost/scope/*.hpp ] ; diff --git a/test/Jamfile b/test/Jamfile index 9481d5a..abb2f73 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -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 + /boost/scope//boost_scope common 1024 @@ -43,6 +47,8 @@ project windows:_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: @@ -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) ] ;