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`.
This commit is contained in:
Chun-wei Fan 2022-02-17 14:19:35 +08:00
parent 5de67c8961
commit 561e8ba887
1 changed files with 4 additions and 16 deletions

View File

@ -83,22 +83,10 @@ check_funcs = [
m_dep = cpp.find_library('m', required: false) m_dep = cpp.find_library('m', required: false)
freetype_dep = null_dep # https://github.com/harfbuzz/harfbuzz/pull/2498
if not get_option('freetype').disabled() freetype_dep = dependency(cpp.get_argument_syntax() == 'msvc' ? 'freetype' : 'freetype2',
freetype_dep = dependency('freetype2', required: false) required: get_option('freetype'),
default_options: ['harfbuzz=disabled'])
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
glib_dep = dependency('glib-2.0', required: get_option('glib')) glib_dep = dependency('glib-2.0', required: get_option('glib'))
gobject_dep = dependency('gobject-2.0', required: get_option('gobject')) gobject_dep = dependency('gobject-2.0', required: get_option('gobject'))