Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Side by Side Diff: build/common.gypi

Issue 2345653002: Simplify build/common.gypi shell used to keep closure compilation going (Closed)
Patch Set: variables -> target_defaults Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4
5 # IMPORTANT:
6 # Please don't directly include this file if you are building via gyp_chromium,
7 # since gyp_chromium is automatically forcing its inclusion.
8 { 4 {
9 # Variables expected to be overriden on the GYP command line (-D) or by
10 # ~/.gyp/include.gypi.
11 'variables': {
12 # Putting a variables dict inside another variables dict looks kind of
13 # weird. This is done so that 'host_arch', 'chromeos', etc are defined as
14 # variables within the outer variables dict here. This is necessary
15 # to get these variables defined for the conditions within this variables
16 # dict that operate on these variables.
17 'variables': {
18 'variables': {
19 'variables': {
20 'variables': {
21 # Whether we're building a ChromeOS build.
22 'chromeos%': 0,
23
24 # Whether we're building the cast (chromecast) shell
25 'chromecast%': 0,
26
27 # Whether or not we are using the Aura windowing framework.
28 'use_aura%': 0,
29
30 # Whether or not we are building the Ash shell.
31 'use_ash%': 0,
32
33 # Whether or not we are using CRAS, the ChromeOS Audio Server.
34 'use_cras%': 0,
35
36 # Use a raw surface abstraction.
37 'use_ozone%': 0,
38
39 # Configure the build for small devices. See crbug.com/318413
40 'embedded%': 0,
41
42 'conditions': [
43 # Compute the architecture that we're building on.
44 ['OS=="win" or OS=="ios"', {
45 'host_arch%': 'ia32',
46 }, {
47 'host_arch%': '<!pymod_do_main(detect_host_arch)',
48 }],
49 ],
50 },
51 # Copy conditionally-set variables out one scope.
52 'chromeos%': '<(chromeos)',
53 'chromecast%': '<(chromecast)',
54 'use_aura%': '<(use_aura)',
55 'use_ash%': '<(use_ash)',
56 'use_cras%': '<(use_cras)',
57 'use_ozone%': '<(use_ozone)',
58 'embedded%': '<(embedded)',
59 'host_arch%': '<(host_arch)',
60
61 # Whether we are using Views Toolkit
62 'toolkit_views%': 0,
63
64 # Use the PCI lib to collect GPU information.
65 'use_libpci%': 1,
66
67 # Use OpenSSL for representing certificates. When targeting Android,
68 # the platform certificate library is used for certificate
69 # verification. On other targets, this flag also enables OpenSSL for
70 # certificate verification, but this configuration is unsupported.
71 'use_openssl_certs%': 0,
72
73 # Whether or not we use external popup menu.
74 'use_external_popup_menu%': 0,
75
76 # Disable viewport meta tag by default.
77 'enable_viewport%': 0,
78
79 # Enable HiDPI support.
80 'enable_hidpi%': 0,
81
82 # Enable Wayland display server support.
83 'enable_wayland_server%' : 0,
84
85 # Enable Wi-Fi Display support.
86 # WARNING: This enables MPEG Transport Stream (MPEG-TS) encoding!
87 'enable_wifi_display%' : 0,
88
89 # By default we build against a stable sysroot image to avoid
90 # depending on the packages installed on the local machine. Set this
91 # to 0 to build against locally installed headers and libraries (e.g.
92 # if packaging for a linux distro)
93 'use_sysroot%': 1,
94
95 # Override buildtype to select the desired build flavor.
96 # Dev - everyday build for development/testing
97 # Official - release build (generally implies additional processing)
98 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
99 # conversion is done), some of the things which are now controlled by
100 # 'branding', such as symbol generation, will need to be refactored
101 # based on 'buildtype' (i.e. we don't care about saving symbols for
102 # non-Official # builds).
103 'buildtype%': 'Dev',
104
105 # Override branding to select the desired branding flavor.
106 'branding%': 'Chromium',
107
108 'conditions': [
109 # Windows and Linux use Aura, but not Ash.
110 ['OS=="win" or OS=="linux" or OS=="openbsd" or OS=="freebsd"', {
111 'use_aura%': 1,
112 }],
113
114 # ChromeOS uses Ash.
115 ['chromeos', {
116 'use_ash%': 1,
117 }],
118
119 ['chromecast==1', {
120 'use_libpci': 0,
121 'conditions': [
122 ['OS!="android"', {
123 'embedded%': 1,
124 'use_ozone%': 1,
125 }],
126 ],
127 }],
128
129 # Ozone uses Aura.
130 ['use_ozone==1', {
131 'use_aura%': 1,
132 }],
133
134 # Whether we're a traditional desktop unix.
135 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") a nd chromeos==0', {
136 'desktop_linux%': 1,
137 }, {
138 'desktop_linux%': 0,
139 }],
140
141 # Embedded implies ozone.
142 ['embedded==1', {
143 'use_ozone%': 1,
144 }],
145
146 # Mac and Android use external popup menu.
147 ['OS=="mac" or OS=="android"', {
148 'use_external_popup_menu%': 1,
149 }],
150
151 ['OS=="android"', {
152 'target_arch%': 'arm',
153 }, {
154 # Default architecture we're building for is the architecture we'r e
155 # building on, and possibly sub-architecture (for iOS builds).
156 'target_arch%': '<(host_arch)',
157 }],
158 ],
159 },
160 # Copy conditionally-set variables out one scope.
161 'chromeos%': '<(chromeos)',
162 'chromecast%': '<(chromecast)',
163 'desktop_linux%': '<(desktop_linux)',
164 'use_aura%': '<(use_aura)',
165 'use_ash%': '<(use_ash)',
166 'use_cras%': '<(use_cras)',
167 'use_ozone%': '<(use_ozone)',
168 'embedded%': '<(embedded)',
169 'use_libpci%': '<(use_libpci)',
170 'use_openssl_certs%': '<(use_openssl_certs)',
171 'use_external_popup_menu%': '<(use_external_popup_menu)',
172 'enable_viewport%': '<(enable_viewport)',
173 'enable_hidpi%': '<(enable_hidpi)',
174 'enable_wayland_server%': '<(enable_wayland_server)',
175 'enable_wifi_display%': '<(enable_wifi_display)',
176 'buildtype%': '<(buildtype)',
177 'branding%': '<(branding)',
178 'branding_path_component%': '<(branding)',
179 'host_arch%': '<(host_arch)',
180 'target_arch%': '<(target_arch)',
181 'use_sysroot%': '<(use_sysroot)',
182
183 # Set to true to instrument the code with function call logger.
184 # See src/third_party/cygprofile/cyg-profile.cc for details.
185 'order_profiling%': 0,
186
187 'target_subarch%': '',
188
189 # The channel to build on Android: stable, beta, dev, canary, or
190 # default. "default" should be used on non-official builds.
191 'android_channel%': 'default',
192
193 # Set ARM architecture version.
194 'arm_version%': 7,
195
196 # Use aurax11 for clipboard implementation. This is true on linux_aura.
197 'use_clipboard_aurax11%': 0,
198
199 # goma settings.
200 # 1 to use goma.
201 # If no gomadir is set, it uses the default gomadir.
202 'use_goma%': 0,
203 'gomadir%': '',
204
205 'chroot_cmd%': '',
206
207 # The system libdir used for this ABI.
208 'system_libdir%': 'lib',
209
210 # Default MIPS arch variant. This is set in the conditions block
211 # below for MIPS targets.
212 'mips_arch_variant%': '',
213
214 # MIPS DSP ASE revision. Possible values are:
215 # 0: unavailable
216 # 1: revision 1
217 # 2: revision 2
218 'mips_dsp_rev%': 0,
219
220 # MIPS SIMD Arch compilation flag.
221 'mips_msa%': 1,
222
223 'conditions': [
224 ['branding == "Chrome"', {
225 'branding_path_component%': 'google_chrome',
226 }],
227
228 ['branding == "Chromium"', {
229 'branding_path_component%': 'chromium',
230 }],
231
232 # Ash needs Aura.
233 ['use_aura==0', {
234 'use_ash%': 0,
235 }],
236
237 # Set default value of toolkit_views based on OS.
238 ['OS=="mac" or OS=="win" or chromeos==1 or use_aura==1', {
239 'toolkit_views%': 1,
240 }, {
241 'toolkit_views%': 0,
242 }],
243
244 # Embedded builds use aura without ash or views.
245 ['embedded==1', {
246 'use_aura%': 1,
247 'use_ash%': 0,
248 'toolkit_views%': 0,
249 }],
250
251 # Chromecast builds on x86 Linux should default to desktop builds.
252 ['chromecast==1 and OS=="linux" and (target_arch=="ia32" or target_arc h=="x64")', {
253 'is_cast_desktop_build%': 1,
254 }, {
255 'is_cast_desktop_build%': 0,
256 }],
257
258 # Enable HiDPI on Mac OS, Windows and Linux (including Chrome OS).
259 ['OS=="mac" or OS=="win" or OS=="linux" or OS=="openbsd" or OS=="freeb sd"', {
260 'enable_hidpi%': 1,
261 }],
262
263 # Enable App Launcher on ChromeOS only.
264 ['chromeos==1', {
265 'enable_app_list%': 1,
266 }, {
267 'enable_app_list%': 0,
268 }],
269
270 ['use_aura==1 and OS!="android"', {
271 'use_default_render_theme%': 1,
272 }, {
273 'use_default_render_theme%': 0,
274 }],
275
276 ['use_ozone==1', {
277 'use_ozone_evdev%': 1,
278 }, {
279 'use_ozone_evdev%': 0,
280 }],
281
282 # Set default gomadir.
283 ['OS=="win"', {
284 'gomadir': 'c:\\goma\\goma-win64',
285 }, {
286 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
287 }],
288
289 # Set the default "target_subarch" on iOS. Valid values are "arm32",
290 # "arm64" and "both" (meaning a fat binary).
291 ['OS=="ios"', {
292 'target_subarch%': 'arm64',
293 }],
294
295 # Set arch variants for MIPS platforms.
296 ['target_arch=="mips64el"', {
297 'conditions': [
298 ['OS=="android"', {
299 'mips_arch_variant%': 'r6',
300 }, {
301 'mips_arch_variant%': 'r2',
302 }],
303 ],
304 }],
305
306 ['target_arch=="mipsel"', {
307 'mips_arch_variant%': 'r1',
308 }],
309
310 # The system root for linux builds.
311 ['OS=="linux" and chromeos==0 and use_sysroot==1', {
312 # sysroot needs to be an absolute path otherwise it generates
313 # incorrect results when passed to pkg-config
314 'conditions': [
315 ['target_arch=="arm"', {
316 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy _arm-sysroot',
317 }],
318 ['target_arch=="arm64"', {
319 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie _arm64-sysroot',
320 }],
321 ['target_arch=="x64"', {
322 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy _amd64-sysroot',
323 }],
324 ['target_arch=="ia32"', {
325 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy _i386-sysroot',
326 }],
327 ['target_arch=="mipsel"', {
328 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy _mips-sysroot',
329 }],
330 ],
331 }, {
332 'sysroot%': ''
333 }], # OS=="linux" and use_sysroot==1
334 ],
335 },
336
337 # Copy conditionally-set variables out one scope.
338 'chromeos%': '<(chromeos)',
339 'chromecast%': '<(chromecast)',
340 'is_cast_desktop_build%': '<(is_cast_desktop_build)',
341 'host_arch%': '<(host_arch)',
342 'target_arch%': '<(target_arch)',
343 'target_subarch%': '<(target_subarch)',
344 'mips_arch_variant%': '<(mips_arch_variant)',
345 'mips_dsp_rev%': '<(mips_dsp_rev)',
346 'mips_msa%': '<(mips_msa)',
347 'toolkit_views%': '<(toolkit_views)',
348 'desktop_linux%': '<(desktop_linux)',
349 'use_aura%': '<(use_aura)',
350 'use_ash%': '<(use_ash)',
351 'use_cras%': '<(use_cras)',
352 'use_libpci%': '<(use_libpci)',
353 'use_ozone%': '<(use_ozone)',
354 'use_ozone_evdev%': '<(use_ozone_evdev)',
355 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
356 'embedded%': '<(embedded)',
357 'use_openssl_certs%': '<(use_openssl_certs)',
358 'use_external_popup_menu%': '<(use_external_popup_menu)',
359 'enable_viewport%': '<(enable_viewport)',
360 'enable_hidpi%': '<(enable_hidpi)',
361 'enable_wayland_server%': '<(enable_wayland_server)',
362 'enable_wifi_display%': '<(enable_wifi_display)',
363 'android_channel%': '<(android_channel)',
364 'use_goma%': '<(use_goma)',
365 'gomadir%': '<(gomadir)',
366 'enable_app_list%': '<(enable_app_list)',
367 'use_default_render_theme%': '<(use_default_render_theme)',
368 'buildtype%': '<(buildtype)',
369 'branding%': '<(branding)',
370 'branding_path_component%': '<(branding_path_component)',
371 'arm_version%': '<(arm_version)',
372 'sysroot%': '<(sysroot)',
373 'use_sysroot%': '<(use_sysroot)',
374 'chroot_cmd%': '<(chroot_cmd)',
375 'system_libdir%': '<(system_libdir)',
376 'order_profiling%': '<(order_profiling)',
377
378 # TODO(zforman): Remove as soon as no bots depend on this.
379 'dont_embed_build_metadata%': 0,
380
381 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
382 # This is useful for parallel compilation tools which can't support /Zi.
383 # Only used on Windows.
384 'win_z7%' : 0,
385
386 # Set to 1 to enable dcheck in Release build.
387 'dcheck_always_on%': 0,
388
389 # Set to 1 to make a build that disables unshipped tracing events.
390 # Note: this setting is ignored if buildtype=="Official".
391 'tracing_like_official_build%': 0,
392
393 # Set to 1 to make a build that disables activation of field trial tests
394 # specified in testing/variations/fieldtrial_testing_config_*.json.
395 # Note: this setting is ignored if branding=="Chrome".
396 'fieldtrial_testing_like_official_build%': 0,
397
398 # Disable image loader component extension by default.
399 'image_loader_extension%': 0,
400
401 # Set NEON compilation flags.
402 'arm_neon%': 1,
403
404 # Detect NEON support at run-time. TODO(pasko): This variable is no longer
405 # set to non-zero, remove it when the last official build with NEON
406 # runtime detection propagates to Stable channel.
407 'arm_neon_optional%': 0,
408
409 # Use libjpeg-turbo as the JPEG codec used by Chromium.
410 'use_libjpeg_turbo%': 1,
411
412 # Use system libjpeg. Note that the system's libjepg will be used even if
413 # use_libjpeg_turbo is set.
414 'use_system_libjpeg%': 0,
415
416 # By default, component is set to static_library and it can be overriden
417 # by the GYP command line or by ~/.gyp/include.gypi.
418 'component%': 'static_library',
419
420 # /analyze is off by default on Windows because it is very slow and noisy.
421 # Enable with GYP_DEFINES=win_analyze=1
422 'win_analyze%': 0,
423
424 # /debug:fastlink is off by default on Windows because it generates PDBs
425 # that are machine-local. But, great for local builds.
426 # Enable with GYP_DEFINES=win_fastlink=1
427 'win_fastlink%': 0,
428
429 # Experimental setting to optimize Chrome's DLLs with PGO.
430 'chrome_pgo_phase%': '0',
431
432 # Experimental setting to build the official builds with full WPO.
433 'full_wpo_on_official%': '0',
434
435 # Set to select the Title Case versions of strings in GRD files.
436 'use_titlecase_in_grd%': 0,
437
438 # Remoting compilation is enabled by default. Set to 0 to disable.
439 'remoting%': 1,
440
441 # Configuration policy is enabled by default. Overridden on some
442 # platforms. This can't be disabled manually since code in src/chrome
443 # assumes this is enabled.
444 'configuration_policy': 1,
445
446 # Variable safe_browsing is used to control the build time configuration
447 # for safe browsing feature. Safe browsing can be compiled in 3 different
448 # levels: 0 disables it, 1 enables it fully, and 2 enables mobile
449 # protection via an external API.
450 'safe_browsing%': 1,
451
452 # Web speech is enabled by default. Set to 0 to disable.
453 'enable_web_speech%': 1,
454
455 # 'Ok Google' hotwording is disabled by default. Set to 1 to enable. (This
456 # will download a closed-source NaCl module at startup.) Chrome-branded
457 # ChromeOS builds have this enabled by default.
458 'enable_hotwording%': 0,
459
460 # Notifications are compiled in by default. Set to 0 to disable.
461 'notifications%' : 1,
462
463 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
464 # regular builds and 1 for ASan builds.
465 'mac_want_real_dsym%': 'default',
466
467 # If this is set, the clang plugins used on the buildbot will be used.
468 # Run tools/clang/scripts/update.py to make sure they are compiled.
469 # This causes 'clang_chrome_plugins_flags' to be set.
470 # Has no effect if 'clang' is not set as well.
471 'clang_use_chrome_plugins%': 1,
472
473 # Enable building with ASAN (Clang's -fsanitize=address option).
474 # -fsanitize=address only works with clang, but asan=1 implies clang=1
475 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addre sssanitizer
476 'asan%': 0,
477 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
478 # Enable coverage gathering instrumentation in sanitizer tools. This flag
479 # also controls coverage granularity.
480 'sanitizer_coverage%': '',
481 # Enable intra-object-overflow detection in ASan (experimental).
482 'asan_field_padding%': 0,
483
484 # Enable Chromium overrides of the default configurations for various
485 # dynamic tools (like ASan).
486 'use_sanitizer_options%': 0,
487
488 # Enable building with SyzyAsan.
489 # See https://github.com/google/syzygy/wiki/SyzyASanHowTo
490 'syzyasan%': 0,
491
492 # Enable building with LSan (Clang's -fsanitize=leak option).
493 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
494 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaks anitizer
495 'lsan%': 0,
496
497 # Enable building with TSan (Clang's -fsanitize=thread option).
498 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
499 # See http://clang.llvm.org/docs/ThreadSanitizer.html
500 'tsan%': 0,
501 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt' ,
502
503 # Enable building with MSan (Clang's -fsanitize=memory option).
504 # MemorySanitizer only works with clang, but msan=1 implies clang=1
505 # See http://clang.llvm.org/docs/MemorySanitizer.html
506 'msan%': 0,
507 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
508 # Track where uninitialized memory originates from. From fastest to
509 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
510 # - track the chain of stores leading from allocation site to use site.
511 'msan_track_origins%': 2,
512
513 # Enable building with UBSan (Clang's -fsanitize=undefined option).
514 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
515 # See http://clang.llvm.org/docs/UsersManual.html
516 'ubsan%': 0,
517 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
518 'ubsan_security_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/security_bl acklist.txt',
519 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/vptr_blacklist. txt',
520
521 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
522 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
523 # ubsan_security also enables UBSan's vptr.
524 'ubsan_security%': 0,
525 'ubsan_vptr%': 0,
526
527 # Use dynamic libraries instrumented by one of the sanitizers
528 # instead of the standard system libraries. Set this flag to build the
529 # libraries from source.
530 'use_instrumented_libraries%': 0,
531
532 # Use dynamic libraries instrumented by one of the sanitizers
533 # instead of the standard system libraries. Set this flag to download
534 # prebuilt binaries from GCS.
535 'use_prebuilt_instrumented_libraries%': 0,
536
537 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
538 # stdlibc++ as standard library. This is intended to use for instrumented
539 # builds.
540 'use_custom_libcxx%': 0,
541
542 # Use the provided profiled order file to link Chrome image with it.
543 # This makes Chrome faster by better using CPU cache when executing code.
544 # This is known as PGO (profile guided optimization).
545 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-e ffort
546 'order_text_section%' : "",
547
548 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
549 # libraries on linux x86-64 and arm, plus ASLR.
550 'linux_fpic%': 1,
551
552 # Whether one-click signin is enabled or not.
553 'enable_one_click_signin%': 0,
554
555 # Enable Chrome browser extensions
556 'enable_extensions%': 1,
557
558 # Enable basic printing support and UI.
559 'enable_basic_printing%': 1,
560
561 # Enable printing with print preview. It does not imply
562 # enable_basic_printing. It's possible to build Chrome with preview only.
563 'enable_print_preview%': 1,
564
565 # For CLD2, the size of the tables that should be included in the build
566 # See third_party/cld_2/cld_2.gyp for more information.
567 # 0: Small tables, high accuracy
568 # 2: Large tables, higher accuracy
569 'cld2_table_size%': 2,
570
571 # Enable spell checker.
572 'enable_spellcheck%': 1,
573
574 # Use the operating system spellchecker, e.g. NSSpellChecker on Mac or
575 # SpellCheckerSession on Android.
576 'use_browser_spellchecker%': 0,
577
578 # Use Minikin hyphenation engine.
579 'use_minikin_hyphenation%': 0,
580
581 # Webrtc compilation is enabled by default. Set to 0 to disable.
582 'enable_webrtc%': 1,
583
584 # Media router support is enabled by default. Set to 0 to disable.
585 'enable_media_router%': 1,
586
587 # Enables use of the session service, which is enabled by default.
588 # Support for disabling depends on the platform.
589 'enable_session_service%': 1,
590
591 # Enables theme support, which is enabled by default. Support for
592 # disabling depends on the platform.
593 'enable_themes%': 1,
594
595 # Enable the task manager by default.
596 'enable_task_manager%': 1,
597
598 # Enables used resource whitelist generation; disabled by default.
599 'enable_resource_whitelist_generation%': 0,
600
601 # Enable FILE support by default.
602 'disable_file_support%': 0,
603
604 # Enable FTP support by default.
605 'disable_ftp_support%': 0,
606
607 # Do not use the platform ICU alternatives by default.
608 'use_platform_icu_alternatives%': 0,
609
610 # Do not disable brotli filter by default.
611 'disable_brotli_filter%': 0,
612
613 # Use of precompiled headers on Windows.
614 #
615 # This variable may be explicitly set to 1 (enabled) or 0
616 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
617 # This setting will override the default.
618 #
619 # See
620 # https://chromium.googlesource.com/chromium/src/+/master/docs/windows_pre compiled_headers.md
621 # for details.
622 'chromium_win_pch%': 0,
623
624 # Clang stuff.
625 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
626 # Set this to true when building with Clang.
627 # See https://chromium.googlesource.com/chromium/src/+/master/docs/clang.m d for details.
628 # If this is set, clang is used as both host and target compiler in
629 # cross-compile builds.
630 'clang%': 0,
631
632 # Use experimental lld linker instead of the platform's default linker.
633 'use_lld%': 0,
634
635 # Enable plugin installation by default.
636 'enable_plugin_installation%': 1,
637
638 # Specifies whether to use canvas_skia.cc in place of platform
639 # specific implementations of gfx::Canvas. Affects text drawing in the
640 # Chrome UI.
641 # TODO(asvitkine): Enable this on all platforms and delete this flag.
642 # http://crbug.com/105550
643 'use_canvas_skia%': 0,
644
645 # Set to "drmemory" to configure the build to work with DrMemory.
646 'build_for_tool%': '',
647
648 'wix_path%': '<(DEPTH)/third_party/wix',
649
650 # Supervised users are enabled by default.
651 'enable_supervised_users%': 1,
652
653 'enable_mdns%' : 0,
654 'enable_service_discovery%': 0,
655 'enable_hangout_services_extension%': 0,
656
657 # Enable the Syzygy optimization step.
658 'syzygy_optimize%': 0,
659
660 # Enable hole punching for the protected video.
661 'video_hole%': 0,
662
663 # Automatically select platforms under ozone. Turn this off to
664 # build only explicitly selected platforms.
665 'ozone_auto_platforms%': 1,
666
667 # Disable the display for a chromecast build. Set to 1 perform an audio-
668 # only build.
669 'disable_display%': 0,
670
671 # If this is set clang is used as host compiler, but not as target
672 # compiler. Always do this by default.
673 'host_clang%': 1,
674
675 # Variables to control Link-Time Optimization (LTO).
676 # On Android, when using GCC LTO, the variable use_lto enables LTO on code
677 # compiled with -Os, and use_lto_o2 enables LTO on code compiled with -O2.
678 # On other platforms (including Android with Clang), use_lto enables LTO
679 # in all translation units, and use_lto_o2 has no effect.
680 #
681 # On Linux and Android, when using LLVM LTO, the script
682 # build/download_gold_plugin.py must be run to download a linker plugin.
683 # On Mac, LLVM needs to be built from scratch using
684 # tools/clang/scripts/update.py and the absolute path to
685 # third_party/llvm-build/Release+Asserts/lib must be added to
686 # $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin.
687 # TODO(pcc): Teach build system to use -lto_library flag to specify path
688 # to linker plugin on Mac.
689 #
690 # On Android/GCC, the variables must *not* be enabled at the same time.
691 # In this case LTO would 'merge' the optimization flags at link-time
692 # which would lead to all code be optimized with -O2. See crbug.com/407544
693 'use_lto%': 0,
694 'use_lto_o2%': 0,
695
696 # Allowed level of identical code folding in the gold linker.
697 'gold_icf_level%': 'all',
698
699 # Libxkbcommon usage.
700 'use_xkbcommon%': 0,
701
702 # Whether we use GTKv3 on linux.
703 'use_gtk3%': 0,
704
705 # Control Flow Integrity for virtual calls and casts.
706 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
707 'cfi_vptr%': 0,
708 # TODO(krasin): remove it. See https://crbug.com/626794.
709 'cfi_cast%': 0,
710 'cfi_diag%': 0,
711
712 'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
713
714 # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
715 'mac_views_browser%': 0,
716
717 # By default, use ICU data file (icudtl.dat).
718 'icu_use_data_file_flag%': 1,
719
720 # Turn on JNI generation optimizations by default.
721 'optimize_jni_generation%': 1,
722
723 'conditions': [
724 # A flag for POSIX platforms
725 ['OS=="win"', {
726 'os_posix%': 0,
727 }, {
728 'os_posix%': 1,
729 }],
730
731 # A flag for BSD platforms
732 ['OS=="freebsd" or OS=="openbsd"', {
733 'os_bsd%': 1,
734 }, {
735 'os_bsd%': 0,
736 }],
737
738 # NSS usage.
739 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris")', {
740 'use_nss_certs%': 1,
741 }, {
742 'use_nss_certs%': 0,
743 }],
744
745 # libudev usage. This currently only affects the content layer.
746 ['OS=="linux" and embedded==0', {
747 'use_udev%': 1,
748 }, {
749 'use_udev%': 0,
750 }],
751
752 # Flags to use X11 on non-Mac POSIX platforms.
753 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
754 'use_x11%': 0,
755 }, {
756 'use_x11%': 1,
757 }],
758
759 # Flags to use glib.
760 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
761 'use_glib%': 0,
762 }, {
763 'use_glib%': 1,
764 }],
765
766 # Flags to use Wayland server support.
767 ['chromeos==1', {
768 'enable_wayland_server%': 1,
769 }, {
770 'enable_wayland_server%': 0,
771 }],
772
773 # Flags to use pango and cairo.
774 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
775 'use_pango%': 0,
776 'use_cairo%': 0,
777 }, {
778 'use_pango%': 1,
779 'use_cairo%': 1,
780 }],
781
782 # DBus usage.
783 ['(OS=="linux" or OS=="openbsd" or OS=="freebsd") and embedded==0', {
784 'use_dbus%': 1,
785 }, {
786 'use_dbus%': 0,
787 }],
788
789 # We always use skia text rendering in Aura on Windows, since GDI
790 # doesn't agree with our BackingStore.
791 # TODO(beng): remove once skia text rendering is on by default.
792 ['use_aura==1 and OS=="win"', {
793 'enable_skia_text%': 1,
794 }],
795
796 # A flag to enable or disable our compile-time dependency
797 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
798 # support will be available. This option is useful
799 # for Linux distributions and for Aura.
800 ['OS!="linux" or chromeos==1', {
801 'use_gnome_keyring%': 0,
802 }, {
803 'use_gnome_keyring%': 1,
804 }],
805
806 ['OS=="mac" or OS=="ios"', {
807 # Mac and iOS want Title Case strings
808 'use_titlecase_in_grd%': 1,
809 }],
810
811 # Enable loader extensions on Chrome OS.
812 ['chromeos==1', {
813 'image_loader_extension%': 1,
814 }, {
815 'image_loader_extension%': 0,
816 }],
817
818 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
819 'enable_one_click_signin%': 1,
820 }],
821
822 ['OS=="android"', {
823 'enable_extensions%': 0,
824 'cld2_table_size%': 0,
825 'enable_themes%': 0,
826 'remoting%': 0,
827 'enable_basic_printing%': 1,
828 'enable_print_preview%': 0,
829 'enable_task_manager%':0,
830 'video_hole%': 1,
831 }],
832
833 # Android and OSX have built-in spellcheckers that can be utilized.
834 ['OS=="android" or OS=="mac"', {
835 'use_browser_spellchecker%': 1,
836 }],
837
838 # Android has hyphenation dictionaries for Minikin to use.
839 ['OS=="android"', {
840 'use_minikin_hyphenation%': 1,
841 }],
842
843 # Enables proprietary codecs and demuxers; e.g. H264, AAC, MP3, and MP4.
844 # We always build Google Chrome and Chromecast with proprietary codecs.
845 ['branding=="Chrome" or chromecast==1', {
846 'proprietary_codecs%': 1,
847 }, {
848 'proprietary_codecs%': 0,
849 }],
850
851 # Enable Link Time Optimization for the official Linux Chrome.
852 # This requires LLVM Gold plugin to be downloaded.
853 # See src/tools/clang/scripts/update.py
854 ['OS=="linux" and target_arch=="x64" and buildtype=="Official" and brand ing=="Chrome" and chromeos==0', {
855 'use_lto%': 1,
856 }],
857
858 # Enable hotwording on Chrome-branded ChromeOS builds.
859 ['branding=="Chrome" and chromeos==1', {
860 'enable_hotwording%': 1,
861 }],
862
863 ['OS=="android"', {
864 'enable_webrtc%': 1,
865 }],
866
867 ['OS=="ios"', {
868 'configuration_policy': 0,
869 'disable_ftp_support%': 1,
870 'enable_extensions%': 0,
871 'cld2_table_size%': 0,
872 'enable_basic_printing%': 0,
873 'enable_print_preview%': 0,
874 'enable_session_service%': 0,
875 'enable_spellcheck%': 0,
876 'enable_themes%': 0,
877 'enable_webrtc%': 0,
878 'notifications%': 0,
879 'remoting%': 0,
880 'safe_browsing%': 2,
881 'enable_supervised_users%': 0,
882 'enable_task_manager%': 0,
883 'enable_media_router%': 0,
884 }],
885
886 # Use GPU accelerated cross process image transport by default
887 # on linux and *BSD builds with the Aura window manager
888 ['use_aura==1 and (OS=="linux" or OS=="openbsd" or OS=="freebsd")', {
889 'ui_compositor_image_transport%': 1,
890 }, {
891 'ui_compositor_image_transport%': 0,
892 }],
893
894 # Turn precompiled headers on by default.
895 ['OS=="win" and buildtype!="Official"', {
896 'chromium_win_pch%': 1
897 }],
898
899 # Whether PDF plugin is enabled, and which options it supports.
900 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
901 'enable_pdf%': 0,
902 'pdf_enable_v8%': 0,
903 }, {
904 'enable_pdf%': 1,
905 'pdf_enable_v8%': 1,
906 }],
907 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
908 'pdf_enable_xfa%': 0,
909 }, {
910 'pdf_enable_xfa%': 0,
911 }],
912
913 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
914 'enable_plugin_installation%': 0,
915 }, {
916 'enable_plugin_installation%': 1,
917 }],
918
919 # Whether PPAPI is enabled.
920 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
921 'enable_plugins%': 0,
922 }, {
923 'enable_plugins%': 1,
924 }],
925
926 # linux_use_bundled_gold: whether to use the gold linker binary checked
927 # into third_party/binutils. Force this off via GYP_DEFINES when you
928 # are using a custom toolchain and need to control -B in ldflags.
929 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
930 # for component=static_library builds.
931 ['((OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch =="arm" or (target_arch=="ia32" and host_arch=="x64"))) or (OS=="linux" and targ et_arch=="mipsel")', {
932 'linux_use_bundled_gold%': 1,
933 }, {
934 'linux_use_bundled_gold%': 0,
935 }],
936
937 # linux_use_bundled_binutils: whether to use the binary binutils
938 # checked into third_party/binutils. These are not multi-arch so cannot
939 # be used except on x86 and x86-64 (the only two architectures which
940 # are currently checke in). Force this off via GYP_DEFINES when you
941 # are using a custom toolchain and need to control -B in cflags.
942 ['OS=="linux" and (target_arch=="x64")', {
943 'linux_use_bundled_binutils%': 1,
944 }, {
945 'linux_use_bundled_binutils%': 0,
946 }],
947
948 # linux_use_gold_flags: whether to use build flags that rely on gold.
949 # On by default for x64 Linux.
950 ['OS=="linux" and target_arch=="x64"', {
951 'linux_use_gold_flags%': 1,
952 }, {
953 'linux_use_gold_flags%': 0,
954 }],
955
956 # linux_use_debug_fission: whether to use split DWARF debug info
957 # files. This can reduce link time significantly, but is incompatible
958 # with some utilities such as icecc and ccache. Requires gold and
959 # gcc >= 4.8 or clang.
960 # http://gcc.gnu.org/wiki/DebugFission
961 ['OS=="linux" and target_arch=="x64"', {
962 'linux_use_debug_fission%': 1,
963 }, {
964 'linux_use_debug_fission%': 0,
965 }],
966
967 ['OS=="android" or OS=="ios"', {
968 'enable_captive_portal_detection%': 0,
969 }, {
970 'enable_captive_portal_detection%': 1,
971 }],
972
973 # Enable Skia UI text drawing incrementally on different platforms.
974 # http://crbug.com/105550
975 #
976 # On Aura, this allows per-tile painting to be used in the browser
977 # compositor.
978 ['OS!="android" and OS!="ios"', {
979 'use_canvas_skia%': 1,
980 }],
981
982 ['chromeos==1', {
983 'enable_basic_printing%': 1,
984 'enable_print_preview%': 1,
985 }],
986
987 # Whether tests targets should be run, archived or just have the
988 # dependencies verified. All the tests targets have the '_run' suffix,
989 # e.g. base_unittests_run runs the target base_unittests. The test
990 # target always calls tools/swarming_client/isolate.py. See the script's
991 # --help for more information. Meant to be overriden with GYP_DEFINES.
992 # TODO(maruel): Remove the conditions as more configurations are
993 # supported.
994 ['OS!="ios" and OS!="android" and chromeos==0 and OS!="openbsd" and OS!= "freebsd"', {
995 'test_isolation_mode%': 'check',
996 }, {
997 'test_isolation_mode%': 'noop',
998 }],
999 # Whether Android build uses OpenMAX DL FFT.
1000 ['OS=="android" and ((target_arch=="arm" and arm_version >= 7) or target _arch=="ia32" or target_arch=="x64" or target_arch=="arm64" or target_arch=="mip sel")', {
1001 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mip sel.
1002 # When enabled, this will also enable WebAudio support on
1003 # Android for these architectures. Default is enabled. Whether
1004 # WebAudio is actually available depends on runtime settings
1005 # and flags.
1006 'use_openmax_dl_fft%': 1,
1007 }, {
1008 'use_openmax_dl_fft%': 0,
1009 }],
1010 ['OS=="win" or OS=="linux" or OS=="openbsd" or OS=="freebsd"', {
1011 'enable_mdns%' : 1,
1012 }],
1013
1014 # Disable various features by default on embedded.
1015 ['embedded==1', {
1016 'remoting%': 0,
1017 'enable_basic_printing%': 0,
1018 'enable_print_preview%': 0,
1019 }],
1020
1021 ['sysroot!=""', {
1022 'pkg-config': '<(chroot_cmd) <(DEPTH)/build/linux/pkg-config-wrapper " <(sysroot)" "<(target_arch)" "<(system_libdir)"',
1023 }, {
1024 'pkg-config': 'pkg-config'
1025 }],
1026
1027 # Enable WebVR support by default on Android
1028 # Still requires command line flag to access API
1029 ['OS=="android"', {
1030 'enable_webvr%': 1,
1031 }, {
1032 'enable_webvr%': 0,
1033 }],
1034
1035 ['order_profiling==0', {
1036 # Set to 1 to enable fast builds. Set to 2 for even faster builds
1037 # (it disables debug info for fastest compilation - only for use
1038 # on compile-only bots).
1039 'fastbuild%': 0,
1040 }, {
1041 # With instrumentation enabled, debug info puts libchrome.so over 4gb,
1042 # which causes the linker to produce an invalid ELF.
1043 # http://crbug.com/574476
1044 'fastbuild%': 2,
1045 }],
1046 ],
1047
1048 # Kasko reporting is disabled by default, but may get enabled below.
1049 'kasko%': 0,
1050
1051 # Setting this to '0' will cause V8's startup snapshot to be
1052 # embedded in the binary instead of being a external files.
1053 'v8_use_external_startup_data%': 1,
1054
1055 # Set this to 1 to enable use of concatenated impulse responses
1056 # for the HRTF panner in WebAudio.
1057 'use_concatenated_impulse_responses': 1,
1058
1059 # You can set the variable 'use_official_google_api_keys' to 1
1060 # to use the Google-internal file containing official API keys
1061 # for Google Chrome even in a developer build. Setting this
1062 # variable explicitly to 1 will cause your build to fail if the
1063 # internal file is missing.
1064 #
1065 # The variable is documented here, but not handled in this file;
1066 # see //google_apis/determine_use_official_keys.gypi for the
1067 # implementation.
1068 #
1069 # Set the variable to 0 to not use the internal file, even when
1070 # it exists in your checkout.
1071 #
1072 # Leave it unset in your include.gypi to have the variable
1073 # implicitly set to 1 if you have
1074 # src/google_apis/internal/google_chrome_api_keys.h in your
1075 # checkout, and implicitly set to 0 if not.
1076 #
1077 # Note that official builds always behave as if the variable
1078 # was explicitly set to 1, i.e. they always use official keys,
1079 # and will fail to build if the internal file is missing.
1080 #
1081 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1082 # include.gypi or by other means. Due to subtleties of GYP, this
1083 # is not the same as leaving the variable unset, even though its
1084 # default value in
1085 # //google_apis/determine_use_official_keys.gypi is 2.
1086
1087 # Set these to bake the specified API keys and OAuth client
1088 # IDs/secrets into your build.
1089 #
1090 # If you create a build without values baked in, you can instead
1091 # set environment variables to provide the keys at runtime (see
1092 # src/google_apis/google_api_keys.h for details). Features that
1093 # require server-side APIs may fail to work if no keys are
1094 # provided.
1095 #
1096 # Note that if you are building an official build or if
1097 # use_official_google_api_keys has been set to 1 (explicitly or
1098 # implicitly), these values will be ignored and the official
1099 # keys will be used instead.
1100 'google_api_key%': '',
1101 'google_default_client_id%': '',
1102 'google_default_client_secret%': '',
1103 # Native Client is enabled by default.
1104 'disable_nacl%': '0',
1105
1106 # Native Client toolchains, enabled by default.
1107 'disable_pnacl%': 0,
1108 'disable_newlib%': 0,
1109
1110 # Sets the default version name and code for Android app, by default we
1111 # do a developer build.
1112 'android_app_version_name%': 'Developer Build',
1113 'android_app_version_code%': 1,
1114
1115 # Use the internal version of the framework to build Android WebView.
1116 'use_webview_internal_framework%': 0,
1117 },
1118
1119 # Copy conditionally-set variables out one scope.
1120 'branding%': '<(branding)',
1121 'branding_path_component%': '<(branding_path_component)',
1122 'buildtype%': '<(buildtype)',
1123 'target_arch%': '<(target_arch)',
1124 'target_subarch%': '<(target_subarch)',
1125 'mips_arch_variant%': '<(mips_arch_variant)',
1126 'mips_dsp_rev%': '<(mips_dsp_rev)',
1127 'mips_msa%': '<(mips_msa)',
1128 'host_arch%': '<(host_arch)',
1129 'toolkit_views%': '<(toolkit_views)',
1130 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1131 'use_aura%': '<(use_aura)',
1132 'use_ash%': '<(use_ash)',
1133 'use_cras%': '<(use_cras)',
1134 'use_libpci%': '<(use_libpci)',
1135 'use_openssl_certs%': '<(use_openssl_certs)',
1136 'use_external_popup_menu%': '<(use_external_popup_menu)',
1137 'use_nss_certs%': '<(use_nss_certs)',
1138 'use_udev%': '<(use_udev)',
1139 'os_bsd%': '<(os_bsd)',
1140 'os_posix%': '<(os_posix)',
1141 'use_dbus%': '<(use_dbus)',
1142 'use_glib%': '<(use_glib)',
1143 'use_pango%': '<(use_pango)',
1144 'use_cairo%': '<(use_cairo)',
1145 'use_ozone%': '<(use_ozone)',
1146 'use_ozone_evdev%': '<(use_ozone_evdev)',
1147 'use_xkbcommon%': '<(use_xkbcommon)',
1148 'use_gtk3%': '<(use_gtk3)',
1149 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1150 'desktop_linux%': '<(desktop_linux)',
1151 'use_x11%': '<(use_x11)',
1152 'use_gnome_keyring%': '<(use_gnome_keyring)',
1153 'linux_fpic%': '<(linux_fpic)',
1154 'chromeos%': '<(chromeos)',
1155 'chromecast%': '<(chromecast)',
1156 'is_cast_desktop_build%': '<(is_cast_desktop_build)',
1157 'enable_viewport%': '<(enable_viewport)',
1158 'enable_hidpi%': '<(enable_hidpi)',
1159 'enable_wayland_server%': '<(enable_wayland_server)',
1160 'enable_wifi_display%': '<(enable_wifi_display)',
1161 'image_loader_extension%': '<(image_loader_extension)',
1162 'fastbuild%': '<(fastbuild)',
1163 'win_z7%': '<(win_z7)',
1164 'dcheck_always_on%': '<(dcheck_always_on)',
1165 'tracing_like_official_build%': '<(tracing_like_official_build)',
1166 'fieldtrial_testing_like_official_build%': '<(fieldtrial_testing_like_offici al_build)',
1167 'arm_version%': '<(arm_version)',
1168 'arm_neon%': '<(arm_neon)',
1169 'arm_neon_optional%': '<(arm_neon_optional)',
1170 'sysroot%': '<(sysroot)',
1171 'use_sysroot%': '<(use_sysroot)',
1172 'pkg-config%': '<(pkg-config)',
1173 'chroot_cmd%': '<(chroot_cmd)',
1174 'system_libdir%': '<(system_libdir)',
1175 'component%': '<(component)',
1176 'win_analyze%': '<(win_analyze)',
1177 'win_fastlink%': '<(win_fastlink)',
1178 'chrome_pgo_phase%': '<(chrome_pgo_phase)',
1179 'full_wpo_on_official%': '<(full_wpo_on_official)',
1180 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_genera tion)',
1181 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1182 'remoting%': '<(remoting)',
1183 'enable_one_click_signin%': '<(enable_one_click_signin)',
1184 'enable_media_router%': '<(enable_media_router)',
1185 'enable_webrtc%': '<(enable_webrtc)',
1186 'chromium_win_pch%': '<(chromium_win_pch)',
1187 'configuration_policy': '<(configuration_policy)',
1188 'safe_browsing%': '<(safe_browsing)',
1189 'enable_web_speech%': '<(enable_web_speech)',
1190 'enable_hotwording%': '<(enable_hotwording)',
1191 'notifications%': '<(notifications)',
1192 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1193 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1194 'asan%': '<(asan)',
1195 'asan_blacklist%': '<(asan_blacklist)',
1196 'sanitizer_coverage%': '<(sanitizer_coverage)',
1197 'asan_field_padding%': '<(asan_field_padding)',
1198 'use_sanitizer_options%': '<(use_sanitizer_options)',
1199 'syzyasan%': '<(syzyasan)',
1200 'kasko%': '<(kasko)',
1201 'syzygy_optimize%': '<(syzygy_optimize)',
1202 'lsan%': '<(lsan)',
1203 'msan%': '<(msan)',
1204 'msan_blacklist%': '<(msan_blacklist)',
1205 'msan_track_origins%': '<(msan_track_origins)',
1206 'tsan%': '<(tsan)',
1207 'tsan_blacklist%': '<(tsan_blacklist)',
1208 'ubsan%': '<(ubsan)',
1209 'ubsan_blacklist%': '<(ubsan_blacklist)',
1210 'ubsan_security%': '<(ubsan_security)',
1211 'ubsan_security_blacklist%': '<(ubsan_security_blacklist)',
1212 'ubsan_vptr%': '<(ubsan_vptr)',
1213 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1214 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1215 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_librari es)',
1216 'use_custom_libcxx%': '<(use_custom_libcxx)',
1217 'order_profiling%': '<(order_profiling)',
1218 'order_text_section%': '<(order_text_section)',
1219 'enable_extensions%': '<(enable_extensions)',
1220 'enable_pdf%': '<(enable_pdf)',
1221 'pdf_enable_v8%': '<(pdf_enable_v8)',
1222 'pdf_enable_xfa%': '<(pdf_enable_xfa)',
1223 'enable_plugin_installation%': '<(enable_plugin_installation)',
1224 'enable_plugins%': '<(enable_plugins)',
1225 'enable_session_service%': '<(enable_session_service)',
1226 'enable_themes%': '<(enable_themes)',
1227 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1228 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1229 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1230 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1231 'use_canvas_skia%': '<(use_canvas_skia)',
1232 'test_isolation_mode%': '<(test_isolation_mode)',
1233 'enable_basic_printing%': '<(enable_basic_printing)',
1234 'enable_print_preview%': '<(enable_print_preview)',
1235 'enable_spellcheck%': '<(enable_spellcheck)',
1236 'use_browser_spellchecker%': '<(use_browser_spellchecker)',
1237 'use_minikin_hyphenation%': '<(use_minikin_hyphenation)',
1238 'cld2_table_size%': '<(cld2_table_size)',
1239 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1240 'disable_file_support%': '<(disable_file_support)',
1241 'disable_ftp_support%': '<(disable_ftp_support)',
1242 'use_platform_icu_alternatives%': '<(use_platform_icu_alternatives)',
1243 'disable_brotli_filter%': '<(disable_brotli_filter)',
1244 'enable_task_manager%': '<(enable_task_manager)',
1245 'wix_path%': '<(wix_path)',
1246 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1247 'use_system_libjpeg%': '<(use_system_libjpeg)',
1248 'android_channel%': '<(android_channel)',
1249 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1250 'gyp_managed_install%': 0,
1251 'create_standalone_apk%': 1,
1252 'enable_app_list%': '<(enable_app_list)',
1253 'use_default_render_theme%': '<(use_default_render_theme)',
1254 'google_api_key%': '<(google_api_key)',
1255 'google_default_client_id%': '<(google_default_client_id)',
1256 'google_default_client_secret%': '<(google_default_client_secret)',
1257 'enable_supervised_users%': '<(enable_supervised_users)',
1258 'enable_mdns%' : '<(enable_mdns)',
1259 'enable_service_discovery%' : '<(enable_service_discovery)',
1260 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension) ',
1261 'proprietary_codecs%': '<(proprietary_codecs)',
1262 'use_goma%': '<(use_goma)',
1263 'gomadir%': '<(gomadir)',
1264 'use_lto%': '<(use_lto)',
1265 'use_lto_o2%': '<(use_lto_o2)',
1266 'gold_icf_level%': '<(gold_icf_level)',
1267 'video_hole%': '<(video_hole)',
1268 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1269 'cfi_vptr%': '<(cfi_vptr)',
1270 'cfi_cast%': '<(cfi_cast)',
1271 'cfi_diag%': '<(cfi_diag)',
1272 'cfi_blacklist%': '<(cfi_blacklist)',
1273 'mac_views_browser%': '<(mac_views_browser)',
1274 'android_app_version_name%': '<(android_app_version_name)',
1275 'android_app_version_code%': '<(android_app_version_code)',
1276 'use_webview_internal_framework%': '<(use_webview_internal_framework)',
1277 'enable_webvr%': '<(enable_webvr)',
1278
1279 # Turns on compiler optimizations in V8 in Debug build.
1280 'v8_optimized_debug%': 1,
1281
1282 # Use system protobuf instead of bundled one.
1283 'use_system_protobuf%': 0,
1284
1285 # Use system yasm instead of bundled one.
1286 'use_system_yasm%': 0,
1287
1288 # Use system ICU instead of bundled one.
1289 'use_system_icu%' : 0,
1290
1291 # Default to enabled PIE; this is important for ASLR but we may need to be
1292 # able to turn it off for various reasons.
1293 'linux_disable_pie%': 0,
1294
1295 # The release channel that this build targets. This is used to restrict
1296 # channel-specific build options, like which installer packages to create.
1297 # The default is 'all', which does no channel-specific filtering.
1298 'channel%': 'all',
1299
1300 # Override chromium_mac_pch and set it to 0 to suppress the use of
1301 # precompiled headers on the Mac. Prefix header injection may still be
1302 # used, but prefix headers will not be precompiled. This is useful when
1303 # using distcc to distribute a build to compile slaves that don't
1304 # share the same compiler executable as the system driving the compilation,
1305 # because precompiled headers rely on pointers into a specific compiler
1306 # executable's image. Setting this to 0 is needed to use an experimental
1307 # Linux-Mac cross compiler distcc farm.
1308 'chromium_mac_pch%': 1,
1309
1310 # The default value for mac_strip in target_defaults. This cannot be
1311 # set there, per the comment about variable% in a target_defaults.
1312 'mac_strip_release%': 0,
1313
1314 # Set to 1 to enable java code coverage. Instruments classes during build
1315 # to produce .ec files during runtime.
1316 'emma_coverage%': 0,
1317
1318 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1319 # separated with whitespace and/or comma. Only has effect if
1320 # 'emma_coverage=1'.
1321 'emma_filter%': '',
1322
1323 # Set to 1 to enable running Android lint on java/class files.
1324 'android_lint%': 1,
1325
1326 # Although base/allocator lets you select a heap library via an
1327 # environment variable, the shim it uses sometimes gets in the way.
1328 # To disable it entirely, and switch to normal msvcrt, do e.g.
1329 # 'win_use_allocator_shim': 0,
1330 # 'win_release_RuntimeLibrary': 2
1331 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1332 'win_use_allocator_shim%': 1, # 1 = shim allocator; 0 = msvcrt
1333
1334 # Enables the unified allocator shim (experimental) which routes all the
1335 # alloc calls to base/. Right now is supported on Linux Desktop only.
1336 # http://crbug.com/550886 .
1337 'use_experimental_allocator_shim%': 0,
1338
1339 # TODO(bradnelson): eliminate this when possible.
1340 # To allow local gyp files to prevent release.vsprops from being included.
1341 # Yes(1) means include release.vsprops.
1342 # Once all vsprops settings are migrated into gyp, this can go away.
1343 'msvs_use_common_release%': 1,
1344
1345 # TODO(bradnelson): eliminate this when possible.
1346 # To allow local gyp files to override additional linker options for msvs.
1347 # Yes(1) means set use the common linker options.
1348 'msvs_use_common_linker_extras%': 1,
1349
1350 # TODO(sgk): eliminate this if possible.
1351 # It would be nicer to support this via a setting in 'target_defaults'
1352 # in chrome/app/locales/locales.gypi overriding the setting in the
1353 # 'Debug' configuration in the 'target_defaults' dict below,
1354 # but that doesn't work as we'd like.
1355 'msvs_debug_link_incremental%': '2',
1356
1357 # Needed for some of the largest modules.
1358 'msvs_debug_link_nonincremental%': '1',
1359
1360 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1361 # to get incremental linking to be faster in debug builds.
1362 'incremental_chrome_dll%': '0',
1363
1364 # Experimental setting to break chrome.dll into multiple pieces based on
1365 # process type.
1366 'chrome_multiple_dll%': '0',
1367
1368 # Whether the VS xtree header has been patched to disable warning 4702. If
1369 # it has, then we don't need to disable 4702 (unreachable code warning).
1370 # The patch is preapplied to the internal toolchain and hence all bots.
1371 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1372
1373 # Clang stuff.
1374 'clang%': '<(clang)',
1375 'host_clang%': '<(host_clang)',
1376 'make_clang_dir%': '<(make_clang_dir)',
1377 'use_lld%': '<(use_lld)',
1378
1379 # Control which version of clang to use when building for iOS. If set to
1380 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1381 # the version of clang that ships with the Chromium source. This variable
1382 # is automatically set to '1' in Official builds.
1383 'clang_xcode%': 0,
1384
1385 # These two variables can be set in GYP_DEFINES while running
1386 # |gclient runhooks| to let clang run a plugin in every compilation.
1387 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1388 # Example:
1389 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dyl ib clang_add_plugin=print-fns' gclient runhooks
1390
1391 'clang_load%': '',
1392 'clang_add_plugin%': '',
1393
1394 # Tell ld64 to write map files describing binary layout. Useful
1395 # for looking at what contributes to binary size, e.g. with
1396 # https://github.com/nico/bloat
1397 'mac_write_linker_maps%': 0,
1398
1399 # The default type of gtest.
1400 'gtest_target_type%': 'executable',
1401
1402 # Enable sampling based profiler.
1403 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1404 'profiling%': '0',
1405 # Profile without optimizing out stack frames when profiling==1.
1406 'profiling_full_stack_frames%': '0',
1407
1408 # And if we want to dump symbols for Breakpad-enabled builds.
1409 'linux_dump_symbols%': 0,
1410 # And if we want to strip the binary after dumping symbols.
1411 'linux_strip_binary%': 0,
1412 # If we want stack unwind support for backtrace().
1413 'debug_unwind_tables%': 1,
1414 'release_unwind_tables%': 1,
1415
1416 # Override where to find binutils
1417 'binutils_version%': 0,
1418 'binutils_dir%': '',
1419
1420 # Enable TCMalloc.
1421 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1422 'use_allocator%': 'tcmalloc',
1423
1424 # Set to 1 to link against gsettings APIs instead of using dlopen().
1425 'linux_link_gsettings%': 0,
1426
1427 # Enable use of OpenMAX DL FFT routines.
1428 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1429
1430 # Enable new NPDevice API.
1431 'enable_new_npdevice_api%': 0,
1432
1433 # .gyp files or targets should set chromium_code to 1 if they build
1434 # Chromium-specific code, as opposed to external code. This variable is
1435 # used to control such things as the set of warnings to enable, and
1436 # whether warnings are treated as errors.
1437 'chromium_code%': 0,
1438
1439 # Disable fatal linker warnings, similarly to how we make it possible
1440 # to disable -Werror (e.g. for different toolchain versions).
1441 'disable_fatal_linker_warnings%': 0,
1442
1443 'release_valgrind_build%': 0,
1444
1445 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1446 'enable_wexit_time_destructors%': 0,
1447
1448 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1449 'internal_gles2_conform_tests%': 0,
1450
1451 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1452 'internal_khronos_glcts_tests%': 0,
1453
1454 # Set to 1 to compile the filter fuzzer.
1455 'internal_filter_fuzzer%': 0,
1456
1457 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1458 # so Cocoa is happy (http://crbug.com/20441).
1459 'locales': [
1460 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1461 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1462 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1463 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1464 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1465 'vi', 'zh-CN', 'zh-TW',
1466 ],
1467
1468 # Pseudo locales are special locales which are used for testing and
1469 # debugging. They don't get copied to the final app. For more info,
1470 # check out https://www.chromium.org/developers/testing/fake-bidi
1471 'pseudo_locales': [
1472 'fake-bidi',
1473 ],
1474
1475 'grit_defines': [],
1476
1477 # If debug_devtools is set to 1, JavaScript files for DevTools are
1478 # stored as is and loaded from disk. Otherwise, a concatenated file
1479 # is stored in resources.pak. It is still possible to load JS files
1480 # from disk by passing --debug-devtools cmdline switch.
1481 'debug_devtools%': 0,
1482
1483 # The Java Bridge is not compiled in by default.
1484 'java_bridge%': 0,
1485
1486 # Code signing for iOS binaries. The bots need to be able to disable this.
1487 'chromium_ios_signing%': 1,
1488
1489 # Identity to use for code signing of iOS binaries. Change this on machines
1490 # with multiple identities in their security keychain.
1491 'chromium_ios_signing_identity%': 'iPhone Developer',
1492
1493 # This flag is only used when disable_nacl==0 and disables all those
1494 # subcomponents which would require the installation of a native_client
1495 # untrusted toolchain.
1496 'disable_nacl_untrusted%': 0,
1497
1498 # PNaCl toolchain does not support sanitizers. Disable by default.
1499 'enable_nacl_nonsfi_test%': 0,
1500
1501 # Disable Dart by default.
1502 'enable_dart%': 0,
1503
1504 # Copy out the setting of disable_nacl.
1505 'disable_nacl%': '<(disable_nacl)',
1506
1507 # Native Client toolchains, enabled by default.
1508 'disable_pnacl%': '<(disable_pnacl)',
1509 'disable_newlib%': '<(disable_newlib)',
1510
1511 # Whether to build full debug version for Debug configuration on Android.
1512 # Compared to full debug version, the default Debug configuration on Android
1513 # has no full v8 debug, has size optimization and linker gc section, so that
1514 # we can build a debug version with acceptable size and performance.
1515 'android_full_debug%': 0,
1516
1517 # Contains data about the attached devices for gyp_managed_install.
1518 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1519
1520 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1521
1522 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/10',
1523 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1524
1525 # Whether we are using the rlz library or not. Platforms like Android send
1526 # rlz codes for searches but do not use the library.
1527 'enable_rlz_support%': 0,
1528 'enable_rlz%': 0,
1529
1530 # Turns on the i18n support in V8.
1531 'v8_enable_i18n_support': 1,
1532
1533 # Compile the v8 shell for the host toolset.
1534 'v8_toolset_for_shell': 'host',
1535
1536 # V8 extras
1537 # Adding V8 extras files requires API owners review
1538 # Be sure to synchronize with build/module_args/v8.gni
1539
1540 'v8_extra_library_files': [
1541 '../third_party/WebKit/Source/core/streams/ByteLengthQueuingStrategy.js',
1542 '../third_party/WebKit/Source/core/streams/CountQueuingStrategy.js',
1543 '../third_party/WebKit/Source/core/streams/ReadableStream.js',
1544 ],
1545 'v8_experimental_extra_library_files': [
1546 ],
1547
1548 # Use brlapi from brltty for braille display support.
1549 'use_brlapi%': 0,
1550
1551 # Relative path to icu.gyp from this file.
1552 'icu_gyp_path': '../third_party/icu/icu.gyp',
1553
1554 # IPC fuzzer is disabled by default.
1555 'enable_ipc_fuzzer%': 0,
1556
1557 # Force disable libstdc++ debug mode.
1558 'disable_glibcxx_debug%': 0,
1559
1560 # Support ChromeOS touchpad gestures with ozone.
1561 'use_evdev_gestures%': 0,
1562
1563 # Default ozone platform (if no --ozone-platform flag).
1564 'ozone_platform%': "",
1565
1566 # Ozone platforms to include in the build.
1567 'ozone_platform_caca%': 0,
1568 'ozone_platform_cast%': 0,
1569 'ozone_platform_gbm%': 0,
1570 'ozone_platform_headless%': 0,
1571 'ozone_platform_wayland%': 0,
1572
1573 # Experiment: http://crbug.com/426914
1574 'envoy%': 0,
1575
1576 # Used to set libjpeg_gyp_path. Chrome OS ui/gfx/gfx.gyp uses the IJG path
1577 # for robust login screen decoding.
1578 'libjpeg_ijg_gyp_path': '<(DEPTH)/third_party/libjpeg/libjpeg.gyp',
1579 'libjpeg_turbo_gyp_path': '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp',
1580
1581 'conditions': [
1582 # Enable the Syzygy optimization step for the official builds.
1583 ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
1584 'syzygy_optimize%': 1,
1585 }, {
1586 'syzygy_optimize%': 0,
1587 }],
1588 ['sanitizer_coverage==1', {
1589 'sanitizer_coverage': 'edge,indirect-calls,8bit-counters',
1590 }],
1591 # Get binutils version so we can enable debug fission if we can.
1592 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1593 'conditions': [
1594 # compiler_version doesn't work with clang
1595 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1596 # compiler_version works with clang.
1597 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1598 # that it takes effect here.
1599 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan== 0 and ubsan_security==0 and ubsan_vptr==0', {
1600 'binutils_version%': '<!pymod_do_main(compiler_version target assemb ler)',
1601 }],
1602 # On Android we know the binutils version in the toolchain.
1603 ['OS=="android"', {
1604 'binutils_version%': 222,
1605 }],
1606 ['host_arch=="x64"', {
1607 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1608 }],
1609 ['host_arch=="ia32"', {
1610 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1611 }],
1612 # Our version of binutils in third_party/binutils
1613 ['linux_use_bundled_binutils==1', {
1614 'binutils_version%': 224,
1615 }],
1616 ],
1617 }, {
1618 'binutils_version%': 0,
1619 }],
1620 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"= ="True"', {
1621 'directx_sdk_path%': '<(directx_sdk_default_path)',
1622 }, {
1623 'directx_sdk_path%': '$(DXSDK_DIR)',
1624 }],
1625 ['OS=="win"', {
1626 'windows_driver_kit_path%': '$(WDK_DIR)',
1627 'conditions': [
1628 ['component!="shared_library"', {
1629 'single_module_mode_handle_verifier%': 0,
1630 }, {
1631 'single_module_mode_handle_verifier%': 1,
1632 }],
1633 ],
1634 }],
1635 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1636 'conditions': [
1637 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1638 'werror%': '',
1639 'disable_nacl%': 1,
1640 'nacl_untrusted_build%': 0,
1641 'use_allocator%': 'none',
1642 }],
1643 # Use a 64-bit linker to avoid running out of address space. The
1644 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1645 ['host_arch=="ia32" and target_arch=="ia32"', {
1646 # TODO(thestig) This is a horrible way to force the desired
1647 # configuration. Our gyp variable scoping is likely wrong and
1648 # needs to be cleaned up. The GN configuration should be changed
1649 # to match.
1650 'binutils_version%': 224,
1651 'linux_use_bundled_binutils%': '1',
1652 'linux_use_bundled_gold%': '1',
1653 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1654 }],
1655 # All Chrome builds have breakpad symbols, but only process the
1656 # symbols from official builds.
1657 ['(branding=="Chrome" and buildtype=="Official")', {
1658 'linux_dump_symbols%': 1,
1659
1660 # Omit unwind support in official release builds to save space. We
1661 # can use breakpad for these builds.
1662 'release_unwind_tables%': 0,
1663 }],
1664 ],
1665 }], # os_posix==1 and OS!="mac" and OS!="ios"
1666 ['OS=="ios"', {
1667 'disable_nacl%': 1,
1668 'icu_use_data_file_flag%': 1,
1669 'enable_web_speech%': 0,
1670 'use_system_libxml%': 1,
1671 'use_system_sqlite%': 1,
1672 'locales==': [
1673 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1674 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1675 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1676 'uk', 'vi', 'zh-CN', 'zh-TW',
1677 ],
1678
1679 # iOS SDK and deployment target support. The |ios_sdk| value is left
1680 # blank so that when it is set in the project files it will be the
1681 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1682 # causes Xcode to spit out a warning for every single project file for
1683 # not using the "current" SDK.
1684 'ios_sdk%': '',
1685 'ios_sdk_path%': '',
1686 'ios_deployment_target%': '9.0',
1687
1688 'conditions': [
1689 # ios_product_name is set to the name of the .app bundle as it should
1690 # appear on disk.
1691 ['branding=="Chrome"', {
1692 'ios_product_name%': 'Chrome',
1693 }, { # else: branding!="Chrome"
1694 'ios_product_name%': 'Chromium',
1695 }],
1696 ['branding=="Chrome" and buildtype=="Official"', {
1697 'ios_breakpad%': 1,
1698 }, { # else: branding!="Chrome" or buildtype!="Official"
1699 'ios_breakpad%': 0,
1700 }],
1701 ],
1702 }], # OS=="ios"
1703 ['OS=="android"', {
1704 # Location of Android NDK.
1705 'variables': {
1706 'variables': {
1707 # Standard libraries can use the relative path to the NDK.
1708 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1709 # Unfortunately, it is required to use the absolute path to the SDK
1710 # because it us passed to ant which uses a different relative path
1711 # from GYP.
1712 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_ tools/sdk/',
1713 # Similarly, gdbserver and the Android toolchain need to use the
1714 # absolute path to the NDK because they are used at different levels
1715 # in the GYP files.
1716 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party /android_tools/ndk/',
1717 'android_host_arch%': '<!(uname -m)',
1718 # Version of the NDK. Used to ensure full rebuilds on NDK rolls.
1719 'android_ndk_version%': 'r10e',
1720 # Android API-level of the SDK used for compilation.
1721 'android_sdk_version%': '23',
1722 'android_sdk_build_tools_version%': '23.0.1',
1723 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1724
1725 'conditions': [
1726 # Figure this out early since it needs symbols from libgcc.a, so i t
1727 # has to be before that in the set of libraries.
1728 # ASan needs to dynamically link to libc++ even in static builds s o
1729 # that it can interpose operator new.
1730 ['component=="shared_library" or asan==1', {
1731 'android_libcpp_library': 'c++_shared',
1732 'android_must_copy_system_libraries': 1,
1733 }, {
1734 'android_libcpp_library': 'c++_static',
1735 'android_must_copy_system_libraries': 0,
1736 }],
1737 ],
1738
1739 },
1740 # Copy conditionally-set variables out one scope.
1741 'android_ndk_root%': '<(android_ndk_root)',
1742 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1743 'android_ndk_version%': '<(android_ndk_version)',
1744 'android_sdk_root%': '<(android_sdk_root)',
1745 'android_sdk_version%': '<(android_sdk_version)',
1746 'android_sdk_build_tools_version%': '<(android_sdk_build_tools_version )',
1747 'android_libcpp_root': '<(android_ndk_root)/sources/cxx-stl/llvm-libc+ +',
1748 'android_libcpp_library': '<(android_libcpp_library)',
1749 'android_must_copy_system_libraries': '<(android_must_copy_system_libr aries)',
1750 'host_os%': '<(host_os)',
1751
1752 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_v ersion)',
1753 # Android SDK build tools (e.g. dx, aidl)
1754 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_b uild_tools_version)',
1755
1756 # Android API level 16 is JB (Android 4.1) which is the minimum
1757 # platform requirement for Chrome on Android, we use it for native
1758 # code compilation.
1759 'conditions': [
1760 ['target_arch == "ia32"', {
1761 'android_app_abi%': 'x86',
1762 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/andro id-x86/gdbserver/gdbserver',
1763 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/ arch-x86',
1764 'android_ndk_lib_dir%': 'usr/lib',
1765 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86 -4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1766 }],
1767 ['target_arch == "x64"', {
1768 'android_app_abi%': 'x86_64',
1769 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/andro id-x86_64/gdbserver/gdbserver',
1770 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/ arch-x86_64',
1771 'android_ndk_lib_dir%': 'usr/lib64',
1772 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86 _64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1773 }],
1774 ['target_arch=="arm"', {
1775 'conditions': [
1776 ['arm_version<7', {
1777 'android_app_abi%': 'armeabi',
1778 }, {
1779 'android_app_abi%': 'armeabi-v7a',
1780 }],
1781 ],
1782 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/andro id-arm/gdbserver/gdbserver',
1783 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/ arch-arm',
1784 'android_ndk_lib_dir%': 'usr/lib',
1785 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm -linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1786 }],
1787 ['target_arch == "arm64"', {
1788 'android_app_abi%': 'arm64-v8a',
1789 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/andro id-arm64/gdbserver/gdbserver',
1790 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/ arch-arm64',
1791 'android_ndk_lib_dir%': 'usr/lib',
1792 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aar ch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1793 }],
1794 ['target_arch == "mipsel"', {
1795 'android_app_abi%': 'mips',
1796 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/andro id-mips/gdbserver/gdbserver',
1797 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/ arch-mips',
1798 'android_ndk_lib_dir%': 'usr/lib',
1799 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mip sel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1800 }],
1801 ['target_arch == "mips64el"', {
1802 'android_app_abi%': 'mips64',
1803 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/andro id-mips64/gdbserver/gdbserver',
1804 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/ arch-mips64',
1805 'android_ndk_lib_dir%': 'usr/lib64',
1806 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mip s64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1807 }],
1808 ],
1809 },
1810 # Copy conditionally-set variables out one scope.
1811 'android_app_abi%': '<(android_app_abi)',
1812 'android_gdbserver%': '<(android_gdbserver)',
1813 'android_ndk_root%': '<(android_ndk_root)',
1814 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1815 'android_ndk_version%': '<(android_ndk_version)',
1816 'android_sdk_root%': '<(android_sdk_root)',
1817 'android_sdk_version%': '<(android_sdk_version)',
1818 'android_toolchain%': '<(android_toolchain)',
1819
1820 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1821 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1822 'android_sdk_build_tools_version%': '<(android_sdk_build_tools_version)' ,
1823 'android_sdk_tools%': '<(android_sdk_tools)',
1824 'android_aapt_path%': '<(android_sdk_tools)/aapt',
1825 'android_sdk%': '<(android_sdk)',
1826 'android_sdk_jar%': '<(android_sdk)/android.jar',
1827
1828 'android_libcpp_root': '<(android_libcpp_root)',
1829 'android_libcpp_library': '<(android_libcpp_library)',
1830 'android_libcpp_include': '<(android_libcpp_root)/libcxx/include',
1831 'android_libcpp_libs_dir%': '<(android_libcpp_root)/libs/<(android_app_a bi)',
1832 'android_must_copy_system_libraries': '<(android_must_copy_system_librar ies)',
1833 'host_os%': '<(host_os)',
1834
1835 # Location of the "objcopy" binary, used by both gyp and scripts.
1836 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1837
1838 # Location of the "strip" binary, used by both gyp and scripts.
1839 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1840
1841 # Location of the "readelf" binary.
1842 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1843
1844 # Determines whether we should optimize JNI generation at the cost of
1845 # breaking assumptions in the build system that when inputs have changed
1846 # the outputs should always change as well. This is meant purely for
1847 # developer builds, to avoid spurious re-linking of native files.
1848 'optimize_jni_generation%': '<(optimize_jni_generation)',
1849
1850 # Use OpenSSL's struct X509 to represent certificates.
1851 'use_openssl_certs%': 1,
1852
1853 'proprietary_codecs%': '<(proprietary_codecs)',
1854
1855 'safe_browsing%': 2,
1856
1857 'enable_web_speech%': 0,
1858 'java_bridge%': 1,
1859 'use_allocator%': 'none',
1860
1861 # Disable Native Client.
1862 'disable_nacl%': 1,
1863
1864 # Sessions are store separately in the Java side.
1865 'enable_session_service%': 0,
1866
1867 'p2p_apis%' : 0,
1868
1869 'gtest_target_type%': 'shared_library',
1870 }], # OS=="android"
1871 ['embedded==1', {
1872 'use_system_fontconfig%': 0,
1873 }, {
1874 'use_system_fontconfig%': 1,
1875 }],
1876 ['chromecast==1', {
1877 'conditions': [
1878 ['target_arch=="arm"', {
1879 'arm_arch%': '',
1880 'arm_tune%': 'cortex-a9',
1881 'arm_thumb%': 1,
1882 }],
1883 # TODO(dalecurtis): What audio codecs does Chromecast want here? Sort
1884 # out and add configs if necessary. http://crbug.com/570754
1885 ['OS!="android"', {
1886 'ffmpeg_branding%': 'ChromeOS',
1887 }],
1888 ],
1889 }],
1890 ['OS=="linux"', {
1891 'clang%': 1,
1892 'conditions': [
1893 ['target_arch=="arm64"', {
1894 # Temporarily disable nacl and tcmalloc on arm64 linux to get
1895 # rid of compilation errors.
1896 'disable_nacl%': 1,
1897 'use_allocator%': 'none',
1898 }],
1899 ],
1900 }], # OS=="mac"
1901 ['OS=="mac"', {
1902 'conditions': [
1903 # All Chrome builds have breakpad symbols, but only process the
1904 # symbols from official builds.
1905 ['(branding=="Chrome" and buildtype=="Official")', {
1906 'mac_strip_release%': 1,
1907 }],
1908 ],
1909 }], # OS=="mac"
1910 ['OS=="mac" or OS=="ios"', {
1911 'clang%': 1,
1912
1913 # On Mac and iOS we just use the default system allocator.
1914 'use_allocator%': 'none',
1915
1916 'variables': {
1917 # Mac OS X SDK and deployment target support. The SDK identifies
1918 # the version of the system headers that will be used, and
1919 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1920 # macro. "Maximum allowed" refers to the operating system version
1921 # whose APIs are available in the headers. The deployment target
1922 # identifies the minimum system version that the built products are
1923 # expected to function on. It corresponds to the
1924 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1925 # macros are available, #include <AvailabilityMacros.h>. Additional
1926 # documentation on these macros is available at
1927 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html# SECTION3
1928 # Chrome normally builds with the Mac OS X 10.10 SDK and sets the
1929 # deployment target to 10.7. Other projects, such as O3D, may
1930 # override these defaults.
1931
1932 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1933 # about that is at least the specified version. In official builds,
1934 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1935 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1936 # path to the SDK; when set to a non-empty string, SDK detection
1937 # based on mac_sdk_min will be bypassed entirely.
1938 'mac_deployment_target%': '10.7',
1939 'mac_sdk_min%': '10.10',
1940 'mac_sdk_path%': '',
1941 },
1942
1943 'mac_sdk_min': '<(mac_sdk_min)',
1944 'mac_sdk_path': '<(mac_sdk_path)',
1945 'mac_deployment_target': '<(mac_deployment_target)',
1946
1947 # Compile in Breakpad support by default so that it can be
1948 # tested, even if it is not enabled by default at runtime.
1949 'mac_breakpad_compiled_in%': 1,
1950 'conditions': [
1951 # mac_product_name is set to the name of the .app bundle as it should
1952 # appear on disk. This duplicates data from
1953 # chrome/app/theme/chromium/BRANDING and
1954 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1955 # these names into the build system.
1956 ['branding=="Chrome"', {
1957 'mac_product_name%': 'Google Chrome',
1958 }, { # else: branding!="Chrome"
1959 'mac_product_name%': 'Chromium',
1960 }],
1961 # Official mac builds require a specific OS X SDK, but iOS and
1962 # non-official mac builds do not.
1963 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1964 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac _sdk_min) --sdk_path=<(mac_sdk_path))',
1965 }, {
1966 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min) )',
1967 }],
1968 ['branding=="Chrome" and buildtype=="Official"', {
1969 # Enable uploading crash dumps.
1970 'mac_breakpad_uploads%': 1,
1971 # Enable dumping symbols at build time for use by Mac Breakpad.
1972 'mac_breakpad%': 1,
1973 # Enable Keystone auto-update support.
1974 'mac_keystone%': 1,
1975 }, { # else: branding!="Chrome" or buildtype!="Official"
1976 'mac_breakpad_uploads%': 0,
1977 'mac_breakpad%': 0,
1978 'mac_keystone%': 0,
1979 }],
1980 ],
1981 }], # OS=="mac" or OS=="ios"
1982 ['OS=="win"', {
1983 'conditions': [
1984 # This is the architecture convention used in WinSDK paths.
1985 ['target_arch=="ia32"', {
1986 'winsdk_arch%': 'x86',
1987 },{
1988 'winsdk_arch%': '<(target_arch)',
1989 }],
1990 ['component=="shared_library"', {
1991 'win_use_allocator_shim%': 0,
1992 }],
1993 ['component=="static_library"', {
1994 # Turn on multiple dll by default on Windows when in static_library.
1995 'chrome_multiple_dll%': 1,
1996 }],
1997 ['asan==1 or syzyasan==1', {
1998 'win_use_allocator_shim%': 0,
1999 }],
2000 # The AddressSanitizer build should be a console program as it prints
2001 # out stuff on stderr.
2002 ['asan==1', {
2003 'win_console_app%': 1,
2004 }, {
2005 'win_console_app%': 0,
2006 }],
2007 # Enable the Kasko reporter for syzyasan builds.
2008 ['syzyasan==1', {
2009 'kasko': 1,
2010 }],
2011 ['component=="shared_library"', {
2012 # Not enabled for component=static_library because some targets
2013 # are too large and the toolchain fails due to the size of the
2014 # .obj files.
2015 'incremental_chrome_dll%': 1,
2016 }],
2017 # Don't do incremental linking for large modules on 32-bit or when
2018 # component=static_library as the toolchain fails due to the size of
2019 # the .ilk files.
2020 ['MSVS_OS_BITS==32 or component=="static_library"', {
2021 'msvs_large_module_debug_link_mode%': '1', # No
2022 },{
2023 'msvs_large_module_debug_link_mode%': '2', # Yes
2024 }],
2025 ['chrome_pgo_phase!=0', {
2026 'full_wpo_on_official%': 1,
2027 }],
2028 ],
2029 'nacl_win64_defines': [
2030 # This flag is used to minimize dependencies when building
2031 # Native Client loader for 64-bit Windows.
2032 'NACL_WIN64',
2033 ],
2034 # Need to include allocator target, but exclude tcmalloc files.
2035 'use_allocator%': 'winheap',
2036 }],
2037
2038 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded ==0', {
2039 'use_cups%': 1,
2040 }, {
2041 'use_cups%': 0,
2042 }],
2043
2044 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win") and chrome cast==0', {
2045 'enable_pepper_cdms%': 1,
2046 }, {
2047 'enable_pepper_cdms%': 0,
2048 }],
2049
2050 ['OS=="android" or chromecast==1', {
2051 'enable_browser_cdms%': 1,
2052 }, {
2053 'enable_browser_cdms%': 0,
2054 }],
2055
2056 # Native Client glibc toolchain is enabled except on mips
2057 ['target_arch=="mipsel" or target_arch=="mips64el"', {
2058 'disable_glibc%': 1,
2059 }, {
2060 'disable_glibc%': 0,
2061 }],
2062
2063 # Set the relative path from this file to the GYP file of the JPEG
2064 # library used by Chromium.
2065 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2066 # Configuration for using the system libjeg is here.
2067 'libjpeg_gyp_path': '<(libjpeg_ijg_gyp_path)',
2068 }, {
2069 'libjpeg_gyp_path': '<(libjpeg_turbo_gyp_path)',
2070 }],
2071
2072 # Options controlling the use of GConf (the classic GNOME configuration
2073 # system) and GIO, which contains GSettings (the new GNOME config system).
2074 ['chromeos==1 or embedded==1', {
2075 'use_gconf%': 0,
2076 'use_gio%': 0,
2077 }, {
2078 'use_gconf%': 1,
2079 'use_gio%': 1,
2080 }],
2081
2082 # Set up -D and -E flags passed into grit.
2083 ['branding=="Chrome"', {
2084 # TODO(mmoss) The .grd files look for _google_chrome, but for
2085 # consistency they should look for google_chrome_build like C++.
2086 'grit_defines': ['-D', '_google_chrome',
2087 '-E', 'CHROMIUM_BUILD=google_chrome'],
2088 }, {
2089 'grit_defines': ['-D', '_chromium',
2090 '-E', 'CHROMIUM_BUILD=chromium'],
2091 }],
2092 ['chromeos==1', {
2093 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2094 }],
2095 ['desktop_linux==1', {
2096 'grit_defines': ['-D', 'desktop_linux'],
2097 }],
2098 ['toolkit_views==1', {
2099 'grit_defines': ['-D', 'toolkit_views'],
2100 }],
2101 ['use_aura==1', {
2102 'grit_defines': ['-D', 'use_aura'],
2103 }],
2104 ['use_ash==1', {
2105 'grit_defines': ['-D', 'use_ash'],
2106 }],
2107 ['use_nss_certs==1', {
2108 'grit_defines': ['-D', 'use_nss_certs'],
2109 }],
2110 ['use_ozone==1', {
2111 'grit_defines': ['-D', 'use_ozone'],
2112 }],
2113 ['image_loader_extension==1', {
2114 'grit_defines': ['-D', 'image_loader_extension'],
2115 }],
2116 ['use_titlecase_in_grd==1', {
2117 'grit_defines': ['-D', 'use_titlecase'],
2118 }],
2119 ['OS=="android"', {
2120 'grit_defines': [
2121 '-t', 'android',
2122 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2123 '--no-output-all-resource-defines',
2124 ],
2125 }],
2126 ['OS=="mac" or OS=="ios"', {
2127 'grit_defines': ['-D', 'scale_factors=2x'],
2128 }],
2129 ['OS == "ios"', {
2130 'variables': {
2131 'enable_coverage%': 0,
2132 },
2133 'grit_defines': [
2134 '-t', 'ios',
2135 '--no-output-all-resource-defines',
2136 ],
2137
2138 # Enable host builds.
2139 'host_os%': "mac",
2140
2141 'conditions': [
2142 # Use the version of clang shipped with Xcode when building official
2143 # version of Chrome for iOS.
2144 #
2145 # TODO(eugenebut): Remove enable_coverage check once
2146 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2147 # http://crbug.com/450379
2148 ['buildtype=="Official" or enable_coverage', {
2149 'clang_xcode%': 1,
2150 }],
2151 ],
2152 }],
2153 ['enable_extensions==1', {
2154 'grit_defines': ['-D', 'enable_extensions'],
2155 }],
2156 ['enable_plugins!=0', {
2157 'grit_defines': ['-D', 'enable_plugins'],
2158 }],
2159 ['enable_basic_printing==1 or enable_print_preview==1', {
2160 'grit_defines': ['-D', 'enable_printing'],
2161 }],
2162 ['enable_print_preview==1', {
2163 'grit_defines': ['-D', 'enable_print_preview'],
2164 }],
2165 ['enable_themes==1', {
2166 'grit_defines': ['-D', 'enable_themes'],
2167 }],
2168 ['enable_app_list==1', {
2169 'grit_defines': ['-D', 'enable_app_list'],
2170 }],
2171 ['use_concatenated_impulse_responses==1', {
2172 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2173 }],
2174 ['enable_media_router==1', {
2175 'grit_defines': ['-D', 'enable_media_router'],
2176 }],
2177 ['enable_webrtc==1', {
2178 'grit_defines': ['-D', 'enable_webrtc'],
2179 }],
2180 ['enable_hangout_services_extension==1', {
2181 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2182 }],
2183 ['enable_task_manager==1', {
2184 'grit_defines': ['-D', 'enable_task_manager'],
2185 }],
2186 ['notifications==1', {
2187 'grit_defines': ['-D', 'enable_notifications'],
2188 }],
2189 ['mac_views_browser==1', {
2190 'grit_defines': ['-D', 'mac_views_browser'],
2191 }],
2192 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2193 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelist ed_resource_{numeric_id}") {numeric_id}'],
2194 }],
2195 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2196 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message(" whitelisted_resource_{numeric_id}")) {numeric_id}'],
2197 }],
2198 ['enable_mdns==1 or OS=="mac"', {
2199 'grit_defines': ['-D', 'enable_service_discovery'],
2200 'enable_service_discovery%': 1
2201 }],
2202 ['clang_use_chrome_plugins==1', {
2203 'variables': {
2204 'conditions': [
2205 ['OS!="win"', {
2206 'variables': {
2207 'conditions': [
2208 ['OS=="mac" or OS=="ios"', {
2209 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/ll vm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2210 }, { # OS != "mac" or OS != "ios"
2211 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/ll vm-build/Release+Asserts/lib/libFindBadConstructs.so',
2212 }],
2213 ],
2214 },
2215 'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ',
2216 }, { # OS == "win"
2217 # On Windows, the plugin is built directly into clang, so there's
2218 # no need to load it dynamically.
2219 'clang_dynlib_flags%': '',
2220 }],
2221 ['(OS=="android" or OS=="linux") and chromecast==0', {
2222 'clang_plugin_check_ipc_arg': '-Xclang -plugin-arg-find-bad-constr ucts -Xclang check-ipc',
2223 }, {
2224 'clang_plugin_check_ipc_arg': '',
2225 }],
2226 ],
2227 'clang_plugin_args%': '-Xclang -plugin-arg-find-bad-constructs -Xclang check-templates '
2228 '-Xclang -plugin-arg-find-bad-constructs -Xclang follow-macro-expansio n ',
2229 },
2230 # If you change these, also change build/config/clang/BUILD.gn.
2231 'clang_chrome_plugins_flags%':
2232 '<(clang_dynlib_flags)'
2233 '-Xclang -add-plugin -Xclang find-bad-constructs <(clang_plugin_args) <(clang_plugin_check_ipc_arg)',
2234 }],
2235 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2236 'clang%': 1,
2237 'use_allocator%': 'none',
2238 'use_sanitizer_options%': 1,
2239 }],
2240 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and lsan==0 and t san==0 and build_for_tool==""', {
2241 'use_experimental_allocator_shim%': 1,
2242 }],
2243 ['OS=="linux" and asan==0 and msan==0 and lsan==0 and tsan==0', {
2244 # PNaCl toolchain Non-SFI build only supports linux OS build.
2245 # Also, it does not support sanitizers.
2246 'enable_nacl_nonsfi_test%': 1,
2247 }],
2248 ['asan==1 and OS=="linux" and chromeos==0', {
2249 'use_custom_libcxx%': 1,
2250 }],
2251 ['ubsan==1', {
2252 'clang%': 1,
2253 }],
2254 ['ubsan_security==1', {
2255 'clang%': 1,
2256 }],
2257 ['ubsan_vptr==1', {
2258 'clang%': 1,
2259 }],
2260 ['asan==1 and OS=="mac"', {
2261 'mac_strip_release': 1,
2262 }],
2263 ['tsan==1', {
2264 'use_custom_libcxx%': 1,
2265 }],
2266 ['msan==1', {
2267 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2268 # libstdc++. This is required to avoid false positive reports whenever
2269 # the C++ standard library is used.
2270 'use_custom_libcxx%': 1,
2271 # Running the V8-generated code on an ARM simulator is a powerful hack
2272 # that allows the tool to see the memory accesses from JITted code.
2273 # Without this flag, JS code causes false positive reports from MSan.
2274 'v8_target_arch': 'arm64',
2275 }],
2276
2277 # Build tweaks for DrMemory.
2278 # TODO(rnk): Combine with tsan config to share the builder.
2279 # http://crbug.com/108155
2280 ['build_for_tool=="drmemory"', {
2281 # These runtime checks force initialization of stack vars which blocks
2282 # DrMemory's uninit detection.
2283 'win_debug_RuntimeChecks': '0',
2284 # Iterator debugging is slow.
2285 'win_debug_disable_iterator_debugging': '1',
2286 # Try to disable optimizations that mess up stacks in a release build.
2287 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2288 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2289 # compiler bug, so we use /Ob1 instead.
2290 'win_release_InlineFunctionExpansion': '1',
2291 'win_release_OmitFramePointers': '0',
2292 # Ditto for debug, to support bumping win_debug_Optimization.
2293 'win_debug_InlineFunctionExpansion': 0,
2294 'win_debug_OmitFramePointers': 0,
2295 # Keep the code under #ifndef NVALGRIND.
2296 'release_valgrind_build': 1,
2297 }],
2298
2299 # RLZ library is used on Win, Mac, iOS and ChromeOS.
2300 ['OS=="win" or OS=="mac" or OS=="ios" or chromeos==1', {
2301 'enable_rlz_support%': 1,
2302 'conditions': [
2303 # RLZ is enabled for "Chrome" builds.
2304 ['branding=="Chrome"', {
2305 'enable_rlz%': 1,
2306 }],
2307 ],
2308 }],
2309
2310 # Set default compiler flags depending on ARM version.
2311 ['arm_version==6', {
2312 'arm_arch%': 'armv6',
2313 'arm_tune%': '',
2314 'arm_fpu%': 'vfp',
2315 'arm_float_abi%': 'softfp',
2316 'arm_thumb%': 0,
2317 }],
2318 ['arm_version==7', {
2319 'arm_arch%': 'armv7-a',
2320 'arm_tune%': 'generic-armv7-a',
2321 'conditions': [
2322 ['arm_neon==1', {
2323 'arm_fpu%': 'neon',
2324 }, {
2325 'arm_fpu%': 'vfpv3-d16',
2326 }],
2327 ['OS=="android"', {
2328 'arm_float_abi%': 'softfp',
2329 }, {
2330 'arm_float_abi%': 'hard',
2331 }],
2332 ],
2333 'arm_thumb%': 1,
2334 }],
2335
2336 # Set default compiler flags for MIPS floating-point support.
2337 ['target_arch=="mipsel"', {
2338 'mips_float_abi%': 'hard',
2339 }],
2340 ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
2341 'mips_fpu_mode%': 'fp32',
2342 }, {
2343 'mips_fpu_mode%': '',
2344 }],
2345
2346 # Enable brlapi by default for chromeos.
2347 ['chromeos==1', {
2348 'use_brlapi%': 1,
2349 }],
2350
2351 ['use_ozone==1 and ozone_auto_platforms==1', {
2352 # Use headless as the default platform.
2353 'ozone_platform%': 'headless',
2354 'ozone_platform_headless%': 1,
2355 'conditions': [
2356 ['chromecast==1', {
2357 'ozone_platform_cast%': 1,
2358 'conditions': [
2359 # For desktop non-audio Chromecast builds, run with
2360 # --ozone-platform=x11
2361 # TODO(slan|halliwell): Make the default platform "cast" on
2362 # desktop non-audio builds too.
2363 ['is_cast_desktop_build==1 and disable_display==0', {
2364 # Use GN instead.
2365 }, {
2366 'ozone_platform%': 'cast',
2367 }],
2368 ],
2369 }, { # chromecast!=1
2370 # Build all platforms whose deps are in install-build-deps.sh.
2371 # Only these platforms will be compile tested by buildbots.
2372 'conditions': [
2373 ['chromeos==1', {
2374 'ozone_platform_gbm%': 1,
2375 }],
2376 ],
2377 }],
2378 ],
2379 }],
2380
2381 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2382 'use_clipboard_aurax11%': 1,
2383 }],
2384
2385 ['OS=="win" and use_goma==1', {
2386 # goma doesn't support pch yet.
2387 'chromium_win_pch': 0,
2388 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2389 'conditions': [
2390 ['win_z7==0 and fastbuild==0', {
2391 'fastbuild': 1,
2392 }],
2393 ],
2394 }],
2395
2396 ['host_clang==1', {
2397 'host_cc': '<(make_clang_dir)/bin/clang',
2398 'host_cxx': '<(make_clang_dir)/bin/clang++',
2399 }, {
2400 'host_cc': '<!(which gcc)',
2401 'host_cxx': '<!(which g++)',
2402 }],
2403
2404 # The seccomp-bpf sandbox is only supported on five architectures
2405 # currently.
2406 # Do not disable seccomp_bpf anywhere without talking to
2407 # security@chromium.org!
2408 ['((OS=="linux" or OS=="android") and '
2409 '(target_arch=="ia32" or target_arch=="x64" or '
2410 'target_arch=="arm" or target_arch=="mipsel" or '
2411 'target_arch=="arm64"))', {
2412 'use_seccomp_bpf%': 1,
2413 }, {
2414 'use_seccomp_bpf%': 0,
2415 }],
2416
2417 ['cfi_vptr==1', {
2418 'use_lto%': 1,
2419 }],
2420
2421 ['branding=="Chrome" and buildtype=="Official"', {
2422 'enable_hangout_services_extension%': 1,
2423 }, {
2424 'enable_hangout_services_extension%': 0,
2425 }],
2426 ],
2427
2428 # The path to the ANGLE library.
2429 'angle_path': '<(DEPTH)/third_party/angle',
2430
2431 # List of default apps to install in new profiles. The first list contains
2432 # the source files as found in svn. The second list, used only for linux,
2433 # contains the destination location for each of the files. When a crx
2434 # is added or removed from the list, the chrome/browser/resources/
2435 # default_apps/external_extensions.json file must also be updated.
2436 #
2437 # README: GN version of these is in the target //chrome:default_apps
2438 # (there's no global variable like in GYP). Be sure to update that target
2439 # if you change these lists!
2440 'default_apps_list': [
2441 'browser/resources/default_apps/external_extensions.json',
2442 'browser/resources/default_apps/gmail.crx',
2443 'browser/resources/default_apps/youtube.crx',
2444 'browser/resources/default_apps/drive.crx',
2445 'browser/resources/default_apps/docs.crx',
2446 ],
2447 'default_apps_list_linux_dest': [
2448 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2449 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2450 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2451 '<(PRODUCT_DIR)/default_apps/drive.crx',
2452 '<(PRODUCT_DIR)/default_apps/docs.crx',
2453 ],
2454
2455 # Whether to allow building of the GPU-related isolates.
2456 'archive_gpu_tests%': 0,
2457
2458 # Whether to allow building of chromoting related isolates.
2459 'archive_chromoting_tests%': 0,
2460
2461 # Whether to allow building of Media Router related isolates.
2462 'archive_media_router_tests%': 0,
2463 },
2464 'target_defaults': { 5 'target_defaults': {
2465 'variables': {
2466 # The condition that operates on chromium_code is in a target_conditions
2467 # section, and will not have access to the default fallback value of
2468 # chromium_code at the top of this file, or to the chromium_code
2469 # variable placed at the root variables scope of .gyp files, because
2470 # those variables are not set at target scope. As a workaround,
2471 # if chromium_code is not set at target scope, define it in target scope
2472 # to contain whatever value it has during early variable expansion.
2473 # That's enough to make it available during target conditional
2474 # processing.
2475 'chromium_code%': '<(chromium_code)',
2476
2477 'component%': '<(component)',
2478
2479 'chromecast%': '<(chromecast)',
2480
2481 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2482 'win_release_Optimization%': '2', # 2 = /O2
2483 'win_debug_Optimization%': '0', # 0 = /Od
2484
2485 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2486 # Tri-state: blank is default, 1 on, 0 off
2487 'win_release_OmitFramePointers%': '0',
2488 # Tri-state: blank is default, 1 on, 0 off
2489 'win_debug_OmitFramePointers%': '',
2490
2491 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2492 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2493
2494 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2495 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2496 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2497
2498 # VS inserts quite a lot of extra checks to algorithms like
2499 # std::partial_sort in Debug build which make them O(N^2)
2500 # instead of O(N*logN). This is particularly slow under memory
2501 # tools like ThreadSanitizer so we want it to be disablable.
2502 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2503 'win_debug_disable_iterator_debugging%': '0',
2504
2505 # An application manifest fragment to declare compatibility settings for
2506 # 'executable' targets. Ignored in other target type.
2507 'win_exe_compatibility_manifest%':
2508 '<(DEPTH)\\build\\win\\compatibility.manifest',
2509
2510 'release_extra_cflags%': '',
2511 'debug_extra_cflags%': '',
2512
2513 'release_valgrind_build%': '<(release_valgrind_build)',
2514
2515 # the non-qualified versions are widely assumed to be *nix-only
2516 'win_release_extra_cflags%': '',
2517 'win_debug_extra_cflags%': '',
2518
2519 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2520 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2521
2522 # Only used by Windows build for now. Can be used to build into a
2523 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2524 # output files in src/build/VS2010_{Debug,Release}.
2525 'build_dir_prefix%': '',
2526
2527 # Targets are by default not nacl untrusted code.
2528 'nacl_untrusted_build%': 0,
2529
2530 'pnacl_compile_flags': [
2531 # pnacl uses the clang compiler so we need to suppress all the
2532 # same warnings as we do for clang.
2533 # TODO(sbc): Remove these if/when they are removed from the clang
2534 # build.
2535 '-Wno-unused-function',
2536 '-Wno-char-subscripts',
2537 '-Wno-c++11-extensions',
2538 '-Wno-unnamed-type-template-args',
2539 ],
2540
2541 # By default, Android targets have their exported JNI symbols stripped,
2542 # so we test the manual JNI registration code paths that are required
2543 # when using the crazy linker. To allow use of native JNI exports (lazily
2544 # resolved by the JVM), targets can enable this variable, which will stop
2545 # the stripping from happening. Only targets which do not need to be
2546 # compatible with the crazy linker are permitted to set this.
2547 'use_native_jni_exports%': 0,
2548
2549 'conditions': [
2550 ['OS=="win" and component=="shared_library"', {
2551 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2552 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2553 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2554 }, {
2555 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2556 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2557 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2558 }],
2559 ['OS=="ios"', {
2560 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.htm l
2561 'mac_release_optimization%': 's', # Use -Os unless overridden
2562 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2563 }, {
2564 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.htm l
2565 'mac_release_optimization%': '2', # Use -O2 unless overridden
2566 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2567 }],
2568 ['OS=="android"', {
2569 'host_os%': '<(host_os)', # See comment above chromium_code.
2570 }],
2571 ],
2572 'clang_warning_flags': [
2573 '-Wheader-hygiene',
2574
2575 # TODO(thakis): Consider -Wloop-analysis (turns on
2576 # -Wrange-loop-analysis too).
2577
2578 # Don't die on dtoa code that uses a char as an array index.
2579 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2580 '-Wno-char-subscripts',
2581
2582 # TODO(thakis): This used to be implied by -Wno-unused-function,
2583 # which we no longer use. Check if it makes sense to remove
2584 # this as well. http://crbug.com/316352
2585 '-Wno-unneeded-internal-declaration',
2586
2587 # Warns on switches on enums that cover all enum values but
2588 # also contain a default: branch. Chrome is full of that.
2589 '-Wno-covered-switch-default',
2590
2591 # Warns when a const char[] is converted to bool.
2592 '-Wstring-conversion',
2593
2594 # C++11-related flags:
2595
2596 # This warns on using ints as initializers for floats in
2597 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2598 # which happens in several places in chrome code. Not sure if
2599 # this is worth fixing.
2600 '-Wno-c++11-narrowing',
2601
2602 # Clang considers the `register` keyword as deprecated, but e.g.
2603 # code generated by flex (used in angle) contains that keyword.
2604 # http://crbug.com/255186
2605 '-Wno-deprecated-register',
2606
2607 # TODO(hans): Get this cleaned up, http://crbug.com/428099
2608 '-Wno-inconsistent-missing-override',
2609
2610 # TODO(thakis): Enable this, crbug.com/507717
2611 '-Wno-shift-negative-value',
2612
2613 # TODO(thakis): https://crbug.com/604888
2614 '-Wno-undefined-var-template',
2615
2616 # TODO(thakis): https://crbug.com/617318
2617 '-Wno-nonportable-include-path',
2618 ],
2619 },
2620 'defines': [
2621 # Don't use deprecated V8 APIs anywhere.
2622 'V8_DEPRECATION_WARNINGS',
2623 ],
2624 'include_dirs': [
2625 '<(SHARED_INTERMEDIATE_DIR)',
2626 ],
2627 'conditions': [
2628 ['OS=="mac"', {
2629 # When compiling Objective C, warns if a method is used whose
2630 # availability is newer than the deployment target.
2631 'xcode_settings': { 'WARNING_CFLAGS': ['-Wpartial-availability']},
2632 }],
2633 ['(OS=="mac" or OS=="ios") and asan==1', {
2634 'dependencies': [
2635 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2636 ],
2637 }],
2638 ['OS=="win" and asan==1 and component=="shared_library"', {
2639 'dependencies': [
2640 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2641 ],
2642 }],
2643 ['branding=="Chrome"', {
2644 'defines': ['GOOGLE_CHROME_BUILD'],
2645 }, { # else: branding!="Chrome"
2646 'defines': ['CHROMIUM_BUILD'],
2647 }],
2648 ['OS=="mac" and component=="shared_library"', {
2649 'xcode_settings': {
2650 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2651 'LD_RUNPATH_SEARCH_PATHS': [
2652 # For unbundled binaries.
2653 '@loader_path/.',
2654 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2655 '@loader_path/../../..',
2656 ],
2657 },
2658 }],
2659 ['clang==1 or host_clang==1', {
2660 # This is here so that all files get recompiled after a clang roll and
2661 # when turning clang on or off.
2662 # (defines are passed via the command line, and build systems rebuild
2663 # things when their commandline changes). Nothing should ever read this
2664 # define.
2665 'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/up date.py --print-revision)'],
2666 }],
2667 ['enable_rlz==1', {
2668 'defines': ['ENABLE_RLZ'],
2669 }],
2670 ['component=="shared_library"', {
2671 'defines': ['COMPONENT_BUILD'],
2672 }],
2673 ['ui_compositor_image_transport==1', {
2674 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2675 }],
2676 ['use_aura==1', {
2677 'defines': ['USE_AURA=1'],
2678 }],
2679 ['use_ash==1', {
2680 'defines': ['USE_ASH=1'],
2681 }],
2682 ['use_pango==1', {
2683 'defines': ['USE_PANGO=1'],
2684 }],
2685 ['use_cairo==1', {
2686 'defines': ['USE_CAIRO=1'],
2687 }],
2688 ['use_cras==1', {
2689 'defines': ['USE_CRAS=1'],
2690 }],
2691 ['use_ozone==1', {
2692 'defines': ['USE_OZONE=1'],
2693 }],
2694 ['use_default_render_theme==1', {
2695 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2696 }],
2697 ['use_libjpeg_turbo==1', {
2698 'defines': ['USE_LIBJPEG_TURBO=1'],
2699 }],
2700 ['use_x11==1', {
2701 'defines': ['USE_X11=1'],
2702 }],
2703 ['use_clipboard_aurax11==1', {
2704 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2705 }],
2706 ['image_loader_extension==1', {
2707 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2708 }],
2709 ['enable_webrtc==1', {
2710 'defines': ['ENABLE_WEBRTC=1'],
2711 }],
2712 ['enable_media_router==1', {
2713 'defines': ['ENABLE_MEDIA_ROUTER=1'],
2714 }],
2715 ['proprietary_codecs==1', {
2716 'defines': ['USE_PROPRIETARY_CODECS'],
2717 }],
2718 ['enable_viewport==1', {
2719 'defines': ['ENABLE_VIEWPORT'],
2720 }],
2721 ['enable_pepper_cdms==1', {
2722 'defines': ['ENABLE_PEPPER_CDMS'],
2723 }],
2724 ['enable_browser_cdms==1', {
2725 'defines': ['ENABLE_BROWSER_CDMS'],
2726 }],
2727 ['notifications==1', {
2728 'defines': ['ENABLE_NOTIFICATIONS'],
2729 }],
2730 ['enable_wayland_server==1', {
2731 'defines': ['ENABLE_WAYLAND_SERVER=1'],
2732 }],
2733 ['enable_wifi_display==1', {
2734 'defines': ['ENABLE_WIFI_DISPLAY=1'],
2735 }],
2736 ['use_udev==1', {
2737 'defines': ['USE_UDEV'],
2738 }],
2739 ['use_external_popup_menu==1', {
2740 'defines': ['USE_EXTERNAL_POPUP_MENU'],
2741 }],
2742 ['fastbuild!=0', {
2743 'xcode_settings': {
2744 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2745 },
2746 'conditions': [
2747 ['OS=="win" and fastbuild==2', {
2748 # Completely disable debug information.
2749 'msvs_settings': {
2750 'VCLinkerTool': {
2751 'GenerateDebugInformation': 'false',
2752 },
2753 'VCCLCompilerTool': {
2754 'DebugInformationFormat': '0',
2755 },
2756 },
2757 }],
2758 ['OS=="win" and fastbuild==1', {
2759 'msvs_settings': {
2760 'VCLinkerTool': {
2761 # This tells the linker to generate .pdbs, so that
2762 # we can get meaningful stack traces.
2763 'GenerateDebugInformation': 'true',
2764 },
2765 'VCCLCompilerTool': {
2766 # No debug info to be generated by compiler.
2767 'DebugInformationFormat': '0',
2768 },
2769 },
2770 }],
2771 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2772 'variables': { 'debug_extra_cflags': '-g0', },
2773 }],
2774 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2775 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2776 # fixed.
2777 'variables': { 'debug_extra_cflags': '-g0', },
2778 }],
2779 # Android builds symbols on release by default, disable them.
2780 ['OS=="android" and fastbuild==2', {
2781 'variables': { 'release_extra_cflags': '-g0', },
2782 }],
2783 ['OS=="android" and fastbuild==1', {
2784 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2785 # fixed.
2786 'variables': { 'release_extra_cflags': '-g0', },
2787 }],
2788 ],
2789 }], # fastbuild!=0
2790 ['dcheck_always_on!=0', {
2791 'defines': ['DCHECK_ALWAYS_ON=1'],
2792 }], # dcheck_always_on!=0
2793 ['tracing_like_official_build!=0', {
2794 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2795 }], # tracing_like_official_build!=0
2796 ['fieldtrial_testing_like_official_build==0 and branding!="Chrome"', {
2797 'defines': ['FIELDTRIAL_TESTING_ENABLED'],
2798 }], # fieldtrial_testing_like_official_build==0 and branding!="Chrome"
2799 ['OS=="win"', {
2800 'defines': ['NO_TCMALLOC'],
2801 }],
2802 ['syzyasan==1', {
2803 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2804 'msvs_settings': {
2805 'VCLinkerTool': {
2806 'Profile': 'true',
2807 },
2808 },
2809 'defines': [
2810 'SYZYASAN',
2811 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2812 'MEMORY_SANITIZER_INITIAL_SIZE',
2813 ],
2814 }],
2815 ['OS=="win"', {
2816 'defines': [
2817 '__STD_C',
2818 '_CRT_SECURE_NO_DEPRECATE',
2819 '_SCL_SECURE_NO_DEPRECATE',
2820 # This define is required to pull in the new Win 10 interfaces from
2821 # system headers like ShObjIdl.h.
2822 'NTDDI_VERSION=0x0A000000',
2823 # This is required for ATL to use XP-safe versions of its functions.
2824 '_USING_V110_SDK71_',
2825 ],
2826 'include_dirs': [
2827 '<(DEPTH)/third_party/wtl/include',
2828 ],
2829 'conditions': [
2830 ['win_z7!=0', {
2831 'msvs_settings': {
2832 # Generates debug info when win_z7=1
2833 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2834 'VCLinkerTool': {
2835 'GenerateDebugInformation': 'true',
2836 },
2837 'VCCLCompilerTool': {
2838 'DebugInformationFormat': '1',
2839 }
2840 }
2841 }], # win_z7!=0
2842 ['win_analyze', {
2843 'defines!': [
2844 # This is prohibited when running /analyze.
2845 '_USING_V110_SDK71_',
2846 ],
2847 'msvs_settings': {
2848 'VCCLCompilerTool': {
2849 # Set WarnAsError to false to disable this setting for most
2850 # projects so that compilation continues.
2851 'WarnAsError': 'false',
2852 # When win_analyze is specified add the /analyze switch.
2853 # Also add /WX- to force-disable WarnAsError for projects that
2854 # override WarnAsError.
2855 # Also, disable various noisy warnings that have low value.
2856 'AdditionalOptions': [
2857 '/analyze:WX-',
2858 '/wd6011', # Dereferencing NULL pointer
2859 '/wd6312', # Possible infinite loop: use of the constant
2860 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2861 '/wd6326', # Potential comparison of constant with constant
2862 '/wd28159', # Consider using 'GetTickCount64'
2863 '/wd28204', # Inconsistent SAL annotations
2864 '/wd28251', # Inconsistent SAL annotations
2865 '/wd28252', # Inconsistent SAL annotations
2866 '/wd28253', # Inconsistent SAL annotations
2867 '/wd28196', # The precondition is not satisfied
2868 '/wd28301', # Inconsistent SAL annotations
2869 '/wd6340', # Sign mismatch in function parameter
2870 '/wd28182', # Dereferencing NULL pointer
2871 # C6285 is ~16% of raw warnings and has low value
2872 '/wd6285', # non-zero constant || non-zero constant
2873 # C6334 is ~80% of raw warnings and has low value
2874 '/wd6334', # sizeof applied to an expression with an operator
2875 ],
2876 },
2877 },
2878 }], # win_analyze
2879 ],
2880 }], # OS==win
2881 ['chromecast==1', {
2882 'defines': [
2883 'LOG_DISABLED=0',
2884 ],
2885 }],
2886 ['enable_task_manager==1', {
2887 'defines': [
2888 'ENABLE_TASK_MANAGER=1',
2889 ],
2890 }],
2891 ['enable_extensions==1', {
2892 'defines': [
2893 'ENABLE_EXTENSIONS=1',
2894 ],
2895 }],
2896 ['OS=="win" and branding=="Chrome"', {
2897 'defines': ['ENABLE_SWIFTSHADER'],
2898 }],
2899 ['enable_dart==1', {
2900 'defines': ['WEBKIT_USING_DART=1'],
2901 }],
2902 ['enable_pdf==1', {
2903 'defines': ['ENABLE_PDF=1'],
2904 }],
2905 ['enable_plugin_installation==1', {
2906 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2907 }],
2908 ['enable_plugins==1', {
2909 'defines': ['ENABLE_PLUGINS=1'],
2910 }],
2911 ['enable_session_service==1', {
2912 'defines': ['ENABLE_SESSION_SERVICE=1'],
2913 }],
2914 ['enable_themes==1', {
2915 'defines': ['ENABLE_THEMES=1'],
2916 }],
2917 ['enable_basic_printing==1 or enable_print_preview==1', {
2918 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2919 'defines': ['ENABLE_PRINTING=1'],
2920 }],
2921 ['enable_basic_printing==1', {
2922 # Enable basic printing support and UI.
2923 'defines': ['ENABLE_BASIC_PRINTING=1'],
2924 }],
2925 ['enable_print_preview==1', {
2926 # Enable printing with print preview.
2927 # Can be defined without ENABLE_BASIC_PRINTING.
2928 'defines': ['ENABLE_PRINT_PREVIEW=1'],
2929 }],
2930 ['enable_spellcheck==1', {
2931 'defines': ['ENABLE_SPELLCHECK=1'],
2932 }],
2933 ['use_browser_spellchecker', {
2934 'defines': ['USE_BROWSER_SPELLCHECKER=1'],
2935 }],
2936 ['use_minikin_hyphenation', {
2937 'defines': ['USE_MINIKIN_HYPHENATION=1'],
2938 }],
2939 ['enable_captive_portal_detection==1', {
2940 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2941 }],
2942 ['enable_app_list==1', {
2943 'defines': ['ENABLE_APP_LIST=1'],
2944 }],
2945 ['disable_file_support==1', {
2946 'defines': ['DISABLE_FILE_SUPPORT=1'],
2947 }],
2948 ['disable_ftp_support==1', {
2949 'defines': ['DISABLE_FTP_SUPPORT=1'],
2950 }],
2951 ['enable_supervised_users==1', {
2952 'defines': ['ENABLE_SUPERVISED_USERS=1'],
2953 }],
2954 ['enable_mdns==1', {
2955 'defines': ['ENABLE_MDNS=1'],
2956 }],
2957 ['enable_service_discovery==1', {
2958 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2959 }],
2960 ['enable_hangout_services_extension==1', {
2961 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2962 }],
2963 ['enable_ipc_fuzzer==1', {
2964 'defines': ['ENABLE_IPC_FUZZER=1'],
2965 }],
2966 ['video_hole==1', {
2967 'defines': ['VIDEO_HOLE=1'],
2968 }],
2969 ['v8_use_external_startup_data==1', {
2970 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
2971 }],
2972 ['enable_webvr==1', {
2973 'defines': ['ENABLE_WEBVR'],
2974 }],
2975
2976 # SAFE_BROWSING_DB_LOCAL - service manages a local database.
2977 # SAFE_BROWSING_DB_REMOTE - service talks via API to a database
2978 # SAFE_BROWSING_CSD - enable client-side phishing detection.
2979 ['safe_browsing==1', {
2980 'defines': [
2981 # TODO(nparker): Remove existing uses of FULL_SAFE_BROWSING
2982 'FULL_SAFE_BROWSING',
2983 'SAFE_BROWSING_CSD',
2984 'SAFE_BROWSING_DB_LOCAL',
2985 ],
2986 }],
2987 ['safe_browsing==2 and OS!="ios"', {
2988 'defines': [
2989 'SAFE_BROWSING_DB_REMOTE',
2990 ],
2991 }],
2992 ], # conditions for 'target_defaults'
2993 'target_conditions': [
2994 ['<(use_libpci)==1', {
2995 'defines': ['USE_LIBPCI=1'],
2996 }],
2997 ['<(use_openssl_certs)==1', {
2998 'defines': ['USE_OPENSSL_CERTS=1'],
2999 }],
3000 ['>(nacl_untrusted_build)==1', {
3001 'defines': [
3002 'USE_OPENSSL_CERTS=1',
3003 ],
3004 }],
3005 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3006 'defines': ['USE_GLIB=1'],
3007 }],
3008 ['<(use_nss_certs)==1 and >(nacl_untrusted_build)==0', {
3009 'defines': ['USE_NSS_CERTS=1'],
3010 }],
3011 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3012 'defines': ['OS_CHROMEOS=1'],
3013 }],
3014 ['<(asan)==1 and >(nacl_untrusted_build)==0', {
3015 'defines': [
3016 'ADDRESS_SANITIZER',
3017 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3018 'MEMORY_SANITIZER_INITIAL_SIZE',
3019 ],
3020 }],
3021 ['enable_wexit_time_destructors==1 and OS!="win"', {
3022 # TODO: Enable on Windows too, http://crbug.com/404525
3023 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3024 }],
3025 ['chromium_code==0', {
3026 'variables': {
3027 'clang_warning_flags': [
3028 # Lots of third-party libraries have unused variables. Instead of
3029 # suppressing them individually, we just blanket suppress them here.
3030 '-Wno-unused-variable',
3031 ],
3032 },
3033 'conditions': [
3034 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3035 # Remove -Wextra for third-party code.
3036 'cflags!': [ '-Wextra' ],
3037 'cflags_cc': [
3038 # Don't warn about hash_map in third-party code.
3039 '-Wno-deprecated',
3040 ],
3041 }],
3042 [ 'os_posix==1 and clang!=1 and OS!="mac" and OS!="ios"', {
3043 # When we don't control the compiler, don't use -Wall for
3044 # third-party code either.
3045 'cflags!': [ '-Wall' ],
3046 }],
3047 # TODO: Fix all warnings on chromeos too.
3048 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos== 1)', {
3049 'cflags!': [
3050 '-Werror',
3051 ],
3052 }],
3053 [ 'OS=="win"', {
3054 'defines': [
3055 '_CRT_SECURE_NO_DEPRECATE',
3056 '_CRT_NONSTDC_NO_WARNINGS',
3057 '_CRT_NONSTDC_NO_DEPRECATE',
3058 '_SCL_SECURE_NO_DEPRECATE',
3059 ],
3060 'msvs_disabled_warnings': [
3061 # forcing value to bool 'true' or 'false' (performance warning)
3062 4800,
3063 ],
3064 'msvs_settings': {
3065 'VCCLCompilerTool': {
3066 'WarningLevel': '3',
3067 'WarnAsError': 'true',
3068 'Detect64BitPortabilityProblems': 'false',
3069 },
3070 },
3071 'conditions': [
3072 ['buildtype=="Official"', {
3073 'msvs_settings': {
3074 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3075 }
3076 }],
3077 [ 'component=="shared_library"', {
3078 # TODO(darin): Unfortunately, some third_party code depends on bas e.
3079 'msvs_disabled_warnings': [
3080 4251, # class 'std::xx' needs to have dll-interface.
3081 ],
3082 }],
3083 ],
3084 }],
3085
3086 [ 'OS=="mac" or OS=="ios"', {
3087 'xcode_settings': {
3088 'WARNING_CFLAGS!': ['-Wextra'],
3089 },
3090 'conditions': [
3091 ['buildtype=="Official"', {
3092 'xcode_settings': {
3093 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3094 },
3095 }],
3096 ],
3097 }],
3098 [ 'OS=="ios"', {
3099 'xcode_settings': {
3100 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3101 # Several internal ios directories generate numerous warnings for
3102 # -Wobjc-missing-property-synthesis.
3103 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3104 },
3105 }],
3106 ],
3107 }, {
3108 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3109 # C99 macros on Mac and Linux.
3110 'defines': [
3111 '__STDC_CONSTANT_MACROS',
3112 '__STDC_FORMAT_MACROS',
3113 ],
3114 'conditions': [
3115 ['OS=="win"', {
3116 # turn on warnings for signed/unsigned mismatch on chromium code.
3117 'msvs_settings': {
3118 'VCCLCompilerTool': {
3119 'AdditionalOptions': ['/we4389'],
3120 },
3121 },
3122 }],
3123 ['OS=="win" and component=="shared_library"', {
3124 'msvs_disabled_warnings': [
3125 4251, # class 'std::xx' needs to have dll-interface.
3126 ],
3127 }],
3128 ],
3129 }],
3130 ], # target_conditions for 'target_defaults'
3131 'default_configuration': 'Debug', 6 'default_configuration': 'Debug',
3132 'configurations': { 7 'configurations': {
3133 # VCLinkerTool LinkIncremental values below: 8 'Debug': {},
3134 # 0 == default 9 'Release': {},
3135 # 1 == /INCREMENTAL:NO
3136 # 2 == /INCREMENTAL
3137 # Debug links incremental, Release does not.
3138 #
3139 # Abstract base configurations to cover common attributes.
3140 #
3141 'Common_Base': {
3142 'abstract': 1,
3143 'msvs_configuration_attributes': {
3144 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(Configuratio nName)',
3145 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3146 'CharacterSet': '1',
3147 },
3148 'msvs_settings':{
3149 'VCCLCompilerTool': {
3150 'AdditionalOptions': [
3151 '/bigobj',
3152 # Tell the compiler to crash on failures. This is undocumented
3153 # and unsupported but very handy.
3154 '/d2FastFail',
3155 ],
3156 },
3157 'VCLinkerTool': {
3158 # Add the default import libs.
3159 'AdditionalDependencies': [
3160 'kernel32.lib',
3161 'gdi32.lib',
3162 'winspool.lib',
3163 'comdlg32.lib',
3164 'advapi32.lib',
3165 'shell32.lib',
3166 'ole32.lib',
3167 'oleaut32.lib',
3168 'user32.lib',
3169 'uuid.lib',
3170 'odbc32.lib',
3171 'odbccp32.lib',
3172 'delayimp.lib',
3173 'credui.lib',
3174 ],
3175 'AdditionalOptions': [
3176 # Suggested by Microsoft Devrel to avoid
3177 # LINK : fatal error LNK1248: image size (80000000) exceeds maxi mum allowable size (80000000)
3178 # which started happening more regularly after VS2013 Update 4.
3179 # Needs to be a bit lower for VS2015, or else errors out.
3180 '/maxilksize:0x7ff00000',
3181 # Tell the linker to crash on failures.
3182 '/fastfail',
3183 ],
3184 },
3185 },
3186 'conditions': [
3187 ['OS=="win" and win_fastlink==1 and MSVS_VERSION != "2013"', {
3188 'msvs_settings': {
3189 'VCLinkerTool': {
3190 # /PROFILE is incompatible with /debug:fastlink
3191 'Profile': 'false',
3192 'AdditionalOptions': [
3193 # Tell VS 2015+ to create a PDB that references debug
3194 # information in .obj and .lib files instead of copying
3195 # it all.
3196 '/DEBUG:FASTLINK',
3197 ],
3198 },
3199 },
3200 }],
3201 ['OS=="win" and MSVS_VERSION == "2015"', {
3202 'msvs_settings': {
3203 'VCCLCompilerTool': {
3204 'AdditionalOptions': [
3205 # Work around crbug.com/526851, bug in VS 2015 RTM compiler.
3206 '/Zc:sizedDealloc-',
3207 # Disable thread-safe statics to avoid overhead and because
3208 # they are disabled on other platforms. See crbug.com/587210
3209 # and -fno-threadsafe-statics.
3210 '/Zc:threadSafeInit-',
3211 ],
3212 },
3213 },
3214 }],
3215 ],
3216 },
3217 'x86_Base': {
3218 'abstract': 1,
3219 'msvs_settings': {
3220 'VCLinkerTool': {
3221 'MinimumRequiredVersion': '5.01', # XP.
3222 'TargetMachine': '1',
3223 },
3224 'VCLibrarianTool': {
3225 'TargetMachine': '1',
3226 },
3227 },
3228 'msvs_configuration_platform': 'Win32',
3229 },
3230 'x64_Base': {
3231 'abstract': 1,
3232 'msvs_configuration_platform': 'x64',
3233 'msvs_settings': {
3234 'VCLinkerTool': {
3235 # Make sure to understand http://crbug.com/361720 if you want to
3236 # increase this.
3237 'MinimumRequiredVersion': '5.02', # Server 2003.
3238 'TargetMachine': '17', # x86 - 64
3239 'AdditionalLibraryDirectories!':
3240 ['<(windows_sdk_path)/Lib/10.0.10586.0/um/x86'],
3241 'AdditionalLibraryDirectories':
3242 ['<(windows_sdk_path)/Lib/10.0.10586.0/um/x64'],
3243 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3244 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3245 },
3246 'VCLibrarianTool': {
3247 'AdditionalLibraryDirectories!':
3248 ['<(windows_sdk_path)/Lib/10.0.10586.0/um/x86'],
3249 'AdditionalLibraryDirectories':
3250 ['<(windows_sdk_path)/Lib/10.0.10586.0/um/x64'],
3251 'TargetMachine': '17', # x64
3252 },
3253 },
3254 },
3255 'Debug_Base': {
3256 'abstract': 1,
3257 'defines': [
3258 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3259 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3260 ],
3261 'xcode_settings': {
3262 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3263 'OTHER_CFLAGS': [
3264 '<@(debug_extra_cflags)',
3265 ],
3266 },
3267 'msvs_settings': {
3268 'VCCLCompilerTool': {
3269 'Optimization': '<(win_debug_Optimization)',
3270 'PreprocessorDefinitions': ['_DEBUG'],
3271 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3272 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3273 'conditions': [
3274 # According to MSVS, InlineFunctionExpansion=0 means
3275 # "default inlining", not "/Ob0".
3276 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3277 ['win_debug_InlineFunctionExpansion==0', {
3278 'AdditionalOptions': ['/Ob0'],
3279 }],
3280 ['win_debug_InlineFunctionExpansion!=""', {
3281 'InlineFunctionExpansion':
3282 '<(win_debug_InlineFunctionExpansion)',
3283 }],
3284 ['win_debug_disable_iterator_debugging==1', {
3285 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3286 }],
3287
3288 # if win_debug_OmitFramePointers is blank, leave as default
3289 ['win_debug_OmitFramePointers==1', {
3290 'OmitFramePointers': 'true',
3291 }],
3292 ['win_debug_OmitFramePointers==0', {
3293 'OmitFramePointers': 'false',
3294 # The above is not sufficient (http://crbug.com/106711): it
3295 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3296 # perform FPO regardless, so we must explicitly disable.
3297 # We still want the false setting above to avoid having
3298 # "/Oy /Oy-" and warnings about overriding.
3299 'AdditionalOptions': ['/Oy-'],
3300 }],
3301 ],
3302 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3303 },
3304 'VCLinkerTool': {
3305 'LinkIncremental': '<(msvs_debug_link_incremental)',
3306 # ASLR makes debugging with windbg difficult because Chrome.exe and
3307 # Chrome.dll share the same base name. As result, windbg will
3308 # name the Chrome.dll module like chrome_<base address>, where
3309 # <base address> typically changes with each launch. This in turn
3310 # means that breakpoints in Chrome.dll don't stick from one launch
3311 # to the next. For this reason, we turn ASLR off in debug builds.
3312 # Note that this is a three-way bool, where 0 means to pick up
3313 # the default setting, 1 is off and 2 is on.
3314 'RandomizedBaseAddress': 1,
3315 },
3316 'VCResourceCompilerTool': {
3317 'PreprocessorDefinitions': ['_DEBUG'],
3318 },
3319 },
3320 'variables': {
3321 'clang_warning_flags': [
3322 # Allow comparing the address of references and 'this' against 0
3323 # in debug builds. Technically, these can never be null in
3324 # well-defined C/C++ and Clang can optimize such checks away in
3325 # release builds, but they may be used in asserts in debug builds.
3326 '-Wno-undefined-bool-conversion',
3327 '-Wno-tautological-undefined-compare',
3328 ],
3329 },
3330 'conditions': [
3331 ['OS=="linux" or OS=="android"', {
3332 'target_conditions': [
3333 ['_toolset=="target"', {
3334 'cflags': [
3335 '<@(debug_extra_cflags)',
3336 ],
3337 }],
3338 ],
3339 }],
3340 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3341 # Enable libstdc++ debugging facilities to help catch problems
3342 # early, see http://crbug.com/65151 .
3343 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3344 'defines': ['_GLIBCXX_DEBUG=1',],
3345 }],
3346 ['release_valgrind_build==0', {
3347 'xcode_settings': {
3348 'OTHER_CFLAGS': [
3349 '-fstack-protector-strong', # Implies -fstack-protector
3350 ],
3351 },
3352 }],
3353 ],
3354 },
3355 'Release_Base': {
3356 'abstract': 1,
3357 'defines': [
3358 'NDEBUG',
3359 ],
3360 'xcode_settings': {
3361 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3362 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3363 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3364 },
3365 'msvs_settings': {
3366 'VCCLCompilerTool': {
3367 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3368 'conditions': [
3369 # In official builds, each target will self-select
3370 # an optimization level.
3371 ['buildtype!="Official"', {
3372 'Optimization': '<(win_release_Optimization)',
3373 },
3374 ],
3375 # According to MSVS, InlineFunctionExpansion=0 means
3376 # "default inlining", not "/Ob0".
3377 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3378 ['win_release_InlineFunctionExpansion==0', {
3379 'AdditionalOptions': ['/Ob0'],
3380 }],
3381 ['win_release_InlineFunctionExpansion!=""', {
3382 'InlineFunctionExpansion':
3383 '<(win_release_InlineFunctionExpansion)',
3384 }],
3385
3386 # if win_release_OmitFramePointers is blank, leave as default
3387 ['win_release_OmitFramePointers==1', {
3388 'OmitFramePointers': 'true',
3389 }],
3390 ['win_release_OmitFramePointers==0', {
3391 'OmitFramePointers': 'false',
3392 # The above is not sufficient (http://crbug.com/106711): it
3393 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3394 # perform FPO regardless, so we must explicitly disable.
3395 # We still want the false setting above to avoid having
3396 # "/Oy /Oy-" and warnings about overriding.
3397 'AdditionalOptions': ['/Oy-'],
3398 }],
3399 ['asan==0', {
3400 # Put data in separate COMDATs. This allows the linker
3401 # to put bit-identical constants at the same address even if
3402 # they're unrelated constants, which saves binary size.
3403 # This optimization can't be used when ASan is enabled because
3404 # it is not compatible with the ASan ODR checker.
3405 'AdditionalOptions': ['/Gw'],
3406 }],
3407 ],
3408 'AdditionalOptions': [
3409 '/d2Zi+', # Improve debugging of Release builds.
3410 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3411 '<@(win_release_extra_cflags)',
3412 ],
3413 },
3414 'VCLinkerTool': {
3415 # LinkIncremental is a tri-state boolean, where 0 means default
3416 # (i.e., inherit from parent solution), 1 means false, and
3417 # 2 means true.
3418 'LinkIncremental': '1',
3419 # This corresponds to the /PROFILE flag which ensures the PDB
3420 # file contains FIXUP information (growing the PDB file by about
3421 # 5%) but does not otherwise alter the output binary. This
3422 # information is used by the Syzygy optimization tool when
3423 # decomposing the release image.
3424 'Profile': 'true',
3425 },
3426 },
3427 'conditions': [
3428 ['release_valgrind_build==0 and tsan==0', {
3429 'defines': [
3430 'NVALGRIND',
3431 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3432 ],
3433 }, {
3434 'defines': [
3435 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3436 'MEMORY_SANITIZER_INITIAL_SIZE',
3437 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3438 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3439 ],
3440 }],
3441 ['OS=="win" and win_use_allocator_shim==1', {
3442 'defines': [
3443 'ALLOCATOR_SHIM'
3444 ],
3445 }],
3446 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3447 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3448 # It seems to work fine with Ubuntu 12 headers though, so use it
3449 # in official builds.
3450 ['os_posix==1 and (asan!=1 and msan!=1 and tsan!=1 and lsan!=1 and ubs an!=1) and (OS!="linux" or clang!=1 or buildtype=="Official")', {
3451 'target_conditions': [
3452 ['chromium_code==1', {
3453 # Non-chromium code is not guaranteed to compile cleanly
3454 # with _FORTIFY_SOURCE. Also, fortified build may fail
3455 # when optimizations are disabled, so only do that for Release
3456 # build.
3457 'defines': [
3458 '_FORTIFY_SOURCE=2',
3459 ],
3460 }],
3461 ],
3462 }],
3463 ['OS=="linux" or OS=="android"', {
3464 'target_conditions': [
3465 ['_toolset=="target"', {
3466 'cflags': [
3467 '<@(release_extra_cflags)',
3468 ],
3469 'conditions': [
3470 ['enable_resource_whitelist_generation==1', {
3471 'cflags': [
3472 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3473 ],
3474 }],
3475 ],
3476 }],
3477 ],
3478 }],
3479 ['OS=="ios"', {
3480 'defines': [
3481 'NS_BLOCK_ASSERTIONS=1',
3482 ],
3483 }],
3484 ],
3485 },
3486 #
3487 # Concrete configurations
3488 #
3489 'Debug': {
3490 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3491 },
3492 'Release': {
3493 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3494 },
3495 'conditions': [
3496 [ 'OS=="ios"', {
3497 'Profile': {
3498 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3499 'target_conditions': [
3500 [ '_type=="executable"', {
3501 # To get a real .dSYM bundle produced by dsymutil, set the
3502 # debug information format to dwarf-with-dsym. Since
3503 # strip_from_xcode will not be used, set Xcode to do the
3504 # stripping as well.
3505 'xcode_settings': {
3506 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3507 'DEPLOYMENT_POSTPROCESSING': 'YES',
3508 'STRIP_INSTALLED_PRODUCT': 'YES',
3509 },
3510 }],
3511 ],
3512 },
3513 }],
3514 [ 'OS=="win"', {
3515 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3516 'Debug_x64': {
3517 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3518 },
3519 'Release_x64': {
3520 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3521 },
3522 }],
3523 ],
3524 }, 10 },
3525 }, 11 },
3526 'conditions': [
3527 ['os_posix==1', {
3528 'target_defaults': {
3529 'ldflags': [
3530 '-Wl,-z,now',
3531 '-Wl,-z,relro',
3532 ],
3533 # TODO(glider): enable the default options on other systems.
3534 'conditions': [
3535 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or targe t_arch!="ia32")) or OS=="mac")', {
3536 'dependencies': [
3537 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3538 ],
3539 }],
3540 ],
3541 },
3542 }],
3543 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3544 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3545 'target_defaults': {
3546 'ldflags': [
3547 '-Wl,--fatal-warnings',
3548 ],
3549 },
3550 }],
3551 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3552 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubs an==0 and ubsan_security==0 and ubsan_vptr==0 and cfi_diag==0', {
3553 'target_defaults': {
3554 'ldflags': [
3555 '-Wl,-z,defs',
3556 ],
3557 },
3558 }],
3559 ['os_posix==1 and chromeos==0', {
3560 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3561 # and we want to avoid overriding this, so stack-protector is only
3562 # enabled when not building on Chrome OS.
3563 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3564 # supports it. See also https://crbug.com/533294
3565 'target_defaults': {
3566 'cflags': [
3567 '-fstack-protector',
3568 '--param=ssp-buffer-size=4',
3569 ],
3570 },
3571 }],
3572 ['os_posix==1 and OS=="linux"', {
3573 'defines': [
3574 '_LARGEFILE_SOURCE',
3575 '_LARGEFILE64_SOURCE',
3576 '_FILE_OFFSET_BITS=64',
3577 ],
3578 }],
3579 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3580 'target_defaults': {
3581 # Enable -Werror by default, but put it in a variable so it can
3582 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3583 'variables': {
3584 'werror%': '-Werror',
3585 'libraries_for_target%': '',
3586 'conditions' : [
3587 # Enable -Wextra for chromium_code when we control the compiler.
3588 ['clang==1', { 'wextra': '-Wextra' }, { 'wextra': '-Wno-extra' }],
3589 ],
3590 },
3591 'defines': [
3592 '_FILE_OFFSET_BITS=64',
3593 ],
3594 'cflags': [
3595 '<(werror)', # See note above about the werror variable.
3596 '-pthread',
3597 '-fno-strict-aliasing', # See http://crbug.com/32204
3598 '-Wall',
3599 '<(wextra)',
3600 # Don't warn about unused function params. We use those everywhere.
3601 '-Wno-unused-parameter',
3602 # Don't warn about the "struct foo f = {0};" initialization pattern.
3603 '-Wno-missing-field-initializers',
3604 # Don't export any symbols (for example, to plugins we dlopen()).
3605 # Note: this is *required* to make some plugins work.
3606 '-fvisibility=hidden',
3607 '-pipe',
3608 ],
3609 'cflags_cc': [
3610 '-fno-exceptions',
3611 '-fno-rtti',
3612 # If this is removed then remove the corresponding /Zc:threadSafeInit-
3613 # for Windows.
3614 '-fno-threadsafe-statics',
3615 # Make inline functions have hidden visiblity by default.
3616 # Surprisingly, not covered by -fvisibility=hidden.
3617 '-fvisibility-inlines-hidden',
3618 ],
3619 'ldflags': [
3620 '-pthread', '-Wl,-z,noexecstack',
3621 ],
3622 'libraries' : [
3623 '<(libraries_for_target)',
3624 ],
3625 'configurations': {
3626 'Debug_Base': {
3627 'variables': {
3628 'debug_optimize%': '0',
3629 },
3630 'defines': [
3631 '_DEBUG',
3632 ],
3633 'cflags': [
3634 '-O>(debug_optimize)',
3635 '-g',
3636 ],
3637 'conditions' : [
3638 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64 el"', {
3639 # TODO(jdduke) Re-enable on mips after resolving linking
3640 # issues with libc++ (crbug.com/456380).
3641 'ldflags': [
3642 # Warn in case of text relocations.
3643 '-Wl,--warn-shared-textrel',
3644 ],
3645 }],
3646 ['OS=="android" and android_full_debug==0', {
3647 # Some configurations are copied from Release_Base to reduce
3648 # the binary size.
3649 'variables': {
3650 'debug_optimize%': 's',
3651 },
3652 'cflags': [
3653 '-fdata-sections',
3654 '-ffunction-sections',
3655 ],
3656 'ldflags': [
3657 '-Wl,-O1',
3658 '-Wl,--as-needed',
3659 ],
3660 }],
3661 ['OS=="android" and android_full_debug==0 and target_arch!="arm64" ', {
3662 # We don't omit frame pointers on arm64 since they are required
3663 # to correctly unwind stackframes which contain system library
3664 # function frames (crbug.com/391706).
3665 'cflags': [
3666 '-fomit-frame-pointer',
3667 ],
3668 }],
3669 ['OS=="linux" and target_arch=="ia32"', {
3670 'ldflags': [
3671 '-Wl,--no-as-needed',
3672 ],
3673 }],
3674 ['debug_unwind_tables==1', {
3675 'cflags': ['-funwind-tables'],
3676 }, {
3677 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-table s'],
3678 'defines': ['NO_UNWIND_TABLES'],
3679 }],
3680 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and binut ils_version>=223', {
3681 'cflags': ['-gsplit-dwarf'],
3682 }],
3683 ],
3684 },
3685 'Release_Base': {
3686 'variables': {
3687 'release_optimize%': '2',
3688 # Binaries become big and gold is unable to perform GC
3689 # and remove unused sections for some of test targets
3690 # on 32 bit platform.
3691 # (This is currently observed only in chromeos valgrind bots)
3692 # The following flag is to disable --gc-sections linker
3693 # option for these bots.
3694 'no_gc_sections%': 0,
3695
3696 # TODO(bradnelson): reexamine how this is done if we change the
3697 # expansion of configurations
3698 'release_valgrind_build%': 0,
3699 },
3700 'cflags': [
3701 '-O<(release_optimize)',
3702 # Don't emit the GCC version ident directives, they just end up
3703 # in the .comment section taking up binary size.
3704 '-fno-ident',
3705 # Put data and code in their own sections, so that unused symbols
3706 # can be removed at link time with --gc-sections.
3707 '-fdata-sections',
3708 '-ffunction-sections',
3709 ],
3710 'ldflags': [
3711 # Specifically tell the linker to perform optimizations.
3712 # See http://lwn.net/Articles/192624/ .
3713 '-Wl,-O1',
3714 '-Wl,--as-needed',
3715 ],
3716 'conditions' : [
3717 ['no_gc_sections==0', {
3718 'ldflags': [
3719 '-Wl,--gc-sections',
3720 ],
3721 }],
3722 ['OS=="android" and target_arch!="arm64"', {
3723 # We don't omit frame pointers on arm64 since they are required
3724 # to correctly unwind stackframes which contain system library
3725 # function frames (crbug.com/391706).
3726 'cflags': [
3727 '-fomit-frame-pointer',
3728 ]
3729 }],
3730 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64 el"', {
3731 # TODO(jdduke) Re-enable on mips after resolving linking
3732 # issues with libc++ (crbug.com/456380).
3733 'ldflags': [
3734 # Warn in case of text relocations.
3735 '-Wl,--warn-shared-textrel',
3736 ],
3737 }],
3738 ['OS=="android"', {
3739 'variables': {
3740 'release_optimize%': 's',
3741 },
3742 }, {
3743 'ldflags': [
3744 # TODO(pcc): Fix linker bug which requires us to link pthread
3745 # unconditionally here (crbug.com/623236).
3746 '-Wl,--no-as-needed',
3747 '-lpthread',
3748 '-Wl,--as-needed',
3749 ],
3750 }],
3751 ['profiling==1', {
3752 'cflags': [
3753 '-fno-omit-frame-pointer',
3754 '-g',
3755 ],
3756 'conditions' : [
3757 ['profiling_full_stack_frames==1', {
3758 'cflags': [
3759 '-fno-inline',
3760 '-fno-optimize-sibling-calls',
3761 ],
3762 }],
3763 ],
3764 }],
3765 ['release_unwind_tables==1', {
3766 'cflags': ['-funwind-tables'],
3767 }, {
3768 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-table s'],
3769 'defines': ['NO_UNWIND_TABLES'],
3770 }],
3771 ],
3772 },
3773 },
3774 'conditions': [
3775 ['target_arch=="ia32"', {
3776 'target_conditions': [
3777 ['_toolset=="target"', {
3778 'asflags': [
3779 # Needed so that libs with .s files (e.g. libicudata.a)
3780 # are compatible with the general 32-bit-ness.
3781 '-32',
3782 ],
3783 # All floating-point computations on x87 happens in 80-bit
3784 # precision. Because the C and C++ language standards allow
3785 # the compiler to keep the floating-point values in higher
3786 # precision than what's specified in the source and doing so
3787 # is more efficient than constantly rounding up to 64-bit or
3788 # 32-bit precision as specified in the source, the compiler,
3789 # especially in the optimized mode, tries very hard to keep
3790 # values in x87 floating-point stack (in 80-bit precision)
3791 # as long as possible. This has important side effects, that
3792 # the real value used in computation may change depending on
3793 # how the compiler did the optimization - that is, the value
3794 # kept in 80-bit is different than the value rounded down to
3795 # 64-bit or 32-bit. There are possible compiler options to
3796 # make this behavior consistent (e.g. -ffloat-store would keep
3797 # all floating-values in the memory, thus force them to be
3798 # rounded to its original precision) but they have significant
3799 # runtime performance penalty.
3800 #
3801 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3802 # which keep floating-point values in SSE registers in its
3803 # native precision (32-bit for single precision, and 64-bit
3804 # for double precision values). This means the floating-point
3805 # value used during computation does not change depending on
3806 # how the compiler optimized the code, since the value is
3807 # always kept in its specified precision.
3808 #
3809 # Refer to http://crbug.com/348761 for rationale behind SSE2
3810 # being a minimum requirement for 32-bit Linux builds and
3811 # http://crbug.com/313032 for an example where this has "bit"
3812 # us in the past.
3813 'cflags': [
3814 '-msse2',
3815 '-mfpmath=sse',
3816 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3817 '-m32',
3818 ],
3819 'ldflags': [
3820 '-m32',
3821 ],
3822 'conditions': [
3823 # Use gold linker for Android ia32 target.
3824 ['OS=="android"', {
3825 # Use gold linker for Android ia32 target.
3826 'ldflags': [
3827 '-fuse-ld=gold',
3828 ],
3829 # Use -mstackrealign due to a bug on ia32 Jelly Bean.
3830 # See crbug.com/521527
3831 'cflags': [
3832 '-mstackrealign',
3833 ],
3834 }],
3835 ],
3836 }],
3837 ],
3838 }],
3839 ['target_arch=="x64"', {
3840 'target_conditions': [
3841 ['_toolset=="target"', {
3842 'conditions': [
3843 # Use gold linker for Android x64 target.
3844 ['OS=="android"', {
3845 'ldflags': [
3846 '-fuse-ld=gold',
3847 ],
3848 }],
3849 ],
3850 'cflags': [
3851 '-m64',
3852 '-march=x86-64',
3853 ],
3854 'ldflags': [
3855 '-m64',
3856 ],
3857 }],
3858 ],
3859 }],
3860 ['target_arch=="arm"', {
3861 'target_conditions': [
3862 ['_toolset=="target"', {
3863 'conditions': [
3864 ['clang==0', {
3865 'cflags': [
3866 # Don't warn about "maybe" uninitialized. Clang doesn't
3867 # include this in -Wall but gcc does, and it gives false
3868 # positives.
3869 '-Wno-maybe-uninitialized',
3870 ],
3871 'cflags_cc': [
3872 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3873 # has changed whenever it encounters a varargs function. T his
3874 # silences those warnings, as they are not helpful and
3875 # clutter legitimate warnings.
3876 '-Wno-abi',
3877 ],
3878 }],
3879 ['clang==1 and arm_arch!="" and OS!="android"', {
3880 'cflags': [
3881 '-target arm-linux-gnueabihf',
3882 ],
3883 'ldflags': [
3884 '-target arm-linux-gnueabihf',
3885 ],
3886 }],
3887 ['arm_arch!=""', {
3888 'cflags': [
3889 '-march=<(arm_arch)',
3890 ],
3891 'conditions': [
3892 ['use_lto==1 or use_lto_o2==1', {
3893 'ldflags': [
3894 '-march=<(arm_arch)',
3895 ],
3896 }],
3897 ],
3898 }],
3899 ['arm_tune!=""', {
3900 'cflags': [
3901 '-mtune=<(arm_tune)',
3902 ],
3903 'conditions': [
3904 ['use_lto==1 or use_lto_o2==1', {
3905 'ldflags': [
3906 '-mtune=<(arm_tune)',
3907 ],
3908 }],
3909 ],
3910 }],
3911 ['arm_fpu!=""', {
3912 'cflags': [
3913 '-mfpu=<(arm_fpu)',
3914 ],
3915 'conditions': [
3916 ['use_lto==1 or use_lto_o2==1', {
3917 'ldflags': [
3918 '-mfpu=<(arm_fpu)',
3919 ],
3920 }],
3921 ],
3922 }],
3923 ['arm_float_abi!=""', {
3924 'cflags': [
3925 '-mfloat-abi=<(arm_float_abi)',
3926 ],
3927 'conditions': [
3928 ['use_lto==1 or use_lto_o2==1', {
3929 'ldflags': [
3930 '-mfloat-abi=<(arm_float_abi)',
3931 ],
3932 }],
3933 ],
3934 }],
3935 ['arm_thumb==1', {
3936 'cflags': [
3937 '-mthumb',
3938 ],
3939 'conditions': [
3940 ['use_lto==1 or use_lto_o2==1', {
3941 'ldflags': [
3942 '-mthumb',
3943 ],
3944 }],
3945 ],
3946 }],
3947 ['OS=="android"', {
3948 # Most of the following flags are derived from what Android
3949 # uses by default when building for arm, reference for which
3950 # can be found in the following file in the Android NDK:
3951 # toolchains/arm-linux-androideabi-4.9/setup.mk
3952 'cflags': [
3953 # The tree-sra optimization (scalar replacement for
3954 # aggregates enabling subsequent optimizations) leads to
3955 # invalid code generation when using the Android NDK's
3956 # compiler (r5-r7). This can be verified using
3957 # webkit_unit_tests' WTF.Checked_int8_t test.
3958 '-fno-tree-sra',
3959 # The following option is disabled to improve binary
3960 # size and performance in gcc 4.9.
3961 '-fno-caller-saves',
3962 '-Wno-psabi',
3963 ],
3964 # Android now supports .relro sections properly.
3965 # NOTE: While these flags enable the generation of .relro
3966 # sections, the generated libraries can still be loaded on
3967 # older Android platform versions.
3968 'ldflags': [
3969 '-Wl,-z,relro',
3970 '-Wl,-z,now',
3971 '-fuse-ld=gold',
3972 ],
3973 'conditions': [
3974 ['arm_thumb==1', {
3975 'cflags': [ '-mthumb-interwork' ],
3976 }],
3977 ['profiling==1', {
3978 'cflags': [
3979 # Thumb code with frame pointer makes chrome crash
3980 # early.
3981 '-marm',
3982 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3983 # The perf report sometimes incorrectly attributes
3984 # code from tail calls.
3985 '-fno-optimize-sibling-calls',
3986 ],
3987 'cflags!': [
3988 '-fomit-frame-pointer',
3989 ],
3990 }],
3991 ['clang==1', {
3992 'cflags!': [
3993 # Clang does not support the following options.
3994 '-mapcs-frame',
3995 '-mthumb-interwork',
3996 '-finline-limit=64',
3997 '-fno-tree-sra',
3998 '-fno-caller-saves',
3999 '-Wno-psabi',
4000 ],
4001 }],
4002 ['clang==1 and linux_use_bundled_gold==0', {
4003 'ldflags': [
4004 # Let clang find the ld.gold in the NDK.
4005 '--gcc-toolchain=<(android_toolchain)/..',
4006 ],
4007 }],
4008 ['asan==1', {
4009 'cflags': [
4010 '-marm', # Required for frame pointer based stack trac es.
4011 ],
4012 }],
4013 ],
4014 }],
4015 ['chromecast==1', {
4016 'cflags': [
4017 # We set arm_arch to "" so that -march compiler option
4018 # is not set. Otherwise a gcc bug that would complain
4019 # about it conflicting with '-mcpu=cortex-a9'. The flag
4020 # '-march=armv7-a' is actually redundant anyway because
4021 # it is enabled by default when we built the toolchain.
4022 # And using '-mcpu=cortex-a9' should be sufficient.
4023 '-mcpu=cortex-a9',
4024 '-funwind-tables',
4025 # Breakpad requires symbols with debugging information
4026 '-g',
4027 ],
4028 'ldflags': [
4029 # We want to statically link libstdc++/libgcc.
4030 '-static-libstdc++',
4031 '-static-libgcc',
4032 # Don't allow visible symbols from libraries that contain
4033 # assembly code with symbols that aren't hidden properly.
4034 # http://b/26390825
4035 '-Wl,--exclude-libs=libffmpeg.a',
4036 ],
4037 'cflags!': [
4038 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4039 # define their own cflags for arm builds that could
4040 # conflict with the flags we set here (e.g.
4041 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4042 '-march=armv7-a',
4043 '-mtune=cortex-a8',
4044 ],
4045 'target_conditions': [
4046 [ '_type=="executable" and OS!="android"', {
4047 # Statically link whole libstdc++ and libgcc in
4048 # executables to ensure only one copy at runtime.
4049 'ldflags': [
4050 # Note executables also get -static-stdlibc++/libgcc.
4051 # Despite including libstdc++/libgcc archives, we
4052 # still need to specify static linking for them in
4053 # order to prevent the executable from having a
4054 # dynamic dependency on them.
4055
4056 # Export stdlibc++ and libgcc symbols to force shlibs
4057 # to refer to these symbols from the executable.
4058 '-Wl,--export-dynamic',
4059
4060 '-lm', # stdlibc++ requires math.h
4061
4062 # In case we redefined stdlibc++ symbols
4063 # (e.g. tc_malloc)
4064 '-Wl,--allow-multiple-definition',
4065
4066 '-Wl,--whole-archive',
4067 '-l:libstdc++.a',
4068 '-l:libgcc.a',
4069 '-Wl,--no-whole-archive',
4070 ],
4071 }]
4072 ],
4073 }],
4074 ],
4075 }],
4076 ],
4077 }],
4078 ['target_arch=="arm64"', {
4079 'target_conditions': [
4080 ['_toolset=="target"', {
4081 'conditions': [
4082 ['OS=="android"', {
4083 'cflags!': [
4084 '-fstack-protector', # stack protector is always enabled on arm64.
4085 ],
4086 }],
4087 ['clang==1 and arm_arch!="" and OS!="android"', {
4088 'cflags': [
4089 '-target aarch64-linux-gnu',
4090 ],
4091 'ldflags': [
4092 '-target aarch64-linux-gnu',
4093 ],
4094 }],
4095 ],
4096 }],
4097 ],
4098 }],
4099 ['target_arch=="mipsel"', {
4100 'target_conditions': [
4101 ['_toolset=="target"', {
4102 'conditions': [
4103 ['mips_arch_variant=="r6"', {
4104 'conditions': [
4105 ['clang==1', {
4106 'conditions': [
4107 ['OS=="android"', {
4108 'cflags': [ '-target mipsel-linux-android', '-march= mipsel', '-mcpu=mips32r6', ],
4109 'ldflags': [ '-target mipsel-linux-android', ],
4110 }],
4111 ],
4112 }, { # clang==0
4113 'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
4114 }],
4115 ['clang==0 and OS=="android"', {
4116 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4117 }],
4118 ['mips_msa==1', {
4119 'cflags': ['-mmsa', '-mfp64', '-msched-weight', '-mload- store-pairs'],
4120 }],
4121 ],
4122 'cflags': [ '-mfp64', '-mno-odd-spreg' ],
4123 'ldflags': [ '-mfp64', '-mno-odd-spreg' ],
4124 }],
4125 ['mips_arch_variant=="r2"', {
4126 'conditions': [
4127 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4128 'cflags': ['-m<(mips_fpu_mode)'],
4129 }],
4130 ['clang==1', {
4131 'conditions': [
4132 ['OS=="android"', {
4133 'cflags': [ '-target mipsel-linux-android', '-march= mipsel', '-mcpu=mips32r2'],
4134 'ldflags': [ '-target mipsel-linux-android', ],
4135 }, {
4136 'cflags': [ '-target mipsel-linux-gnu', '-march=mips el', '-mcpu=mips32r2'],
4137 'ldflags': [ '-target mipsel-linux-gnu', ],
4138 }],
4139 ],
4140 }, { # clang==0
4141 'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
4142 }],
4143 ],
4144 }],
4145 ['mips_arch_variant=="r1"', {
4146 'conditions': [
4147 ['clang==1', {
4148 'conditions': [
4149 ['OS=="android"', {
4150 'cflags': [ '-target mipsel-linux-android', '-march= mipsel', '-mcpu=mips32'],
4151 'ldflags': [ '-target mipsel-linux-android', ],
4152 }, {
4153 'cflags': [ '-target mipsel-linux-gnu', '-march=mips el', '-mcpu=mips32'],
4154 'ldflags': [ '-target mipsel-linux-gnu', ],
4155 }],
4156 ],
4157 }, { # clang==0
4158 'cflags': ['-mips32', '-Wa,-mips32', ],
4159 }],
4160 ],
4161 }],
4162 ['clang==1', {
4163 'cflags!': [
4164 # Clang does not support the following options.
4165 '-finline-limit=64',
4166 ],
4167 # TODO(gordanac) Enable integrated-as.
4168 'cflags': [ '-fno-integrated-as' ],
4169 'conditions': [
4170 ['OS=="android"', {
4171 'cflags': [
4172 # Else /usr/bin/as gets picked up.
4173 '-B<(android_toolchain)',
4174 ],
4175 }],
4176 ],
4177 }],
4178 ['clang==1 and OS=="android"', {
4179 'ldflags': [
4180 # Let clang find the ld in the NDK.
4181 '--gcc-toolchain=<(android_toolchain)/..',
4182 ],
4183 }],
4184 ['mips_dsp_rev==1', {
4185 'cflags': ['-mdsp'],
4186 }],
4187 ['mips_dsp_rev==2', {
4188 'cflags': ['-mdspr2'],
4189 }],
4190 ],
4191 'cflags': [
4192 '-m<(mips_float_abi)-float'
4193 ],
4194 'ldflags': [
4195 '-Wl,--no-keep-memory'
4196 ],
4197 'cflags_cc': [
4198 '-Wno-uninitialized',
4199 ],
4200 }],
4201 ['_toolset=="target" and _type=="executable"', {
4202 'conditions': [
4203 ['OS=="linux"', {
4204 'ldflags': ['-pie'],
4205 }],
4206 ],
4207 }],
4208 ],
4209 }],
4210 ['target_arch=="mips64el"', {
4211 'target_conditions': [
4212 ['_toolset=="target"', {
4213 'conditions': [
4214 ['mips_arch_variant=="r6"', {
4215 'conditions': [
4216 ['clang==1', {
4217 'conditions': [
4218 ['OS=="android"', {
4219 'cflags': [ '-target mips64el-linux-android', '-marc h=mips64el', '-mcpu=mips64r6', ],
4220 'ldflags': [ '-target mips64el-linux-android', ],
4221 }],
4222 ],
4223 }, { # clang==0
4224 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4225 'ldflags': ['-mips64r6'],
4226 }],
4227 ['mips_msa==1', {
4228 'cflags': ['-mmsa', '-mfp64', '-msched-weight', '-mload- store-pairs'],
4229 }],
4230 ],
4231 }],
4232 ['mips_arch_variant=="r2"', {
4233 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4234 'ldflags': ['-mips64r2'],
4235 }],
4236 ['clang==1', {
4237 'cflags!': [
4238 # Clang does not support the following options.
4239 '-finline-limit=64',
4240 ],
4241 # TODO(gordanac) Enable integrated-as.
4242 'cflags': [ '-fno-integrated-as' ],
4243 'conditions': [
4244 ['OS=="android"', {
4245 'cflags': [
4246 # Else /usr/bin/as gets picked up.
4247 '-B<(android_toolchain)',
4248 ],
4249 }],
4250 ],
4251 }],
4252 ['clang==1 and OS=="android"', {
4253 'ldflags': [
4254 # Let clang find the ld in the NDK.
4255 '--gcc-toolchain=<(android_toolchain)/..',
4256 ],
4257 }],
4258 ],
4259
4260 'cflags_cc': [
4261 '-Wno-uninitialized',
4262 ],
4263 }],
4264 ],
4265 }],
4266 ['linux_fpic==1', {
4267 'cflags': [
4268 '-fPIC',
4269 ],
4270 'ldflags': [
4271 '-fPIC',
4272 ],
4273 }],
4274 ['sysroot!=""', {
4275 'target_conditions': [
4276 ['_toolset=="target"', {
4277 'cflags': [
4278 '--sysroot=<(sysroot)',
4279 ],
4280 'ldflags': [
4281 '--sysroot=<(sysroot)',
4282 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4283 ],
4284 }]]
4285 }],
4286 ['clang==1', {
4287 'cflags': [
4288 # See http://crbug.com/110262
4289 '-fcolor-diagnostics',
4290 ],
4291 'cflags_cc': [
4292 # gnu++11 instead of c++11 is needed because some code uses
4293 # typeof() (a GNU extension).
4294 # TODO(thakis): Eventually switch this to c++11 instead,
4295 # http://crbug.com/427584
4296 '-std=gnu++11',
4297 ],
4298 }],
4299 ['clang==1 and chromeos==1', {
4300 'cflags': [
4301 # TODO(thakis): Remove, http://crbug.com/263960
4302 '-Wno-reserved-user-defined-literal',
4303 ],
4304 }],
4305 ['clang==0 and host_clang==1', {
4306 'target_conditions': [
4307 ['_toolset=="host"', {
4308 'cflags_cc': [ '-std=gnu++11', ],
4309 }],
4310 ],
4311 }],
4312 ['clang==1 and clang_use_chrome_plugins==1', {
4313 'cflags': [
4314 '<@(clang_chrome_plugins_flags)',
4315 ],
4316 }],
4317 ['clang==1 and clang_load!=""', {
4318 'cflags': [
4319 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4320 ],
4321 }],
4322 ['clang==1 and clang_add_plugin!=""', {
4323 'cflags': [
4324 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4325 ],
4326 }],
4327 ['clang==1 and target_arch=="ia32"', {
4328 'cflags': [
4329 # Else building libyuv gives clang's register allocator issues,
4330 # see llvm.org/PR15798 / crbug.com/233709
4331 '-momit-leaf-frame-pointer',
4332 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4333 '-mstack-alignment=16',
4334 '-mstackrealign',
4335 ],
4336 }],
4337 # Common options for AddressSanitizer, LeakSanitizer,
4338 # ThreadSanitizer, MemorySanitizer and non-official CFI builds.
4339 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_securi ty==1 or ubsan_vptr==1 or '
4340 '(cfi_vptr==1 and buildtype!="Official")', {
4341 'target_conditions': [
4342 ['_toolset=="target"', {
4343 'cflags': [
4344 '-fno-omit-frame-pointer',
4345 '-gline-tables-only',
4346 ],
4347 'cflags!': [
4348 '-fomit-frame-pointer',
4349 ],
4350 }],
4351 ],
4352 }],
4353 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4354 'target_conditions': [
4355 ['_toolset=="target"', {
4356 'ldflags!': [
4357 # Functions interposed by the sanitizers can make ld think
4358 # that some libraries aren't needed when they actually are,
4359 # http://crbug.com/234010. As workaround, disable --as-needed.
4360 '-Wl,--as-needed',
4361 ],
4362 'defines': [
4363 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4364 'MEMORY_SANITIZER_INITIAL_SIZE',
4365 ],
4366 }],
4367 ],
4368 }],
4369 ['asan==1', {
4370 'target_conditions': [
4371 ['_toolset=="target"', {
4372 'cflags': [
4373 '-fsanitize=address',
4374 # TODO(eugenis): Re-enable. http://crbug.com/427202
4375 #'-fsanitize-blacklist=<(asan_blacklist)',
4376 ],
4377 'ldflags': [
4378 '-fsanitize=address',
4379 ],
4380 }],
4381 ],
4382 'conditions': [
4383 ['OS=="mac"', {
4384 'cflags': [
4385 '-mllvm -asan-globals=0', # http://crbug.com/352073
4386 ],
4387 }],
4388 ],
4389 }],
4390 ['ubsan==1', {
4391 'target_conditions': [
4392 ['_toolset=="target"', {
4393 'conditions': [
4394 ['chromecast==0', {
4395 'cflags': [
4396 # Employ the experimental PBQP register allocator to avoid
4397 # slow compilation on files with too many basic blocks.
4398 # See http://crbug.com/426271.
4399 '-mllvm -regalloc=pbqp',
4400 # Speculatively use coalescing to slightly improve the cod e
4401 # generated by PBQP regallocator. May increase compile tim e.
4402 '-mllvm -pbqp-coalescing',
4403 ],
4404 }],
4405 ],
4406 'cflags': [
4407 # FIXME: work on enabling more flags and getting rid of false
4408 # positives. http://crbug.com/174801.
4409 '-fsanitize=bounds',
4410 '-fsanitize=float-divide-by-zero',
4411 '-fsanitize=integer-divide-by-zero',
4412 '-fsanitize=null',
4413 '-fsanitize=object-size',
4414 '-fsanitize=return',
4415 '-fsanitize=returns-nonnull-attribute',
4416 '-fsanitize=shift-exponent',
4417 '-fsanitize=signed-integer-overflow',
4418 '-fsanitize=unreachable',
4419 '-fsanitize=vla-bound',
4420 '-fsanitize-blacklist=<(ubsan_blacklist)',
4421 ],
4422 'cflags_cc!': [
4423 '-fno-rtti',
4424 ],
4425 'cflags!': [
4426 '-fno-rtti',
4427 ],
4428 'ldflags': [
4429 '-fsanitize=undefined',
4430 ],
4431 'defines': [
4432 'UNDEFINED_SANITIZER',
4433 ],
4434 }],
4435 ],
4436 }],
4437 ['ubsan_security==1', {
4438 'target_conditions': [
4439 ['_toolset=="target"', {
4440 'cflags': [
4441 '-fsanitize=signed-integer-overflow,shift,vptr',
4442 '-fsanitize-blacklist=<(ubsan_security_blacklist)',
4443 ],
4444 'cflags_cc!': [
4445 '-fno-rtti',
4446 ],
4447 'cflags!': [
4448 '-fno-rtti',
4449 ],
4450 'ldflags': [
4451 '-fsanitize=signed-integer-overflow,shift,vptr',
4452 ],
4453 'defines': [
4454 'UNDEFINED_SANITIZER',
4455 ],
4456 }],
4457 ],
4458 }],
4459 ['ubsan_vptr==1', {
4460 'target_conditions': [
4461 ['_toolset=="target"', {
4462 'cflags': [
4463 '-fsanitize=vptr',
4464 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4465 ],
4466 'cflags_cc!': [
4467 '-fno-rtti',
4468 ],
4469 'cflags!': [
4470 '-fno-rtti',
4471 ],
4472 'ldflags': [
4473 '-fsanitize=vptr',
4474 ],
4475 'defines': [
4476 'UNDEFINED_SANITIZER',
4477 ],
4478 }],
4479 ],
4480 }],
4481 ['sanitizer_coverage!=""', {
4482 'target_conditions': [
4483 ['_toolset=="target"', {
4484 'cflags': [
4485 '-fsanitize-coverage=<(sanitizer_coverage)',
4486 ],
4487 'defines': [
4488 'SANITIZER_COVERAGE',
4489 ],
4490 }],
4491 ],
4492 }],
4493 ['sanitizer_coverage!="" and target_arch=="arm"', {
4494 'target_conditions': [
4495 ['_toolset=="target"', {
4496 'cflags': [
4497 '-mllvm -sanitizer-coverage-block-threshold=0', # http://crbu g.com/517105
4498 ],
4499 }],
4500 ],
4501 }],
4502 ['asan_field_padding!=0', {
4503 'target_conditions': [
4504 ['_toolset=="target"', {
4505 'cflags': [
4506 '-fsanitize-address-field-padding=<(asan_field_padding)',
4507 ],
4508 }],
4509 ],
4510 }],
4511 ['lsan==1', {
4512 'target_conditions': [
4513 ['_toolset=="target"', {
4514 'cflags': [
4515 '-fsanitize=leak',
4516 ],
4517 'ldflags': [
4518 '-fsanitize=leak',
4519 ],
4520 'defines': [
4521 'LEAK_SANITIZER',
4522 'WTF_USE_LEAK_SANITIZER=1',
4523 ],
4524 }],
4525 ],
4526 }],
4527 ['tsan==1', {
4528 'target_conditions': [
4529 ['_toolset=="target"', {
4530 'cflags': [
4531 '-fsanitize=thread',
4532 '-fsanitize-blacklist=<(tsan_blacklist)',
4533 ],
4534 'ldflags': [
4535 '-fsanitize=thread',
4536 ],
4537 'defines': [
4538 'THREAD_SANITIZER',
4539 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4540 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4541 ],
4542 }],
4543 ],
4544 }],
4545 ['msan==1', {
4546 'target_conditions': [
4547 ['_toolset=="target"', {
4548 'cflags': [
4549 '-fsanitize=memory',
4550 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4551 '-fsanitize-blacklist=<(msan_blacklist)',
4552 ],
4553 'ldflags': [
4554 '-fsanitize=memory',
4555 ],
4556 'defines': [
4557 'MEMORY_SANITIZER',
4558 ],
4559 }],
4560 ],
4561 }],
4562 ['use_instrumented_libraries==1', {
4563 'dependencies': [
4564 '<(DEPTH)/third_party/instrumented_libraries/instrumented_librarie s.gyp:instrumented_libraries',
4565 ],
4566 }],
4567 ['use_prebuilt_instrumented_libraries==1', {
4568 'dependencies': [
4569 '<(DEPTH)/third_party/instrumented_libraries/instrumented_librarie s.gyp:prebuilt_instrumented_libraries',
4570 ],
4571 }],
4572 ['use_custom_libcxx==1', {
4573 'dependencies': [
4574 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4575 ],
4576 }],
4577 ['order_profiling!=0 and OS=="android"', {
4578 'target_conditions' : [
4579 ['_toolset=="target"', {
4580 'cflags': ['-finstrument-functions'],
4581 'defines': ['CYGPROFILE_INSTRUMENTATION'],
4582 }],
4583 ],
4584 }],
4585 # Clang doesn't understand -finstrument-functions-exclude-file-list=.
4586 ['order_profiling!=0 and OS=="android" and clang==0', {
4587 'target_conditions' : [
4588 ['_toolset=="target"', {
4589 'cflags': [
4590 # Allow mmx intrinsics to inline, so that the
4591 # compiler can expand the intrinsics.
4592 '-finstrument-functions-exclude-file-list=mmintrin.h',
4593 # Avoids errors with current NDK:
4594 # "third_party/android_tools/ndk/toolchains/arm-linux-androide abi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/include/a rm_neon.h:3426:3: error: argument must be a constant"
4595 '-finstrument-functions-exclude-file-list=arm_neon.h',
4596 ],
4597 }],
4598 ],
4599 }],
4600 ['linux_dump_symbols==1', {
4601 'cflags': [ '-g' ],
4602 'conditions': [
4603 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0' , {
4604 'target_conditions': [
4605 ['_toolset=="target"', {
4606 'ldflags': [
4607 # Attempt to use less memory to prevent the linker from
4608 # running out of address space. Considering installing a
4609 # 64-bit kernel and switching to a 64-bit linker.
4610 '-Wl,--no-keep-memory',
4611 ],
4612 }],
4613 ],
4614 }],
4615 ],
4616 }],
4617 ['use_allocator!="tcmalloc"', {
4618 'defines': ['NO_TCMALLOC'],
4619 }],
4620 ['linux_use_gold_flags==1', {
4621 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4622 # selection.
4623 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Option s.html
4624 'ldflags': [ '-fuse-ld=gold', ],
4625
4626 'target_conditions': [
4627 ['_toolset=="target"', {
4628 'conditions': [
4629 # TODO(thestig): Enable this for disabled cases.
4630 [ 'linux_use_bundled_binutils==1', {
4631 'ldflags': [
4632 # Experimentation found that using four linking threads
4633 # saved ~20% of link time.
4634 # https://groups.google.com/a/chromium.org/group/chromium- dev/browse_thread/thread/281527606915bb36
4635 # Only apply this to the target linker, since the host
4636 # linker might not be gold, but isn't used much anyway.
4637 '-Wl,--threads',
4638 '-Wl,--thread-count=4',
4639 ],
4640 }],
4641 # TODO(thestig): Enable this for disabled cases.
4642 [ 'buildtype!="Official" and chromeos==0 and release_valgrind_ build==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_ security==0 and ubsan_vptr==0', {
4643 'ldflags': [
4644 '-Wl,--detect-odr-violations',
4645 ],
4646 }],
4647 ],
4648 }],
4649 ],
4650 'conditions': [
4651 ['release_valgrind_build==0 and order_profiling==0 and asan==0 and msan==0 and lsan==0 and tsan==0', {
4652 'target_conditions': [
4653 ['_toolset=="target"', {
4654 'ldflags': [
4655 '-Wl,--icf=<(gold_icf_level)',
4656 ],
4657 }],
4658 ],
4659 }],
4660 ],
4661 }],
4662 ['linux_use_bundled_binutils==1', {
4663 'cflags': [
4664 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4665 ],
4666 }],
4667 ['linux_use_bundled_gold==1 and '
4668 'not (clang==0 and (use_lto==1 or use_lto_o2==1))', {
4669 # Put our binutils, which contains gold in the search path. We pass
4670 # the path to gold to the compiler. gyp leaves unspecified what the
4671 # cwd is when running the compiler, so the normal gyp path-munging
4672 # fails us. This hack gets the right path.
4673 #
4674 # Disabled when using GCC LTO because GCC also uses the -B search
4675 # path at link time to find "as", and our bundled "as" can only
4676 # target x86.
4677 'ldflags': [
4678 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4679 ],
4680 }],
4681 # Some binutils 2.23 releases may or may not have new dtags enabled,
4682 # but they are all compatible with --disable-new-dtags,
4683 # because the new dynamic tags are not created by default.
4684 ['binutils_version>=223', {
4685 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4686 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4687 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4688 # inside this file to allow usage of --no-as-needed and removal of
4689 # this flag.
4690 'ldflags': [
4691 '-Wl,--disable-new-dtags',
4692 ],
4693 }],
4694 ['clang==0', {
4695 'target_conditions': [
4696 ['_toolset=="target"', {
4697 'cflags_cc': [
4698 '-std=gnu++11',
4699 # See comment for -Wno-c++11-narrowing.
4700 '-Wno-narrowing',
4701 ],
4702 }],
4703 ],
4704 }],
4705 ['clang==0 and host_clang==0', {
4706 'target_conditions': [
4707 ['_toolset=="host"', {
4708 'cflags_cc': [
4709 '-std=gnu++11',
4710 # See comment for -Wno-c++11-narrowing.
4711 '-Wno-narrowing',
4712 ],
4713 }],
4714 ],
4715 }],
4716 ['clang==0 and chromeos==1', {
4717 'target_conditions': [
4718 ['_toolset=="target"', {
4719 'cflags_cc': [
4720 # TODO(thakis): Remove, http://crbug.com/263960
4721 '-Wno-literal-suffix',
4722 ],
4723 }],
4724 ],
4725 }],
4726 ['clang==0 and host_clang==0 and chromeos==1', {
4727 'target_conditions': [
4728 ['_toolset=="host"', {
4729 'cflags_cc': [
4730 # TODO(thakis): Remove, http://crbug.com/263960
4731 '-Wno-literal-suffix',
4732 ],
4733 }],
4734 ],
4735 }],
4736 ],
4737 },
4738 }],
4739 # *BSD-specific options; note that most *BSD options are set above,
4740 # with Linux.
4741 ['OS=="openbsd" or OS=="freebsd"', {
4742 'target_defaults': {
4743 'ldflags': [
4744 '-Wl,--no-keep-memory',
4745 ],
4746 },
4747 }],
4748 # Android-specific options; note that most are set above with Linux.
4749 ['OS=="android"', {
4750 'variables': {
4751 # Placing this variable here prevents from forking libvpx, used
4752 # by remoting. Remoting is off, so it needn't built,
4753 # so forking it's deps seems like overkill.
4754 # But this variable need defined to properly run gyp.
4755 # A proper solution is to have an OS==android conditional
4756 # in third_party/libvpx/libvpx.gyp to define it.
4757 'libvpx_path': 'lib/linux/arm',
4758 },
4759 'target_defaults': {
4760 'variables': {
4761 'release_extra_cflags%': '',
4762 'conditions': [
4763 # If we're using the components build, append "cr" to all shared
4764 # libraries to avoid naming collisions with android system library
4765 # versions with the same name (e.g. skia, icu).
4766 ['component=="shared_library"', {
4767 'android_product_extension': 'cr.so',
4768 }, {
4769 'android_product_extension': 'so',
4770 } ],
4771 ],
4772 },
4773 'target_conditions': [
4774 ['_type=="shared_library"', {
4775 'product_extension': '<(android_product_extension)',
4776 }],
4777
4778 # Settings for building device targets using Android's toolchain.
4779 # These are based on the setup.mk file from the Android NDK.
4780 #
4781 # The NDK Android executable link step looks as follows:
4782 # $LDFLAGS
4783 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4784 # $(PRIVATE_OBJECTS) <-- The .o that we built
4785 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4786 # $(TARGET_LIBGCC) <-- libgcc.a
4787 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4788 # $(PRIVATE_LDLIBS) <-- System .so
4789 # $(TARGET_CRTEND_O) <-- crtend.o
4790 #
4791 # For now the above are approximated for executables by adding
4792 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4793 # of 'libraries'.
4794 #
4795 # The NDK Android shared library link step looks as follows:
4796 # $LDFLAGS
4797 # $(PRIVATE_OBJECTS) <-- The .o that we built
4798 # -l,--whole-archive
4799 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4800 # -l,--no-whole-archive
4801 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4802 # $(TARGET_LIBGCC) <-- libgcc.a
4803 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4804 # $(PRIVATE_LDLIBS) <-- System .so
4805 #
4806 # For now, assume that whole static libraries are not needed.
4807 #
4808 # For both executables and shared libraries, add the proper
4809 # libgcc.a to the start of libraries which puts it in the
4810 # proper spot after .o and .a files get linked in.
4811 #
4812 # TODO: The proper thing to do longer-tem would be proper gyp
4813 # support for a custom link command line.
4814 ['_toolset=="target"', {
4815 'cflags!': [
4816 '-pthread', # Not supported by Android toolchain.
4817 ],
4818 'cflags': [
4819 '-ffunction-sections',
4820 '-funwind-tables',
4821 '-g',
4822 '-fstack-protector',
4823 '-fno-short-enums',
4824 '-finline-limit=64',
4825 '<@(release_extra_cflags)',
4826 '--sysroot=<(android_ndk_sysroot)',
4827 ],
4828 'cflags_cc': [
4829 # NOTE: The libc++ header include paths below are specified in
4830 # cflags rather than include_dirs because they need to come
4831 # after include_dirs.
4832 # The include ordering here is important; change with caution.
4833 '-isystem<(android_libcpp_include)',
4834 '-isystem<(android_ndk_root)/sources/cxx-stl/llvm-libc++abi/libcxx abi/include',
4835 '-isystem<(android_ndk_root)/sources/android/support/include',
4836 ],
4837 'defines': [
4838 'ANDROID',
4839 '__GNU_SOURCE=1', # Necessary for clone()
4840 # The NDK has these things, but doesn't define the constants
4841 # to say that it does. Define them here instead.
4842 'HAVE_SYS_UIO_H',
4843 'ANDROID_NDK_VERSION=<(android_ndk_version)',
4844 ],
4845 'ldflags!': [
4846 '-pthread', # Not supported by Android toolchain.
4847 ],
4848 'ldflags': [
4849 '-Wl,--build-id=sha1',
4850 '-Wl,--no-undefined',
4851 '--sysroot=<(android_ndk_sysroot)',
4852 '-nostdlib',
4853 '-L<(android_libcpp_libs_dir)',
4854 # Don't allow visible symbols from libgcc or libc++ to be
4855 # re-exported.
4856 '-Wl,--exclude-libs=libgcc.a',
4857 '-Wl,--exclude-libs=libc++_static.a',
4858 # Don't allow visible symbols from libraries that contain
4859 # assembly code with symbols that aren't hidden properly.
4860 # http://crbug.com/448386
4861 '-Wl,--exclude-libs=libcommon_audio.a',
4862 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4863 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4864 '-Wl,--exclude-libs=libiSACFix.a',
4865 '-Wl,--exclude-libs=libisac_neon.a',
4866 '-Wl,--exclude-libs=libopus.a',
4867 '-Wl,--exclude-libs=libvpx.a',
4868 ],
4869 'libraries': [
4870 '-l<(android_libcpp_library)',
4871 '-latomic',
4872 # Manually link the libgcc.a that the cross compiler uses.
4873 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4874 '-lc',
4875 '-ldl',
4876 '-lm',
4877 ],
4878 'conditions': [
4879 ['component=="static_library"', {
4880 'target_conditions': [
4881 ['use_native_jni_exports==0', {
4882 # Use a linker version script to strip JNI exports from
4883 # binaries which have not specifically asked to use them.
4884 'ldflags': [
4885 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/andr oid/android_no_jni_exports.lst',
4886 ],
4887 }],
4888 ],
4889 }],
4890 ['clang==1', {
4891 'libraries!': [
4892 # Clang with libc++ does not require an explicit atomic
4893 # library reference.
4894 '-latomic',
4895 ],
4896 'cflags': [
4897 # Work around incompatibilities between bionic and clang
4898 # headers.
4899 '-D__compiler_offsetof=__builtin_offsetof',
4900 '-Dnan=__builtin_nan',
4901 ],
4902 'cflags!': [
4903 # Clang does not support the following options.
4904 '-finline-limit=64',
4905 ],
4906 'conditions': [
4907 ['target_arch=="arm"', {
4908 'cflags': [
4909 '-target arm-linux-androideabi',
4910 ],
4911 'ldflags': [
4912 '-target arm-linux-androideabi',
4913 ],
4914 }],
4915 ['target_arch=="ia32"', {
4916 'cflags': [
4917 '-target i686-linux-androideabi',
4918 ],
4919 'ldflags': [
4920 '-target i686-linux-androideabi',
4921 ],
4922 }],
4923 # Place holder for arm64 support, not tested.
4924 # TODO: Enable clang support for Android Arm64. http://crbug.c om/539781
4925 ['target_arch=="arm64"', {
4926 'cflags': [
4927 '-target aarch64-linux-androideabi',
4928 ],
4929 'ldflags': [
4930 '-target aarch64-linux-androideabi',
4931 ],
4932 }],
4933 # Place holder for x64 support, not tested.
4934 # TODO: Enable clang support for Android x64. http://crbug.com /539781
4935 ['target_arch=="x64"', {
4936 'cflags': [
4937 '-target x86_64-linux-androideabi',
4938 ],
4939 'ldflags': [
4940 '-target x86_64-linux-androideabi',
4941 ],
4942 }],
4943 ],
4944 }],
4945 ['asan==1', {
4946 'cflags': [
4947 # Android build relies on -Wl,--gc-sections removing
4948 # unreachable code. ASan instrumentation for globals inhibits
4949 # this and results in a library with unresolvable relocations.
4950 # TODO(eugenis): find a way to reenable this.
4951 '-mllvm -asan-globals=0',
4952 ],
4953 }],
4954 ['target_arch == "arm" and order_profiling==0', {
4955 'ldflags': [
4956 # Enable identical code folding to reduce size.
4957 '-Wl,--icf=<(gold_icf_level)',
4958 ],
4959 }],
4960 ['target_arch=="ia32"', {
4961 # The x86 toolchain currently has problems with stack-protector.
4962 'cflags!': [
4963 '-fstack-protector',
4964 ],
4965 'cflags': [
4966 '-fno-stack-protector',
4967 ],
4968 }],
4969 ],
4970 'target_conditions': [
4971 ['_type=="executable"', {
4972 'cflags': [
4973 '-fPIE',
4974 ],
4975 'ldflags': [
4976 '-Bdynamic',
4977 '-Wl,--gc-sections',
4978 '-Wl,-z,nocopyreloc',
4979 '-pie',
4980 # crtbegin_dynamic.o should be the last item in ldflags.
4981 '<(android_ndk_lib)/crtbegin_dynamic.o',
4982 ],
4983 'libraries': [
4984 # crtend_android.o needs to be the last item in libraries.
4985 # Do not add any libraries after this!
4986 '<(android_ndk_lib)/crtend_android.o',
4987 ],
4988 }],
4989 ['_type=="shared_library" or _type=="loadable_module"', {
4990 'ldflags': [
4991 '-Wl,-shared,-Bsymbolic',
4992 # crtbegin_so.o should be the last item in ldflags.
4993 '<(android_ndk_lib)/crtbegin_so.o',
4994 ],
4995 'libraries': [
4996 # crtend_so.o needs to be the last item in libraries.
4997 # Do not add any libraries after this!
4998 '<(android_ndk_lib)/crtend_so.o',
4999 ],
5000 }],
5001 ],
5002 }],
5003 # Settings for building host targets using the system toolchain.
5004 ['_toolset=="host"', {
5005 'cflags!': [
5006 # Due to issues in Clang build system, using ASan on 32-bit
5007 # binaries on x86_64 host is problematic.
5008 # TODO(eugenis): re-enable.
5009 '-fsanitize=address',
5010 ],
5011 'ldflags!': [
5012 '-fsanitize=address',
5013 '-Wl,-z,noexecstack',
5014 '-Wl,--gc-sections',
5015 '-Wl,-O1',
5016 '-Wl,--as-needed',
5017 '-Wl,--warn-shared-textrel',
5018 '-Wl,--fatal-warnings',
5019 ],
5020 }],
5021 # Settings for building host targets on mac.
5022 ['_toolset=="host" and host_os=="mac"', {
5023 'ldflags!': [
5024 '-Wl,-z,now',
5025 '-Wl,-z,relro',
5026 ],
5027 }],
5028 ],
5029 },
5030 }],
5031 ['OS=="solaris"', {
5032 'cflags!': ['-fvisibility=hidden'],
5033 'cflags_cc!': ['-fvisibility-inlines-hidden'],
5034 }],
5035 ['OS=="mac" or OS=="ios"', {
5036 'target_defaults': {
5037 'mac_bundle': 0,
5038 'xcode_settings': {
5039 'ALWAYS_SEARCH_USER_PATHS': 'NO',
5040 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
5041 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
5042 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
5043 # Warn if automatic synthesis is triggered with
5044 # the -Wobjc-missing-property-synthesis flag.
5045 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
5046 'COPY_PHASE_STRIP': 'NO',
5047 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
5048 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
5049 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
5050 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
5051 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
5052 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
5053 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
5054 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
5055 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
5056 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
5057 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
5058 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
5059 'USE_HEADERMAP': 'NO',
5060 'WARNING_CFLAGS': [
5061 '-Wall',
5062 '-Wextra',
5063 # Don't warn about unused function parameters.
5064 '-Wno-unused-parameter',
5065 # Don't warn about the "struct foo f = {0};" initialization
5066 # pattern.
5067 '-Wno-missing-field-initializers',
5068 # This warns on selectors from Cocoa headers (-length, -set).
5069 # cfe-dev is currently discussing the merits of this warning.
5070 # TODO(thakis): Reevaluate what to do with this, based on the
5071 # cfe-dev discussion.
5072 '-Wno-selector-type-mismatch',
5073 ],
5074 'conditions': [
5075 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
5076 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
5077 ],
5078 ['clang==1', {
5079 'OTHER_CFLAGS': [
5080 # See http://crbug.com/110262
5081 '-fcolor-diagnostics',
5082 ],
5083 }],
5084 # Note that the prebuilt Clang binaries should not be used for iOS
5085 # development except for ASan builds.
5086 ['clang_xcode==0', {
5087 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
5088 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
5089 }],
5090 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
5091 'OTHER_CFLAGS': [
5092 '<@(clang_chrome_plugins_flags)',
5093 ],
5094 }],
5095 ['clang==1 and clang_xcode==0 and clang_load!=""', {
5096 'OTHER_CFLAGS': [
5097 '-Xclang', '-load', '-Xclang', '<(clang_load)',
5098 ],
5099 }],
5100 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
5101 'OTHER_CFLAGS': [
5102 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
5103 ],
5104 }],
5105 ],
5106 },
5107 'conditions': [
5108 ['clang==1', {
5109 'variables': {
5110 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
5111 },
5112 }],
5113 ['asan==1', {
5114 'xcode_settings': {
5115 'OTHER_CFLAGS': [
5116 '-fsanitize=address',
5117 '-mllvm -asan-globals=0', # http://crbug.com/352073
5118 '-gline-tables-only',
5119 ],
5120 },
5121 }],
5122 ['sanitizer_coverage!=""', {
5123 'target_conditions': [
5124 ['_toolset=="target"', {
5125 'cflags': [
5126 '-fsanitize-coverage=<(sanitizer_coverage)',
5127 ],
5128 'defines': [
5129 'SANITIZER_COVERAGE',
5130 ],
5131 }],
5132 ],
5133 }],
5134 ],
5135 'target_conditions': [
5136 ['_type!="static_library"', {
5137 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5138 'conditions': [
5139 ['asan==1', {
5140 'xcode_settings': {
5141 'OTHER_LDFLAGS': [
5142 '-fsanitize=address',
5143 ],
5144 },
5145 }],
5146 ['mac_write_linker_maps==1', {
5147 'xcode_settings': {
5148 'OTHER_LDFLAGS': [
5149 '-Wl,-map,>(_target_name).map',
5150 ],
5151 },
5152 }],
5153 ],
5154 }],
5155 ['_mac_bundle', {
5156 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5157 'target_conditions': [
5158 ['_type=="executable"', {
5159 'conditions': [
5160 ['asan==1', {
5161 'postbuilds': [
5162 {
5163 'variables': {
5164 # Define copy_asan_dylib_path in a variable ending in
5165 # _path so that gyp understands it's a path and
5166 # performs proper relativization during dict merging.
5167 'copy_asan_dylib_path':
5168 'mac/copy_asan_runtime_dylib.sh',
5169 },
5170 'postbuild_name': 'Copy ASan runtime dylib',
5171 'action': [
5172 '<(copy_asan_dylib_path)',
5173 ],
5174 },
5175 ],
5176 }],
5177 ],
5178 }],
5179 ],
5180 }],
5181 ], # target_conditions
5182 }, # target_defaults
5183 }], # OS=="mac" or OS=="ios"
5184 ['OS=="mac"', {
5185 'target_defaults': {
5186 'defines': [
5187 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5188 # with common names, like 'check', 'require', and 'verify'.
5189 # (Included by system header. Also exists on iOS but not included.)
5190 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/ AssertMacros.h
5191 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5192 ],
5193 'variables': {
5194 # These should end with %, but there seems to be a bug with % in
5195 # variables that are intended to be set to different values in
5196 # different targets, like these.
5197 # Strip debugging symbols from the target.
5198 'mac_strip': '<(mac_strip_release)',
5199 'conditions': [
5200 ['asan==1', {
5201 'conditions': [
5202 ['mac_want_real_dsym=="default"', {
5203 'mac_real_dsym': 1,
5204 }, {
5205 'mac_real_dsym': '<(mac_want_real_dsym)'
5206 }],
5207 ],
5208 }, {
5209 'conditions': [
5210 ['mac_want_real_dsym=="default"', {
5211 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5212 }, {
5213 'mac_real_dsym': '<(mac_want_real_dsym)'
5214 }],
5215 ],
5216 }],
5217 ],
5218 },
5219 'configurations': {
5220 'Release_Base': {
5221 'conditions': [
5222 ['branding=="Chrome" and buildtype=="Official"', {
5223 'xcode_settings': {
5224 'OTHER_CFLAGS': [
5225 # The Google Chrome Framework dSYM generated by dsymutil has
5226 # grown larger than 4GB, which dsymutil can't handle. Reduce
5227 # the amount of debug symbols.
5228 '-fno-standalone-debug', # See http://crbug.com/479841
5229 ]
5230 },
5231 }],
5232 ],
5233 }, # configuration "Release"
5234 }, # configurations
5235 'xcode_settings': {
5236 # Tell the compiler to use libc++'s headers and the linker to link
5237 # against libc++. The latter part normally requires OS X 10.7,
5238 # but we still support running on 10.6. How does this work? Two
5239 # parts:
5240 # 1. Chromium's clang doesn't error on -mmacosx-version-min=10.6
5241 # combined with -stdlib=libc++ (it normally silently produced a
5242 # binary that doesn't run on 10.6)
5243 # 2. Further down, library_dirs is set to
5244 # third_party/libc++-static, which contains a static
5245 # libc++.a library. The linker then links against that instead
5246 # of against /usr/lib/libc++.dylib when it sees the -lc++ flag
5247 # added by the driver.
5248 #
5249 # In component builds, just link to the system libc++. This has
5250 # the effect of making everything depend on libc++, which means
5251 # component-build binaries won't run on 10.6 (no libc++ there),
5252 # but for a developer-only configuration that's ok. (We don't
5253 # want to raise the deployment target yet so that official and
5254 # dev builds have the same deployment target. This affects
5255 # things like which functions are considered deprecated.)
5256 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5257
5258 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5259 # (Equivalent to -fPIC)
5260 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5261 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5262 # Keep pch files below xcodebuild/.
5263 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHe aders',
5264 'OTHER_CFLAGS': [
5265 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5266 # xcode_setting, but not until all downstream projects' mac bots are
5267 # using xcode >= 4.6, because that's when the default value of the
5268 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5269 # setting is a no-op as far as xcode is concerned, but the compiler
5270 # behaves differently based on whether -fno-strict-aliasing is
5271 # specified or not.
5272 '-fno-strict-aliasing', # See http://crbug.com/32204.
5273 ],
5274 },
5275 'target_conditions': [
5276 ['>(nacl_untrusted_build)==0 and component=="static_library"', {
5277 # See the comment for CLANG_CXX_LIBRARY above for what this does.
5278 # The NaCl toolchains have their own toolchain and don't need this.
5279 # ASan requires 10.7+ and clang implicitly adds -lc++abi in ASan
5280 # mode. Our libc++.a contains both libc++ and libc++abi in one
5281 # library, so it doesn't work in that mode.
5282 'conditions': [
5283 ['asan==0', {
5284 'library_dirs': [ '<(DEPTH)/third_party/libc++-static' ],
5285 }],
5286 ],
5287 }],
5288 ['_type=="executable"', {
5289 # Turn on position-independence (ASLR) for executables. When
5290 # PIE is on for the Chrome executables, the framework will
5291 # also be subject to ASLR.
5292 'xcode_settings': {
5293 'OTHER_LDFLAGS': [
5294 '-Wl,-pie', # Position-independent executable (MH_PIE)
5295 ],
5296 },
5297 }],
5298 ['(_type=="executable" or _type=="shared_library" or \
5299 _type=="loadable_module") and mac_strip!=0', {
5300 'target_conditions': [
5301 ['mac_real_dsym == 1', {
5302 # To get a real .dSYM bundle produced by dsymutil, set the
5303 # debug information format to dwarf-with-dsym. Since
5304 # strip_from_xcode will not be used, set Xcode to do the
5305 # stripping as well.
5306 'configurations': {
5307 'Release_Base': {
5308 'xcode_settings': {
5309 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5310 'DEPLOYMENT_POSTPROCESSING': 'YES',
5311 'STRIP_INSTALLED_PRODUCT': 'YES',
5312 'conditions': [
5313 # Only strip non-ASan builds.
5314 ['asan==0', {
5315 'target_conditions': [
5316 ['_type=="shared_library" or _type=="loadable_module "', {
5317 # The Xcode default is to strip debugging symbols
5318 # only (-S). Local symbols should be stripped as
5319 # well, which will be handled by -x. Xcode will
5320 # continue to insert -S when stripping even when
5321 # additional flags are added with STRIPFLAGS.
5322 'STRIPFLAGS': '-x',
5323 }], # _type=="shared_library" or _type=="loadable_m odule"
5324 ], # target_conditions
5325 }, { # asan != 0
5326 'STRIPFLAGS': '-S',
5327 }],
5328 ],
5329 }, # xcode_settings
5330 }, # configuration "Release"
5331 }, # configurations
5332 }, { # mac_real_dsym != 1
5333 # To get a fast fake .dSYM bundle, use a post-build step to
5334 # produce the .dSYM and strip the executable. strip_from_xcode
5335 # only operates in the Release configuration.
5336 'postbuilds': [
5337 {
5338 'variables': {
5339 # Define strip_from_xcode in a variable ending in _path
5340 # so that gyp understands it's a path and performs proper
5341 # relativization during dict merging.
5342 'strip_from_xcode_path': 'mac/strip_from_xcode',
5343 },
5344 'postbuild_name': 'Strip If Needed',
5345 'action': ['<(strip_from_xcode_path)'],
5346 },
5347 ], # postbuilds
5348 }], # mac_real_dsym
5349 ], # target_conditions
5350 }], # (_type=="executable" or _type=="shared_library" or
5351 # _type=="loadable_module") and mac_strip!=0
5352 ], # target_conditions
5353 }, # target_defaults
5354 }], # OS=="mac"
5355 ['OS=="ios"', {
5356 'target_defaults': {
5357 'xcode_settings' : {
5358 'ENABLE_BITCODE': 'NO',
5359 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5360
5361 'conditions': [
5362 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5363 # additional flag to suppress the "unknown compiler option" error.
5364 # Restrict this flag to builds that are either compiling with Xcode
5365 # or compiling with Xcode's Clang. This will allow Ninja builds to
5366 # continue failing on unknown compiler options.
5367 # TODO(rohitrao): This flag is temporary and should be removed as
5368 # soon as the iOS bots are updated to use Xcode 5.1.
5369 ['clang_xcode==1', {
5370 'WARNING_CFLAGS': [
5371 '-Wno-unknown-warning-option',
5372 # It's not possible to achieve nullability completeness before
5373 # all builders are running Xcode 7. crbug.com/499809
5374 '-Wno-nullability-completeness',
5375 ],
5376 'OTHER_CPLUSPLUSFLAGS': [
5377 '$(inherited)',
5378 # TODO(ios): Remove once Xcode's libc++ has LLVM r256325
5379 '-isystem <!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Relea se+Asserts/include/c++/v1',
5380 ],
5381 }],
5382
5383 # Limit the valid architectures depending on "target_subarch".
5384 # This need to include the "arm" architectures but also the "x86"
5385 # ones (they are used when building for the simulator).
5386 ['target_subarch=="arm32"', {
5387 'VALID_ARCHS': ['armv7', 'i386'],
5388 }],
5389 ['target_subarch=="arm64"', {
5390 'VALID_ARCHS': ['arm64', 'x86_64'],
5391 }],
5392 ['target_subarch=="both"', {
5393 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5394 }],
5395 ],
5396 },
5397 'target_conditions': [
5398 ['_toolset=="host"', {
5399 'xcode_settings': {
5400 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5401 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5402 'VALID_ARCHS': [
5403 'x86_64',
5404 ],
5405 'ARCHS': [
5406 'x86_64',
5407 ],
5408 },
5409 }],
5410 ['_toolset=="target"', {
5411 'xcode_settings': {
5412 # This section should be for overriding host settings. But,
5413 # since we can't negate the iphone deployment target above, we
5414 # instead set it here for target only.
5415 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5416 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5417 },
5418 }],
5419 ['_type=="executable"', {
5420 'configurations': {
5421 'Release_Base': {
5422 'xcode_settings': {
5423 'DEPLOYMENT_POSTPROCESSING': 'YES',
5424 'STRIP_INSTALLED_PRODUCT': 'YES',
5425 'conditions': [
5426 ['buildtype=="Official"', {
5427 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5428 }, {
5429 # Remove dSYM to reduce build time.
5430 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5431 }],
5432 ],
5433 },
5434 },
5435 'Debug_Base': {
5436 'xcode_settings': {
5437 # Remove dSYM to reduce build time.
5438 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5439 },
5440 },
5441 },
5442 'xcode_settings': {
5443 'conditions': [
5444 ['chromium_ios_signing', {
5445 # iOS SDK wants everything for device signed.
5446 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '<(chromium_ios_signing_i dentity)',
5447 }, {
5448 'CODE_SIGNING_REQUIRED': 'NO',
5449 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5450 }],
5451 ],
5452 },
5453 }],
5454 ], # target_conditions
5455 }, # target_defaults
5456 }], # OS=="ios"
5457 ['OS=="win"', {
5458 'target_defaults': {
5459 'defines': [
5460 '_WIN32_WINNT=0x0A00',
5461 'WINVER=0x0A00',
5462 'WIN32',
5463 '_WINDOWS',
5464 'NOMINMAX',
5465 'PSAPI_VERSION=1',
5466 '_CRT_RAND_S',
5467 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5468 'WIN32_LEAN_AND_MEAN',
5469 '_ATL_NO_OPENGL',
5470 '_SECURE_ATL',
5471 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5472 '_HAS_EXCEPTIONS=0',
5473 # Silence some warnings; we can't switch the the 'recommended'
5474 # versions as they're not available on old OSs.
5475 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5476 ],
5477 'conditions': [
5478 ['buildtype=="Official"', {
5479 # In official builds, targets can self-select an optimization
5480 # level by defining a variable named 'optimize', and setting it
5481 # to one of
5482 # - "size", optimizes for minimal code size - the default.
5483 # - "speed", optimizes for speed over code size.
5484 # - "max", whole program optimization and link-time code
5485 # generation. This is very expensive and should be used
5486 # sparingly.
5487 'variables': {
5488 'optimize%': 'size',
5489 },
5490 'msvs_settings': {
5491 'VCLinkerTool': {
5492 # Set /LTCG for the official builds.
5493 'LinkTimeCodeGeneration': '1',
5494 'AdditionalOptions': [
5495 # Set the number of LTCG code-gen threads to eight.
5496 # The default is four. This gives a 5-10% link speedup.
5497 '/cgthreads:8',
5498 ],
5499 },
5500 },
5501 'target_conditions': [
5502 ['optimize=="size"', {
5503 'msvs_settings': {
5504 'VCCLCompilerTool': {
5505 # 1, optimizeMinSpace, Minimize Size (/O1)
5506 'Optimization': '1',
5507 # 2, favorSize - Favor small code (/Os)
5508 'FavorSizeOrSpeed': '2',
5509 'conditions': [
5510 # TODO(thakis): Remove clang==0 here, crbug.com/598772
5511 ['full_wpo_on_official==1 and clang==0', {
5512 # This implies link time code generation.
5513 'WholeProgramOptimization': 'true',
5514 }],
5515 ],
5516 },
5517 },
5518 }],
5519 # This config is used to avoid a problem in ffmpeg, see
5520 # http://crbug.com/264459.
5521 ['optimize=="size_no_ltcg"', {
5522 'msvs_settings': {
5523 'VCCLCompilerTool': {
5524 # 1, optimizeMinSpace, Minimize Size (/O1)
5525 'Optimization': '1',
5526 # 2, favorSize - Favor small code (/Os)
5527 'FavorSizeOrSpeed': '2',
5528 },
5529 },
5530 }],
5531 ['optimize=="speed"', {
5532 'msvs_settings': {
5533 'VCCLCompilerTool': {
5534 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5535 'Optimization': '2',
5536 # 1, favorSpeed - Favor fast code (/Ot)
5537 'FavorSizeOrSpeed': '1',
5538 'conditions': [
5539 # TODO(thakis): Remove clang==0 here, crbug.com/598772
5540 ['full_wpo_on_official==1 and clang==0', {
5541 # This implies link time code generation.
5542 'WholeProgramOptimization': 'true',
5543 }],
5544 ],
5545 },
5546 },
5547 }],
5548 ['optimize=="max"', {
5549 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5550 # builds. Probably anything that this would catch that
5551 # wouldn't be caught in a normal build isn't going to
5552 # actually be a bug, so the incremental value of C4702 for
5553 # PGO builds is likely very small.
5554 'msvs_disabled_warnings': [
5555 4702
5556 ],
5557 'msvs_settings': {
5558 'VCCLCompilerTool': {
5559 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5560 'Optimization': '2',
5561 # 1, favorSpeed - Favor fast code (/Ot)
5562 'FavorSizeOrSpeed': '1',
5563 },
5564 },
5565 # TODO(thakis): Remove clang==0 here, https://crbug.com/598772
5566 'conditions': [
5567 ['clang==0', {
5568 'msvs_settings': {
5569 'VCCLCompilerTool': {
5570 # This implies link time code generation.
5571 'WholeProgramOptimization': 'true',
5572 },
5573 },
5574 }],
5575 ],
5576 }],
5577 ],
5578 }],
5579 ['msvs_xtree_patched!=1', {
5580 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5581 # it's enabled. This will generally only be true for system-level
5582 # installed Express users.
5583 'msvs_disabled_warnings': [
5584 4702, # unreachable code
5585 ],
5586 }],
5587 ['full_wpo_on_official==1', {
5588 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5589 # builds. Probably anything that this would catch that
5590 # wouldn't be caught in a normal build isn't going to
5591 # actually be a bug, so the incremental value of C4702 for
5592 # PGO builds is likely very small.
5593 'msvs_disabled_warnings': [
5594 4702
5595 ],
5596 }],
5597 ],
5598 # Add extra include directories here that need to be in front of the
5599 # installed and packaged include directories. This may be needed in
5600 # order to force a particular SDK version, such as to get VS 2013 to use
5601 # the Windows 10 SDK. Beware of making the INCLUDE variable excessively
5602 # long, and be sure to make corresponding changes to
5603 # build\toolchain\win\setup_toolchain.py
5604 'msvs_system_include_dirs': [
5605 ],
5606 'msvs_disabled_warnings': [
5607 # C4091: 'typedef ': ignored on left of 'X' when no variable is
5608 # declared.
5609 # This happens in a number of Windows headers. Dumb.
5610 4091,
5611
5612 # C4127: conditional expression is constant
5613 # This warning can in theory catch dead code and other problems, but
5614 # triggers in far too many desirable cases where the conditional
5615 # expression is either set by macros or corresponds some legitimate
5616 # compile-time constant expression (due to constant template args,
5617 # conditionals comparing the sizes of different types, etc.). Some of
5618 # these can be worked around, but it's not worth it.
5619 4127,
5620
5621 # C4351: new behavior: elements of array 'array' will be default
5622 # initialized
5623 # This is a silly "warning" that basically just alerts you that the
5624 # compiler is going to actually follow the language spec like it's
5625 # supposed to, instead of not following it like old buggy versions
5626 # did. There's absolutely no reason to turn this on.
5627 4351,
5628
5629 # C4355: 'this': used in base member initializer list
5630 # It's commonly useful to pass |this| to objects in a class'
5631 # initializer list. While this warning can catch real bugs, most of
5632 # the time the constructors in question don't attempt to call methods
5633 # on the passed-in pointer (until later), and annotating every legit
5634 # usage of this is simply more hassle than the warning is worth.
5635 4355,
5636
5637 # C4503: 'identifier': decorated name length exceeded, name was
5638 # truncated
5639 # This only means that some long error messages might have truncated
5640 # identifiers in the presence of lots of templates. It has no effect
5641 # on program correctness and there's no real reason to waste time
5642 # trying to prevent it.
5643 4503,
5644
5645 # Warning C4589 says: "Constructor of abstract class ignores
5646 # initializer for virtual base class." Disable this warning because it
5647 # is flaky in VS 2015 RTM. It triggers on compiler generated
5648 # copy-constructors in some cases.
5649 4589,
5650
5651 # C4611: interaction between 'function' and C++ object destruction is
5652 # non-portable
5653 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5654 # suggests using exceptions instead of setjmp/longjmp for C++, but
5655 # Chromium code compiles without exception support. We therefore have
5656 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5657 # means we have to turn off this warning (and be careful about how
5658 # object destruction happens in such cases).
5659 4611,
5660
5661 # TODO(maruel): These warnings are level 4. They will be slowly
5662 # removed as code is fixed.
5663 4100, # Unreferenced formal parameter
5664 4121, # Alignment of a member was sensitive to packing
5665 4244, # Conversion from 'type1' to 'type2', possible loss of data
5666 4505, # Unreferenced local function has been removed
5667 4510, # Default constructor could not be generated
5668 4512, # Assignment operator could not be generated
5669 4610, # Object can never be instantiated
5670 4838, # Narrowing conversion. Doesn't seem to be very useful.
5671 4995, # 'X': name was marked as #pragma deprecated
5672 4996, # 'X': was declared deprecated (for GetVersionEx).
5673
5674 # These are variable shadowing warnings that are new in VS2015. We
5675 # should work through these at some point -- they may be removed from
5676 # the RTM release in the /W4 set.
5677 4456, 4457, 4458, 4459,
5678
5679 # TODO(brucedawson): http://crbug.com/554200 4312 is a VS
5680 # 2015 64-bit warning for integer to larger pointer
5681 4312,
5682
5683 # TODO(brucedawson): http://crbug.com/593448 - C4595 is an 'illegal
5684 # inline operator new' warning that is new in VS 2015 Update 2.
5685 # This is equivalent to clang's no-inline-new-delete warning.
5686 # See http://bugs.icu-project.org/trac/ticket/11122
5687 4595,
5688 ],
5689 'msvs_settings': {
5690 'VCCLCompilerTool': {
5691 'AdditionalOptions': ['/MP'],
5692 'MinimalRebuild': 'false',
5693 'BufferSecurityCheck': 'true',
5694 'EnableFunctionLevelLinking': 'true',
5695 'RuntimeTypeInfo': 'false',
5696 'WarningLevel': '4',
5697 'WarnAsError': 'true',
5698 'DebugInformationFormat': '3',
5699 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5700 'ExceptionHandling': '0',
5701 },
5702 'VCLibrarianTool': {
5703 'AdditionalOptions': ['/ignore:4221'],
5704 'AdditionalLibraryDirectories': [
5705 '<(windows_sdk_path)/Lib/win8/um/x86',
5706 ],
5707 },
5708 'VCLinkerTool': {
5709 'AdditionalDependencies': [
5710 'wininet.lib',
5711 'dnsapi.lib',
5712 'version.lib',
5713 'msimg32.lib',
5714 'ws2_32.lib',
5715 'usp10.lib',
5716 'psapi.lib',
5717 'dbghelp.lib',
5718 'winmm.lib',
5719 'shlwapi.lib',
5720 ],
5721 'AdditionalLibraryDirectories': [
5722 '<(windows_sdk_path)/Lib/win8/um/x86',
5723 ],
5724 'GenerateDebugInformation': 'true',
5725 'MapFileName': '$(OutDir)\\$(TargetName).map',
5726 'FixedBaseAddress': '1',
5727 # SubSystem values:
5728 # 0 == not set
5729 # 1 == /SUBSYSTEM:CONSOLE
5730 # 2 == /SUBSYSTEM:WINDOWS
5731 # Most of the executables we'll ever create are tests
5732 # and utilities with console output.
5733 'SubSystem': '1',
5734 },
5735 'VCMIDLTool': {
5736 'GenerateStublessProxies': 'true',
5737 'TypeLibraryName': '$(InputName).tlb',
5738 'OutputDirectory': '$(IntDir)',
5739 'HeaderFileName': '$(InputName).h',
5740 'DLLDataFileName': '$(InputName).dlldata.c',
5741 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5742 'ProxyFileName': '$(InputName)_p.c',
5743 },
5744 'VCResourceCompilerTool': {
5745 'Culture' : '1033',
5746 'AdditionalIncludeDirectories': [
5747 '<(DEPTH)',
5748 '<(SHARED_INTERMEDIATE_DIR)',
5749 ],
5750 },
5751 'target_conditions': [
5752 ['_type=="executable"', {
5753 'VCManifestTool': {
5754 'EmbedManifest': 'true',
5755 },
5756 }],
5757 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5758 'VCManifestTool': {
5759 'AdditionalManifestFiles': [
5760 '>(win_exe_compatibility_manifest)',
5761 ],
5762 },
5763 }],
5764 ],
5765 'conditions': [
5766 # Building with Clang on Windows is a work in progress and very
5767 # experimental. See crbug.com/82385.
5768 # Keep this in sync with the similar blocks in build/config/compiler /BUILD.gn
5769 ['clang==1', {
5770 'VCCLCompilerTool': {
5771 'AdditionalOptions': [
5772 # Don't warn about unused function parameters.
5773 # (This is also used on other platforms.)
5774 '-Wno-unused-parameter',
5775 # Don't warn about the "struct foo f = {0};" initialization
5776 # pattern.
5777 '-Wno-missing-field-initializers',
5778
5779 # TODO(hans): Make this list shorter eventually, http://crbug. com/504657
5780 '-Wno-microsoft-enum-value', # http://crbug.com/505296
5781 '-Wno-unknown-pragmas', # http://crbug.com/505314
5782 '-Wno-microsoft-cast', # http://crbug.com/550065
5783 ],
5784 },
5785 }],
5786 ['clang==1 and clang_use_chrome_plugins==1', {
5787 'VCCLCompilerTool': {
5788 'AdditionalOptions': [
5789 '<@(clang_chrome_plugins_flags)',
5790 ],
5791 },
5792 }],
5793 ['clang==1 and MSVS_VERSION == "2013"', {
5794 'VCCLCompilerTool': {
5795 'AdditionalOptions': [
5796 '-fmsc-version=1800',
5797 ],
5798 },
5799 }],
5800 ['clang==1 and MSVS_VERSION == "2015"', {
5801 'VCCLCompilerTool': {
5802 'AdditionalOptions': [
5803 '-fmsc-version=1900',
5804 ],
5805 },
5806 }],
5807 ['clang==1 and "<!(python <(DEPTH)/build/win/use_ansi_codes.py)"=="T rue"', {
5808 'VCCLCompilerTool': {
5809 'AdditionalOptions': [
5810 # cmd.exe doesn't understand ANSI escape codes by default,
5811 # so only enable them if something emulating them is around.
5812 '-fansi-escape-codes',
5813 # Also see http://crbug.com/110262
5814 '-fcolor-diagnostics',
5815 ],
5816 },
5817 }],
5818 ],
5819 },
5820 },
5821 }],
5822 ['disable_nacl==1', {
5823 'target_defaults': {
5824 'defines': [
5825 'DISABLE_NACL',
5826 ],
5827 },
5828 }],
5829 ['OS=="win" and msvs_use_common_linker_extras', {
5830 'target_defaults': {
5831 'msvs_settings': {
5832 'VCLinkerTool': {
5833 'DelayLoadDLLs': [
5834 'dbghelp.dll',
5835 'dwmapi.dll',
5836 'shell32.dll',
5837 'uxtheme.dll',
5838 ],
5839 },
5840 },
5841 'configurations': {
5842 'x86_Base': {
5843 'msvs_settings': {
5844 'VCLinkerTool': {
5845 'AdditionalOptions': [
5846 '/safeseh',
5847 '/dynamicbase',
5848 '/ignore:4199',
5849 '/ignore:4221',
5850 '/nxcompat',
5851 '/largeaddressaware',
5852 ],
5853 },
5854 'conditions': [
5855 ['asan==1', {
5856 # TODO(asan/win): Move this down into the general
5857 # win-target_defaults section once the 64-bit asan runtime
5858 # exists. See crbug.com/345874.
5859 'VCCLCompilerTool': {
5860 'AdditionalOptions': [
5861 '-fsanitize=address',
5862 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/as an/blacklist_win.txt',
5863 # Omit variable info to speed up /Z7 links.
5864 '-gline-tables-only',
5865 ],
5866 'AdditionalIncludeDirectories': [
5867 # MSVC needs to be able to find the sanitizer headers when
5868 # invoked via /fallback. This is critical for using macros
5869 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5870 # back.
5871 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/t ools/clang/scripts/update.py --print-clang-version)/include_sanitizer',
5872 ],
5873 },
5874 'VCLinkerTool': {
5875 'AdditionalLibraryDirectories': [
5876 # TODO(hans): If make_clang_dir is absolute, this breaks.
5877 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/t ools/clang/scripts/update.py --print-clang-version)/lib/windows',
5878 ],
5879 },
5880 'target_conditions': [
5881 ['component=="shared_library"', {
5882 'VCLinkerTool': {
5883 'AdditionalDependencies': [
5884 'clang_rt.asan_dynamic-i386.lib',
5885 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5886 ],
5887 },
5888 }],
5889 ['_type=="executable" and component=="static_library"', {
5890 'VCLinkerTool': {
5891 'AdditionalDependencies': [
5892 'clang_rt.asan-i386.lib',
5893 ],
5894 },
5895 }],
5896 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5897 'VCLinkerTool': {
5898 'AdditionalDependencies': [
5899 'clang_rt.asan_dll_thunk-i386.lib',
5900 ],
5901 },
5902 }],
5903 ],
5904 }],
5905 ['sanitizer_coverage!=""', {
5906 # TODO(asan/win): Move this down into the general
5907 # win-target_defaults section once the 64-bit asan runtime
5908 # exists. See crbug.com/345874.
5909 'VCCLCompilerTool': {
5910 'AdditionalOptions': [
5911 '-fsanitize-coverage=<(sanitizer_coverage)',
5912 ],
5913 },
5914 }],
5915 ],
5916 },
5917 'conditions': [
5918 ['sanitizer_coverage!=""', {
5919 # TODO(asan/win): Move this down into the general
5920 # win-target_defaults section once the 64-bit asan runtime
5921 # exists. See crbug.com/345874.
5922 'defines': [
5923 'SANITIZER_COVERAGE',
5924 ],
5925 }],
5926 ],
5927 },
5928 'x64_Base': {
5929 'msvs_settings': {
5930 'VCLinkerTool': {
5931 'AdditionalOptions': [
5932 # safeseh is not compatible with x64
5933 '/dynamicbase',
5934 '/ignore:4199',
5935 '/ignore:4221',
5936 '/nxcompat',
5937 ],
5938 },
5939 },
5940 },
5941 },
5942 },
5943 }],
5944 ['enable_new_npdevice_api==1', {
5945 'target_defaults': {
5946 'defines': [
5947 'ENABLE_NEW_NPDEVICE_API',
5948 ],
5949 },
5950 }],
5951 # Don't warn about the "typedef 'foo' locally defined but not used"
5952 # for gcc 4.8 and higher.
5953 # TODO: remove this flag once all builds work. See crbug.com/227506
5954 ['clang==0', {
5955 'target_defaults': {
5956 'cflags': [ '-Wno-unused-local-typedefs' ],
5957 },
5958 }],
5959 ['clang==0 and host_clang==1', {
5960 'target_defaults': {
5961 'target_conditions': [
5962 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5963 ],
5964 },
5965 }],
5966 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5967 'and OS!="win"', {
5968 'make_global_settings': [
5969 ['CC', '<(make_clang_dir)/bin/clang'],
5970 ['CXX', '<(make_clang_dir)/bin/clang++'],
5971 ['CC.host', '$(CC)'],
5972 ['CXX.host', '$(CXX)'],
5973 ],
5974 }],
5975 ['clang==1 and OS=="win"', {
5976 'make_global_settings': [
5977 # On Windows, gyp's ninja generator only looks at CC.
5978 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5979 ],
5980 }],
5981 ['use_lld==1 and OS=="win"', {
5982 'make_global_settings': [
5983 # Limited to Windows because lld-link is the driver that is
5984 # compatible with link.exe.
5985 ['LD', '<(make_clang_dir)/bin/lld-link'],
5986 # lld-link includes a replacement for lib.exe that can produce thin
5987 # archives and understands bitcode (for use_lto==1).
5988 ['AR', '<(make_clang_dir)/bin/lld-link /lib /llvmlibthin'],
5989 ],
5990 }],
5991 ['OS=="android" and clang==0', {
5992 # Hardcode the compiler names in the Makefile so that
5993 # it won't depend on the environment at make time.
5994 'make_global_settings': [
5995 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5996 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5997 ['CC.host', '<(host_cc)'],
5998 ['CXX.host', '<(host_cxx)'],
5999 ],
6000 }],
6001 ['OS=="linux" and target_arch=="mipsel" and host_arch!="mipsel" and chromeos ==0 and clang==0', {
6002 # Set default mips cross tools on linux. These can be overridden
6003 # using CC,CXX,CC.host and CXX.host environment variables.
6004 'make_global_settings': [
6005 ['CC', '<!(which mipsel-linux-gnu-gcc)'],
6006 ['CXX', '<!(which mipsel-linux-gnu-g++)'],
6007 ['CC.host', '<(host_cc)'],
6008 ['CXX.host', '<(host_cxx)'],
6009 ],
6010 }],
6011 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 an d clang==0', {
6012 # Set default ARM cross tools on linux. These can be overridden
6013 # using CC,CXX,CC.host and CXX.host environment variables.
6014 'make_global_settings': [
6015 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
6016 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
6017 ['CC.host', '<(host_cc)'],
6018 ['CXX.host', '<(host_cxx)'],
6019 ],
6020 }],
6021 ['use_goma==1', {
6022 'make_global_settings': [
6023 ['CC_wrapper', '<(gomadir)/gomacc'],
6024 ['CXX_wrapper', '<(gomadir)/gomacc'],
6025 ['CC.host_wrapper', '<(gomadir)/gomacc'],
6026 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
6027 ],
6028 }],
6029 ['use_lto==1', {
6030 'target_defaults': {
6031 'target_conditions': [
6032 ['_toolset=="target"', {
6033 'cflags': [
6034 '-flto',
6035 ],
6036 'xcode_settings': {
6037 'LLVM_LTO': 'YES',
6038 },
6039 }],
6040 # Work-around for http://openradar.appspot.com/20356002
6041 ['_toolset=="target" and _type!="static_library"', {
6042 'xcode_settings': {
6043 'OTHER_LDFLAGS': [
6044 '-Wl,-all_load',
6045 ],
6046 },
6047 }],
6048 ],
6049 },
6050 }],
6051 ['use_lto==1 and clang==0', {
6052 'target_defaults': {
6053 'target_conditions': [
6054 ['_toolset=="target"', {
6055 'cflags': [
6056 '-ffat-lto-objects',
6057 ],
6058 }],
6059 ],
6060 },
6061 }],
6062 ['use_lto==1 and clang==1', {
6063 'target_defaults': {
6064 'target_conditions': [
6065 ['_toolset=="target"', {
6066 'arflags': [
6067 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
6068 ],
6069 'cflags': [
6070 '-fwhole-program-vtables',
6071 ],
6072 'ldflags': [
6073 '-fwhole-program-vtables',
6074 ],
6075 }],
6076 ],
6077 'msvs_settings': {
6078 'VCCLCompilerTool': {
6079 'AdditionalOptions': [
6080 # TODO(pcc): Add LTO support to clang-cl driver and use it here.
6081 '-Xclang',
6082 '-emit-llvm-bc',
6083 ],
6084 },
6085 },
6086 },
6087 }],
6088 # Apply a lower LTO optimization level as the default is too slow.
6089 ['use_lto==1 and clang==1', {
6090 'target_defaults': {
6091 'target_conditions': [
6092 ['_toolset=="target"', {
6093 'ldflags': [
6094 '-Wl,--plugin-opt,O1',
6095 # Allows the linker to apply ICF to the LTO object file. Also, whe n
6096 # targeting ARM, wWithout this flag, LTO produces a .text section
6097 # that is larger than the maximum call displacement, preventing th e
6098 # linker from relocating calls (http://llvm.org/PR22999).
6099 '-Wl,--plugin-opt,-function-sections',
6100 ],
6101 }],
6102 ['_toolset=="target" and _type!="static_library"', {
6103 'xcode_settings': {
6104 'OTHER_LDFLAGS': [
6105 '-Wl,-mllvm,-O1',
6106 ],
6107 },
6108 }],
6109 ],
6110 'msvs_settings': {
6111 'VCLinkerTool': {
6112 'AdditionalOptions': [
6113 '/opt:lldlto=1',
6114 ],
6115 },
6116 },
6117 },
6118 }],
6119 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
6120 'target_defaults': {
6121 'target_conditions': [
6122 ['_toolset=="target"', {
6123 'ldflags': [
6124 '-flto=32',
6125 ],
6126 }],
6127 ],
6128 },
6129 }],
6130 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
6131 'target_defaults': {
6132 'target_conditions': [
6133 ['_toolset=="target"', {
6134 'ldflags': [
6135 '-flto',
6136 ],
6137 }],
6138 ],
6139 },
6140 }],
6141 ['cfi_diag==1', {
6142 'target_defaults': {
6143 'target_conditions': [
6144 ['_toolset=="target"', {
6145 'cflags': [
6146 '-fno-sanitize-trap=cfi',
6147 '-fsanitize-recover=cfi',
6148 ],
6149 'cflags_cc!': [
6150 '-fno-rtti',
6151 ],
6152 'cflags!': [
6153 '-fno-rtti',
6154 ],
6155 'ldflags': [
6156 '-fno-sanitize-trap=cfi',
6157 '-fsanitize-recover=cfi',
6158 ],
6159 'xcode_settings': {
6160 'OTHER_CFLAGS': [
6161 '-fno-sanitize-trap=cfi',
6162 '-fsanitize-recover=cfi',
6163 ],
6164 },
6165 'msvs_settings': {
6166 'VCCLCompilerTool': {
6167 'AdditionalOptions': [
6168 '-fno-sanitize-trap=cfi',
6169 '-fsanitize-recover=cfi',
6170 ],
6171 },
6172 },
6173 }],
6174 ['_toolset=="target" and _type!="static_library"', {
6175 'xcode_settings': {
6176 'OTHER_LDFLAGS': [
6177 '-fno-sanitize-trap=cfi',
6178 '-fsanitize-recover=cfi',
6179 ],
6180 },
6181 }],
6182 ],
6183 },
6184 }],
6185 ['cfi_vptr==1 and cfi_diag==0', {
6186 'target_defaults': {
6187 'target_conditions': [
6188 ['_toolset=="target"', {
6189 'defines': [
6190 'CFI_ENFORCEMENT',
6191 ],
6192 }],
6193 ],
6194 },
6195 }],
6196 ['cfi_vptr==1', {
6197 'target_defaults': {
6198 'target_conditions': [
6199 ['_toolset=="target"', {
6200 'cflags': [
6201 '-fsanitize=cfi-vcall',
6202 '-fsanitize-blacklist=<(cfi_blacklist)',
6203 ],
6204 'ldflags': [
6205 '-fsanitize=cfi-vcall',
6206 '-fsanitize=cfi-derived-cast',
6207 '-fsanitize=cfi-unrelated-cast',
6208 ],
6209 'xcode_settings': {
6210 'OTHER_CFLAGS': [
6211 '-fsanitize=cfi-vcall',
6212 '-fsanitize-blacklist=<(cfi_blacklist)',
6213 ],
6214 },
6215 }],
6216 ['_toolset=="target" and _type!="static_library"', {
6217 'xcode_settings': {
6218 'OTHER_LDFLAGS': [
6219 '-fsanitize=cfi-vcall',
6220 ],
6221 },
6222 }],
6223 ],
6224 },
6225 }],
6226 ['cfi_vptr==1 and cfi_cast==1', {
6227 'target_defaults': {
6228 'target_conditions': [
6229 ['_toolset=="target"', {
6230 'cflags': [
6231 '-fsanitize=cfi-derived-cast',
6232 '-fsanitize=cfi-unrelated-cast',
6233 ],
6234 'ldflags': [
6235 '-fsanitize=cfi-derived-cast',
6236 '-fsanitize=cfi-unrelated-cast',
6237 ],
6238 'xcode_settings': {
6239 'OTHER_CFLAGS': [
6240 '-fsanitize=cfi-derived-cast',
6241 '-fsanitize=cfi-unrelated-cast',
6242 ],
6243 },
6244 }],
6245 ['_toolset=="target" and _type!="static_library"', {
6246 'xcode_settings': {
6247 'OTHER_LDFLAGS': [
6248 '-fsanitize=cfi-derived-cast',
6249 '-fsanitize=cfi-unrelated-cast',
6250 ],
6251 },
6252 }],
6253 ],
6254 },
6255 }],
6256 ['cfi_vptr==1 and OS=="win"', {
6257 'target_defaults': {
6258 'target_conditions': [
6259 ['_toolset=="target"', {
6260 'msvs_settings': {
6261 'VCCLCompilerTool': {
6262 'AdditionalOptions': [
6263 # TODO(pcc): Use regular -fsanitize=* flags here once clang-cl
6264 # supports LTO.
6265 '-Xclang',
6266 '-fsanitize=cfi-vcall',
6267 '-Xclang',
6268 '-fsanitize=cfi-derived-cast',
6269 '-Xclang',
6270 '-fsanitize=cfi-unrelated-cast',
6271 '-Xclang',
6272 '-fsanitize-trap=cfi-vcall',
6273 '-Xclang',
6274 '-fsanitize-trap=cfi-derived-cast',
6275 '-Xclang',
6276 '-fsanitize-trap=cfi-unrelated-cast',
6277 '-Xclang',
6278 '-fsanitize-blacklist=<(cfi_blacklist)',
6279 '-Xclang',
6280 '-fsanitize-blacklist=../../<(make_clang_dir)/lib/clang/<!(pyt hon <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/cfi_blacklist. txt',
6281 ],
6282 },
6283 },
6284 }],
6285 ],
6286 },
6287 }],
6288 ],
6289 'xcode_settings': {
6290 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
6291 # This block adds *project-wide* configuration settings to each project
6292 # file. It's almost always wrong to put things here. Specify your
6293 # custom xcode_settings in target_defaults to add them to targets instead.
6294
6295 'conditions': [
6296 # In an Xcode Project Info window, the "Base SDK for All Configurations"
6297 # setting sets the SDK on a project-wide basis. In order to get the
6298 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
6299 # here at the project level.
6300 ['OS=="mac"', {
6301 'ARCHS': [ 'x86_64' ],
6302 'conditions': [
6303 ['mac_sdk_path==""', {
6304 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
6305 }, {
6306 'SDKROOT': '<(mac_sdk_path)', # -isysroot
6307 }],
6308 ],
6309 }],
6310 ['OS=="ios"', {
6311 # Target both iPhone and iPad.
6312 'TARGETED_DEVICE_FAMILY': '1,2',
6313 'conditions': [
6314 ['ios_sdk_path==""', {
6315 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6316 }, {
6317 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6318 }],
6319 ],
6320 }],
6321 ],
6322
6323 # The Xcode generator will look for an xcode_settings section at the root
6324 # of each dict and use it to apply settings on a file-wide basis. Most
6325 # settings should not be here, they should be in target-specific
6326 # xcode_settings sections, or better yet, should use non-Xcode-specific
6327 # settings in target dicts. SYMROOT is a special case, because many other
6328 # Xcode variables depend on it, including variables such as
6329 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6330 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6331 # files to appear (when present) in the UI as actual files and not red
6332 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6333 # and therefore SYMROOT, needs to be set at the project level.
6334 'SYMROOT': '<(DEPTH)/xcodebuild',
6335 },
6336 } 12 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698