[meson] Make harfbuzz-icu separate module optout-able

This commit is contained in:
Ebrahim Byagowi 2020-04-19 00:54:24 +04:30
parent 8ae06c9489
commit c6b3f73b09
4 changed files with 16 additions and 4 deletions

View File

@ -190,6 +190,9 @@ endif
if icu_dep.found()
conf.set('HAVE_ICU', 1)
endif
if get_option('icu-builtin')
conf.set('HAVE_ICU_BUILTIN', 1)
endif

View File

@ -26,5 +26,7 @@ option('tests', type : 'feature', value : 'auto', yield : true,
option('introspection', type : 'feature', value : 'disabled', yield : true,
description : 'Generate gobject-introspection bindings (.gir/.typelib files)')
option('icu-builtin', type: 'boolean', value: false,
description: 'Don\'t separate ICU support as harfbuzz-icu module')
option('amalgam', type : 'boolean', value : false,
description : 'Enable amalgam builds')

View File

@ -325,6 +325,15 @@ if get_option('amalgam')
hb_sources = ['harfbuzz.cc']
endif
have_icu = conf.get('HAVE_ICU', 0) == 1
have_icu_builtin = conf.get('HAVE_ICU_BUILTIN', 0) == 1
if have_icu and have_icu_builtin
hb_sources += hb_icu_sources
hb_headers += hb_icu_headers
deps += [icu_dep]
endif
# harfbuzz
gen_def = find_program('gen-def.py')
harfbuzz_def = custom_target('harfbuzz.def',
@ -485,9 +494,7 @@ pkgmod.generate(libharfbuzz_subset,
version: meson.project_version(),
)
have_icu = conf.get('HAVE_ICU', 0) == 1
if have_icu
if have_icu and not have_icu_builtin
libharfbuzz_icu = library('harfbuzz-icu', [hb_icu_sources, hb_icu_headers],
include_directories: incconfig,
dependencies: icu_dep,

View File

@ -96,7 +96,7 @@ if conf.get('HAVE_GLIB', 0) == 1
test(test_name, executable(test_name, source,
include_directories: [incconfig, incsrc],
dependencies: deps,
link_with: [libharfbuzz, libharfbuzz_icu],
link_with: have_icu_builtin ? [libharfbuzz] : [libharfbuzz, libharfbuzz_icu],
install: false,
), env: env)
endforeach