summaryrefslogtreecommitdiffstats
path: root/src/graph.cc
diff options
context:
space:
mode:
authorMaxim Kalaev <maximk@il.ibm.com>2012-08-29 20:25:44 (GMT)
committerMaxim Kalaev <maximk@il.ibm.com>2012-08-30 17:53:51 (GMT)
commitbcc8ad1369ae3d90631729d29cc83c377f44535e (patch)
treeb32e35f170b93a57610fac6770bc426a723f7726 /src/graph.cc
parent433b9d4e166544c52a494da2c810821fb39ab174 (diff)
downloadNinja-bcc8ad1369ae3d90631729d29cc83c377f44535e.zip
Ninja-bcc8ad1369ae3d90631729d29cc83c377f44535e.tar.gz
Ninja-bcc8ad1369ae3d90631729d29cc83c377f44535e.tar.bz2
safer build: consider target dirty if depfile is missing
Diffstat (limited to 'src/graph.cc')
-rw-r--r--src/graph.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/graph.cc b/src/graph.cc
index 9654c1a..3567bfa 100644
--- a/src/graph.cc
+++ b/src/graph.cc
@@ -38,8 +38,13 @@ bool Edge::RecomputeDirty(State* state, DiskInterface* disk_interface,
outputs_ready_ = true;
if (!rule_->depfile().empty()) {
- if (!LoadDepFile(state, disk_interface, err))
- return false;
+ if (!LoadDepFile(state, disk_interface, err)) {
+ if (!err->empty())
+ return false;
+ EXPLAIN("Edge targets are dirty because depfile '%s' is missing",
+ EvaluateDepFile().c_str());
+ dirty = true;
+ }
}
// Visit all inputs; we're dirty if any of the inputs are dirty.
@@ -274,8 +279,9 @@ bool Edge::LoadDepFile(State* state, DiskInterface* disk_interface,
string content = disk_interface->ReadFile(path, err);
if (!err->empty())
return false;
+ // On a missing depfile: return false and empty *err.
if (content.empty())
- return true;
+ return false;
DepfileParser depfile;
string depfile_err;