blob: 54b36d458db9ec97b4c80dc207081674f8432c7b [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': [
andrew@webrtc.org34235372013-04-30 23:43:26 +000015 '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
xians@google.comd3185fe2011-09-12 12:24:39 +000016 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
niklase@google.com470e71d2011-07-07 08:21:25 +000017 ],
18 'include_dirs': [
19 '.',
niklase@google.com470e71d2011-07-07 08:21:25 +000020 '../interface',
andrew@webrtc.org236d5d32012-09-21 20:46:40 +000021 'include',
xians@google.com68efa212011-08-11 12:41:56 +000022 'dummy', # dummy audio device
niklase@google.com470e71d2011-07-07 08:21:25 +000023 ],
24 'direct_dependent_settings': {
25 'include_dirs': [
niklase@google.com470e71d2011-07-07 08:21:25 +000026 '../interface',
andrew@webrtc.org236d5d32012-09-21 20:46:40 +000027 'include',
niklase@google.com470e71d2011-07-07 08:21:25 +000028 ],
29 },
30 # TODO(xians): Rename files to e.g. *_linux.{ext}, remove sources in conditions section
31 'sources': [
andrew@webrtc.org236d5d32012-09-21 20:46:40 +000032 'include/audio_device.h',
33 'include/audio_device_defines.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000034 'audio_device_buffer.cc',
35 'audio_device_buffer.h',
36 'audio_device_generic.cc',
37 'audio_device_generic.h',
38 'audio_device_utility.cc',
39 'audio_device_utility.h',
40 'audio_device_impl.cc',
41 'audio_device_impl.h',
42 'audio_device_config.h',
xians@google.com68efa212011-08-11 12:41:56 +000043 'dummy/audio_device_dummy.h',
xians@google.com68efa212011-08-11 12:41:56 +000044 'dummy/audio_device_utility_dummy.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000045 ],
46 'conditions': [
niklase@google.com470e71d2011-07-07 08:21:25 +000047 ['OS=="linux"', {
niklase@google.com470e71d2011-07-07 08:21:25 +000048 'include_dirs': [
xians@google.com68efa212011-08-11 12:41:56 +000049 'linux',
niklase@google.com470e71d2011-07-07 08:21:25 +000050 ],
xians@google.combf5d2ba2011-08-16 07:44:19 +000051 }], # OS==linux
sjlee@webrtc.org4b425082012-09-10 17:58:21 +000052 ['OS=="ios"', {
53 'include_dirs': [
54 'ios',
55 ],
56 }], # OS==ios
xians@google.combf5d2ba2011-08-16 07:44:19 +000057 ['OS=="mac"', {
sjlee@webrtc.org4b425082012-09-10 17:58:21 +000058 'include_dirs': [
59 'mac',
60 ],
xians@google.combf5d2ba2011-08-16 07:44:19 +000061 }], # OS==mac
62 ['OS=="win"', {
sjlee@webrtc.org4b425082012-09-10 17:58:21 +000063 'include_dirs': [
64 'win',
sjlee@webrtc.org4b425082012-09-10 17:58:21 +000065 ],
xians@google.combf5d2ba2011-08-16 07:44:19 +000066 }],
leozwang@webrtc.org4ad4c242012-02-22 16:04:59 +000067 ['OS=="android"', {
andrew@webrtc.org236d5d32012-09-21 20:46:40 +000068 'include_dirs': [
69 'android',
70 ],
leozwang@webrtc.org4ad4c242012-02-22 16:04:59 +000071 }], # OS==android
xians@google.combf5d2ba2011-08-16 07:44:19 +000072 ['include_internal_audio_device==0', {
73 'defines': [
74 'WEBRTC_DUMMY_AUDIO_BUILD',
75 ],
76 }],
77 ['include_internal_audio_device==1', {
78 'sources': [
79 'linux/alsasymboltable_linux.cc',
80 'linux/alsasymboltable_linux.h',
81 'linux/audio_device_alsa_linux.cc',
82 'linux/audio_device_alsa_linux.h',
83 'linux/audio_device_utility_linux.cc',
84 'linux/audio_device_utility_linux.h',
85 'linux/audio_mixer_manager_alsa_linux.cc',
86 'linux/audio_mixer_manager_alsa_linux.h',
87 'linux/latebindingsymboltable_linux.cc',
88 'linux/latebindingsymboltable_linux.h',
sjlee@webrtc.org4b425082012-09-10 17:58:21 +000089 'ios/audio_device_ios.cc',
90 'ios/audio_device_ios.h',
91 'ios/audio_device_utility_ios.cc',
92 'ios/audio_device_utility_ios.h',
xians@google.combf5d2ba2011-08-16 07:44:19 +000093 'mac/audio_device_mac.cc',
94 'mac/audio_device_mac.h',
95 'mac/audio_device_utility_mac.cc',
96 'mac/audio_device_utility_mac.h',
97 'mac/audio_mixer_manager_mac.cc',
98 'mac/audio_mixer_manager_mac.h',
99 'mac/portaudio/pa_memorybarrier.h',
100 'mac/portaudio/pa_ringbuffer.c',
101 'mac/portaudio/pa_ringbuffer.h',
102 'win/audio_device_core_win.cc',
103 'win/audio_device_core_win.h',
104 'win/audio_device_wave_win.cc',
105 'win/audio_device_wave_win.h',
106 'win/audio_device_utility_win.cc',
107 'win/audio_device_utility_win.h',
108 'win/audio_mixer_manager_win.cc',
109 'win/audio_mixer_manager_win.h',
leozwang@webrtc.org4ad4c242012-02-22 16:04:59 +0000110 'android/audio_device_utility_android.cc',
111 'android/audio_device_utility_android.h',
xians@google.combf5d2ba2011-08-16 07:44:19 +0000112 ],
wjia@google.com647aa162011-07-21 20:45:31 +0000113 'conditions': [
leozwang@webrtc.org3197d482012-03-02 17:12:14 +0000114 ['OS=="android"', {
115 'link_settings': {
116 'libraries': [
117 '-llog',
118 '-lOpenSLES',
119 ],
120 },
leozwang@webrtc.org2db85bc2012-09-18 20:19:00 +0000121 'conditions': [
122 ['enable_android_opensl==1', {
123 'sources': [
leozwang@webrtc.org2a84f632012-10-03 21:40:06 +0000124 'android/audio_device_opensles_android.cc',
125 'android/audio_device_opensles_android.h',
leozwang@webrtc.org2db85bc2012-09-18 20:19:00 +0000126 ],
127 }, {
128 'sources': [
leozwang@webrtc.org2a84f632012-10-03 21:40:06 +0000129 'android/audio_device_jni_android.cc',
130 'android/audio_device_jni_android.h',
leozwang@webrtc.org2db85bc2012-09-18 20:19:00 +0000131 ],
132 }],
133 ],
leozwang@webrtc.org3197d482012-03-02 17:12:14 +0000134 }],
xians@google.combf5d2ba2011-08-16 07:44:19 +0000135 ['OS=="linux"', {
wjia@google.com647aa162011-07-21 20:45:31 +0000136 'defines': [
xians@google.combf5d2ba2011-08-16 07:44:19 +0000137 'LINUX_ALSA',
wjia@google.com647aa162011-07-21 20:45:31 +0000138 ],
139 'link_settings': {
140 'libraries': [
niklas.enbom@webrtc.orge2a80062013-05-14 21:33:11 +0000141 '-ldl','-lX11',
xians@google.combf5d2ba2011-08-16 07:44:19 +0000142 ],
143 },
144 'conditions': [
145 ['include_pulse_audio==1', {
146 'defines': [
147 'LINUX_PULSE',
148 ],
149 'sources': [
150 'linux/audio_device_pulse_linux.cc',
151 'linux/audio_device_pulse_linux.h',
152 'linux/audio_mixer_manager_pulse_linux.cc',
153 'linux/audio_mixer_manager_pulse_linux.h',
154 'linux/pulseaudiosymboltable_linux.cc',
155 'linux/pulseaudiosymboltable_linux.h',
156 ],
xians@google.combf5d2ba2011-08-16 07:44:19 +0000157 }],
158 ],
159 }],
sjlee@webrtc.org4b425082012-09-10 17:58:21 +0000160 ['OS=="mac" or OS=="ios"', {
xians@google.combf5d2ba2011-08-16 07:44:19 +0000161 'link_settings': {
162 'libraries': [
163 '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
164 '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
wjia@google.com647aa162011-07-21 20:45:31 +0000165 ],
166 },
167 }],
andrew@webrtc.orga3c6d612011-09-13 17:17:49 +0000168 ['OS=="win"', {
169 'link_settings': {
170 'libraries': [
171 # Required for the built-in WASAPI AEC.
172 '-ldmoguids.lib',
173 '-lwmcodecdspuuid.lib',
174 '-lamstrmid.lib',
175 '-lmsdmo.lib',
176 ],
177 },
178 }],
xians@google.combf5d2ba2011-08-16 07:44:19 +0000179 ], # conditions
180 }], # include_internal_audio_device==1
181 ], # conditions
niklase@google.com470e71d2011-07-07 08:21:25 +0000182 },
xians@google.com7fa20c32011-08-05 12:04:30 +0000183 ],
kjellander@webrtc.org67fdd702012-03-09 08:11:04 +0000184 'conditions': [
mflodman@webrtc.org6af95942012-05-24 13:23:35 +0000185 ['include_tests==1', {
xians@google.com7fa20c32011-08-05 12:04:30 +0000186 'targets': [
187 {
kjellander@webrtc.org63e98882013-06-14 20:09:44 +0000188 'target_name': 'audio_device_integrationtests',
xians@google.com7fa20c32011-08-05 12:04:30 +0000189 'type': 'executable',
190 'dependencies': [
xians@google.com3d292f12011-08-05 08:32:13 +0000191 'audio_device',
xians@google.comd3185fe2011-09-12 12:24:39 +0000192 'webrtc_utility',
andrew@webrtc.org81cf5e42012-06-27 01:41:54 +0000193 '<(webrtc_root)/test/test.gyp:test_support_main',
194 '<(DEPTH)/testing/gtest.gyp:gtest',
xians@google.comd3185fe2011-09-12 12:24:39 +0000195 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
xians@google.com3d292f12011-08-05 08:32:13 +0000196 ],
197 'sources': [
andrew@webrtc.org236d5d32012-09-21 20:46:40 +0000198 'test/audio_device_test_api.cc',
199 'test/audio_device_test_defines.h',
xians@google.com3d292f12011-08-05 08:32:13 +0000200 ],
201 },
202 {
203 'target_name': 'audio_device_test_func',
204 'type': 'executable',
205 'dependencies': [
206 'audio_device',
xians@google.comd3185fe2011-09-12 12:24:39 +0000207 'webrtc_utility',
andrew@webrtc.org34235372013-04-30 23:43:26 +0000208 '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
xians@google.comd3185fe2011-09-12 12:24:39 +0000209 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
andrew@webrtc.org81cf5e42012-06-27 01:41:54 +0000210 '<(webrtc_root)/test/test.gyp:test_support',
211 '<(DEPTH)/testing/gtest.gyp:gtest',
xians@google.com3d292f12011-08-05 08:32:13 +0000212 ],
213 'sources': [
andrew@webrtc.org236d5d32012-09-21 20:46:40 +0000214 'test/audio_device_test_func.cc',
215 'test/audio_device_test_defines.h',
216 'test/func_test_manager.cc',
217 'test/func_test_manager.h',
xians@google.com3d292f12011-08-05 08:32:13 +0000218 ],
xians@google.com7fa20c32011-08-05 12:04:30 +0000219 },
niklase@google.com470e71d2011-07-07 08:21:25 +0000220 ],
xians@google.com7fa20c32011-08-05 12:04:30 +0000221 }],
niklase@google.com470e71d2011-07-07 08:21:25 +0000222 ],
223}
224