meson: better errors for image loader deps

Helps people avoid libjpeg or libwebp if they don't want them.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
dev
Pekka Paalanen 6 years ago
parent d64649b56b
commit 4da8141255
  1. 11
      shared/meson.build

@ -45,14 +45,21 @@ endif
if get_option('image-jpeg')
dep_libjpeg = dependency('libjpeg', required: false)
if not dep_libjpeg.found()
dep_libjpeg = cc.find_library('jpeg')
dep_libjpeg = cc.find_library('jpeg', required: false)
endif
if not dep_libjpeg.found()
error('JPEG image loading requires libjpeg or jpeg, neither was found. Or, you can use \'-Dimage-jpeg=false\'.')
endif
deps_cairo_shared += dep_libjpeg
config_h.set('HAVE_JPEG', '1')
endif
if get_option('image-webp')
deps_cairo_shared += dependency('libwebp')
dep_webp = dependency('libwebp', required: false)
if not dep_webp.found()
error('WEBP image loading requires libwebp which was not found. Or, you can use \'-Dimage-webp=false\'.')
endif
deps_cairo_shared += dep_webp
config_h.set('HAVE_WEBP', '1')
endif

Loading…
Cancel
Save