summaryrefslogtreecommitdiffstats
path: root/src/build_log.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2011-01-23 20:00:55 (GMT)
committerEvan Martin <martine@danga.com>2011-01-23 20:00:55 (GMT)
commit791f0634684f157f7ed443165ac9985f2c04f8ed (patch)
tree8c9427cdf6b0827216445e82b8682b6ea658db69 /src/build_log.cc
parent8a95f48ad50c380cc8d30e7cd6720535547ca2dd (diff)
downloadNinja-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.cc6
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())