From 726aaab07a785b904dd1265bffa603bdd2a7665b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 24 May 2021 10:50:28 +0200 Subject: Tie loose ends in target type/pattern-specific matching --- libbuild2/cc/link-rule.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'libbuild2/cc') diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx index 05a4da8..0482fcb 100644 --- a/libbuild2/cc/link-rule.cxx +++ b/libbuild2/cc/link-rule.cxx @@ -1522,12 +1522,14 @@ namespace build2 if (!l.defined ()) { - bool g (pt->group != nullptr); + const target* g (pt->group); + + target_key tk (pt->key ()); + target_key gk (g != nullptr ? g->key () : target_key {}); + l = bs.lookup_original (var, - &pt->type (), - &pt->name, - (g ? &pt->group->type () : nullptr), - (g ? &pt->group->name : nullptr)).first; + &tk, + g != nullptr ? &gk : nullptr).first; } if (l ? cast (*l) : u) -- cgit v1.1