meson.build: support building with ICU 76

ICU 76 decided to reduce overlinking[^1] thus `icu-i18n` will no longer
add `icu-uc` when linking to shared libraries. This results in failure:
```
src/lib/icu/libicu.a.p/Converter.cxx.o: undefined reference to symbol 'ucnv_fromUnicode_76'
```

[^1]: 199bc82702
This commit is contained in:
Michael Cho 2024-10-26 10:29:53 -04:00
parent 449f8af7d0
commit 1a063fee7e
No known key found for this signature in database
GPG Key ID: 55E85E28A7CD1E85
1 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,7 @@
icu_dep = dependency('icu-i18n', version: '>= 50', required: get_option('icu')) icu_i18n_dep = dependency('icu-i18n', version: '>= 50', required: get_option('icu'))
conf.set('HAVE_ICU', icu_dep.found()) icu_uc_dep = dependency('icu-uc', version: '>= 50', required: get_option('icu'))
have_icu = icu_i18n_dep.found() and icu_uc_dep.found()
conf.set('HAVE_ICU', have_icu)
icu_sources = [ icu_sources = [
'Canonicalize.cxx', 'Canonicalize.cxx',
@ -13,7 +15,7 @@ if is_windows
endif endif
iconv_dep = [] iconv_dep = []
if icu_dep.found() if have_icu
icu_sources += [ icu_sources += [
'Init.cxx', 'Init.cxx',
'Util.cxx', 'Util.cxx',
@ -31,7 +33,8 @@ icu = static_library(
icu_sources, icu_sources,
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
icu_dep, icu_i18n_dep,
icu_uc_dep,
iconv_dep, iconv_dep,
fmt_dep, fmt_dep,
], ],