Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for modular build structure. #317

Merged
merged 16 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -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>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
;

64 changes: 36 additions & 28 deletions build/Jamfile.v2
Original file line number Diff line number Diff line change
@@ -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 <library>$(boost_dependencies)
: requirements
<conditional>@include-spirit
<library>$(boost_dependencies_private)
: usage-requirements
<define>BOOST_SERIALIZATION_NO_LIB=1
;

import ../../config/checks/config : requires ;

SPIRIT_ROOT = [ modules.peek : SPIRIT_ROOT ] ;
rule include-spirit ( properties * )
{
local old-compiler ;
if <toolset>borland in $(properties)
{
if ! <toolset-borland:version>6.1.0 in $(properties)
{
old-compiler = true ;
}
if ! <toolset-borland:version>6.1.0 in $(properties)
{
old-compiler = true ;
}

}
else if <toolset>msvc in $(properties)
{
if <toolset-msvc:version>6.5 in $(properties)
|| <toolset-msvc:version>7.0 in $(properties)
{
{
old-compiler = true ;
}
}
}

local result ;
if $(old-compiler)
{
{
if $(SPIRIT_ROOT)
{
# note - we can't use <include>$(SPIRIT_ROOT) because
# note - we can't use <include>$(SPIRIT_ROOT) because
# it puts -I$(SPIRIT_ROOT) AFTER the "../../.." in the command line.
# so use these instead
# so use these instead
result = <cxxflags>-I$(SPIRIT_ROOT) ;
}
else
else
{
echo **** spirit 1.6x required to build library with this compiler **** ;
result = <build>no ;
}
}
}
return $(result) ;
}

SOURCES =
SOURCES =
archive_exception
basic_archive
basic_iarchive
Expand Down Expand Up @@ -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
Expand All @@ -110,27 +120,25 @@ WSOURCES =
codecvt_null
;

lib boost_serialization
lib boost_serialization
: ## sources ##
$(SOURCES).cpp
: ## requirements ##
[ check-target-builds ../../config/checks//std_wstreambuf : <source>../src/$(SOURCES_HAS_STD_WSTREAMBUF).cpp ]
[ check-target-builds /boost/config/checks//std_wstreambuf : <source>../src/$(SOURCES_HAS_STD_WSTREAMBUF).cpp ]
<toolset>msvc:<cxxflags>/Gy
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
<link>shared:<define>BOOST_SERIALIZATION_DYN_LINK=1
;

lib boost_wserialization
: $(WSOURCES).cpp boost_serialization
:
lib boost_wserialization
: $(WSOURCES).cpp boost_serialization
:
[ requires std_wstreambuf ]
<toolset>msvc:<cxxflags>/Gy
<toolset>msvc:<cxxflags>/Gy
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
# note: both serialization and wserialization are conditioned on the this
# switch - don't change it to BOOST_WSERIALIZATION_DYN_LINK
<link>shared:<define>BOOST_SERIALIZATION_DYN_LINK=1
;

boost-install boost_serialization boost_wserialization ;
1 change: 0 additions & 1 deletion example/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -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" :
Expand Down
2 changes: 0 additions & 2 deletions performance/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -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 ] ;
Expand All @@ -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 ]
Expand Down
22 changes: 12 additions & 10 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
@@ -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 <library>/boost/filesystem
: requirements <library>/boost/filesystem//boost_filesystem
<library>/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 :
Expand All @@ -27,9 +29,9 @@ import ../util/test :
;

BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ;

lib dll_a
:
:
dll_a.cpp
../build//boost_serialization
:
Expand All @@ -38,7 +40,7 @@ lib dll_a

lib dll_polymorphic_base
:
dll_polymorphic_base.cpp
dll_polymorphic_base.cpp
../build//boost_serialization
:
<link>shared
Expand Down Expand Up @@ -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 ]

Expand Down Expand Up @@ -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 ]
Expand Down
Loading
Loading