blob: a83bc5f8922e99efde4ffa5c88a016dc1a70247a (
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
38
39
40
|
From bcb48a193109d94c8d288ec81443c597181c6cae Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Tue, 7 Nov 2023 23:58:54 +0100
Subject: [PATCH 12/18] Allow overriding preference for shared libzstd library
As of 3f45905953d57e0174059d7d9d6bc75c3c1c406c Qt prefers the shared zstd
library. This breaks static builds. With this change the static library is
preferred again when CMAKE_FIND_LIBRARY_SUFFIXES_OVERRIDE is set (which is
done by the CMake toolchain file used by Arch Linux mingw-w64 packaging).
Change-Id: I42972676a23e88346d8e34d4df27a58625ace52d
---
cmake/FindWrapZSTD.cmake | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/cmake/FindWrapZSTD.cmake b/cmake/FindWrapZSTD.cmake
index 310f6cf9603..534bfa99b3a 100644
--- a/cmake/FindWrapZSTD.cmake
+++ b/cmake/FindWrapZSTD.cmake
@@ -28,12 +28,13 @@ include(FindPackageHandleStandardArgs)
if(TARGET zstd::libzstd_static OR TARGET zstd::libzstd_shared OR TARGET zstd::libzstd)
find_package_handle_standard_args(WrapZSTD
REQUIRED_VARS zstd_VERSION VERSION_VAR zstd_VERSION)
- if(TARGET zstd::libzstd_shared)
+ if ((CMAKE_FIND_LIBRARY_SUFFIXES_OVERRIDE AND TARGET zstd::libzstd_static)
+ OR (NOT TARGET zstd::libzstd_shared AND NOT TARGET zstd::libzstd))
+ set(zstdtargetsuffix "_static")
+ elseif(TARGET zstd::libzstd_shared)
set(zstdtargetsuffix "_shared")
- elseif(TARGET zstd::libzstd)
- set(zstdtargetsuffix "")
else()
- set(zstdtargetsuffix "_static")
+ set(zstdtargetsuffix "")
endif()
if(NOT TARGET WrapZSTD::WrapZSTD)
--
2.47.1
|