-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathrtmixer_build.py
More file actions
36 lines (29 loc) · 863 Bytes
/
rtmixer_build.py
File metadata and controls
36 lines (29 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# This is used to create the _rtmixer extension module (see setup.py).
import sys
from cffi import FFI
import pa_ringbuffer
RINGBUFFER_CDEF = pa_ringbuffer.cdef()
ffibuilder = FFI()
ffibuilder.cdef(RINGBUFFER_CDEF)
ffibuilder.cdef("""
/* From limits.h: */
#define ULONG_MAX ...
""")
ffibuilder.cdef(open('src/rtmixer.h').read())
# '-Wconversion'
extra_compile_args = list()
if sys.platform == "linux":
extra_compile_args.append("--std=c99")
ffibuilder.set_source(
'_rtmixer',
RINGBUFFER_CDEF + open('src/rtmixer.c').read(),
include_dirs=['src', 'portaudio/include'],
sources=['portaudio/src/common/pa_ringbuffer.c'],
extra_compile_args=extra_compile_args,
# TODO: release mode by default, option for using debug mode
undef_macros=[
# 'NDEBUG'
],
)
if __name__ == '__main__':
ffibuilder.compile(verbose=True)