diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-11-13 09:46:04 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-11-13 09:46:04 +0200 |
commit | 1dc4b29bb57b14bfd8f700be80224b6d865f0184 (patch) | |
tree | c18e6c62de1f71510876285a259e5782eae2c3af /libbuild2/config/module.hxx | |
parent | 8ac1daf33da807635eddd881f2b178af8e22863a (diff) |
Implement config.config.persist logic
Note that the inherited value part is documented but is not yet fully
implemented.
Diffstat (limited to 'libbuild2/config/module.hxx')
-rw-r--r-- | libbuild2/config/module.hxx | 10 |
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; |