diff options
Diffstat (limited to 'src/graph.cc')
-rw-r--r-- | src/graph.cc | 23 |
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"); |