diff options
author | Evan Martin <martine@danga.com> | 2011-01-23 20:00:55 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-01-23 20:00:55 (GMT) |
commit | 791f0634684f157f7ed443165ac9985f2c04f8ed (patch) | |
tree | 8c9427cdf6b0827216445e82b8682b6ea658db69 /src/build_log.cc | |
parent | 8a95f48ad50c380cc8d30e7cd6720535547ca2dd (diff) | |
download | Ninja-791f0634684f157f7ed443165ac9985f2c04f8ed.zip Ninja-791f0634684f157f7ed443165ac9985f2c04f8ed.tar.gz Ninja-791f0634684f157f7ed443165ac9985f2c04f8ed.tar.bz2 |
move dry run info inside build log
Diffstat (limited to 'src/build_log.cc')
-rw-r--r-- | src/build_log.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/build_log.cc b/src/build_log.cc index 144ae14..b8a782f 100644 --- a/src/build_log.cc +++ b/src/build_log.cc @@ -4,6 +4,7 @@ #include <stdio.h> #include <string.h> +#include "build.h" #include "graph.h" #include "ninja.h" @@ -18,6 +19,9 @@ BuildLog::BuildLog() : log_file_(NULL), config_(NULL), needs_recompaction_(false) {} bool BuildLog::OpenForWrite(const string& path, string* err) { + if (config_ && config_->dry_run) + return true; // Do nothing, report success. + if (needs_recompaction_) { if (!Recompact(path, err)) return false; @@ -61,7 +65,6 @@ void BuildLog::Close() { log_file_ = NULL; } -// Load the on-disk log. bool BuildLog::Load(const string& path, string* err) { FILE* file = fopen(path.c_str(), "r"); if (!file) { @@ -115,7 +118,6 @@ bool BuildLog::Load(const string& path, string* err) { return true; } -// Lookup a previously-run command by its output path. BuildLog::LogEntry* BuildLog::LookupByOutput(const string& path) { Log::iterator i = log_.find(path); if (i != log_.end()) |