aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-08 16:16:17 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-08 16:16:17 +0200
commit6e2e56e8f70faed666a83797cebb96e844650a79 (patch)
tree7d905da821e89e38e1026831468e475210c587b2
parent5af9070fda0dba591264ed675920efcfd62e81bc (diff)
Add note to generated config.build about inherited configuration
-rw-r--r--build/config/operation.cxx18
1 files changed, 15 insertions, 3 deletions
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<const path&> ());
+
+ 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)
{