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': 'voice_engine',
16      'type': 'static_library',
17      'dependencies': [
18        '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
19        '<(webrtc_root)/modules/modules.gyp:audio_coding_module',
20        '<(webrtc_root)/modules/modules.gyp:audio_conference_mixer',
21        '<(webrtc_root)/modules/modules.gyp:audio_device',
22        '<(webrtc_root)/modules/modules.gyp:audio_processing',
23        '<(webrtc_root)/modules/modules.gyp:bitrate_controller',
24        '<(webrtc_root)/modules/modules.gyp:media_file',
25        '<(webrtc_root)/modules/modules.gyp:rtp_rtcp',
26        '<(webrtc_root)/modules/modules.gyp:webrtc_utility',
27        '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
28      ],
29      'sources': [
30        '../common_types.h',
31        '../engine_configurations.h',
32        '../typedefs.h',
33        'include/voe_audio_processing.h',
34        'include/voe_base.h',
35        'include/voe_codec.h',
36        'include/voe_dtmf.h',
37        'include/voe_errors.h',
38        'include/voe_external_media.h',
39        'include/voe_file.h',
40        'include/voe_hardware.h',
41        'include/voe_neteq_stats.h',
42        'include/voe_network.h',
43        'include/voe_rtp_rtcp.h',
44        'include/voe_video_sync.h',
45        'include/voe_volume_control.h',
46        'channel.cc',
47        'channel.h',
48        'channel_manager.cc',
49        'channel_manager.h',
50        'dtmf_inband.cc',
51        'dtmf_inband.h',
52        'dtmf_inband_queue.cc',
53        'dtmf_inband_queue.h',
54        'level_indicator.cc',
55        'level_indicator.h',
56        'monitor_module.cc',
57        'monitor_module.h',
58        'network_predictor.cc',
59        'network_predictor.h',
60        'output_mixer.cc',
61        'output_mixer.h',
62        'shared_data.cc',
63        'shared_data.h',
64        'statistics.cc',
65        'statistics.h',
66        'transmit_mixer.cc',
67        'transmit_mixer.h',
68        'utility.cc',
69        'utility.h',
70        'voe_audio_processing_impl.cc',
71        'voe_audio_processing_impl.h',
72        'voe_base_impl.cc',
73        'voe_base_impl.h',
74        'voe_codec_impl.cc',
75        'voe_codec_impl.h',
76        'voe_dtmf_impl.cc',
77        'voe_dtmf_impl.h',
78        'voe_external_media_impl.cc',
79        'voe_external_media_impl.h',
80        'voe_file_impl.cc',
81        'voe_file_impl.h',
82        'voe_hardware_impl.cc',
83        'voe_hardware_impl.h',
84        'voe_neteq_stats_impl.cc',
85        'voe_neteq_stats_impl.h',
86        'voe_network_impl.cc',
87        'voe_network_impl.h',
88        'voe_rtp_rtcp_impl.cc',
89        'voe_rtp_rtcp_impl.h',
90        'voe_video_sync_impl.cc',
91        'voe_video_sync_impl.h',
92        'voe_volume_control_impl.cc',
93        'voe_volume_control_impl.h',
94        'voice_engine_defines.h',
95        'voice_engine_impl.cc',
96        'voice_engine_impl.h',
97      ],
98    },
99  ],
100  'conditions': [
101    ['OS=="win"', {
102      'defines': ['WEBRTC_DRIFT_COMPENSATION_SUPPORTED',],
103    }],
104    ['include_tests==1', {
105      'targets': [
106        {
107          'target_name': 'voice_engine_unittests',
108          'type': '<(gtest_target_type)',
109          'dependencies': [
110            'voice_engine',
111            '<(DEPTH)/testing/gtest.gyp:gtest',
112            # The rest are to satisfy the unittests' include chain.
113            # This would be unnecessary if we used qualified includes.
114            '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
115            '<(webrtc_root)/modules/modules.gyp:audio_device',
116            '<(webrtc_root)/modules/modules.gyp:audio_processing',
117            '<(webrtc_root)/modules/modules.gyp:audio_coding_module',
118            '<(webrtc_root)/modules/modules.gyp:audio_conference_mixer',
119            '<(webrtc_root)/modules/modules.gyp:media_file',
120            '<(webrtc_root)/modules/modules.gyp:rtp_rtcp',
121            '<(webrtc_root)/modules/modules.gyp:webrtc_utility',
122            '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
123            '<(webrtc_root)/test/test.gyp:test_support_main',
124          ],
125          'sources': [
126            'channel_unittest.cc',
127            'network_predictor_unittest.cc',
128            'transmit_mixer_unittest.cc',
129            'utility_unittest.cc',
130            'voe_audio_processing_unittest.cc',
131            'voe_base_unittest.cc',
132            'voe_codec_unittest.cc',
133          ],
134          'conditions': [
135            ['OS=="android"', {
136              'dependencies': [
137                '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
138              ],
139            }],
140          ],
141        },
142        {
143          'target_name': 'voe_auto_test',
144          'type': 'executable',
145          'dependencies': [
146            'voice_engine',
147            '<(DEPTH)/testing/gmock.gyp:gmock',
148            '<(DEPTH)/testing/gtest.gyp:gtest',
149            '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
150            '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
151            '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:field_trial_default',
152            '<(webrtc_root)/test/test.gyp:channel_transport',
153            '<(webrtc_root)/test/test.gyp:test_support',
154           ],
155          'sources': [
156            'test/auto_test/automated_mode.cc',
157            'test/auto_test/extended/agc_config_test.cc',
158            'test/auto_test/extended/ec_metrics_test.cc',
159            'test/auto_test/fakes/fake_external_transport.cc',
160            'test/auto_test/fakes/fake_external_transport.h',
161            'test/auto_test/fixtures/after_initialization_fixture.cc',
162            'test/auto_test/fixtures/after_initialization_fixture.h',
163            'test/auto_test/fixtures/after_streaming_fixture.cc',
164            'test/auto_test/fixtures/after_streaming_fixture.h',
165            'test/auto_test/fixtures/before_initialization_fixture.cc',
166            'test/auto_test/fixtures/before_initialization_fixture.h',
167            'test/auto_test/fixtures/before_streaming_fixture.cc',
168            'test/auto_test/fixtures/before_streaming_fixture.h',
169            'test/auto_test/standard/audio_processing_test.cc',
170            'test/auto_test/standard/codec_before_streaming_test.cc',
171            'test/auto_test/standard/codec_test.cc',
172            'test/auto_test/standard/dtmf_test.cc',
173            'test/auto_test/standard/external_media_test.cc',
174            'test/auto_test/standard/file_before_streaming_test.cc',
175            'test/auto_test/standard/file_test.cc',
176            'test/auto_test/standard/hardware_before_initializing_test.cc',
177            'test/auto_test/standard/hardware_before_streaming_test.cc',
178            'test/auto_test/standard/hardware_test.cc',
179            'test/auto_test/standard/mixing_test.cc',
180            'test/auto_test/standard/neteq_stats_test.cc',
181            'test/auto_test/standard/rtp_rtcp_before_streaming_test.cc',
182            'test/auto_test/standard/rtp_rtcp_extensions.cc',
183            'test/auto_test/standard/rtp_rtcp_test.cc',
184            'test/auto_test/standard/voe_base_misc_test.cc',
185            'test/auto_test/standard/video_sync_test.cc',
186            'test/auto_test/standard/volume_test.cc',
187            'test/auto_test/resource_manager.cc',
188            'test/auto_test/voe_cpu_test.cc',
189            'test/auto_test/voe_cpu_test.h',
190            'test/auto_test/voe_standard_test.cc',
191            'test/auto_test/voe_standard_test.h',
192            'test/auto_test/voe_stress_test.cc',
193            'test/auto_test/voe_stress_test.h',
194            'test/auto_test/voe_test_defines.h',
195            'test/auto_test/voe_test_interface.h',
196          ],
197          'conditions': [
198            ['OS=="android"', {
199              # some tests are not supported on android yet, exclude these tests.
200              'sources!': [
201                'test/auto_test/standard/hardware_before_streaming_test.cc',
202              ],
203            }],
204          ],
205          # Disable warnings to enable Win64 build, issue 1323.
206          'msvs_disabled_warnings': [
207            4267,  # size_t to int truncation.
208          ],
209        },
210        {
211          # command line test that should work on linux/mac/win
212          'target_name': 'voe_cmd_test',
213          'type': 'executable',
214          'dependencies': [
215            'voice_engine',
216            '<(DEPTH)/testing/gtest.gyp:gtest',
217            '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
218            '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
219            '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:field_trial_default',
220            '<(webrtc_root)/test/test.gyp:channel_transport',
221            '<(webrtc_root)/test/test.gyp:test_support',
222          ],
223          'sources': [
224            'test/cmd_test/voe_cmd_test.cc',
225          ],
226        },
227      ], # targets
228      'conditions': [
229        # TODO(kjellander): Support UseoFMFC on VS2010.
230        # http://code.google.com/p/webrtc/issues/detail?id=709
231        ['OS=="win" and MSVS_VERSION < "2010"', {
232          'targets': [
233            # WinTest - GUI test for Windows
234            {
235              'target_name': 'voe_ui_win_test',
236              'type': 'executable',
237              'dependencies': [
238                'voice_engine',
239                '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
240                '<(webrtc_root)/test/test.gyp:test_support',
241              ],
242              'sources': [
243                'test/win_test/Resource.h',
244                'test/win_test/WinTest.cc',
245                'test/win_test/WinTest.h',
246                'test/win_test/WinTest.rc',
247                'test/win_test/WinTestDlg.cc',
248                'test/win_test/WinTestDlg.h',
249                'test/win_test/res/WinTest.ico',
250                'test/win_test/res/WinTest.rc2',
251                'test/win_test/stdafx.cc',
252                'test/win_test/stdafx.h',
253              ],
254              'configurations': {
255                'Common_Base': {
256                  'msvs_configuration_attributes': {
257                    'conditions': [
258                      ['component=="shared_library"', {
259                        'UseOfMFC': '2',  # Shared DLL
260                      },{
261                        'UseOfMFC': '1',  # Static
262                      }],
263                    ],
264                  },
265                },
266              },
267              'msvs_settings': {
268                'VCLinkerTool': {
269                  'SubSystem': '2',   # Windows
270                },
271              },
272            },
273          ],  # targets
274        }],
275        ['OS=="android"', {
276          'targets': [
277            {
278              'target_name': 'voice_engine_unittests_apk_target',
279              'type': 'none',
280              'dependencies': [
281                '<(apk_tests_path):voice_engine_unittests_apk',
282              ],
283            },
284          ],
285        }],
286        ['test_isolation_mode != "noop"', {
287          'targets': [
288            {
289              'target_name': 'voice_engine_unittests_run',
290              'type': 'none',
291              'dependencies': [
292                'voice_engine_unittests',
293              ],
294              'includes': [
295                '../build/isolate.gypi',
296                'voice_engine_unittests.isolate',
297              ],
298              'sources': [
299                'voice_engine_unittests.isolate',
300              ],
301            },
302            {
303              'target_name': 'voe_auto_test_run',
304              'type': 'none',
305              'dependencies': [
306                'voe_auto_test',
307              ],
308              'includes': [
309                '../build/isolate.gypi',
310                'voe_auto_test.isolate',
311              ],
312              'sources': [
313                'voe_auto_test.isolate',
314              ],
315            },
316          ],
317        }],
318      ],  # conditions
319    }], # include_tests
320  ], # conditions
321}
322