• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2011 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  'includes': [
11    '../build/common.gypi',
12  ],
13  'targets': [
14    {
15      'target_name': 'common_audio',
16      'type': 'static_library',
17      'dependencies': [
18        '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
19      ],
20      'include_dirs': [
21        'resampler/include',
22        'signal_processing/include',
23      ],
24      'direct_dependent_settings': {
25        'include_dirs': [
26          'resampler/include',
27          'signal_processing/include',
28          'vad/include',
29        ],
30      },
31      'sources': [
32        'audio_util.cc',
33        'fir_filter.cc',
34        'fir_filter.h',
35        'fir_filter_neon.h',
36        'fir_filter_sse.h',
37        'include/audio_util.h',
38        'resampler/include/push_resampler.h',
39        'resampler/include/resampler.h',
40        'resampler/push_resampler.cc',
41        'resampler/push_sinc_resampler.cc',
42        'resampler/push_sinc_resampler.h',
43        'resampler/resampler.cc',
44        'resampler/sinc_resampler.cc',
45        'resampler/sinc_resampler.h',
46        'signal_processing/include/real_fft.h',
47        'signal_processing/include/signal_processing_library.h',
48        'signal_processing/include/spl_inl.h',
49        'signal_processing/auto_corr_to_refl_coef.c',
50        'signal_processing/auto_correlation.c',
51        'signal_processing/complex_fft.c',
52        'signal_processing/complex_fft_tables.h',
53        'signal_processing/complex_bit_reverse.c',
54        'signal_processing/copy_set_operations.c',
55        'signal_processing/cross_correlation.c',
56        'signal_processing/division_operations.c',
57        'signal_processing/dot_product_with_scale.c',
58        'signal_processing/downsample_fast.c',
59        'signal_processing/energy.c',
60        'signal_processing/filter_ar.c',
61        'signal_processing/filter_ar_fast_q12.c',
62        'signal_processing/filter_ma_fast_q12.c',
63        'signal_processing/get_hanning_window.c',
64        'signal_processing/get_scaling_square.c',
65        'signal_processing/ilbc_specific_functions.c',
66        'signal_processing/levinson_durbin.c',
67        'signal_processing/lpc_to_refl_coef.c',
68        'signal_processing/min_max_operations.c',
69        'signal_processing/randomization_functions.c',
70        'signal_processing/refl_coef_to_lpc.c',
71        'signal_processing/real_fft.c',
72        'signal_processing/resample.c',
73        'signal_processing/resample_48khz.c',
74        'signal_processing/resample_by_2.c',
75        'signal_processing/resample_by_2_internal.c',
76        'signal_processing/resample_by_2_internal.h',
77        'signal_processing/resample_fractional.c',
78        'signal_processing/spl_init.c',
79        'signal_processing/spl_sqrt.c',
80        'signal_processing/spl_sqrt_floor.c',
81        'signal_processing/spl_version.c',
82        'signal_processing/splitting_filter.c',
83        'signal_processing/sqrt_of_one_minus_x_squared.c',
84        'signal_processing/vector_scaling_operations.c',
85        'vad/include/webrtc_vad.h',
86        'vad/webrtc_vad.c',
87        'vad/vad_core.c',
88        'vad/vad_core.h',
89        'vad/vad_filterbank.c',
90        'vad/vad_filterbank.h',
91        'vad/vad_gmm.c',
92        'vad/vad_gmm.h',
93        'vad/vad_sp.c',
94        'vad/vad_sp.h',
95      ],
96      'conditions': [
97        ['target_arch=="ia32" or target_arch=="x64"', {
98          'dependencies': ['common_audio_sse2',],
99        }],
100        ['target_arch=="arm" or target_arch=="armv7"', {
101          'sources': [
102            'signal_processing/complex_bit_reverse_arm.S',
103            'signal_processing/spl_sqrt_floor_arm.S',
104          ],
105          'sources!': [
106            'signal_processing/complex_bit_reverse.c',
107            'signal_processing/spl_sqrt_floor.c',
108          ],
109          'conditions': [
110            ['arm_version==7', {
111              'dependencies': ['common_audio_neon',],
112              'sources': [
113                'signal_processing/filter_ar_fast_q12_armv7.S',
114              ],
115              'sources!': [
116                'signal_processing/filter_ar_fast_q12.c',
117              ],
118            }],
119          ],  # conditions
120        }],
121        ['target_arch=="mipsel"', {
122          'sources': [
123            'signal_processing/include/spl_inl_mips.h',
124            'signal_processing/complex_bit_reverse_mips.c',
125            'signal_processing/complex_fft_mips.c',
126            'signal_processing/cross_correlation_mips.c',
127            'signal_processing/downsample_fast_mips.c',
128            'signal_processing/filter_ar_fast_q12_mips.c',
129            'signal_processing/min_max_operations_mips.c',
130            'signal_processing/resample_by_2_mips.c',
131            'signal_processing/spl_sqrt_floor_mips.c',
132          ],
133          'sources!': [
134            'signal_processing/complex_bit_reverse.c',
135            'signal_processing/complex_fft.c',
136            'signal_processing/filter_ar_fast_q12.c',
137            'signal_processing/spl_sqrt_floor.c',
138          ],
139          'conditions': [
140            ['mips_dsp_rev>0', {
141              'sources': [
142                'signal_processing/vector_scaling_operations_mips.c',
143              ],
144            }],
145          ],
146        }],
147      ],  # conditions
148      # Ignore warning on shift operator promotion.
149      'msvs_disabled_warnings': [ 4334, ],
150    },
151  ],  # targets
152  'conditions': [
153    ['target_arch=="ia32" or target_arch=="x64"', {
154      'targets': [
155        {
156          'target_name': 'common_audio_sse2',
157          'type': 'static_library',
158          'sources': [
159            'fir_filter_sse.cc',
160            'resampler/sinc_resampler_sse.cc',
161          ],
162          'cflags': ['-msse2',],
163          'xcode_settings': {
164            'OTHER_CFLAGS': ['-msse2',],
165          },
166        },
167      ],  # targets
168    }],
169    ['(target_arch=="arm" and arm_version==7) or target_arch=="armv7"', {
170      'targets': [
171        {
172          'target_name': 'common_audio_neon',
173          'type': 'static_library',
174          'includes': ['../build/arm_neon.gypi',],
175          'sources': [
176            'fir_filter_neon.cc',
177            'resampler/sinc_resampler_neon.cc',
178            'signal_processing/cross_correlation_neon.S',
179            'signal_processing/downsample_fast_neon.S',
180            'signal_processing/min_max_operations_neon.S',
181            'signal_processing/vector_scaling_operations_neon.S',
182          ],
183        },
184      ],  # targets
185    }],
186    ['include_tests==1', {
187      'targets' : [
188        {
189          'target_name': 'common_audio_unittests',
190          'type': '<(gtest_target_type)',
191          'dependencies': [
192            'common_audio',
193            '<(webrtc_root)/test/test.gyp:test_support_main',
194            '<(DEPTH)/testing/gmock.gyp:gmock',
195            '<(DEPTH)/testing/gtest.gyp:gtest',
196          ],
197          'sources': [
198            'audio_util_unittest.cc',
199            'fir_filter_unittest.cc',
200            'resampler/resampler_unittest.cc',
201            'resampler/push_resampler_unittest.cc',
202            'resampler/push_sinc_resampler_unittest.cc',
203            'resampler/sinc_resampler_unittest.cc',
204            'resampler/sinusoidal_linear_chirp_source.cc',
205            'resampler/sinusoidal_linear_chirp_source.h',
206            'signal_processing/real_fft_unittest.cc',
207            'signal_processing/signal_processing_unittest.cc',
208            'vad/vad_core_unittest.cc',
209            'vad/vad_filterbank_unittest.cc',
210            'vad/vad_gmm_unittest.cc',
211            'vad/vad_sp_unittest.cc',
212            'vad/vad_unittest.cc',
213            'vad/vad_unittest.h',
214          ],
215          'conditions': [
216            # TODO(henrike): remove build_with_chromium==1 when the bots are
217            # using Chromium's buildbots.
218            ['build_with_chromium==1 and OS=="android"', {
219              'dependencies': [
220                '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
221              ],
222            }],
223          ],
224        },
225      ],  # targets
226      'conditions': [
227        # TODO(henrike): remove build_with_chromium==1 when the bots are using
228        # Chromium's buildbots.
229        ['build_with_chromium==1 and OS=="android"', {
230          'targets': [
231            {
232              'target_name': 'common_audio_unittests_apk_target',
233              'type': 'none',
234              'dependencies': [
235                '<(apk_tests_path):common_audio_unittests_apk',
236              ],
237            },
238          ],
239        }],
240        ['test_isolation_mode != "noop"', {
241          'targets': [
242            {
243              'target_name': 'common_audio_unittests_run',
244              'type': 'none',
245              'dependencies': [
246                'common_audio_unittests',
247              ],
248              'includes': [
249                '../build/isolate.gypi',
250                'common_audio_unittests.isolate',
251              ],
252              'sources': [
253                'common_audio_unittests.isolate',
254              ],
255            },
256          ],
257        }],
258      ],
259    }],
260  ],  # conditions
261}
262