From 477583869ec304899170728e32ce9f0c5c597af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Ferdinand=20Rivera=20Morell?= Date: Sat, 24 Aug 2024 04:39:04 -0500 Subject: [PATCH] Add support for modular build structure. (#71) This is part of the effort to make the Boost libraries "modular" for build and consumption. See https://lists.boost.org/Archives/boost/2024/01/255704.php and https://github.com/grafikrobot/boost-b2-modular/blob/b2-modular/README.adoc for more information. This PR depends on the following other PRs being merged to both develop and master branches of the respective repos: - https://github.com/boostorg/boost/pull/854 --- build.jam | 36 ++++++++++++++++++++++++++++++++++++ test/Jamfile.v2 | 11 ++++++++--- 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 build.jam diff --git a/build.jam b/build.jam new file mode 100644 index 00000000..6c49a765 --- /dev/null +++ b/build.jam @@ -0,0 +1,36 @@ +# 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/filesystem//boost_filesystem + /boost/function//boost_function + /boost/move//boost_move + /boost/predef//boost_predef + /boost/smart_ptr//boost_smart_ptr + /boost/spirit//boost_spirit + /boost/system//boost_system + /boost/throw_exception//boost_throw_exception + /boost/type_index//boost_type_index + /boost/type_traits//boost_type_traits + /boost/winapi//boost_winapi ; + +project /boost/dll + : common-requirements + include + ; + +explicit + [ alias boost_dll : : : : $(boost_dependencies) ] + [ alias all : boost_dll test ] + ; + +call-if : boost-library dll + ; + diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 37897590..692422e4 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -7,11 +7,15 @@ # For more information, see http://www.boost.org +require-b2 5.0.1 ; + +import-search /boost/config/checks ; + # bring in rules for testing import testing ; import path ; -import ../../config/checks/config : requires ; +import config : requires ; local RDYNAMIC = freebsd:"-rdynamic" solaris:"-Bdynamic" aix:"-rdynamic" qnxnto,qcc:"-Bdynamic" qnxnto,gcc:"-rdynamic" @@ -20,13 +24,14 @@ local RDYNAMIC = freebsd:"-rdynamic" solaris:static BOOST_SYSTEM_NO_DEPRECATED $(RDYNAMIC) ; -lib static_refcounting_plugin : ../example/tutorial8/refcounting_plugin.cpp : static BOOST_SYSTEM_NO_DEPRECATED release $(RDYNAMIC) ; +lib static_plugin : ../example/tutorial4/static_plugin.cpp : static BOOST_SYSTEM_NO_DEPRECATED $(RDYNAMIC) /boost/dll//boost_dll ; +lib static_refcounting_plugin : ../example/tutorial8/refcounting_plugin.cpp : static BOOST_SYSTEM_NO_DEPRECATED release $(RDYNAMIC) /boost/dll//boost_dll ; project : source-location . : requirements + /boost/dll//boost_dll [ requires cxx11_rvalue_references ] [ requires cxx11_static_assert ] # linux