summaryrefslogtreecommitdiffstats
path: root/src/build.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-08-07 20:58:55 (GMT)
committerEvan Martin <martine@danga.com>2012-08-07 21:03:00 (GMT)
commitcc222d3f6ba769fd800b1dfdb1699fbb84516c7b (patch)
tree99f395a2f120ffbdd1d1390c8e5d6205d346354f /src/build.cc
parent645165bca247558f94d5f47cf7795c463e81d83a (diff)
downloadNinja-cc222d3f6ba769fd800b1dfdb1699fbb84516c7b.zip
Ninja-cc222d3f6ba769fd800b1dfdb1699fbb84516c7b.tar.gz
Ninja-cc222d3f6ba769fd800b1dfdb1699fbb84516c7b.tar.bz2
use DiskInterface to create the build directory
Fixes issue #392 (didn't handle creating nested build dirs right). Moves MakeDir out of util.h; all code should go through DiskInterface to simplify testing. Moves ownership of the DiskInterface into the client of the Builder, which also allows removing some code that reached inside the object as well as a minor leak.
Diffstat (limited to 'src/build.cc')
-rw-r--r--src/build.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/build.cc b/src/build.cc
index a1c94e4..6d1318c 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -552,9 +552,9 @@ struct DryRunCommandRunner : public CommandRunner {
queue<Edge*> finished_;
};
-Builder::Builder(State* state, const BuildConfig& config)
- : state_(state), config_(config) {
- disk_interface_ = new RealDiskInterface;
+Builder::Builder(State* state, const BuildConfig& config,
+ DiskInterface* disk_interface)
+ : state_(state), config_(config), disk_interface_(disk_interface) {
status_ = new BuildStatus(config);
log_ = state->build_log_;
}