From: Alexey Edelev Date: Mon, 27 May 2024 09:09:05 +0000 (+0200) Subject: [PATCH] Prefer using the non-suffixed libzstd over static one X-Git-Tag: archive/raspbian/6.6.2+dfsg-10+rpi1^2~13 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=66b824bae32306d964fbcada12e2d4b514ca91af;p=qt6-base.git [PATCH] Prefer using the non-suffixed libzstd over static one Recent zstd versions provide the libstd target but not only libzstd_shared or libzstd_static. Attempt to use it as the WrapZSTD::WrapZSTD counterpart if the target exists. Task-number: QTBUG-119469 Change-Id: I47916bfa6f10883d099184a497800277c8026b14 Reviewed-by: Alexandru Croitor Gbp-Pq: Name upstream_Prefer-using-the-non-suffixed-libzstd-over-static-on.patch --- diff --git a/cmake/FindWrapZSTD.cmake b/cmake/FindWrapZSTD.cmake index fb424236..f1613543 100644 --- a/cmake/FindWrapZSTD.cmake +++ b/cmake/FindWrapZSTD.cmake @@ -25,14 +25,17 @@ find_package(zstd CONFIG QUIET) include(FindPackageHandleStandardArgs) -if(TARGET zstd::libzstd_static OR TARGET zstd::libzstd_shared) +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) set(zstdtargetsuffix "_shared") + elseif(TARGET zstd::libzstd) + set(zstdtargetsuffix "") else() set(zstdtargetsuffix "_static") endif() + if(NOT TARGET WrapZSTD::WrapZSTD) add_library(WrapZSTD::WrapZSTD INTERFACE IMPORTED) set_target_properties(WrapZSTD::WrapZSTD PROPERTIES