diff --git a/meson.build b/meson.build index cdb9e857e..9122b8d8c 100644 --- a/meson.build +++ b/meson.build @@ -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) diff --git a/meson_options.txt b/meson_options.txt index f411f4850..8762d2e31 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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, diff --git a/src/meson.build b/src/meson.build index a6db7407e..91a7b4c25 100644 --- a/src/meson.build +++ b/src/meson.build @@ -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,