diff --git a/meson.build b/meson.build index 9a98f0c86a0..490932ce35b 100644 --- a/meson.build +++ b/meson.build @@ -819,19 +819,31 @@ endif ############################################################### icuopt = get_option('icu') +icu_i18n = not_found_dep if not icuopt.disabled() - icu = dependency('icu-uc', required: false) - if icu.found() - icu_i18n = dependency('icu-i18n', required: true) - endif - - # Unfortunately the dependency is named differently with cmake - if not icu.found() # combine with above once meson 0.60.0 is required - icu = dependency('ICU', required: icuopt, - components: ['uc'], modules: ['ICU::uc'], method: 'cmake') + if host_system != 'windows' + icu = dependency('icu-uc', required: false) if icu.found() - icu_i18n = dependency('ICU', required: true, - components: ['i18n'], modules: ['ICU::i18n']) + icu_i18n = dependency('icu-i18n', required: true) + endif + + # Unfortunately the dependency is named differently with cmake + if not icu.found() # combine with above once meson 0.60.0 is required + icu = dependency('ICU', required: icuopt, + components: ['uc'], modules: ['ICU::uc'], method: 'cmake') + if icu.found() + icu_i18n = dependency('ICU', required: true, + components: ['i18n'], modules: ['ICU::i18n']) + endif + endif + else + icu = dependency('icuuc', required: false) + if not icu.found() + icu = cc.find_library('icuuc', required: icuopt, dirs: postgres_lib_d) + endif + icuin = dependency('icuin', required: false) + if not icuin.found() + icuin = cc.find_library('icuin', required: icuopt, dirs: postgres_lib_d) endif endif @@ -844,6 +856,7 @@ if not icuopt.disabled() else icu = not_found_dep icu_i18n = not_found_dep + icuin = not_found_dep endif @@ -3070,6 +3083,12 @@ backend_both_deps += [ zstd, ] +if host_system == 'windows' + backend_both_deps += [ + icuin, + ] +endif + backend_mod_deps = backend_both_deps + os_deps backend_code = declare_dependency(