diff options
author | Evan Martin <martine@danga.com> | 2010-12-26 20:31:12 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2010-12-26 20:31:12 (GMT) |
commit | 53fc63501dab3c40355f6a66cc712dd50081abfd (patch) | |
tree | 4b1642c21f989d7e64d8fcb52849604c05e8937f /src/build.cc | |
parent | 8b9c5b5d5ff8a6940c8d41925c789b844ec874c5 (diff) | |
download | Ninja-53fc63501dab3c40355f6a66cc712dd50081abfd.zip Ninja-53fc63501dab3c40355f6a66cc712dd50081abfd.tar.gz Ninja-53fc63501dab3c40355f6a66cc712dd50081abfd.tar.bz2 |
hook up build log
Diffstat (limited to 'src/build.cc')
-rw-r--r-- | src/build.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/build.cc b/src/build.cc index 73f9a86..4d561fb 100644 --- a/src/build.cc +++ b/src/build.cc @@ -2,6 +2,7 @@ #include <stdio.h> +#include "build_log.h" #include "ninja.h" #include "subprocess.h" @@ -247,6 +248,7 @@ Builder::Builder(State* state, const BuildConfig& config) command_runner_ = new RealCommandRunner; status_ = new BuildStatus; status_->verbosity_ = config.verbosity; + log_ = new BuildLog; } Node* Builder::AddTarget(const string& name, string* err) { @@ -274,6 +276,9 @@ bool Builder::Build(string* err) { return true; } + if (!log_->OpenForWrite("ninja_log", err)) + return false; + status_->PlanHasTotalEdges(plan_.edge_count()); while (plan_.more_to_do()) { while (command_runner_->CanRunMore()) { @@ -288,7 +293,6 @@ bool Builder::Build(string* err) { if (!StartEdge(edge, err)) return false; - status_->BuildEdgeStarted(edge); } bool success; @@ -307,6 +311,8 @@ bool Builder::Build(string* err) { } bool Builder::StartEdge(Edge* edge, string* err) { + status_->BuildEdgeStarted(edge); + // Create directories necessary for outputs. // XXX: this will block; do we care? for (vector<Node*>::iterator i = edge->outputs_.begin(); @@ -334,4 +340,5 @@ void Builder::FinishEdge(Edge* edge) { } plan_.EdgeFinished(edge); status_->BuildEdgeFinished(edge); + log_->RecordCommand(edge, 0); // XXX get edge timing. } |