diff --git a/src/build/virtual-target.jam b/src/build/virtual-target.jam index d85f666560..ce7d06873f 100644 --- a/src/build/virtual-target.jam +++ b/src/build/virtual-target.jam @@ -282,10 +282,7 @@ class abstract-file-target : virtual-target { $(action).add-targets $(__name__) ; - if $(self.type) && ! $(exact) - { - _adjust-name $(name) ; - } + _adjust-name $(name) ; } } @@ -474,8 +471,16 @@ class abstract-file-target : virtual-target : $(tag) ; } - self.name = [ indirect.call $(rule-name) $(specified-name) + local name = [ indirect.call $(rule-name) $(specified-name) : $(self.type) : $(ps) ] ; + if $(name) + { + self.name = $(name) ; + } + else + { + tag = ; + } } else { @@ -484,8 +489,9 @@ class abstract-file-target : virtual-target } } - # If there is no tag or the tag rule returned nothing. - if ! $(tag) || ! $(self.name) + # If this is a typed target, the name is not requested to be exact, + # and there is no tag or the tag rule returned nothing. + if $(self.type) && ! $(exact) && ! $(tag) { self.name = [ virtual-target.add-prefix-and-suffix $(specified-name) : $(self.type) : $(ps) ] ; diff --git a/test/tag.py b/test/tag.py index 74a20d2389..0243286dab 100644 --- a/test/tag.py +++ b/test/tag.py @@ -71,6 +71,7 @@ def test_tag_property(t): case SHARED_LIB : tags += _dll ; case STATIC_LIB : tags += _lib ; case EXE : tags += _exe ; + case * : tags = ; } if $(tags) {