summaryrefslogtreecommitdiffstats
path: root/src/build.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-04-22 00:55:10 (GMT)
committerNico Weber <nicolasweber@gmx.de>2013-04-22 00:56:43 (GMT)
commita83020b750e7b3c8c801fcf79ebe94d7dd4840dd (patch)
treef5ec3fc917cd9ae39935c93edaafdef67ea721a0 /src/build.cc
parentc57fd1a903cb342dc414307088352cdb550d3641 (diff)
downloadNinja-a83020b750e7b3c8c801fcf79ebe94d7dd4840dd.zip
Ninja-a83020b750e7b3c8c801fcf79ebe94d7dd4840dd.tar.gz
Ninja-a83020b750e7b3c8c801fcf79ebe94d7dd4840dd.tar.bz2
Don't record deps in dry runs.
deps_log() is NULL during dry runs, so this fixes a crash. It also matches ninja 1.2.0's behavior as far as I can tell. Fixes issue #551.
Diffstat (limited to 'src/build.cc')
-rw-r--r--src/build.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/build.cc b/src/build.cc
index fed3065..c9842ce 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -715,7 +715,9 @@ void Builder::FinishCommand(CommandRunner::Result* result) {
// extraction itself can fail, which makes the command fail from a
// build perspective.
vector<Node*> deps_nodes;
- string deps_type = edge->GetBinding("deps");
+ string deps_type;
+ if (!config_.dry_run)
+ deps_type = edge->GetBinding("deps");
if (!deps_type.empty()) {
string extract_err;
if (!ExtractDeps(result, deps_type, &deps_nodes, &extract_err) &&