Xrasher/3rdparty/opusfile/wscript
Alibek Omarov 6b6d3b3770 3rdparty: opusfile: wscript: hack building on Android with API level lower than 24
In API level 21 **and** _FILE_OFFSET_BITS == 64 we don't get fseeko/ftello functions.
To avoid increasing API level, just set _FILE_OFFSET_BITS to some bogus value.
Undefining it doesn't work as opusfile sets it to 64 automatically.
2024-12-02 21:28:36 +03:00

37 lines
1 KiB
Python

#! /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)
if conf.env.DEST_OS == 'android':
# HACKHACK: set it to 32 here because opusfile can't be built on Android SDK < 24
# with _FILE_OFFSET_BITS 64 (which it sets automatically in src/internal.h)
# we are not (????) relying on this part of the API, so it should be harmless
conf.define('_FILE_OFFSET_BITS', 32)
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',
includes = ['opusfile/include/'],
use = ['libogg', 'opus'],
export_includes = ['opusfile/include/']
)