Skip to content

Commit

Permalink
allow tag feature for virtual-targets with EXACT name
Browse files Browse the repository at this point in the history
  • Loading branch information
grisumbras authored and grafikrobot committed Jun 11, 2024
1 parent dfd11bb commit 36cd684
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/build/virtual-target.jam
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,7 @@ class abstract-file-target : virtual-target
{
$(action).add-targets $(__name__) ;

if $(self.type) && ! $(exact)
{
_adjust-name $(name) ;
}
_adjust-name $(name) ;
}
}

Expand Down Expand Up @@ -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
{
Expand All @@ -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) ] ;
Expand Down
1 change: 1 addition & 0 deletions test/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 36cd684

Please sign in to comment.