aboutsummaryrefslogtreecommitdiff
path: root/build2/config/utility
diff options
context:
space:
mode:
Diffstat (limited to 'build2/config/utility')
-rw-r--r--build2/config/utility20
1 files changed, 14 insertions, 6 deletions
diff --git a/build2/config/utility b/build2/config/utility
index c47cecf..c1ccc0f 100644
--- a/build2/config/utility
+++ b/build2/config/utility
@@ -22,6 +22,7 @@ namespace build2
// If override is true and the variable doesn't come from this root scope
// or from the command line (i.e., it is inherited from the amalgamtion),
// then its value is "overridden" to the default value on this root scope.
+ // See save_variable() for more information on save_flags.
//
// Return the reference to the value as well as the indication of whether
// the value is "new", that is, it was set to the default value (inherited
@@ -34,25 +35,30 @@ namespace build2
required (scope& root,
const variable&,
const T& default_value,
- bool override = false);
+ bool override = false,
+ uint64_t save_flags = 0);
template <typename T>
inline pair<reference_wrapper<const value>, bool>
required (scope& root,
const string& name,
const T& default_value,
- bool override = false)
+ bool override = false,
+ uint64_t save_flags = 0)
{
- return required (root, var_pool.find (name), default_value, override);
+ return required (
+ root, var_pool.find (name), default_value, override, save_flags);
}
inline pair<reference_wrapper<const value>, bool>
required (scope& root,
const string& name,
const char* default_value,
- bool override = false)
+ bool override = false,
+ uint64_t save_flags = 0)
{
- return required (root, name, string (default_value), override);
+ return required (
+ root, name, string (default_value), override, save_flags);
}
// As above, but leave the unspecified value as undefined (and return
@@ -116,8 +122,10 @@ namespace build2
unconfigured (scope& root, const string& ns, bool);
// Enter the variable so that it is saved during configuration. See
- // config::module.
+ // config::module for details.
//
+ const uint64_t save_commented = 0x01; // Save default value as commented.
+
void
save_variable (scope& root, const variable&, uint64_t flags = 0);
}