import static plugins also into dlls

static plugins must be actually linked into the target whenever it is
not a static library itself.

apart from fixing qml plugin linkage, this also provides a more generic
fix for the already fixed linking of activeqt controls.

Task-number: QTBUG-28215
Task-number: QTBUG-55279
Change-Id: I9661369bf3dfc6bcf3a5ed563e6716eb3ef6e76e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
bb10
Oswald Buddenhagen 2016-12-06 17:27:50 +01:00
parent 696c3f9af8
commit 9576b71fe8
1 changed files with 6 additions and 5 deletions

View File

@ -45,6 +45,9 @@ qaxserver {
QT += axserver
}
!force_import_plugins:!contains(TEMPLATE, ".*app"):!if(contains(TEMPLATE, ".*lib"):dll): \
CONFIG -= import_plugins
# target variable, flag source variable
defineTest(qtProcessModuleFlags) {
for(flag, $$2) {
@ -191,9 +194,9 @@ qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
QMAKE_RPATHLINKDIR *= $$unique(rpaths)
}
# static builds: link qml import plugins into the app.
# static builds: link qml import plugins into the target.
contains(qt_module_deps, qml): \
qtConfig(static):contains(TEMPLATE, .*app):!host_build:!no_import_scan {
qtConfig(static):import_plugins:!host_build:!no_import_scan {
exists($$[QT_INSTALL_QML/get]): \
QMLPATHS *= $$[QT_INSTALL_QML/get]
@ -249,7 +252,7 @@ contains(qt_module_deps, qml): \
QTPLUGIN.platforms = qminimal
}
contains(TEMPLATE, .*app) {
import_plugins {
autoplugs =
for (qtmod, qt_module_deps) {
for (ptype, QT.$${qtmod}.plugin_types) {
@ -282,7 +285,6 @@ contains(TEMPLATE, .*app) {
}
qtConfig(static) {
force_import_plugins|contains(TEMPLATE, .*app) {
import_plugins:!isEmpty(QTPLUGIN) {
IMPORT_FILE_CONT = \
"// This file is autogenerated by qmake. It imports static plugin classes for" \
@ -300,7 +302,6 @@ qtConfig(static) {
GENERATED_SOURCES += $$IMPORT_CPP
QMAKE_DISTCLEAN += $$IMPORT_CPP
}
}
for (QTPLUG, $$list($$lower($$unique(QTPLUGIN)))) {
# Check if the plugin is known to Qt. We can use this to determine