aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/link-rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-03-21 10:38:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-03-21 10:38:22 +0200
commit903eeb2c681f2008602bf48265ec628e4fdc9225 (patch)
treef60cb2964320ba3ed64df8a49ffa89966533f8c8 /build2/cc/link-rule.cxx
parentfc8da2b2cc0a7ad497c810b54e53d68a11cb1887 (diff)
Strip out_root when hashing linker input paths
This allows moving out_root of simple projects (no rpath, -I$out_root, or similar) without causing a re-link which we use for testing.
Diffstat (limited to 'build2/cc/link-rule.cxx')
-rw-r--r--build2/cc/link-rule.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx
index 04e2e7d..4379362 100644
--- a/build2/cc/link-rule.cxx
+++ b/build2/cc/link-rule.cxx
@@ -1034,10 +1034,11 @@ namespace build2
struct data
{
- sha256& cs;
- bool& update;
- timestamp mt;
- } d {cs, update, mt};
+ sha256& cs;
+ const dir_path& out_root;
+ bool& update;
+ timestamp mt;
+ } d {cs, bs.root_scope ()->out_path (), update, mt};
auto lib = [&d, this] (const file* l, const string& p, lflags f, bool)
{
@@ -1055,7 +1056,7 @@ namespace build2
l = &l->member->as<file> ();
d.cs.append (f);
- d.cs.append (l->path ().string ());
+ hash_path (d.cs, l->path (), d.out_root);
}
else
d.cs.append (p);
@@ -1593,7 +1594,7 @@ namespace build2
f = nullptr; // Timestamp checked by hash_libraries().
}
else
- cs.append (f->path ().string ());
+ hash_path (cs, f->path (), rs.out_path ());
}
else
f = pt->is_a<exe> (); // Consider executable mtime (e.g., linker).
@@ -1607,7 +1608,7 @@ namespace build2
// Treat it as input for both MinGW and VC (mtime checked above).
//
if (!manifest.empty ())
- cs.append (manifest.string ());
+ hash_path (cs, manifest, rs.out_path ());
// Treat .libs as inputs, not options.
//