diff options
Diffstat (limited to 'src/task_ld.cc')
-rw-r--r-- | src/task_ld.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/task_ld.cc b/src/task_ld.cc index d719ce7..69c3a8a 100644 --- a/src/task_ld.cc +++ b/src/task_ld.cc @@ -129,7 +129,13 @@ int TaskLD::runInner() auto tool = compiler(); const auto& c = ctor::get_configuration(); - return execute(settings, tool, args, c.env, is_self); + auto res = execute(settings, tool, args, c.env, is_self); + if(res != 0) + { + std::filesystem::remove(targetFile()); + } + + return res; } int TaskLD::clean() |