From 6e2e56e8f70faed666a83797cebb96e844650a79 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 8 Apr 2015 16:16:17 +0200 Subject: Add note to generated config.build about inherited configuration --- build/config/operation.cxx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'build/config') diff --git a/build/config/operation.cxx b/build/config/operation.cxx index ef83e47..e62d313 100644 --- a/build/config/operation.cxx +++ b/build/config/operation.cxx @@ -66,9 +66,9 @@ namespace build } static void - save_config (scope& r) + save_config (scope& root) { - const path& out_root (r.path ()); + const path& out_root (root.path ()); path f (out_root / config_file); if (verb >= 1) @@ -84,10 +84,22 @@ namespace build ofs.exceptions (ofstream::failbit | ofstream::badbit); + ofs << "# Created automatically by the config module, but" << endl + << "# feel free to edit." << endl + << "#" << endl; + + if (auto v = root.ro_variables ()["amalgamation"]) + { + const path& d (v.as ()); + + ofs << "# Base configuration inherited from " << d << "/ ." << endl + << "#" << endl; + } + // Save all the variables in the config namespace that are set // on the project's root scope. // - for (auto p (r.variables.find_namespace ("config")); + for (auto p (root.variables.find_namespace ("config")); p.first != p.second; ++p.first) { -- cgit v1.1