Edge* edge = node->in_edge_;
if (!edge) { // Leaf node.
if (node->dirty_) {
- *err = "'" + node->file_->path_ + "' missing "
+ string referenced;
+ if (!stack->empty())
+ referenced = ", needed by '" + stack->back()->file_->path_ + "',";
+ *err = "'" + node->file_->path_ + "'" + referenced + " missing "
"and no known rule to make it";
}
return false;
string err;
Dirty("in1");
EXPECT_FALSE(builder_.AddTarget("cat1", &err));
- EXPECT_EQ("'in1' missing and no known rule to make it", err);
+ EXPECT_EQ("'in1', needed by 'cat1', missing and no known rule to make it",
+ err);
}
TEST_F(BuildTest, MissingTarget) {