Skip to content

Commit

Permalink
Add support for modular build structure. (#69)
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

* Update copyright dates.

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

* Split b2 dependencies into public and private.

* Be explicit about the kind of public dependencies and make the winapi be conditional on windows target-os.
  • Loading branch information
grafikrobot authored Oct 10, 2024
1 parent 54bbc34 commit 0ed0a5d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 16 deletions.
24 changes: 24 additions & 0 deletions build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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 :
<library>/boost/assert//boost_assert
<library>/boost/config//boost_config
<library>/boost/predef//boost_predef
<library>/boost/type_traits//boost_type_traits
<target-os>windows:<library>/boost/winapi//boost_winapi ;

project /boost/atomic ;

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

call-if : boost-library atomic
: install boost_atomic
;
18 changes: 9 additions & 9 deletions build/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

import-search /boost/config/checks ;

import common ;
import config : requires ;
import path ;
Expand All @@ -15,12 +17,6 @@ import feature ;
import configure ;
import atomic-arch-config ;

local here = [ modules.binding $(__name__) ] ;

project.push-current [ project.current ] ;
project.load [ path.join [ path.make $(here:D) ] ../../config/checks/architecture ] ;
project.pop-current ;

lib synchronization ;
explicit synchronization ;

Expand All @@ -47,8 +43,13 @@ local cxx_requirements = [ requires
cxx11_static_assert
] ;

project boost/atomic
project
: common-requirements
<include>../include
$(boost_dependencies)
: requirements
<library>/boost/align//boost_align
<library>/boost/preprocessor//boost_preprocessor
<include>../src
<threading>multi
<link>shared:<define>BOOST_ATOMIC_DYN_LINK=1
Expand All @@ -59,6 +60,7 @@ project boost/atomic
: usage-requirements
<link>shared:<define>BOOST_ATOMIC_DYN_LINK=1
<link>static:<define>BOOST_ATOMIC_STATIC_LINK=1
<define>BOOST_ATOMIC_NO_LIB=1
: source-location ../src
;

Expand Down Expand Up @@ -150,5 +152,3 @@ lib boost_atomic
<conditional>@check-synchronization-lib
$(cxx_requirements)
;

boost-install boost_atomic ;
14 changes: 7 additions & 7 deletions build/atomic-arch-config.jam
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ rule deduce-architecture ( properties * )
}
else
{
if [ configure.builds /boost/architecture//x86 : $(properties) : "x86" ]
if [ configure.builds /boost/config/checks/architecture//x86 : $(properties) : "x86" ]
{
return x86 ;
}
else if [ configure.builds /boost/architecture//arm : $(properties) : "arm" ]
else if [ configure.builds /boost/config/checks/architecture//arm : $(properties) : "arm" ]
{
return arm ;
}
else if [ configure.builds /boost/architecture//mips1 : $(properties) : "mips1" ]
else if [ configure.builds /boost/config/checks/architecture//mips1 : $(properties) : "mips1" ]
{
return mips1 ;
}
else if [ configure.builds /boost/architecture//power : $(properties) : "power" ]
else if [ configure.builds /boost/config/checks/architecture//power : $(properties) : "power" ]
{
return power ;
}
else if [ configure.builds /boost/architecture//sparc : $(properties) : "sparc" ]
else if [ configure.builds /boost/config/checks/architecture//sparc : $(properties) : "sparc" ]
{
return sparc ;
}
Expand All @@ -51,11 +51,11 @@ rule deduce-address-model ( properties * )
}
else
{
if [ configure.builds /boost/architecture//32 : $(properties) : "32-bit" ]
if [ configure.builds /boost/config/checks/architecture//32 : $(properties) : "32-bit" ]
{
return 32 ;
}
else if [ configure.builds /boost/architecture//64 : $(properties) : "64-bit" ]
else if [ configure.builds /boost/config/checks/architecture//64 : $(properties) : "64-bit" ]
{
return 64 ;
}
Expand Down

0 comments on commit 0ed0a5d

Please sign in to comment.