From 60ff77c181dd9955bcffed5df7df9925eae56337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Ferdinand=20Rivera=20Morell?= Date: Sat, 12 Oct 2024 02:18:24 -0500 Subject: [PATCH] Add support for modular build structure. (#73) * Make the library modular usable. * Put back removing qualified boostcpp tag. As we need it until the Jamroot removes the qualified tag. * Switch to library requirements instead of source. As source puts extra source in install targets. * Remove uses of BOOST_ROOT in Jamfiles. * Add requires-b2 check to top-level build file. * Bump B2 require to 5.2 * Update copyright dates. * Move inter-lib dependencies to a project variable and into the build targets. * Update build deps. --- build.jam | 38 ++++++++++++++++++++++++++++++++++++++ example/Jamfile.v2 | 23 ++++++++++------------- perf/Jamfile.v2 | 4 +++- test/Jamfile.v2 | 17 ++++++++++------- 4 files changed, 61 insertions(+), 21 deletions(-) create mode 100644 build.jam diff --git a/build.jam b/build.jam new file mode 100644 index 0000000..b80851e --- /dev/null +++ b/build.jam @@ -0,0 +1,38 @@ +# 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/assert//boost_assert + /boost/bind//boost_bind + /boost/config//boost_config + /boost/container_hash//boost_container_hash + /boost/core//boost_core + /boost/integer//boost_integer + /boost/iterator//boost_iterator + /boost/move//boost_move + /boost/mpl//boost_mpl + /boost/preprocessor//boost_preprocessor + /boost/smart_ptr//boost_smart_ptr + /boost/static_assert//boost_static_assert + /boost/throw_exception//boost_throw_exception + /boost/tuple//boost_tuple + /boost/type_traits//boost_type_traits + /boost/utility//boost_utility ; + +project /boost/multi_index + : common-requirements + include + ; + +explicit + [ alias boost_multi_index : : : : $(boost_dependencies) ] + [ alias all : boost_multi_index example perf test ] + ; + +call-if : boost-library multi_index + ; + diff --git a/example/Jamfile.v2 b/example/Jamfile.v2 index a4dc9c3..f5613e1 100644 --- a/example/Jamfile.v2 +++ b/example/Jamfile.v2 @@ -1,69 +1,66 @@ # Boost.MultiIndex examples Jamfile # -# Copyright 2003-2007 Joaquín M López Muñoz. +# Copyright 2003-2007 Joaqu�n M L�pez Mu�oz. # 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) # # See http://www.boost.org/libs/multi_index for library home page. +project : requirements /boost/multi_index//boost_multi_index ; + exe basic : basic.cpp - : $(BOOST_ROOT) ; exe bimap : bimap.cpp - : $(BOOST_ROOT) ; exe complex_structs : complex_structs.cpp - : $(BOOST_ROOT) ; exe composite_keys : composite_keys.cpp - : $(BOOST_ROOT) + /boost/tokenizer//boost_tokenizer ; exe fun_key : fun_key.cpp - : $(BOOST_ROOT) ; exe hashed : hashed.cpp - : $(BOOST_ROOT) + /boost/tokenizer//boost_tokenizer ; exe ip_allocator : ip_allocator.cpp - : $(BOOST_ROOT) multi + /boost/interprocess//boost_interprocess + : multi ; exe non_default_ctor : non_default_ctor.cpp - : $(BOOST_ROOT) ; exe random_access : random_access.cpp - : $(BOOST_ROOT) + /boost/tokenizer//boost_tokenizer ; exe rearrange : rearrange.cpp - : $(BOOST_ROOT) + /boost/random//boost_random ; exe sequenced : sequenced.cpp - : $(BOOST_ROOT) + /boost/tokenizer//boost_tokenizer ; exe serialization : serialization.cpp /boost/serialization//boost_serialization - : $(BOOST_ROOT) ; diff --git a/perf/Jamfile.v2 b/perf/Jamfile.v2 index c9aea9c..6fd2464 100644 --- a/perf/Jamfile.v2 +++ b/perf/Jamfile.v2 @@ -1,12 +1,14 @@ # Boost.MultiIndex performance tests Jamfile # -# Copyright 2003-2006 Joaquín M López Muñoz. +# Copyright 2003-2006 Joaqu�n M L�pez Mu�oz. # 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) # # See http://www.boost.org/libs/multi_index for library home page. +project : requirements /boost/multi_index//boost_multi_index ; + exe test_perf : test_perf.cpp : $(BOOST_ROOT) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index fea3033..81f561d 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1,6 +1,6 @@ # Boost.MultiIndex tests Jamfile # -# Copyright 2003-2020 Joaquín M López Muñoz. +# Copyright 2003-2020 Joaqu�n M L�pez Mu�oz. # 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) @@ -18,8 +18,8 @@ import type ; # Problem bypassed by changing the EXE names containing a taboo word. # Thanks to Rene Rivera for guidance on the use of the feature. -rule change-test_update-exe-name ( name : type ? : property-set ) -{ +rule change-test_update-exe-name ( name : type ? : property-set ) +{ if [ os.on-windows ] && [ type.is-subtype $(type) EXE ] { return test_updat.exe ; @@ -28,6 +28,7 @@ rule change-test_update-exe-name ( name : type ? : property-set ) project : requirements + /boost/multi_index//boost_multi_index msvc:_SCL_SECURE_NO_WARNINGS msvc:_CRT_SECURE_NO_WARNINGS msvc:_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS @@ -46,7 +47,8 @@ test-suite "multi_index" : [ run test_conv_iterators.cpp test_conv_iterators_main.cpp ] [ run test_copy_assignment.cpp test_copy_assignment_main.cpp ] [ run test_hash_ops.cpp test_hash_ops_main.cpp ] - [ run test_iterators.cpp test_iterators_main.cpp ] + [ run test_iterators.cpp test_iterators_main.cpp + /boost/foreach//boost_foreach ] [ run test_key.cpp test_key_main.cpp : : : [ check-target-builds boost_multi_index_key_supported @@ -57,7 +59,7 @@ test-suite "multi_index" : [ run test_modifiers.cpp test_modifiers_main.cpp ] [ run test_mpl_ops.cpp test_mpl_ops_main.cpp ] [ run test_node_handling.cpp test_node_handling_main.cpp ] - [ run test_observers.cpp test_observers_main.cpp ] + [ run test_observers.cpp test_observers_main.cpp ] [ run test_projection.cpp test_projection_main.cpp ] [ run test_range.cpp test_range_main.cpp ] [ run test_rank_ops.cpp test_rank_ops_main.cpp ] @@ -69,8 +71,9 @@ test-suite "multi_index" : /boost/serialization//boost_serialization ] [ run test_set_ops.cpp test_set_ops_main.cpp ] [ run test_special_set_ops.cpp test_special_set_ops_main.cpp ] - [ run test_update.cpp test_update_main.cpp - : : : + [ run test_update.cpp test_update_main.cpp + : : : + -@%boostcpp.tag -@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag @change-test_update-exe-name ] ;