diff --git a/meson.build b/meson.build index 917c4d019..e22859a26 100644 --- a/meson.build +++ b/meson.build @@ -93,28 +93,15 @@ gobject_dep = dependency('gobject-2.0', required: get_option('gobject')) graphite2_dep = dependency('graphite2', required: get_option('graphite2')) graphite_dep = dependency('graphite2', required: get_option('graphite')) -icu_dep = null_dep -if not get_option('icu').disabled() - icu_dep = dependency('icu-uc', required: false) - - if (not icu_dep.found() and - cpp.get_id() == 'msvc' and - cpp.has_header('unicode/uchar.h') and - cpp.has_header('unicode/unorm2.h') and - cpp.has_header('unicode/ustring.h') and - cpp.has_header('unicode/utf16.h') and - cpp.has_header('unicode/uversion.h') and - cpp.has_header('unicode/uscript.h')) - if get_option('buildtype') == 'debug' - icu_dep = cpp.find_library('icuucd', required: false) - else - icu_dep = cpp.find_library('icuuc', required: false) - endif - endif - - if not icu_dep.found() - icu_dep = dependency('icu-uc', required: get_option('icu')) - endif +if cpp.get_argument_syntax() == 'msvc' + icu_dep = dependency('ICU', + required: get_option('icu'), + components: 'uc', + method: 'cmake') +else + icu_dep = dependency('icu-uc', + required: get_option('icu'), + method: 'pkg-config') endif if icu_dep.found() and icu_dep.type_name() == 'pkgconfig'