Skip to content

Commit 492971d

Browse files
committed
build: 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. More info: - QTBUG-4155 - Qt commit a0d8fb4ac3cb7bafdb39f340055eacee4f957513
1 parent 3d28c88 commit 492971d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed
Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
--- old/qtbase/mkspecs/features/qt_module.prf
22
+++ new/qtbase/mkspecs/features/qt_module.prf
3-
@@ -245,7 +245,7 @@
3+
@@ -264,7 +264,7 @@
44
load(qt_targets)
55

66
# this builds on top of qt_common
77
-!internal_module:!lib_bundle:if(unix|mingw) {
8-
+unix|mingw {
8+
+if(unix|mingw):!if(darwin:debug_and_release:CONFIG(debug, debug|release)) {
99
CONFIG += create_pc
1010
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
1111
host_build: \
12+
@@ -274,9 +274,9 @@
13+
QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]
14+
QMAKE_PKGCONFIG_CFLAGS = -I${includedir}/$$MODULE_INCNAME
15+
QMAKE_PKGCONFIG_NAME = $$replace(TARGET, ^Qt, "Qt$$QT_MAJOR_VERSION ")
16+
- QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$QT_MAJOR_VERSION)
17+
+ QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$QT_MAJOR_VERSION)$$qtPlatformTargetSuffix()
18+
for(i, MODULE_DEPENDS): \
19+
- QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$section(QT.$${i}.VERSION, ., 0, 0))
20+
+ QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$section(QT.$${i}.VERSION, ., 0, 0))$$qtPlatformTargetSuffix()
21+
isEmpty(QMAKE_PKGCONFIG_DESCRIPTION): \
22+
QMAKE_PKGCONFIG_DESCRIPTION = $$replace(TARGET, ^Qt, "Qt ") module
23+
pclib_replace.match = $$lib_replace.match

0 commit comments

Comments
 (0)