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 # Use system libc++ instead of the default C++ library, usually libstdc++.
517 # This is intended for iOS builds only.
518 'use_system_libcxx%': 0,
520 # Use a modified version of Clang to intercept allocated types and sizes
521 # for allocated objects. clang_type_profiler=1 implies clang=1.
522 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
523 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
524 'clang_type_profiler%': 0,
526 # Set to true to instrument the code with function call logger.
527 # See src/third_party/cygprofile/cyg-profile.cc for details.
528 'order_profiling%': 0,
530 # Use the provided profiled order file to link Chrome image with it.
531 # This makes Chrome faster by better using CPU cache when executing code.
532 # This is known as PGO (profile guided optimization).
533 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
534 'order_text_section%' : "",
536 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
537 # libraries on linux x86-64 and arm, plus ASLR.
540 # Whether one-click signin is enabled or not.
541 'enable_one_click_signin%': 0,
543 # Whether to back up data before sync.
544 'enable_pre_sync_backup%': 0,
546 # Enable Chrome browser extensions
547 'enable_extensions%': 1,
550 'enable_google_now%': 1,
552 # Enable basic printing support and UI.
553 'enable_basic_printing%': 1,
555 # Enable printing with print preview. It does not imply
556 # enable_basic_printing. It's possible to build Chrome with preview only.
557 'enable_print_preview%': 1,
559 # Set the version of CLD.
564 # For CLD2, the size of the tables that should be included in the build
565 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
567 # See third_party/cld_2/cld_2.gyp for more information.
568 # 0: Small tables, lower accuracy
569 # 2: Large tables, high accuracy
570 'cld2_table_size%': 2,
572 # Enable spell checker.
573 'enable_spellcheck%': 1,
575 # Use the operating system spellchecker, e.g. NSSpellChecker on Mac or
576 # SpellCheckerSession on Android.
577 'use_browser_spellchecker%': 0,
579 # Webrtc compilation is enabled by default. Set to 0 to disable.
582 # Media router support is enabled by default. Set to 0 to disable.
583 'enable_media_router%': 1,
585 # Enables use of the session service, which is enabled by default.
586 # Support for disabling depends on the platform.
587 'enable_session_service%': 1,
589 # Enables theme support, which is enabled by default. Support for
590 # disabling depends on the platform.
593 # Enables autofill dialog and associated features; disabled by default.
594 'enable_autofill_dialog%' : 0,
596 # Defaults Wallet integration in Autofill dialog to use production
597 # servers. Unofficial builds won't have the proper API keys.
598 'enable_prod_wallet_service%': 0,
600 # Enables support for background apps.
601 'enable_background%': 1,
603 # Enable the task manager by default.
604 'enable_task_manager%': 1,
606 # Enables used resource whitelist generation; disabled by default.
607 'enable_resource_whitelist_generation%': 0,
609 # Enable FILE support by default.
610 'disable_file_support%': 0,
612 # Enable FTP support by default.
613 'disable_ftp_support%': 0,
615 # Use of precompiled headers on Windows.
617 # This variable may be explicitly set to 1 (enabled) or 0
618 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
619 # This setting will override the default.
622 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
624 'chromium_win_pch%': 0,
627 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
628 # Set this to true when building with Clang.
629 # See http://code.google.com/p/chromium/wiki/Clang for details.
630 # If this is set, clang is used as both host and target compiler in
631 # cross-compile builds.
634 # Use experimental lld linker instead of the platform's default linker.
637 # Enable plugin installation by default.
638 'enable_plugin_installation%': 1,
640 # Specifies whether to use canvas_skia.cc in place of platform
641 # specific implementations of gfx::Canvas. Affects text drawing in the
643 # TODO(asvitkine): Enable this on all platforms and delete this flag.
644 # http://crbug.com/105550
645 'use_canvas_skia%': 0,
647 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
648 # with one of those tools.
649 'build_for_tool%': '',
651 'wix_path%': '<(DEPTH)/third_party/wix',
653 # Supervised users are enabled by default.
654 'enable_supervised_users%': 1,
656 # Platform sends memory pressure signals natively.
657 'native_memory_pressure_signals%': 0,
660 'enable_service_discovery%': 0,
661 'enable_wifi_bootstrapping%': 0,
662 'enable_hangout_services_extension%': 0,
664 # Enable the Syzygy optimization step.
665 'syzygy_optimize%': 0,
667 # Enable hole punching for the protected video.
670 # Automatically select platforms under ozone. Turn this off to
671 # build only explicitly selected platforms.
672 'ozone_auto_platforms%': 1,
674 # If this is set clang is used as host compiler, but not as target
675 # compiler. Always do this by default.
678 # Variables to control Link-Time Optimization (LTO).
679 # On Android, when using GCC LTO, the variable use_lto enables LTO on code
680 # compiled with -Os, and use_lto_o2 enables LTO on code compiled with -O2.
681 # On other platforms (including Android with Clang), use_lto enables LTO
682 # in all translation units, and use_lto_o2 has no effect.
684 # On Linux and Android, when using LLVM LTO, the script
685 # build/download_gold_plugin.py must be run to download a linker plugin.
686 # On Mac, LLVM needs to be built from scratch using
687 # tools/clang/scripts/update.py and the absolute path to
688 # third_party/llvm-build/Release+Asserts/lib must be added to
689 # $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin.
690 # TODO(pcc): Teach build system to use -lto_library flag to specify path
691 # to linker plugin on Mac.
693 # On Android/GCC, the variables must *not* be enabled at the same time.
694 # In this case LTO would 'merge' the optimization flags at link-time
695 # which would lead to all code be optimized with -O2. See crbug.com/407544
699 # Allowed level of identical code folding in the gold linker.
700 'gold_icf_level%': 'all',
702 # Libxkbcommon usage.
705 # Whether we use GTKv3 on linux.
708 # Control Flow Integrity for virtual calls and casts.
709 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
713 'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
715 # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
716 'mac_views_browser%': 0,
718 # By default, use ICU data file (icudtl.dat).
719 'icu_use_data_file_flag%': 1,
721 # Turn on JNI generation optimizations by default.
722 'optimize_jni_generation%': 1,
725 # A flag for POSIX platforms
732 # A flag for BSD platforms
733 ['OS=="freebsd" or OS=="openbsd"', {
740 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris")', {
746 # libudev usage. This currently only affects the content layer.
747 ['OS=="linux" and embedded==0', {
753 # Flags to use X11 on non-Mac POSIX platforms.
754 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
761 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
767 # Flags to use pango and cairo.
768 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
777 ['OS=="linux" and embedded==0', {
783 # We always use skia text rendering in Aura on Windows, since GDI
784 # doesn't agree with our BackingStore.
785 # TODO(beng): remove once skia text rendering is on by default.
786 ['use_aura==1 and OS=="win"', {
787 'enable_skia_text%': 1,
790 # A flag to enable or disable our compile-time dependency
791 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
792 # support will be available. This option is useful
793 # for Linux distributions and for Aura.
794 ['OS!="linux" or chromeos==1', {
795 'use_gnome_keyring%': 0,
797 'use_gnome_keyring%': 1,
800 ['OS=="mac" or OS=="ios"', {
801 # Mac and iOS want Title Case strings
802 'use_titlecase_in_grd%': 1,
805 # Enable loader extensions on Chrome OS.
807 'image_loader_extension%': 1,
809 'image_loader_extension%': 0,
812 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
813 'enable_one_click_signin%': 1,
814 'enable_pre_sync_backup%': 1,
818 'enable_extensions%': 0,
819 'enable_google_now%': 0,
824 'arm_neon_optional%': 1,
825 'native_memory_pressure_signals%': 1,
826 'enable_basic_printing%': 1,
827 'enable_print_preview%': 0,
828 'enable_task_manager%':0,
832 # Android and OSX have built-in spellcheckers that can be utilized.
833 ['OS=="android" or OS=="mac"', {
834 'use_browser_spellchecker%': 1,
837 # Android OS includes support for proprietary codecs regardless of
838 # building Chromium or Google Chrome. We also ship Google Chrome and
839 # Chromecast with proprietary codecs.
840 ['OS=="android" or branding=="Chrome" or chromecast==1', {
841 'proprietary_codecs%': 1,
843 'proprietary_codecs%': 0,
846 ['OS=="mac" or OS=="ios"', {
847 'native_memory_pressure_signals%': 1,
850 # Enable autofill dialog when not on iOS.
852 'enable_autofill_dialog%': 1,
855 ['buildtype=="Official"', {
856 'enable_prod_wallet_service%': 1,
859 # Enable hotwording on Chrome-branded ChromeOS builds.
860 ['branding=="Chrome" and chromeos==1', {
861 'enable_hotwording%': 1,
869 'disable_ftp_support%': 1,
870 'enable_extensions%': 0,
871 'enable_google_now%': 0,
873 'cld2_table_size%': 0,
874 'enable_basic_printing%': 0,
875 'enable_print_preview%': 0,
876 'enable_session_service%': 0,
877 'enable_spellcheck%': 0,
883 'enable_supervised_users%': 0,
884 'enable_task_manager%': 0,
885 'use_system_libcxx%': 1,
886 'enable_media_router%': 0,
889 # Use GPU accelerated cross process image transport by default
890 # on linux builds with the Aura window manager
891 ['use_aura==1 and OS=="linux"', {
892 'ui_compositor_image_transport%': 1,
894 'ui_compositor_image_transport%': 0,
897 # Turn precompiled headers on by default.
898 ['OS=="win" and buildtype!="Official"', {
899 'chromium_win_pch%': 1
902 # Whether PDF plugin is enabled.
903 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
909 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
910 'enable_plugin_installation%': 0,
912 'enable_plugin_installation%': 1,
915 # Whether PPAPI is enabled.
916 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
917 'enable_plugins%': 0,
919 'enable_plugins%': 1,
922 # linux_use_bundled_gold: whether to use the gold linker binary checked
923 # into third_party/binutils. Force this off via GYP_DEFINES when you
924 # are using a custom toolchain and need to control -B in ldflags.
925 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
926 # for component=static_library builds.
927 ['(OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm" or (target_arch=="ia32" and host_arch=="x64"))', {
928 'linux_use_bundled_gold%': 1,
930 'linux_use_bundled_gold%': 0,
933 # linux_use_bundled_binutils: whether to use the binary binutils
934 # checked into third_party/binutils. These are not multi-arch so cannot
935 # be used except on x86 and x86-64 (the only two architectures which
936 # are currently checke in). Force this off via GYP_DEFINES when you
937 # are using a custom toolchain and need to control -B in cflags.
938 ['OS=="linux" and (target_arch=="x64")', {
939 'linux_use_bundled_binutils%': 1,
941 'linux_use_bundled_binutils%': 0,
944 # linux_use_gold_flags: whether to use build flags that rely on gold.
945 # On by default for x64 Linux.
946 ['OS=="linux" and target_arch=="x64"', {
947 'linux_use_gold_flags%': 1,
949 'linux_use_gold_flags%': 0,
952 # linux_use_debug_fission: whether to use split DWARF debug info
953 # files. This can reduce link time significantly, but is incompatible
954 # with some utilities such as icecc and ccache. Requires gold and
955 # gcc >= 4.8 or clang.
956 # http://gcc.gnu.org/wiki/DebugFission
957 ['OS=="linux" and target_arch=="x64"', {
958 'linux_use_debug_fission%': 1,
960 'linux_use_debug_fission%': 0,
963 ['OS=="android" or OS=="ios"', {
964 'enable_captive_portal_detection%': 0,
966 'enable_captive_portal_detection%': 1,
969 # Enable Skia UI text drawing incrementally on different platforms.
970 # http://crbug.com/105550
972 # On Aura, this allows per-tile painting to be used in the browser
974 ['OS!="android" and OS!="ios"', {
975 'use_canvas_skia%': 1,
979 'enable_basic_printing%': 0,
980 'enable_print_preview%': 1,
983 # Do not enable the Settings App on ChromeOS.
984 ['enable_app_list==1 and chromeos==0', {
985 'enable_settings_app%': 1,
987 'enable_settings_app%': 0,
990 # Whether tests targets should be run, archived or just have the
991 # dependencies verified. All the tests targets have the '_run' suffix,
992 # e.g. base_unittests_run runs the target base_unittests. The test
993 # target always calls tools/swarming_client/isolate.py. See the script's
994 # --help for more information. Meant to be overriden with GYP_DEFINES.
995 # TODO(maruel): Remove the conditions as more configurations are
997 ['OS!="ios" and OS!="android" and chromeos==0', {
998 'test_isolation_mode%': 'check',
1000 'test_isolation_mode%': 'noop',
1002 # Whether Android build uses OpenMAX DL FFT.
1003 ['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")', {
1004 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
1005 # When enabled, this will also enable WebAudio support on
1006 # Android for these architectures. Default is enabled. Whether
1007 # WebAudio is actually available depends on runtime settings
1009 'use_openmax_dl_fft%': 1,
1011 'use_openmax_dl_fft%': 0,
1013 ['OS=="win" or OS=="linux"', {
1017 # Disable various features by default on embedded.
1020 'enable_basic_printing%': 0,
1021 'enable_print_preview%': 0,
1024 ['OS=="win" or OS=="mac"', {
1025 'enable_wifi_bootstrapping%' : 1,
1028 # Path to sas.dll, which provides the SendSAS function.
1029 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1030 ['target_arch=="x64"', {
1031 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1033 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1037 'pkg-config': '<(chroot_cmd) <(DEPTH)/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
1039 'pkg-config': 'pkg-config'
1042 # Enable WebVR support by default on Android
1043 # Still requires command line flag to access API
1051 # Setting this to '0' will cause V8's startup snapshot to be
1052 # embedded in the binary instead of being a external files.
1053 'v8_use_external_startup_data%': 1,
1055 # Set this to 1 to enable use of concatenated impulse responses
1056 # for the HRTF panner in WebAudio.
1057 'use_concatenated_impulse_responses': 1,
1059 # You can set the variable 'use_official_google_api_keys' to 1
1060 # to use the Google-internal file containing official API keys
1061 # for Google Chrome even in a developer build. Setting this
1062 # variable explicitly to 1 will cause your build to fail if the
1063 # internal file is missing.
1065 # The variable is documented here, but not handled in this file;
1066 # see //google_apis/determine_use_official_keys.gypi for the
1069 # Set the variable to 0 to not use the internal file, even when
1070 # it exists in your checkout.
1072 # Leave it unset in your include.gypi to have the variable
1073 # implicitly set to 1 if you have
1074 # src/google_apis/internal/google_chrome_api_keys.h in your
1075 # checkout, and implicitly set to 0 if not.
1077 # Note that official builds always behave as if the variable
1078 # was explicitly set to 1, i.e. they always use official keys,
1079 # and will fail to build if the internal file is missing.
1081 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1082 # include.gypi or by other means. Due to subtleties of GYP, this
1083 # is not the same as leaving the variable unset, even though its
1085 # //google_apis/determine_use_official_keys.gypi is 2.
1087 # Set these to bake the specified API keys and OAuth client
1088 # IDs/secrets into your build.
1090 # If you create a build without values baked in, you can instead
1091 # set environment variables to provide the keys at runtime (see
1092 # src/google_apis/google_api_keys.h for details). Features that
1093 # require server-side APIs may fail to work if no keys are
1096 # Note that if you are building an official build or if
1097 # use_official_google_api_keys has been set to 1 (explicitly or
1098 # implicitly), these values will be ignored and the official
1099 # keys will be used instead.
1100 'google_api_key%': '',
1101 'google_default_client_id%': '',
1102 'google_default_client_secret%': '',
1103 # Native Client is enabled by default.
1104 'disable_nacl%': '0',
1106 # Native Client toolchains, enabled by default.
1107 'disable_pnacl%': 0,
1108 'disable_newlib%': 0,
1110 # Sets the default version name and code for Android app, by default we
1111 # do a developer build.
1112 'android_app_version_name%': 'Developer Build',
1113 'android_app_version_code%': 1,
1116 # Copy conditionally-set variables out one scope.
1117 'branding%': '<(branding)',
1118 'branding_path_component%': '<(branding_path_component)',
1119 'buildtype%': '<(buildtype)',
1120 'target_arch%': '<(target_arch)',
1121 'target_subarch%': '<(target_subarch)',
1122 'mips_arch_variant%': '<(mips_arch_variant)',
1123 'mips_dsp_rev%': '<(mips_dsp_rev)',
1124 'host_arch%': '<(host_arch)',
1125 'toolkit_views%': '<(toolkit_views)',
1126 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1127 'use_aura%': '<(use_aura)',
1128 'use_ash%': '<(use_ash)',
1129 'use_cras%': '<(use_cras)',
1130 'use_libpci%': '<(use_libpci)',
1131 'use_openssl%': '<(use_openssl)',
1132 'use_openssl_certs%': '<(use_openssl_certs)',
1133 'use_nss_certs%': '<(use_nss_certs)',
1134 'use_udev%': '<(use_udev)',
1135 'os_bsd%': '<(os_bsd)',
1136 'os_posix%': '<(os_posix)',
1137 'use_dbus%': '<(use_dbus)',
1138 'use_glib%': '<(use_glib)',
1139 'use_pango%': '<(use_pango)',
1140 'use_cairo%': '<(use_cairo)',
1141 'use_ozone%': '<(use_ozone)',
1142 'use_ozone_evdev%': '<(use_ozone_evdev)',
1143 'use_xkbcommon%': '<(use_xkbcommon)',
1144 'use_gtk3%': '<(use_gtk3)',
1145 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1146 'desktop_linux%': '<(desktop_linux)',
1147 'use_x11%': '<(use_x11)',
1148 'use_gnome_keyring%': '<(use_gnome_keyring)',
1149 'linux_fpic%': '<(linux_fpic)',
1150 'chromeos%': '<(chromeos)',
1151 'chromecast%': '<(chromecast)',
1152 'enable_viewport%': '<(enable_viewport)',
1153 'enable_hidpi%': '<(enable_hidpi)',
1154 'enable_topchrome_md%': '<(enable_topchrome_md)',
1155 'image_loader_extension%': '<(image_loader_extension)',
1156 'fastbuild%': '<(fastbuild)',
1157 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1158 'win_z7%': '<(win_z7)',
1159 'dcheck_always_on%': '<(dcheck_always_on)',
1160 'tracing_like_official_build%': '<(tracing_like_official_build)',
1161 'fieldtrial_testing_like_official_build%': '<(fieldtrial_testing_like_official_build)',
1162 'arm_version%': '<(arm_version)',
1163 'arm_neon%': '<(arm_neon)',
1164 'arm_neon_optional%': '<(arm_neon_optional)',
1165 'sysroot%': '<(sysroot)',
1166 'pkg-config%': '<(pkg-config)',
1167 'chroot_cmd%': '<(chroot_cmd)',
1168 'system_libdir%': '<(system_libdir)',
1169 'component%': '<(component)',
1170 'win_analyze%': '<(win_analyze)',
1171 'win_fastlink%': '<(win_fastlink)',
1172 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1173 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1174 'remoting%': '<(remoting)',
1175 'enable_one_click_signin%': '<(enable_one_click_signin)',
1176 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1177 'enable_media_router%': '<(enable_media_router)',
1178 'enable_webrtc%': '<(enable_webrtc)',
1179 'chromium_win_pch%': '<(chromium_win_pch)',
1180 'configuration_policy%': '<(configuration_policy)',
1181 'safe_browsing%': '<(safe_browsing)',
1182 'enable_web_speech%': '<(enable_web_speech)',
1183 'enable_hotwording%': '<(enable_hotwording)',
1184 'notifications%': '<(notifications)',
1185 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1186 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1188 'asan_blacklist%': '<(asan_blacklist)',
1189 'asan_coverage%': '<(asan_coverage)',
1190 'sanitizer_coverage%': '<(sanitizer_coverage)',
1191 'asan_field_padding%': '<(asan_field_padding)',
1192 'use_sanitizer_options%': '<(use_sanitizer_options)',
1193 'syzyasan%': '<(syzyasan)',
1194 'kasko%': '<(kasko)',
1195 'syzygy_optimize%': '<(syzygy_optimize)',
1198 'msan_blacklist%': '<(msan_blacklist)',
1199 'msan_track_origins%': '<(msan_track_origins)',
1201 'tsan_blacklist%': '<(tsan_blacklist)',
1202 'ubsan%': '<(ubsan)',
1203 'ubsan_blacklist%': '<(ubsan_blacklist)',
1204 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1205 'ubsan_vptr%': '<(ubsan_vptr)',
1206 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1207 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
1208 'use_custom_libcxx%': '<(use_custom_libcxx)',
1209 'use_system_libcxx%': '<(use_system_libcxx)',
1210 'clang_type_profiler%': '<(clang_type_profiler)',
1211 'order_profiling%': '<(order_profiling)',
1212 'order_text_section%': '<(order_text_section)',
1213 'enable_extensions%': '<(enable_extensions)',
1214 'enable_pdf%': '<(enable_pdf)',
1215 'enable_plugin_installation%': '<(enable_plugin_installation)',
1216 'enable_plugins%': '<(enable_plugins)',
1217 'enable_session_service%': '<(enable_session_service)',
1218 'enable_themes%': '<(enable_themes)',
1219 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1220 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1221 'enable_background%': '<(enable_background)',
1222 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1223 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1224 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1225 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1226 'use_canvas_skia%': '<(use_canvas_skia)',
1227 'test_isolation_mode%': '<(test_isolation_mode)',
1228 'enable_basic_printing%': '<(enable_basic_printing)',
1229 'enable_print_preview%': '<(enable_print_preview)',
1230 'enable_spellcheck%': '<(enable_spellcheck)',
1231 'use_browser_spellchecker%': '<(use_browser_spellchecker)',
1232 'enable_google_now%': '<(enable_google_now)',
1233 'cld_version%': '<(cld_version)',
1234 'cld2_table_size%': '<(cld2_table_size)',
1235 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1236 'disable_file_support%': '<(disable_file_support)',
1237 'disable_ftp_support%': '<(disable_ftp_support)',
1238 'enable_task_manager%': '<(enable_task_manager)',
1239 'sas_dll_path%': '<(sas_dll_path)',
1240 'wix_path%': '<(wix_path)',
1241 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1242 'use_system_libjpeg%': '<(use_system_libjpeg)',
1243 'android_channel%': '<(android_channel)',
1244 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1245 'gyp_managed_install%': 0,
1246 'create_standalone_apk%': 1,
1247 'enable_app_list%': '<(enable_app_list)',
1248 'use_default_render_theme%': '<(use_default_render_theme)',
1249 'enable_settings_app%': '<(enable_settings_app)',
1250 'google_api_key%': '<(google_api_key)',
1251 'google_default_client_id%': '<(google_default_client_id)',
1252 'google_default_client_secret%': '<(google_default_client_secret)',
1253 'enable_supervised_users%': '<(enable_supervised_users)',
1254 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1255 'enable_mdns%' : '<(enable_mdns)',
1256 'enable_service_discovery%' : '<(enable_service_discovery)',
1257 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1258 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1259 'proprietary_codecs%': '<(proprietary_codecs)',
1260 'use_goma%': '<(use_goma)',
1261 'gomadir%': '<(gomadir)',
1262 'use_lto%': '<(use_lto)',
1263 'use_lto_o2%': '<(use_lto_o2)',
1264 'gold_icf_level%': '<(gold_icf_level)',
1265 'video_hole%': '<(video_hole)',
1266 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1267 'cfi_vptr%': '<(cfi_vptr)',
1268 'cfi_diag%': '<(cfi_diag)',
1269 'cfi_blacklist%': '<(cfi_blacklist)',
1270 'mac_views_browser%': '<(mac_views_browser)',
1271 'android_app_version_name%': '<(android_app_version_name)',
1272 'android_app_version_code%': '<(android_app_version_code)',
1273 'enable_webvr%': '<(enable_webvr)',
1275 # Turns on compiler optimizations in V8 in Debug build.
1276 'v8_optimized_debug%': 1,
1278 # Use system protobuf instead of bundled one.
1279 'use_system_protobuf%': 0,
1281 # Use system yasm instead of bundled one.
1282 'use_system_yasm%': 0,
1284 # Use system ICU instead of bundled one.
1285 'use_system_icu%' : 0,
1287 # Default to enabled PIE; this is important for ASLR but we may need to be
1288 # able to turn it off for various reasons.
1289 'linux_disable_pie%': 0,
1291 # The release channel that this build targets. This is used to restrict
1292 # channel-specific build options, like which installer packages to create.
1293 # The default is 'all', which does no channel-specific filtering.
1296 # Override chromium_mac_pch and set it to 0 to suppress the use of
1297 # precompiled headers on the Mac. Prefix header injection may still be
1298 # used, but prefix headers will not be precompiled. This is useful when
1299 # using distcc to distribute a build to compile slaves that don't
1300 # share the same compiler executable as the system driving the compilation,
1301 # because precompiled headers rely on pointers into a specific compiler
1302 # executable's image. Setting this to 0 is needed to use an experimental
1303 # Linux-Mac cross compiler distcc farm.
1304 'chromium_mac_pch%': 1,
1306 # The default value for mac_strip in target_defaults. This cannot be
1307 # set there, per the comment about variable% in a target_defaults.
1308 'mac_strip_release%': 0,
1310 # Set to 1 to enable java code coverage. Instruments classes during build
1311 # to produce .ec files during runtime.
1312 'emma_coverage%': 0,
1314 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1315 # separated with whitespace and/or comma. Only has effect if
1316 # 'emma_coverage=1'.
1319 # Set to 1 to enable running Android lint on java/class files.
1322 # Although base/allocator lets you select a heap library via an
1323 # environment variable, the libcmt shim it uses sometimes gets in
1324 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1325 # 'win_use_allocator_shim': 0,
1326 # 'win_release_RuntimeLibrary': 2
1327 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1328 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1330 # TODO(bradnelson): eliminate this when possible.
1331 # To allow local gyp files to prevent release.vsprops from being included.
1332 # Yes(1) means include release.vsprops.
1333 # Once all vsprops settings are migrated into gyp, this can go away.
1334 'msvs_use_common_release%': 1,
1336 # TODO(bradnelson): eliminate this when possible.
1337 # To allow local gyp files to override additional linker options for msvs.
1338 # Yes(1) means set use the common linker options.
1339 'msvs_use_common_linker_extras%': 1,
1341 # TODO(sgk): eliminate this if possible.
1342 # It would be nicer to support this via a setting in 'target_defaults'
1343 # in chrome/app/locales/locales.gypi overriding the setting in the
1344 # 'Debug' configuration in the 'target_defaults' dict below,
1345 # but that doesn't work as we'd like.
1346 'msvs_debug_link_incremental%': '2',
1348 # Needed for some of the largest modules.
1349 'msvs_debug_link_nonincremental%': '1',
1351 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1352 # to get incremental linking to be faster in debug builds.
1353 'incremental_chrome_dll%': '0',
1355 # Experimental setting to break chrome.dll into multiple pieces based on
1357 'chrome_multiple_dll%': '0',
1359 # Experimental setting to optimize Chrome's DLLs with PGO.
1360 'chrome_pgo_phase%': '0',
1362 # Whether the VS xtree header has been patched to disable warning 4702. If
1363 # it has, then we don't need to disable 4702 (unreachable code warning).
1364 # The patch is preapplied to the internal toolchain and hence all bots.
1365 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1368 'clang%': '<(clang)',
1369 'host_clang%': '<(host_clang)',
1370 'make_clang_dir%': '<(make_clang_dir)',
1371 'use_lld%': '<(use_lld)',
1373 # Control which version of clang to use when building for iOS. If set to
1374 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1375 # the version of clang that ships with the Chromium source. This variable
1376 # is automatically set to '1' in Official builds.
1379 # These two variables can be set in GYP_DEFINES while running
1380 # |gclient runhooks| to let clang run a plugin in every compilation.
1381 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1383 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1386 'clang_add_plugin%': '',
1388 # Tell ld64 to write map files describing binary layout. Useful
1389 # for looking at what contributes to binary size, e.g. with
1390 # https://github.com/nico/bloat
1391 'mac_write_linker_maps%': 0,
1393 # The default type of gtest.
1394 'gtest_target_type%': 'executable',
1396 # Enable sampling based profiler.
1397 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1399 # Profile without optimizing out stack frames when profiling==1.
1400 'profiling_full_stack_frames%': '0',
1402 # And if we want to dump symbols for Breakpad-enabled builds.
1403 'linux_dump_symbols%': 0,
1404 # And if we want to strip the binary after dumping symbols.
1405 'linux_strip_binary%': 0,
1406 # If we want stack unwind support for backtrace().
1407 'debug_unwind_tables%': 1,
1408 'release_unwind_tables%': 1,
1410 # Override where to find binutils
1411 'binutils_version%': 0,
1412 'binutils_dir%': '',
1415 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1416 'use_allocator%': 'tcmalloc',
1418 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1419 'linux_link_gnome_keyring%': 0,
1420 # Set to 1 to link against gsettings APIs instead of using dlopen().
1421 'linux_link_gsettings%': 0,
1423 # Enable use of OpenMAX DL FFT routines.
1424 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1426 # Enable new NPDevice API.
1427 'enable_new_npdevice_api%': 0,
1429 # .gyp files or targets should set chromium_code to 1 if they build
1430 # Chromium-specific code, as opposed to external code. This variable is
1431 # used to control such things as the set of warnings to enable, and
1432 # whether warnings are treated as errors.
1433 'chromium_code%': 0,
1435 # Disable fatal linker warnings, similarly to how we make it possible
1436 # to disable -Werror (e.g. for different toolchain versions).
1437 'disable_fatal_linker_warnings%': 0,
1439 'release_valgrind_build%': 0,
1441 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1442 'enable_wexit_time_destructors%': 0,
1444 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1445 'internal_gles2_conform_tests%': 0,
1447 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1448 'internal_khronos_glcts_tests%': 0,
1450 # Set to 1 to compile the filter fuzzer.
1451 'internal_filter_fuzzer%': 0,
1453 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1454 # so Cocoa is happy (http://crbug.com/20441).
1456 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1457 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1458 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1459 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1460 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1461 'vi', 'zh-CN', 'zh-TW',
1464 # Pseudo locales are special locales which are used for testing and
1465 # debugging. They don't get copied to the final app. For more info,
1466 # check out https://www.chromium.org/developers/testing/fake-bidi
1473 # If debug_devtools is set to 1, JavaScript files for DevTools are
1474 # stored as is and loaded from disk. Otherwise, a concatenated file
1475 # is stored in resources.pak. It is still possible to load JS files
1476 # from disk by passing --debug-devtools cmdline switch.
1477 'debug_devtools%': 0,
1479 # The Java Bridge is not compiled in by default.
1482 # Code signing for iOS binaries. The bots need to be able to disable this.
1483 'chromium_ios_signing%': 1,
1485 # This flag is only used when disable_nacl==0 and disables all those
1486 # subcomponents which would require the installation of a native_client
1487 # untrusted toolchain.
1488 'disable_nacl_untrusted%': 0,
1490 # PNaCl toolchain does not support sanitizers. Disable by default.
1491 'enable_nacl_nonsfi_test%': 0,
1493 # Disable Dart by default.
1496 # Copy out the setting of disable_nacl.
1497 'disable_nacl%': '<(disable_nacl)',
1499 # Native Client toolchains, enabled by default.
1500 'disable_pnacl%': '<(disable_pnacl)',
1501 'disable_newlib%': '<(disable_newlib)',
1503 # Whether to build full debug version for Debug configuration on Android.
1504 # Compared to full debug version, the default Debug configuration on Android
1505 # has no full v8 debug, has size optimization and linker gc section, so that
1506 # we can build a debug version with acceptable size and performance.
1507 'android_full_debug%': 0,
1509 # Contains data about the attached devices for gyp_managed_install.
1510 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1512 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1513 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1515 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1516 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1518 # Whether we are using the rlz library or not. Platforms like Android send
1519 # rlz codes for searches but do not use the library.
1520 'enable_rlz_support%': 0,
1523 # Turns on the i18n support in V8.
1524 'v8_enable_i18n_support': 1,
1526 # Compile d8 for the host toolset.
1527 'v8_toolset_for_d8': 'host',
1529 # Use brlapi from brltty for braille display support.
1532 # Relative path to icu.gyp from this file.
1533 'icu_gyp_path': '../third_party/icu/icu.gyp',
1535 # IPC fuzzer is disabled by default.
1536 'enable_ipc_fuzzer%': 0,
1538 # Force disable libstdc++ debug mode.
1539 'disable_glibcxx_debug%': 0,
1541 # Set to 1 to compile with MSE support for MPEG2 TS
1542 'enable_mpeg2ts_stream_parser%': 0,
1544 # Support ChromeOS touchpad gestures with ozone.
1545 'use_evdev_gestures%': 0,
1547 # Default ozone platform (if no --ozone-platform flag).
1548 'ozone_platform%': "",
1550 # Ozone platforms to include in the build.
1551 'ozone_platform_caca%': 0,
1552 'ozone_platform_cast%': 0,
1553 'ozone_platform_drm%': 0,
1554 'ozone_platform_egltest%': 0,
1555 'ozone_platform_gbm%': 0,
1556 'ozone_platform_ozonex%': 0,
1557 'ozone_platform_test%': 0,
1559 # Experiment: http://crbug.com/426914
1562 # Used to set libjpeg_gyp_path. Chrome OS ui/gfx/gfx.gyp uses the IJG path
1563 # for robust login screen decoding.
1564 'libjpeg_ijg_gyp_path': '<(DEPTH)/third_party/libjpeg/libjpeg.gyp',
1565 'libjpeg_turbo_gyp_path': '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp',
1568 ['buildtype=="Official"', {
1569 # Continue to embed build meta data in Official builds, basically the
1570 # time it was built.
1571 # TODO(maruel): This decision should be revisited because having an
1572 # official deterministic build has high value too but MSVC toolset can't
1573 # generate anything deterministic with WPO enabled AFAIK.
1574 'dont_embed_build_metadata%': 0,
1576 # Enable the Syzygy optimization step for the official builds.
1577 ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
1578 'syzygy_optimize%': 1,
1580 'syzygy_optimize%': 0,
1582 # Get binutils version so we can enable debug fission if we can.
1583 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1585 # compiler_version doesn't work with clang
1586 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1587 # compiler_version works with clang.
1588 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1589 # that it takes effect here.
1590 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1591 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1593 # On Android we know the binutils version in the toolchain.
1595 'binutils_version%': 222,
1597 ['host_arch=="x64"', {
1598 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1600 ['host_arch=="ia32"', {
1601 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1603 # Our version of binutils in third_party/binutils
1604 ['linux_use_bundled_binutils==1', {
1605 'binutils_version%': 224,
1609 'binutils_version%': 0,
1611 # The version of GCC in use, set later in platforms that use GCC and have
1612 # not explicitly chosen to build with clang. Currently, this means all
1613 # platforms except Windows, Mac and iOS.
1614 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1615 # it takes effect here.
1616 ['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', {
1619 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1620 # We directly set the gcc version since we know what we use.
1623 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1624 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1628 'host_gcc_version%': 0,
1631 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1632 'directx_sdk_path%': '<(directx_sdk_default_path)',
1634 'directx_sdk_path%': '$(DXSDK_DIR)',
1637 'windows_driver_kit_path%': '$(WDK_DIR)',
1639 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1641 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1644 'nacl_untrusted_build%': 0,
1645 'use_allocator%': 'none',
1647 # Use a 64-bit linker to avoid running out of address space. The
1648 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1649 ['host_arch=="ia32" and target_arch=="ia32"', {
1650 # TODO(thestig) This is a horrible way to force the desired
1651 # configuration. Our gyp variable scoping is likely wrong and
1652 # needs to be cleaned up. The GN configuration should be changed
1654 'binutils_version%': 224,
1655 'linux_use_bundled_binutils%': '1',
1656 'linux_use_bundled_gold%': '1',
1657 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1659 # All Chrome builds have breakpad symbols, but only process the
1660 # symbols from official builds.
1661 ['(branding=="Chrome" and buildtype=="Official")', {
1662 'linux_dump_symbols%': 1,
1664 # Omit unwind support in official release builds to save space. We
1665 # can use breakpad for these builds.
1666 'release_unwind_tables%': 0,
1669 }], # os_posix==1 and OS!="mac" and OS!="ios"
1672 'enable_background%': 0,
1673 'icu_use_data_file_flag%': 1,
1674 'enable_web_speech%': 0,
1675 'use_system_libxml%': 1,
1676 'use_system_sqlite%': 1,
1678 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1679 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1680 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1681 'uk', 'vi', 'zh-CN', 'zh-TW',
1684 # iOS SDK and deployment target support. The |ios_sdk| value is left
1685 # blank so that when it is set in the project files it will be the
1686 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1687 # causes Xcode to spit out a warning for every single project file for
1688 # not using the "current" SDK.
1690 'ios_sdk_path%': '',
1691 'ios_deployment_target%': '7.0',
1694 # ios_product_name is set to the name of the .app bundle as it should
1696 ['branding=="Chrome"', {
1697 'ios_product_name%': 'Chrome',
1698 }, { # else: branding!="Chrome"
1699 'ios_product_name%': 'Chromium',
1701 ['branding=="Chrome" and buildtype=="Official"', {
1703 }, { # else: branding!="Chrome" or buildtype!="Official"
1709 # Location of Android NDK.
1712 # Standard libraries can use the relative path to the NDK.
1713 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1714 # Unfortunately, it is required to use the absolute path to the SDK
1715 # because it us passed to ant which uses a different relative path
1717 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1718 # Similarly, gdbserver and the Android toolchain need to use the
1719 # absolute path to the NDK because they are used at different levels
1721 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1722 'android_host_arch%': '<!(uname -m)',
1723 # Android API-level of the SDK used for compilation.
1724 'android_sdk_version%': '23',
1725 'android_sdk_build_tools_version%': '23.0.0',
1726 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1729 # Figure this out early since it needs symbols from libgcc.a, so it
1730 # has to be before that in the set of libraries.
1731 # ASan needs to dynamically link to libc++ even in static builds so
1732 # that it can interpose operator new.
1733 ['component=="shared_library" or asan==1', {
1734 'android_libcpp_library': 'c++_shared',
1735 'android_must_copy_system_libraries': 1,
1737 'android_libcpp_library': 'c++_static',
1738 'android_must_copy_system_libraries': 0,
1743 # Copy conditionally-set variables out one scope.
1744 'android_ndk_root%': '<(android_ndk_root)',
1745 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1746 'android_sdk_root%': '<(android_sdk_root)',
1747 'android_sdk_version%': '<(android_sdk_version)',
1748 'android_libcpp_root': '<(android_ndk_root)/sources/cxx-stl/llvm-libc++',
1749 'android_libcpp_library': '<(android_libcpp_library)',
1750 'android_must_copy_system_libraries': '<(android_must_copy_system_libraries)',
1751 'host_os%': '<(host_os)',
1753 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1754 # Android SDK build tools (e.g. dx, aidl)
1755 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1757 # Android API level 16 is JB (Android 4.1) which is the minimum
1758 # platform requirement for Chrome on Android, we use it for native
1761 ['target_arch == "ia32"', {
1762 'android_app_abi%': 'x86',
1763 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
1764 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-x86',
1765 'android_ndk_lib_dir%': 'usr/lib',
1766 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1768 ['target_arch == "x64"', {
1769 'android_app_abi%': 'x86_64',
1770 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1771 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1772 'android_ndk_lib_dir%': 'usr/lib64',
1773 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1775 ['target_arch=="arm"', {
1778 'android_app_abi%': 'armeabi',
1780 'android_app_abi%': 'armeabi-v7a',
1783 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
1784 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-arm',
1785 'android_ndk_lib_dir%': 'usr/lib',
1786 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1788 ['target_arch == "arm64"', {
1789 'android_app_abi%': 'arm64-v8a',
1790 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1791 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1792 'android_ndk_lib_dir%': 'usr/lib',
1793 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1795 ['target_arch == "mipsel"', {
1796 'android_app_abi%': 'mips',
1797 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
1798 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-mips',
1799 'android_ndk_lib_dir%': 'usr/lib',
1800 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1802 ['target_arch == "mips64el"', {
1803 'android_app_abi%': 'mips64',
1804 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1805 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1806 'android_ndk_lib_dir%': 'usr/lib64',
1807 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1811 # Copy conditionally-set variables out one scope.
1812 'android_app_abi%': '<(android_app_abi)',
1813 'android_gdbserver%': '<(android_gdbserver)',
1814 'android_ndk_root%': '<(android_ndk_root)',
1815 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1816 'android_sdk_root%': '<(android_sdk_root)',
1817 'android_sdk_version%': '<(android_sdk_version)',
1818 'android_toolchain%': '<(android_toolchain)',
1820 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1821 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1822 'android_sdk_tools%': '<(android_sdk_tools)',
1823 'android_aapt_path%': '<(android_sdk_tools)/aapt',
1824 'android_sdk%': '<(android_sdk)',
1825 'android_sdk_jar%': '<(android_sdk)/android.jar',
1827 'android_libcpp_root': '<(android_libcpp_root)',
1828 'android_libcpp_library': '<(android_libcpp_library)',
1829 'android_libcpp_include': '<(android_libcpp_root)/libcxx/include',
1830 'android_libcpp_libs_dir%': '<(android_libcpp_root)/libs/<(android_app_abi)',
1831 'android_must_copy_system_libraries': '<(android_must_copy_system_libraries)',
1832 'host_os%': '<(host_os)',
1834 # Location of the "objcopy" binary, used by both gyp and scripts.
1835 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1837 # Location of the "strip" binary, used by both gyp and scripts.
1838 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1840 # Location of the "readelf" binary.
1841 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1843 # Determines whether we should optimize JNI generation at the cost of
1844 # breaking assumptions in the build system that when inputs have changed
1845 # the outputs should always change as well. This is meant purely for
1846 # developer builds, to avoid spurious re-linking of native files.
1847 'optimize_jni_generation%': '<(optimize_jni_generation)',
1849 # Use OpenSSL's struct X509 to represent certificates.
1850 'use_openssl_certs%': 1,
1852 'proprietary_codecs%': '<(proprietary_codecs)',
1853 'safe_browsing%': 3,
1854 'enable_web_speech%': 0,
1856 'use_allocator%': 'none',
1858 # Disable Native Client.
1861 # Android does not support background apps.
1862 'enable_background%': 0,
1864 # Sessions are store separately in the Java side.
1865 'enable_session_service%': 0,
1869 'gtest_target_type%': 'shared_library',
1872 'use_system_fontconfig%': 0,
1874 'use_system_fontconfig%': 1,
1877 'enable_mpeg2ts_stream_parser%': 1,
1878 'ffmpeg_branding%': 'ChromeOS',
1879 'ozone_platform_ozonex%': 1,
1880 'use_custom_freetype%': 0,
1881 'use_playready%': 0,
1883 ['target_arch=="arm"', {
1885 'arm_tune%': 'cortex-a9',
1891 ['chromecast==1 and OS!="android"', {
1892 'ozone_platform_cast%': 1
1899 # All Chrome builds have breakpad symbols, but only process the
1900 # symbols from official builds.
1901 ['(branding=="Chrome" and buildtype=="Official")', {
1902 'mac_strip_release%': 1,
1906 ['OS=="mac" or OS=="ios"', {
1910 # Mac OS X SDK and deployment target support. The SDK identifies
1911 # the version of the system headers that will be used, and
1912 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1913 # macro. "Maximum allowed" refers to the operating system version
1914 # whose APIs are available in the headers. The deployment target
1915 # identifies the minimum system version that the built products are
1916 # expected to function on. It corresponds to the
1917 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1918 # macros are available, #include <AvailabilityMacros.h>. Additional
1919 # documentation on these macros is available at
1920 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1921 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1922 # deployment target to 10.6. Other projects, such as O3D, may
1923 # override these defaults.
1925 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1926 # about that is at least the specified version. In official builds,
1927 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1928 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1929 # path to the SDK; when set to a non-empty string, SDK detection
1930 # based on mac_sdk_min will be bypassed entirely.
1933 'mac_sdk_min%': '10.8',
1934 }, { # else OS!="ios"
1935 'mac_sdk_min%': '10.10',
1938 'mac_sdk_path%': '',
1940 'mac_deployment_target%': '10.6',
1943 'mac_sdk_min': '<(mac_sdk_min)',
1944 'mac_sdk_path': '<(mac_sdk_path)',
1945 'mac_deployment_target': '<(mac_deployment_target)',
1947 # Compile in Breakpad support by default so that it can be
1948 # tested, even if it is not enabled by default at runtime.
1949 'mac_breakpad_compiled_in%': 1,
1951 # mac_product_name is set to the name of the .app bundle as it should
1952 # appear on disk. This duplicates data from
1953 # chrome/app/theme/chromium/BRANDING and
1954 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1955 # these names into the build system.
1956 ['branding=="Chrome"', {
1957 'mac_product_name%': 'Google Chrome',
1958 }, { # else: branding!="Chrome"
1959 'mac_product_name%': 'Chromium',
1961 # Official mac builds require a specific OS X SDK, but iOS and
1962 # non-official mac builds do not.
1963 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1964 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1966 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1968 ['branding=="Chrome" and buildtype=="Official"', {
1969 # Enable uploading crash dumps.
1970 'mac_breakpad_uploads%': 1,
1971 # Enable dumping symbols at build time for use by Mac Breakpad.
1973 # Enable Keystone auto-update support.
1975 }, { # else: branding!="Chrome" or buildtype!="Official"
1976 'mac_breakpad_uploads%': 0,
1981 }], # OS=="mac" or OS=="ios"
1984 # This is the architecture convention used in WinSDK paths.
1985 ['target_arch=="ia32"', {
1986 'winsdk_arch%': 'x86',
1988 'winsdk_arch%': '<(target_arch)',
1990 ['component=="shared_library" or MSVS_VERSION == "2015"', {
1991 # TODO(scottmg): The allocator shimming doesn't work on the 2015 CRT
1992 # and we are hoping to be able to remove it if an additional feature
1993 # lands in the 2015 CRT API. For now, don't shim and revisit once
1994 # VS2015 is RTM: http://crbug.com/481611.
1995 'win_use_allocator_shim%': 0,
1997 ['component=="static_library"', {
1998 # Turn on multiple dll by default on Windows when in static_library.
1999 'chrome_multiple_dll%': 1,
2001 ['asan==1 or syzyasan==1', {
2002 'win_use_allocator_shim%': 0,
2007 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
2008 # Only enabled by default for ninja because it's buggy in VS.
2009 # Not enabled for component=static_library because some targets
2010 # are too large and the toolchain fails due to the size of the
2012 'incremental_chrome_dll%': 1,
2014 # Don't do incremental linking for large modules on 32-bit or when
2015 # component=static_library as the toolchain fails due to the size of
2017 ['MSVS_OS_BITS==32 or component=="static_library"', {
2018 'msvs_large_module_debug_link_mode%': '1', # No
2020 'msvs_large_module_debug_link_mode%': '2', # Yes
2023 'nacl_win64_defines': [
2024 # This flag is used to minimize dependencies when building
2025 # Native Client loader for 64-bit Windows.
2028 # Need to include allocator target, but exclude tcmalloc files.
2029 'use_allocator%': 'winheap',
2032 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
2038 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win") and chromecast==0', {
2039 'enable_pepper_cdms%': 1,
2041 'enable_pepper_cdms%': 0,
2044 ['OS=="android" or chromecast==1', {
2045 'enable_browser_cdms%': 1,
2047 'enable_browser_cdms%': 0,
2050 # Native Client glibc toolchain is enabled
2051 # by default except on arm, mips and mips64.
2052 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
2053 'disable_glibc%': 1,
2055 'disable_glibc%': 0,
2058 # Set the relative path from this file to the GYP file of the JPEG
2059 # library used by Chromium.
2060 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2061 # Configuration for using the system libjeg is here.
2062 'libjpeg_gyp_path': '<(libjpeg_ijg_gyp_path)',
2064 'libjpeg_gyp_path': '<(libjpeg_turbo_gyp_path)',
2067 # Options controlling the use of GConf (the classic GNOME configuration
2068 # system) and GIO, which contains GSettings (the new GNOME config system).
2069 ['chromeos==1 or embedded==1', {
2077 # Set up -D and -E flags passed into grit.
2078 ['branding=="Chrome"', {
2079 # TODO(mmoss) The .grd files look for _google_chrome, but for
2080 # consistency they should look for google_chrome_build like C++.
2081 'grit_defines': ['-D', '_google_chrome',
2082 '-E', 'CHROMIUM_BUILD=google_chrome'],
2084 'grit_defines': ['-D', '_chromium',
2085 '-E', 'CHROMIUM_BUILD=chromium'],
2088 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2090 ['desktop_linux==1', {
2091 'grit_defines': ['-D', 'desktop_linux'],
2093 ['toolkit_views==1', {
2094 'grit_defines': ['-D', 'toolkit_views'],
2097 'grit_defines': ['-D', 'use_aura'],
2100 'grit_defines': ['-D', 'use_ash'],
2102 ['use_nss_certs==1', {
2103 'grit_defines': ['-D', 'use_nss_certs'],
2106 'grit_defines': ['-D', 'use_ozone'],
2108 ['image_loader_extension==1', {
2109 'grit_defines': ['-D', 'image_loader_extension'],
2111 ['use_titlecase_in_grd==1', {
2112 'grit_defines': ['-D', 'use_titlecase'],
2117 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2118 '--no-output-all-resource-defines',
2121 ['OS=="mac" or OS=="ios"', {
2122 'grit_defines': ['-D', 'scale_factors=2x'],
2126 'enable_coverage%': 0,
2130 '--no-output-all-resource-defines',
2132 # iOS uses a whitelist to filter resources.
2133 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2135 # Enable host builds when generating with ninja-ios.
2137 ['"<(GENERATOR)"=="ninja"', {
2141 # Use the version of clang shipped with Xcode when building official
2142 # version of Chrome for iOS.
2144 # TODO(eugenebut): Remove enable_coverage check once
2145 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2146 # http://crbug.com/450379
2147 ['buildtype=="Official" or enable_coverage', {
2152 ['enable_extensions==1', {
2153 'grit_defines': ['-D', 'enable_extensions'],
2155 ['enable_plugins!=0', {
2156 'grit_defines': ['-D', 'enable_plugins'],
2158 ['enable_basic_printing==1 or enable_print_preview==1', {
2159 'grit_defines': ['-D', 'enable_printing'],
2161 ['enable_print_preview==1', {
2162 'grit_defines': ['-D', 'enable_print_preview'],
2164 ['enable_themes==1', {
2165 'grit_defines': ['-D', 'enable_themes'],
2167 ['enable_app_list==1', {
2168 'grit_defines': ['-D', 'enable_app_list'],
2170 ['enable_settings_app==1', {
2171 'grit_defines': ['-D', 'enable_settings_app'],
2173 ['enable_google_now==1', {
2174 'grit_defines': ['-D', 'enable_google_now'],
2176 ['use_concatenated_impulse_responses==1', {
2177 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2179 ['enable_media_router==1', {
2180 'grit_defines': ['-D', 'enable_media_router'],
2182 ['enable_webrtc==1', {
2183 'grit_defines': ['-D', 'enable_webrtc'],
2185 ['enable_hangout_services_extension==1', {
2186 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2188 ['enable_task_manager==1', {
2189 'grit_defines': ['-D', 'enable_task_manager'],
2191 ['notifications==1', {
2192 'grit_defines': ['-D', 'enable_notifications'],
2194 ['enable_wifi_bootstrapping==1', {
2195 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2197 ['mac_views_browser==1', {
2198 'grit_defines': ['-D', 'mac_views_browser'],
2200 ['enable_topchrome_md==1', {
2201 'grit_defines': ['-D', 'enable_topchrome_md'],
2203 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2204 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2206 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2207 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2209 ['enable_mdns==1 or OS=="mac"', {
2210 'grit_defines': ['-D', 'enable_service_discovery'],
2211 'enable_service_discovery%': 1
2213 ['clang_use_chrome_plugins==1', {
2219 ['OS=="mac" or OS=="ios"', {
2220 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2221 }, { # OS != "mac" or OS != "ios"
2222 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
2226 'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ',
2228 # On Windows, the plugin is built directly into clang, so there's
2229 # no need to load it dynamically.
2230 'clang_dynlib_flags%': '',
2232 # https://crbug.com/441916
2233 ['OS=="android" or OS=="linux" or OS=="mac"', {
2234 'clang_plugin_args%': '-Xclang -plugin-arg-find-bad-constructs -Xclang check-templates ',
2235 }, { # OS != "linux"
2236 'clang_plugin_args%': ''
2240 # If you change these, also change build/config/clang/BUILD.gn.
2241 'clang_chrome_plugins_flags%':
2242 '<(clang_dynlib_flags)'
2243 '-Xclang -add-plugin -Xclang find-bad-constructs <(clang_plugin_args)',
2245 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2247 'use_allocator%': 'none',
2248 'use_sanitizer_options%': 1,
2251 ['OS=="linux" and asan==0 and msan==0 and lsan==0 and tsan==0', {
2252 # PNaCl toolchain Non-SFI build only supports linux OS build.
2253 # Also, it does not support sanitizers.
2254 'enable_nacl_nonsfi_test%': 1,
2256 ['asan==1 and OS=="linux" and chromeos==0', {
2257 'use_custom_libcxx%': 1,
2265 ['asan==1 and OS=="mac"', {
2266 'mac_strip_release': 1,
2269 'use_custom_libcxx%': 1,
2272 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2273 # libstdc++. This is required to avoid false positive reports whenever
2274 # the C++ standard library is used.
2275 'use_custom_libcxx%': 1,
2276 # Running the V8-generated code on an ARM simulator is a powerful hack
2277 # that allows the tool to see the memory accesses from JITted code.
2278 # Without this flag, JS code causes false positive reports from MSan.
2279 'v8_target_arch': 'arm64',
2282 ['OS=="linux" and clang_type_profiler==1', {
2284 'clang_use_chrome_plugins%': 0,
2286 ['host_arch=="x64"', {
2287 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2289 ['host_arch=="ia32"', {
2290 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2291 # Clang in this directory at your own risk if needed for some
2292 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2293 # usage). Any failure by this compiler should not close the tree.
2294 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2299 # On valgrind bots, override the optimizer settings so we don't inline too
2300 # much and make the stacks harder to figure out.
2302 # TODO(rnk): Kill off variables that no one else uses and just implement
2303 # them under a build_for_tool== condition.
2304 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2306 'mac_debug_optimization': '1',
2307 'mac_release_optimization': '1',
2308 'release_optimize': '1',
2309 'no_gc_sections': 1,
2310 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2311 '-fno-builtin -fno-optimize-sibling-calls',
2312 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2313 '-fno-builtin -fno-optimize-sibling-calls',
2315 # MSVS flags for TSan on Pin and Windows.
2316 'win_debug_RuntimeChecks': '0',
2317 'win_debug_disable_iterator_debugging': '1',
2318 'win_debug_Optimization': '1',
2319 'win_debug_InlineFunctionExpansion': '0',
2320 'win_release_InlineFunctionExpansion': '0',
2321 'win_release_OmitFramePointers': '0',
2323 'use_allocator': 'tcmalloc',
2324 'release_valgrind_build': 1,
2326 'component': 'static_library',
2327 'use_system_zlib': 0,
2330 # Build tweaks for DrMemory.
2331 # TODO(rnk): Combine with tsan config to share the builder.
2332 # http://crbug.com/108155
2333 ['build_for_tool=="drmemory"', {
2334 # These runtime checks force initialization of stack vars which blocks
2335 # DrMemory's uninit detection.
2336 'win_debug_RuntimeChecks': '0',
2337 # Iterator debugging is slow.
2338 'win_debug_disable_iterator_debugging': '1',
2339 # Try to disable optimizations that mess up stacks in a release build.
2340 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2341 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2342 # compiler bug, so we use /Ob1 instead.
2343 'win_release_InlineFunctionExpansion': '1',
2344 'win_release_OmitFramePointers': '0',
2345 # Ditto for debug, to support bumping win_debug_Optimization.
2346 'win_debug_InlineFunctionExpansion': 0,
2347 'win_debug_OmitFramePointers': 0,
2348 # Keep the code under #ifndef NVALGRIND.
2349 'release_valgrind_build': 1,
2352 # RLZ library is used on Win, Mac, iOS and ChromeOS.
2353 ['OS=="win" or OS=="mac" or OS=="ios" or chromeos==1', {
2354 'enable_rlz_support%': 1,
2356 # RLZ is enabled for "Chrome" builds.
2357 ['branding=="Chrome"', {
2363 # Set default compiler flags depending on ARM version.
2364 ['arm_version==6', {
2365 'arm_arch%': 'armv6',
2368 'arm_float_abi%': 'softfp',
2371 ['arm_version==7', {
2372 'arm_arch%': 'armv7-a',
2373 'arm_tune%': 'generic-armv7-a',
2378 'arm_fpu%': 'vfpv3-d16',
2381 'arm_float_abi%': 'softfp',
2383 'arm_float_abi%': 'hard',
2389 # Set default compiler flags for MIPS floating-point support.
2390 ['target_arch=="mipsel"', {
2391 'mips_float_abi%': 'hard',
2393 ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
2394 'mips_fpu_mode%': 'fp32',
2396 'mips_fpu_mode%': '',
2399 # Enable brlapi by default for chromeos.
2404 ['use_ozone==1 and ozone_auto_platforms==1', {
2405 # Use test as the default platform.
2406 'ozone_platform%': 'test',
2408 # Build all platforms whose deps are in install-build-deps.sh.
2409 # Only these platforms will be compile tested by buildbots.
2410 'ozone_platform_drm%': 1,
2411 'ozone_platform_test%': 1,
2412 'ozone_platform_egltest%': 1,
2415 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2416 'use_clipboard_aurax11%': 1,
2419 ['OS=="win" and use_goma==1', {
2420 # goma doesn't support pch yet.
2421 'chromium_win_pch': 0,
2422 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2424 ['win_z7==0 and fastbuild==0', {
2430 ['OS=="win" and (clang==1 or asan==1)', {
2431 'chromium_win_pch': 0,
2435 'host_cc': '<(make_clang_dir)/bin/clang',
2436 'host_cxx': '<(make_clang_dir)/bin/clang++',
2438 'host_cc': '<!(which gcc)',
2439 'host_cxx': '<!(which g++)',
2442 # The seccomp-bpf sandbox is only supported on five architectures
2444 # Do not disable seccomp_bpf anywhere without talking to
2445 # security@chromium.org!
2446 ['((OS=="linux" or OS=="android") and '
2447 '(target_arch=="ia32" or target_arch=="x64" or '
2448 'target_arch=="arm" or target_arch=="mipsel" or '
2449 'target_arch=="arm64"))', {
2450 'use_seccomp_bpf%': 1,
2452 'use_seccomp_bpf%': 0,
2459 ['branding=="Chrome" and buildtype=="Official"', {
2460 'enable_hangout_services_extension%': 1,
2462 'enable_hangout_services_extension%': 0,
2466 # The path to the ANGLE library.
2467 'angle_path': '<(DEPTH)/third_party/angle',
2469 # List of default apps to install in new profiles. The first list contains
2470 # the source files as found in svn. The second list, used only for linux,
2471 # contains the destination location for each of the files. When a crx
2472 # is added or removed from the list, the chrome/browser/resources/
2473 # default_apps/external_extensions.json file must also be updated.
2475 # README: GN version of these is in the target //chrome:default_apps
2476 # (there's no global variable like in GYP). Be sure to update that target
2477 # if you change these lists!
2478 'default_apps_list': [
2479 'browser/resources/default_apps/external_extensions.json',
2480 'browser/resources/default_apps/gmail.crx',
2481 'browser/resources/default_apps/search.crx',
2482 'browser/resources/default_apps/youtube.crx',
2483 'browser/resources/default_apps/drive.crx',
2484 'browser/resources/default_apps/docs.crx',
2486 'default_apps_list_linux_dest': [
2487 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2488 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2489 '<(PRODUCT_DIR)/default_apps/search.crx',
2490 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2491 '<(PRODUCT_DIR)/default_apps/drive.crx',
2492 '<(PRODUCT_DIR)/default_apps/docs.crx',
2495 # Whether to allow building of the GPU-related isolates.
2496 'archive_gpu_tests%': 0,
2498 # Whether to allow building of chromoting related isolates.
2499 'archive_chromoting_tests%': 0,
2501 # Whether to allow building of Media Router related isolates.
2502 'archive_media_router_tests%': 0,
2504 'target_defaults': {
2506 # The condition that operates on chromium_code is in a target_conditions
2507 # section, and will not have access to the default fallback value of
2508 # chromium_code at the top of this file, or to the chromium_code
2509 # variable placed at the root variables scope of .gyp files, because
2510 # those variables are not set at target scope. As a workaround,
2511 # if chromium_code is not set at target scope, define it in target scope
2512 # to contain whatever value it has during early variable expansion.
2513 # That's enough to make it available during target conditional
2515 'chromium_code%': '<(chromium_code)',
2517 'component%': '<(component)',
2519 'chromecast%': '<(chromecast)',
2521 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2522 'win_release_Optimization%': '2', # 2 = /O2
2523 'win_debug_Optimization%': '0', # 0 = /Od
2525 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2526 # Tri-state: blank is default, 1 on, 0 off
2527 'win_release_OmitFramePointers%': '0',
2528 # Tri-state: blank is default, 1 on, 0 off
2529 'win_debug_OmitFramePointers%': '',
2531 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2532 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2534 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2535 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2536 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2538 # VS inserts quite a lot of extra checks to algorithms like
2539 # std::partial_sort in Debug build which make them O(N^2)
2540 # instead of O(N*logN). This is particularly slow under memory
2541 # tools like ThreadSanitizer so we want it to be disablable.
2542 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2543 'win_debug_disable_iterator_debugging%': '0',
2545 # An application manifest fragment to declare compatibility settings for
2546 # 'executable' targets. Ignored in other target type.
2547 'win_exe_compatibility_manifest%':
2548 '<(DEPTH)\\build\\win\\compatibility.manifest',
2550 'release_extra_cflags%': '',
2551 'debug_extra_cflags%': '',
2553 'release_valgrind_build%': '<(release_valgrind_build)',
2555 # the non-qualified versions are widely assumed to be *nix-only
2556 'win_release_extra_cflags%': '',
2557 'win_debug_extra_cflags%': '',
2559 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2560 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2562 # Only used by Windows build for now. Can be used to build into a
2563 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2564 # output files in src/build/VS2010_{Debug,Release}.
2565 'build_dir_prefix%': '',
2567 # Targets are by default not nacl untrusted code.
2568 'nacl_untrusted_build%': 0,
2570 'pnacl_compile_flags': [
2571 # pnacl uses the clang compiler so we need to suppress all the
2572 # same warnings as we do for clang.
2573 # TODO(sbc): Remove these if/when they are removed from the clang
2575 '-Wno-unused-function',
2576 '-Wno-char-subscripts',
2577 '-Wno-c++11-extensions',
2578 '-Wno-unnamed-type-template-args',
2581 # By default, Android targets have their exported JNI symbols stripped,
2582 # so we test the manual JNI registration code paths that are required
2583 # when using the crazy linker. To allow use of native JNI exports (lazily
2584 # resolved by the JVM), targets can enable this variable, which will stop
2585 # the stripping from happening. Only targets which do not need to be
2586 # compatible with the crazy linker are permitted to set this.
2587 'use_native_jni_exports%': 0,
2590 ['OS=="win" and component=="shared_library"', {
2591 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2592 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2593 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2595 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2596 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2597 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2600 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2601 'mac_release_optimization%': 's', # Use -Os unless overridden
2602 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2604 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2605 'mac_release_optimization%': '2', # Use -O2 unless overridden
2606 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2609 'host_os%': '<(host_os)', # See comment above chromium_code.
2612 'clang_warning_flags': [
2615 # Don't die on dtoa code that uses a char as an array index.
2616 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2617 '-Wno-char-subscripts',
2619 # TODO(thakis): This used to be implied by -Wno-unused-function,
2620 # which we no longer use. Check if it makes sense to remove
2621 # this as well. http://crbug.com/316352
2622 '-Wno-unneeded-internal-declaration',
2624 # Warns on switches on enums that cover all enum values but
2625 # also contain a default: branch. Chrome is full of that.
2626 '-Wno-covered-switch-default',
2628 # Warns when a const char[] is converted to bool.
2629 '-Wstring-conversion',
2631 # C++11-related flags:
2633 # This warns on using ints as initializers for floats in
2634 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2635 # which happens in several places in chrome code. Not sure if
2636 # this is worth fixing.
2637 '-Wno-c++11-narrowing',
2639 # Clang considers the `register` keyword as deprecated, but e.g.
2640 # code generated by flex (used in angle) contains that keyword.
2641 # http://crbug.com/255186
2642 '-Wno-deprecated-register',
2644 # TODO(hans): Get this cleaned up, http://crbug.com/428099
2645 '-Wno-inconsistent-missing-override',
2647 # TODO(thakis): Enable this, crbug.com/507717
2648 '-Wno-shift-negative-value',
2651 'includes': [ 'set_clang_warning_flags.gypi', ],
2653 # Don't use deprecated V8 APIs anywhere.
2654 'V8_DEPRECATION_WARNINGS',
2655 'CLD_VERSION=<(cld_version)',
2658 '<(SHARED_INTERMEDIATE_DIR)',
2662 # When compiling Objective C, warns if a method is used whose
2663 # availability is newer than the deployment target.
2664 'xcode_settings': { 'WARNING_CFLAGS': ['-Wpartial-availability']},
2666 ['(OS=="mac" or OS=="ios") and asan==1', {
2668 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2671 ['OS=="win" and asan==1 and component=="shared_library"', {
2673 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2676 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2677 'cflags_cc!': ['-fno-rtti'],
2680 '-gline-tables-only',
2681 '-fintercept-allocation-functions',
2683 'defines': ['TYPE_PROFILING'],
2685 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2688 ['branding=="Chrome"', {
2689 'defines': ['GOOGLE_CHROME_BUILD'],
2690 }, { # else: branding!="Chrome"
2691 'defines': ['CHROMIUM_BUILD'],
2693 ['OS=="mac" and component=="shared_library"', {
2695 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2696 'LD_RUNPATH_SEARCH_PATHS': [
2697 # For unbundled binaries.
2699 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2700 '@loader_path/../../..',
2704 ['clang==1 or host_clang==1', {
2705 # This is here so that all files get recompiled after a clang roll and
2706 # when turning clang on or off.
2707 # (defines are passed via the command line, and build systems rebuild
2708 # things when their commandline changes). Nothing should ever read this
2710 'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
2713 'defines': ['ENABLE_RLZ'],
2715 ['component=="shared_library"', {
2716 'defines': ['COMPONENT_BUILD'],
2718 ['ui_compositor_image_transport==1', {
2719 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2722 'defines': ['USE_AURA=1'],
2725 'defines': ['USE_ASH=1'],
2728 'defines': ['USE_PANGO=1'],
2731 'defines': ['USE_CAIRO=1'],
2734 'defines': ['USE_CRAS=1'],
2737 'defines': ['USE_OZONE=1'],
2739 ['use_default_render_theme==1', {
2740 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2742 ['use_libjpeg_turbo==1', {
2743 'defines': ['USE_LIBJPEG_TURBO=1'],
2746 'defines': ['USE_X11=1'],
2748 ['use_clipboard_aurax11==1', {
2749 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2751 ['enable_one_click_signin==1', {
2752 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2754 ['enable_pre_sync_backup==1', {
2755 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2757 ['image_loader_extension==1', {
2758 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2761 'defines': ['ENABLE_PROFILING=1'],
2763 ['enable_webrtc==1', {
2764 'defines': ['ENABLE_WEBRTC=1'],
2766 ['enable_media_router==1', {
2767 'defines': ['ENABLE_MEDIA_ROUTER=1'],
2769 ['proprietary_codecs==1', {
2770 'defines': ['USE_PROPRIETARY_CODECS'],
2772 ['enable_mpeg2ts_stream_parser==1', {
2773 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2777 ['enable_viewport==1', {
2778 'defines': ['ENABLE_VIEWPORT'],
2780 ['enable_pepper_cdms==1', {
2781 'defines': ['ENABLE_PEPPER_CDMS'],
2783 ['enable_browser_cdms==1', {
2784 'defines': ['ENABLE_BROWSER_CDMS'],
2786 ['configuration_policy==1', {
2787 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2789 ['notifications==1', {
2790 'defines': ['ENABLE_NOTIFICATIONS'],
2792 ['enable_hidpi==1', {
2793 'defines': ['ENABLE_HIDPI=1'],
2795 ['enable_topchrome_md==1', {
2796 'defines': ['ENABLE_TOPCHROME_MD=1'],
2798 ['native_memory_pressure_signals==1', {
2799 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2802 'defines': ['USE_UDEV'],
2806 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2809 ['OS=="win" and fastbuild==2', {
2810 # Completely disable debug information.
2813 'GenerateDebugInformation': 'false',
2815 'VCCLCompilerTool': {
2816 'DebugInformationFormat': '0',
2820 ['OS=="win" and fastbuild==1', {
2823 # This tells the linker to generate .pdbs, so that
2824 # we can get meaningful stack traces.
2825 'GenerateDebugInformation': 'true',
2827 'VCCLCompilerTool': {
2828 # No debug info to be generated by compiler.
2829 'DebugInformationFormat': '0',
2833 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2834 'variables': { 'debug_extra_cflags': '-g0', },
2836 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2837 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2839 'variables': { 'debug_extra_cflags': '-g0', },
2841 # Android builds symbols on release by default, disable them.
2842 ['OS=="android" and fastbuild==2', {
2843 'variables': { 'release_extra_cflags': '-g0', },
2845 ['OS=="android" and fastbuild==1', {
2846 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2848 'variables': { 'release_extra_cflags': '-g0', },
2852 ['dont_embed_build_metadata==1', {
2854 'DONT_EMBED_BUILD_METADATA',
2856 }], # dont_embed_build_metadata==1
2857 ['dcheck_always_on!=0', {
2858 'defines': ['DCHECK_ALWAYS_ON=1'],
2859 }], # dcheck_always_on!=0
2860 ['tracing_like_official_build!=0', {
2861 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2862 }], # tracing_like_official_build!=0
2863 ['fieldtrial_testing_like_official_build==0 and branding!="Chrome"', {
2864 'defines': ['FIELDTRIAL_TESTING_ENABLED'],
2865 }], # fieldtrial_testing_like_official_build==0 and branding!="Chrome"
2867 'defines': ['NO_TCMALLOC'],
2869 ['win_use_allocator_shim==1', {
2870 'defines': ['ALLOCATOR_SHIM'],
2876 'ADDRESS_SANITIZER',
2877 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2878 'MEMORY_SANITIZER_INITIAL_SIZE',
2882 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2890 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2891 'MEMORY_SANITIZER_INITIAL_SIZE',
2899 '<(DEPTH)/third_party/kasko/include',
2905 '_CRT_SECURE_NO_DEPRECATE',
2906 '_SCL_SECURE_NO_DEPRECATE',
2907 # This define is required to pull in the new Win8 interfaces from
2908 # system headers like ShObjIdl.h.
2909 'NTDDI_VERSION=0x06030000',
2910 # This is required for ATL to use XP-safe versions of its functions.
2911 '_USING_V110_SDK71_',
2914 '<(DEPTH)/third_party/wtl/include',
2919 # Generates debug info when win_z7=1
2920 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2922 'GenerateDebugInformation': 'true',
2924 'VCCLCompilerTool': {
2925 'DebugInformationFormat': '1',
2931 # This is prohibited when running /analyze.
2932 '_USING_V110_SDK71_',
2935 'VCCLCompilerTool': {
2936 # Set WarnAsError to false to disable this setting for most
2937 # projects so that compilation continues.
2938 'WarnAsError': 'false',
2939 # When win_analyze is specified add the /analyze switch.
2940 # Also add /WX- to force-disable WarnAsError for projects that
2941 # override WarnAsError.
2942 # Also, disable various noisy warnings that have low value.
2943 'AdditionalOptions': [
2945 '/wd6011', # Dereferencing NULL pointer
2946 '/wd6312', # Possible infinite loop: use of the constant
2947 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2948 '/wd6326', # Potential comparison of constant with constant
2949 '/wd28159', # Consider using 'GetTickCount64'
2950 '/wd28204', # Inconsistent SAL annotations
2951 '/wd28251', # Inconsistent SAL annotations
2952 '/wd28252', # Inconsistent SAL annotations
2953 '/wd28253', # Inconsistent SAL annotations
2954 '/wd28196', # The precondition is not satisfied
2955 '/wd28301', # Inconsistent SAL annotations
2956 '/wd6340', # Sign mismatch in function parameter
2957 '/wd28182', # Dereferencing NULL pointer
2958 # C6285 is ~16% of raw warnings and has low value
2959 '/wd6285', # non-zero constant || non-zero constant
2960 # C6334 is ~80% of raw warnings and has low value
2961 '/wd6334', # sizeof applied to an expression with an operator
2973 ['use_playready==1', {
2975 'PLAYREADY_CDM_AVAILABLE',
2980 ['enable_task_manager==1', {
2982 'ENABLE_TASK_MANAGER=1',
2985 ['enable_extensions==1', {
2987 'ENABLE_EXTENSIONS=1',
2990 ['OS=="win" and branding=="Chrome"', {
2991 'defines': ['ENABLE_SWIFTSHADER'],
2993 ['enable_dart==1', {
2994 'defines': ['WEBKIT_USING_DART=1'],
2997 'defines': ['ENABLE_PDF=1'],
2999 ['enable_plugin_installation==1', {
3000 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
3002 ['enable_plugins==1', {
3003 'defines': ['ENABLE_PLUGINS=1'],
3005 ['enable_session_service==1', {
3006 'defines': ['ENABLE_SESSION_SERVICE=1'],
3008 ['enable_themes==1', {
3009 'defines': ['ENABLE_THEMES=1'],
3011 ['enable_autofill_dialog==1', {
3012 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
3014 ['enable_prod_wallet_service==1', {
3015 # In GN, this is set on the autofill tagets only. See
3016 # //components/autofill/core/browser:wallet_service
3017 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
3019 ['enable_background==1', {
3020 'defines': ['ENABLE_BACKGROUND=1'],
3022 ['enable_google_now==1', {
3023 'defines': ['ENABLE_GOOGLE_NOW=1'],
3025 ['enable_basic_printing==1 or enable_print_preview==1', {
3026 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
3027 'defines': ['ENABLE_PRINTING=1'],
3029 ['enable_basic_printing==1', {
3030 # Enable basic printing support and UI.
3031 'defines': ['ENABLE_BASIC_PRINTING=1'],
3033 ['enable_print_preview==1', {
3034 # Enable printing with print preview.
3035 # Can be defined without ENABLE_BASIC_PRINTING.
3036 'defines': ['ENABLE_PRINT_PREVIEW=1'],
3038 ['enable_spellcheck==1', {
3039 'defines': ['ENABLE_SPELLCHECK=1'],
3041 ['use_browser_spellchecker', {
3042 'defines': ['USE_BROWSER_SPELLCHECKER=1'],
3044 ['enable_captive_portal_detection==1', {
3045 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
3047 ['enable_app_list==1', {
3048 'defines': ['ENABLE_APP_LIST=1'],
3050 ['enable_settings_app==1', {
3051 'defines': ['ENABLE_SETTINGS_APP=1'],
3053 ['disable_file_support==1', {
3054 'defines': ['DISABLE_FILE_SUPPORT=1'],
3056 ['disable_ftp_support==1', {
3057 'defines': ['DISABLE_FTP_SUPPORT=1'],
3059 ['enable_supervised_users==1', {
3060 'defines': ['ENABLE_SUPERVISED_USERS=1'],
3062 ['enable_mdns==1', {
3063 'defines': ['ENABLE_MDNS=1'],
3065 ['enable_service_discovery==1', {
3066 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
3068 ['enable_wifi_bootstrapping==1', {
3069 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
3071 ['enable_hangout_services_extension==1', {
3072 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
3074 ['enable_ipc_fuzzer==1', {
3075 'defines': ['ENABLE_IPC_FUZZER=1'],
3078 'defines': ['VIDEO_HOLE=1'],
3080 ['v8_use_external_startup_data==1', {
3081 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
3083 ['enable_webvr==1', {
3084 'defines': ['ENABLE_WEBVR'],
3087 # SAFE_BROWSING_SERVICE - browser manages a safe-browsing service.
3088 # SAFE_BROWSING_DB_LOCAL - service manages a local database.
3089 # SAFE_BROWSING_DB_REMOTE - service talks via API to a database
3090 # SAFE_BROWSING_CSD - enable client-side phishing detection.
3091 ['safe_browsing==1', {
3093 # TODO(nparker): Remove existing uses of FULL_SAFE_BROWSING
3094 'FULL_SAFE_BROWSING',
3095 'SAFE_BROWSING_CSD',
3096 'SAFE_BROWSING_DB_LOCAL',
3097 'SAFE_BROWSING_SERVICE',
3100 ['safe_browsing==2', {
3102 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3103 'MOBILE_SAFE_BROWSING',
3104 'SAFE_BROWSING_SERVICE',
3107 ['safe_browsing==3', {
3109 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3110 'MOBILE_SAFE_BROWSING',
3111 'SAFE_BROWSING_DB_REMOTE',
3112 'SAFE_BROWSING_SERVICE',
3115 ], # conditions for 'target_defaults'
3116 'target_conditions': [
3117 ['<(use_libpci)==1', {
3118 'defines': ['USE_LIBPCI=1'],
3120 ['<(use_openssl)==1', {
3121 'defines': ['USE_OPENSSL=1'],
3123 ['<(use_openssl_certs)==1', {
3124 'defines': ['USE_OPENSSL_CERTS=1'],
3126 ['>(nacl_untrusted_build)==1', {
3129 'USE_OPENSSL_CERTS=1',
3132 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3133 'defines': ['USE_GLIB=1'],
3135 ['<(use_nss_certs)==1 and >(nacl_untrusted_build)==0', {
3136 'defines': ['USE_NSS_CERTS=1'],
3138 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3139 'defines': ['OS_CHROMEOS=1'],
3141 ['enable_wexit_time_destructors==1 and OS!="win"', {
3142 # TODO: Enable on Windows too, http://crbug.com/404525
3143 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3145 ['chromium_code==0', {
3147 'clang_warning_flags': [
3148 # TODO(thakis): Move this suppression into individual third-party
3149 # libraries as required. http://crbug.com/505316.
3150 '-Wno-unused-function',
3151 # Lots of third-party libraries have unused variables. Instead of
3152 # suppressing them individually, we just blanket suppress them here.
3153 '-Wno-unused-variable',
3157 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3158 # We don't want to get warnings from third-party code,
3159 # so remove any existing warning-enabling flags like -Wall.
3165 # Don't warn about hash_map in third-party code.
3169 # Don't warn about printf format problems.
3170 # This is off by default in gcc but on in Ubuntu's gcc(!).
3174 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3178 # TODO: Fix all warnings on chromeos too.
3179 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3184 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3186 # Don't warn about ignoring the return value from e.g. close().
3187 # This is off by default in some gccs but on by default in others.
3188 # BSD systems do not support this option, since they are usually
3189 # using gcc 4.2.1, which does not have this flag yet.
3190 '-Wno-unused-result',
3195 '_CRT_SECURE_NO_DEPRECATE',
3196 '_CRT_NONSTDC_NO_WARNINGS',
3197 '_CRT_NONSTDC_NO_DEPRECATE',
3198 '_SCL_SECURE_NO_DEPRECATE',
3200 'msvs_disabled_warnings': [
3204 'VCCLCompilerTool': {
3205 'WarningLevel': '3',
3206 'WarnAsError': 'true',
3207 'Detect64BitPortabilityProblems': 'false',
3211 ['buildtype=="Official"', {
3213 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3216 [ 'component=="shared_library"', {
3217 # TODO(darin): Unfortunately, some third_party code depends on base.
3218 'msvs_disabled_warnings': [
3219 4251, # class 'std::xx' needs to have dll-interface.
3225 [ 'OS=="mac" or OS=="ios"', {
3227 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3230 ['buildtype=="Official"', {
3232 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3239 # TODO(ios): Fix remaining warnings in third-party code, then
3240 # remove this; the Mac cleanup didn't get everything that's
3241 # flagged in an iOS build.
3242 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3243 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3244 # Several internal ios directories generate numerous warnings for
3245 # -Wobjc-missing-property-synthesis.
3246 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3252 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3253 'filename_rules.gypi',
3255 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3256 # C99 macros on Mac and Linux.
3258 '__STDC_CONSTANT_MACROS',
3259 '__STDC_FORMAT_MACROS',
3263 # turn on warnings for signed/unsigned mismatch on chromium code.
3265 'VCCLCompilerTool': {
3266 'AdditionalOptions': ['/we4389'],
3270 ['OS=="win" and component=="shared_library"', {
3271 'msvs_disabled_warnings': [
3272 4251, # class 'std::xx' needs to have dll-interface.
3277 ], # target_conditions for 'target_defaults'
3278 'default_configuration': 'Debug',
3280 # VCLinkerTool LinkIncremental values below:
3282 # 1 == /INCREMENTAL:NO
3284 # Debug links incremental, Release does not.
3286 # Abstract base configurations to cover common attributes.
3290 'msvs_configuration_attributes': {
3291 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3292 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3293 'CharacterSet': '1',
3296 'VCCLCompilerTool': {
3297 'AdditionalOptions': [
3302 # Add the default import libs.
3303 'AdditionalDependencies': [
3320 'AdditionalOptions': [
3321 # Suggested by Microsoft Devrel to avoid
3322 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3323 # which started happening more regularly after VS2013 Update 4.
3324 # Needs to be a bit lower for VS2015, or else errors out.
3325 '/maxilksize:0x7ff00000',
3330 ['OS=="win" and win_fastlink==1', {
3333 # /PROFILE is incompatible with /debug:fastlink
3335 'AdditionalOptions': [
3336 # Tell VS 2015+ to create a PDB that references debug
3337 # information in .obj and .lib files instead of copying
3344 ['OS=="win" and MSVS_VERSION == "2015"', {
3346 'VCCLCompilerTool': {
3347 'AdditionalOptions': [
3348 # Work around crbug.com/526851, bug in VS 2015 RTM compiler.
3349 '/Zc:sizedDealloc-',
3360 'MinimumRequiredVersion': '5.01', # XP.
3361 'TargetMachine': '1',
3363 'VCLibrarianTool': {
3364 'TargetMachine': '1',
3367 'msvs_configuration_platform': 'Win32',
3371 'msvs_configuration_platform': 'x64',
3374 # Make sure to understand http://crbug.com/361720 if you want to
3376 'MinimumRequiredVersion': '5.02', # Server 2003.
3377 'TargetMachine': '17', # x86 - 64
3378 'AdditionalLibraryDirectories!':
3379 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3380 'AdditionalLibraryDirectories':
3381 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3382 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3383 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3385 'VCLibrarianTool': {
3386 'AdditionalLibraryDirectories!':
3387 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3388 'AdditionalLibraryDirectories':
3389 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3390 'TargetMachine': '17', # x64
3397 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3398 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3401 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3403 '<@(debug_extra_cflags)',
3407 'VCCLCompilerTool': {
3408 'Optimization': '<(win_debug_Optimization)',
3409 'PreprocessorDefinitions': ['_DEBUG'],
3410 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3411 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3413 # According to MSVS, InlineFunctionExpansion=0 means
3414 # "default inlining", not "/Ob0".
3415 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3416 ['win_debug_InlineFunctionExpansion==0', {
3417 'AdditionalOptions': ['/Ob0'],
3419 ['win_debug_InlineFunctionExpansion!=""', {
3420 'InlineFunctionExpansion':
3421 '<(win_debug_InlineFunctionExpansion)',
3423 ['win_debug_disable_iterator_debugging==1', {
3424 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3427 # if win_debug_OmitFramePointers is blank, leave as default
3428 ['win_debug_OmitFramePointers==1', {
3429 'OmitFramePointers': 'true',
3431 ['win_debug_OmitFramePointers==0', {
3432 'OmitFramePointers': 'false',
3433 # The above is not sufficient (http://crbug.com/106711): it
3434 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3435 # perform FPO regardless, so we must explicitly disable.
3436 # We still want the false setting above to avoid having
3437 # "/Oy /Oy-" and warnings about overriding.
3438 'AdditionalOptions': ['/Oy-'],
3441 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3444 'LinkIncremental': '<(msvs_debug_link_incremental)',
3445 # ASLR makes debugging with windbg difficult because Chrome.exe and
3446 # Chrome.dll share the same base name. As result, windbg will
3447 # name the Chrome.dll module like chrome_<base address>, where
3448 # <base address> typically changes with each launch. This in turn
3449 # means that breakpoints in Chrome.dll don't stick from one launch
3450 # to the next. For this reason, we turn ASLR off in debug builds.
3451 # Note that this is a three-way bool, where 0 means to pick up
3452 # the default setting, 1 is off and 2 is on.
3453 'RandomizedBaseAddress': 1,
3455 'VCResourceCompilerTool': {
3456 'PreprocessorDefinitions': ['_DEBUG'],
3460 ['OS=="linux" or OS=="android"', {
3461 'target_conditions': [
3462 ['_toolset=="target"', {
3464 '<@(debug_extra_cflags)',
3469 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3470 # Enable libstdc++ debugging facilities to help catch problems
3471 # early, see http://crbug.com/65151 .
3472 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3473 'defines': ['_GLIBCXX_DEBUG=1',],
3475 ['release_valgrind_build==0', {
3478 '-fstack-protector-all', # Implies -fstack-protector
3484 # Allow comparing the address of references and 'this' against 0
3485 # in debug builds. Technically, these can never be null in
3486 # well-defined C/C++ and Clang can optimize such checks away in
3487 # release builds, but they may be used in asserts in debug builds.
3488 '-Wno-undefined-bool-conversion',
3489 '-Wno-tautological-undefined-compare',
3493 '-Wno-undefined-bool-conversion',
3494 '-Wno-tautological-undefined-compare',
3498 'VCCLCompilerTool': {
3499 'AdditionalOptions': [
3500 '-Wno-undefined-bool-conversion',
3501 '-Wno-tautological-undefined-compare',
3514 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3515 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3516 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3519 'VCCLCompilerTool': {
3520 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3522 # In official builds, each target will self-select
3523 # an optimization level.
3524 ['buildtype!="Official"', {
3525 'Optimization': '<(win_release_Optimization)',
3528 # According to MSVS, InlineFunctionExpansion=0 means
3529 # "default inlining", not "/Ob0".
3530 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3531 ['win_release_InlineFunctionExpansion==0', {
3532 'AdditionalOptions': ['/Ob0'],
3534 ['win_release_InlineFunctionExpansion!=""', {
3535 'InlineFunctionExpansion':
3536 '<(win_release_InlineFunctionExpansion)',
3539 # if win_release_OmitFramePointers is blank, leave as default
3540 ['win_release_OmitFramePointers==1', {
3541 'OmitFramePointers': 'true',
3543 ['win_release_OmitFramePointers==0', {
3544 'OmitFramePointers': 'false',
3545 # The above is not sufficient (http://crbug.com/106711): it
3546 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3547 # perform FPO regardless, so we must explicitly disable.
3548 # We still want the false setting above to avoid having
3549 # "/Oy /Oy-" and warnings about overriding.
3550 'AdditionalOptions': ['/Oy-'],
3553 # Put data in separate COMDATs. This allows the linker
3554 # to put bit-identical constants at the same address even if
3555 # they're unrelated constants, which saves binary size.
3556 # This optimization can't be used when ASan is enabled because
3557 # it is not compatible with the ASan ODR checker.
3558 'AdditionalOptions': ['/Gw'],
3561 'AdditionalOptions': [
3562 '/d2Zi+', # Improve debugging of Release builds.
3563 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3564 '<@(win_release_extra_cflags)',
3568 # LinkIncremental is a tri-state boolean, where 0 means default
3569 # (i.e., inherit from parent solution), 1 means false, and
3571 'LinkIncremental': '1',
3572 # This corresponds to the /PROFILE flag which ensures the PDB
3573 # file contains FIXUP information (growing the PDB file by about
3574 # 5%) but does not otherwise alter the output binary. This
3575 # information is used by the Syzygy optimization tool when
3576 # decomposing the release image.
3581 ['msvs_use_common_release', {
3582 'includes': ['release.gypi'],
3584 ['release_valgrind_build==0 and tsan==0', {
3587 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3591 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3592 'MEMORY_SANITIZER_INITIAL_SIZE',
3593 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3594 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3598 'defines': ['NO_TCMALLOC'],
3600 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3601 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3602 # It seems to work fine with Ubuntu 12 headers though, so use it
3603 # in official builds.
3604 ['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")', {
3605 'target_conditions': [
3606 ['chromium_code==1', {
3607 # Non-chromium code is not guaranteed to compile cleanly
3608 # with _FORTIFY_SOURCE. Also, fortified build may fail
3609 # when optimizations are disabled, so only do that for Release
3612 '_FORTIFY_SOURCE=2',
3617 ['OS=="linux" or OS=="android"', {
3618 'target_conditions': [
3619 ['_toolset=="target"', {
3621 '<@(release_extra_cflags)',
3624 ['enable_resource_whitelist_generation==1', {
3626 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3635 'NS_BLOCK_ASSERTIONS=1',
3641 # Concrete configurations
3644 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3647 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3652 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3653 'target_conditions': [
3654 [ '_type=="executable"', {
3655 # To get a real .dSYM bundle produced by dsymutil, set the
3656 # debug information format to dwarf-with-dsym. Since
3657 # strip_from_xcode will not be used, set Xcode to do the
3658 # stripping as well.
3660 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3661 'DEPLOYMENT_POSTPROCESSING': 'YES',
3662 'STRIP_INSTALLED_PRODUCT': 'YES',
3669 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3671 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3674 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3682 'target_defaults': {
3687 # TODO(glider): enable the default options on other systems.
3689 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3691 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3697 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3698 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3699 'target_defaults': {
3701 '-Wl,--fatal-warnings',
3705 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3706 ['(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', {
3707 'target_defaults': {
3713 ['os_posix==1 and chromeos==0', {
3714 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3715 # and we want to avoid overriding this, so stack-protector is only
3716 # enabled when not building on Chrome OS.
3717 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3719 'target_defaults': {
3721 '-fstack-protector',
3722 '--param=ssp-buffer-size=4',
3726 ['os_posix==1 and OS=="linux"', {
3728 '_LARGEFILE_SOURCE',
3729 '_LARGEFILE64_SOURCE',
3730 '_FILE_OFFSET_BITS=64',
3733 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3734 'target_defaults': {
3735 # Enable -Werror by default, but put it in a variable so it can
3736 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3738 'werror%': '-Werror',
3739 'libraries_for_target%': '',
3742 '_FILE_OFFSET_BITS=64',
3745 '<(werror)', # See note above about the werror variable.
3747 '-fno-strict-aliasing', # See http://crbug.com/32204
3749 # Don't warn about unused function params. We use those everywhere.
3750 '-Wno-unused-parameter',
3751 # Don't warn about the "struct foo f = {0};" initialization pattern.
3752 '-Wno-missing-field-initializers',
3753 # Don't export any symbols (for example, to plugins we dlopen()).
3754 # Note: this is *required* to make some plugins work.
3755 '-fvisibility=hidden',
3761 '-fno-threadsafe-statics',
3762 # Make inline functions have hidden visiblity by default.
3763 # Surprisingly, not covered by -fvisibility=hidden.
3764 '-fvisibility-inlines-hidden',
3765 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3766 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3770 '-pthread', '-Wl,-z,noexecstack',
3773 '<(libraries_for_target)',
3778 'debug_optimize%': '0',
3784 '-O>(debug_optimize)',
3788 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3789 # TODO(jdduke) Re-enable on mips after resolving linking
3790 # issues with libc++ (crbug.com/456380).
3792 # Warn in case of text relocations.
3793 '-Wl,--warn-shared-textrel',
3796 ['OS=="android" and android_full_debug==0', {
3797 # Some configurations are copied from Release_Base to reduce
3800 'debug_optimize%': 's',
3804 '-ffunction-sections',
3811 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3812 # We don't omit frame pointers on arm64 since they are required
3813 # to correctly unwind stackframes which contain system library
3814 # function frames (crbug.com/391706).
3816 '-fomit-frame-pointer',
3819 ['OS=="linux" and target_arch=="ia32"', {
3821 '-Wl,--no-as-needed',
3824 ['debug_unwind_tables==1', {
3825 'cflags': ['-funwind-tables'],
3827 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3828 'defines': ['NO_UNWIND_TABLES'],
3830 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3831 # definitions in to the right scope to use them when setting
3832 # linux_use_debug_fission, so it can be used here alone.
3833 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3834 'cflags': ['-gsplit-dwarf'],
3840 'release_optimize%': '2',
3841 # Binaries become big and gold is unable to perform GC
3842 # and remove unused sections for some of test targets
3843 # on 32 bit platform.
3844 # (This is currently observed only in chromeos valgrind bots)
3845 # The following flag is to disable --gc-sections linker
3846 # option for these bots.
3847 'no_gc_sections%': 0,
3849 # TODO(bradnelson): reexamine how this is done if we change the
3850 # expansion of configurations
3851 'release_valgrind_build%': 0,
3854 '-O<(release_optimize)',
3855 # Don't emit the GCC version ident directives, they just end up
3856 # in the .comment section taking up binary size.
3858 # Put data and code in their own sections, so that unused symbols
3859 # can be removed at link time with --gc-sections.
3861 '-ffunction-sections',
3864 # Specifically tell the linker to perform optimizations.
3865 # See http://lwn.net/Articles/192624/ .
3870 ['no_gc_sections==0', {
3872 '-Wl,--gc-sections',
3875 ['OS=="android" and target_arch!="arm64"', {
3876 # We don't omit frame pointers on arm64 since they are required
3877 # to correctly unwind stackframes which contain system library
3878 # function frames (crbug.com/391706).
3880 '-fomit-frame-pointer',
3883 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3884 # TODO(jdduke) Re-enable on mips after resolving linking
3885 # issues with libc++ (crbug.com/456380).
3887 # Warn in case of text relocations.
3888 '-Wl,--warn-shared-textrel',
3893 'release_optimize%': 's',
3898 '-fno-omit-frame-pointer',
3902 ['profiling_full_stack_frames==1', {
3905 '-fno-optimize-sibling-calls',
3910 ['release_unwind_tables==1', {
3911 'cflags': ['-funwind-tables'],
3913 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3914 'defines': ['NO_UNWIND_TABLES'],
3920 ['target_arch=="ia32"', {
3921 'target_conditions': [
3922 ['_toolset=="target"', {
3924 # Needed so that libs with .s files (e.g. libicudata.a)
3925 # are compatible with the general 32-bit-ness.
3928 # All floating-point computations on x87 happens in 80-bit
3929 # precision. Because the C and C++ language standards allow
3930 # the compiler to keep the floating-point values in higher
3931 # precision than what's specified in the source and doing so
3932 # is more efficient than constantly rounding up to 64-bit or
3933 # 32-bit precision as specified in the source, the compiler,
3934 # especially in the optimized mode, tries very hard to keep
3935 # values in x87 floating-point stack (in 80-bit precision)
3936 # as long as possible. This has important side effects, that
3937 # the real value used in computation may change depending on
3938 # how the compiler did the optimization - that is, the value
3939 # kept in 80-bit is different than the value rounded down to
3940 # 64-bit or 32-bit. There are possible compiler options to
3941 # make this behavior consistent (e.g. -ffloat-store would keep
3942 # all floating-values in the memory, thus force them to be
3943 # rounded to its original precision) but they have significant
3944 # runtime performance penalty.
3946 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3947 # which keep floating-point values in SSE registers in its
3948 # native precision (32-bit for single precision, and 64-bit
3949 # for double precision values). This means the floating-point
3950 # value used during computation does not change depending on
3951 # how the compiler optimized the code, since the value is
3952 # always kept in its specified precision.
3954 # Refer to http://crbug.com/348761 for rationale behind SSE2
3955 # being a minimum requirement for 32-bit Linux builds and
3956 # http://crbug.com/313032 for an example where this has "bit"
3961 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3968 # Use gold linker for Android ia32 target.
3970 # Use gold linker for Android ia32 target.
3974 # Use -mstackrealign due to a bug on ia32 Jelly Bean.
3975 # See crbug.com/521527
3984 ['target_arch=="x64"', {
3985 'target_conditions': [
3986 ['_toolset=="target"', {
3988 # Use gold linker for Android x64 target.
4005 ['target_arch=="arm"', {
4006 'target_conditions': [
4007 ['_toolset=="target"', {
4011 # The codesourcery arm-2009q3 toolchain warns at that the ABI
4012 # has changed whenever it encounters a varargs function. This
4013 # silences those warnings, as they are not helpful and
4014 # clutter legitimate warnings.
4018 ['clang==1 and arm_arch!="" and OS!="android"', {
4020 '-target arm-linux-gnueabihf',
4023 '-target arm-linux-gnueabihf',
4028 '-march=<(arm_arch)',
4031 ['use_lto==1 or use_lto_o2==1', {
4033 '-march=<(arm_arch)',
4038 ['clang==1 and OS!="android"', {
4040 # We need to disable clang's builtin assembler as it can't
4041 # handle several asm files, crbug.com/124610
4042 '-no-integrated-as',
4047 '-mtune=<(arm_tune)',
4050 ['use_lto==1 or use_lto_o2==1', {
4052 '-mtune=<(arm_tune)',
4062 ['use_lto==1 or use_lto_o2==1', {
4069 ['arm_float_abi!=""', {
4071 '-mfloat-abi=<(arm_float_abi)',
4074 ['use_lto==1 or use_lto_o2==1', {
4076 '-mfloat-abi=<(arm_float_abi)',
4086 ['use_lto==1 or use_lto_o2==1', {
4094 # Most of the following flags are derived from what Android
4095 # uses by default when building for arm, reference for which
4096 # can be found in the following file in the Android NDK:
4097 # toolchains/arm-linux-androideabi-4.9/setup.mk
4099 # The tree-sra optimization (scalar replacement for
4100 # aggregates enabling subsequent optimizations) leads to
4101 # invalid code generation when using the Android NDK's
4102 # compiler (r5-r7). This can be verified using
4103 # webkit_unit_tests' WTF.Checked_int8_t test.
4105 # The following option is disabled to improve binary
4106 # size and performance in gcc 4.9.
4107 '-fno-caller-saves',
4110 # Android now supports .relro sections properly.
4111 # NOTE: While these flags enable the generation of .relro
4112 # sections, the generated libraries can still be loaded on
4113 # older Android platform versions.
4120 ['gcc_version==48 and clang==0', {
4122 # The following 5 options are disabled to save on
4123 # binary size in GCC 4.8.
4124 '-fno-partial-inlining',
4125 '-fno-early-inlining',
4126 '-fno-tree-copy-prop',
4127 '-fno-tree-loop-optimize',
4128 '-fno-move-loop-invariants',
4132 'cflags': [ '-mthumb-interwork' ],
4136 # Thumb code with frame pointer makes chrome crash
4139 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
4140 # The perf report sometimes incorrectly attributes
4141 # code from tail calls.
4142 '-fno-optimize-sibling-calls',
4145 '-fomit-frame-pointer',
4150 # Clang does not support the following options.
4152 '-mthumb-interwork',
4153 '-finline-limit=64',
4155 '-fno-caller-saves',
4159 # TODO(hans) Enable integrated-as (crbug.com/124610).
4160 '-no-integrated-as',
4161 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4164 ['clang==1 and linux_use_bundled_gold==0', {
4166 # Let clang find the ld.gold in the NDK.
4167 '--gcc-toolchain=<(android_toolchain)/..',
4172 '-marm', # Required for frame pointer based stack traces.
4179 # We set arm_arch to "" so that -march compiler option
4180 # is not set. Otherwise a gcc bug that would complain
4181 # about it conflicting with '-mcpu=cortex-a9'. The flag
4182 # '-march=armv7-a' is actually redundant anyway because
4183 # it is enabled by default when we built the toolchain.
4184 # And using '-mcpu=cortex-a9' should be sufficient.
4187 # Breakpad requires symbols with debugging information
4191 # We want to statically link libstdc++/libgcc_s.
4192 '-static-libstdc++',
4196 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4197 # define their own cflags for arm builds that could
4198 # conflict with the flags we set here (e.g.
4199 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4208 ['target_arch=="arm64"', {
4209 'target_conditions': [
4210 ['_toolset=="target"', {
4214 '-fstack-protector', # stack protector is always enabled on arm64.
4221 ['target_arch=="mipsel"', {
4222 'target_conditions': [
4223 ['_toolset=="target"', {
4225 ['mips_arch_variant=="r6"', {
4228 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ],
4229 'ldflags': [ '-target mipsel-linux-gnu', ],
4231 'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
4233 ['clang==0 and OS=="android"', {
4234 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4238 ['mips_arch_variant=="r2"', {
4240 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4241 'cflags': ['-m<(mips_fpu_mode)'],
4246 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
4247 'ldflags': [ '-target mipsel-linux-android', ],
4249 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32r2'],
4250 'ldflags': [ '-target mipsel-linux-gnu', ],
4254 'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
4258 ['mips_arch_variant=="r1"', {
4263 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
4264 'ldflags': [ '-target mipsel-linux-android', ],
4266 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32'],
4267 'ldflags': [ '-target mipsel-linux-gnu', ],
4271 'cflags': ['-mips32', '-Wa,-mips32', ],
4277 # Clang does not support the following options.
4278 '-finline-limit=64',
4281 # TODO(gordanac) Enable integrated-as.
4282 '-no-integrated-as',
4285 ['clang==1 and OS=="android"', {
4287 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4290 # Let clang find the ld in the NDK.
4291 '--gcc-toolchain=<(android_toolchain)/..',
4294 ['mips_dsp_rev==1', {
4295 'cflags': ['-mdsp'],
4297 ['mips_dsp_rev==2', {
4298 'cflags': ['-mdspr2'],
4302 '-m<(mips_float_abi)-float'
4305 '-Wl,--no-keep-memory'
4308 '-Wno-uninitialized',
4313 ['target_arch=="mips64el"', {
4314 'target_conditions': [
4315 ['_toolset=="target"', {
4317 ['mips_arch_variant=="r6"', {
4318 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4319 'ldflags': ['-mips64r6'],
4321 ['mips_arch_variant=="r2"', {
4322 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4323 'ldflags': ['-mips64r2'],
4327 '-Wno-uninitialized',
4341 'target_conditions': [
4342 ['_toolset=="target"', {
4344 '--sysroot=<(sysroot)',
4347 '--sysroot=<(sysroot)',
4348 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4354 # TODO(thakis): Remove, http://crbug.com/263960
4355 '-Wno-reserved-user-defined-literal',
4358 # gnu++11 instead of c++11 is needed because some code uses
4359 # typeof() (a GNU extension).
4360 # TODO(thakis): Eventually switch this to c++11 instead,
4361 # http://crbug.com/427584
4365 ['clang==0 and host_clang==1', {
4366 'target_conditions': [
4367 ['_toolset=="host"', {
4368 'cflags_cc': [ '-std=gnu++11', ],
4372 ['clang==1 and clang_use_chrome_plugins==1', {
4374 '<@(clang_chrome_plugins_flags)',
4377 ['clang==1 and clang_load!=""', {
4379 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4382 ['clang==1 and clang_add_plugin!=""', {
4384 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4387 ['clang==1 and target_arch=="ia32"', {
4389 # Else building libyuv gives clang's register allocator issues,
4390 # see llvm.org/PR15798 / crbug.com/233709
4391 '-momit-leaf-frame-pointer',
4392 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4393 '-mstack-alignment=16',
4397 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4399 # See http://crbug.com/110262
4400 '-fcolor-diagnostics',
4403 # Common options for AddressSanitizer, LeakSanitizer,
4404 # ThreadSanitizer, MemorySanitizer and non-official CFI builds.
4405 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1 or '
4406 '(cfi_vptr==1 and buildtype!="Official")', {
4407 'target_conditions': [
4408 ['_toolset=="target"', {
4410 '-fno-omit-frame-pointer',
4411 '-gline-tables-only',
4414 '-fomit-frame-pointer',
4419 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4420 'target_conditions': [
4421 ['_toolset=="target"', {
4423 # Functions interposed by the sanitizers can make ld think
4424 # that some libraries aren't needed when they actually are,
4425 # http://crbug.com/234010. As workaround, disable --as-needed.
4429 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4430 'MEMORY_SANITIZER_INITIAL_SIZE',
4436 'target_conditions': [
4437 ['_toolset=="target"', {
4439 '-fsanitize=address',
4440 # TODO(earthdok): Re-enable. http://crbug.com/427202
4441 #'-fsanitize-blacklist=<(asan_blacklist)',
4444 '-fsanitize=address',
4451 '-mllvm -asan-globals=0', # http://crbug.com/352073
4457 'target_conditions': [
4458 ['_toolset=="target"', {
4460 # FIXME: work on enabling more flags and getting rid of false
4461 # positives. http://crbug.com/174801.
4462 '-fsanitize=bounds',
4463 '-fsanitize=float-divide-by-zero',
4464 '-fsanitize=integer-divide-by-zero',
4466 '-fsanitize=object-size',
4467 '-fsanitize=return',
4468 '-fsanitize=returns-nonnull-attribute',
4469 '-fsanitize=shift-exponent',
4470 '-fsanitize=signed-integer-overflow',
4471 '-fsanitize=unreachable',
4472 '-fsanitize=vla-bound',
4473 '-fsanitize-blacklist=<(ubsan_blacklist)',
4474 # Employ the experimental PBQP register allocator to avoid
4475 # slow compilation on files with too many basic blocks.
4476 # See http://crbug.com/426271.
4477 '-mllvm -regalloc=pbqp',
4478 # Speculatively use coalescing to slightly improve the code
4479 # generated by PBQP regallocator. May increase compile time.
4480 '-mllvm -pbqp-coalescing',
4489 '-fsanitize=undefined',
4492 'UNDEFINED_SANITIZER',
4498 'target_conditions': [
4499 ['_toolset=="target"', {
4502 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4514 'UNDEFINED_SANITIZER',
4519 ['asan_coverage!=0 and sanitizer_coverage==0', {
4520 'target_conditions': [
4521 ['_toolset=="target"', {
4523 '-fsanitize-coverage=<(asan_coverage)',
4526 'SANITIZER_COVERAGE',
4531 ['sanitizer_coverage!=0', {
4532 'target_conditions': [
4533 ['_toolset=="target"', {
4535 '-fsanitize-coverage=<(sanitizer_coverage)',
4538 'SANITIZER_COVERAGE',
4543 ['(asan_coverage>1 or sanitizer_coverage>1) and target_arch=="arm"', {
4544 'target_conditions': [
4545 ['_toolset=="target"', {
4547 '-mllvm -sanitizer-coverage-block-threshold=0', # http://crbug.com/517105
4552 ['asan_field_padding!=0', {
4553 'target_conditions': [
4554 ['_toolset=="target"', {
4556 '-fsanitize-address-field-padding=<(asan_field_padding)',
4562 'target_conditions': [
4563 ['_toolset=="target"', {
4572 'WTF_USE_LEAK_SANITIZER=1',
4578 'target_conditions': [
4579 ['_toolset=="target"', {
4581 '-fsanitize=thread',
4582 '-fsanitize-blacklist=<(tsan_blacklist)',
4585 '-fsanitize=thread',
4589 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4590 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4596 'target_conditions': [
4597 ['_toolset=="target"', {
4599 '-fsanitize=memory',
4600 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4601 '-fsanitize-blacklist=<(msan_blacklist)',
4604 '-fsanitize=memory',
4612 ['use_instrumented_libraries==1', {
4614 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4617 ['use_prebuilt_instrumented_libraries==1', {
4619 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
4622 ['use_custom_libcxx==1', {
4624 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4627 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4628 'target_conditions' : [
4629 # crazy_linker has an upstream gyp file we can't edit, and we
4630 # don't want to instrument it.
4631 ['_toolset=="target" and _target_name!="crazy_linker"', {
4633 '-finstrument-functions',
4634 # Allow mmx intrinsics to inline, so that the
4635 #0 compiler can expand the intrinsics.
4636 '-finstrument-functions-exclude-file-list=mmintrin.h',
4639 ['_toolset=="target" and OS=="android"', {
4641 # Avoids errors with current NDK:
4642 # "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"
4643 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4648 ['linux_dump_symbols==1', {
4651 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4652 'target_conditions': [
4653 ['_toolset=="target"', {
4655 # Attempt to use less memory to prevent the linker from
4656 # running out of address space. Considering installing a
4657 # 64-bit kernel and switching to a 64-bit linker.
4658 '-Wl,--no-keep-memory',
4665 ['use_allocator!="tcmalloc"', {
4666 'defines': ['NO_TCMALLOC'],
4668 ['linux_use_gold_flags==1', {
4669 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4671 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4672 'ldflags': [ '-fuse-ld=gold', ],
4674 'target_conditions': [
4675 ['_toolset=="target"', {
4677 # Experimentation found that using four linking threads
4678 # saved ~20% of link time.
4679 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4680 # Only apply this to the target linker, since the host
4681 # linker might not be gold, but isn't used much anyway.
4682 # TODO(raymes): Disable threading because gold is frequently
4683 # crashing on the bots: crbug.com/161942.
4685 # '-Wl,--thread-count=4',
4688 # TODO(thestig): Enable this for disabled cases.
4689 [ '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', {
4691 '-Wl,--detect-odr-violations',
4698 ['release_valgrind_build==0 and order_profiling==0 and asan==0 and msan==0 and lsan==0 and tsan==0', {
4699 'target_conditions': [
4700 ['_toolset=="target"', {
4702 '-Wl,--icf=<(gold_icf_level)',
4709 ['linux_use_bundled_binutils==1', {
4711 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4714 ['linux_use_bundled_gold==1 and '
4715 'not (clang==0 and (use_lto==1 or use_lto_o2==1))', {
4716 # Put our binutils, which contains gold in the search path. We pass
4717 # the path to gold to the compiler. gyp leaves unspecified what the
4718 # cwd is when running the compiler, so the normal gyp path-munging
4719 # fails us. This hack gets the right path.
4721 # Disabled when using GCC LTO because GCC also uses the -B search
4722 # path at link time to find "as", and our bundled "as" can only
4725 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4728 # Some binutils 2.23 releases may or may not have new dtags enabled,
4729 # but they are all compatible with --disable-new-dtags,
4730 # because the new dynamic tags are not created by default.
4731 ['binutils_version>=223', {
4732 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4733 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4734 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4735 # inside this file to allow usage of --no-as-needed and removal of
4738 '-Wl,--disable-new-dtags',
4741 ['gcc_version>=47 and clang==0', {
4742 'target_conditions': [
4743 ['_toolset=="target"', {
4746 # See comment for -Wno-c++11-narrowing.
4748 # TODO(thakis): Remove, http://crbug.com/263960
4749 '-Wno-literal-suffix',
4754 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4755 'target_conditions': [
4756 ['_toolset=="host"', {
4759 # See comment for -Wno-c++11-narrowing.
4761 # TODO(thakis): Remove, http://crbug.com/263960
4762 '-Wno-literal-suffix',
4770 # FreeBSD-specific options; note that most FreeBSD options are set above,
4773 'target_defaults': {
4775 '-Wl,--no-keep-memory',
4779 # Android-specific options; note that most are set above with Linux.
4782 # This is a unique identifier for a given build. It's used for
4783 # identifying various build artifacts corresponding to a particular
4784 # build of chrome (e.g. where to find archived symbols).
4785 'chrome_build_id%': '',
4787 # Placing this variable here prevents from forking libvpx, used
4788 # by remoting. Remoting is off, so it needn't built,
4789 # so forking it's deps seems like overkill.
4790 # But this variable need defined to properly run gyp.
4791 # A proper solution is to have an OS==android conditional
4792 # in third_party/libvpx/libvpx.gyp to define it.
4793 'libvpx_path': 'lib/linux/arm',
4795 'target_defaults': {
4797 'release_extra_cflags%': '',
4799 # If we're using the components build, append "cr" to all shared
4800 # libraries to avoid naming collisions with android system library
4801 # versions with the same name (e.g. skia, icu).
4802 ['component=="shared_library"', {
4803 'android_product_extension': 'cr.so',
4805 'android_product_extension': 'so',
4809 'target_conditions': [
4810 ['_type=="shared_library"', {
4811 'product_extension': '<(android_product_extension)',
4814 # Settings for building device targets using Android's toolchain.
4815 # These are based on the setup.mk file from the Android NDK.
4817 # The NDK Android executable link step looks as follows:
4819 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4820 # $(PRIVATE_OBJECTS) <-- The .o that we built
4821 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4822 # $(TARGET_LIBGCC) <-- libgcc.a
4823 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4824 # $(PRIVATE_LDLIBS) <-- System .so
4825 # $(TARGET_CRTEND_O) <-- crtend.o
4827 # For now the above are approximated for executables by adding
4828 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4831 # The NDK Android shared library link step looks as follows:
4833 # $(PRIVATE_OBJECTS) <-- The .o that we built
4834 # -l,--whole-archive
4835 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4836 # -l,--no-whole-archive
4837 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4838 # $(TARGET_LIBGCC) <-- libgcc.a
4839 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4840 # $(PRIVATE_LDLIBS) <-- System .so
4842 # For now, assume that whole static libraries are not needed.
4844 # For both executables and shared libraries, add the proper
4845 # libgcc.a to the start of libraries which puts it in the
4846 # proper spot after .o and .a files get linked in.
4848 # TODO: The proper thing to do longer-tem would be proper gyp
4849 # support for a custom link command line.
4850 ['_toolset=="target"', {
4852 '-pthread', # Not supported by Android toolchain.
4855 '-ffunction-sections',
4858 '-fstack-protector',
4860 '-finline-limit=64',
4861 '<@(release_extra_cflags)',
4862 '--sysroot=<(android_ndk_sysroot)',
4863 # NOTE: The libc++ header include paths below are specified in
4864 # cflags rather than include_dirs because they need to come
4865 # after include_dirs.
4866 # The include ordering here is important; change with caution.
4867 '-isystem<(android_libcpp_include)',
4868 '-isystem<(android_ndk_root)/sources/cxx-stl/llvm-libc++abi/libcxxabi/include',
4869 '-isystem<(android_ndk_root)/sources/android/support/include',
4873 '__GNU_SOURCE=1', # Necessary for clone()
4874 'CHROME_BUILD_ID="<(chrome_build_id)"',
4875 # The NDK has these things, but doesn't define the constants
4876 # to say that it does. Define them here instead.
4880 '-pthread', # Not supported by Android toolchain.
4883 '-Wl,--build-id=sha1',
4884 '-Wl,--no-undefined',
4885 '--sysroot=<(android_ndk_sysroot)',
4887 '-L<(android_libcpp_libs_dir)',
4888 # Don't allow visible symbols from libgcc or libc++ to be
4890 '-Wl,--exclude-libs=libgcc.a',
4891 '-Wl,--exclude-libs=libc++_static.a',
4892 # Don't allow visible symbols from libraries that contain
4893 # assembly code with symbols that aren't hidden properly.
4894 # http://crbug.com/448386
4895 '-Wl,--exclude-libs=libcommon_audio.a',
4896 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4897 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4898 '-Wl,--exclude-libs=libiSACFix.a',
4899 '-Wl,--exclude-libs=libisac_neon.a',
4900 '-Wl,--exclude-libs=libopus.a',
4901 '-Wl,--exclude-libs=libvpx.a',
4904 '-l<(android_libcpp_library)',
4906 # Manually link the libgcc.a that the cross compiler uses.
4907 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4913 ['component=="static_library"', {
4914 'target_conditions': [
4915 ['use_native_jni_exports==0', {
4916 # Use a linker version script to strip JNI exports from
4917 # binaries which have not specifically asked to use them.
4919 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4926 # Clang with libc++ does not require an explicit atomic
4927 # library reference.
4931 # Work around incompatibilities between bionic and clang
4933 '-D__compiler_offsetof=__builtin_offsetof',
4934 '-Dnan=__builtin_nan',
4937 # Clang does not support the following options.
4938 '-finline-limit=64',
4941 ['target_arch=="arm"', {
4943 '-target arm-linux-androideabi',
4946 '-target arm-linux-androideabi',
4949 ['target_arch=="ia32"', {
4951 '-target i686-linux-androideabi',
4954 '-target i686-linux-androideabi',
4957 # Place holder for x64 support, not tested.
4958 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4959 ['target_arch=="x64"', {
4961 '-target x86_64-linux-androideabi',
4964 '-target x86_64-linux-androideabi',
4971 # Android build relies on -Wl,--gc-sections removing
4972 # unreachable code. ASan instrumentation for globals inhibits
4973 # this and results in a library with unresolvable relocations.
4974 # TODO(eugenis): find a way to reenable this.
4975 '-mllvm -asan-globals=0',
4978 ['target_arch == "arm" and order_profiling==0', {
4980 # Enable identical code folding to reduce size.
4981 '-Wl,--icf=<(gold_icf_level)',
4984 ['target_arch=="ia32"', {
4985 # The x86 toolchain currently has problems with stack-protector.
4987 '-fstack-protector',
4990 '-fno-stack-protector',
4994 'target_conditions': [
4995 ['_type=="executable"', {
4996 # Force android tools to export the "main" symbol so they can be
4997 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4998 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4999 # when ICS support will be dropped.
5002 '-fvisibility=default',
5006 '-Wl,--gc-sections',
5007 '-Wl,-z,nocopyreloc',
5010 # crtbegin_dynamic.o should be the last item in ldflags.
5011 '<(android_ndk_lib)/crtbegin_dynamic.o',
5014 # crtend_android.o needs to be the last item in libraries.
5015 # Do not add any libraries after this!
5016 '<(android_ndk_lib)/crtend_android.o',
5019 ['_type=="shared_library" or _type=="loadable_module"', {
5021 '-Wl,-shared,-Bsymbolic',
5022 # crtbegin_so.o should be the last item in ldflags.
5023 '<(android_ndk_lib)/crtbegin_so.o',
5026 # crtend_so.o needs to be the last item in libraries.
5027 # Do not add any libraries after this!
5028 '<(android_ndk_lib)/crtend_so.o',
5033 # Settings for building host targets using the system toolchain.
5034 ['_toolset=="host"', {
5036 # Due to issues in Clang build system, using ASan on 32-bit
5037 # binaries on x86_64 host is problematic.
5038 # TODO(eugenis): re-enable.
5039 '-fsanitize=address',
5042 '-fsanitize=address',
5043 '-Wl,-z,noexecstack',
5044 '-Wl,--gc-sections',
5047 '-Wl,--warn-shared-textrel',
5048 '-Wl,--fatal-warnings',
5051 # Settings for building host targets on mac.
5052 ['_toolset=="host" and host_os=="mac"', {
5062 'cflags!': ['-fvisibility=hidden'],
5063 'cflags_cc!': ['-fvisibility-inlines-hidden'],
5065 ['OS=="mac" or OS=="ios"', {
5066 'target_defaults': {
5069 'ALWAYS_SEARCH_USER_PATHS': 'NO',
5070 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
5071 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
5072 'COPY_PHASE_STRIP': 'NO',
5073 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
5074 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
5075 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
5076 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
5077 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
5078 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
5079 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
5080 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
5081 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
5082 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
5083 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
5084 'GCC_VERSION': '4.2',
5085 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
5086 'USE_HEADERMAP': 'NO',
5091 # Don't warn about unused function parameters.
5092 '-Wno-unused-parameter',
5093 # Don't warn about the "struct foo f = {0};" initialization
5095 '-Wno-missing-field-initializers',
5098 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
5099 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
5101 # Note that the prebuilt Clang binaries should not be used for iOS
5102 # development except for ASan builds.
5104 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
5105 # Warn if automatic synthesis is triggered with
5106 # the -Wobjc-missing-property-synthesis flag.
5107 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
5108 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
5110 # This warns on selectors from Cocoa headers (-length, -set).
5111 # cfe-dev is currently discussing the merits of this warning.
5112 # TODO(thakis): Reevaluate what to do with this, based one
5113 # cfe-dev discussion.
5114 '-Wno-selector-type-mismatch',
5117 ['clang_xcode==0', {
5118 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
5119 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
5123 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
5125 '<@(clang_chrome_plugins_flags)',
5128 ['clang==1 and clang_xcode==0 and clang_load!=""', {
5130 '-Xclang', '-load', '-Xclang', '<(clang_load)',
5133 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
5135 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
5138 ['clang==1 and "<(GENERATOR)"=="ninja"', {
5140 # See http://crbug.com/110262
5141 '-fcolor-diagnostics',
5144 ['OS=="ios" and target_subarch!="arm32" and \
5145 "<(GENERATOR)"=="xcode"', {
5147 # TODO(ios): when building Chrome for iOS on 64-bit platform
5148 # with Xcode, the -Wshorted-64-to-32 warning is automatically
5149 # enabled. This cause failures when compiling protobuf code,
5150 # so disable the warning. http://crbug.com/359107
5151 '-Wno-shorten-64-to-32',
5159 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
5165 '-fsanitize=address',
5166 '-mllvm -asan-globals=0', # http://crbug.com/352073
5167 '-gline-tables-only',
5171 ['asan_coverage!=0 and sanitizer_coverage==0', {
5172 'target_conditions': [
5173 ['_toolset=="target"', {
5175 '-fsanitize-coverage=<(asan_coverage)',
5178 'SANITIZER_COVERAGE',
5183 ['sanitizer_coverage!=0', {
5184 'target_conditions': [
5185 ['_toolset=="target"', {
5187 '-fsanitize-coverage=<(sanitizer_coverage)',
5190 'SANITIZER_COVERAGE',
5196 'target_conditions': [
5197 ['_type!="static_library"', {
5198 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5203 '-fsanitize=address',
5207 ['mac_write_linker_maps==1', {
5210 '-Wl,-map,>(_target_name).map',
5217 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5218 'target_conditions': [
5219 ['_type=="executable"', {
5225 # Define copy_asan_dylib_path in a variable ending in
5226 # _path so that gyp understands it's a path and
5227 # performs proper relativization during dict merging.
5228 'copy_asan_dylib_path':
5229 'mac/copy_asan_runtime_dylib.sh',
5231 'postbuild_name': 'Copy ASan runtime dylib',
5233 '<(copy_asan_dylib_path)',
5242 ], # target_conditions
5243 }, # target_defaults
5244 }], # OS=="mac" or OS=="ios"
5246 'target_defaults': {
5248 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5249 # with common names, like 'check', 'require', and 'verify'.
5250 # (Included by system header. Also exists on iOS but not included.)
5251 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5252 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5255 # These should end with %, but there seems to be a bug with % in
5256 # variables that are intended to be set to different values in
5257 # different targets, like these.
5258 'mac_pie': 1, # Most executables can be position-independent.
5259 # Strip debugging symbols from the target.
5260 'mac_strip': '<(mac_strip_release)',
5264 ['mac_want_real_dsym=="default"', {
5267 'mac_real_dsym': '<(mac_want_real_dsym)'
5272 ['mac_want_real_dsym=="default"', {
5273 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5275 'mac_real_dsym': '<(mac_want_real_dsym)'
5284 ['branding=="Chrome" and buildtype=="Official"', {
5287 # The Google Chrome Framework dSYM generated by dsymutil has
5288 # grown larger than 4GB, which dsymutil can't handle. Reduce
5289 # the amount of debug symbols.
5290 '-fno-standalone-debug', # See http://crbug.com/479841
5295 }, # configuration "Release"
5298 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5299 # (Equivalent to -fPIC)
5300 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5301 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5302 # Keep pch files below xcodebuild/.
5303 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5305 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5306 # xcode_setting, but not until all downstream projects' mac bots are
5307 # using xcode >= 4.6, because that's when the default value of the
5308 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5309 # setting is a no-op as far as xcode is concerned, but the compiler
5310 # behaves differently based on whether -fno-strict-aliasing is
5312 '-fno-strict-aliasing', # See http://crbug.com/32204.
5315 'target_conditions': [
5316 ['_type=="executable"', {
5319 # Arranges for data (heap) pages to be protected against
5320 # code execution when running on Mac OS X 10.7 ("Lion"), and
5321 # ensures that the position-independent executable (PIE) bit
5322 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5324 # Define change_mach_o_flags in a variable ending in _path
5325 # so that GYP understands it's a path and performs proper
5326 # relativization during dict merging.
5327 'change_mach_o_flags_path':
5328 'mac/change_mach_o_flags_from_xcode.sh',
5329 'change_mach_o_flags_options%': [
5331 'target_conditions': [
5332 ['mac_pie==0 or release_valgrind_build==1', {
5333 # Don't enable PIE if it's unwanted. It's unwanted if
5334 # the target specifies mac_pie=0 or if building for
5335 # Valgrind, because Valgrind doesn't understand slide.
5336 # See the similar mac_pie/release_valgrind_build check
5338 'change_mach_o_flags_options': [
5344 'postbuild_name': 'Change Mach-O Flags',
5346 '<(change_mach_o_flags_path)',
5347 '>@(change_mach_o_flags_options)',
5351 'target_conditions': [
5352 ['mac_pie==1 and release_valgrind_build==0', {
5353 # Turn on position-independence (ASLR) for executables. When
5354 # PIE is on for the Chrome executables, the framework will
5355 # also be subject to ASLR.
5356 # Don't do this when building for Valgrind, because Valgrind
5357 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5358 # understand slide, and get rid of the Valgrind check.
5361 '-Wl,-pie', # Position-independent executable (MH_PIE)
5367 ['(_type=="executable" or _type=="shared_library" or \
5368 _type=="loadable_module") and mac_strip!=0', {
5369 'target_conditions': [
5370 ['mac_real_dsym == 1', {
5371 # To get a real .dSYM bundle produced by dsymutil, set the
5372 # debug information format to dwarf-with-dsym. Since
5373 # strip_from_xcode will not be used, set Xcode to do the
5374 # stripping as well.
5378 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5379 'DEPLOYMENT_POSTPROCESSING': 'YES',
5380 'STRIP_INSTALLED_PRODUCT': 'YES',
5382 # Only strip non-ASan builds.
5384 'target_conditions': [
5385 ['_type=="shared_library" or _type=="loadable_module"', {
5386 # The Xcode default is to strip debugging symbols
5387 # only (-S). Local symbols should be stripped as
5388 # well, which will be handled by -x. Xcode will
5389 # continue to insert -S when stripping even when
5390 # additional flags are added with STRIPFLAGS.
5392 }], # _type=="shared_library" or _type=="loadable_module"
5393 ], # target_conditions
5399 }, # configuration "Release"
5401 }, { # mac_real_dsym != 1
5402 # To get a fast fake .dSYM bundle, use a post-build step to
5403 # produce the .dSYM and strip the executable. strip_from_xcode
5404 # only operates in the Release configuration.
5408 # Define strip_from_xcode in a variable ending in _path
5409 # so that gyp understands it's a path and performs proper
5410 # relativization during dict merging.
5411 'strip_from_xcode_path': 'mac/strip_from_xcode',
5413 'postbuild_name': 'Strip If Needed',
5414 'action': ['<(strip_from_xcode_path)'],
5418 ], # target_conditions
5419 }], # (_type=="executable" or _type=="shared_library" or
5420 # _type=="loadable_module") and mac_strip!=0
5421 ], # target_conditions
5422 }, # target_defaults
5426 'ios/coverage.gypi',
5428 'target_defaults': {
5429 'xcode_settings' : {
5430 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5431 'ENABLE_BITCODE': 'NO',
5434 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5435 # additional flag to suppress the "unknown compiler option" error.
5436 # Restrict this flag to builds that are either compiling with Xcode
5437 # or compiling with Xcode's Clang. This will allow Ninja builds to
5438 # continue failing on unknown compiler options.
5439 # TODO(rohitrao): This flag is temporary and should be removed as
5440 # soon as the iOS bots are updated to use Xcode 5.1.
5441 ['clang_xcode==1', {
5443 '-Wno-unknown-warning-option',
5444 # It's not possible to achieve nullability completeness before
5445 # all builders are running Xcode 7. crbug.com/499809
5446 '-Wno-nullability-completeness',
5450 # Limit the valid architectures depending on "target_subarch".
5451 # This need to include the "arm" architectures but also the "x86"
5452 # ones (they are used when building for the simulator).
5453 ['target_subarch=="arm32"', {
5454 'VALID_ARCHS': ['armv7', 'i386'],
5456 ['target_subarch=="arm64"', {
5457 'VALID_ARCHS': ['arm64', 'x86_64'],
5459 ['target_subarch=="both"', {
5460 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5462 ['use_system_libcxx==1', {
5463 'target_conditions': [
5464 # Only use libc++ when building target for iOS not when building
5465 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5466 # does not support libc++.
5467 ['_toolset=="target"', {
5468 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5472 # The default for deployment target of 7.0+ is libc++, so force
5473 # the old behavior unless libc++ is enabled.
5474 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5478 'target_conditions': [
5479 ['_toolset=="host"', {
5481 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5482 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5491 ['_toolset=="target"', {
5493 # This section should be for overriding host settings. But,
5494 # since we can't negate the iphone deployment target above, we
5495 # instead set it here for target only.
5496 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5497 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5500 ['_type=="executable"', {
5504 'DEPLOYMENT_POSTPROCESSING': 'YES',
5505 'STRIP_INSTALLED_PRODUCT': 'YES',
5507 ['buildtype!="Official"', {
5508 # Remove dSYM to reduce build time.
5509 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5516 # Remove dSYM to reduce build time.
5517 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5523 ['chromium_ios_signing', {
5524 # iOS SDK wants everything for device signed.
5525 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5527 'CODE_SIGNING_REQUIRED': 'NO',
5528 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5533 ], # target_conditions
5534 }, # target_defaults
5537 'target_defaults': {
5539 '_WIN32_WINNT=0x0603',
5546 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5547 'WIN32_LEAN_AND_MEAN',
5550 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5551 '_HAS_EXCEPTIONS=0',
5552 # Silence some warnings; we can't switch the the 'recommended'
5553 # versions as they're not available on old OSs.
5554 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5557 ['buildtype=="Official"', {
5558 # In official builds, targets can self-select an optimization
5559 # level by defining a variable named 'optimize', and setting it
5561 # - "size", optimizes for minimal code size - the default.
5562 # - "speed", optimizes for speed over code size.
5563 # - "max", whole program optimization and link-time code
5564 # generation. This is very expensive and should be used
5567 'optimize%': 'size',
5571 # Set /LTCG for the official builds.
5572 'LinkTimeCodeGeneration': '1',
5573 'AdditionalOptions': [
5574 # Set the number of LTCG code-gen threads to eight.
5575 # The default is four. This gives a 5-10% link speedup.
5580 'target_conditions': [
5581 ['optimize=="size"', {
5583 'VCCLCompilerTool': {
5584 # 1, optimizeMinSpace, Minimize Size (/O1)
5585 'Optimization': '1',
5586 # 2, favorSize - Favor small code (/Os)
5587 'FavorSizeOrSpeed': '2',
5592 # This config is used to avoid a problem in ffmpeg, see
5593 # http://crbug.com/264459.
5594 ['optimize=="size_no_ltcg"', {
5596 'VCCLCompilerTool': {
5597 # 1, optimizeMinSpace, Minimize Size (/O1)
5598 'Optimization': '1',
5599 # 2, favorSize - Favor small code (/Os)
5600 'FavorSizeOrSpeed': '2',
5605 ['optimize=="speed"', {
5607 'VCCLCompilerTool': {
5608 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5609 'Optimization': '2',
5610 # 1, favorSpeed - Favor fast code (/Ot)
5611 'FavorSizeOrSpeed': '1',
5616 ['optimize=="max"', {
5617 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5618 # builds. Probably anything that this would catch that
5619 # wouldn't be caught in a normal build isn't going to
5620 # actually be a bug, so the incremental value of C4702 for
5621 # PGO builds is likely very small.
5622 'msvs_disabled_warnings': [
5626 'VCCLCompilerTool': {
5627 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5628 'Optimization': '2',
5629 # 1, favorSpeed - Favor fast code (/Ot)
5630 'FavorSizeOrSpeed': '1',
5631 # This implies link time code generation.
5632 'WholeProgramOptimization': 'true',
5640 ['msvs_xtree_patched!=1', {
5641 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5642 # it's enabled. This will generally only be true for system-level
5643 # installed Express users.
5644 'msvs_disabled_warnings': [
5649 'msvs_system_include_dirs': [
5650 '<(windows_sdk_path)/Include/shared',
5651 '<(windows_sdk_path)/Include/um',
5652 '<(windows_sdk_path)/Include/winrt',
5653 '$(VSInstallDir)/VC/atlmfc/include',
5655 'msvs_cygwin_shell': 0,
5656 'msvs_disabled_warnings': [
5657 # C4091: 'typedef ': ignored on left of 'X' when no variable is
5659 # This happens in a number of Windows headers. Dumb.
5662 # C4127: conditional expression is constant
5663 # This warning can in theory catch dead code and other problems, but
5664 # triggers in far too many desirable cases where the conditional
5665 # expression is either set by macros or corresponds some legitimate
5666 # compile-time constant expression (due to constant template args,
5667 # conditionals comparing the sizes of different types, etc.). Some of
5668 # these can be worked around, but it's not worth it.
5671 # C4351: new behavior: elements of array 'array' will be default
5673 # This is a silly "warning" that basically just alerts you that the
5674 # compiler is going to actually follow the language spec like it's
5675 # supposed to, instead of not following it like old buggy versions
5676 # did. There's absolutely no reason to turn this on.
5679 # C4355: 'this': used in base member initializer list
5680 # It's commonly useful to pass |this| to objects in a class'
5681 # initializer list. While this warning can catch real bugs, most of
5682 # the time the constructors in question don't attempt to call methods
5683 # on the passed-in pointer (until later), and annotating every legit
5684 # usage of this is simply more hassle than the warning is worth.
5687 # C4503: 'identifier': decorated name length exceeded, name was
5689 # This only means that some long error messages might have truncated
5690 # identifiers in the presence of lots of templates. It has no effect
5691 # on program correctness and there's no real reason to waste time
5692 # trying to prevent it.
5695 # Warning C4589 says: "Constructor of abstract class ignores
5696 # initializer for virtual base class." Disable this warning because it
5697 # is flaky in VS 2015 RTM. It triggers on compiler generated
5698 # copy-constructors in some cases.
5701 # C4611: interaction between 'function' and C++ object destruction is
5703 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5704 # suggests using exceptions instead of setjmp/longjmp for C++, but
5705 # Chromium code compiles without exception support. We therefore have
5706 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5707 # means we have to turn off this warning (and be careful about how
5708 # object destruction happens in such cases).
5711 # TODO(maruel): These warnings are level 4. They will be slowly
5712 # removed as code is fixed.
5713 4100, # Unreferenced formal parameter
5714 4121, # Alignment of a member was sensitive to packing
5715 4244, # Conversion from 'type1' to 'type2', possible loss of data
5716 4481, # Nonstandard extension used: override specifier 'keyword'
5717 4505, # Unreferenced local function has been removed
5718 4510, # Default constructor could not be generated
5719 4512, # Assignment operator could not be generated
5720 4610, # Object can never be instantiated
5721 4838, # Narrowing conversion. Doesn't seem to be very useful.
5722 4995, # 'X': name was marked as #pragma deprecated
5723 4996, # 'X': was declared deprecated (for GetVersionEx).
5725 # These are variable shadowing warnings that are new in VS2015. We
5726 # should work through these at some point -- they may be removed from
5727 # the RTM release in the /W4 set.
5728 4456, 4457, 4458, 4459,
5731 'VCCLCompilerTool': {
5732 'AdditionalOptions': ['/MP'],
5733 'MinimalRebuild': 'false',
5734 'BufferSecurityCheck': 'true',
5735 'EnableFunctionLevelLinking': 'true',
5736 'RuntimeTypeInfo': 'false',
5737 'WarningLevel': '4',
5738 'WarnAsError': 'true',
5739 'DebugInformationFormat': '3',
5740 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5741 'ExceptionHandling': '0',
5743 'VCLibrarianTool': {
5744 'AdditionalOptions': ['/ignore:4221'],
5745 'AdditionalLibraryDirectories': [
5746 '<(windows_sdk_path)/Lib/win8/um/x86',
5750 'AdditionalDependencies': [
5762 'AdditionalLibraryDirectories': [
5763 '<(windows_sdk_path)/Lib/win8/um/x86',
5765 'GenerateDebugInformation': 'true',
5766 'MapFileName': '$(OutDir)\\$(TargetName).map',
5767 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5768 'FixedBaseAddress': '1',
5771 # 1 == /SUBSYSTEM:CONSOLE
5772 # 2 == /SUBSYSTEM:WINDOWS
5773 # Most of the executables we'll ever create are tests
5774 # and utilities with console output.
5778 'GenerateStublessProxies': 'true',
5779 'TypeLibraryName': '$(InputName).tlb',
5780 'OutputDirectory': '$(IntDir)',
5781 'HeaderFileName': '$(InputName).h',
5782 'DLLDataFileName': '$(InputName).dlldata.c',
5783 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5784 'ProxyFileName': '$(InputName)_p.c',
5786 'VCResourceCompilerTool': {
5788 'AdditionalIncludeDirectories': [
5790 '<(SHARED_INTERMEDIATE_DIR)',
5793 'target_conditions': [
5794 ['_type=="executable"', {
5796 'EmbedManifest': 'true',
5799 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5801 'AdditionalManifestFiles': [
5802 '>(win_exe_compatibility_manifest)',
5808 # Building with Clang on Windows is a work in progress and very
5809 # experimental. See crbug.com/82385.
5810 # Keep this in sync with the similar blocks in build/config/compiler/BUILD.gn
5812 'VCCLCompilerTool': {
5813 'AdditionalOptions': [
5814 # Many files use intrinsics without including this header.
5815 # TODO(hans): Fix those files, or move this to sub-GYPs.
5818 # TODO(hans): Make this list shorter eventually, http://crbug.com/504657
5819 '-Qunused-arguments', # http://crbug.com/504658
5820 '-Wno-microsoft-enum-value', # http://crbug.com/505296
5821 '-Wno-unknown-pragmas', # http://crbug.com/505314
5822 '-Wno-unused-value', # http://crbug.com/505318
5826 ['clang==1 and clang_use_chrome_plugins==1', {
5827 'VCCLCompilerTool': {
5828 'AdditionalOptions': [
5829 '<@(clang_chrome_plugins_flags)',
5833 ['clang==1 and MSVS_VERSION == "2013"', {
5834 'VCCLCompilerTool': {
5835 'AdditionalOptions': [
5836 '-fmsc-version=1800',
5840 ['clang==1 and MSVS_VERSION == "2015"', {
5841 'VCCLCompilerTool': {
5842 'AdditionalOptions': [
5843 '-fmsc-version=1900',
5847 ['clang==1 and "<!(python <(DEPTH)/build/win/use_ansi_codes.py)"=="True"', {
5848 'VCCLCompilerTool': {
5849 'AdditionalOptions': [
5850 # cmd.exe doesn't understand ANSI escape codes by default,
5851 # so only enable them if something emulating them is around.
5852 '-fansi-escape-codes',
5853 # Also see http://crbug.com/110262
5854 '-fcolor-diagnostics',
5862 ['disable_nacl==1', {
5863 'target_defaults': {
5869 ['OS=="win" and msvs_use_common_linker_extras', {
5870 'target_defaults': {
5885 'AdditionalOptions': [
5896 'AdditionalOptions': ['/largeaddressaware'],
5900 # TODO(asan/win): Move this down into the general
5901 # win-target_defaults section once the 64-bit asan runtime
5902 # exists. See crbug.com/345874.
5903 'VCCLCompilerTool': {
5904 'AdditionalOptions': [
5905 '-fsanitize=address',
5906 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5908 'AdditionalIncludeDirectories': [
5909 # MSVC needs to be able to find the sanitizer headers when
5910 # invoked via /fallback. This is critical for using macros
5911 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5913 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/include_sanitizer',
5917 'AdditionalLibraryDirectories': [
5918 # TODO(hans): If make_clang_dir is absolute, this breaks.
5919 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/lib/windows',
5922 'target_conditions': [
5923 ['component=="shared_library"', {
5925 'AdditionalDependencies': [
5926 'clang_rt.asan_dynamic-i386.lib',
5927 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5931 ['_type=="executable" and component=="static_library"', {
5933 'AdditionalDependencies': [
5934 'clang_rt.asan-i386.lib',
5938 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5940 'AdditionalDependencies': [
5941 'clang_rt.asan_dll_thunk-i386.lib',
5947 ['sanitizer_coverage!=0', {
5948 # TODO(asan/win): Move this down into the general
5949 # win-target_defaults section once the 64-bit asan runtime
5950 # exists. See crbug.com/345874.
5951 'VCCLCompilerTool': {
5952 'AdditionalOptions': [
5953 '-fsanitize-coverage=<(sanitizer_coverage)',
5960 ['sanitizer_coverage!=0', {
5961 # TODO(asan/win): Move this down into the general
5962 # win-target_defaults section once the 64-bit asan runtime
5963 # exists. See crbug.com/345874.
5965 'SANITIZER_COVERAGE',
5973 'AdditionalOptions': [
5974 # safeseh is not compatible with x64
5986 ['enable_new_npdevice_api==1', {
5987 'target_defaults': {
5989 'ENABLE_NEW_NPDEVICE_API',
5993 # Don't warn about the "typedef 'foo' locally defined but not used"
5994 # for gcc 4.8 and higher.
5995 # TODO: remove this flag once all builds work. See crbug.com/227506
5996 ['gcc_version>=48 and clang==0', {
5997 'target_defaults': {
5999 '-Wno-unused-local-typedefs',
6003 ['gcc_version>=48 and clang==0 and host_clang==1', {
6004 'target_defaults': {
6005 'target_conditions': [
6006 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
6010 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
6012 'make_global_settings': [
6013 ['CC', '<(make_clang_dir)/bin/clang'],
6014 ['CXX', '<(make_clang_dir)/bin/clang++'],
6015 ['CC.host', '$(CC)'],
6016 ['CXX.host', '$(CXX)'],
6019 ['clang==1 and OS=="win"', {
6020 'make_global_settings': [
6021 # On Windows, gyp's ninja generator only looks at CC.
6022 ['CC', '<(make_clang_dir)/bin/clang-cl'],
6025 ['use_lld==1 and OS=="win"', {
6026 'make_global_settings': [
6027 # Limited to Windows because lld-link is the driver that is
6028 # compatible with link.exe.
6029 ['LD', '<(make_clang_dir)/bin/lld-link'],
6032 ['OS=="android" and clang==0', {
6033 # Hardcode the compiler names in the Makefile so that
6034 # it won't depend on the environment at make time.
6035 'make_global_settings': [
6036 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
6037 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
6038 ['CC.host', '<(host_cc)'],
6039 ['CXX.host', '<(host_cxx)'],
6042 ['OS=="linux" and target_arch=="mipsel" and host_arch!="mipsel" and chromeos==0 and clang==0', {
6043 # Set default mips cross tools on linux. These can be overridden
6044 # using CC,CXX,CC.host and CXX.host environment variables.
6045 'make_global_settings': [
6046 ['CC', '<!(which mipsel-linux-gnu-gcc)'],
6047 ['CXX', '<!(which mipsel-linux-gnu-g++)'],
6048 ['CC.host', '<(host_cc)'],
6049 ['CXX.host', '<(host_cxx)'],
6052 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
6053 # Set default ARM cross tools on linux. These can be overridden
6054 # using CC,CXX,CC.host and CXX.host environment variables.
6055 'make_global_settings': [
6056 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
6057 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
6058 ['CC.host', '<(host_cc)'],
6059 ['CXX.host', '<(host_cxx)'],
6062 # TODO(yyanagisawa): supports GENERATOR==make
6063 # make generator doesn't support CC_wrapper without CC
6064 # in make_global_settings yet.
6065 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
6066 'make_global_settings': [
6067 ['CC_wrapper', '<(gomadir)/gomacc'],
6068 ['CXX_wrapper', '<(gomadir)/gomacc'],
6069 ['CC.host_wrapper', '<(gomadir)/gomacc'],
6070 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
6074 'target_defaults': {
6075 'target_conditions': [
6076 ['_toolset=="target"', {
6084 # Work-around for http://openradar.appspot.com/20356002
6085 ['_toolset=="target" and _type!="static_library"', {
6095 ['use_lto==1 and clang==0', {
6096 'target_defaults': {
6097 'target_conditions': [
6098 ['_toolset=="target"', {
6100 '-ffat-lto-objects',
6106 ['use_lto==1 and clang==1', {
6107 'target_defaults': {
6108 'target_conditions': [
6109 ['_toolset=="target"', {
6111 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
6117 # Apply a lower LTO optimization level in non-official builds.
6118 ['use_lto==1 and clang==1 and buildtype!="Official"', {
6119 'target_defaults': {
6120 'target_conditions': [
6121 ['_toolset=="target"', {
6123 '-Wl,--plugin-opt,O1',
6126 ['_toolset=="target" and _type!="static_library"', {
6136 ['use_lto==1 and clang==1 and target_arch=="arm"', {
6137 'target_defaults': {
6138 'target_conditions': [
6139 ['_toolset=="target"', {
6140 # Without this flag, LTO produces a .text section that is larger
6141 # than the maximum call displacement, preventing the linker from
6142 # relocating calls (http://llvm.org/PR22999).
6144 '-Wl,-plugin-opt,-function-sections',
6150 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
6151 'target_defaults': {
6152 'target_conditions': [
6153 ['_toolset=="target"', {
6161 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
6162 'target_defaults': {
6163 'target_conditions': [
6164 ['_toolset=="target"', {
6173 'target_defaults': {
6174 'target_conditions': [
6175 ['_toolset=="target"', {
6177 '-fno-sanitize-trap=cfi',
6178 '-fsanitize-recover=cfi',
6187 '-fno-sanitize-trap=cfi',
6188 '-fsanitize-recover=cfi',
6192 '-fno-sanitize-trap=cfi',
6193 '-fsanitize-recover=cfi',
6197 'VCCLCompilerTool': {
6198 'AdditionalOptions': [
6199 '-fno-sanitize-trap=cfi',
6200 '-fsanitize-recover=cfi',
6205 ['_toolset=="target" and _type!="static_library"', {
6208 '-fno-sanitize-trap=cfi',
6209 '-fsanitize-recover=cfi',
6216 ['cfi_vptr==1 and cfi_diag==0', {
6217 'target_defaults': {
6218 'target_conditions': [
6219 ['_toolset=="target"', {
6228 'target_defaults': {
6229 'target_conditions': [
6230 ['_toolset=="target"', {
6232 '-fsanitize=cfi-vcall',
6233 '-fsanitize=cfi-derived-cast',
6234 '-fsanitize=cfi-unrelated-cast',
6235 '-fsanitize-blacklist=<(cfi_blacklist)',
6238 '-fsanitize=cfi-vcall',
6239 '-fsanitize=cfi-derived-cast',
6240 '-fsanitize=cfi-unrelated-cast',
6244 '-fsanitize=cfi-vcall',
6245 '-fsanitize=cfi-derived-cast',
6246 '-fsanitize=cfi-unrelated-cast',
6247 '-fsanitize-blacklist=<(cfi_blacklist)',
6251 'VCCLCompilerTool': {
6252 'AdditionalOptions': [
6253 '-fsanitize=cfi-vcall',
6254 '-fsanitize=cfi-derived-cast',
6255 '-fsanitize=cfi-unrelated-cast',
6256 '-fsanitize-blacklist=<(cfi_blacklist)',
6261 ['_toolset=="target" and _type!="static_library"', {
6264 '-fsanitize=cfi-vcall',
6265 '-fsanitize=cfi-derived-cast',
6266 '-fsanitize=cfi-unrelated-cast',
6275 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
6276 # This block adds *project-wide* configuration settings to each project
6277 # file. It's almost always wrong to put things here. Specify your
6278 # custom xcode_settings in target_defaults to add them to targets instead.
6281 # In an Xcode Project Info window, the "Base SDK for All Configurations"
6282 # setting sets the SDK on a project-wide basis. In order to get the
6283 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
6284 # here at the project level.
6287 ['mac_sdk_path==""', {
6288 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
6290 'SDKROOT': '<(mac_sdk_path)', # -isysroot
6296 ['ios_sdk_path==""', {
6298 # TODO(justincohen): Ninja only supports simulator for now.
6299 ['"<(GENERATOR)"=="xcode"', {
6300 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6302 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
6306 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6311 # Target both iPhone and iPad.
6312 'TARGETED_DEVICE_FAMILY': '1,2',
6315 ['target_arch=="x64"', {
6320 ['target_arch=="ia32"', {
6329 # The Xcode generator will look for an xcode_settings section at the root
6330 # of each dict and use it to apply settings on a file-wide basis. Most
6331 # settings should not be here, they should be in target-specific
6332 # xcode_settings sections, or better yet, should use non-Xcode-specific
6333 # settings in target dicts. SYMROOT is a special case, because many other
6334 # Xcode variables depend on it, including variables such as
6335 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6336 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6337 # files to appear (when present) in the UI as actual files and not red
6338 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6339 # and therefore SYMROOT, needs to be set at the project level.
6340 'SYMROOT': '<(DEPTH)/xcodebuild',