From 3a58de12d587717e704c68638e1d6fad62f19e8c Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 29 Apr 2023 13:38:11 +0100 Subject: [PATCH] Simplify no wstreambuf support. See https://github.com/boostorg/serialization/pull/224. --- build/Jamfile.v2 | 47 ++++++----------------------------------------- test/Jamfile.v2 | 8 ++++---- util/test.jam | 11 +++++++++++ 3 files changed, 21 insertions(+), 45 deletions(-) diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 0f214e8789..b8d96d7f74 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -12,6 +12,8 @@ project boost/serialization @include-spirit ; +import ../../config/checks/config : requires ; + SPIRIT_ROOT = [ modules.peek : SPIRIT_ROOT ] ; rule include-spirit ( properties * ) { @@ -88,7 +90,7 @@ SOURCES = codecvt_null ; -SOURCES_HAS_STD_LOCALE = +SOURCES_HAS_STD_WSTREAMBUF = xml_oarchive utf8_codecvt_facet ; @@ -105,51 +107,14 @@ WSOURCES = xml_woarchive polymorphic_xml_wiarchive polymorphic_xml_woarchive + $(SOURCES_HAS_STD_WSTREAMBUF) ; -rule has-config-flag ( flag : properties * ) -{ - if ( "$(flag)" in $(properties) || "$(flag)=1" in $(properties) ) - { - return 1 ; - } - else - { - return ; - } -} - -rule select-define-specific-sources ( properties * ) -{ - local result ; - if ! [ has-config-flag BOOST_NO_STD_LOCALE : $(properties) ] - { - result += $(SOURCES_HAS_STD_LOCALE).cpp ; - } - - #ECHO additional sources $(result) ; - - return $(result) ; -} - -rule should-build-wserialization ( properties * ) -{ - local result ; - if [ has-config-flag BOOST_NO_STD_LOCALE : $(properties) ] - { - result += no ; - } - - #ECHO should build wserialization $(result) ; - - return $(result) ; -} - lib boost_serialization : ## sources ## $(SOURCES).cpp : ## requirements ## - @select-define-specific-sources + [ check-target-builds ../../config/checks//std_wstreambuf : ../src/$(SOURCES_HAS_STD_WSTREAMBUF).cpp ] msvc:/Gy msvc:_SCL_SECURE_NO_WARNINGS msvc:_CRT_SECURE_NO_WARNINGS @@ -165,7 +130,7 @@ lib boost_serialization lib boost_wserialization : $(WSOURCES).cpp boost_serialization : - @should-build-wserialization + [ requires std_wstreambuf ] msvc:/Gy msvc:_SCL_SECURE_NO_WARNINGS msvc:_CRT_SECURE_NO_WARNINGS diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index fafe1189ae..35fa872e5a 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -73,7 +73,7 @@ test-suite "serialization" : [ test-bsl-run_files test_diamond_complex ] [ test-bsl-run_files test_forward_list : A : : [ requires cxx11_hdr_forward_list ] ] # BOOST_NO_CXX11_HDR_FORWARD_LIST [ test-bsl-run_files test_forward_list_ptrs : A : : [ requires cxx11_hdr_forward_list ] ] # BOOST_NO_CXX11_HDR_FORWARD_LIST - [ test-bsl-run_files test_helper_support ] + [ test-bsl-run_files test_helper_support : : : [ requires std_wstreambuf ] ] [ test-bsl-run_files test_interrupts ] [ test-bsl-run_files test_list : A ] [ test-bsl-run_files test_list_ptrs : A ] @@ -119,7 +119,7 @@ test-suite "serialization" : [ test-bsl-run_polymorphic_files test_polymorphic : test_polymorphic_A A ] [ test-bsl-run_polymorphic_files test_polymorphic2 : test_polymorphic2imp ] - [ test-bsl-run_polymorphic_files test_p_helper ] + [ test-bsl-run_polymorphic_files test_p_helper : : : [ requires std_wstreambuf ] ] # this test should pass with both shared and static linking. But B2 get's mixed up with static linking # so we'll just run the shared version of the test, which is the one that we're most interested @@ -150,8 +150,8 @@ if ! $(BOOST_ARCHIVE_LIST) { [ test-bsl-run test_private_ctor ] [ test-bsl-run test_reset_object_address : A ] [ test-bsl-run test_void_cast ] - [ test-bsl-run test_mult_archive_types ] - [ test-bsl-run test_iterators ] + [ test-bsl-run test_mult_archive_types : : : [ requires std_wstreambuf ] ] + [ test-bsl-run test_iterators : : : [ requires std_wstreambuf ] ] [ test-bsl-run test_iterators_base64 ] [ test-bsl-run test_smart_cast ] [ test-bsl-run test_codecvt_null ] diff --git a/util/test.jam b/util/test.jam index 4a04c33376..1d5ca3364b 100644 --- a/util/test.jam +++ b/util/test.jam @@ -163,6 +163,17 @@ rule test-bsl-run_archive ( test-name : archive-name : sources * : libs * : requ BOOST_ARCHIVE_TEST=$(archive-name).hpp $(requirements) ] ; + case "*xml_archive" : + tests += [ + run-invoke $(test-name)_$(archive-name) + : # sources + $(sources).cpp $(libs) + : # input files + : # requirements + BOOST_ARCHIVE_TEST=$(archive-name).hpp + $(requirements) + [ requires std_wstreambuf ] + ] ; case "*" : tests += [ run-invoke $(test-name)_$(archive-name)