meson: add option and build system plumbing for DirectWrite 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 b7796a5d69
commit 83ebbe4ade
3 changed files with 17 additions and 4 deletions

View File

@ -136,6 +136,16 @@ if host_machine.system() == 'windows' and not get_option('uniscribe').disabled()
endif
endif
# DirectWrite (windows) - FIXME: untested
if host_machine.system() == 'windows' and not get_option('directwrite').disabled()
if cpp.has_header('dwrite.h')
deps += [cpp.find_library('dwrite', required: true)]
conf.set('HAVE_DIRECTWRITE', 1)
elif get_option('directwrite').enabled()
error('DirectWrite was enabled explicitly, but required header is missing.')
endif
endif
# threads
if host_machine.system() != 'windows'
thread_dep = dependency('threads', required: false)

View File

@ -17,6 +17,8 @@ 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)')
option('directwrite', type: 'feature', value: 'disabled',
description: 'Enable DirectWrite shaper backend on Windows (experimental)')
# Common feature options
#option('tests', type : 'feature', value : 'auto', yield : true,

View File

@ -108,10 +108,6 @@ hb_coretext_sources = [
'hb-coretext.cc',
]
hb_directwrite_sources = [
'hb-directwrite.cc',
]
hb_icu_sources = [
'hb-icu.cc',
]
@ -180,6 +176,11 @@ if conf.get('HAVE_UNISCRIBE', 0) == 1
hb_headers += ['hb-uniscribe.h']
endif
if conf.get('HAVE_DIRECTWRITE', 0) == 1
hb_sources += ['hb-directwrite.cc']
hb_headers += ['hb-directwrite.h']
endif
version = '0.' + '0'.join(meson.project_version().split('.')) + '.0'
libharfbuzz = library('harfbuzz', hb_sources,