Ninja: Do not use newlines in response files with Windows GNU tools (#15439)

Since commit v2.8.11~213^2 (Ninja: Avoid LNK1170 linker error, 2013-02-01)
we generate linker response files with "$in_newline" to support a large
number of object files with the MS link.exe tool.  However, the GNU linker
on Windows does not understand the newline endings that Ninja puts in the
response files.  Switch back to "$in" for that case.
This commit is contained in:
Thomas Herz 2015-05-07 00:48:03 +02:00 committed by Brad King
parent b3de0dfe93
commit 20560e8dca
1 changed files with 6 additions and 1 deletions

View File

@ -202,7 +202,12 @@ cmNinjaNormalTargetGenerator
responseFlag += rspfile; responseFlag += rspfile;
// build response file content // build response file content
rspcontent = "$in_newline $LINK_PATH $LINK_LIBRARIES"; if (this->GetGlobalGenerator()->IsGCCOnWindows()) {
rspcontent = "$in";
} else {
rspcontent = "$in_newline";
}
rspcontent += " $LINK_PATH $LINK_LIBRARIES";
vars.Objects = responseFlag.c_str(); vars.Objects = responseFlag.c_str();
vars.LinkLibraries = ""; vars.LinkLibraries = "";
} }