diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2019-03-06 21:40:27 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2019-11-20 20:55:05 (GMT) |
commit | e2433c11d00725913d0b76350f4d35ba749e3f47 (patch) | |
tree | c688c3266346b6d3ec3fc19caee8b7730dde6a91 /src/build.cc | |
parent | 2d15b04e411229cb902332957281622119025e77 (diff) | |
download | Ninja-e2433c11d00725913d0b76350f4d35ba749e3f47.zip Ninja-e2433c11d00725913d0b76350f4d35ba749e3f47.tar.gz Ninja-e2433c11d00725913d0b76350f4d35ba749e3f47.tar.bz2 |
build: add to deps log for each edge output
Diffstat (limited to 'src/build.cc')
-rw-r--r-- | src/build.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/build.cc b/src/build.cc index 931fb95..fe8daca 100644 --- a/src/build.cc +++ b/src/build.cc @@ -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; |