From 1dc4b29bb57b14bfd8f700be80224b6d865f0184 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 13 Nov 2019 09:46:04 +0200 Subject: Implement config.config.persist logic Note that the inherited value part is documented but is not yet fully implemented. --- libbuild2/config/module.hxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libbuild2/config/module.hxx') 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>* persist = nullptr; -- cgit v1.1