Browse Source

wscript: require Opus Custom for build

Apparently, not all Linux distributions enable it. Anyway, we can build codec ourselves
pull/2/head
Alibek Omarov 2 years ago
parent
commit
4110ee0928
  1. 2
      3rdparty/opus/wscript
  2. 4
      wscript

2
3rdparty/opus/wscript vendored

@ -27,7 +27,7 @@ def build(bld): @@ -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,

4
wscript

@ -328,8 +328,8 @@ int main(int argc, char **argv) { strcasestr(argv[1], argv[2]); return 0; }''' @@ -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')

Loading…
Cancel
Save