diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-07-21 10:04:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-07-21 10:04:18 +0200 |
commit | d8f26e8402bbe19820545db90394f657ae42e598 (patch) | |
tree | a1430c3077de2053ef32013c2eef5e50b840a43a /build2/config/utility | |
parent | de15b95d09d00821aa23e96a0c3e827689c27a58 (diff) |
Save default/hinted ar/ld/rc values as commented out
This way, when we, for example, change the C++ compiler (which hinted these
values), they will be automatically adjusted as well.
Diffstat (limited to 'build2/config/utility')
-rw-r--r-- | build2/config/utility | 20 |
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); } |