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