Ninja: ninja now also could read parentheses in .d files
This commit is contained in:
parent
6546086004
commit
6e6886d3bd
|
@ -580,8 +580,6 @@ static void outputDepFile(const string& dfile, const string& objfile,
|
||||||
tmp = *i;
|
tmp = *i;
|
||||||
doEscape(tmp, "\\", "/");
|
doEscape(tmp, "\\", "/");
|
||||||
doEscape(tmp, " ", "\\ ");
|
doEscape(tmp, " ", "\\ ");
|
||||||
//doEscape(tmp, "(", "\\("); // TODO ninja can't read ( and )
|
|
||||||
//doEscape(tmp, ")", "\\)");
|
|
||||||
fprintf(out, "%s \\\n", tmp.c_str());
|
fprintf(out, "%s \\\n", tmp.c_str());
|
||||||
//printf("include: %s \n", tmp.c_str());
|
//printf("include: %s \n", tmp.c_str());
|
||||||
}
|
}
|
||||||
|
@ -640,12 +638,10 @@ static int process( const string& srcfilename,
|
||||||
bool isFirstLine = true; // cl prints always first the source filename
|
bool isFirstLine = true; // cl prints always first the source filename
|
||||||
while (getline(ss, line)) {
|
while (getline(ss, line)) {
|
||||||
if (startsWith(line, prefix)) {
|
if (startsWith(line, prefix)) {
|
||||||
if (!contains(line, "(") && !contains(line, ")")) {
|
string inc = trimLeadingSpace(line.substr(prefix.size()).c_str());
|
||||||
string inc = trimLeadingSpace(line.substr(prefix.size()).c_str());
|
if (inc[inc.size() - 1] == '\r') // blech, stupid \r\n
|
||||||
if (inc[inc.size() - 1] == '\r') // blech, stupid \r\n
|
inc = inc.substr(0, inc.size() - 1);
|
||||||
inc = inc.substr(0, inc.size() - 1);
|
includes.push_back(inc);
|
||||||
includes.push_back(inc);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (!isFirstLine || !startsWith(line, srcfilename)) {
|
if (!isFirstLine || !startsWith(line, srcfilename)) {
|
||||||
if (!quiet) {
|
if (!quiet) {
|
||||||
|
|
Loading…
Reference in New Issue