[llvm] [cmake] Support finding both static and shared zstd via FindZstd
authorMichał Górny <mgorny@gentoo.org>
Fri, 7 Oct 2022 16:42:27 +0000 (18:42 +0200)
committerMichał Górny <mgorny@gentoo.org>
Wed, 12 Oct 2022 05:14:28 +0000 (07:14 +0200)
commit56f94ede2af9a327e59fe84dbf8cbbb7bb1dfa79
treec4eed8ec0d3e2cb8c6e92050a9f914c29f6c5714
parentd3ce1339264dff3ea5571e9d5cf53d41e49a0879
[llvm] [cmake] Support finding both static and shared zstd via FindZstd

Improve the logic in FindZstd to support finding both shared and static
variants of the zstd library simultaneously.  Otherwise, if the shared
library is installed, zstd::libzstd_static is not declared at all
and CMake fails if LLVM_USE_STATIC_ZSTD is used.

Differential Revision: https://reviews.llvm.org/D135457
llvm/cmake/modules/Findzstd.cmake