meson: add option and build system plumbing for uniscribe on Windows

Untested though.
This commit is contained in:
Tim-Philipp Müller 2018-11-12 16:56:56 +00:00 committed by Ebrahim Byagowi
parent c81290b0c1
commit b7796a5d69
3 changed files with 21 additions and 4 deletions

View File

@ -123,6 +123,20 @@ if fontconfig_dep.found()
deps += [fontconfig_dep]
endif
# uniscribe (windows) - FIXME: untested
if host_machine.system() == 'windows' and not get_option('uniscribe').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.')
endif
endif
# threads
if host_machine.system() != 'windows'
thread_dep = dependency('threads', required: false)

View File

@ -15,6 +15,8 @@ option('freetype', type: 'feature', value: 'auto',
description: 'Enable freetype interop helpers')
option('ucdn', type: 'feature', value: 'auto',
description: 'Use internal HarfBuzz-provided UCDN library')
option('uniscribe', type: 'feature', value: 'disabled',
description: 'Enable Uniscribe shaper backend (Windows only)')
# Common feature options
#option('tests', type : 'feature', value : 'auto', yield : true,

View File

@ -112,10 +112,6 @@ hb_directwrite_sources = [
'hb-directwrite.cc',
]
hb_uniscribe_sources = [
'hb-uniscribe.cc',
]
hb_icu_sources = [
'hb-icu.cc',
]
@ -179,6 +175,11 @@ if conf.get('HAVE_ICU', 0) == 1
hb_headers += hb_icu_headers
endif
if conf.get('HAVE_UNISCRIBE', 0) == 1
hb_sources += ['hb-uniscribe.cc']
hb_headers += ['hb-uniscribe.h']
endif
version = '0.' + '0'.join(meson.project_version().split('.')) + '.0'
libharfbuzz = library('harfbuzz', hb_sources,