summaryrefslogtreecommitdiffstats
path: root/src/graph.cc
diff options
context:
space:
mode:
authorunknown <petr@meloun.(none)>2012-02-09 21:23:35 (GMT)
committerunknown <petr@meloun.(none)>2012-02-09 21:23:35 (GMT)
commitaf070e520806987bd3b175bf222774de923b62dd (patch)
tree0eff2859034dd46b6cbd8bd93fed41b8824e642e /src/graph.cc
parent7504ab4e5dbb153979333c67a8a43448040b718d (diff)
downloadNinja-af070e520806987bd3b175bf222774de923b62dd.zip
Ninja-af070e520806987bd3b175bf222774de923b62dd.tar.gz
Ninja-af070e520806987bd3b175bf222774de923b62dd.tar.bz2
Response files
Diffstat (limited to 'src/graph.cc')
-rw-r--r--src/graph.cc23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/graph.cc b/src/graph.cc
index 5320cfa..10aaeb3 100644
--- a/src/graph.cc
+++ b/src/graph.cc
@@ -76,7 +76,7 @@ bool Edge::RecomputeDirty(State* state, DiskInterface* disk_interface,
// date outputs, etc. Visit all outputs and determine whether they're dirty.
if (!dirty) {
BuildLog* build_log = state ? state->build_log_ : 0;
- string command = EvaluateCommand();
+ string command = EvaluateCommand(true);
for (vector<Node*>::iterator i = outputs_.begin();
i != outputs_.end(); ++i) {
@@ -204,9 +204,12 @@ string EdgeEnv::MakePathList(vector<Node*>::iterator begin,
return result;
}
-string Edge::EvaluateCommand() {
+string Edge::EvaluateCommand(bool incl_rsp_file) {
EdgeEnv env(this);
- return rule_->command().Evaluate(&env);
+ string command = rule_->command().Evaluate(&env);
+ if (incl_rsp_file && HasRspFile())
+ command += ";rspfile=" + GetRspFileContent();
+ return command;
}
string Edge::EvaluateDepFile() {
@@ -219,6 +222,20 @@ string Edge::GetDescription() {
return rule_->description().Evaluate(&env);
}
+bool Edge::HasRspFile() {
+ return !rule_->rspfile_.empty();
+}
+
+string Edge::GetRspFile() {
+ EdgeEnv env(this);
+ return rule_->rspfile_.Evaluate(&env);
+}
+
+string Edge::GetRspFileContent() {
+ EdgeEnv env(this);
+ return rule_->rspfile_content_.Evaluate(&env);
+}
+
bool Edge::LoadDepFile(State* state, DiskInterface* disk_interface,
string* err) {
METRIC_RECORD("depfile load");