summaryrefslogtreecommitdiffstats
path: root/src/build.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2013-02-19 18:00:05 (GMT)
committerEvan Martin <martine@danga.com>2013-04-08 22:02:43 (GMT)
commitc47f2cedbb8f44182a72343d0c71f5af5196d274 (patch)
tree255cc011a1f9a0e34f911a1828ff55f28e4780c2 /src/build.cc
parent149e8d8d5d2b043fa53f9f8b74fff893ea1819df (diff)
downloadNinja-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.cc20
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.