windeployqt: Do not deploy insighttracker plugin by default
Qt insight's TP is using plugin type "generic" so that insight plugins can be deployed for every Qt application. As "generic" plugins are part of QtGui windeployqt deploys these if a dependency to QtGui is found. As defaulting to a deployment of insight plugins might cause confusion among users, we make deployment of these plugins explicit if the module is available. Change-Id: I9d2a8595373d5a15b7afbeaf7174226563b1cb6f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Timothée Keller <timothee.keller@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit ae7bc8803f16219b4fde93bf7312976cb28f7c2f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
8cf1b2b53a
commit
bb08829eb7
@ -188,6 +188,7 @@ struct Options {
|
|||||||
bool dryRun = false;
|
bool dryRun = false;
|
||||||
bool patchQt = true;
|
bool patchQt = true;
|
||||||
bool ignoreLibraryErrors = false;
|
bool ignoreLibraryErrors = false;
|
||||||
|
bool deployInsightTrackerPlugin = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Return binary to be deployed from folder, ignore pre-existing web engine process.
|
// Return binary to be deployed from folder, ignore pre-existing web engine process.
|
||||||
@ -454,6 +455,11 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse
|
|||||||
parser->addPositionalArgument(QStringLiteral("[files]"),
|
parser->addPositionalArgument(QStringLiteral("[files]"),
|
||||||
QStringLiteral("Binaries or directory containing the binary."));
|
QStringLiteral("Binaries or directory containing the binary."));
|
||||||
|
|
||||||
|
QCommandLineOption deployInsightTrackerOption(QStringLiteral("deploy-insighttracker"),
|
||||||
|
QStringLiteral("Deploy insight tracker plugin."));
|
||||||
|
// The option will be added to the parser if the module is available (see block below)
|
||||||
|
bool insightTrackerModuleAvailable = false;
|
||||||
|
|
||||||
OptionPtrVector enabledModuleOptions;
|
OptionPtrVector enabledModuleOptions;
|
||||||
OptionPtrVector disabledModuleOptions;
|
OptionPtrVector disabledModuleOptions;
|
||||||
const size_t qtModulesCount = qtModuleEntries.size();
|
const size_t qtModulesCount = qtModuleEntries.size();
|
||||||
@ -462,6 +468,10 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse
|
|||||||
for (const QtModule &module : qtModuleEntries) {
|
for (const QtModule &module : qtModuleEntries) {
|
||||||
const QString option = moduleNameToOptionName(module.name);
|
const QString option = moduleNameToOptionName(module.name);
|
||||||
const QString name = module.name;
|
const QString name = module.name;
|
||||||
|
if (name == u"InsightTracker") {
|
||||||
|
parser->addOption(deployInsightTrackerOption);
|
||||||
|
insightTrackerModuleAvailable = true;
|
||||||
|
}
|
||||||
const QString enabledDescription = QStringLiteral("Add ") + name + QStringLiteral(" module.");
|
const QString enabledDescription = QStringLiteral("Add ") + name + QStringLiteral(" module.");
|
||||||
CommandLineOptionPtr enabledOption(new QCommandLineOption(option, enabledDescription));
|
CommandLineOptionPtr enabledOption(new QCommandLineOption(option, enabledDescription));
|
||||||
parser->addOption(*enabledOption.data());
|
parser->addOption(*enabledOption.data());
|
||||||
@ -541,6 +551,8 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse
|
|||||||
|
|
||||||
options->patchQt = !parser->isSet(noPatchQtOption);
|
options->patchQt = !parser->isSet(noPatchQtOption);
|
||||||
options->ignoreLibraryErrors = parser->isSet(ignoreErrorOption);
|
options->ignoreLibraryErrors = parser->isSet(ignoreErrorOption);
|
||||||
|
if (insightTrackerModuleAvailable)
|
||||||
|
options->deployInsightTrackerPlugin = parser->isSet(deployInsightTrackerOption);
|
||||||
|
|
||||||
for (const QtModule &module : qtModuleEntries) {
|
for (const QtModule &module : qtModuleEntries) {
|
||||||
if (parser->isSet(*enabledModuleOptions.at(module.id)))
|
if (parser->isSet(*enabledModuleOptions.at(module.id)))
|
||||||
@ -835,7 +847,7 @@ static QString deployPlugin(const QString &plugin, const QDir &subDir,
|
|||||||
ModuleBitset *usedQtModules, const ModuleBitset &disabledQtModules,
|
ModuleBitset *usedQtModules, const ModuleBitset &disabledQtModules,
|
||||||
const QStringList &disabledPluginTypes,
|
const QStringList &disabledPluginTypes,
|
||||||
const QString &libraryLocation, const QString &infix,
|
const QString &libraryLocation, const QString &infix,
|
||||||
Platform platform)
|
Platform platform, bool deployInsightTrackerPlugin)
|
||||||
{
|
{
|
||||||
const QString subDirName = subDir.dirName();
|
const QString subDirName = subDir.dirName();
|
||||||
// Filter out disabled plugins
|
// Filter out disabled plugins
|
||||||
@ -843,6 +855,12 @@ static QString deployPlugin(const QString &plugin, const QDir &subDir,
|
|||||||
std::wcout << "Skipping plugin " << plugin << " due to skipped plugin type " << subDirName << '\n';
|
std::wcout << "Skipping plugin " << plugin << " due to skipped plugin type " << subDirName << '\n';
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
if (subDirName == u"generic" && plugin.contains(u"qinsighttracker")
|
||||||
|
&& !deployInsightTrackerPlugin) {
|
||||||
|
std::wcout << "Skipping plugin " << plugin
|
||||||
|
<< ". Use -deploy-insighttracker if you want to use it.\n";
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
const QString pluginPath = subDir.absoluteFilePath(plugin);
|
const QString pluginPath = subDir.absoluteFilePath(plugin);
|
||||||
// Deploy QUiTools plugins as is without further dependency checking.
|
// Deploy QUiTools plugins as is without further dependency checking.
|
||||||
@ -892,7 +910,8 @@ QStringList findQtPlugins(ModuleBitset *usedQtModules, const ModuleBitset &disab
|
|||||||
const QStringList &disabledPluginTypes,
|
const QStringList &disabledPluginTypes,
|
||||||
const QString &qtPluginsDirName, const QString &libraryLocation,
|
const QString &qtPluginsDirName, const QString &libraryLocation,
|
||||||
const QString &infix,
|
const QString &infix,
|
||||||
DebugMatchMode debugMatchModeIn, Platform platform, QString *platformPlugin)
|
DebugMatchMode debugMatchModeIn, Platform platform, QString *platformPlugin,
|
||||||
|
bool deployInsightTrackerPlugin)
|
||||||
{
|
{
|
||||||
if (qtPluginsDirName.isEmpty())
|
if (qtPluginsDirName.isEmpty())
|
||||||
return QStringList();
|
return QStringList();
|
||||||
@ -938,7 +957,8 @@ QStringList findQtPlugins(ModuleBitset *usedQtModules, const ModuleBitset &disab
|
|||||||
for (const QString &plugin : plugins) {
|
for (const QString &plugin : plugins) {
|
||||||
const QString pluginPath =
|
const QString pluginPath =
|
||||||
deployPlugin(plugin, subDir, usedQtModules, disabledQtModules,
|
deployPlugin(plugin, subDir, usedQtModules, disabledQtModules,
|
||||||
disabledPluginTypes, libraryLocation, infix, platform);
|
disabledPluginTypes, libraryLocation, infix, platform,
|
||||||
|
deployInsightTrackerPlugin);
|
||||||
if (!pluginPath.isEmpty()) {
|
if (!pluginPath.isEmpty()) {
|
||||||
if (isPlatformPlugin)
|
if (isPlatformPlugin)
|
||||||
*platformPlugin = subDir.absoluteFilePath(plugin);
|
*platformPlugin = subDir.absoluteFilePath(plugin);
|
||||||
@ -1406,7 +1426,8 @@ static DeployResult deploy(const Options &options, const QMap<QString, QString>
|
|||||||
// qtaccessiblequick plugin.
|
// qtaccessiblequick plugin.
|
||||||
disabled,
|
disabled,
|
||||||
options.disabledPluginTypes, qtpathsVariables.value(QStringLiteral("QT_INSTALL_PLUGINS")),
|
options.disabledPluginTypes, qtpathsVariables.value(QStringLiteral("QT_INSTALL_PLUGINS")),
|
||||||
libraryLocation, infix, debugMatchMode, options.platform, &platformPlugin);
|
libraryLocation, infix, debugMatchMode, options.platform, &platformPlugin,
|
||||||
|
options.deployInsightTrackerPlugin);
|
||||||
|
|
||||||
// Apply options flags and re-add library names.
|
// Apply options flags and re-add library names.
|
||||||
QString qtGuiLibrary;
|
QString qtGuiLibrary;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user