summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-05-12 15:30:47 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-05 17:11:28 +0200
commit020c54daaaee6a0e4ce7de9bdf57b3ca4e8965b1 (patch)
tree395399b89e8c7ad5b35d3b5a76f7481474a8aa29 /mkspecs
parentd6525a6c1011bfec337d9403ab8cb5724dc8fdfb (diff)
fix/optimize QT_PLUGIN_PATH construction in qtAddTargetEnv()
instead of adding all possible plugin paths (for which QMAKEMODULES wouldn't have been a reliable source anyway), only add the paths of plugins of the necessary types. this necessitates that we create qt_plugin_<foo>.pri files also in shared builds of qt when making a prefix build. we don't install them unless it's a static build, though. Change-Id: Ib56b009562a7131d4dc4dfc259b34ec6581b0f77 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/qt_functions.prf20
-rw-r--r--mkspecs/features/qt_plugin.prf10
2 files changed, 18 insertions, 12 deletions
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index d41fe3b4d5..9a4d80e80f 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -253,11 +253,13 @@ defineTest(qtAddTargetEnv) {
deps = $$replace($$2, -private$, _private)
deps = $$resolve_depends(deps, "QT.", ".depends" ".private_depends" ".run_depends")
!isEmpty(deps) {
+ ptypes =
for(dep, deps) {
isEmpty(3): \
deppath += $$shell_path($$eval(QT.$${dep}.libs))
else: \
deppath += $$system_path($$eval(QT.$${dep}.libs))
+ ptypes += $$eval(QT.$${dep}.plugin_types)
}
equals(QMAKE_HOST.os, Windows) {
deppath.name = PATH
@@ -277,14 +279,16 @@ defineTest(qtAddTargetEnv) {
deppath.CONFIG = prepend
pluginpath.value =
- for(qmod, QMAKEMODULES) {
- qmod = $$section(qmod, /, 0, -3)/plugins
- exists($$qmod) {
- isEmpty(3): \
- pluginpath.value += $$shell_path($$qmod)
- else: \
- pluginpath.value += $$system_path($$qmod)
- }
+ ppaths = $$[QT_INSTALL_PLUGINS/get]
+ for(qplug, QT_PLUGINS): \
+ contains(ptypes, QT_PLUGIN.$${qplug}.TYPE): \
+ ppaths += $$eval(QT_PLUGIN.$${qplug}.PATH)
+ ppaths = $$unique(ppaths)
+ for(qplug, ppaths) {
+ isEmpty(3): \
+ pluginpath.value += $$shell_path($$qplug)
+ else: \
+ pluginpath.value += $$system_path($$qplug)
}
pluginpath.name = QT_PLUGIN_PATH
diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf
index b012278bde..8a70ce041a 100644
--- a/mkspecs/features/qt_plugin.prf
+++ b/mkspecs/features/qt_plugin.prf
@@ -24,7 +24,7 @@ tool_plugin {
contains(QT_CONFIG, build_all):CONFIG += build_all
}
-CONFIG(static, static|shared) {
+CONFIG(static, static|shared)|prefix_build {
isEmpty(MODULE): MODULE = $$basename(TARGET)
mod_work_pfx = $$MODULE_QMAKE_OUTDIR/mkspecs/modules
@@ -66,9 +66,11 @@ CONFIG(static, static|shared) {
cache(QT_PLUGINS, transient)
}
- pritarget.path = $$[QT_HOST_DATA]/mkspecs/modules
- pritarget.files = $$MODULE_PRI
- INSTALLS += pritarget
+ CONFIG(static, static|shared) {
+ pritarget.path = $$[QT_HOST_DATA]/mkspecs/modules
+ pritarget.files = $$MODULE_PRI
+ INSTALLS += pritarget
+ }
}
target.path = $$[QT_INSTALL_PLUGINS]/$$PLUGIN_TYPE