[gtk/gtk-3-24-meson: 89/94] meson.build: MSVC-Add fallback dep search for HarfBuzz



commit 20a5a3d730cb0de82e77f7dcbba4f68985685db0
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Apr 4 09:33:08 2019 +0800

    meson.build: MSVC-Add fallback dep search for HarfBuzz
    
    It seems that Meson 0.50.0 broke dependency search using CMake for
    HarfBuzz at least, so we add a workaround for it to look for the
    HarfBuzz headers and libraries manually when we couldn't find HarfBuzz
    using the pkg-config and CMake method.

 meson.build | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/meson.build b/meson.build
index 0c25957bb1..45f0d7a16a 100644
--- a/meson.build
+++ b/meson.build
@@ -409,8 +409,10 @@ epoxy_dep      = dependency('epoxy', version: epoxy_req,
                             fallback: ['libepoxy', 'libepoxy_dep'])
 atk_dep        = dependency('atk', version: atk_req,
                             fallback : ['atk', 'libatk_dep'])
-harfbuzz_dep   = dependency('harfbuzz', version: '>= 0.9', required: false,
-                            fallback: ['harfbuzz', 'libharfbuzz_dep'])
+
+# Update once Meson can have deps declared in a declarative manner or can
+# find deps properly with CMake again
+harfbuzz_dep   = dependency('harfbuzz', version: '>= 0.9', required: false)
 xkbdep         = dependency('xkbcommon', version: xkbcommon_req, required: wayland_enabled)
 iso_codes_dep  = dependency('iso-codes', required: false)
 
@@ -424,6 +426,20 @@ if os_unix
   platform_gio_dep = giounix_dep
 endif
 
+# Remove once Meson is fixed to find deps properly with CMake or
+# gains the ability to declare deps in a declarative manner
+# Fallback for HarfBuzz
+if cc.get_id() == 'msvc' and not harfbuzz_dep.found()
+  if cc.has_header('hb.h')
+    harfbuzz_dep = cc.find_library('harfbuzz', required : false)
+  endif
+endif
+
+if not harfbuzz_dep.found()
+  harfbuzz_dep   = dependency('harfbuzz', version: '>= 0.9', required: false,
+                              fallback: ['harfbuzz', 'libharfbuzz_dep'])
+endif
+
 if iso_codes_dep.found()
   cdata.set_quoted('ISO_CODES_PREFIX', iso_codes_dep.get_pkgconfig_variable('prefix'))
 else


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]