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 # Set to 1 to make a build that disables activation of field trial tests
372 # specified in testing/variations/fieldtrial_testing_config_*.json.
373 # Note: this setting is ignored if branding=="Chrome".
374 'fieldtrial_testing_like_official_build%': 0,
376 # Disable image loader component extension by default.
377 'image_loader_extension%': 0,
379 # Set NEON compilation flags.
382 # Detect NEON support at run-time.
383 'arm_neon_optional%': 0,
385 # Use libjpeg-turbo as the JPEG codec used by Chromium.
386 'use_libjpeg_turbo%': 1,
388 # Use system libjpeg. Note that the system's libjepg will be used even if
389 # use_libjpeg_turbo is set.
390 'use_system_libjpeg%': 0,
392 # By default, component is set to static_library and it can be overriden
393 # by the GYP command line or by ~/.gyp/include.gypi.
394 'component%': 'static_library',
396 # /analyze is off by default on Windows because it is very slow and noisy.
397 # Enable with GYP_DEFINES=win_analyze=1
400 # /debug:fastlink is off by default on Windows because it generates PDBs
401 # that are machine-local. But, great for local builds.
402 # Enable with GYP_DEFINES=win_fastlink=1
405 # Set to select the Title Case versions of strings in GRD files.
406 'use_titlecase_in_grd%': 0,
408 # Remoting compilation is enabled by default. Set to 0 to disable.
411 # Configuration policy is enabled by default. Set to 0 to disable.
412 'configuration_policy%': 1,
414 # Variable safe_browsing is used to control the build time configuration
415 # for safe browsing feature. Safe browsing can be compiled in 4 different
416 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
417 # reporting features for use with Data Saver on Mobile, and 3 enables
418 # extended mobile protection via an external API. When 3 is fully
419 # deployed, it will replace 2.
422 # Web speech is enabled by default. Set to 0 to disable.
423 'enable_web_speech%': 1,
425 # 'Ok Google' hotwording is disabled by default. Set to 1 to enable. (This
426 # will download a closed-source NaCl module at startup.) Chrome-branded
427 # ChromeOS builds have this enabled by default.
428 'enable_hotwording%': 0,
430 # Notifications are compiled in by default. Set to 0 to disable.
431 'notifications%' : 1,
433 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
434 # regular builds and 1 for ASan builds.
435 'mac_want_real_dsym%': 'default',
437 # If this is set, the clang plugins used on the buildbot will be used.
438 # Run tools/clang/scripts/update.sh to make sure they are compiled.
439 # This causes 'clang_chrome_plugins_flags' to be set.
440 # Has no effect if 'clang' is not set as well.
441 'clang_use_chrome_plugins%': 1,
443 # Enable building with ASAN (Clang's -fsanitize=address option).
444 # -fsanitize=address only works with clang, but asan=1 implies clang=1
445 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
447 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
448 # Enable coverage gathering instrumentation in sanitizer tools. This flag
449 # also controls coverage granularity (1 for function-level coverage, 2
450 # for block-level coverage).
451 'sanitizer_coverage%': 0,
452 # Deprecated, only works if |sanitizer_coverage| isn't set.
453 # TODO(glider): remove this flag.
455 # Enable intra-object-overflow detection in ASan (experimental).
456 'asan_field_padding%': 0,
458 # Enable Chromium overrides of the default configurations for various
459 # dynamic tools (like ASan).
460 'use_sanitizer_options%': 0,
462 # Enable building with SyzyAsan.
463 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
466 # Enable crash reporting via Kasko.
469 # Enable building with LSan (Clang's -fsanitize=leak option).
470 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
471 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
474 # Enable building with TSan (Clang's -fsanitize=thread option).
475 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
476 # See http://clang.llvm.org/docs/ThreadSanitizer.html
478 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
480 # Enable building with MSan (Clang's -fsanitize=memory option).
481 # MemorySanitizer only works with clang, but msan=1 implies clang=1
482 # See http://clang.llvm.org/docs/MemorySanitizer.html
484 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
485 # Track where uninitialized memory originates from. From fastest to
486 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
487 # - track the chain of stores leading from allocation site to use site.
488 'msan_track_origins%': 2,
490 # Enable building with UBSan (Clang's -fsanitize=undefined option).
491 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
492 # See http://clang.llvm.org/docs/UsersManual.html
494 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
495 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/vptr_blacklist.txt',
497 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
498 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
501 # Use dynamic libraries instrumented by one of the sanitizers
502 # instead of the standard system libraries. Set this flag to build the
503 # libraries from source.
504 'use_instrumented_libraries%': 0,
506 # Use dynamic libraries instrumented by one of the sanitizers
507 # instead of the standard system libraries. Set this flag to download
508 # prebuilt binaries from GCS.
509 'use_prebuilt_instrumented_libraries%': 0,
511 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
512 # stdlibc++ as standard library. This is intended to use for instrumented
514 'use_custom_libcxx%': 0,
516 # Set to true to instrument the code with function call logger.
517 # See src/third_party/cygprofile/cyg-profile.cc for details.
518 'order_profiling%': 0,
520 # Use the provided profiled order file to link Chrome image with it.
521 # This makes Chrome faster by better using CPU cache when executing code.
522 # This is known as PGO (profile guided optimization).
523 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
524 'order_text_section%' : "",
526 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
527 # libraries on linux x86-64 and arm, plus ASLR.
530 # Whether one-click signin is enabled or not.
531 'enable_one_click_signin%': 0,
533 # Whether to back up data before sync.
534 'enable_pre_sync_backup%': 0,
536 # Enable Chrome browser extensions
537 'enable_extensions%': 1,
540 'enable_google_now%': 1,
542 # Enable basic printing support and UI.
543 'enable_basic_printing%': 1,
545 # Enable printing with print preview. It does not imply
546 # enable_basic_printing. It's possible to build Chrome with preview only.
547 'enable_print_preview%': 1,
549 # Set the version of CLD.
550 # 1: (DEPRECATED! See http://crbug.com/528305 for info) Use only CLD1.
554 # For CLD2, the size of the tables that should be included in the build
555 # Only evaluated if cld_version == 2.
556 # See third_party/cld_2/cld_2.gyp for more information.
557 # 0: Small tables, high accuracy
558 # 2: Large tables, higher accuracy
559 'cld2_table_size%': 2,
561 # Enable spell checker.
562 'enable_spellcheck%': 1,
564 # Use the operating system spellchecker, e.g. NSSpellChecker on Mac or
565 # SpellCheckerSession on Android.
566 'use_browser_spellchecker%': 0,
568 # Webrtc compilation is enabled by default. Set to 0 to disable.
571 # Media router support is enabled by default. Set to 0 to disable.
572 'enable_media_router%': 1,
574 # Enables use of the session service, which is enabled by default.
575 # Support for disabling depends on the platform.
576 'enable_session_service%': 1,
578 # Enables theme support, which is enabled by default. Support for
579 # disabling depends on the platform.
582 # Enables autofill dialog and associated features; disabled by default.
583 'enable_autofill_dialog%' : 0,
585 # Defaults Wallet integration in Autofill dialog to use production
586 # servers. Unofficial builds won't have the proper API keys.
587 'enable_prod_wallet_service%': 0,
589 # Enables support for background apps.
590 'enable_background%': 1,
592 # Enable the task manager by default.
593 'enable_task_manager%': 1,
595 # Enables used resource whitelist generation; disabled by default.
596 'enable_resource_whitelist_generation%': 0,
598 # Enable FILE support by default.
599 'disable_file_support%': 0,
601 # Enable FTP support by default.
602 'disable_ftp_support%': 0,
604 # Use of precompiled headers on Windows.
606 # This variable may be explicitly set to 1 (enabled) or 0
607 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
608 # This setting will override the default.
611 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
613 'chromium_win_pch%': 0,
616 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
617 # Set this to true when building with Clang.
618 # See http://code.google.com/p/chromium/wiki/Clang for details.
619 # If this is set, clang is used as both host and target compiler in
620 # cross-compile builds.
623 # Use experimental lld linker instead of the platform's default linker.
626 # Enable plugin installation by default.
627 'enable_plugin_installation%': 1,
629 # Specifies whether to use canvas_skia.cc in place of platform
630 # specific implementations of gfx::Canvas. Affects text drawing in the
632 # TODO(asvitkine): Enable this on all platforms and delete this flag.
633 # http://crbug.com/105550
634 'use_canvas_skia%': 0,
636 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
637 # with one of those tools.
638 'build_for_tool%': '',
640 'wix_path%': '<(DEPTH)/third_party/wix',
642 # Supervised users are enabled by default.
643 'enable_supervised_users%': 1,
645 # Platform sends memory pressure signals natively.
646 'native_memory_pressure_signals%': 0,
649 'enable_service_discovery%': 0,
650 'enable_wifi_bootstrapping%': 0,
651 'enable_hangout_services_extension%': 0,
653 # Enable the Syzygy optimization step.
654 'syzygy_optimize%': 0,
656 # Enable hole punching for the protected video.
659 # Automatically select platforms under ozone. Turn this off to
660 # build only explicitly selected platforms.
661 'ozone_auto_platforms%': 1,
663 # If this is set clang is used as host compiler, but not as target
664 # compiler. Always do this by default.
667 # Variables to control Link-Time Optimization (LTO).
668 # On Android, when using GCC LTO, the variable use_lto enables LTO on code
669 # compiled with -Os, and use_lto_o2 enables LTO on code compiled with -O2.
670 # On other platforms (including Android with Clang), use_lto enables LTO
671 # in all translation units, and use_lto_o2 has no effect.
673 # On Linux and Android, when using LLVM LTO, the script
674 # build/download_gold_plugin.py must be run to download a linker plugin.
675 # On Mac, LLVM needs to be built from scratch using
676 # tools/clang/scripts/update.py and the absolute path to
677 # third_party/llvm-build/Release+Asserts/lib must be added to
678 # $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin.
679 # TODO(pcc): Teach build system to use -lto_library flag to specify path
680 # to linker plugin on Mac.
682 # On Android/GCC, the variables must *not* be enabled at the same time.
683 # In this case LTO would 'merge' the optimization flags at link-time
684 # which would lead to all code be optimized with -O2. See crbug.com/407544
688 # Allowed level of identical code folding in the gold linker.
689 'gold_icf_level%': 'all',
691 # Libxkbcommon usage.
694 # Whether we use GTKv3 on linux.
697 # Control Flow Integrity for virtual calls and casts.
698 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
702 'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
704 # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
705 'mac_views_browser%': 0,
707 # By default, use ICU data file (icudtl.dat).
708 'icu_use_data_file_flag%': 1,
710 # Turn on JNI generation optimizations by default.
711 'optimize_jni_generation%': 1,
714 # A flag for POSIX platforms
721 # A flag for BSD platforms
722 ['OS=="freebsd" or OS=="openbsd"', {
729 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris")', {
735 # libudev usage. This currently only affects the content layer.
736 ['OS=="linux" and embedded==0', {
742 # Flags to use X11 on non-Mac POSIX platforms.
743 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
750 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
756 # Flags to use pango and cairo.
757 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
766 ['OS=="linux" and embedded==0', {
772 # We always use skia text rendering in Aura on Windows, since GDI
773 # doesn't agree with our BackingStore.
774 # TODO(beng): remove once skia text rendering is on by default.
775 ['use_aura==1 and OS=="win"', {
776 'enable_skia_text%': 1,
779 # A flag to enable or disable our compile-time dependency
780 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
781 # support will be available. This option is useful
782 # for Linux distributions and for Aura.
783 ['OS!="linux" or chromeos==1', {
784 'use_gnome_keyring%': 0,
786 'use_gnome_keyring%': 1,
789 ['OS=="mac" or OS=="ios"', {
790 # Mac and iOS want Title Case strings
791 'use_titlecase_in_grd%': 1,
794 # Enable loader extensions on Chrome OS.
796 'image_loader_extension%': 1,
798 'image_loader_extension%': 0,
801 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
802 'enable_one_click_signin%': 1,
803 'enable_pre_sync_backup%': 1,
807 'enable_extensions%': 0,
808 'enable_google_now%': 0,
809 'cld2_table_size%': 0,
813 'arm_neon_optional%': 1,
814 'native_memory_pressure_signals%': 1,
815 'enable_basic_printing%': 1,
816 'enable_print_preview%': 0,
817 'enable_task_manager%':0,
821 # Android and OSX have built-in spellcheckers that can be utilized.
822 ['OS=="android" or OS=="mac"', {
823 'use_browser_spellchecker%': 1,
826 # Android OS includes support for proprietary codecs regardless of
827 # building Chromium or Google Chrome. We also ship Google Chrome and
828 # Chromecast with proprietary codecs.
829 ['OS=="android" or branding=="Chrome" or chromecast==1', {
830 'proprietary_codecs%': 1,
832 'proprietary_codecs%': 0,
835 ['OS=="mac" or OS=="ios"', {
836 'native_memory_pressure_signals%': 1,
839 # Enable autofill dialog when not on iOS.
841 'enable_autofill_dialog%': 1,
844 ['buildtype=="Official"', {
845 'enable_prod_wallet_service%': 1,
848 # Enable hotwording on Chrome-branded ChromeOS builds.
849 ['branding=="Chrome" and chromeos==1', {
850 'enable_hotwording%': 1,
858 'disable_ftp_support%': 1,
859 'enable_extensions%': 0,
860 'enable_google_now%': 0,
861 'cld2_table_size%': 0,
862 'enable_basic_printing%': 0,
863 'enable_print_preview%': 0,
864 'enable_session_service%': 0,
865 'enable_spellcheck%': 0,
871 'enable_supervised_users%': 0,
872 'enable_task_manager%': 0,
873 'enable_media_router%': 0,
876 # Use GPU accelerated cross process image transport by default
877 # on linux builds with the Aura window manager
878 ['use_aura==1 and OS=="linux"', {
879 'ui_compositor_image_transport%': 1,
881 'ui_compositor_image_transport%': 0,
884 # Turn precompiled headers on by default.
885 ['OS=="win" and buildtype!="Official"', {
886 'chromium_win_pch%': 1
889 # Whether PDF plugin is enabled.
890 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
896 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
897 'enable_plugin_installation%': 0,
899 'enable_plugin_installation%': 1,
902 # Whether PPAPI is enabled.
903 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
904 'enable_plugins%': 0,
906 'enable_plugins%': 1,
909 # linux_use_bundled_gold: whether to use the gold linker binary checked
910 # into third_party/binutils. Force this off via GYP_DEFINES when you
911 # are using a custom toolchain and need to control -B in ldflags.
912 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
913 # for component=static_library builds.
914 ['(OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm" or (target_arch=="ia32" and host_arch=="x64"))', {
915 'linux_use_bundled_gold%': 1,
917 'linux_use_bundled_gold%': 0,
920 # linux_use_bundled_binutils: whether to use the binary binutils
921 # checked into third_party/binutils. These are not multi-arch so cannot
922 # be used except on x86 and x86-64 (the only two architectures which
923 # are currently checke in). Force this off via GYP_DEFINES when you
924 # are using a custom toolchain and need to control -B in cflags.
925 ['OS=="linux" and (target_arch=="x64")', {
926 'linux_use_bundled_binutils%': 1,
928 'linux_use_bundled_binutils%': 0,
931 # linux_use_gold_flags: whether to use build flags that rely on gold.
932 # On by default for x64 Linux.
933 ['OS=="linux" and target_arch=="x64"', {
934 'linux_use_gold_flags%': 1,
936 'linux_use_gold_flags%': 0,
939 # linux_use_debug_fission: whether to use split DWARF debug info
940 # files. This can reduce link time significantly, but is incompatible
941 # with some utilities such as icecc and ccache. Requires gold and
942 # gcc >= 4.8 or clang.
943 # http://gcc.gnu.org/wiki/DebugFission
944 ['OS=="linux" and target_arch=="x64"', {
945 'linux_use_debug_fission%': 1,
947 'linux_use_debug_fission%': 0,
950 ['OS=="android" or OS=="ios"', {
951 'enable_captive_portal_detection%': 0,
953 'enable_captive_portal_detection%': 1,
956 # Enable Skia UI text drawing incrementally on different platforms.
957 # http://crbug.com/105550
959 # On Aura, this allows per-tile painting to be used in the browser
961 ['OS!="android" and OS!="ios"', {
962 'use_canvas_skia%': 1,
966 'enable_basic_printing%': 0,
967 'enable_print_preview%': 1,
970 # Do not enable the Settings App on ChromeOS.
971 ['enable_app_list==1 and chromeos==0', {
972 'enable_settings_app%': 1,
974 'enable_settings_app%': 0,
977 # Whether tests targets should be run, archived or just have the
978 # dependencies verified. All the tests targets have the '_run' suffix,
979 # e.g. base_unittests_run runs the target base_unittests. The test
980 # target always calls tools/swarming_client/isolate.py. See the script's
981 # --help for more information. Meant to be overriden with GYP_DEFINES.
982 # TODO(maruel): Remove the conditions as more configurations are
984 ['OS!="ios" and OS!="android" and chromeos==0', {
985 'test_isolation_mode%': 'check',
987 'test_isolation_mode%': 'noop',
989 # Whether Android build uses OpenMAX DL FFT.
990 ['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")', {
991 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
992 # When enabled, this will also enable WebAudio support on
993 # Android for these architectures. Default is enabled. Whether
994 # WebAudio is actually available depends on runtime settings
996 'use_openmax_dl_fft%': 1,
998 'use_openmax_dl_fft%': 0,
1000 ['OS=="win" or OS=="linux"', {
1004 # Disable various features by default on embedded.
1007 'enable_basic_printing%': 0,
1008 'enable_print_preview%': 0,
1011 ['OS=="win" or OS=="mac"', {
1012 'enable_wifi_bootstrapping%' : 1,
1015 # Path to sas.dll, which provides the SendSAS function.
1016 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1017 ['target_arch=="x64"', {
1018 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1020 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1024 'pkg-config': '<(chroot_cmd) <(DEPTH)/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
1026 'pkg-config': 'pkg-config'
1029 # Enable WebVR support by default on Android
1030 # Still requires command line flag to access API
1038 # Setting this to '0' will cause V8's startup snapshot to be
1039 # embedded in the binary instead of being a external files.
1040 'v8_use_external_startup_data%': 1,
1042 # Set this to 1 to enable use of concatenated impulse responses
1043 # for the HRTF panner in WebAudio.
1044 'use_concatenated_impulse_responses': 1,
1046 # You can set the variable 'use_official_google_api_keys' to 1
1047 # to use the Google-internal file containing official API keys
1048 # for Google Chrome even in a developer build. Setting this
1049 # variable explicitly to 1 will cause your build to fail if the
1050 # internal file is missing.
1052 # The variable is documented here, but not handled in this file;
1053 # see //google_apis/determine_use_official_keys.gypi for the
1056 # Set the variable to 0 to not use the internal file, even when
1057 # it exists in your checkout.
1059 # Leave it unset in your include.gypi to have the variable
1060 # implicitly set to 1 if you have
1061 # src/google_apis/internal/google_chrome_api_keys.h in your
1062 # checkout, and implicitly set to 0 if not.
1064 # Note that official builds always behave as if the variable
1065 # was explicitly set to 1, i.e. they always use official keys,
1066 # and will fail to build if the internal file is missing.
1068 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1069 # include.gypi or by other means. Due to subtleties of GYP, this
1070 # is not the same as leaving the variable unset, even though its
1072 # //google_apis/determine_use_official_keys.gypi is 2.
1074 # Set these to bake the specified API keys and OAuth client
1075 # IDs/secrets into your build.
1077 # If you create a build without values baked in, you can instead
1078 # set environment variables to provide the keys at runtime (see
1079 # src/google_apis/google_api_keys.h for details). Features that
1080 # require server-side APIs may fail to work if no keys are
1083 # Note that if you are building an official build or if
1084 # use_official_google_api_keys has been set to 1 (explicitly or
1085 # implicitly), these values will be ignored and the official
1086 # keys will be used instead.
1087 'google_api_key%': '',
1088 'google_default_client_id%': '',
1089 'google_default_client_secret%': '',
1090 # Native Client is enabled by default.
1091 'disable_nacl%': '0',
1093 # Native Client toolchains, enabled by default.
1094 'disable_pnacl%': 0,
1095 'disable_newlib%': 0,
1097 # Sets the default version name and code for Android app, by default we
1098 # do a developer build.
1099 'android_app_version_name%': 'Developer Build',
1100 'android_app_version_code%': 1,
1103 # Copy conditionally-set variables out one scope.
1104 'branding%': '<(branding)',
1105 'branding_path_component%': '<(branding_path_component)',
1106 'buildtype%': '<(buildtype)',
1107 'target_arch%': '<(target_arch)',
1108 'target_subarch%': '<(target_subarch)',
1109 'mips_arch_variant%': '<(mips_arch_variant)',
1110 'mips_dsp_rev%': '<(mips_dsp_rev)',
1111 'host_arch%': '<(host_arch)',
1112 'toolkit_views%': '<(toolkit_views)',
1113 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1114 'use_aura%': '<(use_aura)',
1115 'use_ash%': '<(use_ash)',
1116 'use_cras%': '<(use_cras)',
1117 'use_libpci%': '<(use_libpci)',
1118 'use_openssl%': '<(use_openssl)',
1119 'use_openssl_certs%': '<(use_openssl_certs)',
1120 'use_nss_certs%': '<(use_nss_certs)',
1121 'use_udev%': '<(use_udev)',
1122 'os_bsd%': '<(os_bsd)',
1123 'os_posix%': '<(os_posix)',
1124 'use_dbus%': '<(use_dbus)',
1125 'use_glib%': '<(use_glib)',
1126 'use_pango%': '<(use_pango)',
1127 'use_cairo%': '<(use_cairo)',
1128 'use_ozone%': '<(use_ozone)',
1129 'use_ozone_evdev%': '<(use_ozone_evdev)',
1130 'use_xkbcommon%': '<(use_xkbcommon)',
1131 'use_gtk3%': '<(use_gtk3)',
1132 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1133 'desktop_linux%': '<(desktop_linux)',
1134 'use_x11%': '<(use_x11)',
1135 'use_gnome_keyring%': '<(use_gnome_keyring)',
1136 'linux_fpic%': '<(linux_fpic)',
1137 'chromeos%': '<(chromeos)',
1138 'chromecast%': '<(chromecast)',
1139 'enable_viewport%': '<(enable_viewport)',
1140 'enable_hidpi%': '<(enable_hidpi)',
1141 'enable_topchrome_md%': '<(enable_topchrome_md)',
1142 'image_loader_extension%': '<(image_loader_extension)',
1143 'fastbuild%': '<(fastbuild)',
1144 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1145 'win_z7%': '<(win_z7)',
1146 'dcheck_always_on%': '<(dcheck_always_on)',
1147 'tracing_like_official_build%': '<(tracing_like_official_build)',
1148 'fieldtrial_testing_like_official_build%': '<(fieldtrial_testing_like_official_build)',
1149 'arm_version%': '<(arm_version)',
1150 'arm_neon%': '<(arm_neon)',
1151 'arm_neon_optional%': '<(arm_neon_optional)',
1152 'sysroot%': '<(sysroot)',
1153 'pkg-config%': '<(pkg-config)',
1154 'chroot_cmd%': '<(chroot_cmd)',
1155 'system_libdir%': '<(system_libdir)',
1156 'component%': '<(component)',
1157 'win_analyze%': '<(win_analyze)',
1158 'win_fastlink%': '<(win_fastlink)',
1159 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1160 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1161 'remoting%': '<(remoting)',
1162 'enable_one_click_signin%': '<(enable_one_click_signin)',
1163 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1164 'enable_media_router%': '<(enable_media_router)',
1165 'enable_webrtc%': '<(enable_webrtc)',
1166 'chromium_win_pch%': '<(chromium_win_pch)',
1167 'configuration_policy%': '<(configuration_policy)',
1168 'safe_browsing%': '<(safe_browsing)',
1169 'enable_web_speech%': '<(enable_web_speech)',
1170 'enable_hotwording%': '<(enable_hotwording)',
1171 'notifications%': '<(notifications)',
1172 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1173 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1175 'asan_blacklist%': '<(asan_blacklist)',
1176 'asan_coverage%': '<(asan_coverage)',
1177 'sanitizer_coverage%': '<(sanitizer_coverage)',
1178 'asan_field_padding%': '<(asan_field_padding)',
1179 'use_sanitizer_options%': '<(use_sanitizer_options)',
1180 'syzyasan%': '<(syzyasan)',
1181 'kasko%': '<(kasko)',
1182 'syzygy_optimize%': '<(syzygy_optimize)',
1185 'msan_blacklist%': '<(msan_blacklist)',
1186 'msan_track_origins%': '<(msan_track_origins)',
1188 'tsan_blacklist%': '<(tsan_blacklist)',
1189 'ubsan%': '<(ubsan)',
1190 'ubsan_blacklist%': '<(ubsan_blacklist)',
1191 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1192 'ubsan_vptr%': '<(ubsan_vptr)',
1193 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1194 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
1195 'use_custom_libcxx%': '<(use_custom_libcxx)',
1196 'order_profiling%': '<(order_profiling)',
1197 'order_text_section%': '<(order_text_section)',
1198 'enable_extensions%': '<(enable_extensions)',
1199 'enable_pdf%': '<(enable_pdf)',
1200 'enable_plugin_installation%': '<(enable_plugin_installation)',
1201 'enable_plugins%': '<(enable_plugins)',
1202 'enable_session_service%': '<(enable_session_service)',
1203 'enable_themes%': '<(enable_themes)',
1204 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1205 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1206 'enable_background%': '<(enable_background)',
1207 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1208 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1209 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1210 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1211 'use_canvas_skia%': '<(use_canvas_skia)',
1212 'test_isolation_mode%': '<(test_isolation_mode)',
1213 'enable_basic_printing%': '<(enable_basic_printing)',
1214 'enable_print_preview%': '<(enable_print_preview)',
1215 'enable_spellcheck%': '<(enable_spellcheck)',
1216 'use_browser_spellchecker%': '<(use_browser_spellchecker)',
1217 'enable_google_now%': '<(enable_google_now)',
1218 'cld_version%': '<(cld_version)',
1219 'cld2_table_size%': '<(cld2_table_size)',
1220 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1221 'disable_file_support%': '<(disable_file_support)',
1222 'disable_ftp_support%': '<(disable_ftp_support)',
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 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1430 'internal_gles2_conform_tests%': 0,
1432 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1433 'internal_khronos_glcts_tests%': 0,
1435 # Set to 1 to compile the filter fuzzer.
1436 'internal_filter_fuzzer%': 0,
1438 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1439 # so Cocoa is happy (http://crbug.com/20441).
1441 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1442 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1443 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1444 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1445 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1446 'vi', 'zh-CN', 'zh-TW',
1449 # Pseudo locales are special locales which are used for testing and
1450 # debugging. They don't get copied to the final app. For more info,
1451 # check out https://www.chromium.org/developers/testing/fake-bidi
1458 # If debug_devtools is set to 1, JavaScript files for DevTools are
1459 # stored as is and loaded from disk. Otherwise, a concatenated file
1460 # is stored in resources.pak. It is still possible to load JS files
1461 # from disk by passing --debug-devtools cmdline switch.
1462 'debug_devtools%': 0,
1464 # The Java Bridge is not compiled in by default.
1467 # Code signing for iOS binaries. The bots need to be able to disable this.
1468 'chromium_ios_signing%': 1,
1470 # This flag is only used when disable_nacl==0 and disables all those
1471 # subcomponents which would require the installation of a native_client
1472 # untrusted toolchain.
1473 'disable_nacl_untrusted%': 0,
1475 # PNaCl toolchain does not support sanitizers. Disable by default.
1476 'enable_nacl_nonsfi_test%': 0,
1478 # Disable Dart by default.
1481 # Copy out the setting of disable_nacl.
1482 'disable_nacl%': '<(disable_nacl)',
1484 # Native Client toolchains, enabled by default.
1485 'disable_pnacl%': '<(disable_pnacl)',
1486 'disable_newlib%': '<(disable_newlib)',
1488 # Whether to build full debug version for Debug configuration on Android.
1489 # Compared to full debug version, the default Debug configuration on Android
1490 # has no full v8 debug, has size optimization and linker gc section, so that
1491 # we can build a debug version with acceptable size and performance.
1492 'android_full_debug%': 0,
1494 # Contains data about the attached devices for gyp_managed_install.
1495 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1497 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1498 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1500 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1501 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1503 # Whether we are using the rlz library or not. Platforms like Android send
1504 # rlz codes for searches but do not use the library.
1505 'enable_rlz_support%': 0,
1508 # Turns on the i18n support in V8.
1509 'v8_enable_i18n_support': 1,
1511 # Compile d8 for the host toolset.
1512 'v8_toolset_for_d8': 'host',
1514 # Use brlapi from brltty for braille display support.
1517 # Relative path to icu.gyp from this file.
1518 'icu_gyp_path': '../third_party/icu/icu.gyp',
1520 # IPC fuzzer is disabled by default.
1521 'enable_ipc_fuzzer%': 0,
1523 # Force disable libstdc++ debug mode.
1524 'disable_glibcxx_debug%': 0,
1526 # Set to 1 to compile with MSE support for MPEG2 TS
1527 'enable_mpeg2ts_stream_parser%': 0,
1529 # Support ChromeOS touchpad gestures with ozone.
1530 'use_evdev_gestures%': 0,
1532 # Default ozone platform (if no --ozone-platform flag).
1533 'ozone_platform%': "",
1535 # Ozone platforms to include in the build.
1536 'ozone_platform_caca%': 0,
1537 'ozone_platform_cast%': 0,
1538 'ozone_platform_egltest%': 0,
1539 'ozone_platform_gbm%': 0,
1540 'ozone_platform_ozonex%': 0,
1541 'ozone_platform_test%': 0,
1543 # Experiment: http://crbug.com/426914
1546 # Used to set libjpeg_gyp_path. Chrome OS ui/gfx/gfx.gyp uses the IJG path
1547 # for robust login screen decoding.
1548 'libjpeg_ijg_gyp_path': '<(DEPTH)/third_party/libjpeg/libjpeg.gyp',
1549 'libjpeg_turbo_gyp_path': '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp',
1552 ['buildtype=="Official"', {
1553 # Continue to embed build meta data in Official builds, basically the
1554 # time it was built.
1555 # TODO(maruel): This decision should be revisited because having an
1556 # official deterministic build has high value too but MSVC toolset can't
1557 # generate anything deterministic with WPO enabled AFAIK.
1558 'dont_embed_build_metadata%': 0,
1560 # Enable the Syzygy optimization step for the official builds.
1561 ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
1562 'syzygy_optimize%': 1,
1564 'syzygy_optimize%': 0,
1566 # Get binutils version so we can enable debug fission if we can.
1567 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1569 # compiler_version doesn't work with clang
1570 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1571 # compiler_version works with clang.
1572 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1573 # that it takes effect here.
1574 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1575 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1577 # On Android we know the binutils version in the toolchain.
1579 'binutils_version%': 222,
1581 ['host_arch=="x64"', {
1582 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1584 ['host_arch=="ia32"', {
1585 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1587 # Our version of binutils in third_party/binutils
1588 ['linux_use_bundled_binutils==1', {
1589 'binutils_version%': 224,
1593 'binutils_version%': 0,
1595 # The version of GCC in use, set later in platforms that use GCC and have
1596 # not explicitly chosen to build with clang. Currently, this means all
1597 # platforms except Windows, Mac and iOS.
1598 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1599 # it takes effect here.
1600 ['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', {
1603 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1604 # We directly set the gcc version since we know what we use.
1607 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1608 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1612 'host_gcc_version%': 0,
1615 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1616 'directx_sdk_path%': '<(directx_sdk_default_path)',
1618 'directx_sdk_path%': '$(DXSDK_DIR)',
1621 'windows_driver_kit_path%': '$(WDK_DIR)',
1623 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1625 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1628 'nacl_untrusted_build%': 0,
1629 'use_allocator%': 'none',
1631 # Use a 64-bit linker to avoid running out of address space. The
1632 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1633 ['host_arch=="ia32" and target_arch=="ia32"', {
1634 # TODO(thestig) This is a horrible way to force the desired
1635 # configuration. Our gyp variable scoping is likely wrong and
1636 # needs to be cleaned up. The GN configuration should be changed
1638 'binutils_version%': 224,
1639 'linux_use_bundled_binutils%': '1',
1640 'linux_use_bundled_gold%': '1',
1641 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1643 # All Chrome builds have breakpad symbols, but only process the
1644 # symbols from official builds.
1645 ['(branding=="Chrome" and buildtype=="Official")', {
1646 'linux_dump_symbols%': 1,
1648 # Omit unwind support in official release builds to save space. We
1649 # can use breakpad for these builds.
1650 'release_unwind_tables%': 0,
1653 }], # os_posix==1 and OS!="mac" and OS!="ios"
1656 'enable_background%': 0,
1657 'icu_use_data_file_flag%': 1,
1658 'enable_web_speech%': 0,
1659 'use_system_libxml%': 1,
1660 'use_system_sqlite%': 1,
1662 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1663 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1664 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1665 'uk', 'vi', 'zh-CN', 'zh-TW',
1668 # iOS SDK and deployment target support. The |ios_sdk| value is left
1669 # blank so that when it is set in the project files it will be the
1670 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1671 # causes Xcode to spit out a warning for every single project file for
1672 # not using the "current" SDK.
1674 'ios_sdk_path%': '',
1675 'ios_deployment_target%': '7.0',
1678 # ios_product_name is set to the name of the .app bundle as it should
1680 ['branding=="Chrome"', {
1681 'ios_product_name%': 'Chrome',
1682 }, { # else: branding!="Chrome"
1683 'ios_product_name%': 'Chromium',
1685 ['branding=="Chrome" and buildtype=="Official"', {
1687 }, { # else: branding!="Chrome" or buildtype!="Official"
1693 # Location of Android NDK.
1696 # Standard libraries can use the relative path to the NDK.
1697 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1698 # Unfortunately, it is required to use the absolute path to the SDK
1699 # because it us passed to ant which uses a different relative path
1701 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1702 # Similarly, gdbserver and the Android toolchain need to use the
1703 # absolute path to the NDK because they are used at different levels
1705 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1706 'android_host_arch%': '<!(uname -m)',
1707 # Android API-level of the SDK used for compilation.
1708 'android_sdk_version%': '23',
1709 'android_sdk_build_tools_version%': '23.0.0',
1710 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1713 # Figure this out early since it needs symbols from libgcc.a, so it
1714 # has to be before that in the set of libraries.
1715 # ASan needs to dynamically link to libc++ even in static builds so
1716 # that it can interpose operator new.
1717 ['component=="shared_library" or asan==1', {
1718 'android_libcpp_library': 'c++_shared',
1719 'android_must_copy_system_libraries': 1,
1721 'android_libcpp_library': 'c++_static',
1722 'android_must_copy_system_libraries': 0,
1727 # Copy conditionally-set variables out one scope.
1728 'android_ndk_root%': '<(android_ndk_root)',
1729 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1730 'android_sdk_root%': '<(android_sdk_root)',
1731 'android_sdk_version%': '<(android_sdk_version)',
1732 'android_libcpp_root': '<(android_ndk_root)/sources/cxx-stl/llvm-libc++',
1733 'android_libcpp_library': '<(android_libcpp_library)',
1734 'android_must_copy_system_libraries': '<(android_must_copy_system_libraries)',
1735 'host_os%': '<(host_os)',
1737 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1738 # Android SDK build tools (e.g. dx, aidl)
1739 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1741 # Android API level 16 is JB (Android 4.1) which is the minimum
1742 # platform requirement for Chrome on Android, we use it for native
1745 ['target_arch == "ia32"', {
1746 'android_app_abi%': 'x86',
1747 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
1748 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-x86',
1749 'android_ndk_lib_dir%': 'usr/lib',
1750 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1752 ['target_arch == "x64"', {
1753 'android_app_abi%': 'x86_64',
1754 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1755 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1756 'android_ndk_lib_dir%': 'usr/lib64',
1757 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1759 ['target_arch=="arm"', {
1762 'android_app_abi%': 'armeabi',
1764 'android_app_abi%': 'armeabi-v7a',
1767 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
1768 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-arm',
1769 'android_ndk_lib_dir%': 'usr/lib',
1770 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1772 ['target_arch == "arm64"', {
1773 'android_app_abi%': 'arm64-v8a',
1774 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1775 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1776 'android_ndk_lib_dir%': 'usr/lib',
1777 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1779 ['target_arch == "mipsel"', {
1780 'android_app_abi%': 'mips',
1781 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
1782 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-mips',
1783 'android_ndk_lib_dir%': 'usr/lib',
1784 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1786 ['target_arch == "mips64el"', {
1787 'android_app_abi%': 'mips64',
1788 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1789 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1790 'android_ndk_lib_dir%': 'usr/lib64',
1791 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1795 # Copy conditionally-set variables out one scope.
1796 'android_app_abi%': '<(android_app_abi)',
1797 'android_gdbserver%': '<(android_gdbserver)',
1798 'android_ndk_root%': '<(android_ndk_root)',
1799 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1800 'android_sdk_root%': '<(android_sdk_root)',
1801 'android_sdk_version%': '<(android_sdk_version)',
1802 'android_toolchain%': '<(android_toolchain)',
1804 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1805 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1806 'android_sdk_tools%': '<(android_sdk_tools)',
1807 'android_aapt_path%': '<(android_sdk_tools)/aapt',
1808 'android_sdk%': '<(android_sdk)',
1809 'android_sdk_jar%': '<(android_sdk)/android.jar',
1811 'android_libcpp_root': '<(android_libcpp_root)',
1812 'android_libcpp_library': '<(android_libcpp_library)',
1813 'android_libcpp_include': '<(android_libcpp_root)/libcxx/include',
1814 'android_libcpp_libs_dir%': '<(android_libcpp_root)/libs/<(android_app_abi)',
1815 'android_must_copy_system_libraries': '<(android_must_copy_system_libraries)',
1816 'host_os%': '<(host_os)',
1818 # Location of the "objcopy" binary, used by both gyp and scripts.
1819 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1821 # Location of the "strip" binary, used by both gyp and scripts.
1822 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1824 # Location of the "readelf" binary.
1825 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1827 # Determines whether we should optimize JNI generation at the cost of
1828 # breaking assumptions in the build system that when inputs have changed
1829 # the outputs should always change as well. This is meant purely for
1830 # developer builds, to avoid spurious re-linking of native files.
1831 'optimize_jni_generation%': '<(optimize_jni_generation)',
1833 # Use OpenSSL's struct X509 to represent certificates.
1834 'use_openssl_certs%': 1,
1836 'proprietary_codecs%': '<(proprietary_codecs)',
1838 # safe_browsing defaults to 2 for public builds and is switched to 3 in
1839 # //clank/supplement.gypi since mode 3 requires an internal API.
1840 'safe_browsing%': 2,
1842 'enable_web_speech%': 0,
1844 'use_allocator%': 'none',
1846 # Disable Native Client.
1849 # Android does not support background apps.
1850 'enable_background%': 0,
1852 # Sessions are store separately in the Java side.
1853 'enable_session_service%': 0,
1857 'gtest_target_type%': 'shared_library',
1860 'use_system_fontconfig%': 0,
1862 'use_system_fontconfig%': 1,
1865 'enable_mpeg2ts_stream_parser%': 1,
1866 'ffmpeg_branding%': 'ChromeOS',
1867 'ozone_platform_ozonex%': 1,
1868 'use_custom_freetype%': 0,
1869 'use_playready%': 0,
1871 ['target_arch=="arm"', {
1873 'arm_tune%': 'cortex-a9',
1879 ['chromecast==1 and OS!="android"', {
1880 'ozone_platform_cast%': 1
1887 # All Chrome builds have breakpad symbols, but only process the
1888 # symbols from official builds.
1889 ['(branding=="Chrome" and buildtype=="Official")', {
1890 'mac_strip_release%': 1,
1894 ['OS=="mac" or OS=="ios"', {
1898 # Mac OS X SDK and deployment target support. The SDK identifies
1899 # the version of the system headers that will be used, and
1900 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1901 # macro. "Maximum allowed" refers to the operating system version
1902 # whose APIs are available in the headers. The deployment target
1903 # identifies the minimum system version that the built products are
1904 # expected to function on. It corresponds to the
1905 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1906 # macros are available, #include <AvailabilityMacros.h>. Additional
1907 # documentation on these macros is available at
1908 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1909 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1910 # deployment target to 10.6. Other projects, such as O3D, may
1911 # override these defaults.
1913 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1914 # about that is at least the specified version. In official builds,
1915 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1916 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1917 # path to the SDK; when set to a non-empty string, SDK detection
1918 # based on mac_sdk_min will be bypassed entirely.
1921 'mac_sdk_min%': '10.8',
1922 }, { # else OS!="ios"
1923 'mac_sdk_min%': '10.10',
1926 'mac_sdk_path%': '',
1928 'mac_deployment_target%': '10.6',
1931 'mac_sdk_min': '<(mac_sdk_min)',
1932 'mac_sdk_path': '<(mac_sdk_path)',
1933 'mac_deployment_target': '<(mac_deployment_target)',
1935 # Compile in Breakpad support by default so that it can be
1936 # tested, even if it is not enabled by default at runtime.
1937 'mac_breakpad_compiled_in%': 1,
1939 # mac_product_name is set to the name of the .app bundle as it should
1940 # appear on disk. This duplicates data from
1941 # chrome/app/theme/chromium/BRANDING and
1942 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1943 # these names into the build system.
1944 ['branding=="Chrome"', {
1945 'mac_product_name%': 'Google Chrome',
1946 }, { # else: branding!="Chrome"
1947 'mac_product_name%': 'Chromium',
1949 # Official mac builds require a specific OS X SDK, but iOS and
1950 # non-official mac builds do not.
1951 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1952 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1954 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1956 ['branding=="Chrome" and buildtype=="Official"', {
1957 # Enable uploading crash dumps.
1958 'mac_breakpad_uploads%': 1,
1959 # Enable dumping symbols at build time for use by Mac Breakpad.
1961 # Enable Keystone auto-update support.
1963 }, { # else: branding!="Chrome" or buildtype!="Official"
1964 'mac_breakpad_uploads%': 0,
1969 }], # OS=="mac" or OS=="ios"
1972 # This is the architecture convention used in WinSDK paths.
1973 ['target_arch=="ia32"', {
1974 'winsdk_arch%': 'x86',
1976 'winsdk_arch%': '<(target_arch)',
1978 ['component=="shared_library" or MSVS_VERSION == "2015"', {
1979 # TODO(scottmg): The allocator shimming doesn't work on the 2015 CRT
1980 # and we are hoping to be able to remove it if an additional feature
1981 # lands in the 2015 CRT API. For now, don't shim and revisit once
1982 # VS2015 is RTM: http://crbug.com/481611.
1983 'win_use_allocator_shim%': 0,
1985 ['component=="static_library"', {
1986 # Turn on multiple dll by default on Windows when in static_library.
1987 'chrome_multiple_dll%': 1,
1989 ['asan==1 or syzyasan==1', {
1990 'win_use_allocator_shim%': 0,
1995 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1996 # Only enabled by default for ninja because it's buggy in VS.
1997 # Not enabled for component=static_library because some targets
1998 # are too large and the toolchain fails due to the size of the
2000 'incremental_chrome_dll%': 1,
2002 # Don't do incremental linking for large modules on 32-bit or when
2003 # component=static_library as the toolchain fails due to the size of
2005 ['MSVS_OS_BITS==32 or component=="static_library"', {
2006 'msvs_large_module_debug_link_mode%': '1', # No
2008 'msvs_large_module_debug_link_mode%': '2', # Yes
2011 'nacl_win64_defines': [
2012 # This flag is used to minimize dependencies when building
2013 # Native Client loader for 64-bit Windows.
2016 # Need to include allocator target, but exclude tcmalloc files.
2017 'use_allocator%': 'winheap',
2020 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
2026 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win") and chromecast==0', {
2027 'enable_pepper_cdms%': 1,
2029 'enable_pepper_cdms%': 0,
2032 ['OS=="android" or chromecast==1', {
2033 'enable_browser_cdms%': 1,
2035 'enable_browser_cdms%': 0,
2038 # Native Client glibc toolchain is enabled
2039 # by default except on arm, mips and mips64.
2040 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
2041 'disable_glibc%': 1,
2043 'disable_glibc%': 0,
2046 # Set the relative path from this file to the GYP file of the JPEG
2047 # library used by Chromium.
2048 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2049 # Configuration for using the system libjeg is here.
2050 'libjpeg_gyp_path': '<(libjpeg_ijg_gyp_path)',
2052 'libjpeg_gyp_path': '<(libjpeg_turbo_gyp_path)',
2055 # Options controlling the use of GConf (the classic GNOME configuration
2056 # system) and GIO, which contains GSettings (the new GNOME config system).
2057 ['chromeos==1 or embedded==1', {
2065 # Set up -D and -E flags passed into grit.
2066 ['branding=="Chrome"', {
2067 # TODO(mmoss) The .grd files look for _google_chrome, but for
2068 # consistency they should look for google_chrome_build like C++.
2069 'grit_defines': ['-D', '_google_chrome',
2070 '-E', 'CHROMIUM_BUILD=google_chrome'],
2072 'grit_defines': ['-D', '_chromium',
2073 '-E', 'CHROMIUM_BUILD=chromium'],
2076 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2078 ['desktop_linux==1', {
2079 'grit_defines': ['-D', 'desktop_linux'],
2081 ['toolkit_views==1', {
2082 'grit_defines': ['-D', 'toolkit_views'],
2085 'grit_defines': ['-D', 'use_aura'],
2088 'grit_defines': ['-D', 'use_ash'],
2090 ['use_nss_certs==1', {
2091 'grit_defines': ['-D', 'use_nss_certs'],
2094 'grit_defines': ['-D', 'use_ozone'],
2096 ['image_loader_extension==1', {
2097 'grit_defines': ['-D', 'image_loader_extension'],
2099 ['use_titlecase_in_grd==1', {
2100 'grit_defines': ['-D', 'use_titlecase'],
2105 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2106 '--no-output-all-resource-defines',
2109 ['OS=="mac" or OS=="ios"', {
2110 'grit_defines': ['-D', 'scale_factors=2x'],
2114 'enable_coverage%': 0,
2118 '--no-output-all-resource-defines',
2120 # iOS uses a whitelist to filter resources.
2121 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2123 # Enable host builds when generating with ninja-ios.
2125 ['"<(GENERATOR)"=="ninja"', {
2129 # Use the version of clang shipped with Xcode when building official
2130 # version of Chrome for iOS.
2132 # TODO(eugenebut): Remove enable_coverage check once
2133 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2134 # http://crbug.com/450379
2135 ['buildtype=="Official" or enable_coverage', {
2140 ['enable_extensions==1', {
2141 'grit_defines': ['-D', 'enable_extensions'],
2143 ['enable_plugins!=0', {
2144 'grit_defines': ['-D', 'enable_plugins'],
2146 ['enable_basic_printing==1 or enable_print_preview==1', {
2147 'grit_defines': ['-D', 'enable_printing'],
2149 ['enable_print_preview==1', {
2150 'grit_defines': ['-D', 'enable_print_preview'],
2152 ['enable_themes==1', {
2153 'grit_defines': ['-D', 'enable_themes'],
2155 ['enable_app_list==1', {
2156 'grit_defines': ['-D', 'enable_app_list'],
2158 ['enable_settings_app==1', {
2159 'grit_defines': ['-D', 'enable_settings_app'],
2161 ['enable_google_now==1', {
2162 'grit_defines': ['-D', 'enable_google_now'],
2164 ['use_concatenated_impulse_responses==1', {
2165 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2167 ['enable_media_router==1', {
2168 'grit_defines': ['-D', 'enable_media_router'],
2170 ['enable_webrtc==1', {
2171 'grit_defines': ['-D', 'enable_webrtc'],
2173 ['enable_hangout_services_extension==1', {
2174 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2176 ['enable_task_manager==1', {
2177 'grit_defines': ['-D', 'enable_task_manager'],
2179 ['notifications==1', {
2180 'grit_defines': ['-D', 'enable_notifications'],
2182 ['enable_wifi_bootstrapping==1', {
2183 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2185 ['mac_views_browser==1', {
2186 'grit_defines': ['-D', 'mac_views_browser'],
2188 ['enable_topchrome_md==1', {
2189 'grit_defines': ['-D', 'enable_topchrome_md'],
2191 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2192 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2194 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2195 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2197 ['enable_mdns==1 or OS=="mac"', {
2198 'grit_defines': ['-D', 'enable_service_discovery'],
2199 'enable_service_discovery%': 1
2201 ['clang_use_chrome_plugins==1', {
2207 ['OS=="mac" or OS=="ios"', {
2208 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2209 }, { # OS != "mac" or OS != "ios"
2210 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
2214 'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ',
2216 # On Windows, the plugin is built directly into clang, so there's
2217 # no need to load it dynamically.
2218 'clang_dynlib_flags%': '',
2220 # https://crbug.com/441916
2221 ['OS=="android" or OS=="linux" or OS=="mac"', {
2222 'clang_plugin_args%': '-Xclang -plugin-arg-find-bad-constructs -Xclang check-templates ',
2223 }, { # OS != "linux"
2224 'clang_plugin_args%': ''
2228 # If you change these, also change build/config/clang/BUILD.gn.
2229 'clang_chrome_plugins_flags%':
2230 '<(clang_dynlib_flags)'
2231 '-Xclang -add-plugin -Xclang find-bad-constructs <(clang_plugin_args)',
2233 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2235 'use_allocator%': 'none',
2236 'use_sanitizer_options%': 1,
2239 ['OS=="linux" and asan==0 and msan==0 and lsan==0 and tsan==0', {
2240 # PNaCl toolchain Non-SFI build only supports linux OS build.
2241 # Also, it does not support sanitizers.
2242 'enable_nacl_nonsfi_test%': 1,
2244 ['asan==1 and OS=="linux" and chromeos==0', {
2245 'use_custom_libcxx%': 1,
2253 ['asan==1 and OS=="mac"', {
2254 'mac_strip_release': 1,
2257 'use_custom_libcxx%': 1,
2260 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2261 # libstdc++. This is required to avoid false positive reports whenever
2262 # the C++ standard library is used.
2263 'use_custom_libcxx%': 1,
2264 # Running the V8-generated code on an ARM simulator is a powerful hack
2265 # that allows the tool to see the memory accesses from JITted code.
2266 # Without this flag, JS code causes false positive reports from MSan.
2267 'v8_target_arch': 'arm64',
2270 # On valgrind bots, override the optimizer settings so we don't inline too
2271 # much and make the stacks harder to figure out.
2273 # TODO(rnk): Kill off variables that no one else uses and just implement
2274 # them under a build_for_tool== condition.
2275 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2277 'mac_debug_optimization': '1',
2278 'mac_release_optimization': '1',
2279 'release_optimize': '1',
2280 'no_gc_sections': 1,
2281 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2282 '-fno-builtin -fno-optimize-sibling-calls',
2283 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2284 '-fno-builtin -fno-optimize-sibling-calls',
2286 # MSVS flags for TSan on Pin and Windows.
2287 'win_debug_RuntimeChecks': '0',
2288 'win_debug_disable_iterator_debugging': '1',
2289 'win_debug_Optimization': '1',
2290 'win_debug_InlineFunctionExpansion': '0',
2291 'win_release_InlineFunctionExpansion': '0',
2292 'win_release_OmitFramePointers': '0',
2294 'use_allocator': 'tcmalloc',
2295 'release_valgrind_build': 1,
2297 'component': 'static_library',
2298 'use_system_zlib': 0,
2301 # Build tweaks for DrMemory.
2302 # TODO(rnk): Combine with tsan config to share the builder.
2303 # http://crbug.com/108155
2304 ['build_for_tool=="drmemory"', {
2305 # These runtime checks force initialization of stack vars which blocks
2306 # DrMemory's uninit detection.
2307 'win_debug_RuntimeChecks': '0',
2308 # Iterator debugging is slow.
2309 'win_debug_disable_iterator_debugging': '1',
2310 # Try to disable optimizations that mess up stacks in a release build.
2311 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2312 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2313 # compiler bug, so we use /Ob1 instead.
2314 'win_release_InlineFunctionExpansion': '1',
2315 'win_release_OmitFramePointers': '0',
2316 # Ditto for debug, to support bumping win_debug_Optimization.
2317 'win_debug_InlineFunctionExpansion': 0,
2318 'win_debug_OmitFramePointers': 0,
2319 # Keep the code under #ifndef NVALGRIND.
2320 'release_valgrind_build': 1,
2323 # RLZ library is used on Win, Mac, iOS and ChromeOS.
2324 ['OS=="win" or OS=="mac" or OS=="ios" or chromeos==1', {
2325 'enable_rlz_support%': 1,
2327 # RLZ is enabled for "Chrome" builds.
2328 ['branding=="Chrome"', {
2334 # Set default compiler flags depending on ARM version.
2335 ['arm_version==6', {
2336 'arm_arch%': 'armv6',
2339 'arm_float_abi%': 'softfp',
2342 ['arm_version==7', {
2343 'arm_arch%': 'armv7-a',
2344 'arm_tune%': 'generic-armv7-a',
2349 'arm_fpu%': 'vfpv3-d16',
2352 'arm_float_abi%': 'softfp',
2354 'arm_float_abi%': 'hard',
2360 # Set default compiler flags for MIPS floating-point support.
2361 ['target_arch=="mipsel"', {
2362 'mips_float_abi%': 'hard',
2364 ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
2365 'mips_fpu_mode%': 'fp32',
2367 'mips_fpu_mode%': '',
2370 # Enable brlapi by default for chromeos.
2375 ['use_ozone==1 and ozone_auto_platforms==1', {
2376 # Use test as the default platform.
2377 'ozone_platform%': 'test',
2379 # Build all platforms whose deps are in install-build-deps.sh.
2380 # Only these platforms will be compile tested by buildbots.
2381 'ozone_platform_gbm%': 1,
2382 'ozone_platform_test%': 1,
2383 'ozone_platform_egltest%': 1,
2386 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2387 'use_clipboard_aurax11%': 1,
2390 ['OS=="win" and use_goma==1', {
2391 # goma doesn't support pch yet.
2392 'chromium_win_pch': 0,
2393 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2395 ['win_z7==0 and fastbuild==0', {
2401 ['OS=="win" and (clang==1 or asan==1)', {
2402 'chromium_win_pch': 0,
2406 'host_cc': '<(make_clang_dir)/bin/clang',
2407 'host_cxx': '<(make_clang_dir)/bin/clang++',
2409 'host_cc': '<!(which gcc)',
2410 'host_cxx': '<!(which g++)',
2413 # The seccomp-bpf sandbox is only supported on five architectures
2415 # Do not disable seccomp_bpf anywhere without talking to
2416 # security@chromium.org!
2417 ['((OS=="linux" or OS=="android") and '
2418 '(target_arch=="ia32" or target_arch=="x64" or '
2419 'target_arch=="arm" or target_arch=="mipsel" or '
2420 'target_arch=="arm64"))', {
2421 'use_seccomp_bpf%': 1,
2423 'use_seccomp_bpf%': 0,
2430 ['branding=="Chrome" and buildtype=="Official"', {
2431 'enable_hangout_services_extension%': 1,
2433 'enable_hangout_services_extension%': 0,
2437 # The path to the ANGLE library.
2438 'angle_path': '<(DEPTH)/third_party/angle',
2440 # List of default apps to install in new profiles. The first list contains
2441 # the source files as found in svn. The second list, used only for linux,
2442 # contains the destination location for each of the files. When a crx
2443 # is added or removed from the list, the chrome/browser/resources/
2444 # default_apps/external_extensions.json file must also be updated.
2446 # README: GN version of these is in the target //chrome:default_apps
2447 # (there's no global variable like in GYP). Be sure to update that target
2448 # if you change these lists!
2449 'default_apps_list': [
2450 'browser/resources/default_apps/external_extensions.json',
2451 'browser/resources/default_apps/gmail.crx',
2452 'browser/resources/default_apps/search.crx',
2453 'browser/resources/default_apps/youtube.crx',
2454 'browser/resources/default_apps/drive.crx',
2455 'browser/resources/default_apps/docs.crx',
2457 'default_apps_list_linux_dest': [
2458 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2459 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2460 '<(PRODUCT_DIR)/default_apps/search.crx',
2461 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2462 '<(PRODUCT_DIR)/default_apps/drive.crx',
2463 '<(PRODUCT_DIR)/default_apps/docs.crx',
2466 # Whether to allow building of the GPU-related isolates.
2467 'archive_gpu_tests%': 0,
2469 # Whether to allow building of chromoting related isolates.
2470 'archive_chromoting_tests%': 0,
2472 # Whether to allow building of Media Router related isolates.
2473 'archive_media_router_tests%': 0,
2475 'target_defaults': {
2477 # The condition that operates on chromium_code is in a target_conditions
2478 # section, and will not have access to the default fallback value of
2479 # chromium_code at the top of this file, or to the chromium_code
2480 # variable placed at the root variables scope of .gyp files, because
2481 # those variables are not set at target scope. As a workaround,
2482 # if chromium_code is not set at target scope, define it in target scope
2483 # to contain whatever value it has during early variable expansion.
2484 # That's enough to make it available during target conditional
2486 'chromium_code%': '<(chromium_code)',
2488 'component%': '<(component)',
2490 'chromecast%': '<(chromecast)',
2492 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2493 'win_release_Optimization%': '2', # 2 = /O2
2494 'win_debug_Optimization%': '0', # 0 = /Od
2496 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2497 # Tri-state: blank is default, 1 on, 0 off
2498 'win_release_OmitFramePointers%': '0',
2499 # Tri-state: blank is default, 1 on, 0 off
2500 'win_debug_OmitFramePointers%': '',
2502 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2503 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2505 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2506 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2507 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2509 # VS inserts quite a lot of extra checks to algorithms like
2510 # std::partial_sort in Debug build which make them O(N^2)
2511 # instead of O(N*logN). This is particularly slow under memory
2512 # tools like ThreadSanitizer so we want it to be disablable.
2513 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2514 'win_debug_disable_iterator_debugging%': '0',
2516 # An application manifest fragment to declare compatibility settings for
2517 # 'executable' targets. Ignored in other target type.
2518 'win_exe_compatibility_manifest%':
2519 '<(DEPTH)\\build\\win\\compatibility.manifest',
2521 'release_extra_cflags%': '',
2522 'debug_extra_cflags%': '',
2524 'release_valgrind_build%': '<(release_valgrind_build)',
2526 # the non-qualified versions are widely assumed to be *nix-only
2527 'win_release_extra_cflags%': '',
2528 'win_debug_extra_cflags%': '',
2530 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2531 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2533 # Only used by Windows build for now. Can be used to build into a
2534 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2535 # output files in src/build/VS2010_{Debug,Release}.
2536 'build_dir_prefix%': '',
2538 # Targets are by default not nacl untrusted code.
2539 'nacl_untrusted_build%': 0,
2541 'pnacl_compile_flags': [
2542 # pnacl uses the clang compiler so we need to suppress all the
2543 # same warnings as we do for clang.
2544 # TODO(sbc): Remove these if/when they are removed from the clang
2546 '-Wno-unused-function',
2547 '-Wno-char-subscripts',
2548 '-Wno-c++11-extensions',
2549 '-Wno-unnamed-type-template-args',
2552 # By default, Android targets have their exported JNI symbols stripped,
2553 # so we test the manual JNI registration code paths that are required
2554 # when using the crazy linker. To allow use of native JNI exports (lazily
2555 # resolved by the JVM), targets can enable this variable, which will stop
2556 # the stripping from happening. Only targets which do not need to be
2557 # compatible with the crazy linker are permitted to set this.
2558 'use_native_jni_exports%': 0,
2561 ['OS=="win" and component=="shared_library"', {
2562 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2563 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2564 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2566 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2567 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2568 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2571 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2572 'mac_release_optimization%': 's', # Use -Os unless overridden
2573 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2575 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2576 'mac_release_optimization%': '2', # Use -O2 unless overridden
2577 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2580 'host_os%': '<(host_os)', # See comment above chromium_code.
2583 'clang_warning_flags': [
2586 # Don't die on dtoa code that uses a char as an array index.
2587 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2588 '-Wno-char-subscripts',
2590 # TODO(thakis): This used to be implied by -Wno-unused-function,
2591 # which we no longer use. Check if it makes sense to remove
2592 # this as well. http://crbug.com/316352
2593 '-Wno-unneeded-internal-declaration',
2595 # Warns on switches on enums that cover all enum values but
2596 # also contain a default: branch. Chrome is full of that.
2597 '-Wno-covered-switch-default',
2599 # Warns when a const char[] is converted to bool.
2600 '-Wstring-conversion',
2602 # C++11-related flags:
2604 # This warns on using ints as initializers for floats in
2605 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2606 # which happens in several places in chrome code. Not sure if
2607 # this is worth fixing.
2608 '-Wno-c++11-narrowing',
2610 # Clang considers the `register` keyword as deprecated, but e.g.
2611 # code generated by flex (used in angle) contains that keyword.
2612 # http://crbug.com/255186
2613 '-Wno-deprecated-register',
2615 # TODO(hans): Get this cleaned up, http://crbug.com/428099
2616 '-Wno-inconsistent-missing-override',
2618 # TODO(thakis): Enable this, crbug.com/507717
2619 '-Wno-shift-negative-value',
2622 'includes': [ 'set_clang_warning_flags.gypi', ],
2624 # Don't use deprecated V8 APIs anywhere.
2625 'V8_DEPRECATION_WARNINGS',
2626 'CLD_VERSION=<(cld_version)',
2629 '<(SHARED_INTERMEDIATE_DIR)',
2633 # When compiling Objective C, warns if a method is used whose
2634 # availability is newer than the deployment target.
2635 'xcode_settings': { 'WARNING_CFLAGS': ['-Wpartial-availability']},
2637 ['(OS=="mac" or OS=="ios") and asan==1', {
2639 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2642 ['OS=="win" and asan==1 and component=="shared_library"', {
2644 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2647 ['branding=="Chrome"', {
2648 'defines': ['GOOGLE_CHROME_BUILD'],
2649 }, { # else: branding!="Chrome"
2650 'defines': ['CHROMIUM_BUILD'],
2652 ['OS=="mac" and component=="shared_library"', {
2654 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2655 'LD_RUNPATH_SEARCH_PATHS': [
2656 # For unbundled binaries.
2658 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2659 '@loader_path/../../..',
2663 ['clang==1 or host_clang==1', {
2664 # This is here so that all files get recompiled after a clang roll and
2665 # when turning clang on or off.
2666 # (defines are passed via the command line, and build systems rebuild
2667 # things when their commandline changes). Nothing should ever read this
2669 'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
2672 'defines': ['ENABLE_RLZ'],
2674 ['component=="shared_library"', {
2675 'defines': ['COMPONENT_BUILD'],
2677 ['ui_compositor_image_transport==1', {
2678 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2681 'defines': ['USE_AURA=1'],
2684 'defines': ['USE_ASH=1'],
2687 'defines': ['USE_PANGO=1'],
2690 'defines': ['USE_CAIRO=1'],
2693 'defines': ['USE_CRAS=1'],
2696 'defines': ['USE_OZONE=1'],
2698 ['use_default_render_theme==1', {
2699 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2701 ['use_libjpeg_turbo==1', {
2702 'defines': ['USE_LIBJPEG_TURBO=1'],
2705 'defines': ['USE_X11=1'],
2707 ['use_clipboard_aurax11==1', {
2708 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2710 ['enable_one_click_signin==1', {
2711 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2713 ['enable_pre_sync_backup==1', {
2714 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2716 ['image_loader_extension==1', {
2717 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2720 'defines': ['ENABLE_PROFILING=1'],
2722 ['enable_webrtc==1', {
2723 'defines': ['ENABLE_WEBRTC=1'],
2725 ['enable_media_router==1', {
2726 'defines': ['ENABLE_MEDIA_ROUTER=1'],
2728 ['proprietary_codecs==1', {
2729 'defines': ['USE_PROPRIETARY_CODECS'],
2731 ['enable_mpeg2ts_stream_parser==1', {
2732 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2736 ['enable_viewport==1', {
2737 'defines': ['ENABLE_VIEWPORT'],
2739 ['enable_pepper_cdms==1', {
2740 'defines': ['ENABLE_PEPPER_CDMS'],
2742 ['enable_browser_cdms==1', {
2743 'defines': ['ENABLE_BROWSER_CDMS'],
2745 ['configuration_policy==1', {
2746 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2748 ['notifications==1', {
2749 'defines': ['ENABLE_NOTIFICATIONS'],
2751 ['enable_hidpi==1', {
2752 'defines': ['ENABLE_HIDPI=1'],
2754 ['enable_topchrome_md==1', {
2755 'defines': ['ENABLE_TOPCHROME_MD=1'],
2757 ['native_memory_pressure_signals==1', {
2758 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2761 'defines': ['USE_UDEV'],
2765 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2768 ['OS=="win" and fastbuild==2', {
2769 # Completely disable debug information.
2772 'GenerateDebugInformation': 'false',
2774 'VCCLCompilerTool': {
2775 'DebugInformationFormat': '0',
2779 ['OS=="win" and fastbuild==1', {
2782 # This tells the linker to generate .pdbs, so that
2783 # we can get meaningful stack traces.
2784 'GenerateDebugInformation': 'true',
2786 'VCCLCompilerTool': {
2787 # No debug info to be generated by compiler.
2788 'DebugInformationFormat': '0',
2792 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2793 'variables': { 'debug_extra_cflags': '-g0', },
2795 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2796 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2798 'variables': { 'debug_extra_cflags': '-g0', },
2800 # Android builds symbols on release by default, disable them.
2801 ['OS=="android" and fastbuild==2', {
2802 'variables': { 'release_extra_cflags': '-g0', },
2804 ['OS=="android" and fastbuild==1', {
2805 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2807 'variables': { 'release_extra_cflags': '-g0', },
2811 ['dont_embed_build_metadata==1', {
2813 'DONT_EMBED_BUILD_METADATA',
2815 }], # dont_embed_build_metadata==1
2816 ['dcheck_always_on!=0', {
2817 'defines': ['DCHECK_ALWAYS_ON=1'],
2818 }], # dcheck_always_on!=0
2819 ['tracing_like_official_build!=0', {
2820 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2821 }], # tracing_like_official_build!=0
2822 ['fieldtrial_testing_like_official_build==0 and branding!="Chrome"', {
2823 'defines': ['FIELDTRIAL_TESTING_ENABLED'],
2824 }], # fieldtrial_testing_like_official_build==0 and branding!="Chrome"
2826 'defines': ['NO_TCMALLOC'],
2828 ['win_use_allocator_shim==1', {
2829 'defines': ['ALLOCATOR_SHIM'],
2835 'ADDRESS_SANITIZER',
2836 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2837 'MEMORY_SANITIZER_INITIAL_SIZE',
2841 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2849 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2850 'MEMORY_SANITIZER_INITIAL_SIZE',
2858 '<(DEPTH)/third_party/kasko/include',
2864 '_CRT_SECURE_NO_DEPRECATE',
2865 '_SCL_SECURE_NO_DEPRECATE',
2866 # This define is required to pull in the new Win8 interfaces from
2867 # system headers like ShObjIdl.h.
2868 'NTDDI_VERSION=0x06030000',
2869 # This is required for ATL to use XP-safe versions of its functions.
2870 '_USING_V110_SDK71_',
2873 '<(DEPTH)/third_party/wtl/include',
2878 # Generates debug info when win_z7=1
2879 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2881 'GenerateDebugInformation': 'true',
2883 'VCCLCompilerTool': {
2884 'DebugInformationFormat': '1',
2890 # This is prohibited when running /analyze.
2891 '_USING_V110_SDK71_',
2894 'VCCLCompilerTool': {
2895 # Set WarnAsError to false to disable this setting for most
2896 # projects so that compilation continues.
2897 'WarnAsError': 'false',
2898 # When win_analyze is specified add the /analyze switch.
2899 # Also add /WX- to force-disable WarnAsError for projects that
2900 # override WarnAsError.
2901 # Also, disable various noisy warnings that have low value.
2902 'AdditionalOptions': [
2904 '/wd6011', # Dereferencing NULL pointer
2905 '/wd6312', # Possible infinite loop: use of the constant
2906 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2907 '/wd6326', # Potential comparison of constant with constant
2908 '/wd28159', # Consider using 'GetTickCount64'
2909 '/wd28204', # Inconsistent SAL annotations
2910 '/wd28251', # Inconsistent SAL annotations
2911 '/wd28252', # Inconsistent SAL annotations
2912 '/wd28253', # Inconsistent SAL annotations
2913 '/wd28196', # The precondition is not satisfied
2914 '/wd28301', # Inconsistent SAL annotations
2915 '/wd6340', # Sign mismatch in function parameter
2916 '/wd28182', # Dereferencing NULL pointer
2917 # C6285 is ~16% of raw warnings and has low value
2918 '/wd6285', # non-zero constant || non-zero constant
2919 # C6334 is ~80% of raw warnings and has low value
2920 '/wd6334', # sizeof applied to an expression with an operator
2932 ['use_playready==1', {
2934 'PLAYREADY_CDM_AVAILABLE',
2939 ['enable_task_manager==1', {
2941 'ENABLE_TASK_MANAGER=1',
2944 ['enable_extensions==1', {
2946 'ENABLE_EXTENSIONS=1',
2949 ['OS=="win" and branding=="Chrome"', {
2950 'defines': ['ENABLE_SWIFTSHADER'],
2952 ['enable_dart==1', {
2953 'defines': ['WEBKIT_USING_DART=1'],
2956 'defines': ['ENABLE_PDF=1'],
2958 ['enable_plugin_installation==1', {
2959 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2961 ['enable_plugins==1', {
2962 'defines': ['ENABLE_PLUGINS=1'],
2964 ['enable_session_service==1', {
2965 'defines': ['ENABLE_SESSION_SERVICE=1'],
2967 ['enable_themes==1', {
2968 'defines': ['ENABLE_THEMES=1'],
2970 ['enable_autofill_dialog==1', {
2971 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2973 ['enable_prod_wallet_service==1', {
2974 # In GN, this is set on the autofill tagets only. See
2975 # //components/autofill/core/browser:wallet_service
2976 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2978 ['enable_background==1', {
2979 'defines': ['ENABLE_BACKGROUND=1'],
2981 ['enable_google_now==1', {
2982 'defines': ['ENABLE_GOOGLE_NOW=1'],
2984 ['enable_basic_printing==1 or enable_print_preview==1', {
2985 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2986 'defines': ['ENABLE_PRINTING=1'],
2988 ['enable_basic_printing==1', {
2989 # Enable basic printing support and UI.
2990 'defines': ['ENABLE_BASIC_PRINTING=1'],
2992 ['enable_print_preview==1', {
2993 # Enable printing with print preview.
2994 # Can be defined without ENABLE_BASIC_PRINTING.
2995 'defines': ['ENABLE_PRINT_PREVIEW=1'],
2997 ['enable_spellcheck==1', {
2998 'defines': ['ENABLE_SPELLCHECK=1'],
3000 ['use_browser_spellchecker', {
3001 'defines': ['USE_BROWSER_SPELLCHECKER=1'],
3003 ['enable_captive_portal_detection==1', {
3004 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
3006 ['enable_app_list==1', {
3007 'defines': ['ENABLE_APP_LIST=1'],
3009 ['enable_settings_app==1', {
3010 'defines': ['ENABLE_SETTINGS_APP=1'],
3012 ['disable_file_support==1', {
3013 'defines': ['DISABLE_FILE_SUPPORT=1'],
3015 ['disable_ftp_support==1', {
3016 'defines': ['DISABLE_FTP_SUPPORT=1'],
3018 ['enable_supervised_users==1', {
3019 'defines': ['ENABLE_SUPERVISED_USERS=1'],
3021 ['enable_mdns==1', {
3022 'defines': ['ENABLE_MDNS=1'],
3024 ['enable_service_discovery==1', {
3025 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
3027 ['enable_wifi_bootstrapping==1', {
3028 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
3030 ['enable_hangout_services_extension==1', {
3031 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
3033 ['enable_ipc_fuzzer==1', {
3034 'defines': ['ENABLE_IPC_FUZZER=1'],
3037 'defines': ['VIDEO_HOLE=1'],
3039 ['v8_use_external_startup_data==1', {
3040 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
3042 ['enable_webvr==1', {
3043 'defines': ['ENABLE_WEBVR'],
3046 # SAFE_BROWSING_SERVICE - browser manages a safe-browsing service.
3047 # SAFE_BROWSING_DB_LOCAL - service manages a local database.
3048 # SAFE_BROWSING_DB_REMOTE - service talks via API to a database
3049 # SAFE_BROWSING_CSD - enable client-side phishing detection.
3050 ['safe_browsing==1', {
3052 # TODO(nparker): Remove existing uses of FULL_SAFE_BROWSING
3053 'FULL_SAFE_BROWSING',
3054 'SAFE_BROWSING_CSD',
3055 'SAFE_BROWSING_DB_LOCAL',
3056 'SAFE_BROWSING_SERVICE',
3059 ['safe_browsing==2', {
3061 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3062 'MOBILE_SAFE_BROWSING',
3063 'SAFE_BROWSING_SERVICE',
3066 ['safe_browsing==3', {
3068 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3069 'MOBILE_SAFE_BROWSING',
3070 'SAFE_BROWSING_DB_REMOTE',
3071 'SAFE_BROWSING_SERVICE',
3074 ], # conditions for 'target_defaults'
3075 'target_conditions': [
3076 ['<(use_libpci)==1', {
3077 'defines': ['USE_LIBPCI=1'],
3079 ['<(use_openssl)==1', {
3080 'defines': ['USE_OPENSSL=1'],
3082 ['<(use_openssl_certs)==1', {
3083 'defines': ['USE_OPENSSL_CERTS=1'],
3085 ['>(nacl_untrusted_build)==1', {
3088 'USE_OPENSSL_CERTS=1',
3091 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3092 'defines': ['USE_GLIB=1'],
3094 ['<(use_nss_certs)==1 and >(nacl_untrusted_build)==0', {
3095 'defines': ['USE_NSS_CERTS=1'],
3097 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3098 'defines': ['OS_CHROMEOS=1'],
3100 ['enable_wexit_time_destructors==1 and OS!="win"', {
3101 # TODO: Enable on Windows too, http://crbug.com/404525
3102 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3104 ['"<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)"!="245965-1"', {
3105 # TODO(thakis): Move this to the global clang_warning_flags block once
3106 # clang is rolled far enough that the pinned clang understands this flag
3107 # TODO(thakis): Consider enabling this?
3108 'variables': { 'clang_warning_flags': ['-Wno-bitfield-width']},
3110 ['chromium_code==0', {
3112 'clang_warning_flags': [
3113 # TODO(thakis): Move this suppression into individual third-party
3114 # libraries as required. http://crbug.com/505316.
3115 '-Wno-unused-function',
3116 # Lots of third-party libraries have unused variables. Instead of
3117 # suppressing them individually, we just blanket suppress them here.
3118 '-Wno-unused-variable',
3122 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3123 # We don't want to get warnings from third-party code,
3124 # so remove any existing warning-enabling flags like -Wall.
3130 # Don't warn about hash_map in third-party code.
3134 # Don't warn about printf format problems.
3135 # This is off by default in gcc but on in Ubuntu's gcc(!).
3139 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3143 # TODO: Fix all warnings on chromeos too.
3144 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3149 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3151 # Don't warn about ignoring the return value from e.g. close().
3152 # This is off by default in some gccs but on by default in others.
3153 # BSD systems do not support this option, since they are usually
3154 # using gcc 4.2.1, which does not have this flag yet.
3155 '-Wno-unused-result',
3160 '_CRT_SECURE_NO_DEPRECATE',
3161 '_CRT_NONSTDC_NO_WARNINGS',
3162 '_CRT_NONSTDC_NO_DEPRECATE',
3163 '_SCL_SECURE_NO_DEPRECATE',
3165 'msvs_disabled_warnings': [
3169 'VCCLCompilerTool': {
3170 'WarningLevel': '3',
3171 'WarnAsError': 'true',
3172 'Detect64BitPortabilityProblems': 'false',
3176 ['buildtype=="Official"', {
3178 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3181 [ 'component=="shared_library"', {
3182 # TODO(darin): Unfortunately, some third_party code depends on base.
3183 'msvs_disabled_warnings': [
3184 4251, # class 'std::xx' needs to have dll-interface.
3190 [ 'OS=="mac" or OS=="ios"', {
3192 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3195 ['buildtype=="Official"', {
3197 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3204 # TODO(ios): Fix remaining warnings in third-party code, then
3205 # remove this; the Mac cleanup didn't get everything that's
3206 # flagged in an iOS build.
3207 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3208 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3209 # Several internal ios directories generate numerous warnings for
3210 # -Wobjc-missing-property-synthesis.
3211 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3217 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3218 'filename_rules.gypi',
3220 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3221 # C99 macros on Mac and Linux.
3223 '__STDC_CONSTANT_MACROS',
3224 '__STDC_FORMAT_MACROS',
3228 # turn on warnings for signed/unsigned mismatch on chromium code.
3230 'VCCLCompilerTool': {
3231 'AdditionalOptions': ['/we4389'],
3235 ['OS=="win" and component=="shared_library"', {
3236 'msvs_disabled_warnings': [
3237 4251, # class 'std::xx' needs to have dll-interface.
3242 ], # target_conditions for 'target_defaults'
3243 'default_configuration': 'Debug',
3245 # VCLinkerTool LinkIncremental values below:
3247 # 1 == /INCREMENTAL:NO
3249 # Debug links incremental, Release does not.
3251 # Abstract base configurations to cover common attributes.
3255 'msvs_configuration_attributes': {
3256 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3257 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3258 'CharacterSet': '1',
3261 'VCCLCompilerTool': {
3262 'AdditionalOptions': [
3267 # Add the default import libs.
3268 'AdditionalDependencies': [
3285 'AdditionalOptions': [
3286 # Suggested by Microsoft Devrel to avoid
3287 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3288 # which started happening more regularly after VS2013 Update 4.
3289 # Needs to be a bit lower for VS2015, or else errors out.
3290 '/maxilksize:0x7ff00000',
3295 ['OS=="win" and win_fastlink==1', {
3298 # /PROFILE is incompatible with /debug:fastlink
3300 'AdditionalOptions': [
3301 # Tell VS 2015+ to create a PDB that references debug
3302 # information in .obj and .lib files instead of copying
3309 ['OS=="win" and MSVS_VERSION == "2015"', {
3311 'VCCLCompilerTool': {
3312 'AdditionalOptions': [
3313 # Work around crbug.com/526851, bug in VS 2015 RTM compiler.
3314 '/Zc:sizedDealloc-',
3325 'MinimumRequiredVersion': '5.01', # XP.
3326 'TargetMachine': '1',
3328 'VCLibrarianTool': {
3329 'TargetMachine': '1',
3332 'msvs_configuration_platform': 'Win32',
3336 'msvs_configuration_platform': 'x64',
3339 # Make sure to understand http://crbug.com/361720 if you want to
3341 'MinimumRequiredVersion': '5.02', # Server 2003.
3342 'TargetMachine': '17', # x86 - 64
3343 'AdditionalLibraryDirectories!':
3344 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3345 'AdditionalLibraryDirectories':
3346 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3347 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3348 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3350 'VCLibrarianTool': {
3351 'AdditionalLibraryDirectories!':
3352 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3353 'AdditionalLibraryDirectories':
3354 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3355 'TargetMachine': '17', # x64
3362 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3363 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3366 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3368 '<@(debug_extra_cflags)',
3372 'VCCLCompilerTool': {
3373 'Optimization': '<(win_debug_Optimization)',
3374 'PreprocessorDefinitions': ['_DEBUG'],
3375 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3376 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3378 # According to MSVS, InlineFunctionExpansion=0 means
3379 # "default inlining", not "/Ob0".
3380 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3381 ['win_debug_InlineFunctionExpansion==0', {
3382 'AdditionalOptions': ['/Ob0'],
3384 ['win_debug_InlineFunctionExpansion!=""', {
3385 'InlineFunctionExpansion':
3386 '<(win_debug_InlineFunctionExpansion)',
3388 ['win_debug_disable_iterator_debugging==1', {
3389 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3392 # if win_debug_OmitFramePointers is blank, leave as default
3393 ['win_debug_OmitFramePointers==1', {
3394 'OmitFramePointers': 'true',
3396 ['win_debug_OmitFramePointers==0', {
3397 'OmitFramePointers': 'false',
3398 # The above is not sufficient (http://crbug.com/106711): it
3399 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3400 # perform FPO regardless, so we must explicitly disable.
3401 # We still want the false setting above to avoid having
3402 # "/Oy /Oy-" and warnings about overriding.
3403 'AdditionalOptions': ['/Oy-'],
3406 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3409 'LinkIncremental': '<(msvs_debug_link_incremental)',
3410 # ASLR makes debugging with windbg difficult because Chrome.exe and
3411 # Chrome.dll share the same base name. As result, windbg will
3412 # name the Chrome.dll module like chrome_<base address>, where
3413 # <base address> typically changes with each launch. This in turn
3414 # means that breakpoints in Chrome.dll don't stick from one launch
3415 # to the next. For this reason, we turn ASLR off in debug builds.
3416 # Note that this is a three-way bool, where 0 means to pick up
3417 # the default setting, 1 is off and 2 is on.
3418 'RandomizedBaseAddress': 1,
3420 'VCResourceCompilerTool': {
3421 'PreprocessorDefinitions': ['_DEBUG'],
3425 ['OS=="linux" or OS=="android"', {
3426 'target_conditions': [
3427 ['_toolset=="target"', {
3429 '<@(debug_extra_cflags)',
3434 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3435 # Enable libstdc++ debugging facilities to help catch problems
3436 # early, see http://crbug.com/65151 .
3437 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3438 'defines': ['_GLIBCXX_DEBUG=1',],
3440 ['release_valgrind_build==0', {
3443 '-fstack-protector-all', # Implies -fstack-protector
3449 # Allow comparing the address of references and 'this' against 0
3450 # in debug builds. Technically, these can never be null in
3451 # well-defined C/C++ and Clang can optimize such checks away in
3452 # release builds, but they may be used in asserts in debug builds.
3453 '-Wno-undefined-bool-conversion',
3454 '-Wno-tautological-undefined-compare',
3458 '-Wno-undefined-bool-conversion',
3459 '-Wno-tautological-undefined-compare',
3463 'VCCLCompilerTool': {
3464 'AdditionalOptions': [
3465 '-Wno-undefined-bool-conversion',
3466 '-Wno-tautological-undefined-compare',
3479 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3480 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3481 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3484 'VCCLCompilerTool': {
3485 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3487 # In official builds, each target will self-select
3488 # an optimization level.
3489 ['buildtype!="Official"', {
3490 'Optimization': '<(win_release_Optimization)',
3493 # According to MSVS, InlineFunctionExpansion=0 means
3494 # "default inlining", not "/Ob0".
3495 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3496 ['win_release_InlineFunctionExpansion==0', {
3497 'AdditionalOptions': ['/Ob0'],
3499 ['win_release_InlineFunctionExpansion!=""', {
3500 'InlineFunctionExpansion':
3501 '<(win_release_InlineFunctionExpansion)',
3504 # if win_release_OmitFramePointers is blank, leave as default
3505 ['win_release_OmitFramePointers==1', {
3506 'OmitFramePointers': 'true',
3508 ['win_release_OmitFramePointers==0', {
3509 'OmitFramePointers': 'false',
3510 # The above is not sufficient (http://crbug.com/106711): it
3511 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3512 # perform FPO regardless, so we must explicitly disable.
3513 # We still want the false setting above to avoid having
3514 # "/Oy /Oy-" and warnings about overriding.
3515 'AdditionalOptions': ['/Oy-'],
3518 # Put data in separate COMDATs. This allows the linker
3519 # to put bit-identical constants at the same address even if
3520 # they're unrelated constants, which saves binary size.
3521 # This optimization can't be used when ASan is enabled because
3522 # it is not compatible with the ASan ODR checker.
3523 'AdditionalOptions': ['/Gw'],
3526 'AdditionalOptions': [
3527 '/d2Zi+', # Improve debugging of Release builds.
3528 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3529 '<@(win_release_extra_cflags)',
3533 # LinkIncremental is a tri-state boolean, where 0 means default
3534 # (i.e., inherit from parent solution), 1 means false, and
3536 'LinkIncremental': '1',
3537 # This corresponds to the /PROFILE flag which ensures the PDB
3538 # file contains FIXUP information (growing the PDB file by about
3539 # 5%) but does not otherwise alter the output binary. This
3540 # information is used by the Syzygy optimization tool when
3541 # decomposing the release image.
3546 ['msvs_use_common_release', {
3547 'includes': ['release.gypi'],
3549 ['release_valgrind_build==0 and tsan==0', {
3552 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3556 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3557 'MEMORY_SANITIZER_INITIAL_SIZE',
3558 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3559 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3563 'defines': ['NO_TCMALLOC'],
3565 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3566 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3567 # It seems to work fine with Ubuntu 12 headers though, so use it
3568 # in official builds.
3569 ['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")', {
3570 'target_conditions': [
3571 ['chromium_code==1', {
3572 # Non-chromium code is not guaranteed to compile cleanly
3573 # with _FORTIFY_SOURCE. Also, fortified build may fail
3574 # when optimizations are disabled, so only do that for Release
3577 '_FORTIFY_SOURCE=2',
3582 ['OS=="linux" or OS=="android"', {
3583 'target_conditions': [
3584 ['_toolset=="target"', {
3586 '<@(release_extra_cflags)',
3589 ['enable_resource_whitelist_generation==1', {
3591 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3600 'NS_BLOCK_ASSERTIONS=1',
3606 # Concrete configurations
3609 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3612 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3617 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3618 'target_conditions': [
3619 [ '_type=="executable"', {
3620 # To get a real .dSYM bundle produced by dsymutil, set the
3621 # debug information format to dwarf-with-dsym. Since
3622 # strip_from_xcode will not be used, set Xcode to do the
3623 # stripping as well.
3625 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3626 'DEPLOYMENT_POSTPROCESSING': 'YES',
3627 'STRIP_INSTALLED_PRODUCT': 'YES',
3634 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3636 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3639 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3647 'target_defaults': {
3652 # TODO(glider): enable the default options on other systems.
3654 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3656 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3662 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3663 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3664 'target_defaults': {
3666 '-Wl,--fatal-warnings',
3670 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3671 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0 and cfi_diag==0', {
3672 'target_defaults': {
3678 ['os_posix==1 and chromeos==0', {
3679 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3680 # and we want to avoid overriding this, so stack-protector is only
3681 # enabled when not building on Chrome OS.
3682 'target_defaults': {
3684 '--param=ssp-buffer-size=4',
3689 '-fstack-protector-strong',
3692 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3695 '-fstack-protector',
3701 ['os_posix==1 and OS=="linux"', {
3703 '_LARGEFILE_SOURCE',
3704 '_LARGEFILE64_SOURCE',
3705 '_FILE_OFFSET_BITS=64',
3708 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3709 'target_defaults': {
3710 # Enable -Werror by default, but put it in a variable so it can
3711 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3713 'werror%': '-Werror',
3714 'libraries_for_target%': '',
3717 '_FILE_OFFSET_BITS=64',
3720 '<(werror)', # See note above about the werror variable.
3722 '-fno-strict-aliasing', # See http://crbug.com/32204
3724 # Don't warn about unused function params. We use those everywhere.
3725 '-Wno-unused-parameter',
3726 # Don't warn about the "struct foo f = {0};" initialization pattern.
3727 '-Wno-missing-field-initializers',
3728 # Don't export any symbols (for example, to plugins we dlopen()).
3729 # Note: this is *required* to make some plugins work.
3730 '-fvisibility=hidden',
3736 '-fno-threadsafe-statics',
3737 # Make inline functions have hidden visiblity by default.
3738 # Surprisingly, not covered by -fvisibility=hidden.
3739 '-fvisibility-inlines-hidden',
3740 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3741 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3745 '-pthread', '-Wl,-z,noexecstack',
3748 '<(libraries_for_target)',
3753 'debug_optimize%': '0',
3759 '-O>(debug_optimize)',
3763 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3764 # TODO(jdduke) Re-enable on mips after resolving linking
3765 # issues with libc++ (crbug.com/456380).
3767 # Warn in case of text relocations.
3768 '-Wl,--warn-shared-textrel',
3771 ['OS=="android" and android_full_debug==0', {
3772 # Some configurations are copied from Release_Base to reduce
3775 'debug_optimize%': 's',
3779 '-ffunction-sections',
3786 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3787 # We don't omit frame pointers on arm64 since they are required
3788 # to correctly unwind stackframes which contain system library
3789 # function frames (crbug.com/391706).
3791 '-fomit-frame-pointer',
3794 ['OS=="linux" and target_arch=="ia32"', {
3796 '-Wl,--no-as-needed',
3799 ['debug_unwind_tables==1', {
3800 'cflags': ['-funwind-tables'],
3802 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3803 'defines': ['NO_UNWIND_TABLES'],
3805 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3806 # definitions in to the right scope to use them when setting
3807 # linux_use_debug_fission, so it can be used here alone.
3808 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3809 'cflags': ['-gsplit-dwarf'],
3815 'release_optimize%': '2',
3816 # Binaries become big and gold is unable to perform GC
3817 # and remove unused sections for some of test targets
3818 # on 32 bit platform.
3819 # (This is currently observed only in chromeos valgrind bots)
3820 # The following flag is to disable --gc-sections linker
3821 # option for these bots.
3822 'no_gc_sections%': 0,
3824 # TODO(bradnelson): reexamine how this is done if we change the
3825 # expansion of configurations
3826 'release_valgrind_build%': 0,
3829 '-O<(release_optimize)',
3830 # Don't emit the GCC version ident directives, they just end up
3831 # in the .comment section taking up binary size.
3833 # Put data and code in their own sections, so that unused symbols
3834 # can be removed at link time with --gc-sections.
3836 '-ffunction-sections',
3839 # Specifically tell the linker to perform optimizations.
3840 # See http://lwn.net/Articles/192624/ .
3845 ['no_gc_sections==0', {
3847 '-Wl,--gc-sections',
3850 ['OS=="android" and target_arch!="arm64"', {
3851 # We don't omit frame pointers on arm64 since they are required
3852 # to correctly unwind stackframes which contain system library
3853 # function frames (crbug.com/391706).
3855 '-fomit-frame-pointer',
3858 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3859 # TODO(jdduke) Re-enable on mips after resolving linking
3860 # issues with libc++ (crbug.com/456380).
3862 # Warn in case of text relocations.
3863 '-Wl,--warn-shared-textrel',
3868 'release_optimize%': 's',
3873 '-fno-omit-frame-pointer',
3877 ['profiling_full_stack_frames==1', {
3880 '-fno-optimize-sibling-calls',
3885 ['release_unwind_tables==1', {
3886 'cflags': ['-funwind-tables'],
3888 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3889 'defines': ['NO_UNWIND_TABLES'],
3895 ['target_arch=="ia32"', {
3896 'target_conditions': [
3897 ['_toolset=="target"', {
3899 # Needed so that libs with .s files (e.g. libicudata.a)
3900 # are compatible with the general 32-bit-ness.
3903 # All floating-point computations on x87 happens in 80-bit
3904 # precision. Because the C and C++ language standards allow
3905 # the compiler to keep the floating-point values in higher
3906 # precision than what's specified in the source and doing so
3907 # is more efficient than constantly rounding up to 64-bit or
3908 # 32-bit precision as specified in the source, the compiler,
3909 # especially in the optimized mode, tries very hard to keep
3910 # values in x87 floating-point stack (in 80-bit precision)
3911 # as long as possible. This has important side effects, that
3912 # the real value used in computation may change depending on
3913 # how the compiler did the optimization - that is, the value
3914 # kept in 80-bit is different than the value rounded down to
3915 # 64-bit or 32-bit. There are possible compiler options to
3916 # make this behavior consistent (e.g. -ffloat-store would keep
3917 # all floating-values in the memory, thus force them to be
3918 # rounded to its original precision) but they have significant
3919 # runtime performance penalty.
3921 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3922 # which keep floating-point values in SSE registers in its
3923 # native precision (32-bit for single precision, and 64-bit
3924 # for double precision values). This means the floating-point
3925 # value used during computation does not change depending on
3926 # how the compiler optimized the code, since the value is
3927 # always kept in its specified precision.
3929 # Refer to http://crbug.com/348761 for rationale behind SSE2
3930 # being a minimum requirement for 32-bit Linux builds and
3931 # http://crbug.com/313032 for an example where this has "bit"
3936 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3943 # Use gold linker for Android ia32 target.
3945 # Use gold linker for Android ia32 target.
3949 # Use -mstackrealign due to a bug on ia32 Jelly Bean.
3950 # See crbug.com/521527
3959 ['target_arch=="x64"', {
3960 'target_conditions': [
3961 ['_toolset=="target"', {
3963 # Use gold linker for Android x64 target.
3980 ['target_arch=="arm"', {
3981 'target_conditions': [
3982 ['_toolset=="target"', {
3986 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3987 # has changed whenever it encounters a varargs function. This
3988 # silences those warnings, as they are not helpful and
3989 # clutter legitimate warnings.
3993 ['clang==1 and arm_arch!="" and OS!="android"', {
3995 '-target arm-linux-gnueabihf',
3998 '-target arm-linux-gnueabihf',
4003 '-march=<(arm_arch)',
4006 ['use_lto==1 or use_lto_o2==1', {
4008 '-march=<(arm_arch)',
4013 ['clang==1 and OS!="android"', {
4015 # We need to disable clang's builtin assembler as it can't
4016 # handle several asm files, crbug.com/124610
4017 '-no-integrated-as',
4022 '-mtune=<(arm_tune)',
4025 ['use_lto==1 or use_lto_o2==1', {
4027 '-mtune=<(arm_tune)',
4037 ['use_lto==1 or use_lto_o2==1', {
4044 ['arm_float_abi!=""', {
4046 '-mfloat-abi=<(arm_float_abi)',
4049 ['use_lto==1 or use_lto_o2==1', {
4051 '-mfloat-abi=<(arm_float_abi)',
4061 ['use_lto==1 or use_lto_o2==1', {
4069 # Most of the following flags are derived from what Android
4070 # uses by default when building for arm, reference for which
4071 # can be found in the following file in the Android NDK:
4072 # toolchains/arm-linux-androideabi-4.9/setup.mk
4074 # The tree-sra optimization (scalar replacement for
4075 # aggregates enabling subsequent optimizations) leads to
4076 # invalid code generation when using the Android NDK's
4077 # compiler (r5-r7). This can be verified using
4078 # webkit_unit_tests' WTF.Checked_int8_t test.
4080 # The following option is disabled to improve binary
4081 # size and performance in gcc 4.9.
4082 '-fno-caller-saves',
4085 # Android now supports .relro sections properly.
4086 # NOTE: While these flags enable the generation of .relro
4087 # sections, the generated libraries can still be loaded on
4088 # older Android platform versions.
4095 ['gcc_version==48 and clang==0', {
4097 # The following 5 options are disabled to save on
4098 # binary size in GCC 4.8.
4099 '-fno-partial-inlining',
4100 '-fno-early-inlining',
4101 '-fno-tree-copy-prop',
4102 '-fno-tree-loop-optimize',
4103 '-fno-move-loop-invariants',
4107 'cflags': [ '-mthumb-interwork' ],
4111 # Thumb code with frame pointer makes chrome crash
4114 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
4115 # The perf report sometimes incorrectly attributes
4116 # code from tail calls.
4117 '-fno-optimize-sibling-calls',
4120 '-fomit-frame-pointer',
4125 # Clang does not support the following options.
4127 '-mthumb-interwork',
4128 '-finline-limit=64',
4130 '-fno-caller-saves',
4134 # TODO(hans) Enable integrated-as (crbug.com/124610).
4135 '-no-integrated-as',
4136 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4139 ['clang==1 and linux_use_bundled_gold==0', {
4141 # Let clang find the ld.gold in the NDK.
4142 '--gcc-toolchain=<(android_toolchain)/..',
4147 '-marm', # Required for frame pointer based stack traces.
4154 # We set arm_arch to "" so that -march compiler option
4155 # is not set. Otherwise a gcc bug that would complain
4156 # about it conflicting with '-mcpu=cortex-a9'. The flag
4157 # '-march=armv7-a' is actually redundant anyway because
4158 # it is enabled by default when we built the toolchain.
4159 # And using '-mcpu=cortex-a9' should be sufficient.
4162 # Breakpad requires symbols with debugging information
4166 # We want to statically link libstdc++/libgcc_s.
4167 '-static-libstdc++',
4171 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4172 # define their own cflags for arm builds that could
4173 # conflict with the flags we set here (e.g.
4174 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4183 ['target_arch=="arm64"', {
4184 'target_conditions': [
4185 ['_toolset=="target"', {
4189 '-fstack-protector', # stack protector is always enabled on arm64.
4196 ['target_arch=="mipsel"', {
4197 'target_conditions': [
4198 ['_toolset=="target"', {
4200 ['mips_arch_variant=="r6"', {
4203 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ],
4204 'ldflags': [ '-target mipsel-linux-gnu', ],
4206 'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
4208 ['clang==0 and OS=="android"', {
4209 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4213 ['mips_arch_variant=="r2"', {
4215 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4216 'cflags': ['-m<(mips_fpu_mode)'],
4221 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
4222 'ldflags': [ '-target mipsel-linux-android', ],
4224 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32r2'],
4225 'ldflags': [ '-target mipsel-linux-gnu', ],
4229 'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
4233 ['mips_arch_variant=="r1"', {
4238 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
4239 'ldflags': [ '-target mipsel-linux-android', ],
4241 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32'],
4242 'ldflags': [ '-target mipsel-linux-gnu', ],
4246 'cflags': ['-mips32', '-Wa,-mips32', ],
4252 # Clang does not support the following options.
4253 '-finline-limit=64',
4256 # TODO(gordanac) Enable integrated-as.
4257 '-no-integrated-as',
4260 ['clang==1 and OS=="android"', {
4262 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4265 # Let clang find the ld in the NDK.
4266 '--gcc-toolchain=<(android_toolchain)/..',
4269 ['mips_dsp_rev==1', {
4270 'cflags': ['-mdsp'],
4272 ['mips_dsp_rev==2', {
4273 'cflags': ['-mdspr2'],
4277 '-m<(mips_float_abi)-float'
4280 '-Wl,--no-keep-memory'
4283 '-Wno-uninitialized',
4288 ['target_arch=="mips64el"', {
4289 'target_conditions': [
4290 ['_toolset=="target"', {
4292 ['mips_arch_variant=="r6"', {
4293 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4294 'ldflags': ['-mips64r6'],
4296 ['mips_arch_variant=="r2"', {
4297 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4298 'ldflags': ['-mips64r2'],
4302 '-Wno-uninitialized',
4316 'target_conditions': [
4317 ['_toolset=="target"', {
4319 '--sysroot=<(sysroot)',
4322 '--sysroot=<(sysroot)',
4323 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4329 # TODO(thakis): Remove, http://crbug.com/263960
4330 '-Wno-reserved-user-defined-literal',
4333 # gnu++11 instead of c++11 is needed because some code uses
4334 # typeof() (a GNU extension).
4335 # TODO(thakis): Eventually switch this to c++11 instead,
4336 # http://crbug.com/427584
4340 ['clang==0 and host_clang==1', {
4341 'target_conditions': [
4342 ['_toolset=="host"', {
4343 'cflags_cc': [ '-std=gnu++11', ],
4347 ['clang==1 and clang_use_chrome_plugins==1', {
4349 '<@(clang_chrome_plugins_flags)',
4352 ['clang==1 and clang_load!=""', {
4354 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4357 ['clang==1 and clang_add_plugin!=""', {
4359 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4362 ['clang==1 and target_arch=="ia32"', {
4364 # Else building libyuv gives clang's register allocator issues,
4365 # see llvm.org/PR15798 / crbug.com/233709
4366 '-momit-leaf-frame-pointer',
4367 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4368 '-mstack-alignment=16',
4372 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4374 # See http://crbug.com/110262
4375 '-fcolor-diagnostics',
4378 # Common options for AddressSanitizer, LeakSanitizer,
4379 # ThreadSanitizer, MemorySanitizer and non-official CFI builds.
4380 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1 or '
4381 '(cfi_vptr==1 and buildtype!="Official")', {
4382 'target_conditions': [
4383 ['_toolset=="target"', {
4385 '-fno-omit-frame-pointer',
4386 '-gline-tables-only',
4389 '-fomit-frame-pointer',
4394 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4395 'target_conditions': [
4396 ['_toolset=="target"', {
4398 # Functions interposed by the sanitizers can make ld think
4399 # that some libraries aren't needed when they actually are,
4400 # http://crbug.com/234010. As workaround, disable --as-needed.
4404 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4405 'MEMORY_SANITIZER_INITIAL_SIZE',
4411 'target_conditions': [
4412 ['_toolset=="target"', {
4414 '-fsanitize=address',
4415 # TODO(earthdok): Re-enable. http://crbug.com/427202
4416 #'-fsanitize-blacklist=<(asan_blacklist)',
4419 '-fsanitize=address',
4426 '-mllvm -asan-globals=0', # http://crbug.com/352073
4432 'target_conditions': [
4433 ['_toolset=="target"', {
4435 # FIXME: work on enabling more flags and getting rid of false
4436 # positives. http://crbug.com/174801.
4437 '-fsanitize=bounds',
4438 '-fsanitize=float-divide-by-zero',
4439 '-fsanitize=integer-divide-by-zero',
4441 '-fsanitize=object-size',
4442 '-fsanitize=return',
4443 '-fsanitize=returns-nonnull-attribute',
4444 '-fsanitize=shift-exponent',
4445 '-fsanitize=signed-integer-overflow',
4446 '-fsanitize=unreachable',
4447 '-fsanitize=vla-bound',
4448 '-fsanitize-blacklist=<(ubsan_blacklist)',
4449 # Employ the experimental PBQP register allocator to avoid
4450 # slow compilation on files with too many basic blocks.
4451 # See http://crbug.com/426271.
4452 '-mllvm -regalloc=pbqp',
4453 # Speculatively use coalescing to slightly improve the code
4454 # generated by PBQP regallocator. May increase compile time.
4455 '-mllvm -pbqp-coalescing',
4464 '-fsanitize=undefined',
4467 'UNDEFINED_SANITIZER',
4473 'target_conditions': [
4474 ['_toolset=="target"', {
4477 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4489 'UNDEFINED_SANITIZER',
4494 ['asan_coverage!=0 and sanitizer_coverage==0', {
4495 'target_conditions': [
4496 ['_toolset=="target"', {
4498 '-fsanitize-coverage=<(asan_coverage)',
4501 'SANITIZER_COVERAGE',
4506 ['sanitizer_coverage!=0', {
4507 'target_conditions': [
4508 ['_toolset=="target"', {
4510 '-fsanitize-coverage=<(sanitizer_coverage)',
4513 'SANITIZER_COVERAGE',
4518 ['(asan_coverage>1 or sanitizer_coverage>1) and target_arch=="arm"', {
4519 'target_conditions': [
4520 ['_toolset=="target"', {
4522 '-mllvm -sanitizer-coverage-block-threshold=0', # http://crbug.com/517105
4527 ['asan_field_padding!=0', {
4528 'target_conditions': [
4529 ['_toolset=="target"', {
4531 '-fsanitize-address-field-padding=<(asan_field_padding)',
4537 'target_conditions': [
4538 ['_toolset=="target"', {
4547 'WTF_USE_LEAK_SANITIZER=1',
4553 'target_conditions': [
4554 ['_toolset=="target"', {
4556 '-fsanitize=thread',
4557 '-fsanitize-blacklist=<(tsan_blacklist)',
4560 '-fsanitize=thread',
4564 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4565 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4571 'target_conditions': [
4572 ['_toolset=="target"', {
4574 '-fsanitize=memory',
4575 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4576 '-fsanitize-blacklist=<(msan_blacklist)',
4579 '-fsanitize=memory',
4587 ['use_instrumented_libraries==1', {
4589 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4592 ['use_prebuilt_instrumented_libraries==1', {
4594 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
4597 ['use_custom_libcxx==1', {
4599 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4602 ['order_profiling!=0 and OS=="android"', {
4603 'target_conditions' : [
4604 # crazy_linker has an upstream gyp file we can't edit, and we
4605 # don't want to instrument it.
4606 ['_toolset=="target" and _target_name!="crazy_linker"', {
4608 '-finstrument-functions',
4609 # Allow mmx intrinsics to inline, so that the
4610 # compiler can expand the intrinsics.
4611 '-finstrument-functions-exclude-file-list=mmintrin.h',
4613 'defines': ['CYGPROFILE_INSTRUMENTATION'],
4615 ['_toolset=="target"', {
4617 # Avoids errors with current NDK:
4618 # "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"
4619 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4624 ['linux_dump_symbols==1', {
4627 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4628 'target_conditions': [
4629 ['_toolset=="target"', {
4631 # Attempt to use less memory to prevent the linker from
4632 # running out of address space. Considering installing a
4633 # 64-bit kernel and switching to a 64-bit linker.
4634 '-Wl,--no-keep-memory',
4641 ['use_allocator!="tcmalloc"', {
4642 'defines': ['NO_TCMALLOC'],
4644 ['linux_use_gold_flags==1', {
4645 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4647 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4648 'ldflags': [ '-fuse-ld=gold', ],
4650 'target_conditions': [
4651 ['_toolset=="target"', {
4653 # Experimentation found that using four linking threads
4654 # saved ~20% of link time.
4655 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4656 # Only apply this to the target linker, since the host
4657 # linker might not be gold, but isn't used much anyway.
4658 # TODO(raymes): Disable threading because gold is frequently
4659 # crashing on the bots: crbug.com/161942.
4661 # '-Wl,--thread-count=4',
4664 # TODO(thestig): Enable this for disabled cases.
4665 [ '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', {
4667 '-Wl,--detect-odr-violations',
4674 ['release_valgrind_build==0 and order_profiling==0 and asan==0 and msan==0 and lsan==0 and tsan==0', {
4675 'target_conditions': [
4676 ['_toolset=="target"', {
4678 '-Wl,--icf=<(gold_icf_level)',
4685 ['linux_use_bundled_binutils==1', {
4687 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4690 ['linux_use_bundled_gold==1 and '
4691 'not (clang==0 and (use_lto==1 or use_lto_o2==1))', {
4692 # Put our binutils, which contains gold in the search path. We pass
4693 # the path to gold to the compiler. gyp leaves unspecified what the
4694 # cwd is when running the compiler, so the normal gyp path-munging
4695 # fails us. This hack gets the right path.
4697 # Disabled when using GCC LTO because GCC also uses the -B search
4698 # path at link time to find "as", and our bundled "as" can only
4701 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4704 # Some binutils 2.23 releases may or may not have new dtags enabled,
4705 # but they are all compatible with --disable-new-dtags,
4706 # because the new dynamic tags are not created by default.
4707 ['binutils_version>=223', {
4708 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4709 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4710 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4711 # inside this file to allow usage of --no-as-needed and removal of
4714 '-Wl,--disable-new-dtags',
4717 ['gcc_version>=47 and clang==0', {
4718 'target_conditions': [
4719 ['_toolset=="target"', {
4722 # See comment for -Wno-c++11-narrowing.
4724 # TODO(thakis): Remove, http://crbug.com/263960
4725 '-Wno-literal-suffix',
4730 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4731 'target_conditions': [
4732 ['_toolset=="host"', {
4735 # See comment for -Wno-c++11-narrowing.
4737 # TODO(thakis): Remove, http://crbug.com/263960
4738 '-Wno-literal-suffix',
4746 # FreeBSD-specific options; note that most FreeBSD options are set above,
4749 'target_defaults': {
4751 '-Wl,--no-keep-memory',
4755 # Android-specific options; note that most are set above with Linux.
4758 # This is a unique identifier for a given build. It's used for
4759 # identifying various build artifacts corresponding to a particular
4760 # build of chrome (e.g. where to find archived symbols).
4761 'chrome_build_id%': '',
4763 # Placing this variable here prevents from forking libvpx, used
4764 # by remoting. Remoting is off, so it needn't built,
4765 # so forking it's deps seems like overkill.
4766 # But this variable need defined to properly run gyp.
4767 # A proper solution is to have an OS==android conditional
4768 # in third_party/libvpx/libvpx.gyp to define it.
4769 'libvpx_path': 'lib/linux/arm',
4771 'target_defaults': {
4773 'release_extra_cflags%': '',
4775 # If we're using the components build, append "cr" to all shared
4776 # libraries to avoid naming collisions with android system library
4777 # versions with the same name (e.g. skia, icu).
4778 ['component=="shared_library"', {
4779 'android_product_extension': 'cr.so',
4781 'android_product_extension': 'so',
4785 'target_conditions': [
4786 ['_type=="shared_library"', {
4787 'product_extension': '<(android_product_extension)',
4790 # Settings for building device targets using Android's toolchain.
4791 # These are based on the setup.mk file from the Android NDK.
4793 # The NDK Android executable link step looks as follows:
4795 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4796 # $(PRIVATE_OBJECTS) <-- The .o that we built
4797 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4798 # $(TARGET_LIBGCC) <-- libgcc.a
4799 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4800 # $(PRIVATE_LDLIBS) <-- System .so
4801 # $(TARGET_CRTEND_O) <-- crtend.o
4803 # For now the above are approximated for executables by adding
4804 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4807 # The NDK Android shared library link step looks as follows:
4809 # $(PRIVATE_OBJECTS) <-- The .o that we built
4810 # -l,--whole-archive
4811 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4812 # -l,--no-whole-archive
4813 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4814 # $(TARGET_LIBGCC) <-- libgcc.a
4815 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4816 # $(PRIVATE_LDLIBS) <-- System .so
4818 # For now, assume that whole static libraries are not needed.
4820 # For both executables and shared libraries, add the proper
4821 # libgcc.a to the start of libraries which puts it in the
4822 # proper spot after .o and .a files get linked in.
4824 # TODO: The proper thing to do longer-tem would be proper gyp
4825 # support for a custom link command line.
4826 ['_toolset=="target"', {
4828 '-pthread', # Not supported by Android toolchain.
4831 '-ffunction-sections',
4834 '-fstack-protector',
4836 '-finline-limit=64',
4837 '<@(release_extra_cflags)',
4838 '--sysroot=<(android_ndk_sysroot)',
4839 # NOTE: The libc++ header include paths below are specified in
4840 # cflags rather than include_dirs because they need to come
4841 # after include_dirs.
4842 # The include ordering here is important; change with caution.
4843 '-isystem<(android_libcpp_include)',
4844 '-isystem<(android_ndk_root)/sources/cxx-stl/llvm-libc++abi/libcxxabi/include',
4845 '-isystem<(android_ndk_root)/sources/android/support/include',
4849 '__GNU_SOURCE=1', # Necessary for clone()
4850 'CHROME_BUILD_ID="<(chrome_build_id)"',
4851 # The NDK has these things, but doesn't define the constants
4852 # to say that it does. Define them here instead.
4856 '-pthread', # Not supported by Android toolchain.
4859 '-Wl,--build-id=sha1',
4860 '-Wl,--no-undefined',
4861 '--sysroot=<(android_ndk_sysroot)',
4863 '-L<(android_libcpp_libs_dir)',
4864 # Don't allow visible symbols from libgcc or libc++ to be
4866 '-Wl,--exclude-libs=libgcc.a',
4867 '-Wl,--exclude-libs=libc++_static.a',
4868 # Don't allow visible symbols from libraries that contain
4869 # assembly code with symbols that aren't hidden properly.
4870 # http://crbug.com/448386
4871 '-Wl,--exclude-libs=libcommon_audio.a',
4872 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4873 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4874 '-Wl,--exclude-libs=libiSACFix.a',
4875 '-Wl,--exclude-libs=libisac_neon.a',
4876 '-Wl,--exclude-libs=libopus.a',
4877 '-Wl,--exclude-libs=libvpx.a',
4880 '-l<(android_libcpp_library)',
4882 # Manually link the libgcc.a that the cross compiler uses.
4883 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4889 ['component=="static_library"', {
4890 'target_conditions': [
4891 ['use_native_jni_exports==0', {
4892 # Use a linker version script to strip JNI exports from
4893 # binaries which have not specifically asked to use them.
4895 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4902 # Clang with libc++ does not require an explicit atomic
4903 # library reference.
4907 # Work around incompatibilities between bionic and clang
4909 '-D__compiler_offsetof=__builtin_offsetof',
4910 '-Dnan=__builtin_nan',
4913 # Clang does not support the following options.
4914 '-finline-limit=64',
4917 ['target_arch=="arm"', {
4919 '-target arm-linux-androideabi',
4922 '-target arm-linux-androideabi',
4925 ['target_arch=="ia32"', {
4927 '-target i686-linux-androideabi',
4930 '-target i686-linux-androideabi',
4933 # Place holder for x64 support, not tested.
4934 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4935 ['target_arch=="x64"', {
4937 '-target x86_64-linux-androideabi',
4940 '-target x86_64-linux-androideabi',
4947 # Android build relies on -Wl,--gc-sections removing
4948 # unreachable code. ASan instrumentation for globals inhibits
4949 # this and results in a library with unresolvable relocations.
4950 # TODO(eugenis): find a way to reenable this.
4951 '-mllvm -asan-globals=0',
4954 ['target_arch == "arm" and order_profiling==0', {
4956 # Enable identical code folding to reduce size.
4957 '-Wl,--icf=<(gold_icf_level)',
4960 ['target_arch=="ia32"', {
4961 # The x86 toolchain currently has problems with stack-protector.
4963 '-fstack-protector',
4966 '-fno-stack-protector',
4970 'target_conditions': [
4971 ['_type=="executable"', {
4972 # Force android tools to export the "main" symbol so they can be
4973 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4974 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4975 # when ICS support will be dropped.
4978 '-fvisibility=default',
4982 '-Wl,--gc-sections',
4983 '-Wl,-z,nocopyreloc',
4986 # crtbegin_dynamic.o should be the last item in ldflags.
4987 '<(android_ndk_lib)/crtbegin_dynamic.o',
4990 # crtend_android.o needs to be the last item in libraries.
4991 # Do not add any libraries after this!
4992 '<(android_ndk_lib)/crtend_android.o',
4995 ['_type=="shared_library" or _type=="loadable_module"', {
4997 '-Wl,-shared,-Bsymbolic',
4998 # crtbegin_so.o should be the last item in ldflags.
4999 '<(android_ndk_lib)/crtbegin_so.o',
5002 # crtend_so.o needs to be the last item in libraries.
5003 # Do not add any libraries after this!
5004 '<(android_ndk_lib)/crtend_so.o',
5009 # Settings for building host targets using the system toolchain.
5010 ['_toolset=="host"', {
5012 # Due to issues in Clang build system, using ASan on 32-bit
5013 # binaries on x86_64 host is problematic.
5014 # TODO(eugenis): re-enable.
5015 '-fsanitize=address',
5018 '-fsanitize=address',
5019 '-Wl,-z,noexecstack',
5020 '-Wl,--gc-sections',
5023 '-Wl,--warn-shared-textrel',
5024 '-Wl,--fatal-warnings',
5027 # Settings for building host targets on mac.
5028 ['_toolset=="host" and host_os=="mac"', {
5038 'cflags!': ['-fvisibility=hidden'],
5039 'cflags_cc!': ['-fvisibility-inlines-hidden'],
5041 ['OS=="mac" or OS=="ios"', {
5042 'target_defaults': {
5045 'ALWAYS_SEARCH_USER_PATHS': 'NO',
5046 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
5047 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
5048 'COPY_PHASE_STRIP': 'NO',
5049 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
5050 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
5051 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
5052 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
5053 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
5054 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
5055 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
5056 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
5057 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
5058 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
5059 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
5060 'GCC_VERSION': '4.2',
5061 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
5062 'USE_HEADERMAP': 'NO',
5067 # Don't warn about unused function parameters.
5068 '-Wno-unused-parameter',
5069 # Don't warn about the "struct foo f = {0};" initialization
5071 '-Wno-missing-field-initializers',
5074 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
5075 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
5077 # Note that the prebuilt Clang binaries should not be used for iOS
5078 # development except for ASan builds.
5080 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
5081 # Warn if automatic synthesis is triggered with
5082 # the -Wobjc-missing-property-synthesis flag.
5083 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
5084 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
5086 # This warns on selectors from Cocoa headers (-length, -set).
5087 # cfe-dev is currently discussing the merits of this warning.
5088 # TODO(thakis): Reevaluate what to do with this, based one
5089 # cfe-dev discussion.
5090 '-Wno-selector-type-mismatch',
5093 ['clang_xcode==0', {
5094 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
5095 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
5099 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
5101 '<@(clang_chrome_plugins_flags)',
5104 ['clang==1 and clang_xcode==0 and clang_load!=""', {
5106 '-Xclang', '-load', '-Xclang', '<(clang_load)',
5109 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
5111 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
5114 ['clang==1 and "<(GENERATOR)"=="ninja"', {
5116 # See http://crbug.com/110262
5117 '-fcolor-diagnostics',
5120 ['OS=="ios" and target_subarch!="arm32" and \
5121 "<(GENERATOR)"=="xcode"', {
5123 # TODO(ios): when building Chrome for iOS on 64-bit platform
5124 # with Xcode, the -Wshorted-64-to-32 warning is automatically
5125 # enabled. This cause failures when compiling protobuf code,
5126 # so disable the warning. http://crbug.com/359107
5127 '-Wno-shorten-64-to-32',
5135 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
5141 '-fsanitize=address',
5142 '-mllvm -asan-globals=0', # http://crbug.com/352073
5143 '-gline-tables-only',
5147 ['asan_coverage!=0 and sanitizer_coverage==0', {
5148 'target_conditions': [
5149 ['_toolset=="target"', {
5151 '-fsanitize-coverage=<(asan_coverage)',
5154 'SANITIZER_COVERAGE',
5159 ['sanitizer_coverage!=0', {
5160 'target_conditions': [
5161 ['_toolset=="target"', {
5163 '-fsanitize-coverage=<(sanitizer_coverage)',
5166 'SANITIZER_COVERAGE',
5172 'target_conditions': [
5173 ['_type!="static_library"', {
5174 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5179 '-fsanitize=address',
5183 ['mac_write_linker_maps==1', {
5186 '-Wl,-map,>(_target_name).map',
5193 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5194 'target_conditions': [
5195 ['_type=="executable"', {
5201 # Define copy_asan_dylib_path in a variable ending in
5202 # _path so that gyp understands it's a path and
5203 # performs proper relativization during dict merging.
5204 'copy_asan_dylib_path':
5205 'mac/copy_asan_runtime_dylib.sh',
5207 'postbuild_name': 'Copy ASan runtime dylib',
5209 '<(copy_asan_dylib_path)',
5218 ], # target_conditions
5219 }, # target_defaults
5220 }], # OS=="mac" or OS=="ios"
5222 'target_defaults': {
5224 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5225 # with common names, like 'check', 'require', and 'verify'.
5226 # (Included by system header. Also exists on iOS but not included.)
5227 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5228 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5231 # These should end with %, but there seems to be a bug with % in
5232 # variables that are intended to be set to different values in
5233 # different targets, like these.
5234 'mac_pie': 1, # Most executables can be position-independent.
5235 # Strip debugging symbols from the target.
5236 'mac_strip': '<(mac_strip_release)',
5240 ['mac_want_real_dsym=="default"', {
5243 'mac_real_dsym': '<(mac_want_real_dsym)'
5248 ['mac_want_real_dsym=="default"', {
5249 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5251 'mac_real_dsym': '<(mac_want_real_dsym)'
5260 ['branding=="Chrome" and buildtype=="Official"', {
5263 # The Google Chrome Framework dSYM generated by dsymutil has
5264 # grown larger than 4GB, which dsymutil can't handle. Reduce
5265 # the amount of debug symbols.
5266 '-fno-standalone-debug', # See http://crbug.com/479841
5271 }, # configuration "Release"
5274 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5275 # (Equivalent to -fPIC)
5276 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5277 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5278 # Keep pch files below xcodebuild/.
5279 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5281 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5282 # xcode_setting, but not until all downstream projects' mac bots are
5283 # using xcode >= 4.6, because that's when the default value of the
5284 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5285 # setting is a no-op as far as xcode is concerned, but the compiler
5286 # behaves differently based on whether -fno-strict-aliasing is
5288 '-fno-strict-aliasing', # See http://crbug.com/32204.
5291 'target_conditions': [
5292 ['_type=="executable"', {
5295 # Arranges for data (heap) pages to be protected against
5296 # code execution when running on Mac OS X 10.7 ("Lion"), and
5297 # ensures that the position-independent executable (PIE) bit
5298 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5300 # Define change_mach_o_flags in a variable ending in _path
5301 # so that GYP understands it's a path and performs proper
5302 # relativization during dict merging.
5303 'change_mach_o_flags_path':
5304 'mac/change_mach_o_flags_from_xcode.sh',
5305 'change_mach_o_flags_options%': [
5307 'target_conditions': [
5308 ['mac_pie==0 or release_valgrind_build==1', {
5309 # Don't enable PIE if it's unwanted. It's unwanted if
5310 # the target specifies mac_pie=0 or if building for
5311 # Valgrind, because Valgrind doesn't understand slide.
5312 # See the similar mac_pie/release_valgrind_build check
5314 'change_mach_o_flags_options': [
5320 'postbuild_name': 'Change Mach-O Flags',
5322 '<(change_mach_o_flags_path)',
5323 '>@(change_mach_o_flags_options)',
5327 'target_conditions': [
5328 ['mac_pie==1 and release_valgrind_build==0', {
5329 # Turn on position-independence (ASLR) for executables. When
5330 # PIE is on for the Chrome executables, the framework will
5331 # also be subject to ASLR.
5332 # Don't do this when building for Valgrind, because Valgrind
5333 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5334 # understand slide, and get rid of the Valgrind check.
5337 '-Wl,-pie', # Position-independent executable (MH_PIE)
5343 ['(_type=="executable" or _type=="shared_library" or \
5344 _type=="loadable_module") and mac_strip!=0', {
5345 'target_conditions': [
5346 ['mac_real_dsym == 1', {
5347 # To get a real .dSYM bundle produced by dsymutil, set the
5348 # debug information format to dwarf-with-dsym. Since
5349 # strip_from_xcode will not be used, set Xcode to do the
5350 # stripping as well.
5354 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5355 'DEPLOYMENT_POSTPROCESSING': 'YES',
5356 'STRIP_INSTALLED_PRODUCT': 'YES',
5358 # Only strip non-ASan builds.
5360 'target_conditions': [
5361 ['_type=="shared_library" or _type=="loadable_module"', {
5362 # The Xcode default is to strip debugging symbols
5363 # only (-S). Local symbols should be stripped as
5364 # well, which will be handled by -x. Xcode will
5365 # continue to insert -S when stripping even when
5366 # additional flags are added with STRIPFLAGS.
5368 }], # _type=="shared_library" or _type=="loadable_module"
5369 ], # target_conditions
5375 }, # configuration "Release"
5377 }, { # mac_real_dsym != 1
5378 # To get a fast fake .dSYM bundle, use a post-build step to
5379 # produce the .dSYM and strip the executable. strip_from_xcode
5380 # only operates in the Release configuration.
5384 # Define strip_from_xcode in a variable ending in _path
5385 # so that gyp understands it's a path and performs proper
5386 # relativization during dict merging.
5387 'strip_from_xcode_path': 'mac/strip_from_xcode',
5389 'postbuild_name': 'Strip If Needed',
5390 'action': ['<(strip_from_xcode_path)'],
5394 ], # target_conditions
5395 }], # (_type=="executable" or _type=="shared_library" or
5396 # _type=="loadable_module") and mac_strip!=0
5397 ], # target_conditions
5398 }, # target_defaults
5402 'ios/coverage.gypi',
5404 'target_defaults': {
5405 'xcode_settings' : {
5406 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5407 'ENABLE_BITCODE': 'NO',
5408 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5411 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5412 # additional flag to suppress the "unknown compiler option" error.
5413 # Restrict this flag to builds that are either compiling with Xcode
5414 # or compiling with Xcode's Clang. This will allow Ninja builds to
5415 # continue failing on unknown compiler options.
5416 # TODO(rohitrao): This flag is temporary and should be removed as
5417 # soon as the iOS bots are updated to use Xcode 5.1.
5418 ['clang_xcode==1', {
5420 '-Wno-unknown-warning-option',
5421 # It's not possible to achieve nullability completeness before
5422 # all builders are running Xcode 7. crbug.com/499809
5423 '-Wno-nullability-completeness',
5427 # Limit the valid architectures depending on "target_subarch".
5428 # This need to include the "arm" architectures but also the "x86"
5429 # ones (they are used when building for the simulator).
5430 ['target_subarch=="arm32"', {
5431 'VALID_ARCHS': ['armv7', 'i386'],
5433 ['target_subarch=="arm64"', {
5434 'VALID_ARCHS': ['arm64', 'x86_64'],
5436 ['target_subarch=="both"', {
5437 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5441 'target_conditions': [
5442 ['_toolset=="host"', {
5444 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5445 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5454 ['_toolset=="target"', {
5456 # This section should be for overriding host settings. But,
5457 # since we can't negate the iphone deployment target above, we
5458 # instead set it here for target only.
5459 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5460 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5463 ['_type=="executable"', {
5467 'DEPLOYMENT_POSTPROCESSING': 'YES',
5468 'STRIP_INSTALLED_PRODUCT': 'YES',
5470 ['buildtype!="Official"', {
5471 # Remove dSYM to reduce build time.
5472 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5479 # Remove dSYM to reduce build time.
5480 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5486 ['chromium_ios_signing', {
5487 # iOS SDK wants everything for device signed.
5488 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5490 'CODE_SIGNING_REQUIRED': 'NO',
5491 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5496 ], # target_conditions
5497 }, # target_defaults
5500 'target_defaults': {
5502 '_WIN32_WINNT=0x0603',
5509 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5510 'WIN32_LEAN_AND_MEAN',
5513 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5514 '_HAS_EXCEPTIONS=0',
5515 # Silence some warnings; we can't switch the the 'recommended'
5516 # versions as they're not available on old OSs.
5517 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5520 ['buildtype=="Official"', {
5521 # In official builds, targets can self-select an optimization
5522 # level by defining a variable named 'optimize', and setting it
5524 # - "size", optimizes for minimal code size - the default.
5525 # - "speed", optimizes for speed over code size.
5526 # - "max", whole program optimization and link-time code
5527 # generation. This is very expensive and should be used
5530 'optimize%': 'size',
5534 # Set /LTCG for the official builds.
5535 'LinkTimeCodeGeneration': '1',
5536 'AdditionalOptions': [
5537 # Set the number of LTCG code-gen threads to eight.
5538 # The default is four. This gives a 5-10% link speedup.
5543 'target_conditions': [
5544 ['optimize=="size"', {
5546 'VCCLCompilerTool': {
5547 # 1, optimizeMinSpace, Minimize Size (/O1)
5548 'Optimization': '1',
5549 # 2, favorSize - Favor small code (/Os)
5550 'FavorSizeOrSpeed': '2',
5555 # This config is used to avoid a problem in ffmpeg, see
5556 # http://crbug.com/264459.
5557 ['optimize=="size_no_ltcg"', {
5559 'VCCLCompilerTool': {
5560 # 1, optimizeMinSpace, Minimize Size (/O1)
5561 'Optimization': '1',
5562 # 2, favorSize - Favor small code (/Os)
5563 'FavorSizeOrSpeed': '2',
5568 ['optimize=="speed"', {
5570 'VCCLCompilerTool': {
5571 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5572 'Optimization': '2',
5573 # 1, favorSpeed - Favor fast code (/Ot)
5574 'FavorSizeOrSpeed': '1',
5579 ['optimize=="max"', {
5580 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5581 # builds. Probably anything that this would catch that
5582 # wouldn't be caught in a normal build isn't going to
5583 # actually be a bug, so the incremental value of C4702 for
5584 # PGO builds is likely very small.
5585 'msvs_disabled_warnings': [
5589 'VCCLCompilerTool': {
5590 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5591 'Optimization': '2',
5592 # 1, favorSpeed - Favor fast code (/Ot)
5593 'FavorSizeOrSpeed': '1',
5594 # This implies link time code generation.
5595 'WholeProgramOptimization': 'true',
5603 ['msvs_xtree_patched!=1', {
5604 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5605 # it's enabled. This will generally only be true for system-level
5606 # installed Express users.
5607 'msvs_disabled_warnings': [
5612 'msvs_system_include_dirs': [
5613 '<(windows_sdk_path)/Include/shared',
5614 '<(windows_sdk_path)/Include/um',
5615 '<(windows_sdk_path)/Include/winrt',
5616 '$(VSInstallDir)/VC/atlmfc/include',
5618 'msvs_cygwin_shell': 0,
5619 'msvs_disabled_warnings': [
5620 # C4091: 'typedef ': ignored on left of 'X' when no variable is
5622 # This happens in a number of Windows headers. Dumb.
5625 # C4127: conditional expression is constant
5626 # This warning can in theory catch dead code and other problems, but
5627 # triggers in far too many desirable cases where the conditional
5628 # expression is either set by macros or corresponds some legitimate
5629 # compile-time constant expression (due to constant template args,
5630 # conditionals comparing the sizes of different types, etc.). Some of
5631 # these can be worked around, but it's not worth it.
5634 # C4351: new behavior: elements of array 'array' will be default
5636 # This is a silly "warning" that basically just alerts you that the
5637 # compiler is going to actually follow the language spec like it's
5638 # supposed to, instead of not following it like old buggy versions
5639 # did. There's absolutely no reason to turn this on.
5642 # C4355: 'this': used in base member initializer list
5643 # It's commonly useful to pass |this| to objects in a class'
5644 # initializer list. While this warning can catch real bugs, most of
5645 # the time the constructors in question don't attempt to call methods
5646 # on the passed-in pointer (until later), and annotating every legit
5647 # usage of this is simply more hassle than the warning is worth.
5650 # C4503: 'identifier': decorated name length exceeded, name was
5652 # This only means that some long error messages might have truncated
5653 # identifiers in the presence of lots of templates. It has no effect
5654 # on program correctness and there's no real reason to waste time
5655 # trying to prevent it.
5658 # Warning C4589 says: "Constructor of abstract class ignores
5659 # initializer for virtual base class." Disable this warning because it
5660 # is flaky in VS 2015 RTM. It triggers on compiler generated
5661 # copy-constructors in some cases.
5664 # C4611: interaction between 'function' and C++ object destruction is
5666 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5667 # suggests using exceptions instead of setjmp/longjmp for C++, but
5668 # Chromium code compiles without exception support. We therefore have
5669 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5670 # means we have to turn off this warning (and be careful about how
5671 # object destruction happens in such cases).
5674 # TODO(maruel): These warnings are level 4. They will be slowly
5675 # removed as code is fixed.
5676 4100, # Unreferenced formal parameter
5677 4121, # Alignment of a member was sensitive to packing
5678 4244, # Conversion from 'type1' to 'type2', possible loss of data
5679 4481, # Nonstandard extension used: override specifier 'keyword'
5680 4505, # Unreferenced local function has been removed
5681 4510, # Default constructor could not be generated
5682 4512, # Assignment operator could not be generated
5683 4610, # Object can never be instantiated
5684 4838, # Narrowing conversion. Doesn't seem to be very useful.
5685 4995, # 'X': name was marked as #pragma deprecated
5686 4996, # 'X': was declared deprecated (for GetVersionEx).
5688 # These are variable shadowing warnings that are new in VS2015. We
5689 # should work through these at some point -- they may be removed from
5690 # the RTM release in the /W4 set.
5691 4456, 4457, 4458, 4459,
5694 'VCCLCompilerTool': {
5695 'AdditionalOptions': ['/MP'],
5696 'MinimalRebuild': 'false',
5697 'BufferSecurityCheck': 'true',
5698 'EnableFunctionLevelLinking': 'true',
5699 'RuntimeTypeInfo': 'false',
5700 'WarningLevel': '4',
5701 'WarnAsError': 'true',
5702 'DebugInformationFormat': '3',
5703 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5704 'ExceptionHandling': '0',
5706 'VCLibrarianTool': {
5707 'AdditionalOptions': ['/ignore:4221'],
5708 'AdditionalLibraryDirectories': [
5709 '<(windows_sdk_path)/Lib/win8/um/x86',
5713 'AdditionalDependencies': [
5725 'AdditionalLibraryDirectories': [
5726 '<(windows_sdk_path)/Lib/win8/um/x86',
5728 'GenerateDebugInformation': 'true',
5729 'MapFileName': '$(OutDir)\\$(TargetName).map',
5730 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5731 'FixedBaseAddress': '1',
5734 # 1 == /SUBSYSTEM:CONSOLE
5735 # 2 == /SUBSYSTEM:WINDOWS
5736 # Most of the executables we'll ever create are tests
5737 # and utilities with console output.
5741 'GenerateStublessProxies': 'true',
5742 'TypeLibraryName': '$(InputName).tlb',
5743 'OutputDirectory': '$(IntDir)',
5744 'HeaderFileName': '$(InputName).h',
5745 'DLLDataFileName': '$(InputName).dlldata.c',
5746 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5747 'ProxyFileName': '$(InputName)_p.c',
5749 'VCResourceCompilerTool': {
5751 'AdditionalIncludeDirectories': [
5753 '<(SHARED_INTERMEDIATE_DIR)',
5756 'target_conditions': [
5757 ['_type=="executable"', {
5759 'EmbedManifest': 'true',
5762 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5764 'AdditionalManifestFiles': [
5765 '>(win_exe_compatibility_manifest)',
5771 # Building with Clang on Windows is a work in progress and very
5772 # experimental. See crbug.com/82385.
5773 # Keep this in sync with the similar blocks in build/config/compiler/BUILD.gn
5775 'VCCLCompilerTool': {
5776 'AdditionalOptions': [
5777 # Many files use intrinsics without including this header.
5778 # TODO(hans): Fix those files, or move this to sub-GYPs.
5781 # TODO(hans): Make this list shorter eventually, http://crbug.com/504657
5782 '-Qunused-arguments', # http://crbug.com/504658
5783 '-Wno-microsoft-enum-value', # http://crbug.com/505296
5784 '-Wno-unknown-pragmas', # http://crbug.com/505314
5785 '-Wno-unused-value', # http://crbug.com/505318
5789 ['clang==1 and clang_use_chrome_plugins==1', {
5790 'VCCLCompilerTool': {
5791 'AdditionalOptions': [
5792 '<@(clang_chrome_plugins_flags)',
5796 ['clang==1 and MSVS_VERSION == "2013"', {
5797 'VCCLCompilerTool': {
5798 'AdditionalOptions': [
5799 '-fmsc-version=1800',
5803 ['clang==1 and MSVS_VERSION == "2015"', {
5804 'VCCLCompilerTool': {
5805 'AdditionalOptions': [
5806 '-fmsc-version=1900',
5810 ['clang==1 and "<!(python <(DEPTH)/build/win/use_ansi_codes.py)"=="True"', {
5811 'VCCLCompilerTool': {
5812 'AdditionalOptions': [
5813 # cmd.exe doesn't understand ANSI escape codes by default,
5814 # so only enable them if something emulating them is around.
5815 '-fansi-escape-codes',
5816 # Also see http://crbug.com/110262
5817 '-fcolor-diagnostics',
5825 ['disable_nacl==1', {
5826 'target_defaults': {
5832 ['OS=="win" and msvs_use_common_linker_extras', {
5833 'target_defaults': {
5848 'AdditionalOptions': [
5859 'AdditionalOptions': ['/largeaddressaware'],
5863 # TODO(asan/win): Move this down into the general
5864 # win-target_defaults section once the 64-bit asan runtime
5865 # exists. See crbug.com/345874.
5866 'VCCLCompilerTool': {
5867 'AdditionalOptions': [
5868 '-fsanitize=address',
5869 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5871 'AdditionalIncludeDirectories': [
5872 # MSVC needs to be able to find the sanitizer headers when
5873 # invoked via /fallback. This is critical for using macros
5874 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5876 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/include_sanitizer',
5880 'AdditionalLibraryDirectories': [
5881 # TODO(hans): If make_clang_dir is absolute, this breaks.
5882 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/lib/windows',
5885 'target_conditions': [
5886 ['component=="shared_library"', {
5888 'AdditionalDependencies': [
5889 'clang_rt.asan_dynamic-i386.lib',
5890 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5894 ['_type=="executable" and component=="static_library"', {
5896 'AdditionalDependencies': [
5897 'clang_rt.asan-i386.lib',
5901 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5903 'AdditionalDependencies': [
5904 'clang_rt.asan_dll_thunk-i386.lib',
5910 ['sanitizer_coverage!=0', {
5911 # TODO(asan/win): Move this down into the general
5912 # win-target_defaults section once the 64-bit asan runtime
5913 # exists. See crbug.com/345874.
5914 'VCCLCompilerTool': {
5915 'AdditionalOptions': [
5916 '-fsanitize-coverage=<(sanitizer_coverage)',
5923 ['sanitizer_coverage!=0', {
5924 # TODO(asan/win): Move this down into the general
5925 # win-target_defaults section once the 64-bit asan runtime
5926 # exists. See crbug.com/345874.
5928 'SANITIZER_COVERAGE',
5936 'AdditionalOptions': [
5937 # safeseh is not compatible with x64
5949 ['enable_new_npdevice_api==1', {
5950 'target_defaults': {
5952 'ENABLE_NEW_NPDEVICE_API',
5956 # Don't warn about the "typedef 'foo' locally defined but not used"
5957 # for gcc 4.8 and higher.
5958 # TODO: remove this flag once all builds work. See crbug.com/227506
5959 ['gcc_version>=48 and clang==0', {
5960 'target_defaults': {
5962 '-Wno-unused-local-typedefs',
5966 ['gcc_version>=48 and clang==0 and host_clang==1', {
5967 'target_defaults': {
5968 'target_conditions': [
5969 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5973 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5975 'make_global_settings': [
5976 ['CC', '<(make_clang_dir)/bin/clang'],
5977 ['CXX', '<(make_clang_dir)/bin/clang++'],
5978 ['CC.host', '$(CC)'],
5979 ['CXX.host', '$(CXX)'],
5982 ['clang==1 and OS=="win"', {
5983 'make_global_settings': [
5984 # On Windows, gyp's ninja generator only looks at CC.
5985 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5988 ['use_lld==1 and OS=="win"', {
5989 'make_global_settings': [
5990 # Limited to Windows because lld-link is the driver that is
5991 # compatible with link.exe.
5992 ['LD', '<(make_clang_dir)/bin/lld-link'],
5995 ['OS=="android" and clang==0', {
5996 # Hardcode the compiler names in the Makefile so that
5997 # it won't depend on the environment at make time.
5998 'make_global_settings': [
5999 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
6000 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
6001 ['CC.host', '<(host_cc)'],
6002 ['CXX.host', '<(host_cxx)'],
6005 ['OS=="linux" and target_arch=="mipsel" and host_arch!="mipsel" and chromeos==0 and clang==0', {
6006 # Set default mips cross tools on linux. These can be overridden
6007 # using CC,CXX,CC.host and CXX.host environment variables.
6008 'make_global_settings': [
6009 ['CC', '<!(which mipsel-linux-gnu-gcc)'],
6010 ['CXX', '<!(which mipsel-linux-gnu-g++)'],
6011 ['CC.host', '<(host_cc)'],
6012 ['CXX.host', '<(host_cxx)'],
6015 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
6016 # Set default ARM cross tools on linux. These can be overridden
6017 # using CC,CXX,CC.host and CXX.host environment variables.
6018 'make_global_settings': [
6019 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
6020 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
6021 ['CC.host', '<(host_cc)'],
6022 ['CXX.host', '<(host_cxx)'],
6025 # TODO(yyanagisawa): supports GENERATOR==make
6026 # make generator doesn't support CC_wrapper without CC
6027 # in make_global_settings yet.
6028 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
6029 'make_global_settings': [
6030 ['CC_wrapper', '<(gomadir)/gomacc'],
6031 ['CXX_wrapper', '<(gomadir)/gomacc'],
6032 ['CC.host_wrapper', '<(gomadir)/gomacc'],
6033 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
6037 'target_defaults': {
6038 'target_conditions': [
6039 ['_toolset=="target"', {
6047 # Work-around for http://openradar.appspot.com/20356002
6048 ['_toolset=="target" and _type!="static_library"', {
6058 ['use_lto==1 and clang==0', {
6059 'target_defaults': {
6060 'target_conditions': [
6061 ['_toolset=="target"', {
6063 '-ffat-lto-objects',
6069 ['use_lto==1 and clang==1', {
6070 'target_defaults': {
6071 'target_conditions': [
6072 ['_toolset=="target"', {
6074 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
6080 # Apply a lower LTO optimization level in non-official builds.
6081 ['use_lto==1 and clang==1 and buildtype!="Official"', {
6082 'target_defaults': {
6083 'target_conditions': [
6084 ['_toolset=="target"', {
6086 '-Wl,--plugin-opt,O1',
6089 ['_toolset=="target" and _type!="static_library"', {
6099 ['use_lto==1 and clang==1 and target_arch=="arm"', {
6100 'target_defaults': {
6101 'target_conditions': [
6102 ['_toolset=="target"', {
6103 # Without this flag, LTO produces a .text section that is larger
6104 # than the maximum call displacement, preventing the linker from
6105 # relocating calls (http://llvm.org/PR22999).
6107 '-Wl,-plugin-opt,-function-sections',
6113 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
6114 'target_defaults': {
6115 'target_conditions': [
6116 ['_toolset=="target"', {
6124 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
6125 'target_defaults': {
6126 'target_conditions': [
6127 ['_toolset=="target"', {
6136 'target_defaults': {
6137 'target_conditions': [
6138 ['_toolset=="target"', {
6140 '-fno-sanitize-trap=cfi',
6141 '-fsanitize-recover=cfi',
6150 '-fno-sanitize-trap=cfi',
6151 '-fsanitize-recover=cfi',
6155 '-fno-sanitize-trap=cfi',
6156 '-fsanitize-recover=cfi',
6160 'VCCLCompilerTool': {
6161 'AdditionalOptions': [
6162 '-fno-sanitize-trap=cfi',
6163 '-fsanitize-recover=cfi',
6168 ['_toolset=="target" and _type!="static_library"', {
6171 '-fno-sanitize-trap=cfi',
6172 '-fsanitize-recover=cfi',
6179 ['cfi_vptr==1 and cfi_diag==0', {
6180 'target_defaults': {
6181 'target_conditions': [
6182 ['_toolset=="target"', {
6191 'target_defaults': {
6192 'target_conditions': [
6193 ['_toolset=="target"', {
6195 '-fsanitize=cfi-vcall',
6196 '-fsanitize=cfi-derived-cast',
6197 '-fsanitize=cfi-unrelated-cast',
6198 '-fsanitize-blacklist=<(cfi_blacklist)',
6201 '-fsanitize=cfi-vcall',
6202 '-fsanitize=cfi-derived-cast',
6203 '-fsanitize=cfi-unrelated-cast',
6207 '-fsanitize=cfi-vcall',
6208 '-fsanitize=cfi-derived-cast',
6209 '-fsanitize=cfi-unrelated-cast',
6210 '-fsanitize-blacklist=<(cfi_blacklist)',
6214 'VCCLCompilerTool': {
6215 'AdditionalOptions': [
6216 '-fsanitize=cfi-vcall',
6217 '-fsanitize=cfi-derived-cast',
6218 '-fsanitize=cfi-unrelated-cast',
6219 '-fsanitize-blacklist=<(cfi_blacklist)',
6224 ['_toolset=="target" and _type!="static_library"', {
6227 '-fsanitize=cfi-vcall',
6228 '-fsanitize=cfi-derived-cast',
6229 '-fsanitize=cfi-unrelated-cast',
6238 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
6239 # This block adds *project-wide* configuration settings to each project
6240 # file. It's almost always wrong to put things here. Specify your
6241 # custom xcode_settings in target_defaults to add them to targets instead.
6244 # In an Xcode Project Info window, the "Base SDK for All Configurations"
6245 # setting sets the SDK on a project-wide basis. In order to get the
6246 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
6247 # here at the project level.
6250 ['mac_sdk_path==""', {
6251 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
6253 'SDKROOT': '<(mac_sdk_path)', # -isysroot
6259 ['ios_sdk_path==""', {
6261 # TODO(justincohen): Ninja only supports simulator for now.
6262 ['"<(GENERATOR)"=="xcode"', {
6263 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6265 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
6269 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6274 # Target both iPhone and iPad.
6275 'TARGETED_DEVICE_FAMILY': '1,2',
6278 ['target_arch=="x64"', {
6283 ['target_arch=="ia32"', {
6292 # The Xcode generator will look for an xcode_settings section at the root
6293 # of each dict and use it to apply settings on a file-wide basis. Most
6294 # settings should not be here, they should be in target-specific
6295 # xcode_settings sections, or better yet, should use non-Xcode-specific
6296 # settings in target dicts. SYMROOT is a special case, because many other
6297 # Xcode variables depend on it, including variables such as
6298 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6299 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6300 # files to appear (when present) in the UI as actual files and not red
6301 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6302 # and therefore SYMROOT, needs to be set at the project level.
6303 'SYMROOT': '<(DEPTH)/xcodebuild',