ref: cc81763bbaa1fc36144a5bdd8f0e3107aed22e25
parent: 39c4721d573e42ab1b96a9399c69dd8f2babca09
author: Paul Brossier <[email protected]>
date: Sat Sep 5 07:41:36 EDT 2015
wscript: add option to not build with CoreAudio/AudioToolbox
--- a/src/io/audio_unit.c
+++ b/src/io/audio_unit.c
@@ -19,7 +19,7 @@
*/
#include "config.h"
-#ifdef TARGET_OS_IPHONE
+#ifdef HAVE_AUDIO_UNIT
#include "aubio_priv.h"
#include "fvec.h"
@@ -774,4 +774,4 @@
return (int)err;
}
-#endif /* TARGET_OS_IPHONE */
+#endif /* HAVE_AUDIO_UNIT */
--- a/wscript
+++ b/wscript
@@ -78,6 +78,9 @@
add_option_enable_disable(ctx, 'accelerate', default = None,
help_str = 'use Accelerate framework (darwin only) (auto)',
help_disable_str = 'do not use Accelerate framework')
+ add_option_enable_disable(ctx, 'apple-audio', default = None,
+ help_str = 'use CoreFoundation (darwin only) (auto)',
+ help_disable_str = 'do not use CoreFoundation framework')
ctx.add_option('--with-target-platform', type='string',
help='set target platform for cross-compilation', dest='target_platform')
@@ -113,17 +116,20 @@
ctx.env.LINKFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
if target_platform in [ 'darwin', 'ios', 'iosimulator']:
- ctx.env.FRAMEWORK = ['CoreFoundation', 'AudioToolbox']
- ctx.define('HAVE_SOURCE_APPLE_AUDIO', 1)
- ctx.define('HAVE_SINK_APPLE_AUDIO', 1)
+ if (ctx.options.enable_apple_audio != False):
+ ctx.env.FRAMEWORK += ['CoreFoundation', 'AudioToolbox']
+ ctx.define('HAVE_SOURCE_APPLE_AUDIO', 1)
+ ctx.define('HAVE_SINK_APPLE_AUDIO', 1)
if (ctx.options.enable_accelerate != False):
ctx.define('HAVE_ACCELERATE', 1)
ctx.env.FRAMEWORK += ['Accelerate']
if target_platform in [ 'ios', 'iosimulator' ]:
- ctx.define('TARGET_OS_IPHONE', 1)
MINSDKVER="6.1"
ctx.env.CFLAGS += ['-std=c99']
+ if (ctx.options.enable_audio_unit != False):
+ ctx.define('HAVE_AUDIO_UNIT', 1)
+ #ctx.env.FRAMEWORK += ['CoreFoundation', 'AudioToolbox']
if target_platform == 'ios':
DEVROOT = "/Applications/Xcode.app/Contents"
DEVROOT += "/Developer/Platforms/iPhoneOS.platform/Developer"