[vlc-commits] contrib: qt: fix building for Windows
Steve Lhomme
git at videolan.org
Tue Mar 10 08:36:27 CET 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Mar 9 12:48:57 2020 +0100| [afea992cb2c337b56c4667eb62fa440acec29145] | committer: Steve Lhomme
contrib: qt: fix building for Windows
Backport a0d8fb4ac3cb7bafdb39f340055eacee4f957513 from Qt 5.15
Qt5 generates the .pc for debug and release targets even when only the release
target is selected. The debug target overwrote the release .pc files with the
wrong libraries built.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=afea992cb2c337b56c4667eb62fa440acec29145
---
...ingw-pkgconfig-file-and-dependency-naming.patch | 51 ++++++++++++++++++++++
contrib/src/qt/rules.mak | 1 +
2 files changed, 52 insertions(+)
diff --git a/contrib/src/qt/fix-mingw-pkgconfig-file-and-dependency-naming.patch b/contrib/src/qt/fix-mingw-pkgconfig-file-and-dependency-naming.patch
new file mode 100644
index 0000000000..4660f3ca76
--- /dev/null
+++ b/contrib/src/qt/fix-mingw-pkgconfig-file-and-dependency-naming.patch
@@ -0,0 +1,51 @@
+From a0d8fb4ac3cb7bafdb39f340055eacee4f957513 Mon Sep 17 00:00:00 2001
+From: Kai Pastor <dg0yt at darc.de>
+Date: Wed, 30 Jan 2019 07:36:51 +0100
+Subject: [PATCH] Fix mingw pkgconfig file and dependency naming
+
+This change adds the correct suffix to debug mode .pc filenames for
+MinGW and also to the Qt libraries listed in the `Requires` field.
+The filename adjustment fixes the accidental overwriting of release
+mode .pc files with the debug mode variant which required the wrong
+variant of the libraries when `debug_and_release` is active.
+
+Note that macOS also supports the `debug_and_release' configuration
+but may use the regular library names together with DYLD_IMAGE_SUFFIX.
+Creation of *_debug.pc files is turned off as they're identical to their
+non-debug counterparts.
+
+[ChangeLog][Platform Specific Changes][MinGW] Added a suffix to debug
+mode pkgconfig files.
+
+Task-number: QTBUG-4155
+Change-Id: I221c2dae51d7bd011836cb03945631a43180d7b5
+Reviewed-by: Kai Koehne <kai.koehne at qt.io>
+---
+ mkspecs/features/qt_module.prf | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
+index a52a4486bc5..213556904d2 100644
+--- a/mkspecs/features/qt_module.prf
++++ b/mkspecs/features/qt_module.prf
+@@ -264,7 +264,7 @@ load(qt_installs)
+ load(qt_targets)
+
+ # this builds on top of qt_common
+-!internal_module:if(unix|mingw) {
++!internal_module:if(unix|mingw):!if(darwin:debug_and_release:CONFIG(debug, debug|release)) {
+ CONFIG += create_pc
+ QMAKE_PKGCONFIG_DESTDIR = pkgconfig
+ host_build: \
+@@ -281,9 +281,9 @@ load(qt_targets)
+ QMAKE_PKGCONFIG_CFLAGS += -I${includedir}/$$section(inc, /, 1, 1)
+ }
+ QMAKE_PKGCONFIG_NAME = $$replace(TARGET, ^Qt, "Qt$$QT_MAJOR_VERSION ")
+- QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$QT_MAJOR_VERSION)
++ QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$QT_MAJOR_VERSION)$$qtPlatformTargetSuffix()
+ for(i, MODULE_DEPENDS): \
+- QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$section(QT.$${i}.VERSION, ., 0, 0))
++ QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$section(QT.$${i}.VERSION, ., 0, 0))$$qtPlatformTargetSuffix()
+ isEmpty(QMAKE_PKGCONFIG_DESCRIPTION): \
+ QMAKE_PKGCONFIG_DESCRIPTION = $$replace(TARGET, ^Qt, "Qt ") module
+ pclib_replace.match = $$lib_replace.match
diff --git a/contrib/src/qt/rules.mak b/contrib/src/qt/rules.mak
index 6bc3d01320..11fefca26b 100644
--- a/contrib/src/qt/rules.mak
+++ b/contrib/src/qt/rules.mak
@@ -37,6 +37,7 @@ endif
$(APPLY) $(SRC)/qt/0006-ANGLE-don-t-use-msvc-intrinsics-when-crosscompiling-.patch
$(APPLY) $(SRC)/qt/0007-ANGLE-remove-static-assert-that-can-t-be-evaluated-b.patch
$(APPLY) $(SRC)/qt/0008-ANGLE-disable-ANGLE_STD_ASYNC_WORKERS-when-compiling.patch
+ $(APPLY) $(SRC)/qt/fix-mingw-pkgconfig-file-and-dependency-naming.patch
ifdef HAVE_CROSS_COMPILE
$(APPLY) $(SRC)/qt/0003-allow-cross-compilation-of-angle-with-wine.patch
More information about the vlc-commits
mailing list