aboutsummaryrefslogtreecommitdiff
path: root/build/config/utility
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-01 09:43:29 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-01 09:43:29 +0200
commitf355a4379f035df61a7702f5ff805eefb004fb20 (patch)
treec0c50209492b81f8a88a25c059c39e5fef816a88 /build/config/utility
parentcb625e2715b4a7e90120e72b323adcb1264e006a (diff)
Override outer configuration install paths that contain package name
Diffstat (limited to 'build/config/utility')
-rw-r--r--build/config/utility24
1 files changed, 19 insertions, 5 deletions
diff --git a/build/config/utility b/build/config/utility
index 406c271..9a5dc5e 100644
--- a/build/config/utility
+++ b/build/config/utility
@@ -21,24 +21,38 @@ namespace build
{
// Set, if necessary, a required config.* variable.
//
+ // If override is true and the variable doesn't come from this root
+ // scope or from the command line, then its value is "overridden"
+ // for this root scope.
+ //
// Return the reference to the value as well as the indication of
// whether the variable has actually been set.
//
template <typename T>
std::pair<std::reference_wrapper<const value>, bool>
- required (scope& root, const variable&, const T& default_value);
+ required (scope& root,
+ const variable&,
+ const T& default_value,
+ bool override = false);
template <typename T>
inline std::pair<std::reference_wrapper<const value>, bool>
- required (scope& root, const std::string& name, const T& default_value)
+ required (scope& root,
+ const std::string& name,
+ const T& default_value,
+ bool override = false)
{
- return required (root, variable_pool.find (name), default_value);
+ return required (
+ root, variable_pool.find (name), default_value, override);
}
inline std::pair<std::reference_wrapper<const value>, bool>
- required (scope& root, const std::string& name, const char* default_value)
+ required (scope& root,
+ const std::string& name,
+ const char* default_value,
+ bool override = false)
{
- return required (root, name, std::string (default_value));
+ return required (root, name, std::string (default_value), override);
}
// Set, if necessary, an optional config.* variable. In particular,