diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-04-11 07:57:19 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-04-11 07:57:19 +0200 |
commit | 0342dc2fcdd78ef28a4e59d84193a3807068d726 (patch) | |
tree | e750c3062d6ff54f0d409fe1a25984b7e78592c8 /build2/dist/module.cxx | |
parent | 5f7c3f923de106f9d204a8f3500274731ae84fd9 (diff) |
New configuration logic, iteration 1
Diffstat (limited to 'build2/dist/module.cxx')
-rw-r--r-- | build2/dist/module.cxx | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/build2/dist/module.cxx b/build2/dist/module.cxx index 4b68bb8..2a7ba92 100644 --- a/build2/dist/module.cxx +++ b/build2/dist/module.cxx @@ -23,7 +23,7 @@ namespace build2 static rule rule_; extern "C" void - dist_boot (scope& r, const location&, unique_ptr<module>&) + dist_boot (scope& r, const location&, unique_ptr<module_base>&) { tracer trace ("dist::boot"); @@ -39,20 +39,18 @@ namespace build2 { auto& v (var_pool); - // @@ OVR + // Note: some overridable, some not. + // + v.insert<abs_dir_path> ("config.dist.root", true); + v.insert<strings> ("config.dist.archives", true); + v.insert<path> ("config.dist.cmd", true); - v.insert<bool> ("dist"); + v.insert<dir_path> ("dist.root"); + v.insert<path> ("dist.cmd"); + v.insert<strings> ("dist.archives"); - v.insert<string> ("dist.package"); - - v.insert<dir_path> ("dist.root"); - v.insert<dir_path> ("config.dist.root"); - - v.insert<path> ("dist.cmd"); - v.insert<path> ("config.dist.cmd"); - - v.insert<strings> ("dist.archives"); - v.insert<strings> ("config.dist.archives"); + v.insert<bool> ("dist"); // Flag. + v.insert<string> ("dist.package"); // Project's package name. } } @@ -60,7 +58,7 @@ namespace build2 dist_init (scope& r, scope&, const location& l, - unique_ptr<module>&, + unique_ptr<module_base>&, bool first, bool) { @@ -97,10 +95,10 @@ namespace build2 if (s) { - const value& cv (config::optional_absolute (r, "config.dist.root")); + const value& cv (config::optional (r, "config.dist.root")); if (cv && !cv.empty ()) - v = cv; + v = cast<dir_path> (cv); // Strip abs_dir_path. } } |