summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgerioldman <k.gergo49@gmail.com>2023-08-27 12:02:50 (GMT)
committergerioldman <k.gergo49@gmail.com>2023-08-27 12:02:50 (GMT)
commit98bb926065926133278fa5dafd31bfc5007edf96 (patch)
treed89fbf9724b506b4e5476db24fe35caf1c563576
parent22b778ca197562d55e64bd07faa3b37b064492a7 (diff)
downloadNinja-98bb926065926133278fa5dafd31bfc5007edf96.zip
Ninja-98bb926065926133278fa5dafd31bfc5007edf96.tar.gz
Ninja-98bb926065926133278fa5dafd31bfc5007edf96.tar.bz2
AddTasking RSP syntax to printCompdb functionality
-rw-r--r--src/ninja.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ninja.cc b/src/ninja.cc
index 887d89f..2520f31 100644
--- a/src/ninja.cc
+++ b/src/ninja.cc
@@ -882,7 +882,7 @@ std::string EvaluateCommandWithRspfile(const Edge* edge,
return command;
size_t index = command.find(rspfile);
- if (index == 0 || index == string::npos || command[index - 1] != '@')
+ if (index == 0 || index == string::npos || ( command[index - 1] != '@' && command.find("--option-file=") != index - 14 && command.find("-f ") != index - 3 ))
return command;
string rspfile_content = edge->GetBinding("rspfile_content");
@@ -892,7 +892,12 @@ std::string EvaluateCommandWithRspfile(const Edge* edge,
rspfile_content.replace(newline_index, 1, 1, ' ');
++newline_index;
}
- command.replace(index - 1, rspfile.length() + 1, rspfile_content);
+ if (command[index - 1] == '@')
+ command.replace(index - 1, rspfile.length() + 1, rspfile_content);
+ else if (command.find("-f ") == index - 3)
+ command.replace(index - 3, rspfile.length() + 3, rspfile_content);
+ else
+ command.replace(index - 14, rspfile.length() + 14, rspfile_content);
return command;
}