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 # /debug:fastlink is off by default on Windows because it generates PDBs
396 # that are machine-local. But, great for local builds.
397 # Enable with GYP_DEFINES=win_fastlink=1
400 # Set to select the Title Case versions of strings in GRD files.
401 'use_titlecase_in_grd%': 0,
403 # Use translations provided by volunteers at launchpad.net. This
404 # currently only works on Linux.
405 'use_third_party_translations%': 0,
407 # Remoting compilation is enabled by default. Set to 0 to disable.
410 # Configuration policy is enabled by default. Set to 0 to disable.
411 'configuration_policy%': 1,
413 # Variable safe_browsing is used to control the build time configuration
414 # for safe browsing feature. Safe browsing can be compiled in 4 different
415 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
416 # reporting features for use with Data Saver on Mobile, and 3 enables
417 # extended mobile protection via an external API. When 3 is fully
418 # deployed, it will replace 2.
421 # Web speech is enabled by default. Set to 0 to disable.
422 'enable_web_speech%': 1,
424 # 'Ok Google' hotwording is disabled by default in open source builds. Set
425 # to 1 to enable. (This will download a closed-source NaCl module at
426 # startup.) Chrome-branded builds have this enabled by default.
427 'enable_hotwording%': 0,
429 # Notifications are compiled in by default. Set to 0 to disable.
430 'notifications%' : 1,
432 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
433 # regular builds and 1 for ASan builds.
434 'mac_want_real_dsym%': 'default',
436 # If this is set, the clang plugins used on the buildbot will be used.
437 # Run tools/clang/scripts/update.sh to make sure they are compiled.
438 # This causes 'clang_chrome_plugins_flags' to be set.
439 # Has no effect if 'clang' is not set as well.
440 'clang_use_chrome_plugins%': 1,
442 # Enable building with ASAN (Clang's -fsanitize=address option).
443 # -fsanitize=address only works with clang, but asan=1 implies clang=1
444 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
446 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
447 # Enable coverage gathering instrumentation in sanitizer tools. This flag
448 # also controls coverage granularity (1 for function-level coverage, 2
449 # for block-level coverage).
450 'sanitizer_coverage%': 0,
451 # Deprecated, only works if |sanitizer_coverage| isn't set.
452 # TODO(glider): remove this flag.
454 # Enable intra-object-overflow detection in ASan (experimental).
455 'asan_field_padding%': 0,
457 # Enable Chromium overrides of the default configurations for various
458 # dynamic tools (like ASan).
459 'use_sanitizer_options%': 0,
461 # Enable building with SyzyAsan.
462 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
465 # Enable crash reporting via Kasko.
468 # Enable building with LSan (Clang's -fsanitize=leak option).
469 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
470 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
473 # Enable building with TSan (Clang's -fsanitize=thread option).
474 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
475 # See http://clang.llvm.org/docs/ThreadSanitizer.html
477 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
479 # Enable building with MSan (Clang's -fsanitize=memory option).
480 # MemorySanitizer only works with clang, but msan=1 implies clang=1
481 # See http://clang.llvm.org/docs/MemorySanitizer.html
483 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
484 # Track where uninitialized memory originates from. From fastest to
485 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
486 # - track the chain of stores leading from allocation site to use site.
487 'msan_track_origins%': 2,
489 # Enable building with UBSan (Clang's -fsanitize=undefined option).
490 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
491 # See http://clang.llvm.org/docs/UsersManual.html
493 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
494 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/vptr_blacklist.txt',
496 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
497 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
500 # Use dynamic libraries instrumented by one of the sanitizers
501 # instead of the standard system libraries. Set this flag to build the
502 # libraries from source.
503 'use_instrumented_libraries%': 0,
505 # Use dynamic libraries instrumented by one of the sanitizers
506 # instead of the standard system libraries. Set this flag to download
507 # prebuilt binaries from GCS.
508 'use_prebuilt_instrumented_libraries%': 0,
510 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
511 # stdlibc++ as standard library. This is intended to use for instrumented
513 'use_custom_libcxx%': 0,
515 # Use system libc++ instead of the default C++ library, usually libstdc++.
516 # This is intended for iOS builds only.
517 'use_system_libcxx%': 0,
519 # Use a modified version of Clang to intercept allocated types and sizes
520 # for allocated objects. clang_type_profiler=1 implies clang=1.
521 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
522 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
523 'clang_type_profiler%': 0,
525 # Set to true to instrument the code with function call logger.
526 # See src/third_party/cygprofile/cyg-profile.cc for details.
527 'order_profiling%': 0,
529 # Use the provided profiled order file to link Chrome image with it.
530 # This makes Chrome faster by better using CPU cache when executing code.
531 # This is known as PGO (profile guided optimization).
532 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
533 'order_text_section%' : "",
535 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
536 # libraries on linux x86-64 and arm, plus ASLR.
539 # Whether one-click signin is enabled or not.
540 'enable_one_click_signin%': 0,
542 # Whether to back up data before sync.
543 'enable_pre_sync_backup%': 0,
545 # Enable Chrome browser extensions
546 'enable_extensions%': 1,
549 'enable_google_now%': 1,
551 # Enable basic printing support and UI.
552 'enable_basic_printing%': 1,
554 # Enable printing with print preview. It does not imply
555 # enable_basic_printing. It's possible to build Chrome with preview only.
556 'enable_print_preview%': 1,
558 # Set the version of CLD.
559 # 0: Don't specify the version. This option is for the Finch testing.
564 # For CLD2, the size of the tables that should be included in the build
565 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
567 # See third_party/cld_2/cld_2.gyp for more information.
568 # 0: Small tables, lower accuracy
569 # 2: Large tables, high accuracy
570 'cld2_table_size%': 2,
572 # Enable spell checker.
573 'enable_spellcheck%': 1,
575 # Use the operating system spellchecker, e.g. NSSpellChecker on Mac or
576 # SpellCheckerSession on Android.
577 'use_platform_spellchecker%': 0,
579 # Webrtc compilation is enabled by default. Set to 0 to disable.
582 # Media router support is enabled by default. Set to 0 to disable.
583 'enable_media_router%': 1,
585 # Enables use of the session service, which is enabled by default.
586 # Support for disabling depends on the platform.
587 'enable_session_service%': 1,
589 # Enables theme support, which is enabled by default. Support for
590 # disabling depends on the platform.
593 # Enables autofill dialog and associated features; disabled by default.
594 'enable_autofill_dialog%' : 0,
596 # Defaults Wallet integration in Autofill dialog to use production
597 # servers. Unofficial builds won't have the proper API keys.
598 'enable_prod_wallet_service%': 0,
600 # Enables support for background apps.
601 'enable_background%': 1,
603 # Enable the task manager by default.
604 'enable_task_manager%': 1,
606 # Enables used resource whitelist generation; disabled by default.
607 'enable_resource_whitelist_generation%': 0,
609 # Enable FILE support by default.
610 'disable_file_support%': 0,
612 # Enable FTP support by default.
613 'disable_ftp_support%': 0,
615 # Use native android functions in place of ICU. Not supported by most
617 'use_icu_alternatives_on_android%': 0,
619 # Use of precompiled headers on Windows.
621 # This variable may be explicitly set to 1 (enabled) or 0
622 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
623 # This setting will override the default.
626 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
628 'chromium_win_pch%': 0,
631 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
632 # Set this to true when building with Clang.
633 # See http://code.google.com/p/chromium/wiki/Clang for details.
634 # If this is set, clang is used as both host and target compiler in
635 # cross-compile builds.
638 # Use experimental lld linker instead of the platform's default linker.
641 # Enable plugin installation by default.
642 'enable_plugin_installation%': 1,
644 # Specifies whether to use canvas_skia.cc in place of platform
645 # specific implementations of gfx::Canvas. Affects text drawing in the
647 # TODO(asvitkine): Enable this on all platforms and delete this flag.
648 # http://crbug.com/105550
649 'use_canvas_skia%': 0,
651 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
652 # with one of those tools.
653 'build_for_tool%': '',
655 'wix_path%': '<(DEPTH)/third_party/wix',
657 # Supervised users are enabled by default.
658 'enable_supervised_users%': 1,
660 # Platform sends memory pressure signals natively.
661 'native_memory_pressure_signals%': 0,
664 'enable_service_discovery%': 0,
665 'enable_wifi_bootstrapping%': 0,
666 'enable_hangout_services_extension%': 0,
668 # Enable the Syzygy optimization step.
669 'syzygy_optimize%': 0,
671 # Enable hole punching for the protected video.
674 # Automatically select platforms under ozone. Turn this off to
675 # build only explicitly selected platforms.
676 'ozone_auto_platforms%': 1,
678 # If this is set clang is used as host compiler, but not as target
679 # compiler. Always do this by default.
682 # Variables to control Link-Time Optimization (LTO).
683 # On Android, the variable use_lto enables LTO on code compiled with -Os,
684 # and use_lto_o2 enables LTO on code compiled with -O2. On other
685 # platforms, use_lto enables LTO in all translation units, and use_lto_o2
688 # On Linux and Android, when using LLVM LTO, the script
689 # build/download_gold_plugin.py must be run to download a linker plugin.
690 # On Mac, LLVM needs to be built from scratch using
691 # tools/clang/scripts/update.py and the absolute path to
692 # third_party/llvm-build/Release+Asserts/lib must be added to
693 # $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin.
695 # On Android, the variables must *not* be enabled at the same time.
696 # In this case LTO would 'merge' the optimization flags at link-time
697 # which would lead to all code be optimized with -O2. See crbug.com/407544
701 # Allowed level of identical code folding in the gold linker.
702 'gold_icf_level%': 'all',
704 # Libxkbcommon usage.
707 # Control Flow Integrity for virtual calls and casts.
708 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
712 'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
714 # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
715 'mac_views_browser%': 0,
717 # By default, use ICU data file (icudtl.dat).
718 'icu_use_data_file_flag%': 1,
720 # Turn on JNI generation optimizations by default.
721 'optimize_jni_generation%': 1,
724 # A flag for POSIX platforms
731 # A flag for BSD platforms
732 ['OS=="freebsd" or OS=="openbsd"', {
739 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris")', {
745 # libudev usage. This currently only affects the content layer.
746 ['OS=="linux" and embedded==0', {
752 # Flags to use X11 on non-Mac POSIX platforms.
753 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
760 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
766 # Flags to use pango and cairo.
767 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
776 ['OS=="linux" and embedded==0', {
782 # We always use skia text rendering in Aura on Windows, since GDI
783 # doesn't agree with our BackingStore.
784 # TODO(beng): remove once skia text rendering is on by default.
785 ['use_aura==1 and OS=="win"', {
786 'enable_skia_text%': 1,
789 # A flag to enable or disable our compile-time dependency
790 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
791 # support will be available. This option is useful
792 # for Linux distributions and for Aura.
793 ['OS!="linux" or chromeos==1', {
794 'use_gnome_keyring%': 0,
796 'use_gnome_keyring%': 1,
799 ['OS=="mac" or OS=="ios"', {
800 # Mac and iOS want Title Case strings
801 'use_titlecase_in_grd%': 1,
804 # Enable loader extensions on Chrome OS.
806 'image_loader_extension%': 1,
808 'image_loader_extension%': 0,
811 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
812 'enable_one_click_signin%': 1,
813 'enable_pre_sync_backup%': 1,
817 'enable_extensions%': 0,
818 'enable_google_now%': 0,
823 'arm_neon_optional%': 1,
824 'native_memory_pressure_signals%': 1,
825 'enable_basic_printing%': 1,
826 'enable_print_preview%': 0,
827 'enable_task_manager%':0,
831 # Android and OSX have built-in spellcheckers that can be utilized.
832 ['OS=="android" or OS=="mac"', {
833 'use_platform_spellchecker%': 1,
836 # Android OS includes support for proprietary codecs regardless of
837 # building Chromium or Google Chrome. We also ship Google Chrome and
838 # Chromecast with proprietary codecs.
839 ['OS=="android" or branding=="Chrome" or chromecast==1', {
840 'proprietary_codecs%': 1,
842 'proprietary_codecs%': 0,
845 ['OS=="mac" or OS=="ios"', {
846 'native_memory_pressure_signals%': 1,
849 # Enable autofill dialog when not on iOS.
851 'enable_autofill_dialog%': 1,
854 ['buildtype=="Official"', {
855 'enable_prod_wallet_service%': 1,
858 ['branding=="Chrome"', {
859 'enable_hotwording%': 1,
867 'disable_ftp_support%': 1,
868 'enable_extensions%': 0,
869 'enable_google_now%': 0,
871 'cld2_table_size%': 0,
872 'enable_basic_printing%': 0,
873 'enable_print_preview%': 0,
874 'enable_session_service%': 0,
875 'enable_spellcheck%': 0,
881 'enable_supervised_users%': 0,
882 'enable_task_manager%': 0,
883 'use_system_libcxx%': 1,
884 'enable_media_router%': 0,
887 # Use GPU accelerated cross process image transport by default
888 # on linux builds with the Aura window manager
889 ['use_aura==1 and OS=="linux"', {
890 'ui_compositor_image_transport%': 1,
892 'ui_compositor_image_transport%': 0,
895 # Turn precompiled headers on by default.
896 ['OS=="win" and buildtype!="Official"', {
897 'chromium_win_pch%': 1
900 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
901 'enable_plugin_installation%': 0,
903 'enable_plugin_installation%': 1,
906 # Whether PPAPI is enabled.
907 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
908 'enable_plugins%': 0,
910 'enable_plugins%': 1,
913 # linux_use_bundled_gold: whether to use the gold linker binary checked
914 # into third_party/binutils. Force this off via GYP_DEFINES when you
915 # are using a custom toolchain and need to control -B in ldflags.
916 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
917 # for component=static_library builds.
918 ['(OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm" or (target_arch=="ia32" and host_arch=="x64"))', {
919 'linux_use_bundled_gold%': 1,
921 'linux_use_bundled_gold%': 0,
924 # linux_use_bundled_binutils: whether to use the binary binutils
925 # checked into third_party/binutils. These are not multi-arch so cannot
926 # be used except on x86 and x86-64 (the only two architectures which
927 # are currently checke in). Force this off via GYP_DEFINES when you
928 # are using a custom toolchain and need to control -B in cflags.
929 ['OS=="linux" and (target_arch=="x64")', {
930 'linux_use_bundled_binutils%': 1,
932 'linux_use_bundled_binutils%': 0,
935 # linux_use_gold_flags: whether to use build flags that rely on gold.
936 # On by default for x64 Linux.
937 ['OS=="linux" and target_arch=="x64"', {
938 'linux_use_gold_flags%': 1,
940 'linux_use_gold_flags%': 0,
943 # linux_use_debug_fission: whether to use split DWARF debug info
944 # files. This can reduce link time significantly, but is incompatible
945 # with some utilities such as icecc and ccache. Requires gold and
946 # gcc >= 4.8 or clang.
947 # http://gcc.gnu.org/wiki/DebugFission
948 ['OS=="linux" and target_arch=="x64"', {
949 'linux_use_debug_fission%': 1,
951 'linux_use_debug_fission%': 0,
954 ['OS=="android" or OS=="ios"', {
955 'enable_captive_portal_detection%': 0,
957 'enable_captive_portal_detection%': 1,
960 # Enable Skia UI text drawing incrementally on different platforms.
961 # http://crbug.com/105550
963 # On Aura, this allows per-tile painting to be used in the browser
965 ['OS!="android" and OS!="ios"', {
966 'use_canvas_skia%': 1,
970 'enable_basic_printing%': 0,
971 'enable_print_preview%': 1,
974 # Do not enable the Settings App on ChromeOS.
975 ['enable_app_list==1 and chromeos==0', {
976 'enable_settings_app%': 1,
978 'enable_settings_app%': 0,
981 # Whether tests targets should be run, archived or just have the
982 # dependencies verified. All the tests targets have the '_run' suffix,
983 # e.g. base_unittests_run runs the target base_unittests. The test
984 # target always calls tools/swarming_client/isolate.py. See the script's
985 # --help for more information. Meant to be overriden with GYP_DEFINES.
986 # TODO(maruel): Remove the conditions as more configurations are
988 ['OS!="ios" and OS!="android" and chromeos==0', {
989 'test_isolation_mode%': 'check',
991 'test_isolation_mode%': 'noop',
993 # Whether Android build uses OpenMAX DL FFT.
994 ['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")', {
995 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
996 # When enabled, this will also enable WebAudio support on
997 # Android for these architectures. Default is enabled. Whether
998 # WebAudio is actually available depends on runtime settings
1000 'use_openmax_dl_fft%': 1,
1002 'use_openmax_dl_fft%': 0,
1004 ['OS=="win" or OS=="linux"', {
1008 # Disable various features by default on embedded.
1011 'enable_basic_printing%': 0,
1012 'enable_print_preview%': 0,
1015 ['OS=="win" or OS=="mac"', {
1016 'enable_wifi_bootstrapping%' : 1,
1019 # Path to sas.dll, which provides the SendSAS function.
1020 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1021 ['target_arch=="x64"', {
1022 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1024 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1028 'pkg-config': '<(chroot_cmd) <(DEPTH)/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
1030 'pkg-config': 'pkg-config'
1034 # WebVR support disabled until platform implementations have been added
1037 # Setting this to '0' will cause V8's startup snapshot to be
1038 # embedded in the binary instead of being a external files.
1039 'v8_use_external_startup_data%': 1,
1041 # Set this to 1 to enable use of concatenated impulse responses
1042 # for the HRTF panner in WebAudio.
1043 'use_concatenated_impulse_responses': 1,
1045 # You can set the variable 'use_official_google_api_keys' to 1
1046 # to use the Google-internal file containing official API keys
1047 # for Google Chrome even in a developer build. Setting this
1048 # variable explicitly to 1 will cause your build to fail if the
1049 # internal file is missing.
1051 # The variable is documented here, but not handled in this file;
1052 # see //google_apis/determine_use_official_keys.gypi for the
1055 # Set the variable to 0 to not use the internal file, even when
1056 # it exists in your checkout.
1058 # Leave it unset in your include.gypi to have the variable
1059 # implicitly set to 1 if you have
1060 # src/google_apis/internal/google_chrome_api_keys.h in your
1061 # checkout, and implicitly set to 0 if not.
1063 # Note that official builds always behave as if the variable
1064 # was explicitly set to 1, i.e. they always use official keys,
1065 # and will fail to build if the internal file is missing.
1067 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1068 # include.gypi or by other means. Due to subtleties of GYP, this
1069 # is not the same as leaving the variable unset, even though its
1071 # //google_apis/determine_use_official_keys.gypi is 2.
1073 # Set these to bake the specified API keys and OAuth client
1074 # IDs/secrets into your build.
1076 # If you create a build without values baked in, you can instead
1077 # set environment variables to provide the keys at runtime (see
1078 # src/google_apis/google_api_keys.h for details). Features that
1079 # require server-side APIs may fail to work if no keys are
1082 # Note that if you are building an official build or if
1083 # use_official_google_api_keys has been set to 1 (explicitly or
1084 # implicitly), these values will be ignored and the official
1085 # keys will be used instead.
1086 'google_api_key%': '',
1087 'google_default_client_id%': '',
1088 'google_default_client_secret%': '',
1089 # Native Client is enabled by default.
1090 'disable_nacl%': '0',
1092 # Native Client toolchains, enabled by default.
1093 'disable_pnacl%': 0,
1094 'disable_newlib%': 0,
1096 # Sets the default version name and code for Android app, by default we
1097 # do a developer build.
1098 'android_app_version_name%': 'Developer Build',
1099 'android_app_version_code%': 1,
1102 # Copy conditionally-set variables out one scope.
1103 'branding%': '<(branding)',
1104 'branding_path_component%': '<(branding_path_component)',
1105 'buildtype%': '<(buildtype)',
1106 'target_arch%': '<(target_arch)',
1107 'target_subarch%': '<(target_subarch)',
1108 'mips_arch_variant%': '<(mips_arch_variant)',
1109 'mips_dsp_rev%': '<(mips_dsp_rev)',
1110 'host_arch%': '<(host_arch)',
1111 'toolkit_views%': '<(toolkit_views)',
1112 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1113 'use_aura%': '<(use_aura)',
1114 'use_ash%': '<(use_ash)',
1115 'use_cras%': '<(use_cras)',
1116 'use_libpci%': '<(use_libpci)',
1117 'use_openssl%': '<(use_openssl)',
1118 'use_openssl_certs%': '<(use_openssl_certs)',
1119 'use_nss_certs%': '<(use_nss_certs)',
1120 'use_udev%': '<(use_udev)',
1121 'os_bsd%': '<(os_bsd)',
1122 'os_posix%': '<(os_posix)',
1123 'use_dbus%': '<(use_dbus)',
1124 'use_glib%': '<(use_glib)',
1125 'use_pango%': '<(use_pango)',
1126 'use_cairo%': '<(use_cairo)',
1127 'use_ozone%': '<(use_ozone)',
1128 'use_ozone_evdev%': '<(use_ozone_evdev)',
1129 'use_xkbcommon%': '<(use_xkbcommon)',
1130 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1131 'desktop_linux%': '<(desktop_linux)',
1132 'use_x11%': '<(use_x11)',
1133 'use_gnome_keyring%': '<(use_gnome_keyring)',
1134 'linux_fpic%': '<(linux_fpic)',
1135 'chromeos%': '<(chromeos)',
1136 'chromecast%': '<(chromecast)',
1137 'enable_viewport%': '<(enable_viewport)',
1138 'enable_hidpi%': '<(enable_hidpi)',
1139 'enable_topchrome_md%': '<(enable_topchrome_md)',
1140 'image_loader_extension%': '<(image_loader_extension)',
1141 'fastbuild%': '<(fastbuild)',
1142 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1143 'win_z7%': '<(win_z7)',
1144 'dcheck_always_on%': '<(dcheck_always_on)',
1145 'tracing_like_official_build%': '<(tracing_like_official_build)',
1146 'arm_version%': '<(arm_version)',
1147 'arm_neon%': '<(arm_neon)',
1148 'arm_neon_optional%': '<(arm_neon_optional)',
1149 'sysroot%': '<(sysroot)',
1150 'pkg-config%': '<(pkg-config)',
1151 'chroot_cmd%': '<(chroot_cmd)',
1152 'system_libdir%': '<(system_libdir)',
1153 'component%': '<(component)',
1154 'win_analyze%': '<(win_analyze)',
1155 'win_fastlink%': '<(win_fastlink)',
1156 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1157 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1158 'use_third_party_translations%': '<(use_third_party_translations)',
1159 'remoting%': '<(remoting)',
1160 'enable_one_click_signin%': '<(enable_one_click_signin)',
1161 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1162 'enable_media_router%': '<(enable_media_router)',
1163 'enable_webrtc%': '<(enable_webrtc)',
1164 'chromium_win_pch%': '<(chromium_win_pch)',
1165 'configuration_policy%': '<(configuration_policy)',
1166 'safe_browsing%': '<(safe_browsing)',
1167 'enable_web_speech%': '<(enable_web_speech)',
1168 'enable_hotwording%': '<(enable_hotwording)',
1169 'notifications%': '<(notifications)',
1170 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1171 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1173 'asan_blacklist%': '<(asan_blacklist)',
1174 'asan_coverage%': '<(asan_coverage)',
1175 'sanitizer_coverage%': '<(sanitizer_coverage)',
1176 'asan_field_padding%': '<(asan_field_padding)',
1177 'use_sanitizer_options%': '<(use_sanitizer_options)',
1178 'syzyasan%': '<(syzyasan)',
1179 'kasko%': '<(kasko)',
1180 'syzygy_optimize%': '<(syzygy_optimize)',
1183 'msan_blacklist%': '<(msan_blacklist)',
1184 'msan_track_origins%': '<(msan_track_origins)',
1186 'tsan_blacklist%': '<(tsan_blacklist)',
1187 'ubsan%': '<(ubsan)',
1188 'ubsan_blacklist%': '<(ubsan_blacklist)',
1189 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1190 'ubsan_vptr%': '<(ubsan_vptr)',
1191 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1192 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
1193 'use_custom_libcxx%': '<(use_custom_libcxx)',
1194 'use_system_libcxx%': '<(use_system_libcxx)',
1195 'clang_type_profiler%': '<(clang_type_profiler)',
1196 'order_profiling%': '<(order_profiling)',
1197 'order_text_section%': '<(order_text_section)',
1198 'enable_extensions%': '<(enable_extensions)',
1199 'enable_plugin_installation%': '<(enable_plugin_installation)',
1200 'enable_plugins%': '<(enable_plugins)',
1201 'enable_session_service%': '<(enable_session_service)',
1202 'enable_themes%': '<(enable_themes)',
1203 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1204 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1205 'enable_background%': '<(enable_background)',
1206 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1207 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1208 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1209 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1210 'use_canvas_skia%': '<(use_canvas_skia)',
1211 'test_isolation_mode%': '<(test_isolation_mode)',
1212 'enable_basic_printing%': '<(enable_basic_printing)',
1213 'enable_print_preview%': '<(enable_print_preview)',
1214 'enable_spellcheck%': '<(enable_spellcheck)',
1215 'use_platform_spellchecker%': '<(use_platform_spellchecker)',
1216 'enable_google_now%': '<(enable_google_now)',
1217 'cld_version%': '<(cld_version)',
1218 'cld2_table_size%': '<(cld2_table_size)',
1219 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1220 'disable_file_support%': '<(disable_file_support)',
1221 'disable_ftp_support%': '<(disable_ftp_support)',
1222 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1223 'enable_task_manager%': '<(enable_task_manager)',
1224 'sas_dll_path%': '<(sas_dll_path)',
1225 'wix_path%': '<(wix_path)',
1226 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1227 'use_system_libjpeg%': '<(use_system_libjpeg)',
1228 'android_channel%': '<(android_channel)',
1229 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1230 'gyp_managed_install%': 0,
1231 'create_standalone_apk%': 1,
1232 'enable_app_list%': '<(enable_app_list)',
1233 'use_default_render_theme%': '<(use_default_render_theme)',
1234 'enable_settings_app%': '<(enable_settings_app)',
1235 'google_api_key%': '<(google_api_key)',
1236 'google_default_client_id%': '<(google_default_client_id)',
1237 'google_default_client_secret%': '<(google_default_client_secret)',
1238 'enable_supervised_users%': '<(enable_supervised_users)',
1239 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1240 'enable_mdns%' : '<(enable_mdns)',
1241 'enable_service_discovery%' : '<(enable_service_discovery)',
1242 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1243 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1244 'proprietary_codecs%': '<(proprietary_codecs)',
1245 'use_goma%': '<(use_goma)',
1246 'gomadir%': '<(gomadir)',
1247 'use_lto%': '<(use_lto)',
1248 'use_lto_o2%': '<(use_lto_o2)',
1249 'gold_icf_level%': '<(gold_icf_level)',
1250 'video_hole%': '<(video_hole)',
1251 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1252 'cfi_vptr%': '<(cfi_vptr)',
1253 'cfi_diag%': '<(cfi_diag)',
1254 'cfi_blacklist%': '<(cfi_blacklist)',
1255 'mac_views_browser%': '<(mac_views_browser)',
1256 'android_app_version_name%': '<(android_app_version_name)',
1257 'android_app_version_code%': '<(android_app_version_code)',
1258 'enable_webvr%': '<(enable_webvr)',
1260 # Turns on compiler optimizations in V8 in Debug build.
1261 'v8_optimized_debug%': 1,
1263 # Use system protobuf instead of bundled one.
1264 'use_system_protobuf%': 0,
1266 # Use system yasm instead of bundled one.
1267 'use_system_yasm%': 0,
1269 # Use system ICU instead of bundled one.
1270 'use_system_icu%' : 0,
1272 # Default to enabled PIE; this is important for ASLR but we may need to be
1273 # able to turn it off for various reasons.
1274 'linux_disable_pie%': 0,
1276 # The release channel that this build targets. This is used to restrict
1277 # channel-specific build options, like which installer packages to create.
1278 # The default is 'all', which does no channel-specific filtering.
1281 # Override chromium_mac_pch and set it to 0 to suppress the use of
1282 # precompiled headers on the Mac. Prefix header injection may still be
1283 # used, but prefix headers will not be precompiled. This is useful when
1284 # using distcc to distribute a build to compile slaves that don't
1285 # share the same compiler executable as the system driving the compilation,
1286 # because precompiled headers rely on pointers into a specific compiler
1287 # executable's image. Setting this to 0 is needed to use an experimental
1288 # Linux-Mac cross compiler distcc farm.
1289 'chromium_mac_pch%': 1,
1291 # The default value for mac_strip in target_defaults. This cannot be
1292 # set there, per the comment about variable% in a target_defaults.
1293 'mac_strip_release%': 0,
1295 # Set to 1 to enable java code coverage. Instruments classes during build
1296 # to produce .ec files during runtime.
1297 'emma_coverage%': 0,
1299 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1300 # separated with whitespace and/or comma. Only has effect if
1301 # 'emma_coverage=1'.
1304 # Set to 1 to enable running Android lint on java/class files.
1307 # Although base/allocator lets you select a heap library via an
1308 # environment variable, the libcmt shim it uses sometimes gets in
1309 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1310 # 'win_use_allocator_shim': 0,
1311 # 'win_release_RuntimeLibrary': 2
1312 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1313 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1315 # TODO(bradnelson): eliminate this when possible.
1316 # To allow local gyp files to prevent release.vsprops from being included.
1317 # Yes(1) means include release.vsprops.
1318 # Once all vsprops settings are migrated into gyp, this can go away.
1319 'msvs_use_common_release%': 1,
1321 # TODO(bradnelson): eliminate this when possible.
1322 # To allow local gyp files to override additional linker options for msvs.
1323 # Yes(1) means set use the common linker options.
1324 'msvs_use_common_linker_extras%': 1,
1326 # TODO(sgk): eliminate this if possible.
1327 # It would be nicer to support this via a setting in 'target_defaults'
1328 # in chrome/app/locales/locales.gypi overriding the setting in the
1329 # 'Debug' configuration in the 'target_defaults' dict below,
1330 # but that doesn't work as we'd like.
1331 'msvs_debug_link_incremental%': '2',
1333 # Needed for some of the largest modules.
1334 'msvs_debug_link_nonincremental%': '1',
1336 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1337 # to get incremental linking to be faster in debug builds.
1338 'incremental_chrome_dll%': '0',
1340 # Experimental setting to break chrome.dll into multiple pieces based on
1342 'chrome_multiple_dll%': '0',
1344 # Experimental setting to optimize Chrome's DLLs with PGO.
1345 'chrome_pgo_phase%': '0',
1347 # Whether the VS xtree header has been patched to disable warning 4702. If
1348 # it has, then we don't need to disable 4702 (unreachable code warning).
1349 # The patch is preapplied to the internal toolchain and hence all bots.
1350 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1353 'clang%': '<(clang)',
1354 'host_clang%': '<(host_clang)',
1355 'make_clang_dir%': '<(make_clang_dir)',
1356 'use_lld%': '<(use_lld)',
1358 # Control which version of clang to use when building for iOS. If set to
1359 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1360 # the version of clang that ships with the Chromium source. This variable
1361 # is automatically set to '1' in Official builds.
1364 # These two variables can be set in GYP_DEFINES while running
1365 # |gclient runhooks| to let clang run a plugin in every compilation.
1366 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1368 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1371 'clang_add_plugin%': '',
1373 # Tell ld64 to write map files describing binary layout. Useful
1374 # for looking at what contributes to binary size, e.g. with
1375 # https://github.com/nico/bloat
1376 'mac_write_linker_maps%': 0,
1378 # The default type of gtest.
1379 'gtest_target_type%': 'executable',
1381 # Enable sampling based profiler.
1382 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1384 # Profile without optimizing out stack frames when profiling==1.
1385 'profiling_full_stack_frames%': '0',
1387 # And if we want to dump symbols for Breakpad-enabled builds.
1388 'linux_dump_symbols%': 0,
1389 # And if we want to strip the binary after dumping symbols.
1390 'linux_strip_binary%': 0,
1391 # If we want stack unwind support for backtrace().
1392 'debug_unwind_tables%': 1,
1393 'release_unwind_tables%': 1,
1395 # Override where to find binutils
1396 'binutils_version%': 0,
1397 'binutils_dir%': '',
1400 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1401 'use_allocator%': 'tcmalloc',
1403 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1404 'linux_link_gnome_keyring%': 0,
1405 # Set to 1 to link against gsettings APIs instead of using dlopen().
1406 'linux_link_gsettings%': 0,
1408 # Enable use of OpenMAX DL FFT routines.
1409 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1411 # Enable new NPDevice API.
1412 'enable_new_npdevice_api%': 0,
1414 # .gyp files or targets should set chromium_code to 1 if they build
1415 # Chromium-specific code, as opposed to external code. This variable is
1416 # used to control such things as the set of warnings to enable, and
1417 # whether warnings are treated as errors.
1418 'chromium_code%': 0,
1420 # Disable fatal linker warnings, similarly to how we make it possible
1421 # to disable -Werror (e.g. for different toolchain versions).
1422 'disable_fatal_linker_warnings%': 0,
1424 'release_valgrind_build%': 0,
1426 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1427 'enable_wexit_time_destructors%': 0,
1429 # Build libpeerconnection as a static library by default.
1430 'libpeer_target_type%': 'static_library',
1432 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1433 'internal_gles2_conform_tests%': 0,
1435 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1436 'internal_khronos_glcts_tests%': 0,
1438 # Set to 1 to compile the filter fuzzer.
1439 'internal_filter_fuzzer%': 0,
1441 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1442 # so Cocoa is happy (http://crbug.com/20441).
1444 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1445 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1446 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1447 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1448 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1449 'vi', 'zh-CN', 'zh-TW',
1452 # Pseudo locales are special locales which are used for testing and
1453 # debugging. They don't get copied to the final app. For more info,
1454 # check out https://www.chromium.org/developers/testing/fake-bidi
1461 # If debug_devtools is set to 1, JavaScript files for DevTools are
1462 # stored as is and loaded from disk. Otherwise, a concatenated file
1463 # is stored in resources.pak. It is still possible to load JS files
1464 # from disk by passing --debug-devtools cmdline switch.
1465 'debug_devtools%': 0,
1467 # The Java Bridge is not compiled in by default.
1470 # Code signing for iOS binaries. The bots need to be able to disable this.
1471 'chromium_ios_signing%': 1,
1473 # This flag is only used when disable_nacl==0 and disables all those
1474 # subcomponents which would require the installation of a native_client
1475 # untrusted toolchain.
1476 'disable_nacl_untrusted%': 0,
1478 # PNaCl toolchain does not support sanitizers. Disable by default.
1479 'enable_nacl_nonsfi_test%': 0,
1481 # Disable Dart by default.
1484 # Copy out the setting of disable_nacl.
1485 'disable_nacl%': '<(disable_nacl)',
1487 # Native Client toolchains, enabled by default.
1488 'disable_pnacl%': '<(disable_pnacl)',
1489 'disable_newlib%': '<(disable_newlib)',
1491 # Whether to build full debug version for Debug configuration on Android.
1492 # Compared to full debug version, the default Debug configuration on Android
1493 # has no full v8 debug, has size optimization and linker gc section, so that
1494 # we can build a debug version with acceptable size and performance.
1495 'android_full_debug%': 0,
1497 # Contains data about the attached devices for gyp_managed_install.
1498 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1500 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1501 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1503 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1504 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1506 # Whether we are using the rlz library or not. Platforms like Android send
1507 # rlz codes for searches but do not use the library.
1508 'enable_rlz_support%': 0,
1511 # Turns on the i18n support in V8.
1512 'v8_enable_i18n_support': 1,
1514 # Compile d8 for the host toolset.
1515 'v8_toolset_for_d8': 'host',
1517 # Use brlapi from brltty for braille display support.
1520 # Relative path to icu.gyp from this file.
1521 'icu_gyp_path': '../third_party/icu/icu.gyp',
1523 # IPC fuzzer is disabled by default.
1524 'enable_ipc_fuzzer%': 0,
1526 # Force disable libstdc++ debug mode.
1527 'disable_glibcxx_debug%': 0,
1529 # Set to 1 to compile with MSE support for MPEG2 TS
1530 'enable_mpeg2ts_stream_parser%': 0,
1532 # Support ChromeOS touchpad gestures with ozone.
1533 'use_evdev_gestures%': 0,
1535 # Default ozone platform (if no --ozone-platform flag).
1536 'ozone_platform%': "",
1538 # Ozone platforms to include in the build.
1539 'ozone_platform_caca%': 0,
1540 'ozone_platform_cast%': 0,
1541 'ozone_platform_drm%': 0,
1542 'ozone_platform_egltest%': 0,
1543 'ozone_platform_gbm%': 0,
1544 'ozone_platform_ozonex%': 0,
1545 'ozone_platform_test%': 0,
1547 # Experiment: http://crbug.com/426914
1550 # Used to set libjpeg_gyp_path. Chrome OS ui/gfx/gfx.gyp uses the IJG path
1551 # for robust login screen decoding.
1552 'libjpeg_ijg_gyp_path': '<(DEPTH)/third_party/libjpeg/libjpeg.gyp',
1553 'libjpeg_turbo_gyp_path': '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp',
1556 ['buildtype=="Official"', {
1557 # Continue to embed build meta data in Official builds, basically the
1558 # time it was built.
1559 # TODO(maruel): This decision should be revisited because having an
1560 # official deterministic build has high value too but MSVC toolset can't
1561 # generate anything deterministic with WPO enabled AFAIK.
1562 'dont_embed_build_metadata%': 0,
1564 # Enable the Syzygy optimization step for the official builds.
1565 ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
1566 'syzygy_optimize%': 1,
1568 'syzygy_optimize%': 0,
1570 # Get binutils version so we can enable debug fission if we can.
1571 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1573 # compiler_version doesn't work with clang
1574 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1575 # compiler_version works with clang.
1576 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1577 # that it takes effect here.
1578 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1579 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1581 # On Android we know the binutils version in the toolchain.
1583 'binutils_version%': 222,
1585 ['host_arch=="x64"', {
1586 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1588 ['host_arch=="ia32"', {
1589 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1591 # Our version of binutils in third_party/binutils
1592 ['linux_use_bundled_binutils==1', {
1593 'binutils_version%': 224,
1597 'binutils_version%': 0,
1599 # The version of GCC in use, set later in platforms that use GCC and have
1600 # not explicitly chosen to build with clang. Currently, this means all
1601 # platforms except Windows, Mac and iOS.
1602 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1603 # it takes effect here.
1604 ['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', {
1607 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1608 # We directly set the gcc version since we know what we use.
1611 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1612 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1616 'host_gcc_version%': 0,
1619 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1620 'directx_sdk_path%': '<(directx_sdk_default_path)',
1622 'directx_sdk_path%': '$(DXSDK_DIR)',
1625 'windows_driver_kit_path%': '$(WDK_DIR)',
1627 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1629 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1632 'nacl_untrusted_build%': 0,
1633 'use_allocator%': 'none',
1635 # Use a 64-bit linker to avoid running out of address space. The
1636 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1637 ['host_arch=="ia32" and target_arch=="ia32"', {
1638 # TODO(thestig) This is a horrible way to force the desired
1639 # configuration. Our gyp variable scoping is likely wrong and
1640 # needs to be cleaned up. The GN configuration should be changed
1642 'binutils_version%': 224,
1643 'linux_use_bundled_binutils%': '1',
1644 'linux_use_bundled_gold%': '1',
1645 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1647 # All Chrome builds have breakpad symbols, but only process the
1648 # symbols from official builds.
1649 ['(branding=="Chrome" and buildtype=="Official")', {
1650 'linux_dump_symbols%': 1,
1652 # Omit unwind support in official release builds to save space. We
1653 # can use breakpad for these builds.
1654 'release_unwind_tables%': 0,
1657 }], # os_posix==1 and OS!="mac" and OS!="ios"
1660 'enable_background%': 0,
1661 'icu_use_data_file_flag%': 1,
1662 'enable_web_speech%': 0,
1663 'use_system_libxml%': 1,
1664 'use_system_sqlite%': 1,
1666 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1667 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1668 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1669 'uk', 'vi', 'zh-CN', 'zh-TW',
1672 # iOS SDK and deployment target support. The |ios_sdk| value is left
1673 # blank so that when it is set in the project files it will be the
1674 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1675 # causes Xcode to spit out a warning for every single project file for
1676 # not using the "current" SDK.
1678 'ios_sdk_path%': '',
1679 'ios_deployment_target%': '7.0',
1682 # ios_product_name is set to the name of the .app bundle as it should
1684 ['branding=="Chrome"', {
1685 'ios_product_name%': 'Chrome',
1686 }, { # else: branding!="Chrome"
1687 'ios_product_name%': 'Chromium',
1689 ['branding=="Chrome" and buildtype=="Official"', {
1691 }, { # else: branding!="Chrome" or buildtype!="Official"
1697 # Location of Android NDK.
1700 # Standard libraries can use the relative path to the NDK.
1701 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1702 # Unfortunately, it is required to use the absolute path to the SDK
1703 # because it us passed to ant which uses a different relative path
1705 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1706 # Similarly, gdbserver and the Android toolchain need to use the
1707 # absolute path to the NDK because they are used at different levels
1709 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1710 'android_host_arch%': '<!(uname -m)',
1711 # Android API-level of the SDK used for compilation.
1712 'android_sdk_version%': '22',
1713 'android_sdk_build_tools_version%': '22.0.0',
1714 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1716 # Copy conditionally-set variables out one scope.
1717 'android_ndk_root%': '<(android_ndk_root)',
1718 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1719 'android_sdk_root%': '<(android_sdk_root)',
1720 'android_sdk_version%': '<(android_sdk_version)',
1721 'android_libcpp_root': '<(android_ndk_root)/sources/cxx-stl/llvm-libc++',
1722 'host_os%': '<(host_os)',
1724 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1725 # Android SDK build tools (e.g. dx, aidl)
1726 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1728 # Android API level 16 is JB (Android 4.1) which is the minimum
1729 # platform requirement for Chrome on Android, we use it for native
1732 ['target_arch == "ia32"', {
1733 'android_app_abi%': 'x86',
1734 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
1735 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-x86',
1736 'android_ndk_lib_dir%': 'usr/lib',
1737 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1739 ['target_arch == "x64"', {
1740 'android_app_abi%': 'x86_64',
1741 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1742 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1743 'android_ndk_lib_dir%': 'usr/lib64',
1744 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1746 ['target_arch=="arm"', {
1749 'android_app_abi%': 'armeabi',
1751 'android_app_abi%': 'armeabi-v7a',
1754 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
1755 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-arm',
1756 'android_ndk_lib_dir%': 'usr/lib',
1757 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1759 ['target_arch == "arm64"', {
1760 'android_app_abi%': 'arm64-v8a',
1761 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1762 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1763 'android_ndk_lib_dir%': 'usr/lib',
1764 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1766 ['target_arch == "mipsel"', {
1767 'android_app_abi%': 'mips',
1768 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
1769 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-mips',
1770 'android_ndk_lib_dir%': 'usr/lib',
1771 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1773 ['target_arch == "mips64el"', {
1774 'android_app_abi%': 'mips64',
1775 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1776 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1777 'android_ndk_lib_dir%': 'usr/lib64',
1778 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1782 # Copy conditionally-set variables out one scope.
1783 'android_app_abi%': '<(android_app_abi)',
1784 'android_gdbserver%': '<(android_gdbserver)',
1785 'android_ndk_root%': '<(android_ndk_root)',
1786 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1787 'android_sdk_root%': '<(android_sdk_root)',
1788 'android_sdk_version%': '<(android_sdk_version)',
1789 'android_toolchain%': '<(android_toolchain)',
1791 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1792 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1793 'android_sdk_tools%': '<(android_sdk_tools)',
1794 'android_aapt_path%': '<(android_sdk_tools)/aapt',
1795 'android_sdk%': '<(android_sdk)',
1796 'android_sdk_jar%': '<(android_sdk)/android.jar',
1798 'android_libcpp_root': '<(android_libcpp_root)',
1799 'android_libcpp_include': '<(android_libcpp_root)/libcxx/include',
1800 'android_libcpp_libs_dir%': '<(android_libcpp_root)/libs/<(android_app_abi)',
1801 'host_os%': '<(host_os)',
1803 # Location of the "objcopy" binary, used by both gyp and scripts.
1804 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1806 # Location of the "strip" binary, used by both gyp and scripts.
1807 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1809 # Location of the "readelf" binary.
1810 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1812 # Determines whether we should optimize JNI generation at the cost of
1813 # breaking assumptions in the build system that when inputs have changed
1814 # the outputs should always change as well. This is meant purely for
1815 # developer builds, to avoid spurious re-linking of native files.
1816 'optimize_jni_generation%': '<(optimize_jni_generation)',
1818 # Use OpenSSL's struct X509 to represent certificates.
1819 'use_openssl_certs%': 1,
1821 'proprietary_codecs%': '<(proprietary_codecs)',
1822 'safe_browsing%': 2,
1823 'enable_web_speech%': 0,
1825 'use_allocator%': 'none',
1827 # Disable Native Client.
1830 # Android does not support background apps.
1831 'enable_background%': 0,
1833 # Sessions are store separately in the Java side.
1834 'enable_session_service%': 0,
1838 'gtest_target_type%': 'shared_library',
1841 'use_system_fontconfig%': 0,
1843 'use_system_fontconfig%': 1,
1846 'enable_mpeg2ts_stream_parser%': 1,
1847 'ffmpeg_branding%': 'ChromeOS',
1848 'ozone_platform_ozonex%': 1,
1849 'use_custom_freetype%': 0,
1850 'use_playready%': 0,
1852 ['target_arch=="arm"', {
1854 'arm_tune%': 'cortex-a9',
1860 ['chromecast==1 and OS!="android"', {
1861 'ozone_platform_cast%': 1
1868 # All Chrome builds have breakpad symbols, but only process the
1869 # symbols from official builds.
1870 ['(branding=="Chrome" and buildtype=="Official")', {
1871 'mac_strip_release%': 1,
1875 ['OS=="mac" or OS=="ios"', {
1879 # Mac OS X SDK and deployment target support. The SDK identifies
1880 # the version of the system headers that will be used, and
1881 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1882 # macro. "Maximum allowed" refers to the operating system version
1883 # whose APIs are available in the headers. The deployment target
1884 # identifies the minimum system version that the built products are
1885 # expected to function on. It corresponds to the
1886 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1887 # macros are available, #include <AvailabilityMacros.h>. Additional
1888 # documentation on these macros is available at
1889 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1890 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1891 # deployment target to 10.6. Other projects, such as O3D, may
1892 # override these defaults.
1894 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1895 # about that is at least the specified version. In official builds,
1896 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1897 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1898 # path to the SDK; when set to a non-empty string, SDK detection
1899 # based on mac_sdk_min will be bypassed entirely.
1902 'mac_sdk_min%': '10.8',
1903 }, { # else OS!="ios"
1904 'mac_sdk_min%': '10.6',
1907 'mac_sdk_path%': '',
1909 'mac_deployment_target%': '10.6',
1912 'mac_sdk_min': '<(mac_sdk_min)',
1913 'mac_sdk_path': '<(mac_sdk_path)',
1914 'mac_deployment_target': '<(mac_deployment_target)',
1916 # Compile in Breakpad support by default so that it can be
1917 # tested, even if it is not enabled by default at runtime.
1918 'mac_breakpad_compiled_in%': 1,
1920 # mac_product_name is set to the name of the .app bundle as it should
1921 # appear on disk. This duplicates data from
1922 # chrome/app/theme/chromium/BRANDING and
1923 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1924 # these names into the build system.
1925 ['branding=="Chrome"', {
1926 'mac_product_name%': 'Google Chrome',
1927 }, { # else: branding!="Chrome"
1928 'mac_product_name%': 'Chromium',
1930 # Official mac builds require a specific OS X SDK, but iOS and
1931 # non-official mac builds do not.
1932 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1933 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1935 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1937 ['branding=="Chrome" and buildtype=="Official"', {
1938 # Enable uploading crash dumps.
1939 'mac_breakpad_uploads%': 1,
1940 # Enable dumping symbols at build time for use by Mac Breakpad.
1942 # Enable Keystone auto-update support.
1944 }, { # else: branding!="Chrome" or buildtype!="Official"
1945 'mac_breakpad_uploads%': 0,
1950 }], # OS=="mac" or OS=="ios"
1953 # This is the architecture convention used in WinSDK paths.
1954 ['target_arch=="ia32"', {
1955 'winsdk_arch%': 'x86',
1957 'winsdk_arch%': '<(target_arch)',
1959 ['component=="shared_library" or MSVS_VERSION == "2015"', {
1960 # TODO(scottmg): The allocator shimming doesn't work on the 2015 CRT
1961 # and we are hoping to be able to remove it if an additional feature
1962 # lands in the 2015 CRT API. For now, don't shim and revisit once
1963 # VS2015 is RTM: http://crbug.com/481611.
1964 'win_use_allocator_shim%': 0,
1966 ['component=="static_library"', {
1967 # Turn on multiple dll by default on Windows when in static_library.
1968 'chrome_multiple_dll%': 1,
1970 ['asan==1 or syzyasan==1', {
1971 'win_use_allocator_shim%': 0,
1976 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1977 # Only enabled by default for ninja because it's buggy in VS.
1978 # Not enabled for component=static_library because some targets
1979 # are too large and the toolchain fails due to the size of the
1981 'incremental_chrome_dll%': 1,
1983 # Don't do incremental linking for large modules on 32-bit or when
1984 # component=static_library as the toolchain fails due to the size of
1986 ['MSVS_OS_BITS==32 or component=="static_library"', {
1987 'msvs_large_module_debug_link_mode%': '1', # No
1989 'msvs_large_module_debug_link_mode%': '2', # Yes
1992 'nacl_win64_defines': [
1993 # This flag is used to minimize dependencies when building
1994 # Native Client loader for 64-bit Windows.
1997 # Need to include allocator target, but exclude tcmalloc files.
1998 'use_allocator%': 'winheap',
2001 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
2007 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win") and chromecast==0', {
2008 'enable_pepper_cdms%': 1,
2010 'enable_pepper_cdms%': 0,
2013 ['OS=="android" or chromecast==1', {
2014 'enable_browser_cdms%': 1,
2016 'enable_browser_cdms%': 0,
2019 # Native Client glibc toolchain is enabled
2020 # by default except on arm, mips and mips64.
2021 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
2022 'disable_glibc%': 1,
2024 'disable_glibc%': 0,
2027 # Set the relative path from this file to the GYP file of the JPEG
2028 # library used by Chromium.
2029 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2030 # Configuration for using the system libjeg is here.
2031 'libjpeg_gyp_path': '<(libjpeg_ijg_gyp_path)',
2033 'libjpeg_gyp_path': '<(libjpeg_turbo_gyp_path)',
2036 # Options controlling the use of GConf (the classic GNOME configuration
2037 # system) and GIO, which contains GSettings (the new GNOME config system).
2038 ['chromeos==1 or embedded==1', {
2046 # Set up -D and -E flags passed into grit.
2047 ['branding=="Chrome"', {
2048 # TODO(mmoss) The .grd files look for _google_chrome, but for
2049 # consistency they should look for google_chrome_build like C++.
2050 'grit_defines': ['-D', '_google_chrome',
2051 '-E', 'CHROMIUM_BUILD=google_chrome'],
2053 'grit_defines': ['-D', '_chromium',
2054 '-E', 'CHROMIUM_BUILD=chromium'],
2057 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2059 ['desktop_linux==1', {
2060 'grit_defines': ['-D', 'desktop_linux'],
2062 ['toolkit_views==1', {
2063 'grit_defines': ['-D', 'toolkit_views'],
2066 'grit_defines': ['-D', 'use_aura'],
2069 'grit_defines': ['-D', 'use_ash'],
2071 ['use_nss_certs==1', {
2072 'grit_defines': ['-D', 'use_nss_certs'],
2075 'grit_defines': ['-D', 'use_ozone'],
2077 ['image_loader_extension==1', {
2078 'grit_defines': ['-D', 'image_loader_extension'],
2081 'grit_defines': ['-D', 'remoting'],
2083 ['use_titlecase_in_grd==1', {
2084 'grit_defines': ['-D', 'use_titlecase'],
2086 ['use_third_party_translations==1', {
2087 'grit_defines': ['-D', 'use_third_party_translations'],
2089 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2090 'ka', 'ku', 'kw', 'ms', 'ug'
2096 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2097 '--no-output-all-resource-defines',
2100 ['OS=="mac" or OS=="ios"', {
2101 'grit_defines': ['-D', 'scale_factors=2x'],
2105 'enable_coverage%': 0,
2109 '--no-output-all-resource-defines',
2111 # iOS uses a whitelist to filter resources.
2112 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2114 # Enable host builds when generating with ninja-ios.
2116 ['"<(GENERATOR)"=="ninja"', {
2120 # Use the version of clang shipped with Xcode when building official
2121 # version of Chrome for iOS.
2123 # TODO(eugenebut): Remove enable_coverage check once
2124 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2125 # http://crbug.com/450379
2126 ['buildtype=="Official" or enable_coverage', {
2131 ['enable_extensions==1', {
2132 'grit_defines': ['-D', 'enable_extensions'],
2134 ['enable_plugins!=0', {
2135 'grit_defines': ['-D', 'enable_plugins'],
2137 ['enable_basic_printing==1 or enable_print_preview==1', {
2138 'grit_defines': ['-D', 'enable_printing'],
2140 ['enable_print_preview==1', {
2141 'grit_defines': ['-D', 'enable_print_preview'],
2143 ['enable_themes==1', {
2144 'grit_defines': ['-D', 'enable_themes'],
2146 ['enable_app_list==1', {
2147 'grit_defines': ['-D', 'enable_app_list'],
2149 ['enable_settings_app==1', {
2150 'grit_defines': ['-D', 'enable_settings_app'],
2152 ['enable_google_now==1', {
2153 'grit_defines': ['-D', 'enable_google_now'],
2155 ['use_concatenated_impulse_responses==1', {
2156 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2158 ['enable_media_router==1', {
2159 'grit_defines': ['-D', 'enable_media_router'],
2161 ['enable_webrtc==1', {
2162 'grit_defines': ['-D', 'enable_webrtc'],
2164 ['enable_hangout_services_extension==1', {
2165 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2167 ['enable_task_manager==1', {
2168 'grit_defines': ['-D', 'enable_task_manager'],
2170 ['notifications==1', {
2171 'grit_defines': ['-D', 'enable_notifications'],
2173 ['enable_wifi_bootstrapping==1', {
2174 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2176 ['mac_views_browser==1', {
2177 'grit_defines': ['-D', 'mac_views_browser'],
2179 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2180 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2182 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2183 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2185 ['enable_mdns==1 or OS=="mac"', {
2186 'grit_defines': ['-D', 'enable_service_discovery'],
2187 'enable_service_discovery%': 1
2189 ['clang_use_chrome_plugins==1', {
2195 ['OS=="mac" or OS=="ios"', {
2196 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2197 }, { # OS != "mac" or OS != "ios"
2198 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
2202 'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ',
2204 # On Windows, the plugin is built directly into clang, so there's
2205 # no need to load it dynamically.
2206 'clang_dynlib_flags%': '',
2208 # https://crbug.com/441916
2209 ['OS=="android" or OS=="linux" or OS=="mac"', {
2210 'clang_plugin_args%': '-Xclang -plugin-arg-find-bad-constructs -Xclang check-templates ',
2211 }, { # OS != "linux"
2212 'clang_plugin_args%': ''
2216 # If you change these, also change build/config/clang/BUILD.gn.
2217 'clang_chrome_plugins_flags%':
2218 '<(clang_dynlib_flags)'
2219 '-Xclang -add-plugin -Xclang find-bad-constructs <(clang_plugin_args)',
2221 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2223 'use_allocator%': 'none',
2224 'use_sanitizer_options%': 1,
2227 ['OS=="linux" and asan==0 and msan==0 and lsan==0 and tsan==0', {
2228 # PNaCl toolchain Non-SFI build only supports linux OS build.
2229 # Also, it does not support sanitizers.
2230 'enable_nacl_nonsfi_test%': 1,
2232 ['asan==1 and OS=="linux" and chromeos==0', {
2233 'use_custom_libcxx%': 1,
2241 ['asan==1 and OS=="mac"', {
2242 'mac_strip_release': 1,
2245 'use_custom_libcxx%': 1,
2248 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2249 # libstdc++. This is required to avoid false positive reports whenever
2250 # the C++ standard library is used.
2251 'use_custom_libcxx%': 1,
2252 # Running the V8-generated code on an ARM simulator is a powerful hack
2253 # that allows the tool to see the memory accesses from JITted code.
2254 # Without this flag, JS code causes false positive reports from MSan.
2255 'v8_target_arch': 'arm64',
2258 ['OS=="linux" and clang_type_profiler==1', {
2260 'clang_use_chrome_plugins%': 0,
2262 ['host_arch=="x64"', {
2263 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2265 ['host_arch=="ia32"', {
2266 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2267 # Clang in this directory at your own risk if needed for some
2268 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2269 # usage). Any failure by this compiler should not close the tree.
2270 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2275 # On valgrind bots, override the optimizer settings so we don't inline too
2276 # much and make the stacks harder to figure out.
2278 # TODO(rnk): Kill off variables that no one else uses and just implement
2279 # them under a build_for_tool== condition.
2280 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2282 'mac_debug_optimization': '1',
2283 'mac_release_optimization': '1',
2284 'release_optimize': '1',
2285 'no_gc_sections': 1,
2286 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2287 '-fno-builtin -fno-optimize-sibling-calls',
2288 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2289 '-fno-builtin -fno-optimize-sibling-calls',
2291 # MSVS flags for TSan on Pin and Windows.
2292 'win_debug_RuntimeChecks': '0',
2293 'win_debug_disable_iterator_debugging': '1',
2294 'win_debug_Optimization': '1',
2295 'win_debug_InlineFunctionExpansion': '0',
2296 'win_release_InlineFunctionExpansion': '0',
2297 'win_release_OmitFramePointers': '0',
2299 'use_allocator': 'tcmalloc',
2300 'release_valgrind_build': 1,
2302 'component': 'static_library',
2303 'use_system_zlib': 0,
2306 # Build tweaks for DrMemory.
2307 # TODO(rnk): Combine with tsan config to share the builder.
2308 # http://crbug.com/108155
2309 ['build_for_tool=="drmemory"', {
2310 # These runtime checks force initialization of stack vars which blocks
2311 # DrMemory's uninit detection.
2312 'win_debug_RuntimeChecks': '0',
2313 # Iterator debugging is slow.
2314 'win_debug_disable_iterator_debugging': '1',
2315 # Try to disable optimizations that mess up stacks in a release build.
2316 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2317 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2318 # compiler bug, so we use /Ob1 instead.
2319 'win_release_InlineFunctionExpansion': '1',
2320 'win_release_OmitFramePointers': '0',
2321 # Ditto for debug, to support bumping win_debug_Optimization.
2322 'win_debug_InlineFunctionExpansion': 0,
2323 'win_debug_OmitFramePointers': 0,
2324 # Keep the code under #ifndef NVALGRIND.
2325 'release_valgrind_build': 1,
2328 # RLZ library is used on Win, Mac, iOS and ChromeOS.
2329 ['OS=="win" or OS=="mac" or OS=="ios" or chromeos==1', {
2330 'enable_rlz_support%': 1,
2332 # RLZ is enabled for "Chrome" builds.
2333 ['branding=="Chrome"', {
2339 # Set default compiler flags depending on ARM version.
2340 ['arm_version==6', {
2341 'arm_arch%': 'armv6',
2344 'arm_float_abi%': 'softfp',
2347 ['arm_version==7', {
2348 'arm_arch%': 'armv7-a',
2349 'arm_tune%': 'generic-armv7-a',
2354 'arm_fpu%': 'vfpv3-d16',
2357 'arm_float_abi%': 'softfp',
2359 'arm_float_abi%': 'hard',
2365 # Set default compiler flags for MIPS floating-point support.
2366 ['target_arch=="mipsel"', {
2367 'mips_float_abi%': 'hard',
2369 ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
2370 'mips_fpu_mode%': 'fp32',
2372 'mips_fpu_mode%': '',
2375 # Enable brlapi by default for chromeos.
2380 ['use_ozone==1 and ozone_auto_platforms==1', {
2381 # Use test as the default platform.
2382 'ozone_platform%': 'test',
2384 # Build all platforms whose deps are in install-build-deps.sh.
2385 # Only these platforms will be compile tested by buildbots.
2386 'ozone_platform_drm%': 1,
2387 'ozone_platform_test%': 1,
2388 'ozone_platform_egltest%': 1,
2391 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2392 'use_clipboard_aurax11%': 1,
2395 ['OS=="win" and use_goma==1', {
2396 # goma doesn't support pch yet.
2397 'chromium_win_pch': 0,
2398 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2400 ['win_z7==0 and fastbuild==0', {
2406 ['OS=="win" and (clang==1 or asan==1)', {
2407 'chromium_win_pch': 0,
2411 'host_cc': '<(make_clang_dir)/bin/clang',
2412 'host_cxx': '<(make_clang_dir)/bin/clang++',
2414 'host_cc': '<!(which gcc)',
2415 'host_cxx': '<!(which g++)',
2418 # The seccomp-bpf sandbox is only supported on five architectures
2420 # Do not disable seccomp_bpf anywhere without talking to
2421 # security@chromium.org!
2422 ['((OS=="linux" or OS=="android") and '
2423 '(target_arch=="ia32" or target_arch=="x64" or '
2424 'target_arch=="arm" or target_arch=="mipsel" or '
2425 'target_arch=="arm64"))', {
2426 'use_seccomp_bpf%': 1,
2428 'use_seccomp_bpf%': 0,
2435 ['branding=="Chrome" and buildtype=="Official"', {
2436 'enable_hangout_services_extension%': 1,
2438 'enable_hangout_services_extension%': 0,
2442 # The path to the ANGLE library.
2443 'angle_path': '<(DEPTH)/third_party/angle',
2445 # List of default apps to install in new profiles. The first list contains
2446 # the source files as found in svn. The second list, used only for linux,
2447 # contains the destination location for each of the files. When a crx
2448 # is added or removed from the list, the chrome/browser/resources/
2449 # default_apps/external_extensions.json file must also be updated.
2451 # README: GN version of these is in the target //chrome:default_apps
2452 # (there's no global variable like in GYP). Be sure to update that target
2453 # if you change these lists!
2454 'default_apps_list': [
2455 'browser/resources/default_apps/external_extensions.json',
2456 'browser/resources/default_apps/gmail.crx',
2457 'browser/resources/default_apps/search.crx',
2458 'browser/resources/default_apps/youtube.crx',
2459 'browser/resources/default_apps/drive.crx',
2460 'browser/resources/default_apps/docs.crx',
2462 'default_apps_list_linux_dest': [
2463 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2464 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2465 '<(PRODUCT_DIR)/default_apps/search.crx',
2466 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2467 '<(PRODUCT_DIR)/default_apps/drive.crx',
2468 '<(PRODUCT_DIR)/default_apps/docs.crx',
2471 # Whether to allow building of the GPU-related isolates.
2472 'archive_gpu_tests%': 0,
2474 # Whether to allow building of chromoting related isolates.
2475 'archive_chromoting_tests%': 0,
2477 # Whether to allow building of Media Router related isolates.
2478 'archive_media_router_tests%': 0,
2480 'target_defaults': {
2482 # The condition that operates on chromium_code is in a target_conditions
2483 # section, and will not have access to the default fallback value of
2484 # chromium_code at the top of this file, or to the chromium_code
2485 # variable placed at the root variables scope of .gyp files, because
2486 # those variables are not set at target scope. As a workaround,
2487 # if chromium_code is not set at target scope, define it in target scope
2488 # to contain whatever value it has during early variable expansion.
2489 # That's enough to make it available during target conditional
2491 'chromium_code%': '<(chromium_code)',
2493 'component%': '<(component)',
2495 'chromecast%': '<(chromecast)',
2497 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2498 'win_release_Optimization%': '2', # 2 = /O2
2499 'win_debug_Optimization%': '0', # 0 = /Od
2501 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2502 # Tri-state: blank is default, 1 on, 0 off
2503 'win_release_OmitFramePointers%': '0',
2504 # Tri-state: blank is default, 1 on, 0 off
2505 'win_debug_OmitFramePointers%': '',
2507 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2508 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2510 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2511 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2512 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2514 # VS inserts quite a lot of extra checks to algorithms like
2515 # std::partial_sort in Debug build which make them O(N^2)
2516 # instead of O(N*logN). This is particularly slow under memory
2517 # tools like ThreadSanitizer so we want it to be disablable.
2518 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2519 'win_debug_disable_iterator_debugging%': '0',
2521 # An application manifest fragment to declare compatibility settings for
2522 # 'executable' targets. Ignored in other target type.
2523 'win_exe_compatibility_manifest%':
2524 '<(DEPTH)\\build\\win\\compatibility.manifest',
2526 'release_extra_cflags%': '',
2527 'debug_extra_cflags%': '',
2529 'release_valgrind_build%': '<(release_valgrind_build)',
2531 # the non-qualified versions are widely assumed to be *nix-only
2532 'win_release_extra_cflags%': '',
2533 'win_debug_extra_cflags%': '',
2535 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2536 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2538 # Only used by Windows build for now. Can be used to build into a
2539 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2540 # output files in src/build/VS2010_{Debug,Release}.
2541 'build_dir_prefix%': '',
2543 # Targets are by default not nacl untrusted code.
2544 'nacl_untrusted_build%': 0,
2546 'pnacl_compile_flags': [
2547 # pnacl uses the clang compiler so we need to suppress all the
2548 # same warnings as we do for clang.
2549 # TODO(sbc): Remove these if/when they are removed from the clang
2551 '-Wno-unused-function',
2552 '-Wno-char-subscripts',
2553 '-Wno-c++11-extensions',
2554 '-Wno-unnamed-type-template-args',
2557 # By default, Android targets have their exported JNI symbols stripped,
2558 # so we test the manual JNI registration code paths that are required
2559 # when using the crazy linker. To allow use of native JNI exports (lazily
2560 # resolved by the JVM), targets can enable this variable, which will stop
2561 # the stripping from happening. Only targets which do not need to be
2562 # compatible with the crazy linker are permitted to set this.
2563 'use_native_jni_exports%': 0,
2566 ['OS=="win" and component=="shared_library"', {
2567 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2568 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2569 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2571 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2572 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2573 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2576 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2577 'mac_release_optimization%': 's', # Use -Os unless overridden
2578 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2580 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2581 'mac_release_optimization%': '2', # Use -O2 unless overridden
2582 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2585 'host_os%': '<(host_os)', # See comment above chromium_code.
2588 'clang_warning_flags': [
2591 # Don't die on dtoa code that uses a char as an array index.
2592 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2593 '-Wno-char-subscripts',
2595 # TODO(thakis): This used to be implied by -Wno-unused-function,
2596 # which we no longer use. Check if it makes sense to remove
2597 # this as well. http://crbug.com/316352
2598 '-Wno-unneeded-internal-declaration',
2600 # Warns on switches on enums that cover all enum values but
2601 # also contain a default: branch. Chrome is full of that.
2602 '-Wno-covered-switch-default',
2604 # Warns when a const char[] is converted to bool.
2605 '-Wstring-conversion',
2607 # C++11-related flags:
2609 # This warns on using ints as initializers for floats in
2610 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2611 # which happens in several places in chrome code. Not sure if
2612 # this is worth fixing.
2613 '-Wno-c++11-narrowing',
2615 # Clang considers the `register` keyword as deprecated, but e.g.
2616 # code generated by flex (used in angle) contains that keyword.
2617 # http://crbug.com/255186
2618 '-Wno-deprecated-register',
2620 # TODO(hans): Get this cleaned up, http://crbug.com/428099
2621 '-Wno-inconsistent-missing-override',
2623 # TODO(thakis): Enable this, crbug.com/507717
2624 '-Wno-shift-negative-value',
2627 'includes': [ 'set_clang_warning_flags.gypi', ],
2629 # Don't use deprecated V8 APIs anywhere.
2630 'V8_DEPRECATION_WARNINGS',
2633 '<(SHARED_INTERMEDIATE_DIR)',
2637 # When compiling Objective C, warns if a method is used whose
2638 # availability is newer than the deployment target.
2639 'xcode_settings': { 'WARNING_CFLAGS': ['-Wpartial-availability']},
2641 ['(OS=="mac" or OS=="ios") and asan==1', {
2643 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2646 ['OS=="win" and asan==1 and component=="shared_library"', {
2648 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2651 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2652 'cflags_cc!': ['-fno-rtti'],
2655 '-gline-tables-only',
2656 '-fintercept-allocation-functions',
2658 'defines': ['TYPE_PROFILING'],
2660 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2663 ['branding=="Chrome"', {
2664 'defines': ['GOOGLE_CHROME_BUILD'],
2665 }, { # else: branding!="Chrome"
2666 'defines': ['CHROMIUM_BUILD'],
2668 ['OS=="mac" and component=="shared_library"', {
2670 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2671 'LD_RUNPATH_SEARCH_PATHS': [
2672 # For unbundled binaries.
2674 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2675 '@loader_path/../../..',
2679 ['clang==1 or host_clang==1', {
2680 # This is here so that all files get recompiled after a clang roll and
2681 # when turning clang on or off.
2682 # (defines are passed via the command line, and build systems rebuild
2683 # things when their commandline changes). Nothing should ever read this
2685 'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
2688 'defines': ['ENABLE_RLZ'],
2690 ['component=="shared_library"', {
2691 'defines': ['COMPONENT_BUILD'],
2693 ['ui_compositor_image_transport==1', {
2694 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2697 'defines': ['USE_AURA=1'],
2700 'defines': ['USE_ASH=1'],
2703 'defines': ['USE_PANGO=1'],
2706 'defines': ['USE_CAIRO=1'],
2709 'defines': ['USE_CRAS=1'],
2712 'defines': ['USE_OZONE=1'],
2714 ['use_default_render_theme==1', {
2715 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2717 ['use_libjpeg_turbo==1', {
2718 'defines': ['USE_LIBJPEG_TURBO=1'],
2721 'defines': ['USE_X11=1'],
2723 ['use_clipboard_aurax11==1', {
2724 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2726 ['enable_one_click_signin==1', {
2727 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2729 ['enable_pre_sync_backup==1', {
2730 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2732 ['image_loader_extension==1', {
2733 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2736 'defines': ['ENABLE_PROFILING=1'],
2739 'defines': ['ENABLE_REMOTING=1'],
2741 ['enable_webrtc==1', {
2742 'defines': ['ENABLE_WEBRTC=1'],
2744 ['enable_media_router==1', {
2745 'defines': ['ENABLE_MEDIA_ROUTER=1'],
2747 ['proprietary_codecs==1', {
2748 'defines': ['USE_PROPRIETARY_CODECS'],
2750 ['enable_mpeg2ts_stream_parser==1', {
2751 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2755 ['enable_viewport==1', {
2756 'defines': ['ENABLE_VIEWPORT'],
2758 ['enable_pepper_cdms==1', {
2759 'defines': ['ENABLE_PEPPER_CDMS'],
2761 ['enable_browser_cdms==1', {
2762 'defines': ['ENABLE_BROWSER_CDMS'],
2764 ['configuration_policy==1', {
2765 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2767 ['notifications==1', {
2768 'defines': ['ENABLE_NOTIFICATIONS'],
2770 ['enable_hidpi==1', {
2771 'defines': ['ENABLE_HIDPI=1'],
2773 ['enable_topchrome_md==1', {
2774 'defines': ['ENABLE_TOPCHROME_MD=1'],
2776 ['native_memory_pressure_signals==1', {
2777 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2780 'defines': ['USE_UDEV'],
2784 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2787 ['OS=="win" and fastbuild==2', {
2788 # Completely disable debug information.
2791 'GenerateDebugInformation': 'false',
2793 'VCCLCompilerTool': {
2794 'DebugInformationFormat': '0',
2798 ['OS=="win" and fastbuild==1', {
2801 # This tells the linker to generate .pdbs, so that
2802 # we can get meaningful stack traces.
2803 'GenerateDebugInformation': 'true',
2805 'VCCLCompilerTool': {
2806 # No debug info to be generated by compiler.
2807 'DebugInformationFormat': '0',
2811 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2812 'variables': { 'debug_extra_cflags': '-g0', },
2814 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2815 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2817 'variables': { 'debug_extra_cflags': '-g0', },
2819 # Android builds symbols on release by default, disable them.
2820 ['OS=="android" and fastbuild==2', {
2821 'variables': { 'release_extra_cflags': '-g0', },
2823 ['OS=="android" and fastbuild==1', {
2824 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2826 'variables': { 'release_extra_cflags': '-g0', },
2830 ['dont_embed_build_metadata==1', {
2832 'DONT_EMBED_BUILD_METADATA',
2834 }], # dont_embed_build_metadata==1
2835 ['dcheck_always_on!=0', {
2836 'defines': ['DCHECK_ALWAYS_ON=1'],
2837 }], # dcheck_always_on!=0
2838 ['tracing_like_official_build!=0', {
2839 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2840 }], # tracing_like_official_build!=0
2842 'defines': ['NO_TCMALLOC'],
2844 ['win_use_allocator_shim==1', {
2845 'defines': ['ALLOCATOR_SHIM'],
2851 'ADDRESS_SANITIZER',
2852 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2853 'MEMORY_SANITIZER_INITIAL_SIZE',
2857 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2865 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2866 'MEMORY_SANITIZER_INITIAL_SIZE',
2874 '<(DEPTH)/third_party/kasko/include',
2880 '_CRT_SECURE_NO_DEPRECATE',
2881 '_SCL_SECURE_NO_DEPRECATE',
2882 # This define is required to pull in the new Win8 interfaces from
2883 # system headers like ShObjIdl.h.
2884 'NTDDI_VERSION=0x06030000',
2885 # This is required for ATL to use XP-safe versions of its functions.
2886 '_USING_V110_SDK71_',
2889 '<(DEPTH)/third_party/wtl/include',
2894 # Generates debug info when win_z7=1
2895 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2897 'GenerateDebugInformation': 'true',
2899 'VCCLCompilerTool': {
2900 'DebugInformationFormat': '1',
2906 # This is prohibited when running /analyze.
2907 '_USING_V110_SDK71_',
2910 'VCCLCompilerTool': {
2911 # Set WarnAsError to false to disable this setting for most
2912 # projects so that compilation continues.
2913 'WarnAsError': 'false',
2914 # When win_analyze is specified add the /analyze switch.
2915 # Also add /WX- to force-disable WarnAsError for projects that
2916 # override WarnAsError.
2917 # Also, disable various noisy warnings that have low value.
2918 'AdditionalOptions': [
2920 '/wd6011', # Dereferencing NULL pointer
2921 '/wd6312', # Possible infinite loop: use of the constant
2922 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2923 '/wd6326', # Potential comparison of constant with constant
2924 '/wd28159', # Consider using 'GetTickCount64'
2925 '/wd28204', # Inconsistent SAL annotations
2926 '/wd28251', # Inconsistent SAL annotations
2927 '/wd28252', # Inconsistent SAL annotations
2928 '/wd28253', # Inconsistent SAL annotations
2929 '/wd28196', # The precondition is not satisfied
2930 '/wd28301', # Inconsistent SAL annotations
2931 '/wd6340', # Sign mismatch in function parameter
2932 '/wd28182', # Dereferencing NULL pointer
2933 # C6285 is ~16% of raw warnings and has low value
2934 '/wd6285', # non-zero constant || non-zero constant
2935 # C6334 is ~80% of raw warnings and has low value
2936 '/wd6334', # sizeof applied to an expression with an operator
2948 ['use_playready==1', {
2950 'PLAYREADY_CDM_AVAILABLE',
2955 ['enable_task_manager==1', {
2957 'ENABLE_TASK_MANAGER=1',
2960 ['enable_extensions==1', {
2962 'ENABLE_EXTENSIONS=1',
2965 ['OS=="win" and branding=="Chrome"', {
2966 'defines': ['ENABLE_SWIFTSHADER'],
2968 ['enable_dart==1', {
2969 'defines': ['WEBKIT_USING_DART=1'],
2971 ['enable_plugin_installation==1', {
2972 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2974 ['enable_plugins==1', {
2975 'defines': ['ENABLE_PLUGINS=1'],
2977 ['enable_session_service==1', {
2978 'defines': ['ENABLE_SESSION_SERVICE=1'],
2980 ['enable_themes==1', {
2981 'defines': ['ENABLE_THEMES=1'],
2983 ['enable_autofill_dialog==1', {
2984 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2986 ['enable_prod_wallet_service==1', {
2987 # In GN, this is set on the autofill tagets only. See
2988 # //components/autofill/core/browser:wallet_service
2989 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2991 ['enable_background==1', {
2992 'defines': ['ENABLE_BACKGROUND=1'],
2994 ['enable_google_now==1', {
2995 'defines': ['ENABLE_GOOGLE_NOW=1'],
2997 ['cld_version!=0', {
2998 'defines': ['CLD_VERSION=<(cld_version)'],
3000 ['enable_basic_printing==1 or enable_print_preview==1', {
3001 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
3002 'defines': ['ENABLE_PRINTING=1'],
3004 ['enable_basic_printing==1', {
3005 # Enable basic printing support and UI.
3006 'defines': ['ENABLE_BASIC_PRINTING=1'],
3008 ['enable_print_preview==1', {
3009 # Enable printing with print preview.
3010 # Can be defined without ENABLE_BASIC_PRINTING.
3011 'defines': ['ENABLE_PRINT_PREVIEW=1'],
3013 ['enable_spellcheck==1', {
3014 'defines': ['ENABLE_SPELLCHECK=1'],
3016 ['use_platform_spellchecker', {
3017 'defines': ['USE_PLATFORM_SPELLCHECKER=1'],
3019 ['enable_captive_portal_detection==1', {
3020 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
3022 ['enable_app_list==1', {
3023 'defines': ['ENABLE_APP_LIST=1'],
3025 ['enable_settings_app==1', {
3026 'defines': ['ENABLE_SETTINGS_APP=1'],
3028 ['disable_file_support==1', {
3029 'defines': ['DISABLE_FILE_SUPPORT=1'],
3031 ['disable_ftp_support==1', {
3032 'defines': ['DISABLE_FTP_SUPPORT=1'],
3034 ['enable_supervised_users==1', {
3035 'defines': ['ENABLE_SUPERVISED_USERS=1'],
3037 ['enable_mdns==1', {
3038 'defines': ['ENABLE_MDNS=1'],
3040 ['enable_service_discovery==1', {
3041 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
3043 ['enable_wifi_bootstrapping==1', {
3044 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
3046 ['enable_hangout_services_extension==1', {
3047 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
3049 ['enable_ipc_fuzzer==1', {
3050 'defines': ['ENABLE_IPC_FUZZER=1'],
3053 'defines': ['VIDEO_HOLE=1'],
3055 ['v8_use_external_startup_data==1', {
3056 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
3058 ['enable_webvr==1', {
3059 'defines': ['ENABLE_WEBVR'],
3062 # SAFE_BROWSING_SERVICE - browser manages a safe-browsing service.
3063 # SAFE_BROWSING_DB_LOCAL - service manages a local database.
3064 # SAFE_BROWSING_DB_REMOTE - service talks via API to a database
3065 # SAFE_BROWSING_CSD - enable client-side phishing detection.
3066 ['safe_browsing==1', {
3068 # TODO(nparker): Remove existing uses of FULL_SAFE_BROWSING
3069 'FULL_SAFE_BROWSING',
3070 'SAFE_BROWSING_CSD',
3071 'SAFE_BROWSING_DB_LOCAL',
3072 'SAFE_BROWSING_SERVICE',
3075 ['safe_browsing==2', {
3077 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3078 'MOBILE_SAFE_BROWSING',
3079 'SAFE_BROWSING_SERVICE',
3082 ['safe_browsing==3', {
3084 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3085 'MOBILE_SAFE_BROWSING',
3086 'SAFE_BROWSING_DB_REMOTE',
3087 'SAFE_BROWSING_SERVICE',
3090 ], # conditions for 'target_defaults'
3091 'target_conditions': [
3092 ['<(use_libpci)==1', {
3093 'defines': ['USE_LIBPCI=1'],
3095 ['<(use_openssl)==1', {
3096 'defines': ['USE_OPENSSL=1'],
3098 ['<(use_openssl_certs)==1', {
3099 'defines': ['USE_OPENSSL_CERTS=1'],
3101 ['>(nacl_untrusted_build)==1', {
3104 'USE_OPENSSL_CERTS=1',
3107 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3108 'defines': ['USE_GLIB=1'],
3110 ['<(use_nss_certs)==1 and >(nacl_untrusted_build)==0', {
3111 'defines': ['USE_NSS_CERTS=1'],
3113 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3114 'defines': ['OS_CHROMEOS=1'],
3116 ['enable_wexit_time_destructors==1 and OS!="win"', {
3117 # TODO: Enable on Windows too, http://crbug.com/404525
3118 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3120 ['chromium_code==0', {
3122 'clang_warning_flags': [
3123 # TODO(mgiuca): Move this suppression into individual third-party
3124 # libraries as required. http://crbug.com/505301.
3125 '-Wno-overloaded-virtual',
3126 # Lots of third-party libraries have unused variables. Instead of
3127 # suppressing them individually, we just blanket suppress them here.
3128 '-Wno-unused-variable',
3132 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3133 # We don't want to get warnings from third-party code,
3134 # so remove any existing warning-enabling flags like -Wall.
3140 # Don't warn about hash_map in third-party code.
3144 # Don't warn about printf format problems.
3145 # This is off by default in gcc but on in Ubuntu's gcc(!).
3149 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3153 # TODO: Fix all warnings on chromeos too.
3154 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3159 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3161 # Don't warn about ignoring the return value from e.g. close().
3162 # This is off by default in some gccs but on by default in others.
3163 # BSD systems do not support this option, since they are usually
3164 # using gcc 4.2.1, which does not have this flag yet.
3165 '-Wno-unused-result',
3170 '_CRT_SECURE_NO_DEPRECATE',
3171 '_CRT_NONSTDC_NO_WARNINGS',
3172 '_CRT_NONSTDC_NO_DEPRECATE',
3173 '_SCL_SECURE_NO_DEPRECATE',
3175 'msvs_disabled_warnings': [
3179 'VCCLCompilerTool': {
3180 'WarningLevel': '3',
3181 'WarnAsError': 'true',
3182 'Detect64BitPortabilityProblems': 'false',
3186 ['buildtype=="Official"', {
3188 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3191 [ 'component=="shared_library"', {
3192 # TODO(darin): Unfortunately, some third_party code depends on base.
3193 'msvs_disabled_warnings': [
3194 4251, # class 'std::xx' needs to have dll-interface.
3200 [ 'OS=="mac" or OS=="ios"', {
3202 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3205 ['buildtype=="Official"', {
3207 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3214 # TODO(ios): Fix remaining warnings in third-party code, then
3215 # remove this; the Mac cleanup didn't get everything that's
3216 # flagged in an iOS build.
3217 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3218 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3219 # Several internal ios directories generate numerous warnings for
3220 # -Wobjc-missing-property-synthesis.
3221 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3227 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3228 'filename_rules.gypi',
3230 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3231 # C99 macros on Mac and Linux.
3233 '__STDC_CONSTANT_MACROS',
3234 '__STDC_FORMAT_MACROS',
3238 # turn on warnings for signed/unsigned mismatch on chromium code.
3240 'VCCLCompilerTool': {
3241 'AdditionalOptions': ['/we4389'],
3245 ['OS=="win" and component=="shared_library"', {
3246 'msvs_disabled_warnings': [
3247 4251, # class 'std::xx' needs to have dll-interface.
3252 ], # target_conditions for 'target_defaults'
3253 'default_configuration': 'Debug',
3255 # VCLinkerTool LinkIncremental values below:
3257 # 1 == /INCREMENTAL:NO
3259 # Debug links incremental, Release does not.
3261 # Abstract base configurations to cover common attributes.
3265 'msvs_configuration_attributes': {
3266 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3267 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3268 'CharacterSet': '1',
3271 'VCCLCompilerTool': {
3272 'AdditionalOptions': [
3277 # Add the default import libs.
3278 'AdditionalDependencies': [
3295 'AdditionalOptions': [
3296 # Suggested by Microsoft Devrel to avoid
3297 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3298 # which started happening more regularly after VS2013 Update 4.
3299 # Needs to be a bit lower for VS2015, or else errors out.
3300 '/maxilksize:0x7ff00000',
3309 'MinimumRequiredVersion': '5.01', # XP.
3310 'TargetMachine': '1',
3312 'VCLibrarianTool': {
3313 'TargetMachine': '1',
3316 'msvs_configuration_platform': 'Win32',
3320 'msvs_configuration_platform': 'x64',
3323 # Make sure to understand http://crbug.com/361720 if you want to
3325 'MinimumRequiredVersion': '5.02', # Server 2003.
3326 'TargetMachine': '17', # x86 - 64
3327 'AdditionalLibraryDirectories!':
3328 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3329 'AdditionalLibraryDirectories':
3330 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3331 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3332 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3334 'VCLibrarianTool': {
3335 'AdditionalLibraryDirectories!':
3336 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3337 'AdditionalLibraryDirectories':
3338 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3339 'TargetMachine': '17', # x64
3346 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3347 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3350 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3352 '<@(debug_extra_cflags)',
3356 'VCCLCompilerTool': {
3357 'Optimization': '<(win_debug_Optimization)',
3358 'PreprocessorDefinitions': ['_DEBUG'],
3359 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3360 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3362 # According to MSVS, InlineFunctionExpansion=0 means
3363 # "default inlining", not "/Ob0".
3364 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3365 ['win_debug_InlineFunctionExpansion==0', {
3366 'AdditionalOptions': ['/Ob0'],
3368 ['win_debug_InlineFunctionExpansion!=""', {
3369 'InlineFunctionExpansion':
3370 '<(win_debug_InlineFunctionExpansion)',
3372 ['win_debug_disable_iterator_debugging==1', {
3373 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3376 # if win_debug_OmitFramePointers is blank, leave as default
3377 ['win_debug_OmitFramePointers==1', {
3378 'OmitFramePointers': 'true',
3380 ['win_debug_OmitFramePointers==0', {
3381 'OmitFramePointers': 'false',
3382 # The above is not sufficient (http://crbug.com/106711): it
3383 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3384 # perform FPO regardless, so we must explicitly disable.
3385 # We still want the false setting above to avoid having
3386 # "/Oy /Oy-" and warnings about overriding.
3387 'AdditionalOptions': ['/Oy-'],
3390 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3393 'LinkIncremental': '<(msvs_debug_link_incremental)',
3394 # ASLR makes debugging with windbg difficult because Chrome.exe and
3395 # Chrome.dll share the same base name. As result, windbg will
3396 # name the Chrome.dll module like chrome_<base address>, where
3397 # <base address> typically changes with each launch. This in turn
3398 # means that breakpoints in Chrome.dll don't stick from one launch
3399 # to the next. For this reason, we turn ASLR off in debug builds.
3400 # Note that this is a three-way bool, where 0 means to pick up
3401 # the default setting, 1 is off and 2 is on.
3402 'RandomizedBaseAddress': 1,
3404 'VCResourceCompilerTool': {
3405 'PreprocessorDefinitions': ['_DEBUG'],
3409 ['OS=="linux" or OS=="android"', {
3410 'target_conditions': [
3411 ['_toolset=="target"', {
3413 '<@(debug_extra_cflags)',
3418 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3419 # Enable libstdc++ debugging facilities to help catch problems
3420 # early, see http://crbug.com/65151 .
3421 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3422 'defines': ['_GLIBCXX_DEBUG=1',],
3424 ['release_valgrind_build==0', {
3427 '-fstack-protector-all', # Implies -fstack-protector
3433 # Allow comparing the address of references and 'this' against 0
3434 # in debug builds. Technically, these can never be null in
3435 # well-defined C/C++ and Clang can optimize such checks away in
3436 # release builds, but they may be used in asserts in debug builds.
3437 '-Wno-undefined-bool-conversion',
3438 '-Wno-tautological-undefined-compare',
3442 '-Wno-undefined-bool-conversion',
3443 '-Wno-tautological-undefined-compare',
3447 'VCCLCompilerTool': {
3448 'AdditionalOptions': [
3449 '-Wno-undefined-bool-conversion',
3450 '-Wno-tautological-undefined-compare',
3463 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3464 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3465 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3468 'VCCLCompilerTool': {
3469 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3471 # In official builds, each target will self-select
3472 # an optimization level.
3473 ['buildtype!="Official"', {
3474 'Optimization': '<(win_release_Optimization)',
3477 # According to MSVS, InlineFunctionExpansion=0 means
3478 # "default inlining", not "/Ob0".
3479 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3480 ['win_release_InlineFunctionExpansion==0', {
3481 'AdditionalOptions': ['/Ob0'],
3483 ['win_release_InlineFunctionExpansion!=""', {
3484 'InlineFunctionExpansion':
3485 '<(win_release_InlineFunctionExpansion)',
3488 # if win_release_OmitFramePointers is blank, leave as default
3489 ['win_release_OmitFramePointers==1', {
3490 'OmitFramePointers': 'true',
3492 ['win_release_OmitFramePointers==0', {
3493 'OmitFramePointers': 'false',
3494 # The above is not sufficient (http://crbug.com/106711): it
3495 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3496 # perform FPO regardless, so we must explicitly disable.
3497 # We still want the false setting above to avoid having
3498 # "/Oy /Oy-" and warnings about overriding.
3499 'AdditionalOptions': ['/Oy-'],
3502 # Put data in separate COMDATs. This allows the linker
3503 # to put bit-identical constants at the same address even if
3504 # they're unrelated constants, which saves binary size.
3505 # This optimization can't be used when ASan is enabled because
3506 # it is not compatible with the ASan ODR checker.
3507 'AdditionalOptions': ['/Gw'],
3510 'AdditionalOptions': [
3511 '/d2Zi+', # Improve debugging of Release builds.
3512 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3513 '<@(win_release_extra_cflags)',
3517 # LinkIncremental is a tri-state boolean, where 0 means default
3518 # (i.e., inherit from parent solution), 1 means false, and
3520 'LinkIncremental': '1',
3521 # This corresponds to the /PROFILE flag which ensures the PDB
3522 # file contains FIXUP information (growing the PDB file by about
3523 # 5%) but does not otherwise alter the output binary. This
3524 # information is used by the Syzygy optimization tool when
3525 # decomposing the release image.
3530 ['msvs_use_common_release', {
3531 'includes': ['release.gypi'],
3533 ['release_valgrind_build==0 and tsan==0', {
3536 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3540 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3541 'MEMORY_SANITIZER_INITIAL_SIZE',
3542 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3543 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3547 'defines': ['NO_TCMALLOC'],
3549 ['win_fastlink==1', {
3552 # /PROFILE is incompatible with /debug:fastlink
3554 'AdditionalOptions': [
3555 # Tell VS 2015+ to create a PDB that references debug
3556 # information in .obj and .lib files instead of copying
3566 # This corresponds to the /PROFILE flag which ensures the PDB
3567 # file contains FIXUP information (growing the PDB file by about
3568 # 5%) but does not otherwise alter the output binary. This
3569 # information is used by the Syzygy optimization tool when
3570 # decomposing the release image.
3577 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3578 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3579 # It seems to work fine with Ubuntu 12 headers though, so use it
3580 # in official builds.
3581 ['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")', {
3582 'target_conditions': [
3583 ['chromium_code==1', {
3584 # Non-chromium code is not guaranteed to compile cleanly
3585 # with _FORTIFY_SOURCE. Also, fortified build may fail
3586 # when optimizations are disabled, so only do that for Release
3589 '_FORTIFY_SOURCE=2',
3594 ['OS=="linux" or OS=="android"', {
3595 'target_conditions': [
3596 ['_toolset=="target"', {
3598 '<@(release_extra_cflags)',
3601 ['enable_resource_whitelist_generation==1', {
3603 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3612 'NS_BLOCK_ASSERTIONS=1',
3618 # Concrete configurations
3621 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3624 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3629 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3630 'target_conditions': [
3631 [ '_type=="executable"', {
3632 # To get a real .dSYM bundle produced by dsymutil, set the
3633 # debug information format to dwarf-with-dsym. Since
3634 # strip_from_xcode will not be used, set Xcode to do the
3635 # stripping as well.
3637 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3638 'DEPLOYMENT_POSTPROCESSING': 'YES',
3639 'STRIP_INSTALLED_PRODUCT': 'YES',
3646 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3648 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3651 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3659 'target_defaults': {
3664 # TODO(glider): enable the default options on other systems.
3666 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3668 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3674 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3675 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3676 'target_defaults': {
3678 '-Wl,--fatal-warnings',
3682 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3683 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
3684 'target_defaults': {
3690 ['os_posix==1 and chromeos==0', {
3691 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3692 # and we want to avoid overriding this, so stack-protector is only
3693 # enabled when not building on Chrome OS.
3694 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3696 'target_defaults': {
3698 '-fstack-protector',
3699 '--param=ssp-buffer-size=4',
3703 ['os_posix==1 and OS=="linux"', {
3705 '_LARGEFILE_SOURCE',
3706 '_LARGEFILE64_SOURCE',
3707 '_FILE_OFFSET_BITS=64',
3710 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3711 'target_defaults': {
3712 # Enable -Werror by default, but put it in a variable so it can
3713 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3715 'werror%': '-Werror',
3716 'libraries_for_target%': '',
3719 '_FILE_OFFSET_BITS=64',
3722 '<(werror)', # See note above about the werror variable.
3724 '-fno-strict-aliasing', # See http://crbug.com/32204
3726 # Don't warn about unused function params. We use those everywhere.
3727 '-Wno-unused-parameter',
3728 # Don't warn about the "struct foo f = {0};" initialization pattern.
3729 '-Wno-missing-field-initializers',
3730 # Don't export any symbols (for example, to plugins we dlopen()).
3731 # Note: this is *required* to make some plugins work.
3732 '-fvisibility=hidden',
3738 '-fno-threadsafe-statics',
3739 # Make inline functions have hidden visiblity by default.
3740 # Surprisingly, not covered by -fvisibility=hidden.
3741 '-fvisibility-inlines-hidden',
3742 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3743 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3747 '-pthread', '-Wl,-z,noexecstack',
3750 '<(libraries_for_target)',
3755 'debug_optimize%': '0',
3761 '-O>(debug_optimize)',
3765 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3766 # TODO(jdduke) Re-enable on mips after resolving linking
3767 # issues with libc++ (crbug.com/456380).
3769 # Warn in case of text relocations.
3770 '-Wl,--warn-shared-textrel',
3773 ['OS=="android" and android_full_debug==0', {
3774 # Some configurations are copied from Release_Base to reduce
3777 'debug_optimize%': 's',
3781 '-ffunction-sections',
3788 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3789 # We don't omit frame pointers on arm64 since they are required
3790 # to correctly unwind stackframes which contain system library
3791 # function frames (crbug.com/391706).
3793 '-fomit-frame-pointer',
3796 ['OS=="linux" and target_arch=="ia32"', {
3798 '-Wl,--no-as-needed',
3801 ['debug_unwind_tables==1', {
3802 'cflags': ['-funwind-tables'],
3804 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3805 'defines': ['NO_UNWIND_TABLES'],
3807 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3808 # definitions in to the right scope to use them when setting
3809 # linux_use_debug_fission, so it can be used here alone.
3810 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3811 'cflags': ['-gsplit-dwarf'],
3817 'release_optimize%': '2',
3818 # Binaries become big and gold is unable to perform GC
3819 # and remove unused sections for some of test targets
3820 # on 32 bit platform.
3821 # (This is currently observed only in chromeos valgrind bots)
3822 # The following flag is to disable --gc-sections linker
3823 # option for these bots.
3824 'no_gc_sections%': 0,
3826 # TODO(bradnelson): reexamine how this is done if we change the
3827 # expansion of configurations
3828 'release_valgrind_build%': 0,
3831 '-O<(release_optimize)',
3832 # Don't emit the GCC version ident directives, they just end up
3833 # in the .comment section taking up binary size.
3835 # Put data and code in their own sections, so that unused symbols
3836 # can be removed at link time with --gc-sections.
3838 '-ffunction-sections',
3841 # Specifically tell the linker to perform optimizations.
3842 # See http://lwn.net/Articles/192624/ .
3847 ['no_gc_sections==0', {
3849 '-Wl,--gc-sections',
3852 ['OS=="android" and target_arch!="arm64"', {
3853 # We don't omit frame pointers on arm64 since they are required
3854 # to correctly unwind stackframes which contain system library
3855 # function frames (crbug.com/391706).
3857 '-fomit-frame-pointer',
3860 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3861 # TODO(jdduke) Re-enable on mips after resolving linking
3862 # issues with libc++ (crbug.com/456380).
3864 # Warn in case of text relocations.
3865 '-Wl,--warn-shared-textrel',
3870 'release_optimize%': 's',
3875 '-fno-omit-frame-pointer',
3879 ['profiling_full_stack_frames==1', {
3882 '-fno-optimize-sibling-calls',
3887 ['release_unwind_tables==1', {
3888 'cflags': ['-funwind-tables'],
3890 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3891 'defines': ['NO_UNWIND_TABLES'],
3897 ['target_arch=="ia32"', {
3898 'target_conditions': [
3899 ['_toolset=="target"', {
3901 # Needed so that libs with .s files (e.g. libicudata.a)
3902 # are compatible with the general 32-bit-ness.
3905 # All floating-point computations on x87 happens in 80-bit
3906 # precision. Because the C and C++ language standards allow
3907 # the compiler to keep the floating-point values in higher
3908 # precision than what's specified in the source and doing so
3909 # is more efficient than constantly rounding up to 64-bit or
3910 # 32-bit precision as specified in the source, the compiler,
3911 # especially in the optimized mode, tries very hard to keep
3912 # values in x87 floating-point stack (in 80-bit precision)
3913 # as long as possible. This has important side effects, that
3914 # the real value used in computation may change depending on
3915 # how the compiler did the optimization - that is, the value
3916 # kept in 80-bit is different than the value rounded down to
3917 # 64-bit or 32-bit. There are possible compiler options to
3918 # make this behavior consistent (e.g. -ffloat-store would keep
3919 # all floating-values in the memory, thus force them to be
3920 # rounded to its original precision) but they have significant
3921 # runtime performance penalty.
3923 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3924 # which keep floating-point values in SSE registers in its
3925 # native precision (32-bit for single precision, and 64-bit
3926 # for double precision values). This means the floating-point
3927 # value used during computation does not change depending on
3928 # how the compiler optimized the code, since the value is
3929 # always kept in its specified precision.
3931 # Refer to http://crbug.com/348761 for rationale behind SSE2
3932 # being a minimum requirement for 32-bit Linux builds and
3933 # http://crbug.com/313032 for an example where this has "bit"
3938 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3945 # Use gold linker for Android ia32 target.
3955 ['target_arch=="x64"', {
3956 'target_conditions': [
3957 ['_toolset=="target"', {
3959 # Use gold linker for Android x64 target.
3976 ['target_arch=="arm"', {
3977 'target_conditions': [
3978 ['_toolset=="target"', {
3982 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3983 # has changed whenever it encounters a varargs function. This
3984 # silences those warnings, as they are not helpful and
3985 # clutter legitimate warnings.
3989 ['clang==1 and arm_arch!="" and OS!="android"', {
3991 '-target arm-linux-gnueabihf',
3994 '-target arm-linux-gnueabihf',
3999 '-march=<(arm_arch)',
4002 ['use_lto==1 or use_lto_o2==1', {
4004 '-march=<(arm_arch)',
4009 ['clang==1 and OS!="android"', {
4011 # We need to disable clang's builtin assembler as it can't
4012 # handle several asm files, crbug.com/124610
4013 '-no-integrated-as',
4018 '-mtune=<(arm_tune)',
4021 ['use_lto==1 or use_lto_o2==1', {
4023 '-mtune=<(arm_tune)',
4033 ['use_lto==1 or use_lto_o2==1', {
4040 ['arm_float_abi!=""', {
4042 '-mfloat-abi=<(arm_float_abi)',
4045 ['use_lto==1 or use_lto_o2==1', {
4047 '-mfloat-abi=<(arm_float_abi)',
4057 ['use_lto==1 or use_lto_o2==1', {
4065 # Most of the following flags are derived from what Android
4066 # uses by default when building for arm, reference for which
4067 # can be found in the following file in the Android NDK:
4068 # toolchains/arm-linux-androideabi-4.9/setup.mk
4070 # The tree-sra optimization (scalar replacement for
4071 # aggregates enabling subsequent optimizations) leads to
4072 # invalid code generation when using the Android NDK's
4073 # compiler (r5-r7). This can be verified using
4074 # webkit_unit_tests' WTF.Checked_int8_t test.
4076 # The following option is disabled to improve binary
4077 # size and performance in gcc 4.9.
4078 '-fno-caller-saves',
4081 # Android now supports .relro sections properly.
4082 # NOTE: While these flags enable the generation of .relro
4083 # sections, the generated libraries can still be loaded on
4084 # older Android platform versions.
4091 ['gcc_version==48 and clang==0', {
4093 # The following 5 options are disabled to save on
4094 # binary size in GCC 4.8.
4095 '-fno-partial-inlining',
4096 '-fno-early-inlining',
4097 '-fno-tree-copy-prop',
4098 '-fno-tree-loop-optimize',
4099 '-fno-move-loop-invariants',
4103 'cflags': [ '-mthumb-interwork' ],
4107 # Thumb code with frame pointer makes chrome crash
4110 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
4111 # The perf report sometimes incorrectly attributes
4112 # code from tail calls.
4113 '-fno-optimize-sibling-calls',
4116 '-fomit-frame-pointer',
4121 # Clang does not support the following options.
4123 '-mthumb-interwork',
4124 '-finline-limit=64',
4126 '-fno-caller-saves',
4130 # TODO(hans) Enable integrated-as (crbug.com/124610).
4131 '-no-integrated-as',
4132 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4135 ['clang==1 and linux_use_bundled_gold==0', {
4137 # Let clang find the ld.gold in the NDK.
4138 '--gcc-toolchain=<(android_toolchain)/..',
4143 '-marm', # Required for frame pointer based stack traces.
4150 # We set arm_arch to "" so that -march compiler option
4151 # is not set. Otherwise a gcc bug that would complain
4152 # about it conflicting with '-mcpu=cortex-a9'. The flag
4153 # '-march=armv7-a' is actually redundant anyway because
4154 # it is enabled by default when we built the toolchain.
4155 # And using '-mcpu=cortex-a9' should be sufficient.
4158 # Breakpad requires symbols with debugging information
4162 # We want to statically link libstdc++/libgcc_s.
4163 '-static-libstdc++',
4167 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4168 # define their own cflags for arm builds that could
4169 # conflict with the flags we set here (e.g.
4170 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4179 ['target_arch=="arm64"', {
4180 'target_conditions': [
4181 ['_toolset=="target"', {
4185 '-fstack-protector', # stack protector is always enabled on arm64.
4192 ['target_arch=="mipsel"', {
4193 'target_conditions': [
4194 ['_toolset=="target"', {
4196 ['mips_arch_variant=="r6"', {
4199 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ],
4200 'ldflags': [ '-target mipsel-linux-gnu', ],
4202 'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
4204 ['clang==0 and OS=="android"', {
4205 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4209 ['mips_arch_variant=="r2"', {
4211 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4212 'cflags': ['-m<(mips_fpu_mode)'],
4217 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
4218 'ldflags': [ '-target mipsel-linux-android', ],
4220 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32r2'],
4221 'ldflags': [ '-target mipsel-linux-gnu', ],
4225 'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
4229 ['mips_arch_variant=="r1"', {
4234 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
4235 'ldflags': [ '-target mipsel-linux-android', ],
4237 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32'],
4238 'ldflags': [ '-target mipsel-linux-gnu', ],
4242 'cflags': ['-mips32', '-Wa,-mips32', ],
4248 # Clang does not support the following options.
4249 '-finline-limit=64',
4252 # TODO(gordanac) Enable integrated-as.
4253 '-no-integrated-as',
4256 ['clang==1 and OS=="android"', {
4258 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4261 # Let clang find the ld in the NDK.
4262 '--gcc-toolchain=<(android_toolchain)/..',
4265 ['mips_dsp_rev==1', {
4266 'cflags': ['-mdsp'],
4268 ['mips_dsp_rev==2', {
4269 'cflags': ['-mdspr2'],
4273 '-m<(mips_float_abi)-float'
4276 '-Wl,--no-keep-memory'
4279 '-Wno-uninitialized',
4284 ['target_arch=="mips64el"', {
4285 'target_conditions': [
4286 ['_toolset=="target"', {
4288 ['mips_arch_variant=="r6"', {
4289 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4290 'ldflags': ['-mips64r6'],
4292 ['mips_arch_variant=="r2"', {
4293 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4294 'ldflags': ['-mips64r2'],
4298 '-Wno-uninitialized',
4312 'target_conditions': [
4313 ['_toolset=="target"', {
4315 '--sysroot=<(sysroot)',
4318 '--sysroot=<(sysroot)',
4319 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4325 # TODO(thakis): Remove, http://crbug.com/263960
4326 '-Wno-reserved-user-defined-literal',
4329 # gnu++11 instead of c++11 is needed because some code uses
4330 # typeof() (a GNU extension).
4331 # TODO(thakis): Eventually switch this to c++11 instead,
4332 # http://crbug.com/427584
4336 ['clang==0 and host_clang==1', {
4337 'target_conditions': [
4338 ['_toolset=="host"', {
4339 'cflags_cc': [ '-std=gnu++11', ],
4343 ['clang==1 and clang_use_chrome_plugins==1', {
4345 '<@(clang_chrome_plugins_flags)',
4348 ['clang==1 and clang_load!=""', {
4350 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4353 ['clang==1 and clang_add_plugin!=""', {
4355 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4358 ['clang==1 and target_arch=="ia32"', {
4360 # Else building libyuv gives clang's register allocator issues,
4361 # see llvm.org/PR15798 / crbug.com/233709
4362 '-momit-leaf-frame-pointer',
4363 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4364 '-mstack-alignment=16',
4368 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4370 # See http://crbug.com/110262
4371 '-fcolor-diagnostics',
4374 # Common options for AddressSanitizer, LeakSanitizer,
4375 # ThreadSanitizer and MemorySanitizer.
4376 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4377 'target_conditions': [
4378 ['_toolset=="target"', {
4380 '-fno-omit-frame-pointer',
4381 '-gline-tables-only',
4384 '-fomit-frame-pointer',
4389 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4390 'target_conditions': [
4391 ['_toolset=="target"', {
4393 # Functions interposed by the sanitizers can make ld think
4394 # that some libraries aren't needed when they actually are,
4395 # http://crbug.com/234010. As workaround, disable --as-needed.
4399 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4400 'MEMORY_SANITIZER_INITIAL_SIZE',
4406 'target_conditions': [
4407 ['_toolset=="target"', {
4409 '-fsanitize=address',
4410 # TODO(earthdok): Re-enable. http://crbug.com/427202
4411 #'-fsanitize-blacklist=<(asan_blacklist)',
4414 '-fsanitize=address',
4421 '-mllvm -asan-globals=0', # http://crbug.com/352073
4427 'target_conditions': [
4428 ['_toolset=="target"', {
4430 # FIXME: work on enabling more flags and getting rid of false
4431 # positives. http://crbug.com/174801.
4432 '-fsanitize=bounds',
4433 '-fsanitize=float-divide-by-zero',
4434 '-fsanitize=integer-divide-by-zero',
4436 '-fsanitize=object-size',
4437 '-fsanitize=return',
4438 '-fsanitize=returns-nonnull-attribute',
4439 '-fsanitize=shift-exponent',
4440 '-fsanitize=signed-integer-overflow',
4441 '-fsanitize=unreachable',
4442 '-fsanitize=vla-bound',
4443 '-fsanitize-blacklist=<(ubsan_blacklist)',
4444 # Employ the experimental PBQP register allocator to avoid
4445 # slow compilation on files with too many basic blocks.
4446 # See http://crbug.com/426271.
4447 '-mllvm -regalloc=pbqp',
4448 # Speculatively use coalescing to slightly improve the code
4449 # generated by PBQP regallocator. May increase compile time.
4450 '-mllvm -pbqp-coalescing',
4459 '-fsanitize=undefined',
4462 'UNDEFINED_SANITIZER',
4468 'target_conditions': [
4469 ['_toolset=="target"', {
4472 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4484 'UNDEFINED_SANITIZER',
4489 ['asan_coverage!=0 and sanitizer_coverage==0', {
4490 'target_conditions': [
4491 ['_toolset=="target"', {
4493 '-fsanitize-coverage=<(asan_coverage)',
4496 'SANITIZER_COVERAGE',
4501 ['sanitizer_coverage!=0', {
4502 'target_conditions': [
4503 ['_toolset=="target"', {
4505 '-fsanitize-coverage=<(sanitizer_coverage)',
4508 'SANITIZER_COVERAGE',
4513 ['asan_field_padding!=0', {
4514 'target_conditions': [
4515 ['_toolset=="target"', {
4517 '-fsanitize-address-field-padding=<(asan_field_padding)',
4523 'target_conditions': [
4524 ['_toolset=="target"', {
4533 'WTF_USE_LEAK_SANITIZER=1',
4539 'target_conditions': [
4540 ['_toolset=="target"', {
4542 '-fsanitize=thread',
4543 '-fsanitize-blacklist=<(tsan_blacklist)',
4546 '-fsanitize=thread',
4550 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4551 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4557 'target_conditions': [
4558 ['_toolset=="target"', {
4560 '-fsanitize=memory',
4561 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4562 '-fsanitize-blacklist=<(msan_blacklist)',
4565 '-fsanitize=memory',
4573 ['use_instrumented_libraries==1', {
4575 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4578 ['use_prebuilt_instrumented_libraries==1', {
4580 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
4583 ['use_custom_libcxx==1', {
4585 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4588 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4589 'target_conditions' : [
4590 # crazy_linker has an upstream gyp file we can't edit, and we
4591 # don't want to instrument it.
4592 ['_toolset=="target" and _target_name!="crazy_linker"', {
4594 '-finstrument-functions',
4595 # Allow mmx intrinsics to inline, so that the
4596 #0 compiler can expand the intrinsics.
4597 '-finstrument-functions-exclude-file-list=mmintrin.h',
4600 ['_toolset=="target" and OS=="android"', {
4602 # Avoids errors with current NDK:
4603 # "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"
4604 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4609 ['linux_dump_symbols==1', {
4612 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4613 'target_conditions': [
4614 ['_toolset=="target"', {
4616 # Attempt to use less memory to prevent the linker from
4617 # running out of address space. Considering installing a
4618 # 64-bit kernel and switching to a 64-bit linker.
4619 '-Wl,--no-keep-memory',
4626 ['use_allocator!="tcmalloc"', {
4627 'defines': ['NO_TCMALLOC'],
4629 ['linux_use_gold_flags==1', {
4630 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4632 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4633 'ldflags': [ '-fuse-ld=gold', ],
4635 'target_conditions': [
4636 ['_toolset=="target"', {
4638 # Experimentation found that using four linking threads
4639 # saved ~20% of link time.
4640 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4641 # Only apply this to the target linker, since the host
4642 # linker might not be gold, but isn't used much anyway.
4643 # TODO(raymes): Disable threading because gold is frequently
4644 # crashing on the bots: crbug.com/161942.
4646 # '-Wl,--thread-count=4',
4649 # TODO(thestig): Enable this for disabled cases.
4650 [ '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', {
4652 '-Wl,--detect-odr-violations',
4659 ['release_valgrind_build==0 and order_profiling==0 and asan==0 and msan==0 and lsan==0 and tsan==0', {
4660 'target_conditions': [
4661 ['_toolset=="target"', {
4663 '-Wl,--icf=<(gold_icf_level)',
4670 ['linux_use_bundled_binutils==1', {
4672 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4675 ['linux_use_bundled_gold==1 and '
4676 'not (clang==0 and (use_lto==1 or use_lto_o2==1))', {
4677 # Put our binutils, which contains gold in the search path. We pass
4678 # the path to gold to the compiler. gyp leaves unspecified what the
4679 # cwd is when running the compiler, so the normal gyp path-munging
4680 # fails us. This hack gets the right path.
4682 # Disabled when using GCC LTO because GCC also uses the -B search
4683 # path at link time to find "as", and our bundled "as" can only
4686 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4689 # Some binutils 2.23 releases may or may not have new dtags enabled,
4690 # but they are all compatible with --disable-new-dtags,
4691 # because the new dynamic tags are not created by default.
4692 ['binutils_version>=223', {
4693 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4694 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4695 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4696 # inside this file to allow usage of --no-as-needed and removal of
4699 '-Wl,--disable-new-dtags',
4702 ['gcc_version>=47 and clang==0', {
4703 'target_conditions': [
4704 ['_toolset=="target"', {
4707 # See comment for -Wno-c++11-narrowing.
4709 # TODO(thakis): Remove, http://crbug.com/263960
4710 '-Wno-literal-suffix',
4715 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4716 'target_conditions': [
4717 ['_toolset=="host"', {
4720 # See comment for -Wno-c++11-narrowing.
4722 # TODO(thakis): Remove, http://crbug.com/263960
4723 '-Wno-literal-suffix',
4731 # FreeBSD-specific options; note that most FreeBSD options are set above,
4734 'target_defaults': {
4736 '-Wl,--no-keep-memory',
4740 # Android-specific options; note that most are set above with Linux.
4743 # This is a unique identifier for a given build. It's used for
4744 # identifying various build artifacts corresponding to a particular
4745 # build of chrome (e.g. where to find archived symbols).
4746 'chrome_build_id%': '',
4748 # Figure this out early since it needs symbols from libgcc.a, so it
4749 # has to be before that in the set of libraries.
4750 ['component=="shared_library"', {
4751 'android_libcpp_library': 'c++_shared',
4753 'android_libcpp_library': 'c++_static',
4757 # Placing this variable here prevents from forking libvpx, used
4758 # by remoting. Remoting is off, so it needn't built,
4759 # so forking it's deps seems like overkill.
4760 # But this variable need defined to properly run gyp.
4761 # A proper solution is to have an OS==android conditional
4762 # in third_party/libvpx/libvpx.gyp to define it.
4763 'libvpx_path': 'lib/linux/arm',
4765 'target_defaults': {
4767 'release_extra_cflags%': '',
4769 # If we're using the components build, append "cr" to all shared
4770 # libraries to avoid naming collisions with android system library
4771 # versions with the same name (e.g. skia, icu).
4772 ['component=="shared_library"', {
4773 'android_product_extension': 'cr.so',
4775 'android_product_extension': 'so',
4779 'target_conditions': [
4780 ['_type=="shared_library"', {
4781 'product_extension': '<(android_product_extension)',
4784 # Settings for building device targets using Android's toolchain.
4785 # These are based on the setup.mk file from the Android NDK.
4787 # The NDK Android executable link step looks as follows:
4789 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4790 # $(PRIVATE_OBJECTS) <-- The .o that we built
4791 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4792 # $(TARGET_LIBGCC) <-- libgcc.a
4793 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4794 # $(PRIVATE_LDLIBS) <-- System .so
4795 # $(TARGET_CRTEND_O) <-- crtend.o
4797 # For now the above are approximated for executables by adding
4798 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4801 # The NDK Android shared library link step looks as follows:
4803 # $(PRIVATE_OBJECTS) <-- The .o that we built
4804 # -l,--whole-archive
4805 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4806 # -l,--no-whole-archive
4807 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4808 # $(TARGET_LIBGCC) <-- libgcc.a
4809 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4810 # $(PRIVATE_LDLIBS) <-- System .so
4812 # For now, assume that whole static libraries are not needed.
4814 # For both executables and shared libraries, add the proper
4815 # libgcc.a to the start of libraries which puts it in the
4816 # proper spot after .o and .a files get linked in.
4818 # TODO: The proper thing to do longer-tem would be proper gyp
4819 # support for a custom link command line.
4820 ['_toolset=="target"', {
4822 '-pthread', # Not supported by Android toolchain.
4825 '-ffunction-sections',
4828 '-fstack-protector',
4830 '-finline-limit=64',
4831 '<@(release_extra_cflags)',
4832 '--sysroot=<(android_ndk_sysroot)',
4833 # NOTE: The libc++ header include paths below are specified in
4834 # cflags rather than include_dirs because they need to come
4835 # after include_dirs.
4836 # The include ordering here is important; change with caution.
4837 '-isystem<(android_libcpp_include)',
4838 '-isystem<(android_ndk_root)/sources/cxx-stl/llvm-libc++abi/libcxxabi/include',
4839 '-isystem<(android_ndk_root)/sources/android/support/include',
4843 '__GNU_SOURCE=1', # Necessary for clone()
4844 'CHROME_BUILD_ID="<(chrome_build_id)"',
4845 # The NDK has these things, but doesn't define the constants
4846 # to say that it does. Define them here instead.
4850 '-pthread', # Not supported by Android toolchain.
4853 '-Wl,--build-id=sha1',
4854 '-Wl,--no-undefined',
4855 '--sysroot=<(android_ndk_sysroot)',
4857 '-L<(android_libcpp_libs_dir)',
4858 # Don't allow visible symbols from libgcc or libc++ to be
4860 '-Wl,--exclude-libs=libgcc.a',
4861 '-Wl,--exclude-libs=libc++_static.a',
4862 # Don't allow visible symbols from libraries that contain
4863 # assembly code with symbols that aren't hidden properly.
4864 # http://crbug.com/448386
4865 '-Wl,--exclude-libs=libcommon_audio.a',
4866 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4867 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4868 '-Wl,--exclude-libs=libiSACFix.a',
4869 '-Wl,--exclude-libs=libisac_neon.a',
4870 '-Wl,--exclude-libs=libopus.a',
4871 '-Wl,--exclude-libs=libvpx.a',
4874 '-l<(android_libcpp_library)',
4876 # Manually link the libgcc.a that the cross compiler uses.
4877 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4883 ['component=="static_library"', {
4884 'target_conditions': [
4885 ['use_native_jni_exports==0', {
4886 # Use a linker version script to strip JNI exports from
4887 # binaries which have not specifically asked to use them.
4889 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4896 # Clang with libc++ does not require an explicit atomic
4897 # library reference.
4901 # Work around incompatibilities between bionic and clang
4903 '-D__compiler_offsetof=__builtin_offsetof',
4904 '-Dnan=__builtin_nan',
4907 ['target_arch=="arm"', {
4909 '-target arm-linux-androideabi',
4912 '-target arm-linux-androideabi',
4915 ['target_arch=="ia32"', {
4917 '-target x86-linux-androideabi',
4920 '-target x86-linux-androideabi',
4923 # Place holder for x64 support, not tested.
4924 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4925 ['target_arch=="x64"', {
4927 '-target x86_64-linux-androideabi',
4930 '-target x86_64-linux-androideabi',
4937 # Android build relies on -Wl,--gc-sections removing
4938 # unreachable code. ASan instrumentation for globals inhibits
4939 # this and results in a library with unresolvable relocations.
4940 # TODO(eugenis): find a way to reenable this.
4941 '-mllvm -asan-globals=0',
4944 ['target_arch == "arm" and order_profiling==0', {
4946 # Enable identical code folding to reduce size.
4947 '-Wl,--icf=<(gold_icf_level)',
4950 ['target_arch=="ia32"', {
4951 # The x86 toolchain currently has problems with stack-protector.
4953 '-fstack-protector',
4956 '-fno-stack-protector',
4960 'target_conditions': [
4961 ['_type=="executable"', {
4962 # Force android tools to export the "main" symbol so they can be
4963 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4964 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4965 # when ICS support will be dropped.
4968 '-fvisibility=default',
4972 '-Wl,--gc-sections',
4973 '-Wl,-z,nocopyreloc',
4976 # crtbegin_dynamic.o should be the last item in ldflags.
4977 '<(android_ndk_lib)/crtbegin_dynamic.o',
4980 # crtend_android.o needs to be the last item in libraries.
4981 # Do not add any libraries after this!
4982 '<(android_ndk_lib)/crtend_android.o',
4985 ['_type=="shared_library" or _type=="loadable_module"', {
4987 '-Wl,-shared,-Bsymbolic',
4988 # crtbegin_so.o should be the last item in ldflags.
4989 '<(android_ndk_lib)/crtbegin_so.o',
4992 # crtend_so.o needs to be the last item in libraries.
4993 # Do not add any libraries after this!
4994 '<(android_ndk_lib)/crtend_so.o',
4999 # Settings for building host targets using the system toolchain.
5000 ['_toolset=="host"', {
5002 # Due to issues in Clang build system, using ASan on 32-bit
5003 # binaries on x86_64 host is problematic.
5004 # TODO(eugenis): re-enable.
5005 '-fsanitize=address',
5008 '-fsanitize=address',
5009 '-Wl,-z,noexecstack',
5010 '-Wl,--gc-sections',
5013 '-Wl,--warn-shared-textrel',
5014 '-Wl,--fatal-warnings',
5017 # Settings for building host targets on mac.
5018 ['_toolset=="host" and host_os=="mac"', {
5028 'cflags!': ['-fvisibility=hidden'],
5029 'cflags_cc!': ['-fvisibility-inlines-hidden'],
5031 ['OS=="mac" or OS=="ios"', {
5032 'target_defaults': {
5035 'ALWAYS_SEARCH_USER_PATHS': 'NO',
5036 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
5037 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
5038 'COPY_PHASE_STRIP': 'NO',
5039 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
5040 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
5041 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
5042 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
5043 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
5044 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
5045 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
5046 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
5047 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
5048 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
5049 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
5050 'GCC_VERSION': '4.2',
5051 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
5052 'USE_HEADERMAP': 'NO',
5057 # Don't warn about unused function parameters.
5058 '-Wno-unused-parameter',
5059 # Don't warn about the "struct foo f = {0};" initialization
5061 '-Wno-missing-field-initializers',
5064 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
5065 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
5067 # Note that the prebuilt Clang binaries should not be used for iOS
5068 # development except for ASan builds.
5070 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
5071 # Warn if automatic synthesis is triggered with
5072 # the -Wobjc-missing-property-synthesis flag.
5073 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
5074 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
5076 # This warns on selectors from Cocoa headers (-length, -set).
5077 # cfe-dev is currently discussing the merits of this warning.
5078 # TODO(thakis): Reevaluate what to do with this, based one
5079 # cfe-dev discussion.
5080 '-Wno-selector-type-mismatch',
5083 ['clang_xcode==0', {
5084 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
5085 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
5089 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
5091 '<@(clang_chrome_plugins_flags)',
5094 ['clang==1 and clang_xcode==0 and clang_load!=""', {
5096 '-Xclang', '-load', '-Xclang', '<(clang_load)',
5099 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
5101 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
5104 ['clang==1 and "<(GENERATOR)"=="ninja"', {
5106 # See http://crbug.com/110262
5107 '-fcolor-diagnostics',
5110 ['OS=="ios" and target_subarch!="arm32" and \
5111 "<(GENERATOR)"=="xcode"', {
5113 # TODO(ios): when building Chrome for iOS on 64-bit platform
5114 # with Xcode, the -Wshorted-64-to-32 warning is automatically
5115 # enabled. This cause failures when compiling protobuf code,
5116 # so disable the warning. http://crbug.com/359107
5117 '-Wno-shorten-64-to-32',
5125 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
5131 '-fsanitize=address',
5132 '-mllvm -asan-globals=0', # http://crbug.com/352073
5133 '-gline-tables-only',
5137 ['asan_coverage!=0 and sanitizer_coverage==0', {
5138 'target_conditions': [
5139 ['_toolset=="target"', {
5141 '-fsanitize-coverage=<(asan_coverage)',
5144 'SANITIZER_COVERAGE',
5149 ['sanitizer_coverage!=0', {
5150 'target_conditions': [
5151 ['_toolset=="target"', {
5153 '-fsanitize-coverage=<(sanitizer_coverage)',
5156 'SANITIZER_COVERAGE',
5162 'target_conditions': [
5163 ['_type!="static_library"', {
5164 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5169 '-fsanitize=address',
5173 ['mac_write_linker_maps==1', {
5176 '-Wl,-map,>(_target_name).map',
5183 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5184 'target_conditions': [
5185 ['_type=="executable"', {
5191 # Define copy_asan_dylib_path in a variable ending in
5192 # _path so that gyp understands it's a path and
5193 # performs proper relativization during dict merging.
5194 'copy_asan_dylib_path':
5195 'mac/copy_asan_runtime_dylib.sh',
5197 'postbuild_name': 'Copy ASan runtime dylib',
5199 '<(copy_asan_dylib_path)',
5208 ], # target_conditions
5209 }, # target_defaults
5210 }], # OS=="mac" or OS=="ios"
5212 'target_defaults': {
5214 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5215 # with common names, like 'check', 'require', and 'verify'.
5216 # (Included by system header. Also exists on iOS but not included.)
5217 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5218 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5221 # These should end with %, but there seems to be a bug with % in
5222 # variables that are intended to be set to different values in
5223 # different targets, like these.
5224 'mac_pie': 1, # Most executables can be position-independent.
5225 # Strip debugging symbols from the target.
5226 'mac_strip': '<(mac_strip_release)',
5230 ['mac_want_real_dsym=="default"', {
5233 'mac_real_dsym': '<(mac_want_real_dsym)'
5238 ['mac_want_real_dsym=="default"', {
5239 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5241 'mac_real_dsym': '<(mac_want_real_dsym)'
5250 ['branding=="Chrome" and buildtype=="Official"', {
5253 # The Google Chrome Framework dSYM generated by dsymutil has
5254 # grown larger than 4GB, which dsymutil can't handle. Reduce
5255 # the amount of debug symbols.
5256 '-fno-standalone-debug', # See http://crbug.com/479841
5261 }, # configuration "Release"
5264 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5265 # (Equivalent to -fPIC)
5266 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5267 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5268 # Keep pch files below xcodebuild/.
5269 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5271 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5272 # xcode_setting, but not until all downstream projects' mac bots are
5273 # using xcode >= 4.6, because that's when the default value of the
5274 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5275 # setting is a no-op as far as xcode is concerned, but the compiler
5276 # behaves differently based on whether -fno-strict-aliasing is
5278 '-fno-strict-aliasing', # See http://crbug.com/32204.
5281 'target_conditions': [
5282 ['_type=="executable"', {
5285 # Arranges for data (heap) pages to be protected against
5286 # code execution when running on Mac OS X 10.7 ("Lion"), and
5287 # ensures that the position-independent executable (PIE) bit
5288 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5290 # Define change_mach_o_flags in a variable ending in _path
5291 # so that GYP understands it's a path and performs proper
5292 # relativization during dict merging.
5293 'change_mach_o_flags_path':
5294 'mac/change_mach_o_flags_from_xcode.sh',
5295 'change_mach_o_flags_options%': [
5297 'target_conditions': [
5298 ['mac_pie==0 or release_valgrind_build==1', {
5299 # Don't enable PIE if it's unwanted. It's unwanted if
5300 # the target specifies mac_pie=0 or if building for
5301 # Valgrind, because Valgrind doesn't understand slide.
5302 # See the similar mac_pie/release_valgrind_build check
5304 'change_mach_o_flags_options': [
5310 'postbuild_name': 'Change Mach-O Flags',
5312 '<(change_mach_o_flags_path)',
5313 '>@(change_mach_o_flags_options)',
5317 'target_conditions': [
5318 ['mac_pie==1 and release_valgrind_build==0', {
5319 # Turn on position-independence (ASLR) for executables. When
5320 # PIE is on for the Chrome executables, the framework will
5321 # also be subject to ASLR.
5322 # Don't do this when building for Valgrind, because Valgrind
5323 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5324 # understand slide, and get rid of the Valgrind check.
5327 '-Wl,-pie', # Position-independent executable (MH_PIE)
5333 ['(_type=="executable" or _type=="shared_library" or \
5334 _type=="loadable_module") and mac_strip!=0', {
5335 'target_conditions': [
5336 ['mac_real_dsym == 1', {
5337 # To get a real .dSYM bundle produced by dsymutil, set the
5338 # debug information format to dwarf-with-dsym. Since
5339 # strip_from_xcode will not be used, set Xcode to do the
5340 # stripping as well.
5344 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5345 'DEPLOYMENT_POSTPROCESSING': 'YES',
5346 'STRIP_INSTALLED_PRODUCT': 'YES',
5348 # Only strip non-ASan builds.
5350 'target_conditions': [
5351 ['_type=="shared_library" or _type=="loadable_module"', {
5352 # The Xcode default is to strip debugging symbols
5353 # only (-S). Local symbols should be stripped as
5354 # well, which will be handled by -x. Xcode will
5355 # continue to insert -S when stripping even when
5356 # additional flags are added with STRIPFLAGS.
5358 }], # _type=="shared_library" or _type=="loadable_module"
5359 ], # target_conditions
5365 }, # configuration "Release"
5367 }, { # mac_real_dsym != 1
5368 # To get a fast fake .dSYM bundle, use a post-build step to
5369 # produce the .dSYM and strip the executable. strip_from_xcode
5370 # only operates in the Release configuration.
5374 # Define strip_from_xcode in a variable ending in _path
5375 # so that gyp understands it's a path and performs proper
5376 # relativization during dict merging.
5377 'strip_from_xcode_path': 'mac/strip_from_xcode',
5379 'postbuild_name': 'Strip If Needed',
5380 'action': ['<(strip_from_xcode_path)'],
5384 ], # target_conditions
5385 }], # (_type=="executable" or _type=="shared_library" or
5386 # _type=="loadable_module") and mac_strip!=0
5387 ], # target_conditions
5388 }, # target_defaults
5392 'ios/coverage.gypi',
5394 'target_defaults': {
5395 'xcode_settings' : {
5396 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5399 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5400 # additional flag to suppress the "unknown compiler option" error.
5401 # Restrict this flag to builds that are either compiling with Xcode
5402 # or compiling with Xcode's Clang. This will allow Ninja builds to
5403 # continue failing on unknown compiler options.
5404 # TODO(rohitrao): This flag is temporary and should be removed as
5405 # soon as the iOS bots are updated to use Xcode 5.1.
5406 ['clang_xcode==1', {
5408 '-Wno-unknown-warning-option',
5409 # It's not possible to achieve nullability completeness before
5410 # all builders are running Xcode 7. crbug.com/499809
5411 '-Wno-nullability-completeness',
5415 # Limit the valid architectures depending on "target_subarch".
5416 # This need to include the "arm" architectures but also the "x86"
5417 # ones (they are used when building for the simulator).
5418 ['target_subarch=="arm32"', {
5419 'VALID_ARCHS': ['armv7', 'i386'],
5421 ['target_subarch=="arm64"', {
5422 'VALID_ARCHS': ['arm64', 'x86_64'],
5424 ['target_subarch=="both"', {
5425 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5427 ['use_system_libcxx==1', {
5428 'target_conditions': [
5429 # Only use libc++ when building target for iOS not when building
5430 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5431 # does not support libc++.
5432 ['_toolset=="target"', {
5433 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5437 # The default for deployment target of 7.0+ is libc++, so force
5438 # the old behavior unless libc++ is enabled.
5439 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5443 'target_conditions': [
5444 ['_toolset=="host"', {
5446 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5447 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5456 ['_toolset=="target"', {
5458 # This section should be for overriding host settings. But,
5459 # since we can't negate the iphone deployment target above, we
5460 # instead set it here for target only.
5461 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5462 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5465 ['_type=="executable"', {
5469 'DEPLOYMENT_POSTPROCESSING': 'YES',
5470 'STRIP_INSTALLED_PRODUCT': 'YES',
5472 ['buildtype!="Official"', {
5473 # Remove dSYM to reduce build time.
5474 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5481 # Remove dSYM to reduce build time.
5482 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5488 ['chromium_ios_signing', {
5489 # iOS SDK wants everything for device signed.
5490 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5492 'CODE_SIGNING_REQUIRED': 'NO',
5493 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5498 ], # target_conditions
5499 }, # target_defaults
5502 'target_defaults': {
5504 '_WIN32_WINNT=0x0603',
5511 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5512 'WIN32_LEAN_AND_MEAN',
5515 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5516 '_HAS_EXCEPTIONS=0',
5517 # Silence some warnings; we can't switch the the 'recommended'
5518 # versions as they're not available on old OSs.
5519 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5522 ['buildtype=="Official"', {
5523 # In official builds, targets can self-select an optimization
5524 # level by defining a variable named 'optimize', and setting it
5526 # - "size", optimizes for minimal code size - the default.
5527 # - "speed", optimizes for speed over code size.
5528 # - "max", whole program optimization and link-time code
5529 # generation. This is very expensive and should be used
5532 'optimize%': 'size',
5536 # Set /LTCG for the official builds.
5537 'LinkTimeCodeGeneration': '1',
5538 'AdditionalOptions': [
5539 # Set the number of LTCG code-gen threads to eight.
5540 # The default is four. This gives a 5-10% link speedup.
5545 'target_conditions': [
5546 ['optimize=="size"', {
5548 'VCCLCompilerTool': {
5549 # 1, optimizeMinSpace, Minimize Size (/O1)
5550 'Optimization': '1',
5551 # 2, favorSize - Favor small code (/Os)
5552 'FavorSizeOrSpeed': '2',
5557 # This config is used to avoid a problem in ffmpeg, see
5558 # http://crbug.com/264459.
5559 ['optimize=="size_no_ltcg"', {
5561 'VCCLCompilerTool': {
5562 # 1, optimizeMinSpace, Minimize Size (/O1)
5563 'Optimization': '1',
5564 # 2, favorSize - Favor small code (/Os)
5565 'FavorSizeOrSpeed': '2',
5570 ['optimize=="speed"', {
5572 'VCCLCompilerTool': {
5573 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5574 'Optimization': '2',
5575 # 1, favorSpeed - Favor fast code (/Ot)
5576 'FavorSizeOrSpeed': '1',
5581 ['optimize=="max"', {
5582 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5583 # builds. Probably anything that this would catch that
5584 # wouldn't be caught in a normal build isn't going to
5585 # actually be a bug, so the incremental value of C4702 for
5586 # PGO builds is likely very small.
5587 'msvs_disabled_warnings': [
5591 'VCCLCompilerTool': {
5592 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5593 'Optimization': '2',
5594 # 1, favorSpeed - Favor fast code (/Ot)
5595 'FavorSizeOrSpeed': '1',
5596 # This implies link time code generation.
5597 'WholeProgramOptimization': 'true',
5605 ['msvs_xtree_patched!=1', {
5606 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5607 # it's enabled. This will generally only be true for system-level
5608 # installed Express users.
5609 'msvs_disabled_warnings': [
5614 'msvs_system_include_dirs': [
5615 '<(windows_sdk_path)/Include/shared',
5616 '<(windows_sdk_path)/Include/um',
5617 '<(windows_sdk_path)/Include/winrt',
5618 '$(VSInstallDir)/VC/atlmfc/include',
5620 'msvs_cygwin_shell': 0,
5621 'msvs_disabled_warnings': [
5622 # C4091: 'typedef ': ignored on left of 'X' when no variable is
5624 # This happens in a number of Windows headers. Dumb.
5627 # C4127: conditional expression is constant
5628 # This warning can in theory catch dead code and other problems, but
5629 # triggers in far too many desirable cases where the conditional
5630 # expression is either set by macros or corresponds some legitimate
5631 # compile-time constant expression (due to constant template args,
5632 # conditionals comparing the sizes of different types, etc.). Some of
5633 # these can be worked around, but it's not worth it.
5636 # C4351: new behavior: elements of array 'array' will be default
5638 # This is a silly "warning" that basically just alerts you that the
5639 # compiler is going to actually follow the language spec like it's
5640 # supposed to, instead of not following it like old buggy versions
5641 # did. There's absolutely no reason to turn this on.
5644 # C4355: 'this': used in base member initializer list
5645 # It's commonly useful to pass |this| to objects in a class'
5646 # initializer list. While this warning can catch real bugs, most of
5647 # the time the constructors in question don't attempt to call methods
5648 # on the passed-in pointer (until later), and annotating every legit
5649 # usage of this is simply more hassle than the warning is worth.
5652 # C4503: 'identifier': decorated name length exceeded, name was
5654 # This only means that some long error messages might have truncated
5655 # identifiers in the presence of lots of templates. It has no effect
5656 # on program correctness and there's no real reason to waste time
5657 # trying to prevent it.
5660 # Warning C4589 says: "Constructor of abstract class ignores
5661 # initializer for virtual base class." Disable this warning because it
5662 # is flaky in VS 2015 RTM. It triggers on compiler generated
5663 # copy-constructors in some cases.
5666 # C4611: interaction between 'function' and C++ object destruction is
5668 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5669 # suggests using exceptions instead of setjmp/longjmp for C++, but
5670 # Chromium code compiles without exception support. We therefore have
5671 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5672 # means we have to turn off this warning (and be careful about how
5673 # object destruction happens in such cases).
5676 # TODO(maruel): These warnings are level 4. They will be slowly
5677 # removed as code is fixed.
5678 4100, # Unreferenced formal parameter
5679 4121, # Alignment of a member was sensitive to packing
5680 4244, # Conversion from 'type1' to 'type2', possible loss of data
5681 4481, # Nonstandard extension used: override specifier 'keyword'
5682 4505, # Unreferenced local function has been removed
5683 4510, # Default constructor could not be generated
5684 4512, # Assignment operator could not be generated
5685 4610, # Object can never be instantiated
5686 4838, # Narrowing conversion. Doesn't seem to be very useful.
5687 4995, # 'X': name was marked as #pragma deprecated
5688 4996, # 'X': was declared deprecated (for GetVersionEx).
5690 # These are variable shadowing warnings that are new in VS2015. We
5691 # should work through these at some point -- they may be removed from
5692 # the RTM release in the /W4 set.
5693 4456, 4457, 4458, 4459,
5696 'VCCLCompilerTool': {
5697 'AdditionalOptions': ['/MP'],
5698 'MinimalRebuild': 'false',
5699 'BufferSecurityCheck': 'true',
5700 'EnableFunctionLevelLinking': 'true',
5701 'RuntimeTypeInfo': 'false',
5702 'WarningLevel': '4',
5703 'WarnAsError': 'true',
5704 'DebugInformationFormat': '3',
5705 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5706 'ExceptionHandling': '0',
5708 'VCLibrarianTool': {
5709 'AdditionalOptions': ['/ignore:4221'],
5710 'AdditionalLibraryDirectories': [
5711 '<(windows_sdk_path)/Lib/win8/um/x86',
5715 'AdditionalDependencies': [
5727 'AdditionalLibraryDirectories': [
5728 '<(windows_sdk_path)/Lib/win8/um/x86',
5730 'GenerateDebugInformation': 'true',
5731 'MapFileName': '$(OutDir)\\$(TargetName).map',
5732 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5733 'FixedBaseAddress': '1',
5736 # 1 == /SUBSYSTEM:CONSOLE
5737 # 2 == /SUBSYSTEM:WINDOWS
5738 # Most of the executables we'll ever create are tests
5739 # and utilities with console output.
5743 'GenerateStublessProxies': 'true',
5744 'TypeLibraryName': '$(InputName).tlb',
5745 'OutputDirectory': '$(IntDir)',
5746 'HeaderFileName': '$(InputName).h',
5747 'DLLDataFileName': '$(InputName).dlldata.c',
5748 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5749 'ProxyFileName': '$(InputName)_p.c',
5751 'VCResourceCompilerTool': {
5753 'AdditionalIncludeDirectories': [
5755 '<(SHARED_INTERMEDIATE_DIR)',
5758 'target_conditions': [
5759 ['_type=="executable"', {
5761 'EmbedManifest': 'true',
5764 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5766 'AdditionalManifestFiles': [
5767 '>(win_exe_compatibility_manifest)',
5773 # Building with Clang on Windows is a work in progress and very
5774 # experimental. See crbug.com/82385.
5775 # Keep this in sync with the similar blocks in build/config/compiler/BUILD.gn
5777 'VCCLCompilerTool': {
5778 'AdditionalOptions': [
5779 # Many files use intrinsics without including this header.
5780 # TODO(hans): Fix those files, or move this to sub-GYPs.
5783 # TODO(hans): Make this list shorter eventually, http://crbug.com/504657
5784 '-Qunused-arguments', # http://crbug.com/504658
5785 '-Wno-microsoft', # http://crbug.com/505296
5786 '-Wno-switch', # http://crbug.com/505308
5787 '-Wno-unknown-pragmas', # http://crbug.com/505314
5788 '-Wno-unused-function', # http://crbug.com/505316
5789 '-Wno-unused-value', # http://crbug.com/505318
5793 ['clang==1 and clang_use_chrome_plugins==1', {
5794 'VCCLCompilerTool': {
5795 'AdditionalOptions': [
5796 '<@(clang_chrome_plugins_flags)',
5800 ['clang==1 and MSVS_VERSION == "2013"', {
5801 'VCCLCompilerTool': {
5802 'AdditionalOptions': [
5803 '-fmsc-version=1800',
5807 ['clang==1 and MSVS_VERSION == "2015"', {
5808 'VCCLCompilerTool': {
5809 'AdditionalOptions': [
5810 '-fmsc-version=1900',
5814 ['clang==1 and "<!(python <(DEPTH)/build/win/use_ansi_codes.py)"=="True"', {
5815 'VCCLCompilerTool': {
5816 'AdditionalOptions': [
5817 # cmd.exe doesn't understand ANSI escape codes by default,
5818 # so only enable them if something emulating them is around.
5819 '-fansi-escape-codes',
5820 # Also see http://crbug.com/110262
5821 '-fcolor-diagnostics',
5829 ['disable_nacl==1', {
5830 'target_defaults': {
5836 ['OS=="win" and msvs_use_common_linker_extras', {
5837 'target_defaults': {
5852 'AdditionalOptions': [
5863 'AdditionalOptions': ['/largeaddressaware'],
5867 # TODO(asan/win): Move this down into the general
5868 # win-target_defaults section once the 64-bit asan runtime
5869 # exists. See crbug.com/345874.
5870 'VCCLCompilerTool': {
5871 'AdditionalOptions': [
5872 '-fsanitize=address',
5873 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5875 'AdditionalIncludeDirectories': [
5876 # MSVC needs to be able to find the sanitizer headers when
5877 # invoked via /fallback. This is critical for using macros
5878 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5880 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/include_sanitizer',
5884 'AdditionalLibraryDirectories': [
5885 # TODO(hans): If make_clang_dir is absolute, this breaks.
5886 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/lib/windows',
5889 'target_conditions': [
5890 ['component=="shared_library"', {
5892 'AdditionalDependencies': [
5893 'clang_rt.asan_dynamic-i386.lib',
5894 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5898 ['_type=="executable" and component=="static_library"', {
5900 'AdditionalDependencies': [
5901 'clang_rt.asan-i386.lib',
5905 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5907 'AdditionalDependencies': [
5908 'clang_rt.asan_dll_thunk-i386.lib',
5914 ['sanitizer_coverage!=0', {
5915 # TODO(asan/win): Move this down into the general
5916 # win-target_defaults section once the 64-bit asan runtime
5917 # exists. See crbug.com/345874.
5918 'VCCLCompilerTool': {
5919 'AdditionalOptions': [
5920 '-fsanitize-coverage=<(sanitizer_coverage)',
5927 ['sanitizer_coverage!=0', {
5928 # TODO(asan/win): Move this down into the general
5929 # win-target_defaults section once the 64-bit asan runtime
5930 # exists. See crbug.com/345874.
5932 'SANITIZER_COVERAGE',
5940 'AdditionalOptions': [
5941 # safeseh is not compatible with x64
5953 ['enable_new_npdevice_api==1', {
5954 'target_defaults': {
5956 'ENABLE_NEW_NPDEVICE_API',
5960 # Don't warn about the "typedef 'foo' locally defined but not used"
5961 # for gcc 4.8 and higher.
5962 # TODO: remove this flag once all builds work. See crbug.com/227506
5963 ['gcc_version>=48 and clang==0', {
5964 'target_defaults': {
5966 '-Wno-unused-local-typedefs',
5970 ['gcc_version>=48 and clang==0 and host_clang==1', {
5971 'target_defaults': {
5972 'target_conditions': [
5973 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5977 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5979 'make_global_settings': [
5980 ['CC', '<(make_clang_dir)/bin/clang'],
5981 ['CXX', '<(make_clang_dir)/bin/clang++'],
5982 ['CC.host', '$(CC)'],
5983 ['CXX.host', '$(CXX)'],
5986 ['clang==1 and OS=="win"', {
5987 'make_global_settings': [
5988 # On Windows, gyp's ninja generator only looks at CC.
5989 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5992 ['use_lld==1 and OS=="win"', {
5993 'make_global_settings': [
5994 # Limited to Windows because -flavor link2 is the driver that is
5995 # compatible with link.exe.
5996 ['LD', '<(make_clang_dir)/bin/lld -flavor link2'],
5999 ['OS=="android" and clang==0', {
6000 # Hardcode the compiler names in the Makefile so that
6001 # it won't depend on the environment at make time.
6002 'make_global_settings': [
6003 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
6004 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
6005 ['CC.host', '<(host_cc)'],
6006 ['CXX.host', '<(host_cxx)'],
6009 ['OS=="linux" and target_arch=="mipsel" and host_arch!="mipsel" and chromeos==0 and clang==0', {
6010 # Set default mips cross tools on linux. These can be overridden
6011 # using CC,CXX,CC.host and CXX.host environment variables.
6012 'make_global_settings': [
6013 ['CC', '<!(which mipsel-linux-gnu-gcc)'],
6014 ['CXX', '<!(which mipsel-linux-gnu-g++)'],
6015 ['CC.host', '<(host_cc)'],
6016 ['CXX.host', '<(host_cxx)'],
6019 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
6020 # Set default ARM cross tools on linux. These can be overridden
6021 # using CC,CXX,CC.host and CXX.host environment variables.
6022 'make_global_settings': [
6023 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
6024 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
6025 ['CC.host', '<(host_cc)'],
6026 ['CXX.host', '<(host_cxx)'],
6029 # TODO(yyanagisawa): supports GENERATOR==make
6030 # make generator doesn't support CC_wrapper without CC
6031 # in make_global_settings yet.
6032 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
6033 'make_global_settings': [
6034 ['CC_wrapper', '<(gomadir)/gomacc'],
6035 ['CXX_wrapper', '<(gomadir)/gomacc'],
6036 ['CC.host_wrapper', '<(gomadir)/gomacc'],
6037 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
6041 'target_defaults': {
6042 'target_conditions': [
6043 ['_toolset=="target"', {
6051 # Work-around for http://openradar.appspot.com/20356002
6052 ['_toolset=="target" and _type!="static_library"', {
6062 ['use_lto==1 and clang==0', {
6063 'target_defaults': {
6064 'target_conditions': [
6065 ['_toolset=="target"', {
6067 '-ffat-lto-objects',
6073 ['use_lto==1 and clang==1', {
6074 'target_defaults': {
6075 'target_conditions': [
6076 ['_toolset=="target"', {
6078 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
6084 # Apply a lower LTO optimization level in non-official builds.
6085 ['use_lto==1 and clang==1 and buildtype!="Official"', {
6086 'target_defaults': {
6087 'target_conditions': [
6088 ['_toolset=="target"', {
6090 '-Wl,--plugin-opt,O1',
6093 ['_toolset=="target" and _type!="static_library"', {
6103 ['use_lto==1 and clang==1 and target_arch=="arm"', {
6104 'target_defaults': {
6105 'target_conditions': [
6106 ['_toolset=="target"', {
6107 # Without this flag, LTO produces a .text section that is larger
6108 # than the maximum call displacement, preventing the linker from
6109 # relocating calls (http://llvm.org/PR22999).
6111 '-Wl,-plugin-opt,-function-sections',
6117 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
6118 'target_defaults': {
6119 'target_conditions': [
6120 ['_toolset=="target"', {
6128 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
6129 'target_defaults': {
6130 'target_conditions': [
6131 ['_toolset=="target"', {
6140 'target_defaults': {
6141 'target_conditions': [
6142 ['_toolset=="target"', {
6144 '-fno-sanitize-trap=cfi',
6145 '-fsanitize-recover=cfi',
6148 '-fno-sanitize-trap=cfi',
6149 '-fsanitize-recover=cfi',
6153 '-fno-sanitize-trap=cfi',
6154 '-fsanitize-recover=cfi',
6158 'VCCLCompilerTool': {
6159 'AdditionalOptions': [
6160 '-fno-sanitize-trap=cfi',
6161 '-fsanitize-recover=cfi',
6166 ['_toolset=="target" and _type!="static_library"', {
6169 '-fno-sanitize-trap=cfi',
6170 '-fsanitize-recover=cfi',
6178 'target_defaults': {
6179 'target_conditions': [
6180 ['_toolset=="target"', {
6182 '-fsanitize=cfi-vcall',
6183 '-fsanitize=cfi-derived-cast',
6184 '-fsanitize=cfi-unrelated-cast',
6185 '-fsanitize-blacklist=<(cfi_blacklist)',
6188 '-fsanitize=cfi-vcall',
6189 '-fsanitize=cfi-derived-cast',
6190 '-fsanitize=cfi-unrelated-cast',
6194 '-fsanitize=cfi-vcall',
6195 '-fsanitize=cfi-derived-cast',
6196 '-fsanitize=cfi-unrelated-cast',
6197 '-fsanitize-blacklist=<(cfi_blacklist)',
6201 'VCCLCompilerTool': {
6202 'AdditionalOptions': [
6203 '-fsanitize=cfi-vcall',
6204 '-fsanitize=cfi-derived-cast',
6205 '-fsanitize=cfi-unrelated-cast',
6206 '-fsanitize-blacklist=<(cfi_blacklist)',
6211 ['_toolset=="target" and _type!="static_library"', {
6214 '-fsanitize=cfi-vcall',
6215 '-fsanitize=cfi-derived-cast',
6216 '-fsanitize=cfi-unrelated-cast',
6225 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
6226 # This block adds *project-wide* configuration settings to each project
6227 # file. It's almost always wrong to put things here. Specify your
6228 # custom xcode_settings in target_defaults to add them to targets instead.
6231 # In an Xcode Project Info window, the "Base SDK for All Configurations"
6232 # setting sets the SDK on a project-wide basis. In order to get the
6233 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
6234 # here at the project level.
6237 ['mac_sdk_path==""', {
6238 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
6240 'SDKROOT': '<(mac_sdk_path)', # -isysroot
6246 ['ios_sdk_path==""', {
6248 # TODO(justincohen): Ninja only supports simulator for now.
6249 ['"<(GENERATOR)"=="xcode"', {
6250 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6252 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
6256 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6261 # Target both iPhone and iPad.
6262 'TARGETED_DEVICE_FAMILY': '1,2',
6265 ['target_arch=="x64"', {
6270 ['target_arch=="ia32"', {
6279 # The Xcode generator will look for an xcode_settings section at the root
6280 # of each dict and use it to apply settings on a file-wide basis. Most
6281 # settings should not be here, they should be in target-specific
6282 # xcode_settings sections, or better yet, should use non-Xcode-specific
6283 # settings in target dicts. SYMROOT is a special case, because many other
6284 # Xcode variables depend on it, including variables such as
6285 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6286 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6287 # files to appear (when present) in the UI as actual files and not red
6288 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6289 # and therefore SYMROOT, needs to be set at the project level.
6290 'SYMROOT': '<(DEPTH)/xcodebuild',