Upstream version 11.39.250.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / audio_processing / audio_processing.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   'variables': {
11     'audio_processing_dependencies': [
12       '<(webrtc_root)/base/base.gyp:rtc_base_approved',
13       '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
14       '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
15     ],
16     'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/audio_processing/asm_offsets',
17   },
18   'targets': [
19     {
20       'target_name': 'audio_processing',
21       'type': 'static_library',
22       'variables': {
23         # Outputs some low-level debug files.
24         'aec_debug_dump%': 0,
25         'agc_debug_dump%': 0,
26
27         # Disables the usual mode where we trust the reported system delay
28         # values the AEC receives. The corresponding define is set appropriately
29         # in the code, but it can be force-enabled here for testing.
30         'aec_untrusted_delay_for_testing%': 0,
31       },
32       'dependencies': [
33         '<@(audio_processing_dependencies)',
34       ],
35       'sources': [
36         'aec/include/echo_cancellation.h',
37         'aec/echo_cancellation.c',
38         'aec/echo_cancellation_internal.h',
39         'aec/aec_core.h',
40         'aec/aec_core.c',
41         'aec/aec_core_internal.h',
42         'aec/aec_rdft.h',
43         'aec/aec_rdft.c',
44         'aec/aec_resampler.h',
45         'aec/aec_resampler.c',
46         'aecm/include/echo_control_mobile.h',
47         'aecm/echo_control_mobile.c',
48         'aecm/aecm_core.c',
49         'aecm/aecm_core.h',
50         'agc/include/gain_control.h',
51         'agc/analog_agc.c',
52         'agc/analog_agc.h',
53         'agc/digital_agc.c',
54         'agc/digital_agc.h',
55         'audio_buffer.cc',
56         'audio_buffer.h',
57         'audio_processing_impl.cc',
58         'audio_processing_impl.h',
59         'common.h',
60         'echo_cancellation_impl.cc',
61         'echo_cancellation_impl.h',
62         'echo_control_mobile_impl.cc',
63         'echo_control_mobile_impl.h',
64         'gain_control_impl.cc',
65         'gain_control_impl.h',
66         'high_pass_filter_impl.cc',
67         'high_pass_filter_impl.h',
68         'include/audio_processing.h',
69         'level_estimator_impl.cc',
70         'level_estimator_impl.h',
71         'noise_suppression_impl.cc',
72         'noise_suppression_impl.h',
73         'processing_component.cc',
74         'processing_component.h',
75         'rms_level.cc',
76         'rms_level.h',
77         'typing_detection.cc',
78         'typing_detection.h',
79         'utility/delay_estimator.c',
80         'utility/delay_estimator.h',
81         'utility/delay_estimator_internal.h',
82         'utility/delay_estimator_wrapper.c',
83         'utility/delay_estimator_wrapper.h',
84         'utility/fft4g.c',
85         'utility/fft4g.h',
86         'utility/ring_buffer.c',
87         'utility/ring_buffer.h',
88         'voice_detection_impl.cc',
89         'voice_detection_impl.h',
90       ],
91       'conditions': [
92         ['aec_debug_dump==1', {
93           'defines': ['WEBRTC_AEC_DEBUG_DUMP',],
94         }],
95         ['aec_untrusted_delay_for_testing==1', {
96           'defines': ['WEBRTC_UNTRUSTED_DELAY',],
97         }],
98         ['agc_debug_dump==1', {
99           'defines': ['WEBRTC_AGC_DEBUG_DUMP',],
100         }],
101         ['enable_protobuf==1', {
102           'dependencies': ['audioproc_debug_proto'],
103           'defines': ['WEBRTC_AUDIOPROC_DEBUG_DUMP'],
104         }],
105         ['prefer_fixed_point==1', {
106           'defines': ['WEBRTC_NS_FIXED'],
107           'sources': [
108             'ns/include/noise_suppression_x.h',
109             'ns/noise_suppression_x.c',
110             'ns/nsx_core.c',
111             'ns/nsx_core.h',
112             'ns/nsx_defines.h',
113           ],
114           'conditions': [
115             ['target_arch=="mipsel"', {
116               'sources': [
117                 'ns/nsx_core_mips.c',
118               ],
119             }, {
120               'sources': [
121                 'ns/nsx_core_c.c',
122               ],
123             }],
124           ],
125         }, {
126           'defines': ['WEBRTC_NS_FLOAT'],
127           'sources': [
128             'ns/defines.h',
129             'ns/include/noise_suppression.h',
130             'ns/noise_suppression.c',
131             'ns/ns_core.c',
132             'ns/ns_core.h',
133             'ns/windows_private.h',
134           ],
135         }],
136         ['target_arch=="ia32" or target_arch=="x64"', {
137           'dependencies': ['audio_processing_sse2',],
138         }],
139         ['(target_arch=="arm" and arm_version==7) or target_arch=="armv7"', {
140           'dependencies': ['audio_processing_neon',],
141         }],
142         ['target_arch=="mipsel"', {
143           'sources': [
144             'aecm/aecm_core_mips.c',
145           ],
146           'conditions': [
147             ['mips_fpu==1', {
148               'sources': [
149                 'aec/aec_core_mips.c',
150                 'aec/aec_rdft_mips.c',
151               ],
152             }],
153           ],
154         }, {
155           'sources': [
156             'aecm/aecm_core_c.c',
157           ],
158         }],
159       ],
160       # TODO(jschuh): Bug 1348: fix size_t to int truncations.
161       'msvs_disabled_warnings': [ 4267, ],
162     },
163   ],
164   'conditions': [
165     ['enable_protobuf==1', {
166       'targets': [
167         {
168           'target_name': 'audioproc_debug_proto',
169           'type': 'static_library',
170           'sources': ['debug.proto',],
171           'variables': {
172             'proto_in_dir': '.',
173             # Workaround to protect against gyp's pathname relativization when
174             # this file is included by modules.gyp.
175             'proto_out_protected': 'webrtc/audio_processing',
176             'proto_out_dir': '<(proto_out_protected)',
177           },
178           'includes': ['../../build/protoc.gypi',],
179         },
180       ],
181     }],
182     ['target_arch=="ia32" or target_arch=="x64"', {
183       'targets': [
184         {
185           'target_name': 'audio_processing_sse2',
186           'type': 'static_library',
187           'sources': [
188             'aec/aec_core_sse2.c',
189             'aec/aec_rdft_sse2.c',
190           ],
191           'cflags': ['-msse2',],
192           'xcode_settings': {
193             'OTHER_CFLAGS': ['-msse2',],
194           },
195         },
196       ],
197     }],
198     ['(target_arch=="arm" and arm_version==7) or target_arch=="armv7"', {
199       'targets': [{
200         'target_name': 'audio_processing_neon',
201         'type': 'static_library',
202         'includes': ['../../build/arm_neon.gypi',],
203         'dependencies': [
204           '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
205         ],
206         'sources': [
207           'aec/aec_core_neon.c',
208           'aec/aec_rdft_neon.c',
209           'aecm/aecm_core_neon.c',
210           'ns/nsx_core_neon.c',
211         ],
212         'conditions': [
213           ['OS=="android" or OS=="ios"', {
214             'dependencies': [
215               '<(gen_core_neon_offsets_gyp):*',
216             ],
217             'sources': [
218               'aecm/aecm_core_neon.S',
219               'ns/nsx_core_neon.S',
220             ],
221             'include_dirs': [
222               '<(shared_generated_dir)',
223             ],
224             'sources!': [
225               'aecm/aecm_core_neon.c',
226               'ns/nsx_core_neon.c',
227             ],
228             'includes!': ['../../build/arm_neon.gypi',],
229           }],
230           # Disable LTO in audio_processing_neon target due to compiler bug
231           ['use_lto==1', {
232             'cflags!': [
233               '-flto',
234               '-ffat-lto-objects',
235             ],
236           }],
237         ],
238       }],
239     }],
240   ],
241 }