blob: 55ae10d3ed202b57da4fe2341500b1994de44aaf [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',
henrika@webrtc.org62f6e752015-02-11 08:38:35 +000016 '<(webrtc_root)/base/base.gyp:rtc_base_approved',
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000017 '<(webrtc_root)/common.gyp:webrtc_common',
andrew@webrtc.org34235372013-04-30 23:43:26 +000018 '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
andresp@webrtc.org86e1e482015-01-14 09:30:52 +000019 '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
niklase@google.com470e71d2011-07-07 08:21:25 +000020 ],
21 'include_dirs': [
22 '.',
niklase@google.com470e71d2011-07-07 08:21:25 +000023 '../interface',
andrew@webrtc.org236d5d32012-09-21 20:46:40 +000024 'include',
phoglund@webrtc.org8454ad12014-06-11 14:12:04 +000025 'dummy', # Contains dummy audio device implementations.
niklase@google.com470e71d2011-07-07 08:21:25 +000026 ],
27 'direct_dependent_settings': {
28 'include_dirs': [
niklase@google.com470e71d2011-07-07 08:21:25 +000029 '../interface',
andrew@webrtc.org236d5d32012-09-21 20:46:40 +000030 'include',
niklase@google.com470e71d2011-07-07 08:21:25 +000031 ],
32 },
33 # TODO(xians): Rename files to e.g. *_linux.{ext}, remove sources in conditions section
34 'sources': [
andrew@webrtc.org236d5d32012-09-21 20:46:40 +000035 'include/audio_device.h',
36 'include/audio_device_defines.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000037 'audio_device_buffer.cc',
38 'audio_device_buffer.h',
39 'audio_device_generic.cc',
40 'audio_device_generic.h',
41 'audio_device_utility.cc',
42 'audio_device_utility.h',
43 'audio_device_impl.cc',
44 'audio_device_impl.h',
45 'audio_device_config.h',
pbos@webrtc.org096515b2013-07-30 12:32:59 +000046 'dummy/audio_device_dummy.cc',
xians@google.com68efa212011-08-11 12:41:56 +000047 'dummy/audio_device_dummy.h',
pbos@webrtc.org096515b2013-07-30 12:32:59 +000048 'dummy/audio_device_utility_dummy.cc',
xians@google.com68efa212011-08-11 12:41:56 +000049 'dummy/audio_device_utility_dummy.h',
phoglund@webrtc.org8454ad12014-06-11 14:12:04 +000050 'dummy/file_audio_device.cc',
51 'dummy/file_audio_device.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000052 ],
53 'conditions': [
niklase@google.com470e71d2011-07-07 08:21:25 +000054 ['OS=="linux"', {
niklase@google.com470e71d2011-07-07 08:21:25 +000055 'include_dirs': [
xians@google.com68efa212011-08-11 12:41:56 +000056 'linux',
niklase@google.com470e71d2011-07-07 08:21:25 +000057 ],
xians@google.combf5d2ba2011-08-16 07:44:19 +000058 }], # OS==linux
sjlee@webrtc.org4b425082012-09-10 17:58:21 +000059 ['OS=="ios"', {
60 'include_dirs': [
61 'ios',
62 ],
63 }], # OS==ios
xians@google.combf5d2ba2011-08-16 07:44:19 +000064 ['OS=="mac"', {
sjlee@webrtc.org4b425082012-09-10 17:58:21 +000065 'include_dirs': [
66 'mac',
67 ],
xians@google.combf5d2ba2011-08-16 07:44:19 +000068 }], # OS==mac
69 ['OS=="win"', {
sjlee@webrtc.org4b425082012-09-10 17:58:21 +000070 'include_dirs': [
71 'win',
sjlee@webrtc.org4b425082012-09-10 17:58:21 +000072 ],
xians@google.combf5d2ba2011-08-16 07:44:19 +000073 }],
leozwang@webrtc.org4ad4c242012-02-22 16:04:59 +000074 ['OS=="android"', {
andrew@webrtc.org236d5d32012-09-21 20:46:40 +000075 'include_dirs': [
76 'android',
77 ],
leozwang@webrtc.org4ad4c242012-02-22 16:04:59 +000078 }], # OS==android
xians@google.combf5d2ba2011-08-16 07:44:19 +000079 ['include_internal_audio_device==0', {
80 'defines': [
81 'WEBRTC_DUMMY_AUDIO_BUILD',
82 ],
83 }],
phoglund@webrtc.org8454ad12014-06-11 14:12:04 +000084 ['build_with_chromium==0', {
85 'sources': [
86 # Don't link these into Chrome since they contain static data.
87 'dummy/file_audio_device_factory.cc',
88 'dummy/file_audio_device_factory.h',
89 ],
90 }],
xians@google.combf5d2ba2011-08-16 07:44:19 +000091 ['include_internal_audio_device==1', {
92 'sources': [
93 'linux/alsasymboltable_linux.cc',
94 'linux/alsasymboltable_linux.h',
95 'linux/audio_device_alsa_linux.cc',
96 'linux/audio_device_alsa_linux.h',
97 'linux/audio_device_utility_linux.cc',
98 'linux/audio_device_utility_linux.h',
99 'linux/audio_mixer_manager_alsa_linux.cc',
100 'linux/audio_mixer_manager_alsa_linux.h',
101 'linux/latebindingsymboltable_linux.cc',
102 'linux/latebindingsymboltable_linux.h',
tkchin@webrtc.org122caa52014-07-15 20:20:47 +0000103 'ios/audio_device_ios.mm',
sjlee@webrtc.org4b425082012-09-10 17:58:21 +0000104 'ios/audio_device_ios.h',
105 'ios/audio_device_utility_ios.cc',
106 'ios/audio_device_utility_ios.h',
xians@google.combf5d2ba2011-08-16 07:44:19 +0000107 'mac/audio_device_mac.cc',
108 'mac/audio_device_mac.h',
109 'mac/audio_device_utility_mac.cc',
110 'mac/audio_device_utility_mac.h',
111 'mac/audio_mixer_manager_mac.cc',
112 'mac/audio_mixer_manager_mac.h',
113 'mac/portaudio/pa_memorybarrier.h',
114 'mac/portaudio/pa_ringbuffer.c',
115 'mac/portaudio/pa_ringbuffer.h',
116 'win/audio_device_core_win.cc',
117 'win/audio_device_core_win.h',
118 'win/audio_device_wave_win.cc',
119 'win/audio_device_wave_win.h',
120 'win/audio_device_utility_win.cc',
121 'win/audio_device_utility_win.h',
122 'win/audio_mixer_manager_win.cc',
123 'win/audio_mixer_manager_win.h',
henrike@webrtc.org9ee75e92013-12-11 21:42:44 +0000124 'android/audio_device_template.h',
leozwang@webrtc.org4ad4c242012-02-22 16:04:59 +0000125 'android/audio_device_utility_android.cc',
126 'android/audio_device_utility_android.h',
henrike@webrtc.org9ee75e92013-12-11 21:42:44 +0000127 'android/audio_manager_jni.cc',
128 'android/audio_manager_jni.h',
129 'android/audio_record_jni.cc',
130 'android/audio_record_jni.h',
131 'android/audio_track_jni.cc',
132 'android/audio_track_jni.h',
133 'android/fine_audio_buffer.cc',
134 'android/fine_audio_buffer.h',
135 'android/low_latency_event_posix.cc',
136 'android/low_latency_event.h',
137 'android/opensles_common.cc',
138 'android/opensles_common.h',
139 'android/opensles_input.cc',
140 'android/opensles_input.h',
141 'android/opensles_output.cc',
142 'android/opensles_output.h',
143 'android/single_rw_fifo.cc',
144 'android/single_rw_fifo.h',
xians@google.combf5d2ba2011-08-16 07:44:19 +0000145 ],
wjia@google.com647aa162011-07-21 20:45:31 +0000146 'conditions': [
leozwang@webrtc.org3197d482012-03-02 17:12:14 +0000147 ['OS=="android"', {
148 'link_settings': {
149 'libraries': [
150 '-llog',
151 '-lOpenSLES',
152 ],
153 },
154 }],
xians@google.combf5d2ba2011-08-16 07:44:19 +0000155 ['OS=="linux"', {
wjia@google.com647aa162011-07-21 20:45:31 +0000156 'defines': [
xians@google.combf5d2ba2011-08-16 07:44:19 +0000157 'LINUX_ALSA',
wjia@google.com647aa162011-07-21 20:45:31 +0000158 ],
159 'link_settings': {
160 'libraries': [
niklas.enbom@webrtc.orge2a80062013-05-14 21:33:11 +0000161 '-ldl','-lX11',
xians@google.combf5d2ba2011-08-16 07:44:19 +0000162 ],
163 },
164 'conditions': [
165 ['include_pulse_audio==1', {
166 'defines': [
167 'LINUX_PULSE',
168 ],
169 'sources': [
170 'linux/audio_device_pulse_linux.cc',
171 'linux/audio_device_pulse_linux.h',
172 'linux/audio_mixer_manager_pulse_linux.cc',
173 'linux/audio_mixer_manager_pulse_linux.h',
174 'linux/pulseaudiosymboltable_linux.cc',
175 'linux/pulseaudiosymboltable_linux.h',
176 ],
xians@google.combf5d2ba2011-08-16 07:44:19 +0000177 }],
178 ],
179 }],
tkchin@webrtc.org122caa52014-07-15 20:20:47 +0000180 ['OS=="mac"', {
xians@google.combf5d2ba2011-08-16 07:44:19 +0000181 'link_settings': {
182 'libraries': [
183 '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
184 '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
wjia@google.com647aa162011-07-21 20:45:31 +0000185 ],
186 },
187 }],
tkchin@webrtc.org122caa52014-07-15 20:20:47 +0000188 ['OS=="ios"', {
189 'xcode_settings': {
190 'CLANG_ENABLE_OBJC_ARC': 'YES',
191 },
192 'link_settings': {
193 'xcode_settings': {
194 'OTHER_LDFLAGS': [
195 '-framework AudioToolbox',
196 '-framework AVFoundation',
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000197 '-framework Foundation',
tkchin@webrtc.org122caa52014-07-15 20:20:47 +0000198 ],
199 },
200 },
201 }],
andrew@webrtc.orga3c6d612011-09-13 17:17:49 +0000202 ['OS=="win"', {
203 'link_settings': {
204 'libraries': [
205 # Required for the built-in WASAPI AEC.
206 '-ldmoguids.lib',
207 '-lwmcodecdspuuid.lib',
208 '-lamstrmid.lib',
209 '-lmsdmo.lib',
210 ],
211 },
212 }],
xians@google.combf5d2ba2011-08-16 07:44:19 +0000213 ], # conditions
214 }], # include_internal_audio_device==1
215 ], # conditions
niklase@google.com470e71d2011-07-07 08:21:25 +0000216 },
xians@google.com7fa20c32011-08-05 12:04:30 +0000217 ],
kjellander@webrtc.org67fdd702012-03-09 08:11:04 +0000218 'conditions': [
mflodman@webrtc.org6af95942012-05-24 13:23:35 +0000219 ['include_tests==1', {
xians@google.com7fa20c32011-08-05 12:04:30 +0000220 'targets': [
221 {
phoglund@webrtc.org32fe90b2013-08-19 11:40:19 +0000222 'target_name': 'audio_device_tests',
xians@google.com7fa20c32011-08-05 12:04:30 +0000223 'type': 'executable',
224 'dependencies': [
xians@google.com3d292f12011-08-05 08:32:13 +0000225 'audio_device',
xians@google.comd3185fe2011-09-12 12:24:39 +0000226 'webrtc_utility',
andrew@webrtc.org81cf5e42012-06-27 01:41:54 +0000227 '<(webrtc_root)/test/test.gyp:test_support_main',
228 '<(DEPTH)/testing/gtest.gyp:gtest',
andresp@webrtc.org86e1e482015-01-14 09:30:52 +0000229 '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
xians@google.com3d292f12011-08-05 08:32:13 +0000230 ],
231 'sources': [
andrew@webrtc.org236d5d32012-09-21 20:46:40 +0000232 'test/audio_device_test_api.cc',
233 'test/audio_device_test_defines.h',
xians@google.com3d292f12011-08-05 08:32:13 +0000234 ],
235 },
236 {
237 'target_name': 'audio_device_test_func',
238 'type': 'executable',
239 'dependencies': [
240 'audio_device',
xians@google.comd3185fe2011-09-12 12:24:39 +0000241 'webrtc_utility',
andrew@webrtc.org34235372013-04-30 23:43:26 +0000242 '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
andresp@webrtc.org86e1e482015-01-14 09:30:52 +0000243 '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
andrew@webrtc.org81cf5e42012-06-27 01:41:54 +0000244 '<(webrtc_root)/test/test.gyp:test_support',
245 '<(DEPTH)/testing/gtest.gyp:gtest',
xians@google.com3d292f12011-08-05 08:32:13 +0000246 ],
247 'sources': [
andrew@webrtc.org236d5d32012-09-21 20:46:40 +0000248 'test/audio_device_test_func.cc',
249 'test/audio_device_test_defines.h',
250 'test/func_test_manager.cc',
251 'test/func_test_manager.h',
xians@google.com3d292f12011-08-05 08:32:13 +0000252 ],
xians@google.com7fa20c32011-08-05 12:04:30 +0000253 },
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000254 ], # targets
255 'conditions': [
256 ['test_isolation_mode != "noop"', {
257 'targets': [
258 {
259 'target_name': 'audio_device_tests_run',
260 'type': 'none',
261 'dependencies': [
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000262 'audio_device_tests',
263 ],
264 'includes': [
kjellander@webrtc.org2a973172013-10-02 19:31:16 +0000265 '../../build/isolate.gypi',
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000266 ],
267 'sources': [
268 'audio_device_tests.isolate',
269 ],
270 },
271 ],
272 }],
henrike@webrtc.org1fdc51a2013-10-02 14:58:19 +0000273 ['OS=="android" and enable_android_opensl==1', {
274 'targets': [
275 {
henrike@webrtc.org82f014a2013-09-10 18:24:07 +0000276 'target_name': 'audio_device_unittest',
277 'type': 'executable',
278 'dependencies': [
279 'audio_device',
280 'webrtc_utility',
281 '<(DEPTH)/testing/gmock.gyp:gmock',
282 '<(DEPTH)/testing/gtest.gyp:gtest',
andresp@webrtc.org86e1e482015-01-14 09:30:52 +0000283 '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
henrike@webrtc.org82f014a2013-09-10 18:24:07 +0000284 '<(webrtc_root)/test/test.gyp:test_support_main',
285 ],
286 'sources': [
287 'android/fine_audio_buffer_unittest.cc',
288 'android/low_latency_event_unittest.cc',
289 'android/single_rw_fifo_unittest.cc',
290 'mock/mock_audio_device_buffer.h',
291 ],
292 },
293 ],
294 }],
295 ],
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000296 }], # include_tests
niklase@google.com470e71d2011-07-07 08:21:25 +0000297 ],
298}
299