From f679fc1efd47e077c72f97993f3dde5267294a47 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 11 Dec 2007 19:41:47 +0000 Subject: [PATCH] Put add-usage-requirements back [SVN r41979] --- src/build/generators.jam | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/build/generators.jam b/src/build/generators.jam index d181ebf05..8c14df997 100644 --- a/src/build/generators.jam +++ b/src/build/generators.jam @@ -1186,6 +1186,26 @@ rule construct ( project name ? : target-type : property-set * : sources * ) decrease-indent ; .construct-stack = $(.construct-stack[2-]) ; - + 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) ; + } + } +}