diff --git a/meson.build b/meson.build index 0b02c63b5..f67ad2d91 100644 --- a/meson.build +++ b/meson.build @@ -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 diff --git a/meson_options.txt b/meson_options.txt index a4b845bf0..78b7f7ec0 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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') diff --git a/src/meson.build b/src/meson.build index 96d4365fe..62ae6fbc2 100644 --- a/src/meson.build +++ b/src/meson.build @@ -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, diff --git a/test/api/meson.build b/test/api/meson.build index 0aba7940a..2bfea39d8 100644 --- a/test/api/meson.build +++ b/test/api/meson.build @@ -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