aboutsummarylogtreecommitdiffstats
path: root/0034-Prevent-static-build-to-prefer-dynamic-libraries.patch
blob: 4f5f7b1ab671a92912cf2df5f38597681791d2d3 (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
From ee1d9dbd64b6123280c47b8633daf3d407f12ae6 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 3 Feb 2019 14:34:42 +0100
Subject: [PATCH 34/34] Prevent static build to prefer dynamic libraries

The static build should not attempt to link against dynamic libraries
in order to get a fully statically linked binary in the end.
---
 mkspecs/features/qt_configure.prf | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index 7ca65c92b3..48fa54a166 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -553,12 +553,12 @@ defineTest(qtConfResolveLibs) {
                 # Under Windows, we look only for static libraries, as even for DLLs
                 # one actually links against a static import library.
                 mingw {
-                    lcan += \
-                        # MinGW supports UNIX-style library naming in addition to
-                        # the MSVC style.
-                        lib$${lib}.dll.a lib$${lib}.a \
-                        # Fun fact: prefix-less libraries are also supported.
-                        $${lib}.dll.a $${lib}.a
+                    # prefer (import) libraries for dynamic linking unless we're doing a
+                    # static build where we solely rely on presence of static libraries
+                    shared {
+                        lcan += $${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_IMPORTLIB} $${lib}.$${QMAKE_EXTENSION_IMPORTLIB}
+                    }
+                    lcan += $${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_STATICLIB} $${lib}.$${QMAKE_EXTENSION_STATICLIB}
                 }
                 lcan += $${lib}.lib
             }
-- 
2.21.0