diff --git a/build.jam b/build.jam new file mode 100644 index 000000000..7a91e3874 --- /dev/null +++ b/build.jam @@ -0,0 +1,46 @@ +# 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/array//boost_array + /boost/assert//boost_assert + /boost/config//boost_config + /boost/core//boost_core + /boost/detail//boost_detail + /boost/integer//boost_integer + /boost/io//boost_io + /boost/iterator//boost_iterator + /boost/move//boost_move + /boost/mp11//boost_mp11 + /boost/mpl//boost_mpl + /boost/optional//boost_optional + /boost/predef//boost_predef + /boost/preprocessor//boost_preprocessor + /boost/smart_ptr//boost_smart_ptr + /boost/spirit//boost_spirit + /boost/static_assert//boost_static_assert + /boost/throw_exception//boost_throw_exception + /boost/type_traits//boost_type_traits + /boost/utility//boost_utility + /boost/variant//boost_variant + /boost/variant2//boost_variant2 ; + +project /boost/serialization + : common-requirements + include + ; + +explicit + [ alias boost_serialization : build//boost_serialization ] + [ alias boost_wserialization : build//boost_wserialization ] + [ alias all : boost_serialization boost_wserialization example test ] + ; + +call-if : boost-library serialization + : install boost_serialization boost_wserialization + ; + diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index d987b927f..50fcce7fb 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -1,60 +1,70 @@ # Boost serialization Library Build Jamfile # (C) Copyright Robert Ramey 2002-2004. -# Use, modification, and distribution are subject to the -# Boost Software License, Version 1.0. (See accompanying file +# Use, modification, and distribution are subject to 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/serialization for the library home page. -project boost/serialization +require-b2 5.0.1 ; +import-search /boost/config/checks ; +import config : requires ; + +constant boost_dependencies_private : + /boost/function//boost_function + ; + +project : source-location ../src + : common-requirements $(boost_dependencies) : requirements @include-spirit + $(boost_dependencies_private) + : usage-requirements + BOOST_SERIALIZATION_NO_LIB=1 ; -import ../../config/checks/config : requires ; - SPIRIT_ROOT = [ modules.peek : SPIRIT_ROOT ] ; rule include-spirit ( properties * ) { local old-compiler ; if borland in $(properties) { - if ! 6.1.0 in $(properties) - { - old-compiler = true ; - } + if ! 6.1.0 in $(properties) + { + old-compiler = true ; + } } else if msvc in $(properties) { if 6.5 in $(properties) || 7.0 in $(properties) - { + { old-compiler = true ; - } + } } - + local result ; if $(old-compiler) - { + { if $(SPIRIT_ROOT) { - # note - we can't use $(SPIRIT_ROOT) because + # note - we can't use $(SPIRIT_ROOT) because # it puts -I$(SPIRIT_ROOT) AFTER the "../../.." in the command line. - # so use these instead + # so use these instead result = -I$(SPIRIT_ROOT) ; } - else + else { echo **** spirit 1.6x required to build library with this compiler **** ; result = no ; } - } + } return $(result) ; } -SOURCES = +SOURCES = archive_exception basic_archive basic_iarchive @@ -90,12 +100,12 @@ SOURCES = codecvt_null ; -SOURCES_HAS_STD_WSTREAMBUF = +SOURCES_HAS_STD_WSTREAMBUF = xml_oarchive utf8_codecvt_facet ; -WSOURCES = +WSOURCES = basic_text_wiprimitive basic_text_woprimitive text_wiarchive @@ -110,27 +120,25 @@ WSOURCES = codecvt_null ; -lib boost_serialization +lib boost_serialization : ## sources ## $(SOURCES).cpp : ## requirements ## - [ check-target-builds ../../config/checks//std_wstreambuf : ../src/$(SOURCES_HAS_STD_WSTREAMBUF).cpp ] + [ check-target-builds /boost/config/checks//std_wstreambuf : ../src/$(SOURCES_HAS_STD_WSTREAMBUF).cpp ] msvc:/Gy msvc:_SCL_SECURE_NO_WARNINGS msvc:_CRT_SECURE_NO_WARNINGS shared:BOOST_SERIALIZATION_DYN_LINK=1 ; -lib boost_wserialization - : $(WSOURCES).cpp boost_serialization - : +lib boost_wserialization + : $(WSOURCES).cpp boost_serialization + : [ requires std_wstreambuf ] - msvc:/Gy + msvc:/Gy msvc:_SCL_SECURE_NO_WARNINGS msvc:_CRT_SECURE_NO_WARNINGS # note: both serialization and wserialization are conditioned on the this # switch - don't change it to BOOST_WSERIALIZATION_DYN_LINK shared:BOOST_SERIALIZATION_DYN_LINK=1 ; - -boost-install boost_serialization boost_wserialization ; diff --git a/example/Jamfile.v2 b/example/Jamfile.v2 index cce6ee65f..a467dc934 100644 --- a/example/Jamfile.v2 +++ b/example/Jamfile.v2 @@ -19,7 +19,6 @@ import ../util/test : test-bsl-run test-bsl-run_archive test-bsl-run_files - test-bsl-run_polymorphic_archive ; test-suite "demo-suite" : diff --git a/performance/Jamfile.v2 b/performance/Jamfile.v2 index 5ec2a2968..a5295b38e 100644 --- a/performance/Jamfile.v2 +++ b/performance/Jamfile.v2 @@ -21,7 +21,6 @@ import ../util/test : test-bsl-run test-bsl-run_archive test-bsl-run_files - test-bsl-run_polymorphic_archive ; BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ; @@ -33,7 +32,6 @@ test-suite "performance" : # [ test-bsl-run_files performance_vector ] # [ test-bsl-run_files performance_no_rtti ] # [ test-bsl-run_files performance_simple_class ] -# [ test-bsl-run_polymorphic_archive performance_polymorphic : ../test/test_polymorphic_A ] [ test-bsl-run-no-lib performance_iterators ] [ test-bsl-run-no-lib performance_iterators_base64 ] diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 3e69b981d..1add4d520 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1,18 +1,20 @@ # Boost serialization Library test Jamfile # (C) Copyright Robert Ramey 2002-2004. -# Use, modification, and distribution are subject to the -# Boost Software License, Version 1.0. (See accompanying file +# Use, modification, and distribution are subject to 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) # -project libs/serialization/test +project : id serialization_test - : requirements /boost/filesystem + : requirements /boost/filesystem//boost_filesystem + /boost/math//boost_math_tr1 ; # import rules for testing conditional on config file variables -import ../../config/checks/config : requires ; +import-search /boost/config/checks ; +import config : requires ; # import rules from the boost serialization test import ../util/test : @@ -27,9 +29,9 @@ import ../util/test : ; BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ; - + lib dll_a - : + : dll_a.cpp ../build//boost_serialization : @@ -38,7 +40,7 @@ lib dll_a lib dll_polymorphic_base : - dll_polymorphic_base.cpp + dll_polymorphic_base.cpp ../build//boost_serialization : shared @@ -130,7 +132,7 @@ test-suite "serialization" : ; if ! $(BOOST_ARCHIVE_LIST) { - test-suite "serialization2" : + test-suite "serialization2" : [ test-bsl-run test_inclusion ] [ test-bsl-run test_inclusion2 ] @@ -178,7 +180,7 @@ if ! $(BOOST_ARCHIVE_LIST) { #[ compile test_const_save_warn1_nvp.cpp ] #[ compile test_const_save_warn2_nvp.cpp ] #[ compile test_const_save_warn3_nvp.cpp ] - + # should compile [ compile test_traits_pass.cpp ] [ compile test_const_pass.cpp ] diff --git a/util/test.jam b/util/test.jam index c119ac665..2745c5f8d 100644 --- a/util/test.jam +++ b/util/test.jam @@ -1,8 +1,8 @@ # Boost serialization Library utility test Jamfile # (C) Copyright Robert Ramey 2002-2004. -# Use, modification, and distribution are subject to the -# Boost Software License, Version 1.0. (See accompanying file +# Use, modification, and distribution are subject to 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) # @@ -11,19 +11,19 @@ # tests. # import rules for testing conditional on config file variables -import ../../config/checks/config : requires ; +import config : requires ; BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ; # these are used to shorten testing while in development. It permits # testing to be applied to just a particular type of archive if ! $(BOOST_ARCHIVE_LIST) { - BOOST_ARCHIVE_LIST = - "text_archive.hpp" - "text_warchive.hpp" - "binary_archive.hpp" - "xml_archive.hpp" - "xml_warchive.hpp" + BOOST_ARCHIVE_LIST = + "text_archive.hpp" + "text_warchive.hpp" + "binary_archive.hpp" + "xml_archive.hpp" + "xml_warchive.hpp" ; # enable the tests which don't depend on a particular archive BOOST_SERIALIZATION_TEST = true ; @@ -54,8 +54,8 @@ rule run-template ( test-name : sources * : files * : requirements * ) { # toolset optimizations msvc:"-Gy" # linking - shared:BOOST_SERIALIZATION_DYN_LINK=1 - shared:BOOST_WSERIALIZATION_DYN_LINK=1 + shared:BOOST_SERIALIZATION_DYN_LINK=1 + shared:BOOST_WSERIALIZATION_DYN_LINK=1 $(requirements) : # test name $(test-name) @@ -70,7 +70,7 @@ rule dependency-save-test ( test ) if $(m) { return $(m[1])save$(m[2]) ; - } + } } # each of the following tests is run with each type of archive @@ -79,7 +79,7 @@ rule run-invoke ( test-name : sources * : files * : requirements * ) local save-test = [ dependency-save-test $(test-name) ] ; local tests ; - tests += [ + tests += [ run-template $(test-name) : # sources $(sources) @@ -99,7 +99,7 @@ rule run-winvoke ( test-name : sources * : files * : requirements * ) local save-test = [ dependency-save-test $(test-name) ] ; local tests ; - tests += [ + tests += [ run-template $(test-name) : # sources $(sources) @@ -121,7 +121,7 @@ rule run-winvoke ( test-name : sources * : files * : requirements * ) rule test-bsl-run-no-lib ( test-name : sources * : requirements * ) { local tests ; - tests += [ + tests += [ run-template $(test-name) : # sources $(test-name).cpp $(sources).cpp @@ -136,8 +136,8 @@ rule test-bsl-run-no-lib ( test-name : sources * : requirements * ) rule test-bsl-run ( test-name : sources * : libs * : requirements * ) { local tests ; - tests += [ - run-invoke $(test-name) + tests += [ + run-invoke $(test-name) : # sources $(test-name).cpp $(sources).cpp $(libs) : # input files @@ -188,27 +188,27 @@ rule test-bsl-run_archive ( test-name : archive-name : sources * : libs * : requ rule test-bsl-run_files ( test-name : sources * : libs * : requirements * ) { local tests ; for local defn in $(BOOST_ARCHIVE_LIST) { - tests += [ - test-bsl-run_archive $(test-name) - : $(defn:LB) - : $(test-name) $(sources) - : $(libs) - : $(requirements) + tests += [ + test-bsl-run_archive $(test-name) + : $(defn:LB) + : $(test-name) $(sources) + : $(libs) + : $(requirements) ] ; } return $(tests) ; } - + rule test-bsl-run_polymorphic_files ( test-name : sources * : libs * : requirements * ) { local tests ; for local defn in $(BOOST_ARCHIVE_LIST) { #ECHO polymorphic_$(defn:LB) ; - tests += [ - test-bsl-run_archive $(test-name) + tests += [ + test-bsl-run_archive $(test-name) : polymorphic_$(defn:LB) - : $(test-name) $(sources) - : $(libs) - : $(requirements) + : $(test-name) $(sources) + : $(libs) + : $(requirements) ] ; } return $(tests) ;