]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
meson: Call meson.override_dependency() if Meson is new enough 4472/head
authorBenjamin Gilbert <bgilbert@backtick.net>
Thu, 28 Aug 2025 23:50:34 +0000 (18:50 -0500)
committerBenjamin Gilbert <bgilbert@backtick.net>
Thu, 28 Aug 2025 23:50:34 +0000 (18:50 -0500)
This tells Meson that we intend libzstd_dep to be used by a parent project
if the parent looks for a dependency named "libzstd".  Without this, the
mapping from "libzstd" to our variable libzstd_dep must be encoded in the
Meson wrap file or in the parent's meson.build.

build/meson/lib/meson.build

index d086fc2d74595cd3e5e3b03e504342fe91a0ae1b..81fc313f954c12f44194b83d9728ff94b93a1064 100644 (file)
@@ -127,6 +127,10 @@ libzstd = library('zstd',
 libzstd_dep = declare_dependency(link_with: libzstd,
   include_directories: join_paths(zstd_rootdir,'lib')) # Do not expose private headers
 
+if meson.version().version_compare('>=0.54.0')
+  meson.override_dependency('libzstd', libzstd_dep)
+endif
+
 # we link to both:
 # - the shared library (for public symbols)
 # - the static library (for private symbols)