blob: e774ddbd139fc2d97d682683b97b342f3395d257 [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',
henrike@webrtc.org1303af32013-07-03 21:50:33 +000028 'apk_tests_path%': '<(DEPTH)/third_party/webrtc/build/apk_tests.gyp',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000029 }, {
30 'webrtc_root%': '<(DEPTH)/webrtc',
henrike@webrtc.org1303af32013-07-03 21:50:33 +000031 'apk_tests_path%': '<(DEPTH)/webrtc/build/apk_test_noop.gyp',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000032 }],
33 ],
34 },
35 'build_with_chromium%': '<(build_with_chromium)',
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +000036 'build_with_libjingle%': '<(build_with_libjingle)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000037 'webrtc_root%': '<(webrtc_root)',
henrike@webrtc.org1303af32013-07-03 21:50:33 +000038 'apk_tests_path%': '<(apk_tests_path)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000039
40 'webrtc_vp8_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp8',
leozwang@webrtc.org6f19b1b2012-10-27 17:46:55 +000041 'include_opus%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000042 },
43 'build_with_chromium%': '<(build_with_chromium)',
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +000044 'build_with_libjingle%': '<(build_with_libjingle)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000045 'webrtc_root%': '<(webrtc_root)',
henrike@webrtc.org1303af32013-07-03 21:50:33 +000046 'apk_tests_path%': '<(apk_tests_path)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000047 'webrtc_vp8_dir%': '<(webrtc_vp8_dir)',
48 'include_opus%': '<(include_opus)',
49
50 # The Chromium common.gypi we use treats all gyp files without
51 # chromium_code==1 as third party code. This disables many of the
52 # preferred warning settings.
53 #
54 # We can set this here to have WebRTC code treated as Chromium code. Our
55 # third party code will still have the reduced warning settings.
56 'chromium_code': 1,
57
58 # Adds video support to dependencies shared by voice and video engine.
59 # This should normally be enabled; the intended use is to disable only
60 # when building voice engine exclusively.
61 'enable_video%': 1,
62
63 # Selects fixed-point code where possible.
64 'prefer_fixed_point%': 0,
65
66 # Enable data logging. Produces text files with data logged within engines
67 # which can be easily parsed for offline processing.
68 'enable_data_logging%': 0,
69
andrew@webrtc.orgf9825e52013-05-20 21:18:04 +000070 # Enables the use of protocol buffers for debug recordings.
71 'enable_protobuf%': 1,
72
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000073 # Disable these to not build components which can be externally provided.
74 'build_libjpeg%': 1,
75 'build_libyuv%': 1,
76 'build_libvpx%': 1,
77
tina.legrand@webrtc.org1f8c02a2012-10-25 12:37:08 +000078 # Enable to use the Mozilla internal settings.
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000079 'build_with_mozilla%': 0,
80
81 'libyuv_dir%': '<(DEPTH)/third_party/libyuv',
82
andrew@webrtc.org5140e242013-02-21 20:12:21 +000083 # Define MIPS architecture variant, MIPS DSP variant and MIPS FPU
84 # This may be subject to change in accordance to Chromium's MIPS flags
85 'mips_arch_variant%': 'mips32r1',
86 'mips_dsp_rev%': 0,
87 'mips_fpu%' : 1,
88
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000089 'conditions': [
90 ['build_with_chromium==1', {
91 # Exclude pulse audio on Chromium since its prerequisites don't require
92 # pulse audio.
93 'include_pulse_audio%': 0,
94
95 # Exclude internal ADM since Chromium uses its own IO handling.
96 'include_internal_audio_device%': 0,
97
98 # Exclude internal VCM in Chromium build.
99 'include_internal_video_capture%': 0,
100
101 # Exclude internal video render module in Chromium build.
102 'include_internal_video_render%': 0,
103
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000104 'include_tests%': 0,
105
andrew@webrtc.org50419b02012-11-14 19:07:54 +0000106 'enable_tracing%': 0,
107
wjia@webrtc.org5c38d902012-11-19 01:41:59 +0000108 'enable_android_opensl%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000109 }, { # Settings for the standalone (not-in-Chromium) build.
110 'include_pulse_audio%': 1,
111 'include_internal_audio_device%': 1,
112 'include_internal_video_capture%': 1,
113 'include_internal_video_render%': 1,
andrew@webrtc.org50419b02012-11-14 19:07:54 +0000114 'enable_tracing%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000115 'include_tests%': 1,
116
117 # TODO(andrew): For now, disable the Chrome plugins, which causes a
118 # flood of chromium-style warnings. Investigate enabling them:
119 # http://code.google.com/p/webrtc/issues/detail?id=163
120 'clang_use_chrome_plugins%': 0,
121
122 # Switch between Android audio device OpenSL ES implementation
123 # and Java Implementation
leozwang@webrtc.org56a1c2c2012-11-29 03:13:00 +0000124 'enable_android_opensl%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000125 }],
126 ['OS=="ios"', {
127 'enable_video%': 0,
128 'enable_protobuf%': 0,
129 'build_libjpeg%': 0,
130 'build_libyuv%': 0,
131 'build_libvpx%': 0,
132 'include_tests%': 0,
133 }],
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +0000134 ['build_with_libjingle==1', {
135 'include_tests%': 0,
136 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000137 ['target_arch=="arm"', {
138 'prefer_fixed_point%': 1,
139 }],
140 ], # conditions
141 },
142 'target_defaults': {
143 'include_dirs': [
andrew@webrtc.orgbe8ec382012-10-22 21:51:58 +0000144 # TODO(andrew): Remove '..' when we've added webrtc/ to include paths.
145 '..',
kjellander@webrtc.orge1888af2013-01-28 20:00:03 +0000146 # Allow includes to be prefixed with webrtc/ in case it is not an
147 # immediate subdirectory of <(DEPTH).
andrew@webrtc.orgbe8ec382012-10-22 21:51:58 +0000148 '../..',
kjellander@webrtc.orge1888af2013-01-28 20:00:03 +0000149 # To include the top-level directory when building in Chrome, so we can
150 # use full paths (e.g. headers inside testing/ or third_party/).
151 '<(DEPTH)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000152 ],
153 'defines': [
154 # TODO(leozwang): Run this as a gclient hook rather than at build-time:
155 # http://code.google.com/p/webrtc/issues/detail?id=687
156 'WEBRTC_SVNREVISION="Unavailable(issue687)"',
157 #'WEBRTC_SVNREVISION="<!(python <(webrtc_root)/build/version.py)"',
158 ],
159 'conditions': [
andrew@webrtc.orgc3e5d342012-11-23 19:30:59 +0000160 ['enable_tracing==1', {
161 'defines': ['WEBRTC_LOGGING',],
162 }],
tina.legrand@webrtc.org1f8c02a2012-10-25 12:37:08 +0000163 ['build_with_mozilla==1', {
164 'defines': [
165 # Changes settings for Mozilla build.
166 'WEBRTC_MOZILLA_BUILD',
167 ],
168 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000169 ['build_with_chromium==1', {
170 'defines': [
171 # Changes settings for Chromium build.
172 'WEBRTC_CHROMIUM_BUILD',
173 ],
174 }, {
175 'conditions': [
176 ['os_posix==1', {
177 'cflags': [
178 '-Wextra',
179 # We need to repeat some flags from Chromium's common.gypi here
180 # that get overridden by -Wextra.
181 '-Wno-unused-parameter',
182 '-Wno-missing-field-initializers',
183 ],
184 'cflags_cc': [
185 # This is enabled for clang; enable for gcc as well.
186 '-Woverloaded-virtual',
187 ],
188 }],
189 ],
190 }],
191 ['target_arch=="arm"', {
192 'defines': [
193 'WEBRTC_ARCH_ARM',
194 ],
195 'conditions': [
196 ['armv7==1', {
197 'defines': ['WEBRTC_ARCH_ARM_V7',],
198 'conditions': [
199 ['arm_neon==1', {
200 'defines': ['WEBRTC_ARCH_ARM_NEON',],
201 }, {
202 'defines': ['WEBRTC_DETECT_ARM_NEON',],
203 }],
204 ],
205 }],
206 ],
207 }],
andrew@webrtc.org5140e242013-02-21 20:12:21 +0000208 ['target_arch=="mipsel"', {
209 'defines': [
210 'MIPS32_LE',
211 ],
212 'conditions': [
213 ['mips_fpu==1', {
214 'defines': [
215 'MIPS_FPU_LE',
216 ],
217 'cflags': [
218 '-mhard-float',
219 ],
220 }, {
221 'cflags': [
222 '-msoft-float',
223 ],
224 }],
225 ['mips_arch_variant=="mips32r2"', {
226 'defines': [
227 'MIPS32_R2_LE',
228 ],
229 'cflags': [
230 '-mips32r2',
231 ],
232 'cflags_cc': [
233 '-mips32r2',
234 ],
235 }],
236 ['mips_dsp_rev==1', {
237 'defines': [
238 'MIPS_DSP_R1_LE',
239 ],
240 'cflags': [
241 '-mdsp',
242 ],
243 'cflags_cc': [
244 '-mdsp',
245 ],
246 }],
247 ['mips_dsp_rev==2', {
248 'defines': [
249 'MIPS_DSP_R1_LE',
250 'MIPS_DSP_R2_LE',
251 ],
252 'cflags': [
253 '-mdspr2',
254 ],
255 'cflags_cc': [
256 '-mdspr2',
257 ],
258 }],
259 ],
260 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000261 ['OS=="ios"', {
262 'defines': [
263 'WEBRTC_MAC',
264 'WEBRTC_IOS',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000265 ],
266 }],
267 ['OS=="linux"', {
268 'defines': [
269 'WEBRTC_LINUX',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000270 ],
271 }],
272 ['OS=="mac"', {
273 'defines': [
274 'WEBRTC_MAC',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000275 ],
276 }],
277 ['OS=="win"', {
278 'defines': [
279 'WEBRTC_WIN',
280 ],
281 # TODO(andrew): enable all warnings when possible.
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000282 # TODO(phoglund): get rid of 4373 supression when
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000283 # http://code.google.com/p/webrtc/issues/detail?id=261 is solved.
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000284 'msvs_disabled_warnings': [
285 4373, # legacy warning for ignoring const / volatile in signatures.
286 4389, # Signed/unsigned mismatch.
287 ],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000288 # Re-enable some warnings that Chromium disables.
289 'msvs_disabled_warnings!': [4189,],
290 }],
291 ['OS=="android"', {
292 'defines': [
293 'WEBRTC_LINUX',
294 'WEBRTC_ANDROID',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000295 ],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000296 'conditions': [
297 ['enable_android_opensl==1', {
298 'defines': [
299 'WEBRTC_ANDROID_OPENSLES',
300 ],
301 }],
wjia@webrtc.orgb1193692013-01-12 01:52:07 +0000302 ['clang!=1', {
303 # The Android NDK doesn't provide optimized versions of these
304 # functions. Ensure they are disabled for all compilers.
305 'cflags': [
306 '-fno-builtin-cos',
307 '-fno-builtin-sin',
308 '-fno-builtin-cosf',
309 '-fno-builtin-sinf',
310 ],
311 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000312 ],
313 }],
314 ], # conditions
sergeyu@chromium.org6ebfd342013-05-22 18:22:21 +0000315 'direct_dependent_settings': {
316 'include_dirs': [
317 '../..',
318 ],
319 'conditions': [
320 ['build_with_mozilla==1', {
321 'defines': [
322 # Changes settings for Mozilla build.
323 'WEBRTC_MOZILLA_BUILD',
324 ],
325 }],
326 ['build_with_chromium==1', {
327 'defines': [
328 # Changes settings for Chromium build.
329 'WEBRTC_CHROMIUM_BUILD',
330 ],
331 }],
332 ['OS=="mac"', {
333 'defines': [
334 'WEBRTC_MAC',
335 ],
336 }],
337 ['OS=="ios"', {
338 'defines': [
339 'WEBRTC_MAC',
340 'WEBRTC_IOS',
341 ],
342 }],
343 ['OS=="win"', {
344 'defines': [
345 'WEBRTC_WIN',
346 ],
347 }],
348 ['OS=="linux"', {
349 'defines': [
350 'WEBRTC_LINUX',
351 ],
352 }],
353 ['OS=="android"', {
354 'defines': [
355 'WEBRTC_LINUX',
356 'WEBRTC_ANDROID',
357 ],
358 'conditions': [
359 ['enable_android_opensl==1', {
360 'defines': [
361 'WEBRTC_ANDROID_OPENSLES',
362 ],
363 }]
364 ],
365 }],
366 ],
367 },
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000368 }, # target_defaults
369}
370