aboutsummaryrefslogtreecommitdiff
path: root/build2/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-10-13 18:20:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 08:12:47 +0200
commitae579402c8c64ea8ceea2e9fcee5097b3c53e353 (patch)
tree5933a00f434adab5583e81c147754d5d4dc69f12 /build2/context.cxx
parent8d2e541ab1aa24140eb680fb046e49a4a3f0bbd2 (diff)
Minor dependency cleanup
Diffstat (limited to 'build2/context.cxx')
-rw-r--r--build2/context.cxx53
1 files changed, 3 insertions, 50 deletions
diff --git a/build2/context.cxx b/build2/context.cxx
index d1d9b54..1527cc8 100644
--- a/build2/context.cxx
+++ b/build2/context.cxx
@@ -25,8 +25,6 @@ using namespace butl;
namespace build2
{
- dir_path work;
- dir_path home;
options ops;
string_pool extension_pool;
@@ -43,6 +41,8 @@ namespace build2
uint64_t dependency_count;
+ variable_override_cache var_override_cache;
+
variable_overrides
reset (const strings& cmd_vars)
{
@@ -55,7 +55,7 @@ namespace build2
variable_overrides vos;
- variable_override_cache.clear ();
+ var_override_cache.clear ();
targets.clear ();
scopes.clear ();
@@ -362,53 +362,6 @@ namespace build2
return out_root / s.leaf (src_root);
}
- // relative()
- //
- const dir_path* relative_base = &work;
-
- string
- diag_relative (const path& p, bool cur)
- {
- if (p.string () == "-")
- return "<stdin>";
-
- const path& b (*relative_base);
-
- if (p.absolute ())
- {
- if (p == b)
- return cur ? "." + p.separator_string () : string ();
-
-#ifndef _WIN32
- if (p == home)
- return "~" + p.separator_string ();
-#endif
-
- path rb (relative (p));
-
-#ifndef _WIN32
- if (rb.relative ())
- {
- // See if the original path with the ~/ shortcut is better
- // that the relative to base.
- //
- if (p.sub (home))
- {
- path rh (p.leaf (home));
- if (rb.size () > rh.size () + 2) // 2 for '~/'
- return "~/" + move (rh).representation ();
- }
- }
- else if (rb.sub (home))
- return "~/" + rb.leaf (home).representation ();
-#endif
-
- return move (rb).representation ();
- }
-
- return p.representation ();
- }
-
// diag_do(), etc.
//
void