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
3 # found in the LICENSE file.
6 # Please don't directly include this file if you are building via gyp_chromium,
7 # since gyp_chromium is automatically forcing its inclusion.
9 # Variables expected to be overriden on the GYP command line (-D) or by
10 # ~/.gyp/include.gypi.
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.
21 # Whether we're building a ChromeOS build.
24 # Whether we're building the cast (chromecast) shell
27 # Whether or not we are using the Aura windowing framework.
30 # Whether or not we are building the Ash shell.
33 # Whether or not we are using CRAS, the ChromeOS Audio Server.
36 # Use a raw surface abstraction.
39 # Configure the build for small devices. See crbug.com/318413
43 # Compute the architecture that we're building on.
44 ['OS=="win" or OS=="ios"', {
47 'host_arch%': '<!pymod_do_main(detect_host_arch)',
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)',
61 # Whether we are using Views Toolkit
64 # Use the PCI lib to collect GPU information.
67 # Use OpenSSL instead of NSS as the underlying SSL and crypto
68 # implementation. Certificate verification will in most cases be
69 # handled by the OS. If OpenSSL's struct X509 is used to represent
70 # certificates, use_openssl_certs must be set.
73 # Use OpenSSL for representing certificates. When targeting Android,
74 # the platform certificate library is used for certificate
75 # verification. On other targets, this flag also enables OpenSSL for
76 # certificate verification, but this configuration is unsupported.
77 'use_openssl_certs%': 0,
79 # Disable viewport meta tag by default.
80 'enable_viewport%': 0,
82 # Enable HiDPI support.
85 # Enable top chrome material design.
86 'enable_topchrome_md%' : 0,
88 # Force building against pre-built sysroot image on linux. By default
89 # the sysroot image is only used for Official builds or when cross
90 # compiling to arm or mips.
93 # Override buildtype to select the desired build flavor.
94 # Dev - everyday build for development/testing
95 # Official - release build (generally implies additional processing)
96 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
97 # conversion is done), some of the things which are now controlled by
98 # 'branding', such as symbol generation, will need to be refactored
99 # based on 'buildtype' (i.e. we don't care about saving symbols for
100 # non-Official # builds).
103 # Override branding to select the desired branding flavor.
104 'branding%': 'Chromium',
107 # Windows and Linux (including Chrome OS) use Aura and Ash.
108 ['OS=="win" or OS=="linux"', {
113 ['chromecast==1 and OS!="android"', {
123 # Whether we're a traditional desktop unix.
124 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
130 # Embedded implies ozone.
136 'target_arch%': 'arm',
138 # Default architecture we're building for is the architecture we're
139 # building on, and possibly sub-architecture (for iOS builds).
140 'target_arch%': '<(host_arch)',
144 # Copy conditionally-set variables out one scope.
145 'chromeos%': '<(chromeos)',
146 'chromecast%': '<(chromecast)',
147 'desktop_linux%': '<(desktop_linux)',
148 'use_aura%': '<(use_aura)',
149 'use_ash%': '<(use_ash)',
150 'use_cras%': '<(use_cras)',
151 'use_ozone%': '<(use_ozone)',
152 'embedded%': '<(embedded)',
153 'use_libpci%': '<(use_libpci)',
154 'use_openssl%': '<(use_openssl)',
155 'use_openssl_certs%': '<(use_openssl_certs)',
156 'enable_viewport%': '<(enable_viewport)',
157 'enable_hidpi%': '<(enable_hidpi)',
158 'enable_topchrome_md%': '<(enable_topchrome_md)',
159 'buildtype%': '<(buildtype)',
160 'branding%': '<(branding)',
161 'branding_path_component%': '<(branding)',
162 'host_arch%': '<(host_arch)',
163 'target_arch%': '<(target_arch)',
165 'target_subarch%': '',
167 # The channel to build on Android: stable, beta, dev, canary, or
168 # default. "default" should be used on non-official builds.
169 'android_channel%': 'default',
171 # Set ARM architecture version.
174 # Use aurax11 for clipboard implementation. This is true on linux_aura.
175 'use_clipboard_aurax11%': 0,
179 # If no gomadir is set, it uses the default gomadir.
183 # The system root for cross-compiles. Default: none.
187 # The system libdir used for this ABI.
188 'system_libdir%': 'lib',
190 # Default MIPS arch variant. This is set in the conditions block
191 # below for MIPS targets.
192 'mips_arch_variant%': '',
194 # MIPS DSP ASE revision. Possible values are:
201 ['branding == "Chrome"', {
202 'branding_path_component%': 'google_chrome',
205 ['branding == "Chromium"', {
206 'branding_path_component%': 'chromium',
214 # Set default value of toolkit_views based on OS.
215 ['OS=="mac" or OS=="win" or chromeos==1 or use_aura==1', {
221 # Embedded builds use aura without ash or views.
228 # Enable HiDPI on Mac OS, Windows and Linux (including Chrome OS).
229 ['OS=="mac" or OS=="win" or OS=="linux"', {
233 # Enable Top Chrome Material Design on Chrome OS, Windows, and Linux.
234 ['chromeos==1 or OS=="win" or OS=="linux"', {
235 'enable_topchrome_md%': 1,
238 # On iOS, use NSS rather than OpenSSL. See http://crbug.com/338886.
243 # Enable App Launcher everywhere but mobile.
244 ['OS!="ios" and OS!="android"', {
245 'enable_app_list%': 1,
247 'enable_app_list%': 0,
250 ['use_aura==1 and OS!="android"', {
251 'use_default_render_theme%': 1,
253 'use_default_render_theme%': 0,
257 'use_ozone_evdev%': 1,
259 'use_ozone_evdev%': 0,
262 # Set default gomadir.
264 'gomadir': 'c:\\goma\\goma-win',
266 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
269 # Set the default "target_subarch" on iOS. Valid values are "arm32",
270 # "arm64" and "both" (meaning a fat binary).
272 'target_subarch%': 'arm64',
275 # Set arch variants for MIPS platforms.
276 ['target_arch=="mips64el"', {
279 'mips_arch_variant%': 'r6',
281 'mips_arch_variant%': 'r2',
286 ['target_arch=="mipsel"', {
287 'mips_arch_variant%': 'r1',
290 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
291 # sysroot needs to be an absolute path otherwise it generates
292 # incorrect results when passed to pkg-config
293 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy_arm-sysroot',
294 }], # OS=="linux" and target_arch=="arm" and chromeos==0
296 ['OS=="linux" and ((branding=="Chrome" and buildtype=="Official" and chromeos==0) or use_sysroot==1)' , {
298 ['target_arch=="x64"', {
299 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy_amd64-sysroot',
301 ['target_arch=="ia32"', {
302 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy_i386-sysroot',
305 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
307 ['OS=="linux" and target_arch=="mipsel"', {
308 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy_mips-sysroot',
313 # Copy conditionally-set variables out one scope.
314 'chromeos%': '<(chromeos)',
315 'chromecast%': '<(chromecast)',
316 'host_arch%': '<(host_arch)',
317 'target_arch%': '<(target_arch)',
318 'target_subarch%': '<(target_subarch)',
319 'mips_arch_variant%': '<(mips_arch_variant)',
320 'mips_dsp_rev%': '<(mips_dsp_rev)',
321 'toolkit_views%': '<(toolkit_views)',
322 'desktop_linux%': '<(desktop_linux)',
323 'use_aura%': '<(use_aura)',
324 'use_ash%': '<(use_ash)',
325 'use_cras%': '<(use_cras)',
326 'use_libpci%': '<(use_libpci)',
327 'use_ozone%': '<(use_ozone)',
328 'use_ozone_evdev%': '<(use_ozone_evdev)',
329 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
330 'embedded%': '<(embedded)',
331 'use_openssl%': '<(use_openssl)',
332 'use_openssl_certs%': '<(use_openssl_certs)',
333 'enable_viewport%': '<(enable_viewport)',
334 'enable_hidpi%': '<(enable_hidpi)',
335 'enable_topchrome_md%': '<(enable_topchrome_md)',
336 'android_channel%': '<(android_channel)',
337 'use_goma%': '<(use_goma)',
338 'gomadir%': '<(gomadir)',
339 'enable_app_list%': '<(enable_app_list)',
340 'use_default_render_theme%': '<(use_default_render_theme)',
341 'buildtype%': '<(buildtype)',
342 'branding%': '<(branding)',
343 'branding_path_component%': '<(branding_path_component)',
344 'arm_version%': '<(arm_version)',
345 'sysroot%': '<(sysroot)',
346 'chroot_cmd%': '<(chroot_cmd)',
347 'system_libdir%': '<(system_libdir)',
349 # Set to 1 to enable fast builds. Set to 2 for even faster builds
350 # (it disables debug info for fastest compilation - only for use
351 # on compile-only bots).
354 # Set to 1 to not store any build metadata, e.g. ifdef out all __DATE__
355 # and __TIME__. Set to 0 to reenable the use of these macros in the code
356 # base. See http://crbug.com/314403.
357 'dont_embed_build_metadata%': 1,
359 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
360 # This is useful for parallel compilation tools which can't support /Zi.
361 # Only used on Windows.
364 # Set to 1 to enable dcheck in Release build.
365 'dcheck_always_on%': 0,
367 # Set to 1 to make a build that disables unshipped tracing events.
368 # Note: this setting is ignored if buildtype=="Official".
369 'tracing_like_official_build%': 0,
371 # Disable image loader component extension by default.
372 'image_loader_extension%': 0,
374 # Set NEON compilation flags.
377 # Detect NEON support at run-time.
378 'arm_neon_optional%': 0,
380 # Use libjpeg-turbo as the JPEG codec used by Chromium.
381 'use_libjpeg_turbo%': 1,
383 # Use system libjpeg. Note that the system's libjepg will be used even if
384 # use_libjpeg_turbo is set.
385 'use_system_libjpeg%': 0,
387 # By default, component is set to static_library and it can be overriden
388 # by the GYP command line or by ~/.gyp/include.gypi.
389 'component%': 'static_library',
391 # /analyze is off by default on Windows because it is very slow and noisy.
392 # Enable with GYP_DEFINES=win_analyze=1
395 # Set to select the Title Case versions of strings in GRD files.
396 'use_titlecase_in_grd%': 0,
398 # Use translations provided by volunteers at launchpad.net. This
399 # currently only works on Linux.
400 'use_third_party_translations%': 0,
402 # Remoting compilation is enabled by default. Set to 0 to disable.
405 # Configuration policy is enabled by default. Set to 0 to disable.
406 'configuration_policy%': 1,
408 # Variable safe_browsing is used to control the build time configuration
409 # for safe browsing feature. Safe browsing can be compiled in 4 different
410 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
411 # reporting features for use with Data Saver on Mobile, and 3 enables
412 # extended mobile protection via an external API. When 3 is fully
413 # deployed, it will replace 2.
416 # Web speech is enabled by default. Set to 0 to disable.
417 'enable_web_speech%': 1,
419 # 'Ok Google' hotwording is disabled by default in open source builds. Set
420 # to 1 to enable. (This will download a closed-source NaCl module at
421 # startup.) Chrome-branded builds have this enabled by default.
422 'enable_hotwording%': 0,
424 # Notifications are compiled in by default. Set to 0 to disable.
425 'notifications%' : 1,
427 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
428 # regular builds and 1 for ASan builds.
429 'mac_want_real_dsym%': 'default',
431 # If this is set, the clang plugins used on the buildbot will be used.
432 # Run tools/clang/scripts/update.sh to make sure they are compiled.
433 # This causes 'clang_chrome_plugins_flags' to be set.
434 # Has no effect if 'clang' is not set as well.
435 'clang_use_chrome_plugins%': 1,
437 # Enable building with ASAN (Clang's -fsanitize=address option).
438 # -fsanitize=address only works with clang, but asan=1 implies clang=1
439 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
441 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
442 # Enable coverage gathering instrumentation in sanitizer tools. This flag
443 # also controls coverage granularity (1 for function-level coverage, 2
444 # for block-level coverage).
445 'sanitizer_coverage%': 0,
446 # Deprecated, only works if |sanitizer_coverage| isn't set.
447 # TODO(glider): remove this flag.
449 # Enable intra-object-overflow detection in ASan (experimental).
450 'asan_field_padding%': 0,
452 # Enable Chromium overrides of the default configurations for various
453 # dynamic tools (like ASan).
454 'use_sanitizer_options%': 0,
456 # Enable building with SyzyAsan.
457 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
460 # Enable crash reporting via Kasko.
463 # Enable building with LSan (Clang's -fsanitize=leak option).
464 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
465 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
468 # Enable building with TSan (Clang's -fsanitize=thread option).
469 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
470 # See http://clang.llvm.org/docs/ThreadSanitizer.html
472 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
474 # Enable building with MSan (Clang's -fsanitize=memory option).
475 # MemorySanitizer only works with clang, but msan=1 implies clang=1
476 # See http://clang.llvm.org/docs/MemorySanitizer.html
478 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
479 # Track where uninitialized memory originates from. From fastest to
480 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
481 # - track the chain of stores leading from allocation site to use site.
482 'msan_track_origins%': 2,
484 # Enable building with UBSan (Clang's -fsanitize=undefined option).
485 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
486 # See http://clang.llvm.org/docs/UsersManual.html
488 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
489 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/vptr_blacklist.txt',
491 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
492 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
495 # Use dynamic libraries instrumented by one of the sanitizers
496 # instead of the standard system libraries. Set this flag to build the
497 # libraries from source.
498 'use_instrumented_libraries%': 0,
500 # Use dynamic libraries instrumented by one of the sanitizers
501 # instead of the standard system libraries. Set this flag to download
502 # prebuilt binaries from GCS.
503 'use_prebuilt_instrumented_libraries%': 0,
505 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
506 # stdlibc++ as standard library. This is intended to use for instrumented
508 'use_custom_libcxx%': 0,
510 # Use system libc++ instead of the default C++ library, usually libstdc++.
511 # This is intended for iOS builds only.
512 'use_system_libcxx%': 0,
514 # Use a modified version of Clang to intercept allocated types and sizes
515 # for allocated objects. clang_type_profiler=1 implies clang=1.
516 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
517 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
518 'clang_type_profiler%': 0,
520 # Set to true to instrument the code with function call logger.
521 # See src/third_party/cygprofile/cyg-profile.cc for details.
522 'order_profiling%': 0,
524 # Use the provided profiled order file to link Chrome image with it.
525 # This makes Chrome faster by better using CPU cache when executing code.
526 # This is known as PGO (profile guided optimization).
527 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
528 'order_text_section%' : "",
530 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
531 # libraries on linux x86-64 and arm, plus ASLR.
534 # Whether one-click signin is enabled or not.
535 'enable_one_click_signin%': 0,
537 # Whether to back up data before sync.
538 'enable_pre_sync_backup%': 0,
540 # Enable Chrome browser extensions
541 'enable_extensions%': 1,
544 'enable_google_now%': 1,
546 # Enable basic printing support and UI.
547 'enable_basic_printing%': 1,
549 # Enable printing with print preview. It does not imply
550 # enable_basic_printing. It's possible to build Chrome with preview only.
551 'enable_print_preview%': 1,
553 # Set the version of CLD.
554 # 0: Don't specify the version. This option is for the Finch testing.
559 # For CLD2, the size of the tables that should be included in the build
560 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
562 # See third_party/cld_2/cld_2.gyp for more information.
563 # 0: Small tables, lower accuracy
564 # 2: Large tables, high accuracy
565 'cld2_table_size%': 2,
567 # Enable spell checker.
568 'enable_spellcheck%': 1,
570 # Use the operating system spellchecker, e.g. NSSpellChecker on Mac or
571 # SpellCheckerSession on Android.
572 'use_platform_spellchecker%': 0,
574 # Webrtc compilation is enabled by default. Set to 0 to disable.
577 # Media router support is enabled by default. Set to 0 to disable.
578 'enable_media_router%': 1,
580 # Enables use of the session service, which is enabled by default.
581 # Support for disabling depends on the platform.
582 'enable_session_service%': 1,
584 # Enables theme support, which is enabled by default. Support for
585 # disabling depends on the platform.
588 # Enables autofill dialog and associated features; disabled by default.
589 'enable_autofill_dialog%' : 0,
591 # Defaults Wallet integration in Autofill dialog to use production
592 # servers. Unofficial builds won't have the proper API keys.
593 'enable_prod_wallet_service%': 0,
595 # Enables support for background apps.
596 'enable_background%': 1,
598 # Enable the task manager by default.
599 'enable_task_manager%': 1,
601 # Enables used resource whitelist generation; disabled by default.
602 'enable_resource_whitelist_generation%': 0,
604 # Enable FILE support by default.
605 'disable_file_support%': 0,
607 # Enable FTP support by default.
608 'disable_ftp_support%': 0,
610 # Use native android functions in place of ICU. Not supported by most
612 'use_icu_alternatives_on_android%': 0,
614 # Use of precompiled headers on Windows.
616 # This variable may be explicitly set to 1 (enabled) or 0
617 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
618 # This setting will override the default.
621 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
623 'chromium_win_pch%': 0,
626 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
627 # Set this to true when building with Clang.
628 # See http://code.google.com/p/chromium/wiki/Clang for details.
629 # If this is set, clang is used as both host and target compiler in
630 # cross-compile builds.
633 # Use experimental lld linker instead of the platform's default linker.
636 # Enable plugin installation by default.
637 'enable_plugin_installation%': 1,
639 # Specifies whether to use canvas_skia.cc in place of platform
640 # specific implementations of gfx::Canvas. Affects text drawing in the
642 # TODO(asvitkine): Enable this on all platforms and delete this flag.
643 # http://crbug.com/105550
644 'use_canvas_skia%': 0,
646 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
647 # with one of those tools.
648 'build_for_tool%': '',
650 'wix_path%': '<(DEPTH)/third_party/wix',
652 # Supervised users are enabled by default.
653 'enable_supervised_users%': 1,
655 # Platform sends memory pressure signals natively.
656 'native_memory_pressure_signals%': 0,
659 'enable_service_discovery%': 0,
660 'enable_wifi_bootstrapping%': 0,
661 'enable_hangout_services_extension%': 0,
663 # Enable the Syzygy optimization step.
664 'syzygy_optimize%': 0,
666 # Enable hole punching for the protected video.
669 # Automatically select platforms under ozone. Turn this off to
670 # build only explicitly selected platforms.
671 'ozone_auto_platforms%': 1,
673 # If this is set clang is used as host compiler, but not as target
674 # compiler. Always do this by default.
677 # Variables to control Link-Time Optimization (LTO).
678 # On Android, the variable use_lto enables LTO on code compiled with -Os,
679 # and use_lto_o2 enables LTO on code compiled with -O2. On other
680 # platforms, use_lto enables LTO in all translation units, and use_lto_o2
683 # On Linux and Android, when using LLVM LTO, the script
684 # build/download_gold_plugin.py must be run to download a linker plugin.
685 # On Mac, LLVM needs to be built from scratch using
686 # tools/clang/scripts/update.py and the absolute path to
687 # third_party/llvm-build/Release+Asserts/lib must be added to
688 # $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin.
690 # On Android, 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
696 # Allowed level of identical code folding in the gold linker.
697 'gold_icf_level%': 'all',
699 # Libxkbcommon usage.
702 # Control Flow Integrity for virtual calls and casts.
703 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
707 'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
709 # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
710 'mac_views_browser%': 0,
712 # By default, use ICU data file (icudtl.dat).
713 'icu_use_data_file_flag%': 1,
715 # Turn on JNI generation optimizations by default.
716 'optimize_jni_generation%': 1,
719 # A flag for POSIX platforms
726 # A flag for BSD platforms
727 ['OS=="freebsd" or OS=="openbsd"', {
734 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris")', {
740 # libudev usage. This currently only affects the content layer.
741 ['OS=="linux" and embedded==0', {
747 # Flags to use X11 on non-Mac POSIX platforms.
748 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
755 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
761 # Flags to use pango and cairo.
762 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
771 ['OS=="linux" and embedded==0', {
777 # We always use skia text rendering in Aura on Windows, since GDI
778 # doesn't agree with our BackingStore.
779 # TODO(beng): remove once skia text rendering is on by default.
780 ['use_aura==1 and OS=="win"', {
781 'enable_skia_text%': 1,
784 # A flag to enable or disable our compile-time dependency
785 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
786 # support will be available. This option is useful
787 # for Linux distributions and for Aura.
788 ['OS!="linux" or chromeos==1', {
789 'use_gnome_keyring%': 0,
791 'use_gnome_keyring%': 1,
794 ['OS=="mac" or OS=="ios"', {
795 # Mac and iOS want Title Case strings
796 'use_titlecase_in_grd%': 1,
799 # Enable loader extensions on Chrome OS.
801 'image_loader_extension%': 1,
803 'image_loader_extension%': 0,
806 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
807 'enable_one_click_signin%': 1,
808 'enable_pre_sync_backup%': 1,
812 'enable_extensions%': 0,
813 'enable_google_now%': 0,
818 'arm_neon_optional%': 1,
819 'native_memory_pressure_signals%': 1,
820 'enable_basic_printing%': 1,
821 'enable_print_preview%': 0,
822 'enable_task_manager%':0,
826 # Android and OSX have built-in spellcheckers that can be utilized.
827 ['OS=="android" or OS=="mac"', {
828 'use_platform_spellchecker%': 1,
831 # Android OS includes support for proprietary codecs regardless of
832 # building Chromium or Google Chrome. We also ship Google Chrome and
833 # Chromecast with proprietary codecs.
834 ['OS=="android" or branding=="Chrome" or chromecast==1', {
835 'proprietary_codecs%': 1,
837 'proprietary_codecs%': 0,
840 ['OS=="mac" or OS=="ios"', {
841 'native_memory_pressure_signals%': 1,
844 # Enable autofill dialog when not on iOS.
846 'enable_autofill_dialog%': 1,
849 ['buildtype=="Official"', {
850 'enable_prod_wallet_service%': 1,
853 ['branding=="Chrome"', {
854 'enable_hotwording%': 1,
862 'disable_ftp_support%': 1,
863 'enable_extensions%': 0,
864 'enable_google_now%': 0,
866 'cld2_table_size%': 0,
867 'enable_basic_printing%': 0,
868 'enable_print_preview%': 0,
869 'enable_session_service%': 0,
870 'enable_spellcheck%': 0,
876 'enable_supervised_users%': 0,
877 'enable_task_manager%': 0,
878 'use_system_libcxx%': 1,
879 'enable_media_router%': 0,
882 # Use GPU accelerated cross process image transport by default
883 # on linux builds with the Aura window manager
884 ['use_aura==1 and OS=="linux"', {
885 'ui_compositor_image_transport%': 1,
887 'ui_compositor_image_transport%': 0,
890 # Turn precompiled headers on by default.
891 ['OS=="win" and buildtype!="Official"', {
892 'chromium_win_pch%': 1
895 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
896 'enable_plugin_installation%': 0,
898 'enable_plugin_installation%': 1,
901 # Whether PPAPI is enabled.
902 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
903 'enable_plugins%': 0,
905 'enable_plugins%': 1,
908 # linux_use_bundled_gold: whether to use the gold linker binary checked
909 # into third_party/binutils. Force this off via GYP_DEFINES when you
910 # are using a custom toolchain and need to control -B in ldflags.
911 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
912 # for component=static_library builds.
913 ['(OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm" or (target_arch=="ia32" and host_arch=="x64"))', {
914 'linux_use_bundled_gold%': 1,
916 'linux_use_bundled_gold%': 0,
919 # linux_use_bundled_binutils: whether to use the binary binutils
920 # checked into third_party/binutils. These are not multi-arch so cannot
921 # be used except on x86 and x86-64 (the only two architectures which
922 # are currently checke in). Force this off via GYP_DEFINES when you
923 # are using a custom toolchain and need to control -B in cflags.
924 ['OS=="linux" and (target_arch=="x64")', {
925 'linux_use_bundled_binutils%': 1,
927 'linux_use_bundled_binutils%': 0,
930 # linux_use_gold_flags: whether to use build flags that rely on gold.
931 # On by default for x64 Linux.
932 ['OS=="linux" and target_arch=="x64"', {
933 'linux_use_gold_flags%': 1,
935 'linux_use_gold_flags%': 0,
938 # linux_use_debug_fission: whether to use split DWARF debug info
939 # files. This can reduce link time significantly, but is incompatible
940 # with some utilities such as icecc and ccache. Requires gold and
941 # gcc >= 4.8 or clang.
942 # http://gcc.gnu.org/wiki/DebugFission
943 ['OS=="linux" and target_arch=="x64"', {
944 'linux_use_debug_fission%': 1,
946 'linux_use_debug_fission%': 0,
949 ['OS=="android" or OS=="ios"', {
950 'enable_captive_portal_detection%': 0,
952 'enable_captive_portal_detection%': 1,
955 # Enable Skia UI text drawing incrementally on different platforms.
956 # http://crbug.com/105550
958 # On Aura, this allows per-tile painting to be used in the browser
960 ['OS!="android" and OS!="ios"', {
961 'use_canvas_skia%': 1,
965 'enable_basic_printing%': 0,
966 'enable_print_preview%': 1,
969 # Do not enable the Settings App on ChromeOS.
970 ['enable_app_list==1 and chromeos==0', {
971 'enable_settings_app%': 1,
973 'enable_settings_app%': 0,
976 # Whether tests targets should be run, archived or just have the
977 # dependencies verified. All the tests targets have the '_run' suffix,
978 # e.g. base_unittests_run runs the target base_unittests. The test
979 # target always calls tools/swarming_client/isolate.py. See the script's
980 # --help for more information. Meant to be overriden with GYP_DEFINES.
981 # TODO(maruel): Remove the conditions as more configurations are
983 ['OS!="ios" and OS!="android" and chromeos==0', {
984 'test_isolation_mode%': 'check',
986 'test_isolation_mode%': 'noop',
988 # Whether Android build uses OpenMAX DL FFT.
989 ['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=="mipsel")', {
990 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
991 # When enabled, this will also enable WebAudio support on
992 # Android for these architectures. Default is enabled. Whether
993 # WebAudio is actually available depends on runtime settings
995 'use_openmax_dl_fft%': 1,
997 'use_openmax_dl_fft%': 0,
999 ['OS=="win" or OS=="linux"', {
1003 # Disable various features by default on embedded.
1006 'enable_basic_printing%': 0,
1007 'enable_print_preview%': 0,
1010 ['OS=="win" or OS=="mac"', {
1011 'enable_wifi_bootstrapping%' : 1,
1014 # Path to sas.dll, which provides the SendSAS function.
1015 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1016 ['target_arch=="x64"', {
1017 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1019 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1023 'pkg-config': '<(chroot_cmd) <(DEPTH)/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
1025 'pkg-config': 'pkg-config'
1029 # WebVR support disabled until platform implementations have been added
1032 # Setting this to '0' will cause V8's startup snapshot to be
1033 # embedded in the binary instead of being a external files.
1034 'v8_use_external_startup_data%': 1,
1036 # Set this to 1 to enable use of concatenated impulse responses
1037 # for the HRTF panner in WebAudio.
1038 'use_concatenated_impulse_responses': 1,
1040 # You can set the variable 'use_official_google_api_keys' to 1
1041 # to use the Google-internal file containing official API keys
1042 # for Google Chrome even in a developer build. Setting this
1043 # variable explicitly to 1 will cause your build to fail if the
1044 # internal file is missing.
1046 # The variable is documented here, but not handled in this file;
1047 # see //google_apis/determine_use_official_keys.gypi for the
1050 # Set the variable to 0 to not use the internal file, even when
1051 # it exists in your checkout.
1053 # Leave it unset in your include.gypi to have the variable
1054 # implicitly set to 1 if you have
1055 # src/google_apis/internal/google_chrome_api_keys.h in your
1056 # checkout, and implicitly set to 0 if not.
1058 # Note that official builds always behave as if the variable
1059 # was explicitly set to 1, i.e. they always use official keys,
1060 # and will fail to build if the internal file is missing.
1062 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1063 # include.gypi or by other means. Due to subtleties of GYP, this
1064 # is not the same as leaving the variable unset, even though its
1066 # //google_apis/determine_use_official_keys.gypi is 2.
1068 # Set these to bake the specified API keys and OAuth client
1069 # IDs/secrets into your build.
1071 # If you create a build without values baked in, you can instead
1072 # set environment variables to provide the keys at runtime (see
1073 # src/google_apis/google_api_keys.h for details). Features that
1074 # require server-side APIs may fail to work if no keys are
1077 # Note that if you are building an official build or if
1078 # use_official_google_api_keys has been set to 1 (explicitly or
1079 # implicitly), these values will be ignored and the official
1080 # keys will be used instead.
1081 'google_api_key%': '',
1082 'google_default_client_id%': '',
1083 'google_default_client_secret%': '',
1084 # Native Client is enabled by default.
1085 'disable_nacl%': '0',
1087 # Sets the default version name and code for Android app, by default we
1088 # do a developer build.
1089 'android_app_version_name%': 'Developer Build',
1090 'android_app_version_code%': 1,
1093 # Copy conditionally-set variables out one scope.
1094 'branding%': '<(branding)',
1095 'branding_path_component%': '<(branding_path_component)',
1096 'buildtype%': '<(buildtype)',
1097 'target_arch%': '<(target_arch)',
1098 'target_subarch%': '<(target_subarch)',
1099 'mips_arch_variant%': '<(mips_arch_variant)',
1100 'mips_dsp_rev%': '<(mips_dsp_rev)',
1101 'host_arch%': '<(host_arch)',
1102 'toolkit_views%': '<(toolkit_views)',
1103 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1104 'use_aura%': '<(use_aura)',
1105 'use_ash%': '<(use_ash)',
1106 'use_cras%': '<(use_cras)',
1107 'use_libpci%': '<(use_libpci)',
1108 'use_openssl%': '<(use_openssl)',
1109 'use_openssl_certs%': '<(use_openssl_certs)',
1110 'use_nss_certs%': '<(use_nss_certs)',
1111 'use_udev%': '<(use_udev)',
1112 'os_bsd%': '<(os_bsd)',
1113 'os_posix%': '<(os_posix)',
1114 'use_dbus%': '<(use_dbus)',
1115 'use_glib%': '<(use_glib)',
1116 'use_pango%': '<(use_pango)',
1117 'use_cairo%': '<(use_cairo)',
1118 'use_ozone%': '<(use_ozone)',
1119 'use_ozone_evdev%': '<(use_ozone_evdev)',
1120 'use_xkbcommon%': '<(use_xkbcommon)',
1121 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1122 'desktop_linux%': '<(desktop_linux)',
1123 'use_x11%': '<(use_x11)',
1124 'use_gnome_keyring%': '<(use_gnome_keyring)',
1125 'linux_fpic%': '<(linux_fpic)',
1126 'chromeos%': '<(chromeos)',
1127 'chromecast%': '<(chromecast)',
1128 'enable_viewport%': '<(enable_viewport)',
1129 'enable_hidpi%': '<(enable_hidpi)',
1130 'enable_topchrome_md%': '<(enable_topchrome_md)',
1131 'image_loader_extension%': '<(image_loader_extension)',
1132 'fastbuild%': '<(fastbuild)',
1133 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1134 'win_z7%': '<(win_z7)',
1135 'dcheck_always_on%': '<(dcheck_always_on)',
1136 'tracing_like_official_build%': '<(tracing_like_official_build)',
1137 'arm_version%': '<(arm_version)',
1138 'arm_neon%': '<(arm_neon)',
1139 'arm_neon_optional%': '<(arm_neon_optional)',
1140 'sysroot%': '<(sysroot)',
1141 'pkg-config%': '<(pkg-config)',
1142 'chroot_cmd%': '<(chroot_cmd)',
1143 'system_libdir%': '<(system_libdir)',
1144 'component%': '<(component)',
1145 'win_analyze%': '<(win_analyze)',
1146 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1147 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1148 'use_third_party_translations%': '<(use_third_party_translations)',
1149 'remoting%': '<(remoting)',
1150 'enable_one_click_signin%': '<(enable_one_click_signin)',
1151 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1152 'enable_media_router%': '<(enable_media_router)',
1153 'enable_webrtc%': '<(enable_webrtc)',
1154 'chromium_win_pch%': '<(chromium_win_pch)',
1155 'configuration_policy%': '<(configuration_policy)',
1156 'safe_browsing%': '<(safe_browsing)',
1157 'enable_web_speech%': '<(enable_web_speech)',
1158 'enable_hotwording%': '<(enable_hotwording)',
1159 'notifications%': '<(notifications)',
1160 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1161 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1163 'asan_blacklist%': '<(asan_blacklist)',
1164 'asan_coverage%': '<(asan_coverage)',
1165 'sanitizer_coverage%': '<(sanitizer_coverage)',
1166 'asan_field_padding%': '<(asan_field_padding)',
1167 'use_sanitizer_options%': '<(use_sanitizer_options)',
1168 'syzyasan%': '<(syzyasan)',
1169 'kasko%': '<(kasko)',
1170 'syzygy_optimize%': '<(syzygy_optimize)',
1173 'msan_blacklist%': '<(msan_blacklist)',
1174 'msan_track_origins%': '<(msan_track_origins)',
1176 'tsan_blacklist%': '<(tsan_blacklist)',
1177 'ubsan%': '<(ubsan)',
1178 'ubsan_blacklist%': '<(ubsan_blacklist)',
1179 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1180 'ubsan_vptr%': '<(ubsan_vptr)',
1181 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1182 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
1183 'use_custom_libcxx%': '<(use_custom_libcxx)',
1184 'use_system_libcxx%': '<(use_system_libcxx)',
1185 'clang_type_profiler%': '<(clang_type_profiler)',
1186 'order_profiling%': '<(order_profiling)',
1187 'order_text_section%': '<(order_text_section)',
1188 'enable_extensions%': '<(enable_extensions)',
1189 'enable_plugin_installation%': '<(enable_plugin_installation)',
1190 'enable_plugins%': '<(enable_plugins)',
1191 'enable_session_service%': '<(enable_session_service)',
1192 'enable_themes%': '<(enable_themes)',
1193 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1194 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1195 'enable_background%': '<(enable_background)',
1196 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1197 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1198 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1199 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1200 'use_canvas_skia%': '<(use_canvas_skia)',
1201 'test_isolation_mode%': '<(test_isolation_mode)',
1202 'enable_basic_printing%': '<(enable_basic_printing)',
1203 'enable_print_preview%': '<(enable_print_preview)',
1204 'enable_spellcheck%': '<(enable_spellcheck)',
1205 'use_platform_spellchecker%': '<(use_platform_spellchecker)',
1206 'enable_google_now%': '<(enable_google_now)',
1207 'cld_version%': '<(cld_version)',
1208 'cld2_table_size%': '<(cld2_table_size)',
1209 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1210 'disable_file_support%': '<(disable_file_support)',
1211 'disable_ftp_support%': '<(disable_ftp_support)',
1212 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1213 'enable_task_manager%': '<(enable_task_manager)',
1214 'sas_dll_path%': '<(sas_dll_path)',
1215 'wix_path%': '<(wix_path)',
1216 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1217 'use_system_libjpeg%': '<(use_system_libjpeg)',
1218 'android_channel%': '<(android_channel)',
1219 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1220 'gyp_managed_install%': 0,
1221 'create_standalone_apk%': 1,
1222 'enable_app_list%': '<(enable_app_list)',
1223 'use_default_render_theme%': '<(use_default_render_theme)',
1224 'enable_settings_app%': '<(enable_settings_app)',
1225 'google_api_key%': '<(google_api_key)',
1226 'google_default_client_id%': '<(google_default_client_id)',
1227 'google_default_client_secret%': '<(google_default_client_secret)',
1228 'enable_supervised_users%': '<(enable_supervised_users)',
1229 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1230 'enable_mdns%' : '<(enable_mdns)',
1231 'enable_service_discovery%' : '<(enable_service_discovery)',
1232 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1233 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1234 'proprietary_codecs%': '<(proprietary_codecs)',
1235 'use_goma%': '<(use_goma)',
1236 'gomadir%': '<(gomadir)',
1237 'use_lto%': '<(use_lto)',
1238 'use_lto_o2%': '<(use_lto_o2)',
1239 'gold_icf_level%': '<(gold_icf_level)',
1240 'video_hole%': '<(video_hole)',
1241 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1242 'cfi_vptr%': '<(cfi_vptr)',
1243 'cfi_diag%': '<(cfi_diag)',
1244 'cfi_blacklist%': '<(cfi_blacklist)',
1245 'mac_views_browser%': '<(mac_views_browser)',
1246 'android_app_version_name%': '<(android_app_version_name)',
1247 'android_app_version_code%': '<(android_app_version_code)',
1248 'enable_webvr%': '<(enable_webvr)',
1250 # Turns on compiler optimizations in V8 in Debug build.
1251 'v8_optimized_debug%': 1,
1253 # Use system protobuf instead of bundled one.
1254 'use_system_protobuf%': 0,
1256 # Use system yasm instead of bundled one.
1257 'use_system_yasm%': 0,
1259 # Use system ICU instead of bundled one.
1260 'use_system_icu%' : 0,
1262 # Default to enabled PIE; this is important for ASLR but we may need to be
1263 # able to turn it off for various reasons.
1264 'linux_disable_pie%': 0,
1266 # The release channel that this build targets. This is used to restrict
1267 # channel-specific build options, like which installer packages to create.
1268 # The default is 'all', which does no channel-specific filtering.
1271 # Override chromium_mac_pch and set it to 0 to suppress the use of
1272 # precompiled headers on the Mac. Prefix header injection may still be
1273 # used, but prefix headers will not be precompiled. This is useful when
1274 # using distcc to distribute a build to compile slaves that don't
1275 # share the same compiler executable as the system driving the compilation,
1276 # because precompiled headers rely on pointers into a specific compiler
1277 # executable's image. Setting this to 0 is needed to use an experimental
1278 # Linux-Mac cross compiler distcc farm.
1279 'chromium_mac_pch%': 1,
1281 # The default value for mac_strip in target_defaults. This cannot be
1282 # set there, per the comment about variable% in a target_defaults.
1283 'mac_strip_release%': 0,
1285 # Set to 1 to enable java code coverage. Instruments classes during build
1286 # to produce .ec files during runtime.
1287 'emma_coverage%': 0,
1289 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1290 # separated with whitespace and/or comma. Only has effect if
1291 # 'emma_coverage=1'.
1294 # Set to 1 to enable running Android lint on java/class files.
1297 # Although base/allocator lets you select a heap library via an
1298 # environment variable, the libcmt shim it uses sometimes gets in
1299 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1300 # 'win_use_allocator_shim': 0,
1301 # 'win_release_RuntimeLibrary': 2
1302 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1303 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1305 # TODO(bradnelson): eliminate this when possible.
1306 # To allow local gyp files to prevent release.vsprops from being included.
1307 # Yes(1) means include release.vsprops.
1308 # Once all vsprops settings are migrated into gyp, this can go away.
1309 'msvs_use_common_release%': 1,
1311 # TODO(bradnelson): eliminate this when possible.
1312 # To allow local gyp files to override additional linker options for msvs.
1313 # Yes(1) means set use the common linker options.
1314 'msvs_use_common_linker_extras%': 1,
1316 # TODO(sgk): eliminate this if possible.
1317 # It would be nicer to support this via a setting in 'target_defaults'
1318 # in chrome/app/locales/locales.gypi overriding the setting in the
1319 # 'Debug' configuration in the 'target_defaults' dict below,
1320 # but that doesn't work as we'd like.
1321 'msvs_debug_link_incremental%': '2',
1323 # Needed for some of the largest modules.
1324 'msvs_debug_link_nonincremental%': '1',
1326 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1327 # to get incremental linking to be faster in debug builds.
1328 'incremental_chrome_dll%': '0',
1330 # Experimental setting to break chrome.dll into multiple pieces based on
1332 'chrome_multiple_dll%': '0',
1334 # Experimental setting to optimize Chrome's DLLs with PGO.
1335 'chrome_pgo_phase%': '0',
1337 # Whether the VS xtree header has been patched to disable warning 4702. If
1338 # it has, then we don't need to disable 4702 (unreachable code warning).
1339 # The patch is preapplied to the internal toolchain and hence all bots.
1340 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1343 'clang%': '<(clang)',
1344 'host_clang%': '<(host_clang)',
1345 'make_clang_dir%': '<(make_clang_dir)',
1346 'use_lld%': '<(use_lld)',
1348 # Control which version of clang to use when building for iOS. If set to
1349 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1350 # the version of clang that ships with the Chromium source. This variable
1351 # is automatically set to '1' in Official builds.
1354 # These two variables can be set in GYP_DEFINES while running
1355 # |gclient runhooks| to let clang run a plugin in every compilation.
1356 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1358 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1361 'clang_add_plugin%': '',
1363 # Tell ld64 to write map files describing binary layout. Useful
1364 # for looking at what contributes to binary size, e.g. with
1365 # https://github.com/nico/bloat
1366 'mac_write_linker_maps%': 0,
1368 # The default type of gtest.
1369 'gtest_target_type%': 'executable',
1371 # Enable sampling based profiler.
1372 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1374 # Profile without optimizing out stack frames when profiling==1.
1375 'profiling_full_stack_frames%': '0',
1377 # And if we want to dump symbols for Breakpad-enabled builds.
1378 'linux_dump_symbols%': 0,
1379 # And if we want to strip the binary after dumping symbols.
1380 'linux_strip_binary%': 0,
1381 # If we want stack unwind support for backtrace().
1382 'debug_unwind_tables%': 1,
1383 'release_unwind_tables%': 1,
1385 # Override where to find binutils
1386 'binutils_version%': 0,
1387 'binutils_dir%': '',
1390 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1391 'use_allocator%': 'tcmalloc',
1393 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1394 'linux_link_gnome_keyring%': 0,
1395 # Set to 1 to link against gsettings APIs instead of using dlopen().
1396 'linux_link_gsettings%': 0,
1398 # Enable use of OpenMAX DL FFT routines.
1399 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1401 # Enable new NPDevice API.
1402 'enable_new_npdevice_api%': 0,
1404 # .gyp files or targets should set chromium_code to 1 if they build
1405 # Chromium-specific code, as opposed to external code. This variable is
1406 # used to control such things as the set of warnings to enable, and
1407 # whether warnings are treated as errors.
1408 'chromium_code%': 0,
1410 # Disable fatal linker warnings, similarly to how we make it possible
1411 # to disable -Werror (e.g. for different toolchain versions).
1412 'disable_fatal_linker_warnings%': 0,
1414 'release_valgrind_build%': 0,
1416 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1417 'enable_wexit_time_destructors%': 0,
1419 # Build libpeerconnection as a static library by default.
1420 'libpeer_target_type%': 'static_library',
1422 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1423 'internal_gles2_conform_tests%': 0,
1425 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1426 'internal_khronos_glcts_tests%': 0,
1428 # Set to 1 to compile the filter fuzzer.
1429 'internal_filter_fuzzer%': 0,
1431 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1432 # so Cocoa is happy (http://crbug.com/20441).
1434 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1435 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1436 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1437 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1438 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1439 'vi', 'zh-CN', 'zh-TW',
1442 # Pseudo locales are special locales which are used for testing and
1443 # debugging. They don't get copied to the final app. For more info,
1444 # check out https://www.chromium.org/developers/testing/fake-bidi
1451 # If debug_devtools is set to 1, JavaScript files for DevTools are
1452 # stored as is and loaded from disk. Otherwise, a concatenated file
1453 # is stored in resources.pak. It is still possible to load JS files
1454 # from disk by passing --debug-devtools cmdline switch.
1455 'debug_devtools%': 0,
1457 # The Java Bridge is not compiled in by default.
1460 # Code signing for iOS binaries. The bots need to be able to disable this.
1461 'chromium_ios_signing%': 1,
1463 # This flag is only used when disable_nacl==0 and disables all those
1464 # subcomponents which would require the installation of a native_client
1465 # untrusted toolchain.
1466 'disable_nacl_untrusted%': 0,
1468 # PNaCl toolchain does not support sanitizers. Disable by default.
1469 'enable_nacl_nonsfi_test%': 0,
1471 # Disable Dart by default.
1474 # Copy out the setting of disable_nacl.
1475 'disable_nacl%': '<(disable_nacl)',
1477 # Portable Native Client is enabled by default.
1478 'disable_pnacl%': 0,
1480 # Whether to build full debug version for Debug configuration on Android.
1481 # Compared to full debug version, the default Debug configuration on Android
1482 # has no full v8 debug, has size optimization and linker gc section, so that
1483 # we can build a debug version with acceptable size and performance.
1484 'android_full_debug%': 0,
1486 # Contains data about the attached devices for gyp_managed_install.
1487 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1489 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1490 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1492 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1493 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1495 # Whether we are using the rlz library or not. Platforms like Android send
1496 # rlz codes for searches but do not use the library.
1497 'enable_rlz_support%': 0,
1500 # Turns on the i18n support in V8.
1501 'v8_enable_i18n_support': 1,
1503 # Compile d8 for the host toolset.
1504 'v8_toolset_for_d8': 'host',
1506 # Use brlapi from brltty for braille display support.
1509 # Relative path to icu.gyp from this file.
1510 'icu_gyp_path': '../third_party/icu/icu.gyp',
1512 # IPC fuzzer is disabled by default.
1513 'enable_ipc_fuzzer%': 0,
1515 # Force disable libstdc++ debug mode.
1516 'disable_glibcxx_debug%': 0,
1518 # Set to 1 to compile with MSE support for MPEG2 TS
1519 'enable_mpeg2ts_stream_parser%': 0,
1521 # Support ChromeOS touchpad gestures with ozone.
1522 'use_evdev_gestures%': 0,
1524 # Default ozone platform (if no --ozone-platform flag).
1525 'ozone_platform%': "",
1527 # Ozone platforms to include in the build.
1528 'ozone_platform_caca%': 0,
1529 'ozone_platform_cast%': 0,
1530 'ozone_platform_drm%': 0,
1531 'ozone_platform_egltest%': 0,
1532 'ozone_platform_gbm%': 0,
1533 'ozone_platform_ozonex%': 0,
1534 'ozone_platform_test%': 0,
1536 # Experiment: http://crbug.com/426914
1539 # Used to set libjpeg_gyp_path. Chrome OS ui/gfx/gfx.gyp uses the IJG path
1540 # for robust login screen decoding.
1541 'libjpeg_ijg_gyp_path': '<(DEPTH)/third_party/libjpeg/libjpeg.gyp',
1542 'libjpeg_turbo_gyp_path': '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp',
1545 ['buildtype=="Official"', {
1546 # Continue to embed build meta data in Official builds, basically the
1547 # time it was built.
1548 # TODO(maruel): This decision should be revisited because having an
1549 # official deterministic build has high value too but MSVC toolset can't
1550 # generate anything deterministic with WPO enabled AFAIK.
1551 'dont_embed_build_metadata%': 0,
1553 # Enable the Syzygy optimization step for the official builds.
1554 ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
1555 'syzygy_optimize%': 1,
1557 'syzygy_optimize%': 0,
1559 # Get binutils version so we can enable debug fission if we can.
1560 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1562 # compiler_version doesn't work with clang
1563 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1564 # compiler_version works with clang.
1565 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1566 # that it takes effect here.
1567 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1568 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1570 # On Android we know the binutils version in the toolchain.
1572 'binutils_version%': 222,
1574 ['host_arch=="x64"', {
1575 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1577 ['host_arch=="ia32"', {
1578 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1580 # Our version of binutils in third_party/binutils
1581 ['linux_use_bundled_binutils==1', {
1582 'binutils_version%': 224,
1586 'binutils_version%': 0,
1588 # The version of GCC in use, set later in platforms that use GCC and have
1589 # not explicitly chosen to build with clang. Currently, this means all
1590 # platforms except Windows, Mac and iOS.
1591 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1592 # it takes effect here.
1593 ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan_vptr==0', {
1596 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1597 # We directly set the gcc version since we know what we use.
1600 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1601 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1605 'host_gcc_version%': 0,
1608 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1609 'directx_sdk_path%': '<(directx_sdk_default_path)',
1611 'directx_sdk_path%': '$(DXSDK_DIR)',
1614 'windows_driver_kit_path%': '$(WDK_DIR)',
1616 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1618 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1621 'nacl_untrusted_build%': 0,
1622 'use_allocator%': 'none',
1624 # Use a 64-bit linker to avoid running out of address space. The
1625 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1626 ['host_arch=="ia32" and target_arch=="ia32"', {
1627 # TODO(thestig) This is a horrible way to force the desired
1628 # configuration. Our gyp variable scoping is likely wrong and
1629 # needs to be cleaned up. The GN configuration should be changed
1631 'binutils_version%': 224,
1632 'linux_use_bundled_binutils%': '1',
1633 'linux_use_bundled_gold%': '1',
1634 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1636 # All Chrome builds have breakpad symbols, but only process the
1637 # symbols from official builds.
1638 ['(branding=="Chrome" and buildtype=="Official")', {
1639 'linux_dump_symbols%': 1,
1641 # Omit unwind support in official release builds to save space. We
1642 # can use breakpad for these builds.
1643 'release_unwind_tables%': 0,
1646 }], # os_posix==1 and OS!="mac" and OS!="ios"
1649 'enable_background%': 0,
1650 'icu_use_data_file_flag%': 1,
1651 'enable_web_speech%': 0,
1652 'use_system_libxml%': 1,
1653 'use_system_sqlite%': 1,
1655 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1656 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1657 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1658 'uk', 'vi', 'zh-CN', 'zh-TW',
1661 # iOS SDK and deployment target support. The |ios_sdk| value is left
1662 # blank so that when it is set in the project files it will be the
1663 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1664 # causes Xcode to spit out a warning for every single project file for
1665 # not using the "current" SDK.
1667 'ios_sdk_path%': '',
1668 'ios_deployment_target%': '7.0',
1671 # ios_product_name is set to the name of the .app bundle as it should
1673 ['branding=="Chrome"', {
1674 'ios_product_name%': 'Chrome',
1675 }, { # else: branding!="Chrome"
1676 'ios_product_name%': 'Chromium',
1678 ['branding=="Chrome" and buildtype=="Official"', {
1680 }, { # else: branding!="Chrome" or buildtype!="Official"
1686 # Location of Android NDK.
1689 # Standard libraries can use the relative path to the NDK.
1690 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1691 # Unfortunately, it is required to use the absolute path to the SDK
1692 # because it us passed to ant which uses a different relative path
1694 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1695 # Similarly, gdbserver and the Android toolchain need to use the
1696 # absolute path to the NDK because they are used at different levels
1698 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1699 'android_host_arch%': '<!(uname -m)',
1700 # Android API-level of the SDK used for compilation.
1701 'android_sdk_version%': '22',
1702 'android_sdk_build_tools_version%': '22.0.0',
1703 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1705 # Copy conditionally-set variables out one scope.
1706 'android_ndk_root%': '<(android_ndk_root)',
1707 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1708 'android_sdk_root%': '<(android_sdk_root)',
1709 'android_sdk_version%': '<(android_sdk_version)',
1710 'android_libcpp_root': '<(android_ndk_root)/sources/cxx-stl/llvm-libc++',
1711 'host_os%': '<(host_os)',
1713 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1714 # Android SDK build tools (e.g. dx, aidl)
1715 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1717 # Android API level 16 is JB (Android 4.1) which is the minimum
1718 # platform requirement for Chrome on Android, we use it for native
1721 ['target_arch == "ia32"', {
1722 'android_app_abi%': 'x86',
1723 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
1724 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-x86',
1725 'android_ndk_lib_dir%': 'usr/lib',
1726 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1728 ['target_arch == "x64"', {
1729 'android_app_abi%': 'x86_64',
1730 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1731 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1732 'android_ndk_lib_dir%': 'usr/lib64',
1733 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1735 ['target_arch=="arm"', {
1738 'android_app_abi%': 'armeabi',
1740 'android_app_abi%': 'armeabi-v7a',
1743 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
1744 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-arm',
1745 'android_ndk_lib_dir%': 'usr/lib',
1746 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1748 ['target_arch == "arm64"', {
1749 'android_app_abi%': 'arm64-v8a',
1750 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1751 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1752 'android_ndk_lib_dir%': 'usr/lib',
1753 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1755 ['target_arch == "mipsel"', {
1756 'android_app_abi%': 'mips',
1757 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
1758 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-mips',
1759 'android_ndk_lib_dir%': 'usr/lib',
1760 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1762 ['target_arch == "mips64el"', {
1763 'android_app_abi%': 'mips64',
1764 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1765 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1766 'android_ndk_lib_dir%': 'usr/lib64',
1767 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1771 # Copy conditionally-set variables out one scope.
1772 'android_app_abi%': '<(android_app_abi)',
1773 'android_gdbserver%': '<(android_gdbserver)',
1774 'android_ndk_root%': '<(android_ndk_root)',
1775 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1776 'android_sdk_root%': '<(android_sdk_root)',
1777 'android_sdk_version%': '<(android_sdk_version)',
1778 'android_toolchain%': '<(android_toolchain)',
1780 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1781 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1782 'android_sdk_tools%': '<(android_sdk_tools)',
1783 'android_aapt_path%': '<(android_sdk_tools)/aapt',
1784 'android_sdk%': '<(android_sdk)',
1785 'android_sdk_jar%': '<(android_sdk)/android.jar',
1787 'android_libcpp_root': '<(android_libcpp_root)',
1788 'android_libcpp_include': '<(android_libcpp_root)/libcxx/include',
1789 'android_libcpp_libs_dir%': '<(android_libcpp_root)/libs/<(android_app_abi)',
1790 'host_os%': '<(host_os)',
1792 # Location of the "objcopy" binary, used by both gyp and scripts.
1793 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1795 # Location of the "strip" binary, used by both gyp and scripts.
1796 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1798 # Location of the "readelf" binary.
1799 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1801 # Determines whether we should optimize JNI generation at the cost of
1802 # breaking assumptions in the build system that when inputs have changed
1803 # the outputs should always change as well. This is meant purely for
1804 # developer builds, to avoid spurious re-linking of native files.
1805 'optimize_jni_generation%': '<(optimize_jni_generation)',
1807 # Use OpenSSL's struct X509 to represent certificates.
1808 'use_openssl_certs%': 1,
1810 'proprietary_codecs%': '<(proprietary_codecs)',
1811 'safe_browsing%': 2,
1812 'enable_web_speech%': 0,
1814 'use_allocator%': 'none',
1816 # Disable Native Client.
1819 # Android does not support background apps.
1820 'enable_background%': 0,
1822 # Sessions are store separately in the Java side.
1823 'enable_session_service%': 0,
1827 'gtest_target_type%': 'shared_library',
1830 'use_system_fontconfig%': 0,
1832 'use_system_fontconfig%': 1,
1835 'enable_mpeg2ts_stream_parser%': 1,
1836 'ffmpeg_branding%': 'ChromeOS',
1837 'ozone_platform_ozonex%': 1,
1838 'use_custom_freetype%': 0,
1839 'use_playready%': 0,
1841 ['target_arch=="arm"', {
1843 'arm_tune%': 'cortex-a9',
1849 ['chromecast==1 and OS!="android"', {
1850 'ozone_platform_cast%': 1
1852 ['OS=="linux" and target_arch!="mipsel"', {
1857 # All Chrome builds have breakpad symbols, but only process the
1858 # symbols from official builds.
1859 ['(branding=="Chrome" and buildtype=="Official")', {
1860 'mac_strip_release%': 1,
1864 ['OS=="mac" or OS=="ios"', {
1868 # Mac OS X SDK and deployment target support. The SDK identifies
1869 # the version of the system headers that will be used, and
1870 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1871 # macro. "Maximum allowed" refers to the operating system version
1872 # whose APIs are available in the headers. The deployment target
1873 # identifies the minimum system version that the built products are
1874 # expected to function on. It corresponds to the
1875 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1876 # macros are available, #include <AvailabilityMacros.h>. Additional
1877 # documentation on these macros is available at
1878 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1879 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1880 # deployment target to 10.6. Other projects, such as O3D, may
1881 # override these defaults.
1883 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1884 # about that is at least the specified version. In official builds,
1885 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1886 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1887 # path to the SDK; when set to a non-empty string, SDK detection
1888 # based on mac_sdk_min will be bypassed entirely.
1891 'mac_sdk_min%': '10.8',
1892 }, { # else OS!="ios"
1893 'mac_sdk_min%': '10.6',
1896 'mac_sdk_path%': '',
1898 'mac_deployment_target%': '10.6',
1901 'mac_sdk_min': '<(mac_sdk_min)',
1902 'mac_sdk_path': '<(mac_sdk_path)',
1903 'mac_deployment_target': '<(mac_deployment_target)',
1905 # Compile in Breakpad support by default so that it can be
1906 # tested, even if it is not enabled by default at runtime.
1907 'mac_breakpad_compiled_in%': 1,
1909 # mac_product_name is set to the name of the .app bundle as it should
1910 # appear on disk. This duplicates data from
1911 # chrome/app/theme/chromium/BRANDING and
1912 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1913 # these names into the build system.
1914 ['branding=="Chrome"', {
1915 'mac_product_name%': 'Google Chrome',
1916 }, { # else: branding!="Chrome"
1917 'mac_product_name%': 'Chromium',
1919 # Official mac builds require a specific OS X SDK, but iOS and
1920 # non-official mac builds do not.
1921 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1922 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1924 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1926 ['branding=="Chrome" and buildtype=="Official"', {
1927 # Enable uploading crash dumps.
1928 'mac_breakpad_uploads%': 1,
1929 # Enable dumping symbols at build time for use by Mac Breakpad.
1931 # Enable Keystone auto-update support.
1933 }, { # else: branding!="Chrome" or buildtype!="Official"
1934 'mac_breakpad_uploads%': 0,
1939 }], # OS=="mac" or OS=="ios"
1942 # This is the architecture convention used in WinSDK paths.
1943 ['target_arch=="ia32"', {
1944 'winsdk_arch%': 'x86',
1946 'winsdk_arch%': '<(target_arch)',
1948 ['component=="shared_library" or MSVS_VERSION == "2015"', {
1949 # TODO(scottmg): The allocator shimming doesn't work on the 2015 CRT
1950 # and we are hoping to be able to remove it if an additional feature
1951 # lands in the 2015 CRT API. For now, don't shim and revisit once
1952 # VS2015 is RTM: http://crbug.com/481611.
1953 'win_use_allocator_shim%': 0,
1955 ['component=="static_library"', {
1956 # Turn on multiple dll by default on Windows when in static_library.
1957 'chrome_multiple_dll%': 1,
1959 ['asan==1 or syzyasan==1', {
1960 'win_use_allocator_shim%': 0,
1965 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1966 # Only enabled by default for ninja because it's buggy in VS.
1967 # Not enabled for component=static_library because some targets
1968 # are too large and the toolchain fails due to the size of the
1970 'incremental_chrome_dll%': 1,
1972 # Don't do incremental linking for large modules on 32-bit or when
1973 # component=static_library as the toolchain fails due to the size of
1975 ['MSVS_OS_BITS==32 or component=="static_library"', {
1976 'msvs_large_module_debug_link_mode%': '1', # No
1978 'msvs_large_module_debug_link_mode%': '2', # Yes
1981 'nacl_win64_defines': [
1982 # This flag is used to minimize dependencies when building
1983 # Native Client loader for 64-bit Windows.
1986 # Need to include allocator target, but exclude tcmalloc files.
1987 'use_allocator%': 'winheap',
1990 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1996 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win") and chromecast==0', {
1997 'enable_pepper_cdms%': 1,
1999 'enable_pepper_cdms%': 0,
2002 ['OS=="android" or chromecast==1', {
2003 'enable_browser_cdms%': 1,
2005 'enable_browser_cdms%': 0,
2008 # Native Client glibc toolchain is enabled
2009 # by default except on arm, mips and mips64.
2010 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
2011 'disable_glibc%': 1,
2013 'disable_glibc%': 0,
2016 # Set the relative path from this file to the GYP file of the JPEG
2017 # library used by Chromium.
2018 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2019 # Configuration for using the system libjeg is here.
2020 'libjpeg_gyp_path': '<(libjpeg_ijg_gyp_path)',
2022 'libjpeg_gyp_path': '<(libjpeg_turbo_gyp_path)',
2025 # Options controlling the use of GConf (the classic GNOME configuration
2026 # system) and GIO, which contains GSettings (the new GNOME config system).
2027 ['chromeos==1 or embedded==1', {
2035 # Set up -D and -E flags passed into grit.
2036 ['branding=="Chrome"', {
2037 # TODO(mmoss) The .grd files look for _google_chrome, but for
2038 # consistency they should look for google_chrome_build like C++.
2039 'grit_defines': ['-D', '_google_chrome',
2040 '-E', 'CHROMIUM_BUILD=google_chrome'],
2042 'grit_defines': ['-D', '_chromium',
2043 '-E', 'CHROMIUM_BUILD=chromium'],
2046 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2048 ['desktop_linux==1', {
2049 'grit_defines': ['-D', 'desktop_linux'],
2051 ['toolkit_views==1', {
2052 'grit_defines': ['-D', 'toolkit_views'],
2055 'grit_defines': ['-D', 'use_aura'],
2058 'grit_defines': ['-D', 'use_ash'],
2060 ['use_nss_certs==1', {
2061 'grit_defines': ['-D', 'use_nss_certs'],
2064 'grit_defines': ['-D', 'use_ozone'],
2066 ['image_loader_extension==1', {
2067 'grit_defines': ['-D', 'image_loader_extension'],
2070 'grit_defines': ['-D', 'remoting'],
2072 ['use_titlecase_in_grd==1', {
2073 'grit_defines': ['-D', 'use_titlecase'],
2075 ['use_third_party_translations==1', {
2076 'grit_defines': ['-D', 'use_third_party_translations'],
2078 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2079 'ka', 'ku', 'kw', 'ms', 'ug'
2085 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2086 '--no-output-all-resource-defines',
2089 ['OS=="mac" or OS=="ios"', {
2090 'grit_defines': ['-D', 'scale_factors=2x'],
2094 'enable_coverage%': 0,
2098 '--no-output-all-resource-defines',
2100 # iOS uses a whitelist to filter resources.
2101 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2103 # Enable host builds when generating with ninja-ios.
2105 ['"<(GENERATOR)"=="ninja"', {
2109 # Use the version of clang shipped with Xcode when building official
2110 # version of Chrome for iOS.
2112 # TODO(eugenebut): Remove enable_coverage check once
2113 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2114 # http://crbug.com/450379
2115 ['buildtype=="Official" or enable_coverage', {
2120 ['enable_extensions==1', {
2121 'grit_defines': ['-D', 'enable_extensions'],
2123 ['enable_plugins!=0', {
2124 'grit_defines': ['-D', 'enable_plugins'],
2126 ['enable_basic_printing==1 or enable_print_preview==1', {
2127 'grit_defines': ['-D', 'enable_printing'],
2129 ['enable_print_preview==1', {
2130 'grit_defines': ['-D', 'enable_print_preview'],
2132 ['enable_themes==1', {
2133 'grit_defines': ['-D', 'enable_themes'],
2135 ['enable_app_list==1', {
2136 'grit_defines': ['-D', 'enable_app_list'],
2138 ['enable_settings_app==1', {
2139 'grit_defines': ['-D', 'enable_settings_app'],
2141 ['enable_google_now==1', {
2142 'grit_defines': ['-D', 'enable_google_now'],
2144 ['use_concatenated_impulse_responses==1', {
2145 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2147 ['enable_media_router==1', {
2148 'grit_defines': ['-D', 'enable_media_router'],
2150 ['enable_webrtc==1', {
2151 'grit_defines': ['-D', 'enable_webrtc'],
2153 ['enable_hangout_services_extension==1', {
2154 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2156 ['enable_task_manager==1', {
2157 'grit_defines': ['-D', 'enable_task_manager'],
2159 ['notifications==1', {
2160 'grit_defines': ['-D', 'enable_notifications'],
2162 ['enable_wifi_bootstrapping==1', {
2163 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2165 ['mac_views_browser==1', {
2166 'grit_defines': ['-D', 'mac_views_browser'],
2168 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2169 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2171 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2172 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2174 ['enable_mdns==1 or OS=="mac"', {
2175 'grit_defines': ['-D', 'enable_service_discovery'],
2176 'enable_service_discovery%': 1
2178 ['clang_use_chrome_plugins==1', {
2184 ['OS=="mac" or OS=="ios"', {
2185 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2186 }, { # OS != "mac" or OS != "ios"
2187 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
2191 'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ',
2193 # On Windows, the plugin is built directly into clang, so there's
2194 # no need to load it dynamically.
2195 'clang_dynlib_flags%': '',
2197 # https://crbug.com/441916
2198 ['OS=="android" or OS=="linux" or OS=="mac"', {
2199 'clang_plugin_args%': '-Xclang -plugin-arg-find-bad-constructs -Xclang check-templates ',
2200 }, { # OS != "linux"
2201 'clang_plugin_args%': ''
2205 # If you change these, also change build/config/clang/BUILD.gn.
2206 'clang_chrome_plugins_flags%':
2207 '<(clang_dynlib_flags)'
2208 '-Xclang -add-plugin -Xclang find-bad-constructs <(clang_plugin_args)',
2210 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2212 'use_allocator%': 'none',
2213 'use_sanitizer_options%': 1,
2216 ['OS=="linux" and asan==0 and msan==0 and lsan==0 and tsan==0', {
2217 # PNaCl toolchain Non-SFI build only supports linux OS build.
2218 # Also, it does not support sanitizers.
2219 'enable_nacl_nonsfi_test%': 1,
2221 ['asan==1 and OS=="linux" and chromeos==0', {
2222 'use_custom_libcxx%': 1,
2230 ['asan==1 and OS=="mac"', {
2231 'mac_strip_release': 1,
2234 'use_custom_libcxx%': 1,
2237 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2238 # libstdc++. This is required to avoid false positive reports whenever
2239 # the C++ standard library is used.
2240 'use_custom_libcxx%': 1,
2241 # Running the V8-generated code on an ARM simulator is a powerful hack
2242 # that allows the tool to see the memory accesses from JITted code.
2243 # Without this flag, JS code causes false positive reports from MSan.
2244 'v8_target_arch': 'arm64',
2247 ['OS=="linux" and clang_type_profiler==1', {
2249 'clang_use_chrome_plugins%': 0,
2251 ['host_arch=="x64"', {
2252 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2254 ['host_arch=="ia32"', {
2255 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2256 # Clang in this directory at your own risk if needed for some
2257 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2258 # usage). Any failure by this compiler should not close the tree.
2259 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2264 # On valgrind bots, override the optimizer settings so we don't inline too
2265 # much and make the stacks harder to figure out.
2267 # TODO(rnk): Kill off variables that no one else uses and just implement
2268 # them under a build_for_tool== condition.
2269 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2271 'mac_debug_optimization': '1',
2272 'mac_release_optimization': '1',
2273 'release_optimize': '1',
2274 'no_gc_sections': 1,
2275 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2276 '-fno-builtin -fno-optimize-sibling-calls',
2277 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2278 '-fno-builtin -fno-optimize-sibling-calls',
2280 # MSVS flags for TSan on Pin and Windows.
2281 'win_debug_RuntimeChecks': '0',
2282 'win_debug_disable_iterator_debugging': '1',
2283 'win_debug_Optimization': '1',
2284 'win_debug_InlineFunctionExpansion': '0',
2285 'win_release_InlineFunctionExpansion': '0',
2286 'win_release_OmitFramePointers': '0',
2288 'use_allocator': 'tcmalloc',
2289 'release_valgrind_build': 1,
2291 'component': 'static_library',
2292 'use_system_zlib': 0,
2295 # Build tweaks for DrMemory.
2296 # TODO(rnk): Combine with tsan config to share the builder.
2297 # http://crbug.com/108155
2298 ['build_for_tool=="drmemory"', {
2299 # These runtime checks force initialization of stack vars which blocks
2300 # DrMemory's uninit detection.
2301 'win_debug_RuntimeChecks': '0',
2302 # Iterator debugging is slow.
2303 'win_debug_disable_iterator_debugging': '1',
2304 # Try to disable optimizations that mess up stacks in a release build.
2305 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2306 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2307 # compiler bug, so we use /Ob1 instead.
2308 'win_release_InlineFunctionExpansion': '1',
2309 'win_release_OmitFramePointers': '0',
2310 # Ditto for debug, to support bumping win_debug_Optimization.
2311 'win_debug_InlineFunctionExpansion': 0,
2312 'win_debug_OmitFramePointers': 0,
2313 # Keep the code under #ifndef NVALGRIND.
2314 'release_valgrind_build': 1,
2317 # RLZ library is used on Win, Mac, iOS and ChromeOS.
2318 ['OS=="win" or OS=="mac" or OS=="ios" or chromeos==1', {
2319 'enable_rlz_support%': 1,
2321 # RLZ is enabled for "Chrome" builds.
2322 ['branding=="Chrome"', {
2328 # Set default compiler flags depending on ARM version.
2329 ['arm_version==6', {
2330 'arm_arch%': 'armv6',
2333 'arm_float_abi%': 'softfp',
2336 ['arm_version==7', {
2337 'arm_arch%': 'armv7-a',
2338 'arm_tune%': 'generic-armv7-a',
2343 'arm_fpu%': 'vfpv3-d16',
2346 'arm_float_abi%': 'softfp',
2348 'arm_float_abi%': 'hard',
2354 # Set default compiler flags for MIPS floating-point support.
2355 ['target_arch=="mipsel"', {
2356 'mips_float_abi%': 'hard',
2358 ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
2359 'mips_fpu_mode%': 'fp32',
2362 # Enable brlapi by default for chromeos.
2367 ['use_ozone==1 and ozone_auto_platforms==1', {
2368 # Use test as the default platform.
2369 'ozone_platform%': 'test',
2371 # Build all platforms whose deps are in install-build-deps.sh.
2372 # Only these platforms will be compile tested by buildbots.
2373 'ozone_platform_drm%': 1,
2374 'ozone_platform_test%': 1,
2375 'ozone_platform_egltest%': 1,
2378 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2379 'use_clipboard_aurax11%': 1,
2382 ['OS=="win" and use_goma==1', {
2383 # goma doesn't support pch yet.
2384 'chromium_win_pch': 0,
2385 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2387 ['win_z7==0 and fastbuild==0', {
2393 ['OS=="win" and (clang==1 or asan==1)', {
2394 'chromium_win_pch': 0,
2398 'host_cc': '<(make_clang_dir)/bin/clang',
2399 'host_cxx': '<(make_clang_dir)/bin/clang++',
2401 'host_cc': '<!(which gcc)',
2402 'host_cxx': '<!(which g++)',
2405 # The seccomp-bpf sandbox is only supported on five architectures
2407 # Do not disable seccomp_bpf anywhere without talking to
2408 # security@chromium.org!
2409 ['((OS=="linux" or OS=="android") and '
2410 '(target_arch=="ia32" or target_arch=="x64" or '
2411 'target_arch=="arm" or target_arch=="mipsel" or '
2412 'target_arch=="arm64"))', {
2413 'use_seccomp_bpf%': 1,
2415 'use_seccomp_bpf%': 0,
2422 ['branding=="Chrome" and buildtype=="Official"', {
2423 'enable_hangout_services_extension%': 1,
2425 'enable_hangout_services_extension%': 0,
2429 # The path to the ANGLE library.
2430 'angle_path': '<(DEPTH)/third_party/angle',
2432 # List of default apps to install in new profiles. The first list contains
2433 # the source files as found in svn. The second list, used only for linux,
2434 # contains the destination location for each of the files. When a crx
2435 # is added or removed from the list, the chrome/browser/resources/
2436 # default_apps/external_extensions.json file must also be updated.
2438 # README: GN version of these is in the target //chrome:default_apps
2439 # (there's no global variable like in GYP). Be sure to update that target
2440 # if you change these lists!
2441 'default_apps_list': [
2442 'browser/resources/default_apps/external_extensions.json',
2443 'browser/resources/default_apps/gmail.crx',
2444 'browser/resources/default_apps/search.crx',
2445 'browser/resources/default_apps/youtube.crx',
2446 'browser/resources/default_apps/drive.crx',
2447 'browser/resources/default_apps/docs.crx',
2449 'default_apps_list_linux_dest': [
2450 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2451 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2452 '<(PRODUCT_DIR)/default_apps/search.crx',
2453 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2454 '<(PRODUCT_DIR)/default_apps/drive.crx',
2455 '<(PRODUCT_DIR)/default_apps/docs.crx',
2458 # Whether to allow building of the GPU-related isolates.
2459 'archive_gpu_tests%': 0,
2461 # Whether to allow building of chromoting related isolates.
2462 'archive_chromoting_tests%': 0,
2464 # Whether to allow building of Media Router related isolates.
2465 'archive_media_router_tests%': 0,
2467 'target_defaults': {
2469 # The condition that operates on chromium_code is in a target_conditions
2470 # section, and will not have access to the default fallback value of
2471 # chromium_code at the top of this file, or to the chromium_code
2472 # variable placed at the root variables scope of .gyp files, because
2473 # those variables are not set at target scope. As a workaround,
2474 # if chromium_code is not set at target scope, define it in target scope
2475 # to contain whatever value it has during early variable expansion.
2476 # That's enough to make it available during target conditional
2478 'chromium_code%': '<(chromium_code)',
2480 'component%': '<(component)',
2482 'chromecast%': '<(chromecast)',
2484 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2485 'win_release_Optimization%': '2', # 2 = /O2
2486 'win_debug_Optimization%': '0', # 0 = /Od
2488 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2489 # Tri-state: blank is default, 1 on, 0 off
2490 'win_release_OmitFramePointers%': '0',
2491 # Tri-state: blank is default, 1 on, 0 off
2492 'win_debug_OmitFramePointers%': '',
2494 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2495 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2497 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2498 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2499 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2501 # VS inserts quite a lot of extra checks to algorithms like
2502 # std::partial_sort in Debug build which make them O(N^2)
2503 # instead of O(N*logN). This is particularly slow under memory
2504 # tools like ThreadSanitizer so we want it to be disablable.
2505 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2506 'win_debug_disable_iterator_debugging%': '0',
2508 # An application manifest fragment to declare compatibility settings for
2509 # 'executable' targets. Ignored in other target type.
2510 'win_exe_compatibility_manifest%':
2511 '<(DEPTH)\\build\\win\\compatibility.manifest',
2513 'release_extra_cflags%': '',
2514 'debug_extra_cflags%': '',
2516 'release_valgrind_build%': '<(release_valgrind_build)',
2518 # the non-qualified versions are widely assumed to be *nix-only
2519 'win_release_extra_cflags%': '',
2520 'win_debug_extra_cflags%': '',
2522 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2523 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2525 # Only used by Windows build for now. Can be used to build into a
2526 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2527 # output files in src/build/VS2010_{Debug,Release}.
2528 'build_dir_prefix%': '',
2530 # Targets are by default not nacl untrusted code.
2531 'nacl_untrusted_build%': 0,
2533 'pnacl_compile_flags': [
2534 # pnacl uses the clang compiler so we need to suppress all the
2535 # same warnings as we do for clang.
2536 # TODO(sbc): Remove these if/when they are removed from the clang
2538 '-Wno-unused-function',
2539 '-Wno-char-subscripts',
2540 '-Wno-c++11-extensions',
2541 '-Wno-unnamed-type-template-args',
2544 # By default, Android targets have their exported JNI symbols stripped,
2545 # so we test the manual JNI registration code paths that are required
2546 # when using the crazy linker. To allow use of native JNI exports (lazily
2547 # resolved by the JVM), targets can enable this variable, which will stop
2548 # the stripping from happening. Only targets which do not need to be
2549 # compatible with the crazy linker are permitted to set this.
2550 'use_native_jni_exports%': 0,
2553 ['OS=="win" and component=="shared_library"', {
2554 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2555 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2556 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2558 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2559 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2560 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2563 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2564 'mac_release_optimization%': 's', # Use -Os unless overridden
2565 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2567 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2568 'mac_release_optimization%': '2', # Use -O2 unless overridden
2569 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2572 'host_os%': '<(host_os)', # See comment above chromium_code.
2575 'clang_warning_flags': [
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',
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',
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',
2591 # Warns when a const char[] is converted to bool.
2592 '-Wstring-conversion',
2594 # C++11-related flags:
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',
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',
2607 # TODO(hans): Get this cleaned up, http://crbug.com/428099
2608 '-Wno-inconsistent-missing-override',
2610 # TODO(thakis): Enable this, crbug.com/507717
2611 '-Wno-shift-negative-value',
2614 'includes': [ 'set_clang_warning_flags.gypi', ],
2616 # Don't use deprecated V8 APIs anywhere.
2617 'V8_DEPRECATION_WARNINGS',
2620 '<(SHARED_INTERMEDIATE_DIR)',
2624 # When compiling Objective C, warns if a method is used whose
2625 # availability is newer than the deployment target.
2626 'xcode_settings': { 'WARNING_CFLAGS': ['-Wpartial-availability']},
2628 ['(OS=="mac" or OS=="ios") and asan==1', {
2630 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2633 ['OS=="win" and asan==1 and component=="shared_library"', {
2635 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2638 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2639 'cflags_cc!': ['-fno-rtti'],
2642 '-gline-tables-only',
2643 '-fintercept-allocation-functions',
2645 'defines': ['TYPE_PROFILING'],
2647 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2650 ['branding=="Chrome"', {
2651 'defines': ['GOOGLE_CHROME_BUILD'],
2652 }, { # else: branding!="Chrome"
2653 'defines': ['CHROMIUM_BUILD'],
2655 ['OS=="mac" and component=="shared_library"', {
2657 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2658 'LD_RUNPATH_SEARCH_PATHS': [
2659 # For unbundled binaries.
2661 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2662 '@loader_path/../../..',
2666 ['clang==1 or host_clang==1', {
2667 # This is here so that all files get recompiled after a clang roll and
2668 # when turning clang on or off.
2669 # (defines are passed via the command line, and build systems rebuild
2670 # things when their commandline changes). Nothing should ever read this
2672 'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
2675 'defines': ['ENABLE_RLZ'],
2677 ['component=="shared_library"', {
2678 'defines': ['COMPONENT_BUILD'],
2680 ['ui_compositor_image_transport==1', {
2681 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2684 'defines': ['USE_AURA=1'],
2687 'defines': ['USE_ASH=1'],
2690 'defines': ['USE_PANGO=1'],
2693 'defines': ['USE_CAIRO=1'],
2696 'defines': ['USE_CRAS=1'],
2699 'defines': ['USE_OZONE=1'],
2701 ['use_default_render_theme==1', {
2702 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2704 ['use_libjpeg_turbo==1', {
2705 'defines': ['USE_LIBJPEG_TURBO=1'],
2708 'defines': ['USE_X11=1'],
2710 ['use_clipboard_aurax11==1', {
2711 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2713 ['enable_one_click_signin==1', {
2714 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2716 ['enable_pre_sync_backup==1', {
2717 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2719 ['image_loader_extension==1', {
2720 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2723 'defines': ['ENABLE_PROFILING=1'],
2726 'defines': ['ENABLE_REMOTING=1'],
2728 ['enable_webrtc==1', {
2729 'defines': ['ENABLE_WEBRTC=1'],
2731 ['enable_media_router==1', {
2732 'defines': ['ENABLE_MEDIA_ROUTER=1'],
2734 ['proprietary_codecs==1', {
2735 'defines': ['USE_PROPRIETARY_CODECS'],
2737 ['enable_mpeg2ts_stream_parser==1', {
2738 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2742 ['enable_viewport==1', {
2743 'defines': ['ENABLE_VIEWPORT'],
2745 ['enable_pepper_cdms==1', {
2746 'defines': ['ENABLE_PEPPER_CDMS'],
2748 ['enable_browser_cdms==1', {
2749 'defines': ['ENABLE_BROWSER_CDMS'],
2751 ['configuration_policy==1', {
2752 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2754 ['notifications==1', {
2755 'defines': ['ENABLE_NOTIFICATIONS'],
2757 ['enable_hidpi==1', {
2758 'defines': ['ENABLE_HIDPI=1'],
2760 ['enable_topchrome_md==1', {
2761 'defines': ['ENABLE_TOPCHROME_MD=1'],
2763 ['native_memory_pressure_signals==1', {
2764 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2767 'defines': ['USE_UDEV'],
2771 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2774 ['OS=="win" and fastbuild==2', {
2775 # Completely disable debug information.
2778 'GenerateDebugInformation': 'false',
2780 'VCCLCompilerTool': {
2781 'DebugInformationFormat': '0',
2785 ['OS=="win" and fastbuild==1', {
2788 # This tells the linker to generate .pdbs, so that
2789 # we can get meaningful stack traces.
2790 'GenerateDebugInformation': 'true',
2792 'VCCLCompilerTool': {
2793 # No debug info to be generated by compiler.
2794 'DebugInformationFormat': '0',
2798 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2799 'variables': { 'debug_extra_cflags': '-g0', },
2801 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2802 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2804 'variables': { 'debug_extra_cflags': '-g0', },
2806 # Android builds symbols on release by default, disable them.
2807 ['OS=="android" and fastbuild==2', {
2808 'variables': { 'release_extra_cflags': '-g0', },
2810 ['OS=="android" and fastbuild==1', {
2811 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2813 'variables': { 'release_extra_cflags': '-g0', },
2817 ['dont_embed_build_metadata==1', {
2819 'DONT_EMBED_BUILD_METADATA',
2821 }], # dont_embed_build_metadata==1
2822 ['dcheck_always_on!=0', {
2823 'defines': ['DCHECK_ALWAYS_ON=1'],
2824 }], # dcheck_always_on!=0
2825 ['tracing_like_official_build!=0', {
2826 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2827 }], # tracing_like_official_build!=0
2829 'defines': ['NO_TCMALLOC'],
2831 ['win_use_allocator_shim==1', {
2832 'defines': ['ALLOCATOR_SHIM'],
2838 'ADDRESS_SANITIZER',
2839 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2840 'MEMORY_SANITIZER_INITIAL_SIZE',
2844 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2852 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2853 'MEMORY_SANITIZER_INITIAL_SIZE',
2861 '<(DEPTH)/third_party/kasko/include',
2867 '_CRT_SECURE_NO_DEPRECATE',
2868 '_SCL_SECURE_NO_DEPRECATE',
2869 # This define is required to pull in the new Win8 interfaces from
2870 # system headers like ShObjIdl.h.
2871 'NTDDI_VERSION=0x06030000',
2872 # This is required for ATL to use XP-safe versions of its functions.
2873 '_USING_V110_SDK71_',
2876 '<(DEPTH)/third_party/wtl/include',
2881 # Generates debug info when win_z7=1
2882 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2884 'GenerateDebugInformation': 'true',
2886 'VCCLCompilerTool': {
2887 'DebugInformationFormat': '1',
2893 # This is prohibited when running /analyze.
2894 '_USING_V110_SDK71_',
2897 'VCCLCompilerTool': {
2898 # Set WarnAsError to false to disable this setting for most
2899 # projects so that compilation continues.
2900 'WarnAsError': 'false',
2901 # When win_analyze is specified add the /analyze switch.
2902 # Also add /WX- to force-disable WarnAsError for projects that
2903 # override WarnAsError.
2904 # Also, disable various noisy warnings that have low value.
2905 'AdditionalOptions': [
2907 '/wd6011', # Dereferencing NULL pointer
2908 '/wd6312', # Possible infinite loop: use of the constant
2909 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2910 '/wd6326', # Potential comparison of constant with constant
2911 '/wd28159', # Consider using 'GetTickCount64'
2912 '/wd28204', # Inconsistent SAL annotations
2913 '/wd28251', # Inconsistent SAL annotations
2914 '/wd28252', # Inconsistent SAL annotations
2915 '/wd28253', # Inconsistent SAL annotations
2916 '/wd28196', # The precondition is not satisfied
2917 '/wd28301', # Inconsistent SAL annotations
2918 '/wd6340', # Sign mismatch in function parameter
2919 '/wd28182', # Dereferencing NULL pointer
2920 # C6285 is ~16% of raw warnings and has low value
2921 '/wd6285', # non-zero constant || non-zero constant
2922 # C6334 is ~80% of raw warnings and has low value
2923 '/wd6334', # sizeof applied to an expression with an operator
2935 ['use_playready==1', {
2937 'PLAYREADY_CDM_AVAILABLE',
2942 ['enable_task_manager==1', {
2944 'ENABLE_TASK_MANAGER=1',
2947 ['enable_extensions==1', {
2949 'ENABLE_EXTENSIONS=1',
2952 ['OS=="win" and branding=="Chrome"', {
2953 'defines': ['ENABLE_SWIFTSHADER'],
2955 ['enable_dart==1', {
2956 'defines': ['WEBKIT_USING_DART=1'],
2958 ['enable_plugin_installation==1', {
2959 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2961 ['enable_plugins==1', {
2962 'defines': ['ENABLE_PLUGINS=1'],
2964 ['enable_session_service==1', {
2965 'defines': ['ENABLE_SESSION_SERVICE=1'],
2967 ['enable_themes==1', {
2968 'defines': ['ENABLE_THEMES=1'],
2970 ['enable_autofill_dialog==1', {
2971 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2973 ['enable_prod_wallet_service==1', {
2974 # In GN, this is set on the autofill tagets only. See
2975 # //components/autofill/core/browser:wallet_service
2976 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2978 ['enable_background==1', {
2979 'defines': ['ENABLE_BACKGROUND=1'],
2981 ['enable_google_now==1', {
2982 'defines': ['ENABLE_GOOGLE_NOW=1'],
2984 ['cld_version!=0', {
2985 'defines': ['CLD_VERSION=<(cld_version)'],
2987 ['enable_basic_printing==1 or enable_print_preview==1', {
2988 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2989 'defines': ['ENABLE_PRINTING=1'],
2991 ['enable_basic_printing==1', {
2992 # Enable basic printing support and UI.
2993 'defines': ['ENABLE_BASIC_PRINTING=1'],
2995 ['enable_print_preview==1', {
2996 # Enable printing with print preview.
2997 # Can be defined without ENABLE_BASIC_PRINTING.
2998 'defines': ['ENABLE_PRINT_PREVIEW=1'],
3000 ['enable_spellcheck==1', {
3001 'defines': ['ENABLE_SPELLCHECK=1'],
3003 ['use_platform_spellchecker', {
3004 'defines': ['USE_PLATFORM_SPELLCHECKER=1'],
3006 ['enable_captive_portal_detection==1', {
3007 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
3009 ['enable_app_list==1', {
3010 'defines': ['ENABLE_APP_LIST=1'],
3012 ['enable_settings_app==1', {
3013 'defines': ['ENABLE_SETTINGS_APP=1'],
3015 ['disable_file_support==1', {
3016 'defines': ['DISABLE_FILE_SUPPORT=1'],
3018 ['disable_ftp_support==1', {
3019 'defines': ['DISABLE_FTP_SUPPORT=1'],
3021 ['enable_supervised_users==1', {
3022 'defines': ['ENABLE_SUPERVISED_USERS=1'],
3024 ['enable_mdns==1', {
3025 'defines': ['ENABLE_MDNS=1'],
3027 ['enable_service_discovery==1', {
3028 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
3030 ['enable_wifi_bootstrapping==1', {
3031 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
3033 ['enable_hangout_services_extension==1', {
3034 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
3036 ['enable_ipc_fuzzer==1', {
3037 'defines': ['ENABLE_IPC_FUZZER=1'],
3040 'defines': ['VIDEO_HOLE=1'],
3042 ['v8_use_external_startup_data==1', {
3043 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
3045 ['enable_webvr==1', {
3046 'defines': ['ENABLE_WEBVR'],
3049 # SAFE_BROWSING_SERVICE - browser manages a safe-browsing service.
3050 # SAFE_BROWSING_DB_LOCAL - service manages a local database.
3051 # SAFE_BROWSING_DB_REMOTE - service talks via API to a database
3052 # SAFE_BROWSING_CSD - enable client-side phishing detection.
3053 ['safe_browsing==1', {
3055 # TODO(nparker): Remove existing uses of FULL_SAFE_BROWSING
3056 'FULL_SAFE_BROWSING',
3057 'SAFE_BROWSING_CSD',
3058 'SAFE_BROWSING_DB_LOCAL',
3059 'SAFE_BROWSING_SERVICE',
3062 ['safe_browsing==2', {
3064 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3065 'MOBILE_SAFE_BROWSING',
3066 'SAFE_BROWSING_SERVICE',
3069 ['safe_browsing==3', {
3071 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3072 'MOBILE_SAFE_BROWSING',
3073 'SAFE_BROWSING_DB_REMOTE',
3074 'SAFE_BROWSING_SERVICE',
3077 ], # conditions for 'target_defaults'
3078 'target_conditions': [
3079 ['<(use_libpci)==1', {
3080 'defines': ['USE_LIBPCI=1'],
3082 ['<(use_openssl)==1', {
3083 'defines': ['USE_OPENSSL=1'],
3085 ['<(use_openssl_certs)==1', {
3086 'defines': ['USE_OPENSSL_CERTS=1'],
3088 ['>(nacl_untrusted_build)==1', {
3091 'USE_OPENSSL_CERTS=1',
3094 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3095 'defines': ['USE_GLIB=1'],
3097 ['<(use_nss_certs)==1 and >(nacl_untrusted_build)==0', {
3098 'defines': ['USE_NSS_CERTS=1'],
3100 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3101 'defines': ['OS_CHROMEOS=1'],
3103 ['enable_wexit_time_destructors==1 and OS!="win"', {
3104 # TODO: Enable on Windows too, http://crbug.com/404525
3105 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3107 ['chromium_code==0', {
3109 'clang_warning_flags': [
3110 # TODO(mgiuca): Move this suppression into individual third-party
3111 # libraries as required. http://crbug.com/505301.
3112 '-Wno-overloaded-virtual',
3113 # Lots of third-party libraries have unused variables. Instead of
3114 # suppressing them individually, we just blanket suppress them here.
3115 '-Wno-unused-variable',
3119 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3120 # We don't want to get warnings from third-party code,
3121 # so remove any existing warning-enabling flags like -Wall.
3127 # Don't warn about hash_map in third-party code.
3131 # Don't warn about printf format problems.
3132 # This is off by default in gcc but on in Ubuntu's gcc(!).
3136 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3140 # TODO: Fix all warnings on chromeos too.
3141 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3146 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3148 # Don't warn about ignoring the return value from e.g. close().
3149 # This is off by default in some gccs but on by default in others.
3150 # BSD systems do not support this option, since they are usually
3151 # using gcc 4.2.1, which does not have this flag yet.
3152 '-Wno-unused-result',
3157 '_CRT_SECURE_NO_DEPRECATE',
3158 '_CRT_NONSTDC_NO_WARNINGS',
3159 '_CRT_NONSTDC_NO_DEPRECATE',
3160 '_SCL_SECURE_NO_DEPRECATE',
3162 'msvs_disabled_warnings': [
3166 'VCCLCompilerTool': {
3167 'WarningLevel': '3',
3168 'WarnAsError': 'true',
3169 'Detect64BitPortabilityProblems': 'false',
3173 ['buildtype=="Official"', {
3175 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3178 [ 'component=="shared_library"', {
3179 # TODO(darin): Unfortunately, some third_party code depends on base.
3180 'msvs_disabled_warnings': [
3181 4251, # class 'std::xx' needs to have dll-interface.
3187 [ 'OS=="mac" or OS=="ios"', {
3189 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3192 ['buildtype=="Official"', {
3194 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3201 # TODO(ios): Fix remaining warnings in third-party code, then
3202 # remove this; the Mac cleanup didn't get everything that's
3203 # flagged in an iOS build.
3204 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3205 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3206 # Several internal ios directories generate numerous warnings for
3207 # -Wobjc-missing-property-synthesis.
3208 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3214 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3215 'filename_rules.gypi',
3217 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3218 # C99 macros on Mac and Linux.
3220 '__STDC_CONSTANT_MACROS',
3221 '__STDC_FORMAT_MACROS',
3225 # turn on warnings for signed/unsigned mismatch on chromium code.
3227 'VCCLCompilerTool': {
3228 'AdditionalOptions': ['/we4389'],
3232 ['OS=="win" and component=="shared_library"', {
3233 'msvs_disabled_warnings': [
3234 4251, # class 'std::xx' needs to have dll-interface.
3239 ], # target_conditions for 'target_defaults'
3240 'default_configuration': 'Debug',
3242 # VCLinkerTool LinkIncremental values below:
3244 # 1 == /INCREMENTAL:NO
3246 # Debug links incremental, Release does not.
3248 # Abstract base configurations to cover common attributes.
3252 'msvs_configuration_attributes': {
3253 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3254 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3255 'CharacterSet': '1',
3258 'VCCLCompilerTool': {
3259 'AdditionalOptions': [
3264 # Add the default import libs.
3265 'AdditionalDependencies': [
3282 'AdditionalOptions': [
3283 # Suggested by Microsoft Devrel to avoid
3284 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3285 # which started happening more regularly after VS2013 Update 4.
3286 # Needs to be a bit lower for VS2015, or else errors out.
3287 '/maxilksize:0x7ff00000',
3296 'MinimumRequiredVersion': '5.01', # XP.
3297 'TargetMachine': '1',
3299 'VCLibrarianTool': {
3300 'TargetMachine': '1',
3303 'msvs_configuration_platform': 'Win32',
3307 'msvs_configuration_platform': 'x64',
3310 # Make sure to understand http://crbug.com/361720 if you want to
3312 'MinimumRequiredVersion': '5.02', # Server 2003.
3313 'TargetMachine': '17', # x86 - 64
3314 'AdditionalLibraryDirectories!':
3315 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3316 'AdditionalLibraryDirectories':
3317 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3318 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3319 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3321 'VCLibrarianTool': {
3322 'AdditionalLibraryDirectories!':
3323 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3324 'AdditionalLibraryDirectories':
3325 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3326 'TargetMachine': '17', # x64
3333 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3334 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3337 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3339 '<@(debug_extra_cflags)',
3343 'VCCLCompilerTool': {
3344 'Optimization': '<(win_debug_Optimization)',
3345 'PreprocessorDefinitions': ['_DEBUG'],
3346 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3347 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3349 # According to MSVS, InlineFunctionExpansion=0 means
3350 # "default inlining", not "/Ob0".
3351 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3352 ['win_debug_InlineFunctionExpansion==0', {
3353 'AdditionalOptions': ['/Ob0'],
3355 ['win_debug_InlineFunctionExpansion!=""', {
3356 'InlineFunctionExpansion':
3357 '<(win_debug_InlineFunctionExpansion)',
3359 ['win_debug_disable_iterator_debugging==1', {
3360 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3363 # if win_debug_OmitFramePointers is blank, leave as default
3364 ['win_debug_OmitFramePointers==1', {
3365 'OmitFramePointers': 'true',
3367 ['win_debug_OmitFramePointers==0', {
3368 'OmitFramePointers': 'false',
3369 # The above is not sufficient (http://crbug.com/106711): it
3370 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3371 # perform FPO regardless, so we must explicitly disable.
3372 # We still want the false setting above to avoid having
3373 # "/Oy /Oy-" and warnings about overriding.
3374 'AdditionalOptions': ['/Oy-'],
3377 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3380 'LinkIncremental': '<(msvs_debug_link_incremental)',
3381 # ASLR makes debugging with windbg difficult because Chrome.exe and
3382 # Chrome.dll share the same base name. As result, windbg will
3383 # name the Chrome.dll module like chrome_<base address>, where
3384 # <base address> typically changes with each launch. This in turn
3385 # means that breakpoints in Chrome.dll don't stick from one launch
3386 # to the next. For this reason, we turn ASLR off in debug builds.
3387 # Note that this is a three-way bool, where 0 means to pick up
3388 # the default setting, 1 is off and 2 is on.
3389 'RandomizedBaseAddress': 1,
3391 'VCResourceCompilerTool': {
3392 'PreprocessorDefinitions': ['_DEBUG'],
3396 ['OS=="linux" or OS=="android"', {
3397 'target_conditions': [
3398 ['_toolset=="target"', {
3400 '<@(debug_extra_cflags)',
3405 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3406 # Enable libstdc++ debugging facilities to help catch problems
3407 # early, see http://crbug.com/65151 .
3408 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3409 'defines': ['_GLIBCXX_DEBUG=1',],
3411 ['release_valgrind_build==0', {
3414 '-fstack-protector-all', # Implies -fstack-protector
3420 # Allow comparing the address of references and 'this' against 0
3421 # in debug builds. Technically, these can never be null in
3422 # well-defined C/C++ and Clang can optimize such checks away in
3423 # release builds, but they may be used in asserts in debug builds.
3424 '-Wno-undefined-bool-conversion',
3425 '-Wno-tautological-undefined-compare',
3429 '-Wno-undefined-bool-conversion',
3430 '-Wno-tautological-undefined-compare',
3434 'VCCLCompilerTool': {
3435 'AdditionalOptions': [
3436 '-Wno-undefined-bool-conversion',
3437 '-Wno-tautological-undefined-compare',
3450 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3451 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3452 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3455 'VCCLCompilerTool': {
3456 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3458 # In official builds, each target will self-select
3459 # an optimization level.
3460 ['buildtype!="Official"', {
3461 'Optimization': '<(win_release_Optimization)',
3464 # According to MSVS, InlineFunctionExpansion=0 means
3465 # "default inlining", not "/Ob0".
3466 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3467 ['win_release_InlineFunctionExpansion==0', {
3468 'AdditionalOptions': ['/Ob0'],
3470 ['win_release_InlineFunctionExpansion!=""', {
3471 'InlineFunctionExpansion':
3472 '<(win_release_InlineFunctionExpansion)',
3475 # if win_release_OmitFramePointers is blank, leave as default
3476 ['win_release_OmitFramePointers==1', {
3477 'OmitFramePointers': 'true',
3479 ['win_release_OmitFramePointers==0', {
3480 'OmitFramePointers': 'false',
3481 # The above is not sufficient (http://crbug.com/106711): it
3482 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3483 # perform FPO regardless, so we must explicitly disable.
3484 # We still want the false setting above to avoid having
3485 # "/Oy /Oy-" and warnings about overriding.
3486 'AdditionalOptions': ['/Oy-'],
3489 # Put data in separate COMDATs. This allows the linker
3490 # to put bit-identical constants at the same address even if
3491 # they're unrelated constants, which saves binary size.
3492 # This optimization can't be used when ASan is enabled because
3493 # it is not compatible with the ASan ODR checker.
3494 'AdditionalOptions': ['/Gw'],
3497 'AdditionalOptions': [
3498 '/d2Zi+', # Improve debugging of Release builds.
3499 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3500 '<@(win_release_extra_cflags)',
3504 # LinkIncremental is a tri-state boolean, where 0 means default
3505 # (i.e., inherit from parent solution), 1 means false, and
3507 'LinkIncremental': '1',
3508 # This corresponds to the /PROFILE flag which ensures the PDB
3509 # file contains FIXUP information (growing the PDB file by about
3510 # 5%) but does not otherwise alter the output binary. This
3511 # information is used by the Syzygy optimization tool when
3512 # decomposing the release image.
3517 ['msvs_use_common_release', {
3518 'includes': ['release.gypi'],
3520 ['release_valgrind_build==0 and tsan==0', {
3523 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3527 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3528 'MEMORY_SANITIZER_INITIAL_SIZE',
3529 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3530 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3534 'defines': ['NO_TCMALLOC'],
3536 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3537 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3538 # It seems to work fine with Ubuntu 12 headers though, so use it
3539 # in official builds.
3540 ['os_posix==1 and (asan!=1 and msan!=1 and tsan!=1 and lsan!=1 and ubsan!=1) and (OS!="linux" or clang!=1 or buildtype=="Official")', {
3541 'target_conditions': [
3542 ['chromium_code==1', {
3543 # Non-chromium code is not guaranteed to compile cleanly
3544 # with _FORTIFY_SOURCE. Also, fortified build may fail
3545 # when optimizations are disabled, so only do that for Release
3548 '_FORTIFY_SOURCE=2',
3553 ['OS=="linux" or OS=="android"', {
3554 'target_conditions': [
3555 ['_toolset=="target"', {
3557 '<@(release_extra_cflags)',
3560 ['enable_resource_whitelist_generation==1', {
3562 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3571 'NS_BLOCK_ASSERTIONS=1',
3577 # Concrete configurations
3580 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3583 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3588 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3589 'target_conditions': [
3590 [ '_type=="executable"', {
3591 # To get a real .dSYM bundle produced by dsymutil, set the
3592 # debug information format to dwarf-with-dsym. Since
3593 # strip_from_xcode will not be used, set Xcode to do the
3594 # stripping as well.
3596 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3597 'DEPLOYMENT_POSTPROCESSING': 'YES',
3598 'STRIP_INSTALLED_PRODUCT': 'YES',
3605 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3607 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3610 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3618 'target_defaults': {
3623 # TODO(glider): enable the default options on other systems.
3625 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3627 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3633 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3634 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3635 'target_defaults': {
3637 '-Wl,--fatal-warnings',
3641 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3642 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
3643 'target_defaults': {
3649 ['os_posix==1 and chromeos==0', {
3650 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3651 # and we want to avoid overriding this, so stack-protector is only
3652 # enabled when not building on Chrome OS.
3653 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3655 'target_defaults': {
3657 '-fstack-protector',
3658 '--param=ssp-buffer-size=4',
3662 ['os_posix==1 and OS=="linux"', {
3664 '_LARGEFILE_SOURCE',
3665 '_LARGEFILE64_SOURCE',
3666 '_FILE_OFFSET_BITS=64',
3669 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3670 'target_defaults': {
3671 # Enable -Werror by default, but put it in a variable so it can
3672 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3674 'werror%': '-Werror',
3675 'libraries_for_target%': '',
3678 '_FILE_OFFSET_BITS=64',
3681 '<(werror)', # See note above about the werror variable.
3683 '-fno-strict-aliasing', # See http://crbug.com/32204
3685 # Don't warn about unused function params. We use those everywhere.
3686 '-Wno-unused-parameter',
3687 # Don't warn about the "struct foo f = {0};" initialization pattern.
3688 '-Wno-missing-field-initializers',
3689 # Don't export any symbols (for example, to plugins we dlopen()).
3690 # Note: this is *required* to make some plugins work.
3691 '-fvisibility=hidden',
3697 '-fno-threadsafe-statics',
3698 # Make inline functions have hidden visiblity by default.
3699 # Surprisingly, not covered by -fvisibility=hidden.
3700 '-fvisibility-inlines-hidden',
3701 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3702 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3706 '-pthread', '-Wl,-z,noexecstack',
3709 '<(libraries_for_target)',
3714 'debug_optimize%': '0',
3720 '-O>(debug_optimize)',
3724 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3725 # TODO(jdduke) Re-enable on mips after resolving linking
3726 # issues with libc++ (crbug.com/456380).
3728 # Warn in case of text relocations.
3729 '-Wl,--warn-shared-textrel',
3732 ['OS=="android" and android_full_debug==0', {
3733 # Some configurations are copied from Release_Base to reduce
3736 'debug_optimize%': 's',
3740 '-ffunction-sections',
3747 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3748 # We don't omit frame pointers on arm64 since they are required
3749 # to correctly unwind stackframes which contain system library
3750 # function frames (crbug.com/391706).
3752 '-fomit-frame-pointer',
3755 ['OS=="linux" and target_arch=="ia32"', {
3757 '-Wl,--no-as-needed',
3760 ['debug_unwind_tables==1', {
3761 'cflags': ['-funwind-tables'],
3763 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3764 'defines': ['NO_UNWIND_TABLES'],
3766 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3767 # definitions in to the right scope to use them when setting
3768 # linux_use_debug_fission, so it can be used here alone.
3769 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3770 'cflags': ['-gsplit-dwarf'],
3776 'release_optimize%': '2',
3777 # Binaries become big and gold is unable to perform GC
3778 # and remove unused sections for some of test targets
3779 # on 32 bit platform.
3780 # (This is currently observed only in chromeos valgrind bots)
3781 # The following flag is to disable --gc-sections linker
3782 # option for these bots.
3783 'no_gc_sections%': 0,
3785 # TODO(bradnelson): reexamine how this is done if we change the
3786 # expansion of configurations
3787 'release_valgrind_build%': 0,
3790 '-O<(release_optimize)',
3791 # Don't emit the GCC version ident directives, they just end up
3792 # in the .comment section taking up binary size.
3794 # Put data and code in their own sections, so that unused symbols
3795 # can be removed at link time with --gc-sections.
3797 '-ffunction-sections',
3800 # Specifically tell the linker to perform optimizations.
3801 # See http://lwn.net/Articles/192624/ .
3806 ['no_gc_sections==0', {
3808 '-Wl,--gc-sections',
3811 ['OS=="android" and target_arch!="arm64"', {
3812 # We don't omit frame pointers on arm64 since they are required
3813 # to correctly unwind stackframes which contain system library
3814 # function frames (crbug.com/391706).
3816 '-fomit-frame-pointer',
3819 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3820 # TODO(jdduke) Re-enable on mips after resolving linking
3821 # issues with libc++ (crbug.com/456380).
3823 # Warn in case of text relocations.
3824 '-Wl,--warn-shared-textrel',
3829 'release_optimize%': 's',
3834 '-fno-omit-frame-pointer',
3838 ['profiling_full_stack_frames==1', {
3841 '-fno-optimize-sibling-calls',
3846 ['release_unwind_tables==1', {
3847 'cflags': ['-funwind-tables'],
3849 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3850 'defines': ['NO_UNWIND_TABLES'],
3856 ['target_arch=="ia32"', {
3857 'target_conditions': [
3858 ['_toolset=="target"', {
3860 # Needed so that libs with .s files (e.g. libicudata.a)
3861 # are compatible with the general 32-bit-ness.
3864 # All floating-point computations on x87 happens in 80-bit
3865 # precision. Because the C and C++ language standards allow
3866 # the compiler to keep the floating-point values in higher
3867 # precision than what's specified in the source and doing so
3868 # is more efficient than constantly rounding up to 64-bit or
3869 # 32-bit precision as specified in the source, the compiler,
3870 # especially in the optimized mode, tries very hard to keep
3871 # values in x87 floating-point stack (in 80-bit precision)
3872 # as long as possible. This has important side effects, that
3873 # the real value used in computation may change depending on
3874 # how the compiler did the optimization - that is, the value
3875 # kept in 80-bit is different than the value rounded down to
3876 # 64-bit or 32-bit. There are possible compiler options to
3877 # make this behavior consistent (e.g. -ffloat-store would keep
3878 # all floating-values in the memory, thus force them to be
3879 # rounded to its original precision) but they have significant
3880 # runtime performance penalty.
3882 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3883 # which keep floating-point values in SSE registers in its
3884 # native precision (32-bit for single precision, and 64-bit
3885 # for double precision values). This means the floating-point
3886 # value used during computation does not change depending on
3887 # how the compiler optimized the code, since the value is
3888 # always kept in its specified precision.
3890 # Refer to http://crbug.com/348761 for rationale behind SSE2
3891 # being a minimum requirement for 32-bit Linux builds and
3892 # http://crbug.com/313032 for an example where this has "bit"
3897 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3904 # Use gold linker for Android ia32 target.
3914 ['target_arch=="x64"', {
3915 'target_conditions': [
3916 ['_toolset=="target"', {
3918 # Use gold linker for Android x64 target.
3935 ['target_arch=="arm"', {
3936 'target_conditions': [
3937 ['_toolset=="target"', {
3941 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3942 # has changed whenever it encounters a varargs function. This
3943 # silences those warnings, as they are not helpful and
3944 # clutter legitimate warnings.
3948 ['clang==1 and arm_arch!="" and OS!="android"', {
3950 '-target arm-linux-gnueabihf',
3953 '-target arm-linux-gnueabihf',
3958 '-march=<(arm_arch)',
3961 ['use_lto==1 or use_lto_o2==1', {
3963 '-march=<(arm_arch)',
3968 ['clang==1 and OS!="android"', {
3970 # We need to disable clang's builtin assembler as it can't
3971 # handle several asm files, crbug.com/124610
3972 '-no-integrated-as',
3977 '-mtune=<(arm_tune)',
3980 ['use_lto==1 or use_lto_o2==1', {
3982 '-mtune=<(arm_tune)',
3992 ['use_lto==1 or use_lto_o2==1', {
3999 ['arm_float_abi!=""', {
4001 '-mfloat-abi=<(arm_float_abi)',
4004 ['use_lto==1 or use_lto_o2==1', {
4006 '-mfloat-abi=<(arm_float_abi)',
4016 ['use_lto==1 or use_lto_o2==1', {
4024 # Most of the following flags are derived from what Android
4025 # uses by default when building for arm, reference for which
4026 # can be found in the following file in the Android NDK:
4027 # toolchains/arm-linux-androideabi-4.9/setup.mk
4029 # The tree-sra optimization (scalar replacement for
4030 # aggregates enabling subsequent optimizations) leads to
4031 # invalid code generation when using the Android NDK's
4032 # compiler (r5-r7). This can be verified using
4033 # webkit_unit_tests' WTF.Checked_int8_t test.
4035 # The following option is disabled to improve binary
4036 # size and performance in gcc 4.9.
4037 '-fno-caller-saves',
4040 # Android now supports .relro sections properly.
4041 # NOTE: While these flags enable the generation of .relro
4042 # sections, the generated libraries can still be loaded on
4043 # older Android platform versions.
4050 ['gcc_version==48 and clang==0', {
4052 # The following 5 options are disabled to save on
4053 # binary size in GCC 4.8.
4054 '-fno-partial-inlining',
4055 '-fno-early-inlining',
4056 '-fno-tree-copy-prop',
4057 '-fno-tree-loop-optimize',
4058 '-fno-move-loop-invariants',
4062 'cflags': [ '-mthumb-interwork' ],
4066 # Thumb code with frame pointer makes chrome crash
4069 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
4070 # The perf report sometimes incorrectly attributes
4071 # code from tail calls.
4072 '-fno-optimize-sibling-calls',
4075 '-fomit-frame-pointer',
4080 # Clang does not support the following options.
4082 '-mthumb-interwork',
4083 '-finline-limit=64',
4085 '-fno-caller-saves',
4089 # TODO(hans) Enable integrated-as (crbug.com/124610).
4090 '-no-integrated-as',
4091 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4094 ['clang==1 and linux_use_bundled_gold==0', {
4096 # Let clang find the ld.gold in the NDK.
4097 '--gcc-toolchain=<(android_toolchain)/..',
4102 '-marm', # Required for frame pointer based stack traces.
4109 # We set arm_arch to "" so that -march compiler option
4110 # is not set. Otherwise a gcc bug that would complain
4111 # about it conflicting with '-mcpu=cortex-a9'. The flag
4112 # '-march=armv7-a' is actually redundant anyway because
4113 # it is enabled by default when we built the toolchain.
4114 # And using '-mcpu=cortex-a9' should be sufficient.
4117 # Breakpad requires symbols with debugging information
4121 # We want to statically link libstdc++/libgcc_s.
4122 '-static-libstdc++',
4126 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4127 # define their own cflags for arm builds that could
4128 # conflict with the flags we set here (e.g.
4129 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4138 ['target_arch=="arm64"', {
4139 'target_conditions': [
4140 ['_toolset=="target"', {
4144 '-fstack-protector', # stack protector is always enabled on arm64.
4151 ['target_arch=="mipsel"', {
4152 'target_conditions': [
4153 ['_toolset=="target"', {
4155 ['mips_arch_variant=="r6"', {
4158 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ],
4159 'ldflags': [ '-target mipsel-linux-gnu', ],
4161 'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
4163 ['clang==0 and OS=="android"', {
4164 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4168 ['mips_arch_variant=="r2"', {
4170 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4171 'cflags': ['-m<(mips_fpu_mode)'],
4176 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
4177 'ldflags': [ '-target mipsel-linux-android', ],
4179 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32r2'],
4180 'ldflags': [ '-target mipsel-linux-gnu', ],
4184 'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
4188 ['mips_arch_variant=="r1"', {
4193 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
4194 'ldflags': [ '-target mipsel-linux-android', ],
4196 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32'],
4197 'ldflags': [ '-target mipsel-linux-gnu', ],
4201 'cflags': ['-mips32', '-Wa,-mips32', ],
4207 # Clang does not support the following options.
4208 '-finline-limit=64',
4211 # TODO(gordanac) Enable integrated-as.
4212 '-no-integrated-as',
4215 ['clang==1 and OS=="android"', {
4217 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4220 # Let clang find the ld in the NDK.
4221 '--gcc-toolchain=<(android_toolchain)/..',
4224 ['mips_dsp_rev==1', {
4225 'cflags': ['-mdsp'],
4227 ['mips_dsp_rev==2', {
4228 'cflags': ['-mdspr2'],
4232 '-m<(mips_float_abi)-float'
4235 '-Wl,--no-keep-memory'
4238 '-Wno-uninitialized',
4243 ['target_arch=="mips64el"', {
4244 'target_conditions': [
4245 ['_toolset=="target"', {
4247 ['mips_arch_variant=="r6"', {
4248 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4249 'ldflags': ['-mips64r6'],
4251 ['mips_arch_variant=="r2"', {
4252 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4253 'ldflags': ['-mips64r2'],
4257 '-Wno-uninitialized',
4271 'target_conditions': [
4272 ['_toolset=="target"', {
4274 '--sysroot=<(sysroot)',
4277 '--sysroot=<(sysroot)',
4278 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4284 # TODO(thakis): Remove, http://crbug.com/263960
4285 '-Wno-reserved-user-defined-literal',
4288 # gnu++11 instead of c++11 is needed because some code uses
4289 # typeof() (a GNU extension).
4290 # TODO(thakis): Eventually switch this to c++11 instead,
4291 # http://crbug.com/427584
4295 ['clang==0 and host_clang==1', {
4296 'target_conditions': [
4297 ['_toolset=="host"', {
4298 'cflags_cc': [ '-std=gnu++11', ],
4302 ['clang==1 and clang_use_chrome_plugins==1', {
4304 '<@(clang_chrome_plugins_flags)',
4307 ['clang==1 and clang_load!=""', {
4309 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4312 ['clang==1 and clang_add_plugin!=""', {
4314 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4317 ['clang==1 and target_arch=="ia32"', {
4319 # Else building libyuv gives clang's register allocator issues,
4320 # see llvm.org/PR15798 / crbug.com/233709
4321 '-momit-leaf-frame-pointer',
4322 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4323 '-mstack-alignment=16',
4327 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4329 # See http://crbug.com/110262
4330 '-fcolor-diagnostics',
4333 # Common options for AddressSanitizer, LeakSanitizer,
4334 # ThreadSanitizer and MemorySanitizer.
4335 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4336 'target_conditions': [
4337 ['_toolset=="target"', {
4339 '-fno-omit-frame-pointer',
4340 '-gline-tables-only',
4343 '-fomit-frame-pointer',
4348 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4349 'target_conditions': [
4350 ['_toolset=="target"', {
4352 # Functions interposed by the sanitizers can make ld think
4353 # that some libraries aren't needed when they actually are,
4354 # http://crbug.com/234010. As workaround, disable --as-needed.
4358 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4359 'MEMORY_SANITIZER_INITIAL_SIZE',
4365 'target_conditions': [
4366 ['_toolset=="target"', {
4368 '-fsanitize=address',
4369 # TODO(earthdok): Re-enable. http://crbug.com/427202
4370 #'-fsanitize-blacklist=<(asan_blacklist)',
4373 '-fsanitize=address',
4380 '-mllvm -asan-globals=0', # http://crbug.com/352073
4386 'target_conditions': [
4387 ['_toolset=="target"', {
4389 # FIXME: work on enabling more flags and getting rid of false
4390 # positives. http://crbug.com/174801.
4391 '-fsanitize=bounds',
4392 '-fsanitize=float-divide-by-zero',
4393 '-fsanitize=integer-divide-by-zero',
4395 '-fsanitize=object-size',
4396 '-fsanitize=return',
4397 '-fsanitize=returns-nonnull-attribute',
4398 '-fsanitize=shift-exponent',
4399 '-fsanitize=signed-integer-overflow',
4400 '-fsanitize=unreachable',
4401 '-fsanitize=vla-bound',
4402 '-fsanitize-blacklist=<(ubsan_blacklist)',
4403 # Employ the experimental PBQP register allocator to avoid
4404 # slow compilation on files with too many basic blocks.
4405 # See http://crbug.com/426271.
4406 '-mllvm -regalloc=pbqp',
4407 # Speculatively use coalescing to slightly improve the code
4408 # generated by PBQP regallocator. May increase compile time.
4409 '-mllvm -pbqp-coalescing',
4418 '-fsanitize=undefined',
4421 'UNDEFINED_SANITIZER',
4427 'target_conditions': [
4428 ['_toolset=="target"', {
4431 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4443 'UNDEFINED_SANITIZER',
4448 ['asan_coverage!=0 and sanitizer_coverage==0', {
4449 'target_conditions': [
4450 ['_toolset=="target"', {
4452 '-fsanitize-coverage=<(asan_coverage)',
4455 'SANITIZER_COVERAGE',
4460 ['sanitizer_coverage!=0', {
4461 'target_conditions': [
4462 ['_toolset=="target"', {
4464 '-fsanitize-coverage=<(sanitizer_coverage)',
4467 'SANITIZER_COVERAGE',
4472 ['asan_field_padding!=0', {
4473 'target_conditions': [
4474 ['_toolset=="target"', {
4476 '-fsanitize-address-field-padding=<(asan_field_padding)',
4482 'target_conditions': [
4483 ['_toolset=="target"', {
4492 'WTF_USE_LEAK_SANITIZER=1',
4498 'target_conditions': [
4499 ['_toolset=="target"', {
4501 '-fsanitize=thread',
4502 '-fsanitize-blacklist=<(tsan_blacklist)',
4505 '-fsanitize=thread',
4509 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4510 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4516 'target_conditions': [
4517 ['_toolset=="target"', {
4519 '-fsanitize=memory',
4520 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4521 '-fsanitize-blacklist=<(msan_blacklist)',
4524 '-fsanitize=memory',
4532 ['use_instrumented_libraries==1', {
4534 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4537 ['use_prebuilt_instrumented_libraries==1', {
4539 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
4542 ['use_custom_libcxx==1', {
4544 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4547 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4548 'target_conditions' : [
4549 # crazy_linker has an upstream gyp file we can't edit, and we
4550 # don't want to instrument it.
4551 ['_toolset=="target" and _target_name!="crazy_linker"', {
4553 '-finstrument-functions',
4554 # Allow mmx intrinsics to inline, so that the
4555 #0 compiler can expand the intrinsics.
4556 '-finstrument-functions-exclude-file-list=mmintrin.h',
4559 ['_toolset=="target" and OS=="android"', {
4561 # Avoids errors with current NDK:
4562 # "third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/include/arm_neon.h:3426:3: error: argument must be a constant"
4563 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4568 ['linux_dump_symbols==1', {
4571 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4572 'target_conditions': [
4573 ['_toolset=="target"', {
4575 # Attempt to use less memory to prevent the linker from
4576 # running out of address space. Considering installing a
4577 # 64-bit kernel and switching to a 64-bit linker.
4578 '-Wl,--no-keep-memory',
4585 ['use_allocator!="tcmalloc"', {
4586 'defines': ['NO_TCMALLOC'],
4588 ['linux_use_gold_flags==1', {
4589 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4591 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4592 'ldflags': [ '-fuse-ld=gold', ],
4594 'target_conditions': [
4595 ['_toolset=="target"', {
4597 # Experimentation found that using four linking threads
4598 # saved ~20% of link time.
4599 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4600 # Only apply this to the target linker, since the host
4601 # linker might not be gold, but isn't used much anyway.
4602 # TODO(raymes): Disable threading because gold is frequently
4603 # crashing on the bots: crbug.com/161942.
4605 # '-Wl,--thread-count=4',
4608 # TODO(thestig): Enable this for disabled cases.
4609 [ '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_vptr==0', {
4611 '-Wl,--detect-odr-violations',
4618 ['release_valgrind_build==0 and order_profiling==0 and asan==0 and msan==0 and lsan==0 and tsan==0', {
4619 'target_conditions': [
4620 ['_toolset=="target"', {
4622 '-Wl,--icf=<(gold_icf_level)',
4629 ['linux_use_bundled_binutils==1', {
4631 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4634 ['linux_use_bundled_gold==1 and '
4635 'not (clang==0 and (use_lto==1 or use_lto_o2==1))', {
4636 # Put our binutils, which contains gold in the search path. We pass
4637 # the path to gold to the compiler. gyp leaves unspecified what the
4638 # cwd is when running the compiler, so the normal gyp path-munging
4639 # fails us. This hack gets the right path.
4641 # Disabled when using GCC LTO because GCC also uses the -B search
4642 # path at link time to find "as", and our bundled "as" can only
4645 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4648 # Some binutils 2.23 releases may or may not have new dtags enabled,
4649 # but they are all compatible with --disable-new-dtags,
4650 # because the new dynamic tags are not created by default.
4651 ['binutils_version>=223', {
4652 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4653 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4654 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4655 # inside this file to allow usage of --no-as-needed and removal of
4658 '-Wl,--disable-new-dtags',
4661 ['gcc_version>=47 and clang==0', {
4662 'target_conditions': [
4663 ['_toolset=="target"', {
4666 # See comment for -Wno-c++11-narrowing.
4668 # TODO(thakis): Remove, http://crbug.com/263960
4669 '-Wno-literal-suffix',
4674 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4675 'target_conditions': [
4676 ['_toolset=="host"', {
4679 # See comment for -Wno-c++11-narrowing.
4681 # TODO(thakis): Remove, http://crbug.com/263960
4682 '-Wno-literal-suffix',
4690 # FreeBSD-specific options; note that most FreeBSD options are set above,
4693 'target_defaults': {
4695 '-Wl,--no-keep-memory',
4699 # Android-specific options; note that most are set above with Linux.
4702 # This is a unique identifier for a given build. It's used for
4703 # identifying various build artifacts corresponding to a particular
4704 # build of chrome (e.g. where to find archived symbols).
4705 'chrome_build_id%': '',
4707 # Figure this out early since it needs symbols from libgcc.a, so it
4708 # has to be before that in the set of libraries.
4709 ['component=="shared_library"', {
4710 'android_libcpp_library': 'c++_shared',
4712 'android_libcpp_library': 'c++_static',
4716 # Placing this variable here prevents from forking libvpx, used
4717 # by remoting. Remoting is off, so it needn't built,
4718 # so forking it's deps seems like overkill.
4719 # But this variable need defined to properly run gyp.
4720 # A proper solution is to have an OS==android conditional
4721 # in third_party/libvpx/libvpx.gyp to define it.
4722 'libvpx_path': 'lib/linux/arm',
4724 'target_defaults': {
4726 'release_extra_cflags%': '',
4728 # If we're using the components build, append "cr" to all shared
4729 # libraries to avoid naming collisions with android system library
4730 # versions with the same name (e.g. skia, icu).
4731 ['component=="shared_library"', {
4732 'android_product_extension': 'cr.so',
4734 'android_product_extension': 'so',
4738 'target_conditions': [
4739 ['_type=="shared_library"', {
4740 'product_extension': '<(android_product_extension)',
4743 # Settings for building device targets using Android's toolchain.
4744 # These are based on the setup.mk file from the Android NDK.
4746 # The NDK Android executable link step looks as follows:
4748 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4749 # $(PRIVATE_OBJECTS) <-- The .o that we built
4750 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4751 # $(TARGET_LIBGCC) <-- libgcc.a
4752 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4753 # $(PRIVATE_LDLIBS) <-- System .so
4754 # $(TARGET_CRTEND_O) <-- crtend.o
4756 # For now the above are approximated for executables by adding
4757 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4760 # The NDK Android shared library link step looks as follows:
4762 # $(PRIVATE_OBJECTS) <-- The .o that we built
4763 # -l,--whole-archive
4764 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4765 # -l,--no-whole-archive
4766 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4767 # $(TARGET_LIBGCC) <-- libgcc.a
4768 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4769 # $(PRIVATE_LDLIBS) <-- System .so
4771 # For now, assume that whole static libraries are not needed.
4773 # For both executables and shared libraries, add the proper
4774 # libgcc.a to the start of libraries which puts it in the
4775 # proper spot after .o and .a files get linked in.
4777 # TODO: The proper thing to do longer-tem would be proper gyp
4778 # support for a custom link command line.
4779 ['_toolset=="target"', {
4781 '-pthread', # Not supported by Android toolchain.
4784 '-ffunction-sections',
4787 '-fstack-protector',
4789 '-finline-limit=64',
4790 '<@(release_extra_cflags)',
4791 '--sysroot=<(android_ndk_sysroot)',
4792 # NOTE: The libc++ header include paths below are specified in
4793 # cflags rather than include_dirs because they need to come
4794 # after include_dirs.
4795 # The include ordering here is important; change with caution.
4796 '-isystem<(android_libcpp_include)',
4797 '-isystem<(android_ndk_root)/sources/cxx-stl/llvm-libc++abi/libcxxabi/include',
4798 '-isystem<(android_ndk_root)/sources/android/support/include',
4802 '__GNU_SOURCE=1', # Necessary for clone()
4803 'CHROME_BUILD_ID="<(chrome_build_id)"',
4804 # The NDK has these things, but doesn't define the constants
4805 # to say that it does. Define them here instead.
4809 '-pthread', # Not supported by Android toolchain.
4812 '-Wl,--build-id=sha1',
4813 '-Wl,--no-undefined',
4814 '--sysroot=<(android_ndk_sysroot)',
4816 '-L<(android_libcpp_libs_dir)',
4817 # Don't allow visible symbols from libgcc or libc++ to be
4819 '-Wl,--exclude-libs=libgcc.a',
4820 '-Wl,--exclude-libs=libc++_static.a',
4821 # Don't allow visible symbols from libraries that contain
4822 # assembly code with symbols that aren't hidden properly.
4823 # http://crbug.com/448386
4824 '-Wl,--exclude-libs=libcommon_audio.a',
4825 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4826 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4827 '-Wl,--exclude-libs=libiSACFix.a',
4828 '-Wl,--exclude-libs=libisac_neon.a',
4829 '-Wl,--exclude-libs=libopus.a',
4830 '-Wl,--exclude-libs=libvpx.a',
4833 '-l<(android_libcpp_library)',
4835 # Manually link the libgcc.a that the cross compiler uses.
4836 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4842 ['component=="static_library"', {
4843 'target_conditions': [
4844 ['use_native_jni_exports==0', {
4845 # Use a linker version script to strip JNI exports from
4846 # binaries which have not specifically asked to use them.
4848 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4855 # Clang with libc++ does not require an explicit atomic
4856 # library reference.
4860 # Work around incompatibilities between bionic and clang
4862 '-D__compiler_offsetof=__builtin_offsetof',
4863 '-Dnan=__builtin_nan',
4866 ['target_arch=="arm"', {
4868 '-target arm-linux-androideabi',
4871 '-target arm-linux-androideabi',
4874 ['target_arch=="ia32"', {
4876 '-target x86-linux-androideabi',
4879 '-target x86-linux-androideabi',
4882 # Place holder for x64 support, not tested.
4883 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4884 ['target_arch=="x64"', {
4886 '-target x86_64-linux-androideabi',
4889 '-target x86_64-linux-androideabi',
4896 # Android build relies on -Wl,--gc-sections removing
4897 # unreachable code. ASan instrumentation for globals inhibits
4898 # this and results in a library with unresolvable relocations.
4899 # TODO(eugenis): find a way to reenable this.
4900 '-mllvm -asan-globals=0',
4903 ['target_arch == "arm" and order_profiling==0', {
4905 # Enable identical code folding to reduce size.
4906 '-Wl,--icf=<(gold_icf_level)',
4909 ['target_arch=="ia32"', {
4910 # The x86 toolchain currently has problems with stack-protector.
4912 '-fstack-protector',
4915 '-fno-stack-protector',
4919 'target_conditions': [
4920 ['_type=="executable"', {
4921 # Force android tools to export the "main" symbol so they can be
4922 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4923 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4924 # when ICS support will be dropped.
4927 '-fvisibility=default',
4931 '-Wl,--gc-sections',
4932 '-Wl,-z,nocopyreloc',
4935 # crtbegin_dynamic.o should be the last item in ldflags.
4936 '<(android_ndk_lib)/crtbegin_dynamic.o',
4939 # crtend_android.o needs to be the last item in libraries.
4940 # Do not add any libraries after this!
4941 '<(android_ndk_lib)/crtend_android.o',
4944 ['_type=="shared_library" or _type=="loadable_module"', {
4946 '-Wl,-shared,-Bsymbolic',
4947 # crtbegin_so.o should be the last item in ldflags.
4948 '<(android_ndk_lib)/crtbegin_so.o',
4951 # crtend_so.o needs to be the last item in libraries.
4952 # Do not add any libraries after this!
4953 '<(android_ndk_lib)/crtend_so.o',
4958 # Settings for building host targets using the system toolchain.
4959 ['_toolset=="host"', {
4961 # Due to issues in Clang build system, using ASan on 32-bit
4962 # binaries on x86_64 host is problematic.
4963 # TODO(eugenis): re-enable.
4964 '-fsanitize=address',
4967 '-fsanitize=address',
4968 '-Wl,-z,noexecstack',
4969 '-Wl,--gc-sections',
4972 '-Wl,--warn-shared-textrel',
4973 '-Wl,--fatal-warnings',
4976 # Settings for building host targets on mac.
4977 ['_toolset=="host" and host_os=="mac"', {
4987 'cflags!': ['-fvisibility=hidden'],
4988 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4990 ['OS=="mac" or OS=="ios"', {
4991 'target_defaults': {
4994 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4995 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4996 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4997 'COPY_PHASE_STRIP': 'NO',
4998 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4999 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
5000 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
5001 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
5002 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
5003 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
5004 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
5005 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
5006 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
5007 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
5008 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
5009 'GCC_VERSION': '4.2',
5010 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
5011 'USE_HEADERMAP': 'NO',
5016 # Don't warn about unused function parameters.
5017 '-Wno-unused-parameter',
5018 # Don't warn about the "struct foo f = {0};" initialization
5020 '-Wno-missing-field-initializers',
5023 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
5024 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
5026 # Note that the prebuilt Clang binaries should not be used for iOS
5027 # development except for ASan builds.
5029 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
5030 # Warn if automatic synthesis is triggered with
5031 # the -Wobjc-missing-property-synthesis flag.
5032 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
5033 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
5035 # This warns on selectors from Cocoa headers (-length, -set).
5036 # cfe-dev is currently discussing the merits of this warning.
5037 # TODO(thakis): Reevaluate what to do with this, based one
5038 # cfe-dev discussion.
5039 '-Wno-selector-type-mismatch',
5042 ['clang_xcode==0', {
5043 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
5044 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
5048 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
5050 '<@(clang_chrome_plugins_flags)',
5053 ['clang==1 and clang_xcode==0 and clang_load!=""', {
5055 '-Xclang', '-load', '-Xclang', '<(clang_load)',
5058 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
5060 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
5063 ['clang==1 and "<(GENERATOR)"=="ninja"', {
5065 # See http://crbug.com/110262
5066 '-fcolor-diagnostics',
5069 ['OS=="ios" and target_subarch!="arm32" and \
5070 "<(GENERATOR)"=="xcode"', {
5072 # TODO(ios): when building Chrome for iOS on 64-bit platform
5073 # with Xcode, the -Wshorted-64-to-32 warning is automatically
5074 # enabled. This cause failures when compiling protobuf code,
5075 # so disable the warning. http://crbug.com/359107
5076 '-Wno-shorten-64-to-32',
5084 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
5090 '-fsanitize=address',
5091 '-mllvm -asan-globals=0', # http://crbug.com/352073
5092 '-gline-tables-only',
5096 ['asan_coverage!=0 and sanitizer_coverage==0', {
5097 'target_conditions': [
5098 ['_toolset=="target"', {
5100 '-fsanitize-coverage=<(asan_coverage)',
5103 'SANITIZER_COVERAGE',
5108 ['sanitizer_coverage!=0', {
5109 'target_conditions': [
5110 ['_toolset=="target"', {
5112 '-fsanitize-coverage=<(sanitizer_coverage)',
5115 'SANITIZER_COVERAGE',
5121 'target_conditions': [
5122 ['_type!="static_library"', {
5123 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5128 '-fsanitize=address',
5132 ['mac_write_linker_maps==1', {
5135 '-Wl,-map,>(_target_name).map',
5142 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5143 'target_conditions': [
5144 ['_type=="executable"', {
5150 # Define copy_asan_dylib_path in a variable ending in
5151 # _path so that gyp understands it's a path and
5152 # performs proper relativization during dict merging.
5153 'copy_asan_dylib_path':
5154 'mac/copy_asan_runtime_dylib.sh',
5156 'postbuild_name': 'Copy ASan runtime dylib',
5158 '<(copy_asan_dylib_path)',
5167 ], # target_conditions
5168 }, # target_defaults
5169 }], # OS=="mac" or OS=="ios"
5171 'target_defaults': {
5173 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5174 # with common names, like 'check', 'require', and 'verify'.
5175 # (Included by system header. Also exists on iOS but not included.)
5176 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5177 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5180 # These should end with %, but there seems to be a bug with % in
5181 # variables that are intended to be set to different values in
5182 # different targets, like these.
5183 'mac_pie': 1, # Most executables can be position-independent.
5184 # Strip debugging symbols from the target.
5185 'mac_strip': '<(mac_strip_release)',
5189 ['mac_want_real_dsym=="default"', {
5192 'mac_real_dsym': '<(mac_want_real_dsym)'
5197 ['mac_want_real_dsym=="default"', {
5198 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5200 'mac_real_dsym': '<(mac_want_real_dsym)'
5209 ['branding=="Chrome" and buildtype=="Official"', {
5212 # The Google Chrome Framework dSYM generated by dsymutil has
5213 # grown larger than 4GB, which dsymutil can't handle. Reduce
5214 # the amount of debug symbols.
5215 '-fno-standalone-debug', # See http://crbug.com/479841
5220 }, # configuration "Release"
5223 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5224 # (Equivalent to -fPIC)
5225 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5226 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5227 # Keep pch files below xcodebuild/.
5228 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5230 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5231 # xcode_setting, but not until all downstream projects' mac bots are
5232 # using xcode >= 4.6, because that's when the default value of the
5233 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5234 # setting is a no-op as far as xcode is concerned, but the compiler
5235 # behaves differently based on whether -fno-strict-aliasing is
5237 '-fno-strict-aliasing', # See http://crbug.com/32204.
5240 'target_conditions': [
5241 ['_type=="executable"', {
5244 # Arranges for data (heap) pages to be protected against
5245 # code execution when running on Mac OS X 10.7 ("Lion"), and
5246 # ensures that the position-independent executable (PIE) bit
5247 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5249 # Define change_mach_o_flags in a variable ending in _path
5250 # so that GYP understands it's a path and performs proper
5251 # relativization during dict merging.
5252 'change_mach_o_flags_path':
5253 'mac/change_mach_o_flags_from_xcode.sh',
5254 'change_mach_o_flags_options%': [
5256 'target_conditions': [
5257 ['mac_pie==0 or release_valgrind_build==1', {
5258 # Don't enable PIE if it's unwanted. It's unwanted if
5259 # the target specifies mac_pie=0 or if building for
5260 # Valgrind, because Valgrind doesn't understand slide.
5261 # See the similar mac_pie/release_valgrind_build check
5263 'change_mach_o_flags_options': [
5269 'postbuild_name': 'Change Mach-O Flags',
5271 '<(change_mach_o_flags_path)',
5272 '>@(change_mach_o_flags_options)',
5276 'target_conditions': [
5277 ['mac_pie==1 and release_valgrind_build==0', {
5278 # Turn on position-independence (ASLR) for executables. When
5279 # PIE is on for the Chrome executables, the framework will
5280 # also be subject to ASLR.
5281 # Don't do this when building for Valgrind, because Valgrind
5282 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5283 # understand slide, and get rid of the Valgrind check.
5286 '-Wl,-pie', # Position-independent executable (MH_PIE)
5292 ['(_type=="executable" or _type=="shared_library" or \
5293 _type=="loadable_module") and mac_strip!=0', {
5294 'target_conditions': [
5295 ['mac_real_dsym == 1', {
5296 # To get a real .dSYM bundle produced by dsymutil, set the
5297 # debug information format to dwarf-with-dsym. Since
5298 # strip_from_xcode will not be used, set Xcode to do the
5299 # stripping as well.
5303 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5304 'DEPLOYMENT_POSTPROCESSING': 'YES',
5305 'STRIP_INSTALLED_PRODUCT': 'YES',
5307 # Only strip non-ASan builds.
5309 'target_conditions': [
5310 ['_type=="shared_library" or _type=="loadable_module"', {
5311 # The Xcode default is to strip debugging symbols
5312 # only (-S). Local symbols should be stripped as
5313 # well, which will be handled by -x. Xcode will
5314 # continue to insert -S when stripping even when
5315 # additional flags are added with STRIPFLAGS.
5317 }], # _type=="shared_library" or _type=="loadable_module"
5318 ], # target_conditions
5324 }, # configuration "Release"
5326 }, { # mac_real_dsym != 1
5327 # To get a fast fake .dSYM bundle, use a post-build step to
5328 # produce the .dSYM and strip the executable. strip_from_xcode
5329 # only operates in the Release configuration.
5333 # Define strip_from_xcode in a variable ending in _path
5334 # so that gyp understands it's a path and performs proper
5335 # relativization during dict merging.
5336 'strip_from_xcode_path': 'mac/strip_from_xcode',
5338 'postbuild_name': 'Strip If Needed',
5339 'action': ['<(strip_from_xcode_path)'],
5343 ], # target_conditions
5344 }], # (_type=="executable" or _type=="shared_library" or
5345 # _type=="loadable_module") and mac_strip!=0
5346 ], # target_conditions
5347 }, # target_defaults
5351 'ios/coverage.gypi',
5353 'target_defaults': {
5354 'xcode_settings' : {
5355 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5358 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5359 # additional flag to suppress the "unknown compiler option" error.
5360 # Restrict this flag to builds that are either compiling with Xcode
5361 # or compiling with Xcode's Clang. This will allow Ninja builds to
5362 # continue failing on unknown compiler options.
5363 # TODO(rohitrao): This flag is temporary and should be removed as
5364 # soon as the iOS bots are updated to use Xcode 5.1.
5365 ['clang_xcode==1', {
5367 '-Wno-unknown-warning-option',
5368 # It's not possible to achieve nullability completeness before
5369 # all builders are running Xcode 7. crbug.com/499809
5370 '-Wno-nullability-completeness',
5374 # Limit the valid architectures depending on "target_subarch".
5375 # This need to include the "arm" architectures but also the "x86"
5376 # ones (they are used when building for the simulator).
5377 ['target_subarch=="arm32"', {
5378 'VALID_ARCHS': ['armv7', 'i386'],
5380 ['target_subarch=="arm64"', {
5381 'VALID_ARCHS': ['arm64', 'x86_64'],
5383 ['target_subarch=="both"', {
5384 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5386 ['use_system_libcxx==1', {
5387 'target_conditions': [
5388 # Only use libc++ when building target for iOS not when building
5389 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5390 # does not support libc++.
5391 ['_toolset=="target"', {
5392 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5396 # The default for deployment target of 7.0+ is libc++, so force
5397 # the old behavior unless libc++ is enabled.
5398 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5402 'target_conditions': [
5403 ['_toolset=="host"', {
5405 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5406 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5415 ['_toolset=="target"', {
5417 # This section should be for overriding host settings. But,
5418 # since we can't negate the iphone deployment target above, we
5419 # instead set it here for target only.
5420 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5421 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5424 ['_type=="executable"', {
5428 'DEPLOYMENT_POSTPROCESSING': 'YES',
5429 'STRIP_INSTALLED_PRODUCT': 'YES',
5434 # Remove dSYM to reduce build time.
5435 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5441 ['chromium_ios_signing', {
5442 # iOS SDK wants everything for device signed.
5443 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5445 'CODE_SIGNING_REQUIRED': 'NO',
5446 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5451 ], # target_conditions
5452 }, # target_defaults
5455 'target_defaults': {
5457 '_WIN32_WINNT=0x0603',
5464 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5465 'WIN32_LEAN_AND_MEAN',
5468 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5469 '_HAS_EXCEPTIONS=0',
5470 # Silence some warnings; we can't switch the the 'recommended'
5471 # versions as they're not available on old OSs.
5472 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5475 ['buildtype=="Official"', {
5476 # In official builds, targets can self-select an optimization
5477 # level by defining a variable named 'optimize', and setting it
5479 # - "size", optimizes for minimal code size - the default.
5480 # - "speed", optimizes for speed over code size.
5481 # - "max", whole program optimization and link-time code
5482 # generation. This is very expensive and should be used
5485 'optimize%': 'size',
5489 # Set /LTCG for the official builds.
5490 'LinkTimeCodeGeneration': '1',
5491 'AdditionalOptions': [
5492 # Set the number of LTCG code-gen threads to eight.
5493 # The default is four. This gives a 5-10% link speedup.
5498 'target_conditions': [
5499 ['optimize=="size"', {
5501 'VCCLCompilerTool': {
5502 # 1, optimizeMinSpace, Minimize Size (/O1)
5503 'Optimization': '1',
5504 # 2, favorSize - Favor small code (/Os)
5505 'FavorSizeOrSpeed': '2',
5510 # This config is used to avoid a problem in ffmpeg, see
5511 # http://crbug.com/264459.
5512 ['optimize=="size_no_ltcg"', {
5514 'VCCLCompilerTool': {
5515 # 1, optimizeMinSpace, Minimize Size (/O1)
5516 'Optimization': '1',
5517 # 2, favorSize - Favor small code (/Os)
5518 'FavorSizeOrSpeed': '2',
5523 ['optimize=="speed"', {
5525 'VCCLCompilerTool': {
5526 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5527 'Optimization': '2',
5528 # 1, favorSpeed - Favor fast code (/Ot)
5529 'FavorSizeOrSpeed': '1',
5534 ['optimize=="max"', {
5535 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5536 # builds. Probably anything that this would catch that
5537 # wouldn't be caught in a normal build isn't going to
5538 # actually be a bug, so the incremental value of C4702 for
5539 # PGO builds is likely very small.
5540 'msvs_disabled_warnings': [
5544 'VCCLCompilerTool': {
5545 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5546 'Optimization': '2',
5547 # 1, favorSpeed - Favor fast code (/Ot)
5548 'FavorSizeOrSpeed': '1',
5549 # This implies link time code generation.
5550 'WholeProgramOptimization': 'true',
5558 ['msvs_xtree_patched!=1', {
5559 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5560 # it's enabled. This will generally only be true for system-level
5561 # installed Express users.
5562 'msvs_disabled_warnings': [
5567 'msvs_system_include_dirs': [
5568 '<(windows_sdk_path)/Include/shared',
5569 '<(windows_sdk_path)/Include/um',
5570 '<(windows_sdk_path)/Include/winrt',
5571 '$(VSInstallDir)/VC/atlmfc/include',
5573 'msvs_cygwin_shell': 0,
5574 'msvs_disabled_warnings': [
5575 # C4091: 'typedef ': ignored on left of 'X' when no variable is
5577 # This happens in a number of Windows headers. Dumb.
5580 # C4127: conditional expression is constant
5581 # This warning can in theory catch dead code and other problems, but
5582 # triggers in far too many desirable cases where the conditional
5583 # expression is either set by macros or corresponds some legitimate
5584 # compile-time constant expression (due to constant template args,
5585 # conditionals comparing the sizes of different types, etc.). Some of
5586 # these can be worked around, but it's not worth it.
5589 # C4351: new behavior: elements of array 'array' will be default
5591 # This is a silly "warning" that basically just alerts you that the
5592 # compiler is going to actually follow the language spec like it's
5593 # supposed to, instead of not following it like old buggy versions
5594 # did. There's absolutely no reason to turn this on.
5597 # C4355: 'this': used in base member initializer list
5598 # It's commonly useful to pass |this| to objects in a class'
5599 # initializer list. While this warning can catch real bugs, most of
5600 # the time the constructors in question don't attempt to call methods
5601 # on the passed-in pointer (until later), and annotating every legit
5602 # usage of this is simply more hassle than the warning is worth.
5605 # C4503: 'identifier': decorated name length exceeded, name was
5607 # This only means that some long error messages might have truncated
5608 # identifiers in the presence of lots of templates. It has no effect
5609 # on program correctness and there's no real reason to waste time
5610 # trying to prevent it.
5613 # Warning C4589 says: "Constructor of abstract class ignores
5614 # initializer for virtual base class." Disable this warning because it
5615 # is flaky in VS 2015 RTM. It triggers on compiler generated
5616 # copy-constructors in some cases.
5619 # C4611: interaction between 'function' and C++ object destruction is
5621 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5622 # suggests using exceptions instead of setjmp/longjmp for C++, but
5623 # Chromium code compiles without exception support. We therefore have
5624 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5625 # means we have to turn off this warning (and be careful about how
5626 # object destruction happens in such cases).
5629 # TODO(maruel): These warnings are level 4. They will be slowly
5630 # removed as code is fixed.
5631 4100, # Unreferenced formal parameter
5632 4121, # Alignment of a member was sensitive to packing
5633 4244, # Conversion from 'type1' to 'type2', possible loss of data
5634 4481, # Nonstandard extension used: override specifier 'keyword'
5635 4505, # Unreferenced local function has been removed
5636 4510, # Default constructor could not be generated
5637 4512, # Assignment operator could not be generated
5638 4610, # Object can never be instantiated
5639 4838, # Narrowing conversion. Doesn't seem to be very useful.
5640 4995, # 'X': name was marked as #pragma deprecated
5641 4996, # 'X': was declared deprecated (for GetVersionEx).
5643 # These are variable shadowing warnings that are new in VS2015. We
5644 # should work through these at some point -- they may be removed from
5645 # the RTM release in the /W4 set.
5646 4456, 4457, 4458, 4459,
5649 'VCCLCompilerTool': {
5650 'AdditionalOptions': ['/MP'],
5651 'MinimalRebuild': 'false',
5652 'BufferSecurityCheck': 'true',
5653 'EnableFunctionLevelLinking': 'true',
5654 'RuntimeTypeInfo': 'false',
5655 'WarningLevel': '4',
5656 'WarnAsError': 'true',
5657 'DebugInformationFormat': '3',
5658 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5659 'ExceptionHandling': '0',
5661 'VCLibrarianTool': {
5662 'AdditionalOptions': ['/ignore:4221'],
5663 'AdditionalLibraryDirectories': [
5664 '<(windows_sdk_path)/Lib/win8/um/x86',
5668 'AdditionalDependencies': [
5680 'AdditionalLibraryDirectories': [
5681 '<(windows_sdk_path)/Lib/win8/um/x86',
5683 'GenerateDebugInformation': 'true',
5684 'MapFileName': '$(OutDir)\\$(TargetName).map',
5685 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5686 'FixedBaseAddress': '1',
5689 # 1 == /SUBSYSTEM:CONSOLE
5690 # 2 == /SUBSYSTEM:WINDOWS
5691 # Most of the executables we'll ever create are tests
5692 # and utilities with console output.
5696 'GenerateStublessProxies': 'true',
5697 'TypeLibraryName': '$(InputName).tlb',
5698 'OutputDirectory': '$(IntDir)',
5699 'HeaderFileName': '$(InputName).h',
5700 'DLLDataFileName': '$(InputName).dlldata.c',
5701 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5702 'ProxyFileName': '$(InputName)_p.c',
5704 'VCResourceCompilerTool': {
5706 'AdditionalIncludeDirectories': [
5708 '<(SHARED_INTERMEDIATE_DIR)',
5711 'target_conditions': [
5712 ['_type=="executable"', {
5714 'EmbedManifest': 'true',
5717 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5719 'AdditionalManifestFiles': [
5720 '>(win_exe_compatibility_manifest)',
5726 # Building with Clang on Windows is a work in progress and very
5727 # experimental. See crbug.com/82385.
5728 # Keep this in sync with the similar blocks in build/config/compiler/BUILD.gn
5730 'VCCLCompilerTool': {
5731 'AdditionalOptions': [
5732 # Many files use intrinsics without including this header.
5733 # TODO(hans): Fix those files, or move this to sub-GYPs.
5736 # TODO(hans): Make this list shorter eventually, http://crbug.com/504657
5737 '-Qunused-arguments', # http://crbug.com/504658
5738 '-Wno-microsoft', # http://crbug.com/505296
5739 '-Wno-switch', # http://crbug.com/505308
5740 '-Wno-unknown-pragmas', # http://crbug.com/505314
5741 '-Wno-unused-function', # http://crbug.com/505316
5742 '-Wno-unused-value', # http://crbug.com/505318
5746 ['clang==1 and target_arch=="ia32" and asan==1', {
5747 # TODO(thakis): Remove this block once llvm.org/PR24167 is fixed.
5748 'VCCLCompilerTool': {
5749 'WarnAsError': 'false',
5750 'AdditionalOptions': [
5755 ['clang==1 and clang_use_chrome_plugins==1', {
5756 'VCCLCompilerTool': {
5757 'AdditionalOptions': [
5758 '<@(clang_chrome_plugins_flags)',
5762 ['clang==1 and MSVS_VERSION == "2013"', {
5763 'VCCLCompilerTool': {
5764 'AdditionalOptions': [
5765 '-fmsc-version=1800',
5769 ['clang==1 and MSVS_VERSION == "2015"', {
5770 'VCCLCompilerTool': {
5771 'AdditionalOptions': [
5772 '-fmsc-version=1900',
5776 ['clang==1 and "<!(python <(DEPTH)/build/win/use_ansi_codes.py)"=="True"', {
5777 'VCCLCompilerTool': {
5778 'AdditionalOptions': [
5779 # cmd.exe doesn't understand ANSI escape codes by default,
5780 # so only enable them if something emulating them is around.
5781 '-fansi-escape-codes',
5782 # Also see http://crbug.com/110262
5783 '-fcolor-diagnostics',
5791 ['disable_nacl==1', {
5792 'target_defaults': {
5798 ['OS=="win" and msvs_use_common_linker_extras', {
5799 'target_defaults': {
5814 'AdditionalOptions': [
5825 'AdditionalOptions': ['/largeaddressaware'],
5829 # TODO(asan/win): Move this down into the general
5830 # win-target_defaults section once the 64-bit asan runtime
5831 # exists. See crbug.com/345874.
5832 'VCCLCompilerTool': {
5833 'AdditionalOptions': [
5834 '-fsanitize=address',
5835 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5837 'AdditionalIncludeDirectories': [
5838 # MSVC needs to be able to find the sanitizer headers when
5839 # invoked via /fallback. This is critical for using macros
5840 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5842 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/include_sanitizer',
5846 'AdditionalLibraryDirectories': [
5847 # TODO(hans): If make_clang_dir is absolute, this breaks.
5848 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/lib/windows',
5851 'target_conditions': [
5852 ['component=="shared_library"', {
5854 'AdditionalDependencies': [
5855 'clang_rt.asan_dynamic-i386.lib',
5856 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5860 ['_type=="executable" and component=="static_library"', {
5862 'AdditionalDependencies': [
5863 'clang_rt.asan-i386.lib',
5867 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5869 'AdditionalDependencies': [
5870 'clang_rt.asan_dll_thunk-i386.lib',
5876 ['sanitizer_coverage!=0', {
5877 # TODO(asan/win): Move this down into the general
5878 # win-target_defaults section once the 64-bit asan runtime
5879 # exists. See crbug.com/345874.
5880 'VCCLCompilerTool': {
5881 'AdditionalOptions': [
5882 '-fsanitize-coverage=<(sanitizer_coverage)',
5889 ['sanitizer_coverage!=0', {
5890 # TODO(asan/win): Move this down into the general
5891 # win-target_defaults section once the 64-bit asan runtime
5892 # exists. See crbug.com/345874.
5894 'SANITIZER_COVERAGE',
5902 'AdditionalOptions': [
5903 # safeseh is not compatible with x64
5915 ['enable_new_npdevice_api==1', {
5916 'target_defaults': {
5918 'ENABLE_NEW_NPDEVICE_API',
5922 # Don't warn about the "typedef 'foo' locally defined but not used"
5923 # for gcc 4.8 and higher.
5924 # TODO: remove this flag once all builds work. See crbug.com/227506
5925 ['gcc_version>=48 and clang==0', {
5926 'target_defaults': {
5928 '-Wno-unused-local-typedefs',
5932 ['gcc_version>=48 and clang==0 and host_clang==1', {
5933 'target_defaults': {
5934 'target_conditions': [
5935 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5939 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5941 'make_global_settings': [
5942 ['CC', '<(make_clang_dir)/bin/clang'],
5943 ['CXX', '<(make_clang_dir)/bin/clang++'],
5944 ['CC.host', '$(CC)'],
5945 ['CXX.host', '$(CXX)'],
5948 ['clang==1 and OS=="win"', {
5949 'make_global_settings': [
5950 # On Windows, gyp's ninja generator only looks at CC.
5951 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5954 ['use_lld==1 and OS=="win"', {
5955 'make_global_settings': [
5956 # Limited to Windows because -flavor link2 is the driver that is
5957 # compatible with link.exe.
5958 ['LD', '<(make_clang_dir)/bin/lld -flavor link2'],
5961 ['OS=="android" and clang==0', {
5962 # Hardcode the compiler names in the Makefile so that
5963 # it won't depend on the environment at make time.
5964 'make_global_settings': [
5965 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5966 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5967 ['CC.host', '<(host_cc)'],
5968 ['CXX.host', '<(host_cxx)'],
5971 ['OS=="linux" and target_arch=="mipsel" and host_arch!="mipsel" and chromeos==0 and clang==0', {
5972 # Set default mips cross tools on linux. These can be overridden
5973 # using CC,CXX,CC.host and CXX.host environment variables.
5974 'make_global_settings': [
5975 ['CC', '<!(which mipsel-linux-gnu-gcc)'],
5976 ['CXX', '<!(which mipsel-linux-gnu-g++)'],
5977 ['CC.host', '<(host_cc)'],
5978 ['CXX.host', '<(host_cxx)'],
5981 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5982 # Set default ARM cross tools on linux. These can be overridden
5983 # using CC,CXX,CC.host and CXX.host environment variables.
5984 'make_global_settings': [
5985 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5986 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5987 ['CC.host', '<(host_cc)'],
5988 ['CXX.host', '<(host_cxx)'],
5991 # TODO(yyanagisawa): supports GENERATOR==make
5992 # make generator doesn't support CC_wrapper without CC
5993 # in make_global_settings yet.
5994 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5995 'make_global_settings': [
5996 ['CC_wrapper', '<(gomadir)/gomacc'],
5997 ['CXX_wrapper', '<(gomadir)/gomacc'],
5998 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5999 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
6003 'target_defaults': {
6004 'target_conditions': [
6005 ['_toolset=="target"', {
6013 # Work-around for http://openradar.appspot.com/20356002
6014 ['_toolset=="target" and _type!="static_library"', {
6024 ['use_lto==1 and clang==0', {
6025 'target_defaults': {
6026 'target_conditions': [
6027 ['_toolset=="target"', {
6029 '-ffat-lto-objects',
6035 ['use_lto==1 and clang==1', {
6036 'target_defaults': {
6037 'target_conditions': [
6038 ['_toolset=="target"', {
6040 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
6046 # Apply a lower LTO optimization level in non-official builds.
6047 ['use_lto==1 and clang==1 and buildtype!="Official"', {
6048 'target_defaults': {
6049 'target_conditions': [
6050 ['_toolset=="target"', {
6052 '-Wl,--plugin-opt,O1',
6055 ['_toolset=="target" and _type!="static_library"', {
6065 ['use_lto==1 and clang==1 and target_arch=="arm"', {
6066 'target_defaults': {
6067 'target_conditions': [
6068 ['_toolset=="target"', {
6069 # Without this flag, LTO produces a .text section that is larger
6070 # than the maximum call displacement, preventing the linker from
6071 # relocating calls (http://llvm.org/PR22999).
6073 '-Wl,-plugin-opt,-function-sections',
6079 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
6080 'target_defaults': {
6081 'target_conditions': [
6082 ['_toolset=="target"', {
6090 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
6091 'target_defaults': {
6092 'target_conditions': [
6093 ['_toolset=="target"', {
6102 'target_defaults': {
6103 'target_conditions': [
6104 ['_toolset=="target"', {
6106 '-fno-sanitize-trap=cfi',
6107 '-fsanitize-recover=cfi',
6110 '-fno-sanitize-trap=cfi',
6111 '-fsanitize-recover=cfi',
6115 '-fno-sanitize-trap=cfi',
6116 '-fsanitize-recover=cfi',
6120 'VCCLCompilerTool': {
6121 'AdditionalOptions': [
6122 '-fno-sanitize-trap=cfi',
6123 '-fsanitize-recover=cfi',
6128 ['_toolset=="target" and _type!="static_library"', {
6131 '-fno-sanitize-trap=cfi',
6132 '-fsanitize-recover=cfi',
6140 'target_defaults': {
6141 'target_conditions': [
6142 ['_toolset=="target"', {
6144 '-fsanitize=cfi-vcall',
6145 '-fsanitize=cfi-derived-cast',
6146 '-fsanitize=cfi-unrelated-cast',
6147 '-fsanitize-blacklist=<(cfi_blacklist)',
6150 '-fsanitize=cfi-vcall',
6151 '-fsanitize=cfi-derived-cast',
6152 '-fsanitize=cfi-unrelated-cast',
6156 '-fsanitize=cfi-vcall',
6157 '-fsanitize=cfi-derived-cast',
6158 '-fsanitize=cfi-unrelated-cast',
6159 '-fsanitize-blacklist=<(cfi_blacklist)',
6163 'VCCLCompilerTool': {
6164 'AdditionalOptions': [
6165 '-fsanitize=cfi-vcall',
6166 '-fsanitize=cfi-derived-cast',
6167 '-fsanitize=cfi-unrelated-cast',
6168 '-fsanitize-blacklist=<(cfi_blacklist)',
6173 ['_toolset=="target" and _type!="static_library"', {
6176 '-fsanitize=cfi-vcall',
6177 '-fsanitize=cfi-derived-cast',
6178 '-fsanitize=cfi-unrelated-cast',
6187 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
6188 # This block adds *project-wide* configuration settings to each project
6189 # file. It's almost always wrong to put things here. Specify your
6190 # custom xcode_settings in target_defaults to add them to targets instead.
6193 # In an Xcode Project Info window, the "Base SDK for All Configurations"
6194 # setting sets the SDK on a project-wide basis. In order to get the
6195 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
6196 # here at the project level.
6199 ['mac_sdk_path==""', {
6200 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
6202 'SDKROOT': '<(mac_sdk_path)', # -isysroot
6208 ['ios_sdk_path==""', {
6210 # TODO(justincohen): Ninja only supports simulator for now.
6211 ['"<(GENERATOR)"=="xcode"', {
6212 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6214 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
6218 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6223 # Target both iPhone and iPad.
6224 'TARGETED_DEVICE_FAMILY': '1,2',
6227 ['target_arch=="x64"', {
6232 ['target_arch=="ia32"', {
6241 # The Xcode generator will look for an xcode_settings section at the root
6242 # of each dict and use it to apply settings on a file-wide basis. Most
6243 # settings should not be here, they should be in target-specific
6244 # xcode_settings sections, or better yet, should use non-Xcode-specific
6245 # settings in target dicts. SYMROOT is a special case, because many other
6246 # Xcode variables depend on it, including variables such as
6247 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6248 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6249 # files to appear (when present) in the UI as actual files and not red
6250 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6251 # and therefore SYMROOT, needs to be set at the project level.
6252 'SYMROOT': '<(DEPTH)/xcodebuild',