diff options
author | unknown <petr@meloun.(none)> | 2012-02-09 21:23:35 (GMT) |
---|---|---|
committer | unknown <petr@meloun.(none)> | 2012-02-09 21:23:35 (GMT) |
commit | af070e520806987bd3b175bf222774de923b62dd (patch) | |
tree | 0eff2859034dd46b6cbd8bd93fed41b8824e642e /src/build.cc | |
parent | 7504ab4e5dbb153979333c67a8a43448040b718d (diff) | |
download | Ninja-af070e520806987bd3b175bf222774de923b62dd.zip Ninja-af070e520806987bd3b175bf222774de923b62dd.tar.gz Ninja-af070e520806987bd3b175bf222774de923b62dd.tar.bz2 |
Response files
Diffstat (limited to 'src/build.cc')
-rw-r--r-- | src/build.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/build.cc b/src/build.cc index cfe2c65..e436aee 100644 --- a/src/build.cc +++ b/src/build.cc @@ -343,8 +343,8 @@ void Plan::CleanNode(BuildLog* build_log, Node* node) { for (vector<Node*>::iterator ni = begin; ni != end; ++ni) if ((*ni)->mtime() > most_recent_input) most_recent_input = (*ni)->mtime(); - string command = (*ei)->EvaluateCommand(); - + string command = (*ei)->EvaluateCommand(true); + // Now, recompute the dirty state of each output. bool all_outputs_clean = true; for (vector<Node*>::iterator ni = (*ei)->outputs_.begin(); @@ -575,6 +575,13 @@ bool Builder::StartEdge(Edge* edge, string* err) { if (!disk_interface_->MakeDirs((*i)->path())) return false; } + + // Create response file, if needed + // XXX: this may also block; do we care? + if (edge->HasRspFile()) { + if (!disk_interface_->WriteFile(edge->GetRspFile(), edge->GetRspFileContent())) + return false; + } // start command computing and run it if (!command_runner_->StartCommand(edge)) { @@ -632,6 +639,10 @@ void Builder::FinishEdge(Edge* edge, bool success, const string& output) { } } + // delete the response file on success (if exists) + if (edge->HasRspFile()) + disk_interface_->RemoveFile(edge->GetRspFile()); + plan_.EdgeFinished(edge); } |