Dear Maintainer, The main branch of llvm-project (milestone: 16.0.0) defaults LLVM_ENABLE_ZSTD to on and searches for zstd's cmake files. Since libzstd-dev does not provide cmake files like zstdConfig.cmake, llvm-project does not have support for zstd compressed debug sections. (Search ZSTD on https://github.com/llvm/llvm-project/blob/main/llvm/cmake/config-ix.cmake) The issue applies to many other packages using CMake and find_package(zstd): they can't make use of the system zstd. zstd has provided build/cmake for a long time (since around 2016). If one builds zstd with cmake, cmake files like zstdConfig.cmake will be available. See https://github.com/archlinux/svntogit-packages/blob/packages/zstd/trunk/PKGBUILD#L36 for a configure example. Reproducible: Always
The problem is CMake is not an official build system for zstd (nor is meson), so I'm reluctant to use it. Other distros may not be using it either (at last check, some went *back* to the makefiles after the "time/benchmark scandal": https://www.phoronix.com/news/Arch-Linux-Bizarre-Zstd (even though it was harmless in the end)).
I suggest LLVM falls back to pkg_check_modules given the config files' existence can't be assumed.
fwiw pcsx2 uses the cmake files too, but I too had mixed feelings about this, so I never opened an issue here and made it use alias_library(Zstd::Zstd PkgConfig::zstd) for now. Pretty sure many distros skip this file as well so I find it amazing it's being relied on, albeit in pcsx2's case they bundle zstd and use it via cmake themselves making the whole thing a bit awkward.
sci-libs/miopen-6.0.2 also wants zstdConfig.cmake, zstd-config.cmake or Findzstd.cmake (note: in lowercase) as optional dependency.