aboutsummaryrefslogtreecommitdiff
path: root/build2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-07-29 09:24:10 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-07-29 09:24:10 +0200
commit1ece46928dcd77d47b4875ac7edadb0c6d30c959 (patch)
treeea6be10112a6b9d031ecfc544177858312a83f99 /build2
parent15ae8a35fba961089ec3bec46a8e7c09b1e6c2f8 (diff)
Delete archive before regenerating
Diffstat (limited to 'build2')
-rw-r--r--build2/cc/link.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/build2/cc/link.cxx b/build2/cc/link.cxx
index babbbed..1a5424b 100644
--- a/build2/cc/link.cxx
+++ b/build2/cc/link.cxx
@@ -1813,6 +1813,17 @@ namespace build2
}
catch (const system_error&) {} // Ignore errors.
}
+ else if (lt.static_library ())
+ {
+ // We use relative paths to the object files which means we may end
+ // up with different ones depending on CWD and some implementation
+ // treat them as different archive members. So remote the file to
+ // be sure. Note that we ignore errors leaving it to the achiever
+ // to complain.
+ //
+ if (mt != timestamp_nonexistent)
+ try_rmfile (relt, true);
+ }
if (verb >= 2)
print_process (args);