aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/config/operation.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-08-18 08:04:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-08-18 08:04:07 +0200
commitb2df0b0663d0537dd3b4f2d28d145ccd90417cab (patch)
treeb58ff44bfa5a8423721d6b865541a2e3a3d27d60 /libbuild2/config/operation.cxx
parent5521a0edd9a2ba8429f7d2e48f754c9d6f66cc3b (diff)
Add ability to mark config.* variables as "unsaved" (always transient)
Diffstat (limited to 'libbuild2/config/operation.cxx')
-rw-r--r--libbuild2/config/operation.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/libbuild2/config/operation.cxx b/libbuild2/config/operation.cxx
index b07df42..963a3e1 100644
--- a/libbuild2/config/operation.cxx
+++ b/libbuild2/config/operation.cxx
@@ -236,7 +236,7 @@ namespace build2
var->name.compare (0, 14, "config.config.") == 0)
continue;
- if (mod->saved (*var))
+ if (mod->find_variable (*var)) // Saved or unsaved.
continue;
const value& v (p.first->second);
@@ -247,7 +247,7 @@ namespace build2
true /* unused */));
if (r.first) // save
{
- mod->save_variable (*var);
+ mod->save_variable (*var, 0);
if (r.second) // warn
{
@@ -291,7 +291,11 @@ namespace build2
bool first (true); // Separate modules with a blank line.
for (const saved_variable& sv: svars)
{
+ if (!sv.flags) // unsaved
+ continue;
+
const variable& var (sv.var);
+ uint64_t flags (*sv.flags);
pair<lookup, size_t> org (rs.lookup_original (var));
pair<lookup, size_t> ovr (var.overrides == nullptr
@@ -304,7 +308,7 @@ namespace build2
// inherited. We might also not have any value at all (see
// unconfigured()).
//
- if (!l.defined () || (l->null && sv.flags & save_null_omitted))
+ if (!l.defined () || (l->null && flags & save_null_omitted))
continue;
// Handle inherited from outer scope values.
@@ -451,7 +455,7 @@ namespace build2
//
if ((org.first.defined () && org.first->extra) && // Default value.
org.first == ovr.first && // Not overriden.
- (sv.flags & save_default_commented) != 0)
+ (flags & save_default_commented) != 0)
{
os << '#' << n << " =" << endl;
continue;