From c7f1064152e11003a51e6fa5ee7e456b2ed92f97 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 19 Feb 2003 09:31:43 +0000 Subject: [PATCH] Kill allow-composing checks [SVN r17523] --- src/build/generators.jam | 41 +++++++++++++--------------------------- src/build/targets.jam | 3 +-- src/tools/builtin.jam | 5 ++--- 3 files changed, 16 insertions(+), 33 deletions(-) diff --git a/src/build/generators.jam b/src/build/generators.jam index 137092455..51ae7c3a9 100644 --- a/src/build/generators.jam +++ b/src/build/generators.jam @@ -745,13 +745,12 @@ local rule ensure-type ( targets * ) # - iterates over requested target-type and all it's bases (in the order returned bt # type.all-bases. # - for each type find all generators that generate that type and which requirements -# are satisfied by properties. If 'sallow-composing' is not given, ignores all -# composing generators. +# are satisfied by properties. # - if the set of generators is not empty, returns that set. # # Note: this algorithm explicitly ignores generators for base classes if there's # at least one generator for requested target-type. -local rule find-viable-generators ( target-type : property-set : allow-composing ? ) +local rule find-viable-generators ( target-type : property-set ) { # Select generators that can create the required target type. local viable-generators = ; @@ -764,7 +763,6 @@ local rule find-viable-generators ( target-type : property-set : allow-composing generators.dout [ indent ] find-viable-generators target-type= $(target-type) property-set= [ $(property-set).as-path ] - $(allow-composing) ; while $(t[1]) @@ -774,20 +772,17 @@ local rule find-viable-generators ( target-type : property-set : allow-composing { generators.dout [ indent ] "trying generator" [ $(g).source-types ] -> [ $(g).target-types ] ; - allow-composing = 1 ; # Avoid trying the same generator twice on different levels. if ! $(g) in $(.active-generators) - && ( $(allow-composing) || ! ( [ is-a $(g) : composing-generator ] - ) ) - { - local m = [ $(g).match-rank $(property-set) ] ; - if $(m) - { - viable-generators += $(g) ; - generator-rank += $(m) ; - t = ; - } - } + { + local m = [ $(g).match-rank $(property-set) ] ; + if $(m) + { + viable-generators += $(g) ; + generator-rank += $(m) ; + t = ; + } + } } t = $(t[2-]) ; } @@ -891,8 +886,7 @@ local rule construct-with-caching ( local rule construct-without-caching ( project name ? : target-type multiple ? : property-set : sources * ) { - viable-generators = [ find-viable-generators $(target-type) : $(property-set) - : $(allow-composing) ] ; + viable-generators = [ find-viable-generators $(target-type) : $(property-set) ] ; local results = [ new vector ] ; @@ -928,16 +922,7 @@ local rule construct-without-caching ( # 'construct' in stack, returns only targets of requested 'target-type', # otherwise, returns also unused sources and additionally generated # targets. -rule construct ( project name ? : target-type multiple ? : property-set * : sources * - : allow-composing ? # Allows to use composing generators for constructing this - # target. This will be typically set when creating main targets, - # and unset when called recursively from 'run' method of - # standard generators. Therefore, composing generators will - # be tried for main targets, but not for any intermediate. - # It prevents things like infinite recursion (LIB <- LIB <- ..). - # Generator may pass non-empty value if finding composing - # generator is reuiqred, see builtin.lib-generator for example. - ) +rule construct ( project name ? : target-type multiple ? : property-set * : sources * ) { local usage-requirements ; if (.construct-stack) diff --git a/src/build/targets.jam b/src/build/targets.jam index 8d1ebfbd2..ddb315a28 100644 --- a/src/build/targets.jam +++ b/src/build/targets.jam @@ -587,8 +587,7 @@ rule typed-target ( name : project : type : [ property-set.create [ $(property-set).raw ] # [ feature.expand $(self.type) ] # ] - : $(source-targets) - : allow-composing ] ; + : $(source-targets) ] ; if ! $(r) { errors.error "unable to construct" [ full-name ] ; diff --git a/src/tools/builtin.jam b/src/tools/builtin.jam index 722ed2c16..2d9b7ae99 100644 --- a/src/tools/builtin.jam +++ b/src/tools/builtin.jam @@ -365,10 +365,9 @@ rule lib-generator ( ) { actual-type = STATIC_LIB ; } - # Construct the target. Pass 'allow-composing', since generators for - # library types are composing and we need to find them. + # Construct the target. return [ generators.construct $(project) $(name) : $(actual-type) - : $(property-set) : $(sources) : allow-composing ] ; + : $(property-set) : $(sources) ] ; } }