diff --git a/meson.build b/meson.build index 2939e288b..18d812499 100644 --- a/meson.build +++ b/meson.build @@ -316,8 +316,10 @@ else endif # BZip2 support -bzip2_dep = cc.find_library('bz2', - required: get_option('bzip2')) +bzip2_dep = dependency('bzip2', required: false) +if not bzip2_dep.found() + bzip2_dep = cc.find_library('bz2', has_headers: ['bzlib.h'], required: get_option('bzip2')) +endif if bzip2_dep.found() ftoption_command += ['--enable=FT_CONFIG_OPTION_USE_BZIP2']