aboutsummaryrefslogtreecommitdiff
path: root/build2/file.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-04-11 07:57:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-04-11 07:57:19 +0200
commit0342dc2fcdd78ef28a4e59d84193a3807068d726 (patch)
treee750c3062d6ff54f0d409fe1a25984b7e78592c8 /build2/file.cxx
parent5f7c3f923de106f9d204a8f3500274731ae84fd9 (diff)
New configuration logic, iteration 1
Diffstat (limited to 'build2/file.cxx')
-rw-r--r--build2/file.cxx35
1 files changed, 7 insertions, 28 deletions
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 <build2/lexer>
#include <build2/parser>
+#include <build2/config/utility>
+
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<dir_path> ("config.import." + project, true));
+ var_pool.insert<abs_dir_path> ("config.import." + project, true));
if (auto l = iroot[var])
{
- out_root = cast<dir_path> (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<dir_path> (const_cast<value&> (*l)));
- if (d != out_root)
- d = out_root;
- }
+ out_root = cast<abs_dir_path> (l);
+ config::save_variable (iroot, var); // Mark as part of configuration.
}
else
{