[meson] add icu DEFS required for compilation

In some cases we need to add additionl defs to build against icu if
icu has certain options configured.

ICU warns about this when building:

*** WARNING: You must set the following flags before code compiled against this ICU will function properly:

    -DU_DISABLE_RENAMING=1

We can fetch these flags from the icu pkgconfig and add them if
required.

This fixes symbol errors if ICU is built without renaming.
This commit is contained in:
James Hilliard 2022-01-17 18:28:39 -07:00 committed by Behdad Esfahbod
parent 0b54f92416
commit daab4bf63a
1 changed files with 7 additions and 0 deletions

View File

@ -123,6 +123,13 @@ if not get_option('icu').disabled()
endif
endif
if icu_dep.found()
icu_defs = icu_dep.get_variable(pkgconfig: 'DEFS', default_value: '')
if icu_defs != ''
add_project_arguments(icu_defs, language: ['c', 'cpp'])
endif
endif
cairo_dep = null_dep
cairo_ft_dep = null_dep
if not get_option('cairo').disabled()