From b15abed686f2be25dd5b3e77f3ce160871de9e18 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 28 Apr 2024 10:30:21 -0500 Subject: [PATCH] Add support for root-less modular build/install. --- boost-install-dirs.jam | 32 ++++++++++++++++++++++++++++++-- boost-install.jam | 7 +++++-- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/boost-install-dirs.jam b/boost-install-dirs.jam index 5c9f3d4..af17424 100644 --- a/boost-install-dirs.jam +++ b/boost-install-dirs.jam @@ -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 ; @@ -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 @@ -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 ; + } +} diff --git a/boost-install.jam b/boost-install.jam index 39e9d09..ca7b6c9 100644 --- a/boost-install.jam +++ b/boost-install.jam @@ -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 ; @@ -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 ] ; @@ -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 ; @@ -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) ] ;