From 4d0b57afef7bf8c728c4baff1d36d78aa34868a8 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 21 Mar 2022 16:40:46 +0800 Subject: build: Clean up libjpeg/libjpeg-turbo search Like wat we did for libpng, do likewise to look for libjpeg (or libjpeg-turbo) via CMake's builtin support, so that we can clean up the build files and have CMake do a more comprehensive manual search for libjpeg or libjpeg-turbo. --- meson.build | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 80b699a8f..018c2c132 100644 --- a/meson.build +++ b/meson.build @@ -294,16 +294,7 @@ endif # Don't check and build the jpeg loader if native_windows_loaders is true jpeg_opt = get_option('jpeg') if not jpeg_opt.disabled() and not native_windows_loaders - jpeg_dep = dependency('libjpeg', required: false) - - if not jpeg_dep.found() and cc.has_header('jpeglib.h') - jpeg_dep = cc.find_library('jpeg', required: false) - if cc.get_id() == 'msvc' and not jpeg_dep.found() - # The IJG JPEG library builds the .lib file as libjpeg.lib in its MSVC build system, - # so look for it as well when jpeg.lib cannot be found - jpeg_dep = cc.find_library('libjpeg', required: false) - endif - endif + jpeg_dep = dependency(is_msvc_like ? 'jpeg' : 'libjpeg', required: false) # Finally, look for the dependency in a fallback if not jpeg_dep.found() -- cgit v1.2.1