* meson.build, meson_option.txt: Handle new HVF driver.

(hvf): New option.
This commit is contained in:
Debbie Goldsmith 2026-03-02 07:17:27 +01:00 committed by Werner Lemberg
parent 39dab7d2cd
commit 2228a8b446
2 changed files with 36 additions and 0 deletions

View file

@ -401,6 +401,35 @@ if brotli_dep.found()
ft2_deps += [brotli_dep]
endif
# HVF support (Apple platforms only).
hvf_dep = disabler()
hvf_found = false
if not get_option('hvf').disabled()
if host_machine.system() == 'darwin'
# Check for HVF header availability.
if cc.has_header('hvf/Scaler.h')
# Find the HVF library.
hvf_dep = cc.find_library('hvf', required: get_option('hvf'))
if hvf_dep.found()
hvf_found = true
ftoption_command += ['--enable=FT_CONFIG_OPTION_HVF']
ft2_deps += [hvf_dep]
# Check for Clang compiler for runtime availability support.
if cc.get_id() == 'clang'
ft2_defines += ['-DHVF_RUNTIME_AVAILABLE=1']
endif
endif
elif get_option('hvf').enabled()
error('HVF support was enabled but hvf/Scaler.h header was not found')
endif
elif get_option('hvf').enabled()
error('HVF support is only available on Apple platforms (macOS/iOS)')
endif
endif
if get_option('error_strings')
ftoption_command += ['--enable=FT_CONFIG_OPTION_ERROR_STRINGS']
endif
@ -524,6 +553,7 @@ summary({'Zlib': zlib_option,
'Png': libpng_dep.found(),
'HarfBuzz': harfbuzz_opt,
'Brotli': brotli_dep.found(),
'HVF': hvf_found,
}, bool_yn: true, section: 'Used Libraries')
# EOF

View file

@ -53,6 +53,12 @@ option('zlib',
'disabled', 'enabled' ],
description: 'Support reading gzip-compressed font files')
option('hvf',
type: 'feature',
value: 'auto',
description: 'Support Apple Hierarchical Variable Font (HVF) format'
+ ' on Apple platforms')
option('error_strings',
type: 'boolean',
value: false,