From cc6b0c5750e3cbb1a8b85f626332033934c91956 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 18 Dec 2022 06:54:44 +0530 Subject: [PATCH] meson: Always look for both cmake and pkgconfig names The is_msvc_like change is wrong; it used a false correlation between "compiler being used" and "dependency method" by saying that on Windows, when building with MSVC, you will only use CMake to find png, jpeg, tiff. You can use pkgconfig to find these deps on Windows with MSVC -- when the deps have been built with Autotools or Meson (with MSVC). You can also find these deps using CMake on other platforms like macOS or Linux. The solution is simple: just search for both names on all platforms, and just search for the pkgconfig name first. --- meson.build | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/meson.build b/meson.build index cabe74c30d..a485363358 100644 --- a/meson.build +++ b/meson.build @@ -410,22 +410,17 @@ if win32_enabled pangowin32_dep = dependency('pangowin32') endif -is_msvc_like = cc.get_argument_syntax() == 'msvc' - pangocairo_dep = dependency('pangocairo', version: pango_req, fallback : ['pango', 'libpangocairo_dep']) pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_req, fallback : ['gdk-pixbuf', 'gdkpixbuf_dep'], default_options: ['png=enabled', 'jpeg=enabled', 'builtin_loaders=png,jpeg', 'man=false']) -png_dep = dependency(is_msvc_like ? 'png' : 'libpng', - fallback: ['libpng', 'libpng_dep'], - required: true) -tiff_dep = dependency(is_msvc_like ? 'tiff' : 'libtiff-4', - fallback: ['libtiff', 'libtiff4_dep'], - required: true) -jpeg_dep = dependency(is_msvc_like ? 'jpeg' : 'libjpeg', - fallback: ['libjpeg-turbo', 'jpeg_dep'], - required: true) +png_dep = dependency('libpng', 'png', + fallback: ['libpng', 'libpng_dep']) +tiff_dep = dependency('libtiff-4', 'tiff', + fallback: ['libtiff', 'libtiff4_dep']) +jpeg_dep = dependency('libjpeg', 'jpeg', + fallback: ['libjpeg-turbo', 'jpeg_dep']) epoxy_dep = dependency('epoxy', version: epoxy_req, fallback: ['libepoxy', 'libepoxy_dep']) -- 2.30.2