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 be set to zero in the supplement.gypi triggered by a
18 # gclient hook in the standalone build.
19 'build_with_chromium%': 1,
20 'build_with_libjingle%': 0,
22 'build_with_chromium%': '<(build_with_chromium)',
23 'build_with_libjingle%': '<(build_with_libjingle)',
26 ['build_with_chromium==1 or build_with_libjingle==1', {
27 'webrtc_root%': '<(DEPTH)/third_party/webrtc',
29 'webrtc_root%': '<(DEPTH)/webrtc',
33 'build_with_chromium%': '<(build_with_chromium)',
34 'build_with_libjingle%': '<(build_with_libjingle)',
35 'webrtc_root%': '<(webrtc_root)',
37 'webrtc_vp8_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp8',
45 'build_with_chromium%': '<(build_with_chromium)',
46 'build_with_libjingle%': '<(build_with_libjingle)',
47 'webrtc_root%': '<(webrtc_root)',
48 'webrtc_vp8_dir%': '<(webrtc_vp8_dir)',
50 'include_g711%': '<(include_g711)',
51 'include_g722%': '<(include_g722)',
52 'include_ilbc%': '<(include_ilbc)',
53 'include_opus%': '<(include_opus)',
54 'include_isac%': '<(include_isac)',
55 'include_pcm16b%': '<(include_pcm16b)',
57 # The Chromium common.gypi we use treats all gyp files without
58 # chromium_code==1 as third party code. This disables many of the
59 # preferred warning settings.
61 # We can set this here to have WebRTC code treated as Chromium code. Our
62 # third party code will still have the reduced warning settings.
65 # Adds video support to dependencies shared by voice and video engine.
66 # This should normally be enabled; the intended use is to disable only
67 # when building voice engine exclusively.
70 # Selects fixed-point code where possible.
71 'prefer_fixed_point%': 0,
73 # Enable data logging. Produces text files with data logged within engines
74 # which can be easily parsed for offline processing.
75 'enable_data_logging%': 0,
77 # Enables the use of protocol buffers for debug recordings.
78 'enable_protobuf%': 1,
80 # Disable these to not build components which can be externally provided.
85 # Enable to use the Mozilla internal settings.
86 'build_with_mozilla%': 0,
88 'libyuv_dir%': '<(DEPTH)/third_party/libyuv',
90 # Define MIPS architecture variant, MIPS DSP variant and MIPS FPU
91 # This may be subject to change in accordance to Chromium's MIPS flags
92 'mips_arch_variant%': 'mips32r1',
97 ['build_with_chromium==1', {
98 # Exclude pulse audio on Chromium since its prerequisites don't require
100 'include_pulse_audio%': 0,
102 # Exclude internal ADM since Chromium uses its own IO handling.
103 'include_internal_audio_device%': 0,
105 # Exclude internal VCM in Chromium build.
106 'include_internal_video_capture%': 0,
108 # Exclude internal video render module in Chromium build.
109 'include_internal_video_render%': 0,
113 'enable_tracing%': 0,
115 'enable_android_opensl%': 0,
116 }, { # Settings for the standalone (not-in-Chromium) build.
117 'include_pulse_audio%': 1,
118 'include_internal_audio_device%': 1,
119 'include_internal_video_capture%': 1,
120 'include_internal_video_render%': 1,
121 'enable_tracing%': 1,
124 # TODO(andrew): For now, disable the Chrome plugins, which causes a
125 # flood of chromium-style warnings. Investigate enabling them:
126 # http://code.google.com/p/webrtc/issues/detail?id=163
127 'clang_use_chrome_plugins%': 0,
129 # Switch between Android audio device OpenSL ES implementation
130 # and Java Implementation
131 'enable_android_opensl%': 0,
134 'include_alsa_audio%': 1,
136 'include_alsa_audio%': 0,
138 ['OS=="solaris" or os_bsd==1', {
139 'include_pulse_audio%': 1,
141 'include_pulse_audio%': 0,
143 ['OS=="linux" or OS=="solaris" or os_bsd==1', {
144 'include_v4l2_video_capture%': 1,
146 'include_v4l2_video_capture%': 0,
150 'enable_protobuf%': 0,
156 ['build_with_libjingle==1', {
159 ['target_arch=="arm"', {
160 'prefer_fixed_point%': 1,
166 # TODO(andrew): Remove '..' when we've added webrtc/ to include paths.
168 # Allow includes to be prefixed with webrtc/ in case it is not an
169 # immediate subdirectory of <(DEPTH).
171 # To include the top-level directory when building in Chrome, so we can
172 # use full paths (e.g. headers inside testing/ or third_party/).
176 # TODO(leozwang): Run this as a gclient hook rather than at build-time:
177 # http://code.google.com/p/webrtc/issues/detail?id=687
178 'WEBRTC_SVNREVISION="\\\"Unavailable_issue687\\\""',
179 #'WEBRTC_SVNREVISION="<!(python <(webrtc_root)/build/version.py)"',
182 ['moz_widget_toolkit_gonk==1', {
187 ['enable_tracing==1', {
188 'defines': ['WEBRTC_LOGGING',],
190 ['build_with_mozilla==1', {
192 # Changes settings for Mozilla build.
193 'WEBRTC_MOZILLA_BUILD',
196 ['build_with_chromium==1', {
198 # Changes settings for Chromium build.
199 'WEBRTC_CHROMIUM_BUILD',
206 # We need to repeat some flags from Chromium's common.gypi here
207 # that get overridden by -Wextra.
208 '-Wno-unused-parameter',
209 '-Wno-missing-field-initializers',
212 # This is enabled for clang; enable for gcc as well.
213 '-Woverloaded-virtual',
218 ['target_arch=="arm"', {
224 'defines': ['WEBRTC_ARCH_ARM_V7',
225 'WEBRTC_BUILD_NEON_LIBS'],
228 'defines': ['WEBRTC_ARCH_ARM_NEON',],
230 'defines': ['WEBRTC_DETECT_ARM_NEON',],
242 ['OS=="dragonfly" or OS=="netbsd"', {
244 # doesn't support pthread_condattr_setclock
245 'WEBRTC_CLOCK_TYPE_REALTIME',
248 # Mozilla: if we support Mozilla on MIPS, we'll need to mod the cflags entries here
249 ['target_arch=="mipsel"', {
266 ['mips_arch_variant=="mips32r2"', {
277 ['mips_dsp_rev==1', {
288 ['mips_dsp_rev==2', {
310 # ['have_clock_monotonic==1', {
312 # 'WEBRTC_CLOCK_TYPE_REALTIME',
329 # TODO(andrew): enable all warnings when possible.
330 # TODO(phoglund): get rid of 4373 supression when
331 # http://code.google.com/p/webrtc/issues/detail?id=261 is solved.
332 'msvs_disabled_warnings': [
333 4373, # legacy warning for ignoring const / volatile in signatures.
334 4389, # Signed/unsigned mismatch.
336 # Re-enable some warnings that Chromium disables.
337 'msvs_disabled_warnings!': [4189,],
345 ['enable_android_opensl==1', {
347 'WEBRTC_ANDROID_OPENSLES',
351 # The Android NDK doesn't provide optimized versions of these
352 # functions. Ensure they are disabled for all compilers.
363 'direct_dependent_settings': {
368 ['build_with_mozilla==1', {
370 # Changes settings for Mozilla build.
371 'WEBRTC_MOZILLA_BUILD',
374 ['build_with_chromium==1', {
376 # Changes settings for Chromium build.
377 'WEBRTC_CHROMIUM_BUILD',
407 ['enable_android_opensl==1', {
409 'WEBRTC_ANDROID_OPENSLES',