2024-11-30 16:45:58 +04:00
|
|
|
#! /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)
|
|
|
|
|
2024-12-02 21:28:32 +03:00
|
|
|
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)
|
|
|
|
|
2024-11-30 16:45:58 +04:00
|
|
|
def build(bld):
|
|
|
|
sources = [
|
|
|
|
'opusfile/src/info.c',
|
|
|
|
'opusfile/src/internal.c',
|
|
|
|
'opusfile/src/opusfile.c',
|
|
|
|
'opusfile/src/stream.c'
|
|
|
|
]
|
|
|
|
|
|
|
|
bld.stlib(
|
|
|
|
source = sources,
|
2024-12-02 21:59:11 +03:00
|
|
|
target = 'opusfile',
|
|
|
|
includes = 'opusfile/include/',
|
|
|
|
use = 'ogg opus',
|
|
|
|
export_includes = 'opusfile/include/'
|
2024-11-30 16:45:58 +04:00
|
|
|
)
|