diff options
author | Evan Martin <martine@danga.com> | 2011-01-07 22:00:21 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-01-07 22:00:21 (GMT) |
commit | 53dc295f1caf88802e244d75317beaee1e7116b9 (patch) | |
tree | 5803237a3f7fda6f5e6a6088c834c54252982cdc | |
parent | 6831ba38d101f4bd9c7e39da511fde4117db97ad (diff) | |
download | Ninja-53dc295f1caf88802e244d75317beaee1e7116b9.zip Ninja-53dc295f1caf88802e244d75317beaee1e7116b9.tar.gz Ninja-53dc295f1caf88802e244d75317beaee1e7116b9.tar.bz2 |
rebuild when command lines change
-rw-r--r-- | src/ninja_jumble.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ninja_jumble.cc b/src/ninja_jumble.cc index 66cfd6a..dc41f2e 100644 --- a/src/ninja_jumble.cc +++ b/src/ninja_jumble.cc @@ -151,6 +151,8 @@ bool Edge::RecomputeDirty(State* state, DiskInterface* disk_interface, } } + string command = EvaluateCommand(); + 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 @@ -162,6 +164,14 @@ bool Edge::RecomputeDirty(State* state, DiskInterface* disk_interface, if (dirty || !(*i)->file_->exists() || (*i)->file_->mtime_ < most_recent_input) { (*i)->dirty_ = true; + } else { + // May also be dirty due to the command changing since the last build. + BuildLog::LogEntry* entry; + if (state->build_log_ && + (entry = state->build_log_->LookupByOutput((*i)->file_->path_))) { + if (command != entry->command) + (*i)->dirty_ = true; + } } } return true; |