summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2011-01-08 01:22:17 (GMT)
committerEvan Martin <martine@danga.com>2011-01-08 01:22:17 (GMT)
commit83056869b618a27c0b3d8ec86e15e9f15777c172 (patch)
tree551d2f1470e19319d70151868c12dd5e4acc7f20 /src
parentd4efbf34a3dd58551b4819612d0355396e0e6301 (diff)
downloadNinja-83056869b618a27c0b3d8ec86e15e9f15777c172.zip
Ninja-83056869b618a27c0b3d8ec86e15e9f15777c172.tar.gz
Ninja-83056869b618a27c0b3d8ec86e15e9f15777c172.tar.bz2
missing implicit deps are ok
This was a very subtle bug, and the difficulty of writing a test for it makes me think I've gone about the testing infrastructure the wrong way. I intend to follow this by fixing up the way tests work.
Diffstat (limited to 'src')
-rw-r--r--src/ninja_jumble.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ninja_jumble.cc b/src/ninja_jumble.cc
index dc41f2e..18faac8 100644
--- a/src/ninja_jumble.cc
+++ b/src/ninja_jumble.cc
@@ -130,7 +130,10 @@ bool Edge::RecomputeDirty(State* state, DiskInterface* disk_interface,
if (!edge->RecomputeDirty(state, disk_interface, err))
return false;
} else {
- (*i)->dirty_ = !(*i)->file_->exists();
+ // This input has no in-edge; it is dirty if it is missing.
+ // But it's ok for implicit deps to be missing.
+ if (!is_implicit(i - inputs_.begin()))
+ (*i)->dirty_ = !(*i)->file_->exists();
}
}
@@ -160,7 +163,7 @@ bool Edge::RecomputeDirty(State* state, DiskInterface* disk_interface,
(*i)->file_->StatIfNecessary(disk_interface);
// Output is dirty if we're dirty, we're missing the output,
- // or if it's older than the mostt recent input mtime.
+ // or if it's older than the most recent input mtime.
if (dirty || !(*i)->file_->exists() ||
(*i)->file_->mtime_ < most_recent_input) {
(*i)->dirty_ = true;