diff options
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/meson.build b/meson.build index 4724bf5cc..738e447d4 100644 --- a/meson.build +++ b/meson.build @@ -332,17 +332,30 @@ if get_option('jpeg') and not native_windows_loaders jpeg_dep = cc.find_library('libjpeg', required: false) endif - if not jpeg_dep.found() - jpeg_dep = dependency('libjpeg', required: false, fallback: 'libjpeg') + if jpeg_dep.found() + enabled_loaders += 'jpeg' + loaders_deps += jpeg_dep endif + endif + + # If we couldn't find libjpeg in our include/linker paths, + # then use pkg-config, and if that fails, fall back to the + # wrap + if not enabled_loaders.contains('jpeg') + jpeg_dep = dependency('libjpeg', required: false, fallback: 'libjpeg') - if jpeg_dep.found() and cc.has_function('jpeg_destroy_decompress', dependencies: jpeg_dep) + if jpeg_dep.found() enabled_loaders += 'jpeg' loaders_deps += jpeg_dep + endif + endif + + if jpeg_dep.found() + has_destroy_decompress = cc.has_function('jpeg_destroy_decompress', dependencies: jpeg_dep) + has_simple_progression = cc.has_function('jpeg_simple_progression', dependencies: jpeg_dep) - gdk_pixbuf_conf.set('HAVE_PROGRESSIVE_JPEG', - cc.has_function('jpeg_simple_progression', - dependencies: jpeg_dep)) + if has_destroy_decompress and has_simple_progression + gdk_pixbuf_conf.set('HAVE_PROGRESSIVE_JPEG', has_simple_progression) endif endif endif |