From 71a184d20fab0577b8bca7b9e9ffd6830cb56018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Ferdinand=20Rivera=20Morell?= Date: Sun, 25 Aug 2024 01:57:23 -0500 Subject: [PATCH] Add support for modular build structure. (#78) 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 | 27 +++++++++++++++++++++++++++ test/Jamfile.v2 | 16 +++++++++++----- 2 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 build.jam diff --git a/build.jam b/build.jam new file mode 100644 index 0000000..ad7d7de --- /dev/null +++ b/build.jam @@ -0,0 +1,27 @@ +# 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//boost_container + /boost/core//boost_core + /boost/throw_exception//boost_throw_exception + /boost/type_traits//boost_type_traits ; + +project /boost/lexical_cast + : common-requirements + include + ; + +explicit + [ alias boost_lexical_cast : : : : $(boost_dependencies) ] + [ alias all : boost_lexical_cast test ] + ; + +call-if : boost-library lexical_cast + ; + diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index e68e037..494906f 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -5,13 +5,15 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # +require-b2 5.0.1 ; +import-search /boost/config/checks ; +import config : requires ; import testing ; import feature ; -import ../../config/checks/config : requires ; - project : requirements + /boost/lexical_cast//boost_lexical_cast [ requires cxx11_rvalue_references cxx11_static_assert cxx11_template_aliases ] static gcc-4.7:-ftrapv @@ -29,6 +31,10 @@ project # Not a lexical_cast related warning: boost/mpl/aux_/preprocessed/gcc/greater_equal.hpp:78:1: warning: empty macro arguments are a C99 feature [-Wc99-extensions] # boost/mpl/iter_fold.hpp:45:1: warning: empty macro arguments are a C99 feature [-Wc99-extensions] clang:-Wno-c99-extensions + + /boost/array//boost_array + /boost/range//boost_range + /boost/utility//boost_utility ; # Thanks to Steven Watanabe for helping with feature @@ -57,7 +63,7 @@ test-suite conversion [ run containers_test.cpp : : : gcc:-Wno-long-long clang:-Wno-long-long ] [ run empty_input_test.cpp ] [ run pointers_test.cpp ] - [ compile typedefed_wchar_test.cpp : msvc:on ] + [ compile typedefed_wchar_test.cpp : msvc:on /boost/date_time//boost_date_time ] [ run typedefed_wchar_test_runtime.cpp : : : msvc:on msvc,stlport:no ] [ run no_locale_test.cpp : : : BOOST_NO_STD_LOCALE BOOST_LEXICAL_CAST_ASSUME_C_LOCALE ] [ run no_exceptions_test.cpp : : : off @@ -74,14 +80,14 @@ test-suite conversion [ run stream_traits_test.cpp ] [ compile-fail to_pointer_test.cpp ] [ compile-fail from_volatile.cpp ] - [ run filesystem_test.cpp ../../filesystem/build//boost_filesystem/static ] + [ run filesystem_test.cpp /boost/filesystem//boost_filesystem/static ] [ run try_lexical_convert.cpp ] ; # Assuring that examples compile and run. Adding sources from `example` directory to the `conversion` test suite. for local p in [ glob ../example/*.cpp ] { - conversion += [ run $(p) ] ; + conversion += [ run $(p) : : : /boost/variant//boost_variant /boost/date_time//boost_date_time ] ; }