blob: 944f4222df9cb9c6ffce62078cc784c3cf4afd7a [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',
henrike@webrtc.org9ee75e92013-12-11 21:42:44 +0000113 'android/audio_device_template.h',
leozwang@webrtc.org4ad4c242012-02-22 16:04:59 +0000114 'android/audio_device_utility_android.cc',
115 'android/audio_device_utility_android.h',
henrike@webrtc.org9ee75e92013-12-11 21:42:44 +0000116 'android/audio_manager_jni.cc',
117 'android/audio_manager_jni.h',
118 'android/audio_record_jni.cc',
119 'android/audio_record_jni.h',
120 'android/audio_track_jni.cc',
121 'android/audio_track_jni.h',
122 'android/fine_audio_buffer.cc',
123 'android/fine_audio_buffer.h',
124 'android/low_latency_event_posix.cc',
125 'android/low_latency_event.h',
126 'android/opensles_common.cc',
127 'android/opensles_common.h',
128 'android/opensles_input.cc',
129 'android/opensles_input.h',
130 'android/opensles_output.cc',
131 'android/opensles_output.h',
132 'android/single_rw_fifo.cc',
133 'android/single_rw_fifo.h',
xians@google.combf5d2ba2011-08-16 07:44:19 +0000134 ],
wjia@google.com647aa162011-07-21 20:45:31 +0000135 'conditions': [
leozwang@webrtc.org3197d482012-03-02 17:12:14 +0000136 ['OS=="android"', {
137 'link_settings': {
138 'libraries': [
139 '-llog',
140 '-lOpenSLES',
141 ],
142 },
143 }],
xians@google.combf5d2ba2011-08-16 07:44:19 +0000144 ['OS=="linux"', {
wjia@google.com647aa162011-07-21 20:45:31 +0000145 'defines': [
xians@google.combf5d2ba2011-08-16 07:44:19 +0000146 'LINUX_ALSA',
wjia@google.com647aa162011-07-21 20:45:31 +0000147 ],
148 'link_settings': {
149 'libraries': [
niklas.enbom@webrtc.orge2a80062013-05-14 21:33:11 +0000150 '-ldl','-lX11',
xians@google.combf5d2ba2011-08-16 07:44:19 +0000151 ],
152 },
153 'conditions': [
154 ['include_pulse_audio==1', {
155 'defines': [
156 'LINUX_PULSE',
157 ],
158 'sources': [
159 'linux/audio_device_pulse_linux.cc',
160 'linux/audio_device_pulse_linux.h',
161 'linux/audio_mixer_manager_pulse_linux.cc',
162 'linux/audio_mixer_manager_pulse_linux.h',
163 'linux/pulseaudiosymboltable_linux.cc',
164 'linux/pulseaudiosymboltable_linux.h',
165 ],
xians@google.combf5d2ba2011-08-16 07:44:19 +0000166 }],
167 ],
168 }],
sjlee@webrtc.org4b425082012-09-10 17:58:21 +0000169 ['OS=="mac" or OS=="ios"', {
xians@google.combf5d2ba2011-08-16 07:44:19 +0000170 'link_settings': {
171 'libraries': [
172 '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
173 '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
wjia@google.com647aa162011-07-21 20:45:31 +0000174 ],
175 },
176 }],
andrew@webrtc.orga3c6d612011-09-13 17:17:49 +0000177 ['OS=="win"', {
178 'link_settings': {
179 'libraries': [
180 # Required for the built-in WASAPI AEC.
181 '-ldmoguids.lib',
182 '-lwmcodecdspuuid.lib',
183 '-lamstrmid.lib',
184 '-lmsdmo.lib',
185 ],
186 },
187 }],
xians@google.combf5d2ba2011-08-16 07:44:19 +0000188 ], # conditions
189 }], # include_internal_audio_device==1
190 ], # conditions
niklase@google.com470e71d2011-07-07 08:21:25 +0000191 },
xians@google.com7fa20c32011-08-05 12:04:30 +0000192 ],
kjellander@webrtc.org67fdd702012-03-09 08:11:04 +0000193 'conditions': [
mflodman@webrtc.org6af95942012-05-24 13:23:35 +0000194 ['include_tests==1', {
xians@google.com7fa20c32011-08-05 12:04:30 +0000195 'targets': [
196 {
phoglund@webrtc.org32fe90b2013-08-19 11:40:19 +0000197 'target_name': 'audio_device_tests',
xians@google.com7fa20c32011-08-05 12:04:30 +0000198 'type': 'executable',
199 'dependencies': [
xians@google.com3d292f12011-08-05 08:32:13 +0000200 'audio_device',
xians@google.comd3185fe2011-09-12 12:24:39 +0000201 'webrtc_utility',
andrew@webrtc.org81cf5e42012-06-27 01:41:54 +0000202 '<(webrtc_root)/test/test.gyp:test_support_main',
203 '<(DEPTH)/testing/gtest.gyp:gtest',
xians@google.comd3185fe2011-09-12 12:24:39 +0000204 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
xians@google.com3d292f12011-08-05 08:32:13 +0000205 ],
206 'sources': [
andrew@webrtc.org236d5d32012-09-21 20:46:40 +0000207 'test/audio_device_test_api.cc',
208 'test/audio_device_test_defines.h',
xians@google.com3d292f12011-08-05 08:32:13 +0000209 ],
210 },
211 {
212 'target_name': 'audio_device_test_func',
213 'type': 'executable',
214 'dependencies': [
215 'audio_device',
xians@google.comd3185fe2011-09-12 12:24:39 +0000216 'webrtc_utility',
andrew@webrtc.org34235372013-04-30 23:43:26 +0000217 '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
xians@google.comd3185fe2011-09-12 12:24:39 +0000218 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
andrew@webrtc.org81cf5e42012-06-27 01:41:54 +0000219 '<(webrtc_root)/test/test.gyp:test_support',
220 '<(DEPTH)/testing/gtest.gyp:gtest',
xians@google.com3d292f12011-08-05 08:32:13 +0000221 ],
222 'sources': [
andrew@webrtc.org236d5d32012-09-21 20:46:40 +0000223 'test/audio_device_test_func.cc',
224 'test/audio_device_test_defines.h',
225 'test/func_test_manager.cc',
226 'test/func_test_manager.h',
xians@google.com3d292f12011-08-05 08:32:13 +0000227 ],
xians@google.com7fa20c32011-08-05 12:04:30 +0000228 },
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000229 ], # targets
230 'conditions': [
231 ['test_isolation_mode != "noop"', {
232 'targets': [
233 {
234 'target_name': 'audio_device_tests_run',
235 'type': 'none',
236 'dependencies': [
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000237 'audio_device_tests',
238 ],
239 'includes': [
kjellander@webrtc.org2a973172013-10-02 19:31:16 +0000240 '../../build/isolate.gypi',
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000241 'audio_device_tests.isolate',
242 ],
243 'sources': [
244 'audio_device_tests.isolate',
245 ],
246 },
247 ],
248 }],
henrike@webrtc.org1fdc51a2013-10-02 14:58:19 +0000249 ['OS=="android" and enable_android_opensl==1', {
250 'targets': [
251 {
henrike@webrtc.org82f014a2013-09-10 18:24:07 +0000252 'target_name': 'audio_device_unittest',
253 'type': 'executable',
254 'dependencies': [
255 'audio_device',
256 'webrtc_utility',
257 '<(DEPTH)/testing/gmock.gyp:gmock',
258 '<(DEPTH)/testing/gtest.gyp:gtest',
259 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
260 '<(webrtc_root)/test/test.gyp:test_support_main',
261 ],
262 'sources': [
263 'android/fine_audio_buffer_unittest.cc',
264 'android/low_latency_event_unittest.cc',
265 'android/single_rw_fifo_unittest.cc',
266 'mock/mock_audio_device_buffer.h',
267 ],
268 },
269 ],
270 }],
271 ],
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000272 }], # include_tests
niklase@google.com470e71d2011-07-07 08:21:25 +0000273 ],
274}
275