aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-10-06 02:07:54 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-10-06 02:07:54 +0300
commit9d873b63913eb7e471952caedc15bdeaafa4f391 (patch)
treeb8ec18bb86ba0ad359c3bf71f6231630494ec074
parentf2e26b666ab63c8c4ea1be0df4e64530147470b6 (diff)
Fix old libs cleanup not to remove unrelated files
-rw-r--r--build2/cc/link.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/build2/cc/link.cxx b/build2/cc/link.cxx
index 4ab2873..e14cb08 100644
--- a/build2/cc/link.cxx
+++ b/build2/cc/link.cxx
@@ -257,7 +257,6 @@ namespace build2
}
append_ext (cp);
- cp += "*"; // For .d, .pdb, etc. A bit dangerous though.
// On Windows the real path is to libs{} and the link path is to the
// import library.
@@ -1833,7 +1832,7 @@ namespace build2
if (verb >= 4) // Seeing this with -V doesn't really add any value.
text << "rm " << p;
- auto rm = [&paths] (path&& m, const string&, bool interm)
+ auto rm = [&paths, this] (path&& m, const string&, bool interm)
{
if (!interm)
{
@@ -1852,6 +1851,13 @@ namespace build2
test (paths.link))
{
try_rmfile (m);
+ try_rmfile (m + ".d");
+
+ if (tsys == "win32-msvc")
+ {
+ try_rmfile (m + ".pdb");
+ try_rmfile (m + ".ilk");
+ }
}
}
return true;