From 7954eed96054ad012ab5b331eddd1ecde703a52a Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 19 Dec 2022 03:13:45 +0530 Subject: 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 freetype. You can use pkgconfig to find freetype on Windows with MSVC -- when it has been built with meson (msvc). You can also find freetype 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. This requires Meson 0.60 --- meson.build | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index a3103e96..78bdcb29 100644 --- a/meson.build +++ b/meson.build @@ -8,7 +8,7 @@ project('pango', 'c', 'cpp', # https://github.com/mesonbuild/meson/issues/2289 'c_std=gnu99', ], - meson_version : '>= 0.55.3') + meson_version : '>= 0.60.0') add_project_arguments([ '-D_POSIX_C_SOURCE=200809L', '-D_POSIX_THREAD_SAFE_FUNCTIONS', '-D_GNU_SOURCE', ], language: 'c') @@ -314,10 +314,7 @@ endif # The first version of freetype with a pkg-config file is 2.1.5, # CMake uses 'freetype' rather than 'freetype2' for the package name -freetype_package_name = cc.get_argument_syntax() == 'msvc' ? \ - 'freetype' : 'freetype2' - -freetype_dep = dependency(freetype_package_name, +freetype_dep = dependency('freetype2', 'freetype', required: freetype_option, fallback: ['freetype2', 'freetype_dep']) -- cgit v1.2.1