aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/config/module.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/config/module.hxx')
-rw-r--r--libbuild2/config/module.hxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/libbuild2/config/module.hxx b/libbuild2/config/module.hxx
index eccd61b..0a35369 100644
--- a/libbuild2/config/module.hxx
+++ b/libbuild2/config/module.hxx
@@ -86,6 +86,16 @@ namespace build2
bool
save_module (const char* name, int prio = 0);
+ // Return true if the variable is already saved.
+ //
+ bool
+ saved (const variable& var)
+ {
+ auto i (saved_modules.find_sup (var.name));
+ return i != saved_modules.end () &&
+ i->second.find (var) != i->second.end ();
+ }
+
// Cached (during init) config.config.persist value, if defined.
//
const vector<pair<string, string>>* persist = nullptr;