summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorРуслан Ижбулатов <lrn1986@gmail.com>2018-01-11 17:49:43 +0000
committerChun-wei Fan <fanchunwei@src.gnome.org>2018-03-28 16:14:37 +0800
commit48613eca278ad2260bc666cde64dbab20390ea8b (patch)
tree383cbd7dccbe3bf07c0ef4c046d949db312f86e8 /meson.build
parent69e1128cd329a4a8643c6636d92494937789c3a7 (diff)
downloadgtk+-48613eca278ad2260bc666cde64dbab20390ea8b.tar.gz
Check for freetype2 version when PangoFT is used
Check for freetype2 version, because pangoft works with any version (pangoft availability does not indicate that ft2 is new enough), unlike GTK. On Windows, since pangoft is optional, we check for the presence of freetype2 .pc file first after finding that we have pangoft, and then check for FT_Get_Var_Design_Coordinates() manually by looking for the freetype headers and .lib first, and then looking for the presence of that symbol, since freetype2's Visual Studio build system does not generate a .pc file for us. https://bugzilla.gnome.org/show_bug.cgi?id=773299
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build32
1 files changed, 31 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 5831dfcbfe..62df80db98 100644
--- a/meson.build
+++ b/meson.build
@@ -313,12 +313,42 @@ cairogobj_dep = dependency('cairo-gobject', version: cairo_req, required : cc.g
pango_dep = dependency('pango', version: pango_req,
fallback : ['pango', 'libpango_dep'])
-if wayland_enabled or x11_enabled
+# Require PangoFT2 if on X11 or wayland
+require_pangoft2 = wayland_enabled or x11_enabled
+
+if require_pangoft2
pangoft_dep = dependency('pangoft2', fallback : ['pango', 'libpangoft2_dep'])
else
pangoft_dep = dependency('pangoft2', required: false)
endif
+if pangoft_dep.found()
+ # Need at least 2.7.1 for FT_Get_Var_Design_Coordinates()
+ # We get the dependency itself from pango, but pango doesn't care
+ # about ft2 version, so an extra check is needed.
+ ft2_dep = dependency('freetype2', version: '>= 2.7.1', required: require_pangoft2)
+
+ # Fallback case: Look for the FreeType2 headers and library manually when its .pc
+ # file is not available, such as on Visual Studio
+ if not ft2_dep.found()
+ ft2lib = ft2_dep
+ if cc.has_header('ft2build.h')
+ ft2_libnames = ['freetype', 'freetypemt']
+ foreach lib: ft2_libnames
+ if not ft2_dep.found()
+ ft2lib = cc.find_library(lib)
+ # If the FreeType2 library is found, check for FT_Get_Var_Design_Coordinates()
+ if ft2lib.found()
+ if cc.has_function('FT_Get_Var_Design_Coordinates', dependencies: ft2lib)
+ ft2_dep = ft2lib
+ endif
+ endif
+ endif
+ endforeach
+ endif
+ endif
+endif
+
pangocairo_dep = dependency('pangocairo', version: cairo_req,
fallback : ['pango', 'libpangocairo_dep'])
pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_req,