wscript: specifically look for opus 1.4, as 1.5 have broken custom modes

Link to GitHub issue: https://github.com/xiph/opus/issues/374
This commit is contained in:
Alibek Omarov 2024-12-02 18:48:13 +03:00
parent c39d2e243a
commit 7eba5a994d

View file

@ -480,8 +480,9 @@ def configure(conf):
if conf.check_cfg(package=i[0], uselib_store=i[1], args='--cflags --libs', mandatory=False):
conf.env['HAVE_SYSTEM_%s' % i[0].upper()] = True
# search for opus 1.4 or higher, it has fixes for custom modes
if conf.check_cfg(package='opus', uselib_store='opus', args='opus >= 1.4 --cflags --libs', mandatory=False):
# search for opus 1.4 only, it has fixes for custom modes
# 1.5 breaks custom modes: https://github.com/xiph/opus/issues/374
if conf.check_cfg(package='opus', uselib_store='opus', args='opus = 1.4 --cflags --libs', mandatory=False):
# now try to link with export that only exists with CUSTOM_MODES defined
frag='''#include <opus_custom.h>
int main(void) { return !opus_custom_encoder_init((OpusCustomEncoder *)1, (const OpusCustomMode *)1, 1); }'''