blob: 91d14d0602dfc9a3b86cd0e5380df395a70310ea [file] [log] [blame]
andrew@webrtc.org14b43be2012-10-22 18:19:23 +00001# Copyright (c) 2012 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# This file contains common settings for building WebRTC components.
10
11{
12 # Nesting is required in order to use variables for setting other variables.
13 'variables': {
14 'variables': {
15 'variables': {
16 '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,
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +000020 'build_with_libjingle%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000021 },
22 'build_with_chromium%': '<(build_with_chromium)',
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +000023 'build_with_libjingle%': '<(build_with_libjingle)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000024
25 'conditions': [
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +000026 ['build_with_chromium==1 or build_with_libjingle==1', {
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000027 'webrtc_root%': '<(DEPTH)/third_party/webrtc',
28 }, {
29 'webrtc_root%': '<(DEPTH)/webrtc',
30 }],
31 ],
32 },
33 'build_with_chromium%': '<(build_with_chromium)',
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +000034 'build_with_libjingle%': '<(build_with_libjingle)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000035 'webrtc_root%': '<(webrtc_root)',
36
37 'webrtc_vp8_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp8',
leozwang@webrtc.org6f19b1b2012-10-27 17:46:55 +000038 'include_opus%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000039 },
40 'build_with_chromium%': '<(build_with_chromium)',
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +000041 'build_with_libjingle%': '<(build_with_libjingle)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000042 'webrtc_root%': '<(webrtc_root)',
43 'webrtc_vp8_dir%': '<(webrtc_vp8_dir)',
44 'include_opus%': '<(include_opus)',
45
46 # The Chromium common.gypi we use treats all gyp files without
47 # chromium_code==1 as third party code. This disables many of the
48 # preferred warning settings.
49 #
50 # We can set this here to have WebRTC code treated as Chromium code. Our
51 # third party code will still have the reduced warning settings.
52 'chromium_code': 1,
53
54 # Adds video support to dependencies shared by voice and video engine.
55 # This should normally be enabled; the intended use is to disable only
56 # when building voice engine exclusively.
57 'enable_video%': 1,
58
59 # Selects fixed-point code where possible.
60 'prefer_fixed_point%': 0,
61
62 # Enable data logging. Produces text files with data logged within engines
63 # which can be easily parsed for offline processing.
64 'enable_data_logging%': 0,
65
66 # Disable these to not build components which can be externally provided.
67 'build_libjpeg%': 1,
68 'build_libyuv%': 1,
69 'build_libvpx%': 1,
70
tina.legrand@webrtc.org1f8c02a2012-10-25 12:37:08 +000071 # Enable to use the Mozilla internal settings.
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000072 'build_with_mozilla%': 0,
73
74 'libyuv_dir%': '<(DEPTH)/third_party/libyuv',
75
andrew@webrtc.org5140e242013-02-21 20:12:21 +000076 # Define MIPS architecture variant, MIPS DSP variant and MIPS FPU
77 # This may be subject to change in accordance to Chromium's MIPS flags
78 'mips_arch_variant%': 'mips32r1',
79 'mips_dsp_rev%': 0,
80 'mips_fpu%' : 1,
81
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000082 'conditions': [
83 ['build_with_chromium==1', {
84 # Exclude pulse audio on Chromium since its prerequisites don't require
85 # pulse audio.
86 'include_pulse_audio%': 0,
87
88 # Exclude internal ADM since Chromium uses its own IO handling.
89 'include_internal_audio_device%': 0,
90
91 # Exclude internal VCM in Chromium build.
92 'include_internal_video_capture%': 0,
93
94 # Exclude internal video render module in Chromium build.
95 'include_internal_video_render%': 0,
96
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000097 'include_tests%': 0,
98
99 # Disable the use of protocol buffers in production code.
100 'enable_protobuf%': 0,
101
andrew@webrtc.org50419b02012-11-14 19:07:54 +0000102 'enable_tracing%': 0,
103
wjia@webrtc.org5c38d902012-11-19 01:41:59 +0000104 'enable_android_opensl%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000105 }, { # Settings for the standalone (not-in-Chromium) build.
106 'include_pulse_audio%': 1,
107 'include_internal_audio_device%': 1,
108 'include_internal_video_capture%': 1,
109 'include_internal_video_render%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000110 'enable_protobuf%': 1,
andrew@webrtc.org50419b02012-11-14 19:07:54 +0000111 'enable_tracing%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000112 'include_tests%': 1,
113
114 # TODO(andrew): For now, disable the Chrome plugins, which causes a
115 # flood of chromium-style warnings. Investigate enabling them:
116 # http://code.google.com/p/webrtc/issues/detail?id=163
117 'clang_use_chrome_plugins%': 0,
118
119 # Switch between Android audio device OpenSL ES implementation
120 # and Java Implementation
leozwang@webrtc.org56a1c2c2012-11-29 03:13:00 +0000121 'enable_android_opensl%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000122 }],
123 ['OS=="ios"', {
124 'enable_video%': 0,
125 'enable_protobuf%': 0,
126 'build_libjpeg%': 0,
127 'build_libyuv%': 0,
128 'build_libvpx%': 0,
129 'include_tests%': 0,
130 }],
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +0000131 ['build_with_libjingle==1', {
132 'include_tests%': 0,
133 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000134 ['target_arch=="arm"', {
135 'prefer_fixed_point%': 1,
136 }],
137 ], # conditions
138 },
139 'target_defaults': {
140 'include_dirs': [
andrew@webrtc.orgbe8ec382012-10-22 21:51:58 +0000141 # TODO(andrew): Remove '..' when we've added webrtc/ to include paths.
142 '..',
kjellander@webrtc.orge1888af2013-01-28 20:00:03 +0000143 # Allow includes to be prefixed with webrtc/ in case it is not an
144 # immediate subdirectory of <(DEPTH).
andrew@webrtc.orgbe8ec382012-10-22 21:51:58 +0000145 '../..',
kjellander@webrtc.orge1888af2013-01-28 20:00:03 +0000146 # To include the top-level directory when building in Chrome, so we can
147 # use full paths (e.g. headers inside testing/ or third_party/).
148 '<(DEPTH)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000149 ],
150 'defines': [
151 # TODO(leozwang): Run this as a gclient hook rather than at build-time:
152 # http://code.google.com/p/webrtc/issues/detail?id=687
153 'WEBRTC_SVNREVISION="Unavailable(issue687)"',
154 #'WEBRTC_SVNREVISION="<!(python <(webrtc_root)/build/version.py)"',
155 ],
156 'conditions': [
andrew@webrtc.orgc3e5d342012-11-23 19:30:59 +0000157 ['enable_tracing==1', {
158 'defines': ['WEBRTC_LOGGING',],
159 }],
tina.legrand@webrtc.org1f8c02a2012-10-25 12:37:08 +0000160 ['build_with_mozilla==1', {
161 'defines': [
162 # Changes settings for Mozilla build.
163 'WEBRTC_MOZILLA_BUILD',
164 ],
165 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000166 ['build_with_chromium==1', {
167 'defines': [
168 # Changes settings for Chromium build.
169 'WEBRTC_CHROMIUM_BUILD',
170 ],
171 }, {
172 'conditions': [
173 ['os_posix==1', {
174 'cflags': [
175 '-Wextra',
176 # We need to repeat some flags from Chromium's common.gypi here
177 # that get overridden by -Wextra.
178 '-Wno-unused-parameter',
179 '-Wno-missing-field-initializers',
180 ],
181 'cflags_cc': [
182 # This is enabled for clang; enable for gcc as well.
183 '-Woverloaded-virtual',
184 ],
185 }],
186 ],
187 }],
188 ['target_arch=="arm"', {
189 'defines': [
190 'WEBRTC_ARCH_ARM',
191 ],
192 'conditions': [
193 ['armv7==1', {
194 'defines': ['WEBRTC_ARCH_ARM_V7',],
195 'conditions': [
196 ['arm_neon==1', {
197 'defines': ['WEBRTC_ARCH_ARM_NEON',],
198 }, {
199 'defines': ['WEBRTC_DETECT_ARM_NEON',],
200 }],
201 ],
202 }],
203 ],
204 }],
andrew@webrtc.org5140e242013-02-21 20:12:21 +0000205 ['target_arch=="mipsel"', {
206 'defines': [
207 'MIPS32_LE',
208 ],
209 'conditions': [
210 ['mips_fpu==1', {
211 'defines': [
212 'MIPS_FPU_LE',
213 ],
214 'cflags': [
215 '-mhard-float',
216 ],
217 }, {
218 'cflags': [
219 '-msoft-float',
220 ],
221 }],
222 ['mips_arch_variant=="mips32r2"', {
223 'defines': [
224 'MIPS32_R2_LE',
225 ],
226 'cflags': [
227 '-mips32r2',
228 ],
229 'cflags_cc': [
230 '-mips32r2',
231 ],
232 }],
233 ['mips_dsp_rev==1', {
234 'defines': [
235 'MIPS_DSP_R1_LE',
236 ],
237 'cflags': [
238 '-mdsp',
239 ],
240 'cflags_cc': [
241 '-mdsp',
242 ],
243 }],
244 ['mips_dsp_rev==2', {
245 'defines': [
246 'MIPS_DSP_R1_LE',
247 'MIPS_DSP_R2_LE',
248 ],
249 'cflags': [
250 '-mdspr2',
251 ],
252 'cflags_cc': [
253 '-mdspr2',
254 ],
255 }],
256 ],
257 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000258 ['OS=="ios"', {
259 'defines': [
260 'WEBRTC_MAC',
261 'WEBRTC_IOS',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000262 ],
263 }],
264 ['OS=="linux"', {
265 'defines': [
266 'WEBRTC_LINUX',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000267 ],
268 }],
269 ['OS=="mac"', {
270 'defines': [
271 'WEBRTC_MAC',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000272 ],
273 }],
274 ['OS=="win"', {
275 'defines': [
276 'WEBRTC_WIN',
277 ],
278 # TODO(andrew): enable all warnings when possible.
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000279 # TODO(phoglund): get rid of 4373 supression when
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000280 # http://code.google.com/p/webrtc/issues/detail?id=261 is solved.
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000281 'msvs_disabled_warnings': [
282 4373, # legacy warning for ignoring const / volatile in signatures.
283 4389, # Signed/unsigned mismatch.
284 ],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000285 # Re-enable some warnings that Chromium disables.
286 'msvs_disabled_warnings!': [4189,],
287 }],
288 ['OS=="android"', {
289 'defines': [
290 'WEBRTC_LINUX',
291 'WEBRTC_ANDROID',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000292 ],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000293 'conditions': [
294 ['enable_android_opensl==1', {
295 'defines': [
296 'WEBRTC_ANDROID_OPENSLES',
297 ],
298 }],
wjia@webrtc.orgb1193692013-01-12 01:52:07 +0000299 ['clang!=1', {
300 # The Android NDK doesn't provide optimized versions of these
301 # functions. Ensure they are disabled for all compilers.
302 'cflags': [
303 '-fno-builtin-cos',
304 '-fno-builtin-sin',
305 '-fno-builtin-cosf',
306 '-fno-builtin-sinf',
307 ],
308 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000309 ],
310 }],
311 ], # conditions
312 }, # target_defaults
313}
314