aboutsummarylogtreecommitdiffstats
path: root/0022-Adjust-linker-flags-for-static-build-with-cmake-ming.patch
blob: 32a4227c546591db4d68dccafdef221d776a64b6 (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
From 089d8ff8c8306acdfa6c9c96c41498b2e5771be6 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Fri, 2 Jun 2017 16:42:07 +0200
Subject: [PATCH 22/31] Adjust linker flags for static build with
 cmake/mingw-w64

Change-Id: I33b88976d8f5ce87ce431a6f422fe87785bf5b8d
---
 src/corelib/Qt5CoreConfigExtras.cmake.in | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index 58d1d5b366..967dc64a19 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -179,3 +179,10 @@ if (ANDROID_PLATFORM)
 endif()
 
 _qt5_Core_check_file_exists(${_Qt5CTestMacros})
+
+!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
+set(_isExe $<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>)
+# INTERFACE_LINK_LIBRARIES is used to pass a linker flag '-static' and library ws2_32
+set_target_properties(${IMPORTED_TARGET_NAME} PROPERTIES \"INTERFACE_LINK_LIBRARIES\" \"$<${_isExe}:-static;ws2_32>\")
+unset(_isExe)
+!!ENDIF
-- 
2.26.1