PKGBUILDs/qt5-base/mingw-w64-static/0031-Hardcode-linker-flags-...

154 lines
5.8 KiB
Diff
Raw Normal View History

2019-04-21 22:37:50 +02:00
From c64b26908cc7cdeb19bb41fab98f328174ccfea0 Mon Sep 17 00:00:00 2001
2017-06-02 18:20:04 +02:00
From: Martchus <martchus@gmx.net>
Date: Wed, 25 Jan 2017 23:42:30 +0100
2019-02-02 18:18:25 +01:00
Subject: [PATCH 31/34] Hardcode linker flags for platform plugins
2017-06-02 18:20:04 +02:00
Otherwise incorrect order of libs leads to errors
when building libqminimal.dll, libqoffscreen.dll
and libqwindows.dll
---
2018-09-19 20:39:07 +02:00
src/plugins/platforms/direct2d/direct2d.pro | 30 ++++++++++++++---
src/plugins/platforms/minimal/minimal.pro | 15 +++++++--
src/plugins/platforms/offscreen/offscreen.pro | 14 ++++++--
src/plugins/platforms/windows/windows.pro | 32 +++++++++++++------
2018-09-19 20:39:07 +02:00
4 files changed, 73 insertions(+), 18 deletions(-)
2017-06-02 18:20:04 +02:00
2018-09-19 20:39:07 +02:00
diff --git a/src/plugins/platforms/direct2d/direct2d.pro b/src/plugins/platforms/direct2d/direct2d.pro
2019-02-02 18:18:25 +01:00
index 9764272632..7310958323 100644
2018-09-19 20:39:07 +02:00
--- a/src/plugins/platforms/direct2d/direct2d.pro
+++ b/src/plugins/platforms/direct2d/direct2d.pro
@@ -1,12 +1,32 @@
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 += \
+ -lQt5EventDispatcherSupport \
+ -lQt5FontDatabaseSupport \
+ -lQt5ThemeSupport \
+ -lfreetype -lole32 -lgdi32 -luuid
+# However, this workaround leads to the necessity of specifying include dirs manually
+INCLUDEPATH += \
+ $$QT_SOURCE_TREE/include/QtEventDispatcherSupport/$${QT_VERSION} \
+ $$QT_SOURCE_TREE/include/QtFontDatabaseSupport/$${QT_VERSION} \
+ $$QT_SOURCE_TREE/include/QtThemeSupport/$${QT_VERSION}
+# Same for private support libs for accessibility and vulkan, if those are enabled
+qtConfig(accessibility) {
+ LIBS += -lQt5AccessibilitySupport
+ INCLUDEPATH += $$QT_SOURCE_TREE/include/QtAccessibilitySupport/$${QT_VERSION}
+}
+qtConfig(vulkan) {
+ LIBS += -lQt5VulkanSupport
+ INCLUDEPATH += $$QT_SOURCE_TREE/include/QtVulkanSupport/$${QT_VERSION}
+}
+# Also add Qt5WindowsUIAutomationSupport - it seems to link against it
+LIBS += -lQt5WindowsUIAutomationSupport
+INCLUDEPATH += $$QT_SOURCE_TREE/include/Qt5WindowsUIAutomationSupport/$${QT_VERSION}
2019-02-02 18:18:25 +01:00
LIBS += -ldwmapi -lversion -lgdi32
QMAKE_USE_PRIVATE += dwrite_1 d2d1_1 d3d11_1 dxgi1_2
2017-06-02 18:20:04 +02:00
diff --git a/src/plugins/platforms/minimal/minimal.pro b/src/plugins/platforms/minimal/minimal.pro
index a1a2da547b..7ef91b574d 100644
2017-06-02 18:20:04 +02:00
--- a/src/plugins/platforms/minimal/minimal.pro
+++ b/src/plugins/platforms/minimal/minimal.pro
@@ -1,8 +1,19 @@
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 += \
+ -lQt5EventDispatcherSupport \
+ -lQt5FontDatabaseSupport \
+ -lfreetype -lole32 -lgdi32 -luuid
+# However, this workaround leads to the necessity of specifying include dirs manually
+INCLUDEPATH += \
2017-06-30 22:27:38 +02:00
+ $$QT_SOURCE_TREE/include/QtEventDispatcherSupport/$${QT_VERSION} \
+ $$QT_SOURCE_TREE/include/QtFontDatabaseSupport/$${QT_VERSION}
2017-06-02 18:20:04 +02:00
+
DEFINES += QT_NO_FOREACH
diff --git a/src/plugins/platforms/offscreen/offscreen.pro b/src/plugins/platforms/offscreen/offscreen.pro
2019-03-16 16:58:50 +01:00
index 392ee8bed1..f1f266e2c2 100644
2017-06-02 18:20:04 +02:00
--- a/src/plugins/platforms/offscreen/offscreen.pro
+++ b/src/plugins/platforms/offscreen/offscreen.pro
@@ -1,8 +1,18 @@
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 += \
+ -lQt5EventDispatcherSupport \
+ -lQt5FontDatabaseSupport \
+ -lfreetype -lole32 -lgdi32 -luuid
+# However, this workaround leads to the necessity of specifying include dirs manually
+INCLUDEPATH += \
2017-06-30 22:27:38 +02:00
+ $$QT_SOURCE_TREE/include/QtEventDispatcherSupport/$${QT_VERSION} \
+ $$QT_SOURCE_TREE/include/QtFontDatabaseSupport/$${QT_VERSION}
2017-06-02 18:20:04 +02:00
DEFINES += QT_NO_FOREACH
diff --git a/src/plugins/platforms/windows/windows.pro b/src/plugins/platforms/windows/windows.pro
2017-12-08 19:49:53 +01:00
index 174bc7b609..e66488e364 100644
2017-06-02 18:20:04 +02:00
--- a/src/plugins/platforms/windows/windows.pro
+++ b/src/plugins/platforms/windows/windows.pro
2017-12-08 19:49:53 +01:00
@@ -1,14 +1,28 @@
2017-06-02 18:20:04 +02:00
TARGET = qwindows
2017-12-08 19:49:53 +01:00
-QT += \
2017-06-02 18:20:04 +02:00
- core-private gui-private \
2017-12-08 19:49:53 +01:00
- eventdispatcher_support-private \
2017-06-02 18:20:04 +02:00
- fontdatabase_support-private theme_support-private
2017-12-08 19:49:53 +01:00
-
-qtConfig(accessibility): QT += accessibility_support-private
-qtConfig(vulkan): QT += vulkan_support-private
-
2017-06-02 18:20:04 +02:00
-LIBS += -lgdi32 -ldwmapi
2017-12-08 19:49:53 +01:00
+QT += core-private gui-private
+
2017-06-02 18:20:04 +02:00
+# Fix linker error when building libqwindows.dll by specifying linker flags for
+# required modules manually (otherwise order is messed)
+LIBS += \
+ -lQt5EventDispatcherSupport \
+ -lQt5FontDatabaseSupport \
+ -lQt5ThemeSupport \
+ -lfreetype -lole32 -lgdi32 -ldwmapi
+# However, this workaround leads to the necessity of specifying include dirs manually
+INCLUDEPATH += \
2017-06-30 22:27:38 +02:00
+ $$QT_SOURCE_TREE/include/QtEventDispatcherSupport/$${QT_VERSION} \
+ $$QT_SOURCE_TREE/include/QtFontDatabaseSupport/$${QT_VERSION} \
+ $$QT_SOURCE_TREE/include/QtThemeSupport/$${QT_VERSION}
2017-12-08 19:49:53 +01:00
+# Same for private support libs for accessibility and vulkan, if those are enabled
+qtConfig(accessibility) {
+ LIBS += -lQt5AccessibilitySupport
+ INCLUDEPATH += $$QT_SOURCE_TREE/include/QtAccessibilitySupport/$${QT_VERSION}
+}
+qtConfig(vulkan) {
+ LIBS += -lQt5VulkanSupport
+ INCLUDEPATH += $$QT_SOURCE_TREE/include/QtVulkanSupport/$${QT_VERSION}
+}
2017-06-02 18:20:04 +02:00
include(windows.pri)
--
2019-03-16 16:58:50 +01:00
2.21.0
2017-06-02 18:20:04 +02:00