build: add to deps log for each edge output

This commit is contained in:
Ben Boeckel 2019-03-06 16:40:27 -05:00
parent 2d15b04e41
commit e2433c11d0

View File

@ -1034,13 +1034,15 @@ bool Builder::FinishCommand(CommandRunner::Result* result, string* err) {
if (!deps_type.empty() && !config_.dry_run) {
assert(edge->outputs_.size() == 1 && "should have been rejected by parser");
Node* out = edge->outputs_[0];
TimeStamp deps_mtime = disk_interface_->Stat(out->path(), err);
if (deps_mtime == -1)
return false;
if (!scan_.deps_log()->RecordDeps(out, deps_mtime, deps_nodes)) {
*err = string("Error writing to deps log: ") + strerror(errno);
return false;
for (std::vector<Node*>::const_iterator o = edge->outputs_.begin();
o != edge->outputs_.end(); ++o) {
TimeStamp deps_mtime = disk_interface_->Stat((*o)->path(), err);
if (deps_mtime == -1)
return false;
if (!scan_.deps_log()->RecordDeps(*o, deps_mtime, deps_nodes)) {
*err = std::string("Error writing to deps log: ") + strerror(errno);
return false;
}
}
}
return true;