blob: b425a7e4d737c8c341154ced30f06e27037349f8 [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',
kjellander@webrtc.org33654222013-08-22 07:57:00 +000028 'import_isolate_path%': '<(DEPTH)/third_party/webrtc/build/import_isolate_chromium.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 }, {
henrike@webrtc.org42581542013-07-16 16:37:22 +000031 'build_with_libjingle%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000032 'webrtc_root%': '<(DEPTH)/webrtc',
henrike@webrtc.org1303af32013-07-03 21:50:33 +000033 'apk_tests_path%': '<(DEPTH)/webrtc/build/apk_test_noop.gyp',
kjellander@webrtc.org33654222013-08-22 07:57:00 +000034 'import_isolate_path%': '<(DEPTH)/webrtc/build/import_isolate_webrtc.gyp',
henrike@webrtc.orga2073af2013-07-08 18:14:58 +000035 'modules_java_gyp_path%': '<(DEPTH)/webrtc/modules/modules_java.gyp',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000036 }],
37 ],
38 },
39 'build_with_chromium%': '<(build_with_chromium)',
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +000040 'build_with_libjingle%': '<(build_with_libjingle)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000041 'webrtc_root%': '<(webrtc_root)',
henrike@webrtc.org1303af32013-07-03 21:50:33 +000042 'apk_tests_path%': '<(apk_tests_path)',
kjellander@webrtc.org33654222013-08-22 07:57:00 +000043 'import_isolate_path%': '<(import_isolate_path)',
henrike@webrtc.orga2073af2013-07-08 18:14:58 +000044 'modules_java_gyp_path%': '<(modules_java_gyp_path)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000045
46 'webrtc_vp8_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp8',
stefan@webrtc.orgf56d6122013-07-09 12:32:35 +000047 'rbe_components_path%': '<(webrtc_root)/modules/remote_bitrate_estimator',
leozwang@webrtc.org6f19b1b2012-10-27 17:46:55 +000048 'include_opus%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000049 },
50 'build_with_chromium%': '<(build_with_chromium)',
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +000051 'build_with_libjingle%': '<(build_with_libjingle)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000052 'webrtc_root%': '<(webrtc_root)',
henrike@webrtc.org1303af32013-07-03 21:50:33 +000053 'apk_tests_path%': '<(apk_tests_path)',
kjellander@webrtc.org33654222013-08-22 07:57:00 +000054 'import_isolate_path%': '<(import_isolate_path)',
henrike@webrtc.orga2073af2013-07-08 18:14:58 +000055 'modules_java_gyp_path%': '<(modules_java_gyp_path)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000056 'webrtc_vp8_dir%': '<(webrtc_vp8_dir)',
57 'include_opus%': '<(include_opus)',
stefan@webrtc.orgf56d6122013-07-09 12:32:35 +000058 'rbe_components_path%': '<(rbe_components_path)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000059
60 # The Chromium common.gypi we use treats all gyp files without
61 # chromium_code==1 as third party code. This disables many of the
62 # preferred warning settings.
63 #
64 # We can set this here to have WebRTC code treated as Chromium code. Our
65 # third party code will still have the reduced warning settings.
66 'chromium_code': 1,
67
68 # Adds video support to dependencies shared by voice and video engine.
69 # This should normally be enabled; the intended use is to disable only
70 # when building voice engine exclusively.
71 'enable_video%': 1,
72
73 # Selects fixed-point code where possible.
74 'prefer_fixed_point%': 0,
75
76 # Enable data logging. Produces text files with data logged within engines
77 # which can be easily parsed for offline processing.
78 'enable_data_logging%': 0,
79
andrew@webrtc.orgf9825e52013-05-20 21:18:04 +000080 # Enables the use of protocol buffers for debug recordings.
81 'enable_protobuf%': 1,
82
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000083 # Disable these to not build components which can be externally provided.
84 'build_libjpeg%': 1,
85 'build_libyuv%': 1,
86 'build_libvpx%': 1,
87
tina.legrand@webrtc.org1f8c02a2012-10-25 12:37:08 +000088 # Enable to use the Mozilla internal settings.
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000089 'build_with_mozilla%': 0,
90
91 'libyuv_dir%': '<(DEPTH)/third_party/libyuv',
92
andrew@webrtc.org5140e242013-02-21 20:12:21 +000093 # Define MIPS architecture variant, MIPS DSP variant and MIPS FPU
94 # This may be subject to change in accordance to Chromium's MIPS flags
95 'mips_arch_variant%': 'mips32r1',
96 'mips_dsp_rev%': 0,
97 'mips_fpu%' : 1,
98
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000099 'conditions': [
100 ['build_with_chromium==1', {
101 # Exclude pulse audio on Chromium since its prerequisites don't require
102 # pulse audio.
103 'include_pulse_audio%': 0,
104
105 # Exclude internal ADM since Chromium uses its own IO handling.
106 'include_internal_audio_device%': 0,
107
108 # Exclude internal VCM in Chromium build.
109 'include_internal_video_capture%': 0,
110
111 # Exclude internal video render module in Chromium build.
112 'include_internal_video_render%': 0,
113
henrike@webrtc.org42581542013-07-16 16:37:22 +0000114 # Include ndk cpu features in Chromium build.
115 'include_ndk_cpu_features%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000116 }, { # Settings for the standalone (not-in-Chromium) build.
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000117 # 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
henrike@webrtc.org42581542013-07-16 16:37:22 +0000122 'include_pulse_audio%': 1,
123 'include_internal_audio_device%': 1,
124 'include_internal_video_capture%': 1,
125 'include_internal_video_render%': 1,
126 'include_ndk_cpu_features%': 0,
127 }],
128 ['build_with_libjingle==1', {
129 'include_tests%': 0,
130 'enable_tracing%': 0,
131 'enable_android_opensl%': 0,
132 }, {
133 'include_tests%': 1,
134 'enable_tracing%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000135 # Switch between Android audio device OpenSL ES implementation
136 # and Java Implementation
leozwang@webrtc.org56a1c2c2012-11-29 03:13:00 +0000137 'enable_android_opensl%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000138 }],
139 ['OS=="ios"', {
fischman@webrtc.orgd0f4c212013-08-20 22:16:55 +0000140 'build_libjpeg%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000141 'enable_protobuf%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000142 'include_tests%': 0,
143 }],
fischman@webrtc.org31b4a5a2013-09-05 16:46:36 +0000144 ['target_arch=="arm" or target_arch=="armv7"', {
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000145 'prefer_fixed_point%': 1,
146 }],
147 ], # conditions
148 },
149 'target_defaults': {
150 'include_dirs': [
andrew@webrtc.orgbe8ec382012-10-22 21:51:58 +0000151 # TODO(andrew): Remove '..' when we've added webrtc/ to include paths.
152 '..',
kjellander@webrtc.orge1888af2013-01-28 20:00:03 +0000153 # Allow includes to be prefixed with webrtc/ in case it is not an
154 # immediate subdirectory of <(DEPTH).
andrew@webrtc.orgbe8ec382012-10-22 21:51:58 +0000155 '../..',
kjellander@webrtc.orge1888af2013-01-28 20:00:03 +0000156 # To include the top-level directory when building in Chrome, so we can
157 # use full paths (e.g. headers inside testing/ or third_party/).
158 '<(DEPTH)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000159 ],
160 'defines': [
161 # TODO(leozwang): Run this as a gclient hook rather than at build-time:
162 # http://code.google.com/p/webrtc/issues/detail?id=687
163 'WEBRTC_SVNREVISION="Unavailable(issue687)"',
164 #'WEBRTC_SVNREVISION="<!(python <(webrtc_root)/build/version.py)"',
165 ],
166 'conditions': [
andrew@webrtc.orgc3e5d342012-11-23 19:30:59 +0000167 ['enable_tracing==1', {
168 'defines': ['WEBRTC_LOGGING',],
169 }],
tina.legrand@webrtc.org1f8c02a2012-10-25 12:37:08 +0000170 ['build_with_mozilla==1', {
171 'defines': [
172 # Changes settings for Mozilla build.
173 'WEBRTC_MOZILLA_BUILD',
174 ],
175 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000176 ['build_with_chromium==1', {
177 'defines': [
178 # Changes settings for Chromium build.
179 'WEBRTC_CHROMIUM_BUILD',
180 ],
181 }, {
182 'conditions': [
183 ['os_posix==1', {
184 'cflags': [
185 '-Wextra',
186 # We need to repeat some flags from Chromium's common.gypi here
187 # that get overridden by -Wextra.
188 '-Wno-unused-parameter',
189 '-Wno-missing-field-initializers',
190 ],
191 'cflags_cc': [
192 # This is enabled for clang; enable for gcc as well.
193 '-Woverloaded-virtual',
194 ],
195 }],
196 ],
197 }],
fischman@webrtc.org31b4a5a2013-09-05 16:46:36 +0000198 ['target_arch=="arm" or target_arch=="armv7"', {
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000199 'defines': [
200 'WEBRTC_ARCH_ARM',
201 ],
202 'conditions': [
203 ['armv7==1', {
204 'defines': ['WEBRTC_ARCH_ARM_V7',],
205 'conditions': [
206 ['arm_neon==1', {
207 'defines': ['WEBRTC_ARCH_ARM_NEON',],
208 }, {
209 'defines': ['WEBRTC_DETECT_ARM_NEON',],
210 }],
211 ],
212 }],
213 ],
214 }],
andrew@webrtc.org5140e242013-02-21 20:12:21 +0000215 ['target_arch=="mipsel"', {
216 'defines': [
217 'MIPS32_LE',
218 ],
219 'conditions': [
220 ['mips_fpu==1', {
221 'defines': [
222 'MIPS_FPU_LE',
223 ],
224 'cflags': [
225 '-mhard-float',
226 ],
227 }, {
228 'cflags': [
229 '-msoft-float',
230 ],
231 }],
232 ['mips_arch_variant=="mips32r2"', {
233 'defines': [
234 'MIPS32_R2_LE',
235 ],
236 'cflags': [
237 '-mips32r2',
238 ],
239 'cflags_cc': [
240 '-mips32r2',
241 ],
242 }],
243 ['mips_dsp_rev==1', {
244 'defines': [
245 'MIPS_DSP_R1_LE',
246 ],
247 'cflags': [
248 '-mdsp',
249 ],
250 'cflags_cc': [
251 '-mdsp',
252 ],
253 }],
254 ['mips_dsp_rev==2', {
255 'defines': [
256 'MIPS_DSP_R1_LE',
257 'MIPS_DSP_R2_LE',
258 ],
259 'cflags': [
260 '-mdspr2',
261 ],
262 'cflags_cc': [
263 '-mdspr2',
264 ],
265 }],
266 ],
267 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000268 ['OS=="ios"', {
269 'defines': [
270 'WEBRTC_MAC',
271 'WEBRTC_IOS',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000272 ],
273 }],
274 ['OS=="linux"', {
275 'defines': [
276 'WEBRTC_LINUX',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000277 ],
278 }],
279 ['OS=="mac"', {
280 'defines': [
281 'WEBRTC_MAC',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000282 ],
283 }],
284 ['OS=="win"', {
285 'defines': [
286 'WEBRTC_WIN',
287 ],
288 # TODO(andrew): enable all warnings when possible.
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000289 # TODO(phoglund): get rid of 4373 supression when
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000290 # http://code.google.com/p/webrtc/issues/detail?id=261 is solved.
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000291 'msvs_disabled_warnings': [
292 4373, # legacy warning for ignoring const / volatile in signatures.
293 4389, # Signed/unsigned mismatch.
294 ],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000295 # Re-enable some warnings that Chromium disables.
296 'msvs_disabled_warnings!': [4189,],
297 }],
298 ['OS=="android"', {
299 'defines': [
300 'WEBRTC_LINUX',
301 'WEBRTC_ANDROID',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000302 ],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000303 'conditions': [
304 ['enable_android_opensl==1', {
305 'defines': [
306 'WEBRTC_ANDROID_OPENSLES',
307 ],
308 }],
wjia@webrtc.orgb1193692013-01-12 01:52:07 +0000309 ['clang!=1', {
310 # The Android NDK doesn't provide optimized versions of these
311 # functions. Ensure they are disabled for all compilers.
312 'cflags': [
313 '-fno-builtin-cos',
314 '-fno-builtin-sin',
315 '-fno-builtin-cosf',
316 '-fno-builtin-sinf',
317 ],
318 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000319 ],
320 }],
321 ], # conditions
sergeyu@chromium.org6ebfd342013-05-22 18:22:21 +0000322 'direct_dependent_settings': {
323 'include_dirs': [
324 '../..',
325 ],
326 'conditions': [
327 ['build_with_mozilla==1', {
328 'defines': [
329 # Changes settings for Mozilla build.
330 'WEBRTC_MOZILLA_BUILD',
331 ],
332 }],
333 ['build_with_chromium==1', {
334 'defines': [
335 # Changes settings for Chromium build.
336 'WEBRTC_CHROMIUM_BUILD',
337 ],
338 }],
339 ['OS=="mac"', {
340 'defines': [
341 'WEBRTC_MAC',
342 ],
343 }],
344 ['OS=="ios"', {
345 'defines': [
346 'WEBRTC_MAC',
347 'WEBRTC_IOS',
348 ],
349 }],
350 ['OS=="win"', {
351 'defines': [
352 'WEBRTC_WIN',
353 ],
354 }],
355 ['OS=="linux"', {
356 'defines': [
357 'WEBRTC_LINUX',
358 ],
359 }],
360 ['OS=="android"', {
361 'defines': [
362 'WEBRTC_LINUX',
363 'WEBRTC_ANDROID',
364 ],
365 'conditions': [
366 ['enable_android_opensl==1', {
367 'defines': [
368 'WEBRTC_ANDROID_OPENSLES',
369 ],
370 }]
371 ],
372 }],
373 ],
374 },
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000375 }, # target_defaults
376}
377