Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / audio_device / audio_device.gypi
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)/common_audio/common_audio.gyp:common_audio',
17         '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
18       ],
19       'include_dirs': [
20         '.',
21         '../interface',
22         'include',
23         'dummy',  # Contains dummy audio device implementations.
24       ],
25       'direct_dependent_settings': {
26         'include_dirs': [
27           '../interface',
28           'include',
29         ],
30       },
31       # TODO(xians): Rename files to e.g. *_linux.{ext}, remove sources in conditions section
32       'sources': [
33         'include/audio_device.h',
34         'include/audio_device_defines.h',
35         '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',
44         'dummy/audio_device_dummy.cc',
45         'dummy/audio_device_dummy.h',
46         'dummy/audio_device_utility_dummy.cc',
47         'dummy/audio_device_utility_dummy.h',
48         'dummy/file_audio_device.cc',
49         'dummy/file_audio_device.h',
50       ],
51       'conditions': [
52         ['OS=="linux"', {
53           'include_dirs': [
54             'linux',
55           ],
56         }], # OS==linux
57         ['OS=="ios"', {
58           'include_dirs': [
59             'ios',
60           ],
61         }], # OS==ios
62         ['OS=="mac"', {
63           'include_dirs': [
64             'mac',
65           ],
66         }], # OS==mac
67         ['OS=="win"', {
68           'include_dirs': [
69             'win',
70           ],
71         }],
72         ['OS=="android"', {
73           'include_dirs': [
74             'android',
75           ],
76         }], # OS==android
77         ['include_internal_audio_device==0', {
78           'defines': [
79             'WEBRTC_DUMMY_AUDIO_BUILD',
80           ],
81         }],
82         ['build_with_chromium==0', {
83           'sources': [
84             # Don't link these into Chrome since they contain static data.
85             'dummy/file_audio_device_factory.cc',
86             'dummy/file_audio_device_factory.h',
87           ],
88         }],
89         ['include_internal_audio_device==1', {
90           'sources': [
91             'linux/alsasymboltable_linux.cc',
92             'linux/alsasymboltable_linux.h',
93             'linux/audio_device_alsa_linux.cc',
94             'linux/audio_device_alsa_linux.h',
95             'linux/audio_device_utility_linux.cc',
96             'linux/audio_device_utility_linux.h',
97             'linux/audio_mixer_manager_alsa_linux.cc',
98             'linux/audio_mixer_manager_alsa_linux.h',
99             'linux/latebindingsymboltable_linux.cc',
100             'linux/latebindingsymboltable_linux.h',
101             'ios/audio_device_ios.mm',
102             'ios/audio_device_ios.h',
103             'ios/audio_device_utility_ios.cc',
104             'ios/audio_device_utility_ios.h',
105             'mac/audio_device_mac.cc',
106             'mac/audio_device_mac.h',
107             'mac/audio_device_utility_mac.cc',
108             'mac/audio_device_utility_mac.h',
109             'mac/audio_mixer_manager_mac.cc',
110             'mac/audio_mixer_manager_mac.h',
111             'mac/portaudio/pa_memorybarrier.h',
112             'mac/portaudio/pa_ringbuffer.c',
113             'mac/portaudio/pa_ringbuffer.h',
114             'win/audio_device_core_win.cc',
115             'win/audio_device_core_win.h',
116             'win/audio_device_wave_win.cc',
117             'win/audio_device_wave_win.h',
118             'win/audio_device_utility_win.cc',
119             'win/audio_device_utility_win.h',
120             'win/audio_mixer_manager_win.cc',
121             'win/audio_mixer_manager_win.h',
122             'android/audio_device_template.h',
123             'android/audio_device_utility_android.cc',
124             'android/audio_device_utility_android.h',
125             'android/audio_manager_jni.cc',
126             'android/audio_manager_jni.h',
127             'android/audio_record_jni.cc',
128             'android/audio_record_jni.h',
129             'android/audio_track_jni.cc',
130             'android/audio_track_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',
143           ],
144           'conditions': [
145             ['OS=="android"', {
146               'link_settings': {
147                 'libraries': [
148                   '-llog',
149                   '-lOpenSLES',
150                 ],
151               },
152             }],
153             ['OS=="linux"', {
154               'defines': [
155                 'LINUX_ALSA',
156               ],
157               'link_settings': {
158                 'libraries': [
159                   '-ldl','-lX11',
160                 ],
161               },
162               'conditions': [
163                 ['include_pulse_audio==1', {
164                   'defines': [
165                     'LINUX_PULSE',
166                   ],
167                   'sources': [
168                     'linux/audio_device_pulse_linux.cc',
169                     'linux/audio_device_pulse_linux.h',
170                     'linux/audio_mixer_manager_pulse_linux.cc',
171                     'linux/audio_mixer_manager_pulse_linux.h',
172                     'linux/pulseaudiosymboltable_linux.cc',
173                     'linux/pulseaudiosymboltable_linux.h',
174                   ],
175                 }],
176               ],
177             }],
178             ['OS=="mac"', {
179               'link_settings': {
180                 'libraries': [
181                   '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
182                   '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
183                 ],
184               },
185             }],
186             ['OS=="ios"', {
187               'xcode_settings': {
188                 'CLANG_ENABLE_OBJC_ARC': 'YES',
189               },
190               'link_settings': {
191                 'xcode_settings': {
192                   'OTHER_LDFLAGS': [
193                     '-framework AudioToolbox',
194                     '-framework AVFoundation',
195                   ],
196                 },
197               },
198             }],
199             ['OS=="win"', {
200               'link_settings': {
201                 'libraries': [
202                   # Required for the built-in WASAPI AEC.
203                   '-ldmoguids.lib',
204                   '-lwmcodecdspuuid.lib',
205                   '-lamstrmid.lib',
206                   '-lmsdmo.lib',
207                 ],
208               },
209             }],
210           ], # conditions
211         }], # include_internal_audio_device==1
212       ], # conditions
213     },
214   ],
215   'conditions': [
216     ['include_tests==1', {
217       'targets': [
218         {
219           'target_name': 'audio_device_tests',
220          'type': 'executable',
221          'dependencies': [
222             'audio_device',
223             'webrtc_utility',
224             '<(webrtc_root)/test/test.gyp:test_support_main',
225             '<(DEPTH)/testing/gtest.gyp:gtest',
226             '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
227           ],
228           'sources': [
229             'test/audio_device_test_api.cc',
230             'test/audio_device_test_defines.h',
231           ],
232         },
233         {
234           'target_name': 'audio_device_test_func',
235           'type': 'executable',
236           'dependencies': [
237             'audio_device',
238             'webrtc_utility',
239             '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
240             '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
241             '<(webrtc_root)/test/test.gyp:test_support',
242             '<(DEPTH)/testing/gtest.gyp:gtest',
243           ],
244           'sources': [
245             'test/audio_device_test_func.cc',
246             'test/audio_device_test_defines.h',
247             'test/func_test_manager.cc',
248             'test/func_test_manager.h',
249           ],
250         },
251       ], # targets
252       'conditions': [
253         ['test_isolation_mode != "noop"', {
254           'targets': [
255             {
256               'target_name': 'audio_device_tests_run',
257               'type': 'none',
258               'dependencies': [
259                 'audio_device_tests',
260               ],
261               'includes': [
262                 '../../build/isolate.gypi',
263               ],
264               'sources': [
265                 'audio_device_tests.isolate',
266               ],
267             },
268           ],
269         }],
270         ['OS=="android" and enable_android_opensl==1', {
271           'targets': [
272             {
273               'target_name': 'audio_device_unittest',
274               'type': 'executable',
275               'dependencies': [
276                 'audio_device',
277                 'webrtc_utility',
278                 '<(DEPTH)/testing/gmock.gyp:gmock',
279                 '<(DEPTH)/testing/gtest.gyp:gtest',
280                 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
281                 '<(webrtc_root)/test/test.gyp:test_support_main',
282               ],
283               'sources': [
284                 'android/fine_audio_buffer_unittest.cc',
285                 'android/low_latency_event_unittest.cc',
286                 'android/single_rw_fifo_unittest.cc',
287                 'mock/mock_audio_device_buffer.h',
288               ],
289             },
290           ],
291         }],
292       ],
293     }], # include_tests
294   ],
295 }
296