summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/qt.prf
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features/qt.prf')
-rw-r--r--mkspecs/features/qt.prf39
1 files changed, 18 insertions, 21 deletions
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index 626cf9c809..3ccbbe7061 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -63,6 +63,8 @@ CLEAN_QT_PRIVATE = $$replace(QT_PRIVATE, -private$, _private)
qt_module_deps = $$CLEAN_QT $$CLEAN_QT_PRIVATE
all_qt_module_deps = $$resolve_depends(qt_module_deps, "QT.", ".depends" ".run_depends")
+QTPLUGIN = $$unique($$list($$lower($$QTPLUGIN)))
+
import_plugins:qtConfig(static) {
manualplugs = $$QTPLUGIN # User may specify plugins. Mostly legacy.
autoplugs = # Auto-added plugins.
@@ -132,6 +134,22 @@ import_plugins:qtConfig(static) {
}
}
+# Only link against plugins in static builds
+!isEmpty(QTPLUGIN):qtConfig(static) {
+ for (plug, QTPLUGIN) {
+ # Check if the plugin is known to Qt. We can use this to determine
+ # the plugin path. Unknown plugins must rely on the default link path.
+ plug_type = $$eval(QT_PLUGIN.$${plug}.TYPE)
+ !isEmpty(plug_type) {
+ plug_path = $$eval(QT_PLUGIN.$${plug}.PATH)
+ isEmpty(plug_path): \
+ plug_path = $$[QT_INSTALL_PLUGINS/get]
+ LIBS += -L$$plug_path/$$plug_type
+ }
+ LIBS += -l$${plug}$$qtPlatformTargetSuffix()
+ }
+}
+
# target variable, flag source variable
defineTest(qtProcessModuleFlags) {
for(flag, $$2) {
@@ -322,24 +340,3 @@ contains(all_qt_module_deps, qml): \
QMAKE_DISTCLEAN += $$QML_IMPORT_CPP
}
}
-qtConfig(static) {
- for (QTPLUG, $$list($$lower($$unique(QTPLUGIN)))) {
- # Check if the plugin is known to Qt. We can use this to determine
- # the plugin path. Unknown plugins must rely on the default link path.
- QT_PLUGINPATH = $$eval(QT_PLUGIN.$${QTPLUG}.TYPE)
-
- # Generate the plugin linker line
- QT_LINKAGE = -l$${QTPLUG}$$qtPlatformTargetSuffix()
-
- # Only link against plugin in static builds
- {
- !isEmpty(QT_PLUGINPATH) {
- plugpath = $$eval(QT_PLUGIN.$${QTPLUG}.PATH)
- isEmpty(plugpath): \
- plugpath = $$[QT_INSTALL_PLUGINS/get]
- LIBS *= -L$$plugpath/$$QT_PLUGINPATH
- }
- LIBS += $$QT_LINKAGE
- }
- }
-}