Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow tag feature for virtual-targets with exact name or without type #393

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading