From 561e8ba8870d9f18a92c886593f8b0162f98d941 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Thu, 17 Feb 2022 14:19:35 +0800 Subject: [PATCH] meson: Cleanup finding FreeType on Visual Studio Nowadays, CMake is much better supported with Meson and is a common tool on Windows (it is even an optionally-installed item for Visual Studio 2017+), so make use of that to find FreeType. The package to search for, however, is `freetype` instead of `freetype2`. --- meson.build | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/meson.build b/meson.build index 8a9400cdb..917c4d019 100644 --- a/meson.build +++ b/meson.build @@ -83,22 +83,10 @@ check_funcs = [ m_dep = cpp.find_library('m', required: false) -freetype_dep = null_dep -if not get_option('freetype').disabled() - freetype_dep = dependency('freetype2', required: false) - - if (not freetype_dep.found() and - cpp.get_id() == 'msvc' and - cpp.has_header('ft2build.h')) - freetype_dep = cpp.find_library('freetype', required: false) - endif - - if not freetype_dep.found() - # https://github.com/harfbuzz/harfbuzz/pull/2498 - freetype_dep = dependency('freetype2', required: get_option('freetype'), - default_options: ['harfbuzz=disabled']) - endif -endif +# https://github.com/harfbuzz/harfbuzz/pull/2498 +freetype_dep = dependency(cpp.get_argument_syntax() == 'msvc' ? 'freetype' : 'freetype2', + required: get_option('freetype'), + default_options: ['harfbuzz=disabled']) glib_dep = dependency('glib-2.0', required: get_option('glib')) gobject_dep = dependency('gobject-2.0', required: get_option('gobject'))