diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-26 15:52:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-26 15:53:23 +0200 |
commit | 8276cb927bafd338be237adbecf437e70042da99 (patch) | |
tree | 49218b58e1f50a65b58674177e6047f1ac9f6831 /build2/dist/init.cxx | |
parent | 2fd9d3f177429b20797897360931badedbb0f0ef (diff) |
Implement version module
Diffstat (limited to 'build2/dist/init.cxx')
-rw-r--r-- | build2/dist/init.cxx | 54 |
1 files changed, 29 insertions, 25 deletions
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 <build2/config/utility> #include <build2/dist/rule> +#include <build2/dist/module> #include <build2/dist/operation> using namespace std; @@ -23,7 +24,7 @@ namespace build2 static const rule rule_; void - boot (scope& rs, const location&, unique_ptr<module_base>&) + boot (scope& rs, const location&, unique_ptr<module_base>& 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<abs_dir_path> ("config.dist.root", true); - v.insert<paths> ("config.dist.archives", true); - v.insert<path> ("config.dist.cmd", true); - - v.insert<dir_path> ("dist.root"); - v.insert<process_path> ("dist.cmd"); - v.insert<paths> ("dist.archives"); - - v.insert<bool> ("dist", variable_visibility::target); // Flag. - - // Project's package name. - // - v.insert<string> ("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<abs_dir_path> ("config.dist.root", true); + vp.insert<paths> ("config.dist.archives", true); + vp.insert<path> ("config.dist.cmd", true); + + vp.insert<dir_path> ("dist.root"); + vp.insert<process_path> ("dist.cmd"); + vp.insert<paths> ("dist.archives"); + + vp.insert<bool> ("dist", variable_visibility::target); // Flag. + + // Project's package name. + // + auto& v_d_p ( + vp.insert<string> ("dist.package", variable_visibility::project)); + + // Create the module. + // + mod.reset (new module (v_d_p)); } bool |