aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/target.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-08-11 11:07:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-08-11 11:07:09 +0200
commit037e5e9224648fdc9f3956d612fb476966847f5c (patch)
tree7c829f581fbd0caafd4a121c7f3a1ab60e3c5557 /libbuild2/target.cxx
parent67db22fcae32c8a8014866ef2ee55b6c7733c3f9 (diff)
Optimize process_libraries() some more
Diffstat (limited to 'libbuild2/target.cxx')
-rw-r--r--libbuild2/target.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/libbuild2/target.cxx b/libbuild2/target.cxx
index a686fc2..24ad01e 100644
--- a/libbuild2/target.cxx
+++ b/libbuild2/target.cxx
@@ -146,7 +146,9 @@ namespace build2
}
pair<lookup, size_t> target::
- lookup_original (const variable& var, bool target_only) const
+ lookup_original (const variable& var,
+ bool target_only,
+ const scope* bs) const
{
pair<lookup_type, size_t> r (lookup_type (), 0);
@@ -185,10 +187,12 @@ namespace build2
target_key tk (key ());
target_key gk (g != nullptr ? g->key () : target_key {});
- auto p (base_scope ().lookup_original (
- var,
- &tk,
- g != nullptr ? &gk : nullptr));
+ if (bs == nullptr)
+ bs = &base_scope ();
+
+ auto p (bs->lookup_original (var,
+ &tk,
+ g != nullptr ? &gk : nullptr));
r.first = move (p.first);
r.second = r.first ? r.second + p.second : p.second;