diff --git a/v2/build/targets.jam b/v2/build/targets.jam index 9af9b7b86..3524030af 100644 --- a/v2/build/targets.jam +++ b/v2/build/targets.jam @@ -968,16 +968,16 @@ class basic-target : abstract-target # is created. local all-targets = [ sequence.transform virtual-target.traverse : $(targets) ] ; - local dg = [ new subvariant $(__name__) : $(build-request) : $(sources) + local s = [ new subvariant $(__name__) : $(build-request) : $(sources) : $(rproperties) : $(usage-requirements) : $(all-targets) ] ; for local v in $(all-targets) { - if ! [ $(v).dg ] + if ! [ $(v).creating-subvariant ] { - $(v).dg $(dg) ; + $(v).creating-subvariant $(s) ; } } - return $(dg) ; + return $(s) ; } @@ -1035,8 +1035,8 @@ class basic-target : abstract-target { if [ $(p).link-incompatible-with $(build-request) ] { - local dg = [ $(t).dg ] ; - local other-mt = [ $(dg).main-target ] ; + local s = [ $(t).creating-subvariant ] ; + local other-mt = [ $(s).main-target ] ; ECHO "warning: targets produced from" [ $(other-mt).name ] "are link incompatible" ; ECHO "warning: with main target" [ name ] ; diff --git a/v2/build/virtual-target.jam b/v2/build/virtual-target.jam index 37be70be4..1824b1b50 100644 --- a/v2/build/virtual-target.jam +++ b/v2/build/virtual-target.jam @@ -261,22 +261,27 @@ class abstract-file-target : virtual-target return $(self.root) ; } - # Sets the dependency graph this target is part of. - # 'dg' is an instance of 'subvariant-dg' class. - rule dg ( dg ? ) + # Gets or sets the subvariant which created this target. Subvariant + # is set when target is brought into existance, and is never changed + # after that. In particual, if target is shared by subvariant, only + # the first is stored. + rule creating-subvariant ( s ? # If specified, specified the value to set, + # which should be instance of 'subvariant' + # class. + ) { - if $(dg) && ( ! $(self.dg) && ! $(overwrite) ) + if $(s) && ( ! $(self.creating-subvariant) && ! $(overwrite) ) { - if $(self.dg) + if $(self.creating-subvariant) { errors.error "Attempt to change 'dg'" ; } else { - self.dg = $(dg) ; + self.creatin-subvariant = $(s) ; } } - return $(self.dg) ; + return $(self.creatin-subvariant) ; } rule actualize-action ( target ) @@ -830,7 +835,7 @@ rule clone-action ( action : new-project : new-action-name ? : new-properties ? $(cloned-target).depends $(d) ; } $(cloned-target).root [ $(target).root ] ; - $(cloned-target).dg [ $(target).dg ] ; + $(cloned-target).creating-subvariant [ $(target).creating-subvariant ] ; cloned-targets += $(cloned-target) ; } @@ -967,7 +972,7 @@ class subvariant local deps = [ $(build-properties).get implicit-dependency ] ; for local d in $(deps) { - self.other-dg += [ $(d:G=).dg ] ; + self.other-dg += [ $(d:G=).creating-subvariant ] ; } self.other-dg = [ sequence.unique $(self.other-dg) ] ; @@ -1022,7 +1027,7 @@ class subvariant local r ; for local t in $(all-targets) { - r += [ $(t).dg ] ; + r += [ $(t).creating-subvariant ] ; } r = [ sequence.unique $(r) ] ; for local s in $(r) diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index 5abce9072..2e245262a 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -421,7 +421,7 @@ class lib-target-class : basic-target # subvariant, we add usage requirements. for local t in [ $(subvariant).created-targets ] { - local s = [ $(t).dg ] ; + local s = [ $(t).creating-subvariant ] ; if $(s) != $(subvariant) { result = [ $(result).add [ $(s).usage-requirements ] ] ; @@ -561,8 +561,8 @@ class compile-action : action # to include path. rule adjust-properties ( properties * ) { - local dg = [ $(self.targets[1]).dg ] ; - return $(properties) [ $(dg).implicit-includes "include" ] ; + local s = [ $(self.targets[1]).creating-subvariant ] ; + return $(properties) [ $(s).implicit-includes "include" ] ; } } diff --git a/v2/tools/stage.jam b/v2/tools/stage.jam index 7ca26b3b5..c16a537cf 100644 --- a/v2/tools/stage.jam +++ b/v2/tools/stage.jam @@ -155,7 +155,7 @@ class stage-target-class : basic-target local s ; for local t in $(targets) { - s += [ $(t).dg ] ; + s += [ $(t).creating-subvariant ] ; } s = [ sequence.unique $(s) ] ;