aboutsummarylogtreecommitdiffstats
path: root/0029-Hardcode-linker-flags-for-platform-plugins.patch
blob: fdf8234230b13cea2bf5cbf3e91e162428408b74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
From df61047d976e3b89140ad144e0116c9f0664e332 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Wed, 25 Jan 2017 23:42:30 +0100
Subject: [PATCH 29/32] Hardcode linker flags for platform plugins

Otherwise incorrect order of libs leads to errors
when building libqminimal.dll, libqoffscreen.dll,
libqwindows.dll and libqdirect2d.dll. Unfortunately
this workaround leads to hardcoding include flags
as well.

Change-Id: I1863d184cff744d2c02e15875e1d108d32ea7861
---
 src/plugins/platforms/direct2d/direct2d.pro   | 39 +++++++++++++++---
 src/plugins/platforms/minimal/minimal.pro     | 17 +++++++-
 src/plugins/platforms/offscreen/offscreen.pro | 16 +++++++-
 src/plugins/platforms/windows/windows.pro     | 40 ++++++++++++++-----
 4 files changed, 93 insertions(+), 19 deletions(-)

diff --git a/src/plugins/platforms/direct2d/direct2d.pro b/src/plugins/platforms/direct2d/direct2d.pro
index 6e73bd14f9d..8046e73d61d 100644
--- a/src/plugins/platforms/direct2d/direct2d.pro
+++ b/src/plugins/platforms/direct2d/direct2d.pro
@@ -1,12 +1,41 @@
 TARGET = qdirect2d
 
 QT += \
-    core-private gui-private \
-    eventdispatcher_support-private \
-    fontdatabase_support-private theme_support-private
+    core-private gui-private
 
-qtConfig(accessibility): QT += accessibility_support-private
-qtConfig(vulkan): QT += vulkan_support-private
+# Fix linker error when building libqdirect2d.dll by specifying linker flags for
+# required modules manually (otherwise order is messed)
+LIBS += \
+    $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5EventDispatcherSupport.$${QMAKE_EXTENSION_STATICLIB} \
+    $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5FontDatabaseSupport.$${QMAKE_EXTENSION_STATICLIB} \
+    $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5ThemeSupport.$${QMAKE_EXTENSION_STATICLIB} \
+    -lfreetype -lole32 -lgdi32 -luuid
+# However, this workaround leads to the necessity of specifying include dirs manually
+INCLUDEPATH += \
+    $$QT_BUILD_TREE/include/QtEventDispatcherSupport/$${QT_VERSION}/QtEventDispatcherSupport \
+    $$QT_BUILD_TREE/include/QtEventDispatcherSupport/$${QT_VERSION} \
+    $$QT_BUILD_TREE/include/QtFontDatabaseSupport/$${QT_VERSION}/QtFontDatabaseSupport \
+    $$QT_BUILD_TREE/include/QtFontDatabaseSupport/$${QT_VERSION} \
+    $$QT_BUILD_TREE/include/QtThemeSupport/$${QT_VERSION}/QtThemeSupport \
+    $$QT_BUILD_TREE/include/QtThemeSupport/$${QT_VERSION}
+# Same for private support libs for accessibility and vulkan, if those are enabled
+qtConfig(accessibility) {
+    LIBS += $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5AccessibilitySupport.$${QMAKE_EXTENSION_STATICLIB}
+    INCLUDEPATH += \
+        $$QT_BUILD_TREE/include/QtAccessibilitySupport/$${QT_VERSION}/Qt5AccessibilitySupport \
+        $$QT_BUILD_TREE/include/QtAccessibilitySupport/$${QT_VERSION}
+}
+qtConfig(vulkan) {
+    LIBS += $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5VulkanSupport.$${QMAKE_EXTENSION_STATICLIB}
+    INCLUDEPATH += \
+        $$QT_BUILD_TREE/include/QtVulkanSupport/$${QT_VERSION}/Qt5VulkanSupport \
+        $$QT_BUILD_TREE/include/QtVulkanSupport/$${QT_VERSION}
+}
+# Also add Qt5WindowsUIAutomationSupport - it seems to link against it
+LIBS += $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5WindowsUIAutomationSupport.$${QMAKE_EXTENSION_STATICLIB}
+INCLUDEPATH += \
+    $$QT_BUILD_TREE/include/Qt5WindowsUIAutomationSupport/$${QT_VERSION}/Qt5WindowsUIAutomationSupport \
+    $$QT_BUILD_TREE/include/Qt5WindowsUIAutomationSupport/$${QT_VERSION}
 
 LIBS += -ldwmapi -lversion
 QMAKE_USE_PRIVATE += gdi32 dwrite_1 d2d1_1 d3d11_1 dxgi1_2
diff --git a/src/plugins/platforms/minimal/minimal.pro b/src/plugins/platforms/minimal/minimal.pro
index a1a2da547b3..9fd5c4fca2f 100644
--- a/src/plugins/platforms/minimal/minimal.pro
+++ b/src/plugins/platforms/minimal/minimal.pro
@@ -1,8 +1,21 @@
 TARGET = qminimal
 
 QT += \
