gstreamer/subprojects/gst-plugins-good/ext/lame/meson.build
Nirbheek Chauhan 3fadf4807c lame: Disable tools when using the fallback subproject
This saves time when building, since we don't use the tools.

Particularly on macOS, due to a macOS bug, Meson picks up an invalid
ncurses-config binary and incorrectly detects the presence of ncurses,
causing a build failure. This is fixed in the latest meson:
https://github.com/mesonbuild/meson/pull/13715

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7611>
2024-10-11 21:20:59 +00:00

38 lines
1.1 KiB
Meson

lame_dep = dependency('', required: false)
lame_option = get_option('lame')
if lame_option.disabled()
subdir_done()
endif
lame_extra_c_args = []
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
if cc.has_header_symbol('lame/lame.h', 'MEDIUM')
lame_extra_c_args += ['-DGSTLAME_PRESET']
endif
else
lame_dep = dependency('mp3lame', allow_fallback: true, required: lame_option,
default_options: ['tools=disabled'])
have_lame = lame_dep.found()
lame_extra_c_args += ['-DHAVE_LAME_SET_VBR_QUALITY', '-DGSTLAME_PRESET', '-DLAME_SUBPROJECT']
endif
if not have_lame
subdir_done()
endif
lame = library('gstlame',
['gstlamemp3enc.c', 'plugin.c'],
c_args : gst_plugins_good_args + lame_extra_c_args,
include_directories : [configinc, libsinc],
dependencies : [gstaudio_dep, lame_dep],
install : true,
install_dir : plugins_install_dir,
)
plugins += [lame]