From 8276cb927bafd338be237adbecf437e70042da99 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 26 Apr 2017 15:52:15 +0200 Subject: Implement version module --- build2/dist/init.cxx | 54 ++++++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 25 deletions(-) (limited to 'build2/dist/init.cxx') diff --git a/build2/dist/init.cxx b/build2/dist/init.cxx index be7b381..41927cd 100644 --- a/build2/dist/init.cxx +++ b/build2/dist/init.cxx @@ -11,6 +11,7 @@ #include #include +#include #include using namespace std; @@ -23,7 +24,7 @@ namespace build2 static const rule rule_; void - boot (scope& rs, const location&, unique_ptr&) + boot (scope& rs, const location&, unique_ptr& mod) { tracer trace ("dist::boot"); @@ -36,30 +37,33 @@ namespace build2 // Enter module variables. Do it during boot in case they get assigned // in bootstrap.build (which is customary for, e.g., dist.package). // - { - auto& v (var_pool.rw (rs)); - - // Note: some overridable, some not. - // - // config.dist.archives is a list of archive extensions that can be - // optionally prefixed with a directory. If it is relative, then it is - // prefixed with config.dist.root. Otherwise, the archive is written - // to the absolute location. - // - v.insert ("config.dist.root", true); - v.insert ("config.dist.archives", true); - v.insert ("config.dist.cmd", true); - - v.insert ("dist.root"); - v.insert ("dist.cmd"); - v.insert ("dist.archives"); - - v.insert ("dist", variable_visibility::target); // Flag. - - // Project's package name. - // - v.insert ("dist.package", variable_visibility::project); - } + auto& vp (var_pool.rw (rs)); + + // Note: some overridable, some not. + // + // config.dist.archives is a list of archive extensions that can be + // optionally prefixed with a directory. If it is relative, then it is + // prefixed with config.dist.root. Otherwise, the archive is written + // to the absolute location. + // + vp.insert ("config.dist.root", true); + vp.insert ("config.dist.archives", true); + vp.insert ("config.dist.cmd", true); + + vp.insert ("dist.root"); + vp.insert ("dist.cmd"); + vp.insert ("dist.archives"); + + vp.insert ("dist", variable_visibility::target); // Flag. + + // Project's package name. + // + auto& v_d_p ( + vp.insert ("dist.package", variable_visibility::project)); + + // Create the module. + // + mod.reset (new module (v_d_p)); } bool -- cgit v1.1