Meson: fix building with -Dspng=enabled (#2685)

And prefer to search for `spng.pc` first, since that one is
generated by Meson.
This commit is contained in:
Kleis Auke Wolthuizen 2022-02-25 16:41:21 +01:00 committed by GitHub
parent e1ad26b782
commit a67d637a3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,9 +271,9 @@ endif
# both
# - we need 0.7+ for PNG write support
# - simplify this when requiring meson>=0.60.0
spng_dep = dependency('libspng', version: '>=0.7', required: get_option('spng'))
spng_dep = dependency('spng', version: '>=0.7', required: false)
if not spng_dep.found()
spng_dep = dependency('spng', version: '>=0.7', required: get_option('spng'))
spng_dep = dependency('libspng', version: '>=0.7', required: get_option('spng'))
endif
if not get_option('spng').disabled() and spng_dep.found()
libvips_deps += spng_dep