Browse Source

wscript: check for opus 1.4, which fixes an assertion in custom modes decoder initialize

pull/2/head
Alibek Omarov 1 year ago
parent
commit
3533b0d284
  1. 13
      wscript

13
wscript

@ -457,15 +457,14 @@ int main(int argc, char **argv) { strchrnul(argv[1], 'x'); return 0; }'''
conf.env.SHAREDIR = conf.env.LIBDIR = conf.env.BINDIR = conf.env.PREFIX conf.env.SHAREDIR = conf.env.LIBDIR = conf.env.BINDIR = conf.env.PREFIX
if not conf.options.BUILD_BUNDLED_DEPS: if not conf.options.BUILD_BUNDLED_DEPS:
# check if we can use system opus # search for exact version of opus, 1.4 has fixes for custom modes
conf.define('CUSTOM_MODES', 1) 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(0, 0, 0); }'''
# try to link with export that only exists with CUSTOM_MODES defined if conf.check_cc(msg='Checking if opus supports custom modes', defines='CUSTOM_MODES=1', use='opus', fragment=frag, mandatory=False):
if conf.check_pkg('opus', 'opus', '''#include <opus_custom.h>
int main(void){ return !opus_custom_encoder_init(0, 0, 0); }''', fatal = False):
conf.env.HAVE_SYSTEM_OPUS = True conf.env.HAVE_SYSTEM_OPUS = True
else:
conf.undefine('CUSTOM_MODES')
conf.define('XASH_BUILD_COMMIT', conf.env.GIT_VERSION if conf.env.GIT_VERSION else 'notset') conf.define('XASH_BUILD_COMMIT', conf.env.GIT_VERSION if conf.env.GIT_VERSION else 'notset')
conf.define('XASH_LOW_MEMORY', conf.options.LOW_MEMORY) conf.define('XASH_LOW_MEMORY', conf.options.LOW_MEMORY)

Loading…
Cancel
Save