summaryrefslogtreecommitdiffstats
path: root/src/clean.h
diff options
context:
space:
mode:
authorikifof <ikifof@gmail.com>2018-04-28 01:34:55 (GMT)
committerikifof <ikifof@gmail.com>2019-05-25 18:14:43 (GMT)
commit714621dba1b8b2d8cd6080b7bc82955b44054734 (patch)
treeaaf2e1572decb72ba9cc9b00a909070fce0cfca9 /src/clean.h
parent20b30dac6698d119e7797b34d6ed2c4ed8f48417 (diff)
downloadNinja-714621dba1b8b2d8cd6080b7bc82955b44054734.zip
Ninja-714621dba1b8b2d8cd6080b7bc82955b44054734.tar.gz
Ninja-714621dba1b8b2d8cd6080b7bc82955b44054734.tar.bz2
Adding a way to clean dead build artifacts that have an entry in the build log,
but are no longer produced by the current manifest. For now adding a dedicated "-t cleandead" option, since it should be run after reading the log; ideally it should be part of the build config and done before to start looking for dirty targets so that an incremental build would produce the same end result as a clean build from scratch. But since I am not 100% sure to understand the comment in the NinjaMain::isPathDead(), I opted to make it a tool for now to avoid impacting users who want to keep those files. The option name "cleandead" was selected insteadof something like "reap" to keep the "clean" prefix.
Diffstat (limited to 'src/clean.h')
-rw-r--r--src/clean.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/clean.h b/src/clean.h
index d044fb1..4c02ff6 100644
--- a/src/clean.h
+++ b/src/clean.h
@@ -20,6 +20,7 @@
#include "build.h"
#include "dyndep.h"
+#include "build_log.h"
using namespace std;
@@ -58,6 +59,10 @@ struct Cleaner {
/// Clean the file produced by the given @a rules.
/// @return non-zero if an error occurs.
int CleanRules(int rule_count, char* rules[]);
+ /// Clean the files produced by previous builds that are no longer in the
+ /// manifest.
+ /// @return non-zero if an error occurs.
+ int CleanDead(const BuildLog::Entries& entries);
/// @return the number of file cleaned.
int cleaned_files_count() const {