lame:meson: Avoid using fallback when we could use system install

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1176>
This commit is contained in:
Thibault Saunier 2021-10-17 01:59:35 -03:00
parent 116bc128c1
commit e94e60c342

View file

@ -1,11 +1,9 @@
lame_option = get_option('lame')
lame_dep = dependency('mp3lame', fallback: ['lame', 'lame_dep'], required: false)
lame_extra_c_args = []
have_lame = lame_dep.found()
if not have_lame
lame_dep = cc.find_library('mp3lame', required : lame_option)
have_lame = cc.has_header_symbol('lame/lame.h', 'lame_init', required : lame_option)
lame_dep = cc.find_library('mp3lame', required: false)
have_lame = cc.has_header_symbol('lame/lame.h', 'lame_init')
if have_lame
if cc.has_header_symbol('lame/lame.h', 'lame_set_VBR_quality')
lame_extra_c_args += ['-DHAVE_LAME_SET_VBR_QUALITY']
endif
@ -13,6 +11,8 @@ if not have_lame
lame_extra_c_args += ['-DGSTLAME_PRESET']
endif
else
lame_dep = dependency('mp3lame', fallback: ['lame', 'lame_dep'], required: lame_option)
have_lame = lame_dep.found()
lame_extra_c_args += ['-DHAVE_LAME_SET_VBR_QUALITY', '-DGSTLAME_PRESET', '-DLAME_SUBPROJECT']
endif