summaryrefslogtreecommitdiffstats
path: root/src/graph.h
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-09-19 01:56:15 (GMT)
committerPeter Collingbourne <peter@pcc.me.uk>2011-10-24 00:16:38 (GMT)
commit0efbbbf67a94452919084765e87106e7748274cb (patch)
tree21c8c5a13b70d7f287b2f569a35f6a03a7f1c19d /src/graph.h
parent386cbf6c7e49c88b87f54619b06670ea9f66c8a5 (diff)
downloadNinja-0efbbbf67a94452919084765e87106e7748274cb.zip
Ninja-0efbbbf67a94452919084765e87106e7748274cb.tar.gz
Ninja-0efbbbf67a94452919084765e87106e7748274cb.tar.bz2
Implement restat rules
A restat rule is a rule which is capable of pruning the build tree depending on the timestamps of its outputs before and after a build. After a restat rule is rebuilt, Ninja will re-stat each output file to obtain its current timestamp. If the timestamp is unchanged from when Ninja initially stat'ed the file before starting the build, Ninja will mark that output file as clean, and recursively for each reverse dependency of the output file, recompute its dirty status. Ninja then stores the most recent timestamp of any input file in the build log entry associated with the output file. This timestamp will be treated by future invocations of Ninja as the output file's modification time instead of the output file's actual modification time for the purpose of deciding whether it is dirty (but not whether its reverse dependencies are dirty).
Diffstat (limited to 'src/graph.h')
-rw-r--r--src/graph.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/graph.h b/src/graph.h
index 079db43..64496d5 100644
--- a/src/graph.h
+++ b/src/graph.h
@@ -59,7 +59,7 @@ struct FileStat {
/// An invokable build command and associated metadata (description, etc.).
struct Rule {
- Rule(const string& name) : name_(name), generator_(false) { }
+ Rule(const string& name) : name_(name), generator_(false), restat_(false) { }
bool ParseCommand(const string& command, string* err) {
return command_.Parse(command, err);
@@ -68,7 +68,7 @@ struct Rule {
EvalString command_;
EvalString description_;
EvalString depfile_;
- bool generator_;
+ bool generator_, restat_;
};
struct BuildLog;