# libtiff: Merge branch 'upstream-zstd-config' into 'master'

**URL:** <https://discourse.libsdl.org/t/libtiff-merge-branch-upstream-zstd-config-into-master/43932>\
**Category:** SDL Commits\
**Created:** [May 25, 2023, 5:08pm UTC](https://discourse.libsdl.org/t/libtiff-merge-branch-upstream-zstd-config-into-master/43932 "2023-05-25T17:08:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [May 25, 2023, 5:08pm UTC](https://discourse.libsdl.org/t/libtiff-merge-branch-upstream-zstd-config-into-master/43932/1 "2023-05-25T17:08:26Z")

</div>

> <https://github.com/libsdl-org/libtiff/commit/7eb0f8ca764c8ff28ef8d7f61d9845f480a5abac>
>
> check if upstream zstd config was used and bind to it if so
> 
> See merge request l…ibtiff/libtiff!493

```diff
From 527208be700769e5192883f1c388481456429755 Mon Sep 17 00:00:00 2001
From: Benjamin Buch <[EMAIL REDACTED]>
Date: Wed, 24 May 2023 09:37:16 +0000
Subject: [PATCH 1/2] check if upstream zstd config was used and bind to it if
 so

---
 cmake/ZSTDCodec.cmake | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/cmake/ZSTDCodec.cmake b/cmake/ZSTDCodec.cmake
index 490d75c4..e4e6f0ea 100644
--- a/cmake/ZSTDCodec.cmake
+++ b/cmake/ZSTDCodec.cmake
@@ -31,6 +31,14 @@ set(ZSTD_USABLE FALSE)
 find_package(ZSTD)
 
 if(ZSTD_FOUND)
+ if(TARGET zstd::libzstd_static)
+ add_library(ZSTD::ZSTD ALIAS zstd::libzstd_static)
+ set(ZSTD_HAVE_DECOMPRESS_STREAM ON)
+ elseif(TARGET zstd::libzstd_shared)
+ add_library(ZSTD::ZSTD ALIAS zstd::libzstd_shared)
+ set(ZSTD_HAVE_DECOMPRESS_STREAM ON)
+ endif()
+
     if(NOT DEFINED ZSTD_HAVE_DECOMPRESS_STREAM)
       set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
       set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ZSTD_INCLUDE_DIRS})

From 211704a9e641ad4f0c0dc9d1fbf158f14b659881 Mon Sep 17 00:00:00 2001
From: Benjamin Buch <benni.buch@gmail.com>
Date: Wed, 24 May 2023 10:20:27 +0000
Subject: [PATCH 2/2] prefer shared over static

---
 cmake/ZSTDCodec.cmake | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cmake/ZSTDCodec.cmake b/cmake/ZSTDCodec.cmake
index e4e6f0ea..3fac861a 100644
--- a/cmake/ZSTDCodec.cmake
+++ b/cmake/ZSTDCodec.cmake
@@ -31,12 +31,12 @@ set(ZSTD_USABLE FALSE)
 find_package(ZSTD)
 
 if(ZSTD_FOUND)
- if(TARGET zstd::libzstd_static)
- add_library(ZSTD::ZSTD ALIAS zstd::libzstd_static)
- set(ZSTD_HAVE_DECOMPRESS_STREAM ON)
- elseif(TARGET zstd::libzstd_shared)
+ if(TARGET zstd::libzstd_shared)
         add_library(ZSTD::ZSTD ALIAS zstd::libzstd_shared)
         set(ZSTD_HAVE_DECOMPRESS_STREAM ON)
+ elseif(TARGET zstd::libzstd_static)
+ add_library(ZSTD::ZSTD ALIAS zstd::libzstd_static)
+ set(ZSTD_HAVE_DECOMPRESS_STREAM ON)
     endif()
 
     if(NOT DEFINED ZSTD_HAVE_DECOMPRESS_STREAM)

```
