From 49ad964458b99d138259945793fbc2c96adf498e Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Mar 2003 09:44:20 +0000 Subject: [PATCH] Refactorings. * new/targets.jam (main-target.apply-default-build): Call 'build-request.expand-no-defaults', not 'expand'. The motivation is to have defaults added in one place: 'property-set.add-defaults'. Also handle the case where default-build is empty. (main-target.generate): Apply defaults here. The motivation is that if we're using default build, default features should be applied here as well, or else we'll get ambiguous alternatives. (basic-target.generate): Do not add defaults. [SVN r17755] --- src/build/targets.jam | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/build/targets.jam b/src/build/targets.jam index 49ae777a4..8ffeb987d 100644 --- a/src/build/targets.jam +++ b/src/build/targets.jam @@ -297,16 +297,23 @@ rule main-target ( name : project ) rule apply-default-build ( property-set ) - { + { local result ; if ! [ $(property-set).raw ] { - properties = [ build-request.expand $(self.default-build) ] ; + properties = [ build-request.expand-no-defaults $(self.default-build) ] ; - for local p in $(properties) - { - result += [ property-set.create [ feature.split $(p) ] ] ; + if $(properties) + { + for local p in $(properties) + { + result += [ property-set.create [ feature.split $(p) ] ] ; + } } + else + { + result = [ property-set.empty ] ; + } } else { @@ -332,9 +339,9 @@ rule main-target ( name : project ) local result ; for local p in $(all-property-sets) { - result += [ generate-really $(p) ] ; + result += [ generate-really [ $(p).add-defaults ] ] ; } - return $(result) ; + return $(result) ; } local rule generate-really ( property-set ) @@ -527,10 +534,6 @@ rule basic-target ( name : project # come from dependencies, the value is not target id, but rather # virtual target names, so generators.construct can use them. - # defaults should be added as soon as possible. For example, conditionals - # might have "debug:..." and won't work if defaults are not - # applied. - rproperties = [ $(rproperties).add-defaults ] ; rproperties = [ $(rproperties).evaluate-conditionals ] ; rproperties =