# Copyright (c) 2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. Import('env') env = env.Clone( ) env.Replace( PA_DIR = '$THIRD_PARTY_DIR/portaudio', CPPPATH = [ '$PA_DIR/include', '$PA_DIR/src/common', '$VC80_CPPPATH', ], ) env.Append( CPPDEFINES = [ 'PA_NO_DS', 'PA_NO_ASIO', ], ) if env['OS'] in ['win32', 'wince']: env.Append( CPPPATH = [ '$PA_DIR/src/os/win', ], CPPFLAGS = [ '/wd4133', '/wd4101', ], ) elif env['OS'] == 'linux': env.Append( CPPPATH = [ '$PA_DIR/src/os/unix', ], CPPFLAGS = [ # disable some warnings '-Wno-unused-variable', # enable multithreading support with pthread library '-pthread', ], CPPDEFINES = [ # build only the OSS hostapi for linux 'PA_USE_OSS', 'HAVE_SYS_SOUNDCARD_H=1', ], ) elif env['OS'] == 'osx': env.Append( CPPPATH = [ '$PA_DIR/src/hostapi/coreaudio', '$PA_DIR/src/hostapi/mac_osx', '$PA_DIR/src/os/unix', ], CPPFLAGS = [ # disable some warnings '-Wno-unused-variable', '-Wno-uninitialized', ], CPPDEFINES = [ 'PA_USE_COREAUDIO', ], ) input_files = [ '$PA_DIR/src/common/pa_allocation.c', '$PA_DIR/src/common/pa_converters.c', '$PA_DIR/src/common/pa_cpuload.c', '$PA_DIR/src/common/pa_debugprint.c', '$PA_DIR/src/common/pa_dither.c', '$PA_DIR/src/common/pa_front.c', '$PA_DIR/src/common/pa_process.c', '$PA_DIR/src/common/pa_skeleton.c', '$PA_DIR/src/common/pa_stream.c', '$PA_DIR/src/common/pa_trace.c', ] # Platform-specific inputs if env['OS'] in ['win32', 'wince']: input_files += [ '$PA_DIR/src/hostapi/wmme/pa_win_wmme.c', '$PA_DIR/src/os/win/pa_win_hostapis.c', '$PA_DIR/src/os/win/pa_win_util.c', '$PA_DIR/src/os/win/pa_win_waveformat.c', ] elif env['OS'] == 'linux': input_files += [ '$PA_DIR/src/hostapi/oss/pa_unix_oss.c', '$PA_DIR/src/os/unix/pa_unix_hostapis.c', '$PA_DIR/src/os/unix/pa_unix_util.c', ] elif env['OS'] == 'osx': input_files += [ '$PA_DIR/src/common/pa_ringbuffer.c', '$PA_DIR/src/hostapi/coreaudio/pa_mac_core.c', '$PA_DIR/src/hostapi/coreaudio/pa_mac_core_blocking.c', '$PA_DIR/src/hostapi/coreaudio/pa_mac_core_utilities.c', '$PA_DIR/src/os/mac_osx/pa_mac_hostapis.c', '$PA_DIR/src/os/unix/pa_unix_util.c', ] env.GearsStaticLibrary('portaudio', input_files)