Skip to content

Commit

Permalink
Add support for modular build structure. (#102)
Browse files Browse the repository at this point in the history
* Make the library modular usable.

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Add missing lib reference.

* Add requires-b2 check to top-level build file.

* Bump B2 require to 5.2

* Change all <source> references to <library>.

* Update copyright dates.

* Move inter-lib dependencies to a project variable and into the build targets.

* Update build deps.
  • Loading branch information
grafikrobot authored Jan 1, 2025
1 parent 9c6964a commit f700da0
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 28 deletions.
21 changes: 0 additions & 21 deletions Jamfile

This file was deleted.

12 changes: 7 additions & 5 deletions benchmark/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@
# See www.boost.org/LICENSE_1_0.txt
#

project libs/format/benchmark
project
: requirements
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
;
<library>/boost/format//boost_format
<library>/boost/timer//boost_timer
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
;

exe bench_format_no_locale
: bench_format.cpp
/boost/timer//boost_timer
: <define>BOOST_NO_STD_LOCALE <location-prefix>no_locale
: <define>BOOST_NO_STD_LOCALE <location-prefix>no_locale
;

exe bench_format_normal
: bench_format.cpp
: bench_format.cpp
/boost/timer//boost_timer
: <location-prefix>normal
;
Expand Down
37 changes: 37 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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/config//boost_config
/boost/core//boost_core
/boost/optional//boost_optional
/boost/smart_ptr//boost_smart_ptr
/boost/throw_exception//boost_throw_exception
/boost/utility//boost_utility ;

project /boost/format
: common-requirements
<include>include
;

explicit
[ alias boost_format : : : : <library>$(boost_dependencies) ]
[ alias all
: boost_format
benchmark
example
test
tools
: <warnings>pedantic
<warnings-as-errors>on
]
;

call-if : boost-library format
;

4 changes: 3 additions & 1 deletion example/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

import testing ;

project : requirements <library>/boost/format//boost_format ;

test-suite "format-examples"
: [ run sample_advanced.cpp ]
[ run sample_formats.cpp ]
[ run sample_new_features.cpp ]
[ run sample_userType.cpp ]
[ run sample_userType.cpp : : : <library>/boost/numeric_conversion//boost_numeric_conversion ]
;

5 changes: 5 additions & 0 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

import testing ;

project : requirements
<library>/boost/format//boost_format
<library>/boost/algorithm//boost_algorithm
;

test-suite "format"
: [ run format_test1.cpp ]
[ run format_test1.cpp : : : <toolset>msvc:<cxxflags>"/FIWindows.h" : format_test1_windows_h ]
Expand Down
5 changes: 4 additions & 1 deletion tools/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@

project
: requirements
<library>/boost/format//boost_format
<define>_CRT_SECURE_NO_WARNINGS
<link>static
;

exe format_matrix
exe format_matrix
: format_matrix.cpp
/boost/array//boost_array
/boost/filesystem//boost_filesystem
/boost/program_options//boost_program_options
/boost/system//boost_system
;

0 comments on commit f700da0

Please sign in to comment.