summaryrefslogtreecommitdiffstats
path: root/src/graph.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/graph.cc')
-rw-r--r--src/graph.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/graph.cc b/src/graph.cc
index 18adeee..9654c1a 100644
--- a/src/graph.cc
+++ b/src/graph.cc
@@ -158,10 +158,15 @@ bool Edge::RecomputeOutputDirty(BuildLog* build_log,
// May also be dirty due to the command changing since the last build.
// But if this is a generator rule, the command changing does not make us
// dirty.
- if (!rule_->generator() && build_log &&
- (entry || (entry = build_log->LookupByOutput(output->path())))) {
- if (BuildLog::LogEntry::HashCommand(command) != entry->command_hash) {
- EXPLAIN("command line changed for %s", output->path().c_str());
+ if (!rule_->generator() && build_log) {
+ if (entry || (entry = build_log->LookupByOutput(output->path()))) {
+ if (BuildLog::LogEntry::HashCommand(command) != entry->command_hash) {
+ EXPLAIN("command line changed for %s", output->path().c_str());
+ return true;
+ }
+ }
+ if (!entry) {
+ EXPLAIN("command line not found in log for %s", output->path().c_str());
return true;
}
}