diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-03-21 10:38:22 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-03-21 10:38:22 +0200 |
commit | 903eeb2c681f2008602bf48265ec628e4fdc9225 (patch) | |
tree | f60cb2964320ba3ed64df8a49ffa89966533f8c8 /build2/utility.hxx | |
parent | fc8da2b2cc0a7ad497c810b54e53d68a11cb1887 (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/utility.hxx')
-rw-r--r-- | build2/utility.hxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/build2/utility.hxx b/build2/utility.hxx index ea47c03..e5c21e7 100644 --- a/build2/utility.hxx +++ b/build2/utility.hxx @@ -403,6 +403,20 @@ namespace build2 extern const path empty_path; extern const dir_path empty_dir_path; + // Hash a path potentially without the specific directory prefix. + // + // If prefix is not empty and is a super-path of the path to hash, then only + // hash the suffix. Note that both paths are assumed to be normalized. + // + // This functionality is normally used to strip out_root from target paths + // being hashed in order to avoid updates in case out_root was moved. Note + // that this should only be done if the result of the update does not + // include the out_root path in any form (as could be the case, for example, + // for debug information, __FILE__ macro expansion, rpath, etc). + // + void + hash_path (sha256&, const path&, const dir_path& prefix = dir_path ()); + // Append all the values from a variable to the C-string list. T is either // target or scope. The variable is expected to be of type strings. // |