diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-03-19 09:27:22 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-03-19 09:27:22 +0200 |
commit | cbcb0b03501ce346ca3778624dcf908e851e6e2e (patch) | |
tree | ec7cf219ea6772ed5ea03de35eefd5e781d7906a /libbuild2/scope.hxx | |
parent | 14b34a239fa23e1a28519ab87f450c0a440d4f85 (diff) |
Tweak lookup_config() semantics some more
Diffstat (limited to 'libbuild2/scope.hxx')
-rw-r--r-- | libbuild2/scope.hxx | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/libbuild2/scope.hxx b/libbuild2/scope.hxx index 97ec448..c49778f 100644 --- a/libbuild2/scope.hxx +++ b/libbuild2/scope.hxx @@ -151,10 +151,30 @@ namespace build2 size_t start_depth = 1) const; pair<lookup_type, size_t> - lookup_override (const variable&, + lookup_override (const variable& var, pair<lookup_type, size_t> original, bool target = false, - bool rule = false) const; + bool rule = false) const + { + return lookup_override_info (var, original, target, rule).lookup; + } + + // As above but also return an indication of whether the resulting value + // is/is based (e.g., via append/prepend overrides) on the original or an + // "outright" override. Note that it will always be false if there is no + // original. + // + struct override_info + { + pair<lookup_type, size_t> lookup; + bool original; + }; + + override_info + lookup_override_info (const variable&, + pair<lookup_type, size_t> original, + bool target = false, + bool rule = false) const; // Return a value suitable for assignment (or append if you only want to // append to the value from this scope). If the value does not exist in |