diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-23 09:53:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-23 09:57:32 +0200 |
commit | c6265603e0e98c19f8d81c8edd5a34a550063c02 (patch) | |
tree | 7108ad8849d4ac74281a89e5034774f055435f59 /build2/config | |
parent | 0a4f6bd240a512dadc54afd3116d8b8d03879de4 (diff) |
Add support for config.cli=false (leave unconfigured)
Diffstat (limited to 'build2/config')
-rw-r--r-- | build2/config/utility | 4 | ||||
-rw-r--r-- | build2/config/utility.cxx | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/build2/config/utility b/build2/config/utility index de75de4..31270fb 100644 --- a/build2/config/utility +++ b/build2/config/utility @@ -120,9 +120,9 @@ namespace build2 // Set the config.*.configured value. Note that you only need to set it to // false. It will be automatically ignored if there are any other config.* - // values for this module. + // values for this module. Return true if this sets a new value. // - void + bool unconfigured (scope& root, const string& ns, bool); // Enter the variable so that it is saved during configuration. See diff --git a/build2/config/utility.cxx b/build2/config/utility.cxx index 9131620..4c0e933 100644 --- a/build2/config/utility.cxx +++ b/build2/config/utility.cxx @@ -105,7 +105,7 @@ namespace build2 return l && !cast<bool> (l); } - void + bool unconfigured (scope& root, const string& ns, bool v) { // Note: not overridable. @@ -115,7 +115,15 @@ namespace build2 if (current_mif->id == configure_id) save_variable (root, var); - root.assign (var) = !v; + value& x (root.assign (var)); + + if (x.null || cast<bool> (x) != !v) + { + x = !v; + return true; + } + else + return false; } void |