Alibek Omarov
4 years ago
6 changed files with 56 additions and 47 deletions
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
Subproject commit dfd6c88aaa54a03a61434c413e30c217eb98f1d5 |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
Subproject commit 1639592368fc2dadc82d63f3be6f17ed0b554d71 |
@ -0,0 +1,52 @@
@@ -0,0 +1,52 @@
|
||||
#! /usr/bin/env python |
||||
# encoding: utf-8 |
||||
|
||||
import os |
||||
|
||||
OPUS_CHECK='''#include <opus.h> |
||||
#include <stddef.h> |
||||
int main() |
||||
{ |
||||
OpusEncoder *oe = opus_encoder_create(48000, 2, OPUS_APPLICATION_VOIP, NULL); |
||||
OpusDecoder *od = opus_decoder_create(48000, 2, NULL); |
||||
return !oe || !od; |
||||
} |
||||
''' |
||||
|
||||
def options(opt): |
||||
pass |
||||
|
||||
def configure(conf): |
||||
if conf.check_pkg('opus', 'OPUS', OPUS_CHECK, fatal = False): |
||||
conf.env.HAVE_OPUS = True |
||||
return |
||||
|
||||
if not conf.path.find_dir('opus') or not conf.path.find_dir('opus/src'): |
||||
conf.fatal('Can\'t find opus submodule. Run `git submodule update --init --recursive`.') |
||||
return |
||||
|
||||
# TODO: ARM/x86 intrinsics detection |
||||
# TODO: maybe call autotools/cmake/meson instead? |
||||
|
||||
def build(bld): |
||||
if bld.env.HAVE_OPUS: |
||||
return |
||||
|
||||
sources = bld.path.ant_glob([ |
||||
'opus/src/*.c', |
||||
'opus/celt/*.c', |
||||
'opus/silk/*.c', |
||||
'opus/silk/float/*.c' |
||||
]) |
||||
includes = ['opus/include/', 'opus/celt/', 'opus/silk/', 'opus/silk/float/'] |
||||
defines = ['USE_ALLOCA', 'OPUS_BUILD', 'FLOAT_APPROX', 'PACKAGE_VERSION="1.3.1"'] |
||||
|
||||
bld.stlib( |
||||
source = sources, |
||||
target = 'opus', |
||||
features = 'c', |
||||
includes = includes, |
||||
defines = defines, |
||||
subsystem = bld.env.MSVC_SUBSYSTEM, |
||||
export_includes = ['opus/include/'] |
||||
) |
@ -1,42 +0,0 @@
@@ -1,42 +0,0 @@
|
||||
# encoding: utf-8 |
||||
|
||||
import os |
||||
|
||||
def options(opt): |
||||
pass |
||||
|
||||
def configure(conf): |
||||
path = conf.path.find_dir('3rdparty/opus') |
||||
conf.env.LIB_OPUS = ['opus'] |
||||
conf.env.INCLUDES_OPUS = [path.find_dir('include/').abspath()] |
||||
|
||||
def build(bld): |
||||
path = bld.path.find_dir('3rdparty/opus') |
||||
|
||||
sources = path.ant_glob([ |
||||
'src/*.c', |
||||
'celt/*.c', |
||||
'silk/*.c', |
||||
'silk/float/*.c']) |
||||
|
||||
includes = [ |
||||
path.find_dir('include/'), |
||||
path.find_dir('celt/'), |
||||
path.find_dir('silk/'), |
||||
path.find_dir('silk/float/') |
||||
] |
||||
|
||||
defines = [ |
||||
'USE_ALLOCA', |
||||
'OPUS_BUILD', |
||||
'PACKAGE_VERSION="1.3.1"' |
||||
] |
||||
|
||||
bld.stlib( |
||||
source = sources, |
||||
target = 'opus', |
||||
features = 'c', |
||||
includes = includes, |
||||
defines = defines, |
||||
subsystem = bld.env.MSVC_SUBSYSTEM |
||||
) |
Loading…
Reference in new issue