lame:meson: Avoid using fallback when we could use system install
authorThibault Saunier <tsaunier@igalia.com>
Sun, 17 Oct 2021 04:59:35 +0000 (01:59 -0300)
committerThibault Saunier <tsaunier@igalia.com>
Sun, 17 Oct 2021 04:59:35 +0000 (01:59 -0300)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1176>

subprojects/gst-plugins-good/ext/lame/meson.build

index 8baa283..2169fde 100644 (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