Skip to content

Commit 8a8c628

Browse files
authored
Merge pull request #317 from grafikrobot/modular
Add support for modular build structure.
2 parents 0c53f8e + 03f542a commit 8a8c628

6 files changed

Lines changed: 123 additions & 70 deletions

File tree

build.jam

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright René Ferdinand Rivera Morell 2023-2024
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# (See accompanying file LICENSE_1_0.txt or copy at
4+
# http://www.boost.org/LICENSE_1_0.txt)
5+
6+
require-b2 5.2 ;
7+
8+
constant boost_dependencies :
9+
/boost/array//boost_array
10+
/boost/assert//boost_assert
11+
/boost/config//boost_config
12+
/boost/core//boost_core
13+
/boost/detail//boost_detail
14+
/boost/integer//boost_integer
15+
/boost/io//boost_io
16+
/boost/iterator//boost_iterator
17+
/boost/move//boost_move
18+
/boost/mp11//boost_mp11
19+
/boost/mpl//boost_mpl
20+
/boost/optional//boost_optional
21+
/boost/predef//boost_predef
22+
/boost/preprocessor//boost_preprocessor
23+
/boost/smart_ptr//boost_smart_ptr
24+
/boost/spirit//boost_spirit
25+
/boost/static_assert//boost_static_assert
26+
/boost/throw_exception//boost_throw_exception
27+
/boost/type_traits//boost_type_traits
28+
/boost/utility//boost_utility
29+
/boost/variant//boost_variant
30+
/boost/variant2//boost_variant2 ;
31+
32+
project /boost/serialization
33+
: common-requirements
34+
<include>include
35+
;
36+
37+
explicit
38+
[ alias boost_serialization : build//boost_serialization ]
39+
[ alias boost_wserialization : build//boost_wserialization ]
40+
[ alias all : boost_serialization boost_wserialization example test ]
41+
;
42+
43+
call-if : boost-library serialization
44+
: install boost_serialization boost_wserialization
45+
;
46+

build/Jamfile.v2

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,70 @@
11
# Boost serialization Library Build Jamfile
22
# (C) Copyright Robert Ramey 2002-2004.
3-
# Use, modification, and distribution are subject to the
4-
# Boost Software License, Version 1.0. (See accompanying file
3+
# Use, modification, and distribution are subject to the
4+
# Boost Software License, Version 1.0. (See accompanying file
55
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
66
#
77
# See http://www.boost.org/libs/serialization for the library home page.
88

9-
project boost/serialization
9+
require-b2 5.0.1 ;
10+
import-search /boost/config/checks ;
11+
import config : requires ;
12+
13+
constant boost_dependencies_private :
14+
/boost/function//boost_function
15+
;
16+
17+
project
1018
: source-location ../src
19+
: common-requirements <library>$(boost_dependencies)
1120
: requirements
1221
<conditional>@include-spirit
22+
<library>$(boost_dependencies_private)
23+
: usage-requirements
24+
<define>BOOST_SERIALIZATION_NO_LIB=1
1325
;
1426

15-
import ../../config/checks/config : requires ;
16-
1727
SPIRIT_ROOT = [ modules.peek : SPIRIT_ROOT ] ;
1828
rule include-spirit ( properties * )
1929
{
2030
local old-compiler ;
2131
if <toolset>borland in $(properties)
2232
{
23-
if ! <toolset-borland:version>6.1.0 in $(properties)
24-
{
25-
old-compiler = true ;
26-
}
33+
if ! <toolset-borland:version>6.1.0 in $(properties)
34+
{
35+
old-compiler = true ;
36+
}
2737

2838
}
2939
else if <toolset>msvc in $(properties)
3040
{
3141
if <toolset-msvc:version>6.5 in $(properties)
3242
|| <toolset-msvc:version>7.0 in $(properties)
33-
{
43+
{
3444
old-compiler = true ;
35-
}
45+
}
3646
}
37-
47+
3848
local result ;
3949
if $(old-compiler)
40-
{
50+
{
4151
if $(SPIRIT_ROOT)
4252
{
43-
# note - we can't use <include>$(SPIRIT_ROOT) because
53+
# note - we can't use <include>$(SPIRIT_ROOT) because
4454
# it puts -I$(SPIRIT_ROOT) AFTER the "../../.." in the command line.
45-
# so use these instead
55+
# so use these instead
4656
result = <cxxflags>-I$(SPIRIT_ROOT) ;
4757
}
48-
else
58+
else
4959
{
5060
echo **** spirit 1.6x required to build library with this compiler **** ;
5161
result = <build>no ;
5262
}
53-
}
63+
}
5464
return $(result) ;
5565
}
5666

57-
SOURCES =
67+
SOURCES =
5868
archive_exception
5969
basic_archive
6070
basic_iarchive
@@ -90,12 +100,12 @@ SOURCES =
90100
codecvt_null
91101
;
92102

93-
SOURCES_HAS_STD_WSTREAMBUF =
103+
SOURCES_HAS_STD_WSTREAMBUF =
94104
xml_oarchive
95105
utf8_codecvt_facet
96106
;
97107

98-
WSOURCES =
108+
WSOURCES =
99109
basic_text_wiprimitive
100110
basic_text_woprimitive
101111
text_wiarchive
@@ -110,27 +120,25 @@ WSOURCES =
110120
codecvt_null
111121
;
112122

113-
lib boost_serialization
123+
lib boost_serialization
114124
: ## sources ##
115125
$(SOURCES).cpp
116126
: ## requirements ##
117-
[ check-target-builds ../../config/checks//std_wstreambuf : <source>../src/$(SOURCES_HAS_STD_WSTREAMBUF).cpp ]
127+
[ check-target-builds /boost/config/checks//std_wstreambuf : <source>../src/$(SOURCES_HAS_STD_WSTREAMBUF).cpp ]
118128
<toolset>msvc:<cxxflags>/Gy
119129
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
120130
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
121131
<link>shared:<define>BOOST_SERIALIZATION_DYN_LINK=1
122132
;
123133

124-
lib boost_wserialization
125-
: $(WSOURCES).cpp boost_serialization
126-
:
134+
lib boost_wserialization
135+
: $(WSOURCES).cpp boost_serialization
136+
:
127137
[ requires std_wstreambuf ]
128-
<toolset>msvc:<cxxflags>/Gy
138+
<toolset>msvc:<cxxflags>/Gy
129139
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
130140
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
131141
# note: both serialization and wserialization are conditioned on the this
132142
# switch - don't change it to BOOST_WSERIALIZATION_DYN_LINK
133143
<link>shared:<define>BOOST_SERIALIZATION_DYN_LINK=1
134144
;
135-
136-
boost-install boost_serialization boost_wserialization ;

example/Jamfile.v2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import ../util/test :
1919
test-bsl-run
2020
test-bsl-run_archive
2121
test-bsl-run_files
22-
test-bsl-run_polymorphic_archive
2322
;
2423

2524
test-suite "demo-suite" :

performance/Jamfile.v2

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import ../util/test :
2121
test-bsl-run
2222
test-bsl-run_archive
2323
test-bsl-run_files
24-
test-bsl-run_polymorphic_archive
2524
;
2625

2726
BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ;
@@ -33,7 +32,6 @@ test-suite "performance" :
3332
# [ test-bsl-run_files performance_vector ]
3433
# [ test-bsl-run_files performance_no_rtti ]
3534
# [ test-bsl-run_files performance_simple_class ]
36-
# [ test-bsl-run_polymorphic_archive performance_polymorphic : ../test/test_polymorphic_A ]
3735

3836
[ test-bsl-run-no-lib performance_iterators ]
3937
[ test-bsl-run-no-lib performance_iterators_base64 ]

test/Jamfile.v2

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
# Boost serialization Library test Jamfile
22

33
# (C) Copyright Robert Ramey 2002-2004.
4-
# Use, modification, and distribution are subject to the
5-
# Boost Software License, Version 1.0. (See accompanying file
4+
# Use, modification, and distribution are subject to the
5+
# Boost Software License, Version 1.0. (See accompanying file
66
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
77
#
88

9-
project libs/serialization/test
9+
project
1010
: id serialization_test
11-
: requirements <library>/boost/filesystem
11+
: requirements <library>/boost/filesystem//boost_filesystem
12+
<library>/boost/math//boost_math_tr1
1213
;
1314

1415
# import rules for testing conditional on config file variables
15-
import ../../config/checks/config : requires ;
16+
import-search /boost/config/checks ;
17+
import config : requires ;
1618

1719
# import rules from the boost serialization test
1820
import ../util/test :
@@ -27,9 +29,9 @@ import ../util/test :
2729
;
2830

2931
BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ;
30-
32+
3133
lib dll_a
32-
:
34+
:
3335
dll_a.cpp
3436
../build//boost_serialization
3537
:
@@ -38,7 +40,7 @@ lib dll_a
3840

3941
lib dll_polymorphic_base
4042
:
41-
dll_polymorphic_base.cpp
43+
dll_polymorphic_base.cpp
4244
../build//boost_serialization
4345
:
4446
<link>shared
@@ -130,7 +132,7 @@ test-suite "serialization" :
130132
;
131133

132134
if ! $(BOOST_ARCHIVE_LIST) {
133-
test-suite "serialization2" :
135+
test-suite "serialization2" :
134136
[ test-bsl-run test_inclusion ]
135137
[ test-bsl-run test_inclusion2 ]
136138

@@ -178,7 +180,7 @@ if ! $(BOOST_ARCHIVE_LIST) {
178180
#[ compile test_const_save_warn1_nvp.cpp ]
179181
#[ compile test_const_save_warn2_nvp.cpp ]
180182
#[ compile test_const_save_warn3_nvp.cpp ]
181-
183+
182184
# should compile
183185
[ compile test_traits_pass.cpp ]
184186
[ compile test_const_pass.cpp ]

0 commit comments

Comments
 (0)