Windeployqt: also allow platform-type plugin selection

Including/excluding plugins of the platforms type did not work, since
windeployqt was only ever looking for 'qwindows'. Keep the default
behavior of deploying 'qwindows.dll', but also allow users to
add/remove platform-type plugins.

Pick-to: 6.6
Change-Id: I4062a71939224d1462896d95a2541e8caced399d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit bca41b1832bf1ce76787109456094149520bc403)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Timothée Keller 2023-11-14 17:34:33 +01:00 committed by Qt Cherry-pick Bot
parent 72c2d67250
commit 15cf52cd59

View File

@ -953,6 +953,14 @@ static QString deployPlugin(const QString &plugin, const QDir &subDir, const boo
return {};
}
// By default, only deploy qwindows.dll
if (subDirName == u"platforms"
&& !(pluginSelections.includedPlugins.contains(pluginName)
|| (pluginSelections.enabledPluginTypes.contains(subDirName)))
&& !pluginName.startsWith(u"qwindows")) {
return {};
}
const QString pluginPath = subDir.absoluteFilePath(plugin);
// If dueToModule is false, check if the user included the plugin or the entire type. In the
@ -1043,25 +1051,17 @@ QStringList findQtPlugins(ModuleBitset *usedQtModules, const ModuleBitset &disab
: debugMatchModeIn;
QDir subDir(subDirFi.absoluteFilePath());
std::wcout << "Adding in plugin type " << subDirFi.baseName() << " for module: " << qtModuleEntries.moduleById(module).name << '\n';
// Filter for platform or any.
QString filter;
const bool isPlatformPlugin = subDirName == "platforms"_L1;
if (isPlatformPlugin) {
filter = QStringLiteral("qwindows");
if (!infix.isEmpty())
filter += infix;
} else {
filter = u"*"_s;
}
const QStringList plugins =
findSharedLibraries(subDir, platform, debugMatchMode, filter);
findSharedLibraries(subDir, platform, debugMatchMode, QString());
for (const QString &plugin : plugins) {
const QString pluginPath =
deployPlugin(plugin, subDir, dueToModule, debugMatchMode, usedQtModules,
disabledQtModules, pluginSelections, libraryLocation, infix,
platform, deployInsightTrackerPlugin);
if (!pluginPath.isEmpty()) {
if (isPlatformPlugin)
if (isPlatformPlugin && plugin.startsWith(u"qwindows"))
*platformPlugin = subDir.absoluteFilePath(plugin);
result.append(pluginPath);
}