1 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
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.
9 # This file contains common settings for building WebRTC components.
12 # Nesting is required in order to use variables for setting other variables.
17 # This will already be set to zero by supplement.gypi
18 'build_with_chromium%': 1,
20 'build_with_chromium%': '<(build_with_chromium)',
23 ['build_with_chromium==1', {
24 'build_with_libjingle': 1,
25 'webrtc_root%': '<(DEPTH)/third_party/webrtc',
26 'apk_tests_path%': '<(DEPTH)/third_party/webrtc/build/apk_tests.gyp',
27 'modules_java_gyp_path%': '<(DEPTH)/third_party/webrtc/modules/modules_java_chromium.gyp',
28 'gen_core_neon_offsets_gyp%': '<(DEPTH)/third_party/webrtc/modules/audio_processing/gen_core_neon_offsets_chromium.gyp',
30 'build_with_libjingle%': 0,
31 'webrtc_root%': '<(DEPTH)/webrtc',
32 'apk_tests_path%': '<(DEPTH)/webrtc/build/apk_test_noop.gyp',
33 'modules_java_gyp_path%': '<(DEPTH)/webrtc/modules/modules_java.gyp',
34 'gen_core_neon_offsets_gyp%':'<(DEPTH)/webrtc/modules/audio_processing/gen_core_neon_offsets.gyp',
38 'build_with_chromium%': '<(build_with_chromium)',
39 'build_with_libjingle%': '<(build_with_libjingle)',
40 'webrtc_root%': '<(webrtc_root)',
41 'apk_tests_path%': '<(apk_tests_path)',
42 'modules_java_gyp_path%': '<(modules_java_gyp_path)',
43 'gen_core_neon_offsets_gyp%': '<(gen_core_neon_offsets_gyp)',
44 'webrtc_vp8_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp8',
45 'rbe_components_path%': '<(webrtc_root)/modules/remote_bitrate_estimator',
48 'build_with_chromium%': '<(build_with_chromium)',
49 'build_with_libjingle%': '<(build_with_libjingle)',
50 'webrtc_root%': '<(webrtc_root)',
51 'apk_tests_path%': '<(apk_tests_path)',
52 'modules_java_gyp_path%': '<(modules_java_gyp_path)',
53 'gen_core_neon_offsets_gyp%': '<(gen_core_neon_offsets_gyp)',
54 'webrtc_vp8_dir%': '<(webrtc_vp8_dir)',
55 'include_opus%': '<(include_opus)',
56 'rbe_components_path%': '<(rbe_components_path)',
58 # The Chromium common.gypi we use treats all gyp files without
59 # chromium_code==1 as third party code. This disables many of the
60 # preferred warning settings.
62 # We can set this here to have WebRTC code treated as Chromium code. Our
63 # third party code will still have the reduced warning settings.
66 # Set to 1 to enable code coverage on Linux using the gcov library.
69 # Remote bitrate estimator logging/plotting.
70 'enable_bwe_test_logging%': 0,
72 # Adds video support to dependencies shared by voice and video engine.
73 # This should normally be enabled; the intended use is to disable only
74 # when building voice engine exclusively.
77 # Selects fixed-point code where possible.
78 'prefer_fixed_point%': 0,
80 # Enable data logging. Produces text files with data logged within engines
81 # which can be easily parsed for offline processing.
82 'enable_data_logging%': 0,
84 # Enables the use of protocol buffers for debug recordings.
85 'enable_protobuf%': 1,
87 # Disable these to not build components which can be externally provided.
92 # Enable to use the Mozilla internal settings.
93 'build_with_mozilla%': 0,
95 'libyuv_dir%': '<(DEPTH)/third_party/libyuv',
97 # Define MIPS architecture variant, MIPS DSP variant and MIPS FPU
98 # This may be subject to change in accordance to Chromium's MIPS flags
99 'mips_arch_variant%': 'mips32r1',
102 'enable_android_opensl%': 1,
105 ['build_with_chromium==1', {
106 # Exclude pulse audio on Chromium since its prerequisites don't require
108 'include_pulse_audio%': 0,
110 # Exclude internal ADM since Chromium uses its own IO handling.
111 'include_internal_audio_device%': 0,
113 # Exclude internal VCM in Chromium build.
114 'include_internal_video_capture%': 0,
116 # Exclude internal video render module in Chromium build.
117 'include_internal_video_render%': 0,
118 }, { # Settings for the standalone (not-in-Chromium) build.
119 # TODO(andrew): For now, disable the Chrome plugins, which causes a
120 # flood of chromium-style warnings. Investigate enabling them:
121 # http://code.google.com/p/webrtc/issues/detail?id=163
122 'clang_use_chrome_plugins%': 0,
124 'include_pulse_audio%': 1,
125 'include_internal_audio_device%': 1,
126 'include_internal_video_capture%': 1,
127 'include_internal_video_render%': 1,
129 ['build_with_libjingle==1', {
131 'restrict_webrtc_logging%': 1,
134 'restrict_webrtc_logging%': 0,
138 'enable_protobuf%': 0,
140 ['target_arch=="arm" or target_arch=="armv7"', {
141 'prefer_fixed_point%': 1,
147 # Allow includes to be prefixed with webrtc/ in case it is not an
148 # immediate subdirectory of <(DEPTH).
150 # To include the top-level directory when building in Chrome, so we can
151 # use full paths (e.g. headers inside testing/ or third_party/).
155 ['restrict_webrtc_logging==1', {
156 'defines': ['WEBRTC_RESTRICT_LOGGING',],
158 ['build_with_mozilla==1', {
160 # Changes settings for Mozilla build.
161 'WEBRTC_MOZILLA_BUILD',
164 ['enable_video==1', {
165 'defines': ['WEBRTC_MODULE_UTILITY_VIDEO',],
167 ['build_with_chromium==1', {
169 # Changes settings for Chromium build.
170 'WEBRTC_CHROMIUM_BUILD',
177 # We need to repeat some flags from Chromium's common.gypi here
178 # that get overridden by -Wextra.
179 '-Wno-unused-parameter',
180 '-Wno-missing-field-initializers',
181 '-Wno-strict-overflow',
184 '-Wnon-virtual-dtor',
185 # This is enabled for clang; enable for gcc as well.
186 '-Woverloaded-virtual',
196 ['target_arch=="arm" or target_arch=="armv7"', {
202 'defines': ['WEBRTC_ARCH_ARM_V7',],
205 'defines': ['WEBRTC_ARCH_ARM_NEON',],
207 'defines': ['WEBRTC_DETECT_ARM_NEON',],
213 ['target_arch=="mipsel"', {
230 ['mips_arch_variant=="mips32r2"', {
241 ['mips_dsp_rev==1', {
252 ['mips_dsp_rev==2', {
266 ['coverage==1 and OS=="linux"', {
267 'cflags': [ '-ftest-coverage',
269 'link_settings': { 'libraries': [ '-lgcov' ] },
272 # For access to standard POSIXish features, use WEBRTC_POSIX instead of
273 # a more specific macro.
298 # TODO(andrew): enable all warnings when possible.
299 # TODO(phoglund): get rid of 4373 supression when
300 # http://code.google.com/p/webrtc/issues/detail?id=261 is solved.
301 'msvs_disabled_warnings': [
302 4373, # legacy warning for ignoring const / volatile in signatures.
303 4389, # Signed/unsigned mismatch.
305 # Re-enable some warnings that Chromium disables.
306 'msvs_disabled_warnings!': [4189,],
314 ['enable_android_opensl==1', {
316 'WEBRTC_ANDROID_OPENSLES',
320 # The Android NDK doesn't provide optimized versions of these
321 # functions. Ensure they are disabled for all compilers.
332 'direct_dependent_settings': {
337 ['build_with_mozilla==1', {
339 # Changes settings for Mozilla build.
340 'WEBRTC_MOZILLA_BUILD',
343 ['build_with_chromium==1', {
345 # Changes settings for Chromium build.
346 'WEBRTC_CHROMIUM_BUILD',
376 ['enable_android_opensl==1', {
378 'WEBRTC_ANDROID_OPENSLES',