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.
This commit is contained in:
Chun-wei Fan 2020-03-13 18:01:17 +08:00 committed by Ebrahim Byagowi
parent 9d0e6aef8a
commit 838346c54a
3 changed files with 12 additions and 6 deletions

View File

@ -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

View File

@ -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',

View File

@ -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