Skip to content

Commit

Permalink
Add support for root-less modular build/install.
Browse files Browse the repository at this point in the history
  • Loading branch information
grafikrobot committed Apr 28, 2024
1 parent 76e07e0 commit b15abed
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
32 changes: 30 additions & 2 deletions boost-install-dirs.jam
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)

import modules ;
import boostcpp ;
import package ;
import path ;

Expand Down Expand Up @@ -82,7 +81,14 @@ rule header-subdir

rule stagedir
{
return [ path.make [ modules.peek boostcpp : BOOST_STAGE_LOCATE ] ] ;
if [ modules.peek boostcpp : BOOST_STAGE_LOCATE ]
{
return [ path.make [ modules.peek boostcpp : BOOST_STAGE_LOCATE ] ] ;
}
else
{
return [ path.make [ path.join [ path.pwd ] stage ] ] ;
}
}

# stage-libdir
Expand All @@ -102,3 +108,25 @@ rule stage-libdir
return $(stagedir)/lib ;
}
}

# stage-includedir

rule stage-includedir
{
local ld = [ MATCH --stage-includedir=(.*) : [ modules.peek : ARGV ] ] ;

if $(ld)
{
ld = [ path.root [ path.make $(ld) ] [ path.pwd ] ] ;
return $(ld) ;
}
else if [ modules.peek boostcpp : BOOST_ROOT ]
{
return [ path.make [ modules.peek boostcpp : BOOST_ROOT ] ] ;
}
else
{
local stagedir = [ stagedir ] ;
return $(stagedir)/include ;
}
}
7 changes: 5 additions & 2 deletions boost-install.jam
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)

import modules ;
import boostcpp ;
import property-set ;
import "class" : new ;
import project ;
Expand Down Expand Up @@ -555,6 +554,8 @@ actions generate-cmake-variant-

local rule tag ( name : type ? : property-set )
{
import boostcpp ;

.debug tag $(name) ;

local link = [ $(property-set).get <link> ] ;
Expand Down Expand Up @@ -1161,7 +1162,7 @@ rule install-cmake-config ( name * )

rule stage-cmake-config ( name * )
{
local includedir = [ path.make [ modules.peek boostcpp : BOOST_ROOT ] ] ;
local includedir = [ boost-install-dirs.stage-includedir ] ;
local libdir = [ boost-install-dirs.stage-libdir ] ;
local cmakedir = $(libdir)/cmake ;

Expand Down Expand Up @@ -1257,6 +1258,8 @@ rule generate-dependencies ( project name ? : property-set : sources * )

local rule install-stage-subdir ( properties * )
{
import boostcpp ;

local ps = [ property-set.create $(properties) ] ;

local r = [ boostcpp.tag boost : STATIC_LIB : $(ps) ] ;
Expand Down

0 comments on commit b15abed

Please sign in to comment.