Skip to content

Commit

Permalink
AddTasking RSP syntax to printCompdb functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
gerioldman committed Aug 27, 2023
1 parent 22b778c commit 98bb926
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ninja.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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;
}

Expand Down

0 comments on commit 98bb926

Please sign in to comment.