summaryrefslogtreecommitdiffstats
path: root/src/build.h
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.h
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.h')
-rw-r--r--src/build.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/build.h b/src/build.h
index 5e26bbb..986e8a9 100644
--- a/src/build.h
+++ b/src/build.h
@@ -119,7 +119,8 @@ struct BuildConfig {
/// Builder wraps the build process: starting commands, updating status.
struct Builder {
- Builder(State* state, const BuildConfig& config);
+ Builder(State* state, const BuildConfig& config,
+ DiskInterface* disk_interface);
~Builder();
/// Clean up after interrupted commands by deleting output files.
@@ -144,12 +145,13 @@ struct Builder {
State* state_;
const BuildConfig& config_;
Plan plan_;
- DiskInterface* disk_interface_;
auto_ptr<CommandRunner> command_runner_;
BuildStatus* status_;
BuildLog* log_;
private:
+ DiskInterface* disk_interface_;
+
// Unimplemented copy ctor and operator= ensure we don't copy the auto_ptr.
Builder(const Builder &other); // DO NOT IMPLEMENT
void operator=(const Builder &other); // DO NOT IMPLEMENT