wscript: require Opus Custom for build

Apparently, not all Linux distributions enable it. Anyway, we can build codec ourselves
This commit is contained in:
Alibek Omarov 2022-08-31 05:44:20 +03:00
parent 4b05cf4399
commit 4110ee0928
2 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@ def build(bld):
'opus/celt/opus_custom_demo.c'
])
includes = ['opus/include/', 'opus/celt/', 'opus/silk/', 'opus/silk/float/']
defines = ['USE_ALLOCA', 'OPUS_BUILD', 'FLOAT_APPROX', 'PACKAGE_VERSION="1.3.1"']
defines = ['USE_ALLOCA', 'OPUS_BUILD', 'FLOAT_APPROX', 'PACKAGE_VERSION="1.3.1"', 'CUSTOM_MODES']
bld.stlib(
source = sources,

View File

@ -328,8 +328,8 @@ int main(int argc, char **argv) { strcasestr(argv[1], argv[2]); return 0; }'''
if not conf.options.BUILD_BUNDLED_DEPS:
# check if we can use system opus
if conf.check_pkg('opus', 'opus', '''#include <opus.h>
int main(void){ return (opus_encoder_create(48000, 2, OPUS_APPLICATION_VOIP, 0) != 0) && (opus_decoder_create(48000, 2, 0) != 0);}''', fatal = False):
if conf.check_pkg('opus', 'opus', '''#include <opus_custom.h>
int main(void){ return opus_custom_mode_create(44100, 1024, 0) != 0; }''', fatal = False):
conf.env.HAVE_SYSTEM_OPUS = True
conf.define('XASH_BUILD_COMMIT', conf.env.GIT_VERSION if conf.env.GIT_VERSION else 'notset')