summaryrefslogtreecommitdiffstats
path: root/src/build.h
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-09-04 22:39:04 (GMT)
committerEvan Martin <martine@danga.com>2012-09-04 22:39:04 (GMT)
commit1e11c8a6bd119025efd8725370ffa42354f92f88 (patch)
tree53adfbd3d97d14a84bc9e0657e85569d0d547a11 /src/build.h
parent703dcffd6d2e4b64411eb44d3025093abfd1d737 (diff)
downloadNinja-1e11c8a6bd119025efd8725370ffa42354f92f88.zip
Ninja-1e11c8a6bd119025efd8725370ffa42354f92f88.tar.gz
Ninja-1e11c8a6bd119025efd8725370ffa42354f92f88.tar.bz2
move BuildLog to DependencyScan
The build log is needed in computing whether an edge is dirty, so I think it belongs here. (It's a bit weird that Builder needs to reach into it to record completed commands, maybe it will become cleaner with more thought.)
Diffstat (limited to 'src/build.h')
-rw-r--r--src/build.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/build.h b/src/build.h
index 9152eac..3e7a144 100644
--- a/src/build.h
+++ b/src/build.h
@@ -121,7 +121,7 @@ struct BuildConfig {
/// Builder wraps the build process: starting commands, updating status.
struct Builder {
Builder(State* state, const BuildConfig& config,
- DiskInterface* disk_interface);
+ BuildLog* log, DiskInterface* disk_interface);
~Builder();
/// Clean up after interrupted commands by deleting output files.
@@ -143,12 +143,16 @@ struct Builder {
bool StartEdge(Edge* edge, string* err);
void FinishEdge(Edge* edge, bool success, const string& output);
+ /// Used for tests.
+ void SetBuildLog(BuildLog* log) {
+ scan_.set_build_log(log);
+ }
+
State* state_;
const BuildConfig& config_;
Plan plan_;
auto_ptr<CommandRunner> command_runner_;
BuildStatus* status_;
- BuildLog* log_;
private:
DiskInterface* disk_interface_;