1
0
Fork 0

meson: allow unconstrained dependency version to be "unknown"

And allow for compound version constraints in the future.
This commit is contained in:
Oleg Oshmyan 2021-11-11 02:02:35 +02:00 committed by Ryan Lucia
parent 18503946d5
commit 1d01f8adc8
1 changed files with 9 additions and 10 deletions

View File

@ -182,29 +182,28 @@ deps += dependency('icu-i18n', version: '>=4.8.1.1')
dep_avail = [] dep_avail = []
foreach dep: [ foreach dep: [
# audio, in order of precedence # audio, in order of precedence
['libpulse', '', 'PulseAudio', []], ['libpulse', [], 'PulseAudio', []],
['alsa', '', 'ALSA', []], ['alsa', [], 'ALSA', []],
['portaudio-2.0', '', 'PortAudio', []], ['portaudio-2.0', [], 'PortAudio', []],
['openal', '>=0.0.8', 'OpenAL', []], ['openal', '>=0.0.8', 'OpenAL', []],
# video # video
['ffms2', '>=2.22', 'FFMS2', ['ffms2', 'ffms2_dep']], ['ffms2', '>=2.22', 'FFMS2', ['ffms2', 'ffms2_dep']],
# other # other
['fftw3', '', 'FFTW3', []], ['fftw3', [], 'FFTW3', []],
['hunspell', '', 'Hunspell', ['hunspell', 'hunspell_dep']], ['hunspell', [], 'Hunspell', ['hunspell', 'hunspell_dep']],
['uchardet', '', 'uchardet', ['uchardet', 'uchardet_dep']], ['uchardet', [], 'uchardet', ['uchardet', 'uchardet_dep']],
] ]
optname = dep[0].split('-')[0] optname = dep[0].split('-')[0]
if not get_option(optname).disabled() if not get_option(optname).disabled()
dep_version = dep[1] != '' ? dep[1] : '>=0'
# [provide] section is ignored if required is false; # [provide] section is ignored if required is false;
# must provided define fallback explicitly # must provided define fallback explicitly
# (with meson 0.56 you can do allow_fallback: true): # (with meson 0.56 you can do allow_fallback: true):
#d = dependency(dep[0], version: dep_version, #d = dependency(dep[0], version: dep[1],
# required: false, allow_fallback: true) # required: false, allow_fallback: true)
if dep[3].length() > 0 if dep[3].length() > 0
d = dependency(dep[0], version: dep_version, fallback: dep[3]) d = dependency(dep[0], version: dep[1], fallback: dep[3])
else else
d = dependency(dep[0], version: dep_version, required: false) d = dependency(dep[0], version: dep[1], required: false)
endif endif
if d.found() if d.found()