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_noop.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_tests.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 'rtc_relative_path%': 1,
57 'rbe_components_path%': '<(rbe_components_path)',
58 'external_libraries%': '0',
59 'json_root%': '<(DEPTH)/third_party/jsoncpp/source/include/',
60 # openssl needs to be defined or gyp will complain. Is is only used when
61 # when providing external libraries so just use current directory as a
65 # The Chromium common.gypi we use treats all gyp files without
66 # chromium_code==1 as third party code. This disables many of the
67 # preferred warning settings.
69 # We can set this here to have WebRTC code treated as Chromium code. Our
70 # third party code will still have the reduced warning settings.
73 # Set to 1 to enable code coverage on Linux using the gcov library.
76 # Remote bitrate estimator logging/plotting.
77 'enable_bwe_test_logging%': 0,
79 # Adds video support to dependencies shared by voice and video engine.
80 # This should normally be enabled; the intended use is to disable only
81 # when building voice engine exclusively.
84 # Selects fixed-point code where possible.
85 'prefer_fixed_point%': 0,
87 # Enable data logging. Produces text files with data logged within engines
88 # which can be easily parsed for offline processing.
89 'enable_data_logging%': 0,
91 # Enables the use of protocol buffers for debug recordings.
92 'enable_protobuf%': 1,
94 # Disable these to not build components which can be externally provided.
102 'have_dbus_glib%': 0,
104 # Enable to use the Mozilla internal settings.
105 'build_with_mozilla%': 0,
107 'libyuv_dir%': '<(DEPTH)/third_party/libyuv',
109 # Define MIPS architecture variant, MIPS DSP variant and MIPS FPU
110 # This may be subject to change in accordance to Chromium's MIPS flags
111 'mips_arch_variant%': 'mips32r1',
114 'enable_android_opensl%': 1,
116 # Link-Time Optimizations
117 # Executes code generation at link-time instead of compile-time
118 # https://gcc.gnu.org/wiki/LinkTimeOptimization
121 # Defer ssl perference to that specified through sslconfig.h instead of
122 # choosing openssl or nss directly. In practice, this can be used to
123 # enable schannel on windows.
124 'use_legacy_ssl_defaults%': 0,
127 ['build_with_chromium==1', {
128 # Exclude pulse audio on Chromium since its prerequisites don't require
130 'include_pulse_audio%': 0,
132 # Exclude internal ADM since Chromium uses its own IO handling.
133 'include_internal_audio_device%': 0,
135 }, { # Settings for the standalone (not-in-Chromium) build.
136 # TODO(andrew): For now, disable the Chrome plugins, which causes a
137 # flood of chromium-style warnings. Investigate enabling them:
138 # http://code.google.com/p/webrtc/issues/detail?id=163
139 'clang_use_chrome_plugins%': 0,
141 'include_pulse_audio%': 1,
142 'include_internal_audio_device%': 1,
144 ['build_with_libjingle==1', {
146 'restrict_webrtc_logging%': 1,
149 'restrict_webrtc_logging%': 0,
153 'enable_protobuf%': 0,
155 ['target_arch=="arm" or target_arch=="armv7"', {
156 'prefer_fixed_point%': 1,
162 # To include the top-level directory when building in Chrome, so we can
163 # use full paths (e.g. headers inside testing/ or third_party/).
167 ['restrict_webrtc_logging==1', {
168 'defines': ['WEBRTC_RESTRICT_LOGGING',],
170 ['build_with_mozilla==1', {
172 # Changes settings for Mozilla build.
173 'WEBRTC_MOZILLA_BUILD',
176 ['have_dbus_glib==1', {
181 '<!@(pkg-config --cflags dbus-glib-1)',
184 ['rtc_relative_path==1', {
185 'defines': ['EXPAT_RELATIVE_PATH',],
187 ['enable_video==1', {
188 'defines': ['WEBRTC_MODULE_UTILITY_VIDEO',],
190 ['build_with_chromium==1', {
192 # Changes settings for Chromium build.
193 'WEBRTC_CHROMIUM_BUILD',
194 'LOGGING_INSIDE_WEBRTC',
197 # overrides must be included first as that is the mechanism for
198 # selecting the override headers in Chromium.
200 # Allow includes to be prefixed with webrtc/ in case it is not an
201 # immediate subdirectory of <(DEPTH).
208 # -Wextra is currently disabled in Chromium's common.gypi. Enable
209 # for targets that can handle it. For Android/arm64 right now
210 # there will be an 'enumeral and non-enumeral type in conditional
211 # expression' warning in android_tools/ndk_experimental's version
213 # See: https://code.google.com/p/chromium/issues/detail?id=379699
214 ['target_arch!="arm64" or OS!="android"', {
217 # We need to repeat some flags from Chromium's common.gypi
218 # here that get overridden by -Wextra.
219 '-Wno-unused-parameter',
220 '-Wno-missing-field-initializers',
221 '-Wno-strict-overflow',
226 '-Wnon-virtual-dtor',
227 # This is enabled for clang; enable for gcc as well.
228 '-Woverloaded-virtual',
238 ['target_arch=="arm" or target_arch=="armv7"', {
244 'defines': ['WEBRTC_ARCH_ARM_V7',],
247 'defines': ['WEBRTC_ARCH_ARM_NEON',],
249 'defines': ['WEBRTC_DETECT_ARM_NEON',],
255 ['target_arch=="mipsel"', {
272 ['mips_arch_variant=="mips32r2"', {
283 ['mips_dsp_rev==1', {
294 ['mips_dsp_rev==2', {
308 ['coverage==1 and OS=="linux"', {
309 'cflags': [ '-ftest-coverage',
311 'link_settings': { 'libraries': [ '-lgcov' ] },
314 # For access to standard POSIXish features, use WEBRTC_POSIX instead of
315 # a more specific macro.
340 # TODO(andrew): enable all warnings when possible.
341 # TODO(phoglund): get rid of 4373 supression when
342 # http://code.google.com/p/webrtc/issues/detail?id=261 is solved.
343 'msvs_disabled_warnings': [
344 4373, # legacy warning for ignoring const / volatile in signatures.
345 4389, # Signed/unsigned mismatch.
347 # Re-enable some warnings that Chromium disables.
348 'msvs_disabled_warnings!': [4189,],
356 ['enable_android_opensl==1', {
358 'WEBRTC_ANDROID_OPENSLES',
362 # The Android NDK doesn't provide optimized versions of these
363 # functions. Ensure they are disabled for all compilers.
374 'direct_dependent_settings': {
376 ['build_with_mozilla==1', {
378 # Changes settings for Mozilla build.
379 'WEBRTC_MOZILLA_BUILD',
382 ['build_with_chromium==1', {
384 # Changes settings for Chromium build.
385 'WEBRTC_CHROMIUM_BUILD',
388 # overrides must be included first as that is the mechanism for
389 # selecting the override headers in Chromium.
425 ['enable_android_opensl==1', {
427 'WEBRTC_ANDROID_OPENSLES',
433 # For access to standard POSIXish features, use WEBRTC_POSIX instead
434 # of a more specific macro.