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