blob: 4e439e6bb5faa41b4d9fe7d59514c7433c21b22e [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',
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
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000110 'include_tests%': 0,
111
andrew@webrtc.org50419b02012-11-14 19:07:54 +0000112 'enable_tracing%': 0,
113
wjia@webrtc.org5c38d902012-11-19 01:41:59 +0000114 'enable_android_opensl%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000115 }, { # Settings for the standalone (not-in-Chromium) build.
116 'include_pulse_audio%': 1,
117 'include_internal_audio_device%': 1,
118 'include_internal_video_capture%': 1,
119 'include_internal_video_render%': 1,
andrew@webrtc.org50419b02012-11-14 19:07:54 +0000120 'enable_tracing%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000121 'include_tests%': 1,
122
123 # TODO(andrew): For now, disable the Chrome plugins, which causes a
124 # flood of chromium-style warnings. Investigate enabling them:
125 # http://code.google.com/p/webrtc/issues/detail?id=163
126 'clang_use_chrome_plugins%': 0,
127
128 # Switch between Android audio device OpenSL ES implementation
129 # and Java Implementation
leozwang@webrtc.org56a1c2c2012-11-29 03:13:00 +0000130 'enable_android_opensl%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000131 }],
132 ['OS=="ios"', {
133 'enable_video%': 0,
134 'enable_protobuf%': 0,
135 'build_libjpeg%': 0,
136 'build_libyuv%': 0,
137 'build_libvpx%': 0,
138 'include_tests%': 0,
139 }],
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +0000140 ['build_with_libjingle==1', {
141 'include_tests%': 0,
142 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000143 ['target_arch=="arm"', {
144 'prefer_fixed_point%': 1,
145 }],
146 ], # conditions
147 },
148 'target_defaults': {
149 'include_dirs': [
andrew@webrtc.orgbe8ec382012-10-22 21:51:58 +0000150 # TODO(andrew): Remove '..' when we've added webrtc/ to include paths.
151 '..',
kjellander@webrtc.orge1888af2013-01-28 20:00:03 +0000152 # Allow includes to be prefixed with webrtc/ in case it is not an
153 # immediate subdirectory of <(DEPTH).
andrew@webrtc.orgbe8ec382012-10-22 21:51:58 +0000154 '../..',
kjellander@webrtc.orge1888af2013-01-28 20:00:03 +0000155 # To include the top-level directory when building in Chrome, so we can
156 # use full paths (e.g. headers inside testing/ or third_party/).
157 '<(DEPTH)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000158 ],
159 'defines': [
160 # TODO(leozwang): Run this as a gclient hook rather than at build-time:
161 # http://code.google.com/p/webrtc/issues/detail?id=687
162 'WEBRTC_SVNREVISION="Unavailable(issue687)"',
163 #'WEBRTC_SVNREVISION="<!(python <(webrtc_root)/build/version.py)"',
164 ],
165 'conditions': [
andrew@webrtc.orgc3e5d342012-11-23 19:30:59 +0000166 ['enable_tracing==1', {
167 'defines': ['WEBRTC_LOGGING',],
168 }],
tina.legrand@webrtc.org1f8c02a2012-10-25 12:37:08 +0000169 ['build_with_mozilla==1', {
170 'defines': [
171 # Changes settings for Mozilla build.
172 'WEBRTC_MOZILLA_BUILD',
173 ],
174 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000175 ['build_with_chromium==1', {
176 'defines': [
177 # Changes settings for Chromium build.
178 'WEBRTC_CHROMIUM_BUILD',
179 ],
180 }, {
181 'conditions': [
182 ['os_posix==1', {
183 'cflags': [
184 '-Wextra',
185 # We need to repeat some flags from Chromium's common.gypi here
186 # that get overridden by -Wextra.
187 '-Wno-unused-parameter',
188 '-Wno-missing-field-initializers',
189 ],
190 'cflags_cc': [
191 # This is enabled for clang; enable for gcc as well.
192 '-Woverloaded-virtual',
193 ],
194 }],
195 ],
196 }],
197 ['target_arch=="arm"', {
198 'defines': [
199 'WEBRTC_ARCH_ARM',
200 ],
201 'conditions': [
202 ['armv7==1', {
203 'defines': ['WEBRTC_ARCH_ARM_V7',],
204 'conditions': [
205 ['arm_neon==1', {
206 'defines': ['WEBRTC_ARCH_ARM_NEON',],
207 }, {
208 'defines': ['WEBRTC_DETECT_ARM_NEON',],
209 }],
210 ],
211 }],
212 ],
213 }],
andrew@webrtc.org5140e242013-02-21 20:12:21 +0000214 ['target_arch=="mipsel"', {
215 'defines': [
216 'MIPS32_LE',
217 ],
218 'conditions': [
219 ['mips_fpu==1', {
220 'defines': [
221 'MIPS_FPU_LE',
222 ],
223 'cflags': [
224 '-mhard-float',
225 ],
226 }, {
227 'cflags': [
228 '-msoft-float',
229 ],
230 }],
231 ['mips_arch_variant=="mips32r2"', {
232 'defines': [
233 'MIPS32_R2_LE',
234 ],
235 'cflags': [
236 '-mips32r2',
237 ],
238 'cflags_cc': [
239 '-mips32r2',
240 ],
241 }],
242 ['mips_dsp_rev==1', {
243 'defines': [
244 'MIPS_DSP_R1_LE',
245 ],
246 'cflags': [
247 '-mdsp',
248 ],
249 'cflags_cc': [
250 '-mdsp',
251 ],
252 }],
253 ['mips_dsp_rev==2', {
254 'defines': [
255 'MIPS_DSP_R1_LE',
256 'MIPS_DSP_R2_LE',
257 ],
258 'cflags': [
259 '-mdspr2',
260 ],
261 'cflags_cc': [
262 '-mdspr2',
263 ],
264 }],
265 ],
266 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000267 ['OS=="ios"', {
268 'defines': [
269 'WEBRTC_MAC',
270 'WEBRTC_IOS',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000271 ],
272 }],
273 ['OS=="linux"', {
274 'defines': [
275 'WEBRTC_LINUX',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000276 ],
277 }],
278 ['OS=="mac"', {
279 'defines': [
280 'WEBRTC_MAC',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000281 ],
282 }],
283 ['OS=="win"', {
284 'defines': [
285 'WEBRTC_WIN',
286 ],
287 # TODO(andrew): enable all warnings when possible.
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000288 # TODO(phoglund): get rid of 4373 supression when
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000289 # http://code.google.com/p/webrtc/issues/detail?id=261 is solved.
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000290 'msvs_disabled_warnings': [
291 4373, # legacy warning for ignoring const / volatile in signatures.
292 4389, # Signed/unsigned mismatch.
293 ],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000294 # Re-enable some warnings that Chromium disables.
295 'msvs_disabled_warnings!': [4189,],
296 }],
297 ['OS=="android"', {
298 'defines': [
299 'WEBRTC_LINUX',
300 'WEBRTC_ANDROID',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000301 ],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000302 'conditions': [
303 ['enable_android_opensl==1', {
304 'defines': [
305 'WEBRTC_ANDROID_OPENSLES',
306 ],
307 }],
wjia@webrtc.orgb1193692013-01-12 01:52:07 +0000308 ['clang!=1', {
309 # The Android NDK doesn't provide optimized versions of these
310 # functions. Ensure they are disabled for all compilers.
311 'cflags': [
312 '-fno-builtin-cos',
313 '-fno-builtin-sin',
314 '-fno-builtin-cosf',
315 '-fno-builtin-sinf',
316 ],
317 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000318 ],
319 }],
320 ], # conditions
sergeyu@chromium.org6ebfd342013-05-22 18:22:21 +0000321 'direct_dependent_settings': {
322 'include_dirs': [
323 '../..',
324 ],
325 'conditions': [
326 ['build_with_mozilla==1', {
327 'defines': [
328 # Changes settings for Mozilla build.
329 'WEBRTC_MOZILLA_BUILD',
330 ],
331 }],
332 ['build_with_chromium==1', {
333 'defines': [
334 # Changes settings for Chromium build.
335 'WEBRTC_CHROMIUM_BUILD',
336 ],
337 }],
338 ['OS=="mac"', {
339 'defines': [
340 'WEBRTC_MAC',
341 ],
342 }],
343 ['OS=="ios"', {
344 'defines': [
345 'WEBRTC_MAC',
346 'WEBRTC_IOS',
347 ],
348 }],
349 ['OS=="win"', {
350 'defines': [
351 'WEBRTC_WIN',
352 ],
353 }],
354 ['OS=="linux"', {
355 'defines': [
356 'WEBRTC_LINUX',
357 ],
358 }],
359 ['OS=="android"', {
360 'defines': [
361 'WEBRTC_LINUX',
362 'WEBRTC_ANDROID',
363 ],
364 'conditions': [
365 ['enable_android_opensl==1', {
366 'defines': [
367 'WEBRTC_ANDROID_OPENSLES',
368 ],
369 }]
370 ],
371 }],
372 ],
373 },
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000374 }, # target_defaults
375}
376