[llvm] fix zstd_shared detection on mingw (PR #139945)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu May 22 13:47:21 PDT 2025


================
@@ -29,11 +29,11 @@ find_package_handle_standard_args(
 )
 
 if(zstd_FOUND)
-  if(zstd_LIBRARY MATCHES "${zstd_STATIC_LIBRARY_SUFFIX}$")
+  if(zstd_LIBRARY MATCHES "${zstd_STATIC_LIBRARY_SUFFIX}$" AND NOT zstd_LIBRARY MATCHES "\\.dll\\.a$")
----------------
mstorsjo wrote:

Oh, I missed that this used `zstd_STATIC_LIBRARY_SUFFIX`, I thought it was the usual `CMAKE_STATIC_LIBRARY_SUFFIX`.

If it would be the cmake general ones, and if we'd use the variable for import library suffix, like `if (zstd_LIBRARY MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$" AND NOT zstd_LIBRARY MATCHES "${CMAKE_IMPORT_LIBRARY_SUFFIX}$")`, it'd essentially be `if (zstd_LIBRARY MATCHES ".lib$" AND  NOT zstd_LIBRARY MATCHES ".lib$")`.

But this wasn't the case, so nevermind - sorry for the detour.

https://github.com/llvm/llvm-project/pull/139945


More information about the llvm-commits mailing list