summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/qt_plugin.prf
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features/qt_plugin.prf')
-rw-r--r--mkspecs/features/qt_plugin.prf31
1 files changed, 29 insertions, 2 deletions
diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf
index 5efd55582d..c020bd2767 100644
--- a/mkspecs/features/qt_plugin.prf
+++ b/mkspecs/features/qt_plugin.prf
@@ -27,7 +27,13 @@ tool_plugin {
CONFIG(static, static|shared) {
isEmpty(MODULE): MODULE = $$basename(TARGET)
- MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_plugin_$${MODULE}.pri
+ mod_work_pfx = $$MODULE_QMAKE_OUTDIR/mkspecs/modules
+ force_independent: \
+ mod_inst_pfx = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst
+ else: \
+ mod_inst_pfx = $$mod_work_pfx
+ MODULE_PRI = $$mod_inst_pfx/qt_plugin_$${MODULE}.pri
+ MODULE_FWD_PRI = $$mod_work_pfx/qt_plugin_$${MODULE}.pri
!build_pass {
MODULE_PRI_CONT = \
@@ -35,8 +41,29 @@ CONFIG(static, static|shared) {
"QT_PLUGIN.$${MODULE}.EXTENDS = $$PLUGIN_EXTENDS" \
"QT_PLUGIN.$${MODULE}.CLASS_NAME = $$PLUGIN_CLASS_NAME" \
"QT_PLUGINS += $$MODULE"
-
write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.")
+ MODULE_PRI_FILES = $$MODULE_PRI
+
+ force_independent {
+
+ # Create a forwarding module .pri file
+ MODULE_FWD_PRI_CONT = \
+ "QT_PLUGIN.$${MODULE}.PATH = $$MODULE_BASE_OUTDIR/plugins" \
+ "include($$MODULE_PRI)"
+ write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error("Aborting.")
+ touch($$MODULE_FWD_PRI, $$MODULE_PRI)
+ MODULE_PRI_FILES += $$MODULE_FWD_PRI
+
+ }
+
+ # Then, inject the new module into the current cache state
+ !contains(QMAKE_INTERNAL_INCLUDED_FILES, $$MODULE_FWD_PRI): \ # before the actual include()!
+ cache(QMAKE_INTERNAL_INCLUDED_FILES, add transient, MODULE_PRI_FILES)
+ include($$MODULE_FWD_PRI)
+ for(var, $$list(TYPE EXTENDS CLASS_NAME PATH)): \
+ defined(QT_PLUGIN.$${MODULE}.$$var, var): \
+ cache(QT_PLUGIN.$${MODULE}.$$var, transient)
+ cache(QT_PLUGINS, transient)
}
pritarget.path = $$[QT_HOST_DATA]/mkspecs/modules