diff options
author | Evan Martin <martine@danga.com> | 2011-09-09 20:48:27 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-09-09 20:48:27 (GMT) |
commit | 639c8f0bad935625f3e61fb9dfac7da17b4d7625 (patch) | |
tree | 2bbbec00bd86c2d5e7692c2dc5cbc05508892c4f /src/graph.cc | |
parent | 531c5e5bef4ef26d7456c462673435402697d7b8 (diff) | |
download | Ninja-639c8f0bad935625f3e61fb9dfac7da17b4d7625.zip Ninja-639c8f0bad935625f3e61fb9dfac7da17b4d7625.tar.gz Ninja-639c8f0bad935625f3e61fb9dfac7da17b4d7625.tar.bz2 |
don't mark phony edges dirty if none of their inputs are dirty
Because the output file is always missing, we'd consider a phony edge
dirty even when there wasn't any work to do. Most importantly, that
would mean we wouldn't print "nothing to do" in the common case of
everything being up to date when building an alias.
Diffstat (limited to 'src/graph.cc')
-rw-r--r-- | src/graph.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/graph.cc b/src/graph.cc index 82716aa..c43cf70 100644 --- a/src/graph.cc +++ b/src/graph.cc @@ -70,10 +70,19 @@ bool Edge::RecomputeDirty(State* state, DiskInterface* disk_interface, assert(!outputs_.empty()); for (vector<Node*>::iterator i = outputs_.begin(); i != outputs_.end(); ++i) { - // We may have other outputs, that our input-recursive traversal hasn't hit - // yet (or never will). Stat them if we haven't already. + // We may have other outputs that our input-recursive traversal hasn't hit + // yet (or never will). Stat them if we haven't already to mark that we've + // visited their dependents. (*i)->file_->StatIfNecessary(disk_interface); + if (is_phony()) { + // Phony edges don't write any output. + // They're only dirty if an input is dirty. + if (dirty) + (*i)->dirty_ = true; + continue; + } + // Output is dirty if we're dirty, we're missing the output, // or if it's older than the most recent input mtime. if (dirty || !(*i)->file_->exists() || |