From 1e3465217eb7ef7391e95c002d67407d7415d2f4 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sun, 22 Oct 2006 14:16:48 +0000 Subject: [PATCH] Merge [SVN r35691] --- v2/build/generators.jam | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/v2/build/generators.jam b/v2/build/generators.jam index 3c7cfe365..d1013e7c3 100644 --- a/v2/build/generators.jam +++ b/v2/build/generators.jam @@ -639,7 +639,6 @@ rule register ( g ) # a generator and then call 'run' method on that generator, bypassing all # generator selection. rule register-standard ( id : source-types * : target-types + : requirements * ) - { local g = [ new generator $(id) : $(source-types) : $(target-types) : $(requirements) ] ; @@ -1168,3 +1167,22 @@ rule construct ( project name ? : target-type : property-set * : sources * ) return $(result) ; } +# Given 'result', obtained from some generator or +# generators.construct, adds 'raw-properties' as usage requirements +# to it. If result already contains usage requirements -- that is +# the first element of result of an instance of the property-set class, +# the existing usage requirements and 'raw-properties' are combined. +rule add-usage-requirements ( result * : raw-properties * ) +{ + if $(result) + { + if [ class.is-a $(result[1]) : property-set ] + { + return [ $(result[1]).add-raw $(raw-properties) ] $(result[2-]) ; + } + else + { + return [ property-set.create $(raw-properties) ] $(result) ; + } + } +}