diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-12-01 09:43:29 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-12-01 09:43:29 +0200 |
commit | f355a4379f035df61a7702f5ff805eefb004fb20 (patch) | |
tree | c0c50209492b81f8a88a25c059c39e5fef816a88 /build/config/utility.txx | |
parent | cb625e2715b4a7e90120e72b323adcb1264e006a (diff) |
Override outer configuration install paths that contain package name
Diffstat (limited to 'build/config/utility.txx')
-rw-r--r-- | build/config/utility.txx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/build/config/utility.txx b/build/config/utility.txx index 943d308..06cb2eb 100644 --- a/build/config/utility.txx +++ b/build/config/utility.txx @@ -10,18 +10,20 @@ namespace build { template <typename T> std::pair<std::reference_wrapper<const value>, bool> - required (scope& root, const variable& var, const T& def_value) + required (scope& root, const variable& var, const T& def_value, bool ovr) { using result = std::pair<std::reference_wrapper<const value>, bool>; if (auto l = root[var]) { - return l.belongs (*global_scope) - ? result (root.assign (var) = *l, true) - : result (*l, false); + if (l.belongs (*global_scope)) + return result (root.assign (var) = *l, true); + + if (!ovr || l.belongs (root)) + return result (*l, false); } - else - return result (root.assign (var) = def_value, true); + + return result (root.assign (var) = def_value, true); } template <typename T> |