diff options
Diffstat (limited to 'build/config/operation.cxx')
-rw-r--r-- | build/config/operation.cxx | 18 |
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) { |