From ede64adbceded55e5488defc46f47d62f5f26976 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 18 Dec 2003 14:54:04 +0000 Subject: [PATCH] Allow to select staged targets, even with off. Patch from Pedro Ferreira. [SVN r21322] --- v2/tools/stage.jam | 61 +++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/v2/tools/stage.jam b/v2/tools/stage.jam index 7c7c40c5c..ce834e93c 100644 --- a/v2/tools/stage.jam +++ b/v2/tools/stage.jam @@ -139,8 +139,10 @@ class stage-target-class : basic-target : [ $(property-set).get ] ] ; } - property-set = [ update-location $(property-set) ] ; + property-set = [ update-location $(property-set) ] ; + local include-types = [ $(property-set).get ] ; + local result ; for local i in $(source-targets) { @@ -166,17 +168,43 @@ class stage-target-class : basic-target errors.error "Unable to generate staged version of " [ $(source).str ] ; } - for t in $(staged-targets) - { - $(t).set-path [ $(property-set).get ] ; - result += [ virtual-target.register $(t) ] ; + for t in [ select-included $(staged-targets) : $(include-types) ] + { + $(t).set-path [ $(property-set).get ] ; + result += [ virtual-target.register $(t) ] ; } - } + } } - + return $(result) ; } + rule select-included ( source-targets * : types-to-include * ) + { + local result-targets ; + if $(types-to-include) + { + for local r in $(source-targets) + { + local ty = [ $(r).type ] ; + if $(ty) + { + if [ include-type $(ty) : $(types-to-include) ] + { + result-targets += $(r) ; + } + } + } + } + else + { + result-targets = $(source-targets) ; + } + + + return $(result-targets) ; + } + rule collect-targets ( targets * : types-to-include * ) { # Find subvariants @@ -192,24 +220,7 @@ class stage-target-class : basic-target { result += [ $(i).all-referenced-targets ] ; } - result = [ sequence.unique $(result) ] ; - - if $(types-to-include) - { - local result2 ; - for local r in $(result) - { - if [ include-type [ $(r).type ] : $(types-to-include) ] - { - result2 += $(r) ; - } - } - return $(result2) ; - } - else - { - return $(result) ; - } + result = [ sequence.unique $(result) ] ; } # Don't do nothing.