summaryrefslogtreecommitdiffstats
path: root/src/build.cc
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-06-19 15:47:21 (GMT)
committerBrad King <brad.king@kitware.com>2019-04-18 12:21:44 (GMT)
commitb08f3fb86909bf5b890e33936cf8fd44e1cbff47 (patch)
treeeda7529eece89180f27cbc1421dfc72dbada12c1 /src/build.cc
parent083a9e2e7af813571444e33fad5f0f373bce7e3f (diff)
downloadNinja-b08f3fb86909bf5b890e33936cf8fd44e1cbff47.zip
Ninja-b08f3fb86909bf5b890e33936cf8fd44e1cbff47.tar.gz
Ninja-b08f3fb86909bf5b890e33936cf8fd44e1cbff47.tar.bz2
Make a Builder optionally available to Plan
In order to later support dynamic updates to the build plan while building, the Plan will need access to its Builder. Since this access will be needed only for specific features we can avoid updating all Plan constructions in the test suite by making this access optional.
Diffstat (limited to 'src/build.cc')
-rw-r--r--src/build.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/build.cc b/src/build.cc
index a07d970..1674e51 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -288,7 +288,11 @@ void BuildStatus::PrintStatus(Edge* edge, EdgeStatus status) {
force_full_command ? LinePrinter::FULL : LinePrinter::ELIDE);
}
-Plan::Plan() : command_edges_(0), wanted_edges_(0) {}
+Plan::Plan(Builder* builder)
+ : builder_(builder)
+ , command_edges_(0)
+ , wanted_edges_(0)
+{}
void Plan::Reset() {
command_edges_ = 0;
@@ -572,7 +576,8 @@ bool RealCommandRunner::WaitForCommand(Result* result) {
Builder::Builder(State* state, const BuildConfig& config,
BuildLog* build_log, DepsLog* deps_log,
DiskInterface* disk_interface)
- : state_(state), config_(config), disk_interface_(disk_interface),
+ : state_(state), config_(config),
+ plan_(this), disk_interface_(disk_interface),
scan_(state, build_log, deps_log, disk_interface,
&config_.depfile_parser_options) {
status_ = new BuildStatus(config);