From 0342dc2fcdd78ef28a4e59d84193a3807068d726 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 11 Apr 2016 07:57:19 +0200 Subject: New configuration logic, iteration 1 --- build2/file.cxx | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) (limited to 'build2/file.cxx') diff --git a/build2/file.cxx b/build2/file.cxx index e494f5a..c3d2273 100644 --- a/build2/file.cxx +++ b/build2/file.cxx @@ -18,6 +18,8 @@ #include #include +#include + using namespace std; using namespace butl; @@ -859,42 +861,19 @@ namespace build2 break; } - // Then try the config.import.* mechanism (overridable variable). + // Then try the config.import.* mechanism. // if (out_root.empty ()) { - // @@ OVR + // Note: overridable variable with path auto-completion. // const variable& var ( - var_pool.insert ("config.import." + project, true)); + var_pool.insert ("config.import." + project, true)); if (auto l = iroot[var]) { - out_root = cast (l); - - if (l.belongs (*global_scope)) // A value from command line. - { - // Process the path by making it absolute and normalized. - // - if (out_root.relative ()) - out_root = work / out_root; - - out_root.normalize (); - - // Set on our root scope (part of our configuration). - // - iroot.assign (var) = out_root; - - // Also update the command-line value. This is necessary to avoid - // a warning issued by the config module about global/root scope - // value mismatch. Not very clean. - // - // @@ CMDVAR - // - dir_path& d (cast (const_cast (*l))); - if (d != out_root) - d = out_root; - } + out_root = cast (l); + config::save_variable (iroot, var); // Mark as part of configuration. } else { -- cgit v1.1