From 29f8159583d2b02efa2afeaa58082f57222c943d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 3 Dec 2015 14:37:22 +0200 Subject: Add ability for module to remember that it is unconfigured A module can set and then check the config.*.configured special variable to false. --- build/config/operation.cxx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'build/config/operation.cxx') diff --git a/build/config/operation.cxx b/build/config/operation.cxx index 295a38a..abe4e22 100644 --- a/build/config/operation.cxx +++ b/build/config/operation.cxx @@ -101,13 +101,24 @@ namespace build { const variable& var (p.first->first); const value& val (p.first->second); + const string& n (var.name); // Skip special variables. // - if (var.name == "config.loaded" || - var.name == "config.configured") + if (n == "config.loaded" || + n == "config.configured") continue; + // We will only write config.*.configured if it is false + // (true is implied by its absence). + // + if (n.size () > 11 && + n.compare (n.size () - 11, 11, ".configured") == 0) + { + if (val == nullptr || as (val)) + continue; + } + // Warn the user if the value that we are saving differs // from the one they specified on the command line. // -- cgit v1.1