From: Nirbheek Chauhan Date: Sun, 18 Dec 2022 01:24:44 +0000 (+0530) Subject: meson: Always look for both cmake and pkgconfig names X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~9^2~23^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cc6b0c5750e3cbb1a8b85f626332033934c91956;p=gtk4.git 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. --- 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'])