From 83ebbe4ade0c74ec83d62fcfc6ba04de87384ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 12 Nov 2018 16:56:56 +0000 Subject: [PATCH] meson: add option and build system plumbing for DirectWrite on Windows Untested though. --- meson.build | 10 ++++++++++ meson_options.txt | 2 ++ src/meson.build | 9 +++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 9122b8d8c..2dd408d40 100644 --- a/meson.build +++ b/meson.build @@ -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) diff --git a/meson_options.txt b/meson_options.txt index 8762d2e31..817a438f0 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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, diff --git a/src/meson.build b/src/meson.build index 91a7b4c25..b7f603877 100644 --- a/src/meson.build +++ b/src/meson.build @@ -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,