blob: d0d45ebbb5a5fbb49332fa17a1a1d0c72cd73b0a [file] [log] [blame]
leozwang@webrtc.org30537022012-03-15 18:34:13 +00001# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00002#
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{
niklase@google.com470e71d2011-07-07 08:21:25 +000010 'targets': [
11 {
12 'target_name': 'audio_device',
wjia@webrtc.orga3c82bf2013-01-18 23:42:21 +000013 'type': 'static_library',
niklase@google.com470e71d2011-07-07 08:21:25 +000014 'dependencies': [
henrike@webrtc.orgad2eb6f2013-10-04 14:21:23 +000015 'webrtc_utility',
andrew@webrtc.org34235372013-04-30 23:43:26 +000016 '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
xians@google.comd3185fe2011-09-12 12:24:39 +000017 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
niklase@google.com470e71d2011-07-07 08:21:25 +000018 ],
19 'include_dirs': [
20 '.',
niklase@google.com470e71d2011-07-07 08:21:25 +000021 '../interface',
andrew@webrtc.org236d5d32012-09-21 20:46:40 +000022 'include',
xians@google.com68efa212011-08-11 12:41:56 +000023 'dummy', # dummy audio device
niklase@google.com470e71d2011-07-07 08:21:25 +000024 ],
25 'direct_dependent_settings': {
26 'include_dirs': [
niklase@google.com470e71d2011-07-07 08:21:25 +000027 '../interface',
andrew@webrtc.org236d5d32012-09-21 20:46:40 +000028 'include',
niklase@google.com470e71d2011-07-07 08:21:25 +000029 ],
30 },
31 # TODO(xians): Rename files to e.g. *_linux.{ext}, remove sources in conditions section
32 'sources': [
andrew@webrtc.org236d5d32012-09-21 20:46:40 +000033 'include/audio_device.h',
34 'include/audio_device_defines.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000035 'audio_device_buffer.cc',
36 'audio_device_buffer.h',
37 'audio_device_generic.cc',
38 'audio_device_generic.h',
39 'audio_device_utility.cc',
40 'audio_device_utility.h',
41 'audio_device_impl.cc',
42 'audio_device_impl.h',
43 'audio_device_config.h',
pbos@webrtc.org096515b2013-07-30 12:32:59 +000044 'dummy/audio_device_dummy.cc',
xians@google.com68efa212011-08-11 12:41:56 +000045 'dummy/audio_device_dummy.h',
pbos@webrtc.org096515b2013-07-30 12:32:59 +000046 'dummy/audio_device_utility_dummy.cc',
xians@google.com68efa212011-08-11 12:41:56 +000047 'dummy/audio_device_utility_dummy.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000048 ],
49 'conditions': [
niklase@google.com470e71d2011-07-07 08:21:25 +000050 ['OS=="linux"', {
niklase@google.com470e71d2011-07-07 08:21:25 +000051 'include_dirs': [
xians@google.com68efa212011-08-11 12:41:56 +000052 'linux',
niklase@google.com470e71d2011-07-07 08:21:25 +000053 ],
xians@google.combf5d2ba2011-08-16 07:44:19 +000054 }], # OS==linux
sjlee@webrtc.org4b425082012-09-10 17:58:21 +000055 ['OS=="ios"', {
56 'include_dirs': [
57 'ios',
58 ],
59 }], # OS==ios
xians@google.combf5d2ba2011-08-16 07:44:19 +000060 ['OS=="mac"', {
sjlee@webrtc.org4b425082012-09-10 17:58:21 +000061 'include_dirs': [
62 'mac',
63 ],
xians@google.combf5d2ba2011-08-16 07:44:19 +000064 }], # OS==mac
65 ['OS=="win"', {
sjlee@webrtc.org4b425082012-09-10 17:58:21 +000066 'include_dirs': [
67 'win',
sjlee@webrtc.org4b425082012-09-10 17:58:21 +000068 ],
xians@google.combf5d2ba2011-08-16 07:44:19 +000069 }],
leozwang@webrtc.org4ad4c242012-02-22 16:04:59 +000070 ['OS=="android"', {
andrew@webrtc.org236d5d32012-09-21 20:46:40 +000071 'include_dirs': [
72 'android',
73 ],
leozwang@webrtc.org4ad4c242012-02-22 16:04:59 +000074 }], # OS==android
xians@google.combf5d2ba2011-08-16 07:44:19 +000075 ['include_internal_audio_device==0', {
76 'defines': [
77 'WEBRTC_DUMMY_AUDIO_BUILD',
78 ],
79 }],
80 ['include_internal_audio_device==1', {
81 'sources': [
82 'linux/alsasymboltable_linux.cc',
83 'linux/alsasymboltable_linux.h',
84 'linux/audio_device_alsa_linux.cc',
85 'linux/audio_device_alsa_linux.h',
86 'linux/audio_device_utility_linux.cc',
87 'linux/audio_device_utility_linux.h',
88 'linux/audio_mixer_manager_alsa_linux.cc',
89 'linux/audio_mixer_manager_alsa_linux.h',
90 'linux/latebindingsymboltable_linux.cc',
91 'linux/latebindingsymboltable_linux.h',
sjlee@webrtc.org4b425082012-09-10 17:58:21 +000092 'ios/audio_device_ios.cc',
93 'ios/audio_device_ios.h',
94 'ios/audio_device_utility_ios.cc',
95 'ios/audio_device_utility_ios.h',
xians@google.combf5d2ba2011-08-16 07:44:19 +000096 'mac/audio_device_mac.cc',
97 'mac/audio_device_mac.h',
98 'mac/audio_device_utility_mac.cc',
99 'mac/audio_device_utility_mac.h',
100 'mac/audio_mixer_manager_mac.cc',
101 'mac/audio_mixer_manager_mac.h',
102 'mac/portaudio/pa_memorybarrier.h',
103 'mac/portaudio/pa_ringbuffer.c',
104 'mac/portaudio/pa_ringbuffer.h',
105 'win/audio_device_core_win.cc',
106 'win/audio_device_core_win.h',
107 'win/audio_device_wave_win.cc',
108 'win/audio_device_wave_win.h',
109 'win/audio_device_utility_win.cc',
110 'win/audio_device_utility_win.h',
111 'win/audio_mixer_manager_win.cc',
112 'win/audio_mixer_manager_win.h',
leozwang@webrtc.org4ad4c242012-02-22 16:04:59 +0000113 'android/audio_device_utility_android.cc',
114 'android/audio_device_utility_android.h',
xians@google.combf5d2ba2011-08-16 07:44:19 +0000115 ],
wjia@google.com647aa162011-07-21 20:45:31 +0000116 'conditions': [
leozwang@webrtc.org3197d482012-03-02 17:12:14 +0000117 ['OS=="android"', {
118 'link_settings': {
119 'libraries': [
120 '-llog',
121 '-lOpenSLES',
122 ],
123 },
leozwang@webrtc.org2db85bc2012-09-18 20:19:00 +0000124 'conditions': [
125 ['enable_android_opensl==1', {
126 'sources': [
leozwang@webrtc.org2a84f632012-10-03 21:40:06 +0000127 'android/audio_device_opensles_android.cc',
128 'android/audio_device_opensles_android.h',
henrike@webrtc.org82f014a2013-09-10 18:24:07 +0000129 'android/audio_manager_jni.cc',
130 'android/audio_manager_jni.h',
131 'android/fine_audio_buffer.cc',
132 'android/fine_audio_buffer.h',
133 'android/low_latency_event_posix.cc',
134 'android/low_latency_event.h',
135 'android/opensles_common.cc',
136 'android/opensles_common.h',
137 'android/opensles_input.cc',
138 'android/opensles_input.h',
139 'android/opensles_output.cc',
140 'android/opensles_output.h',
141 'android/single_rw_fifo.cc',
142 'android/single_rw_fifo.h',
leozwang@webrtc.org2db85bc2012-09-18 20:19:00 +0000143 ],
144 }, {
145 'sources': [
leozwang@webrtc.org2a84f632012-10-03 21:40:06 +0000146 'android/audio_device_jni_android.cc',
147 'android/audio_device_jni_android.h',
leozwang@webrtc.org2db85bc2012-09-18 20:19:00 +0000148 ],
149 }],
150 ],
leozwang@webrtc.org3197d482012-03-02 17:12:14 +0000151 }],
xians@google.combf5d2ba2011-08-16 07:44:19 +0000152 ['OS=="linux"', {
wjia@google.com647aa162011-07-21 20:45:31 +0000153 'defines': [
xians@google.combf5d2ba2011-08-16 07:44:19 +0000154 'LINUX_ALSA',
wjia@google.com647aa162011-07-21 20:45:31 +0000155 ],
156 'link_settings': {
157 'libraries': [
niklas.enbom@webrtc.orge2a80062013-05-14 21:33:11 +0000158 '-ldl','-lX11',
xians@google.combf5d2ba2011-08-16 07:44:19 +0000159 ],
160 },
161 'conditions': [
162 ['include_pulse_audio==1', {
163 'defines': [
164 'LINUX_PULSE',
165 ],
166 'sources': [
167 'linux/audio_device_pulse_linux.cc',
168 'linux/audio_device_pulse_linux.h',
169 'linux/audio_mixer_manager_pulse_linux.cc',
170 'linux/audio_mixer_manager_pulse_linux.h',
171 'linux/pulseaudiosymboltable_linux.cc',
172 'linux/pulseaudiosymboltable_linux.h',
173 ],
xians@google.combf5d2ba2011-08-16 07:44:19 +0000174 }],
175 ],
176 }],
sjlee@webrtc.org4b425082012-09-10 17:58:21 +0000177 ['OS=="mac" or OS=="ios"', {
xians@google.combf5d2ba2011-08-16 07:44:19 +0000178 'link_settings': {
179 'libraries': [
180 '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
181 '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
wjia@google.com647aa162011-07-21 20:45:31 +0000182 ],
183 },
184 }],
andrew@webrtc.orga3c6d612011-09-13 17:17:49 +0000185 ['OS=="win"', {
186 'link_settings': {
187 'libraries': [
188 # Required for the built-in WASAPI AEC.
189 '-ldmoguids.lib',
190 '-lwmcodecdspuuid.lib',
191 '-lamstrmid.lib',
192 '-lmsdmo.lib',
193 ],
194 },
195 }],
xians@google.combf5d2ba2011-08-16 07:44:19 +0000196 ], # conditions
197 }], # include_internal_audio_device==1
198 ], # conditions
niklase@google.com470e71d2011-07-07 08:21:25 +0000199 },
xians@google.com7fa20c32011-08-05 12:04:30 +0000200 ],
kjellander@webrtc.org67fdd702012-03-09 08:11:04 +0000201 'conditions': [
mflodman@webrtc.org6af95942012-05-24 13:23:35 +0000202 ['include_tests==1', {
xians@google.com7fa20c32011-08-05 12:04:30 +0000203 'targets': [
204 {
phoglund@webrtc.org32fe90b2013-08-19 11:40:19 +0000205 'target_name': 'audio_device_tests',
xians@google.com7fa20c32011-08-05 12:04:30 +0000206 'type': 'executable',
207 'dependencies': [
xians@google.com3d292f12011-08-05 08:32:13 +0000208 'audio_device',
xians@google.comd3185fe2011-09-12 12:24:39 +0000209 'webrtc_utility',
andrew@webrtc.org81cf5e42012-06-27 01:41:54 +0000210 '<(webrtc_root)/test/test.gyp:test_support_main',
211 '<(DEPTH)/testing/gtest.gyp:gtest',
xians@google.comd3185fe2011-09-12 12:24:39 +0000212 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
xians@google.com3d292f12011-08-05 08:32:13 +0000213 ],
214 'sources': [
andrew@webrtc.org236d5d32012-09-21 20:46:40 +0000215 'test/audio_device_test_api.cc',
216 'test/audio_device_test_defines.h',
xians@google.com3d292f12011-08-05 08:32:13 +0000217 ],
218 },
219 {
220 'target_name': 'audio_device_test_func',
221 'type': 'executable',
222 'dependencies': [
223 'audio_device',
xians@google.comd3185fe2011-09-12 12:24:39 +0000224 'webrtc_utility',
andrew@webrtc.org34235372013-04-30 23:43:26 +0000225 '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
xians@google.comd3185fe2011-09-12 12:24:39 +0000226 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
andrew@webrtc.org81cf5e42012-06-27 01:41:54 +0000227 '<(webrtc_root)/test/test.gyp:test_support',
228 '<(DEPTH)/testing/gtest.gyp:gtest',
xians@google.com3d292f12011-08-05 08:32:13 +0000229 ],
230 'sources': [
andrew@webrtc.org236d5d32012-09-21 20:46:40 +0000231 'test/audio_device_test_func.cc',
232 'test/audio_device_test_defines.h',
233 'test/func_test_manager.cc',
234 'test/func_test_manager.h',
xians@google.com3d292f12011-08-05 08:32:13 +0000235 ],
xians@google.com7fa20c32011-08-05 12:04:30 +0000236 },
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000237 ], # targets
238 'conditions': [
239 ['test_isolation_mode != "noop"', {
240 'targets': [
241 {
242 'target_name': 'audio_device_tests_run',
243 'type': 'none',
244 'dependencies': [
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000245 'audio_device_tests',
246 ],
247 'includes': [
kjellander@webrtc.org2a973172013-10-02 19:31:16 +0000248 '../../build/isolate.gypi',
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000249 'audio_device_tests.isolate',
250 ],
251 'sources': [
252 'audio_device_tests.isolate',
253 ],
254 },
255 ],
256 }],
henrike@webrtc.org82f014a2013-09-10 18:24:07 +0000257 ['OS=="android" and enable_android_opensl==1', {
258 'targets': [
259 {
henrike@webrtc.org1fdc51a2013-10-02 14:58:19 +0000260 'target_name': 'libopensl-demo-jni',
261 'type': 'loadable_module',
262 'dependencies': [
263 'audio_device',
264 ],
265 'sources': [
266 'android/test/jni/opensl_runner.cc',
267 'android/test/fake_audio_device_buffer.cc',
268 ],
269 'link_settings': {
270 'libraries': [
271 '-llog',
272 '-lOpenSLES',
273 ],
274 },
275 },
276 {
277 'target_name': 'OpenSlDemo',
278 'type': 'none',
279 'dependencies': [
280 'libopensl-demo-jni',
281 '<(modules_java_gyp_path):*',
282 ],
283 'actions': [
284 {
285 # TODO(henrik): Convert building of the demo to a proper GYP
286 # target so this action is not needed once chromium's
287 # apk-building machinery can be used. (crbug.com/225101)
288 'action_name': 'build_opensldemo_apk',
289 'variables': {
290 'android_opensl_demo_root': '<(webrtc_root)/modules/audio_device/android/test',
291 },
292 'inputs' : [
293 '<(PRODUCT_DIR)/lib.java/audio_device_module_java.jar',
294 '<(PRODUCT_DIR)/libopensl-demo-jni.so',
295 '<!@(find <(android_opensl_demo_root)/src -name "*.java")',
296 '<!@(find <(android_opensl_demo_root)/res -name "*.xml")',
297 '<!@(find <(android_opensl_demo_root)/res -name "*.png")',
298 '<(android_opensl_demo_root)/AndroidManifest.xml',
299 '<(android_opensl_demo_root)/build.xml',
300 '<(android_opensl_demo_root)/project.properties',
301 ],
302 'outputs': ['<(PRODUCT_DIR)/OpenSlDemo-debug.apk'],
303 'action': ['bash', '-ec',
304 'rm -f <(_outputs) && '
305 'mkdir -p <(android_opensl_demo_root)/libs/<(android_app_abi) && '
306 '<(android_strip) -o <(android_opensl_demo_root)/libs/<(android_app_abi)/libopensl-demo-jni.so <(PRODUCT_DIR)/libopensl-demo-jni.so && '
307 'cp <(PRODUCT_DIR)/lib.java/audio_device_module_java.jar <(android_opensl_demo_root)/libs/ &&'
308 'cd <(android_opensl_demo_root) && '
309 'ant debug && '
310 'cd - && '
311 'cp <(android_opensl_demo_root)/bin/OpenSlDemo-debug.apk <(_outputs)'
312 ],
313 },
314 ],
315 }],
316 }],
317 ['OS=="android" and enable_android_opensl==1', {
318 'targets': [
319 {
henrike@webrtc.org82f014a2013-09-10 18:24:07 +0000320 'target_name': 'audio_device_unittest',
321 'type': 'executable',
322 'dependencies': [
323 'audio_device',
324 'webrtc_utility',
325 '<(DEPTH)/testing/gmock.gyp:gmock',
326 '<(DEPTH)/testing/gtest.gyp:gtest',
327 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
328 '<(webrtc_root)/test/test.gyp:test_support_main',
329 ],
330 'sources': [
331 'android/fine_audio_buffer_unittest.cc',
332 'android/low_latency_event_unittest.cc',
333 'android/single_rw_fifo_unittest.cc',
334 'mock/mock_audio_device_buffer.h',
335 ],
336 },
337 ],
338 }],
339 ],
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000340 }], # include_tests
niklase@google.com470e71d2011-07-07 08:21:25 +0000341 ],
342}
343