3rdparty: vorbis: added wscript for libvorbisfile

This commit is contained in:
SNMetamorph 2024-11-29 19:38:06 +04:00 committed by Alibek Omarov
parent 9e67a90b25
commit 914be8dbd7
2 changed files with 53 additions and 0 deletions

52
3rdparty/vorbis/libvorbisfile/wscript vendored Normal file
View file

@ -0,0 +1,52 @@
#! /usr/bin/env python
# encoding: utf-8
FRAGMENT_MEMORY_H='''#include <memory.h>
int main (void) {
return 0;
}'''
FRAGMENT_MEMCMP='''#include <string.h>
int main (void) {
memcmp(NULL, NULL, 0);
return 0;
}'''
FRAGMENT_ALLOCA_H='''#include <alloca.h>
int main (void) {
int foo=10;
int * array = alloca(foo);
}'''
def options(opt):
pass
def configure(conf):
if not conf.path.find_dir('../vorbis-src') or not conf.path.find_dir('../vorbis-src/lib'):
conf.fatal('Can\'t find libvorbis submodule. Run `git submodule update --init --recursive`.')
return
if conf.check_cc(fragment=FRAGMENT_MEMORY_H, msg = 'Checking for memory.h header', mandatory = False):
conf.define('USE_MEMORY_H', 1)
conf.check_cc(fragmenmt=FRAGMENT_MEMCMP, msg = 'Checking for memcmp in string.h header', mandatory = False)
conf.check_cc(fragment=FRAGMENT_ALLOCA_H, msg = 'Checking for alloca in alloca.h header', mandatory = False)
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 = [
'../vorbis-src/lib/vorbisfile.c'
]
bld.stlib(
source = sources,
target = 'libvorbisfile',
features = 'c',
includes = ['../vorbis-src/include/'],
use = ['libvorbis'],
export_includes = ['../vorbis-src/include/']
)

View file

@ -98,6 +98,7 @@ SUBDIRS = [
Subproject('3rdparty/vgui_support', lambda x: not x.env.DEDICATED),
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/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),