diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2024-07-31 09:34:05 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2024-07-31 09:34:05 +0200 |
commit | b13b031b2b8a7390d1dd4b2658d0f0b62e43db47 (patch) | |
tree | f4d2d12c6717541ec7d2b56cfafa25ebd73070d9 /libbuild2/cc | |
parent | e122c6ff4a7f21026332ce9211ad095bd44e71ea (diff) |
Add lookup limit to {scope,target}::lookup_original()
Diffstat (limited to 'libbuild2/cc')
-rw-r--r-- | libbuild2/cc/common.cxx | 12 | ||||
-rw-r--r-- | libbuild2/cc/link-rule.cxx | 10 | ||||
-rw-r--r-- | libbuild2/cc/pkgconfig.cxx | 4 |
3 files changed, 13 insertions, 13 deletions
diff --git a/libbuild2/cc/common.cxx b/libbuild2/cc/common.cxx index 9a4a07c..fcc8961 100644 --- a/libbuild2/cc/common.cxx +++ b/libbuild2/cc/common.cxx @@ -185,7 +185,7 @@ namespace build2 // const string* pt ( cast_null<string> ( - l.state[a].lookup_original (c_type, true /* target_only */).first)); + l.state[a].lookup_original (c_type, lookup_limit::target).first)); // cc.type value format is <lang>[,...]. // @@ -242,7 +242,7 @@ namespace build2 // { const variable& v (impl ? c_export_impl_libs : c_export_libs); - c_e_libs = l.lookup_original (v, false, &bs).first; + c_e_libs = l.lookup_original (v, &bs).first; } if (!cc) @@ -251,7 +251,7 @@ namespace build2 same ? (impl ? x_export_impl_libs : x_export_libs) : vp[t + (impl ? ".export.impl_libs" : ".export.libs")]); - x_e_libs = l.lookup_original (v, false, &bs).first; + x_e_libs = l.lookup_original (v, &bs).first; } // Process options first. @@ -669,7 +669,7 @@ namespace build2 // See the link rule for the lookup semantics. // lookup l ( - t->lookup_original (var, true /* target_only */).first); + t->lookup_original (var, lookup_limit::target).first); if (l ? cast<bool> (*l) : u) lf |= lflag_whole; @@ -778,8 +778,8 @@ namespace build2 if (proc_lib) { const variable& v (same ? x_libs : vp[t + ".libs"]); - proc_impl (l.lookup_original (c_libs, false, &bs).first); - proc_impl (l.lookup_original (v, false, &bs).first); + proc_impl (l.lookup_original (c_libs, &bs).first); + proc_impl (l.lookup_original (v, &bs).first); } } } diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx index 417cba5..8c68b64 100644 --- a/libbuild2/cc/link-rule.cxx +++ b/libbuild2/cc/link-rule.cxx @@ -102,13 +102,13 @@ namespace build2 // const scope& bs (t->base_scope ()); - if (lookup l = t->lookup_original (c_export_libs, false, &bs).first) + if (lookup l = t->lookup_original (c_export_libs, &bs).first) { if (!deduplicate_export_libs (bs, cast<vector<name>> (l), r, seen)) return false; } - if (lookup l = t->lookup_original (x_export_libs, false, &bs).first) + if (lookup l = t->lookup_original (x_export_libs, &bs).first) { if (!deduplicate_export_libs (bs, cast<vector<name>> (l), r, seen)) return false; @@ -1310,7 +1310,7 @@ namespace build2 // if (const string* t = cast_null<string> ( ft->state[a].lookup_original ( - c_type, true /* target_only */).first)) + c_type, lookup_limit::target).first)) { if (recursively_binless (*t)) continue; @@ -1330,7 +1330,7 @@ namespace build2 { auto find = [&t, &bs] (const variable& v) -> lookup { - return t.lookup_original (v, false, &bs).first; + return t.lookup_original (v, &bs).first; }; auto has_simple = [] (lookup l) @@ -1975,7 +1975,7 @@ namespace build2 lookup l (p.prerequisite.vars[var]); if (!l.defined ()) - l = pt->lookup_original (var, true /* target_only */).first; + l = pt->lookup_original (var, lookup_limit::target).first; if (!l.defined ()) { diff --git a/libbuild2/cc/pkgconfig.cxx b/libbuild2/cc/pkgconfig.cxx index 046fbc8..7e47534 100644 --- a/libbuild2/cc/pkgconfig.cxx +++ b/libbuild2/cc/pkgconfig.cxx @@ -2256,7 +2256,7 @@ namespace build2 const string& t ( cast<string> ( l.state[a].lookup_original ( - c_type, true /* target_only */).first)); + c_type, lookup_limit::target).first)); // If common, then only save the language (the rest could be // static/shared-specific; strictly speaking even the language could @@ -2276,7 +2276,7 @@ namespace build2 // if (cast_false<bool> (l.lookup_original ( ctx.var_pool["bin.whole"], - true /* target_only */).first)) + lookup_limit::target).first)) { os << endl << "bin.whole = true" << endl; |