Skip to content

Commit

Permalink
Add support for modular build structure. (#218)
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 NO_LIB usage requirements.

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

* Update dependencies.

* Bump B2 require to 5.2

* Move inter-lib dependencies to a project variable and into the build targets.
  • Loading branch information
grafikrobot authored Aug 19, 2024
1 parent 24b61d2 commit 0c10bd5
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
26 changes: 26 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright René Ferdinand Rivera Morell 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 ;

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

explicit
[ alias boost_charconv : build//boost_charconv ]
[ alias all : boost_charconv test ]
;

call-if : boost-library charconv
: install boost_charconv
;

10 changes: 6 additions & 4 deletions build/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt

import ../../config/checks/config : requires ;
require-b2 5.0.1 ;
import-search /boost/config/checks ;

project boost/charconv ;
import config : requires ;

project : common-requirements <library>$(boost_dependencies) ;

local SOURCES = from_chars.cpp to_chars.cpp ;

Expand All @@ -28,6 +31,5 @@ lib boost_charconv

# usage-requirements
: <link>shared:<define>BOOST_CHARCONV_DYN_LINK=1
<define>BOOST_CHARCONV_NO_LIB=1
;

boost-install boost_charconv ;
7 changes: 5 additions & 2 deletions test/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt

require-b2 5.0.1 ;
import-search /boost/config/checks ;

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

project : requirements

Expand Down Expand Up @@ -58,7 +61,7 @@ run P2497.cpp ;
run github_issue_110.cpp ;
run github_issue_122.cpp ;
run from_chars_string_view.cpp ;
run github_issue_152.cpp ;
run github_issue_152.cpp /boost/random//boost_random ;
run github_issue_152_float128.cpp : : : [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : <library>"quadmath" ] ;
run github_issue_154.cpp ;
#run github_issue_156.cpp ;
Expand Down

0 comments on commit 0c10bd5

Please sign in to comment.