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