From f21d8a36073acecad56b2621219ba82fedc04e37 Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Thu, 11 Nov 2021 02:18:24 +0200 Subject: [PATCH] meson: use OpenAL.framework on macOS It is not picked up by the existing dependency() check because its version is unknown to Meson, which fails the version constraint. Besides, dependency('openal') seems to try "openal.framework", which may or may not work on case-sensitive file systems. --- meson.build | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index dc04cc556..433ca01ee 100644 --- a/meson.build +++ b/meson.build @@ -182,16 +182,16 @@ deps += dependency('icu-i18n', version: '>=4.8.1.1') dep_avail = [] foreach dep: [ # audio, in order of precedence - ['libpulse', [], 'PulseAudio', []], - ['alsa', [], 'ALSA', []], - ['portaudio-2.0', [], 'PortAudio', []], - ['openal', '>=0.0.8', 'OpenAL', []], + ['libpulse', [], 'PulseAudio', [], []], + ['alsa', [], 'ALSA', [], []], + ['portaudio-2.0', [], 'PortAudio', [], []], + ['openal', '>=0.0.8', 'OpenAL', [], ['OpenAL']], # video - ['ffms2', '>=2.22', 'FFMS2', ['ffms2', 'ffms2_dep']], + ['ffms2', '>=2.22', 'FFMS2', ['ffms2', 'ffms2_dep'], []], # other - ['fftw3', [], 'FFTW3', []], - ['hunspell', [], 'Hunspell', ['hunspell', 'hunspell_dep']], - ['uchardet', [], 'uchardet', ['uchardet', 'uchardet_dep']], + ['fftw3', [], 'FFTW3', [], []], + ['hunspell', [], 'Hunspell', ['hunspell', 'hunspell_dep'], []], + ['uchardet', [], 'uchardet', ['uchardet', 'uchardet_dep'], []], ] optname = dep[0].split('-')[0] if not get_option(optname).disabled() @@ -206,6 +206,10 @@ foreach dep: [ d = dependency(dep[0], version: dep[1], required: false) endif + if not d.found() and dep[4].length() > 0 and host_machine.system() == 'darwin' + d = dependency('appleframeworks', modules: dep[4], required: false) + endif + if d.found() deps += d conf.set('WITH_@0@'.format(dep[0].split('-')[0].to_upper()), 1)