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 # ChromeOS and Windows use Aura and Ash.
108 ['chromeos==1 or 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, Chrome OS, Windows and Linux.
229 ['OS=="mac" or chromeos==1 or OS=="win" or OS=="linux"', {
233 # Enable Top Chrome Material Design on Chrome OS, and Windows.
234 ['chromeos==1 or OS=="win"', {
235 'enable_topchrome_md%': 1,
238 # Enable the OpenSSL backend on Mac OS and Windows.
239 ['OS=="mac" or OS=="win"', {
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)/chrome/installer/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)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
301 ['target_arch=="ia32"', {
302 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/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)/mipsel-sysroot/sysroot',
313 # Copy conditionally-set variables out one scope.
314 'chromeos%': '<(chromeos)',
315 'chromecast%': '<(chromecast)',
316 'host_arch%': '<(host_arch)',
317 'target_arch%': '<(target_arch)',
318 'target_subarch%': '<(target_subarch)',
319 'mips_arch_variant%': '<(mips_arch_variant)',
320 'mips_dsp_rev%': '<(mips_dsp_rev)',
321 'toolkit_views%': '<(toolkit_views)',
322 'desktop_linux%': '<(desktop_linux)',
323 'use_aura%': '<(use_aura)',
324 'use_ash%': '<(use_ash)',
325 'use_cras%': '<(use_cras)',
326 'use_libpci%': '<(use_libpci)',
327 'use_ozone%': '<(use_ozone)',
328 'use_ozone_evdev%': '<(use_ozone_evdev)',
329 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
330 'embedded%': '<(embedded)',
331 'use_openssl%': '<(use_openssl)',
332 'use_openssl_certs%': '<(use_openssl_certs)',
333 'enable_viewport%': '<(enable_viewport)',
334 'enable_hidpi%': '<(enable_hidpi)',
335 'enable_topchrome_md%': '<(enable_topchrome_md)',
336 'android_channel%': '<(android_channel)',
337 'use_goma%': '<(use_goma)',
338 'gomadir%': '<(gomadir)',
339 'enable_app_list%': '<(enable_app_list)',
340 'use_default_render_theme%': '<(use_default_render_theme)',
341 'buildtype%': '<(buildtype)',
342 'branding%': '<(branding)',
343 'branding_path_component%': '<(branding_path_component)',
344 'arm_version%': '<(arm_version)',
345 'sysroot%': '<(sysroot)',
346 'chroot_cmd%': '<(chroot_cmd)',
347 'system_libdir%': '<(system_libdir)',
349 # Set to 1 to enable fast builds. Set to 2 for even faster builds
350 # (it disables debug info for fastest compilation - only for use
351 # on compile-only bots).
354 # Set to 1 to not store any build metadata, e.g. ifdef out all __DATE__
355 # and __TIME__. Set to 0 to reenable the use of these macros in the code
356 # base. See http://crbug.com/314403.
357 'dont_embed_build_metadata%': 1,
359 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
360 # This is useful for parallel compilation tools which can't support /Zi.
361 # Only used on Windows.
364 # Set to 1 to enable dcheck in Release build.
365 'dcheck_always_on%': 0,
367 # Set to 1 to make a build that disables unshipped tracing events.
368 # Note: this setting is ignored if buildtype=="Official".
369 'tracing_like_official_build%': 0,
371 # Disable image loader component extension by default.
372 'image_loader_extension%': 0,
374 # Set NEON compilation flags.
377 # Detect NEON support at run-time.
378 'arm_neon_optional%': 0,
380 # Use libjpeg-turbo as the JPEG codec used by Chromium.
381 'use_libjpeg_turbo%': 1,
383 # Use system libjpeg. Note that the system's libjepg will be used even if
384 # use_libjpeg_turbo is set.
385 'use_system_libjpeg%': 0,
387 # By default, component is set to static_library and it can be overriden
388 # by the GYP command line or by ~/.gyp/include.gypi.
389 'component%': 'static_library',
391 # /analyze is off by default on Windows because it is very slow and noisy.
392 # Enable with GYP_DEFINES=win_analyze=1
395 # Set to select the Title Case versions of strings in GRD files.
396 'use_titlecase_in_grd%': 0,
398 # Use translations provided by volunteers at launchpad.net. This
399 # currently only works on Linux.
400 'use_third_party_translations%': 0,
402 # Remoting compilation is enabled by default. Set to 0 to disable.
405 # Configuration policy is enabled by default. Set to 0 to disable.
406 'configuration_policy%': 1,
408 # Variable safe_browsing is used to control the build time configuration
409 # for safe browsing feature. Safe browsing can be compiled in 4 different
410 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
411 # reporting features for use with Data Saver on Mobile, and 3 enables
412 # extended mobile protection via an external API. When 3 is fully
413 # deployed, it will replace 2.
416 # Web speech is enabled by default. Set to 0 to disable.
417 'enable_web_speech%': 1,
419 # 'Ok Google' hotwording is enabled by default. Set to 0 to disable.
420 'enable_hotwording%': 1,
422 # Notifications are compiled in by default. Set to 0 to disable.
423 'notifications%' : 1,
425 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
426 # regular builds and 1 for ASan builds.
427 'mac_want_real_dsym%': 'default',
429 # If this is set, the clang plugins used on the buildbot will be used.
430 # Run tools/clang/scripts/update.sh to make sure they are compiled.
431 # This causes 'clang_chrome_plugins_flags' to be set.
432 # Has no effect if 'clang' is not set as well.
433 'clang_use_chrome_plugins%': 1,
435 # Enable building with ASAN (Clang's -fsanitize=address option).
436 # -fsanitize=address only works with clang, but asan=1 implies clang=1
437 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
439 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
440 # Enable coverage gathering instrumentation in sanitizer tools. This flag
441 # also controls coverage granularity (1 for function-level coverage, 2
442 # for block-level coverage).
443 'sanitizer_coverage%': 0,
444 # Deprecated, only works if |sanitizer_coverage| isn't set.
445 # TODO(glider): remove this flag.
447 # Enable intra-object-overflow detection in ASan (experimental).
448 'asan_field_padding%': 0,
450 # Enable Chromium overrides of the default configurations for various
451 # dynamic tools (like ASan).
452 'use_sanitizer_options%': 0,
454 # Enable building with SyzyAsan.
455 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
458 # Enable crash reporting via Kasko.
461 # Enable building with LSan (Clang's -fsanitize=leak option).
462 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
463 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
466 # Enable building with TSan (Clang's -fsanitize=thread option).
467 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
468 # See http://clang.llvm.org/docs/ThreadSanitizer.html
470 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
472 # Enable building with MSan (Clang's -fsanitize=memory option).
473 # MemorySanitizer only works with clang, but msan=1 implies clang=1
474 # See http://clang.llvm.org/docs/MemorySanitizer.html
476 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
477 # Track where uninitialized memory originates from. From fastest to
478 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
479 # - track the chain of stores leading from allocation site to use site.
480 'msan_track_origins%': 2,
482 # Enable building with UBSan (Clang's -fsanitize=undefined option).
483 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
484 # See http://clang.llvm.org/docs/UsersManual.html
486 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
487 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/vptr_blacklist.txt',
489 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
490 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
493 # Use dynamic libraries instrumented by one of the sanitizers
494 # instead of the standard system libraries. Set this flag to build the
495 # libraries from source.
496 'use_instrumented_libraries%': 0,
498 # Use dynamic libraries instrumented by one of the sanitizers
499 # instead of the standard system libraries. Set this flag to download
500 # prebuilt binaries from GCS.
501 'use_prebuilt_instrumented_libraries%': 0,
503 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
504 # stdlibc++ as standard library. This is intended to use for instrumented
506 'use_custom_libcxx%': 0,
508 # Use system libc++ instead of the default C++ library, usually libstdc++.
509 # This is intended for iOS builds only.
510 'use_system_libcxx%': 0,
512 # Use a modified version of Clang to intercept allocated types and sizes
513 # for allocated objects. clang_type_profiler=1 implies clang=1.
514 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
515 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
516 'clang_type_profiler%': 0,
518 # Set to true to instrument the code with function call logger.
519 # See src/third_party/cygprofile/cyg-profile.cc for details.
520 'order_profiling%': 0,
522 # Use the provided profiled order file to link Chrome image with it.
523 # This makes Chrome faster by better using CPU cache when executing code.
524 # This is known as PGO (profile guided optimization).
525 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
526 'order_text_section%' : "",
528 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
529 # libraries on linux x86-64 and arm, plus ASLR.
532 # Whether one-click signin is enabled or not.
533 'enable_one_click_signin%': 0,
535 # Whether to back up data before sync.
536 'enable_pre_sync_backup%': 0,
538 # Enable Chrome browser extensions
539 'enable_extensions%': 1,
542 'enable_google_now%': 1,
544 # Enable basic printing support and UI.
545 'enable_basic_printing%': 1,
547 # Enable printing with print preview. It does not imply
548 # enable_basic_printing. It's possible to build Chrome with preview only.
549 'enable_print_preview%': 1,
551 # Set the version of CLD.
552 # 0: Don't specify the version. This option is for the Finch testing.
557 # For CLD2, the size of the tables that should be included in the build
558 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
560 # See third_party/cld_2/cld_2.gyp for more information.
561 # 0: Small tables, lower accuracy
562 # 2: Large tables, high accuracy
563 'cld2_table_size%': 2,
565 # Enable spell checker.
566 'enable_spellcheck%': 1,
568 # Webrtc compilation is enabled by default. Set to 0 to disable.
571 # Media router support is enabled by default. Set to 0 to disable.
572 'enable_media_router%': 1,
574 # Enables use of the session service, which is enabled by default.
575 # Support for disabling depends on the platform.
576 'enable_session_service%': 1,
578 # Enables theme support, which is enabled by default. Support for
579 # disabling depends on the platform.
582 # Enables autofill dialog and associated features; disabled by default.
583 'enable_autofill_dialog%' : 0,
585 # Defaults Wallet integration in Autofill dialog to use production
586 # servers. Unofficial builds won't have the proper API keys.
587 'enable_prod_wallet_service%': 0,
589 # Enables support for background apps.
590 'enable_background%': 1,
592 # Enable the task manager by default.
593 'enable_task_manager%': 1,
595 # Enables used resource whitelist generation; disabled by default.
596 'enable_resource_whitelist_generation%': 0,
598 # Enable FILE support by default.
599 'disable_file_support%': 0,
601 # Enable FTP support by default.
602 'disable_ftp_support%': 0,
604 # Use native android functions in place of ICU. Not supported by most
606 'use_icu_alternatives_on_android%': 0,
608 # Use of precompiled headers on Windows.
610 # This variable may be explicitly set to 1 (enabled) or 0
611 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
612 # This setting will override the default.
615 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
617 'chromium_win_pch%': 0,
620 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
621 # Set this to true when building with Clang.
622 # See http://code.google.com/p/chromium/wiki/Clang for details.
623 # If this is set, clang is used as both host and target compiler in
624 # cross-compile builds.
627 # Use experimental lld linker instead of the platform's default linker.
630 # Enable plugin installation by default.
631 'enable_plugin_installation%': 1,
633 # Specifies whether to use canvas_skia.cc in place of platform
634 # specific implementations of gfx::Canvas. Affects text drawing in the
636 # TODO(asvitkine): Enable this on all platforms and delete this flag.
637 # http://crbug.com/105550
638 'use_canvas_skia%': 0,
640 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
641 # with one of those tools.
642 'build_for_tool%': '',
644 'wix_path%': '<(DEPTH)/third_party/wix',
646 # Supervised users are enabled by default.
647 'enable_supervised_users%': 1,
649 # Platform sends memory pressure signals natively.
650 'native_memory_pressure_signals%': 0,
653 'enable_service_discovery%': 0,
654 'enable_wifi_bootstrapping%': 0,
655 'enable_hangout_services_extension%': 0,
657 # Enable the Syzygy optimization step.
658 'syzygy_optimize%': 0,
660 # Enable hole punching for the protected video.
663 # Automatically select platforms under ozone. Turn this off to
664 # build only explicitly selected platforms.
665 'ozone_auto_platforms%': 1,
667 # If this is set clang is used as host compiler, but not as target
668 # compiler. Always do this by default.
671 # Variables to control Link-Time Optimization (LTO).
672 # On Android, the variable use_lto enables LTO on code compiled with -Os,
673 # and use_lto_o2 enables LTO on code compiled with -O2. On other
674 # platforms, use_lto enables LTO in all translation units, and use_lto_o2
677 # On Linux and Android, when using LLVM LTO, the script
678 # build/download_gold_plugin.py must be run to download a linker plugin.
679 # On Mac, LLVM needs to be built from scratch using
680 # tools/clang/scripts/update.py and the absolute path to
681 # third_party/llvm-build/Release+Asserts/lib must be added to
682 # $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin.
684 # On Android, the variables must *not* be enabled at the same time.
685 # In this case LTO would 'merge' the optimization flags at link-time
686 # which would lead to all code be optimized with -O2. See crbug.com/407544
690 # Libxkbcommon usage.
693 # Control Flow Integrity for virtual calls and casts.
694 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
697 'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
699 # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
700 'mac_views_browser%': 0,
702 # By default, use ICU data file (icudtl.dat).
703 'icu_use_data_file_flag%': 1,
705 # Turn on JNI generation optimizations by default.
706 'optimize_jni_generation%': 1,
709 # A flag for POSIX platforms
716 # A flag for BSD platforms
717 ['OS=="freebsd" or OS=="openbsd"', {
724 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris")', {
730 # libudev usage. This currently only affects the content layer.
731 ['OS=="linux" and embedded==0', {
737 # Flags to use X11 on non-Mac POSIX platforms.
738 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
745 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
751 # Flags to use pango and cairo.
752 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
761 ['OS=="linux" and embedded==0', {
767 # We always use skia text rendering in Aura on Windows, since GDI
768 # doesn't agree with our BackingStore.
769 # TODO(beng): remove once skia text rendering is on by default.
770 ['use_aura==1 and OS=="win"', {
771 'enable_skia_text%': 1,
774 # A flag to enable or disable our compile-time dependency
775 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
776 # support will be available. This option is useful
777 # for Linux distributions and for Aura.
778 ['OS!="linux" or chromeos==1', {
779 'use_gnome_keyring%': 0,
781 'use_gnome_keyring%': 1,
784 ['OS=="mac" or OS=="ios"', {
785 # Mac and iOS want Title Case strings
786 'use_titlecase_in_grd%': 1,
789 # Enable loader extensions on Chrome OS.
791 'image_loader_extension%': 1,
793 'image_loader_extension%': 0,
796 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
797 'enable_one_click_signin%': 1,
798 'enable_pre_sync_backup%': 1,
802 'enable_extensions%': 0,
803 'enable_google_now%': 0,
805 'enable_spellcheck%': 0,
809 'arm_neon_optional%': 1,
810 'native_memory_pressure_signals%': 1,
811 'enable_basic_printing%': 1,
812 'enable_print_preview%': 0,
813 'enable_task_manager%':0,
817 # Android OS includes support for proprietary codecs regardless of
818 # building Chromium or Google Chrome. We also ship Google Chrome and
819 # Chromecast with proprietary codecs.
820 ['OS=="android" or branding=="Chrome" or chromecast==1', {
821 'proprietary_codecs%': 1,
823 'proprietary_codecs%': 0,
826 ['OS=="mac" or OS=="ios"', {
827 'native_memory_pressure_signals%': 1,
830 # Enable autofill dialog when not on iOS.
832 'enable_autofill_dialog%': 1,
835 ['buildtype=="Official"', {
836 'enable_prod_wallet_service%': 1,
844 'disable_ftp_support%': 1,
845 'enable_extensions%': 0,
846 'enable_google_now%': 0,
848 'cld2_table_size%': 0,
849 'enable_basic_printing%': 0,
850 'enable_print_preview%': 0,
851 'enable_session_service%': 0,
852 'enable_spellcheck%': 0,
858 'enable_supervised_users%': 0,
859 'enable_task_manager%': 0,
860 'use_system_libcxx%': 1,
863 # Use GPU accelerated cross process image transport by default
864 # on linux builds with the Aura window manager
865 ['use_aura==1 and OS=="linux"', {
866 'ui_compositor_image_transport%': 1,
868 'ui_compositor_image_transport%': 0,
871 # Turn precompiled headers on by default.
872 ['OS=="win" and buildtype!="Official"', {
873 'chromium_win_pch%': 1
876 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
877 'enable_plugin_installation%': 0,
879 'enable_plugin_installation%': 1,
882 # Whether PPAPI is enabled.
883 ['OS=="android" or OS=="ios" or embedded==1', {
884 'enable_plugins%': 0,
886 'enable_plugins%': 1,
889 # linux_use_bundled_gold: whether to use the gold linker binary checked
890 # into third_party/binutils. Force this off via GYP_DEFINES when you
891 # are using a custom toolchain and need to control -B in ldflags.
892 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
893 # for component=static_library builds.
894 ['(OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm")', {
895 'linux_use_bundled_gold%': 1,
897 'linux_use_bundled_gold%': 0,
900 # linux_use_bundled_binutils: whether to use the binary binutils
901 # checked into third_party/binutils. These are not multi-arch so cannot
902 # be used except on x86 and x86-64 (the only two architectures which
903 # are currently checke in). Force this off via GYP_DEFINES when you
904 # are using a custom toolchain and need to control -B in cflags.
905 ['OS=="linux" and (target_arch=="x64")', {
906 'linux_use_bundled_binutils%': 1,
908 'linux_use_bundled_binutils%': 0,
911 # linux_use_gold_flags: whether to use build flags that rely on gold.
912 # On by default for x64 Linux.
913 ['OS=="linux" and target_arch=="x64"', {
914 'linux_use_gold_flags%': 1,
916 'linux_use_gold_flags%': 0,
919 # linux_use_debug_fission: whether to use split DWARF debug info
920 # files. This can reduce link time significantly, but is incompatible
921 # with some utilities such as icecc and ccache. Requires gold and
922 # gcc >= 4.8 or clang.
923 # http://gcc.gnu.org/wiki/DebugFission
924 ['OS=="linux" and target_arch=="x64"', {
925 'linux_use_debug_fission%': 1,
927 'linux_use_debug_fission%': 0,
930 ['OS=="android" or OS=="ios"', {
931 'enable_captive_portal_detection%': 0,
932 'enable_media_router%': 0,
934 'enable_captive_portal_detection%': 1,
935 'enable_media_router%': 1,
938 # Enable Skia UI text drawing incrementally on different platforms.
939 # http://crbug.com/105550
941 # On Aura, this allows per-tile painting to be used in the browser
943 ['OS!="android" and OS!="ios"', {
944 'use_canvas_skia%': 1,
948 'enable_basic_printing%': 0,
949 'enable_print_preview%': 1,
952 # Do not enable the Settings App on ChromeOS.
953 ['enable_app_list==1 and chromeos==0', {
954 'enable_settings_app%': 1,
956 'enable_settings_app%': 0,
959 # Whether tests targets should be run, archived or just have the
960 # dependencies verified. All the tests targets have the '_run' suffix,
961 # e.g. base_unittests_run runs the target base_unittests. The test
962 # target always calls tools/swarming_client/isolate.py. See the script's
963 # --help for more information. Meant to be overriden with GYP_DEFINES.
964 # TODO(maruel): Remove the conditions as more configurations are
966 ['OS!="ios" and OS!="android" and chromeos==0', {
967 'test_isolation_mode%': 'check',
969 'test_isolation_mode%': 'noop',
971 # Whether Android build uses OpenMAX DL FFT.
972 ['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")', {
973 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
974 # When enabled, this will also enable WebAudio support on
975 # Android for these architectures. Default is enabled. Whether
976 # WebAudio is actually available depends on runtime settings
978 'use_openmax_dl_fft%': 1,
980 'use_openmax_dl_fft%': 0,
982 ['OS=="win" or OS=="linux"', {
986 # Turns on compiler optimizations in V8 in Debug build, except
987 # on android_clang, where we're hitting a weird linker error.
988 # TODO(dpranke): http://crbug.com/266155 .
990 'v8_optimized_debug%': 1,
992 'v8_optimized_debug%': 2,
995 # Disable various features by default on embedded.
998 'enable_basic_printing%': 0,
999 'enable_print_preview%': 0,
1002 ['OS=="win" or OS=="mac"', {
1003 'enable_wifi_bootstrapping%' : 1,
1006 # Path to sas.dll, which provides the SendSAS function.
1007 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1008 ['target_arch=="x64"', {
1009 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1011 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1015 'pkg-config': '<(chroot_cmd) <(DEPTH)/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
1017 'pkg-config': 'pkg-config'
1020 # Enable WebVR support by default on Android
1021 # Still requires command line flag to access API
1029 # Setting this to '0' will cause V8's startup snapshot to be
1030 # embedded in the binary instead of being a external files.
1031 'v8_use_external_startup_data%': 1,
1033 # Set this to 1 to enable use of concatenated impulse responses
1034 # for the HRTF panner in WebAudio.
1035 'use_concatenated_impulse_responses': 1,
1037 # You can set the variable 'use_official_google_api_keys' to 1
1038 # to use the Google-internal file containing official API keys
1039 # for Google Chrome even in a developer build. Setting this
1040 # variable explicitly to 1 will cause your build to fail if the
1041 # internal file is missing.
1043 # The variable is documented here, but not handled in this file;
1044 # see //google_apis/determine_use_official_keys.gypi for the
1047 # Set the variable to 0 to not use the internal file, even when
1048 # it exists in your checkout.
1050 # Leave it unset in your include.gypi to have the variable
1051 # implicitly set to 1 if you have
1052 # src/google_apis/internal/google_chrome_api_keys.h in your
1053 # checkout, and implicitly set to 0 if not.
1055 # Note that official builds always behave as if the variable
1056 # was explicitly set to 1, i.e. they always use official keys,
1057 # and will fail to build if the internal file is missing.
1059 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1060 # include.gypi or by other means. Due to subtleties of GYP, this
1061 # is not the same as leaving the variable unset, even though its
1063 # //google_apis/determine_use_official_keys.gypi is 2.
1065 # Set these to bake the specified API keys and OAuth client
1066 # IDs/secrets into your build.
1068 # If you create a build without values baked in, you can instead
1069 # set environment variables to provide the keys at runtime (see
1070 # src/google_apis/google_api_keys.h for details). Features that
1071 # require server-side APIs may fail to work if no keys are
1074 # Note that if you are building an official build or if
1075 # use_official_google_api_keys has been set to 1 (explicitly or
1076 # implicitly), these values will be ignored and the official
1077 # keys will be used instead.
1078 'google_api_key%': '',
1079 'google_default_client_id%': '',
1080 'google_default_client_secret%': '',
1081 # Native Client is enabled by default.
1082 'disable_nacl%': '0',
1084 # Sets the default version name and code for Android app, by default we
1085 # do a developer build.
1086 'android_app_version_name%': 'Developer Build',
1087 'android_app_version_code%': 1,
1090 # Copy conditionally-set variables out one scope.
1091 'branding%': '<(branding)',
1092 'branding_path_component%': '<(branding_path_component)',
1093 'buildtype%': '<(buildtype)',
1094 'target_arch%': '<(target_arch)',
1095 'target_subarch%': '<(target_subarch)',
1096 'mips_arch_variant%': '<(mips_arch_variant)',
1097 'mips_dsp_rev%': '<(mips_dsp_rev)',
1098 'host_arch%': '<(host_arch)',
1099 'toolkit_views%': '<(toolkit_views)',
1100 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1101 'use_aura%': '<(use_aura)',
1102 'use_ash%': '<(use_ash)',
1103 'use_cras%': '<(use_cras)',
1104 'use_libpci%': '<(use_libpci)',
1105 'use_openssl%': '<(use_openssl)',
1106 'use_openssl_certs%': '<(use_openssl_certs)',
1107 'use_nss_certs%': '<(use_nss_certs)',
1108 'use_udev%': '<(use_udev)',
1109 'os_bsd%': '<(os_bsd)',
1110 'os_posix%': '<(os_posix)',
1111 'use_dbus%': '<(use_dbus)',
1112 'use_glib%': '<(use_glib)',
1113 'use_pango%': '<(use_pango)',
1114 'use_cairo%': '<(use_cairo)',
1115 'use_ozone%': '<(use_ozone)',
1116 'use_ozone_evdev%': '<(use_ozone_evdev)',
1117 'use_xkbcommon%': '<(use_xkbcommon)',
1118 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1119 'desktop_linux%': '<(desktop_linux)',
1120 'use_x11%': '<(use_x11)',
1121 'use_gnome_keyring%': '<(use_gnome_keyring)',
1122 'linux_fpic%': '<(linux_fpic)',
1123 'chromeos%': '<(chromeos)',
1124 'chromecast%': '<(chromecast)',
1125 'enable_viewport%': '<(enable_viewport)',
1126 'enable_hidpi%': '<(enable_hidpi)',
1127 'enable_topchrome_md%': '<(enable_topchrome_md)',
1128 'image_loader_extension%': '<(image_loader_extension)',
1129 'fastbuild%': '<(fastbuild)',
1130 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1131 'win_z7%': '<(win_z7)',
1132 'dcheck_always_on%': '<(dcheck_always_on)',
1133 'tracing_like_official_build%': '<(tracing_like_official_build)',
1134 'arm_version%': '<(arm_version)',
1135 'arm_neon%': '<(arm_neon)',
1136 'arm_neon_optional%': '<(arm_neon_optional)',
1137 'sysroot%': '<(sysroot)',
1138 'pkg-config%': '<(pkg-config)',
1139 'chroot_cmd%': '<(chroot_cmd)',
1140 'system_libdir%': '<(system_libdir)',
1141 'component%': '<(component)',
1142 'win_analyze%': '<(win_analyze)',
1143 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1144 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1145 'use_third_party_translations%': '<(use_third_party_translations)',
1146 'remoting%': '<(remoting)',
1147 'enable_one_click_signin%': '<(enable_one_click_signin)',
1148 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1149 'enable_media_router%': '<(enable_media_router)',
1150 'enable_webrtc%': '<(enable_webrtc)',
1151 'chromium_win_pch%': '<(chromium_win_pch)',
1152 'configuration_policy%': '<(configuration_policy)',
1153 'safe_browsing%': '<(safe_browsing)',
1154 'enable_web_speech%': '<(enable_web_speech)',
1155 'enable_hotwording%': '<(enable_hotwording)',
1156 'notifications%': '<(notifications)',
1157 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1158 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1160 'asan_blacklist%': '<(asan_blacklist)',
1161 'asan_coverage%': '<(asan_coverage)',
1162 'sanitizer_coverage%': '<(sanitizer_coverage)',
1163 'asan_field_padding%': '<(asan_field_padding)',
1164 'use_sanitizer_options%': '<(use_sanitizer_options)',
1165 'syzyasan%': '<(syzyasan)',
1166 'kasko%': '<(kasko)',
1167 'syzygy_optimize%': '<(syzygy_optimize)',
1170 'msan_blacklist%': '<(msan_blacklist)',
1171 'msan_track_origins%': '<(msan_track_origins)',
1173 'tsan_blacklist%': '<(tsan_blacklist)',
1174 'ubsan%': '<(ubsan)',
1175 'ubsan_blacklist%': '<(ubsan_blacklist)',
1176 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1177 'ubsan_vptr%': '<(ubsan_vptr)',
1178 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1179 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
1180 'use_custom_libcxx%': '<(use_custom_libcxx)',
1181 'use_system_libcxx%': '<(use_system_libcxx)',
1182 'clang_type_profiler%': '<(clang_type_profiler)',
1183 'order_profiling%': '<(order_profiling)',
1184 'order_text_section%': '<(order_text_section)',
1185 'enable_extensions%': '<(enable_extensions)',
1186 'enable_plugin_installation%': '<(enable_plugin_installation)',
1187 'enable_plugins%': '<(enable_plugins)',
1188 'enable_session_service%': '<(enable_session_service)',
1189 'enable_themes%': '<(enable_themes)',
1190 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1191 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1192 'enable_background%': '<(enable_background)',
1193 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1194 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1195 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1196 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1197 'use_canvas_skia%': '<(use_canvas_skia)',
1198 'test_isolation_mode%': '<(test_isolation_mode)',
1199 'enable_basic_printing%': '<(enable_basic_printing)',
1200 'enable_print_preview%': '<(enable_print_preview)',
1201 'enable_spellcheck%': '<(enable_spellcheck)',
1202 'enable_google_now%': '<(enable_google_now)',
1203 'cld_version%': '<(cld_version)',
1204 'cld2_table_size%': '<(cld2_table_size)',
1205 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1206 'disable_file_support%': '<(disable_file_support)',
1207 'disable_ftp_support%': '<(disable_ftp_support)',
1208 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1209 'enable_task_manager%': '<(enable_task_manager)',
1210 'sas_dll_path%': '<(sas_dll_path)',
1211 'wix_path%': '<(wix_path)',
1212 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1213 'use_system_libjpeg%': '<(use_system_libjpeg)',
1214 'android_channel%': '<(android_channel)',
1215 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1216 'gyp_managed_install%': 0,
1217 'create_standalone_apk%': 1,
1218 'enable_app_list%': '<(enable_app_list)',
1219 'use_default_render_theme%': '<(use_default_render_theme)',
1220 'enable_settings_app%': '<(enable_settings_app)',
1221 'google_api_key%': '<(google_api_key)',
1222 'google_default_client_id%': '<(google_default_client_id)',
1223 'google_default_client_secret%': '<(google_default_client_secret)',
1224 'enable_supervised_users%': '<(enable_supervised_users)',
1225 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1226 'enable_mdns%' : '<(enable_mdns)',
1227 'enable_service_discovery%' : '<(enable_service_discovery)',
1228 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1229 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1230 'v8_optimized_debug%': '<(v8_optimized_debug)',
1231 'proprietary_codecs%': '<(proprietary_codecs)',
1232 'use_goma%': '<(use_goma)',
1233 'gomadir%': '<(gomadir)',
1234 'use_lto%': '<(use_lto)',
1235 'use_lto_o2%': '<(use_lto_o2)',
1236 'video_hole%': '<(video_hole)',
1237 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1238 'cfi_vptr%': '<(cfi_vptr)',
1239 'cfi_blacklist%': '<(cfi_blacklist)',
1240 'mac_views_browser%': '<(mac_views_browser)',
1241 'android_app_version_name%': '<(android_app_version_name)',
1242 'android_app_version_code%': '<(android_app_version_code)',
1243 'enable_webvr%': '<(enable_webvr)',
1245 # Use system protobuf instead of bundled one.
1246 'use_system_protobuf%': 0,
1248 # Use system yasm instead of bundled one.
1249 'use_system_yasm%': 0,
1251 # Use system ICU instead of bundled one.
1252 'use_system_icu%' : 0,
1254 # Default to enabled PIE; this is important for ASLR but we may need to be
1255 # able to turn it off for various reasons.
1256 'linux_disable_pie%': 0,
1258 # The release channel that this build targets. This is used to restrict
1259 # channel-specific build options, like which installer packages to create.
1260 # The default is 'all', which does no channel-specific filtering.
1263 # Override chromium_mac_pch and set it to 0 to suppress the use of
1264 # precompiled headers on the Mac. Prefix header injection may still be
1265 # used, but prefix headers will not be precompiled. This is useful when
1266 # using distcc to distribute a build to compile slaves that don't
1267 # share the same compiler executable as the system driving the compilation,
1268 # because precompiled headers rely on pointers into a specific compiler
1269 # executable's image. Setting this to 0 is needed to use an experimental
1270 # Linux-Mac cross compiler distcc farm.
1271 'chromium_mac_pch%': 1,
1273 # The default value for mac_strip in target_defaults. This cannot be
1274 # set there, per the comment about variable% in a target_defaults.
1275 'mac_strip_release%': 0,
1277 # Set to 1 to enable java code coverage. Instruments classes during build
1278 # to produce .ec files during runtime.
1279 'emma_coverage%': 0,
1281 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1282 # separated with whitespace and/or comma. Only has effect if
1283 # 'emma_coverage=1'.
1286 # Set to 1 to enable running Android lint on java/class files.
1289 # Although base/allocator lets you select a heap library via an
1290 # environment variable, the libcmt shim it uses sometimes gets in
1291 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1292 # 'win_use_allocator_shim': 0,
1293 # 'win_release_RuntimeLibrary': 2
1294 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1295 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1297 # TODO(bradnelson): eliminate this when possible.
1298 # To allow local gyp files to prevent release.vsprops from being included.
1299 # Yes(1) means include release.vsprops.
1300 # Once all vsprops settings are migrated into gyp, this can go away.
1301 'msvs_use_common_release%': 1,
1303 # TODO(bradnelson): eliminate this when possible.
1304 # To allow local gyp files to override additional linker options for msvs.
1305 # Yes(1) means set use the common linker options.
1306 'msvs_use_common_linker_extras%': 1,
1308 # TODO(sgk): eliminate this if possible.
1309 # It would be nicer to support this via a setting in 'target_defaults'
1310 # in chrome/app/locales/locales.gypi overriding the setting in the
1311 # 'Debug' configuration in the 'target_defaults' dict below,
1312 # but that doesn't work as we'd like.
1313 'msvs_debug_link_incremental%': '2',
1315 # Needed for some of the largest modules.
1316 'msvs_debug_link_nonincremental%': '1',
1318 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1319 # to get incremental linking to be faster in debug builds.
1320 'incremental_chrome_dll%': '0',
1322 # Experimental setting to break chrome.dll into multiple pieces based on
1324 'chrome_multiple_dll%': '0',
1326 # Experimental setting to optimize Chrome's DLLs with PGO.
1327 'chrome_pgo_phase%': '0',
1329 # Whether the VS xtree header has been patched to disable warning 4702. If
1330 # it has, then we don't need to disable 4702 (unreachable code warning).
1331 # The patch is preapplied to the internal toolchain and hence all bots.
1332 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1335 'clang%': '<(clang)',
1336 'host_clang%': '<(host_clang)',
1337 'make_clang_dir%': '<(make_clang_dir)',
1338 'use_lld%': '<(use_lld)',
1340 # Control which version of clang to use when building for iOS. If set to
1341 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1342 # the version of clang that ships with the Chromium source. This variable
1343 # is automatically set to '1' in Official builds.
1346 # These two variables can be set in GYP_DEFINES while running
1347 # |gclient runhooks| to let clang run a plugin in every compilation.
1348 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1350 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1353 'clang_add_plugin%': '',
1355 # Tell ld64 to write map files describing binary layout. Useful
1356 # for looking at what contributes to binary size, e.g. with
1357 # https://github.com/nico/bloat
1358 'mac_write_linker_maps%': 0,
1360 # The default type of gtest.
1361 'gtest_target_type%': 'executable',
1363 # Enable sampling based profiler.
1364 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1366 # Profile without optimizing out stack frames when profiling==1.
1367 'profiling_full_stack_frames%': '0',
1369 # And if we want to dump symbols for Breakpad-enabled builds.
1370 'linux_dump_symbols%': 0,
1371 # And if we want to strip the binary after dumping symbols.
1372 'linux_strip_binary%': 0,
1373 # If we want stack unwind support for backtrace().
1374 'debug_unwind_tables%': 1,
1375 'release_unwind_tables%': 1,
1377 # Override where to find binutils
1378 'binutils_version%': 0,
1379 'binutils_dir%': '',
1382 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1383 'use_allocator%': 'tcmalloc',
1385 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1386 'linux_link_gnome_keyring%': 0,
1387 # Set to 1 to link against gsettings APIs instead of using dlopen().
1388 'linux_link_gsettings%': 0,
1390 # Enable use of OpenMAX DL FFT routines.
1391 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1393 # Enable new NPDevice API.
1394 'enable_new_npdevice_api%': 0,
1396 # .gyp files or targets should set chromium_code to 1 if they build
1397 # Chromium-specific code, as opposed to external code. This variable is
1398 # used to control such things as the set of warnings to enable, and
1399 # whether warnings are treated as errors.
1400 'chromium_code%': 0,
1402 # Disable fatal linker warnings, similarly to how we make it possible
1403 # to disable -Werror (e.g. for different toolchain versions).
1404 'disable_fatal_linker_warnings%': 0,
1406 'release_valgrind_build%': 0,
1408 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1409 'enable_wexit_time_destructors%': 0,
1411 # Build libpeerconnection as a static library by default.
1412 'libpeer_target_type%': 'static_library',
1414 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1415 'internal_gles2_conform_tests%': 0,
1417 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1418 'internal_khronos_glcts_tests%': 0,
1420 # Set to 1 to compile the filter fuzzer.
1421 'internal_filter_fuzzer%': 0,
1423 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1424 # so Cocoa is happy (http://crbug.com/20441).
1426 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1427 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1428 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1429 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1430 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1431 'vi', 'zh-CN', 'zh-TW',
1434 # Pseudo locales are special locales which are used for testing and
1435 # debugging. They don't get copied to the final app. For more info,
1436 # check out https://www.chromium.org/developers/testing/fake-bidi
1443 # If debug_devtools is set to 1, JavaScript files for DevTools are
1444 # stored as is and loaded from disk. Otherwise, a concatenated file
1445 # is stored in resources.pak. It is still possible to load JS files
1446 # from disk by passing --debug-devtools cmdline switch.
1447 'debug_devtools%': 0,
1449 # The Java Bridge is not compiled in by default.
1452 # Code signing for iOS binaries. The bots need to be able to disable this.
1453 'chromium_ios_signing%': 1,
1455 # This flag is only used when disable_nacl==0 and disables all those
1456 # subcomponents which would require the installation of a native_client
1457 # untrusted toolchain.
1458 'disable_nacl_untrusted%': 0,
1460 # PNaCl toolchain does not support sanitizers. Disable by default.
1461 'enable_nacl_nonsfi_test%': 0,
1463 # Disable Dart by default.
1466 # Copy out the setting of disable_nacl.
1467 'disable_nacl%': '<(disable_nacl)',
1469 # Portable Native Client is enabled by default.
1470 'disable_pnacl%': 0,
1472 # Whether to build full debug version for Debug configuration on Android.
1473 # Compared to full debug version, the default Debug configuration on Android
1474 # has no full v8 debug, has size optimization and linker gc section, so that
1475 # we can build a debug version with acceptable size and performance.
1476 'android_full_debug%': 0,
1478 # Contains data about the attached devices for gyp_managed_install.
1479 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1481 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1482 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1484 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1485 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1487 # Whether we are using the rlz library or not. Platforms like Android send
1488 # rlz codes for searches but do not use the library.
1491 # Turns on the i18n support in V8.
1492 'v8_enable_i18n_support': 1,
1494 # Compile d8 for the host toolset.
1495 'v8_toolset_for_d8': 'host',
1497 # Use brlapi from brltty for braille display support.
1500 # Relative path to icu.gyp from this file.
1501 'icu_gyp_path': '../third_party/icu/icu.gyp',
1503 # IPC fuzzer is disabled by default.
1504 'enable_ipc_fuzzer%': 0,
1506 # Force disable libstdc++ debug mode.
1507 'disable_glibcxx_debug%': 0,
1509 # Set to 1 to compile with MSE support for MPEG2 TS
1510 'enable_mpeg2ts_stream_parser%': 0,
1512 # Support ChromeOS touchpad gestures with ozone.
1513 'use_evdev_gestures%': 0,
1515 # Default ozone platform (if no --ozone-platform flag).
1516 'ozone_platform%': "",
1518 # Ozone platforms to include in the build.
1519 'ozone_platform_caca%': 0,
1520 'ozone_platform_cast%': 0,
1521 'ozone_platform_dri%': 0,
1522 'ozone_platform_drm%': 0,
1523 'ozone_platform_egltest%': 0,
1524 'ozone_platform_gbm%': 0,
1525 'ozone_platform_ozonex%': 0,
1526 'ozone_platform_test%': 0,
1528 # Experiment: http://crbug.com/426914
1531 # Used to set libjpeg_gyp_path. Chrome OS ui/gfx/gfx.gyp uses the IJG path
1532 # for robust login screen decoding.
1533 'libjpeg_ijg_gyp_path': '<(DEPTH)/third_party/libjpeg/libjpeg.gyp',
1534 'libjpeg_turbo_gyp_path': '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp',
1537 ['buildtype=="Official"', {
1538 # Continue to embed build meta data in Official builds, basically the
1539 # time it was built.
1540 # TODO(maruel): This decision should be revisited because having an
1541 # official deterministic build has high value too but MSVC toolset can't
1542 # generate anything deterministic with WPO enabled AFAIK.
1543 'dont_embed_build_metadata%': 0,
1545 # Enable the Syzygy optimization step for the official builds.
1546 ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
1547 'syzygy_optimize%': 1,
1549 'syzygy_optimize%': 0,
1551 # Get binutils version so we can enable debug fission if we can.
1552 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1554 # compiler_version doesn't work with clang
1555 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1556 # compiler_version works with clang.
1557 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1558 # that it takes effect here.
1559 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1560 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1562 # On Android we know the binutils version in the toolchain.
1564 'binutils_version%': 222,
1566 ['host_arch=="x64"', {
1567 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1569 ['host_arch=="ia32"', {
1570 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1572 # Our version of binutils in third_party/binutils
1573 ['linux_use_bundled_binutils==1', {
1574 'binutils_version%': 224,
1578 'binutils_version%': 0,
1580 # The version of GCC in use, set later in platforms that use GCC and have
1581 # not explicitly chosen to build with clang. Currently, this means all
1582 # platforms except Windows, Mac and iOS.
1583 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1584 # it takes effect here.
1585 ['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', {
1588 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1589 # We directly set the gcc version since we know what we use.
1592 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1593 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1597 'host_gcc_version%': 0,
1600 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1601 'directx_sdk_path%': '<(directx_sdk_default_path)',
1603 'directx_sdk_path%': '$(DXSDK_DIR)',
1606 'windows_driver_kit_path%': '$(WDK_DIR)',
1608 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1610 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1613 'nacl_untrusted_build%': 0,
1614 'use_allocator%': 'none',
1616 # Use a 64-bit linker to avoid running out of address space. The
1617 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1618 ['host_arch=="ia32" and target_arch=="ia32"', {
1619 # TODO(thestig) This is a horrible way to force the desired
1620 # configuration. Our gyp variable scoping is likely wrong and
1621 # needs to be cleaned up. The GN configuration should be changed
1623 'binutils_version%': 224,
1624 'linux_use_bundled_binutils%': '1',
1625 'linux_use_bundled_gold%': '1',
1626 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1628 # All Chrome builds have breakpad symbols, but only process the
1629 # symbols from official builds.
1630 ['(branding=="Chrome" and buildtype=="Official")', {
1631 'linux_dump_symbols%': 1,
1633 # Omit unwind support in official release builds to save space. We
1634 # can use breakpad for these builds.
1635 'release_unwind_tables%': 0,
1638 }], # os_posix==1 and OS!="mac" and OS!="ios"
1641 'enable_background%': 0,
1642 'icu_use_data_file_flag%': 1,
1643 'enable_web_speech%': 0,
1644 'use_system_libxml%': 1,
1645 'use_system_sqlite%': 1,
1647 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1648 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1649 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1650 'uk', 'vi', 'zh-CN', 'zh-TW',
1653 # iOS SDK and deployment target support. The |ios_sdk| value is left
1654 # blank so that when it is set in the project files it will be the
1655 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1656 # causes Xcode to spit out a warning for every single project file for
1657 # not using the "current" SDK.
1659 'ios_sdk_path%': '',
1660 'ios_deployment_target%': '7.0',
1663 # ios_product_name is set to the name of the .app bundle as it should
1665 ['branding=="Chrome"', {
1666 'ios_product_name%': 'Chrome',
1667 }, { # else: branding!="Chrome"
1668 'ios_product_name%': 'Chromium',
1670 ['branding=="Chrome" and buildtype=="Official"', {
1672 }, { # else: branding!="Chrome" or buildtype!="Official"
1678 # Location of Android NDK.
1681 # Standard libraries can use the relative path to the NDK.
1682 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1683 # Unfortunately, it is required to use the absolute path to the SDK
1684 # because it us passed to ant which uses a different relative path
1686 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1687 # Similarly, gdbserver and the Android toolchain need to use the
1688 # absolute path to the NDK because they are used at different levels
1690 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1691 'android_host_arch%': '<!(uname -m)',
1692 # Android API-level of the SDK used for compilation.
1693 'android_sdk_version%': '22',
1694 'android_sdk_build_tools_version%': '22.0.0',
1695 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1697 # Copy conditionally-set variables out one scope.
1698 'android_ndk_root%': '<(android_ndk_root)',
1699 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1700 'android_sdk_root%': '<(android_sdk_root)',
1701 'android_sdk_version%': '<(android_sdk_version)',
1702 'android_libcpp_root': '<(android_ndk_root)/sources/cxx-stl/llvm-libc++',
1703 'host_os%': '<(host_os)',
1705 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1706 # Android SDK build tools (e.g. dx, aidl)
1707 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1709 # Android API level 16 is JB (Android 4.1) which is the minimum
1710 # platform requirement for Chrome on Android, we use it for native
1713 ['target_arch == "ia32"', {
1714 'android_app_abi%': 'x86',
1715 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
1716 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-x86',
1717 'android_ndk_lib_dir%': 'usr/lib',
1718 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1720 ['target_arch == "x64"', {
1721 'android_app_abi%': 'x86_64',
1722 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1723 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1724 'android_ndk_lib_dir%': 'usr/lib64',
1725 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1727 ['target_arch=="arm"', {
1730 'android_app_abi%': 'armeabi',
1732 'android_app_abi%': 'armeabi-v7a',
1735 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
1736 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-arm',
1737 'android_ndk_lib_dir%': 'usr/lib',
1738 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1740 ['target_arch == "arm64"', {
1741 'android_app_abi%': 'arm64-v8a',
1742 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1743 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1744 'android_ndk_lib_dir%': 'usr/lib',
1745 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1747 ['target_arch == "mipsel"', {
1748 'android_app_abi%': 'mips',
1749 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
1750 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-mips',
1751 'android_ndk_lib_dir%': 'usr/lib',
1752 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1754 ['target_arch == "mips64el"', {
1755 'android_app_abi%': 'mips64',
1756 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1757 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1758 'android_ndk_lib_dir%': 'usr/lib64',
1759 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1763 # Copy conditionally-set variables out one scope.
1764 'android_app_abi%': '<(android_app_abi)',
1765 'android_gdbserver%': '<(android_gdbserver)',
1766 'android_ndk_root%': '<(android_ndk_root)',
1767 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1768 'android_sdk_root%': '<(android_sdk_root)',
1769 'android_sdk_version%': '<(android_sdk_version)',
1770 'android_toolchain%': '<(android_toolchain)',
1772 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1773 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1774 'android_sdk_tools%': '<(android_sdk_tools)',
1775 'android_aapt_path%': '<(android_sdk_tools)/aapt',
1776 'android_sdk%': '<(android_sdk)',
1777 'android_sdk_jar%': '<(android_sdk)/android.jar',
1779 'android_libcpp_root': '<(android_libcpp_root)',
1780 'android_libcpp_include': '<(android_libcpp_root)/libcxx/include',
1781 'android_libcpp_libs_dir': '<(android_libcpp_root)/libs/<(android_app_abi)',
1782 'host_os%': '<(host_os)',
1784 # Location of the "objcopy" binary, used by both gyp and scripts.
1785 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1787 # Location of the "strip" binary, used by both gyp and scripts.
1788 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1790 # Location of the "readelf" binary.
1791 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1793 # Determines whether we should optimize JNI generation at the cost of
1794 # breaking assumptions in the build system that when inputs have changed
1795 # the outputs should always change as well. This is meant purely for
1796 # developer builds, to avoid spurious re-linking of native files.
1797 'optimize_jni_generation%': '<(optimize_jni_generation)',
1799 # Always uses openssl.
1801 'use_openssl_certs%': 1,
1803 'proprietary_codecs%': '<(proprietary_codecs)',
1804 'safe_browsing%': 2,
1805 'enable_web_speech%': 0,
1807 'build_ffmpegsumo%': 0,
1808 'use_allocator%': 'none',
1810 # Disable Native Client.
1813 # Android does not support background apps.
1814 'enable_background%': 0,
1816 # Sessions are store separately in the Java side.
1817 'enable_session_service%': 0,
1821 'gtest_target_type%': 'shared_library',
1824 'use_system_fontconfig%': 0,
1826 'use_system_fontconfig%': 1,
1829 'enable_mpeg2ts_stream_parser%': 1,
1830 'ffmpeg_branding%': 'ChromeOS',
1831 'ozone_platform_ozonex%': 1,
1832 'use_playready%': 0,
1834 ['target_arch=="arm"', {
1836 'arm_tune%': 'cortex-a9',
1842 ['chromecast==1 and OS!="android"', {
1843 'ozone_platform_cast%': 1
1845 ['OS=="linux" and target_arch!="mipsel"', {
1850 # All Chrome builds have breakpad symbols, but only process the
1851 # symbols from official builds.
1852 ['(branding=="Chrome" and buildtype=="Official")', {
1853 'mac_strip_release%': 1,
1857 ['OS=="mac" or OS=="ios"', {
1861 # Mac OS X SDK and deployment target support. The SDK identifies
1862 # the version of the system headers that will be used, and
1863 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1864 # macro. "Maximum allowed" refers to the operating system version
1865 # whose APIs are available in the headers. The deployment target
1866 # identifies the minimum system version that the built products are
1867 # expected to function on. It corresponds to the
1868 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1869 # macros are available, #include <AvailabilityMacros.h>. Additional
1870 # documentation on these macros is available at
1871 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1872 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1873 # deployment target to 10.6. Other projects, such as O3D, may
1874 # override these defaults.
1876 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1877 # about that is at least the specified version. In official builds,
1878 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1879 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1880 # path to the SDK; when set to a non-empty string, SDK detection
1881 # based on mac_sdk_min will be bypassed entirely.
1884 'mac_sdk_min%': '10.8',
1885 }, { # else OS!="ios"
1886 'mac_sdk_min%': '10.6',
1889 'mac_sdk_path%': '',
1891 'mac_deployment_target%': '10.6',
1894 'mac_sdk_min': '<(mac_sdk_min)',
1895 'mac_sdk_path': '<(mac_sdk_path)',
1896 'mac_deployment_target': '<(mac_deployment_target)',
1898 # Compile in Breakpad support by default so that it can be
1899 # tested, even if it is not enabled by default at runtime.
1900 'mac_breakpad_compiled_in%': 1,
1902 # mac_product_name is set to the name of the .app bundle as it should
1903 # appear on disk. This duplicates data from
1904 # chrome/app/theme/chromium/BRANDING and
1905 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1906 # these names into the build system.
1907 ['branding=="Chrome"', {
1908 'mac_product_name%': 'Google Chrome',
1909 }, { # else: branding!="Chrome"
1910 'mac_product_name%': 'Chromium',
1912 # Official mac builds require a specific OS X SDK, but iOS and
1913 # non-official mac builds do not.
1914 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1915 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1917 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1919 ['branding=="Chrome" and buildtype=="Official"', {
1920 # Enable uploading crash dumps.
1921 'mac_breakpad_uploads%': 1,
1922 # Enable dumping symbols at build time for use by Mac Breakpad.
1924 # Enable Keystone auto-update support.
1926 }, { # else: branding!="Chrome" or buildtype!="Official"
1927 'mac_breakpad_uploads%': 0,
1932 }], # OS=="mac" or OS=="ios"
1935 # This is the architecture convention used in WinSDK paths.
1936 ['target_arch=="ia32"', {
1937 'winsdk_arch%': 'x86',
1939 'winsdk_arch%': '<(target_arch)',
1941 ['component=="shared_library" or MSVS_VERSION == "2015"', {
1942 # TODO(scottmg): The allocator shimming doesn't work on the 2015 CRT
1943 # and we are hoping to be able to remove it if an additional feature
1944 # lands in the 2015 CRT API. For now, don't shim and revisit once
1945 # VS2015 is RTM: http://crbug.com/481611.
1946 'win_use_allocator_shim%': 0,
1948 ['component=="static_library"', {
1949 # Turn on multiple dll by default on Windows when in static_library.
1950 'chrome_multiple_dll%': 1,
1952 ['asan==1 or syzyasan==1', {
1953 'win_use_allocator_shim%': 0,
1958 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1959 # Only enabled by default for ninja because it's buggy in VS.
1960 # Not enabled for component=static_library because some targets
1961 # are too large and the toolchain fails due to the size of the
1963 'incremental_chrome_dll%': 1,
1965 # Don't do incremental linking for large modules on 32-bit or when
1966 # component=static_library as the toolchain fails due to the size of
1968 ['MSVS_OS_BITS==32 or component=="static_library"', {
1969 'msvs_large_module_debug_link_mode%': '1', # No
1971 'msvs_large_module_debug_link_mode%': '2', # Yes
1974 'nacl_win64_defines': [
1975 # This flag is used to minimize dependencies when building
1976 # Native Client loader for 64-bit Windows.
1979 # Need to include allocator target, but exclude tcmalloc files.
1980 'use_allocator%': 'winheap',
1983 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1989 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win") and chromecast==0', {
1990 'enable_pepper_cdms%': 1,
1992 'enable_pepper_cdms%': 0,
1995 ['OS=="android" or chromecast==1', {
1996 'enable_browser_cdms%': 1,
1998 'enable_browser_cdms%': 0,
2001 # Native Client glibc toolchain is enabled
2002 # by default except on arm, mips and mips64.
2003 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
2004 'disable_glibc%': 1,
2006 'disable_glibc%': 0,
2009 # Set the relative path from this file to the GYP file of the JPEG
2010 # library used by Chromium.
2011 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2012 # Configuration for using the system libjeg is here.
2013 'libjpeg_gyp_path': '<(libjpeg_ijg_gyp_path)',
2015 'libjpeg_gyp_path': '<(libjpeg_turbo_gyp_path)',
2018 # Options controlling the use of GConf (the classic GNOME configuration
2019 # system) and GIO, which contains GSettings (the new GNOME config system).
2020 ['chromeos==1 or embedded==1', {
2028 # Set up -D and -E flags passed into grit.
2029 ['branding=="Chrome"', {
2030 # TODO(mmoss) The .grd files look for _google_chrome, but for
2031 # consistency they should look for google_chrome_build like C++.
2032 'grit_defines': ['-D', '_google_chrome',
2033 '-E', 'CHROMIUM_BUILD=google_chrome'],
2035 'grit_defines': ['-D', '_chromium',
2036 '-E', 'CHROMIUM_BUILD=chromium'],
2039 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2041 ['desktop_linux==1', {
2042 'grit_defines': ['-D', 'desktop_linux'],
2044 ['toolkit_views==1', {
2045 'grit_defines': ['-D', 'toolkit_views'],
2048 'grit_defines': ['-D', 'use_aura'],
2051 'grit_defines': ['-D', 'use_ash'],
2053 ['use_nss_certs==1', {
2054 'grit_defines': ['-D', 'use_nss_certs'],
2057 'grit_defines': ['-D', 'use_ozone'],
2059 ['image_loader_extension==1', {
2060 'grit_defines': ['-D', 'image_loader_extension'],
2063 'grit_defines': ['-D', 'remoting'],
2065 ['use_titlecase_in_grd==1', {
2066 'grit_defines': ['-D', 'use_titlecase'],
2068 ['use_third_party_translations==1', {
2069 'grit_defines': ['-D', 'use_third_party_translations'],
2071 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2072 'ka', 'ku', 'kw', 'ms', 'ug'
2078 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2079 '--no-output-all-resource-defines',
2082 ['OS=="mac" or OS=="ios"', {
2083 'grit_defines': ['-D', 'scale_factors=2x'],
2087 'enable_coverage%': 0,
2091 '--no-output-all-resource-defines',
2093 # iOS uses a whitelist to filter resources.
2094 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2096 # Enable host builds when generating with ninja-ios.
2098 ['"<(GENERATOR)"=="ninja"', {
2102 # Use the version of clang shipped with Xcode when building official
2103 # version of Chrome for iOS.
2105 # TODO(eugenebut): Remove enable_coverage check once
2106 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2107 # http://crbug.com/450379
2109 # TODO(sdefresne): Remove xcodebuild version check onces clang ToT
2110 # supports "nullable" and related. https://crbug.com/499448
2111 ['buildtype=="Official" or enable_coverage or '
2112 '<!(xcodebuild -version|awk \'/Xcode/{print ($2 >= 7.0)}\')==1', {
2117 ['enable_extensions==1', {
2118 'grit_defines': ['-D', 'enable_extensions'],
2120 ['enable_plugins!=0', {
2121 'grit_defines': ['-D', 'enable_plugins'],
2123 ['enable_basic_printing==1 or enable_print_preview==1', {
2124 'grit_defines': ['-D', 'enable_printing'],
2126 ['enable_print_preview==1', {
2127 'grit_defines': ['-D', 'enable_print_preview'],
2129 ['enable_themes==1', {
2130 'grit_defines': ['-D', 'enable_themes'],
2132 ['enable_app_list==1', {
2133 'grit_defines': ['-D', 'enable_app_list'],
2135 ['enable_settings_app==1', {
2136 'grit_defines': ['-D', 'enable_settings_app'],
2138 ['enable_google_now==1', {
2139 'grit_defines': ['-D', 'enable_google_now'],
2141 ['use_concatenated_impulse_responses==1', {
2142 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2144 ['enable_media_router==1', {
2145 'grit_defines': ['-D', 'enable_media_router'],
2147 ['enable_webrtc==1', {
2148 'grit_defines': ['-D', 'enable_webrtc'],
2150 ['enable_hangout_services_extension==1', {
2151 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2153 ['enable_task_manager==1', {
2154 'grit_defines': ['-D', 'enable_task_manager'],
2156 ['notifications==1', {
2157 'grit_defines': ['-D', 'enable_notifications'],
2159 ['enable_wifi_bootstrapping==1', {
2160 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2162 ['mac_views_browser==1', {
2163 'grit_defines': ['-D', 'mac_views_browser'],
2165 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2166 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2168 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2169 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2171 ['enable_mdns==1 or OS=="mac"', {
2172 'grit_defines': ['-D', 'enable_service_discovery'],
2173 'enable_service_discovery%': 1
2175 ['clang_use_chrome_plugins==1', {
2181 ['OS=="mac" or OS=="ios"', {
2182 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2183 }, { # OS != "mac" or OS != "ios"
2184 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
2188 'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ',
2190 # On Windows, the plugin is built directly into clang, so there's
2191 # no need to load it dynamically.
2192 'clang_dynlib_flags%': '',
2194 # https://crbug.com/441916
2195 ['OS=="android" or OS=="linux" or OS=="mac"', {
2196 'clang_plugin_args%': '-Xclang -plugin-arg-find-bad-constructs -Xclang check-templates ',
2197 }, { # OS != "linux"
2198 'clang_plugin_args%': ''
2202 # If you change these, also change build/config/clang/BUILD.gn.
2203 'clang_chrome_plugins_flags%':
2204 '<(clang_dynlib_flags)'
2205 '-Xclang -add-plugin -Xclang find-bad-constructs <(clang_plugin_args)',
2207 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2209 'use_allocator%': 'none',
2210 'use_sanitizer_options%': 1,
2213 # Allowed level of identical code folding in the gold linker.
2214 ['OS=="linux" and target_arch=="x64"', {
2215 # --icf=safe disables much more folding on x86_64 than elsewhere, see
2216 # http://crbug.com/492177. Turning it on saves over 12 MB of binary
2217 # size, but it seems to regress cold startup time by over a second
2218 # (see http://crbug.com/492809).
2219 # TODO(thakis): Check if disabling ICF would inmprove android cold start
2220 # times by several seconds too.
2221 'gold_icf_level%': 'safe',
2223 'gold_icf_level%': 'all',
2226 ['OS=="linux" and asan==0 and msan==0 and lsan==0 and tsan==0', {
2227 # PNaCl toolchain Non-SFI build only supports linux OS build.
2228 # Also, it does not support sanitizers.
2229 'enable_nacl_nonsfi_test%': 1,
2231 ['asan==1 and OS=="linux" and chromeos==0', {
2232 'use_custom_libcxx%': 1,
2240 ['asan==1 and OS=="mac"', {
2241 'mac_strip_release': 1,
2244 'use_custom_libcxx%': 1,
2247 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2248 # libstdc++. This is required to avoid false positive reports whenever
2249 # the C++ standard library is used.
2250 'use_custom_libcxx%': 1,
2251 # Running the V8-generated code on an ARM simulator is a powerful hack
2252 # that allows the tool to see the memory accesses from JITted code.
2253 # Without this flag, JS code causes false positive reports from MSan.
2254 'v8_target_arch': 'arm64',
2257 ['OS=="linux" and clang_type_profiler==1', {
2259 'clang_use_chrome_plugins%': 0,
2261 ['host_arch=="x64"', {
2262 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2264 ['host_arch=="ia32"', {
2265 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2266 # Clang in this directory at your own risk if needed for some
2267 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2268 # usage). Any failure by this compiler should not close the tree.
2269 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2274 # On valgrind bots, override the optimizer settings so we don't inline too
2275 # much and make the stacks harder to figure out.
2277 # TODO(rnk): Kill off variables that no one else uses and just implement
2278 # them under a build_for_tool== condition.
2279 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2281 'mac_debug_optimization': '1',
2282 'mac_release_optimization': '1',
2283 'release_optimize': '1',
2284 'no_gc_sections': 1,
2285 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2286 '-fno-builtin -fno-optimize-sibling-calls',
2287 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2288 '-fno-builtin -fno-optimize-sibling-calls',
2290 # MSVS flags for TSan on Pin and Windows.
2291 'win_debug_RuntimeChecks': '0',
2292 'win_debug_disable_iterator_debugging': '1',
2293 'win_debug_Optimization': '1',
2294 'win_debug_InlineFunctionExpansion': '0',
2295 'win_release_InlineFunctionExpansion': '0',
2296 'win_release_OmitFramePointers': '0',
2298 'use_allocator': 'tcmalloc',
2299 'release_valgrind_build': 1,
2301 'component': 'static_library',
2302 'use_system_zlib': 0,
2305 # Build tweaks for DrMemory.
2306 # TODO(rnk): Combine with tsan config to share the builder.
2307 # http://crbug.com/108155
2308 ['build_for_tool=="drmemory"', {
2309 # These runtime checks force initialization of stack vars which blocks
2310 # DrMemory's uninit detection.
2311 'win_debug_RuntimeChecks': '0',
2312 # Iterator debugging is slow.
2313 'win_debug_disable_iterator_debugging': '1',
2314 # Try to disable optimizations that mess up stacks in a release build.
2315 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2316 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2317 # compiler bug, so we use /Ob1 instead.
2318 'win_release_InlineFunctionExpansion': '1',
2319 'win_release_OmitFramePointers': '0',
2320 # Ditto for debug, to support bumping win_debug_Optimization.
2321 'win_debug_InlineFunctionExpansion': 0,
2322 'win_debug_OmitFramePointers': 0,
2323 # Keep the code under #ifndef NVALGRIND.
2324 'release_valgrind_build': 1,
2327 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2328 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2332 # Set default compiler flags depending on ARM version.
2333 ['arm_version==6', {
2334 'arm_arch%': 'armv6',
2337 'arm_float_abi%': 'softfp',
2340 ['arm_version==7', {
2341 'arm_arch%': 'armv7-a',
2342 'arm_tune%': 'generic-armv7-a',
2347 'arm_fpu%': 'vfpv3-d16',
2350 'arm_float_abi%': 'softfp',
2352 'arm_float_abi%': 'hard',
2358 # Set default compiler flags for MIPS floating-point support.
2359 ['target_arch=="mipsel"', {
2360 'mips_float_abi%': 'hard',
2362 ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
2363 'mips_fpu_mode%': 'fp32',
2366 # Enable brlapi by default for chromeos.
2371 ['use_ozone==1 and ozone_auto_platforms==1', {
2372 # Use test as the default platform.
2373 'ozone_platform%': 'test',
2375 # Build all platforms whose deps are in install-build-deps.sh.
2376 # Only these platforms will be compile tested by buildbots.
2377 'ozone_platform_dri%': 1,
2378 'ozone_platform_drm%': 1,
2379 'ozone_platform_test%': 1,
2380 'ozone_platform_egltest%': 1,
2383 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2384 'use_clipboard_aurax11%': 1,
2387 ['OS=="win" and use_goma==1', {
2388 # goma doesn't support pch yet.
2389 'chromium_win_pch': 0,
2390 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2392 ['win_z7==0 and fastbuild==0', {
2398 ['OS=="win" and (clang==1 or asan==1)', {
2399 'chromium_win_pch': 0,
2403 'host_cc': '<(make_clang_dir)/bin/clang',
2404 'host_cxx': '<(make_clang_dir)/bin/clang++',
2406 'host_cc': '<!(which gcc)',
2407 'host_cxx': '<!(which g++)',
2410 # The seccomp-bpf sandbox is only supported on five architectures
2412 # Do not disable seccomp_bpf anywhere without talking to
2413 # security@chromium.org!
2414 ['((OS=="linux" or OS=="android") and '
2415 '(target_arch=="ia32" or target_arch=="x64" or '
2416 'target_arch=="arm" or target_arch=="mipsel" or '
2417 'target_arch=="arm64"))', {
2418 'use_seccomp_bpf%': 1,
2420 'use_seccomp_bpf%': 0,
2427 ['branding=="Chrome" and buildtype=="Official"', {
2428 'enable_hangout_services_extension%': 1,
2430 'enable_hangout_services_extension%': 0,
2434 # The path to the ANGLE library.
2435 'angle_path': '<(DEPTH)/third_party/angle',
2437 # List of default apps to install in new profiles. The first list contains
2438 # the source files as found in svn. The second list, used only for linux,
2439 # contains the destination location for each of the files. When a crx
2440 # is added or removed from the list, the chrome/browser/resources/
2441 # default_apps/external_extensions.json file must also be updated.
2443 # README: GN version of these is in the target //chrome:default_apps
2444 # (there's no global variable like in GYP). Be sure to update that target
2445 # if you change these lists!
2446 'default_apps_list': [
2447 'browser/resources/default_apps/external_extensions.json',
2448 'browser/resources/default_apps/gmail.crx',
2449 'browser/resources/default_apps/search.crx',
2450 'browser/resources/default_apps/youtube.crx',
2451 'browser/resources/default_apps/drive.crx',
2452 'browser/resources/default_apps/docs.crx',
2454 'default_apps_list_linux_dest': [
2455 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2456 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2457 '<(PRODUCT_DIR)/default_apps/search.crx',
2458 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2459 '<(PRODUCT_DIR)/default_apps/drive.crx',
2460 '<(PRODUCT_DIR)/default_apps/docs.crx',
2463 # Whether to allow building of the GPU-related isolates.
2464 'archive_gpu_tests%': 0,
2466 # Whether to allow building of chromoting related isolates.
2467 'archive_chromoting_tests%': 0,
2469 'target_defaults': {
2471 # The condition that operates on chromium_code is in a target_conditions
2472 # section, and will not have access to the default fallback value of
2473 # chromium_code at the top of this file, or to the chromium_code
2474 # variable placed at the root variables scope of .gyp files, because
2475 # those variables are not set at target scope. As a workaround,
2476 # if chromium_code is not set at target scope, define it in target scope
2477 # to contain whatever value it has during early variable expansion.
2478 # That's enough to make it available during target conditional
2480 'chromium_code%': '<(chromium_code)',
2482 'component%': '<(component)',
2484 'chromecast%': '<(chromecast)',
2486 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2487 'win_release_Optimization%': '2', # 2 = /O2
2488 'win_debug_Optimization%': '0', # 0 = /Od
2490 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2491 # Tri-state: blank is default, 1 on, 0 off
2492 'win_release_OmitFramePointers%': '0',
2493 # Tri-state: blank is default, 1 on, 0 off
2494 'win_debug_OmitFramePointers%': '',
2496 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2497 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2499 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2500 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2501 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2503 # VS inserts quite a lot of extra checks to algorithms like
2504 # std::partial_sort in Debug build which make them O(N^2)
2505 # instead of O(N*logN). This is particularly slow under memory
2506 # tools like ThreadSanitizer so we want it to be disablable.
2507 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2508 'win_debug_disable_iterator_debugging%': '0',
2510 # An application manifest fragment to declare compatibility settings for
2511 # 'executable' targets. Ignored in other target type.
2512 'win_exe_compatibility_manifest%':
2513 '<(DEPTH)\\build\\win\\compatibility.manifest',
2515 'release_extra_cflags%': '',
2516 'debug_extra_cflags%': '',
2518 'release_valgrind_build%': '<(release_valgrind_build)',
2520 # the non-qualified versions are widely assumed to be *nix-only
2521 'win_release_extra_cflags%': '',
2522 'win_debug_extra_cflags%': '',
2524 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2525 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2527 # Only used by Windows build for now. Can be used to build into a
2528 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2529 # output files in src/build/VS2010_{Debug,Release}.
2530 'build_dir_prefix%': '',
2532 # Targets are by default not nacl untrusted code.
2533 'nacl_untrusted_build%': 0,
2535 'pnacl_compile_flags': [
2536 # pnacl uses the clang compiler so we need to suppress all the
2537 # same warnings as we do for clang.
2538 # TODO(sbc): Remove these if/when they are removed from the clang
2540 '-Wno-unused-function',
2541 '-Wno-char-subscripts',
2542 '-Wno-c++11-extensions',
2543 '-Wno-unnamed-type-template-args',
2546 # By default, Android targets have their exported JNI symbols stripped,
2547 # so we test the manual JNI registration code paths that are required
2548 # when using the crazy linker. To allow use of native JNI exports (lazily
2549 # resolved by the JVM), targets can enable this variable, which will stop
2550 # the stripping from happening. Only targets which do not need to be
2551 # compatible with the crazy linker are permitted to set this.
2552 'use_native_jni_exports%': 0,
2555 ['OS=="win" and component=="shared_library"', {
2556 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2557 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2558 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2560 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2561 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2562 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2565 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2566 'mac_release_optimization%': 's', # Use -Os unless overridden
2567 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2569 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2570 'mac_release_optimization%': '2', # Use -O2 unless overridden
2571 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2574 'host_os%': '<(host_os)', # See comment above chromium_code.
2577 'clang_warning_flags': [
2580 # Don't die on dtoa code that uses a char as an array index.
2581 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2582 '-Wno-char-subscripts',
2584 # TODO(thakis): This used to be implied by -Wno-unused-function,
2585 # which we no longer use. Check if it makes sense to remove
2586 # this as well. http://crbug.com/316352
2587 '-Wno-unneeded-internal-declaration',
2589 # Warns on switches on enums that cover all enum values but
2590 # also contain a default: branch. Chrome is full of that.
2591 '-Wno-covered-switch-default',
2593 # Warns when a const char[] is converted to bool.
2594 '-Wstring-conversion',
2596 # C++11-related flags:
2598 # This warns on using ints as initializers for floats in
2599 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2600 # which happens in several places in chrome code. Not sure if
2601 # this is worth fixing.
2602 '-Wno-c++11-narrowing',
2604 # Clang considers the `register` keyword as deprecated, but e.g.
2605 # code generated by flex (used in angle) contains that keyword.
2606 # http://crbug.com/255186
2607 '-Wno-deprecated-register',
2609 # TODO(hans): Get this cleaned up.
2610 '-Wno-inconsistent-missing-override',
2613 'includes': [ 'set_clang_warning_flags.gypi', ],
2615 # Don't use deprecated V8 APIs anywhere.
2616 'V8_DEPRECATION_WARNINGS',
2619 '<(SHARED_INTERMEDIATE_DIR)',
2623 # When compiling Objective C, warns if a method is used whose
2624 # availability is newer than the deployment target.
2625 'xcode_settings': { 'WARNING_CFLAGS': ['-Wpartial-availability']},
2627 ['(OS=="mac" or OS=="ios") and asan==1', {
2629 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2632 ['OS=="win" and asan==1 and component=="shared_library"', {
2634 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2637 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2638 'cflags_cc!': ['-fno-rtti'],
2641 '-gline-tables-only',
2642 '-fintercept-allocation-functions',
2644 'defines': ['TYPE_PROFILING'],
2646 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2649 ['branding=="Chrome"', {
2650 'defines': ['GOOGLE_CHROME_BUILD'],
2651 }, { # else: branding!="Chrome"
2652 'defines': ['CHROMIUM_BUILD'],
2654 ['OS=="mac" and component=="shared_library"', {
2656 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2657 'LD_RUNPATH_SEARCH_PATHS': [
2658 # For unbundled binaries.
2660 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2661 '@loader_path/../../..',
2665 ['clang==1 or host_clang==1', {
2666 # This is here so that all files get recompiled after a clang roll and
2667 # when turning clang on or off.
2668 # (defines are passed via the command line, and build systems rebuild
2669 # things when their commandline changes). Nothing should ever read this
2671 'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
2674 'defines': ['ENABLE_RLZ'],
2676 ['component=="shared_library"', {
2677 'defines': ['COMPONENT_BUILD'],
2679 ['ui_compositor_image_transport==1', {
2680 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2683 'defines': ['USE_AURA=1'],
2686 'defines': ['USE_ASH=1'],
2689 'defines': ['USE_PANGO=1'],
2692 'defines': ['USE_CAIRO=1'],
2695 'defines': ['USE_CRAS=1'],
2698 'defines': ['USE_OZONE=1'],
2700 ['use_default_render_theme==1', {
2701 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2703 ['use_libjpeg_turbo==1', {
2704 'defines': ['USE_LIBJPEG_TURBO=1'],
2707 'defines': ['USE_X11=1'],
2709 ['use_clipboard_aurax11==1', {
2710 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2712 ['enable_one_click_signin==1', {
2713 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2715 ['enable_pre_sync_backup==1', {
2716 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2718 ['image_loader_extension==1', {
2719 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2722 'defines': ['ENABLE_PROFILING=1'],
2725 'defines': ['ENABLE_REMOTING=1'],
2727 ['enable_webrtc==1', {
2728 'defines': ['ENABLE_WEBRTC=1'],
2730 ['enable_media_router==1', {
2731 'defines': ['ENABLE_MEDIA_ROUTER=1'],
2733 ['proprietary_codecs==1', {
2734 'defines': ['USE_PROPRIETARY_CODECS'],
2736 ['enable_mpeg2ts_stream_parser==1', {
2737 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2741 ['enable_viewport==1', {
2742 'defines': ['ENABLE_VIEWPORT'],
2744 ['enable_pepper_cdms==1', {
2745 'defines': ['ENABLE_PEPPER_CDMS'],
2747 ['enable_browser_cdms==1', {
2748 'defines': ['ENABLE_BROWSER_CDMS'],
2750 ['configuration_policy==1', {
2751 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2753 ['notifications==1', {
2754 'defines': ['ENABLE_NOTIFICATIONS'],
2756 ['enable_hidpi==1', {
2757 'defines': ['ENABLE_HIDPI=1'],
2759 ['enable_topchrome_md==1', {
2760 'defines': ['ENABLE_TOPCHROME_MD=1'],
2762 ['native_memory_pressure_signals==1', {
2763 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2766 'defines': ['USE_UDEV'],
2770 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2773 ['OS=="win" and fastbuild==2', {
2774 # Completely disable debug information.
2777 'GenerateDebugInformation': 'false',
2779 'VCCLCompilerTool': {
2780 'DebugInformationFormat': '0',
2784 ['OS=="win" and fastbuild==1', {
2787 # This tells the linker to generate .pdbs, so that
2788 # we can get meaningful stack traces.
2789 'GenerateDebugInformation': 'true',
2791 'VCCLCompilerTool': {
2792 # No debug info to be generated by compiler.
2793 'DebugInformationFormat': '0',
2797 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2798 'variables': { 'debug_extra_cflags': '-g0', },
2800 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2801 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2803 'variables': { 'debug_extra_cflags': '-g0', },
2805 # Android builds symbols on release by default, disable them.
2806 ['OS=="android" and fastbuild==2', {
2807 'variables': { 'release_extra_cflags': '-g0', },
2809 ['OS=="android" and fastbuild==1', {
2810 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2812 'variables': { 'release_extra_cflags': '-g0', },
2816 ['dont_embed_build_metadata==1', {
2818 'DONT_EMBED_BUILD_METADATA',
2820 }], # dont_embed_build_metadata==1
2821 ['dcheck_always_on!=0', {
2822 'defines': ['DCHECK_ALWAYS_ON=1'],
2823 }], # dcheck_always_on!=0
2824 ['tracing_like_official_build!=0', {
2825 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2826 }], # tracing_like_official_build!=0
2828 'defines': ['NO_TCMALLOC'],
2830 ['win_use_allocator_shim==1', {
2831 'defines': ['ALLOCATOR_SHIM'],
2837 'ADDRESS_SANITIZER',
2838 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2839 'MEMORY_SANITIZER_INITIAL_SIZE',
2843 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2851 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2852 'MEMORY_SANITIZER_INITIAL_SIZE',
2860 '<(DEPTH)/third_party/kasko/include',
2866 '_CRT_SECURE_NO_DEPRECATE',
2867 '_SCL_SECURE_NO_DEPRECATE',
2868 # This define is required to pull in the new Win8 interfaces from
2869 # system headers like ShObjIdl.h.
2870 'NTDDI_VERSION=0x06030000',
2871 # This is required for ATL to use XP-safe versions of its functions.
2872 '_USING_V110_SDK71_',
2875 '<(DEPTH)/third_party/wtl/include',
2880 # Generates debug info when win_z7=1
2881 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2883 'GenerateDebugInformation': 'true',
2885 'VCCLCompilerTool': {
2886 'DebugInformationFormat': '1',
2892 # This is prohibited when running /analyze.
2893 '_USING_V110_SDK71_',
2896 'VCCLCompilerTool': {
2897 # Set WarnAsError to false to disable this setting for most
2898 # projects so that compilation continues.
2899 'WarnAsError': 'false',
2900 # When win_analyze is specified add the /analyze switch.
2901 # Also add /WX- to force-disable WarnAsError for projects that
2902 # override WarnAsError.
2903 # Also, disable various noisy warnings that have low value.
2904 'AdditionalOptions': [
2907 '/wd6011', # Dereferencing NULL pointer
2908 '/wd6312', # Possible infinite loop: use of the constant
2909 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2910 '/wd6326', # Potential comparison of constant with constant
2911 '/wd28159', # Consider using 'GetTickCount64'
2912 '/wd28204', # Inconsistent SAL annotations
2913 '/wd28251', # Inconsistent SAL annotations
2914 '/wd28252', # Inconsistent SAL annotations
2915 '/wd28253', # Inconsistent SAL annotations
2916 '/wd28196', # The precondition is not satisfied
2917 '/wd28301', # Inconsistent SAL annotations
2918 '/wd6340', # Sign mismatch in function parameter
2919 '/wd28182', # Dereferencing NULL pointer
2920 # C6285 is ~16% of raw warnings and has low value
2921 '/wd6285', # non-zero constant || non-zero constant
2922 # C6334 is ~80% of raw warnings and has low value
2923 '/wd6334', # sizeof applied to an expression with an operator
2935 ['use_playready==1', {
2937 'PLAYREADY_CDM_AVAILABLE',
2942 ['enable_task_manager==1', {
2944 'ENABLE_TASK_MANAGER=1',
2947 ['enable_extensions==1', {
2949 'ENABLE_EXTENSIONS=1',
2952 ['OS=="win" and branding=="Chrome"', {
2953 'defines': ['ENABLE_SWIFTSHADER'],
2955 ['enable_dart==1', {
2956 'defines': ['WEBKIT_USING_DART=1'],
2958 ['enable_plugin_installation==1', {
2959 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2961 ['enable_plugins==1', {
2962 'defines': ['ENABLE_PLUGINS=1'],
2964 ['enable_session_service==1', {
2965 'defines': ['ENABLE_SESSION_SERVICE=1'],
2967 ['enable_themes==1', {
2968 'defines': ['ENABLE_THEMES=1'],
2970 ['enable_autofill_dialog==1', {
2971 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2973 ['enable_prod_wallet_service==1', {
2974 # In GN, this is set on the autofill tagets only. See
2975 # //components/autofill/core/browser:wallet_service
2976 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2978 ['enable_background==1', {
2979 'defines': ['ENABLE_BACKGROUND=1'],
2981 ['enable_google_now==1', {
2982 'defines': ['ENABLE_GOOGLE_NOW=1'],
2984 ['cld_version!=0', {
2985 'defines': ['CLD_VERSION=<(cld_version)'],
2987 ['enable_basic_printing==1 or enable_print_preview==1', {
2988 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2989 'defines': ['ENABLE_PRINTING=1'],
2991 ['enable_basic_printing==1', {
2992 # Enable basic printing support and UI.
2993 'defines': ['ENABLE_BASIC_PRINTING=1'],
2995 ['enable_print_preview==1', {
2996 # Enable printing with print preview.
2997 # Can be defined without ENABLE_BASIC_PRINTING.
2998 'defines': ['ENABLE_PRINT_PREVIEW=1'],
3000 ['enable_spellcheck==1', {
3001 'defines': ['ENABLE_SPELLCHECK=1'],
3003 ['enable_captive_portal_detection==1', {
3004 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
3006 ['enable_app_list==1', {
3007 'defines': ['ENABLE_APP_LIST=1'],
3009 ['enable_settings_app==1', {
3010 'defines': ['ENABLE_SETTINGS_APP=1'],
3012 ['disable_file_support==1', {
3013 'defines': ['DISABLE_FILE_SUPPORT=1'],
3015 ['disable_ftp_support==1', {
3016 'defines': ['DISABLE_FTP_SUPPORT=1'],
3018 ['enable_supervised_users==1', {
3019 'defines': ['ENABLE_SUPERVISED_USERS=1'],
3021 ['enable_mdns==1', {
3022 'defines': ['ENABLE_MDNS=1'],
3024 ['enable_service_discovery==1', {
3025 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
3027 ['enable_wifi_bootstrapping==1', {
3028 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
3030 ['enable_hangout_services_extension==1', {
3031 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
3033 ['enable_ipc_fuzzer==1', {
3034 'defines': ['ENABLE_IPC_FUZZER=1'],
3037 'defines': ['VIDEO_HOLE=1'],
3039 ['v8_use_external_startup_data==1', {
3040 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
3042 ['enable_webvr==1', {
3043 'defines': ['ENABLE_WEBVR'],
3046 # SAFE_BROWSING_SERVICE - browser manages a safe-browsing service.
3047 # SAFE_BROWSING_DB_LOCAL - service manages a local database.
3048 # SAFE_BROWSING_DB_REMOTE - service talks via API to a database
3049 # SAFE_BROWSING_CSD - enable client-side phishing detection.
3050 ['safe_browsing==1', {
3052 # TODO(nparker): Remove existing uses of FULL_SAFE_BROWSING
3053 'FULL_SAFE_BROWSING',
3054 'SAFE_BROWSING_CSD',
3055 'SAFE_BROWSING_DB_LOCAL',
3056 'SAFE_BROWSING_SERVICE',
3059 ['safe_browsing==2', {
3061 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3062 'MOBILE_SAFE_BROWSING',
3063 'SAFE_BROWSING_SERVICE',
3066 ['safe_browsing==3', {
3068 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3069 'MOBILE_SAFE_BROWSING',
3070 'SAFE_BROWSING_DB_REMOTE',
3071 'SAFE_BROWSING_SERVICE',
3074 ], # conditions for 'target_defaults'
3075 'target_conditions': [
3076 ['<(use_libpci)==1', {
3077 'defines': ['USE_LIBPCI=1'],
3079 ['<(use_openssl)==1', {
3080 'defines': ['USE_OPENSSL=1'],
3082 ['<(use_openssl_certs)==1', {
3083 'defines': ['USE_OPENSSL_CERTS=1'],
3085 ['>(nacl_untrusted_build)==1', {
3088 'USE_OPENSSL_CERTS=1',
3091 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3092 'defines': ['USE_GLIB=1'],
3094 ['<(use_nss_certs)==1 and >(nacl_untrusted_build)==0', {
3095 'defines': ['USE_NSS_CERTS=1'],
3097 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3098 'defines': ['OS_CHROMEOS=1'],
3100 ['enable_wexit_time_destructors==1 and OS!="win"', {
3101 # TODO: Enable on Windows too, http://crbug.com/404525
3102 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3104 ['chromium_code==0', {
3106 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3107 # We don't want to get warnings from third-party code,
3108 # so remove any existing warning-enabling flags like -Wall.
3114 # Don't warn about hash_map in third-party code.
3118 # Don't warn about printf format problems.
3119 # This is off by default in gcc but on in Ubuntu's gcc(!).
3123 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3127 # TODO: Fix all warnings on chromeos too.
3128 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3133 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3135 # Don't warn about ignoring the return value from e.g. close().
3136 # This is off by default in some gccs but on by default in others.
3137 # BSD systems do not support this option, since they are usually
3138 # using gcc 4.2.1, which does not have this flag yet.
3139 '-Wno-unused-result',
3144 '_CRT_SECURE_NO_DEPRECATE',
3145 '_CRT_NONSTDC_NO_WARNINGS',
3146 '_CRT_NONSTDC_NO_DEPRECATE',
3147 '_SCL_SECURE_NO_DEPRECATE',
3149 'msvs_disabled_warnings': [
3153 'VCCLCompilerTool': {
3154 'WarningLevel': '3',
3155 'WarnAsError': 'true',
3156 'Detect64BitPortabilityProblems': 'false',
3160 ['buildtype=="Official"', {
3162 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3165 [ 'component=="shared_library"', {
3166 # TODO(darin): Unfortunately, some third_party code depends on base.
3167 'msvs_disabled_warnings': [
3168 4251, # class 'std::xx' needs to have dll-interface.
3174 [ 'OS=="mac" or OS=="ios"', {
3176 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3179 ['buildtype=="Official"', {
3181 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3188 # TODO(ios): Fix remaining warnings in third-party code, then
3189 # remove this; the Mac cleanup didn't get everything that's
3190 # flagged in an iOS build.
3191 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3192 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3193 # Several internal ios directories generate numerous warnings for
3194 # -Wobjc-missing-property-synthesis.
3195 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3201 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3202 'filename_rules.gypi',
3204 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3205 # C99 macros on Mac and Linux.
3207 '__STDC_CONSTANT_MACROS',
3208 '__STDC_FORMAT_MACROS',
3212 # turn on warnings for signed/unsigned mismatch on chromium code.
3214 'VCCLCompilerTool': {
3215 'AdditionalOptions': ['/we4389'],
3219 ['OS=="win" and component=="shared_library"', {
3220 'msvs_disabled_warnings': [
3221 4251, # class 'std::xx' needs to have dll-interface.
3226 ], # target_conditions for 'target_defaults'
3227 'default_configuration': 'Debug',
3229 # VCLinkerTool LinkIncremental values below:
3231 # 1 == /INCREMENTAL:NO
3233 # Debug links incremental, Release does not.
3235 # Abstract base configurations to cover common attributes.
3239 'msvs_configuration_attributes': {
3240 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3241 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3242 'CharacterSet': '1',
3246 'AdditionalOptions': [
3251 # Add the default import libs.
3252 'AdditionalDependencies': [
3269 'AdditionalOptions': [
3270 # Suggested by Microsoft Devrel to avoid
3271 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3272 # which started happening more regularly after VS2013 Update 4.
3273 # Needs to be a bit lower for VS2015, or else errors out.
3274 '/maxilksize:0x7ff00000',
3283 'MinimumRequiredVersion': '5.01', # XP.
3284 'TargetMachine': '1',
3286 'VCLibrarianTool': {
3287 'TargetMachine': '1',
3290 'msvs_configuration_platform': 'Win32',
3294 'msvs_configuration_platform': 'x64',
3297 # Make sure to understand http://crbug.com/361720 if you want to
3299 'MinimumRequiredVersion': '5.02', # Server 2003.
3300 'TargetMachine': '17', # x86 - 64
3301 'AdditionalLibraryDirectories!':
3302 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3303 'AdditionalLibraryDirectories':
3304 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3305 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3306 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3308 'VCLibrarianTool': {
3309 'AdditionalLibraryDirectories!':
3310 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3311 'AdditionalLibraryDirectories':
3312 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3313 'TargetMachine': '17', # x64
3320 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3321 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3324 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3326 '<@(debug_extra_cflags)',
3330 'VCCLCompilerTool': {
3331 'Optimization': '<(win_debug_Optimization)',
3332 'PreprocessorDefinitions': ['_DEBUG'],
3333 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3334 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3336 # According to MSVS, InlineFunctionExpansion=0 means
3337 # "default inlining", not "/Ob0".
3338 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3339 ['win_debug_InlineFunctionExpansion==0', {
3340 'AdditionalOptions': ['/Ob0'],
3342 ['win_debug_InlineFunctionExpansion!=""', {
3343 'InlineFunctionExpansion':
3344 '<(win_debug_InlineFunctionExpansion)',
3346 ['win_debug_disable_iterator_debugging==1', {
3347 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3350 # if win_debug_OmitFramePointers is blank, leave as default
3351 ['win_debug_OmitFramePointers==1', {
3352 'OmitFramePointers': 'true',
3354 ['win_debug_OmitFramePointers==0', {
3355 'OmitFramePointers': 'false',
3356 # The above is not sufficient (http://crbug.com/106711): it
3357 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3358 # perform FPO regardless, so we must explicitly disable.
3359 # We still want the false setting above to avoid having
3360 # "/Oy /Oy-" and warnings about overriding.
3361 'AdditionalOptions': ['/Oy-'],
3364 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3367 'LinkIncremental': '<(msvs_debug_link_incremental)',
3368 # ASLR makes debugging with windbg difficult because Chrome.exe and
3369 # Chrome.dll share the same base name. As result, windbg will
3370 # name the Chrome.dll module like chrome_<base address>, where
3371 # <base address> typically changes with each launch. This in turn
3372 # means that breakpoints in Chrome.dll don't stick from one launch
3373 # to the next. For this reason, we turn ASLR off in debug builds.
3374 # Note that this is a three-way bool, where 0 means to pick up
3375 # the default setting, 1 is off and 2 is on.
3376 'RandomizedBaseAddress': 1,
3378 'VCResourceCompilerTool': {
3379 'PreprocessorDefinitions': ['_DEBUG'],
3383 ['OS=="linux" or OS=="android"', {
3384 'target_conditions': [
3385 ['_toolset=="target"', {
3387 '<@(debug_extra_cflags)',
3392 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3393 # Enable libstdc++ debugging facilities to help catch problems
3394 # early, see http://crbug.com/65151 .
3395 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3396 'defines': ['_GLIBCXX_DEBUG=1',],
3398 ['release_valgrind_build==0', {
3401 '-fstack-protector-all', # Implies -fstack-protector
3407 # Allow comparing the address of references and 'this' against 0
3408 # in debug builds. Technically, these can never be null in
3409 # well-defined C/C++ and Clang can optimize such checks away in
3410 # release builds, but they may be used in asserts in debug builds.
3411 '-Wno-undefined-bool-conversion',
3412 '-Wno-tautological-undefined-compare',
3416 '-Wno-undefined-bool-conversion',
3417 '-Wno-tautological-undefined-compare',
3421 'VCCLCompilerTool': {
3422 'AdditionalOptions': [
3423 '-Wno-undefined-bool-conversion',
3424 '-Wno-tautological-undefined-compare',
3437 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3438 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3439 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3442 'VCCLCompilerTool': {
3443 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3445 # In official builds, each target will self-select
3446 # an optimization level.
3447 ['buildtype!="Official"', {
3448 'Optimization': '<(win_release_Optimization)',
3451 # According to MSVS, InlineFunctionExpansion=0 means
3452 # "default inlining", not "/Ob0".
3453 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3454 ['win_release_InlineFunctionExpansion==0', {
3455 'AdditionalOptions': ['/Ob0'],
3457 ['win_release_InlineFunctionExpansion!=""', {
3458 'InlineFunctionExpansion':
3459 '<(win_release_InlineFunctionExpansion)',
3462 # if win_release_OmitFramePointers is blank, leave as default
3463 ['win_release_OmitFramePointers==1', {
3464 'OmitFramePointers': 'true',
3466 ['win_release_OmitFramePointers==0', {
3467 'OmitFramePointers': 'false',
3468 # The above is not sufficient (http://crbug.com/106711): it
3469 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3470 # perform FPO regardless, so we must explicitly disable.
3471 # We still want the false setting above to avoid having
3472 # "/Oy /Oy-" and warnings about overriding.
3473 'AdditionalOptions': ['/Oy-'],
3476 # Put data in separate COMDATs. This allows the linker
3477 # to put bit-identical constants at the same address even if
3478 # they're unrelated constants, which saves binary size.
3479 # This optimization can't be used when ASan is enabled because
3480 # it is not compatible with the ASan ODR checker.
3481 'AdditionalOptions': ['/Gw'],
3484 'AdditionalOptions': [
3485 '/d2Zi+', # Improve debugging of Release builds.
3486 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3487 '<@(win_release_extra_cflags)',
3491 # LinkIncremental is a tri-state boolean, where 0 means default
3492 # (i.e., inherit from parent solution), 1 means false, and
3494 'LinkIncremental': '1',
3495 # This corresponds to the /PROFILE flag which ensures the PDB
3496 # file contains FIXUP information (growing the PDB file by about
3497 # 5%) but does not otherwise alter the output binary. This
3498 # information is used by the Syzygy optimization tool when
3499 # decomposing the release image.
3504 ['msvs_use_common_release', {
3505 'includes': ['release.gypi'],
3507 ['release_valgrind_build==0 and tsan==0', {
3510 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3514 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3515 'MEMORY_SANITIZER_INITIAL_SIZE',
3516 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3517 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3521 'defines': ['NO_TCMALLOC'],
3523 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3524 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3525 # It seems to work fine with Ubuntu 12 headers though, so use it
3526 # in official builds.
3527 ['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")', {
3528 'target_conditions': [
3529 ['chromium_code==1', {
3530 # Non-chromium code is not guaranteed to compile cleanly
3531 # with _FORTIFY_SOURCE. Also, fortified build may fail
3532 # when optimizations are disabled, so only do that for Release
3535 '_FORTIFY_SOURCE=2',
3540 ['OS=="linux" or OS=="android"', {
3541 'target_conditions': [
3542 ['_toolset=="target"', {
3544 '<@(release_extra_cflags)',
3547 ['enable_resource_whitelist_generation==1', {
3549 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3558 'NS_BLOCK_ASSERTIONS=1',
3564 # Concrete configurations
3567 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3570 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3575 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3576 'target_conditions': [
3577 [ '_type=="executable"', {
3578 # To get a real .dSYM bundle produced by dsymutil, set the
3579 # debug information format to dwarf-with-dsym. Since
3580 # strip_from_xcode will not be used, set Xcode to do the
3581 # stripping as well.
3583 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3584 'DEPLOYMENT_POSTPROCESSING': 'YES',
3585 'STRIP_INSTALLED_PRODUCT': 'YES',
3592 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3594 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3597 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3605 'target_defaults': {
3610 # TODO(glider): enable the default options on other systems.
3612 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3614 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3620 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3621 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3622 'target_defaults': {
3624 '-Wl,--fatal-warnings',
3628 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3629 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
3630 'target_defaults': {
3636 ['os_posix==1 and chromeos==0', {
3637 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3638 # and we want to avoid overriding this, so stack-protector is only
3639 # enabled when not building on Chrome OS.
3640 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3642 'target_defaults': {
3644 '-fstack-protector',
3645 '--param=ssp-buffer-size=4',
3649 ['os_posix==1 and OS=="linux"', {
3651 '_LARGEFILE_SOURCE',
3652 '_LARGEFILE64_SOURCE',
3653 '_FILE_OFFSET_BITS=64',
3656 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3657 'target_defaults': {
3658 # Enable -Werror by default, but put it in a variable so it can
3659 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3661 'werror%': '-Werror',
3662 'libraries_for_target%': '',
3665 '_FILE_OFFSET_BITS=64',
3668 '<(werror)', # See note above about the werror variable.
3670 '-fno-strict-aliasing', # See http://crbug.com/32204
3672 # Don't warn about unused function params. We use those everywhere.
3673 '-Wno-unused-parameter',
3674 # Don't warn about the "struct foo f = {0};" initialization pattern.
3675 '-Wno-missing-field-initializers',
3676 # Don't export any symbols (for example, to plugins we dlopen()).
3677 # Note: this is *required* to make some plugins work.
3678 '-fvisibility=hidden',
3684 '-fno-threadsafe-statics',
3685 # Make inline functions have hidden visiblity by default.
3686 # Surprisingly, not covered by -fvisibility=hidden.
3687 '-fvisibility-inlines-hidden',
3688 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3689 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3693 '-pthread', '-Wl,-z,noexecstack',
3696 '<(libraries_for_target)',
3701 'debug_optimize%': '0',
3707 '-O>(debug_optimize)',
3712 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3713 # TODO(jdduke) Re-enable on mips after resolving linking
3714 # issues with libc++ (crbug.com/456380).
3716 # Warn in case of text relocations.
3717 '-Wl,--warn-shared-textrel',
3720 ['OS=="android" and android_full_debug==0', {
3721 # Some configurations are copied from Release_Base to reduce
3724 'debug_optimize%': 's',
3728 '-ffunction-sections',
3735 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3736 # We don't omit frame pointers on arm64 since they are required
3737 # to correctly unwind stackframes which contain system library
3738 # function frames (crbug.com/391706).
3740 '-fomit-frame-pointer',
3743 ['OS=="linux" and target_arch=="ia32"', {
3745 '-Wl,--no-as-needed',
3748 ['debug_unwind_tables==1', {
3749 'cflags': ['-funwind-tables'],
3751 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3752 'defines': ['NO_UNWIND_TABLES'],
3754 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3755 # definitions in to the right scope to use them when setting
3756 # linux_use_debug_fission, so it can be used here alone.
3757 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3758 'cflags': ['-gsplit-dwarf'],
3764 'release_optimize%': '2',
3765 # Binaries become big and gold is unable to perform GC
3766 # and remove unused sections for some of test targets
3767 # on 32 bit platform.
3768 # (This is currently observed only in chromeos valgrind bots)
3769 # The following flag is to disable --gc-sections linker
3770 # option for these bots.
3771 'no_gc_sections%': 0,
3773 # TODO(bradnelson): reexamine how this is done if we change the
3774 # expansion of configurations
3775 'release_valgrind_build%': 0,
3778 '-O<(release_optimize)',
3779 # Don't emit the GCC version ident directives, they just end up
3780 # in the .comment section taking up binary size.
3782 # Put data and code in their own sections, so that unused symbols
3783 # can be removed at link time with --gc-sections.
3785 '-ffunction-sections',
3788 # Specifically tell the linker to perform optimizations.
3789 # See http://lwn.net/Articles/192624/ .
3794 ['no_gc_sections==0', {
3796 '-Wl,--gc-sections',
3799 ['OS=="android" 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=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3808 # TODO(jdduke) Re-enable on mips after resolving linking
3809 # issues with libc++ (crbug.com/456380).
3811 # Warn in case of text relocations.
3812 '-Wl,--warn-shared-textrel',
3817 'release_optimize%': 's',
3822 '-fno-omit-frame-pointer',
3826 ['profiling_full_stack_frames==1', {
3829 '-fno-optimize-sibling-calls',
3834 ['release_unwind_tables==1', {
3835 'cflags': ['-funwind-tables'],
3837 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3838 'defines': ['NO_UNWIND_TABLES'],
3844 ['target_arch=="ia32"', {
3845 'target_conditions': [
3846 ['_toolset=="target"', {
3848 # Needed so that libs with .s files (e.g. libicudata.a)
3849 # are compatible with the general 32-bit-ness.
3852 # All floating-point computations on x87 happens in 80-bit
3853 # precision. Because the C and C++ language standards allow
3854 # the compiler to keep the floating-point values in higher
3855 # precision than what's specified in the source and doing so
3856 # is more efficient than constantly rounding up to 64-bit or
3857 # 32-bit precision as specified in the source, the compiler,
3858 # especially in the optimized mode, tries very hard to keep
3859 # values in x87 floating-point stack (in 80-bit precision)
3860 # as long as possible. This has important side effects, that
3861 # the real value used in computation may change depending on
3862 # how the compiler did the optimization - that is, the value
3863 # kept in 80-bit is different than the value rounded down to
3864 # 64-bit or 32-bit. There are possible compiler options to
3865 # make this behavior consistent (e.g. -ffloat-store would keep
3866 # all floating-values in the memory, thus force them to be
3867 # rounded to its original precision) but they have significant
3868 # runtime performance penalty.
3870 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3871 # which keep floating-point values in SSE registers in its
3872 # native precision (32-bit for single precision, and 64-bit
3873 # for double precision values). This means the floating-point
3874 # value used during computation does not change depending on
3875 # how the compiler optimized the code, since the value is
3876 # always kept in its specified precision.
3878 # Refer to http://crbug.com/348761 for rationale behind SSE2
3879 # being a minimum requirement for 32-bit Linux builds and
3880 # http://crbug.com/313032 for an example where this has "bit"
3885 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3892 # Use gold linker for Android ia32 target.
3902 ['target_arch=="x64"', {
3903 'target_conditions': [
3904 ['_toolset=="target"', {
3906 # Use gold linker for Android x64 target.
3923 ['target_arch=="arm"', {
3924 'target_conditions': [
3925 ['_toolset=="target"', {
3929 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3930 # has changed whenever it encounters a varargs function. This
3931 # silences those warnings, as they are not helpful and
3932 # clutter legitimate warnings.
3936 ['clang==1 and arm_arch!="" and OS!="android"', {
3938 '-target arm-linux-gnueabihf',
3941 '-target arm-linux-gnueabihf',
3946 '-march=<(arm_arch)',
3949 ['use_lto==1 or use_lto_o2==1', {
3951 '-march=<(arm_arch)',
3956 ['clang==1 and OS!="android"', {
3958 # We need to disable clang's builtin assembler as it can't
3959 # handle several asm files, crbug.com/124610
3960 '-no-integrated-as',
3965 '-mtune=<(arm_tune)',
3968 ['use_lto==1 or use_lto_o2==1', {
3970 '-mtune=<(arm_tune)',
3980 ['use_lto==1 or use_lto_o2==1', {
3987 ['arm_float_abi!=""', {
3989 '-mfloat-abi=<(arm_float_abi)',
3992 ['use_lto==1 or use_lto_o2==1', {
3994 '-mfloat-abi=<(arm_float_abi)',
4004 ['use_lto==1 or use_lto_o2==1', {
4012 # Most of the following flags are derived from what Android
4013 # uses by default when building for arm, reference for which
4014 # can be found in the following file in the Android NDK:
4015 # toolchains/arm-linux-androideabi-4.9/setup.mk
4017 # The tree-sra optimization (scalar replacement for
4018 # aggregates enabling subsequent optimizations) leads to
4019 # invalid code generation when using the Android NDK's
4020 # compiler (r5-r7). This can be verified using
4021 # webkit_unit_tests' WTF.Checked_int8_t test.
4023 # The following option is disabled to improve binary
4024 # size and performance in gcc 4.9.
4025 '-fno-caller-saves',
4028 # Android now supports .relro sections properly.
4029 # NOTE: While these flags enable the generation of .relro
4030 # sections, the generated libraries can still be loaded on
4031 # older Android platform versions.
4038 ['gcc_version==48 and clang==0', {
4040 # The following 5 options are disabled to save on
4041 # binary size in GCC 4.8.
4042 '-fno-partial-inlining',
4043 '-fno-early-inlining',
4044 '-fno-tree-copy-prop',
4045 '-fno-tree-loop-optimize',
4046 '-fno-move-loop-invariants',
4050 'cflags': [ '-mthumb-interwork' ],
4054 # Thumb code with frame pointer makes chrome crash
4057 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
4058 # The perf report sometimes incorrectly attributes
4059 # code from tail calls.
4060 '-fno-optimize-sibling-calls',
4063 '-fomit-frame-pointer',
4068 # Clang does not support the following options.
4070 '-mthumb-interwork',
4071 '-finline-limit=64',
4073 '-fno-caller-saves',
4077 # TODO(hans) Enable integrated-as (crbug.com/124610).
4078 '-no-integrated-as',
4079 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4082 ['clang==1 and linux_use_bundled_gold==0', {
4084 # Let clang find the ld.gold in the NDK.
4085 '--gcc-toolchain=<(android_toolchain)/..',
4090 '-marm', # Required for frame pointer based stack traces.
4097 # We set arm_arch to "" so that -march compiler option
4098 # is not set. Otherwise a gcc bug that would complain
4099 # about it conflicting with '-mcpu=cortex-a9'. The flag
4100 # '-march=armv7-a' is actually redundant anyway because
4101 # it is enabled by default when we built the toolchain.
4102 # And using '-mcpu=cortex-a9' should be sufficient.
4105 # Breakpad requires symbols with debugging information
4109 # We want to statically link libstdc++/libgcc_s.
4110 '-static-libstdc++',
4114 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4115 # define their own cflags for arm builds that could
4116 # conflict with the flags we set here (e.g.
4117 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4126 ['target_arch=="arm64"', {
4127 'target_conditions': [
4128 ['_toolset=="target"', {
4132 '-fstack-protector', # stack protector is always enabled on arm64.
4139 ['target_arch=="mipsel"', {
4140 'target_conditions': [
4141 ['_toolset=="target"', {
4143 ['mips_arch_variant=="r6"', {
4146 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ],
4147 'ldflags': [ '-target mipsel-linux-gnu', ],
4149 'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
4151 ['clang==0 and OS=="android"', {
4152 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4156 ['mips_arch_variant=="r2"', {
4158 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4159 'cflags': ['-m<(mips_fpu_mode)'],
4164 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
4165 'ldflags': [ '-target mipsel-linux-android', ],
4167 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32r2'],
4168 'ldflags': [ '-target mipsel-linux-gnu', ],
4172 'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
4176 ['mips_arch_variant=="r1"', {
4181 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
4182 'ldflags': [ '-target mipsel-linux-android', ],
4184 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32'],
4185 'ldflags': [ '-target mipsel-linux-gnu', ],
4189 'cflags': ['-mips32', '-Wa,-mips32', ],
4195 # Clang does not support the following options.
4196 '-finline-limit=64',
4199 # TODO(gordanac) Enable integrated-as.
4200 '-no-integrated-as',
4203 ['clang==1 and OS=="android"', {
4205 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4208 # Let clang find the ld in the NDK.
4209 '--gcc-toolchain=<(android_toolchain)/..',
4212 ['mips_dsp_rev==1', {
4213 'cflags': ['-mdsp'],
4215 ['mips_dsp_rev==2', {
4216 'cflags': ['-mdspr2'],
4220 '-m<(mips_float_abi)-float'
4223 '-Wl,--no-keep-memory'
4226 '-Wno-uninitialized',
4231 ['target_arch=="mips64el"', {
4232 'target_conditions': [
4233 ['_toolset=="target"', {
4235 ['mips_arch_variant=="r6"', {
4236 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4237 'ldflags': ['-mips64r6'],
4239 ['mips_arch_variant=="r2"', {
4240 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4241 'ldflags': ['-mips64r2'],
4245 '-Wno-uninitialized',
4259 'target_conditions': [
4260 ['_toolset=="target"', {
4262 '--sysroot=<(sysroot)',
4265 '--sysroot=<(sysroot)',
4266 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4272 # TODO(thakis): Remove, http://crbug.com/263960
4273 '-Wno-reserved-user-defined-literal',
4276 # gnu++11 instead of c++11 is needed because some code uses
4277 # typeof() (a GNU extension).
4278 # TODO(thakis): Eventually switch this to c++11 instead,
4279 # http://crbug.com/427584
4283 ['clang==0 and host_clang==1', {
4284 'target_conditions': [
4285 ['_toolset=="host"', {
4286 'cflags_cc': [ '-std=gnu++11', ],
4290 ['clang==1 and clang_use_chrome_plugins==1', {
4292 '<@(clang_chrome_plugins_flags)',
4295 ['clang==1 and clang_load!=""', {
4297 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4300 ['clang==1 and clang_add_plugin!=""', {
4302 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4305 ['clang==1 and target_arch=="ia32"', {
4307 # Else building libyuv gives clang's register allocator issues,
4308 # see llvm.org/PR15798 / crbug.com/233709
4309 '-momit-leaf-frame-pointer',
4310 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4311 '-mstack-alignment=16',
4315 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4317 # See http://crbug.com/110262
4318 '-fcolor-diagnostics',
4321 # Common options for AddressSanitizer, LeakSanitizer,
4322 # ThreadSanitizer and MemorySanitizer.
4323 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4324 'target_conditions': [
4325 ['_toolset=="target"', {
4327 '-fno-omit-frame-pointer',
4328 '-gline-tables-only',
4331 '-fomit-frame-pointer',
4336 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4337 'target_conditions': [
4338 ['_toolset=="target"', {
4340 # Functions interposed by the sanitizers can make ld think
4341 # that some libraries aren't needed when they actually are,
4342 # http://crbug.com/234010. As workaround, disable --as-needed.
4346 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4347 'MEMORY_SANITIZER_INITIAL_SIZE',
4353 'target_conditions': [
4354 ['_toolset=="target"', {
4356 '-fsanitize=address',
4357 # TODO(earthdok): Re-enable. http://crbug.com/427202
4358 #'-fsanitize-blacklist=<(asan_blacklist)',
4361 '-fsanitize=address',
4368 '-mllvm -asan-globals=0', # http://crbug.com/352073
4374 'target_conditions': [
4375 ['_toolset=="target"', {
4377 # FIXME: work on enabling more flags and getting rid of false
4378 # positives. http://crbug.com/174801.
4379 '-fsanitize=bounds',
4380 '-fsanitize=float-divide-by-zero',
4381 '-fsanitize=integer-divide-by-zero',
4383 '-fsanitize=object-size',
4384 '-fsanitize=return',
4385 '-fsanitize=returns-nonnull-attribute',
4386 '-fsanitize=shift-exponent',
4387 '-fsanitize=signed-integer-overflow',
4388 '-fsanitize=unreachable',
4389 '-fsanitize=vla-bound',
4390 '-fsanitize-blacklist=<(ubsan_blacklist)',
4391 # Employ the experimental PBQP register allocator to avoid
4392 # slow compilation on files with too many basic blocks.
4393 # See http://crbug.com/426271.
4394 '-mllvm -regalloc=pbqp',
4395 # Speculatively use coalescing to slightly improve the code
4396 # generated by PBQP regallocator. May increase compile time.
4397 '-mllvm -pbqp-coalescing',
4406 '-fsanitize=undefined',
4409 'UNDEFINED_SANITIZER',
4415 'target_conditions': [
4416 ['_toolset=="target"', {
4419 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4431 'UNDEFINED_SANITIZER',
4436 ['asan_coverage!=0 and sanitizer_coverage==0', {
4437 'target_conditions': [
4438 ['_toolset=="target"', {
4440 '-fsanitize-coverage=<(asan_coverage)',
4443 'SANITIZER_COVERAGE',
4448 ['sanitizer_coverage!=0', {
4449 'target_conditions': [
4450 ['_toolset=="target"', {
4452 '-fsanitize-coverage=<(sanitizer_coverage)',
4455 'SANITIZER_COVERAGE',
4460 ['asan_field_padding!=0', {
4461 'target_conditions': [
4462 ['_toolset=="target"', {
4464 '-fsanitize-address-field-padding=<(asan_field_padding)',
4470 'target_conditions': [
4471 ['_toolset=="target"', {
4480 'WTF_USE_LEAK_SANITIZER=1',
4486 'target_conditions': [
4487 ['_toolset=="target"', {
4489 '-fsanitize=thread',
4490 '-fsanitize-blacklist=<(tsan_blacklist)',
4493 '-fsanitize=thread',
4497 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4498 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4504 'target_conditions': [
4505 ['_toolset=="target"', {
4507 '-fsanitize=memory',
4508 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4509 '-fsanitize-blacklist=<(msan_blacklist)',
4512 '-fsanitize=memory',
4520 ['use_instrumented_libraries==1', {
4522 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4525 ['use_prebuilt_instrumented_libraries==1', {
4527 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
4530 ['use_custom_libcxx==1', {
4532 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4535 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4536 'target_conditions' : [
4537 # crazy_linker has an upstream gyp file we can't edit, and we
4538 # don't want to instrument it.
4539 ['_toolset=="target" and _target_name!="crazy_linker"', {
4541 '-finstrument-functions',
4542 # Allow mmx intrinsics to inline, so that the
4543 #0 compiler can expand the intrinsics.
4544 '-finstrument-functions-exclude-file-list=mmintrin.h',
4547 ['_toolset=="target" and OS=="android"', {
4549 # Avoids errors with current NDK:
4550 # "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"
4551 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4556 ['linux_dump_symbols==1', {
4559 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4560 'target_conditions': [
4561 ['_toolset=="target"', {
4563 # Attempt to use less memory to prevent the linker from
4564 # running out of address space. Considering installing a
4565 # 64-bit kernel and switching to a 64-bit linker.
4566 '-Wl,--no-keep-memory',
4573 ['use_allocator!="tcmalloc"', {
4574 'defines': ['NO_TCMALLOC'],
4576 ['linux_use_gold_flags==1', {
4577 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4579 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4580 'ldflags': [ '-fuse-ld=gold', ],
4582 'target_conditions': [
4583 ['_toolset=="target"', {
4585 # Experimentation found that using four linking threads
4586 # saved ~20% of link time.
4587 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4588 # Only apply this to the target linker, since the host
4589 # linker might not be gold, but isn't used much anyway.
4590 # TODO(raymes): Disable threading because gold is frequently
4591 # crashing on the bots: crbug.com/161942.
4593 # '-Wl,--thread-count=4',
4596 # TODO(thestig): Enable this for disabled cases.
4597 [ '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', {
4599 '-Wl,--detect-odr-violations',
4606 ['release_valgrind_build==0 and order_profiling==0 and asan==0 and msan==0 and lsan==0 and tsan==0', {
4607 'target_conditions': [
4608 ['_toolset=="target"', {
4610 '-Wl,--icf=<(gold_icf_level)',
4617 ['linux_use_bundled_binutils==1', {
4619 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4622 ['linux_use_bundled_gold==1 and '
4623 'not (clang==0 and (use_lto==1 or use_lto_o2==1))', {
4624 # Put our binutils, which contains gold in the search path. We pass
4625 # the path to gold to the compiler. gyp leaves unspecified what the
4626 # cwd is when running the compiler, so the normal gyp path-munging
4627 # fails us. This hack gets the right path.
4629 # Disabled when using GCC LTO because GCC also uses the -B search
4630 # path at link time to find "as", and our bundled "as" can only
4633 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4636 # Some binutils 2.23 releases may or may not have new dtags enabled,
4637 # but they are all compatible with --disable-new-dtags,
4638 # because the new dynamic tags are not created by default.
4639 ['binutils_version>=223', {
4640 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4641 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4642 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4643 # inside this file to allow usage of --no-as-needed and removal of
4646 '-Wl,--disable-new-dtags',
4649 ['gcc_version>=47 and clang==0', {
4650 'target_conditions': [
4651 ['_toolset=="target"', {
4654 # See comment for -Wno-c++11-narrowing.
4656 # TODO(thakis): Remove, http://crbug.com/263960
4657 '-Wno-literal-suffix',
4662 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4663 'target_conditions': [
4664 ['_toolset=="host"', {
4667 # See comment for -Wno-c++11-narrowing.
4669 # TODO(thakis): Remove, http://crbug.com/263960
4670 '-Wno-literal-suffix',
4678 # FreeBSD-specific options; note that most FreeBSD options are set above,
4681 'target_defaults': {
4683 '-Wl,--no-keep-memory',
4687 # Android-specific options; note that most are set above with Linux.
4690 # This is a unique identifier for a given build. It's used for
4691 # identifying various build artifacts corresponding to a particular
4692 # build of chrome (e.g. where to find archived symbols).
4693 'chrome_build_id%': '',
4695 # Figure this out early since it needs symbols from libgcc.a, so it
4696 # has to be before that in the set of libraries.
4697 ['component=="shared_library"', {
4698 'android_libcpp_library': 'c++_shared',
4700 'android_libcpp_library': 'c++_static',
4704 # Placing this variable here prevents from forking libvpx, used
4705 # by remoting. Remoting is off, so it needn't built,
4706 # so forking it's deps seems like overkill.
4707 # But this variable need defined to properly run gyp.
4708 # A proper solution is to have an OS==android conditional
4709 # in third_party/libvpx/libvpx.gyp to define it.
4710 'libvpx_path': 'lib/linux/arm',
4712 'target_defaults': {
4714 'release_extra_cflags%': '',
4716 # If we're using the components build, append "cr" to all shared
4717 # libraries to avoid naming collisions with android system library
4718 # versions with the same name (e.g. skia, icu).
4719 ['component=="shared_library"', {
4720 'android_product_extension': 'cr.so',
4722 'android_product_extension': 'so',
4726 'target_conditions': [
4727 ['_type=="shared_library"', {
4728 'product_extension': '<(android_product_extension)',
4731 # Settings for building device targets using Android's toolchain.
4732 # These are based on the setup.mk file from the Android NDK.
4734 # The NDK Android executable link step looks as follows:
4736 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4737 # $(PRIVATE_OBJECTS) <-- The .o that we built
4738 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4739 # $(TARGET_LIBGCC) <-- libgcc.a
4740 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4741 # $(PRIVATE_LDLIBS) <-- System .so
4742 # $(TARGET_CRTEND_O) <-- crtend.o
4744 # For now the above are approximated for executables by adding
4745 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4748 # The NDK Android shared library link step looks as follows:
4750 # $(PRIVATE_OBJECTS) <-- The .o that we built
4751 # -l,--whole-archive
4752 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4753 # -l,--no-whole-archive
4754 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4755 # $(TARGET_LIBGCC) <-- libgcc.a
4756 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4757 # $(PRIVATE_LDLIBS) <-- System .so
4759 # For now, assume that whole static libraries are not needed.
4761 # For both executables and shared libraries, add the proper
4762 # libgcc.a to the start of libraries which puts it in the
4763 # proper spot after .o and .a files get linked in.
4765 # TODO: The proper thing to do longer-tem would be proper gyp
4766 # support for a custom link command line.
4767 ['_toolset=="target"', {
4769 '-pthread', # Not supported by Android toolchain.
4772 '-ffunction-sections',
4775 '-fstack-protector',
4777 '-finline-limit=64',
4778 '<@(release_extra_cflags)',
4779 '--sysroot=<(android_ndk_sysroot)',
4780 # NOTE: The libc++ header include paths below are specified in
4781 # cflags rather than include_dirs because they need to come
4782 # after include_dirs.
4783 # The include ordering here is important; change with caution.
4784 '-isystem<(android_libcpp_include)',
4785 '-isystem<(android_ndk_root)/sources/cxx-stl/llvm-libc++abi/libcxxabi/include',
4786 '-isystem<(android_ndk_root)/sources/android/support/include',
4790 '__GNU_SOURCE=1', # Necessary for clone()
4791 'CHROME_BUILD_ID="<(chrome_build_id)"',
4792 # The NDK has these things, but doesn't define the constants
4793 # to say that it does. Define them here instead.
4797 '-pthread', # Not supported by Android toolchain.
4800 '-Wl,--build-id=sha1',
4801 '-Wl,--no-undefined',
4802 '--sysroot=<(android_ndk_sysroot)',
4804 '-L<(android_libcpp_libs_dir)',
4805 # Don't allow visible symbols from libgcc or libc++ to be
4807 '-Wl,--exclude-libs=libgcc.a',
4808 '-Wl,--exclude-libs=libc++_static.a',
4809 # Don't allow visible symbols from libraries that contain
4810 # assembly code with symbols that aren't hidden properly.
4811 # http://crbug.com/448386
4812 '-Wl,--exclude-libs=libcommon_audio.a',
4813 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4814 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4815 '-Wl,--exclude-libs=libiSACFix.a',
4816 '-Wl,--exclude-libs=libisac_neon.a',
4817 '-Wl,--exclude-libs=libopus.a',
4818 '-Wl,--exclude-libs=libvpx.a',
4821 '-l<(android_libcpp_library)',
4823 # Manually link the libgcc.a that the cross compiler uses.
4824 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4830 ['component=="static_library"', {
4831 'target_conditions': [
4832 ['use_native_jni_exports==0', {
4833 # Use a linker version script to strip JNI exports from
4834 # binaries which have not specifically asked to use them.
4836 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4843 # Clang with libc++ does not require an explicit atomic
4844 # library reference.
4848 # Work around incompatibilities between bionic and clang
4850 '-D__compiler_offsetof=__builtin_offsetof',
4851 '-Dnan=__builtin_nan',
4854 ['target_arch=="arm"', {
4856 '-target arm-linux-androideabi',
4859 '-target arm-linux-androideabi',
4862 ['target_arch=="ia32"', {
4864 '-target x86-linux-androideabi',
4867 '-target x86-linux-androideabi',
4870 # Place holder for x64 support, not tested.
4871 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4872 ['target_arch=="x64"', {
4874 '-target x86_64-linux-androideabi',
4877 '-target x86_64-linux-androideabi',
4884 # Android build relies on -Wl,--gc-sections removing
4885 # unreachable code. ASan instrumentation for globals inhibits
4886 # this and results in a library with unresolvable relocations.
4887 # TODO(eugenis): find a way to reenable this.
4888 '-mllvm -asan-globals=0',
4891 ['target_arch == "arm" and order_profiling==0', {
4893 # Enable identical code folding to reduce size.
4894 '-Wl,--icf=<(gold_icf_level)',
4897 ['target_arch=="ia32"', {
4898 # The x86 toolchain currently has problems with stack-protector.
4900 '-fstack-protector',
4903 '-fno-stack-protector',
4907 'target_conditions': [
4908 ['_type=="executable"', {
4909 # Force android tools to export the "main" symbol so they can be
4910 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4911 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4912 # when ICS support will be dropped.
4915 '-fvisibility=default',
4919 '-Wl,--gc-sections',
4920 '-Wl,-z,nocopyreloc',
4923 # crtbegin_dynamic.o should be the last item in ldflags.
4924 '<(android_ndk_lib)/crtbegin_dynamic.o',
4927 # crtend_android.o needs to be the last item in libraries.
4928 # Do not add any libraries after this!
4929 '<(android_ndk_lib)/crtend_android.o',
4932 ['_type=="shared_library" or _type=="loadable_module"', {
4934 '-Wl,-shared,-Bsymbolic',
4935 # crtbegin_so.o should be the last item in ldflags.
4936 '<(android_ndk_lib)/crtbegin_so.o',
4939 # crtend_so.o needs to be the last item in libraries.
4940 # Do not add any libraries after this!
4941 '<(android_ndk_lib)/crtend_so.o',
4946 # Settings for building host targets using the system toolchain.
4947 ['_toolset=="host"', {
4949 # Due to issues in Clang build system, using ASan on 32-bit
4950 # binaries on x86_64 host is problematic.
4951 # TODO(eugenis): re-enable.
4952 '-fsanitize=address',
4955 '-fsanitize=address',
4956 '-Wl,-z,noexecstack',
4957 '-Wl,--gc-sections',
4960 '-Wl,--warn-shared-textrel',
4961 '-Wl,--fatal-warnings',
4964 # Settings for building host targets on mac.
4965 ['_toolset=="host" and host_os=="mac"', {
4975 'cflags!': ['-fvisibility=hidden'],
4976 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4978 ['OS=="mac" or OS=="ios"', {
4979 'target_defaults': {
4982 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4983 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4984 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4985 'COPY_PHASE_STRIP': 'NO',
4986 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4987 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4988 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4989 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4990 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4991 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4992 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4993 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4994 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4995 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4996 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4997 'GCC_VERSION': '4.2',
4998 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4999 'USE_HEADERMAP': 'NO',
5004 # Don't warn about unused function parameters.
5005 '-Wno-unused-parameter',
5006 # Don't warn about the "struct foo f = {0};" initialization
5008 '-Wno-missing-field-initializers',
5011 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
5012 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
5014 # Note that the prebuilt Clang binaries should not be used for iOS
5015 # development except for ASan builds.
5017 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
5018 # Warn if automatic synthesis is triggered with
5019 # the -Wobjc-missing-property-synthesis flag.
5020 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
5021 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
5023 # This warns on selectors from Cocoa headers (-length, -set).
5024 # cfe-dev is currently discussing the merits of this warning.
5025 # TODO(thakis): Reevaluate what to do with this, based one
5026 # cfe-dev discussion.
5027 '-Wno-selector-type-mismatch',
5030 ['clang_xcode==0', {
5031 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
5032 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
5036 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
5038 '<@(clang_chrome_plugins_flags)',
5041 ['clang==1 and clang_xcode==0 and clang_load!=""', {
5043 '-Xclang', '-load', '-Xclang', '<(clang_load)',
5046 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
5048 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
5051 ['clang==1 and "<(GENERATOR)"=="ninja"', {
5053 # See http://crbug.com/110262
5054 '-fcolor-diagnostics',
5057 ['OS=="ios" and target_subarch!="arm32" and \
5058 "<(GENERATOR)"=="xcode"', {
5060 # TODO(ios): when building Chrome for iOS on 64-bit platform
5061 # with Xcode, the -Wshorted-64-to-32 warning is automatically
5062 # enabled. This cause failures when compiling protobuf code,
5063 # so disable the warning. http://crbug.com/359107
5064 '-Wno-shorten-64-to-32',
5072 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
5078 '-fsanitize=address',
5079 '-mllvm -asan-globals=0', # http://crbug.com/352073
5080 '-gline-tables-only',
5084 ['asan_coverage!=0 and sanitizer_coverage==0', {
5085 'target_conditions': [
5086 ['_toolset=="target"', {
5088 '-fsanitize-coverage=<(asan_coverage)',
5091 'SANITIZER_COVERAGE',
5096 ['sanitizer_coverage!=0', {
5097 'target_conditions': [
5098 ['_toolset=="target"', {
5100 '-fsanitize-coverage=<(sanitizer_coverage)',
5103 'SANITIZER_COVERAGE',
5109 'target_conditions': [
5110 ['_type!="static_library"', {
5111 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5116 '-fsanitize=address',
5120 ['mac_write_linker_maps==1', {
5123 '-Wl,-map,>(_target_name).map',
5130 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5131 'target_conditions': [
5132 ['_type=="executable"', {
5138 # Define copy_asan_dylib_path in a variable ending in
5139 # _path so that gyp understands it's a path and
5140 # performs proper relativization during dict merging.
5141 'copy_asan_dylib_path':
5142 'mac/copy_asan_runtime_dylib.sh',
5144 'postbuild_name': 'Copy ASan runtime dylib',
5146 '<(copy_asan_dylib_path)',
5155 ], # target_conditions
5156 }, # target_defaults
5157 }], # OS=="mac" or OS=="ios"
5159 'target_defaults': {
5161 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5162 # with common names, like 'check', 'require', and 'verify'.
5163 # (Included by system header. Also exists on iOS but not included.)
5164 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5165 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5168 # These should end with %, but there seems to be a bug with % in
5169 # variables that are intended to be set to different values in
5170 # different targets, like these.
5171 'mac_pie': 1, # Most executables can be position-independent.
5172 # Strip debugging symbols from the target.
5173 'mac_strip': '<(mac_strip_release)',
5177 ['mac_want_real_dsym=="default"', {
5180 'mac_real_dsym': '<(mac_want_real_dsym)'
5185 ['mac_want_real_dsym=="default"', {
5186 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5188 'mac_real_dsym': '<(mac_want_real_dsym)'
5197 ['branding=="Chrome" and buildtype=="Official"', {
5200 # The Google Chrome Framework dSYM generated by dsymutil has
5201 # grown larger than 4GB, which dsymutil can't handle. Reduce
5202 # the amount of debug symbols.
5203 '-fno-standalone-debug', # See http://crbug.com/479841
5208 }, # configuration "Release"
5211 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5212 # (Equivalent to -fPIC)
5213 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5214 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5215 # Keep pch files below xcodebuild/.
5216 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5218 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5219 # xcode_setting, but not until all downstream projects' mac bots are
5220 # using xcode >= 4.6, because that's when the default value of the
5221 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5222 # setting is a no-op as far as xcode is concerned, but the compiler
5223 # behaves differently based on whether -fno-strict-aliasing is
5225 '-fno-strict-aliasing', # See http://crbug.com/32204.
5228 'target_conditions': [
5229 ['_type=="executable"', {
5232 # Arranges for data (heap) pages to be protected against
5233 # code execution when running on Mac OS X 10.7 ("Lion"), and
5234 # ensures that the position-independent executable (PIE) bit
5235 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5237 # Define change_mach_o_flags in a variable ending in _path
5238 # so that GYP understands it's a path and performs proper
5239 # relativization during dict merging.
5240 'change_mach_o_flags_path':
5241 'mac/change_mach_o_flags_from_xcode.sh',
5242 'change_mach_o_flags_options%': [
5244 'target_conditions': [
5245 ['mac_pie==0 or release_valgrind_build==1', {
5246 # Don't enable PIE if it's unwanted. It's unwanted if
5247 # the target specifies mac_pie=0 or if building for
5248 # Valgrind, because Valgrind doesn't understand slide.
5249 # See the similar mac_pie/release_valgrind_build check
5251 'change_mach_o_flags_options': [
5257 'postbuild_name': 'Change Mach-O Flags',
5259 '<(change_mach_o_flags_path)',
5260 '>@(change_mach_o_flags_options)',
5264 'target_conditions': [
5265 ['mac_pie==1 and release_valgrind_build==0', {
5266 # Turn on position-independence (ASLR) for executables. When
5267 # PIE is on for the Chrome executables, the framework will
5268 # also be subject to ASLR.
5269 # Don't do this when building for Valgrind, because Valgrind
5270 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5271 # understand slide, and get rid of the Valgrind check.
5274 '-Wl,-pie', # Position-independent executable (MH_PIE)
5280 ['(_type=="executable" or _type=="shared_library" or \
5281 _type=="loadable_module") and mac_strip!=0', {
5282 'target_conditions': [
5283 ['mac_real_dsym == 1', {
5284 # To get a real .dSYM bundle produced by dsymutil, set the
5285 # debug information format to dwarf-with-dsym. Since
5286 # strip_from_xcode will not be used, set Xcode to do the
5287 # stripping as well.
5291 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5292 'DEPLOYMENT_POSTPROCESSING': 'YES',
5293 'STRIP_INSTALLED_PRODUCT': 'YES',
5295 # Only strip non-ASan builds.
5297 'target_conditions': [
5298 ['_type=="shared_library" or _type=="loadable_module"', {
5299 # The Xcode default is to strip debugging symbols
5300 # only (-S). Local symbols should be stripped as
5301 # well, which will be handled by -x. Xcode will
5302 # continue to insert -S when stripping even when
5303 # additional flags are added with STRIPFLAGS.
5305 }], # _type=="shared_library" or _type=="loadable_module"
5306 ], # target_conditions
5312 }, # configuration "Release"
5314 }, { # mac_real_dsym != 1
5315 # To get a fast fake .dSYM bundle, use a post-build step to
5316 # produce the .dSYM and strip the executable. strip_from_xcode
5317 # only operates in the Release configuration.
5321 # Define strip_from_xcode in a variable ending in _path
5322 # so that gyp understands it's a path and performs proper
5323 # relativization during dict merging.
5324 'strip_from_xcode_path': 'mac/strip_from_xcode',
5326 'postbuild_name': 'Strip If Needed',
5327 'action': ['<(strip_from_xcode_path)'],
5331 ], # target_conditions
5332 }], # (_type=="executable" or _type=="shared_library" or
5333 # _type=="loadable_module") and mac_strip!=0
5334 ], # target_conditions
5335 }, # target_defaults
5339 'ios/coverage.gypi',
5341 'target_defaults': {
5342 'xcode_settings' : {
5343 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5346 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5347 # additional flag to suppress the "unknown compiler option" error.
5348 # Restrict this flag to builds that are either compiling with Xcode
5349 # or compiling with Xcode's Clang. This will allow Ninja builds to
5350 # continue failing on unknown compiler options.
5351 # TODO(rohitrao): This flag is temporary and should be removed as
5352 # soon as the iOS bots are updated to use Xcode 5.1.
5353 ['clang_xcode==1', {
5355 '-Wno-unknown-warning-option',
5356 # It's not possible to achieve nullability completeness before
5357 # all builders are running Xcode 7. crbug.com/499809
5358 '-Wno-nullability-completeness',
5362 # Limit the valid architectures depending on "target_subarch".
5363 # This need to include the "arm" architectures but also the "x86"
5364 # ones (they are used when building for the simulator).
5365 ['target_subarch=="arm32"', {
5366 'VALID_ARCHS': ['armv7', 'i386'],
5368 ['target_subarch=="arm64"', {
5369 'VALID_ARCHS': ['arm64', 'x86_64'],
5371 ['target_subarch=="both"', {
5372 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5374 ['use_system_libcxx==1', {
5375 'target_conditions': [
5376 # Only use libc++ when building target for iOS not when building
5377 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5378 # does not support libc++.
5379 ['_toolset=="target"', {
5380 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5384 # The default for deployment target of 7.0+ is libc++, so force
5385 # the old behavior unless libc++ is enabled.
5386 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5390 'target_conditions': [
5391 ['_toolset=="host"', {
5393 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5394 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5403 ['_toolset=="target"', {
5405 # This section should be for overriding host settings. But,
5406 # since we can't negate the iphone deployment target above, we
5407 # instead set it here for target only.
5408 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5409 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5412 ['_type=="executable"', {
5416 'DEPLOYMENT_POSTPROCESSING': 'YES',
5417 'STRIP_INSTALLED_PRODUCT': 'YES',
5422 # Remove dSYM to reduce build time.
5423 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5429 ['chromium_ios_signing', {
5430 # iOS SDK wants everything for device signed.
5431 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5433 'CODE_SIGNING_REQUIRED': 'NO',
5434 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5439 ], # target_conditions
5440 }, # target_defaults
5443 'target_defaults': {
5445 '_WIN32_WINNT=0x0603',
5452 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5453 'WIN32_LEAN_AND_MEAN',
5456 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5457 '_HAS_EXCEPTIONS=0',
5458 # Silence some warnings; we can't switch the the 'recommended'
5459 # versions as they're not available on old OSs.
5460 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5463 ['buildtype=="Official"', {
5464 # In official builds, targets can self-select an optimization
5465 # level by defining a variable named 'optimize', and setting it
5467 # - "size", optimizes for minimal code size - the default.
5468 # - "speed", optimizes for speed over code size.
5469 # - "max", whole program optimization and link-time code
5470 # generation. This is very expensive and should be used
5473 'optimize%': 'size',
5477 # Set /LTCG for the official builds.
5478 'LinkTimeCodeGeneration': '1',
5479 'AdditionalOptions': [
5480 # Set the number of LTCG code-gen threads to eight.
5481 # The default is four. This gives a 5-10% link speedup.
5486 'target_conditions': [
5487 ['optimize=="size"', {
5489 'VCCLCompilerTool': {
5490 # 1, optimizeMinSpace, Minimize Size (/O1)
5491 'Optimization': '1',
5492 # 2, favorSize - Favor small code (/Os)
5493 'FavorSizeOrSpeed': '2',
5498 # This config is used to avoid a problem in ffmpeg, see
5499 # http://crbug.com/264459.
5500 ['optimize=="size_no_ltcg"', {
5502 'VCCLCompilerTool': {
5503 # 1, optimizeMinSpace, Minimize Size (/O1)
5504 'Optimization': '1',
5505 # 2, favorSize - Favor small code (/Os)
5506 'FavorSizeOrSpeed': '2',
5511 ['optimize=="speed"', {
5513 'VCCLCompilerTool': {
5514 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5515 'Optimization': '2',
5516 # 1, favorSpeed - Favor fast code (/Ot)
5517 'FavorSizeOrSpeed': '1',
5522 ['optimize=="max"', {
5523 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5524 # builds. Probably anything that this would catch that
5525 # wouldn't be caught in a normal build isn't going to
5526 # actually be a bug, so the incremental value of C4702 for
5527 # PGO builds is likely very small.
5528 'msvs_disabled_warnings': [
5532 'VCCLCompilerTool': {
5533 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5534 'Optimization': '2',
5535 # 1, favorSpeed - Favor fast code (/Ot)
5536 'FavorSizeOrSpeed': '1',
5537 # This implies link time code generation.
5538 'WholeProgramOptimization': 'true',
5546 ['msvs_xtree_patched!=1', {
5547 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5548 # it's enabled. This will generally only be true for system-level
5549 # installed Express users.
5550 'msvs_disabled_warnings': [
5555 'msvs_system_include_dirs': [
5556 '<(windows_sdk_path)/Include/shared',
5557 '<(windows_sdk_path)/Include/um',
5558 '<(windows_sdk_path)/Include/winrt',
5559 '$(VSInstallDir)/VC/atlmfc/include',
5561 'msvs_cygwin_shell': 0,
5562 'msvs_disabled_warnings': [
5563 # C4091: 'typedef ': ignored on left of 'X' when no variable is
5565 # This happens in a number of Windows headers. Dumb.
5568 # C4127: conditional expression is constant
5569 # This warning can in theory catch dead code and other problems, but
5570 # triggers in far too many desirable cases where the conditional
5571 # expression is either set by macros or corresponds some legitimate
5572 # compile-time constant expression (due to constant template args,
5573 # conditionals comparing the sizes of different types, etc.). Some of
5574 # these can be worked around, but it's not worth it.
5577 # C4351: new behavior: elements of array 'array' will be default
5579 # This is a silly "warning" that basically just alerts you that the
5580 # compiler is going to actually follow the language spec like it's
5581 # supposed to, instead of not following it like old buggy versions
5582 # did. There's absolutely no reason to turn this on.
5585 # C4355: 'this': used in base member initializer list
5586 # It's commonly useful to pass |this| to objects in a class'
5587 # initializer list. While this warning can catch real bugs, most of
5588 # the time the constructors in question don't attempt to call methods
5589 # on the passed-in pointer (until later), and annotating every legit
5590 # usage of this is simply more hassle than the warning is worth.
5593 # C4503: 'identifier': decorated name length exceeded, name was
5595 # This only means that some long error messages might have truncated
5596 # identifiers in the presence of lots of templates. It has no effect
5597 # on program correctness and there's no real reason to waste time
5598 # trying to prevent it.
5601 # C4611: interaction between 'function' and C++ object destruction is
5603 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5604 # suggests using exceptions instead of setjmp/longjmp for C++, but
5605 # Chromium code compiles without exception support. We therefore have
5606 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5607 # means we have to turn off this warning (and be careful about how
5608 # object destruction happens in such cases).
5611 # TODO(maruel): These warnings are level 4. They will be slowly
5612 # removed as code is fixed.
5613 4100, # Unreferenced formal parameter
5614 4121, # Alignment of a member was sensitive to packing
5615 4244, # Conversion from 'type1' to 'type2', possible loss of data
5616 4481, # Nonstandard extension used: override specifier 'keyword'
5617 4505, # Unreferenced local function has been removed
5618 4510, # Default constructor could not be generated
5619 4512, # Assignment operator could not be generated
5620 4610, # Object can never be instantiated
5621 4838, # Narrowing conversion. Doesn't seem to be very useful.
5622 4996, # 'X': was declared deprecated (for GetVersionEx).
5624 # These are variable shadowing warnings that are new in VS2015. We
5625 # should work through these at some point -- they may be removed from
5626 # the RTM release in the /W4 set.
5627 4456, 4457, 4458, 4459,
5630 'VCCLCompilerTool': {
5631 'AdditionalOptions': ['/MP'],
5632 'MinimalRebuild': 'false',
5633 'BufferSecurityCheck': 'true',
5634 'EnableFunctionLevelLinking': 'true',
5635 'RuntimeTypeInfo': 'false',
5636 'WarningLevel': '4',
5637 'WarnAsError': 'true',
5638 'DebugInformationFormat': '3',
5639 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5640 'ExceptionHandling': '0',
5642 'VCLibrarianTool': {
5643 'AdditionalOptions': ['/ignore:4221'],
5644 'AdditionalLibraryDirectories': [
5645 '<(windows_sdk_path)/Lib/win8/um/x86',
5649 'AdditionalDependencies': [
5661 'AdditionalLibraryDirectories': [
5662 '<(windows_sdk_path)/Lib/win8/um/x86',
5664 'GenerateDebugInformation': 'true',
5665 'MapFileName': '$(OutDir)\\$(TargetName).map',
5666 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5667 'FixedBaseAddress': '1',
5670 # 1 == /SUBSYSTEM:CONSOLE
5671 # 2 == /SUBSYSTEM:WINDOWS
5672 # Most of the executables we'll ever create are tests
5673 # and utilities with console output.
5677 'GenerateStublessProxies': 'true',
5678 'TypeLibraryName': '$(InputName).tlb',
5679 'OutputDirectory': '$(IntDir)',
5680 'HeaderFileName': '$(InputName).h',
5681 'DLLDataFileName': '$(InputName).dlldata.c',
5682 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5683 'ProxyFileName': '$(InputName)_p.c',
5685 'VCResourceCompilerTool': {
5687 'AdditionalIncludeDirectories': [
5689 '<(SHARED_INTERMEDIATE_DIR)',
5692 'target_conditions': [
5693 ['_type=="executable"', {
5695 'EmbedManifest': 'true',
5698 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5700 'AdditionalManifestFiles': [
5701 '>(win_exe_compatibility_manifest)',
5707 # Building with Clang on Windows is a work in progress and very
5708 # experimental. See crbug.com/82385.
5709 # Keep this in sync with the similar blocks in build/config/compiler/BUILD.gn
5711 'VCCLCompilerTool': {
5712 'AdditionalOptions': [
5713 # Many files use intrinsics without including this header.
5714 # TODO(hans): Fix those files, or move this to sub-GYPs.
5717 # TODO(hans): Make this list shorter eventually.
5718 '-Qunused-arguments',
5719 '-Wno-c++11-compat-deprecated-writable-strings',
5720 '-Wno-deprecated-declarations',
5722 '-Wno-enum-conversion',
5723 '-Wno-extra-tokens',
5724 '-Wno-ignored-attributes',
5725 '-Wno-incompatible-pointer-types',
5726 '-Wno-int-to-void-pointer-cast',
5727 '-Wno-invalid-noreturn',
5728 '-Wno-logical-op-parentheses',
5730 '-Wno-missing-braces',
5731 '-Wno-missing-declarations',
5732 '-Wno-msvc-include',
5733 '-Wno-null-dereference',
5734 '-Wno-overloaded-virtual',
5736 '-Wno-pointer-sign',
5738 '-Wno-return-type-c-linkage',
5740 '-Wno-sometimes-uninitialized',
5742 '-Wno-tautological-compare',
5743 '-Wno-unknown-pragmas',
5745 '-Wno-unused-function',
5746 '-Wno-unused-private-field',
5747 '-Wno-unused-value',
5748 '-Wno-unused-variable',
5749 '-Wno-unused-local-typedef', # http://crbug.com/411648
5750 '-Wno-inconsistent-missing-override', #http://crbug.com/428099
5754 ['clang==1 and target_arch=="ia32"', {
5755 'VCCLCompilerTool': {
5756 'WarnAsError': 'false',
5757 'AdditionalOptions': [
5762 ['clang==1 and clang_use_chrome_plugins==1', {
5763 'VCCLCompilerTool': {
5764 'AdditionalOptions': [
5765 '<@(clang_chrome_plugins_flags)',
5769 ['clang==1 and MSVS_VERSION == "2013"', {
5770 'VCCLCompilerTool': {
5771 'AdditionalOptions': [
5772 '-fmsc-version=1800',
5776 ['clang==1 and MSVS_VERSION == "2015"', {
5777 'VCCLCompilerTool': {
5778 'AdditionalOptions': [
5779 '-fmsc-version=1900',
5787 ['disable_nacl==1', {
5788 'target_defaults': {
5794 ['OS=="win" and msvs_use_common_linker_extras', {
5795 'target_defaults': {
5810 'AdditionalOptions': [
5821 'AdditionalOptions': ['/largeaddressaware'],
5825 # TODO(asan/win): Move this down into the general
5826 # win-target_defaults section once the 64-bit asan runtime
5827 # exists. See crbug.com/345874.
5828 'VCCLCompilerTool': {
5829 'AdditionalOptions': [
5830 '-fsanitize=address',
5831 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5833 'AdditionalIncludeDirectories': [
5834 # MSVC needs to be able to find the sanitizer headers when
5835 # invoked via /fallback. This is critical for using macros
5836 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5838 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/include_sanitizer',
5842 'AdditionalLibraryDirectories': [
5843 # TODO(hans): If make_clang_dir is absolute, this breaks.
5844 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/lib/windows',
5847 'target_conditions': [
5848 ['component=="shared_library"', {
5850 'AdditionalDependencies': [
5851 'clang_rt.asan_dynamic-i386.lib',
5852 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5856 ['_type=="executable" and component=="static_library"', {
5858 'AdditionalDependencies': [
5859 'clang_rt.asan-i386.lib',
5863 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5865 'AdditionalDependencies': [
5866 'clang_rt.asan_dll_thunk-i386.lib',
5872 ['sanitizer_coverage!=0', {
5873 # TODO(asan/win): Move this down into the general
5874 # win-target_defaults section once the 64-bit asan runtime
5875 # exists. See crbug.com/345874.
5876 'VCCLCompilerTool': {
5877 'AdditionalOptions': [
5878 '-fsanitize-coverage=<(sanitizer_coverage)',
5885 ['sanitizer_coverage!=0', {
5886 # TODO(asan/win): Move this down into the general
5887 # win-target_defaults section once the 64-bit asan runtime
5888 # exists. See crbug.com/345874.
5890 'SANITIZER_COVERAGE',
5898 'AdditionalOptions': [
5899 # safeseh is not compatible with x64
5911 ['enable_new_npdevice_api==1', {
5912 'target_defaults': {
5914 'ENABLE_NEW_NPDEVICE_API',
5918 # Don't warn about the "typedef 'foo' locally defined but not used"
5919 # for gcc 4.8 and higher.
5920 # TODO: remove this flag once all builds work. See crbug.com/227506
5921 ['gcc_version>=48 and clang==0', {
5922 'target_defaults': {
5924 '-Wno-unused-local-typedefs',
5928 ['gcc_version>=48 and clang==0 and host_clang==1', {
5929 'target_defaults': {
5930 'target_conditions': [
5931 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5935 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5937 'make_global_settings': [
5938 ['CC', '<(make_clang_dir)/bin/clang'],
5939 ['CXX', '<(make_clang_dir)/bin/clang++'],
5940 ['CC.host', '$(CC)'],
5941 ['CXX.host', '$(CXX)'],
5944 ['clang==1 and OS=="win"', {
5945 'make_global_settings': [
5946 # On Windows, gyp's ninja generator only looks at CC.
5947 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5950 ['use_lld==1 and OS=="win"', {
5951 'make_global_settings': [
5952 # Limited to Windows because lld-link is the driver that is compatible
5954 ['LD', '<(make_clang_dir)/bin/lld-link'],
5957 ['OS=="android" and clang==0', {
5958 # Hardcode the compiler names in the Makefile so that
5959 # it won't depend on the environment at make time.
5960 'make_global_settings': [
5961 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5962 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5963 ['CC.host', '<(host_cc)'],
5964 ['CXX.host', '<(host_cxx)'],
5967 ['OS=="linux" and target_arch=="mipsel" and clang==0', {
5968 'make_global_settings': [
5969 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5970 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5971 ['CC.host', '<(host_cc)'],
5972 ['CXX.host', '<(host_cxx)'],
5975 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5976 # Set default ARM cross compiling on linux. These can be overridden
5977 # using CC/CXX/etc environment variables.
5978 'make_global_settings': [
5979 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5980 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5981 ['CC.host', '<(host_cc)'],
5982 ['CXX.host', '<(host_cxx)'],
5986 # TODO(yyanagisawa): supports GENERATOR==make
5987 # make generator doesn't support CC_wrapper without CC
5988 # in make_global_settings yet.
5989 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5990 'make_global_settings': [
5991 ['CC_wrapper', '<(gomadir)/gomacc'],
5992 ['CXX_wrapper', '<(gomadir)/gomacc'],
5993 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5994 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5998 'target_defaults': {
5999 'target_conditions': [
6000 ['_toolset=="target"', {
6008 # Work-around for http://openradar.appspot.com/20356002
6009 ['_toolset=="target" and _type!="static_library"', {
6019 ['use_lto==1 and clang==0', {
6020 'target_defaults': {
6021 'target_conditions': [
6022 ['_toolset=="target"', {
6024 '-ffat-lto-objects',
6030 ['use_lto==1 and clang==1', {
6031 'target_defaults': {
6032 'target_conditions': [
6033 ['_toolset=="target"', {
6035 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
6041 # Apply a lower LTO optimization level in non-official builds.
6042 ['use_lto==1 and clang==1 and buildtype!="Official"', {
6043 'target_defaults': {
6044 'target_conditions': [
6045 ['_toolset=="target"', {
6047 '-Wl,--plugin-opt,O1',
6050 ['_toolset=="target" and _type!="static_library"', {
6060 ['use_lto==1 and clang==1 and target_arch=="arm"', {
6061 'target_defaults': {
6062 'target_conditions': [
6063 ['_toolset=="target"', {
6064 # Without this flag, LTO produces a .text section that is larger
6065 # than the maximum call displacement, preventing the linker from
6066 # relocating calls (http://llvm.org/PR22999).
6068 '-Wl,-plugin-opt,-function-sections',
6074 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
6075 'target_defaults': {
6076 'target_conditions': [
6077 ['_toolset=="target"', {
6085 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
6086 'target_defaults': {
6087 'target_conditions': [
6088 ['_toolset=="target"', {
6097 'target_defaults': {
6098 'target_conditions': [
6099 ['_toolset=="target"', {
6101 '-fsanitize=cfi-vcall',
6102 '-fsanitize=cfi-derived-cast',
6103 '-fsanitize=cfi-unrelated-cast',
6106 '-fsanitize=cfi-vcall',
6107 '-fsanitize=cfi-derived-cast',
6108 '-fsanitize=cfi-unrelated-cast',
6112 '-fsanitize=cfi-vcall',
6113 '-fsanitize=cfi-derived-cast',
6114 '-fsanitize=cfi-unrelated-cast',
6118 ['_toolset=="target" and _type!="static_library"', {
6121 '-fsanitize=cfi-vcall',
6122 '-fsanitize=cfi-derived-cast',
6123 '-fsanitize=cfi-unrelated-cast',
6131 'target_defaults': {
6132 'target_conditions': [
6133 ['_toolset=="target"', {
6135 '-fsanitize-blacklist=<(cfi_blacklist)',
6139 '-fsanitize-blacklist=<(cfi_blacklist)',
6148 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
6149 # This block adds *project-wide* configuration settings to each project
6150 # file. It's almost always wrong to put things here. Specify your
6151 # custom xcode_settings in target_defaults to add them to targets instead.
6154 # In an Xcode Project Info window, the "Base SDK for All Configurations"
6155 # setting sets the SDK on a project-wide basis. In order to get the
6156 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
6157 # here at the project level.
6160 ['mac_sdk_path==""', {
6161 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
6163 'SDKROOT': '<(mac_sdk_path)', # -isysroot
6169 ['ios_sdk_path==""', {
6171 # TODO(justincohen): Ninja only supports simulator for now.
6172 ['"<(GENERATOR)"=="xcode"', {
6173 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6175 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
6179 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6184 # Target both iPhone and iPad.
6185 'TARGETED_DEVICE_FAMILY': '1,2',
6188 ['target_arch=="x64"', {
6193 ['target_arch=="ia32"', {
6202 # The Xcode generator will look for an xcode_settings section at the root
6203 # of each dict and use it to apply settings on a file-wide basis. Most
6204 # settings should not be here, they should be in target-specific
6205 # xcode_settings sections, or better yet, should use non-Xcode-specific
6206 # settings in target dicts. SYMROOT is a special case, because many other
6207 # Xcode variables depend on it, including variables such as
6208 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6209 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6210 # files to appear (when present) in the UI as actual files and not red
6211 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6212 # and therefore SYMROOT, needs to be set at the project level.
6213 'SYMROOT': '<(DEPTH)/xcodebuild',