build: Defer defining HAVE_PANGOFT and HAVE_HARFBUZZ
authorChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 28 Mar 2018 03:32:53 +0000 (11:32 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 28 Mar 2018 14:14:32 +0000 (22:14 +0800)
We forgot to account for the case where we lookup for HarfBuzz manually
under Visual Studio builds, so only set HAVE_HARFBUZZ (and thus
HAVE_PANGOFT, since PangoFT2 depends on HarfBuzz) after we did the
fallback check for HarfBuzz.

Also, check for hb.h instead of harfbuzz/hb.h to be inline with the
pkg-config case, as the sources also include the HarfBuzz header by
using #include <hb.h>, not #include <harfbuzz/hb.h>

https://bugzilla.gnome.org/show_bug.cgi?id=773299

meson.build

index 62df80db98e63a1f6f8bcc1670b61674d183b24b..b5c4fa166e57ff372e84316bbf92e848a019533b 100644 (file)
@@ -371,9 +371,6 @@ else
   platform_gio_dep = giounix_dep
 endif
 
-cdata.set('HAVE_HARFBUZZ', harfbuzz_dep.found())
-cdata.set('HAVE_PANGOFT', pangoft_dep.found())
-
 if iso_codes_dep.found()
   cdata.set_quoted('ISO_CODES_PREFIX', iso_codes_dep.get_pkgconfig_variable('prefix'))
 else
@@ -435,12 +432,15 @@ if cc.get_id() == 'msvc'
 
   # Fallback for HarfBuzz
   if not harfbuzz_dep.found()
-    if cc.has_header('harfbuzz/hb.h')
+    if cc.has_header('hb.h')
       harfbuzz_dep = cc.find_library('harfbuzz', required : false)
     endif
   endif
 endif
 
+cdata.set('HAVE_HARFBUZZ', harfbuzz_dep.found())
+cdata.set('HAVE_PANGOFT', pangoft_dep.found())
+
 atk_pkgs = ['atk']
 
 wayland_pkgs = []