1# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2# 3# Use of this source code is governed by a BSD-style license 4# that can be found in the LICENSE file in the root of the source 5# tree. An additional intellectual property rights grant can be found 6# in the file PATENTS. All contributing project authors may 7# be found in the AUTHORS file in the root of the source tree. 8 9{ 10 'targets': [ 11 { 12 'target_name': 'audio_device', 13 'type': 'static_library', 14 'dependencies': [ 15 'webrtc_utility', 16 '<(webrtc_root)/base/base.gyp:rtc_base_approved', 17 '<(webrtc_root)/common.gyp:webrtc_common', 18 '<(webrtc_root)/common_audio/common_audio.gyp:common_audio', 19 '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers', 20 ], 21 'include_dirs': [ 22 '.', 23 '../include', 24 'include', 25 'dummy', # Contains dummy audio device implementations. 26 ], 27 'direct_dependent_settings': { 28 'include_dirs': [ 29 '../include', 30 'include', 31 ], 32 }, 33 # TODO(xians): Rename files to e.g. *_linux.{ext}, remove sources in conditions section 34 'sources': [ 35 'include/audio_device.h', 36 'include/audio_device_defines.h', 37 'audio_device_buffer.cc', 38 'audio_device_buffer.h', 39 'audio_device_generic.cc', 40 'audio_device_generic.h', 41 'audio_device_config.h', 42 'dummy/audio_device_dummy.cc', 43 'dummy/audio_device_dummy.h', 44 'dummy/file_audio_device.cc', 45 'dummy/file_audio_device.h', 46 'fine_audio_buffer.cc', 47 'fine_audio_buffer.h', 48 ], 49 'conditions': [ 50 ['OS=="linux"', { 51 'include_dirs': [ 52 'linux', 53 ], 54 }], # OS==linux 55 ['OS=="ios"', { 56 'include_dirs': [ 57 'ios', 58 ], 59 }], # OS==ios 60 ['OS=="mac"', { 61 'include_dirs': [ 62 'mac', 63 ], 64 }], # OS==mac 65 ['OS=="win"', { 66 'include_dirs': [ 67 'win', 68 ], 69 }], 70 ['OS=="android"', { 71 'include_dirs': [ 72 'android', 73 ], 74 }], # OS==android 75 ['include_internal_audio_device==0', { 76 'defines': [ 77 'WEBRTC_DUMMY_AUDIO_BUILD', 78 ], 79 }], 80 ['build_with_chromium==0', { 81 'sources': [ 82 # Don't link these into Chrome since they contain static data. 83 'dummy/file_audio_device_factory.cc', 84 'dummy/file_audio_device_factory.h', 85 ], 86 }], 87 ['include_internal_audio_device==1', { 88 'sources': [ 89 'audio_device_impl.cc', 90 'audio_device_impl.h', 91 ], 92 'conditions': [ 93 ['OS=="android"', { 94 'sources': [ 95 'android/audio_device_template.h', 96 'android/audio_manager.cc', 97 'android/audio_manager.h', 98 'android/audio_record_jni.cc', 99 'android/audio_record_jni.h', 100 'android/audio_track_jni.cc', 101 'android/audio_track_jni.h', 102 'android/build_info.cc', 103 'android/build_info.h', 104 'android/opensles_common.cc', 105 'android/opensles_common.h', 106 'android/opensles_player.cc', 107 'android/opensles_player.h', 108 ], 109 'link_settings': { 110 'libraries': [ 111 '-llog', 112 '-lOpenSLES', 113 ], 114 }, 115 }], 116 ['OS=="linux"', { 117 'sources': [ 118 'linux/alsasymboltable_linux.cc', 119 'linux/alsasymboltable_linux.h', 120 'linux/audio_device_alsa_linux.cc', 121 'linux/audio_device_alsa_linux.h', 122 'linux/audio_mixer_manager_alsa_linux.cc', 123 'linux/audio_mixer_manager_alsa_linux.h', 124 'linux/latebindingsymboltable_linux.cc', 125 'linux/latebindingsymboltable_linux.h', 126 ], 127 'defines': [ 128 'LINUX_ALSA', 129 ], 130 'link_settings': { 131 'libraries': [ 132 '-ldl','-lX11', 133 ], 134 }, 135 'conditions': [ 136 ['include_pulse_audio==1', { 137 'defines': [ 138 'LINUX_PULSE', 139 ], 140 'sources': [ 141 'linux/audio_device_pulse_linux.cc', 142 'linux/audio_device_pulse_linux.h', 143 'linux/audio_mixer_manager_pulse_linux.cc', 144 'linux/audio_mixer_manager_pulse_linux.h', 145 'linux/pulseaudiosymboltable_linux.cc', 146 'linux/pulseaudiosymboltable_linux.h', 147 ], 148 }], 149 ], 150 }], 151 ['OS=="mac"', { 152 'sources': [ 153 'mac/audio_device_mac.cc', 154 'mac/audio_device_mac.h', 155 'mac/audio_mixer_manager_mac.cc', 156 'mac/audio_mixer_manager_mac.h', 157 'mac/portaudio/pa_memorybarrier.h', 158 'mac/portaudio/pa_ringbuffer.c', 159 'mac/portaudio/pa_ringbuffer.h', 160 ], 161 'link_settings': { 162 'libraries': [ 163 '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework', 164 '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework', 165 ], 166 }, 167 }], 168 ['OS=="ios"', { 169 'sources': [ 170 'ios/audio_device_ios.h', 171 'ios/audio_device_ios.mm', 172 'ios/audio_device_not_implemented_ios.mm', 173 ], 174 'xcode_settings': { 175 'CLANG_ENABLE_OBJC_ARC': 'YES', 176 }, 177 'link_settings': { 178 'xcode_settings': { 179 'OTHER_LDFLAGS': [ 180 '-framework AudioToolbox', 181 '-framework AVFoundation', 182 '-framework Foundation', 183 '-framework UIKit', 184 ], 185 }, 186 }, 187 }], 188 ['OS=="win"', { 189 'sources': [ 190 'win/audio_device_core_win.cc', 191 'win/audio_device_core_win.h', 192 'win/audio_device_wave_win.cc', 193 'win/audio_device_wave_win.h', 194 'win/audio_mixer_manager_win.cc', 195 'win/audio_mixer_manager_win.h', 196 ], 197 'link_settings': { 198 'libraries': [ 199 # Required for the built-in WASAPI AEC. 200 '-ldmoguids.lib', 201 '-lwmcodecdspuuid.lib', 202 '-lamstrmid.lib', 203 '-lmsdmo.lib', 204 ], 205 }, 206 }], 207 ['OS=="win" and clang==1', { 208 'msvs_settings': { 209 'VCCLCompilerTool': { 210 'AdditionalOptions': [ 211 # Disable warnings failing when compiling with Clang on Windows. 212 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366 213 '-Wno-bool-conversion', 214 '-Wno-delete-non-virtual-dtor', 215 '-Wno-logical-op-parentheses', 216 '-Wno-microsoft-extra-qualification', 217 '-Wno-microsoft-goto', 218 '-Wno-missing-braces', 219 '-Wno-parentheses-equality', 220 '-Wno-reorder', 221 '-Wno-shift-overflow', 222 '-Wno-tautological-compare', 223 '-Wno-unused-private-field', 224 ], 225 }, 226 }, 227 }], 228 ], # conditions 229 }], # include_internal_audio_device==1 230 ], # conditions 231 }, 232 ], 233 'conditions': [ 234 # Does not compile on iOS: webrtc:4755. 235 ['include_tests==1 and OS!="ios"', { 236 'targets': [ 237 { 238 'target_name': 'audio_device_tests', 239 'type': 'executable', 240 'dependencies': [ 241 'audio_device', 242 'webrtc_utility', 243 '<(webrtc_root)/test/test.gyp:test_support_main', 244 '<(DEPTH)/testing/gtest.gyp:gtest', 245 '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers', 246 ], 247 'sources': [ 248 'test/audio_device_test_api.cc', 249 'test/audio_device_test_defines.h', 250 ], 251 }, 252 { 253 'target_name': 'audio_device_test_func', 254 'type': 'executable', 255 'dependencies': [ 256 'audio_device', 257 'webrtc_utility', 258 '<(webrtc_root)/common_audio/common_audio.gyp:common_audio', 259 '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers', 260 '<(webrtc_root)/test/test.gyp:test_support', 261 '<(DEPTH)/testing/gtest.gyp:gtest', 262 ], 263 'sources': [ 264 'test/audio_device_test_func.cc', 265 'test/audio_device_test_defines.h', 266 'test/func_test_manager.cc', 267 'test/func_test_manager.h', 268 ], 269 }, 270 ], # targets 271 }], # include_tests==1 and OS!=ios 272 ], 273} 274 275