diff options
author | Mat Sutcliffe <oktal3700@gmail.com> | 2016-06-16 14:38:22 +0100 |
---|---|---|
committer | Mat Sutcliffe <oktal3700@gmail.com> | 2016-06-16 22:46:54 +0000 |
commit | 23bce6b169ca14ff72b672965ed5f89424c2d8fe (patch) | |
tree | 76558206009c5af4de4f07ea7c93b0aa1338e03a /qmake/generators/makefile.cpp | |
parent | 1e147f446a098bf17c27e744a22e535a9e21c061 (diff) |
qmake: Fix missing newlines in generated vcxproj files
A bug in the Windows C Runtime causes text mode pipes to drop newlines
sometimes. This bug was hidden because of another bug in rcc which
caused newlines to be redundantly duplicated. When the latter bug was
fixed (commit 53d5811b) the former bug was exposed, causing invalid
vcxproj files to be generated. The Windows bug is described here:
https://connect.microsoft.com/VisualStudio/feedback/details/1902345
The workaround is to avoid text mode, and do the conversion of "\r\n"
to "\n" ourselves (which we were already doing anyway).
Change-Id: I792599a4cd7822f109fa921f02207fb1b144b1d1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'qmake/generators/makefile.cpp')
-rw-r--r-- | qmake/generators/makefile.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index a596474669..d896d04e9d 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1952,7 +1952,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) char buff[256]; QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out, LocalShell); dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd); - if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) { + if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) { QString indeps; while(!feof(proc)) { int read_in = (int)fread(buff, 1, 255, proc); @@ -2044,7 +2044,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) char buff[256]; QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, out, LocalShell); dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd); - if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) { + if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) { QString indeps; while(!feof(proc)) { int read_in = (int)fread(buff, 1, 255, proc); |