summaryrefslogtreecommitdiff
path: root/src/task_so.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/task_so.cc')
-rw-r--r--src/task_so.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/task_so.cc b/src/task_so.cc
index 85e80e4..c98e4a7 100644
--- a/src/task_so.cc
+++ b/src/task_so.cc
@@ -116,7 +116,13 @@ int TaskSO::runInner()
auto tool = compiler();
const auto& cfg = ctor::get_configuration();
- return execute(settings, tool, args, cfg.env);
+ auto res = execute(settings, tool, args, cfg.env);
+ if(res != 0)
+ {
+ std::filesystem::remove(targetFile());
+ }
+
+ return res;
}
int TaskSO::clean()