blob: 265c3d78037bcdfd1c3ab3856d9c63a9e9802d04 [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': {
henrike@webrtc.org7ef7df52014-01-21 15:54:56 +000017 # This will already be set to zero by supplement.gypi
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000018 'build_with_chromium%': 1,
kwiberg0edb05b2016-01-19 05:54:28 -080019
20 # Enable to use the Mozilla internal settings.
21 'build_with_mozilla%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000022 },
23 'build_with_chromium%': '<(build_with_chromium)',
kwiberg0edb05b2016-01-19 05:54:28 -080024 'build_with_mozilla%': '<(build_with_mozilla%)',
25 'include_opus%': 1,
kwibergf8c2bac2016-01-18 06:38:32 -080026
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000027 'conditions': [
kwiberg0edb05b2016-01-19 05:54:28 -080028 # Include the iLBC audio codec?
29 ['build_with_chromium==1 or build_with_mozilla==1', {
30 'include_ilbc%': 0,
31 }, {
32 'include_ilbc%': 1,
33 }],
34
henrike@webrtc.org42581542013-07-16 16:37:22 +000035 ['build_with_chromium==1', {
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000036 'webrtc_root%': '<(DEPTH)/third_party/webrtc',
kjellander208d1982016-05-31 04:01:38 -070037 'android_tests_path%': '<(DEPTH)/third_party/webrtc/build/android_tests_noop.gyp',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000038 }, {
39 'webrtc_root%': '<(DEPTH)/webrtc',
kjellander208d1982016-05-31 04:01:38 -070040 'android_tests_path%': '<(DEPTH)/webrtc/build/android_tests.gyp',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000041 }],
tommic06b1332016-05-14 11:31:40 -070042
43 # Controls whether we use libevent on posix platforms.
phoglundff274392016-05-17 03:44:28 -070044 # TODO(phoglund): should arguably be controlled by platform #ifdefs
45 # in the code instead.
46 ['OS=="win" or OS=="mac" or OS=="ios"', {
tommic06b1332016-05-14 11:31:40 -070047 'build_libevent%': 0,
phoglundff274392016-05-17 03:44:28 -070048 'enable_libevent%': 0,
tommic06b1332016-05-14 11:31:40 -070049 }, {
50 'build_libevent%': 1,
phoglundff274392016-05-17 03:44:28 -070051 'enable_libevent%': 1,
tommic06b1332016-05-14 11:31:40 -070052 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000053 ],
54 },
55 'build_with_chromium%': '<(build_with_chromium)',
kwibergf8c2bac2016-01-18 06:38:32 -080056 'build_with_mozilla%': '<(build_with_mozilla)',
tommic06b1332016-05-14 11:31:40 -070057 'build_libevent%': '<(build_libevent)',
phoglundff274392016-05-17 03:44:28 -070058 'enable_libevent%': '<(enable_libevent)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000059 'webrtc_root%': '<(webrtc_root)',
kjellander208d1982016-05-31 04:01:38 -070060 'android_tests_path%': '<(android_tests_path)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000061 'webrtc_vp8_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp8',
marpan@webrtc.org5b883172014-11-01 06:10:48 +000062 'webrtc_vp9_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp9',
kwiberg0edb05b2016-01-19 05:54:28 -080063 'include_ilbc%': '<(include_ilbc)',
64 'include_opus%': '<(include_opus)',
kjellander@webrtc.org2b69eab2015-02-09 10:01:17 +000065 'opus_dir%': '<(DEPTH)/third_party/opus',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000066 },
67 'build_with_chromium%': '<(build_with_chromium)',
kwiberg98ab3a42015-09-30 21:54:21 -070068 'build_with_mozilla%': '<(build_with_mozilla)',
tommic06b1332016-05-14 11:31:40 -070069 'build_libevent%': '<(build_libevent)',
phoglundff274392016-05-17 03:44:28 -070070 'enable_libevent%': '<(enable_libevent)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000071 'webrtc_root%': '<(webrtc_root)',
kjellander208d1982016-05-31 04:01:38 -070072 'android_tests_path%': '<(android_tests_path)',
agrieve39530c42016-04-07 08:18:34 -070073 'test_runner_path': '<(DEPTH)/webrtc/build/android/test_runner.py',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000074 'webrtc_vp8_dir%': '<(webrtc_vp8_dir)',
marpan@webrtc.org5b883172014-11-01 06:10:48 +000075 'webrtc_vp9_dir%': '<(webrtc_vp9_dir)',
kwibergf8c2bac2016-01-18 06:38:32 -080076 'include_ilbc%': '<(include_ilbc)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000077 'include_opus%': '<(include_opus)',
phoglundc6c00b32016-05-04 01:54:35 -070078 'rtc_relative_path%': 1,
henrike@webrtc.org9f36c082014-06-16 21:35:20 +000079 'external_libraries%': '0',
80 'json_root%': '<(DEPTH)/third_party/jsoncpp/source/include/',
81 # openssl needs to be defined or gyp will complain. Is is only used when
82 # when providing external libraries so just use current directory as a
83 # placeholder.
84 'ssl_root%': '.',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000085
86 # The Chromium common.gypi we use treats all gyp files without
87 # chromium_code==1 as third party code. This disables many of the
88 # preferred warning settings.
89 #
90 # We can set this here to have WebRTC code treated as Chromium code. Our
91 # third party code will still have the reduced warning settings.
92 'chromium_code': 1,
93
kjellander@webrtc.org03d45b02016-05-20 09:52:43 +020094 # Targets are by default not NaCl untrusted code. Use this variable exclude
95 # code that uses libraries that aren't available in the NaCl sandbox.
96 'nacl_untrusted_build%': 0,
97
kjellander@webrtc.org0aa04f92014-03-28 13:14:00 +000098 # Set to 1 to enable code coverage on Linux using the gcov library.
99 'coverage%': 0,
100
Johan Ahlers9ddac182016-07-22 08:57:23 +0200101 # Set to "func", "block", "edge" for coverage generation.
102 # At unit test runtime set UBSAN_OPTIONS="coverage=1".
103 # It is recommend to set include_examples=0.
104 # Use llvm's sancov -html-report for human readable reports.
105 # See http://clang.llvm.org/docs/SanitizerCoverage.html .
106 'webrtc_sanitize_coverage%': "",
107
solenberg@webrtc.orgd6e46632013-10-30 16:06:26 +0000108 # Remote bitrate estimator logging/plotting.
109 'enable_bwe_test_logging%': 0,
110
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000111 # Selects fixed-point code where possible.
112 'prefer_fixed_point%': 0,
113
114 # Enable data logging. Produces text files with data logged within engines
115 # which can be easily parsed for offline processing.
116 'enable_data_logging%': 0,
117
andrew@webrtc.orgf9825e52013-05-20 21:18:04 +0000118 # Enables the use of protocol buffers for debug recordings.
119 'enable_protobuf%': 1,
120
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000121 # Disable these to not build components which can be externally provided.
Henrik Kjellandere6cefb62015-04-27 14:39:04 +0200122 'build_expat%': 1,
henrike@webrtc.orga685c9d2014-06-17 14:48:44 +0000123 'build_json%': 1,
kjellander@webrtc.org9b8df252016-02-12 06:47:59 +0100124 'build_libsrtp%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000125 'build_libvpx%': 1,
Peter Boström12996152016-05-14 02:03:18 +0200126 'libvpx_build_vp9%': 1,
Henrik Kjellandere6cefb62015-04-27 14:39:04 +0200127 'build_libyuv%': 1,
andrew@webrtc.orgd2c09dd2015-03-11 22:06:55 +0000128 'build_openmax_dl%': 1,
minyue@webrtc.org7c112f32015-03-17 14:04:56 +0000129 'build_opus%': 1,
kjellander292e1922016-01-13 05:46:58 -0800130 'build_protobuf%': 1,
Henrik Kjellandere6cefb62015-04-27 14:39:04 +0200131 'build_ssl%': 1,
kjellandera96e2d72016-02-04 23:52:28 -0800132 'build_usrsctp%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000133
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000134 # Disable by default
135 'have_dbus_glib%': 0,
136
kjellander@webrtc.org2b69eab2015-02-09 10:01:17 +0000137 # Make it possible to provide custom locations for some libraries.
kjellandere26e7872016-03-04 14:39:28 -0800138 'libvpx_dir%': '<(DEPTH)/third_party/libvpx',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000139 'libyuv_dir%': '<(DEPTH)/third_party/libyuv',
kjellander@webrtc.org2b69eab2015-02-09 10:01:17 +0000140 'opus_dir%': '<(opus_dir)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000141
henrika@webrtc.org45db7ee2015-01-12 14:27:23 +0000142 # Use Java based audio layer as default for Android.
143 # Change this setting to 1 to use Open SL audio instead.
144 # TODO(henrika): add support for Open SL ES.
145 'enable_android_opensl%': 0,
andrew@webrtc.org5140e242013-02-21 20:12:21 +0000146
andrew@webrtc.orgaf7fdfc2014-08-29 17:41:13 +0000147 # Link-Time Optimizations
148 # Executes code generation at link-time instead of compile-time
149 # https://gcc.gnu.org/wiki/LinkTimeOptimization
150 'use_lto%': 0,
151
tpsiaki@google.com67eabc02014-09-10 18:06:47 +0000152 # Defer ssl perference to that specified through sslconfig.h instead of
153 # choosing openssl or nss directly. In practice, this can be used to
154 # enable schannel on windows.
155 'use_legacy_ssl_defaults%': 0,
156
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700157 # Determines whether NEON code will be built.
158 'build_with_neon%': 0,
159
Henrik Kjellander15583c12016-02-10 10:53:12 +0100160 # Disable this to skip building source requiring GTK.
161 'use_gtk%': 1,
162
Zeke Chin71f6f442015-06-29 14:34:58 -0700163 # Enable this to use HW H.264 encoder/decoder on iOS/Mac PeerConnections.
164 # Enabling this may break interop with Android clients that support H264.
165 'use_objc_h264%': 0,
166
tkchin1bd95532016-03-23 13:19:18 -0700167 # Enable this to prevent extern symbols from being hidden on iOS builds.
168 # The chromium settings we inherit hide symbols by default on Release
169 # builds. We want our symbols to be visible when distributing WebRTC via
170 # static libraries to avoid linker warnings.
171 'ios_override_visibility%': 0,
172
mikescarlettcd0e4752016-02-08 17:35:47 -0800173 # Determines whether QUIC code will be built.
174 'use_quic%': 0,
175
hbosa81f6a32016-02-07 15:05:22 -0800176 'conditions': [
hbos62756ee2016-02-08 02:57:00 -0800177 # Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported
178 # on all platforms except Android and iOS. Because FFmpeg can be built
179 # with/without H.264 support, |ffmpeg_branding| has to separately be set
180 # to a value that includes H.264, for example "Chrome". If FFmpeg is built
181 # without H.264, compilation succeeds but |H264DecoderImpl| fails to
182 # initialize. See also: |rtc_initialize_ffmpeg|.
183 # CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING.
184 # http://www.openh264.org, https://www.ffmpeg.org/
185 ['proprietary_codecs==1 and OS!="android" and OS!="ios"', {
186 'rtc_use_h264%': 1,
187 }, {
188 'rtc_use_h264%': 0,
189 }],
190
hbosc5a39c22016-02-02 02:26:05 -0800191 # FFmpeg must be initialized for |H264DecoderImpl| to work. This can be
192 # done by WebRTC during |H264DecoderImpl::InitDecode| or externally.
193 # FFmpeg must only be initialized once. Projects that initialize FFmpeg
194 # externally, such as Chromium, must turn this flag off so that WebRTC
195 # does not also initialize.
196 ['build_with_chromium==0', {
197 'rtc_initialize_ffmpeg%': 1,
198 }, {
199 'rtc_initialize_ffmpeg%': 0,
200 }],
201
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000202 ['build_with_chromium==1', {
kjellander1c24a6d2016-02-05 13:10:34 -0800203 # Build sources requiring GTK. NOTICE: This is not present in Chrome OS
204 # build environments, even if available for Chromium builds.
205 'use_gtk%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000206 # Exclude pulse audio on Chromium since its prerequisites don't require
207 # pulse audio.
208 'include_pulse_audio%': 0,
209
210 # Exclude internal ADM since Chromium uses its own IO handling.
211 'include_internal_audio_device%': 0,
kjellander@webrtc.orgf22695c2015-11-19 15:39:29 +0100212
213 # Remove tests for Chromium to avoid slowing down GYP generation.
214 'include_tests%': 0,
215 'restrict_webrtc_logging%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000216 }, { # Settings for the standalone (not-in-Chromium) build.
kjellander1c24a6d2016-02-05 13:10:34 -0800217 'use_gtk%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000218 # TODO(andrew): For now, disable the Chrome plugins, which causes a
219 # flood of chromium-style warnings. Investigate enabling them:
220 # http://code.google.com/p/webrtc/issues/detail?id=163
221 'clang_use_chrome_plugins%': 0,
222
henrike@webrtc.org42581542013-07-16 16:37:22 +0000223 'include_pulse_audio%': 1,
224 'include_internal_audio_device%': 1,
henrike@webrtc.org42581542013-07-16 16:37:22 +0000225 'include_tests%': 1,
andrew@webrtc.orgf1a48172013-11-07 23:47:26 +0000226 'restrict_webrtc_logging%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000227 }],
peahc8da45f2016-03-03 01:28:49 -0800228 ['target_arch=="arm" or target_arch=="arm64" or target_arch=="mipsel"', {
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000229 'prefer_fixed_point%': 1,
230 }],
paskoe305d952016-05-17 10:56:40 -0700231 ['(target_arch=="arm" and arm_neon==1) or target_arch=="arm64"', {
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700232 'build_with_neon%': 1,
233 }],
andrew@webrtc.org34ac9562014-12-30 18:19:56 +0000234 ['OS!="ios" and (target_arch!="arm" or arm_version>=7) and target_arch!="mips64el"', {
andrew@webrtc.org4165f7a2014-10-08 18:01:27 +0000235 'rtc_use_openmax_dl%': 1,
236 }, {
237 'rtc_use_openmax_dl%': 0,
238 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000239 ], # conditions
240 },
241 'target_defaults': {
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000242 'conditions': [
andrew@webrtc.orgf1a48172013-11-07 23:47:26 +0000243 ['restrict_webrtc_logging==1', {
244 'defines': ['WEBRTC_RESTRICT_LOGGING',],
andrew@webrtc.orgc3e5d342012-11-23 19:30:59 +0000245 }],
tina.legrand@webrtc.org1f8c02a2012-10-25 12:37:08 +0000246 ['build_with_mozilla==1', {
247 'defines': [
248 # Changes settings for Mozilla build.
249 'WEBRTC_MOZILLA_BUILD',
250 ],
251 }],
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000252 ['have_dbus_glib==1', {
253 'defines': [
254 'HAVE_DBUS_GLIB',
255 ],
256 'cflags': [
257 '<!@(pkg-config --cflags dbus-glib-1)',
258 ],
259 }],
phoglundc6c00b32016-05-04 01:54:35 -0700260 ['rtc_relative_path==1', {
261 'defines': ['EXPAT_RELATIVE_PATH',],
262 }],
tommi@webrtc.orga32f0642015-03-08 07:38:31 +0000263 ['os_posix==1', {
264 'configurations': {
265 'Debug_Base': {
266 'defines': [
267 # Chromium's build/common.gypi defines _DEBUG for all posix
268 # _except_ for ios & mac. The size of data types such as
269 # pthread_mutex_t varies between release and debug builds
270 # and is controlled via this flag. Since we now share code
271 # between base/base.gyp and build/common.gypi (this file),
272 # both gyp(i) files, must consistently set this flag uniformly
273 # or else we'll run in to hard-to-figure-out problems where
274 # one compilation unit uses code from another but expects
275 # differently laid out types.
276 # For WebRTC, we want it there as well, because ASSERT and
277 # friends trigger off of it.
278 '_DEBUG',
279 ],
280 },
281 },
282 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000283 ['build_with_chromium==1', {
284 'defines': [
285 # Changes settings for Chromium build.
kjellanderf0e174a2016-05-30 06:27:50 -0700286 # TODO(kjellander): Cleanup unused ones and move defines closer to the
287 # source when webrtc:4256 is completed.
288 'ENABLE_EXTERNAL_AUTH',
289 'FEATURE_ENABLE_SSL',
290 'HAVE_OPENSSL_SSL_H',
291 'HAVE_SCTP',
292 'HAVE_SRTP',
293 'HAVE_WEBRTC_VIDEO',
294 'HAVE_WEBRTC_VOICE',
kjellander602f41e2016-04-04 23:39:45 -0700295 'LOGGING_INSIDE_WEBRTC',
kjellanderf0e174a2016-05-30 06:27:50 -0700296 'NO_MAIN_THREAD_WRAPPING',
297 'NO_SOUND_SYSTEM',
298 'SRTP_RELATIVE_PATH',
299 'SSL_USE_OPENSSL',
300 'USE_WEBRTC_DEV_BRANCH',
301 'WEBRTC_CHROMIUM_BUILD',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000302 ],
303 'include_dirs': [
kjellander@webrtc.orgf2ec8142015-01-30 14:54:36 +0000304 # Include the top-level directory when building in Chrome, so we can
305 # use full paths (e.g. headers inside testing/ or third_party/).
306 '<(DEPTH)',
307 # The overrides must be included before the WebRTC root as that's the
308 # mechanism for selecting the override headers in Chromium.
henrikgee2bf412015-09-30 03:48:52 -0700309 '../../webrtc_overrides',
kjellander@webrtc.orgf2ec8142015-01-30 14:54:36 +0000310 # The WebRTC root is needed to allow includes in the WebRTC code base
311 # to be prefixed with webrtc/.
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000312 '../..',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000313 ],
314 }, {
kjellander@webrtc.orgf2ec8142015-01-30 14:54:36 +0000315 # Include the top-level dir so the WebRTC code can use full paths.
316 'include_dirs': [
317 '../..',
318 ],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000319 'conditions': [
320 ['os_posix==1', {
solenberg@webrtc.orgc6db88b2014-06-04 17:15:42 +0000321 'conditions': [
322 # -Wextra is currently disabled in Chromium's common.gypi. Enable
323 # for targets that can handle it. For Android/arm64 right now
324 # there will be an 'enumeral and non-enumeral type in conditional
325 # expression' warning in android_tools/ndk_experimental's version
326 # of stlport.
327 # See: https://code.google.com/p/chromium/issues/detail?id=379699
328 ['target_arch!="arm64" or OS!="android"', {
329 'cflags': [
330 '-Wextra',
331 # We need to repeat some flags from Chromium's common.gypi
332 # here that get overridden by -Wextra.
333 '-Wno-unused-parameter',
334 '-Wno-missing-field-initializers',
335 '-Wno-strict-overflow',
336 ],
337 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000338 ],
339 'cflags_cc': [
pbos@webrtc.orgb3cc78d2013-11-21 11:42:02 +0000340 '-Wnon-virtual-dtor',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000341 # This is enabled for clang; enable for gcc as well.
342 '-Woverloaded-virtual',
343 ],
344 }],
andresp@webrtc.org7fb75ec2013-12-20 20:20:50 +0000345 ['clang==1', {
346 'cflags': [
kjellander@webrtc.org7d2b6a92015-01-28 18:37:58 +0000347 '-Wimplicit-fallthrough',
andresp@webrtc.org7fb75ec2013-12-20 20:20:50 +0000348 '-Wthread-safety',
nisse4996eaa2016-05-10 23:28:10 -0700349 '-Winconsistent-missing-override',
andresp@webrtc.org7fb75ec2013-12-20 20:20:50 +0000350 ],
351 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000352 ],
353 }],
tkchin@webrtc.org14146e42014-10-31 00:14:39 +0000354 ['target_arch=="arm64"', {
355 'defines': [
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700356 'WEBRTC_ARCH_ARM64',
357 'WEBRTC_HAS_NEON',
tkchin@webrtc.org14146e42014-10-31 00:14:39 +0000358 ],
359 }],
andrew@webrtc.org1090a6e2014-12-18 21:36:18 +0000360 ['target_arch=="arm"', {
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000361 'defines': [
362 'WEBRTC_ARCH_ARM',
363 ],
364 'conditions': [
andrew@webrtc.orga56a2c52014-11-26 17:01:40 +0000365 ['arm_version>=7', {
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000366 'defines': ['WEBRTC_ARCH_ARM_V7',],
367 'conditions': [
368 ['arm_neon==1', {
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700369 'defines': ['WEBRTC_HAS_NEON',],
andrew@webrtc.orga56a2c52014-11-26 17:01:40 +0000370 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000371 ],
372 }],
373 ],
374 }],
Richard Colesd417c932015-04-09 17:36:12 +0200375 ['target_arch=="mipsel" and mips_arch_variant!="r6"', {
andrew@webrtc.org5140e242013-02-21 20:12:21 +0000376 'defines': [
377 'MIPS32_LE',
378 ],
379 'conditions': [
kjellander@webrtc.org6dab6d72015-03-04 09:50:31 +0000380 ['mips_float_abi=="hard"', {
andrew@webrtc.org5140e242013-02-21 20:12:21 +0000381 'defines': [
382 'MIPS_FPU_LE',
383 ],
andrew@webrtc.org5140e242013-02-21 20:12:21 +0000384 }],
andrew@webrtc.orgd05756f2014-09-30 15:53:24 +0000385 ['mips_arch_variant=="r2"', {
andrew@webrtc.org5140e242013-02-21 20:12:21 +0000386 'defines': [
387 'MIPS32_R2_LE',
388 ],
andrew@webrtc.org5140e242013-02-21 20:12:21 +0000389 }],
390 ['mips_dsp_rev==1', {
391 'defines': [
392 'MIPS_DSP_R1_LE',
393 ],
andrew@webrtc.org5140e242013-02-21 20:12:21 +0000394 }],
395 ['mips_dsp_rev==2', {
396 'defines': [
397 'MIPS_DSP_R1_LE',
398 'MIPS_DSP_R2_LE',
399 ],
andrew@webrtc.org5140e242013-02-21 20:12:21 +0000400 }],
401 ],
402 }],
kjellander@webrtc.org0aa04f92014-03-28 13:14:00 +0000403 ['coverage==1 and OS=="linux"', {
404 'cflags': [ '-ftest-coverage',
405 '-fprofile-arcs' ],
kjellander6e6941f2016-04-18 23:08:09 -0700406 'ldflags': [ '--coverage' ],
kjellander@webrtc.org0aa04f92014-03-28 13:14:00 +0000407 'link_settings': { 'libraries': [ '-lgcov' ] },
408 }],
Johan Ahlers9ddac182016-07-22 08:57:23 +0200409 ['webrtc_sanitize_coverage!=""', {
410 'cflags': [ '-fsanitize-coverage=<(webrtc_sanitize_coverage)' ],
411 'ldflags': [ '-fsanitize-coverage=<(webrtc_sanitize_coverage)' ],
412 }],
413 ['webrtc_sanitize_coverage!="" and OS=="mac"', {
414 'xcode_settings': {
415 'OTHER_CFLAGS': [
416 '-fsanitize-coverage=func',
417 ],
418 },
419 }],
henrike@webrtc.orgcc08e3f2014-03-07 15:30:21 +0000420 ['os_posix==1', {
421 # For access to standard POSIXish features, use WEBRTC_POSIX instead of
422 # a more specific macro.
423 'defines': [
424 'WEBRTC_POSIX',
425 ],
426 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000427 ['OS=="ios"', {
428 'defines': [
429 'WEBRTC_MAC',
430 'WEBRTC_IOS',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000431 ],
432 }],
tkchin1bd95532016-03-23 13:19:18 -0700433 ['OS=="ios" and ios_override_visibility==1', {
434 'xcode_settings': {
435 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'NO',
436 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
437 }
438 }],
Zeke Chin71f6f442015-06-29 14:34:58 -0700439 ['OS=="ios" and use_objc_h264==1', {
440 'defines': [
441 'WEBRTC_OBJC_H264',
442 ],
443 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000444 ['OS=="linux"', {
445 'defines': [
446 'WEBRTC_LINUX',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000447 ],
448 }],
449 ['OS=="mac"', {
450 'defines': [
451 'WEBRTC_MAC',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000452 ],
453 }],
454 ['OS=="win"', {
455 'defines': [
456 'WEBRTC_WIN',
457 ],
458 # TODO(andrew): enable all warnings when possible.
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000459 # TODO(phoglund): get rid of 4373 supression when
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000460 # http://code.google.com/p/webrtc/issues/detail?id=261 is solved.
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000461 'msvs_disabled_warnings': [
462 4373, # legacy warning for ignoring const / volatile in signatures.
463 4389, # Signed/unsigned mismatch.
464 ],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000465 # Re-enable some warnings that Chromium disables.
466 'msvs_disabled_warnings!': [4189,],
467 }],
468 ['OS=="android"', {
469 'defines': [
470 'WEBRTC_LINUX',
471 'WEBRTC_ANDROID',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000472 ],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000473 'conditions': [
Henrik Kjellanderc0c7d2e2015-09-07 12:57:42 +0200474 ['clang==0', {
Henrik Kjellander5bfc6cb2015-09-21 16:50:45 +0200475 # The Android NDK doesn't provide optimized versions of these
476 # functions. Ensure they are disabled for all compilers.
wjia@webrtc.orgb1193692013-01-12 01:52:07 +0000477 'cflags': [
478 '-fno-builtin-cos',
479 '-fno-builtin-sin',
480 '-fno-builtin-cosf',
481 '-fno-builtin-sinf',
482 ],
483 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000484 ],
485 }],
kjellanderf0e174a2016-05-30 06:27:50 -0700486 ['chromeos==1', {
487 'defines': [
488 'CHROMEOS',
489 ],
490 }],
491 ['os_bsd==1', {
492 'defines': [
493 'BSD',
494 ],
495 }],
496 ['OS=="openbsd"', {
497 'defines': [
498 'OPENBSD',
499 ],
500 }],
501 ['OS=="freebsd"', {
502 'defines': [
503 'FREEBSD',
504 ],
505 }],
Tommi931e6582015-05-20 09:44:38 +0200506 ['include_internal_audio_device==1', {
507 'defines': [
508 'WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE',
509 ],
510 }],
Peter Boström12996152016-05-14 02:03:18 +0200511 ['libvpx_build_vp9==0', {
512 'defines': [
513 'RTC_DISABLE_VP9',
514 ],
515 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000516 ], # conditions
sergeyu@chromium.org6ebfd342013-05-22 18:22:21 +0000517 'direct_dependent_settings': {
sergeyu@chromium.org6ebfd342013-05-22 18:22:21 +0000518 'conditions': [
519 ['build_with_mozilla==1', {
520 'defines': [
521 # Changes settings for Mozilla build.
522 'WEBRTC_MOZILLA_BUILD',
523 ],
524 }],
525 ['build_with_chromium==1', {
526 'defines': [
527 # Changes settings for Chromium build.
kjellanderf0e174a2016-05-30 06:27:50 -0700528 # TODO(kjellander): Cleanup unused ones and move defines closer to
529 # the source when webrtc:4256 is completed.
530 'FEATURE_ENABLE_SSL',
531 'FEATURE_ENABLE_VOICEMAIL',
532 'EXPAT_RELATIVE_PATH',
533 'GTEST_RELATIVE_PATH',
534 'NO_MAIN_THREAD_WRAPPING',
535 'NO_SOUND_SYSTEM',
sergeyu@chromium.org6ebfd342013-05-22 18:22:21 +0000536 'WEBRTC_CHROMIUM_BUILD',
537 ],
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000538 'include_dirs': [
henrikgee2bf412015-09-30 03:48:52 -0700539 # The overrides must be included first as that is the mechanism for
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000540 # selecting the override headers in Chromium.
henrikgee2bf412015-09-30 03:48:52 -0700541 '../../webrtc_overrides',
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000542 '../..',
543 ],
544 }, {
545 'include_dirs': [
546 '../..',
547 ],
sergeyu@chromium.org6ebfd342013-05-22 18:22:21 +0000548 }],
549 ['OS=="mac"', {
550 'defines': [
551 'WEBRTC_MAC',
552 ],
553 }],
554 ['OS=="ios"', {
555 'defines': [
556 'WEBRTC_MAC',
557 'WEBRTC_IOS',
558 ],
559 }],
560 ['OS=="win"', {
561 'defines': [
562 'WEBRTC_WIN',
kjellanderf0e174a2016-05-30 06:27:50 -0700563 '_CRT_SECURE_NO_WARNINGS', # Suppress warnings about _vsnprinf
sergeyu@chromium.org6ebfd342013-05-22 18:22:21 +0000564 ],
565 }],
566 ['OS=="linux"', {
567 'defines': [
568 'WEBRTC_LINUX',
569 ],
570 }],
571 ['OS=="android"', {
572 'defines': [
573 'WEBRTC_LINUX',
574 'WEBRTC_ANDROID',
575 ],
sergeyu@chromium.org6ebfd342013-05-22 18:22:21 +0000576 }],
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000577 ['os_posix==1', {
578 # For access to standard POSIXish features, use WEBRTC_POSIX instead
579 # of a more specific macro.
580 'defines': [
581 'WEBRTC_POSIX',
582 ],
583 }],
kjellanderf0e174a2016-05-30 06:27:50 -0700584 ['chromeos==1', {
585 'defines': [
586 'CHROMEOS',
587 ],
588 }],
589 ['os_bsd==1', {
590 'defines': [
591 'BSD',
592 ],
593 }],
594 ['OS=="openbsd"', {
595 'defines': [
596 'OPENBSD',
597 ],
598 }],
599 ['OS=="freebsd"', {
600 'defines': [
601 'FREEBSD',
602 ],
603 }],
sergeyu@chromium.org6ebfd342013-05-22 18:22:21 +0000604 ],
605 },
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000606 }, # target_defaults
607}