blob: 17516f49d5a5b1153d09a02cec0cc75f03774528 [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,
20 },
21 'build_with_chromium%': '<(build_with_chromium)',
22
23 'conditions': [
henrike@webrtc.org42581542013-07-16 16:37:22 +000024 ['build_with_chromium==1', {
25 'build_with_libjingle': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000026 'webrtc_root%': '<(DEPTH)/third_party/webrtc',
henrike@webrtc.org1303af32013-07-03 21:50:33 +000027 'apk_tests_path%': '<(DEPTH)/third_party/webrtc/build/apk_tests.gyp',
henrike@webrtc.orga2073af2013-07-08 18:14:58 +000028 'modules_java_gyp_path%': '<(DEPTH)/third_party/webrtc/modules/modules_java_chromium.gyp',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000029 }, {
henrike@webrtc.org42581542013-07-16 16:37:22 +000030 'build_with_libjingle%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000031 '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',
stefan@webrtc.orgf56d6122013-07-09 12:32:35 +000044 'rbe_components_path%': '<(webrtc_root)/modules/remote_bitrate_estimator',
leozwang@webrtc.org6f19b1b2012-10-27 17:46:55 +000045 'include_opus%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000046 },
47 'build_with_chromium%': '<(build_with_chromium)',
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +000048 'build_with_libjingle%': '<(build_with_libjingle)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000049 'webrtc_root%': '<(webrtc_root)',
henrike@webrtc.org1303af32013-07-03 21:50:33 +000050 'apk_tests_path%': '<(apk_tests_path)',
henrike@webrtc.orga2073af2013-07-08 18:14:58 +000051 'modules_java_gyp_path%': '<(modules_java_gyp_path)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000052 'webrtc_vp8_dir%': '<(webrtc_vp8_dir)',
53 'include_opus%': '<(include_opus)',
stefan@webrtc.orgf56d6122013-07-09 12:32:35 +000054 'rbe_components_path%': '<(rbe_components_path)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000055
56 # The Chromium common.gypi we use treats all gyp files without
57 # chromium_code==1 as third party code. This disables many of the
58 # preferred warning settings.
59 #
60 # We can set this here to have WebRTC code treated as Chromium code. Our
61 # third party code will still have the reduced warning settings.
62 'chromium_code': 1,
63
64 # Adds video support to dependencies shared by voice and video engine.
65 # This should normally be enabled; the intended use is to disable only
66 # when building voice engine exclusively.
67 'enable_video%': 1,
68
69 # Selects fixed-point code where possible.
70 'prefer_fixed_point%': 0,
71
72 # Enable data logging. Produces text files with data logged within engines
73 # which can be easily parsed for offline processing.
74 'enable_data_logging%': 0,
75
andrew@webrtc.orgf9825e52013-05-20 21:18:04 +000076 # Enables the use of protocol buffers for debug recordings.
77 'enable_protobuf%': 1,
78
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000079 # Disable these to not build components which can be externally provided.
80 'build_libjpeg%': 1,
81 'build_libyuv%': 1,
82 'build_libvpx%': 1,
83
tina.legrand@webrtc.org1f8c02a2012-10-25 12:37:08 +000084 # Enable to use the Mozilla internal settings.
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000085 'build_with_mozilla%': 0,
86
87 'libyuv_dir%': '<(DEPTH)/third_party/libyuv',
88
andrew@webrtc.org5140e242013-02-21 20:12:21 +000089 # Define MIPS architecture variant, MIPS DSP variant and MIPS FPU
90 # This may be subject to change in accordance to Chromium's MIPS flags
91 'mips_arch_variant%': 'mips32r1',
92 'mips_dsp_rev%': 0,
93 'mips_fpu%' : 1,
94
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000095 'conditions': [
96 ['build_with_chromium==1', {
97 # Exclude pulse audio on Chromium since its prerequisites don't require
98 # pulse audio.
99 'include_pulse_audio%': 0,
100
101 # Exclude internal ADM since Chromium uses its own IO handling.
102 'include_internal_audio_device%': 0,
103
104 # Exclude internal VCM in Chromium build.
105 'include_internal_video_capture%': 0,
106
107 # Exclude internal video render module in Chromium build.
108 'include_internal_video_render%': 0,
109
henrike@webrtc.org42581542013-07-16 16:37:22 +0000110 # Include ndk cpu features in Chromium build.
111 'include_ndk_cpu_features%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000112 }, { # Settings for the standalone (not-in-Chromium) build.
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000113 # TODO(andrew): For now, disable the Chrome plugins, which causes a
114 # flood of chromium-style warnings. Investigate enabling them:
115 # http://code.google.com/p/webrtc/issues/detail?id=163
116 'clang_use_chrome_plugins%': 0,
117
henrike@webrtc.org42581542013-07-16 16:37:22 +0000118 'include_pulse_audio%': 1,
119 'include_internal_audio_device%': 1,
120 'include_internal_video_capture%': 1,
121 'include_internal_video_render%': 1,
122 'include_ndk_cpu_features%': 0,
123 }],
124 ['build_with_libjingle==1', {
125 'include_tests%': 0,
126 'enable_tracing%': 0,
127 'enable_android_opensl%': 0,
128 }, {
129 'include_tests%': 1,
130 'enable_tracing%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000131 # Switch between Android audio device OpenSL ES implementation
132 # and Java Implementation
leozwang@webrtc.org56a1c2c2012-11-29 03:13:00 +0000133 'enable_android_opensl%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000134 }],
135 ['OS=="ios"', {
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000136 'enable_protobuf%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000137 'include_tests%': 0,
138 }],
139 ['target_arch=="arm"', {
140 'prefer_fixed_point%': 1,
141 }],
142 ], # conditions
143 },
144 'target_defaults': {
145 'include_dirs': [
andrew@webrtc.orgbe8ec382012-10-22 21:51:58 +0000146 # TODO(andrew): Remove '..' when we've added webrtc/ to include paths.
147 '..',
kjellander@webrtc.orge1888af2013-01-28 20:00:03 +0000148 # Allow includes to be prefixed with webrtc/ in case it is not an
149 # immediate subdirectory of <(DEPTH).
andrew@webrtc.orgbe8ec382012-10-22 21:51:58 +0000150 '../..',
kjellander@webrtc.orge1888af2013-01-28 20:00:03 +0000151 # To include the top-level directory when building in Chrome, so we can
152 # use full paths (e.g. headers inside testing/ or third_party/).
153 '<(DEPTH)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000154 ],
155 'defines': [
156 # TODO(leozwang): Run this as a gclient hook rather than at build-time:
157 # http://code.google.com/p/webrtc/issues/detail?id=687
158 'WEBRTC_SVNREVISION="Unavailable(issue687)"',
159 #'WEBRTC_SVNREVISION="<!(python <(webrtc_root)/build/version.py)"',
160 ],
161 'conditions': [
andrew@webrtc.orgc3e5d342012-11-23 19:30:59 +0000162 ['enable_tracing==1', {
163 'defines': ['WEBRTC_LOGGING',],
164 }],
tina.legrand@webrtc.org1f8c02a2012-10-25 12:37:08 +0000165 ['build_with_mozilla==1', {
166 'defines': [
167 # Changes settings for Mozilla build.
168 'WEBRTC_MOZILLA_BUILD',
169 ],
170 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000171 ['build_with_chromium==1', {
172 'defines': [
173 # Changes settings for Chromium build.
174 'WEBRTC_CHROMIUM_BUILD',
175 ],
176 }, {
177 'conditions': [
178 ['os_posix==1', {
179 'cflags': [
180 '-Wextra',
181 # We need to repeat some flags from Chromium's common.gypi here
182 # that get overridden by -Wextra.
183 '-Wno-unused-parameter',
184 '-Wno-missing-field-initializers',
185 ],
186 'cflags_cc': [
187 # This is enabled for clang; enable for gcc as well.
188 '-Woverloaded-virtual',
189 ],
190 }],
191 ],
192 }],
193 ['target_arch=="arm"', {
194 'defines': [
195 'WEBRTC_ARCH_ARM',
196 ],
197 'conditions': [
198 ['armv7==1', {
199 'defines': ['WEBRTC_ARCH_ARM_V7',],
200 'conditions': [
201 ['arm_neon==1', {
202 'defines': ['WEBRTC_ARCH_ARM_NEON',],
203 }, {
204 'defines': ['WEBRTC_DETECT_ARM_NEON',],
205 }],
206 ],
207 }],
208 ],
209 }],
andrew@webrtc.org5140e242013-02-21 20:12:21 +0000210 ['target_arch=="mipsel"', {
211 'defines': [
212 'MIPS32_LE',
213 ],
214 'conditions': [
215 ['mips_fpu==1', {
216 'defines': [
217 'MIPS_FPU_LE',
218 ],
219 'cflags': [
220 '-mhard-float',
221 ],
222 }, {
223 'cflags': [
224 '-msoft-float',
225 ],
226 }],
227 ['mips_arch_variant=="mips32r2"', {
228 'defines': [
229 'MIPS32_R2_LE',
230 ],
231 'cflags': [
232 '-mips32r2',
233 ],
234 'cflags_cc': [
235 '-mips32r2',
236 ],
237 }],
238 ['mips_dsp_rev==1', {
239 'defines': [
240 'MIPS_DSP_R1_LE',
241 ],
242 'cflags': [
243 '-mdsp',
244 ],
245 'cflags_cc': [
246 '-mdsp',
247 ],
248 }],
249 ['mips_dsp_rev==2', {
250 'defines': [
251 'MIPS_DSP_R1_LE',
252 'MIPS_DSP_R2_LE',
253 ],
254 'cflags': [
255 '-mdspr2',
256 ],
257 'cflags_cc': [
258 '-mdspr2',
259 ],
260 }],
261 ],
262 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000263 ['OS=="ios"', {
264 'defines': [
265 'WEBRTC_MAC',
266 'WEBRTC_IOS',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000267 ],
268 }],
269 ['OS=="linux"', {
270 'defines': [
271 'WEBRTC_LINUX',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000272 ],
273 }],
274 ['OS=="mac"', {
275 'defines': [
276 'WEBRTC_MAC',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000277 ],
278 }],
279 ['OS=="win"', {
280 'defines': [
281 'WEBRTC_WIN',
282 ],
283 # TODO(andrew): enable all warnings when possible.
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000284 # TODO(phoglund): get rid of 4373 supression when
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000285 # http://code.google.com/p/webrtc/issues/detail?id=261 is solved.
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000286 'msvs_disabled_warnings': [
287 4373, # legacy warning for ignoring const / volatile in signatures.
288 4389, # Signed/unsigned mismatch.
289 ],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000290 # Re-enable some warnings that Chromium disables.
291 'msvs_disabled_warnings!': [4189,],
292 }],
293 ['OS=="android"', {
294 'defines': [
295 'WEBRTC_LINUX',
296 'WEBRTC_ANDROID',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000297 ],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000298 'conditions': [
299 ['enable_android_opensl==1', {
300 'defines': [
301 'WEBRTC_ANDROID_OPENSLES',
302 ],
303 }],
wjia@webrtc.orgb1193692013-01-12 01:52:07 +0000304 ['clang!=1', {
305 # The Android NDK doesn't provide optimized versions of these
306 # functions. Ensure they are disabled for all compilers.
307 'cflags': [
308 '-fno-builtin-cos',
309 '-fno-builtin-sin',
310 '-fno-builtin-cosf',
311 '-fno-builtin-sinf',
312 ],
313 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000314 ],
315 }],
316 ], # conditions
sergeyu@chromium.org6ebfd342013-05-22 18:22:21 +0000317 'direct_dependent_settings': {
318 'include_dirs': [
319 '../..',
320 ],
321 'conditions': [
322 ['build_with_mozilla==1', {
323 'defines': [
324 # Changes settings for Mozilla build.
325 'WEBRTC_MOZILLA_BUILD',
326 ],
327 }],
328 ['build_with_chromium==1', {
329 'defines': [
330 # Changes settings for Chromium build.
331 'WEBRTC_CHROMIUM_BUILD',
332 ],
333 }],
334 ['OS=="mac"', {
335 'defines': [
336 'WEBRTC_MAC',
337 ],
338 }],
339 ['OS=="ios"', {
340 'defines': [
341 'WEBRTC_MAC',
342 'WEBRTC_IOS',
343 ],
344 }],
345 ['OS=="win"', {
346 'defines': [
347 'WEBRTC_WIN',
348 ],
349 }],
350 ['OS=="linux"', {
351 'defines': [
352 'WEBRTC_LINUX',
353 ],
354 }],
355 ['OS=="android"', {
356 'defines': [
357 'WEBRTC_LINUX',
358 'WEBRTC_ANDROID',
359 ],
360 'conditions': [
361 ['enable_android_opensl==1', {
362 'defines': [
363 'WEBRTC_ANDROID_OPENSLES',
364 ],
365 }]
366 ],
367 }],
368 ],
369 },
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000370 }, # target_defaults
371}
372