add spngsave to meson build

This commit is contained in:
John Cupitt 2022-02-11 16:43:02 +00:00
parent 896cad6a7a
commit 1862e7209e
2 changed files with 19 additions and 13 deletions

View File

@ -43,6 +43,7 @@ foreign_sources = files(
'rawload.c', 'rawload.c',
'rawsave.c', 'rawsave.c',
'spngload.c', 'spngload.c',
'spngsave.c',
'svgload.c', 'svgload.c',
'tiff2vips.c', 'tiff2vips.c',
'tiff.c', 'tiff.c',

View File

@ -249,18 +249,22 @@ if libjpeg_dep.found()
endif endif
# Look for libspng first # Look for libspng first
# 0.6.1 uses "libspng.pc", git master libspng uses "spng.pc" # - it's sometimes called "spng.pc", sometimes "libspng.pc", we must search for
# We can simplify this when requiring meson>=0.60.0 # both
spng_dep = dependency('libspng', version: '>=0.6', required: false) # - 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'))
if not spng_dep.found() if not spng_dep.found()
spng_dep = dependency('spng', version: '>=0.6', required: get_option('spng')) spng_dep = dependency('spng', version: '>=0.7', required: get_option('spng'))
endif endif
if not get_option('spng').disabled() and spng_dep.found() if not get_option('spng').disabled() and spng_dep.found()
libvips_deps += spng_dep libvips_deps += spng_dep
cfg_var.set('HAVE_SPNG', '1') cfg_var.set('HAVE_SPNG', '1')
endif endif
# we can have both PNG and SPNG enabled, with SPNG for read and PNG for write # only if libspng not found
png_dep = disabler()
if not spng_dep.found()
png_dep = dependency('libpng', version: '>=1.2.9', required: get_option('png')) png_dep = dependency('libpng', version: '>=1.2.9', required: get_option('png'))
if png_dep.found() if png_dep.found()
libvips_deps += png_dep libvips_deps += png_dep
@ -269,11 +273,12 @@ if png_dep.found()
cfg_var.set('HAVE_PNG_SET_CHUNK_MALLOC_MAX', '1') cfg_var.set('HAVE_PNG_SET_CHUNK_MALLOC_MAX', '1')
endif endif
endif endif
endif
# libwebp ... target 0.6+ to reduce complication # libwebp ... target 0.6+ to reduce complication
# webp has the stuff for handling metadata in two separate libraries -- we # webp has the stuff for handling metadata in two separate libraries -- we
# insit on having all of them # insist on having both of them
libwebp_dep = dependency('libwebp', version: '>=0.6', required: get_option('png')) libwebp_dep = dependency('libwebp', version: '>=0.6', required: get_option('png'))
if libwebp_dep.found() if libwebp_dep.found()
libvips_deps += libwebp_dep libvips_deps += libwebp_dep