From 8e5d0a6425a3f73d320d678735a5a926ee4d4305 Mon Sep 17 00:00:00 2001 From: SNMetamorph Date: Sat, 30 Nov 2024 16:45:58 +0400 Subject: [PATCH] 3rdparty: opusfile: added wscript for libopusfile --- 3rdparty/opusfile/wscript | 32 ++++++++++++++++++++++++++++++++ wscript | 1 + 2 files changed, 33 insertions(+) create mode 100644 3rdparty/opusfile/wscript diff --git a/3rdparty/opusfile/wscript b/3rdparty/opusfile/wscript new file mode 100644 index 00000000..835b4e1f --- /dev/null +++ b/3rdparty/opusfile/wscript @@ -0,0 +1,32 @@ +#! /usr/bin/env python +# encoding: utf-8 + +def options(opt): + pass + +def configure(conf): + if not conf.path.find_dir('opusfile') or not conf.path.find_dir('opusfile/src'): + conf.fatal('Can\'t find opusfile submodule. Run `git submodule update --init --recursive`.') + return + + if conf.env.COMPILER_CC == 'msvc': + conf.define('_CRT_SECURE_NO_WARNINGS', 1) + conf.define('_CRT_SECURE_NO_DEPRECATE', 1) + conf.define('_CRT_NONSTDC_NO_DEPRECATE', 1) + +def build(bld): + sources = [ + 'opusfile/src/info.c', + 'opusfile/src/internal.c', + 'opusfile/src/opusfile.c', + 'opusfile/src/stream.c' + ] + + bld.stlib( + source = sources, + target = 'libopusfile', + features = 'c', + includes = ['opusfile/include/'], + use = ['libogg', 'opus'], + export_includes = ['opusfile/include/'] + ) diff --git a/wscript b/wscript index 3c615b5a..206ae14b 100644 --- a/wscript +++ b/wscript @@ -99,6 +99,7 @@ SUBDIRS = [ Subproject('3rdparty/libogg', lambda x: not x.env.DEDICATED), Subproject('3rdparty/vorbis/libvorbis', lambda x: not x.env.DEDICATED), Subproject('3rdparty/vorbis/libvorbisfile', lambda x: not x.env.DEDICATED), + Subproject('3rdparty/opusfile', lambda x: not x.env.DEDICATED), Subproject('3rdparty/MultiEmulator',lambda x: not x.env.DEDICATED), # Subproject('3rdparty/freevgui', lambda x: not x.env.DEDICATED), Subproject('stub/client', lambda x: not x.env.DEDICATED),