From 704b6bac13cc35322f3febbec47503c8ddb09b47 Mon Sep 17 00:00:00 2001 From: Kavindra Palaraja Date: Fri, 12 Apr 2019 16:07:59 +0200 Subject: doc: Explain how qmake finds for files included in your source code Task-number: QTBUG-26651 Change-Id: Icc09e3272fcec8af0c33d79655159d13183c66ce Reviewed-by: Joerg Bornemann --- qmake/doc/src/qmake-manual.qdoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qmake') diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index 48ca96ae92..b271abcee3 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -1154,8 +1154,9 @@ \target DEPENDPATH \section1 DEPENDPATH - Specifies a list of all directories to look in to resolve dependencies. This - variable is used when crawling through \c included files. + Specifies a list of directories for qmake to scan, to resolve dependencies. + This variable is used when qmake crawls through the header files that you + \c{#include} in your source code. \target DESTDIR \section1 DESTDIR -- cgit v1.2.3 From 14aa1f7d6ffea29647557f98e654355782f55e66 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 20 May 2019 17:02:05 +0200 Subject: Use appropriate encoding rather than UTF-8 when reading from a pipe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The qmake code to read output from dependency-generation was adding QByteArray values to a QString, thereby tacitly converting from UTF-8; this is misguided. Hopefully, the command emits its output in the same local 8-bit encoding that QString knows to convert from. Simplified needlessly verbose loops (that violated Qt coding style) in the process. Fixes: QTBUG-75904 Change-Id: I27cf81ffcb63ebc999b8e4fc57abdb9a68c4d2b3 Reviewed-by: Jörg Bornemann --- qmake/generators/makefile.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index e9dccf0c46..d53dbf9fa5 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2002,14 +2002,11 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) 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(), QT_POPEN_READ)) { - QString indeps; - while(!feof(proc)) { - int read_in = (int)fread(buff, 1, 255, proc); - if(!read_in) - break; - indeps += QByteArray(buff, read_in); - } + QByteArray depData; + while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc)) + depData.append(buff, read_in); QT_PCLOSE(proc); + const QString indeps = QString::fromLocal8Bit(depData); if(!indeps.isEmpty()) { QDir outDir(Option::output_dir); QStringList dep_cmd_deps = splitDeps(indeps, dep_lines); @@ -2090,14 +2087,11 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) 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(), QT_POPEN_READ)) { - QString indeps; - while(!feof(proc)) { - int read_in = (int)fread(buff, 1, 255, proc); - if(!read_in) - break; - indeps += QByteArray(buff, read_in); - } + QByteArray depData; + while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc)) + depData.append(buff, read_in); QT_PCLOSE(proc); + const QString indeps = QString::fromLocal8Bit(depData); if(!indeps.isEmpty()) { QDir outDir(Option::output_dir); QStringList dep_cmd_deps = splitDeps(indeps, dep_lines); -- cgit v1.2.3