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%': '23',
1719 'android_sdk_build_tools_version%': '23.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%': 3,
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.10',
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_topchrome_md==1', {
2202 'grit_defines': ['-D', 'enable_topchrome_md'],
2204 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2205 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2207 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2208 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2210 ['enable_mdns==1 or OS=="mac"', {
2211 'grit_defines': ['-D', 'enable_service_discovery'],
2212 'enable_service_discovery%': 1
2214 ['clang_use_chrome_plugins==1', {
2220 ['OS=="mac" or OS=="ios"', {
2221 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2222 }, { # OS != "mac" or OS != "ios"
2223 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
2227 'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ',
2229 # On Windows, the plugin is built directly into clang, so there's
2230 # no need to load it dynamically.
2231 'clang_dynlib_flags%': '',
2233 # https://crbug.com/441916
2234 ['OS=="android" or OS=="linux" or OS=="mac"', {
2235 'clang_plugin_args%': '-Xclang -plugin-arg-find-bad-constructs -Xclang check-templates ',
2236 }, { # OS != "linux"
2237 'clang_plugin_args%': ''
2241 # If you change these, also change build/config/clang/BUILD.gn.
2242 'clang_chrome_plugins_flags%':
2243 '<(clang_dynlib_flags)'
2244 '-Xclang -add-plugin -Xclang find-bad-constructs <(clang_plugin_args)',
2246 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2248 'use_allocator%': 'none',
2249 'use_sanitizer_options%': 1,
2252 ['OS=="linux" and asan==0 and msan==0 and lsan==0 and tsan==0', {
2253 # PNaCl toolchain Non-SFI build only supports linux OS build.
2254 # Also, it does not support sanitizers.
2255 'enable_nacl_nonsfi_test%': 1,
2257 ['asan==1 and OS=="linux" and chromeos==0', {
2258 'use_custom_libcxx%': 1,
2266 ['asan==1 and OS=="mac"', {
2267 'mac_strip_release': 1,
2270 'use_custom_libcxx%': 1,
2273 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2274 # libstdc++. This is required to avoid false positive reports whenever
2275 # the C++ standard library is used.
2276 'use_custom_libcxx%': 1,
2277 # Running the V8-generated code on an ARM simulator is a powerful hack
2278 # that allows the tool to see the memory accesses from JITted code.
2279 # Without this flag, JS code causes false positive reports from MSan.
2280 'v8_target_arch': 'arm64',
2283 ['OS=="linux" and clang_type_profiler==1', {
2285 'clang_use_chrome_plugins%': 0,
2287 ['host_arch=="x64"', {
2288 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2290 ['host_arch=="ia32"', {
2291 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2292 # Clang in this directory at your own risk if needed for some
2293 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2294 # usage). Any failure by this compiler should not close the tree.
2295 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2300 # On valgrind bots, override the optimizer settings so we don't inline too
2301 # much and make the stacks harder to figure out.
2303 # TODO(rnk): Kill off variables that no one else uses and just implement
2304 # them under a build_for_tool== condition.
2305 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2307 'mac_debug_optimization': '1',
2308 'mac_release_optimization': '1',
2309 'release_optimize': '1',
2310 'no_gc_sections': 1,
2311 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2312 '-fno-builtin -fno-optimize-sibling-calls',
2313 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2314 '-fno-builtin -fno-optimize-sibling-calls',
2316 # MSVS flags for TSan on Pin and Windows.
2317 'win_debug_RuntimeChecks': '0',
2318 'win_debug_disable_iterator_debugging': '1',
2319 'win_debug_Optimization': '1',
2320 'win_debug_InlineFunctionExpansion': '0',
2321 'win_release_InlineFunctionExpansion': '0',
2322 'win_release_OmitFramePointers': '0',
2324 'use_allocator': 'tcmalloc',
2325 'release_valgrind_build': 1,
2327 'component': 'static_library',
2328 'use_system_zlib': 0,
2331 # Build tweaks for DrMemory.
2332 # TODO(rnk): Combine with tsan config to share the builder.
2333 # http://crbug.com/108155
2334 ['build_for_tool=="drmemory"', {
2335 # These runtime checks force initialization of stack vars which blocks
2336 # DrMemory's uninit detection.
2337 'win_debug_RuntimeChecks': '0',
2338 # Iterator debugging is slow.
2339 'win_debug_disable_iterator_debugging': '1',
2340 # Try to disable optimizations that mess up stacks in a release build.
2341 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2342 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2343 # compiler bug, so we use /Ob1 instead.
2344 'win_release_InlineFunctionExpansion': '1',
2345 'win_release_OmitFramePointers': '0',
2346 # Ditto for debug, to support bumping win_debug_Optimization.
2347 'win_debug_InlineFunctionExpansion': 0,
2348 'win_debug_OmitFramePointers': 0,
2349 # Keep the code under #ifndef NVALGRIND.
2350 'release_valgrind_build': 1,
2353 # RLZ library is used on Win, Mac, iOS and ChromeOS.
2354 ['OS=="win" or OS=="mac" or OS=="ios" or chromeos==1', {
2355 'enable_rlz_support%': 1,
2357 # RLZ is enabled for "Chrome" builds.
2358 ['branding=="Chrome"', {
2364 # Set default compiler flags depending on ARM version.
2365 ['arm_version==6', {
2366 'arm_arch%': 'armv6',
2369 'arm_float_abi%': 'softfp',
2372 ['arm_version==7', {
2373 'arm_arch%': 'armv7-a',
2374 'arm_tune%': 'generic-armv7-a',
2379 'arm_fpu%': 'vfpv3-d16',
2382 'arm_float_abi%': 'softfp',
2384 'arm_float_abi%': 'hard',
2390 # Set default compiler flags for MIPS floating-point support.
2391 ['target_arch=="mipsel"', {
2392 'mips_float_abi%': 'hard',
2394 ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
2395 'mips_fpu_mode%': 'fp32',
2397 'mips_fpu_mode%': '',
2400 # Enable brlapi by default for chromeos.
2405 ['use_ozone==1 and ozone_auto_platforms==1', {
2406 # Use test as the default platform.
2407 'ozone_platform%': 'test',
2409 # Build all platforms whose deps are in install-build-deps.sh.
2410 # Only these platforms will be compile tested by buildbots.
2411 'ozone_platform_drm%': 1,
2412 'ozone_platform_test%': 1,
2413 'ozone_platform_egltest%': 1,
2416 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2417 'use_clipboard_aurax11%': 1,
2420 ['OS=="win" and use_goma==1', {
2421 # goma doesn't support pch yet.
2422 'chromium_win_pch': 0,
2423 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2425 ['win_z7==0 and fastbuild==0', {
2431 ['OS=="win" and (clang==1 or asan==1)', {
2432 'chromium_win_pch': 0,
2436 'host_cc': '<(make_clang_dir)/bin/clang',
2437 'host_cxx': '<(make_clang_dir)/bin/clang++',
2439 'host_cc': '<!(which gcc)',
2440 'host_cxx': '<!(which g++)',
2443 # The seccomp-bpf sandbox is only supported on five architectures
2445 # Do not disable seccomp_bpf anywhere without talking to
2446 # security@chromium.org!
2447 ['((OS=="linux" or OS=="android") and '
2448 '(target_arch=="ia32" or target_arch=="x64" or '
2449 'target_arch=="arm" or target_arch=="mipsel" or '
2450 'target_arch=="arm64"))', {
2451 'use_seccomp_bpf%': 1,
2453 'use_seccomp_bpf%': 0,
2460 ['branding=="Chrome" and buildtype=="Official"', {
2461 'enable_hangout_services_extension%': 1,
2463 'enable_hangout_services_extension%': 0,
2467 # The path to the ANGLE library.
2468 'angle_path': '<(DEPTH)/third_party/angle',
2470 # List of default apps to install in new profiles. The first list contains
2471 # the source files as found in svn. The second list, used only for linux,
2472 # contains the destination location for each of the files. When a crx
2473 # is added or removed from the list, the chrome/browser/resources/
2474 # default_apps/external_extensions.json file must also be updated.
2476 # README: GN version of these is in the target //chrome:default_apps
2477 # (there's no global variable like in GYP). Be sure to update that target
2478 # if you change these lists!
2479 'default_apps_list': [
2480 'browser/resources/default_apps/external_extensions.json',
2481 'browser/resources/default_apps/gmail.crx',
2482 'browser/resources/default_apps/search.crx',
2483 'browser/resources/default_apps/youtube.crx',
2484 'browser/resources/default_apps/drive.crx',
2485 'browser/resources/default_apps/docs.crx',
2487 'default_apps_list_linux_dest': [
2488 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2489 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2490 '<(PRODUCT_DIR)/default_apps/search.crx',
2491 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2492 '<(PRODUCT_DIR)/default_apps/drive.crx',
2493 '<(PRODUCT_DIR)/default_apps/docs.crx',
2496 # Whether to allow building of the GPU-related isolates.
2497 'archive_gpu_tests%': 0,
2499 # Whether to allow building of chromoting related isolates.
2500 'archive_chromoting_tests%': 0,
2502 # Whether to allow building of Media Router related isolates.
2503 'archive_media_router_tests%': 0,
2505 'target_defaults': {
2507 # The condition that operates on chromium_code is in a target_conditions
2508 # section, and will not have access to the default fallback value of
2509 # chromium_code at the top of this file, or to the chromium_code
2510 # variable placed at the root variables scope of .gyp files, because
2511 # those variables are not set at target scope. As a workaround,
2512 # if chromium_code is not set at target scope, define it in target scope
2513 # to contain whatever value it has during early variable expansion.
2514 # That's enough to make it available during target conditional
2516 'chromium_code%': '<(chromium_code)',
2518 'component%': '<(component)',
2520 'chromecast%': '<(chromecast)',
2522 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2523 'win_release_Optimization%': '2', # 2 = /O2
2524 'win_debug_Optimization%': '0', # 0 = /Od
2526 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2527 # Tri-state: blank is default, 1 on, 0 off
2528 'win_release_OmitFramePointers%': '0',
2529 # Tri-state: blank is default, 1 on, 0 off
2530 'win_debug_OmitFramePointers%': '',
2532 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2533 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2535 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2536 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2537 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2539 # VS inserts quite a lot of extra checks to algorithms like
2540 # std::partial_sort in Debug build which make them O(N^2)
2541 # instead of O(N*logN). This is particularly slow under memory
2542 # tools like ThreadSanitizer so we want it to be disablable.
2543 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2544 'win_debug_disable_iterator_debugging%': '0',
2546 # An application manifest fragment to declare compatibility settings for
2547 # 'executable' targets. Ignored in other target type.
2548 'win_exe_compatibility_manifest%':
2549 '<(DEPTH)\\build\\win\\compatibility.manifest',
2551 'release_extra_cflags%': '',
2552 'debug_extra_cflags%': '',
2554 'release_valgrind_build%': '<(release_valgrind_build)',
2556 # the non-qualified versions are widely assumed to be *nix-only
2557 'win_release_extra_cflags%': '',
2558 'win_debug_extra_cflags%': '',
2560 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2561 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2563 # Only used by Windows build for now. Can be used to build into a
2564 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2565 # output files in src/build/VS2010_{Debug,Release}.
2566 'build_dir_prefix%': '',
2568 # Targets are by default not nacl untrusted code.
2569 'nacl_untrusted_build%': 0,
2571 'pnacl_compile_flags': [
2572 # pnacl uses the clang compiler so we need to suppress all the
2573 # same warnings as we do for clang.
2574 # TODO(sbc): Remove these if/when they are removed from the clang
2576 '-Wno-unused-function',
2577 '-Wno-char-subscripts',
2578 '-Wno-c++11-extensions',
2579 '-Wno-unnamed-type-template-args',
2582 # By default, Android targets have their exported JNI symbols stripped,
2583 # so we test the manual JNI registration code paths that are required
2584 # when using the crazy linker. To allow use of native JNI exports (lazily
2585 # resolved by the JVM), targets can enable this variable, which will stop
2586 # the stripping from happening. Only targets which do not need to be
2587 # compatible with the crazy linker are permitted to set this.
2588 'use_native_jni_exports%': 0,
2591 ['OS=="win" and component=="shared_library"', {
2592 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2593 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2594 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2596 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2597 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2598 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2601 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2602 'mac_release_optimization%': 's', # Use -Os unless overridden
2603 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2605 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2606 'mac_release_optimization%': '2', # Use -O2 unless overridden
2607 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2610 'host_os%': '<(host_os)', # See comment above chromium_code.
2613 'clang_warning_flags': [
2616 # Don't die on dtoa code that uses a char as an array index.
2617 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2618 '-Wno-char-subscripts',
2620 # TODO(thakis): This used to be implied by -Wno-unused-function,
2621 # which we no longer use. Check if it makes sense to remove
2622 # this as well. http://crbug.com/316352
2623 '-Wno-unneeded-internal-declaration',
2625 # Warns on switches on enums that cover all enum values but
2626 # also contain a default: branch. Chrome is full of that.
2627 '-Wno-covered-switch-default',
2629 # Warns when a const char[] is converted to bool.
2630 '-Wstring-conversion',
2632 # C++11-related flags:
2634 # This warns on using ints as initializers for floats in
2635 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2636 # which happens in several places in chrome code. Not sure if
2637 # this is worth fixing.
2638 '-Wno-c++11-narrowing',
2640 # Clang considers the `register` keyword as deprecated, but e.g.
2641 # code generated by flex (used in angle) contains that keyword.
2642 # http://crbug.com/255186
2643 '-Wno-deprecated-register',
2645 # TODO(hans): Get this cleaned up, http://crbug.com/428099
2646 '-Wno-inconsistent-missing-override',
2648 # TODO(thakis): Enable this, crbug.com/507717
2649 '-Wno-shift-negative-value',
2652 'includes': [ 'set_clang_warning_flags.gypi', ],
2654 # Don't use deprecated V8 APIs anywhere.
2655 'V8_DEPRECATION_WARNINGS',
2656 'CLD_VERSION=<(cld_version)',
2659 '<(SHARED_INTERMEDIATE_DIR)',
2663 # When compiling Objective C, warns if a method is used whose
2664 # availability is newer than the deployment target.
2665 'xcode_settings': { 'WARNING_CFLAGS': ['-Wpartial-availability']},
2667 ['(OS=="mac" or OS=="ios") and asan==1', {
2669 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2672 ['OS=="win" and asan==1 and component=="shared_library"', {
2674 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2677 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2678 'cflags_cc!': ['-fno-rtti'],
2681 '-gline-tables-only',
2682 '-fintercept-allocation-functions',
2684 'defines': ['TYPE_PROFILING'],
2686 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2689 ['branding=="Chrome"', {
2690 'defines': ['GOOGLE_CHROME_BUILD'],
2691 }, { # else: branding!="Chrome"
2692 'defines': ['CHROMIUM_BUILD'],
2694 ['OS=="mac" and component=="shared_library"', {
2696 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2697 'LD_RUNPATH_SEARCH_PATHS': [
2698 # For unbundled binaries.
2700 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2701 '@loader_path/../../..',
2705 ['clang==1 or host_clang==1', {
2706 # This is here so that all files get recompiled after a clang roll and
2707 # when turning clang on or off.
2708 # (defines are passed via the command line, and build systems rebuild
2709 # things when their commandline changes). Nothing should ever read this
2711 'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
2714 'defines': ['ENABLE_RLZ'],
2716 ['component=="shared_library"', {
2717 'defines': ['COMPONENT_BUILD'],
2719 ['ui_compositor_image_transport==1', {
2720 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2723 'defines': ['USE_AURA=1'],
2726 'defines': ['USE_ASH=1'],
2729 'defines': ['USE_PANGO=1'],
2732 'defines': ['USE_CAIRO=1'],
2735 'defines': ['USE_CRAS=1'],
2738 'defines': ['USE_OZONE=1'],
2740 ['use_default_render_theme==1', {
2741 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2743 ['use_libjpeg_turbo==1', {
2744 'defines': ['USE_LIBJPEG_TURBO=1'],
2747 'defines': ['USE_X11=1'],
2749 ['use_clipboard_aurax11==1', {
2750 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2752 ['enable_one_click_signin==1', {
2753 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2755 ['enable_pre_sync_backup==1', {
2756 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2758 ['image_loader_extension==1', {
2759 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2762 'defines': ['ENABLE_PROFILING=1'],
2764 ['enable_webrtc==1', {
2765 'defines': ['ENABLE_WEBRTC=1'],
2767 ['enable_media_router==1', {
2768 'defines': ['ENABLE_MEDIA_ROUTER=1'],
2770 ['proprietary_codecs==1', {
2771 'defines': ['USE_PROPRIETARY_CODECS'],
2773 ['enable_mpeg2ts_stream_parser==1', {
2774 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2778 ['enable_viewport==1', {
2779 'defines': ['ENABLE_VIEWPORT'],
2781 ['enable_pepper_cdms==1', {
2782 'defines': ['ENABLE_PEPPER_CDMS'],
2784 ['enable_browser_cdms==1', {
2785 'defines': ['ENABLE_BROWSER_CDMS'],
2787 ['configuration_policy==1', {
2788 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2790 ['notifications==1', {
2791 'defines': ['ENABLE_NOTIFICATIONS'],
2793 ['enable_hidpi==1', {
2794 'defines': ['ENABLE_HIDPI=1'],
2796 ['enable_topchrome_md==1', {
2797 'defines': ['ENABLE_TOPCHROME_MD=1'],
2799 ['native_memory_pressure_signals==1', {
2800 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2803 'defines': ['USE_UDEV'],
2807 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2810 ['OS=="win" and fastbuild==2', {
2811 # Completely disable debug information.
2814 'GenerateDebugInformation': 'false',
2816 'VCCLCompilerTool': {
2817 'DebugInformationFormat': '0',
2821 ['OS=="win" and fastbuild==1', {
2824 # This tells the linker to generate .pdbs, so that
2825 # we can get meaningful stack traces.
2826 'GenerateDebugInformation': 'true',
2828 'VCCLCompilerTool': {
2829 # No debug info to be generated by compiler.
2830 'DebugInformationFormat': '0',
2834 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2835 'variables': { 'debug_extra_cflags': '-g0', },
2837 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2838 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2840 'variables': { 'debug_extra_cflags': '-g0', },
2842 # Android builds symbols on release by default, disable them.
2843 ['OS=="android" and fastbuild==2', {
2844 'variables': { 'release_extra_cflags': '-g0', },
2846 ['OS=="android" and fastbuild==1', {
2847 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2849 'variables': { 'release_extra_cflags': '-g0', },
2853 ['dont_embed_build_metadata==1', {
2855 'DONT_EMBED_BUILD_METADATA',
2857 }], # dont_embed_build_metadata==1
2858 ['dcheck_always_on!=0', {
2859 'defines': ['DCHECK_ALWAYS_ON=1'],
2860 }], # dcheck_always_on!=0
2861 ['tracing_like_official_build!=0', {
2862 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2863 }], # tracing_like_official_build!=0
2864 ['fieldtrial_testing_like_official_build==0 and branding!="Chrome"', {
2865 'defines': ['FIELDTRIAL_TESTING_ENABLED'],
2866 }], # fieldtrial_testing_like_official_build==0 and branding!="Chrome"
2868 'defines': ['NO_TCMALLOC'],
2870 ['win_use_allocator_shim==1', {
2871 'defines': ['ALLOCATOR_SHIM'],
2877 'ADDRESS_SANITIZER',
2878 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2879 'MEMORY_SANITIZER_INITIAL_SIZE',
2883 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2891 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2892 'MEMORY_SANITIZER_INITIAL_SIZE',
2900 '<(DEPTH)/third_party/kasko/include',
2906 '_CRT_SECURE_NO_DEPRECATE',
2907 '_SCL_SECURE_NO_DEPRECATE',
2908 # This define is required to pull in the new Win8 interfaces from
2909 # system headers like ShObjIdl.h.
2910 'NTDDI_VERSION=0x06030000',
2911 # This is required for ATL to use XP-safe versions of its functions.
2912 '_USING_V110_SDK71_',
2915 '<(DEPTH)/third_party/wtl/include',
2920 # Generates debug info when win_z7=1
2921 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2923 'GenerateDebugInformation': 'true',
2925 'VCCLCompilerTool': {
2926 'DebugInformationFormat': '1',
2932 # This is prohibited when running /analyze.
2933 '_USING_V110_SDK71_',
2936 'VCCLCompilerTool': {
2937 # Set WarnAsError to false to disable this setting for most
2938 # projects so that compilation continues.
2939 'WarnAsError': 'false',
2940 # When win_analyze is specified add the /analyze switch.
2941 # Also add /WX- to force-disable WarnAsError for projects that
2942 # override WarnAsError.
2943 # Also, disable various noisy warnings that have low value.
2944 'AdditionalOptions': [
2946 '/wd6011', # Dereferencing NULL pointer
2947 '/wd6312', # Possible infinite loop: use of the constant
2948 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2949 '/wd6326', # Potential comparison of constant with constant
2950 '/wd28159', # Consider using 'GetTickCount64'
2951 '/wd28204', # Inconsistent SAL annotations
2952 '/wd28251', # Inconsistent SAL annotations
2953 '/wd28252', # Inconsistent SAL annotations
2954 '/wd28253', # Inconsistent SAL annotations
2955 '/wd28196', # The precondition is not satisfied
2956 '/wd28301', # Inconsistent SAL annotations
2957 '/wd6340', # Sign mismatch in function parameter
2958 '/wd28182', # Dereferencing NULL pointer
2959 # C6285 is ~16% of raw warnings and has low value
2960 '/wd6285', # non-zero constant || non-zero constant
2961 # C6334 is ~80% of raw warnings and has low value
2962 '/wd6334', # sizeof applied to an expression with an operator
2974 ['use_playready==1', {
2976 'PLAYREADY_CDM_AVAILABLE',
2981 ['enable_task_manager==1', {
2983 'ENABLE_TASK_MANAGER=1',
2986 ['enable_extensions==1', {
2988 'ENABLE_EXTENSIONS=1',
2991 ['OS=="win" and branding=="Chrome"', {
2992 'defines': ['ENABLE_SWIFTSHADER'],
2994 ['enable_dart==1', {
2995 'defines': ['WEBKIT_USING_DART=1'],
2997 ['enable_plugin_installation==1', {
2998 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
3000 ['enable_plugins==1', {
3001 'defines': ['ENABLE_PLUGINS=1'],
3003 ['enable_session_service==1', {
3004 'defines': ['ENABLE_SESSION_SERVICE=1'],
3006 ['enable_themes==1', {
3007 'defines': ['ENABLE_THEMES=1'],
3009 ['enable_autofill_dialog==1', {
3010 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
3012 ['enable_prod_wallet_service==1', {
3013 # In GN, this is set on the autofill tagets only. See
3014 # //components/autofill/core/browser:wallet_service
3015 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
3017 ['enable_background==1', {
3018 'defines': ['ENABLE_BACKGROUND=1'],
3020 ['enable_google_now==1', {
3021 'defines': ['ENABLE_GOOGLE_NOW=1'],
3023 ['enable_basic_printing==1 or enable_print_preview==1', {
3024 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
3025 'defines': ['ENABLE_PRINTING=1'],
3027 ['enable_basic_printing==1', {
3028 # Enable basic printing support and UI.
3029 'defines': ['ENABLE_BASIC_PRINTING=1'],
3031 ['enable_print_preview==1', {
3032 # Enable printing with print preview.
3033 # Can be defined without ENABLE_BASIC_PRINTING.
3034 'defines': ['ENABLE_PRINT_PREVIEW=1'],
3036 ['enable_spellcheck==1', {
3037 'defines': ['ENABLE_SPELLCHECK=1'],
3039 ['use_browser_spellchecker', {
3040 'defines': ['USE_BROWSER_SPELLCHECKER=1'],
3042 ['enable_captive_portal_detection==1', {
3043 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
3045 ['enable_app_list==1', {
3046 'defines': ['ENABLE_APP_LIST=1'],
3048 ['enable_settings_app==1', {
3049 'defines': ['ENABLE_SETTINGS_APP=1'],
3051 ['disable_file_support==1', {
3052 'defines': ['DISABLE_FILE_SUPPORT=1'],
3054 ['disable_ftp_support==1', {
3055 'defines': ['DISABLE_FTP_SUPPORT=1'],
3057 ['enable_supervised_users==1', {
3058 'defines': ['ENABLE_SUPERVISED_USERS=1'],
3060 ['enable_mdns==1', {
3061 'defines': ['ENABLE_MDNS=1'],
3063 ['enable_service_discovery==1', {
3064 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
3066 ['enable_wifi_bootstrapping==1', {
3067 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
3069 ['enable_hangout_services_extension==1', {
3070 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
3072 ['enable_ipc_fuzzer==1', {
3073 'defines': ['ENABLE_IPC_FUZZER=1'],
3076 'defines': ['VIDEO_HOLE=1'],
3078 ['v8_use_external_startup_data==1', {
3079 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
3081 ['enable_webvr==1', {
3082 'defines': ['ENABLE_WEBVR'],
3085 # SAFE_BROWSING_SERVICE - browser manages a safe-browsing service.
3086 # SAFE_BROWSING_DB_LOCAL - service manages a local database.
3087 # SAFE_BROWSING_DB_REMOTE - service talks via API to a database
3088 # SAFE_BROWSING_CSD - enable client-side phishing detection.
3089 ['safe_browsing==1', {
3091 # TODO(nparker): Remove existing uses of FULL_SAFE_BROWSING
3092 'FULL_SAFE_BROWSING',
3093 'SAFE_BROWSING_CSD',
3094 'SAFE_BROWSING_DB_LOCAL',
3095 'SAFE_BROWSING_SERVICE',
3098 ['safe_browsing==2', {
3100 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3101 'MOBILE_SAFE_BROWSING',
3102 'SAFE_BROWSING_SERVICE',
3105 ['safe_browsing==3', {
3107 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3108 'MOBILE_SAFE_BROWSING',
3109 'SAFE_BROWSING_DB_REMOTE',
3110 'SAFE_BROWSING_SERVICE',
3113 ], # conditions for 'target_defaults'
3114 'target_conditions': [
3115 ['<(use_libpci)==1', {
3116 'defines': ['USE_LIBPCI=1'],
3118 ['<(use_openssl)==1', {
3119 'defines': ['USE_OPENSSL=1'],
3121 ['<(use_openssl_certs)==1', {
3122 'defines': ['USE_OPENSSL_CERTS=1'],
3124 ['>(nacl_untrusted_build)==1', {
3127 'USE_OPENSSL_CERTS=1',
3130 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3131 'defines': ['USE_GLIB=1'],
3133 ['<(use_nss_certs)==1 and >(nacl_untrusted_build)==0', {
3134 'defines': ['USE_NSS_CERTS=1'],
3136 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3137 'defines': ['OS_CHROMEOS=1'],
3139 ['enable_wexit_time_destructors==1 and OS!="win"', {
3140 # TODO: Enable on Windows too, http://crbug.com/404525
3141 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3143 ['chromium_code==0', {
3145 'clang_warning_flags': [
3146 # TODO(thakis): Move this suppression into individual third-party
3147 # libraries as required. http://crbug.com/505316.
3148 '-Wno-unused-function',
3149 # Lots of third-party libraries have unused variables. Instead of
3150 # suppressing them individually, we just blanket suppress them here.
3151 '-Wno-unused-variable',
3155 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3156 # We don't want to get warnings from third-party code,
3157 # so remove any existing warning-enabling flags like -Wall.
3163 # Don't warn about hash_map in third-party code.
3167 # Don't warn about printf format problems.
3168 # This is off by default in gcc but on in Ubuntu's gcc(!).
3172 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3176 # TODO: Fix all warnings on chromeos too.
3177 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3182 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3184 # Don't warn about ignoring the return value from e.g. close().
3185 # This is off by default in some gccs but on by default in others.
3186 # BSD systems do not support this option, since they are usually
3187 # using gcc 4.2.1, which does not have this flag yet.
3188 '-Wno-unused-result',
3193 '_CRT_SECURE_NO_DEPRECATE',
3194 '_CRT_NONSTDC_NO_WARNINGS',
3195 '_CRT_NONSTDC_NO_DEPRECATE',
3196 '_SCL_SECURE_NO_DEPRECATE',
3198 'msvs_disabled_warnings': [
3202 'VCCLCompilerTool': {
3203 'WarningLevel': '3',
3204 'WarnAsError': 'true',
3205 'Detect64BitPortabilityProblems': 'false',
3209 ['buildtype=="Official"', {
3211 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3214 [ 'component=="shared_library"', {
3215 # TODO(darin): Unfortunately, some third_party code depends on base.
3216 'msvs_disabled_warnings': [
3217 4251, # class 'std::xx' needs to have dll-interface.
3223 [ 'OS=="mac" or OS=="ios"', {
3225 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3228 ['buildtype=="Official"', {
3230 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3237 # TODO(ios): Fix remaining warnings in third-party code, then
3238 # remove this; the Mac cleanup didn't get everything that's
3239 # flagged in an iOS build.
3240 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3241 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3242 # Several internal ios directories generate numerous warnings for
3243 # -Wobjc-missing-property-synthesis.
3244 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3250 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3251 'filename_rules.gypi',
3253 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3254 # C99 macros on Mac and Linux.
3256 '__STDC_CONSTANT_MACROS',
3257 '__STDC_FORMAT_MACROS',
3261 # turn on warnings for signed/unsigned mismatch on chromium code.
3263 'VCCLCompilerTool': {
3264 'AdditionalOptions': ['/we4389'],
3268 ['OS=="win" and component=="shared_library"', {
3269 'msvs_disabled_warnings': [
3270 4251, # class 'std::xx' needs to have dll-interface.
3275 ], # target_conditions for 'target_defaults'
3276 'default_configuration': 'Debug',
3278 # VCLinkerTool LinkIncremental values below:
3280 # 1 == /INCREMENTAL:NO
3282 # Debug links incremental, Release does not.
3284 # Abstract base configurations to cover common attributes.
3288 'msvs_configuration_attributes': {
3289 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3290 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3291 'CharacterSet': '1',
3294 'VCCLCompilerTool': {
3295 'AdditionalOptions': [
3300 # Add the default import libs.
3301 'AdditionalDependencies': [
3318 'AdditionalOptions': [
3319 # Suggested by Microsoft Devrel to avoid
3320 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3321 # which started happening more regularly after VS2013 Update 4.
3322 # Needs to be a bit lower for VS2015, or else errors out.
3323 '/maxilksize:0x7ff00000',
3332 'MinimumRequiredVersion': '5.01', # XP.
3333 'TargetMachine': '1',
3335 'VCLibrarianTool': {
3336 'TargetMachine': '1',
3339 'msvs_configuration_platform': 'Win32',
3343 'msvs_configuration_platform': 'x64',
3346 # Make sure to understand http://crbug.com/361720 if you want to
3348 'MinimumRequiredVersion': '5.02', # Server 2003.
3349 'TargetMachine': '17', # x86 - 64
3350 'AdditionalLibraryDirectories!':
3351 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3352 'AdditionalLibraryDirectories':
3353 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3354 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3355 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3357 'VCLibrarianTool': {
3358 'AdditionalLibraryDirectories!':
3359 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3360 'AdditionalLibraryDirectories':
3361 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3362 'TargetMachine': '17', # x64
3369 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3370 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3373 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3375 '<@(debug_extra_cflags)',
3379 'VCCLCompilerTool': {
3380 'Optimization': '<(win_debug_Optimization)',
3381 'PreprocessorDefinitions': ['_DEBUG'],
3382 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3383 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3385 # According to MSVS, InlineFunctionExpansion=0 means
3386 # "default inlining", not "/Ob0".
3387 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3388 ['win_debug_InlineFunctionExpansion==0', {
3389 'AdditionalOptions': ['/Ob0'],
3391 ['win_debug_InlineFunctionExpansion!=""', {
3392 'InlineFunctionExpansion':
3393 '<(win_debug_InlineFunctionExpansion)',
3395 ['win_debug_disable_iterator_debugging==1', {
3396 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3399 # if win_debug_OmitFramePointers is blank, leave as default
3400 ['win_debug_OmitFramePointers==1', {
3401 'OmitFramePointers': 'true',
3403 ['win_debug_OmitFramePointers==0', {
3404 'OmitFramePointers': 'false',
3405 # The above is not sufficient (http://crbug.com/106711): it
3406 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3407 # perform FPO regardless, so we must explicitly disable.
3408 # We still want the false setting above to avoid having
3409 # "/Oy /Oy-" and warnings about overriding.
3410 'AdditionalOptions': ['/Oy-'],
3413 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3416 'LinkIncremental': '<(msvs_debug_link_incremental)',
3417 # ASLR makes debugging with windbg difficult because Chrome.exe and
3418 # Chrome.dll share the same base name. As result, windbg will
3419 # name the Chrome.dll module like chrome_<base address>, where
3420 # <base address> typically changes with each launch. This in turn
3421 # means that breakpoints in Chrome.dll don't stick from one launch
3422 # to the next. For this reason, we turn ASLR off in debug builds.
3423 # Note that this is a three-way bool, where 0 means to pick up
3424 # the default setting, 1 is off and 2 is on.
3425 'RandomizedBaseAddress': 1,
3427 'VCResourceCompilerTool': {
3428 'PreprocessorDefinitions': ['_DEBUG'],
3432 ['OS=="linux" or OS=="android"', {
3433 'target_conditions': [
3434 ['_toolset=="target"', {
3436 '<@(debug_extra_cflags)',
3441 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3442 # Enable libstdc++ debugging facilities to help catch problems
3443 # early, see http://crbug.com/65151 .
3444 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3445 'defines': ['_GLIBCXX_DEBUG=1',],
3447 ['release_valgrind_build==0', {
3450 '-fstack-protector-all', # Implies -fstack-protector
3456 # Allow comparing the address of references and 'this' against 0
3457 # in debug builds. Technically, these can never be null in
3458 # well-defined C/C++ and Clang can optimize such checks away in
3459 # release builds, but they may be used in asserts in debug builds.
3460 '-Wno-undefined-bool-conversion',
3461 '-Wno-tautological-undefined-compare',
3465 '-Wno-undefined-bool-conversion',
3466 '-Wno-tautological-undefined-compare',
3470 'VCCLCompilerTool': {
3471 'AdditionalOptions': [
3472 '-Wno-undefined-bool-conversion',
3473 '-Wno-tautological-undefined-compare',
3486 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3487 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3488 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3491 'VCCLCompilerTool': {
3492 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3494 # In official builds, each target will self-select
3495 # an optimization level.
3496 ['buildtype!="Official"', {
3497 'Optimization': '<(win_release_Optimization)',
3500 # According to MSVS, InlineFunctionExpansion=0 means
3501 # "default inlining", not "/Ob0".
3502 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3503 ['win_release_InlineFunctionExpansion==0', {
3504 'AdditionalOptions': ['/Ob0'],
3506 ['win_release_InlineFunctionExpansion!=""', {
3507 'InlineFunctionExpansion':
3508 '<(win_release_InlineFunctionExpansion)',
3511 # if win_release_OmitFramePointers is blank, leave as default
3512 ['win_release_OmitFramePointers==1', {
3513 'OmitFramePointers': 'true',
3515 ['win_release_OmitFramePointers==0', {
3516 'OmitFramePointers': 'false',
3517 # The above is not sufficient (http://crbug.com/106711): it
3518 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3519 # perform FPO regardless, so we must explicitly disable.
3520 # We still want the false setting above to avoid having
3521 # "/Oy /Oy-" and warnings about overriding.
3522 'AdditionalOptions': ['/Oy-'],
3525 # Put data in separate COMDATs. This allows the linker
3526 # to put bit-identical constants at the same address even if
3527 # they're unrelated constants, which saves binary size.
3528 # This optimization can't be used when ASan is enabled because
3529 # it is not compatible with the ASan ODR checker.
3530 'AdditionalOptions': ['/Gw'],
3533 'AdditionalOptions': [
3534 '/d2Zi+', # Improve debugging of Release builds.
3535 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3536 '<@(win_release_extra_cflags)',
3540 # LinkIncremental is a tri-state boolean, where 0 means default
3541 # (i.e., inherit from parent solution), 1 means false, and
3543 'LinkIncremental': '1',
3544 # This corresponds to the /PROFILE flag which ensures the PDB
3545 # file contains FIXUP information (growing the PDB file by about
3546 # 5%) but does not otherwise alter the output binary. This
3547 # information is used by the Syzygy optimization tool when
3548 # decomposing the release image.
3553 ['msvs_use_common_release', {
3554 'includes': ['release.gypi'],
3556 ['release_valgrind_build==0 and tsan==0', {
3559 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3563 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3564 'MEMORY_SANITIZER_INITIAL_SIZE',
3565 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3566 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3570 'defines': ['NO_TCMALLOC'],
3572 ['win_fastlink==1', {
3575 # /PROFILE is incompatible with /debug:fastlink
3577 'AdditionalOptions': [
3578 # Tell VS 2015+ to create a PDB that references debug
3579 # information in .obj and .lib files instead of copying
3588 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3589 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3590 # It seems to work fine with Ubuntu 12 headers though, so use it
3591 # in official builds.
3592 ['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")', {
3593 'target_conditions': [
3594 ['chromium_code==1', {
3595 # Non-chromium code is not guaranteed to compile cleanly
3596 # with _FORTIFY_SOURCE. Also, fortified build may fail
3597 # when optimizations are disabled, so only do that for Release
3600 '_FORTIFY_SOURCE=2',
3605 ['OS=="linux" or OS=="android"', {
3606 'target_conditions': [
3607 ['_toolset=="target"', {
3609 '<@(release_extra_cflags)',
3612 ['enable_resource_whitelist_generation==1', {
3614 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3623 'NS_BLOCK_ASSERTIONS=1',
3629 # Concrete configurations
3632 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3635 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3640 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3641 'target_conditions': [
3642 [ '_type=="executable"', {
3643 # To get a real .dSYM bundle produced by dsymutil, set the
3644 # debug information format to dwarf-with-dsym. Since
3645 # strip_from_xcode will not be used, set Xcode to do the
3646 # stripping as well.
3648 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3649 'DEPLOYMENT_POSTPROCESSING': 'YES',
3650 'STRIP_INSTALLED_PRODUCT': 'YES',
3657 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3659 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3662 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3670 'target_defaults': {
3675 # TODO(glider): enable the default options on other systems.
3677 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3679 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3685 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3686 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3687 'target_defaults': {
3689 '-Wl,--fatal-warnings',
3693 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3694 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0 and cfi_diag==0', {
3695 'target_defaults': {
3701 ['os_posix==1 and chromeos==0', {
3702 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3703 # and we want to avoid overriding this, so stack-protector is only
3704 # enabled when not building on Chrome OS.
3705 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3707 'target_defaults': {
3709 '-fstack-protector',
3710 '--param=ssp-buffer-size=4',
3714 ['os_posix==1 and OS=="linux"', {
3716 '_LARGEFILE_SOURCE',
3717 '_LARGEFILE64_SOURCE',
3718 '_FILE_OFFSET_BITS=64',
3721 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3722 'target_defaults': {
3723 # Enable -Werror by default, but put it in a variable so it can
3724 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3726 'werror%': '-Werror',
3727 'libraries_for_target%': '',
3730 '_FILE_OFFSET_BITS=64',
3733 '<(werror)', # See note above about the werror variable.
3735 '-fno-strict-aliasing', # See http://crbug.com/32204
3737 # Don't warn about unused function params. We use those everywhere.
3738 '-Wno-unused-parameter',
3739 # Don't warn about the "struct foo f = {0};" initialization pattern.
3740 '-Wno-missing-field-initializers',
3741 # Don't export any symbols (for example, to plugins we dlopen()).
3742 # Note: this is *required* to make some plugins work.
3743 '-fvisibility=hidden',
3749 '-fno-threadsafe-statics',
3750 # Make inline functions have hidden visiblity by default.
3751 # Surprisingly, not covered by -fvisibility=hidden.
3752 '-fvisibility-inlines-hidden',
3753 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3754 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3758 '-pthread', '-Wl,-z,noexecstack',
3761 '<(libraries_for_target)',
3766 'debug_optimize%': '0',
3772 '-O>(debug_optimize)',
3776 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3777 # TODO(jdduke) Re-enable on mips after resolving linking
3778 # issues with libc++ (crbug.com/456380).
3780 # Warn in case of text relocations.
3781 '-Wl,--warn-shared-textrel',
3784 ['OS=="android" and android_full_debug==0', {
3785 # Some configurations are copied from Release_Base to reduce
3788 'debug_optimize%': 's',
3792 '-ffunction-sections',
3799 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3800 # We don't omit frame pointers on arm64 since they are required
3801 # to correctly unwind stackframes which contain system library
3802 # function frames (crbug.com/391706).
3804 '-fomit-frame-pointer',
3807 ['OS=="linux" and target_arch=="ia32"', {
3809 '-Wl,--no-as-needed',
3812 ['debug_unwind_tables==1', {
3813 'cflags': ['-funwind-tables'],
3815 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3816 'defines': ['NO_UNWIND_TABLES'],
3818 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3819 # definitions in to the right scope to use them when setting
3820 # linux_use_debug_fission, so it can be used here alone.
3821 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3822 'cflags': ['-gsplit-dwarf'],
3828 'release_optimize%': '2',
3829 # Binaries become big and gold is unable to perform GC
3830 # and remove unused sections for some of test targets
3831 # on 32 bit platform.
3832 # (This is currently observed only in chromeos valgrind bots)
3833 # The following flag is to disable --gc-sections linker
3834 # option for these bots.
3835 'no_gc_sections%': 0,
3837 # TODO(bradnelson): reexamine how this is done if we change the
3838 # expansion of configurations
3839 'release_valgrind_build%': 0,
3842 '-O<(release_optimize)',
3843 # Don't emit the GCC version ident directives, they just end up
3844 # in the .comment section taking up binary size.
3846 # Put data and code in their own sections, so that unused symbols
3847 # can be removed at link time with --gc-sections.
3849 '-ffunction-sections',
3852 # Specifically tell the linker to perform optimizations.
3853 # See http://lwn.net/Articles/192624/ .
3858 ['no_gc_sections==0', {
3860 '-Wl,--gc-sections',
3863 ['OS=="android" and target_arch!="arm64"', {
3864 # We don't omit frame pointers on arm64 since they are required
3865 # to correctly unwind stackframes which contain system library
3866 # function frames (crbug.com/391706).
3868 '-fomit-frame-pointer',
3871 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3872 # TODO(jdduke) Re-enable on mips after resolving linking
3873 # issues with libc++ (crbug.com/456380).
3875 # Warn in case of text relocations.
3876 '-Wl,--warn-shared-textrel',
3881 'release_optimize%': 's',
3886 '-fno-omit-frame-pointer',
3890 ['profiling_full_stack_frames==1', {
3893 '-fno-optimize-sibling-calls',
3898 ['release_unwind_tables==1', {
3899 'cflags': ['-funwind-tables'],
3901 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3902 'defines': ['NO_UNWIND_TABLES'],
3908 ['target_arch=="ia32"', {
3909 'target_conditions': [
3910 ['_toolset=="target"', {
3912 # Needed so that libs with .s files (e.g. libicudata.a)
3913 # are compatible with the general 32-bit-ness.
3916 # All floating-point computations on x87 happens in 80-bit
3917 # precision. Because the C and C++ language standards allow
3918 # the compiler to keep the floating-point values in higher
3919 # precision than what's specified in the source and doing so
3920 # is more efficient than constantly rounding up to 64-bit or
3921 # 32-bit precision as specified in the source, the compiler,
3922 # especially in the optimized mode, tries very hard to keep
3923 # values in x87 floating-point stack (in 80-bit precision)
3924 # as long as possible. This has important side effects, that
3925 # the real value used in computation may change depending on
3926 # how the compiler did the optimization - that is, the value
3927 # kept in 80-bit is different than the value rounded down to
3928 # 64-bit or 32-bit. There are possible compiler options to
3929 # make this behavior consistent (e.g. -ffloat-store would keep
3930 # all floating-values in the memory, thus force them to be
3931 # rounded to its original precision) but they have significant
3932 # runtime performance penalty.
3934 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3935 # which keep floating-point values in SSE registers in its
3936 # native precision (32-bit for single precision, and 64-bit
3937 # for double precision values). This means the floating-point
3938 # value used during computation does not change depending on
3939 # how the compiler optimized the code, since the value is
3940 # always kept in its specified precision.
3942 # Refer to http://crbug.com/348761 for rationale behind SSE2
3943 # being a minimum requirement for 32-bit Linux builds and
3944 # http://crbug.com/313032 for an example where this has "bit"
3949 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3956 # Use gold linker for Android ia32 target.
3958 # Use gold linker for Android ia32 target.
3962 # Use -mstackrealign due to a bug on ia32 Jelly Bean.
3963 # See crbug.com/521527
3972 ['target_arch=="x64"', {
3973 'target_conditions': [
3974 ['_toolset=="target"', {
3976 # Use gold linker for Android x64 target.
3993 ['target_arch=="arm"', {
3994 'target_conditions': [
3995 ['_toolset=="target"', {
3999 # The codesourcery arm-2009q3 toolchain warns at that the ABI
4000 # has changed whenever it encounters a varargs function. This
4001 # silences those warnings, as they are not helpful and
4002 # clutter legitimate warnings.
4006 ['clang==1 and arm_arch!="" and OS!="android"', {
4008 '-target arm-linux-gnueabihf',
4011 '-target arm-linux-gnueabihf',
4016 '-march=<(arm_arch)',
4019 ['use_lto==1 or use_lto_o2==1', {
4021 '-march=<(arm_arch)',
4026 ['clang==1 and OS!="android"', {
4028 # We need to disable clang's builtin assembler as it can't
4029 # handle several asm files, crbug.com/124610
4030 '-no-integrated-as',
4035 '-mtune=<(arm_tune)',
4038 ['use_lto==1 or use_lto_o2==1', {
4040 '-mtune=<(arm_tune)',
4050 ['use_lto==1 or use_lto_o2==1', {
4057 ['arm_float_abi!=""', {
4059 '-mfloat-abi=<(arm_float_abi)',
4062 ['use_lto==1 or use_lto_o2==1', {
4064 '-mfloat-abi=<(arm_float_abi)',
4074 ['use_lto==1 or use_lto_o2==1', {
4082 # Most of the following flags are derived from what Android
4083 # uses by default when building for arm, reference for which
4084 # can be found in the following file in the Android NDK:
4085 # toolchains/arm-linux-androideabi-4.9/setup.mk
4087 # The tree-sra optimization (scalar replacement for
4088 # aggregates enabling subsequent optimizations) leads to
4089 # invalid code generation when using the Android NDK's
4090 # compiler (r5-r7). This can be verified using
4091 # webkit_unit_tests' WTF.Checked_int8_t test.
4093 # The following option is disabled to improve binary
4094 # size and performance in gcc 4.9.
4095 '-fno-caller-saves',
4098 # Android now supports .relro sections properly.
4099 # NOTE: While these flags enable the generation of .relro
4100 # sections, the generated libraries can still be loaded on
4101 # older Android platform versions.
4108 ['gcc_version==48 and clang==0', {
4110 # The following 5 options are disabled to save on
4111 # binary size in GCC 4.8.
4112 '-fno-partial-inlining',
4113 '-fno-early-inlining',
4114 '-fno-tree-copy-prop',
4115 '-fno-tree-loop-optimize',
4116 '-fno-move-loop-invariants',
4120 'cflags': [ '-mthumb-interwork' ],
4124 # Thumb code with frame pointer makes chrome crash
4127 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
4128 # The perf report sometimes incorrectly attributes
4129 # code from tail calls.
4130 '-fno-optimize-sibling-calls',
4133 '-fomit-frame-pointer',
4138 # Clang does not support the following options.
4140 '-mthumb-interwork',
4141 '-finline-limit=64',
4143 '-fno-caller-saves',
4147 # TODO(hans) Enable integrated-as (crbug.com/124610).
4148 '-no-integrated-as',
4149 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4152 ['clang==1 and linux_use_bundled_gold==0', {
4154 # Let clang find the ld.gold in the NDK.
4155 '--gcc-toolchain=<(android_toolchain)/..',
4160 '-marm', # Required for frame pointer based stack traces.
4167 # We set arm_arch to "" so that -march compiler option
4168 # is not set. Otherwise a gcc bug that would complain
4169 # about it conflicting with '-mcpu=cortex-a9'. The flag
4170 # '-march=armv7-a' is actually redundant anyway because
4171 # it is enabled by default when we built the toolchain.
4172 # And using '-mcpu=cortex-a9' should be sufficient.
4175 # Breakpad requires symbols with debugging information
4179 # We want to statically link libstdc++/libgcc_s.
4180 '-static-libstdc++',
4184 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4185 # define their own cflags for arm builds that could
4186 # conflict with the flags we set here (e.g.
4187 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4196 ['target_arch=="arm64"', {
4197 'target_conditions': [
4198 ['_toolset=="target"', {
4202 '-fstack-protector', # stack protector is always enabled on arm64.
4209 ['target_arch=="mipsel"', {
4210 'target_conditions': [
4211 ['_toolset=="target"', {
4213 ['mips_arch_variant=="r6"', {
4216 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ],
4217 'ldflags': [ '-target mipsel-linux-gnu', ],
4219 'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
4221 ['clang==0 and OS=="android"', {
4222 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4226 ['mips_arch_variant=="r2"', {
4228 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4229 'cflags': ['-m<(mips_fpu_mode)'],
4234 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
4235 'ldflags': [ '-target mipsel-linux-android', ],
4237 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32r2'],
4238 'ldflags': [ '-target mipsel-linux-gnu', ],
4242 'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
4246 ['mips_arch_variant=="r1"', {
4251 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
4252 'ldflags': [ '-target mipsel-linux-android', ],
4254 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32'],
4255 'ldflags': [ '-target mipsel-linux-gnu', ],
4259 'cflags': ['-mips32', '-Wa,-mips32', ],
4265 # Clang does not support the following options.
4266 '-finline-limit=64',
4269 # TODO(gordanac) Enable integrated-as.
4270 '-no-integrated-as',
4273 ['clang==1 and OS=="android"', {
4275 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4278 # Let clang find the ld in the NDK.
4279 '--gcc-toolchain=<(android_toolchain)/..',
4282 ['mips_dsp_rev==1', {
4283 'cflags': ['-mdsp'],
4285 ['mips_dsp_rev==2', {
4286 'cflags': ['-mdspr2'],
4290 '-m<(mips_float_abi)-float'
4293 '-Wl,--no-keep-memory'
4296 '-Wno-uninitialized',
4301 ['target_arch=="mips64el"', {
4302 'target_conditions': [
4303 ['_toolset=="target"', {
4305 ['mips_arch_variant=="r6"', {
4306 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4307 'ldflags': ['-mips64r6'],
4309 ['mips_arch_variant=="r2"', {
4310 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4311 'ldflags': ['-mips64r2'],
4315 '-Wno-uninitialized',
4329 'target_conditions': [
4330 ['_toolset=="target"', {
4332 '--sysroot=<(sysroot)',
4335 '--sysroot=<(sysroot)',
4336 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4342 # TODO(thakis): Remove, http://crbug.com/263960
4343 '-Wno-reserved-user-defined-literal',
4346 # gnu++11 instead of c++11 is needed because some code uses
4347 # typeof() (a GNU extension).
4348 # TODO(thakis): Eventually switch this to c++11 instead,
4349 # http://crbug.com/427584
4353 ['clang==0 and host_clang==1', {
4354 'target_conditions': [
4355 ['_toolset=="host"', {
4356 'cflags_cc': [ '-std=gnu++11', ],
4360 ['clang==1 and clang_use_chrome_plugins==1', {
4362 '<@(clang_chrome_plugins_flags)',
4365 ['clang==1 and clang_load!=""', {
4367 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4370 ['clang==1 and clang_add_plugin!=""', {
4372 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4375 ['clang==1 and target_arch=="ia32"', {
4377 # Else building libyuv gives clang's register allocator issues,
4378 # see llvm.org/PR15798 / crbug.com/233709
4379 '-momit-leaf-frame-pointer',
4380 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4381 '-mstack-alignment=16',
4385 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4387 # See http://crbug.com/110262
4388 '-fcolor-diagnostics',
4391 # Common options for AddressSanitizer, LeakSanitizer,
4392 # ThreadSanitizer, MemorySanitizer and non-official CFI builds.
4393 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1 or '
4394 '(cfi_vptr==1 and buildtype!="Official")', {
4395 'target_conditions': [
4396 ['_toolset=="target"', {
4398 '-fno-omit-frame-pointer',
4399 '-gline-tables-only',
4402 '-fomit-frame-pointer',
4407 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4408 'target_conditions': [
4409 ['_toolset=="target"', {
4411 # Functions interposed by the sanitizers can make ld think
4412 # that some libraries aren't needed when they actually are,
4413 # http://crbug.com/234010. As workaround, disable --as-needed.
4417 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4418 'MEMORY_SANITIZER_INITIAL_SIZE',
4424 'target_conditions': [
4425 ['_toolset=="target"', {
4427 '-fsanitize=address',
4428 # TODO(earthdok): Re-enable. http://crbug.com/427202
4429 #'-fsanitize-blacklist=<(asan_blacklist)',
4432 '-fsanitize=address',
4439 '-mllvm -asan-globals=0', # http://crbug.com/352073
4445 'target_conditions': [
4446 ['_toolset=="target"', {
4448 # FIXME: work on enabling more flags and getting rid of false
4449 # positives. http://crbug.com/174801.
4450 '-fsanitize=bounds',
4451 '-fsanitize=float-divide-by-zero',
4452 '-fsanitize=integer-divide-by-zero',
4454 '-fsanitize=object-size',
4455 '-fsanitize=return',
4456 '-fsanitize=returns-nonnull-attribute',
4457 '-fsanitize=shift-exponent',
4458 '-fsanitize=signed-integer-overflow',
4459 '-fsanitize=unreachable',
4460 '-fsanitize=vla-bound',
4461 '-fsanitize-blacklist=<(ubsan_blacklist)',
4462 # Employ the experimental PBQP register allocator to avoid
4463 # slow compilation on files with too many basic blocks.
4464 # See http://crbug.com/426271.
4465 '-mllvm -regalloc=pbqp',
4466 # Speculatively use coalescing to slightly improve the code
4467 # generated by PBQP regallocator. May increase compile time.
4468 '-mllvm -pbqp-coalescing',
4477 '-fsanitize=undefined',
4480 'UNDEFINED_SANITIZER',
4486 'target_conditions': [
4487 ['_toolset=="target"', {
4490 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4502 'UNDEFINED_SANITIZER',
4507 ['asan_coverage!=0 and sanitizer_coverage==0', {
4508 'target_conditions': [
4509 ['_toolset=="target"', {
4511 '-fsanitize-coverage=<(asan_coverage)',
4514 'SANITIZER_COVERAGE',
4519 ['sanitizer_coverage!=0', {
4520 'target_conditions': [
4521 ['_toolset=="target"', {
4523 '-fsanitize-coverage=<(sanitizer_coverage)',
4526 'SANITIZER_COVERAGE',
4531 ['(asan_coverage>1 or sanitizer_coverage>1) and target_arch=="arm"', {
4532 'target_conditions': [
4533 ['_toolset=="target"', {
4535 '-mllvm -sanitizer-coverage-block-threshold=0', # http://crbug.com/517105
4540 ['asan_field_padding!=0', {
4541 'target_conditions': [
4542 ['_toolset=="target"', {
4544 '-fsanitize-address-field-padding=<(asan_field_padding)',
4550 'target_conditions': [
4551 ['_toolset=="target"', {
4560 'WTF_USE_LEAK_SANITIZER=1',
4566 'target_conditions': [
4567 ['_toolset=="target"', {
4569 '-fsanitize=thread',
4570 '-fsanitize-blacklist=<(tsan_blacklist)',
4573 '-fsanitize=thread',
4577 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4578 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4584 'target_conditions': [
4585 ['_toolset=="target"', {
4587 '-fsanitize=memory',
4588 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4589 '-fsanitize-blacklist=<(msan_blacklist)',
4592 '-fsanitize=memory',
4600 ['use_instrumented_libraries==1', {
4602 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4605 ['use_prebuilt_instrumented_libraries==1', {
4607 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
4610 ['use_custom_libcxx==1', {
4612 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4615 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4616 'target_conditions' : [
4617 # crazy_linker has an upstream gyp file we can't edit, and we
4618 # don't want to instrument it.
4619 ['_toolset=="target" and _target_name!="crazy_linker"', {
4621 '-finstrument-functions',
4622 # Allow mmx intrinsics to inline, so that the
4623 #0 compiler can expand the intrinsics.
4624 '-finstrument-functions-exclude-file-list=mmintrin.h',
4627 ['_toolset=="target" and OS=="android"', {
4629 # Avoids errors with current NDK:
4630 # "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"
4631 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4636 ['linux_dump_symbols==1', {
4639 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4640 'target_conditions': [
4641 ['_toolset=="target"', {
4643 # Attempt to use less memory to prevent the linker from
4644 # running out of address space. Considering installing a
4645 # 64-bit kernel and switching to a 64-bit linker.
4646 '-Wl,--no-keep-memory',
4653 ['use_allocator!="tcmalloc"', {
4654 'defines': ['NO_TCMALLOC'],
4656 ['linux_use_gold_flags==1', {
4657 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4659 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4660 'ldflags': [ '-fuse-ld=gold', ],
4662 'target_conditions': [
4663 ['_toolset=="target"', {
4665 # Experimentation found that using four linking threads
4666 # saved ~20% of link time.
4667 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4668 # Only apply this to the target linker, since the host
4669 # linker might not be gold, but isn't used much anyway.
4670 # TODO(raymes): Disable threading because gold is frequently
4671 # crashing on the bots: crbug.com/161942.
4673 # '-Wl,--thread-count=4',
4676 # TODO(thestig): Enable this for disabled cases.
4677 [ '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', {
4679 '-Wl,--detect-odr-violations',
4686 ['release_valgrind_build==0 and order_profiling==0 and asan==0 and msan==0 and lsan==0 and tsan==0', {
4687 'target_conditions': [
4688 ['_toolset=="target"', {
4690 '-Wl,--icf=<(gold_icf_level)',
4697 ['linux_use_bundled_binutils==1', {
4699 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4702 ['linux_use_bundled_gold==1 and '
4703 'not (clang==0 and (use_lto==1 or use_lto_o2==1))', {
4704 # Put our binutils, which contains gold in the search path. We pass
4705 # the path to gold to the compiler. gyp leaves unspecified what the
4706 # cwd is when running the compiler, so the normal gyp path-munging
4707 # fails us. This hack gets the right path.
4709 # Disabled when using GCC LTO because GCC also uses the -B search
4710 # path at link time to find "as", and our bundled "as" can only
4713 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4716 # Some binutils 2.23 releases may or may not have new dtags enabled,
4717 # but they are all compatible with --disable-new-dtags,
4718 # because the new dynamic tags are not created by default.
4719 ['binutils_version>=223', {
4720 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4721 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4722 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4723 # inside this file to allow usage of --no-as-needed and removal of
4726 '-Wl,--disable-new-dtags',
4729 ['gcc_version>=47 and clang==0', {
4730 'target_conditions': [
4731 ['_toolset=="target"', {
4734 # See comment for -Wno-c++11-narrowing.
4736 # TODO(thakis): Remove, http://crbug.com/263960
4737 '-Wno-literal-suffix',
4742 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4743 'target_conditions': [
4744 ['_toolset=="host"', {
4747 # See comment for -Wno-c++11-narrowing.
4749 # TODO(thakis): Remove, http://crbug.com/263960
4750 '-Wno-literal-suffix',
4758 # FreeBSD-specific options; note that most FreeBSD options are set above,
4761 'target_defaults': {
4763 '-Wl,--no-keep-memory',
4767 # Android-specific options; note that most are set above with Linux.
4770 # This is a unique identifier for a given build. It's used for
4771 # identifying various build artifacts corresponding to a particular
4772 # build of chrome (e.g. where to find archived symbols).
4773 'chrome_build_id%': '',
4775 # Placing this variable here prevents from forking libvpx, used
4776 # by remoting. Remoting is off, so it needn't built,
4777 # so forking it's deps seems like overkill.
4778 # But this variable need defined to properly run gyp.
4779 # A proper solution is to have an OS==android conditional
4780 # in third_party/libvpx/libvpx.gyp to define it.
4781 'libvpx_path': 'lib/linux/arm',
4783 'target_defaults': {
4785 'release_extra_cflags%': '',
4787 # If we're using the components build, append "cr" to all shared
4788 # libraries to avoid naming collisions with android system library
4789 # versions with the same name (e.g. skia, icu).
4790 ['component=="shared_library"', {
4791 'android_product_extension': 'cr.so',
4793 'android_product_extension': 'so',
4797 'target_conditions': [
4798 ['_type=="shared_library"', {
4799 'product_extension': '<(android_product_extension)',
4802 # Settings for building device targets using Android's toolchain.
4803 # These are based on the setup.mk file from the Android NDK.
4805 # The NDK Android executable link step looks as follows:
4807 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4808 # $(PRIVATE_OBJECTS) <-- The .o that we built
4809 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4810 # $(TARGET_LIBGCC) <-- libgcc.a
4811 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4812 # $(PRIVATE_LDLIBS) <-- System .so
4813 # $(TARGET_CRTEND_O) <-- crtend.o
4815 # For now the above are approximated for executables by adding
4816 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4819 # The NDK Android shared library link step looks as follows:
4821 # $(PRIVATE_OBJECTS) <-- The .o that we built
4822 # -l,--whole-archive
4823 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4824 # -l,--no-whole-archive
4825 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4826 # $(TARGET_LIBGCC) <-- libgcc.a
4827 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4828 # $(PRIVATE_LDLIBS) <-- System .so
4830 # For now, assume that whole static libraries are not needed.
4832 # For both executables and shared libraries, add the proper
4833 # libgcc.a to the start of libraries which puts it in the
4834 # proper spot after .o and .a files get linked in.
4836 # TODO: The proper thing to do longer-tem would be proper gyp
4837 # support for a custom link command line.
4838 ['_toolset=="target"', {
4840 '-pthread', # Not supported by Android toolchain.
4843 '-ffunction-sections',
4846 '-fstack-protector',
4848 '-finline-limit=64',
4849 '<@(release_extra_cflags)',
4850 '--sysroot=<(android_ndk_sysroot)',
4851 # NOTE: The libc++ header include paths below are specified in
4852 # cflags rather than include_dirs because they need to come
4853 # after include_dirs.
4854 # The include ordering here is important; change with caution.
4855 '-isystem<(android_libcpp_include)',
4856 '-isystem<(android_ndk_root)/sources/cxx-stl/llvm-libc++abi/libcxxabi/include',
4857 '-isystem<(android_ndk_root)/sources/android/support/include',
4861 '__GNU_SOURCE=1', # Necessary for clone()
4862 'CHROME_BUILD_ID="<(chrome_build_id)"',
4863 # The NDK has these things, but doesn't define the constants
4864 # to say that it does. Define them here instead.
4868 '-pthread', # Not supported by Android toolchain.
4871 '-Wl,--build-id=sha1',
4872 '-Wl,--no-undefined',
4873 '--sysroot=<(android_ndk_sysroot)',
4875 '-L<(android_libcpp_libs_dir)',
4876 # Don't allow visible symbols from libgcc or libc++ to be
4878 '-Wl,--exclude-libs=libgcc.a',
4879 '-Wl,--exclude-libs=libc++_static.a',
4880 # Don't allow visible symbols from libraries that contain
4881 # assembly code with symbols that aren't hidden properly.
4882 # http://crbug.com/448386
4883 '-Wl,--exclude-libs=libcommon_audio.a',
4884 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4885 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4886 '-Wl,--exclude-libs=libiSACFix.a',
4887 '-Wl,--exclude-libs=libisac_neon.a',
4888 '-Wl,--exclude-libs=libopus.a',
4889 '-Wl,--exclude-libs=libvpx.a',
4892 '-l<(android_libcpp_library)',
4894 # Manually link the libgcc.a that the cross compiler uses.
4895 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4901 ['component=="static_library"', {
4902 'target_conditions': [
4903 ['use_native_jni_exports==0', {
4904 # Use a linker version script to strip JNI exports from
4905 # binaries which have not specifically asked to use them.
4907 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4914 # Clang with libc++ does not require an explicit atomic
4915 # library reference.
4919 # Work around incompatibilities between bionic and clang
4921 '-D__compiler_offsetof=__builtin_offsetof',
4922 '-Dnan=__builtin_nan',
4925 # Clang does not support the following options.
4926 '-finline-limit=64',
4929 ['target_arch=="arm"', {
4931 '-target arm-linux-androideabi',
4934 '-target arm-linux-androideabi',
4937 ['target_arch=="ia32"', {
4939 '-target i686-linux-androideabi',
4942 '-target i686-linux-androideabi',
4945 # Place holder for x64 support, not tested.
4946 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4947 ['target_arch=="x64"', {
4949 '-target x86_64-linux-androideabi',
4952 '-target x86_64-linux-androideabi',
4959 # Android build relies on -Wl,--gc-sections removing
4960 # unreachable code. ASan instrumentation for globals inhibits
4961 # this and results in a library with unresolvable relocations.
4962 # TODO(eugenis): find a way to reenable this.
4963 '-mllvm -asan-globals=0',
4966 ['target_arch == "arm" and order_profiling==0', {
4968 # Enable identical code folding to reduce size.
4969 '-Wl,--icf=<(gold_icf_level)',
4972 ['target_arch=="ia32"', {
4973 # The x86 toolchain currently has problems with stack-protector.
4975 '-fstack-protector',
4978 '-fno-stack-protector',
4982 'target_conditions': [
4983 ['_type=="executable"', {
4984 # Force android tools to export the "main" symbol so they can be
4985 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4986 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4987 # when ICS support will be dropped.
4990 '-fvisibility=default',
4994 '-Wl,--gc-sections',
4995 '-Wl,-z,nocopyreloc',
4998 # crtbegin_dynamic.o should be the last item in ldflags.
4999 '<(android_ndk_lib)/crtbegin_dynamic.o',
5002 # crtend_android.o needs to be the last item in libraries.
5003 # Do not add any libraries after this!
5004 '<(android_ndk_lib)/crtend_android.o',
5007 ['_type=="shared_library" or _type=="loadable_module"', {
5009 '-Wl,-shared,-Bsymbolic',
5010 # crtbegin_so.o should be the last item in ldflags.
5011 '<(android_ndk_lib)/crtbegin_so.o',
5014 # crtend_so.o needs to be the last item in libraries.
5015 # Do not add any libraries after this!
5016 '<(android_ndk_lib)/crtend_so.o',
5021 # Settings for building host targets using the system toolchain.
5022 ['_toolset=="host"', {
5024 # Due to issues in Clang build system, using ASan on 32-bit
5025 # binaries on x86_64 host is problematic.
5026 # TODO(eugenis): re-enable.
5027 '-fsanitize=address',
5030 '-fsanitize=address',
5031 '-Wl,-z,noexecstack',
5032 '-Wl,--gc-sections',
5035 '-Wl,--warn-shared-textrel',
5036 '-Wl,--fatal-warnings',
5039 # Settings for building host targets on mac.
5040 ['_toolset=="host" and host_os=="mac"', {
5050 'cflags!': ['-fvisibility=hidden'],
5051 'cflags_cc!': ['-fvisibility-inlines-hidden'],
5053 ['OS=="mac" or OS=="ios"', {
5054 'target_defaults': {
5057 'ALWAYS_SEARCH_USER_PATHS': 'NO',
5058 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
5059 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
5060 'COPY_PHASE_STRIP': 'NO',
5061 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
5062 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
5063 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
5064 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
5065 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
5066 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
5067 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
5068 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
5069 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
5070 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
5071 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
5072 'GCC_VERSION': '4.2',
5073 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
5074 'USE_HEADERMAP': 'NO',
5079 # Don't warn about unused function parameters.
5080 '-Wno-unused-parameter',
5081 # Don't warn about the "struct foo f = {0};" initialization
5083 '-Wno-missing-field-initializers',
5086 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
5087 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
5089 # Note that the prebuilt Clang binaries should not be used for iOS
5090 # development except for ASan builds.
5092 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
5093 # Warn if automatic synthesis is triggered with
5094 # the -Wobjc-missing-property-synthesis flag.
5095 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
5096 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
5098 # This warns on selectors from Cocoa headers (-length, -set).
5099 # cfe-dev is currently discussing the merits of this warning.
5100 # TODO(thakis): Reevaluate what to do with this, based one
5101 # cfe-dev discussion.
5102 '-Wno-selector-type-mismatch',
5105 ['clang_xcode==0', {
5106 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
5107 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
5111 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
5113 '<@(clang_chrome_plugins_flags)',
5116 ['clang==1 and clang_xcode==0 and clang_load!=""', {
5118 '-Xclang', '-load', '-Xclang', '<(clang_load)',
5121 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
5123 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
5126 ['clang==1 and "<(GENERATOR)"=="ninja"', {
5128 # See http://crbug.com/110262
5129 '-fcolor-diagnostics',
5132 ['OS=="ios" and target_subarch!="arm32" and \
5133 "<(GENERATOR)"=="xcode"', {
5135 # TODO(ios): when building Chrome for iOS on 64-bit platform
5136 # with Xcode, the -Wshorted-64-to-32 warning is automatically
5137 # enabled. This cause failures when compiling protobuf code,
5138 # so disable the warning. http://crbug.com/359107
5139 '-Wno-shorten-64-to-32',
5147 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
5153 '-fsanitize=address',
5154 '-mllvm -asan-globals=0', # http://crbug.com/352073
5155 '-gline-tables-only',
5159 ['asan_coverage!=0 and sanitizer_coverage==0', {
5160 'target_conditions': [
5161 ['_toolset=="target"', {
5163 '-fsanitize-coverage=<(asan_coverage)',
5166 'SANITIZER_COVERAGE',
5171 ['sanitizer_coverage!=0', {
5172 'target_conditions': [
5173 ['_toolset=="target"', {
5175 '-fsanitize-coverage=<(sanitizer_coverage)',
5178 'SANITIZER_COVERAGE',
5184 'target_conditions': [
5185 ['_type!="static_library"', {
5186 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5191 '-fsanitize=address',
5195 ['mac_write_linker_maps==1', {
5198 '-Wl,-map,>(_target_name).map',
5205 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5206 'target_conditions': [
5207 ['_type=="executable"', {
5213 # Define copy_asan_dylib_path in a variable ending in
5214 # _path so that gyp understands it's a path and
5215 # performs proper relativization during dict merging.
5216 'copy_asan_dylib_path':
5217 'mac/copy_asan_runtime_dylib.sh',
5219 'postbuild_name': 'Copy ASan runtime dylib',
5221 '<(copy_asan_dylib_path)',
5230 ], # target_conditions
5231 }, # target_defaults
5232 }], # OS=="mac" or OS=="ios"
5234 'target_defaults': {
5236 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5237 # with common names, like 'check', 'require', and 'verify'.
5238 # (Included by system header. Also exists on iOS but not included.)
5239 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5240 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5243 # These should end with %, but there seems to be a bug with % in
5244 # variables that are intended to be set to different values in
5245 # different targets, like these.
5246 'mac_pie': 1, # Most executables can be position-independent.
5247 # Strip debugging symbols from the target.
5248 'mac_strip': '<(mac_strip_release)',
5252 ['mac_want_real_dsym=="default"', {
5255 'mac_real_dsym': '<(mac_want_real_dsym)'
5260 ['mac_want_real_dsym=="default"', {
5261 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5263 'mac_real_dsym': '<(mac_want_real_dsym)'
5272 ['branding=="Chrome" and buildtype=="Official"', {
5275 # The Google Chrome Framework dSYM generated by dsymutil has
5276 # grown larger than 4GB, which dsymutil can't handle. Reduce
5277 # the amount of debug symbols.
5278 '-fno-standalone-debug', # See http://crbug.com/479841
5283 }, # configuration "Release"
5286 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5287 # (Equivalent to -fPIC)
5288 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5289 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5290 # Keep pch files below xcodebuild/.
5291 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5293 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5294 # xcode_setting, but not until all downstream projects' mac bots are
5295 # using xcode >= 4.6, because that's when the default value of the
5296 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5297 # setting is a no-op as far as xcode is concerned, but the compiler
5298 # behaves differently based on whether -fno-strict-aliasing is
5300 '-fno-strict-aliasing', # See http://crbug.com/32204.
5303 'target_conditions': [
5304 ['_type=="executable"', {
5307 # Arranges for data (heap) pages to be protected against
5308 # code execution when running on Mac OS X 10.7 ("Lion"), and
5309 # ensures that the position-independent executable (PIE) bit
5310 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5312 # Define change_mach_o_flags in a variable ending in _path
5313 # so that GYP understands it's a path and performs proper
5314 # relativization during dict merging.
5315 'change_mach_o_flags_path':
5316 'mac/change_mach_o_flags_from_xcode.sh',
5317 'change_mach_o_flags_options%': [
5319 'target_conditions': [
5320 ['mac_pie==0 or release_valgrind_build==1', {
5321 # Don't enable PIE if it's unwanted. It's unwanted if
5322 # the target specifies mac_pie=0 or if building for
5323 # Valgrind, because Valgrind doesn't understand slide.
5324 # See the similar mac_pie/release_valgrind_build check
5326 'change_mach_o_flags_options': [
5332 'postbuild_name': 'Change Mach-O Flags',
5334 '<(change_mach_o_flags_path)',
5335 '>@(change_mach_o_flags_options)',
5339 'target_conditions': [
5340 ['mac_pie==1 and release_valgrind_build==0', {
5341 # Turn on position-independence (ASLR) for executables. When
5342 # PIE is on for the Chrome executables, the framework will
5343 # also be subject to ASLR.
5344 # Don't do this when building for Valgrind, because Valgrind
5345 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5346 # understand slide, and get rid of the Valgrind check.
5349 '-Wl,-pie', # Position-independent executable (MH_PIE)
5355 ['(_type=="executable" or _type=="shared_library" or \
5356 _type=="loadable_module") and mac_strip!=0', {
5357 'target_conditions': [
5358 ['mac_real_dsym == 1', {
5359 # To get a real .dSYM bundle produced by dsymutil, set the
5360 # debug information format to dwarf-with-dsym. Since
5361 # strip_from_xcode will not be used, set Xcode to do the
5362 # stripping as well.
5366 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5367 'DEPLOYMENT_POSTPROCESSING': 'YES',
5368 'STRIP_INSTALLED_PRODUCT': 'YES',
5370 # Only strip non-ASan builds.
5372 'target_conditions': [
5373 ['_type=="shared_library" or _type=="loadable_module"', {
5374 # The Xcode default is to strip debugging symbols
5375 # only (-S). Local symbols should be stripped as
5376 # well, which will be handled by -x. Xcode will
5377 # continue to insert -S when stripping even when
5378 # additional flags are added with STRIPFLAGS.
5380 }], # _type=="shared_library" or _type=="loadable_module"
5381 ], # target_conditions
5387 }, # configuration "Release"
5389 }, { # mac_real_dsym != 1
5390 # To get a fast fake .dSYM bundle, use a post-build step to
5391 # produce the .dSYM and strip the executable. strip_from_xcode
5392 # only operates in the Release configuration.
5396 # Define strip_from_xcode in a variable ending in _path
5397 # so that gyp understands it's a path and performs proper
5398 # relativization during dict merging.
5399 'strip_from_xcode_path': 'mac/strip_from_xcode',
5401 'postbuild_name': 'Strip If Needed',
5402 'action': ['<(strip_from_xcode_path)'],
5406 ], # target_conditions
5407 }], # (_type=="executable" or _type=="shared_library" or
5408 # _type=="loadable_module") and mac_strip!=0
5409 ], # target_conditions
5410 }, # target_defaults
5414 'ios/coverage.gypi',
5416 'target_defaults': {
5417 'xcode_settings' : {
5418 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5419 'ENABLE_BITCODE': 'NO',
5422 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5423 # additional flag to suppress the "unknown compiler option" error.
5424 # Restrict this flag to builds that are either compiling with Xcode
5425 # or compiling with Xcode's Clang. This will allow Ninja builds to
5426 # continue failing on unknown compiler options.
5427 # TODO(rohitrao): This flag is temporary and should be removed as
5428 # soon as the iOS bots are updated to use Xcode 5.1.
5429 ['clang_xcode==1', {
5431 '-Wno-unknown-warning-option',
5432 # It's not possible to achieve nullability completeness before
5433 # all builders are running Xcode 7. crbug.com/499809
5434 '-Wno-nullability-completeness',
5438 # Limit the valid architectures depending on "target_subarch".
5439 # This need to include the "arm" architectures but also the "x86"
5440 # ones (they are used when building for the simulator).
5441 ['target_subarch=="arm32"', {
5442 'VALID_ARCHS': ['armv7', 'i386'],
5444 ['target_subarch=="arm64"', {
5445 'VALID_ARCHS': ['arm64', 'x86_64'],
5447 ['target_subarch=="both"', {
5448 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5450 ['use_system_libcxx==1', {
5451 'target_conditions': [
5452 # Only use libc++ when building target for iOS not when building
5453 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5454 # does not support libc++.
5455 ['_toolset=="target"', {
5456 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5460 # The default for deployment target of 7.0+ is libc++, so force
5461 # the old behavior unless libc++ is enabled.
5462 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5466 'target_conditions': [
5467 ['_toolset=="host"', {
5469 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5470 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5479 ['_toolset=="target"', {
5481 # This section should be for overriding host settings. But,
5482 # since we can't negate the iphone deployment target above, we
5483 # instead set it here for target only.
5484 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5485 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5488 ['_type=="executable"', {
5492 'DEPLOYMENT_POSTPROCESSING': 'YES',
5493 'STRIP_INSTALLED_PRODUCT': 'YES',
5495 ['buildtype!="Official"', {
5496 # Remove dSYM to reduce build time.
5497 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5504 # Remove dSYM to reduce build time.
5505 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5511 ['chromium_ios_signing', {
5512 # iOS SDK wants everything for device signed.
5513 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5515 'CODE_SIGNING_REQUIRED': 'NO',
5516 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5521 ], # target_conditions
5522 }, # target_defaults
5525 'target_defaults': {
5527 '_WIN32_WINNT=0x0603',
5534 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5535 'WIN32_LEAN_AND_MEAN',
5538 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5539 '_HAS_EXCEPTIONS=0',
5540 # Silence some warnings; we can't switch the the 'recommended'
5541 # versions as they're not available on old OSs.
5542 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5545 ['buildtype=="Official"', {
5546 # In official builds, targets can self-select an optimization
5547 # level by defining a variable named 'optimize', and setting it
5549 # - "size", optimizes for minimal code size - the default.
5550 # - "speed", optimizes for speed over code size.
5551 # - "max", whole program optimization and link-time code
5552 # generation. This is very expensive and should be used
5555 'optimize%': 'size',
5559 # Set /LTCG for the official builds.
5560 'LinkTimeCodeGeneration': '1',
5561 'AdditionalOptions': [
5562 # Set the number of LTCG code-gen threads to eight.
5563 # The default is four. This gives a 5-10% link speedup.
5568 'target_conditions': [
5569 ['optimize=="size"', {
5571 'VCCLCompilerTool': {
5572 # 1, optimizeMinSpace, Minimize Size (/O1)
5573 'Optimization': '1',
5574 # 2, favorSize - Favor small code (/Os)
5575 'FavorSizeOrSpeed': '2',
5580 # This config is used to avoid a problem in ffmpeg, see
5581 # http://crbug.com/264459.
5582 ['optimize=="size_no_ltcg"', {
5584 'VCCLCompilerTool': {
5585 # 1, optimizeMinSpace, Minimize Size (/O1)
5586 'Optimization': '1',
5587 # 2, favorSize - Favor small code (/Os)
5588 'FavorSizeOrSpeed': '2',
5593 ['optimize=="speed"', {
5595 'VCCLCompilerTool': {
5596 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5597 'Optimization': '2',
5598 # 1, favorSpeed - Favor fast code (/Ot)
5599 'FavorSizeOrSpeed': '1',
5604 ['optimize=="max"', {
5605 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5606 # builds. Probably anything that this would catch that
5607 # wouldn't be caught in a normal build isn't going to
5608 # actually be a bug, so the incremental value of C4702 for
5609 # PGO builds is likely very small.
5610 'msvs_disabled_warnings': [
5614 'VCCLCompilerTool': {
5615 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5616 'Optimization': '2',
5617 # 1, favorSpeed - Favor fast code (/Ot)
5618 'FavorSizeOrSpeed': '1',
5619 # This implies link time code generation.
5620 'WholeProgramOptimization': 'true',
5628 ['msvs_xtree_patched!=1', {
5629 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5630 # it's enabled. This will generally only be true for system-level
5631 # installed Express users.
5632 'msvs_disabled_warnings': [
5637 'msvs_system_include_dirs': [
5638 '<(windows_sdk_path)/Include/shared',
5639 '<(windows_sdk_path)/Include/um',
5640 '<(windows_sdk_path)/Include/winrt',
5641 '$(VSInstallDir)/VC/atlmfc/include',
5643 'msvs_cygwin_shell': 0,
5644 'msvs_disabled_warnings': [
5645 # C4091: 'typedef ': ignored on left of 'X' when no variable is
5647 # This happens in a number of Windows headers. Dumb.
5650 # C4127: conditional expression is constant
5651 # This warning can in theory catch dead code and other problems, but
5652 # triggers in far too many desirable cases where the conditional
5653 # expression is either set by macros or corresponds some legitimate
5654 # compile-time constant expression (due to constant template args,
5655 # conditionals comparing the sizes of different types, etc.). Some of
5656 # these can be worked around, but it's not worth it.
5659 # C4351: new behavior: elements of array 'array' will be default
5661 # This is a silly "warning" that basically just alerts you that the
5662 # compiler is going to actually follow the language spec like it's
5663 # supposed to, instead of not following it like old buggy versions
5664 # did. There's absolutely no reason to turn this on.
5667 # C4355: 'this': used in base member initializer list
5668 # It's commonly useful to pass |this| to objects in a class'
5669 # initializer list. While this warning can catch real bugs, most of
5670 # the time the constructors in question don't attempt to call methods
5671 # on the passed-in pointer (until later), and annotating every legit
5672 # usage of this is simply more hassle than the warning is worth.
5675 # C4503: 'identifier': decorated name length exceeded, name was
5677 # This only means that some long error messages might have truncated
5678 # identifiers in the presence of lots of templates. It has no effect
5679 # on program correctness and there's no real reason to waste time
5680 # trying to prevent it.
5683 # Warning C4589 says: "Constructor of abstract class ignores
5684 # initializer for virtual base class." Disable this warning because it
5685 # is flaky in VS 2015 RTM. It triggers on compiler generated
5686 # copy-constructors in some cases.
5689 # C4611: interaction between 'function' and C++ object destruction is
5691 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5692 # suggests using exceptions instead of setjmp/longjmp for C++, but
5693 # Chromium code compiles without exception support. We therefore have
5694 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5695 # means we have to turn off this warning (and be careful about how
5696 # object destruction happens in such cases).
5699 # TODO(maruel): These warnings are level 4. They will be slowly
5700 # removed as code is fixed.
5701 4100, # Unreferenced formal parameter
5702 4121, # Alignment of a member was sensitive to packing
5703 4244, # Conversion from 'type1' to 'type2', possible loss of data
5704 4481, # Nonstandard extension used: override specifier 'keyword'
5705 4505, # Unreferenced local function has been removed
5706 4510, # Default constructor could not be generated
5707 4512, # Assignment operator could not be generated
5708 4610, # Object can never be instantiated
5709 4838, # Narrowing conversion. Doesn't seem to be very useful.
5710 4995, # 'X': name was marked as #pragma deprecated
5711 4996, # 'X': was declared deprecated (for GetVersionEx).
5713 # These are variable shadowing warnings that are new in VS2015. We
5714 # should work through these at some point -- they may be removed from
5715 # the RTM release in the /W4 set.
5716 4456, 4457, 4458, 4459,
5719 'VCCLCompilerTool': {
5720 'AdditionalOptions': ['/MP'],
5721 'MinimalRebuild': 'false',
5722 'BufferSecurityCheck': 'true',
5723 'EnableFunctionLevelLinking': 'true',
5724 'RuntimeTypeInfo': 'false',
5725 'WarningLevel': '4',
5726 'WarnAsError': 'true',
5727 'DebugInformationFormat': '3',
5728 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5729 'ExceptionHandling': '0',
5731 'VCLibrarianTool': {
5732 'AdditionalOptions': ['/ignore:4221'],
5733 'AdditionalLibraryDirectories': [
5734 '<(windows_sdk_path)/Lib/win8/um/x86',
5738 'AdditionalDependencies': [
5750 'AdditionalLibraryDirectories': [
5751 '<(windows_sdk_path)/Lib/win8/um/x86',
5753 'GenerateDebugInformation': 'true',
5754 'MapFileName': '$(OutDir)\\$(TargetName).map',
5755 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5756 'FixedBaseAddress': '1',
5759 # 1 == /SUBSYSTEM:CONSOLE
5760 # 2 == /SUBSYSTEM:WINDOWS
5761 # Most of the executables we'll ever create are tests
5762 # and utilities with console output.
5766 'GenerateStublessProxies': 'true',
5767 'TypeLibraryName': '$(InputName).tlb',
5768 'OutputDirectory': '$(IntDir)',
5769 'HeaderFileName': '$(InputName).h',
5770 'DLLDataFileName': '$(InputName).dlldata.c',
5771 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5772 'ProxyFileName': '$(InputName)_p.c',
5774 'VCResourceCompilerTool': {
5776 'AdditionalIncludeDirectories': [
5778 '<(SHARED_INTERMEDIATE_DIR)',
5781 'target_conditions': [
5782 ['_type=="executable"', {
5784 'EmbedManifest': 'true',
5787 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5789 'AdditionalManifestFiles': [
5790 '>(win_exe_compatibility_manifest)',
5796 # Building with Clang on Windows is a work in progress and very
5797 # experimental. See crbug.com/82385.
5798 # Keep this in sync with the similar blocks in build/config/compiler/BUILD.gn
5800 'VCCLCompilerTool': {
5801 'AdditionalOptions': [
5802 # Many files use intrinsics without including this header.
5803 # TODO(hans): Fix those files, or move this to sub-GYPs.
5806 # TODO(hans): Make this list shorter eventually, http://crbug.com/504657
5807 '-Qunused-arguments', # http://crbug.com/504658
5808 '-Wno-microsoft', # http://crbug.com/505296
5809 '-Wno-unknown-pragmas', # http://crbug.com/505314
5810 '-Wno-unused-value', # http://crbug.com/505318
5814 ['clang==1 and clang_use_chrome_plugins==1', {
5815 'VCCLCompilerTool': {
5816 'AdditionalOptions': [
5817 '<@(clang_chrome_plugins_flags)',
5821 ['clang==1 and MSVS_VERSION == "2013"', {
5822 'VCCLCompilerTool': {
5823 'AdditionalOptions': [
5824 '-fmsc-version=1800',
5828 ['clang==1 and MSVS_VERSION == "2015"', {
5829 'VCCLCompilerTool': {
5830 'AdditionalOptions': [
5831 '-fmsc-version=1900',
5835 ['clang==1 and "<!(python <(DEPTH)/build/win/use_ansi_codes.py)"=="True"', {
5836 'VCCLCompilerTool': {
5837 'AdditionalOptions': [
5838 # cmd.exe doesn't understand ANSI escape codes by default,
5839 # so only enable them if something emulating them is around.
5840 '-fansi-escape-codes',
5841 # Also see http://crbug.com/110262
5842 '-fcolor-diagnostics',
5850 ['disable_nacl==1', {
5851 'target_defaults': {
5857 ['OS=="win" and msvs_use_common_linker_extras', {
5858 'target_defaults': {
5873 'AdditionalOptions': [
5884 'AdditionalOptions': ['/largeaddressaware'],
5888 # TODO(asan/win): Move this down into the general
5889 # win-target_defaults section once the 64-bit asan runtime
5890 # exists. See crbug.com/345874.
5891 'VCCLCompilerTool': {
5892 'AdditionalOptions': [
5893 '-fsanitize=address',
5894 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5896 'AdditionalIncludeDirectories': [
5897 # MSVC needs to be able to find the sanitizer headers when
5898 # invoked via /fallback. This is critical for using macros
5899 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5901 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/include_sanitizer',
5905 'AdditionalLibraryDirectories': [
5906 # TODO(hans): If make_clang_dir is absolute, this breaks.
5907 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/lib/windows',
5910 'target_conditions': [
5911 ['component=="shared_library"', {
5913 'AdditionalDependencies': [
5914 'clang_rt.asan_dynamic-i386.lib',
5915 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5919 ['_type=="executable" and component=="static_library"', {
5921 'AdditionalDependencies': [
5922 'clang_rt.asan-i386.lib',
5926 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5928 'AdditionalDependencies': [
5929 'clang_rt.asan_dll_thunk-i386.lib',
5935 ['sanitizer_coverage!=0', {
5936 # TODO(asan/win): Move this down into the general
5937 # win-target_defaults section once the 64-bit asan runtime
5938 # exists. See crbug.com/345874.
5939 'VCCLCompilerTool': {
5940 'AdditionalOptions': [
5941 '-fsanitize-coverage=<(sanitizer_coverage)',
5948 ['sanitizer_coverage!=0', {
5949 # TODO(asan/win): Move this down into the general
5950 # win-target_defaults section once the 64-bit asan runtime
5951 # exists. See crbug.com/345874.
5953 'SANITIZER_COVERAGE',
5961 'AdditionalOptions': [
5962 # safeseh is not compatible with x64
5974 ['enable_new_npdevice_api==1', {
5975 'target_defaults': {
5977 'ENABLE_NEW_NPDEVICE_API',
5981 # Don't warn about the "typedef 'foo' locally defined but not used"
5982 # for gcc 4.8 and higher.
5983 # TODO: remove this flag once all builds work. See crbug.com/227506
5984 ['gcc_version>=48 and clang==0', {
5985 'target_defaults': {
5987 '-Wno-unused-local-typedefs',
5991 ['gcc_version>=48 and clang==0 and host_clang==1', {
5992 'target_defaults': {
5993 'target_conditions': [
5994 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5998 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
6000 'make_global_settings': [
6001 ['CC', '<(make_clang_dir)/bin/clang'],
6002 ['CXX', '<(make_clang_dir)/bin/clang++'],
6003 ['CC.host', '$(CC)'],
6004 ['CXX.host', '$(CXX)'],
6007 ['clang==1 and OS=="win"', {
6008 'make_global_settings': [
6009 # On Windows, gyp's ninja generator only looks at CC.
6010 ['CC', '<(make_clang_dir)/bin/clang-cl'],
6013 ['use_lld==1 and OS=="win"', {
6014 'make_global_settings': [
6015 # Limited to Windows because lld-link is the driver that is
6016 # compatible with link.exe.
6017 ['LD', '<(make_clang_dir)/bin/lld-link'],
6020 ['OS=="android" and clang==0', {
6021 # Hardcode the compiler names in the Makefile so that
6022 # it won't depend on the environment at make time.
6023 'make_global_settings': [
6024 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
6025 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
6026 ['CC.host', '<(host_cc)'],
6027 ['CXX.host', '<(host_cxx)'],
6030 ['OS=="linux" and target_arch=="mipsel" and host_arch!="mipsel" and chromeos==0 and clang==0', {
6031 # Set default mips cross tools on linux. These can be overridden
6032 # using CC,CXX,CC.host and CXX.host environment variables.
6033 'make_global_settings': [
6034 ['CC', '<!(which mipsel-linux-gnu-gcc)'],
6035 ['CXX', '<!(which mipsel-linux-gnu-g++)'],
6036 ['CC.host', '<(host_cc)'],
6037 ['CXX.host', '<(host_cxx)'],
6040 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
6041 # Set default ARM cross tools on linux. These can be overridden
6042 # using CC,CXX,CC.host and CXX.host environment variables.
6043 'make_global_settings': [
6044 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
6045 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
6046 ['CC.host', '<(host_cc)'],
6047 ['CXX.host', '<(host_cxx)'],
6050 # TODO(yyanagisawa): supports GENERATOR==make
6051 # make generator doesn't support CC_wrapper without CC
6052 # in make_global_settings yet.
6053 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
6054 'make_global_settings': [
6055 ['CC_wrapper', '<(gomadir)/gomacc'],
6056 ['CXX_wrapper', '<(gomadir)/gomacc'],
6057 ['CC.host_wrapper', '<(gomadir)/gomacc'],
6058 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
6062 'target_defaults': {
6063 'target_conditions': [
6064 ['_toolset=="target"', {
6072 # Work-around for http://openradar.appspot.com/20356002
6073 ['_toolset=="target" and _type!="static_library"', {
6083 ['use_lto==1 and clang==0', {
6084 'target_defaults': {
6085 'target_conditions': [
6086 ['_toolset=="target"', {
6088 '-ffat-lto-objects',
6094 ['use_lto==1 and clang==1', {
6095 'target_defaults': {
6096 'target_conditions': [
6097 ['_toolset=="target"', {
6099 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
6105 # Apply a lower LTO optimization level in non-official builds.
6106 ['use_lto==1 and clang==1 and buildtype!="Official"', {
6107 'target_defaults': {
6108 'target_conditions': [
6109 ['_toolset=="target"', {
6111 '-Wl,--plugin-opt,O1',
6114 ['_toolset=="target" and _type!="static_library"', {
6124 ['use_lto==1 and clang==1 and target_arch=="arm"', {
6125 'target_defaults': {
6126 'target_conditions': [
6127 ['_toolset=="target"', {
6128 # Without this flag, LTO produces a .text section that is larger
6129 # than the maximum call displacement, preventing the linker from
6130 # relocating calls (http://llvm.org/PR22999).
6132 '-Wl,-plugin-opt,-function-sections',
6138 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
6139 'target_defaults': {
6140 'target_conditions': [
6141 ['_toolset=="target"', {
6149 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
6150 'target_defaults': {
6151 'target_conditions': [
6152 ['_toolset=="target"', {
6161 'target_defaults': {
6162 'target_conditions': [
6163 ['_toolset=="target"', {
6165 '-fno-sanitize-trap=cfi',
6166 '-fsanitize-recover=cfi',
6175 '-fno-sanitize-trap=cfi',
6176 '-fsanitize-recover=cfi',
6180 '-fno-sanitize-trap=cfi',
6181 '-fsanitize-recover=cfi',
6185 'VCCLCompilerTool': {
6186 'AdditionalOptions': [
6187 '-fno-sanitize-trap=cfi',
6188 '-fsanitize-recover=cfi',
6193 ['_toolset=="target" and _type!="static_library"', {
6196 '-fno-sanitize-trap=cfi',
6197 '-fsanitize-recover=cfi',
6204 ['cfi_vptr==1 and cfi_diag==0', {
6205 'target_defaults': {
6206 'target_conditions': [
6207 ['_toolset=="target"', {
6216 'target_defaults': {
6217 'target_conditions': [
6218 ['_toolset=="target"', {
6220 '-fsanitize=cfi-vcall',
6221 '-fsanitize=cfi-derived-cast',
6222 '-fsanitize=cfi-unrelated-cast',
6223 '-fsanitize-blacklist=<(cfi_blacklist)',
6226 '-fsanitize=cfi-vcall',
6227 '-fsanitize=cfi-derived-cast',
6228 '-fsanitize=cfi-unrelated-cast',
6232 '-fsanitize=cfi-vcall',
6233 '-fsanitize=cfi-derived-cast',
6234 '-fsanitize=cfi-unrelated-cast',
6235 '-fsanitize-blacklist=<(cfi_blacklist)',
6239 'VCCLCompilerTool': {
6240 'AdditionalOptions': [
6241 '-fsanitize=cfi-vcall',
6242 '-fsanitize=cfi-derived-cast',
6243 '-fsanitize=cfi-unrelated-cast',
6244 '-fsanitize-blacklist=<(cfi_blacklist)',
6249 ['_toolset=="target" and _type!="static_library"', {
6252 '-fsanitize=cfi-vcall',
6253 '-fsanitize=cfi-derived-cast',
6254 '-fsanitize=cfi-unrelated-cast',
6263 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
6264 # This block adds *project-wide* configuration settings to each project
6265 # file. It's almost always wrong to put things here. Specify your
6266 # custom xcode_settings in target_defaults to add them to targets instead.
6269 # In an Xcode Project Info window, the "Base SDK for All Configurations"
6270 # setting sets the SDK on a project-wide basis. In order to get the
6271 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
6272 # here at the project level.
6275 ['mac_sdk_path==""', {
6276 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
6278 'SDKROOT': '<(mac_sdk_path)', # -isysroot
6284 ['ios_sdk_path==""', {
6286 # TODO(justincohen): Ninja only supports simulator for now.
6287 ['"<(GENERATOR)"=="xcode"', {
6288 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6290 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
6294 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6299 # Target both iPhone and iPad.
6300 'TARGETED_DEVICE_FAMILY': '1,2',
6303 ['target_arch=="x64"', {
6308 ['target_arch=="ia32"', {
6317 # The Xcode generator will look for an xcode_settings section at the root
6318 # of each dict and use it to apply settings on a file-wide basis. Most
6319 # settings should not be here, they should be in target-specific
6320 # xcode_settings sections, or better yet, should use non-Xcode-specific
6321 # settings in target dicts. SYMROOT is a special case, because many other
6322 # Xcode variables depend on it, including variables such as
6323 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6324 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6325 # files to appear (when present) in the UI as actual files and not red
6326 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6327 # and therefore SYMROOT, needs to be set at the project level.
6328 'SYMROOT': '<(DEPTH)/xcodebuild',