From bac2b0ef369503a9f00c503c1d8c5b12a496c3eb Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 9 May 2019 10:42:03 +0200 Subject: qmake: Escape trailing backslash for OBJECTS_DIR for MinGW qmake automatically appends a dir_sep to a few directory paths (see MakefileGenerator::initOutPaths), and various .pri and .prf files rely on that. Anyhow, for non-MSys MinGW on Windows this creates a problem, because mingw32-make will interpret the backslash in OBJECTS_DIR = some_path\ to escape the following newline. We have been working around this problem in various ways: - winmakefile.cpp just removes the trailing \ for OBJECTS_DIR, at the cost of not being compatible with logic in .prf/.pri files that rely on the separator. - winmakefile.cpp adds a '#avoid trailing-slash linebreak' comment for DESTDIR. Anyhow, this does not seem to work for mingw32-make: If you reference $(DESTDIR), the variable will contain trailing spaces. - unixmakefile2.cpp duplicates a trailing \ for DESTDIR. The last approach is now taken also for OBJECTS_DIR. Task-number: QTBUG-75257 Change-Id: Ie8171a990a9ce1cfbf1b94037252ef2392313338 Reviewed-by: Joerg Bornemann --- qmake/generators/unix/unixmake2.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'qmake/generators') diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 7d8c70ec3b..b9de61fbc7 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -169,6 +169,16 @@ static QString rfc1034Identifier(const QString &str) return s; } +static QString escapeDir(const QString &dir) +{ + // When building on non-MSys MinGW, the path ends with a backslash, which + // GNU make will interpret that as a line continuation. Doubling the backslash + // avoids the problem, at the cost of the variable containing *both* backslashes. + if (dir.endsWith('\\')) + return dir + '\\'; + return dir; +} + void UnixMakefileGenerator::writeMakeParts(QTextStream &t) { @@ -231,7 +241,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "####### Output directory\n\n"; // This is used in commands by some .prf files. if (! project->values("OBJECTS_DIR").isEmpty()) - t << "OBJECTS_DIR = " << fileVar("OBJECTS_DIR") << endl; + t << "OBJECTS_DIR = " << escapeDir(fileVar("OBJECTS_DIR")) << endl; else t << "OBJECTS_DIR = ./\n"; t << endl; @@ -277,13 +287,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " " << fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl; t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl; - QString destd = fileVar("DESTDIR"); - // When building on non-MSys MinGW, the path ends with a backslash, which - // GNU make will interpret that as a line continuation. Doubling the backslash - // avoids the problem, at the cost of the variable containing *both* backslashes. - if (destd.endsWith('\\')) - destd += '\\'; - t << "DESTDIR = " << destd << endl; + t << "DESTDIR = " << escapeDir(fileVar("DESTDIR")) << endl; t << "TARGET = " << fileVar("TARGET") << endl; if(project->isActiveConfig("plugin")) { t << "TARGETD = " << fileVar("TARGET") << endl; -- cgit v1.2.3 From 085d1335d16210467cbd29f44e046a0f5fe8970f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 28 May 2019 13:22:39 +0200 Subject: Warn about invalid SUBDIRS content Invalid SUBDIRS values like SUBDIRS += foo \ bar \ \ baz would produce a Makefile with a sub-- target that will call the make on the same Makefile again recursively, letting make run forever. Ignore values like this and print a warning message. Fixes: QTBUG-76068 Change-Id: I6ca0f8c8238249f1be02d8c311b4c148fd80e707 Reviewed-by: Oliver Wolff --- qmake/generators/makefile.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'qmake/generators') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index d53dbf9fa5..bfef31f17e 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2400,8 +2400,15 @@ MakefileGenerator::findSubDirsSubTargets() const st->profile = file; } } else { - if(!file.isEmpty() && !project->isActiveConfig("subdir_first_pro")) - st->profile = file.section(Option::dir_sep, -1) + Option::pro_ext; + if (!file.isEmpty() && !project->isActiveConfig("subdir_first_pro")) { + const QString baseName = file.section(Option::dir_sep, -1); + if (baseName.isEmpty()) { + warn_msg(WarnLogic, "Ignoring invalid SUBDIRS entry %s", + subdirs[subdir].toLatin1().constData()); + continue; + } + st->profile = baseName + Option::pro_ext; + } st->in_directory = file; } while(st->in_directory.endsWith(Option::dir_sep)) -- cgit v1.2.3 From 68866b1a7bcade79e425f609fc1680203b89112e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 31 May 2019 10:22:44 +0200 Subject: Fix QMAKE_EXTRA_COMPILER names in VS projects Use the whole value of 'name', not just the first element, and also replace variables like ${QMAKE_FILE_IN}. This fixes the file_copies feature (COPIES) for Visual Studio projects, because for every entry in COPIES an extra compiler is created with a name 'COPY ${QMAKE_FILE_IN}'. Before this patch the name and the generated file filter would be just 'COPY'. However, duplicate filters are being skipped by the VS project generator. All but the first COPIES entry was ignored. Fixes: QTBUG-76010 Change-Id: Icaa5d2cb8d88ae3ef8ce86220198bca1b9e673f5 Reviewed-by: Oliver Wolff --- qmake/generators/win32/msvc_vcproj.cpp | 28 +++++++++++++++++++++------- qmake/generators/win32/msvc_vcproj.h | 2 ++ 2 files changed, 23 insertions(+), 7 deletions(-) (limited to 'qmake/generators') diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index be0b67a9e6..0115dc1313 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1524,6 +1524,18 @@ void VcprojGenerator::initDistributionFiles() vcProject.DistributionFiles.Config = &(vcProject.Configuration); } +QString VcprojGenerator::extraCompilerName(const ProString &extraCompiler, + const QStringList &inputs, + const QStringList &outputs) +{ + QString name = project->values(ProKey(extraCompiler + ".name")).join(' '); + if (name.isEmpty()) + name = extraCompiler.toQString(); + else + name = replaceExtraCompilerVariables(name, inputs, outputs, NoShell); + return name; +} + void VcprojGenerator::initExtraCompilerOutputs() { ProStringList otherFilters; @@ -1541,13 +1553,16 @@ void VcprojGenerator::initExtraCompilerOutputs() << "YACCSOURCES"; const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS"); for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) { - ProString extracompilerName = project->first(ProKey(*it + ".name")); - if (extracompilerName.isEmpty()) - extracompilerName = (*it); + const ProStringList &inputVars = project->values(ProKey(*it + ".input")); + ProStringList inputFiles; + for (auto var : inputVars) + inputFiles.append(project->values(var.toKey())); + const ProStringList &outputs = project->values(ProKey(*it + ".output")); // Create an extra compiler filter and add the files VCFilter extraCompile; - extraCompile.Name = extracompilerName.toQString(); + extraCompile.Name = extraCompilerName(it->toQString(), inputFiles.toQStringList(), + outputs.toQStringList()); extraCompile.ParseFiles = _False; extraCompile.Filter = ""; extraCompile.Guid = QString(_GUIDExtraCompilerFiles) + "-" + (*it); @@ -1560,14 +1575,14 @@ void VcprojGenerator::initExtraCompilerOutputs() if (!outputVar.isEmpty() && otherFilters.contains(outputVar)) continue; - QString tmp_out = project->first(ProKey(*it + ".output")).toQString(); + QString tmp_out = project->first(outputs.first().toKey()).toQString(); if (project->values(ProKey(*it + ".CONFIG")).indexOf("combine") != -1) { // Combined output, only one file result extraCompile.addFile(Option::fixPathToTargetOS( replaceExtraCompilerVariables(tmp_out, QString(), QString(), NoShell), false)); } else { // One output file per input - const ProStringList &tmp_in = project->values(project->first(ProKey(*it + ".input")).toKey()); + const ProStringList &tmp_in = project->values(inputVars.first().toKey()); for (int i = 0; i < tmp_in.count(); ++i) { const QString &filename = tmp_in.at(i).toQString(); if (extraCompilerSources.contains(filename) && !otherFiltersContain(filename)) @@ -1580,7 +1595,6 @@ void VcprojGenerator::initExtraCompilerOutputs() // build steps there. So, we turn it around and add it to the input files instead, // provided that the input file variable is not handled already (those in otherFilters // are handled, so we avoid them). - const ProStringList &inputVars = project->values(ProKey(*it + ".input")); for (const ProString &inputVar : inputVars) { if (!otherFilters.contains(inputVar)) { const ProStringList &tmp_in = project->values(inputVar.toKey()); diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h index 0b9770e962..e87eb733fc 100644 --- a/qmake/generators/win32/msvc_vcproj.h +++ b/qmake/generators/win32/msvc_vcproj.h @@ -73,6 +73,8 @@ protected: bool doDepends() const override { return false; } // Never necessary using Win32MakefileGenerator::replaceExtraCompilerVariables; QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &, ReplaceFor) override; + QString extraCompilerName(const ProString &extraCompiler, const QStringList &inputs, + const QStringList &outputs); bool supportsMetaBuild() override { return true; } bool supportsMergedBuilds() override { return true; } bool mergeBuildProject(MakefileGenerator *other) override; -- cgit v1.2.3 From 60136b1a846ca5aedeb588edaa178927abb002ec Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 3 Jun 2019 14:39:07 +0200 Subject: Fix meta file replacements if matches are empty QMake code like rplc.match = QMAKE_PRL_INSTALL_REPLACE += rplc led to the generation of invalid sed calls in the Makefile. It is already actively checked for empty matches, but if *all* matches are empty, the sed call looks like sed foo > bar which is invalid. Task-number: QTBUG-75901 Change-Id: I173ed99826414dcf06253a15a247f7d067ee3977 Reviewed-by: Thiago Macieira --- qmake/generators/makefile.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'qmake/generators') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index bfef31f17e..6edaf1f70e 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -3437,19 +3437,23 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt || project->isActiveConfig("no_sed_meta_install")) { ret += "-$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst); } else { - ret += "-$(SED)"; + QString sedargs; const ProStringList &replace_rules = project->values(replace_rule); for (int r = 0; r < replace_rules.size(); ++r) { const ProString match = project->first(ProKey(replace_rules.at(r) + ".match")), replace = project->first(ProKey(replace_rules.at(r) + ".replace")); if (!match.isEmpty() /*&& match != replace*/) { - ret += " -e " + shellQuote("s," + match + "," + replace + ",g"); + sedargs += " -e " + shellQuote("s," + match + "," + replace + ",g"); if (isWindowsShell() && project->first(ProKey(replace_rules.at(r) + ".CONFIG")).contains("path")) - ret += " -e " + shellQuote("s," + windowsifyPath(match.toQString()) + sedargs += " -e " + shellQuote("s," + windowsifyPath(match.toQString()) + "," + windowsifyPath(replace.toQString()) + ",gi"); } } - ret += ' ' + escapeFilePath(src) + " > " + escapeFilePath(dst); + if (sedargs.isEmpty()) { + ret += "-$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst); + } else { + ret += "-$(SED) " + sedargs + ' ' + escapeFilePath(src) + " > " + escapeFilePath(dst); + } } return ret; } -- cgit v1.2.3 From c64f8ca232cc1f2131282d9eb6279ef9b565be88 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 3 Jun 2019 14:52:49 +0200 Subject: Do not write 'Libs:' into .pc files if TEMPLATE is not 'lib' Especially for header modules we don't want a 'Libs:' entry in their .pc file. Task-number: QTBUG-75901 Change-Id: I39037d3132e39dd360532e1425f794ebec28e0bd Reviewed-by: Thiago Macieira --- qmake/generators/makefile.cpp | 74 ++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 36 deletions(-) (limited to 'qmake/generators') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 6edaf1f70e..4a99a60892 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -3359,42 +3359,44 @@ MakefileGenerator::writePkgConfigFile() if (!version.isEmpty()) t << "Version: " << version << endl; - // libs - t << "Libs: "; - QString pkgConfiglibName; - if (target_mode == TARG_MAC_MODE && project->isActiveConfig("lib_bundle")) { - if (libDir != QLatin1String("/Library/Frameworks")) - t << "-F${libdir} "; - ProString bundle; - if (!project->isEmpty("QMAKE_FRAMEWORK_BUNDLE_NAME")) - bundle = project->first("QMAKE_FRAMEWORK_BUNDLE_NAME"); - else - bundle = project->first("TARGET"); - int suffix = bundle.lastIndexOf(".framework"); - if (suffix != -1) - bundle = bundle.left(suffix); - t << "-framework "; - pkgConfiglibName = bundle.toQString(); - } else { - if (!project->values("QMAKE_DEFAULT_LIBDIRS").contains(libDir)) - t << "-L${libdir} "; - pkgConfiglibName = "-l" + project->first("QMAKE_ORIG_TARGET"); - if (project->isActiveConfig("shared")) - pkgConfiglibName += project->first("TARGET_VERSION_EXT").toQString(); - } - t << shellQuote(pkgConfiglibName) << " \n"; - - if (project->isActiveConfig("staticlib")) { - ProStringList libs; - libs << "LIBS"; // FIXME: this should not be conditional on staticlib - libs << "LIBS_PRIVATE"; - libs << "QMAKE_LIBS"; // FIXME: this should not be conditional on staticlib - libs << "QMAKE_LIBS_PRIVATE"; - libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread? - t << "Libs.private:"; - for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) - t << ' ' << fixLibFlags((*it).toKey()).join(' '); - t << endl; + if (project->first("TEMPLATE") == "lib") { + // libs + t << "Libs: "; + QString pkgConfiglibName; + if (target_mode == TARG_MAC_MODE && project->isActiveConfig("lib_bundle")) { + if (libDir != QLatin1String("/Library/Frameworks")) + t << "-F${libdir} "; + ProString bundle; + if (!project->isEmpty("QMAKE_FRAMEWORK_BUNDLE_NAME")) + bundle = project->first("QMAKE_FRAMEWORK_BUNDLE_NAME"); + else + bundle = project->first("TARGET"); + int suffix = bundle.lastIndexOf(".framework"); + if (suffix != -1) + bundle = bundle.left(suffix); + t << "-framework "; + pkgConfiglibName = bundle.toQString(); + } else { + if (!project->values("QMAKE_DEFAULT_LIBDIRS").contains(libDir)) + t << "-L${libdir} "; + pkgConfiglibName = "-l" + project->first("QMAKE_ORIG_TARGET"); + if (project->isActiveConfig("shared")) + pkgConfiglibName += project->first("TARGET_VERSION_EXT").toQString(); + } + t << shellQuote(pkgConfiglibName) << " \n"; + + if (project->isActiveConfig("staticlib")) { + ProStringList libs; + libs << "LIBS"; // FIXME: this should not be conditional on staticlib + libs << "LIBS_PRIVATE"; + libs << "QMAKE_LIBS"; // FIXME: this should not be conditional on staticlib + libs << "QMAKE_LIBS_PRIVATE"; + libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread? + t << "Libs.private:"; + for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) + t << ' ' << fixLibFlags((*it).toKey()).join(' '); + t << endl; + } } // flags -- cgit v1.2.3 From 4da47d0fba04e5d50bf6b63e73bc0de986560f42 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 3 Jun 2019 14:59:16 +0200 Subject: Make sure .pc, .prl and .la files are created for header_only modules Those modules are TEMPLATE=aux, so they weren't triggering the file creation here. To make this work properly we have to: - check for TEMPLATE aux in the right places - add a dummy target to INSTALLS to actually trigger the creation - initialize PRL_TARGET for aux templates Fixes: QTBUG-75901 Started-by: Thiago Macieira Change-Id: Idce141629dd34287808bfffd159f92ac28c6c8b1 Reviewed-by: Thiago Macieira --- qmake/generators/makefile.cpp | 3 ++- qmake/generators/unix/unixmake.cpp | 2 +- qmake/generators/unix/unixmake2.cpp | 10 +++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'qmake/generators') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 4a99a60892..caaf6e71b6 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1120,7 +1120,8 @@ MakefileGenerator::writePrlFile() && project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty() && project->isActiveConfig("create_prl") && (project->first("TEMPLATE") == "lib" - || project->first("TEMPLATE") == "vclib") + || project->first("TEMPLATE") == "vclib" + || project->first("TEMPLATE") == "aux") && (!project->isActiveConfig("plugin") || project->isActiveConfig("static"))) { //write prl file QString local_prl = prlFileName(); QString prl = fileFixify(local_prl); diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 7f42fbe09e..b809bb6c19 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -726,7 +726,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t) } } } - if(project->first("TEMPLATE") == "lib") { + if (isAux || project->first("TEMPLATE") == "lib") { QStringList types; types << "prl" << "libtool" << "pkgconfig"; for(int i = 0; i < types.size(); ++i) { diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 24215ae7b0..d9bcccf2e2 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -48,12 +48,15 @@ void UnixMakefileGenerator::writePrlFile(QTextStream &t) { MakefileGenerator::writePrlFile(t); + const ProString tmplt = project->first("TEMPLATE"); + if (tmplt != "lib" && tmplt != "aux") + return; // libtool support - if(project->isActiveConfig("create_libtool") && project->first("TEMPLATE") == "lib") { //write .la + if (project->isActiveConfig("create_libtool")) { writeLibtoolFile(); } // pkg-config support - if(project->isActiveConfig("create_pc") && project->first("TEMPLATE") == "lib") + if (project->isActiveConfig("create_pc")) writePkgConfigFile(); } @@ -1199,7 +1202,8 @@ void UnixMakefileGenerator::init2() project->values("QMAKE_FRAMEWORK_VERSION").append(project->first("VER_MAJ")); if (project->first("TEMPLATE") == "aux") { - // nothing + project->values("PRL_TARGET") = + project->values("TARGET").first().prepend(project->first("QMAKE_PREFIX_STATICLIB")); } else if (!project->values("QMAKE_APP_FLAG").isEmpty()) { if(!project->isEmpty("QMAKE_BUNDLE")) { ProString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION"); -- cgit v1.2.3 From 5f30fd64269822d4696ac071e17a39ae62a7b50f Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 5 Jun 2019 10:47:28 +0200 Subject: qmake: Cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix clang warnings that are disabled in the default build. Change-Id: I4e773a24884db94acdc6c295d3f66da07cd8a5bd Reviewed-by: Jörg Bornemann Reviewed-by: Albert Astals Cid --- qmake/generators/mac/pbuilder_pbx.cpp | 2 -- qmake/generators/makefile.cpp | 2 +- qmake/generators/makefiledeps.cpp | 2 +- qmake/generators/projectgenerator.h | 2 +- qmake/generators/win32/msvc_objectmodel.cpp | 1 + qmake/generators/win32/winmakefile.cpp | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) (limited to 'qmake/generators') diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 07832041a7..d5994639b3 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -518,7 +518,6 @@ bool ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) { ProStringList tmp; - bool did_preprocess = false; //HEADER const int pbVersion = pbuilderVersion(); @@ -736,7 +735,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) QFile mkf(mkfile); if(mkf.open(QIODevice::WriteOnly | QIODevice::Text)) { writingUnixMakefileGenerator = true; - did_preprocess = true; debug_msg(1, "pbuilder: Creating file: %s", mkfile.toLatin1().constData()); QTextStream mkt(&mkf); writeHeader(mkt); diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index caaf6e71b6..bc59eaaea2 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -900,7 +900,7 @@ MakefileGenerator::processPrlFile(QString &file, bool baseOnly) bool MakefileGenerator::processPrlFileBase(QString &origFile, const QStringRef &origName, - const QStringRef &fixedBase, int slashOff) + const QStringRef &fixedBase, int /*slashOff*/) { return processPrlFileCore(origFile, origName, fixedBase + Option::prl_ext); } diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp index 1aab1987d2..1995cf63ba 100644 --- a/qmake/generators/makefiledeps.cpp +++ b/qmake/generators/makefiledeps.cpp @@ -815,7 +815,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) break; } cpp_state = InCode; - // ... and fall through to handle buffer[x] as such. + Q_FALLTHROUGH(); // to handle buffer[x] as such. case InCode: // matching quotes (string literals and character literals) if (buffer[x] == '\'' || buffer[x] == '"') { diff --git a/qmake/generators/projectgenerator.h b/qmake/generators/projectgenerator.h index cbc9f371ab..02a331bd4f 100644 --- a/qmake/generators/projectgenerator.h +++ b/qmake/generators/projectgenerator.h @@ -43,7 +43,7 @@ protected: void init() override; bool writeMakefile(QTextStream &) override; - QString escapeFilePath(const QString &path) const override { Q_ASSERT(false); return QString(); } + QString escapeFilePath(const QString &) const override { Q_ASSERT(false); return QString(); } public: ProjectGenerator(); diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index f08554d0f5..68f62c8dda 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -1990,6 +1990,7 @@ bool VCMIDLTool::parseOption(const char* option) break; case 0x5eb7af2: // /header filename offset = 5; + Q_FALLTHROUGH(); case 0x0000358: // /h filename HeaderFileName = option + offset + 3; break; diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 208af1327f..cc612921f7 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -671,7 +671,7 @@ void Win32MakefileGenerator::writeObjectsPart(QTextStream &t) t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << endl; } -void Win32MakefileGenerator::writeImplicitRulesPart(QTextStream &t) +void Win32MakefileGenerator::writeImplicitRulesPart(QTextStream &) { } -- cgit v1.2.3