-    core-private gui-private \
-    eventdispatcher_support-private fontdatabase_support-private
+    core-private gui-private
+
+# Fix linker error when building libqminimal.dll by specifying linker flags for
+# required modules manually (otherwise order is messed)
+LIBS += \
+    $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5EventDispatcherSupport.$${QMAKE_EXTENSION_STATICLIB} \
+    $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5FontDatabaseSupport.$${QMAKE_EXTENSION_STATICLIB} \
+    -lfreetype -lole32 -lgdi32 -luuid
+# However, this workaround leads to the necessity of specifying include dirs manually
+INCLUDEPATH += \
+    $$QT_BUILD_TREE/include/QtEventDispatcherSupport/$${QT_VERSION}/QtEventDispatcherSupport \
+    $$QT_BUILD_TREE/include/QtEventDispatcherSupport/$${QT_VERSION} \
+    $$QT_BUILD_TREE/include/QtFontDatabaseSupport/$${QT_VERSION}/QtFontDatabaseSupport \
+    $$QT_BUILD_TREE/include/QtFontDatabaseSupport/$${QT_VERSION}
+
 
 DEFINES += QT_NO_FOREACH
 
diff --git a/src/plugins/platforms/offscreen/offscreen.pro b/src/plugins/platforms/offscreen/offscreen.pro
index f226132592d..592fa7406f0 100644
--- a/src/plugins/platforms/offscreen/offscreen.pro
+++ b/src/plugins/platforms/offscreen/offscreen.pro
@@ -1,8 +1,20 @@
 TARGET = qoffscreen
 
 QT += \
-    core-private gui-private \
-    eventdispatcher_support-private fontdatabase_support-private
+    core-private gui-private
+
+# Fix linker error when building libqoffscreen.dll by specifying linker flags for
+# required modules manually (otherwise order is messed)
+LIBS += \
+    $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5EventDispatcherSupport.$${QMAKE_EXTENSION_STATICLIB} \
+    $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5FontDatabaseSupport.$${QMAKE_EXTENSION_STATICLIB} \
+    -lfreetype -lole32 -lgdi32 -luuid
+# However, this workaround leads to the necessity of specifying include dirs manually
+INCLUDEPATH += \
+    $$QT_BUILD_TREE/include/QtEventDispatcherSupport/$${QT_VERSION}/QtEventDispatcherSupport \
+    $$QT_BUILD_TREE/include/QtEventDispatcherSupport/$${QT_VERSION} \
+    $$QT_BUILD_TREE/include/QtFontDatabaseSupport/$${QT_VERSION}/QtFontDatabaseSupport \
+    $$QT_BUILD_TREE/include/QtFontDatabaseSupport/$${QT_VERSION}
 
 DEFINES += QT_NO_FOREACH
 
diff --git a/src/plugins/platforms/windows/windows.pro b/src/plugins/platforms/windows/windows.pro
index 50a3bb41a92..02f74650a9b 100644
--- a/src/plugins/platforms/windows/windows.pro
+++ b/src/plugins/platforms/windows/windows.pro
@@ -1,15 +1,35 @@
 TARGET = qwindows
 
-QT += \
-    core-private gui-private \
-    eventdispatcher_support-private \
-    fontdatabase_support-private theme_support-private
-
-qtConfig(accessibility): QT += accessibility_support-private
-qtConfig(vulkan): QT += vulkan_support-private
-
-LIBS += -ldwmapi
-QMAKE_USE_PRIVATE += gdi32
+QT += core-private gui-private
+
+# Fix linker error when building libqwindows.dll by specifying linker flags for
+# required modules manually (otherwise order is messed)
+LIBS += \
+    $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5EventDispatcherSupport.$${QMAKE_EXTENSION_STATICLIB} \
+    $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5FontDatabaseSupport.$${QMAKE_EXTENSION_STATICLIB} \
+    $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5ThemeSupport.$${QMAKE_EXTENSION_STATICLIB} \
+    -lfreetype -lole32 -lgdi32 -ldwmapi
+# However, this workaround leads to the necessity of specifying include dirs manually
+INCLUDEPATH += \
+    $$QT_BUILD_TREE/include/QtEventDispatcherSupport/$${QT_VERSION}/QtEventDispatcherSupport \
+    $$QT_BUILD_TREE/include/QtEventDispatcherSupport/$${QT_VERSION} \
+    $$QT_BUILD_TREE/include/QtFontDatabaseSupport/$${QT_VERSION}/QtFontDatabaseSupport \
+    $$QT_BUILD_TREE/include/QtFontDatabaseSupport/$${QT_VERSION} \
+    $$QT_BUILD_TREE/include/QtThemeSupport/$${QT_VERSION}/QtThemeSupport \
+    $$QT_BUILD_TREE/include/QtThemeSupport/$${QT_VERSION}
+# Same for private support libs for accessibility and vulkan, if those are enabled
+qtConfig(accessibility) {
+    LIBS += $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5AccessibilitySupport.$${QMAKE_EXTENSION_STATICLIB}
+    INCLUDEPATH += \
+        $$QT_BUILD_TREE/include/QtAccessibilitySupport/$${QT_VERSION}/Qt5AccessibilitySupport \
+        $$QT_BUILD_TREE/include/QtAccessibilitySupport/$${QT_VERSION}
+}
+qtConfig(vulkan) {
+    LIBS += $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5VulkanSupport.$${QMAKE_EXTENSION_STATICLIB}
+    INCLUDEPATH += \
+        $$QT_BUILD_TREE/include/QtVulkanSupport/$${QT_VERSION}/Qt5VulkanSupport \
+        $$QT_BUILD_TREE/include/QtVulkanSupport/$${QT_VERSION}
+}
 
 include(windows.pri)
 
-- 
2.47.0