diff options
author | Evan Martin <martine@danga.com> | 2013-02-19 18:00:05 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2013-04-08 22:02:43 (GMT) |
commit | c47f2cedbb8f44182a72343d0c71f5af5196d274 (patch) | |
tree | 255cc011a1f9a0e34f911a1828ff55f28e4780c2 /src/build.cc | |
parent | 149e8d8d5d2b043fa53f9f8b74fff893ea1819df (diff) | |
download | Ninja-c47f2cedbb8f44182a72343d0c71f5af5196d274.zip Ninja-c47f2cedbb8f44182a72343d0c71f5af5196d274.tar.gz Ninja-c47f2cedbb8f44182a72343d0c71f5af5196d274.tar.bz2 |
only write deps log if edge is in deps log mode
Diffstat (limited to 'src/build.cc')
-rw-r--r-- | src/build.cc | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/build.cc b/src/build.cc index ecde4df..56f2d9b 100644 --- a/src/build.cc +++ b/src/build.cc @@ -801,16 +801,14 @@ void Builder::FinishCommand(CommandRunner::Result* result) { // can fail, which makes the command fail from a build perspective. vector<Node*> deps_nodes; - if (result->success()) { - string deps_type = edge->GetBinding("deps"); - if (!deps_type.empty()) { - string extract_err; - if (!ExtractDeps(result, deps_type, &deps_nodes, &extract_err)) { - if (!result->output.empty()) - result->output.append("\n"); - result->output.append(extract_err); - result->status = ExitFailure; - } + string deps_type = edge->GetBinding("deps"); + if (result->success() && !deps_type.empty()) { + string extract_err; + if (!ExtractDeps(result, deps_type, &deps_nodes, &extract_err)) { + if (!result->output.empty()) + result->output.append("\n"); + result->output.append(extract_err); + result->status = ExitFailure; } } @@ -874,7 +872,7 @@ void Builder::FinishCommand(CommandRunner::Result* result) { restat_mtime); } - if (scan_.deps_log()) { + if (!deps_type.empty() && scan_.deps_log()) { // XXX figure out multiple outputs. Node* out = edge->outputs_[0]; // XXX need to restat for restat_mtime. |