From 1ece46928dcd77d47b4875ac7edadb0c6d30c959 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 29 Jul 2017 09:24:10 +0200 Subject: Delete archive before regenerating --- build2/cc/link.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) 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); -- cgit v1.1