From 88086ea91aa19dc8b8a20b0e560d593cbd9f45e2 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Fri, 12 Apr 2019 18:08:36 +0800 Subject: [PATCH] meson: Only use HarfBuzz fallback when needed The current Meson releases have broken CMake support, meaning that it is likely that HarfBuzz could not be located for Visual Studio builds unless one handcrafts pkg-config files for it, which is both tedious and error-prone. Instead, use the existing mechanism for looking for the HarfBuzz headers and libraries on Visual Studio first when it could not be found via dependency(), and then use the fallback if it still could not be found. --- meson.build | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 9c2142d166..ab30f90098 100644 --- a/meson.build +++ b/meson.build @@ -376,8 +376,7 @@ pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_req, epoxy_dep = dependency('epoxy', version: epoxy_req, fallback: ['libepoxy', 'libepoxy_dep']) atk_dep = dependency('atk', version: atk_req) -harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false, - fallback: ['harfbuzz', 'libharfbuzz_dep']) +harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false) xkbdep = dependency('xkbcommon', version: xkbcommon_req, required: wayland_enabled) graphene_dep = dependency('graphene-gobject-1.0', version: graphene_req, fallback: ['graphene', 'graphene_dep']) @@ -460,6 +459,11 @@ if cc.get_id() == 'msvc' endif endif +if not harfbuzz_dep.found() + harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false, + fallback: ['harfbuzz', 'libharfbuzz_dep']) +endif + cdata.set('HAVE_HARFBUZZ', harfbuzz_dep.found()) cdata.set('HAVE_PANGOFT', pangoft_dep.found())