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 # Use translations provided by volunteers at launchpad.net. This
409 # currently only works on Linux.
410 'use_third_party_translations%': 0,
412 # Remoting compilation is enabled by default. Set to 0 to disable.
415 # Configuration policy is enabled by default. Set to 0 to disable.
416 'configuration_policy%': 1,
418 # Variable safe_browsing is used to control the build time configuration
419 # for safe browsing feature. Safe browsing can be compiled in 4 different
420 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
421 # reporting features for use with Data Saver on Mobile, and 3 enables
422 # extended mobile protection via an external API. When 3 is fully
423 # deployed, it will replace 2.
426 # Web speech is enabled by default. Set to 0 to disable.
427 'enable_web_speech%': 1,
429 # 'Ok Google' hotwording is disabled by default. Set to 1 to enable. (This
430 # will download a closed-source NaCl module at startup.) Chrome-branded
431 # ChromeOS builds have this enabled by default.
432 'enable_hotwording%': 0,
434 # Notifications are compiled in by default. Set to 0 to disable.
435 'notifications%' : 1,
437 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
438 # regular builds and 1 for ASan builds.
439 'mac_want_real_dsym%': 'default',
441 # If this is set, the clang plugins used on the buildbot will be used.
442 # Run tools/clang/scripts/update.sh to make sure they are compiled.
443 # This causes 'clang_chrome_plugins_flags' to be set.
444 # Has no effect if 'clang' is not set as well.
445 'clang_use_chrome_plugins%': 1,
447 # Enable building with ASAN (Clang's -fsanitize=address option).
448 # -fsanitize=address only works with clang, but asan=1 implies clang=1
449 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
451 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
452 # Enable coverage gathering instrumentation in sanitizer tools. This flag
453 # also controls coverage granularity (1 for function-level coverage, 2
454 # for block-level coverage).
455 'sanitizer_coverage%': 0,
456 # Deprecated, only works if |sanitizer_coverage| isn't set.
457 # TODO(glider): remove this flag.
459 # Enable intra-object-overflow detection in ASan (experimental).
460 'asan_field_padding%': 0,
462 # Enable Chromium overrides of the default configurations for various
463 # dynamic tools (like ASan).
464 'use_sanitizer_options%': 0,
466 # Enable building with SyzyAsan.
467 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
470 # Enable crash reporting via Kasko.
473 # Enable building with LSan (Clang's -fsanitize=leak option).
474 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
475 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
478 # Enable building with TSan (Clang's -fsanitize=thread option).
479 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
480 # See http://clang.llvm.org/docs/ThreadSanitizer.html
482 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
484 # Enable building with MSan (Clang's -fsanitize=memory option).
485 # MemorySanitizer only works with clang, but msan=1 implies clang=1
486 # See http://clang.llvm.org/docs/MemorySanitizer.html
488 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
489 # Track where uninitialized memory originates from. From fastest to
490 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
491 # - track the chain of stores leading from allocation site to use site.
492 'msan_track_origins%': 2,
494 # Enable building with UBSan (Clang's -fsanitize=undefined option).
495 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
496 # See http://clang.llvm.org/docs/UsersManual.html
498 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
499 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/vptr_blacklist.txt',
501 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
502 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
505 # Use dynamic libraries instrumented by one of the sanitizers
506 # instead of the standard system libraries. Set this flag to build the
507 # libraries from source.
508 'use_instrumented_libraries%': 0,
510 # Use dynamic libraries instrumented by one of the sanitizers
511 # instead of the standard system libraries. Set this flag to download
512 # prebuilt binaries from GCS.
513 'use_prebuilt_instrumented_libraries%': 0,
515 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
516 # stdlibc++ as standard library. This is intended to use for instrumented
518 'use_custom_libcxx%': 0,
520 # Use system libc++ instead of the default C++ library, usually libstdc++.
521 # This is intended for iOS builds only.
522 'use_system_libcxx%': 0,
524 # Use a modified version of Clang to intercept allocated types and sizes
525 # for allocated objects. clang_type_profiler=1 implies clang=1.
526 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
527 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
528 'clang_type_profiler%': 0,
530 # Set to true to instrument the code with function call logger.
531 # See src/third_party/cygprofile/cyg-profile.cc for details.
532 'order_profiling%': 0,
534 # Use the provided profiled order file to link Chrome image with it.
535 # This makes Chrome faster by better using CPU cache when executing code.
536 # This is known as PGO (profile guided optimization).
537 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
538 'order_text_section%' : "",
540 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
541 # libraries on linux x86-64 and arm, plus ASLR.
544 # Whether one-click signin is enabled or not.
545 'enable_one_click_signin%': 0,
547 # Whether to back up data before sync.
548 'enable_pre_sync_backup%': 0,
550 # Enable Chrome browser extensions
551 'enable_extensions%': 1,
554 'enable_google_now%': 1,
556 # Enable basic printing support and UI.
557 'enable_basic_printing%': 1,
559 # Enable printing with print preview. It does not imply
560 # enable_basic_printing. It's possible to build Chrome with preview only.
561 'enable_print_preview%': 1,
563 # Set the version of CLD.
568 # For CLD2, the size of the tables that should be included in the build
569 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
571 # See third_party/cld_2/cld_2.gyp for more information.
572 # 0: Small tables, lower accuracy
573 # 2: Large tables, high accuracy
574 'cld2_table_size%': 2,
576 # Enable spell checker.
577 'enable_spellcheck%': 1,
579 # Use the operating system spellchecker, e.g. NSSpellChecker on Mac or
580 # SpellCheckerSession on Android.
581 'use_browser_spellchecker%': 0,
583 # Webrtc compilation is enabled by default. Set to 0 to disable.
586 # Media router support is enabled by default. Set to 0 to disable.
587 'enable_media_router%': 1,
589 # Enables use of the session service, which is enabled by default.
590 # Support for disabling depends on the platform.
591 'enable_session_service%': 1,
593 # Enables theme support, which is enabled by default. Support for
594 # disabling depends on the platform.
597 # Enables autofill dialog and associated features; disabled by default.
598 'enable_autofill_dialog%' : 0,
600 # Defaults Wallet integration in Autofill dialog to use production
601 # servers. Unofficial builds won't have the proper API keys.
602 'enable_prod_wallet_service%': 0,
604 # Enables support for background apps.
605 'enable_background%': 1,
607 # Enable the task manager by default.
608 'enable_task_manager%': 1,
610 # Enables used resource whitelist generation; disabled by default.
611 'enable_resource_whitelist_generation%': 0,
613 # Enable FILE support by default.
614 'disable_file_support%': 0,
616 # Enable FTP support by default.
617 'disable_ftp_support%': 0,
619 # Use native android functions in place of ICU. Not supported by most
621 'use_icu_alternatives_on_android%': 0,
623 # Use of precompiled headers on Windows.
625 # This variable may be explicitly set to 1 (enabled) or 0
626 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
627 # This setting will override the default.
630 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
632 'chromium_win_pch%': 0,
635 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
636 # Set this to true when building with Clang.
637 # See http://code.google.com/p/chromium/wiki/Clang for details.
638 # If this is set, clang is used as both host and target compiler in
639 # cross-compile builds.
642 # Use experimental lld linker instead of the platform's default linker.
645 # Enable plugin installation by default.
646 'enable_plugin_installation%': 1,
648 # Specifies whether to use canvas_skia.cc in place of platform
649 # specific implementations of gfx::Canvas. Affects text drawing in the
651 # TODO(asvitkine): Enable this on all platforms and delete this flag.
652 # http://crbug.com/105550
653 'use_canvas_skia%': 0,
655 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
656 # with one of those tools.
657 'build_for_tool%': '',
659 'wix_path%': '<(DEPTH)/third_party/wix',
661 # Supervised users are enabled by default.
662 'enable_supervised_users%': 1,
664 # Platform sends memory pressure signals natively.
665 'native_memory_pressure_signals%': 0,
668 'enable_service_discovery%': 0,
669 'enable_wifi_bootstrapping%': 0,
670 'enable_hangout_services_extension%': 0,
672 # Enable the Syzygy optimization step.
673 'syzygy_optimize%': 0,
675 # Enable hole punching for the protected video.
678 # Automatically select platforms under ozone. Turn this off to
679 # build only explicitly selected platforms.
680 'ozone_auto_platforms%': 1,
682 # If this is set clang is used as host compiler, but not as target
683 # compiler. Always do this by default.
686 # Variables to control Link-Time Optimization (LTO).
687 # On Android, the variable use_lto enables LTO on code compiled with -Os,
688 # and use_lto_o2 enables LTO on code compiled with -O2. On other
689 # platforms, use_lto enables LTO in all translation units, and use_lto_o2
692 # On Linux and Android, when using LLVM LTO, the script
693 # build/download_gold_plugin.py must be run to download a linker plugin.
694 # On Mac, LLVM needs to be built from scratch using
695 # tools/clang/scripts/update.py and the absolute path to
696 # third_party/llvm-build/Release+Asserts/lib must be added to
697 # $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin.
699 # On Android, the variables must *not* be enabled at the same time.
700 # In this case LTO would 'merge' the optimization flags at link-time
701 # which would lead to all code be optimized with -O2. See crbug.com/407544
705 # Allowed level of identical code folding in the gold linker.
706 'gold_icf_level%': 'all',
708 # Libxkbcommon usage.
711 # Control Flow Integrity for virtual calls and casts.
712 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
716 'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
718 # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
719 'mac_views_browser%': 0,
721 # By default, use ICU data file (icudtl.dat).
722 'icu_use_data_file_flag%': 1,
724 # Turn on JNI generation optimizations by default.
725 'optimize_jni_generation%': 1,
728 # A flag for POSIX platforms
735 # A flag for BSD platforms
736 ['OS=="freebsd" or OS=="openbsd"', {
743 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris")', {
749 # libudev usage. This currently only affects the content layer.
750 ['OS=="linux" and embedded==0', {
756 # Flags to use X11 on non-Mac POSIX platforms.
757 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
764 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
770 # Flags to use pango and cairo.
771 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
780 ['OS=="linux" and embedded==0', {
786 # We always use skia text rendering in Aura on Windows, since GDI
787 # doesn't agree with our BackingStore.
788 # TODO(beng): remove once skia text rendering is on by default.
789 ['use_aura==1 and OS=="win"', {
790 'enable_skia_text%': 1,
793 # A flag to enable or disable our compile-time dependency
794 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
795 # support will be available. This option is useful
796 # for Linux distributions and for Aura.
797 ['OS!="linux" or chromeos==1', {
798 'use_gnome_keyring%': 0,
800 'use_gnome_keyring%': 1,
803 ['OS=="mac" or OS=="ios"', {
804 # Mac and iOS want Title Case strings
805 'use_titlecase_in_grd%': 1,
808 # Enable loader extensions on Chrome OS.
810 'image_loader_extension%': 1,
812 'image_loader_extension%': 0,
815 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
816 'enable_one_click_signin%': 1,
817 'enable_pre_sync_backup%': 1,
821 'enable_extensions%': 0,
822 'enable_google_now%': 0,
827 'arm_neon_optional%': 1,
828 'native_memory_pressure_signals%': 1,
829 'enable_basic_printing%': 1,
830 'enable_print_preview%': 0,
831 'enable_task_manager%':0,
835 # Android and OSX have built-in spellcheckers that can be utilized.
836 ['OS=="android" or OS=="mac"', {
837 'use_browser_spellchecker%': 1,
840 # Android OS includes support for proprietary codecs regardless of
841 # building Chromium or Google Chrome. We also ship Google Chrome and
842 # Chromecast with proprietary codecs.
843 ['OS=="android" or branding=="Chrome" or chromecast==1', {
844 'proprietary_codecs%': 1,
846 'proprietary_codecs%': 0,
849 ['OS=="mac" or OS=="ios"', {
850 'native_memory_pressure_signals%': 1,
853 # Enable autofill dialog when not on iOS.
855 'enable_autofill_dialog%': 1,
858 ['buildtype=="Official"', {
859 'enable_prod_wallet_service%': 1,
862 # Enable hotwording on Chrome-branded ChromeOS builds.
863 ['branding=="Chrome" and chromeos==1', {
864 'enable_hotwording%': 1,
872 'disable_ftp_support%': 1,
873 'enable_extensions%': 0,
874 'enable_google_now%': 0,
876 'cld2_table_size%': 0,
877 'enable_basic_printing%': 0,
878 'enable_print_preview%': 0,
879 'enable_session_service%': 0,
880 'enable_spellcheck%': 0,
886 'enable_supervised_users%': 0,
887 'enable_task_manager%': 0,
888 'use_system_libcxx%': 1,
889 'enable_media_router%': 0,
892 # Use GPU accelerated cross process image transport by default
893 # on linux builds with the Aura window manager
894 ['use_aura==1 and OS=="linux"', {
895 'ui_compositor_image_transport%': 1,
897 'ui_compositor_image_transport%': 0,
900 # Turn precompiled headers on by default.
901 ['OS=="win" and buildtype!="Official"', {
902 'chromium_win_pch%': 1
905 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
906 'enable_plugin_installation%': 0,
908 'enable_plugin_installation%': 1,
911 # Whether PPAPI is enabled.
912 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
913 'enable_plugins%': 0,
915 'enable_plugins%': 1,
918 # linux_use_bundled_gold: whether to use the gold linker binary checked
919 # into third_party/binutils. Force this off via GYP_DEFINES when you
920 # are using a custom toolchain and need to control -B in ldflags.
921 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
922 # for component=static_library builds.
923 ['(OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm" or (target_arch=="ia32" and host_arch=="x64"))', {
924 'linux_use_bundled_gold%': 1,
926 'linux_use_bundled_gold%': 0,
929 # linux_use_bundled_binutils: whether to use the binary binutils
930 # checked into third_party/binutils. These are not multi-arch so cannot
931 # be used except on x86 and x86-64 (the only two architectures which
932 # are currently checke in). Force this off via GYP_DEFINES when you
933 # are using a custom toolchain and need to control -B in cflags.
934 ['OS=="linux" and (target_arch=="x64")', {
935 'linux_use_bundled_binutils%': 1,
937 'linux_use_bundled_binutils%': 0,
940 # linux_use_gold_flags: whether to use build flags that rely on gold.
941 # On by default for x64 Linux.
942 ['OS=="linux" and target_arch=="x64"', {
943 'linux_use_gold_flags%': 1,
945 'linux_use_gold_flags%': 0,
948 # linux_use_debug_fission: whether to use split DWARF debug info
949 # files. This can reduce link time significantly, but is incompatible
950 # with some utilities such as icecc and ccache. Requires gold and
951 # gcc >= 4.8 or clang.
952 # http://gcc.gnu.org/wiki/DebugFission
953 ['OS=="linux" and target_arch=="x64"', {
954 'linux_use_debug_fission%': 1,
956 'linux_use_debug_fission%': 0,
959 ['OS=="android" or OS=="ios"', {
960 'enable_captive_portal_detection%': 0,
962 'enable_captive_portal_detection%': 1,
965 # Enable Skia UI text drawing incrementally on different platforms.
966 # http://crbug.com/105550
968 # On Aura, this allows per-tile painting to be used in the browser
970 ['OS!="android" and OS!="ios"', {
971 'use_canvas_skia%': 1,
975 'enable_basic_printing%': 0,
976 'enable_print_preview%': 1,
979 # Do not enable the Settings App on ChromeOS.
980 ['enable_app_list==1 and chromeos==0', {
981 'enable_settings_app%': 1,
983 'enable_settings_app%': 0,
986 # Whether tests targets should be run, archived or just have the
987 # dependencies verified. All the tests targets have the '_run' suffix,
988 # e.g. base_unittests_run runs the target base_unittests. The test
989 # target always calls tools/swarming_client/isolate.py. See the script's
990 # --help for more information. Meant to be overriden with GYP_DEFINES.
991 # TODO(maruel): Remove the conditions as more configurations are
993 ['OS!="ios" and OS!="android" and chromeos==0', {
994 'test_isolation_mode%': 'check',
996 'test_isolation_mode%': 'noop',
998 # Whether Android build uses OpenMAX DL FFT.
999 ['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")', {
1000 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
1001 # When enabled, this will also enable WebAudio support on
1002 # Android for these architectures. Default is enabled. Whether
1003 # WebAudio is actually available depends on runtime settings
1005 'use_openmax_dl_fft%': 1,
1007 'use_openmax_dl_fft%': 0,
1009 ['OS=="win" or OS=="linux"', {
1013 # Disable various features by default on embedded.
1016 'enable_basic_printing%': 0,
1017 'enable_print_preview%': 0,
1020 ['OS=="win" or OS=="mac"', {
1021 'enable_wifi_bootstrapping%' : 1,
1024 # Path to sas.dll, which provides the SendSAS function.
1025 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1026 ['target_arch=="x64"', {
1027 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1029 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1033 'pkg-config': '<(chroot_cmd) <(DEPTH)/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
1035 'pkg-config': 'pkg-config'
1039 # WebVR support disabled until platform implementations have been added
1042 # Setting this to '0' will cause V8's startup snapshot to be
1043 # embedded in the binary instead of being a external files.
1044 'v8_use_external_startup_data%': 1,
1046 # Set this to 1 to enable use of concatenated impulse responses
1047 # for the HRTF panner in WebAudio.
1048 'use_concatenated_impulse_responses': 1,
1050 # You can set the variable 'use_official_google_api_keys' to 1
1051 # to use the Google-internal file containing official API keys
1052 # for Google Chrome even in a developer build. Setting this
1053 # variable explicitly to 1 will cause your build to fail if the
1054 # internal file is missing.
1056 # The variable is documented here, but not handled in this file;
1057 # see //google_apis/determine_use_official_keys.gypi for the
1060 # Set the variable to 0 to not use the internal file, even when
1061 # it exists in your checkout.
1063 # Leave it unset in your include.gypi to have the variable
1064 # implicitly set to 1 if you have
1065 # src/google_apis/internal/google_chrome_api_keys.h in your
1066 # checkout, and implicitly set to 0 if not.
1068 # Note that official builds always behave as if the variable
1069 # was explicitly set to 1, i.e. they always use official keys,
1070 # and will fail to build if the internal file is missing.
1072 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1073 # include.gypi or by other means. Due to subtleties of GYP, this
1074 # is not the same as leaving the variable unset, even though its
1076 # //google_apis/determine_use_official_keys.gypi is 2.
1078 # Set these to bake the specified API keys and OAuth client
1079 # IDs/secrets into your build.
1081 # If you create a build without values baked in, you can instead
1082 # set environment variables to provide the keys at runtime (see
1083 # src/google_apis/google_api_keys.h for details). Features that
1084 # require server-side APIs may fail to work if no keys are
1087 # Note that if you are building an official build or if
1088 # use_official_google_api_keys has been set to 1 (explicitly or
1089 # implicitly), these values will be ignored and the official
1090 # keys will be used instead.
1091 'google_api_key%': '',
1092 'google_default_client_id%': '',
1093 'google_default_client_secret%': '',
1094 # Native Client is enabled by default.
1095 'disable_nacl%': '0',
1097 # Native Client toolchains, enabled by default.
1098 'disable_pnacl%': 0,
1099 'disable_newlib%': 0,
1101 # Sets the default version name and code for Android app, by default we
1102 # do a developer build.
1103 'android_app_version_name%': 'Developer Build',
1104 'android_app_version_code%': 1,
1107 # Copy conditionally-set variables out one scope.
1108 'branding%': '<(branding)',
1109 'branding_path_component%': '<(branding_path_component)',
1110 'buildtype%': '<(buildtype)',
1111 'target_arch%': '<(target_arch)',
1112 'target_subarch%': '<(target_subarch)',
1113 'mips_arch_variant%': '<(mips_arch_variant)',
1114 'mips_dsp_rev%': '<(mips_dsp_rev)',
1115 'host_arch%': '<(host_arch)',
1116 'toolkit_views%': '<(toolkit_views)',
1117 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1118 'use_aura%': '<(use_aura)',
1119 'use_ash%': '<(use_ash)',
1120 'use_cras%': '<(use_cras)',
1121 'use_libpci%': '<(use_libpci)',
1122 'use_openssl%': '<(use_openssl)',
1123 'use_openssl_certs%': '<(use_openssl_certs)',
1124 'use_nss_certs%': '<(use_nss_certs)',
1125 'use_udev%': '<(use_udev)',
1126 'os_bsd%': '<(os_bsd)',
1127 'os_posix%': '<(os_posix)',
1128 'use_dbus%': '<(use_dbus)',
1129 'use_glib%': '<(use_glib)',
1130 'use_pango%': '<(use_pango)',
1131 'use_cairo%': '<(use_cairo)',
1132 'use_ozone%': '<(use_ozone)',
1133 'use_ozone_evdev%': '<(use_ozone_evdev)',
1134 'use_xkbcommon%': '<(use_xkbcommon)',
1135 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1136 'desktop_linux%': '<(desktop_linux)',
1137 'use_x11%': '<(use_x11)',
1138 'use_gnome_keyring%': '<(use_gnome_keyring)',
1139 'linux_fpic%': '<(linux_fpic)',
1140 'chromeos%': '<(chromeos)',
1141 'chromecast%': '<(chromecast)',
1142 'enable_viewport%': '<(enable_viewport)',
1143 'enable_hidpi%': '<(enable_hidpi)',
1144 'enable_topchrome_md%': '<(enable_topchrome_md)',
1145 'image_loader_extension%': '<(image_loader_extension)',
1146 'fastbuild%': '<(fastbuild)',
1147 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1148 'win_z7%': '<(win_z7)',
1149 'dcheck_always_on%': '<(dcheck_always_on)',
1150 'tracing_like_official_build%': '<(tracing_like_official_build)',
1151 'fieldtrial_testing_like_official_build%': '<(fieldtrial_testing_like_official_build)',
1152 'arm_version%': '<(arm_version)',
1153 'arm_neon%': '<(arm_neon)',
1154 'arm_neon_optional%': '<(arm_neon_optional)',
1155 'sysroot%': '<(sysroot)',
1156 'pkg-config%': '<(pkg-config)',
1157 'chroot_cmd%': '<(chroot_cmd)',
1158 'system_libdir%': '<(system_libdir)',
1159 'component%': '<(component)',
1160 'win_analyze%': '<(win_analyze)',
1161 'win_fastlink%': '<(win_fastlink)',
1162 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1163 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1164 'use_third_party_translations%': '<(use_third_party_translations)',
1165 'remoting%': '<(remoting)',
1166 'enable_one_click_signin%': '<(enable_one_click_signin)',
1167 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1168 'enable_media_router%': '<(enable_media_router)',
1169 'enable_webrtc%': '<(enable_webrtc)',
1170 'chromium_win_pch%': '<(chromium_win_pch)',
1171 'configuration_policy%': '<(configuration_policy)',
1172 'safe_browsing%': '<(safe_browsing)',
1173 'enable_web_speech%': '<(enable_web_speech)',
1174 'enable_hotwording%': '<(enable_hotwording)',
1175 'notifications%': '<(notifications)',
1176 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1177 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1179 'asan_blacklist%': '<(asan_blacklist)',
1180 'asan_coverage%': '<(asan_coverage)',
1181 'sanitizer_coverage%': '<(sanitizer_coverage)',
1182 'asan_field_padding%': '<(asan_field_padding)',
1183 'use_sanitizer_options%': '<(use_sanitizer_options)',
1184 'syzyasan%': '<(syzyasan)',
1185 'kasko%': '<(kasko)',
1186 'syzygy_optimize%': '<(syzygy_optimize)',
1189 'msan_blacklist%': '<(msan_blacklist)',
1190 'msan_track_origins%': '<(msan_track_origins)',
1192 'tsan_blacklist%': '<(tsan_blacklist)',
1193 'ubsan%': '<(ubsan)',
1194 'ubsan_blacklist%': '<(ubsan_blacklist)',
1195 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1196 'ubsan_vptr%': '<(ubsan_vptr)',
1197 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1198 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
1199 'use_custom_libcxx%': '<(use_custom_libcxx)',
1200 'use_system_libcxx%': '<(use_system_libcxx)',
1201 'clang_type_profiler%': '<(clang_type_profiler)',
1202 'order_profiling%': '<(order_profiling)',
1203 'order_text_section%': '<(order_text_section)',
1204 'enable_extensions%': '<(enable_extensions)',
1205 'enable_plugin_installation%': '<(enable_plugin_installation)',
1206 'enable_plugins%': '<(enable_plugins)',
1207 'enable_session_service%': '<(enable_session_service)',
1208 'enable_themes%': '<(enable_themes)',
1209 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1210 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1211 'enable_background%': '<(enable_background)',
1212 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1213 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1214 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1215 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1216 'use_canvas_skia%': '<(use_canvas_skia)',
1217 'test_isolation_mode%': '<(test_isolation_mode)',
1218 'enable_basic_printing%': '<(enable_basic_printing)',
1219 'enable_print_preview%': '<(enable_print_preview)',
1220 'enable_spellcheck%': '<(enable_spellcheck)',
1221 'use_browser_spellchecker%': '<(use_browser_spellchecker)',
1222 'enable_google_now%': '<(enable_google_now)',
1223 'cld_version%': '<(cld_version)',
1224 'cld2_table_size%': '<(cld2_table_size)',
1225 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1226 'disable_file_support%': '<(disable_file_support)',
1227 'disable_ftp_support%': '<(disable_ftp_support)',
1228 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1229 'enable_task_manager%': '<(enable_task_manager)',
1230 'sas_dll_path%': '<(sas_dll_path)',
1231 'wix_path%': '<(wix_path)',
1232 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1233 'use_system_libjpeg%': '<(use_system_libjpeg)',
1234 'android_channel%': '<(android_channel)',
1235 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1236 'gyp_managed_install%': 0,
1237 'create_standalone_apk%': 1,
1238 'enable_app_list%': '<(enable_app_list)',
1239 'use_default_render_theme%': '<(use_default_render_theme)',
1240 'enable_settings_app%': '<(enable_settings_app)',
1241 'google_api_key%': '<(google_api_key)',
1242 'google_default_client_id%': '<(google_default_client_id)',
1243 'google_default_client_secret%': '<(google_default_client_secret)',
1244 'enable_supervised_users%': '<(enable_supervised_users)',
1245 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1246 'enable_mdns%' : '<(enable_mdns)',
1247 'enable_service_discovery%' : '<(enable_service_discovery)',
1248 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1249 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1250 'proprietary_codecs%': '<(proprietary_codecs)',
1251 'use_goma%': '<(use_goma)',
1252 'gomadir%': '<(gomadir)',
1253 'use_lto%': '<(use_lto)',
1254 'use_lto_o2%': '<(use_lto_o2)',
1255 'gold_icf_level%': '<(gold_icf_level)',
1256 'video_hole%': '<(video_hole)',
1257 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1258 'cfi_vptr%': '<(cfi_vptr)',
1259 'cfi_diag%': '<(cfi_diag)',
1260 'cfi_blacklist%': '<(cfi_blacklist)',
1261 'mac_views_browser%': '<(mac_views_browser)',
1262 'android_app_version_name%': '<(android_app_version_name)',
1263 'android_app_version_code%': '<(android_app_version_code)',
1264 'enable_webvr%': '<(enable_webvr)',
1266 # Turns on compiler optimizations in V8 in Debug build.
1267 'v8_optimized_debug%': 1,
1269 # Use system protobuf instead of bundled one.
1270 'use_system_protobuf%': 0,
1272 # Use system yasm instead of bundled one.
1273 'use_system_yasm%': 0,
1275 # Use system ICU instead of bundled one.
1276 'use_system_icu%' : 0,
1278 # Default to enabled PIE; this is important for ASLR but we may need to be
1279 # able to turn it off for various reasons.
1280 'linux_disable_pie%': 0,
1282 # The release channel that this build targets. This is used to restrict
1283 # channel-specific build options, like which installer packages to create.
1284 # The default is 'all', which does no channel-specific filtering.
1287 # Override chromium_mac_pch and set it to 0 to suppress the use of
1288 # precompiled headers on the Mac. Prefix header injection may still be
1289 # used, but prefix headers will not be precompiled. This is useful when
1290 # using distcc to distribute a build to compile slaves that don't
1291 # share the same compiler executable as the system driving the compilation,
1292 # because precompiled headers rely on pointers into a specific compiler
1293 # executable's image. Setting this to 0 is needed to use an experimental
1294 # Linux-Mac cross compiler distcc farm.
1295 'chromium_mac_pch%': 1,
1297 # The default value for mac_strip in target_defaults. This cannot be
1298 # set there, per the comment about variable% in a target_defaults.
1299 'mac_strip_release%': 0,
1301 # Set to 1 to enable java code coverage. Instruments classes during build
1302 # to produce .ec files during runtime.
1303 'emma_coverage%': 0,
1305 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1306 # separated with whitespace and/or comma. Only has effect if
1307 # 'emma_coverage=1'.
1310 # Set to 1 to enable running Android lint on java/class files.
1313 # Although base/allocator lets you select a heap library via an
1314 # environment variable, the libcmt shim it uses sometimes gets in
1315 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1316 # 'win_use_allocator_shim': 0,
1317 # 'win_release_RuntimeLibrary': 2
1318 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1319 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1321 # TODO(bradnelson): eliminate this when possible.
1322 # To allow local gyp files to prevent release.vsprops from being included.
1323 # Yes(1) means include release.vsprops.
1324 # Once all vsprops settings are migrated into gyp, this can go away.
1325 'msvs_use_common_release%': 1,
1327 # TODO(bradnelson): eliminate this when possible.
1328 # To allow local gyp files to override additional linker options for msvs.
1329 # Yes(1) means set use the common linker options.
1330 'msvs_use_common_linker_extras%': 1,
1332 # TODO(sgk): eliminate this if possible.
1333 # It would be nicer to support this via a setting in 'target_defaults'
1334 # in chrome/app/locales/locales.gypi overriding the setting in the
1335 # 'Debug' configuration in the 'target_defaults' dict below,
1336 # but that doesn't work as we'd like.
1337 'msvs_debug_link_incremental%': '2',
1339 # Needed for some of the largest modules.
1340 'msvs_debug_link_nonincremental%': '1',
1342 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1343 # to get incremental linking to be faster in debug builds.
1344 'incremental_chrome_dll%': '0',
1346 # Experimental setting to break chrome.dll into multiple pieces based on
1348 'chrome_multiple_dll%': '0',
1350 # Experimental setting to optimize Chrome's DLLs with PGO.
1351 'chrome_pgo_phase%': '0',
1353 # Whether the VS xtree header has been patched to disable warning 4702. If
1354 # it has, then we don't need to disable 4702 (unreachable code warning).
1355 # The patch is preapplied to the internal toolchain and hence all bots.
1356 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1359 'clang%': '<(clang)',
1360 'host_clang%': '<(host_clang)',
1361 'make_clang_dir%': '<(make_clang_dir)',
1362 'use_lld%': '<(use_lld)',
1364 # Control which version of clang to use when building for iOS. If set to
1365 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1366 # the version of clang that ships with the Chromium source. This variable
1367 # is automatically set to '1' in Official builds.
1370 # These two variables can be set in GYP_DEFINES while running
1371 # |gclient runhooks| to let clang run a plugin in every compilation.
1372 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1374 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1377 'clang_add_plugin%': '',
1379 # Tell ld64 to write map files describing binary layout. Useful
1380 # for looking at what contributes to binary size, e.g. with
1381 # https://github.com/nico/bloat
1382 'mac_write_linker_maps%': 0,
1384 # The default type of gtest.
1385 'gtest_target_type%': 'executable',
1387 # Enable sampling based profiler.
1388 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1390 # Profile without optimizing out stack frames when profiling==1.
1391 'profiling_full_stack_frames%': '0',
1393 # And if we want to dump symbols for Breakpad-enabled builds.
1394 'linux_dump_symbols%': 0,
1395 # And if we want to strip the binary after dumping symbols.
1396 'linux_strip_binary%': 0,
1397 # If we want stack unwind support for backtrace().
1398 'debug_unwind_tables%': 1,
1399 'release_unwind_tables%': 1,
1401 # Override where to find binutils
1402 'binutils_version%': 0,
1403 'binutils_dir%': '',
1406 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1407 'use_allocator%': 'tcmalloc',
1409 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1410 'linux_link_gnome_keyring%': 0,
1411 # Set to 1 to link against gsettings APIs instead of using dlopen().
1412 'linux_link_gsettings%': 0,
1414 # Enable use of OpenMAX DL FFT routines.
1415 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1417 # Enable new NPDevice API.
1418 'enable_new_npdevice_api%': 0,
1420 # .gyp files or targets should set chromium_code to 1 if they build
1421 # Chromium-specific code, as opposed to external code. This variable is
1422 # used to control such things as the set of warnings to enable, and
1423 # whether warnings are treated as errors.
1424 'chromium_code%': 0,
1426 # Disable fatal linker warnings, similarly to how we make it possible
1427 # to disable -Werror (e.g. for different toolchain versions).
1428 'disable_fatal_linker_warnings%': 0,
1430 'release_valgrind_build%': 0,
1432 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1433 'enable_wexit_time_destructors%': 0,
1435 # Build libpeerconnection as a static library by default.
1436 'libpeer_target_type%': 'static_library',
1438 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1439 'internal_gles2_conform_tests%': 0,
1441 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1442 'internal_khronos_glcts_tests%': 0,
1444 # Set to 1 to compile the filter fuzzer.
1445 'internal_filter_fuzzer%': 0,
1447 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1448 # so Cocoa is happy (http://crbug.com/20441).
1450 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1451 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1452 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1453 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1454 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1455 'vi', 'zh-CN', 'zh-TW',
1458 # Pseudo locales are special locales which are used for testing and
1459 # debugging. They don't get copied to the final app. For more info,
1460 # check out https://www.chromium.org/developers/testing/fake-bidi
1467 # If debug_devtools is set to 1, JavaScript files for DevTools are
1468 # stored as is and loaded from disk. Otherwise, a concatenated file
1469 # is stored in resources.pak. It is still possible to load JS files
1470 # from disk by passing --debug-devtools cmdline switch.
1471 'debug_devtools%': 0,
1473 # The Java Bridge is not compiled in by default.
1476 # Code signing for iOS binaries. The bots need to be able to disable this.
1477 'chromium_ios_signing%': 1,
1479 # This flag is only used when disable_nacl==0 and disables all those
1480 # subcomponents which would require the installation of a native_client
1481 # untrusted toolchain.
1482 'disable_nacl_untrusted%': 0,
1484 # PNaCl toolchain does not support sanitizers. Disable by default.
1485 'enable_nacl_nonsfi_test%': 0,
1487 # Disable Dart by default.
1490 # Copy out the setting of disable_nacl.
1491 'disable_nacl%': '<(disable_nacl)',
1493 # Native Client toolchains, enabled by default.
1494 'disable_pnacl%': '<(disable_pnacl)',
1495 'disable_newlib%': '<(disable_newlib)',
1497 # Whether to build full debug version for Debug configuration on Android.
1498 # Compared to full debug version, the default Debug configuration on Android
1499 # has no full v8 debug, has size optimization and linker gc section, so that
1500 # we can build a debug version with acceptable size and performance.
1501 'android_full_debug%': 0,
1503 # Contains data about the attached devices for gyp_managed_install.
1504 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1506 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1507 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1509 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1510 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1512 # Whether we are using the rlz library or not. Platforms like Android send
1513 # rlz codes for searches but do not use the library.
1514 'enable_rlz_support%': 0,
1517 # Turns on the i18n support in V8.
1518 'v8_enable_i18n_support': 1,
1520 # Compile d8 for the host toolset.
1521 'v8_toolset_for_d8': 'host',
1523 # Use brlapi from brltty for braille display support.
1526 # Relative path to icu.gyp from this file.
1527 'icu_gyp_path': '../third_party/icu/icu.gyp',
1529 # IPC fuzzer is disabled by default.
1530 'enable_ipc_fuzzer%': 0,
1532 # Force disable libstdc++ debug mode.
1533 'disable_glibcxx_debug%': 0,
1535 # Set to 1 to compile with MSE support for MPEG2 TS
1536 'enable_mpeg2ts_stream_parser%': 0,
1538 # Support ChromeOS touchpad gestures with ozone.
1539 'use_evdev_gestures%': 0,
1541 # Default ozone platform (if no --ozone-platform flag).
1542 'ozone_platform%': "",
1544 # Ozone platforms to include in the build.
1545 'ozone_platform_caca%': 0,
1546 'ozone_platform_cast%': 0,
1547 'ozone_platform_drm%': 0,
1548 'ozone_platform_egltest%': 0,
1549 'ozone_platform_gbm%': 0,
1550 'ozone_platform_ozonex%': 0,
1551 'ozone_platform_test%': 0,
1553 # Experiment: http://crbug.com/426914
1556 # Used to set libjpeg_gyp_path. Chrome OS ui/gfx/gfx.gyp uses the IJG path
1557 # for robust login screen decoding.
1558 'libjpeg_ijg_gyp_path': '<(DEPTH)/third_party/libjpeg/libjpeg.gyp',
1559 'libjpeg_turbo_gyp_path': '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp',
1562 ['buildtype=="Official"', {
1563 # Continue to embed build meta data in Official builds, basically the
1564 # time it was built.
1565 # TODO(maruel): This decision should be revisited because having an
1566 # official deterministic build has high value too but MSVC toolset can't
1567 # generate anything deterministic with WPO enabled AFAIK.
1568 'dont_embed_build_metadata%': 0,
1570 # Enable the Syzygy optimization step for the official builds.
1571 ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
1572 'syzygy_optimize%': 1,
1574 'syzygy_optimize%': 0,
1576 # Get binutils version so we can enable debug fission if we can.
1577 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1579 # compiler_version doesn't work with clang
1580 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1581 # compiler_version works with clang.
1582 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1583 # that it takes effect here.
1584 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1585 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1587 # On Android we know the binutils version in the toolchain.
1589 'binutils_version%': 222,
1591 ['host_arch=="x64"', {
1592 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1594 ['host_arch=="ia32"', {
1595 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1597 # Our version of binutils in third_party/binutils
1598 ['linux_use_bundled_binutils==1', {
1599 'binutils_version%': 224,
1603 'binutils_version%': 0,
1605 # The version of GCC in use, set later in platforms that use GCC and have
1606 # not explicitly chosen to build with clang. Currently, this means all
1607 # platforms except Windows, Mac and iOS.
1608 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1609 # it takes effect here.
1610 ['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', {
1613 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1614 # We directly set the gcc version since we know what we use.
1617 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1618 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1622 'host_gcc_version%': 0,
1625 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1626 'directx_sdk_path%': '<(directx_sdk_default_path)',
1628 'directx_sdk_path%': '$(DXSDK_DIR)',
1631 'windows_driver_kit_path%': '$(WDK_DIR)',
1633 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1635 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1638 'nacl_untrusted_build%': 0,
1639 'use_allocator%': 'none',
1641 # Use a 64-bit linker to avoid running out of address space. The
1642 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1643 ['host_arch=="ia32" and target_arch=="ia32"', {
1644 # TODO(thestig) This is a horrible way to force the desired
1645 # configuration. Our gyp variable scoping is likely wrong and
1646 # needs to be cleaned up. The GN configuration should be changed
1648 'binutils_version%': 224,
1649 'linux_use_bundled_binutils%': '1',
1650 'linux_use_bundled_gold%': '1',
1651 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1653 # All Chrome builds have breakpad symbols, but only process the
1654 # symbols from official builds.
1655 ['(branding=="Chrome" and buildtype=="Official")', {
1656 'linux_dump_symbols%': 1,
1658 # Omit unwind support in official release builds to save space. We
1659 # can use breakpad for these builds.
1660 'release_unwind_tables%': 0,
1663 }], # os_posix==1 and OS!="mac" and OS!="ios"
1666 'enable_background%': 0,
1667 'icu_use_data_file_flag%': 1,
1668 'enable_web_speech%': 0,
1669 'use_system_libxml%': 1,
1670 'use_system_sqlite%': 1,
1672 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1673 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1674 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1675 'uk', 'vi', 'zh-CN', 'zh-TW',
1678 # iOS SDK and deployment target support. The |ios_sdk| value is left
1679 # blank so that when it is set in the project files it will be the
1680 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1681 # causes Xcode to spit out a warning for every single project file for
1682 # not using the "current" SDK.
1684 'ios_sdk_path%': '',
1685 'ios_deployment_target%': '7.0',
1688 # ios_product_name is set to the name of the .app bundle as it should
1690 ['branding=="Chrome"', {
1691 'ios_product_name%': 'Chrome',
1692 }, { # else: branding!="Chrome"
1693 'ios_product_name%': 'Chromium',
1695 ['branding=="Chrome" and buildtype=="Official"', {
1697 }, { # else: branding!="Chrome" or buildtype!="Official"
1703 # Location of Android NDK.
1706 # Standard libraries can use the relative path to the NDK.
1707 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1708 # Unfortunately, it is required to use the absolute path to the SDK
1709 # because it us passed to ant which uses a different relative path
1711 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1712 # Similarly, gdbserver and the Android toolchain need to use the
1713 # absolute path to the NDK because they are used at different levels
1715 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1716 'android_host_arch%': '<!(uname -m)',
1717 # Android API-level of the SDK used for compilation.
1718 'android_sdk_version%': '22',
1719 'android_sdk_build_tools_version%': '22.0.0',
1720 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1723 # Figure this out early since it needs symbols from libgcc.a, so it
1724 # has to be before that in the set of libraries.
1725 # ASan needs to dynamically link to libc++ even in static builds so
1726 # that it can interpose operator new.
1727 ['component=="shared_library" or asan==1', {
1728 'android_libcpp_library': 'c++_shared',
1729 'android_must_copy_system_libraries': 1,
1731 'android_libcpp_library': 'c++_static',
1732 'android_must_copy_system_libraries': 0,
1737 # Copy conditionally-set variables out one scope.
1738 'android_ndk_root%': '<(android_ndk_root)',
1739 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1740 'android_sdk_root%': '<(android_sdk_root)',
1741 'android_sdk_version%': '<(android_sdk_version)',
1742 'android_libcpp_root': '<(android_ndk_root)/sources/cxx-stl/llvm-libc++',
1743 'android_libcpp_library': '<(android_libcpp_library)',
1744 'android_must_copy_system_libraries': '<(android_must_copy_system_libraries)',
1745 'host_os%': '<(host_os)',
1747 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1748 # Android SDK build tools (e.g. dx, aidl)
1749 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1751 # Android API level 16 is JB (Android 4.1) which is the minimum
1752 # platform requirement for Chrome on Android, we use it for native
1755 ['target_arch == "ia32"', {
1756 'android_app_abi%': 'x86',
1757 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
1758 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-x86',
1759 'android_ndk_lib_dir%': 'usr/lib',
1760 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1762 ['target_arch == "x64"', {
1763 'android_app_abi%': 'x86_64',
1764 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1765 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1766 'android_ndk_lib_dir%': 'usr/lib64',
1767 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1769 ['target_arch=="arm"', {
1772 'android_app_abi%': 'armeabi',
1774 'android_app_abi%': 'armeabi-v7a',
1777 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
1778 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-arm',
1779 'android_ndk_lib_dir%': 'usr/lib',
1780 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1782 ['target_arch == "arm64"', {
1783 'android_app_abi%': 'arm64-v8a',
1784 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1785 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1786 'android_ndk_lib_dir%': 'usr/lib',
1787 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1789 ['target_arch == "mipsel"', {
1790 'android_app_abi%': 'mips',
1791 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
1792 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-mips',
1793 'android_ndk_lib_dir%': 'usr/lib',
1794 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1796 ['target_arch == "mips64el"', {
1797 'android_app_abi%': 'mips64',
1798 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1799 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1800 'android_ndk_lib_dir%': 'usr/lib64',
1801 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1805 # Copy conditionally-set variables out one scope.
1806 'android_app_abi%': '<(android_app_abi)',
1807 'android_gdbserver%': '<(android_gdbserver)',
1808 'android_ndk_root%': '<(android_ndk_root)',
1809 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1810 'android_sdk_root%': '<(android_sdk_root)',
1811 'android_sdk_version%': '<(android_sdk_version)',
1812 'android_toolchain%': '<(android_toolchain)',
1814 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1815 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1816 'android_sdk_tools%': '<(android_sdk_tools)',
1817 'android_aapt_path%': '<(android_sdk_tools)/aapt',
1818 'android_sdk%': '<(android_sdk)',
1819 'android_sdk_jar%': '<(android_sdk)/android.jar',
1821 'android_libcpp_root': '<(android_libcpp_root)',
1822 'android_libcpp_library': '<(android_libcpp_library)',
1823 'android_libcpp_include': '<(android_libcpp_root)/libcxx/include',
1824 'android_libcpp_libs_dir%': '<(android_libcpp_root)/libs/<(android_app_abi)',
1825 'android_must_copy_system_libraries': '<(android_must_copy_system_libraries)',
1826 'host_os%': '<(host_os)',
1828 # Location of the "objcopy" binary, used by both gyp and scripts.
1829 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1831 # Location of the "strip" binary, used by both gyp and scripts.
1832 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1834 # Location of the "readelf" binary.
1835 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1837 # Determines whether we should optimize JNI generation at the cost of
1838 # breaking assumptions in the build system that when inputs have changed
1839 # the outputs should always change as well. This is meant purely for
1840 # developer builds, to avoid spurious re-linking of native files.
1841 'optimize_jni_generation%': '<(optimize_jni_generation)',
1843 # Use OpenSSL's struct X509 to represent certificates.
1844 'use_openssl_certs%': 1,
1846 'proprietary_codecs%': '<(proprietary_codecs)',
1847 'safe_browsing%': 2,
1848 'enable_web_speech%': 0,
1850 'use_allocator%': 'none',
1852 # Disable Native Client.
1855 # Android does not support background apps.
1856 'enable_background%': 0,
1858 # Sessions are store separately in the Java side.
1859 'enable_session_service%': 0,
1863 'gtest_target_type%': 'shared_library',
1866 'use_system_fontconfig%': 0,
1868 'use_system_fontconfig%': 1,
1871 'enable_mpeg2ts_stream_parser%': 1,
1872 'ffmpeg_branding%': 'ChromeOS',
1873 'ozone_platform_ozonex%': 1,
1874 'use_custom_freetype%': 0,
1875 'use_playready%': 0,
1877 ['target_arch=="arm"', {
1879 'arm_tune%': 'cortex-a9',
1885 ['chromecast==1 and OS!="android"', {
1886 'ozone_platform_cast%': 1
1893 # All Chrome builds have breakpad symbols, but only process the
1894 # symbols from official builds.
1895 ['(branding=="Chrome" and buildtype=="Official")', {
1896 'mac_strip_release%': 1,
1900 ['OS=="mac" or OS=="ios"', {
1904 # Mac OS X SDK and deployment target support. The SDK identifies
1905 # the version of the system headers that will be used, and
1906 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1907 # macro. "Maximum allowed" refers to the operating system version
1908 # whose APIs are available in the headers. The deployment target
1909 # identifies the minimum system version that the built products are
1910 # expected to function on. It corresponds to the
1911 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1912 # macros are available, #include <AvailabilityMacros.h>. Additional
1913 # documentation on these macros is available at
1914 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1915 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1916 # deployment target to 10.6. Other projects, such as O3D, may
1917 # override these defaults.
1919 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1920 # about that is at least the specified version. In official builds,
1921 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1922 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1923 # path to the SDK; when set to a non-empty string, SDK detection
1924 # based on mac_sdk_min will be bypassed entirely.
1927 'mac_sdk_min%': '10.8',
1928 }, { # else OS!="ios"
1929 'mac_sdk_min%': '10.6',
1932 'mac_sdk_path%': '',
1934 'mac_deployment_target%': '10.6',
1937 'mac_sdk_min': '<(mac_sdk_min)',
1938 'mac_sdk_path': '<(mac_sdk_path)',
1939 'mac_deployment_target': '<(mac_deployment_target)',
1941 # Compile in Breakpad support by default so that it can be
1942 # tested, even if it is not enabled by default at runtime.
1943 'mac_breakpad_compiled_in%': 1,
1945 # mac_product_name is set to the name of the .app bundle as it should
1946 # appear on disk. This duplicates data from
1947 # chrome/app/theme/chromium/BRANDING and
1948 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1949 # these names into the build system.
1950 ['branding=="Chrome"', {
1951 'mac_product_name%': 'Google Chrome',
1952 }, { # else: branding!="Chrome"
1953 'mac_product_name%': 'Chromium',
1955 # Official mac builds require a specific OS X SDK, but iOS and
1956 # non-official mac builds do not.
1957 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1958 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1960 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1962 ['branding=="Chrome" and buildtype=="Official"', {
1963 # Enable uploading crash dumps.
1964 'mac_breakpad_uploads%': 1,
1965 # Enable dumping symbols at build time for use by Mac Breakpad.
1967 # Enable Keystone auto-update support.
1969 }, { # else: branding!="Chrome" or buildtype!="Official"
1970 'mac_breakpad_uploads%': 0,
1975 }], # OS=="mac" or OS=="ios"
1978 # This is the architecture convention used in WinSDK paths.
1979 ['target_arch=="ia32"', {
1980 'winsdk_arch%': 'x86',
1982 'winsdk_arch%': '<(target_arch)',
1984 ['component=="shared_library" or MSVS_VERSION == "2015"', {
1985 # TODO(scottmg): The allocator shimming doesn't work on the 2015 CRT
1986 # and we are hoping to be able to remove it if an additional feature
1987 # lands in the 2015 CRT API. For now, don't shim and revisit once
1988 # VS2015 is RTM: http://crbug.com/481611.
1989 'win_use_allocator_shim%': 0,
1991 ['component=="static_library"', {
1992 # Turn on multiple dll by default on Windows when in static_library.
1993 'chrome_multiple_dll%': 1,
1995 ['asan==1 or syzyasan==1', {
1996 'win_use_allocator_shim%': 0,
2001 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
2002 # Only enabled by default for ninja because it's buggy in VS.
2003 # Not enabled for component=static_library because some targets
2004 # are too large and the toolchain fails due to the size of the
2006 'incremental_chrome_dll%': 1,
2008 # Don't do incremental linking for large modules on 32-bit or when
2009 # component=static_library as the toolchain fails due to the size of
2011 ['MSVS_OS_BITS==32 or component=="static_library"', {
2012 'msvs_large_module_debug_link_mode%': '1', # No
2014 'msvs_large_module_debug_link_mode%': '2', # Yes
2017 'nacl_win64_defines': [
2018 # This flag is used to minimize dependencies when building
2019 # Native Client loader for 64-bit Windows.
2022 # Need to include allocator target, but exclude tcmalloc files.
2023 'use_allocator%': 'winheap',
2026 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
2032 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win") and chromecast==0', {
2033 'enable_pepper_cdms%': 1,
2035 'enable_pepper_cdms%': 0,
2038 ['OS=="android" or chromecast==1', {
2039 'enable_browser_cdms%': 1,
2041 'enable_browser_cdms%': 0,
2044 # Native Client glibc toolchain is enabled
2045 # by default except on arm, mips and mips64.
2046 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
2047 'disable_glibc%': 1,
2049 'disable_glibc%': 0,
2052 # Set the relative path from this file to the GYP file of the JPEG
2053 # library used by Chromium.
2054 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2055 # Configuration for using the system libjeg is here.
2056 'libjpeg_gyp_path': '<(libjpeg_ijg_gyp_path)',
2058 'libjpeg_gyp_path': '<(libjpeg_turbo_gyp_path)',
2061 # Options controlling the use of GConf (the classic GNOME configuration
2062 # system) and GIO, which contains GSettings (the new GNOME config system).
2063 ['chromeos==1 or embedded==1', {
2071 # Set up -D and -E flags passed into grit.
2072 ['branding=="Chrome"', {
2073 # TODO(mmoss) The .grd files look for _google_chrome, but for
2074 # consistency they should look for google_chrome_build like C++.
2075 'grit_defines': ['-D', '_google_chrome',
2076 '-E', 'CHROMIUM_BUILD=google_chrome'],
2078 'grit_defines': ['-D', '_chromium',
2079 '-E', 'CHROMIUM_BUILD=chromium'],
2082 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2084 ['desktop_linux==1', {
2085 'grit_defines': ['-D', 'desktop_linux'],
2087 ['toolkit_views==1', {
2088 'grit_defines': ['-D', 'toolkit_views'],
2091 'grit_defines': ['-D', 'use_aura'],
2094 'grit_defines': ['-D', 'use_ash'],
2096 ['use_nss_certs==1', {
2097 'grit_defines': ['-D', 'use_nss_certs'],
2100 'grit_defines': ['-D', 'use_ozone'],
2102 ['image_loader_extension==1', {
2103 'grit_defines': ['-D', 'image_loader_extension'],
2105 ['use_titlecase_in_grd==1', {
2106 'grit_defines': ['-D', 'use_titlecase'],
2108 ['use_third_party_translations==1', {
2109 'grit_defines': ['-D', 'use_third_party_translations'],
2111 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2112 'ka', 'ku', 'kw', 'ms', 'ug'
2118 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2119 '--no-output-all-resource-defines',
2122 ['OS=="mac" or OS=="ios"', {
2123 'grit_defines': ['-D', 'scale_factors=2x'],
2127 'enable_coverage%': 0,
2131 '--no-output-all-resource-defines',
2133 # iOS uses a whitelist to filter resources.
2134 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2136 # Enable host builds when generating with ninja-ios.
2138 ['"<(GENERATOR)"=="ninja"', {
2142 # Use the version of clang shipped with Xcode when building official
2143 # version of Chrome for iOS.
2145 # TODO(eugenebut): Remove enable_coverage check once
2146 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2147 # http://crbug.com/450379
2148 ['buildtype=="Official" or enable_coverage', {
2153 ['enable_extensions==1', {
2154 'grit_defines': ['-D', 'enable_extensions'],
2156 ['enable_plugins!=0', {
2157 'grit_defines': ['-D', 'enable_plugins'],
2159 ['enable_basic_printing==1 or enable_print_preview==1', {
2160 'grit_defines': ['-D', 'enable_printing'],
2162 ['enable_print_preview==1', {
2163 'grit_defines': ['-D', 'enable_print_preview'],
2165 ['enable_themes==1', {
2166 'grit_defines': ['-D', 'enable_themes'],
2168 ['enable_app_list==1', {
2169 'grit_defines': ['-D', 'enable_app_list'],
2171 ['enable_settings_app==1', {
2172 'grit_defines': ['-D', 'enable_settings_app'],
2174 ['enable_google_now==1', {
2175 'grit_defines': ['-D', 'enable_google_now'],
2177 ['use_concatenated_impulse_responses==1', {
2178 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2180 ['enable_media_router==1', {
2181 'grit_defines': ['-D', 'enable_media_router'],
2183 ['enable_webrtc==1', {
2184 'grit_defines': ['-D', 'enable_webrtc'],
2186 ['enable_hangout_services_extension==1', {
2187 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2189 ['enable_task_manager==1', {
2190 'grit_defines': ['-D', 'enable_task_manager'],
2192 ['notifications==1', {
2193 'grit_defines': ['-D', 'enable_notifications'],
2195 ['enable_wifi_bootstrapping==1', {
2196 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2198 ['mac_views_browser==1', {
2199 'grit_defines': ['-D', 'mac_views_browser'],
2201 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2202 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2204 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2205 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2207 ['enable_mdns==1 or OS=="mac"', {
2208 'grit_defines': ['-D', 'enable_service_discovery'],
2209 'enable_service_discovery%': 1
2211 ['clang_use_chrome_plugins==1', {
2217 ['OS=="mac" or OS=="ios"', {
2218 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2219 }, { # OS != "mac" or OS != "ios"
2220 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
2224 'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ',
2226 # On Windows, the plugin is built directly into clang, so there's
2227 # no need to load it dynamically.
2228 'clang_dynlib_flags%': '',
2230 # https://crbug.com/441916
2231 ['OS=="android" or OS=="linux" or OS=="mac"', {
2232 'clang_plugin_args%': '-Xclang -plugin-arg-find-bad-constructs -Xclang check-templates ',
2233 }, { # OS != "linux"
2234 'clang_plugin_args%': ''
2238 # If you change these, also change build/config/clang/BUILD.gn.
2239 'clang_chrome_plugins_flags%':
2240 '<(clang_dynlib_flags)'
2241 '-Xclang -add-plugin -Xclang find-bad-constructs <(clang_plugin_args)',
2243 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2245 'use_allocator%': 'none',
2246 'use_sanitizer_options%': 1,
2249 ['OS=="linux" and asan==0 and msan==0 and lsan==0 and tsan==0', {
2250 # PNaCl toolchain Non-SFI build only supports linux OS build.
2251 # Also, it does not support sanitizers.
2252 'enable_nacl_nonsfi_test%': 1,
2254 ['asan==1 and OS=="linux" and chromeos==0', {
2255 'use_custom_libcxx%': 1,
2263 ['asan==1 and OS=="mac"', {
2264 'mac_strip_release': 1,
2267 'use_custom_libcxx%': 1,
2270 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2271 # libstdc++. This is required to avoid false positive reports whenever
2272 # the C++ standard library is used.
2273 'use_custom_libcxx%': 1,
2274 # Running the V8-generated code on an ARM simulator is a powerful hack
2275 # that allows the tool to see the memory accesses from JITted code.
2276 # Without this flag, JS code causes false positive reports from MSan.
2277 'v8_target_arch': 'arm64',
2280 ['OS=="linux" and clang_type_profiler==1', {
2282 'clang_use_chrome_plugins%': 0,
2284 ['host_arch=="x64"', {
2285 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2287 ['host_arch=="ia32"', {
2288 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2289 # Clang in this directory at your own risk if needed for some
2290 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2291 # usage). Any failure by this compiler should not close the tree.
2292 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2297 # On valgrind bots, override the optimizer settings so we don't inline too
2298 # much and make the stacks harder to figure out.
2300 # TODO(rnk): Kill off variables that no one else uses and just implement
2301 # them under a build_for_tool== condition.
2302 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2304 'mac_debug_optimization': '1',
2305 'mac_release_optimization': '1',
2306 'release_optimize': '1',
2307 'no_gc_sections': 1,
2308 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2309 '-fno-builtin -fno-optimize-sibling-calls',
2310 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2311 '-fno-builtin -fno-optimize-sibling-calls',
2313 # MSVS flags for TSan on Pin and Windows.
2314 'win_debug_RuntimeChecks': '0',
2315 'win_debug_disable_iterator_debugging': '1',
2316 'win_debug_Optimization': '1',
2317 'win_debug_InlineFunctionExpansion': '0',
2318 'win_release_InlineFunctionExpansion': '0',
2319 'win_release_OmitFramePointers': '0',
2321 'use_allocator': 'tcmalloc',
2322 'release_valgrind_build': 1,
2324 'component': 'static_library',
2325 'use_system_zlib': 0,
2328 # Build tweaks for DrMemory.
2329 # TODO(rnk): Combine with tsan config to share the builder.
2330 # http://crbug.com/108155
2331 ['build_for_tool=="drmemory"', {
2332 # These runtime checks force initialization of stack vars which blocks
2333 # DrMemory's uninit detection.
2334 'win_debug_RuntimeChecks': '0',
2335 # Iterator debugging is slow.
2336 'win_debug_disable_iterator_debugging': '1',
2337 # Try to disable optimizations that mess up stacks in a release build.
2338 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2339 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2340 # compiler bug, so we use /Ob1 instead.
2341 'win_release_InlineFunctionExpansion': '1',
2342 'win_release_OmitFramePointers': '0',
2343 # Ditto for debug, to support bumping win_debug_Optimization.
2344 'win_debug_InlineFunctionExpansion': 0,
2345 'win_debug_OmitFramePointers': 0,
2346 # Keep the code under #ifndef NVALGRIND.
2347 'release_valgrind_build': 1,
2350 # RLZ library is used on Win, Mac, iOS and ChromeOS.
2351 ['OS=="win" or OS=="mac" or OS=="ios" or chromeos==1', {
2352 'enable_rlz_support%': 1,
2354 # RLZ is enabled for "Chrome" builds.
2355 ['branding=="Chrome"', {
2361 # Set default compiler flags depending on ARM version.
2362 ['arm_version==6', {
2363 'arm_arch%': 'armv6',
2366 'arm_float_abi%': 'softfp',
2369 ['arm_version==7', {
2370 'arm_arch%': 'armv7-a',
2371 'arm_tune%': 'generic-armv7-a',
2376 'arm_fpu%': 'vfpv3-d16',
2379 'arm_float_abi%': 'softfp',
2381 'arm_float_abi%': 'hard',
2387 # Set default compiler flags for MIPS floating-point support.
2388 ['target_arch=="mipsel"', {
2389 'mips_float_abi%': 'hard',
2391 ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
2392 'mips_fpu_mode%': 'fp32',
2394 'mips_fpu_mode%': '',
2397 # Enable brlapi by default for chromeos.
2402 ['use_ozone==1 and ozone_auto_platforms==1', {
2403 # Use test as the default platform.
2404 'ozone_platform%': 'test',
2406 # Build all platforms whose deps are in install-build-deps.sh.
2407 # Only these platforms will be compile tested by buildbots.
2408 'ozone_platform_drm%': 1,
2409 'ozone_platform_test%': 1,
2410 'ozone_platform_egltest%': 1,
2413 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2414 'use_clipboard_aurax11%': 1,
2417 ['OS=="win" and use_goma==1', {
2418 # goma doesn't support pch yet.
2419 'chromium_win_pch': 0,
2420 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2422 ['win_z7==0 and fastbuild==0', {
2428 ['OS=="win" and (clang==1 or asan==1)', {
2429 'chromium_win_pch': 0,
2433 'host_cc': '<(make_clang_dir)/bin/clang',
2434 'host_cxx': '<(make_clang_dir)/bin/clang++',
2436 'host_cc': '<!(which gcc)',
2437 'host_cxx': '<!(which g++)',
2440 # The seccomp-bpf sandbox is only supported on five architectures
2442 # Do not disable seccomp_bpf anywhere without talking to
2443 # security@chromium.org!
2444 ['((OS=="linux" or OS=="android") and '
2445 '(target_arch=="ia32" or target_arch=="x64" or '
2446 'target_arch=="arm" or target_arch=="mipsel" or '
2447 'target_arch=="arm64"))', {
2448 'use_seccomp_bpf%': 1,
2450 'use_seccomp_bpf%': 0,
2457 ['branding=="Chrome" and buildtype=="Official"', {
2458 'enable_hangout_services_extension%': 1,
2460 'enable_hangout_services_extension%': 0,
2464 # The path to the ANGLE library.
2465 'angle_path': '<(DEPTH)/third_party/angle',
2467 # List of default apps to install in new profiles. The first list contains
2468 # the source files as found in svn. The second list, used only for linux,
2469 # contains the destination location for each of the files. When a crx
2470 # is added or removed from the list, the chrome/browser/resources/
2471 # default_apps/external_extensions.json file must also be updated.
2473 # README: GN version of these is in the target //chrome:default_apps
2474 # (there's no global variable like in GYP). Be sure to update that target
2475 # if you change these lists!
2476 'default_apps_list': [
2477 'browser/resources/default_apps/external_extensions.json',
2478 'browser/resources/default_apps/gmail.crx',
2479 'browser/resources/default_apps/search.crx',
2480 'browser/resources/default_apps/youtube.crx',
2481 'browser/resources/default_apps/drive.crx',
2482 'browser/resources/default_apps/docs.crx',
2484 'default_apps_list_linux_dest': [
2485 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2486 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2487 '<(PRODUCT_DIR)/default_apps/search.crx',
2488 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2489 '<(PRODUCT_DIR)/default_apps/drive.crx',
2490 '<(PRODUCT_DIR)/default_apps/docs.crx',
2493 # Whether to allow building of the GPU-related isolates.
2494 'archive_gpu_tests%': 0,
2496 # Whether to allow building of chromoting related isolates.
2497 'archive_chromoting_tests%': 0,
2499 # Whether to allow building of Media Router related isolates.
2500 'archive_media_router_tests%': 0,
2502 'target_defaults': {
2504 # The condition that operates on chromium_code is in a target_conditions
2505 # section, and will not have access to the default fallback value of
2506 # chromium_code at the top of this file, or to the chromium_code
2507 # variable placed at the root variables scope of .gyp files, because
2508 # those variables are not set at target scope. As a workaround,
2509 # if chromium_code is not set at target scope, define it in target scope
2510 # to contain whatever value it has during early variable expansion.
2511 # That's enough to make it available during target conditional
2513 'chromium_code%': '<(chromium_code)',
2515 'component%': '<(component)',
2517 'chromecast%': '<(chromecast)',
2519 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2520 'win_release_Optimization%': '2', # 2 = /O2
2521 'win_debug_Optimization%': '0', # 0 = /Od
2523 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2524 # Tri-state: blank is default, 1 on, 0 off
2525 'win_release_OmitFramePointers%': '0',
2526 # Tri-state: blank is default, 1 on, 0 off
2527 'win_debug_OmitFramePointers%': '',
2529 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2530 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2532 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2533 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2534 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2536 # VS inserts quite a lot of extra checks to algorithms like
2537 # std::partial_sort in Debug build which make them O(N^2)
2538 # instead of O(N*logN). This is particularly slow under memory
2539 # tools like ThreadSanitizer so we want it to be disablable.
2540 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2541 'win_debug_disable_iterator_debugging%': '0',
2543 # An application manifest fragment to declare compatibility settings for
2544 # 'executable' targets. Ignored in other target type.
2545 'win_exe_compatibility_manifest%':
2546 '<(DEPTH)\\build\\win\\compatibility.manifest',
2548 'release_extra_cflags%': '',
2549 'debug_extra_cflags%': '',
2551 'release_valgrind_build%': '<(release_valgrind_build)',
2553 # the non-qualified versions are widely assumed to be *nix-only
2554 'win_release_extra_cflags%': '',
2555 'win_debug_extra_cflags%': '',
2557 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2558 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2560 # Only used by Windows build for now. Can be used to build into a
2561 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2562 # output files in src/build/VS2010_{Debug,Release}.
2563 'build_dir_prefix%': '',
2565 # Targets are by default not nacl untrusted code.
2566 'nacl_untrusted_build%': 0,
2568 'pnacl_compile_flags': [
2569 # pnacl uses the clang compiler so we need to suppress all the
2570 # same warnings as we do for clang.
2571 # TODO(sbc): Remove these if/when they are removed from the clang
2573 '-Wno-unused-function',
2574 '-Wno-char-subscripts',
2575 '-Wno-c++11-extensions',
2576 '-Wno-unnamed-type-template-args',
2579 # By default, Android targets have their exported JNI symbols stripped,
2580 # so we test the manual JNI registration code paths that are required
2581 # when using the crazy linker. To allow use of native JNI exports (lazily
2582 # resolved by the JVM), targets can enable this variable, which will stop
2583 # the stripping from happening. Only targets which do not need to be
2584 # compatible with the crazy linker are permitted to set this.
2585 'use_native_jni_exports%': 0,
2588 ['OS=="win" and component=="shared_library"', {
2589 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2590 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2591 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2593 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2594 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2595 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2598 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2599 'mac_release_optimization%': 's', # Use -Os unless overridden
2600 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2602 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2603 'mac_release_optimization%': '2', # Use -O2 unless overridden
2604 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2607 'host_os%': '<(host_os)', # See comment above chromium_code.
2610 'clang_warning_flags': [
2613 # Don't die on dtoa code that uses a char as an array index.
2614 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2615 '-Wno-char-subscripts',
2617 # TODO(thakis): This used to be implied by -Wno-unused-function,
2618 # which we no longer use. Check if it makes sense to remove
2619 # this as well. http://crbug.com/316352
2620 '-Wno-unneeded-internal-declaration',
2622 # Warns on switches on enums that cover all enum values but
2623 # also contain a default: branch. Chrome is full of that.
2624 '-Wno-covered-switch-default',
2626 # Warns when a const char[] is converted to bool.
2627 '-Wstring-conversion',
2629 # C++11-related flags:
2631 # This warns on using ints as initializers for floats in
2632 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2633 # which happens in several places in chrome code. Not sure if
2634 # this is worth fixing.
2635 '-Wno-c++11-narrowing',
2637 # Clang considers the `register` keyword as deprecated, but e.g.
2638 # code generated by flex (used in angle) contains that keyword.
2639 # http://crbug.com/255186
2640 '-Wno-deprecated-register',
2642 # TODO(hans): Get this cleaned up, http://crbug.com/428099
2643 '-Wno-inconsistent-missing-override',
2645 # TODO(thakis): Enable this, crbug.com/507717
2646 '-Wno-shift-negative-value',
2649 'includes': [ 'set_clang_warning_flags.gypi', ],
2651 # Don't use deprecated V8 APIs anywhere.
2652 'V8_DEPRECATION_WARNINGS',
2653 'CLD_VERSION=<(cld_version)',
2656 '<(SHARED_INTERMEDIATE_DIR)',
2660 # When compiling Objective C, warns if a method is used whose
2661 # availability is newer than the deployment target.
2662 'xcode_settings': { 'WARNING_CFLAGS': ['-Wpartial-availability']},
2664 ['(OS=="mac" or OS=="ios") and asan==1', {
2666 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2669 ['OS=="win" and asan==1 and component=="shared_library"', {
2671 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2674 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2675 'cflags_cc!': ['-fno-rtti'],
2678 '-gline-tables-only',
2679 '-fintercept-allocation-functions',
2681 'defines': ['TYPE_PROFILING'],
2683 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2686 ['branding=="Chrome"', {
2687 'defines': ['GOOGLE_CHROME_BUILD'],
2688 }, { # else: branding!="Chrome"
2689 'defines': ['CHROMIUM_BUILD'],
2691 ['OS=="mac" and component=="shared_library"', {
2693 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2694 'LD_RUNPATH_SEARCH_PATHS': [
2695 # For unbundled binaries.
2697 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2698 '@loader_path/../../..',
2702 ['clang==1 or host_clang==1', {
2703 # This is here so that all files get recompiled after a clang roll and
2704 # when turning clang on or off.
2705 # (defines are passed via the command line, and build systems rebuild
2706 # things when their commandline changes). Nothing should ever read this
2708 'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
2711 'defines': ['ENABLE_RLZ'],
2713 ['component=="shared_library"', {
2714 'defines': ['COMPONENT_BUILD'],
2716 ['ui_compositor_image_transport==1', {
2717 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2720 'defines': ['USE_AURA=1'],
2723 'defines': ['USE_ASH=1'],
2726 'defines': ['USE_PANGO=1'],
2729 'defines': ['USE_CAIRO=1'],
2732 'defines': ['USE_CRAS=1'],
2735 'defines': ['USE_OZONE=1'],
2737 ['use_default_render_theme==1', {
2738 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2740 ['use_libjpeg_turbo==1', {
2741 'defines': ['USE_LIBJPEG_TURBO=1'],
2744 'defines': ['USE_X11=1'],
2746 ['use_clipboard_aurax11==1', {
2747 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2749 ['enable_one_click_signin==1', {
2750 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2752 ['enable_pre_sync_backup==1', {
2753 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2755 ['image_loader_extension==1', {
2756 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2759 'defines': ['ENABLE_PROFILING=1'],
2761 ['enable_webrtc==1', {
2762 'defines': ['ENABLE_WEBRTC=1'],
2764 ['enable_media_router==1', {
2765 'defines': ['ENABLE_MEDIA_ROUTER=1'],
2767 ['proprietary_codecs==1', {
2768 'defines': ['USE_PROPRIETARY_CODECS'],
2770 ['enable_mpeg2ts_stream_parser==1', {
2771 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2775 ['enable_viewport==1', {
2776 'defines': ['ENABLE_VIEWPORT'],
2778 ['enable_pepper_cdms==1', {
2779 'defines': ['ENABLE_PEPPER_CDMS'],
2781 ['enable_browser_cdms==1', {
2782 'defines': ['ENABLE_BROWSER_CDMS'],
2784 ['configuration_policy==1', {
2785 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2787 ['notifications==1', {
2788 'defines': ['ENABLE_NOTIFICATIONS'],
2790 ['enable_hidpi==1', {
2791 'defines': ['ENABLE_HIDPI=1'],
2793 ['enable_topchrome_md==1', {
2794 'defines': ['ENABLE_TOPCHROME_MD=1'],
2796 ['native_memory_pressure_signals==1', {
2797 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2800 'defines': ['USE_UDEV'],
2804 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2807 ['OS=="win" and fastbuild==2', {
2808 # Completely disable debug information.
2811 'GenerateDebugInformation': 'false',
2813 'VCCLCompilerTool': {
2814 'DebugInformationFormat': '0',
2818 ['OS=="win" and fastbuild==1', {
2821 # This tells the linker to generate .pdbs, so that
2822 # we can get meaningful stack traces.
2823 'GenerateDebugInformation': 'true',
2825 'VCCLCompilerTool': {
2826 # No debug info to be generated by compiler.
2827 'DebugInformationFormat': '0',
2831 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2832 'variables': { 'debug_extra_cflags': '-g0', },
2834 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2835 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2837 'variables': { 'debug_extra_cflags': '-g0', },
2839 # Android builds symbols on release by default, disable them.
2840 ['OS=="android" and fastbuild==2', {
2841 'variables': { 'release_extra_cflags': '-g0', },
2843 ['OS=="android" and fastbuild==1', {
2844 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2846 'variables': { 'release_extra_cflags': '-g0', },
2850 ['dont_embed_build_metadata==1', {
2852 'DONT_EMBED_BUILD_METADATA',
2854 }], # dont_embed_build_metadata==1
2855 ['dcheck_always_on!=0', {
2856 'defines': ['DCHECK_ALWAYS_ON=1'],
2857 }], # dcheck_always_on!=0
2858 ['tracing_like_official_build!=0', {
2859 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2860 }], # tracing_like_official_build!=0
2861 ['fieldtrial_testing_like_official_build==0 and branding!="Chrome"', {
2862 'defines': ['FIELDTRIAL_TESTING_ENABLED'],
2863 }], # fieldtrial_testing_like_official_build==0 and branding!="Chrome"
2865 'defines': ['NO_TCMALLOC'],
2867 ['win_use_allocator_shim==1', {
2868 'defines': ['ALLOCATOR_SHIM'],
2874 'ADDRESS_SANITIZER',
2875 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2876 'MEMORY_SANITIZER_INITIAL_SIZE',
2880 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2888 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2889 'MEMORY_SANITIZER_INITIAL_SIZE',
2897 '<(DEPTH)/third_party/kasko/include',
2903 '_CRT_SECURE_NO_DEPRECATE',
2904 '_SCL_SECURE_NO_DEPRECATE',
2905 # This define is required to pull in the new Win8 interfaces from
2906 # system headers like ShObjIdl.h.
2907 'NTDDI_VERSION=0x06030000',
2908 # This is required for ATL to use XP-safe versions of its functions.
2909 '_USING_V110_SDK71_',
2912 '<(DEPTH)/third_party/wtl/include',
2917 # Generates debug info when win_z7=1
2918 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2920 'GenerateDebugInformation': 'true',
2922 'VCCLCompilerTool': {
2923 'DebugInformationFormat': '1',
2929 # This is prohibited when running /analyze.
2930 '_USING_V110_SDK71_',
2933 'VCCLCompilerTool': {
2934 # Set WarnAsError to false to disable this setting for most
2935 # projects so that compilation continues.
2936 'WarnAsError': 'false',
2937 # When win_analyze is specified add the /analyze switch.
2938 # Also add /WX- to force-disable WarnAsError for projects that
2939 # override WarnAsError.
2940 # Also, disable various noisy warnings that have low value.
2941 'AdditionalOptions': [
2943 '/wd6011', # Dereferencing NULL pointer
2944 '/wd6312', # Possible infinite loop: use of the constant
2945 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2946 '/wd6326', # Potential comparison of constant with constant
2947 '/wd28159', # Consider using 'GetTickCount64'
2948 '/wd28204', # Inconsistent SAL annotations
2949 '/wd28251', # Inconsistent SAL annotations
2950 '/wd28252', # Inconsistent SAL annotations
2951 '/wd28253', # Inconsistent SAL annotations
2952 '/wd28196', # The precondition is not satisfied
2953 '/wd28301', # Inconsistent SAL annotations
2954 '/wd6340', # Sign mismatch in function parameter
2955 '/wd28182', # Dereferencing NULL pointer
2956 # C6285 is ~16% of raw warnings and has low value
2957 '/wd6285', # non-zero constant || non-zero constant
2958 # C6334 is ~80% of raw warnings and has low value
2959 '/wd6334', # sizeof applied to an expression with an operator
2971 ['use_playready==1', {
2973 'PLAYREADY_CDM_AVAILABLE',
2978 ['enable_task_manager==1', {
2980 'ENABLE_TASK_MANAGER=1',
2983 ['enable_extensions==1', {
2985 'ENABLE_EXTENSIONS=1',
2988 ['OS=="win" and branding=="Chrome"', {
2989 'defines': ['ENABLE_SWIFTSHADER'],
2991 ['enable_dart==1', {
2992 'defines': ['WEBKIT_USING_DART=1'],
2994 ['enable_plugin_installation==1', {
2995 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2997 ['enable_plugins==1', {
2998 'defines': ['ENABLE_PLUGINS=1'],
3000 ['enable_session_service==1', {
3001 'defines': ['ENABLE_SESSION_SERVICE=1'],
3003 ['enable_themes==1', {
3004 'defines': ['ENABLE_THEMES=1'],
3006 ['enable_autofill_dialog==1', {
3007 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
3009 ['enable_prod_wallet_service==1', {
3010 # In GN, this is set on the autofill tagets only. See
3011 # //components/autofill/core/browser:wallet_service
3012 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
3014 ['enable_background==1', {
3015 'defines': ['ENABLE_BACKGROUND=1'],
3017 ['enable_google_now==1', {
3018 'defines': ['ENABLE_GOOGLE_NOW=1'],
3020 ['enable_basic_printing==1 or enable_print_preview==1', {
3021 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
3022 'defines': ['ENABLE_PRINTING=1'],
3024 ['enable_basic_printing==1', {
3025 # Enable basic printing support and UI.
3026 'defines': ['ENABLE_BASIC_PRINTING=1'],
3028 ['enable_print_preview==1', {
3029 # Enable printing with print preview.
3030 # Can be defined without ENABLE_BASIC_PRINTING.
3031 'defines': ['ENABLE_PRINT_PREVIEW=1'],
3033 ['enable_spellcheck==1', {
3034 'defines': ['ENABLE_SPELLCHECK=1'],
3036 ['use_browser_spellchecker', {
3037 'defines': ['USE_BROWSER_SPELLCHECKER=1'],
3039 ['enable_captive_portal_detection==1', {
3040 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
3042 ['enable_app_list==1', {
3043 'defines': ['ENABLE_APP_LIST=1'],
3045 ['enable_settings_app==1', {
3046 'defines': ['ENABLE_SETTINGS_APP=1'],
3048 ['disable_file_support==1', {
3049 'defines': ['DISABLE_FILE_SUPPORT=1'],
3051 ['disable_ftp_support==1', {
3052 'defines': ['DISABLE_FTP_SUPPORT=1'],
3054 ['enable_supervised_users==1', {
3055 'defines': ['ENABLE_SUPERVISED_USERS=1'],
3057 ['enable_mdns==1', {
3058 'defines': ['ENABLE_MDNS=1'],
3060 ['enable_service_discovery==1', {
3061 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
3063 ['enable_wifi_bootstrapping==1', {
3064 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
3066 ['enable_hangout_services_extension==1', {
3067 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
3069 ['enable_ipc_fuzzer==1', {
3070 'defines': ['ENABLE_IPC_FUZZER=1'],
3073 'defines': ['VIDEO_HOLE=1'],
3075 ['v8_use_external_startup_data==1', {
3076 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
3078 ['enable_webvr==1', {
3079 'defines': ['ENABLE_WEBVR'],
3082 # SAFE_BROWSING_SERVICE - browser manages a safe-browsing service.
3083 # SAFE_BROWSING_DB_LOCAL - service manages a local database.
3084 # SAFE_BROWSING_DB_REMOTE - service talks via API to a database
3085 # SAFE_BROWSING_CSD - enable client-side phishing detection.
3086 ['safe_browsing==1', {
3088 # TODO(nparker): Remove existing uses of FULL_SAFE_BROWSING
3089 'FULL_SAFE_BROWSING',
3090 'SAFE_BROWSING_CSD',
3091 'SAFE_BROWSING_DB_LOCAL',
3092 'SAFE_BROWSING_SERVICE',
3095 ['safe_browsing==2', {
3097 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3098 'MOBILE_SAFE_BROWSING',
3099 'SAFE_BROWSING_SERVICE',
3102 ['safe_browsing==3', {
3104 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3105 'MOBILE_SAFE_BROWSING',
3106 'SAFE_BROWSING_DB_REMOTE',
3107 'SAFE_BROWSING_SERVICE',
3110 ], # conditions for 'target_defaults'
3111 'target_conditions': [
3112 ['<(use_libpci)==1', {
3113 'defines': ['USE_LIBPCI=1'],
3115 ['<(use_openssl)==1', {
3116 'defines': ['USE_OPENSSL=1'],
3118 ['<(use_openssl_certs)==1', {
3119 'defines': ['USE_OPENSSL_CERTS=1'],
3121 ['>(nacl_untrusted_build)==1', {
3124 'USE_OPENSSL_CERTS=1',
3127 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3128 'defines': ['USE_GLIB=1'],
3130 ['<(use_nss_certs)==1 and >(nacl_untrusted_build)==0', {
3131 'defines': ['USE_NSS_CERTS=1'],
3133 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3134 'defines': ['OS_CHROMEOS=1'],
3136 ['enable_wexit_time_destructors==1 and OS!="win"', {
3137 # TODO: Enable on Windows too, http://crbug.com/404525
3138 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3140 ['chromium_code==0', {
3142 'clang_warning_flags': [
3143 # TODO(mgiuca): Move this suppression into individual third-party
3144 # libraries as required. http://crbug.com/505301.
3145 '-Wno-overloaded-virtual',
3146 # Lots of third-party libraries have unused variables. Instead of
3147 # suppressing them individually, we just blanket suppress them here.
3148 '-Wno-unused-variable',
3152 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3153 # We don't want to get warnings from third-party code,
3154 # so remove any existing warning-enabling flags like -Wall.
3160 # Don't warn about hash_map in third-party code.
3164 # Don't warn about printf format problems.
3165 # This is off by default in gcc but on in Ubuntu's gcc(!).
3169 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3173 # TODO: Fix all warnings on chromeos too.
3174 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3179 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3181 # Don't warn about ignoring the return value from e.g. close().
3182 # This is off by default in some gccs but on by default in others.
3183 # BSD systems do not support this option, since they are usually
3184 # using gcc 4.2.1, which does not have this flag yet.
3185 '-Wno-unused-result',
3190 '_CRT_SECURE_NO_DEPRECATE',
3191 '_CRT_NONSTDC_NO_WARNINGS',
3192 '_CRT_NONSTDC_NO_DEPRECATE',
3193 '_SCL_SECURE_NO_DEPRECATE',
3195 'msvs_disabled_warnings': [
3199 'VCCLCompilerTool': {
3200 'WarningLevel': '3',
3201 'WarnAsError': 'true',
3202 'Detect64BitPortabilityProblems': 'false',
3206 ['buildtype=="Official"', {
3208 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3211 [ 'component=="shared_library"', {
3212 # TODO(darin): Unfortunately, some third_party code depends on base.
3213 'msvs_disabled_warnings': [
3214 4251, # class 'std::xx' needs to have dll-interface.
3220 [ 'OS=="mac" or OS=="ios"', {
3222 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3225 ['buildtype=="Official"', {
3227 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3234 # TODO(ios): Fix remaining warnings in third-party code, then
3235 # remove this; the Mac cleanup didn't get everything that's
3236 # flagged in an iOS build.
3237 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3238 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3239 # Several internal ios directories generate numerous warnings for
3240 # -Wobjc-missing-property-synthesis.
3241 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3247 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3248 'filename_rules.gypi',
3250 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3251 # C99 macros on Mac and Linux.
3253 '__STDC_CONSTANT_MACROS',
3254 '__STDC_FORMAT_MACROS',
3258 # turn on warnings for signed/unsigned mismatch on chromium code.
3260 'VCCLCompilerTool': {
3261 'AdditionalOptions': ['/we4389'],
3265 ['OS=="win" and component=="shared_library"', {
3266 'msvs_disabled_warnings': [
3267 4251, # class 'std::xx' needs to have dll-interface.
3272 ], # target_conditions for 'target_defaults'
3273 'default_configuration': 'Debug',
3275 # VCLinkerTool LinkIncremental values below:
3277 # 1 == /INCREMENTAL:NO
3279 # Debug links incremental, Release does not.
3281 # Abstract base configurations to cover common attributes.
3285 'msvs_configuration_attributes': {
3286 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3287 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3288 'CharacterSet': '1',
3291 'VCCLCompilerTool': {
3292 'AdditionalOptions': [
3297 # Add the default import libs.
3298 'AdditionalDependencies': [
3315 'AdditionalOptions': [
3316 # Suggested by Microsoft Devrel to avoid
3317 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3318 # which started happening more regularly after VS2013 Update 4.
3319 # Needs to be a bit lower for VS2015, or else errors out.
3320 '/maxilksize:0x7ff00000',
3329 'MinimumRequiredVersion': '5.01', # XP.
3330 'TargetMachine': '1',
3332 'VCLibrarianTool': {
3333 'TargetMachine': '1',
3336 'msvs_configuration_platform': 'Win32',
3340 'msvs_configuration_platform': 'x64',
3343 # Make sure to understand http://crbug.com/361720 if you want to
3345 'MinimumRequiredVersion': '5.02', # Server 2003.
3346 'TargetMachine': '17', # x86 - 64
3347 'AdditionalLibraryDirectories!':
3348 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3349 'AdditionalLibraryDirectories':
3350 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3351 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3352 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3354 'VCLibrarianTool': {
3355 'AdditionalLibraryDirectories!':
3356 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3357 'AdditionalLibraryDirectories':
3358 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3359 'TargetMachine': '17', # x64
3366 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3367 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3370 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3372 '<@(debug_extra_cflags)',
3376 'VCCLCompilerTool': {
3377 'Optimization': '<(win_debug_Optimization)',
3378 'PreprocessorDefinitions': ['_DEBUG'],
3379 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3380 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3382 # According to MSVS, InlineFunctionExpansion=0 means
3383 # "default inlining", not "/Ob0".
3384 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3385 ['win_debug_InlineFunctionExpansion==0', {
3386 'AdditionalOptions': ['/Ob0'],
3388 ['win_debug_InlineFunctionExpansion!=""', {
3389 'InlineFunctionExpansion':
3390 '<(win_debug_InlineFunctionExpansion)',
3392 ['win_debug_disable_iterator_debugging==1', {
3393 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3396 # if win_debug_OmitFramePointers is blank, leave as default
3397 ['win_debug_OmitFramePointers==1', {
3398 'OmitFramePointers': 'true',
3400 ['win_debug_OmitFramePointers==0', {
3401 'OmitFramePointers': 'false',
3402 # The above is not sufficient (http://crbug.com/106711): it
3403 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3404 # perform FPO regardless, so we must explicitly disable.
3405 # We still want the false setting above to avoid having
3406 # "/Oy /Oy-" and warnings about overriding.
3407 'AdditionalOptions': ['/Oy-'],
3410 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3413 'LinkIncremental': '<(msvs_debug_link_incremental)',
3414 # ASLR makes debugging with windbg difficult because Chrome.exe and
3415 # Chrome.dll share the same base name. As result, windbg will
3416 # name the Chrome.dll module like chrome_<base address>, where
3417 # <base address> typically changes with each launch. This in turn
3418 # means that breakpoints in Chrome.dll don't stick from one launch
3419 # to the next. For this reason, we turn ASLR off in debug builds.
3420 # Note that this is a three-way bool, where 0 means to pick up
3421 # the default setting, 1 is off and 2 is on.
3422 'RandomizedBaseAddress': 1,
3424 'VCResourceCompilerTool': {
3425 'PreprocessorDefinitions': ['_DEBUG'],
3429 ['OS=="linux" or OS=="android"', {
3430 'target_conditions': [
3431 ['_toolset=="target"', {
3433 '<@(debug_extra_cflags)',
3438 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3439 # Enable libstdc++ debugging facilities to help catch problems
3440 # early, see http://crbug.com/65151 .
3441 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3442 'defines': ['_GLIBCXX_DEBUG=1',],
3444 ['release_valgrind_build==0', {
3447 '-fstack-protector-all', # Implies -fstack-protector
3453 # Allow comparing the address of references and 'this' against 0
3454 # in debug builds. Technically, these can never be null in
3455 # well-defined C/C++ and Clang can optimize such checks away in
3456 # release builds, but they may be used in asserts in debug builds.
3457 '-Wno-undefined-bool-conversion',
3458 '-Wno-tautological-undefined-compare',
3462 '-Wno-undefined-bool-conversion',
3463 '-Wno-tautological-undefined-compare',
3467 'VCCLCompilerTool': {
3468 'AdditionalOptions': [
3469 '-Wno-undefined-bool-conversion',
3470 '-Wno-tautological-undefined-compare',
3483 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3484 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3485 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3488 'VCCLCompilerTool': {
3489 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3491 # In official builds, each target will self-select
3492 # an optimization level.
3493 ['buildtype!="Official"', {
3494 'Optimization': '<(win_release_Optimization)',
3497 # According to MSVS, InlineFunctionExpansion=0 means
3498 # "default inlining", not "/Ob0".
3499 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3500 ['win_release_InlineFunctionExpansion==0', {
3501 'AdditionalOptions': ['/Ob0'],
3503 ['win_release_InlineFunctionExpansion!=""', {
3504 'InlineFunctionExpansion':
3505 '<(win_release_InlineFunctionExpansion)',
3508 # if win_release_OmitFramePointers is blank, leave as default
3509 ['win_release_OmitFramePointers==1', {
3510 'OmitFramePointers': 'true',
3512 ['win_release_OmitFramePointers==0', {
3513 'OmitFramePointers': 'false',
3514 # The above is not sufficient (http://crbug.com/106711): it
3515 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3516 # perform FPO regardless, so we must explicitly disable.
3517 # We still want the false setting above to avoid having
3518 # "/Oy /Oy-" and warnings about overriding.
3519 'AdditionalOptions': ['/Oy-'],
3522 # Put data in separate COMDATs. This allows the linker
3523 # to put bit-identical constants at the same address even if
3524 # they're unrelated constants, which saves binary size.
3525 # This optimization can't be used when ASan is enabled because
3526 # it is not compatible with the ASan ODR checker.
3527 'AdditionalOptions': ['/Gw'],
3530 'AdditionalOptions': [
3531 '/d2Zi+', # Improve debugging of Release builds.
3532 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3533 '<@(win_release_extra_cflags)',
3537 # LinkIncremental is a tri-state boolean, where 0 means default
3538 # (i.e., inherit from parent solution), 1 means false, and
3540 'LinkIncremental': '1',
3541 # This corresponds to the /PROFILE flag which ensures the PDB
3542 # file contains FIXUP information (growing the PDB file by about
3543 # 5%) but does not otherwise alter the output binary. This
3544 # information is used by the Syzygy optimization tool when
3545 # decomposing the release image.
3550 ['msvs_use_common_release', {
3551 'includes': ['release.gypi'],
3553 ['release_valgrind_build==0 and tsan==0', {
3556 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3560 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3561 'MEMORY_SANITIZER_INITIAL_SIZE',
3562 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3563 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3567 'defines': ['NO_TCMALLOC'],
3569 ['win_fastlink==1', {
3572 # /PROFILE is incompatible with /debug:fastlink
3574 'AdditionalOptions': [
3575 # Tell VS 2015+ to create a PDB that references debug
3576 # information in .obj and .lib files instead of copying
3585 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3586 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3587 # It seems to work fine with Ubuntu 12 headers though, so use it
3588 # in official builds.
3589 ['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")', {
3590 'target_conditions': [
3591 ['chromium_code==1', {
3592 # Non-chromium code is not guaranteed to compile cleanly
3593 # with _FORTIFY_SOURCE. Also, fortified build may fail
3594 # when optimizations are disabled, so only do that for Release
3597 '_FORTIFY_SOURCE=2',
3602 ['OS=="linux" or OS=="android"', {
3603 'target_conditions': [
3604 ['_toolset=="target"', {
3606 '<@(release_extra_cflags)',
3609 ['enable_resource_whitelist_generation==1', {
3611 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3620 'NS_BLOCK_ASSERTIONS=1',
3626 # Concrete configurations
3629 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3632 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3637 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3638 'target_conditions': [
3639 [ '_type=="executable"', {
3640 # To get a real .dSYM bundle produced by dsymutil, set the
3641 # debug information format to dwarf-with-dsym. Since
3642 # strip_from_xcode will not be used, set Xcode to do the
3643 # stripping as well.
3645 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3646 'DEPLOYMENT_POSTPROCESSING': 'YES',
3647 'STRIP_INSTALLED_PRODUCT': 'YES',
3654 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3656 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3659 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3667 'target_defaults': {
3672 # TODO(glider): enable the default options on other systems.
3674 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3676 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3682 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3683 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3684 'target_defaults': {
3686 '-Wl,--fatal-warnings',
3690 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3691 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
3692 'target_defaults': {
3698 ['os_posix==1 and chromeos==0', {
3699 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3700 # and we want to avoid overriding this, so stack-protector is only
3701 # enabled when not building on Chrome OS.
3702 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3704 'target_defaults': {
3706 '-fstack-protector',
3707 '--param=ssp-buffer-size=4',
3711 ['os_posix==1 and OS=="linux"', {
3713 '_LARGEFILE_SOURCE',
3714 '_LARGEFILE64_SOURCE',
3715 '_FILE_OFFSET_BITS=64',
3718 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3719 'target_defaults': {
3720 # Enable -Werror by default, but put it in a variable so it can
3721 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3723 'werror%': '-Werror',
3724 'libraries_for_target%': '',
3727 '_FILE_OFFSET_BITS=64',
3730 '<(werror)', # See note above about the werror variable.
3732 '-fno-strict-aliasing', # See http://crbug.com/32204
3734 # Don't warn about unused function params. We use those everywhere.
3735 '-Wno-unused-parameter',
3736 # Don't warn about the "struct foo f = {0};" initialization pattern.
3737 '-Wno-missing-field-initializers',
3738 # Don't export any symbols (for example, to plugins we dlopen()).
3739 # Note: this is *required* to make some plugins work.
3740 '-fvisibility=hidden',
3746 '-fno-threadsafe-statics',
3747 # Make inline functions have hidden visiblity by default.
3748 # Surprisingly, not covered by -fvisibility=hidden.
3749 '-fvisibility-inlines-hidden',
3750 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3751 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3755 '-pthread', '-Wl,-z,noexecstack',
3758 '<(libraries_for_target)',
3763 'debug_optimize%': '0',
3769 '-O>(debug_optimize)',
3773 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3774 # TODO(jdduke) Re-enable on mips after resolving linking
3775 # issues with libc++ (crbug.com/456380).
3777 # Warn in case of text relocations.
3778 '-Wl,--warn-shared-textrel',
3781 ['OS=="android" and android_full_debug==0', {
3782 # Some configurations are copied from Release_Base to reduce
3785 'debug_optimize%': 's',
3789 '-ffunction-sections',
3796 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3797 # We don't omit frame pointers on arm64 since they are required
3798 # to correctly unwind stackframes which contain system library
3799 # function frames (crbug.com/391706).
3801 '-fomit-frame-pointer',
3804 ['OS=="linux" and target_arch=="ia32"', {
3806 '-Wl,--no-as-needed',
3809 ['debug_unwind_tables==1', {
3810 'cflags': ['-funwind-tables'],
3812 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3813 'defines': ['NO_UNWIND_TABLES'],
3815 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3816 # definitions in to the right scope to use them when setting
3817 # linux_use_debug_fission, so it can be used here alone.
3818 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3819 'cflags': ['-gsplit-dwarf'],
3825 'release_optimize%': '2',
3826 # Binaries become big and gold is unable to perform GC
3827 # and remove unused sections for some of test targets
3828 # on 32 bit platform.
3829 # (This is currently observed only in chromeos valgrind bots)
3830 # The following flag is to disable --gc-sections linker
3831 # option for these bots.
3832 'no_gc_sections%': 0,
3834 # TODO(bradnelson): reexamine how this is done if we change the
3835 # expansion of configurations
3836 'release_valgrind_build%': 0,
3839 '-O<(release_optimize)',
3840 # Don't emit the GCC version ident directives, they just end up
3841 # in the .comment section taking up binary size.
3843 # Put data and code in their own sections, so that unused symbols
3844 # can be removed at link time with --gc-sections.
3846 '-ffunction-sections',
3849 # Specifically tell the linker to perform optimizations.
3850 # See http://lwn.net/Articles/192624/ .
3855 ['no_gc_sections==0', {
3857 '-Wl,--gc-sections',
3860 ['OS=="android" and target_arch!="arm64"', {
3861 # We don't omit frame pointers on arm64 since they are required
3862 # to correctly unwind stackframes which contain system library
3863 # function frames (crbug.com/391706).
3865 '-fomit-frame-pointer',
3868 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3869 # TODO(jdduke) Re-enable on mips after resolving linking
3870 # issues with libc++ (crbug.com/456380).
3872 # Warn in case of text relocations.
3873 '-Wl,--warn-shared-textrel',
3878 'release_optimize%': 's',
3883 '-fno-omit-frame-pointer',
3887 ['profiling_full_stack_frames==1', {
3890 '-fno-optimize-sibling-calls',
3895 ['release_unwind_tables==1', {
3896 'cflags': ['-funwind-tables'],
3898 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3899 'defines': ['NO_UNWIND_TABLES'],
3905 ['target_arch=="ia32"', {
3906 'target_conditions': [
3907 ['_toolset=="target"', {
3909 # Needed so that libs with .s files (e.g. libicudata.a)
3910 # are compatible with the general 32-bit-ness.
3913 # All floating-point computations on x87 happens in 80-bit
3914 # precision. Because the C and C++ language standards allow
3915 # the compiler to keep the floating-point values in higher
3916 # precision than what's specified in the source and doing so
3917 # is more efficient than constantly rounding up to 64-bit or
3918 # 32-bit precision as specified in the source, the compiler,
3919 # especially in the optimized mode, tries very hard to keep
3920 # values in x87 floating-point stack (in 80-bit precision)
3921 # as long as possible. This has important side effects, that
3922 # the real value used in computation may change depending on
3923 # how the compiler did the optimization - that is, the value
3924 # kept in 80-bit is different than the value rounded down to
3925 # 64-bit or 32-bit. There are possible compiler options to
3926 # make this behavior consistent (e.g. -ffloat-store would keep
3927 # all floating-values in the memory, thus force them to be
3928 # rounded to its original precision) but they have significant
3929 # runtime performance penalty.
3931 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3932 # which keep floating-point values in SSE registers in its
3933 # native precision (32-bit for single precision, and 64-bit
3934 # for double precision values). This means the floating-point
3935 # value used during computation does not change depending on
3936 # how the compiler optimized the code, since the value is
3937 # always kept in its specified precision.
3939 # Refer to http://crbug.com/348761 for rationale behind SSE2
3940 # being a minimum requirement for 32-bit Linux builds and
3941 # http://crbug.com/313032 for an example where this has "bit"
3946 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3953 # Use gold linker for Android ia32 target.
3963 ['target_arch=="x64"', {
3964 'target_conditions': [
3965 ['_toolset=="target"', {
3967 # Use gold linker for Android x64 target.
3984 ['target_arch=="arm"', {
3985 'target_conditions': [
3986 ['_toolset=="target"', {
3990 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3991 # has changed whenever it encounters a varargs function. This
3992 # silences those warnings, as they are not helpful and
3993 # clutter legitimate warnings.
3997 ['clang==1 and arm_arch!="" and OS!="android"', {
3999 '-target arm-linux-gnueabihf',
4002 '-target arm-linux-gnueabihf',
4007 '-march=<(arm_arch)',
4010 ['use_lto==1 or use_lto_o2==1', {
4012 '-march=<(arm_arch)',
4017 ['clang==1 and OS!="android"', {
4019 # We need to disable clang's builtin assembler as it can't
4020 # handle several asm files, crbug.com/124610
4021 '-no-integrated-as',
4026 '-mtune=<(arm_tune)',
4029 ['use_lto==1 or use_lto_o2==1', {
4031 '-mtune=<(arm_tune)',
4041 ['use_lto==1 or use_lto_o2==1', {
4048 ['arm_float_abi!=""', {
4050 '-mfloat-abi=<(arm_float_abi)',
4053 ['use_lto==1 or use_lto_o2==1', {
4055 '-mfloat-abi=<(arm_float_abi)',
4065 ['use_lto==1 or use_lto_o2==1', {
4073 # Most of the following flags are derived from what Android
4074 # uses by default when building for arm, reference for which
4075 # can be found in the following file in the Android NDK:
4076 # toolchains/arm-linux-androideabi-4.9/setup.mk
4078 # The tree-sra optimization (scalar replacement for
4079 # aggregates enabling subsequent optimizations) leads to
4080 # invalid code generation when using the Android NDK's
4081 # compiler (r5-r7). This can be verified using
4082 # webkit_unit_tests' WTF.Checked_int8_t test.
4084 # The following option is disabled to improve binary
4085 # size and performance in gcc 4.9.
4086 '-fno-caller-saves',
4089 # Android now supports .relro sections properly.
4090 # NOTE: While these flags enable the generation of .relro
4091 # sections, the generated libraries can still be loaded on
4092 # older Android platform versions.
4099 ['gcc_version==48 and clang==0', {
4101 # The following 5 options are disabled to save on
4102 # binary size in GCC 4.8.
4103 '-fno-partial-inlining',
4104 '-fno-early-inlining',
4105 '-fno-tree-copy-prop',
4106 '-fno-tree-loop-optimize',
4107 '-fno-move-loop-invariants',
4111 'cflags': [ '-mthumb-interwork' ],
4115 # Thumb code with frame pointer makes chrome crash
4118 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
4119 # The perf report sometimes incorrectly attributes
4120 # code from tail calls.
4121 '-fno-optimize-sibling-calls',
4124 '-fomit-frame-pointer',
4129 # Clang does not support the following options.
4131 '-mthumb-interwork',
4132 '-finline-limit=64',
4134 '-fno-caller-saves',
4138 # TODO(hans) Enable integrated-as (crbug.com/124610).
4139 '-no-integrated-as',
4140 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4143 ['clang==1 and linux_use_bundled_gold==0', {
4145 # Let clang find the ld.gold in the NDK.
4146 '--gcc-toolchain=<(android_toolchain)/..',
4151 '-marm', # Required for frame pointer based stack traces.
4158 # We set arm_arch to "" so that -march compiler option
4159 # is not set. Otherwise a gcc bug that would complain
4160 # about it conflicting with '-mcpu=cortex-a9'. The flag
4161 # '-march=armv7-a' is actually redundant anyway because
4162 # it is enabled by default when we built the toolchain.
4163 # And using '-mcpu=cortex-a9' should be sufficient.
4166 # Breakpad requires symbols with debugging information
4170 # We want to statically link libstdc++/libgcc_s.
4171 '-static-libstdc++',
4175 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4176 # define their own cflags for arm builds that could
4177 # conflict with the flags we set here (e.g.
4178 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4187 ['target_arch=="arm64"', {
4188 'target_conditions': [
4189 ['_toolset=="target"', {
4193 '-fstack-protector', # stack protector is always enabled on arm64.
4200 ['target_arch=="mipsel"', {
4201 'target_conditions': [
4202 ['_toolset=="target"', {
4204 ['mips_arch_variant=="r6"', {
4207 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ],
4208 'ldflags': [ '-target mipsel-linux-gnu', ],
4210 'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
4212 ['clang==0 and OS=="android"', {
4213 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4217 ['mips_arch_variant=="r2"', {
4219 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4220 'cflags': ['-m<(mips_fpu_mode)'],
4225 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
4226 'ldflags': [ '-target mipsel-linux-android', ],
4228 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32r2'],
4229 'ldflags': [ '-target mipsel-linux-gnu', ],
4233 'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
4237 ['mips_arch_variant=="r1"', {
4242 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
4243 'ldflags': [ '-target mipsel-linux-android', ],
4245 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32'],
4246 'ldflags': [ '-target mipsel-linux-gnu', ],
4250 'cflags': ['-mips32', '-Wa,-mips32', ],
4256 # Clang does not support the following options.
4257 '-finline-limit=64',
4260 # TODO(gordanac) Enable integrated-as.
4261 '-no-integrated-as',
4264 ['clang==1 and OS=="android"', {
4266 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4269 # Let clang find the ld in the NDK.
4270 '--gcc-toolchain=<(android_toolchain)/..',
4273 ['mips_dsp_rev==1', {
4274 'cflags': ['-mdsp'],
4276 ['mips_dsp_rev==2', {
4277 'cflags': ['-mdspr2'],
4281 '-m<(mips_float_abi)-float'
4284 '-Wl,--no-keep-memory'
4287 '-Wno-uninitialized',
4292 ['target_arch=="mips64el"', {
4293 'target_conditions': [
4294 ['_toolset=="target"', {
4296 ['mips_arch_variant=="r6"', {
4297 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4298 'ldflags': ['-mips64r6'],
4300 ['mips_arch_variant=="r2"', {
4301 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4302 'ldflags': ['-mips64r2'],
4306 '-Wno-uninitialized',
4320 'target_conditions': [
4321 ['_toolset=="target"', {
4323 '--sysroot=<(sysroot)',
4326 '--sysroot=<(sysroot)',
4327 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4333 # TODO(thakis): Remove, http://crbug.com/263960
4334 '-Wno-reserved-user-defined-literal',
4337 # gnu++11 instead of c++11 is needed because some code uses
4338 # typeof() (a GNU extension).
4339 # TODO(thakis): Eventually switch this to c++11 instead,
4340 # http://crbug.com/427584
4344 ['clang==0 and host_clang==1', {
4345 'target_conditions': [
4346 ['_toolset=="host"', {
4347 'cflags_cc': [ '-std=gnu++11', ],
4351 ['clang==1 and clang_use_chrome_plugins==1', {
4353 '<@(clang_chrome_plugins_flags)',
4356 ['clang==1 and clang_load!=""', {
4358 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4361 ['clang==1 and clang_add_plugin!=""', {
4363 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4366 ['clang==1 and target_arch=="ia32"', {
4368 # Else building libyuv gives clang's register allocator issues,
4369 # see llvm.org/PR15798 / crbug.com/233709
4370 '-momit-leaf-frame-pointer',
4371 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4372 '-mstack-alignment=16',
4376 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4378 # See http://crbug.com/110262
4379 '-fcolor-diagnostics',
4382 # Common options for AddressSanitizer, LeakSanitizer,
4383 # ThreadSanitizer and MemorySanitizer.
4384 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4385 'target_conditions': [
4386 ['_toolset=="target"', {
4388 '-fno-omit-frame-pointer',
4389 '-gline-tables-only',
4392 '-fomit-frame-pointer',
4397 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4398 'target_conditions': [
4399 ['_toolset=="target"', {
4401 # Functions interposed by the sanitizers can make ld think
4402 # that some libraries aren't needed when they actually are,
4403 # http://crbug.com/234010. As workaround, disable --as-needed.
4407 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4408 'MEMORY_SANITIZER_INITIAL_SIZE',
4414 'target_conditions': [
4415 ['_toolset=="target"', {
4417 '-fsanitize=address',
4418 # TODO(earthdok): Re-enable. http://crbug.com/427202
4419 #'-fsanitize-blacklist=<(asan_blacklist)',
4422 '-fsanitize=address',
4429 '-mllvm -asan-globals=0', # http://crbug.com/352073
4435 'target_conditions': [
4436 ['_toolset=="target"', {
4438 # FIXME: work on enabling more flags and getting rid of false
4439 # positives. http://crbug.com/174801.
4440 '-fsanitize=bounds',
4441 '-fsanitize=float-divide-by-zero',
4442 '-fsanitize=integer-divide-by-zero',
4444 '-fsanitize=object-size',
4445 '-fsanitize=return',
4446 '-fsanitize=returns-nonnull-attribute',
4447 '-fsanitize=shift-exponent',
4448 '-fsanitize=signed-integer-overflow',
4449 '-fsanitize=unreachable',
4450 '-fsanitize=vla-bound',
4451 '-fsanitize-blacklist=<(ubsan_blacklist)',
4452 # Employ the experimental PBQP register allocator to avoid
4453 # slow compilation on files with too many basic blocks.
4454 # See http://crbug.com/426271.
4455 '-mllvm -regalloc=pbqp',
4456 # Speculatively use coalescing to slightly improve the code
4457 # generated by PBQP regallocator. May increase compile time.
4458 '-mllvm -pbqp-coalescing',
4467 '-fsanitize=undefined',
4470 'UNDEFINED_SANITIZER',
4476 'target_conditions': [
4477 ['_toolset=="target"', {
4480 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4492 'UNDEFINED_SANITIZER',
4497 ['asan_coverage!=0 and sanitizer_coverage==0', {
4498 'target_conditions': [
4499 ['_toolset=="target"', {
4501 '-fsanitize-coverage=<(asan_coverage)',
4504 'SANITIZER_COVERAGE',
4509 ['sanitizer_coverage!=0', {
4510 'target_conditions': [
4511 ['_toolset=="target"', {
4513 '-fsanitize-coverage=<(sanitizer_coverage)',
4516 'SANITIZER_COVERAGE',
4521 ['(asan_coverage>1 or sanitizer_coverage>1) and target_arch=="arm"', {
4522 'target_conditions': [
4523 ['_toolset=="target"', {
4525 '-mllvm -sanitizer-coverage-block-threshold=0', # http://crbug.com/517105
4530 ['asan_field_padding!=0', {
4531 'target_conditions': [
4532 ['_toolset=="target"', {
4534 '-fsanitize-address-field-padding=<(asan_field_padding)',
4540 'target_conditions': [
4541 ['_toolset=="target"', {
4550 'WTF_USE_LEAK_SANITIZER=1',
4556 'target_conditions': [
4557 ['_toolset=="target"', {
4559 '-fsanitize=thread',
4560 '-fsanitize-blacklist=<(tsan_blacklist)',
4563 '-fsanitize=thread',
4567 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4568 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4574 'target_conditions': [
4575 ['_toolset=="target"', {
4577 '-fsanitize=memory',
4578 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4579 '-fsanitize-blacklist=<(msan_blacklist)',
4582 '-fsanitize=memory',
4590 ['use_instrumented_libraries==1', {
4592 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4595 ['use_prebuilt_instrumented_libraries==1', {
4597 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
4600 ['use_custom_libcxx==1', {
4602 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4605 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4606 'target_conditions' : [
4607 # crazy_linker has an upstream gyp file we can't edit, and we
4608 # don't want to instrument it.
4609 ['_toolset=="target" and _target_name!="crazy_linker"', {
4611 '-finstrument-functions',
4612 # Allow mmx intrinsics to inline, so that the
4613 #0 compiler can expand the intrinsics.
4614 '-finstrument-functions-exclude-file-list=mmintrin.h',
4617 ['_toolset=="target" and OS=="android"', {
4619 # Avoids errors with current NDK:
4620 # "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"
4621 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4626 ['linux_dump_symbols==1', {
4629 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4630 'target_conditions': [
4631 ['_toolset=="target"', {
4633 # Attempt to use less memory to prevent the linker from
4634 # running out of address space. Considering installing a
4635 # 64-bit kernel and switching to a 64-bit linker.
4636 '-Wl,--no-keep-memory',
4643 ['use_allocator!="tcmalloc"', {
4644 'defines': ['NO_TCMALLOC'],
4646 ['linux_use_gold_flags==1', {
4647 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4649 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4650 'ldflags': [ '-fuse-ld=gold', ],
4652 'target_conditions': [
4653 ['_toolset=="target"', {
4655 # Experimentation found that using four linking threads
4656 # saved ~20% of link time.
4657 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4658 # Only apply this to the target linker, since the host
4659 # linker might not be gold, but isn't used much anyway.
4660 # TODO(raymes): Disable threading because gold is frequently
4661 # crashing on the bots: crbug.com/161942.
4663 # '-Wl,--thread-count=4',
4666 # TODO(thestig): Enable this for disabled cases.
4667 [ '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', {
4669 '-Wl,--detect-odr-violations',
4676 ['release_valgrind_build==0 and order_profiling==0 and asan==0 and msan==0 and lsan==0 and tsan==0', {
4677 'target_conditions': [
4678 ['_toolset=="target"', {
4680 '-Wl,--icf=<(gold_icf_level)',
4687 ['linux_use_bundled_binutils==1', {
4689 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4692 ['linux_use_bundled_gold==1 and '
4693 'not (clang==0 and (use_lto==1 or use_lto_o2==1))', {
4694 # Put our binutils, which contains gold in the search path. We pass
4695 # the path to gold to the compiler. gyp leaves unspecified what the
4696 # cwd is when running the compiler, so the normal gyp path-munging
4697 # fails us. This hack gets the right path.
4699 # Disabled when using GCC LTO because GCC also uses the -B search
4700 # path at link time to find "as", and our bundled "as" can only
4703 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4706 # Some binutils 2.23 releases may or may not have new dtags enabled,
4707 # but they are all compatible with --disable-new-dtags,
4708 # because the new dynamic tags are not created by default.
4709 ['binutils_version>=223', {
4710 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4711 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4712 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4713 # inside this file to allow usage of --no-as-needed and removal of
4716 '-Wl,--disable-new-dtags',
4719 ['gcc_version>=47 and clang==0', {
4720 'target_conditions': [
4721 ['_toolset=="target"', {
4724 # See comment for -Wno-c++11-narrowing.
4726 # TODO(thakis): Remove, http://crbug.com/263960
4727 '-Wno-literal-suffix',
4732 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4733 'target_conditions': [
4734 ['_toolset=="host"', {
4737 # See comment for -Wno-c++11-narrowing.
4739 # TODO(thakis): Remove, http://crbug.com/263960
4740 '-Wno-literal-suffix',
4748 # FreeBSD-specific options; note that most FreeBSD options are set above,
4751 'target_defaults': {
4753 '-Wl,--no-keep-memory',
4757 # Android-specific options; note that most are set above with Linux.
4760 # This is a unique identifier for a given build. It's used for
4761 # identifying various build artifacts corresponding to a particular
4762 # build of chrome (e.g. where to find archived symbols).
4763 'chrome_build_id%': '',
4765 # Placing this variable here prevents from forking libvpx, used
4766 # by remoting. Remoting is off, so it needn't built,
4767 # so forking it's deps seems like overkill.
4768 # But this variable need defined to properly run gyp.
4769 # A proper solution is to have an OS==android conditional
4770 # in third_party/libvpx/libvpx.gyp to define it.
4771 'libvpx_path': 'lib/linux/arm',
4773 'target_defaults': {
4775 'release_extra_cflags%': '',
4777 # If we're using the components build, append "cr" to all shared
4778 # libraries to avoid naming collisions with android system library
4779 # versions with the same name (e.g. skia, icu).
4780 ['component=="shared_library"', {
4781 'android_product_extension': 'cr.so',
4783 'android_product_extension': 'so',
4787 'target_conditions': [
4788 ['_type=="shared_library"', {
4789 'product_extension': '<(android_product_extension)',
4792 # Settings for building device targets using Android's toolchain.
4793 # These are based on the setup.mk file from the Android NDK.
4795 # The NDK Android executable link step looks as follows:
4797 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4798 # $(PRIVATE_OBJECTS) <-- The .o that we built
4799 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4800 # $(TARGET_LIBGCC) <-- libgcc.a
4801 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4802 # $(PRIVATE_LDLIBS) <-- System .so
4803 # $(TARGET_CRTEND_O) <-- crtend.o
4805 # For now the above are approximated for executables by adding
4806 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4809 # The NDK Android shared library link step looks as follows:
4811 # $(PRIVATE_OBJECTS) <-- The .o that we built
4812 # -l,--whole-archive
4813 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4814 # -l,--no-whole-archive
4815 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4816 # $(TARGET_LIBGCC) <-- libgcc.a
4817 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4818 # $(PRIVATE_LDLIBS) <-- System .so
4820 # For now, assume that whole static libraries are not needed.
4822 # For both executables and shared libraries, add the proper
4823 # libgcc.a to the start of libraries which puts it in the
4824 # proper spot after .o and .a files get linked in.
4826 # TODO: The proper thing to do longer-tem would be proper gyp
4827 # support for a custom link command line.
4828 ['_toolset=="target"', {
4830 '-pthread', # Not supported by Android toolchain.
4833 '-ffunction-sections',
4836 '-fstack-protector',
4838 '-finline-limit=64',
4839 '<@(release_extra_cflags)',
4840 '--sysroot=<(android_ndk_sysroot)',
4841 # NOTE: The libc++ header include paths below are specified in
4842 # cflags rather than include_dirs because they need to come
4843 # after include_dirs.
4844 # The include ordering here is important; change with caution.
4845 '-isystem<(android_libcpp_include)',
4846 '-isystem<(android_ndk_root)/sources/cxx-stl/llvm-libc++abi/libcxxabi/include',
4847 '-isystem<(android_ndk_root)/sources/android/support/include',
4851 '__GNU_SOURCE=1', # Necessary for clone()
4852 'CHROME_BUILD_ID="<(chrome_build_id)"',
4853 # The NDK has these things, but doesn't define the constants
4854 # to say that it does. Define them here instead.
4858 '-pthread', # Not supported by Android toolchain.
4861 '-Wl,--build-id=sha1',
4862 '-Wl,--no-undefined',
4863 '--sysroot=<(android_ndk_sysroot)',
4865 '-L<(android_libcpp_libs_dir)',
4866 # Don't allow visible symbols from libgcc or libc++ to be
4868 '-Wl,--exclude-libs=libgcc.a',
4869 '-Wl,--exclude-libs=libc++_static.a',
4870 # Don't allow visible symbols from libraries that contain
4871 # assembly code with symbols that aren't hidden properly.
4872 # http://crbug.com/448386
4873 '-Wl,--exclude-libs=libcommon_audio.a',
4874 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4875 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4876 '-Wl,--exclude-libs=libiSACFix.a',
4877 '-Wl,--exclude-libs=libisac_neon.a',
4878 '-Wl,--exclude-libs=libopus.a',
4879 '-Wl,--exclude-libs=libvpx.a',
4882 '-l<(android_libcpp_library)',
4884 # Manually link the libgcc.a that the cross compiler uses.
4885 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4891 ['component=="static_library"', {
4892 'target_conditions': [
4893 ['use_native_jni_exports==0', {
4894 # Use a linker version script to strip JNI exports from
4895 # binaries which have not specifically asked to use them.
4897 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4904 # Clang with libc++ does not require an explicit atomic
4905 # library reference.
4909 # Work around incompatibilities between bionic and clang
4911 '-D__compiler_offsetof=__builtin_offsetof',
4912 '-Dnan=__builtin_nan',
4915 # Clang does not support the following options.
4916 '-finline-limit=64',
4919 ['target_arch=="arm"', {
4921 '-target arm-linux-androideabi',
4924 '-target arm-linux-androideabi',
4927 ['target_arch=="ia32"', {
4929 '-target i686-linux-androideabi',
4932 '-target i686-linux-androideabi',
4935 # Place holder for x64 support, not tested.
4936 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4937 ['target_arch=="x64"', {
4939 '-target x86_64-linux-androideabi',
4942 '-target x86_64-linux-androideabi',
4949 # Android build relies on -Wl,--gc-sections removing
4950 # unreachable code. ASan instrumentation for globals inhibits
4951 # this and results in a library with unresolvable relocations.
4952 # TODO(eugenis): find a way to reenable this.
4953 '-mllvm -asan-globals=0',
4956 ['target_arch == "arm" and order_profiling==0', {
4958 # Enable identical code folding to reduce size.
4959 '-Wl,--icf=<(gold_icf_level)',
4962 ['target_arch=="ia32"', {
4963 # The x86 toolchain currently has problems with stack-protector.
4965 '-fstack-protector',
4968 '-fno-stack-protector',
4972 'target_conditions': [
4973 ['_type=="executable"', {
4974 # Force android tools to export the "main" symbol so they can be
4975 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4976 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4977 # when ICS support will be dropped.
4980 '-fvisibility=default',
4984 '-Wl,--gc-sections',
4985 '-Wl,-z,nocopyreloc',
4988 # crtbegin_dynamic.o should be the last item in ldflags.
4989 '<(android_ndk_lib)/crtbegin_dynamic.o',
4992 # crtend_android.o needs to be the last item in libraries.
4993 # Do not add any libraries after this!
4994 '<(android_ndk_lib)/crtend_android.o',
4997 ['_type=="shared_library" or _type=="loadable_module"', {
4999 '-Wl,-shared,-Bsymbolic',
5000 # crtbegin_so.o should be the last item in ldflags.
5001 '<(android_ndk_lib)/crtbegin_so.o',
5004 # crtend_so.o needs to be the last item in libraries.
5005 # Do not add any libraries after this!
5006 '<(android_ndk_lib)/crtend_so.o',
5011 # Settings for building host targets using the system toolchain.
5012 ['_toolset=="host"', {
5014 # Due to issues in Clang build system, using ASan on 32-bit
5015 # binaries on x86_64 host is problematic.
5016 # TODO(eugenis): re-enable.
5017 '-fsanitize=address',
5020 '-fsanitize=address',
5021 '-Wl,-z,noexecstack',
5022 '-Wl,--gc-sections',
5025 '-Wl,--warn-shared-textrel',
5026 '-Wl,--fatal-warnings',
5029 # Settings for building host targets on mac.
5030 ['_toolset=="host" and host_os=="mac"', {
5040 'cflags!': ['-fvisibility=hidden'],
5041 'cflags_cc!': ['-fvisibility-inlines-hidden'],
5043 ['OS=="mac" or OS=="ios"', {
5044 'target_defaults': {
5047 'ALWAYS_SEARCH_USER_PATHS': 'NO',
5048 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
5049 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
5050 'COPY_PHASE_STRIP': 'NO',
5051 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
5052 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
5053 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
5054 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
5055 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
5056 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
5057 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
5058 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
5059 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
5060 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
5061 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
5062 'GCC_VERSION': '4.2',
5063 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
5064 'USE_HEADERMAP': 'NO',
5069 # Don't warn about unused function parameters.
5070 '-Wno-unused-parameter',
5071 # Don't warn about the "struct foo f = {0};" initialization
5073 '-Wno-missing-field-initializers',
5076 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
5077 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
5079 # Note that the prebuilt Clang binaries should not be used for iOS
5080 # development except for ASan builds.
5082 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
5083 # Warn if automatic synthesis is triggered with
5084 # the -Wobjc-missing-property-synthesis flag.
5085 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
5086 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
5088 # This warns on selectors from Cocoa headers (-length, -set).
5089 # cfe-dev is currently discussing the merits of this warning.
5090 # TODO(thakis): Reevaluate what to do with this, based one
5091 # cfe-dev discussion.
5092 '-Wno-selector-type-mismatch',
5095 ['clang_xcode==0', {
5096 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
5097 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
5101 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
5103 '<@(clang_chrome_plugins_flags)',
5106 ['clang==1 and clang_xcode==0 and clang_load!=""', {
5108 '-Xclang', '-load', '-Xclang', '<(clang_load)',
5111 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
5113 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
5116 ['clang==1 and "<(GENERATOR)"=="ninja"', {
5118 # See http://crbug.com/110262
5119 '-fcolor-diagnostics',
5122 ['OS=="ios" and target_subarch!="arm32" and \
5123 "<(GENERATOR)"=="xcode"', {
5125 # TODO(ios): when building Chrome for iOS on 64-bit platform
5126 # with Xcode, the -Wshorted-64-to-32 warning is automatically
5127 # enabled. This cause failures when compiling protobuf code,
5128 # so disable the warning. http://crbug.com/359107
5129 '-Wno-shorten-64-to-32',
5137 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
5143 '-fsanitize=address',
5144 '-mllvm -asan-globals=0', # http://crbug.com/352073
5145 '-gline-tables-only',
5149 ['asan_coverage!=0 and sanitizer_coverage==0', {
5150 'target_conditions': [
5151 ['_toolset=="target"', {
5153 '-fsanitize-coverage=<(asan_coverage)',
5156 'SANITIZER_COVERAGE',
5161 ['sanitizer_coverage!=0', {
5162 'target_conditions': [
5163 ['_toolset=="target"', {
5165 '-fsanitize-coverage=<(sanitizer_coverage)',
5168 'SANITIZER_COVERAGE',
5174 'target_conditions': [
5175 ['_type!="static_library"', {
5176 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5181 '-fsanitize=address',
5185 ['mac_write_linker_maps==1', {
5188 '-Wl,-map,>(_target_name).map',
5195 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5196 'target_conditions': [
5197 ['_type=="executable"', {
5203 # Define copy_asan_dylib_path in a variable ending in
5204 # _path so that gyp understands it's a path and
5205 # performs proper relativization during dict merging.
5206 'copy_asan_dylib_path':
5207 'mac/copy_asan_runtime_dylib.sh',
5209 'postbuild_name': 'Copy ASan runtime dylib',
5211 '<(copy_asan_dylib_path)',
5220 ], # target_conditions
5221 }, # target_defaults
5222 }], # OS=="mac" or OS=="ios"
5224 'target_defaults': {
5226 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5227 # with common names, like 'check', 'require', and 'verify'.
5228 # (Included by system header. Also exists on iOS but not included.)
5229 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5230 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5233 # These should end with %, but there seems to be a bug with % in
5234 # variables that are intended to be set to different values in
5235 # different targets, like these.
5236 'mac_pie': 1, # Most executables can be position-independent.
5237 # Strip debugging symbols from the target.
5238 'mac_strip': '<(mac_strip_release)',
5242 ['mac_want_real_dsym=="default"', {
5245 'mac_real_dsym': '<(mac_want_real_dsym)'
5250 ['mac_want_real_dsym=="default"', {
5251 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5253 'mac_real_dsym': '<(mac_want_real_dsym)'
5262 ['branding=="Chrome" and buildtype=="Official"', {
5265 # The Google Chrome Framework dSYM generated by dsymutil has
5266 # grown larger than 4GB, which dsymutil can't handle. Reduce
5267 # the amount of debug symbols.
5268 '-fno-standalone-debug', # See http://crbug.com/479841
5273 }, # configuration "Release"
5276 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5277 # (Equivalent to -fPIC)
5278 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5279 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5280 # Keep pch files below xcodebuild/.
5281 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5283 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5284 # xcode_setting, but not until all downstream projects' mac bots are
5285 # using xcode >= 4.6, because that's when the default value of the
5286 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5287 # setting is a no-op as far as xcode is concerned, but the compiler
5288 # behaves differently based on whether -fno-strict-aliasing is
5290 '-fno-strict-aliasing', # See http://crbug.com/32204.
5293 'target_conditions': [
5294 ['_type=="executable"', {
5297 # Arranges for data (heap) pages to be protected against
5298 # code execution when running on Mac OS X 10.7 ("Lion"), and
5299 # ensures that the position-independent executable (PIE) bit
5300 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5302 # Define change_mach_o_flags in a variable ending in _path
5303 # so that GYP understands it's a path and performs proper
5304 # relativization during dict merging.
5305 'change_mach_o_flags_path':
5306 'mac/change_mach_o_flags_from_xcode.sh',
5307 'change_mach_o_flags_options%': [
5309 'target_conditions': [
5310 ['mac_pie==0 or release_valgrind_build==1', {
5311 # Don't enable PIE if it's unwanted. It's unwanted if
5312 # the target specifies mac_pie=0 or if building for
5313 # Valgrind, because Valgrind doesn't understand slide.
5314 # See the similar mac_pie/release_valgrind_build check
5316 'change_mach_o_flags_options': [
5322 'postbuild_name': 'Change Mach-O Flags',
5324 '<(change_mach_o_flags_path)',
5325 '>@(change_mach_o_flags_options)',
5329 'target_conditions': [
5330 ['mac_pie==1 and release_valgrind_build==0', {
5331 # Turn on position-independence (ASLR) for executables. When
5332 # PIE is on for the Chrome executables, the framework will
5333 # also be subject to ASLR.
5334 # Don't do this when building for Valgrind, because Valgrind
5335 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5336 # understand slide, and get rid of the Valgrind check.
5339 '-Wl,-pie', # Position-independent executable (MH_PIE)
5345 ['(_type=="executable" or _type=="shared_library" or \
5346 _type=="loadable_module") and mac_strip!=0', {
5347 'target_conditions': [
5348 ['mac_real_dsym == 1', {
5349 # To get a real .dSYM bundle produced by dsymutil, set the
5350 # debug information format to dwarf-with-dsym. Since
5351 # strip_from_xcode will not be used, set Xcode to do the
5352 # stripping as well.
5356 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5357 'DEPLOYMENT_POSTPROCESSING': 'YES',
5358 'STRIP_INSTALLED_PRODUCT': 'YES',
5360 # Only strip non-ASan builds.
5362 'target_conditions': [
5363 ['_type=="shared_library" or _type=="loadable_module"', {
5364 # The Xcode default is to strip debugging symbols
5365 # only (-S). Local symbols should be stripped as
5366 # well, which will be handled by -x. Xcode will
5367 # continue to insert -S when stripping even when
5368 # additional flags are added with STRIPFLAGS.
5370 }], # _type=="shared_library" or _type=="loadable_module"
5371 ], # target_conditions
5377 }, # configuration "Release"
5379 }, { # mac_real_dsym != 1
5380 # To get a fast fake .dSYM bundle, use a post-build step to
5381 # produce the .dSYM and strip the executable. strip_from_xcode
5382 # only operates in the Release configuration.
5386 # Define strip_from_xcode in a variable ending in _path
5387 # so that gyp understands it's a path and performs proper
5388 # relativization during dict merging.
5389 'strip_from_xcode_path': 'mac/strip_from_xcode',
5391 'postbuild_name': 'Strip If Needed',
5392 'action': ['<(strip_from_xcode_path)'],
5396 ], # target_conditions
5397 }], # (_type=="executable" or _type=="shared_library" or
5398 # _type=="loadable_module") and mac_strip!=0
5399 ], # target_conditions
5400 }, # target_defaults
5404 'ios/coverage.gypi',
5406 'target_defaults': {
5407 'xcode_settings' : {
5408 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5409 'ENABLE_BITCODE': 'NO',
5412 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5413 # additional flag to suppress the "unknown compiler option" error.
5414 # Restrict this flag to builds that are either compiling with Xcode
5415 # or compiling with Xcode's Clang. This will allow Ninja builds to
5416 # continue failing on unknown compiler options.
5417 # TODO(rohitrao): This flag is temporary and should be removed as
5418 # soon as the iOS bots are updated to use Xcode 5.1.
5419 ['clang_xcode==1', {
5421 '-Wno-unknown-warning-option',
5422 # It's not possible to achieve nullability completeness before
5423 # all builders are running Xcode 7. crbug.com/499809
5424 '-Wno-nullability-completeness',
5428 # Limit the valid architectures depending on "target_subarch".
5429 # This need to include the "arm" architectures but also the "x86"
5430 # ones (they are used when building for the simulator).
5431 ['target_subarch=="arm32"', {
5432 'VALID_ARCHS': ['armv7', 'i386'],
5434 ['target_subarch=="arm64"', {
5435 'VALID_ARCHS': ['arm64', 'x86_64'],
5437 ['target_subarch=="both"', {
5438 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5440 ['use_system_libcxx==1', {
5441 'target_conditions': [
5442 # Only use libc++ when building target for iOS not when building
5443 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5444 # does not support libc++.
5445 ['_toolset=="target"', {
5446 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5450 # The default for deployment target of 7.0+ is libc++, so force
5451 # the old behavior unless libc++ is enabled.
5452 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5456 'target_conditions': [
5457 ['_toolset=="host"', {
5459 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5460 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5469 ['_toolset=="target"', {
5471 # This section should be for overriding host settings. But,
5472 # since we can't negate the iphone deployment target above, we
5473 # instead set it here for target only.
5474 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5475 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5478 ['_type=="executable"', {
5482 'DEPLOYMENT_POSTPROCESSING': 'YES',
5483 'STRIP_INSTALLED_PRODUCT': 'YES',
5485 ['buildtype!="Official"', {
5486 # Remove dSYM to reduce build time.
5487 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5494 # Remove dSYM to reduce build time.
5495 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5501 ['chromium_ios_signing', {
5502 # iOS SDK wants everything for device signed.
5503 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5505 'CODE_SIGNING_REQUIRED': 'NO',
5506 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5511 ], # target_conditions
5512 }, # target_defaults
5515 'target_defaults': {
5517 '_WIN32_WINNT=0x0603',
5524 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5525 'WIN32_LEAN_AND_MEAN',
5528 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5529 '_HAS_EXCEPTIONS=0',
5530 # Silence some warnings; we can't switch the the 'recommended'
5531 # versions as they're not available on old OSs.
5532 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5535 ['buildtype=="Official"', {
5536 # In official builds, targets can self-select an optimization
5537 # level by defining a variable named 'optimize', and setting it
5539 # - "size", optimizes for minimal code size - the default.
5540 # - "speed", optimizes for speed over code size.
5541 # - "max", whole program optimization and link-time code
5542 # generation. This is very expensive and should be used
5545 'optimize%': 'size',
5549 # Set /LTCG for the official builds.
5550 'LinkTimeCodeGeneration': '1',
5551 'AdditionalOptions': [
5552 # Set the number of LTCG code-gen threads to eight.
5553 # The default is four. This gives a 5-10% link speedup.
5558 'target_conditions': [
5559 ['optimize=="size"', {
5561 'VCCLCompilerTool': {
5562 # 1, optimizeMinSpace, Minimize Size (/O1)
5563 'Optimization': '1',
5564 # 2, favorSize - Favor small code (/Os)
5565 'FavorSizeOrSpeed': '2',
5570 # This config is used to avoid a problem in ffmpeg, see
5571 # http://crbug.com/264459.
5572 ['optimize=="size_no_ltcg"', {
5574 'VCCLCompilerTool': {
5575 # 1, optimizeMinSpace, Minimize Size (/O1)
5576 'Optimization': '1',
5577 # 2, favorSize - Favor small code (/Os)
5578 'FavorSizeOrSpeed': '2',
5583 ['optimize=="speed"', {
5585 'VCCLCompilerTool': {
5586 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5587 'Optimization': '2',
5588 # 1, favorSpeed - Favor fast code (/Ot)
5589 'FavorSizeOrSpeed': '1',
5594 ['optimize=="max"', {
5595 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5596 # builds. Probably anything that this would catch that
5597 # wouldn't be caught in a normal build isn't going to
5598 # actually be a bug, so the incremental value of C4702 for
5599 # PGO builds is likely very small.
5600 'msvs_disabled_warnings': [
5604 'VCCLCompilerTool': {
5605 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5606 'Optimization': '2',
5607 # 1, favorSpeed - Favor fast code (/Ot)
5608 'FavorSizeOrSpeed': '1',
5609 # This implies link time code generation.
5610 'WholeProgramOptimization': 'true',
5618 ['msvs_xtree_patched!=1', {
5619 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5620 # it's enabled. This will generally only be true for system-level
5621 # installed Express users.
5622 'msvs_disabled_warnings': [
5627 'msvs_system_include_dirs': [
5628 '<(windows_sdk_path)/Include/shared',
5629 '<(windows_sdk_path)/Include/um',
5630 '<(windows_sdk_path)/Include/winrt',
5631 '$(VSInstallDir)/VC/atlmfc/include',
5633 'msvs_cygwin_shell': 0,
5634 'msvs_disabled_warnings': [
5635 # C4091: 'typedef ': ignored on left of 'X' when no variable is
5637 # This happens in a number of Windows headers. Dumb.
5640 # C4127: conditional expression is constant
5641 # This warning can in theory catch dead code and other problems, but
5642 # triggers in far too many desirable cases where the conditional
5643 # expression is either set by macros or corresponds some legitimate
5644 # compile-time constant expression (due to constant template args,
5645 # conditionals comparing the sizes of different types, etc.). Some of
5646 # these can be worked around, but it's not worth it.
5649 # C4351: new behavior: elements of array 'array' will be default
5651 # This is a silly "warning" that basically just alerts you that the
5652 # compiler is going to actually follow the language spec like it's
5653 # supposed to, instead of not following it like old buggy versions
5654 # did. There's absolutely no reason to turn this on.
5657 # C4355: 'this': used in base member initializer list
5658 # It's commonly useful to pass |this| to objects in a class'
5659 # initializer list. While this warning can catch real bugs, most of
5660 # the time the constructors in question don't attempt to call methods
5661 # on the passed-in pointer (until later), and annotating every legit
5662 # usage of this is simply more hassle than the warning is worth.
5665 # C4503: 'identifier': decorated name length exceeded, name was
5667 # This only means that some long error messages might have truncated
5668 # identifiers in the presence of lots of templates. It has no effect
5669 # on program correctness and there's no real reason to waste time
5670 # trying to prevent it.
5673 # Warning C4589 says: "Constructor of abstract class ignores
5674 # initializer for virtual base class." Disable this warning because it
5675 # is flaky in VS 2015 RTM. It triggers on compiler generated
5676 # copy-constructors in some cases.
5679 # C4611: interaction between 'function' and C++ object destruction is
5681 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5682 # suggests using exceptions instead of setjmp/longjmp for C++, but
5683 # Chromium code compiles without exception support. We therefore have
5684 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5685 # means we have to turn off this warning (and be careful about how
5686 # object destruction happens in such cases).
5689 # TODO(maruel): These warnings are level 4. They will be slowly
5690 # removed as code is fixed.
5691 4100, # Unreferenced formal parameter
5692 4121, # Alignment of a member was sensitive to packing
5693 4244, # Conversion from 'type1' to 'type2', possible loss of data
5694 4481, # Nonstandard extension used: override specifier 'keyword'
5695 4505, # Unreferenced local function has been removed
5696 4510, # Default constructor could not be generated
5697 4512, # Assignment operator could not be generated
5698 4610, # Object can never be instantiated
5699 4838, # Narrowing conversion. Doesn't seem to be very useful.
5700 4995, # 'X': name was marked as #pragma deprecated
5701 4996, # 'X': was declared deprecated (for GetVersionEx).
5703 # These are variable shadowing warnings that are new in VS2015. We
5704 # should work through these at some point -- they may be removed from
5705 # the RTM release in the /W4 set.
5706 4456, 4457, 4458, 4459,
5709 'VCCLCompilerTool': {
5710 'AdditionalOptions': ['/MP'],
5711 'MinimalRebuild': 'false',
5712 'BufferSecurityCheck': 'true',
5713 'EnableFunctionLevelLinking': 'true',
5714 'RuntimeTypeInfo': 'false',
5715 'WarningLevel': '4',
5716 'WarnAsError': 'true',
5717 'DebugInformationFormat': '3',
5718 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5719 'ExceptionHandling': '0',
5721 'VCLibrarianTool': {
5722 'AdditionalOptions': ['/ignore:4221'],
5723 'AdditionalLibraryDirectories': [
5724 '<(windows_sdk_path)/Lib/win8/um/x86',
5728 'AdditionalDependencies': [
5740 'AdditionalLibraryDirectories': [
5741 '<(windows_sdk_path)/Lib/win8/um/x86',
5743 'GenerateDebugInformation': 'true',
5744 'MapFileName': '$(OutDir)\\$(TargetName).map',
5745 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5746 'FixedBaseAddress': '1',
5749 # 1 == /SUBSYSTEM:CONSOLE
5750 # 2 == /SUBSYSTEM:WINDOWS
5751 # Most of the executables we'll ever create are tests
5752 # and utilities with console output.
5756 'GenerateStublessProxies': 'true',
5757 'TypeLibraryName': '$(InputName).tlb',
5758 'OutputDirectory': '$(IntDir)',
5759 'HeaderFileName': '$(InputName).h',
5760 'DLLDataFileName': '$(InputName).dlldata.c',
5761 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5762 'ProxyFileName': '$(InputName)_p.c',
5764 'VCResourceCompilerTool': {
5766 'AdditionalIncludeDirectories': [
5768 '<(SHARED_INTERMEDIATE_DIR)',
5771 'target_conditions': [
5772 ['_type=="executable"', {
5774 'EmbedManifest': 'true',
5777 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5779 'AdditionalManifestFiles': [
5780 '>(win_exe_compatibility_manifest)',
5786 # Building with Clang on Windows is a work in progress and very
5787 # experimental. See crbug.com/82385.
5788 # Keep this in sync with the similar blocks in build/config/compiler/BUILD.gn
5790 'VCCLCompilerTool': {
5791 'AdditionalOptions': [
5792 # Many files use intrinsics without including this header.
5793 # TODO(hans): Fix those files, or move this to sub-GYPs.
5796 # TODO(hans): Make this list shorter eventually, http://crbug.com/504657
5797 '-Qunused-arguments', # http://crbug.com/504658
5798 '-Wno-microsoft', # http://crbug.com/505296
5799 '-Wno-switch', # http://crbug.com/505308
5800 '-Wno-unknown-pragmas', # http://crbug.com/505314
5801 '-Wno-unused-function', # http://crbug.com/505316
5802 '-Wno-unused-value', # http://crbug.com/505318
5806 ['clang==1 and clang_use_chrome_plugins==1', {
5807 'VCCLCompilerTool': {
5808 'AdditionalOptions': [
5809 '<@(clang_chrome_plugins_flags)',
5813 ['clang==1 and MSVS_VERSION == "2013"', {
5814 'VCCLCompilerTool': {
5815 'AdditionalOptions': [
5816 '-fmsc-version=1800',
5820 ['clang==1 and MSVS_VERSION == "2015"', {
5821 'VCCLCompilerTool': {
5822 'AdditionalOptions': [
5823 '-fmsc-version=1900',
5827 ['clang==1 and "<!(python <(DEPTH)/build/win/use_ansi_codes.py)"=="True"', {
5828 'VCCLCompilerTool': {
5829 'AdditionalOptions': [
5830 # cmd.exe doesn't understand ANSI escape codes by default,
5831 # so only enable them if something emulating them is around.
5832 '-fansi-escape-codes',
5833 # Also see http://crbug.com/110262
5834 '-fcolor-diagnostics',
5842 ['disable_nacl==1', {
5843 'target_defaults': {
5849 ['OS=="win" and msvs_use_common_linker_extras', {
5850 'target_defaults': {
5865 'AdditionalOptions': [
5876 'AdditionalOptions': ['/largeaddressaware'],
5880 # TODO(asan/win): Move this down into the general
5881 # win-target_defaults section once the 64-bit asan runtime
5882 # exists. See crbug.com/345874.
5883 'VCCLCompilerTool': {
5884 'AdditionalOptions': [
5885 '-fsanitize=address',
5886 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5888 'AdditionalIncludeDirectories': [
5889 # MSVC needs to be able to find the sanitizer headers when
5890 # invoked via /fallback. This is critical for using macros
5891 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5893 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/include_sanitizer',
5897 'AdditionalLibraryDirectories': [
5898 # TODO(hans): If make_clang_dir is absolute, this breaks.
5899 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/lib/windows',
5902 'target_conditions': [
5903 ['component=="shared_library"', {
5905 'AdditionalDependencies': [
5906 'clang_rt.asan_dynamic-i386.lib',
5907 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5911 ['_type=="executable" and component=="static_library"', {
5913 'AdditionalDependencies': [
5914 'clang_rt.asan-i386.lib',
5918 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5920 'AdditionalDependencies': [
5921 'clang_rt.asan_dll_thunk-i386.lib',
5927 ['sanitizer_coverage!=0', {
5928 # TODO(asan/win): Move this down into the general
5929 # win-target_defaults section once the 64-bit asan runtime
5930 # exists. See crbug.com/345874.
5931 'VCCLCompilerTool': {
5932 'AdditionalOptions': [
5933 '-fsanitize-coverage=<(sanitizer_coverage)',
5940 ['sanitizer_coverage!=0', {
5941 # TODO(asan/win): Move this down into the general
5942 # win-target_defaults section once the 64-bit asan runtime
5943 # exists. See crbug.com/345874.
5945 'SANITIZER_COVERAGE',
5953 'AdditionalOptions': [
5954 # safeseh is not compatible with x64
5966 ['enable_new_npdevice_api==1', {
5967 'target_defaults': {
5969 'ENABLE_NEW_NPDEVICE_API',
5973 # Don't warn about the "typedef 'foo' locally defined but not used"
5974 # for gcc 4.8 and higher.
5975 # TODO: remove this flag once all builds work. See crbug.com/227506
5976 ['gcc_version>=48 and clang==0', {
5977 'target_defaults': {
5979 '-Wno-unused-local-typedefs',
5983 ['gcc_version>=48 and clang==0 and host_clang==1', {
5984 'target_defaults': {
5985 'target_conditions': [
5986 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5990 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5992 'make_global_settings': [
5993 ['CC', '<(make_clang_dir)/bin/clang'],
5994 ['CXX', '<(make_clang_dir)/bin/clang++'],
5995 ['CC.host', '$(CC)'],
5996 ['CXX.host', '$(CXX)'],
5999 ['clang==1 and OS=="win"', {
6000 'make_global_settings': [
6001 # On Windows, gyp's ninja generator only looks at CC.
6002 ['CC', '<(make_clang_dir)/bin/clang-cl'],
6005 ['use_lld==1 and OS=="win"', {
6006 'make_global_settings': [
6007 # Limited to Windows because lld-link is the driver that is
6008 # compatible with link.exe.
6009 ['LD', '<(make_clang_dir)/bin/lld-link'],
6012 ['OS=="android" and clang==0', {
6013 # Hardcode the compiler names in the Makefile so that
6014 # it won't depend on the environment at make time.
6015 'make_global_settings': [
6016 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
6017 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
6018 ['CC.host', '<(host_cc)'],
6019 ['CXX.host', '<(host_cxx)'],
6022 ['OS=="linux" and target_arch=="mipsel" and host_arch!="mipsel" and chromeos==0 and clang==0', {
6023 # Set default mips cross tools on linux. These can be overridden
6024 # using CC,CXX,CC.host and CXX.host environment variables.
6025 'make_global_settings': [
6026 ['CC', '<!(which mipsel-linux-gnu-gcc)'],
6027 ['CXX', '<!(which mipsel-linux-gnu-g++)'],
6028 ['CC.host', '<(host_cc)'],
6029 ['CXX.host', '<(host_cxx)'],
6032 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
6033 # Set default ARM cross tools on linux. These can be overridden
6034 # using CC,CXX,CC.host and CXX.host environment variables.
6035 'make_global_settings': [
6036 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
6037 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
6038 ['CC.host', '<(host_cc)'],
6039 ['CXX.host', '<(host_cxx)'],
6042 # TODO(yyanagisawa): supports GENERATOR==make
6043 # make generator doesn't support CC_wrapper without CC
6044 # in make_global_settings yet.
6045 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
6046 'make_global_settings': [
6047 ['CC_wrapper', '<(gomadir)/gomacc'],
6048 ['CXX_wrapper', '<(gomadir)/gomacc'],
6049 ['CC.host_wrapper', '<(gomadir)/gomacc'],
6050 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
6054 'target_defaults': {
6055 'target_conditions': [
6056 ['_toolset=="target"', {
6064 # Work-around for http://openradar.appspot.com/20356002
6065 ['_toolset=="target" and _type!="static_library"', {
6075 ['use_lto==1 and clang==0', {
6076 'target_defaults': {
6077 'target_conditions': [
6078 ['_toolset=="target"', {
6080 '-ffat-lto-objects',
6086 ['use_lto==1 and clang==1', {
6087 'target_defaults': {
6088 'target_conditions': [
6089 ['_toolset=="target"', {
6091 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
6097 # Apply a lower LTO optimization level in non-official builds.
6098 ['use_lto==1 and clang==1 and buildtype!="Official"', {
6099 'target_defaults': {
6100 'target_conditions': [
6101 ['_toolset=="target"', {
6103 '-Wl,--plugin-opt,O1',
6106 ['_toolset=="target" and _type!="static_library"', {
6116 ['use_lto==1 and clang==1 and target_arch=="arm"', {
6117 'target_defaults': {
6118 'target_conditions': [
6119 ['_toolset=="target"', {
6120 # Without this flag, LTO produces a .text section that is larger
6121 # than the maximum call displacement, preventing the linker from
6122 # relocating calls (http://llvm.org/PR22999).
6124 '-Wl,-plugin-opt,-function-sections',
6130 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
6131 'target_defaults': {
6132 'target_conditions': [
6133 ['_toolset=="target"', {
6141 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
6142 'target_defaults': {
6143 'target_conditions': [
6144 ['_toolset=="target"', {
6153 'target_defaults': {
6154 'target_conditions': [
6155 ['_toolset=="target"', {
6157 '-fno-sanitize-trap=cfi',
6158 '-fsanitize-recover=cfi',
6161 '-fno-sanitize-trap=cfi',
6162 '-fsanitize-recover=cfi',
6166 '-fno-sanitize-trap=cfi',
6167 '-fsanitize-recover=cfi',
6171 'VCCLCompilerTool': {
6172 'AdditionalOptions': [
6173 '-fno-sanitize-trap=cfi',
6174 '-fsanitize-recover=cfi',
6179 ['_toolset=="target" and _type!="static_library"', {
6182 '-fno-sanitize-trap=cfi',
6183 '-fsanitize-recover=cfi',
6190 ['cfi_vptr==1 and cfi_diag==0', {
6191 'target_defaults': {
6192 'target_conditions': [
6193 ['_toolset=="target"', {
6202 'target_defaults': {
6203 'target_conditions': [
6204 ['_toolset=="target"', {
6206 '-fsanitize=cfi-vcall',
6207 '-fsanitize=cfi-derived-cast',
6208 '-fsanitize=cfi-unrelated-cast',
6209 '-fsanitize-blacklist=<(cfi_blacklist)',
6212 '-fsanitize=cfi-vcall',
6213 '-fsanitize=cfi-derived-cast',
6214 '-fsanitize=cfi-unrelated-cast',
6218 '-fsanitize=cfi-vcall',
6219 '-fsanitize=cfi-derived-cast',
6220 '-fsanitize=cfi-unrelated-cast',
6221 '-fsanitize-blacklist=<(cfi_blacklist)',
6225 'VCCLCompilerTool': {
6226 'AdditionalOptions': [
6227 '-fsanitize=cfi-vcall',
6228 '-fsanitize=cfi-derived-cast',
6229 '-fsanitize=cfi-unrelated-cast',
6230 '-fsanitize-blacklist=<(cfi_blacklist)',
6235 ['_toolset=="target" and _type!="static_library"', {
6238 '-fsanitize=cfi-vcall',
6239 '-fsanitize=cfi-derived-cast',
6240 '-fsanitize=cfi-unrelated-cast',
6249 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
6250 # This block adds *project-wide* configuration settings to each project
6251 # file. It's almost always wrong to put things here. Specify your
6252 # custom xcode_settings in target_defaults to add them to targets instead.
6255 # In an Xcode Project Info window, the "Base SDK for All Configurations"
6256 # setting sets the SDK on a project-wide basis. In order to get the
6257 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
6258 # here at the project level.
6261 ['mac_sdk_path==""', {
6262 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
6264 'SDKROOT': '<(mac_sdk_path)', # -isysroot
6270 ['ios_sdk_path==""', {
6272 # TODO(justincohen): Ninja only supports simulator for now.
6273 ['"<(GENERATOR)"=="xcode"', {
6274 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6276 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
6280 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6285 # Target both iPhone and iPad.
6286 'TARGETED_DEVICE_FAMILY': '1,2',
6289 ['target_arch=="x64"', {
6294 ['target_arch=="ia32"', {
6303 # The Xcode generator will look for an xcode_settings section at the root
6304 # of each dict and use it to apply settings on a file-wide basis. Most
6305 # settings should not be here, they should be in target-specific
6306 # xcode_settings sections, or better yet, should use non-Xcode-specific
6307 # settings in target dicts. SYMROOT is a special case, because many other
6308 # Xcode variables depend on it, including variables such as
6309 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6310 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6311 # files to appear (when present) in the UI as actual files and not red
6312 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6313 # and therefore SYMROOT, needs to be set at the project level.
6314 'SYMROOT': '<(DEPTH)/xcodebuild',