From 838346c54a332cc7acafea676b4272ab8419c9e8 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Fri, 13 Mar 2020 18:01:17 +0800 Subject: [PATCH] meson: Support GDI integration ...and supersede the configuration option uniscribe with gdi, as Uniscribe is tightly tied to GDI. This means that enabling GDI would also mean enabling Uniscribe. --- meson.build | 9 +++++---- meson_options.txt | 4 ++-- src/meson.build | 5 +++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 7b6fff499..2143d72e8 100644 --- a/meson.build +++ b/meson.build @@ -212,16 +212,17 @@ if fontconfig_dep.found() deps += [fontconfig_dep] endif -# uniscribe (windows) -if host_machine.system() == 'windows' and not get_option('uniscribe').disabled() +# GDI (uniscribe) (windows) +if host_machine.system() == 'windows' and not get_option('gdi').disabled() # TODO: make nicer once we have https://github.com/mesonbuild/meson/issues/3940 if cpp.has_header('usp10.h') and cpp.has_header('windows.h') foreach usplib : ['usp10', 'gdi32', 'rpcrt4'] deps += [cpp.find_library(usplib, required: true)] endforeach conf.set('HAVE_UNISCRIBE', 1) - elif get_option('uniscribe').enabled() - error('uniscribe was enabled explicitly, but some required headers are missing.') + conf.set('HAVE_GDI', 1) + elif get_option('gdi').enabled() + error('gdi was enabled explicitly, but some required headers are missing.') endif endif diff --git a/meson_options.txt b/meson_options.txt index e27ee30de..a4b845bf0 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -13,8 +13,8 @@ option('graphite', type: 'feature', value: 'disabled', description: 'Enable Graphite2 complementary shaper') option('freetype', type: 'feature', value: 'auto', description: 'Enable freetype interop helpers') -option('uniscribe', type: 'feature', value: 'disabled', - description: 'Enable Uniscribe shaper backend (Windows only)') +option('gdi', type: 'feature', value: 'disabled', + description: 'Enable GDI helpers and Uniscribe shaper backend (Windows only)') option('directwrite', type: 'feature', value: 'disabled', description: 'Enable DirectWrite shaper backend on Windows (experimental)') option('coretext', type: 'feature', value: 'disabled', diff --git a/src/meson.build b/src/meson.build index ac26a1255..876dca661 100644 --- a/src/meson.build +++ b/src/meson.build @@ -170,6 +170,11 @@ if conf.get('HAVE_FREETYPE', 0) == 1 hb_headers += hb_ft_headers endif +if conf.get('HAVE_GDI', 0) == 1 + hb_sources += ['hb-gdi.cc'] + hb_headers += ['hb-gdi.h'] +endif + if conf.get('HAVE_GRAPHITE2', 0) == 1 hb_sources += hb_graphite2_sources hb_headers += hb_graphite2_headers