aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2019-05-06 11:08:25 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2019-05-07 13:51:54 +0000
commit3f80c821e939cd908651d20940fb41b2522dc199 (patch)
treee360fd470fad4a400721d369a60a6c31579769fe /share
parent694568d01a1d2480bd57a27ed2f500506f488fcb (diff)
Qt: Do not link static plugins into static libraries
Plugins should only be linked into applications and shared libraries. Change-Id: I95adc3f1f1ec8ea512e4166e78be1d9c5abb6745 Fixes: QBS-1441 Reviewed-by: Ola Røer Thorsen <ola@silentwings.no> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/module-providers/Qt/templates/QtPlugin.qbs2
-rw-r--r--share/qbs/module-providers/Qt/templates/plugin_support.qbs2
-rw-r--r--share/qbs/module-providers/Qt/templates/qml.qbs7
3 files changed, 8 insertions, 3 deletions
diff --git a/share/qbs/module-providers/Qt/templates/QtPlugin.qbs b/share/qbs/module-providers/Qt/templates/QtPlugin.qbs
index 23a6795f3..88bfa5a65 100644
--- a/share/qbs/module-providers/Qt/templates/QtPlugin.qbs
+++ b/share/qbs/module-providers/Qt/templates/QtPlugin.qbs
@@ -12,6 +12,8 @@ QtModule {
return false;
if (!isStaticLibrary)
return false;
+ if (!Qt.plugin_support.linkPlugins)
+ return false;
if (!(Qt.plugin_support.enabledPlugins || []).contains(qtModuleName))
return false;
if (!extendsModules || extendsModules.length === 0)
diff --git a/share/qbs/module-providers/Qt/templates/plugin_support.qbs b/share/qbs/module-providers/Qt/templates/plugin_support.qbs
index 13d95c383..1de923f17 100644
--- a/share/qbs/module-providers/Qt/templates/plugin_support.qbs
+++ b/share/qbs/module-providers/Qt/templates/plugin_support.qbs
@@ -1,6 +1,8 @@
Module {
// Set by user.
property varList pluginsByType
+ property bool linkPlugins: product.type
+ && (product.type.contains("application") || product.type.contains("sharedlibrary"))
// Set by Qt modules.
property stringList pluginTypes
diff --git a/share/qbs/module-providers/Qt/templates/qml.qbs b/share/qbs/module-providers/Qt/templates/qml.qbs
index 2b11abbd5..c95c0f367 100644
--- a/share/qbs/module-providers/Qt/templates/qml.qbs
+++ b/share/qbs/module-providers/Qt/templates/qml.qbs
@@ -24,12 +24,13 @@ QtModule {
readonly property string pluginListFilePathDebug: product.buildDirectory + "/plugins.list.d"
readonly property string pluginListFilePathRelease: product.buildDirectory + "/plugins.list"
+ property bool linkPlugins: isStaticLibrary && Qt.plugin_support.linkPlugins
hasLibrary: @has_library@
architectures: @archs@
targetPlatform: @targetPlatform@
- staticLibsDebug: (isStaticLibrary ? ['@' + pluginListFilePathDebug] : []).concat(@staticLibsDebug@)
- staticLibsRelease: (isStaticLibrary ? ['@' + pluginListFilePathRelease] : []).concat(@staticLibsRelease@)
+ staticLibsDebug: (linkPlugins ? ['@' + pluginListFilePathDebug] : []).concat(@staticLibsDebug@)
+ staticLibsRelease: (linkPlugins ? ['@' + pluginListFilePathRelease] : []).concat(@staticLibsRelease@)
dynamicLibsDebug: @dynamicLibsDebug@
dynamicLibsRelease: @dynamicLibsRelease@
linkerFlagsDebug: @linkerFlagsDebug@
@@ -60,7 +61,7 @@ QtModule {
}
Rule {
- condition: isStaticLibrary
+ condition: linkPlugins
multiplex: true
requiresInputs: false
inputs: ["qt.qml.qml"]