diff options
author | Liang Qi <liang.qi@qt.io> | 2016-11-04 11:27:59 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-11-04 11:30:39 +0100 |
commit | 21c61b26bfb7d6bafac848effd0a169db48ad991 (patch) | |
tree | 4506020e9c61afd641a442b71e33ef661bab847e /src/macdeployqt | |
parent | ae9472a39327ce5d5d6735308bd2aef272771391 (diff) | |
parent | b5cb222357841b8dad6fc80aa8e6e88047f20c00 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I4ee208f69bed72c480c636cb18f22fd88c02d1e5
Diffstat (limited to 'src/macdeployqt')
-rw-r--r-- | src/macdeployqt/shared/shared.cpp | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp index 47bd70e17..e57bc785d 100644 --- a/src/macdeployqt/shared/shared.cpp +++ b/src/macdeployqt/shared/shared.cpp @@ -996,6 +996,22 @@ DeploymentInfo deployQtFrameworks(const QString &appBundlePath, const QStringLis } } +QString getLibInfix(const QStringList &deployedFrameworks) +{ + QString libInfix; + foreach (const QString &framework, deployedFrameworks) { + if (framework.startsWith(QStringLiteral("QtCore"))) { + Q_ASSERT(framework.length() >= 16); + // 16 == "QtCore" + ".framework" + const int lengthOfLibInfix = framework.length() - 16; + if (lengthOfLibInfix) + libInfix = framework.mid(6, lengthOfLibInfix); + break; + } + } + return libInfix; +} + void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pluginSourcePath, const QString pluginDestinationPath, DeploymentInfo deploymentInfo, bool useDebugLibs) { @@ -1013,8 +1029,11 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl // Cocoa print support pluginList.append("printsupport/libcocoaprintersupport.dylib"); + // Check if Qt was configured with -libinfix + const QString libInfixWithFramework = getLibInfix(deploymentInfo.deployedFrameworks) + QStringLiteral(".framework"); + // Network - if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtNetwork.framework"))) { + if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtNetwork") + libInfixWithFramework)) { QStringList bearerPlugins = QDir(pluginSourcePath + QStringLiteral("/bearer")).entryList(QStringList() << QStringLiteral("*.dylib")); foreach (const QString &plugin, bearerPlugins) { if (!plugin.endsWith(QStringLiteral("_debug.dylib"))) @@ -1026,7 +1045,7 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl QStringList imagePlugins = QDir(pluginSourcePath + QStringLiteral("/imageformats")).entryList(QStringList() << QStringLiteral("*.dylib")); foreach (const QString &plugin, imagePlugins) { if (plugin.contains(QStringLiteral("qsvg"))) { - if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtSvg.framework"))) + if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtSvg") + libInfixWithFramework)) pluginList.append(QStringLiteral("imageformats/") + plugin); } else if (!plugin.endsWith(QStringLiteral("_debug.dylib"))) { pluginList.append(QStringLiteral("imageformats/") + plugin); @@ -1034,7 +1053,7 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl } // Sql plugins if QtSql.framework is in use - if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtSql.framework"))) { + if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtSql") + libInfixWithFramework)) { QStringList sqlPlugins = QDir(pluginSourcePath + QStringLiteral("/sqldrivers")).entryList(QStringList() << QStringLiteral("*.dylib")); foreach (const QString &plugin, sqlPlugins) { if (plugin.endsWith(QStringLiteral("_debug.dylib"))) @@ -1054,7 +1073,7 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl } // multimedia plugins if QtMultimedia.framework is in use - if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtMultimedia.framework"))) { + if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtMultimedia") + libInfixWithFramework)) { QStringList plugins = QDir(pluginSourcePath + QStringLiteral("/mediaservice")).entryList(QStringList() << QStringLiteral("*.dylib")); foreach (const QString &plugin, plugins) { if (!plugin.endsWith(QStringLiteral("_debug.dylib"))) @@ -1252,7 +1271,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf // 2) QtQuick.Controls is used // The intended failure mode is that libwidgetsplugin.dylib will be present // in the app bundle but not used at run-time. - if (deploymentInfo.deployedFrameworks.contains("QtWidgets.framework") && qtQuickContolsInUse) { + + // Check if Qt was configured with -libinfix + const QString libInfixWithFramework = getLibInfix(deploymentInfo.deployedFrameworks) + QStringLiteral(".framework"); + + if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtWidgets") + libInfixWithFramework) + && qtQuickContolsInUse) { LogNormal() << "Deploying QML import QtQuick.PrivateWidgets"; QString name = "QtQuick/PrivateWidgets"; QString path = qmlImportsPath + QLatin1Char('/') + name; |