Skip to content

cmake: fallback to pkgconfig if the zstd cmake config is missing#158

Merged
rtissera merged 1 commit into
rtissera:masterfrom
orbea:zstd
May 3, 2026
Merged

cmake: fallback to pkgconfig if the zstd cmake config is missing#158
rtissera merged 1 commit into
rtissera:masterfrom
orbea:zstd

Conversation

@orbea
Copy link
Copy Markdown
Contributor

@orbea orbea commented May 2, 2026

Upstream zstd only installs the zstd cmake config file when its built with cmake and several distros such as Gentoo use the official make build system instead.

This makes depending on the cmake config file unreliable and for downstream projects. Its better to fallback to using the pkgconfig file when its not found.

This solution is copied from cemu.

Upstream-Issue: facebook/zstd#3271
Source: https://github.com/cemu-project/Cemu/blob/9b76b0e2d33725d37dc8c6137d8ea2fa9b991542/cmake/Findzstd.cmake

Upstream zstd only installs the zstd cmake config file when its built
with cmake and several distros such as Gentoo use the official make
build system instead.

This makes depending on the cmake config file unreliable and for
downstream projects. Its better to fallback to using the pkgconfig file
when its not found.

This solution is copied from cemu.

Upstream-Issue: facebook/zstd#3271
Source: https://github.com/cemu-project/Cemu/blob/9b76b0e2d33725d37dc8c6137d8ea2fa9b991542/cmake/Findzstd.cmake
@rtissera
Copy link
Copy Markdown
Owner

rtissera commented May 3, 2026

Yeah, I falled into this trap a few times too.

@rtissera rtissera merged commit 25fcb10 into rtissera:master May 3, 2026
26 checks passed
@orbea orbea deleted the zstd branch May 3, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants