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.
This commit is contained in:
Oleg Oshmyan 2021-11-11 02:18:24 +02:00 committed by Ryan Lucia
parent 1d01f8adc8
commit f21d8a3607

View file

@ -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)