From 1d01f8adc8367a0cad4b539968078dd3afe2e2eb Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Thu, 11 Nov 2021 02:02:35 +0200 Subject: [PATCH] meson: allow unconstrained dependency version to be "unknown" And allow for compound version constraints in the future. --- meson.build | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index eeade16a0..dc04cc556 100644 --- a/meson.build +++ b/meson.build @@ -182,29 +182,28 @@ 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', []], + ['libpulse', [], 'PulseAudio', []], + ['alsa', [], 'ALSA', []], + ['portaudio-2.0', [], 'PortAudio', []], ['openal', '>=0.0.8', 'OpenAL', []], # video ['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() - dep_version = dep[1] != '' ? dep[1] : '>=0' # [provide] section is ignored if required is false; # must provided define fallback explicitly # (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) 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 - d = dependency(dep[0], version: dep_version, required: false) + d = dependency(dep[0], version: dep[1], required: false) endif if d.found()