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 or (OS!="win" and OS!="mac" and OS!="ios" 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 # Notifications are compiled in by default. Set to 0 to disable.
420 'notifications%' : 1,
422 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
423 # regular builds and 1 for ASan builds.
424 'mac_want_real_dsym%': 'default',
426 # If this is set, the clang plugins used on the buildbot will be used.
427 # Run tools/clang/scripts/update.sh to make sure they are compiled.
428 # This causes 'clang_chrome_plugins_flags' to be set.
429 # Has no effect if 'clang' is not set as well.
430 'clang_use_chrome_plugins%': 1,
432 # Enable building with ASAN (Clang's -fsanitize=address option).
433 # -fsanitize=address only works with clang, but asan=1 implies clang=1
434 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
436 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
437 # Enable coverage gathering instrumentation in sanitizer tools. This flag
438 # also controls coverage granularity (1 for function-level coverage, 2
439 # for block-level coverage).
440 'sanitizer_coverage%': 0,
441 # Deprecated, only works if |sanitizer_coverage| isn't set.
442 # TODO(glider): remove this flag.
444 # Enable intra-object-overflow detection in ASan (experimental).
445 'asan_field_padding%': 0,
447 # Enable Chromium overrides of the default configurations for various
448 # dynamic tools (like ASan).
449 'use_sanitizer_options%': 0,
451 # Enable building with SyzyAsan.
452 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
455 # Enable crash reporting via Kasko.
458 # Enable building with LSan (Clang's -fsanitize=leak option).
459 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
460 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
463 # Enable building with TSan (Clang's -fsanitize=thread option).
464 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
465 # See http://clang.llvm.org/docs/ThreadSanitizer.html
467 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
469 # Enable building with MSan (Clang's -fsanitize=memory option).
470 # MemorySanitizer only works with clang, but msan=1 implies clang=1
471 # See http://clang.llvm.org/docs/MemorySanitizer.html
473 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
474 # Track where uninitialized memory originates from. From fastest to
475 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
476 # - track the chain of stores leading from allocation site to use site.
477 'msan_track_origins%': 2,
479 # Enable building with UBSan (Clang's -fsanitize=undefined option).
480 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
481 # See http://clang.llvm.org/docs/UsersManual.html
483 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
484 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/vptr_blacklist.txt',
486 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
487 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
490 # Use dynamic libraries instrumented by one of the sanitizers
491 # instead of the standard system libraries. Set this flag to build the
492 # libraries from source.
493 'use_instrumented_libraries%': 0,
495 # Use dynamic libraries instrumented by one of the sanitizers
496 # instead of the standard system libraries. Set this flag to download
497 # prebuilt binaries from GCS.
498 'use_prebuilt_instrumented_libraries%': 0,
500 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
501 # stdlibc++ as standard library. This is intended to use for instrumented
503 'use_custom_libcxx%': 0,
505 # Use system libc++ instead of the default C++ library, usually libstdc++.
506 # This is intended for iOS builds only.
507 'use_system_libcxx%': 0,
509 # Use a modified version of Clang to intercept allocated types and sizes
510 # for allocated objects. clang_type_profiler=1 implies clang=1.
511 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
512 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
513 'clang_type_profiler%': 0,
515 # Set to true to instrument the code with function call logger.
516 # See src/third_party/cygprofile/cyg-profile.cc for details.
517 'order_profiling%': 0,
519 # Use the provided profiled order file to link Chrome image with it.
520 # This makes Chrome faster by better using CPU cache when executing code.
521 # This is known as PGO (profile guided optimization).
522 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
523 'order_text_section%' : "",
525 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
526 # libraries on linux x86-64 and arm, plus ASLR.
529 # Whether one-click signin is enabled or not.
530 'enable_one_click_signin%': 0,
532 # Whether to back up data before sync.
533 'enable_pre_sync_backup%': 0,
535 # Enable Chrome browser extensions
536 'enable_extensions%': 1,
539 'enable_google_now%': 1,
541 # Enable basic printing support and UI.
542 'enable_basic_printing%': 1,
544 # Enable printing with print preview. It does not imply
545 # enable_basic_printing. It's possible to build Chrome with preview only.
546 'enable_print_preview%': 1,
548 # Set the version of CLD.
549 # 0: Don't specify the version. This option is for the Finch testing.
554 # For CLD2, the size of the tables that should be included in the build
555 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
557 # See third_party/cld_2/cld_2.gyp for more information.
558 # 0: Small tables, lower accuracy
559 # 2: Large tables, high accuracy
560 'cld2_table_size%': 2,
562 # Enable spell checker.
563 'enable_spellcheck%': 1,
565 # Webrtc compilation is enabled by default. Set to 0 to disable.
568 # Media router support is enabled by default. Set to 0 to disable.
569 'enable_media_router%': 1,
571 # Enables use of the session service, which is enabled by default.
572 # Support for disabling depends on the platform.
573 'enable_session_service%': 1,
575 # Enables theme support, which is enabled by default. Support for
576 # disabling depends on the platform.
579 # Enables autofill dialog and associated features; disabled by default.
580 'enable_autofill_dialog%' : 0,
582 # Defaults Wallet integration in Autofill dialog to use production
583 # servers. Unofficial builds won't have the proper API keys.
584 'enable_prod_wallet_service%': 0,
586 # Enables support for background apps.
587 'enable_background%': 1,
589 # Enable the task manager by default.
590 'enable_task_manager%': 1,
592 # Enables used resource whitelist generation; disabled by default.
593 'enable_resource_whitelist_generation%': 0,
595 # Enable FILE support by default.
596 'disable_file_support%': 0,
598 # Enable FTP support by default.
599 'disable_ftp_support%': 0,
601 # Use native android functions in place of ICU. Not supported by most
603 'use_icu_alternatives_on_android%': 0,
605 # Use of precompiled headers on Windows.
607 # This variable may be explicitly set to 1 (enabled) or 0
608 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
609 # This setting will override the default.
612 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
614 'chromium_win_pch%': 0,
617 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
618 # Set this to true when building with Clang.
619 # See http://code.google.com/p/chromium/wiki/Clang for details.
620 # If this is set, clang is used as both host and target compiler in
621 # cross-compile builds.
624 # Use experimental lld linker instead of the platform's default linker.
627 # Enable plugin installation by default.
628 'enable_plugin_installation%': 1,
630 # Specifies whether to use canvas_skia.cc in place of platform
631 # specific implementations of gfx::Canvas. Affects text drawing in the
633 # TODO(asvitkine): Enable this on all platforms and delete this flag.
634 # http://crbug.com/105550
635 'use_canvas_skia%': 0,
637 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
638 # with one of those tools.
639 'build_for_tool%': '',
641 # If no directory is specified then a temporary directory will be used.
642 'test_isolation_outdir%': '',
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,
652 'spdy_proxy_auth_property%' : '',
653 'spdy_proxy_auth_value%' : '',
655 'enable_service_discovery%': 0,
656 'enable_wifi_bootstrapping%': 0,
657 'enable_hangout_services_extension%': 0,
659 # Enable the Syzygy optimization step.
660 'syzygy_optimize%': 0,
662 # Enable hole punching for the protected video.
665 # Automatically select platforms under ozone. Turn this off to
666 # build only explicitly selected platforms.
667 'ozone_auto_platforms%': 1,
669 # If this is set clang is used as host compiler, but not as target
670 # compiler. Always do this by default.
673 # Variables to control Link-Time Optimization (LTO).
674 # On Android, the variable use_lto enables LTO on code compiled with -Os,
675 # and use_lto_o2 enables LTO on code compiled with -O2. On other
676 # platforms, use_lto enables LTO in all translation units, and use_lto_o2
679 # On Linux and Android, when using LLVM LTO, the script
680 # build/download_gold_plugin.py must be run to download a linker plugin.
681 # On Mac, LLVM needs to be built from scratch using
682 # tools/clang/scripts/update.py and the absolute path to
683 # third_party/llvm-build/Release+Asserts/lib must be added to
684 # $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin.
686 # On Android, the variables must *not* be enabled at the same time.
687 # In this case LTO would 'merge' the optimization flags at link-time
688 # which would lead to all code be optimized with -O2. See crbug.com/407544
692 # Libxkbcommon usage.
695 # Control Flow Integrity for virtual calls and casts.
696 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
699 'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
701 # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
702 'mac_views_browser%': 0,
704 # By default, use ICU data file (icudtl.dat).
705 'icu_use_data_file_flag%': 1,
707 # Turn on JNI generation optimizations by default.
708 'optimize_jni_generation%': 1,
711 # A flag for POSIX platforms
718 # A flag for BSD platforms
719 ['OS=="freebsd" or OS=="openbsd"', {
726 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris")', {
732 # libudev usage. This currently only affects the content layer.
733 ['OS=="linux" and embedded==0', {
739 # Flags to use X11 on non-Mac POSIX platforms.
740 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
747 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
753 # Flags to use pango and cairo.
754 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
763 ['OS=="linux" and embedded==0', {
769 # We always use skia text rendering in Aura on Windows, since GDI
770 # doesn't agree with our BackingStore.
771 # TODO(beng): remove once skia text rendering is on by default.
772 ['use_aura==1 and OS=="win"', {
773 'enable_skia_text%': 1,
776 # A flag to enable or disable our compile-time dependency
777 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
778 # support will be available. This option is useful
779 # for Linux distributions and for Aura.
780 ['OS!="linux" or chromeos==1', {
781 'use_gnome_keyring%': 0,
783 'use_gnome_keyring%': 1,
786 ['OS=="mac" or OS=="ios"', {
787 # Mac and iOS want Title Case strings
788 'use_titlecase_in_grd%': 1,
791 # Enable loader extensions on Chrome OS.
793 'image_loader_extension%': 1,
795 'image_loader_extension%': 0,
798 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
799 'enable_one_click_signin%': 1,
800 'enable_pre_sync_backup%': 1,
804 'enable_extensions%': 0,
805 'enable_google_now%': 0,
807 'enable_spellcheck%': 0,
811 'arm_neon_optional%': 1,
812 'native_memory_pressure_signals%': 1,
813 'enable_basic_printing%': 1,
814 'enable_print_preview%': 0,
815 'enable_task_manager%':0,
819 # Android OS includes support for proprietary codecs regardless of
820 # building Chromium or Google Chrome. We also ship Google Chrome and
821 # Chromecast with proprietary codecs.
822 ['OS=="android" or branding=="Chrome" or chromecast==1', {
823 'proprietary_codecs%': 1,
825 'proprietary_codecs%': 0,
828 ['OS=="mac" or OS=="ios"', {
829 'native_memory_pressure_signals%': 1,
832 # Enable autofill dialog when not on iOS.
834 'enable_autofill_dialog%': 1,
837 ['buildtype=="Official"', {
838 'enable_prod_wallet_service%': 1,
846 'disable_ftp_support%': 1,
847 'enable_extensions%': 0,
848 'enable_google_now%': 0,
850 'cld2_table_size%': 0,
851 'enable_basic_printing%': 0,
852 'enable_print_preview%': 0,
853 'enable_session_service%': 0,
854 'enable_spellcheck%': 0,
860 'enable_supervised_users%': 0,
861 'enable_task_manager%': 0,
862 'use_system_libcxx%': 1,
865 # Use GPU accelerated cross process image transport by default
866 # on linux builds with the Aura window manager
867 ['use_aura==1 and OS=="linux"', {
868 'ui_compositor_image_transport%': 1,
870 'ui_compositor_image_transport%': 0,
873 # Turn precompiled headers on by default.
874 ['OS=="win" and buildtype!="Official"', {
875 'chromium_win_pch%': 1
878 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
879 'enable_plugin_installation%': 0,
881 'enable_plugin_installation%': 1,
884 # Whether PPAPI is enabled.
885 ['OS=="android" or OS=="ios" or embedded==1', {
886 'enable_plugins%': 0,
888 'enable_plugins%': 1,
891 # linux_use_bundled_gold: whether to use the gold linker binary checked
892 # into third_party/binutils. Force this off via GYP_DEFINES when you
893 # are using a custom toolchain and need to control -B in ldflags.
894 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
895 # for component=static_library builds.
896 ['(OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm")', {
897 'linux_use_bundled_gold%': 1,
899 'linux_use_bundled_gold%': 0,
902 # linux_use_bundled_binutils: whether to use the binary binutils
903 # checked into third_party/binutils. These are not multi-arch so cannot
904 # be used except on x86 and x86-64 (the only two architectures which
905 # are currently checke in). Force this off via GYP_DEFINES when you
906 # are using a custom toolchain and need to control -B in cflags.
907 ['OS=="linux" and (target_arch=="x64")', {
908 'linux_use_bundled_binutils%': 1,
910 'linux_use_bundled_binutils%': 0,
913 # linux_use_gold_flags: whether to use build flags that rely on gold.
914 # On by default for x64 Linux.
915 ['OS=="linux" and target_arch=="x64"', {
916 'linux_use_gold_flags%': 1,
918 'linux_use_gold_flags%': 0,
921 # linux_use_debug_fission: whether to use split DWARF debug info
922 # files. This can reduce link time significantly, but is incompatible
923 # with some utilities such as icecc and ccache. Requires gold and
924 # gcc >= 4.8 or clang.
925 # http://gcc.gnu.org/wiki/DebugFission
926 ['OS=="linux" and target_arch=="x64"', {
927 'linux_use_debug_fission%': 1,
929 'linux_use_debug_fission%': 0,
932 ['OS=="android" or OS=="ios"', {
933 'enable_captive_portal_detection%': 0,
934 'enable_media_router%': 0,
936 'enable_captive_portal_detection%': 1,
937 'enable_media_router%': 1,
940 # Enable Skia UI text drawing incrementally on different platforms.
941 # http://crbug.com/105550
943 # On Aura, this allows per-tile painting to be used in the browser
945 ['OS!="android" and OS!="ios"', {
946 'use_canvas_skia%': 1,
950 'enable_basic_printing%': 0,
951 'enable_print_preview%': 1,
954 # Do not enable the Settings App on ChromeOS.
955 ['enable_app_list==1 and chromeos==0', {
956 'enable_settings_app%': 1,
958 'enable_settings_app%': 0,
961 # Whether tests targets should be run, archived or just have the
962 # dependencies verified. All the tests targets have the '_run' suffix,
963 # e.g. base_unittests_run runs the target base_unittests. The test
964 # target always calls tools/swarming_client/isolate.py. See the script's
965 # --help for more information. Meant to be overriden with GYP_DEFINES.
966 # TODO(maruel): Remove the conditions as more configurations are
968 ['OS!="ios" and OS!="android" and chromeos==0', {
969 'test_isolation_mode%': 'check',
971 'test_isolation_mode%': 'noop',
973 # Whether Android build uses OpenMAX DL FFT.
974 ['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")', {
975 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
976 # When enabled, this will also enable WebAudio support on
977 # Android for these architectures. Default is enabled. Whether
978 # WebAudio is actually available depends on runtime settings
980 'use_openmax_dl_fft%': 1,
982 'use_openmax_dl_fft%': 0,
984 ['OS=="win" or OS=="linux"', {
988 # Turns on compiler optimizations in V8 in Debug build, except
989 # on android_clang, where we're hitting a weird linker error.
990 # TODO(dpranke): http://crbug.com/266155 .
992 'v8_optimized_debug%': 1,
994 'v8_optimized_debug%': 2,
997 # Disable various features by default on embedded.
1000 'enable_basic_printing%': 0,
1001 'enable_print_preview%': 0,
1004 ['OS=="win" or OS=="mac"', {
1005 'enable_wifi_bootstrapping%' : 1,
1008 # Path to sas.dll, which provides the SendSAS function.
1009 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1010 ['target_arch=="x64"', {
1011 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1013 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1017 'pkg-config': '<(DEPTH)/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
1019 'pkg-config': 'pkg-config'
1023 # Setting this to '0' will cause V8's startup snapshot to be
1024 # embedded in the binary instead of being a external files.
1025 'v8_use_external_startup_data%': 1,
1027 # Set this to 1 to enable use of concatenated impulse responses
1028 # for the HRTF panner in WebAudio.
1029 'use_concatenated_impulse_responses': 1,
1031 # You can set the variable 'use_official_google_api_keys' to 1
1032 # to use the Google-internal file containing official API keys
1033 # for Google Chrome even in a developer build. Setting this
1034 # variable explicitly to 1 will cause your build to fail if the
1035 # internal file is missing.
1037 # The variable is documented here, but not handled in this file;
1038 # see //google_apis/determine_use_official_keys.gypi for the
1041 # Set the variable to 0 to not use the internal file, even when
1042 # it exists in your checkout.
1044 # Leave it unset in your include.gypi to have the variable
1045 # implicitly set to 1 if you have
1046 # src/google_apis/internal/google_chrome_api_keys.h in your
1047 # checkout, and implicitly set to 0 if not.
1049 # Note that official builds always behave as if the variable
1050 # was explicitly set to 1, i.e. they always use official keys,
1051 # and will fail to build if the internal file is missing.
1053 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1054 # include.gypi or by other means. Due to subtleties of GYP, this
1055 # is not the same as leaving the variable unset, even though its
1057 # //google_apis/determine_use_official_keys.gypi is 2.
1059 # Set these to bake the specified API keys and OAuth client
1060 # IDs/secrets into your build.
1062 # If you create a build without values baked in, you can instead
1063 # set environment variables to provide the keys at runtime (see
1064 # src/google_apis/google_api_keys.h for details). Features that
1065 # require server-side APIs may fail to work if no keys are
1068 # Note that if you are building an official build or if
1069 # use_official_google_api_keys has been set to 1 (explicitly or
1070 # implicitly), these values will be ignored and the official
1071 # keys will be used instead.
1072 'google_api_key%': '',
1073 'google_default_client_id%': '',
1074 'google_default_client_secret%': '',
1075 # Native Client is enabled by default.
1076 'disable_nacl%': '0',
1078 # Sets the default version name and code for Android app, by default we
1079 # do a developer build.
1080 'android_app_version_name%': 'Developer Build',
1081 'android_app_version_code%': 1,
1084 # Copy conditionally-set variables out one scope.
1085 'branding%': '<(branding)',
1086 'branding_path_component%': '<(branding_path_component)',
1087 'buildtype%': '<(buildtype)',
1088 'target_arch%': '<(target_arch)',
1089 'target_subarch%': '<(target_subarch)',
1090 'mips_arch_variant%': '<(mips_arch_variant)',
1091 'mips_dsp_rev%': '<(mips_dsp_rev)',
1092 'host_arch%': '<(host_arch)',
1093 'toolkit_views%': '<(toolkit_views)',
1094 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1095 'use_aura%': '<(use_aura)',
1096 'use_ash%': '<(use_ash)',
1097 'use_cras%': '<(use_cras)',
1098 'use_libpci%': '<(use_libpci)',
1099 'use_openssl%': '<(use_openssl)',
1100 'use_openssl_certs%': '<(use_openssl_certs)',
1101 'use_nss_certs%': '<(use_nss_certs)',
1102 'use_udev%': '<(use_udev)',
1103 'os_bsd%': '<(os_bsd)',
1104 'os_posix%': '<(os_posix)',
1105 'use_dbus%': '<(use_dbus)',
1106 'use_glib%': '<(use_glib)',
1107 'use_pango%': '<(use_pango)',
1108 'use_cairo%': '<(use_cairo)',
1109 'use_ozone%': '<(use_ozone)',
1110 'use_ozone_evdev%': '<(use_ozone_evdev)',
1111 'use_xkbcommon%': '<(use_xkbcommon)',
1112 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1113 'desktop_linux%': '<(desktop_linux)',
1114 'use_x11%': '<(use_x11)',
1115 'use_gnome_keyring%': '<(use_gnome_keyring)',
1116 'linux_fpic%': '<(linux_fpic)',
1117 'chromeos%': '<(chromeos)',
1118 'chromecast%': '<(chromecast)',
1119 'enable_viewport%': '<(enable_viewport)',
1120 'enable_hidpi%': '<(enable_hidpi)',
1121 'enable_topchrome_md%': '<(enable_topchrome_md)',
1122 'image_loader_extension%': '<(image_loader_extension)',
1123 'fastbuild%': '<(fastbuild)',
1124 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1125 'win_z7%': '<(win_z7)',
1126 'dcheck_always_on%': '<(dcheck_always_on)',
1127 'tracing_like_official_build%': '<(tracing_like_official_build)',
1128 'arm_version%': '<(arm_version)',
1129 'arm_neon%': '<(arm_neon)',
1130 'arm_neon_optional%': '<(arm_neon_optional)',
1131 'sysroot%': '<(sysroot)',
1132 'pkg-config%': '<(pkg-config)',
1133 'chroot_cmd%': '<(chroot_cmd)',
1134 'system_libdir%': '<(system_libdir)',
1135 'component%': '<(component)',
1136 'win_analyze%': '<(win_analyze)',
1137 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1138 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1139 'use_third_party_translations%': '<(use_third_party_translations)',
1140 'remoting%': '<(remoting)',
1141 'enable_one_click_signin%': '<(enable_one_click_signin)',
1142 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1143 'enable_media_router%': '<(enable_media_router)',
1144 'enable_webrtc%': '<(enable_webrtc)',
1145 'chromium_win_pch%': '<(chromium_win_pch)',
1146 'configuration_policy%': '<(configuration_policy)',
1147 'safe_browsing%': '<(safe_browsing)',
1148 'enable_web_speech%': '<(enable_web_speech)',
1149 'notifications%': '<(notifications)',
1150 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1151 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1153 'asan_blacklist%': '<(asan_blacklist)',
1154 'asan_coverage%': '<(asan_coverage)',
1155 'sanitizer_coverage%': '<(sanitizer_coverage)',
1156 'asan_field_padding%': '<(asan_field_padding)',
1157 'use_sanitizer_options%': '<(use_sanitizer_options)',
1158 'syzyasan%': '<(syzyasan)',
1159 'kasko%': '<(kasko)',
1160 'syzygy_optimize%': '<(syzygy_optimize)',
1163 'msan_blacklist%': '<(msan_blacklist)',
1164 'msan_track_origins%': '<(msan_track_origins)',
1166 'tsan_blacklist%': '<(tsan_blacklist)',
1167 'ubsan%': '<(ubsan)',
1168 'ubsan_blacklist%': '<(ubsan_blacklist)',
1169 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1170 'ubsan_vptr%': '<(ubsan_vptr)',
1171 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1172 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
1173 'use_custom_libcxx%': '<(use_custom_libcxx)',
1174 'use_system_libcxx%': '<(use_system_libcxx)',
1175 'clang_type_profiler%': '<(clang_type_profiler)',
1176 'order_profiling%': '<(order_profiling)',
1177 'order_text_section%': '<(order_text_section)',
1178 'enable_extensions%': '<(enable_extensions)',
1179 'enable_plugin_installation%': '<(enable_plugin_installation)',
1180 'enable_plugins%': '<(enable_plugins)',
1181 'enable_session_service%': '<(enable_session_service)',
1182 'enable_themes%': '<(enable_themes)',
1183 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1184 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1185 'enable_background%': '<(enable_background)',
1186 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1187 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1188 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1189 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1190 'use_canvas_skia%': '<(use_canvas_skia)',
1191 'test_isolation_mode%': '<(test_isolation_mode)',
1192 'test_isolation_outdir%': '<(test_isolation_outdir)',
1193 'enable_basic_printing%': '<(enable_basic_printing)',
1194 'enable_print_preview%': '<(enable_print_preview)',
1195 'enable_spellcheck%': '<(enable_spellcheck)',
1196 'enable_google_now%': '<(enable_google_now)',
1197 'cld_version%': '<(cld_version)',
1198 'cld2_table_size%': '<(cld2_table_size)',
1199 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1200 'disable_file_support%': '<(disable_file_support)',
1201 'disable_ftp_support%': '<(disable_ftp_support)',
1202 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1203 'enable_task_manager%': '<(enable_task_manager)',
1204 'sas_dll_path%': '<(sas_dll_path)',
1205 'wix_path%': '<(wix_path)',
1206 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1207 'use_system_libjpeg%': '<(use_system_libjpeg)',
1208 'android_channel%': '<(android_channel)',
1209 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1210 'gyp_managed_install%': 0,
1211 'create_standalone_apk%': 1,
1212 'enable_app_list%': '<(enable_app_list)',
1213 'use_default_render_theme%': '<(use_default_render_theme)',
1214 'enable_settings_app%': '<(enable_settings_app)',
1215 'google_api_key%': '<(google_api_key)',
1216 'google_default_client_id%': '<(google_default_client_id)',
1217 'google_default_client_secret%': '<(google_default_client_secret)',
1218 'enable_supervised_users%': '<(enable_supervised_users)',
1219 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1220 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1221 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1222 'enable_mdns%' : '<(enable_mdns)',
1223 'enable_service_discovery%' : '<(enable_service_discovery)',
1224 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1225 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1226 'v8_optimized_debug%': '<(v8_optimized_debug)',
1227 'proprietary_codecs%': '<(proprietary_codecs)',
1228 'use_goma%': '<(use_goma)',
1229 'gomadir%': '<(gomadir)',
1230 'use_lto%': '<(use_lto)',
1231 'use_lto_o2%': '<(use_lto_o2)',
1232 'video_hole%': '<(video_hole)',
1233 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1234 'cfi_vptr%': '<(cfi_vptr)',
1235 'cfi_blacklist%': '<(cfi_blacklist)',
1236 'mac_views_browser%': '<(mac_views_browser)',
1237 'android_app_version_name%': '<(android_app_version_name)',
1238 'android_app_version_code%': '<(android_app_version_code)',
1240 # Use system protobuf instead of bundled one.
1241 'use_system_protobuf%': 0,
1243 # Use system yasm instead of bundled one.
1244 'use_system_yasm%': 0,
1246 # Use system ICU instead of bundled one.
1247 'use_system_icu%' : 0,
1249 # Default to enabled PIE; this is important for ASLR but we may need to be
1250 # able to turn it off for various reasons.
1251 'linux_disable_pie%': 0,
1253 # The release channel that this build targets. This is used to restrict
1254 # channel-specific build options, like which installer packages to create.
1255 # The default is 'all', which does no channel-specific filtering.
1258 # Override chromium_mac_pch and set it to 0 to suppress the use of
1259 # precompiled headers on the Mac. Prefix header injection may still be
1260 # used, but prefix headers will not be precompiled. This is useful when
1261 # using distcc to distribute a build to compile slaves that don't
1262 # share the same compiler executable as the system driving the compilation,
1263 # because precompiled headers rely on pointers into a specific compiler
1264 # executable's image. Setting this to 0 is needed to use an experimental
1265 # Linux-Mac cross compiler distcc farm.
1266 'chromium_mac_pch%': 1,
1268 # The default value for mac_strip in target_defaults. This cannot be
1269 # set there, per the comment about variable% in a target_defaults.
1270 'mac_strip_release%': 0,
1272 # Set to 1 to enable java code coverage. Instruments classes during build
1273 # to produce .ec files during runtime.
1274 'emma_coverage%': 0,
1276 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1277 # separated with whitespace and/or comma. Only has effect if
1278 # 'emma_coverage=1'.
1281 # Set to 1 to enable running Android lint on java/class files.
1284 # Although base/allocator lets you select a heap library via an
1285 # environment variable, the libcmt shim it uses sometimes gets in
1286 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1287 # 'win_use_allocator_shim': 0,
1288 # 'win_release_RuntimeLibrary': 2
1289 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1290 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1292 # TODO(bradnelson): eliminate this when possible.
1293 # To allow local gyp files to prevent release.vsprops from being included.
1294 # Yes(1) means include release.vsprops.
1295 # Once all vsprops settings are migrated into gyp, this can go away.
1296 'msvs_use_common_release%': 1,
1298 # TODO(bradnelson): eliminate this when possible.
1299 # To allow local gyp files to override additional linker options for msvs.
1300 # Yes(1) means set use the common linker options.
1301 'msvs_use_common_linker_extras%': 1,
1303 # TODO(sgk): eliminate this if possible.
1304 # It would be nicer to support this via a setting in 'target_defaults'
1305 # in chrome/app/locales/locales.gypi overriding the setting in the
1306 # 'Debug' configuration in the 'target_defaults' dict below,
1307 # but that doesn't work as we'd like.
1308 'msvs_debug_link_incremental%': '2',
1310 # Needed for some of the largest modules.
1311 'msvs_debug_link_nonincremental%': '1',
1313 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1314 # to get incremental linking to be faster in debug builds.
1315 'incremental_chrome_dll%': '0',
1317 # Experimental setting to break chrome.dll into multiple pieces based on
1319 'chrome_multiple_dll%': '0',
1321 # Experimental setting to optimize Chrome's DLLs with PGO.
1322 'chrome_pgo_phase%': '0',
1324 # Whether the VS xtree header has been patched to disable warning 4702. If
1325 # it has, then we don't need to disable 4702 (unreachable code warning).
1326 # The patch is preapplied to the internal toolchain and hence all bots.
1327 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1330 'clang%': '<(clang)',
1331 'host_clang%': '<(host_clang)',
1332 'make_clang_dir%': '<(make_clang_dir)',
1333 'use_lld%': '<(use_lld)',
1335 # Control which version of clang to use when building for iOS. If set to
1336 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1337 # the version of clang that ships with the Chromium source. This variable
1338 # is automatically set to '1' when using the Xcode generator.
1341 # These two variables can be set in GYP_DEFINES while running
1342 # |gclient runhooks| to let clang run a plugin in every compilation.
1343 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1345 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1348 'clang_add_plugin%': '',
1350 # Tell ld64 to write map files describing binary layout. Useful
1351 # for looking at what contributes to binary size, e.g. with
1352 # https://github.com/nico/bloat
1353 'mac_write_linker_maps%': 0,
1355 # The default type of gtest.
1356 'gtest_target_type%': 'executable',
1358 # Enable sampling based profiler.
1359 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1361 # Profile without optimizing out stack frames when profiling==1.
1362 'profiling_full_stack_frames%': '0',
1364 # And if we want to dump symbols for Breakpad-enabled builds.
1365 'linux_dump_symbols%': 0,
1366 # And if we want to strip the binary after dumping symbols.
1367 'linux_strip_binary%': 0,
1368 # If we want stack unwind support for backtrace().
1369 'debug_unwind_tables%': 1,
1370 'release_unwind_tables%': 1,
1372 # Override where to find binutils
1373 'binutils_version%': 0,
1374 'binutils_dir%': '',
1377 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1378 'use_allocator%': 'tcmalloc',
1380 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1381 'linux_link_gnome_keyring%': 0,
1382 # Set to 1 to link against gsettings APIs instead of using dlopen().
1383 'linux_link_gsettings%': 0,
1385 # Enable use of OpenMAX DL FFT routines.
1386 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1388 # Enable new NPDevice API.
1389 'enable_new_npdevice_api%': 0,
1391 # .gyp files or targets should set chromium_code to 1 if they build
1392 # Chromium-specific code, as opposed to external code. This variable is
1393 # used to control such things as the set of warnings to enable, and
1394 # whether warnings are treated as errors.
1395 'chromium_code%': 0,
1397 # Disable fatal linker warnings, similarly to how we make it possible
1398 # to disable -Werror (e.g. for different toolchain versions).
1399 'disable_fatal_linker_warnings%': 0,
1401 'release_valgrind_build%': 0,
1403 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1404 'enable_wexit_time_destructors%': 0,
1406 # Build libpeerconnection as a static library by default.
1407 'libpeer_target_type%': 'static_library',
1409 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1410 'internal_gles2_conform_tests%': 0,
1412 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1413 'internal_khronos_glcts_tests%': 0,
1415 # Set to 1 to compile the filter fuzzer.
1416 'internal_filter_fuzzer%': 0,
1418 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1419 # so Cocoa is happy (http://crbug.com/20441).
1421 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1422 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1423 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1424 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1425 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1426 'vi', 'zh-CN', 'zh-TW',
1429 # Pseudo locales are special locales which are used for testing and
1430 # debugging. They don't get copied to the final app. For more info,
1431 # check out https://www.chromium.org/developers/testing/fake-bidi
1438 # If debug_devtools is set to 1, JavaScript files for DevTools are
1439 # stored as is and loaded from disk. Otherwise, a concatenated file
1440 # is stored in resources.pak. It is still possible to load JS files
1441 # from disk by passing --debug-devtools cmdline switch.
1442 'debug_devtools%': 0,
1444 # The Java Bridge is not compiled in by default.
1447 # Code signing for iOS binaries. The bots need to be able to disable this.
1448 'chromium_ios_signing%': 1,
1450 # This flag is only used when disable_nacl==0 and disables all those
1451 # subcomponents which would require the installation of a native_client
1452 # untrusted toolchain.
1453 'disable_nacl_untrusted%': 0,
1455 # PNaCl toolchain does not support sanitizers. Disable by default.
1456 'enable_nacl_nonsfi_test%': 0,
1458 # Disable Dart by default.
1461 # Copy out the setting of disable_nacl.
1462 'disable_nacl%': '<(disable_nacl)',
1464 # Portable Native Client is enabled by default.
1465 'disable_pnacl%': 0,
1467 # Whether to build full debug version for Debug configuration on Android.
1468 # Compared to full debug version, the default Debug configuration on Android
1469 # has no full v8 debug, has size optimization and linker gc section, so that
1470 # we can build a debug version with acceptable size and performance.
1471 'android_full_debug%': 0,
1473 # Contains data about the attached devices for gyp_managed_install.
1474 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1476 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1477 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1479 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1480 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1482 # Whether we are using the rlz library or not. Platforms like Android send
1483 # rlz codes for searches but do not use the library.
1486 # Turns on the i18n support in V8.
1487 'v8_enable_i18n_support': 1,
1489 # Compile d8 for the host toolset.
1490 'v8_toolset_for_d8': 'host',
1492 # Use brlapi from brltty for braille display support.
1495 # Relative path to icu.gyp from this file.
1496 'icu_gyp_path': '../third_party/icu/icu.gyp',
1498 # IPC fuzzer is disabled by default.
1499 'enable_ipc_fuzzer%': 0,
1501 # Force disable libstdc++ debug mode.
1502 'disable_glibcxx_debug%': 0,
1504 # Set to 1 to compile with MSE support for MPEG2 TS
1505 'enable_mpeg2ts_stream_parser%': 0,
1507 # Support ChromeOS touchpad gestures with ozone.
1508 'use_evdev_gestures%': 0,
1510 # Default ozone platform (if no --ozone-platform flag).
1511 'ozone_platform%': "",
1513 # Ozone platforms to include in the build.
1514 'ozone_platform_caca%': 0,
1515 'ozone_platform_cast%': 0,
1516 'ozone_platform_dri%': 0,
1517 'ozone_platform_drm%': 0,
1518 'ozone_platform_egltest%': 0,
1519 'ozone_platform_gbm%': 0,
1520 'ozone_platform_ozonex%': 0,
1521 'ozone_platform_test%': 0,
1523 # Experiment: http://crbug.com/426914
1526 # Used to set libjpeg_gyp_path. Chrome OS ui/gfx/gfx.gyp uses the IJG path
1527 # for robust login screen decoding.
1528 'libjpeg_ijg_gyp_path': '<(DEPTH)/third_party/libjpeg/libjpeg.gyp',
1529 'libjpeg_turbo_gyp_path': '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp',
1532 ['buildtype=="Official"', {
1533 # Continue to embed build meta data in Official builds, basically the
1534 # time it was built.
1535 # TODO(maruel): This decision should be revisited because having an
1536 # official deterministic build has high value too but MSVC toolset can't
1537 # generate anything deterministic with WPO enabled AFAIK.
1538 'dont_embed_build_metadata%': 0,
1540 # Enable the Syzygy optimization step for the official builds.
1541 ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
1542 'syzygy_optimize%': 1,
1544 'syzygy_optimize%': 0,
1546 # Get binutils version so we can enable debug fission if we can.
1547 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1549 # compiler_version doesn't work with clang
1550 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1551 # compiler_version works with clang.
1552 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1553 # that it takes effect here.
1554 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1555 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1557 # On Android we know the binutils version in the toolchain.
1559 'binutils_version%': 222,
1561 ['host_arch=="x64"', {
1562 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1564 ['host_arch=="ia32"', {
1565 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1567 # Our version of binutils in third_party/binutils
1568 ['linux_use_bundled_binutils==1', {
1569 'binutils_version%': 224,
1573 'binutils_version%': 0,
1575 # The version of GCC in use, set later in platforms that use GCC and have
1576 # not explicitly chosen to build with clang. Currently, this means all
1577 # platforms except Windows, Mac and iOS.
1578 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1579 # it takes effect here.
1580 ['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', {
1583 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1584 # We directly set the gcc version since we know what we use.
1587 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1588 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1592 'host_gcc_version%': 0,
1595 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1596 'directx_sdk_path%': '<(directx_sdk_default_path)',
1598 'directx_sdk_path%': '$(DXSDK_DIR)',
1601 'windows_driver_kit_path%': '$(WDK_DIR)',
1603 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1605 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1608 'nacl_untrusted_build%': 0,
1609 'use_allocator%': 'none',
1611 # Use a 64-bit linker to avoid running out of address space. The
1612 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1613 ['host_arch=="ia32" and target_arch=="ia32"', {
1614 # TODO(thestig) This is a horrible way to force the desired
1615 # configuration. Our gyp variable scoping is likely wrong and
1616 # needs to be cleaned up. The GN configuration should be changed
1618 'binutils_version%': 224,
1619 'linux_use_bundled_binutils%': '1',
1620 'linux_use_bundled_gold%': '1',
1621 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1623 # All Chrome builds have breakpad symbols, but only process the
1624 # symbols from official builds.
1625 ['(branding=="Chrome" and buildtype=="Official")', {
1626 'linux_dump_symbols%': 1,
1628 # Omit unwind support in official release builds to save space. We
1629 # can use breakpad for these builds.
1630 'release_unwind_tables%': 0,
1633 }], # os_posix==1 and OS!="mac" and OS!="ios"
1636 'enable_background%': 0,
1637 'icu_use_data_file_flag%': 1,
1638 'enable_web_speech%': 0,
1639 'use_system_libxml%': 1,
1640 'use_system_sqlite%': 1,
1642 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1643 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1644 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1645 'uk', 'vi', 'zh-CN', 'zh-TW',
1648 # iOS SDK and deployment target support. The |ios_sdk| value is left
1649 # blank so that when it is set in the project files it will be the
1650 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1651 # causes Xcode to spit out a warning for every single project file for
1652 # not using the "current" SDK.
1654 'ios_sdk_path%': '',
1655 'ios_deployment_target%': '7.0',
1658 # ios_product_name is set to the name of the .app bundle as it should
1660 ['branding=="Chrome"', {
1661 'ios_product_name%': 'Chrome',
1662 }, { # else: branding!="Chrome"
1663 'ios_product_name%': 'Chromium',
1665 ['branding=="Chrome" and buildtype=="Official"', {
1667 }, { # else: branding!="Chrome" or buildtype!="Official"
1673 # Location of Android NDK.
1676 # Standard libraries can use the relative path to the NDK.
1677 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1678 # Unfortunately, it is required to use the absolute path to the SDK
1679 # because it us passed to ant which uses a different relative path
1681 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1682 # Similarly, gdbserver and the Android toolchain need to use the
1683 # absolute path to the NDK because they are used at different levels
1685 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1686 'android_host_arch%': '<!(uname -m)',
1687 # Android API-level of the SDK used for compilation.
1688 'android_sdk_version%': '22',
1689 'android_sdk_build_tools_version%': '22.0.0',
1690 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1692 # Copy conditionally-set variables out one scope.
1693 'android_ndk_root%': '<(android_ndk_root)',
1694 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1695 'android_sdk_root%': '<(android_sdk_root)',
1696 'android_sdk_version%': '<(android_sdk_version)',
1697 'android_libcpp_root': '<(android_ndk_root)/sources/cxx-stl/llvm-libc++',
1698 'host_os%': '<(host_os)',
1700 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1701 # Android SDK build tools (e.g. dx, aapt, aidl)
1702 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1704 # Android API level 16 is JB (Android 4.1) which is the minimum
1705 # platform requirement for Chrome on Android, we use it for native
1708 ['target_arch == "ia32"', {
1709 'android_app_abi%': 'x86',
1710 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
1711 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-x86',
1712 'android_ndk_lib_dir%': 'usr/lib',
1713 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1715 ['target_arch == "x64"', {
1716 'android_app_abi%': 'x86_64',
1717 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1718 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1719 'android_ndk_lib_dir%': 'usr/lib64',
1720 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1722 ['target_arch=="arm"', {
1725 'android_app_abi%': 'armeabi',
1727 'android_app_abi%': 'armeabi-v7a',
1730 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
1731 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-arm',
1732 'android_ndk_lib_dir%': 'usr/lib',
1733 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1735 ['target_arch == "arm64"', {
1736 'android_app_abi%': 'arm64-v8a',
1737 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1738 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1739 'android_ndk_lib_dir%': 'usr/lib',
1740 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1742 ['target_arch == "mipsel"', {
1743 'android_app_abi%': 'mips',
1744 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
1745 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-mips',
1746 'android_ndk_lib_dir%': 'usr/lib',
1747 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1749 ['target_arch == "mips64el"', {
1750 'android_app_abi%': 'mips64',
1751 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1752 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1753 'android_ndk_lib_dir%': 'usr/lib64',
1754 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1758 # Copy conditionally-set variables out one scope.
1759 'android_app_abi%': '<(android_app_abi)',
1760 'android_gdbserver%': '<(android_gdbserver)',
1761 'android_ndk_root%': '<(android_ndk_root)',
1762 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1763 'android_sdk_root%': '<(android_sdk_root)',
1764 'android_sdk_version%': '<(android_sdk_version)',
1765 'android_toolchain%': '<(android_toolchain)',
1767 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1768 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1769 'android_sdk_tools%': '<(android_sdk_tools)',
1770 'android_sdk%': '<(android_sdk)',
1771 'android_sdk_jar%': '<(android_sdk)/android.jar',
1773 'android_libcpp_root': '<(android_libcpp_root)',
1774 'android_libcpp_include': '<(android_libcpp_root)/libcxx/include',
1775 'android_libcpp_libs_dir': '<(android_libcpp_root)/libs/<(android_app_abi)',
1776 'host_os%': '<(host_os)',
1778 # Location of the "objcopy" binary, used by both gyp and scripts.
1779 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1781 # Location of the "strip" binary, used by both gyp and scripts.
1782 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1784 # Location of the "readelf" binary.
1785 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1787 # Determines whether we should optimize JNI generation at the cost of
1788 # breaking assumptions in the build system that when inputs have changed
1789 # the outputs should always change as well. This is meant purely for
1790 # developer builds, to avoid spurious re-linking of native files.
1791 'optimize_jni_generation%': '<(optimize_jni_generation)',
1793 # Always uses openssl.
1795 'use_openssl_certs%': 1,
1797 'proprietary_codecs%': '<(proprietary_codecs)',
1798 'safe_browsing%': 2,
1799 'enable_web_speech%': 0,
1801 'build_ffmpegsumo%': 0,
1802 'use_allocator%': 'none',
1804 # Disable Native Client.
1807 # Android does not support background apps.
1808 'enable_background%': 0,
1810 # Sessions are store separately in the Java side.
1811 'enable_session_service%': 0,
1815 'gtest_target_type%': 'shared_library',
1818 'use_system_fontconfig%': 0,
1820 'use_system_fontconfig%': 1,
1823 'enable_mpeg2ts_stream_parser%': 1,
1824 'ffmpeg_branding%': 'ChromeOS',
1825 'ozone_platform_ozonex%': 1,
1826 'use_playready%': 0,
1828 ['target_arch=="arm"', {
1830 'arm_tune%': 'cortex-a9',
1836 ['chromecast==1 and OS!="android"', {
1837 'ozone_platform_cast%': 1
1839 ['OS=="linux" and target_arch!="mipsel"', {
1844 # All Chrome builds have breakpad symbols, but only process the
1845 # symbols from official builds.
1846 ['(branding=="Chrome" and buildtype=="Official")', {
1847 'mac_strip_release%': 1,
1851 ['OS=="mac" or OS=="ios"', {
1855 # Mac OS X SDK and deployment target support. The SDK identifies
1856 # the version of the system headers that will be used, and
1857 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1858 # macro. "Maximum allowed" refers to the operating system version
1859 # whose APIs are available in the headers. The deployment target
1860 # identifies the minimum system version that the built products are
1861 # expected to function on. It corresponds to the
1862 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1863 # macros are available, #include <AvailabilityMacros.h>. Additional
1864 # documentation on these macros is available at
1865 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1866 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1867 # deployment target to 10.6. Other projects, such as O3D, may
1868 # override these defaults.
1870 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1871 # about that is at least the specified version. In official builds,
1872 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1873 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1874 # path to the SDK; when set to a non-empty string, SDK detection
1875 # based on mac_sdk_min will be bypassed entirely.
1878 'mac_sdk_min%': '10.8',
1879 }, { # else OS!="ios"
1880 'mac_sdk_min%': '10.6',
1883 'mac_sdk_path%': '',
1885 'mac_deployment_target%': '10.6',
1888 'mac_sdk_min': '<(mac_sdk_min)',
1889 'mac_sdk_path': '<(mac_sdk_path)',
1890 'mac_deployment_target': '<(mac_deployment_target)',
1892 # Compile in Breakpad support by default so that it can be
1893 # tested, even if it is not enabled by default at runtime.
1894 'mac_breakpad_compiled_in%': 1,
1896 # mac_product_name is set to the name of the .app bundle as it should
1897 # appear on disk. This duplicates data from
1898 # chrome/app/theme/chromium/BRANDING and
1899 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1900 # these names into the build system.
1901 ['branding=="Chrome"', {
1902 'mac_product_name%': 'Google Chrome',
1903 }, { # else: branding!="Chrome"
1904 'mac_product_name%': 'Chromium',
1906 # Official mac builds require a specific OS X SDK, but iOS and
1907 # non-official mac builds do not.
1908 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1909 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1911 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1913 ['branding=="Chrome" and buildtype=="Official"', {
1914 # Enable uploading crash dumps.
1915 'mac_breakpad_uploads%': 1,
1916 # Enable dumping symbols at build time for use by Mac Breakpad.
1918 # Enable Keystone auto-update support.
1920 }, { # else: branding!="Chrome" or buildtype!="Official"
1921 'mac_breakpad_uploads%': 0,
1926 }], # OS=="mac" or OS=="ios"
1929 # This is the architecture convention used in WinSDK paths.
1930 ['target_arch=="ia32"', {
1931 'winsdk_arch%': 'x86',
1933 'winsdk_arch%': '<(target_arch)',
1935 ['component=="shared_library" or MSVS_VERSION == "2015"', {
1936 # TODO(scottmg): The allocator shimming doesn't work on the 2015 CRT
1937 # and we are hoping to be able to remove it if an additional feature
1938 # lands in the 2015 CRT API. For now, don't shim and revisit once
1939 # VS2015 is RTM: http://crbug.com/481611.
1940 'win_use_allocator_shim%': 0,
1942 ['component=="static_library"', {
1943 # Turn on multiple dll by default on Windows when in static_library.
1944 'chrome_multiple_dll%': 1,
1946 ['asan==1 or syzyasan==1', {
1947 'win_use_allocator_shim%': 0,
1952 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1953 # Only enabled by default for ninja because it's buggy in VS.
1954 # Not enabled for component=static_library because some targets
1955 # are too large and the toolchain fails due to the size of the
1957 'incremental_chrome_dll%': 1,
1959 # Don't do incremental linking for large modules on 32-bit or when
1960 # component=static_library as the toolchain fails due to the size of
1962 ['MSVS_OS_BITS==32 or component=="static_library"', {
1963 'msvs_large_module_debug_link_mode%': '1', # No
1965 'msvs_large_module_debug_link_mode%': '2', # Yes
1968 'nacl_win64_defines': [
1969 # This flag is used to minimize dependencies when building
1970 # Native Client loader for 64-bit Windows.
1973 # Need to include allocator target, but exclude tcmalloc files.
1974 'use_allocator%': 'winheap',
1977 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1983 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1984 'enable_pepper_cdms%': 1,
1986 'enable_pepper_cdms%': 0,
1989 ['OS=="android" or chromecast==1', {
1990 'enable_browser_cdms%': 1,
1992 'enable_browser_cdms%': 0,
1995 # Native Client glibc toolchain is enabled
1996 # by default except on arm, mips and mips64.
1997 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
1998 'disable_glibc%': 1,
2000 'disable_glibc%': 0,
2003 # Set the relative path from this file to the GYP file of the JPEG
2004 # library used by Chromium.
2005 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2006 # Configuration for using the system libjeg is here.
2007 'libjpeg_gyp_path': '<(libjpeg_ijg_gyp_path)',
2009 'libjpeg_gyp_path': '<(libjpeg_turbo_gyp_path)',
2012 # Options controlling the use of GConf (the classic GNOME configuration
2013 # system) and GIO, which contains GSettings (the new GNOME config system).
2014 ['chromeos==1 or embedded==1', {
2022 # Set up -D and -E flags passed into grit.
2023 ['branding=="Chrome"', {
2024 # TODO(mmoss) The .grd files look for _google_chrome, but for
2025 # consistency they should look for google_chrome_build like C++.
2026 'grit_defines': ['-D', '_google_chrome',
2027 '-E', 'CHROMIUM_BUILD=google_chrome'],
2029 'grit_defines': ['-D', '_chromium',
2030 '-E', 'CHROMIUM_BUILD=chromium'],
2033 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2035 ['desktop_linux==1', {
2036 'grit_defines': ['-D', 'desktop_linux'],
2038 ['toolkit_views==1', {
2039 'grit_defines': ['-D', 'toolkit_views'],
2042 'grit_defines': ['-D', 'use_aura'],
2045 'grit_defines': ['-D', 'use_ash'],
2047 ['use_nss_certs==1', {
2048 'grit_defines': ['-D', 'use_nss_certs'],
2051 'grit_defines': ['-D', 'use_ozone'],
2053 ['image_loader_extension==1', {
2054 'grit_defines': ['-D', 'image_loader_extension'],
2057 'grit_defines': ['-D', 'remoting'],
2059 ['use_titlecase_in_grd==1', {
2060 'grit_defines': ['-D', 'use_titlecase'],
2062 ['use_third_party_translations==1', {
2063 'grit_defines': ['-D', 'use_third_party_translations'],
2065 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2066 'ka', 'ku', 'kw', 'ms', 'ug'
2072 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2073 '--no-output-all-resource-defines',
2076 ['OS=="mac" or OS=="ios"', {
2077 'grit_defines': ['-D', 'scale_factors=2x'],
2081 'enable_coverage%': 0,
2085 '--no-output-all-resource-defines',
2087 # iOS uses a whitelist to filter resources.
2088 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2090 # Enable host builds when generating with ninja-ios.
2092 ['"<(GENERATOR)"=="ninja"', {
2096 # Use the version of clang shipped with Xcode when building official
2097 # version of Chrome for iOS.
2099 # TODO(eugenebut): Remove enable_coverage check once
2100 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2101 # http://crbug.com/450379
2102 ['buildtype=="Official" or enable_coverage', {
2107 ['enable_extensions==1', {
2108 'grit_defines': ['-D', 'enable_extensions'],
2110 ['enable_plugins!=0', {
2111 'grit_defines': ['-D', 'enable_plugins'],
2113 ['enable_basic_printing==1 or enable_print_preview==1', {
2114 'grit_defines': ['-D', 'enable_printing'],
2116 ['enable_print_preview==1', {
2117 'grit_defines': ['-D', 'enable_print_preview'],
2119 ['enable_themes==1', {
2120 'grit_defines': ['-D', 'enable_themes'],
2122 ['enable_app_list==1', {
2123 'grit_defines': ['-D', 'enable_app_list'],
2125 ['enable_settings_app==1', {
2126 'grit_defines': ['-D', 'enable_settings_app'],
2128 ['enable_google_now==1', {
2129 'grit_defines': ['-D', 'enable_google_now'],
2131 ['use_concatenated_impulse_responses==1', {
2132 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2134 ['enable_media_router==1', {
2135 'grit_defines': ['-D', 'enable_media_router'],
2137 ['enable_webrtc==1', {
2138 'grit_defines': ['-D', 'enable_webrtc'],
2140 ['enable_hangout_services_extension==1', {
2141 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2143 ['enable_task_manager==1', {
2144 'grit_defines': ['-D', 'enable_task_manager'],
2146 ['notifications==1', {
2147 'grit_defines': ['-D', 'enable_notifications'],
2149 ['enable_wifi_bootstrapping==1', {
2150 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2152 ['mac_views_browser==1', {
2153 'grit_defines': ['-D', 'mac_views_browser'],
2155 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2156 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2158 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2159 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2161 ['enable_mdns==1 or OS=="mac"', {
2162 'grit_defines': ['-D', 'enable_service_discovery'],
2163 'enable_service_discovery%': 1
2165 ['clang_use_chrome_plugins==1', {
2171 ['OS=="mac" or OS=="ios"', {
2172 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2173 }, { # OS != "mac" or OS != "ios"
2174 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
2178 'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ',
2180 # On Windows, the plugin is built directly into clang, so there's
2181 # no need to load it dynamically.
2182 'clang_dynlib_flags%': '',
2184 # https://crbug.com/441916
2185 ['OS=="android" or OS=="linux" or OS=="mac"', {
2186 'clang_plugin_args%': '-Xclang -plugin-arg-find-bad-constructs -Xclang check-templates ',
2187 }, { # OS != "linux"
2188 'clang_plugin_args%': ''
2192 # If you change these, also change build/config/clang/BUILD.gn.
2193 'clang_chrome_plugins_flags%':
2194 '<(clang_dynlib_flags)'
2195 '-Xclang -add-plugin -Xclang find-bad-constructs <(clang_plugin_args)',
2197 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2199 'use_allocator%': 'none',
2200 'use_sanitizer_options%': 1,
2203 # Allowed level of identical code folding in the gold linker.
2204 ['OS=="linux" and target_arch=="x64"', {
2205 # --icf=safe disables much more folding on x86_64 than elsewhere, see
2206 # http://crbug.com/492177. Turning it on saves over 12 MB of binary
2207 # size, but it seems to regress cold startup time by over a second
2208 # (see http://crbug.com/492809).
2209 # TODO(thakis): Check if disabling ICF would inmprove android cold start
2210 # times by several seconds too.
2211 'gold_icf_level%': 'safe',
2213 'gold_icf_level%': 'all',
2216 ['OS=="linux" and asan==0 and msan==0 and lsan==0 and tsan==0', {
2217 # PNaCl toolchain Non-SFI build only supports linux OS build.
2218 # Also, it does not support sanitizers.
2219 'enable_nacl_nonsfi_test%': 1,
2221 ['asan==1 and OS=="linux" and chromeos==0', {
2222 'use_custom_libcxx%': 1,
2230 ['asan==1 and OS=="mac"', {
2231 'mac_strip_release': 1,
2234 'use_custom_libcxx%': 1,
2237 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2238 # libstdc++. This is required to avoid false positive reports whenever
2239 # the C++ standard library is used.
2240 'use_custom_libcxx%': 1,
2241 # Running the V8-generated code on an ARM simulator is a powerful hack
2242 # that allows the tool to see the memory accesses from JITted code.
2243 # Without this flag, JS code causes false positive reports from MSan.
2244 'v8_target_arch': 'arm64',
2247 ['OS=="linux" and clang_type_profiler==1', {
2249 'clang_use_chrome_plugins%': 0,
2251 ['host_arch=="x64"', {
2252 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2254 ['host_arch=="ia32"', {
2255 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2256 # Clang in this directory at your own risk if needed for some
2257 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2258 # usage). Any failure by this compiler should not close the tree.
2259 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2264 # On valgrind bots, override the optimizer settings so we don't inline too
2265 # much and make the stacks harder to figure out.
2267 # TODO(rnk): Kill off variables that no one else uses and just implement
2268 # them under a build_for_tool== condition.
2269 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2271 'mac_debug_optimization': '1',
2272 'mac_release_optimization': '1',
2273 'release_optimize': '1',
2274 'no_gc_sections': 1,
2275 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2276 '-fno-builtin -fno-optimize-sibling-calls',
2277 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2278 '-fno-builtin -fno-optimize-sibling-calls',
2280 # MSVS flags for TSan on Pin and Windows.
2281 'win_debug_RuntimeChecks': '0',
2282 'win_debug_disable_iterator_debugging': '1',
2283 'win_debug_Optimization': '1',
2284 'win_debug_InlineFunctionExpansion': '0',
2285 'win_release_InlineFunctionExpansion': '0',
2286 'win_release_OmitFramePointers': '0',
2288 'use_allocator': 'tcmalloc',
2289 'release_valgrind_build': 1,
2291 'component': 'static_library',
2292 'use_system_zlib': 0,
2295 # Build tweaks for DrMemory.
2296 # TODO(rnk): Combine with tsan config to share the builder.
2297 # http://crbug.com/108155
2298 ['build_for_tool=="drmemory"', {
2299 # These runtime checks force initialization of stack vars which blocks
2300 # DrMemory's uninit detection.
2301 'win_debug_RuntimeChecks': '0',
2302 # Iterator debugging is slow.
2303 'win_debug_disable_iterator_debugging': '1',
2304 # Try to disable optimizations that mess up stacks in a release build.
2305 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2306 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2307 # compiler bug, so we use /Ob1 instead.
2308 'win_release_InlineFunctionExpansion': '1',
2309 'win_release_OmitFramePointers': '0',
2310 # Ditto for debug, to support bumping win_debug_Optimization.
2311 'win_debug_InlineFunctionExpansion': 0,
2312 'win_debug_OmitFramePointers': 0,
2313 # Keep the code under #ifndef NVALGRIND.
2314 'release_valgrind_build': 1,
2317 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2318 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2322 # Set default compiler flags depending on ARM version.
2323 ['arm_version==6', {
2324 'arm_arch%': 'armv6',
2327 'arm_float_abi%': 'softfp',
2330 ['arm_version==7', {
2331 'arm_arch%': 'armv7-a',
2332 'arm_tune%': 'generic-armv7-a',
2337 'arm_fpu%': 'vfpv3-d16',
2340 'arm_float_abi%': 'softfp',
2342 'arm_float_abi%': 'hard',
2348 # Set default compiler flags for MIPS floating-point support.
2349 ['target_arch=="mipsel"', {
2350 'mips_float_abi%': 'hard',
2352 ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
2353 'mips_fpu_mode%': 'fp32',
2356 # Enable brlapi by default for chromeos.
2361 ['use_ozone==1 and ozone_auto_platforms==1', {
2362 # Use test as the default platform.
2363 'ozone_platform%': 'test',
2365 # Build all platforms whose deps are in install-build-deps.sh.
2366 # Only these platforms will be compile tested by buildbots.
2367 'ozone_platform_dri%': 1,
2368 'ozone_platform_drm%': 1,
2369 'ozone_platform_test%': 1,
2370 'ozone_platform_egltest%': 1,
2373 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2374 'use_clipboard_aurax11%': 1,
2377 ['OS=="win" and use_goma==1', {
2378 # goma doesn't support pch yet.
2379 'chromium_win_pch': 0,
2380 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2382 ['win_z7==0 and fastbuild==0', {
2388 ['OS=="win" and (clang==1 or asan==1)', {
2389 'chromium_win_pch': 0,
2393 'host_cc': '<(make_clang_dir)/bin/clang',
2394 'host_cxx': '<(make_clang_dir)/bin/clang++',
2396 'host_cc': '<!(which gcc)',
2397 'host_cxx': '<!(which g++)',
2400 # The seccomp-bpf sandbox is only supported on five architectures
2402 # Do not disable seccomp_bpf anywhere without talking to
2403 # security@chromium.org!
2404 ['((OS=="linux" or OS=="android") and '
2405 '(target_arch=="ia32" or target_arch=="x64" or '
2406 'target_arch=="arm" or target_arch=="mipsel" or '
2407 'target_arch=="arm64"))', {
2408 'use_seccomp_bpf%': 1,
2410 'use_seccomp_bpf%': 0,
2417 ['branding=="Chrome" and buildtype=="Official"', {
2418 'enable_hangout_services_extension%': 1,
2420 'enable_hangout_services_extension%': 0,
2424 # The path to the ANGLE library.
2425 'angle_path': '<(DEPTH)/third_party/angle',
2427 # List of default apps to install in new profiles. The first list contains
2428 # the source files as found in svn. The second list, used only for linux,
2429 # contains the destination location for each of the files. When a crx
2430 # is added or removed from the list, the chrome/browser/resources/
2431 # default_apps/external_extensions.json file must also be updated.
2433 # README: GN version of these is in the target //chrome:default_apps
2434 # (there's no global variable like in GYP). Be sure to update that target
2435 # if you change these lists!
2436 'default_apps_list': [
2437 'browser/resources/default_apps/external_extensions.json',
2438 'browser/resources/default_apps/gmail.crx',
2439 'browser/resources/default_apps/search.crx',
2440 'browser/resources/default_apps/youtube.crx',
2441 'browser/resources/default_apps/drive.crx',
2442 'browser/resources/default_apps/docs.crx',
2444 'default_apps_list_linux_dest': [
2445 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2446 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2447 '<(PRODUCT_DIR)/default_apps/search.crx',
2448 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2449 '<(PRODUCT_DIR)/default_apps/drive.crx',
2450 '<(PRODUCT_DIR)/default_apps/docs.crx',
2453 # Whether to allow building of the GPU-related isolates.
2454 'archive_gpu_tests%': 0,
2456 # Whether to allow building of chromoting related isolates.
2457 'archive_chromoting_tests%': 0,
2459 'target_defaults': {
2461 # The condition that operates on chromium_code is in a target_conditions
2462 # section, and will not have access to the default fallback value of
2463 # chromium_code at the top of this file, or to the chromium_code
2464 # variable placed at the root variables scope of .gyp files, because
2465 # those variables are not set at target scope. As a workaround,
2466 # if chromium_code is not set at target scope, define it in target scope
2467 # to contain whatever value it has during early variable expansion.
2468 # That's enough to make it available during target conditional
2470 'chromium_code%': '<(chromium_code)',
2472 'component%': '<(component)',
2474 'chromecast%': '<(chromecast)',
2476 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2477 'win_release_Optimization%': '2', # 2 = /O2
2478 'win_debug_Optimization%': '0', # 0 = /Od
2480 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2481 # Tri-state: blank is default, 1 on, 0 off
2482 'win_release_OmitFramePointers%': '0',
2483 # Tri-state: blank is default, 1 on, 0 off
2484 'win_debug_OmitFramePointers%': '',
2486 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2487 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2489 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2490 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2491 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2493 # VS inserts quite a lot of extra checks to algorithms like
2494 # std::partial_sort in Debug build which make them O(N^2)
2495 # instead of O(N*logN). This is particularly slow under memory
2496 # tools like ThreadSanitizer so we want it to be disablable.
2497 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2498 'win_debug_disable_iterator_debugging%': '0',
2500 # An application manifest fragment to declare compatibility settings for
2501 # 'executable' targets. Ignored in other target type.
2502 'win_exe_compatibility_manifest%':
2503 '<(DEPTH)\\build\\win\\compatibility.manifest',
2505 'release_extra_cflags%': '',
2506 'debug_extra_cflags%': '',
2508 'release_valgrind_build%': '<(release_valgrind_build)',
2510 # the non-qualified versions are widely assumed to be *nix-only
2511 'win_release_extra_cflags%': '',
2512 'win_debug_extra_cflags%': '',
2514 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2515 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2517 # Only used by Windows build for now. Can be used to build into a
2518 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2519 # output files in src/build/VS2010_{Debug,Release}.
2520 'build_dir_prefix%': '',
2522 # Targets are by default not nacl untrusted code.
2523 'nacl_untrusted_build%': 0,
2525 'pnacl_compile_flags': [
2526 # pnacl uses the clang compiler so we need to suppress all the
2527 # same warnings as we do for clang.
2528 # TODO(sbc): Remove these if/when they are removed from the clang
2530 '-Wno-unused-function',
2531 '-Wno-char-subscripts',
2532 '-Wno-c++11-extensions',
2533 '-Wno-unnamed-type-template-args',
2536 # By default, Android targets have their exported JNI symbols stripped,
2537 # so we test the manual JNI registration code paths that are required
2538 # when using the crazy linker. To allow use of native JNI exports (lazily
2539 # resolved by the JVM), targets can enable this variable, which will stop
2540 # the stripping from happening. Only targets which do not need to be
2541 # compatible with the crazy linker are permitted to set this.
2542 'use_native_jni_exports%': 0,
2545 ['OS=="win" and component=="shared_library"', {
2546 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2547 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2548 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2550 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2551 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2552 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2555 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2556 'mac_release_optimization%': 's', # Use -Os unless overridden
2557 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2559 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2560 'mac_release_optimization%': '2', # Use -O2 unless overridden
2561 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2564 'host_os%': '<(host_os)', # See comment above chromium_code.
2567 'clang_warning_flags': [
2570 # Don't die on dtoa code that uses a char as an array index.
2571 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2572 '-Wno-char-subscripts',
2574 # TODO(thakis): This used to be implied by -Wno-unused-function,
2575 # which we no longer use. Check if it makes sense to remove
2576 # this as well. http://crbug.com/316352
2577 '-Wno-unneeded-internal-declaration',
2579 # Warns on switches on enums that cover all enum values but
2580 # also contain a default: branch. Chrome is full of that.
2581 '-Wno-covered-switch-default',
2583 # Warns when a const char[] is converted to bool.
2584 '-Wstring-conversion',
2586 # C++11-related flags:
2588 # This warns on using ints as initializers for floats in
2589 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2590 # which happens in several places in chrome code. Not sure if
2591 # this is worth fixing.
2592 '-Wno-c++11-narrowing',
2594 # Clang considers the `register` keyword as deprecated, but e.g.
2595 # code generated by flex (used in angle) contains that keyword.
2596 # http://crbug.com/255186
2597 '-Wno-deprecated-register',
2599 # TODO(hans): Get this cleaned up.
2600 '-Wno-inconsistent-missing-override',
2603 'includes': [ 'set_clang_warning_flags.gypi', ],
2605 # Don't use deprecated V8 APIs anywhere.
2606 'V8_DEPRECATION_WARNINGS',
2609 '<(SHARED_INTERMEDIATE_DIR)',
2613 # When compiling Objective C, warns if a method is used whose
2614 # availability is newer than the deployment target.
2615 'xcode_settings': { 'WARNING_CFLAGS': ['-Wpartial-availability']},
2617 ['(OS=="mac" or OS=="ios") and asan==1', {
2619 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2622 ['OS=="win" and asan==1 and component=="shared_library"', {
2624 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2627 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2628 'cflags_cc!': ['-fno-rtti'],
2631 '-gline-tables-only',
2632 '-fintercept-allocation-functions',
2634 'defines': ['TYPE_PROFILING'],
2636 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2639 ['branding=="Chrome"', {
2640 'defines': ['GOOGLE_CHROME_BUILD'],
2641 }, { # else: branding!="Chrome"
2642 'defines': ['CHROMIUM_BUILD'],
2644 ['OS=="mac" and component=="shared_library"', {
2646 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2647 'LD_RUNPATH_SEARCH_PATHS': [
2648 # For unbundled binaries.
2650 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2651 '@loader_path/../../..',
2655 ['clang==1 or host_clang==1', {
2656 # This is here so that all files get recompiled after a clang roll and
2657 # when turning clang on or off.
2658 # (defines are passed via the command line, and build systems rebuild
2659 # things when their commandline changes). Nothing should ever read this
2661 'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
2664 'defines': ['ENABLE_RLZ'],
2666 ['component=="shared_library"', {
2667 'defines': ['COMPONENT_BUILD'],
2669 ['toolkit_views==1', {
2670 'defines': ['TOOLKIT_VIEWS=1'],
2672 ['ui_compositor_image_transport==1', {
2673 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2676 'defines': ['USE_AURA=1'],
2679 'defines': ['USE_ASH=1'],
2682 'defines': ['USE_PANGO=1'],
2685 'defines': ['USE_CAIRO=1'],
2688 'defines': ['USE_CRAS=1'],
2691 'defines': ['USE_OZONE=1'],
2693 ['use_default_render_theme==1', {
2694 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2696 ['use_libjpeg_turbo==1', {
2697 'defines': ['USE_LIBJPEG_TURBO=1'],
2700 'defines': ['USE_X11=1'],
2702 ['use_clipboard_aurax11==1', {
2703 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2705 ['enable_one_click_signin==1', {
2706 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2708 ['enable_pre_sync_backup==1', {
2709 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2711 ['image_loader_extension==1', {
2712 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2715 'defines': ['ENABLE_PROFILING=1'],
2718 'defines': ['ENABLE_REMOTING=1'],
2720 ['enable_webrtc==1', {
2721 'defines': ['ENABLE_WEBRTC=1'],
2723 ['enable_media_router==1', {
2724 'defines': ['ENABLE_MEDIA_ROUTER=1'],
2726 ['proprietary_codecs==1', {
2727 'defines': ['USE_PROPRIETARY_CODECS'],
2729 ['enable_mpeg2ts_stream_parser==1', {
2730 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2734 ['enable_viewport==1', {
2735 'defines': ['ENABLE_VIEWPORT'],
2737 ['enable_pepper_cdms==1', {
2738 'defines': ['ENABLE_PEPPER_CDMS'],
2740 ['enable_browser_cdms==1', {
2741 'defines': ['ENABLE_BROWSER_CDMS'],
2743 ['configuration_policy==1', {
2744 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2746 ['notifications==1', {
2747 'defines': ['ENABLE_NOTIFICATIONS'],
2749 ['enable_hidpi==1', {
2750 'defines': ['ENABLE_HIDPI=1'],
2752 ['enable_topchrome_md==1', {
2753 'defines': ['ENABLE_TOPCHROME_MD=1'],
2755 ['native_memory_pressure_signals==1', {
2756 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2759 'defines': ['USE_UDEV'],
2763 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2766 ['OS=="win" and fastbuild==2', {
2767 # Completely disable debug information.
2770 'GenerateDebugInformation': 'false',
2772 'VCCLCompilerTool': {
2773 'DebugInformationFormat': '0',
2777 ['OS=="win" and fastbuild==1', {
2780 # This tells the linker to generate .pdbs, so that
2781 # we can get meaningful stack traces.
2782 'GenerateDebugInformation': 'true',
2784 'VCCLCompilerTool': {
2785 # No debug info to be generated by compiler.
2786 'DebugInformationFormat': '0',
2790 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2791 'variables': { 'debug_extra_cflags': '-g0', },
2793 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2794 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2796 'variables': { 'debug_extra_cflags': '-g0', },
2798 # Android builds symbols on release by default, disable them.
2799 ['OS=="android" and fastbuild==2', {
2800 'variables': { 'release_extra_cflags': '-g0', },
2802 ['OS=="android" and fastbuild==1', {
2803 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2805 'variables': { 'release_extra_cflags': '-g0', },
2809 ['dont_embed_build_metadata==1', {
2811 'DONT_EMBED_BUILD_METADATA',
2813 }], # dont_embed_build_metadata==1
2814 ['dcheck_always_on!=0', {
2815 'defines': ['DCHECK_ALWAYS_ON=1'],
2816 }], # dcheck_always_on!=0
2817 ['tracing_like_official_build!=0', {
2818 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2819 }], # tracing_like_official_build!=0
2821 'defines': ['NO_TCMALLOC'],
2823 ['win_use_allocator_shim==1', {
2824 'defines': ['ALLOCATOR_SHIM'],
2830 'ADDRESS_SANITIZER',
2831 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2832 'MEMORY_SANITIZER_INITIAL_SIZE',
2836 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2844 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2845 'MEMORY_SANITIZER_INITIAL_SIZE',
2853 '<(DEPTH)/third_party/kasko/include',
2859 '_CRT_SECURE_NO_DEPRECATE',
2860 '_SCL_SECURE_NO_DEPRECATE',
2861 # This define is required to pull in the new Win8 interfaces from
2862 # system headers like ShObjIdl.h.
2863 'NTDDI_VERSION=0x06030000',
2864 # This is required for ATL to use XP-safe versions of its functions.
2865 '_USING_V110_SDK71_',
2868 '<(DEPTH)/third_party/wtl/include',
2873 # Generates debug info when win_z7=1
2874 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2876 'GenerateDebugInformation': 'true',
2878 'VCCLCompilerTool': {
2879 'DebugInformationFormat': '1',
2885 # This is prohibited when running /analyze.
2886 '_USING_V110_SDK71_',
2889 'VCCLCompilerTool': {
2890 # Set WarnAsError to false to disable this setting for most
2891 # projects so that compilation continues.
2892 'WarnAsError': 'false',
2893 # When win_analyze is specified add the /analyze switch.
2894 # Also add /WX- to force-disable WarnAsError for projects that
2895 # override WarnAsError.
2896 # Also, disable various noisy warnings that have low value.
2897 'AdditionalOptions': [
2900 '/wd6011', # Dereferencing NULL pointer
2901 '/wd6312', # Possible infinite loop: use of the constant
2902 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2903 '/wd6326', # Potential comparison of constant with constant
2904 '/wd28159', # Consider using 'GetTickCount64'
2905 '/wd28204', # Inconsistent SAL annotations
2906 '/wd28251', # Inconsistent SAL annotations
2907 '/wd28252', # Inconsistent SAL annotations
2908 '/wd28253', # Inconsistent SAL annotations
2909 '/wd28196', # The precondition is not satisfied
2910 '/wd28301', # Inconsistent SAL annotations
2911 '/wd6340', # Sign mismatch in function parameter
2912 '/wd28182', # Dereferencing NULL pointer
2913 # C6285 is ~16% of raw warnings and has low value
2914 '/wd6285', # non-zero constant || non-zero constant
2915 # C6334 is ~80% of raw warnings and has low value
2916 '/wd6334', # sizeof applied to an expression with an operator
2928 ['use_playready==1', {
2930 'PLAYREADY_CDM_AVAILABLE',
2935 ['enable_task_manager==1', {
2937 'ENABLE_TASK_MANAGER=1',
2940 ['enable_extensions==1', {
2942 'ENABLE_EXTENSIONS=1',
2945 ['OS=="win" and branding=="Chrome"', {
2946 'defines': ['ENABLE_SWIFTSHADER'],
2948 ['enable_dart==1', {
2949 'defines': ['WEBKIT_USING_DART=1'],
2951 ['enable_plugin_installation==1', {
2952 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2954 ['enable_plugins==1', {
2955 'defines': ['ENABLE_PLUGINS=1'],
2957 ['enable_session_service==1', {
2958 'defines': ['ENABLE_SESSION_SERVICE=1'],
2960 ['enable_themes==1', {
2961 'defines': ['ENABLE_THEMES=1'],
2963 ['enable_autofill_dialog==1', {
2964 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2966 ['enable_prod_wallet_service==1', {
2967 # In GN, this is set on the autofill tagets only. See
2968 # //components/autofill/core/browser:wallet_service
2969 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2971 ['enable_background==1', {
2972 'defines': ['ENABLE_BACKGROUND=1'],
2974 ['enable_google_now==1', {
2975 'defines': ['ENABLE_GOOGLE_NOW=1'],
2977 ['cld_version!=0', {
2978 'defines': ['CLD_VERSION=<(cld_version)'],
2980 ['enable_basic_printing==1 or enable_print_preview==1', {
2981 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2982 'defines': ['ENABLE_PRINTING=1'],
2984 ['enable_basic_printing==1', {
2985 # Enable basic printing support and UI.
2986 'defines': ['ENABLE_BASIC_PRINTING=1'],
2988 ['enable_print_preview==1', {
2989 # Enable printing with print preview.
2990 # Can be defined without ENABLE_BASIC_PRINTING.
2991 'defines': ['ENABLE_PRINT_PREVIEW=1'],
2993 ['enable_spellcheck==1', {
2994 'defines': ['ENABLE_SPELLCHECK=1'],
2996 ['enable_captive_portal_detection==1', {
2997 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2999 ['enable_app_list==1', {
3000 'defines': ['ENABLE_APP_LIST=1'],
3002 ['enable_settings_app==1', {
3003 'defines': ['ENABLE_SETTINGS_APP=1'],
3005 ['disable_file_support==1', {
3006 'defines': ['DISABLE_FILE_SUPPORT=1'],
3008 ['disable_ftp_support==1', {
3009 'defines': ['DISABLE_FTP_SUPPORT=1'],
3011 ['enable_supervised_users==1', {
3012 'defines': ['ENABLE_SUPERVISED_USERS=1'],
3014 ['spdy_proxy_auth_property != ""', {
3015 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
3017 ['spdy_proxy_auth_value != ""', {
3018 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
3020 ['enable_mdns==1', {
3021 'defines': ['ENABLE_MDNS=1'],
3023 ['enable_service_discovery==1', {
3024 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
3026 ['enable_wifi_bootstrapping==1', {
3027 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
3029 ['enable_hangout_services_extension==1', {
3030 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
3032 ['enable_ipc_fuzzer==1', {
3033 'defines': ['ENABLE_IPC_FUZZER=1'],
3036 'defines': ['VIDEO_HOLE=1'],
3038 ['v8_use_external_startup_data==1', {
3039 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
3042 # SAFE_BROWSING_SERVICE - browser manages a safe-browsing service.
3043 # SAFE_BROWSING_DB_LOCAL - service manages a local database.
3044 # SAFE_BROWSING_DB_REMOTE - service talks via API to a database
3045 # SAFE_BROWSING_CSD - enable client-side phishing detection.
3046 ['safe_browsing==1', {
3048 # TODO(nparker): Remove existing uses of FULL_SAFE_BROWSING
3049 'FULL_SAFE_BROWSING',
3050 'SAFE_BROWSING_CSD',
3051 'SAFE_BROWSING_DB_LOCAL',
3052 'SAFE_BROWSING_SERVICE',
3055 ['safe_browsing==2', {
3057 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3058 'MOBILE_SAFE_BROWSING',
3059 'SAFE_BROWSING_SERVICE',
3062 ['safe_browsing==3', {
3064 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3065 'MOBILE_SAFE_BROWSING',
3066 'SAFE_BROWSING_DB_REMOTE',
3067 'SAFE_BROWSING_SERVICE',
3070 ], # conditions for 'target_defaults'
3071 'target_conditions': [
3072 ['<(use_libpci)==1', {
3073 'defines': ['USE_LIBPCI=1'],
3075 ['<(use_openssl)==1', {
3076 'defines': ['USE_OPENSSL=1'],
3078 ['<(use_openssl_certs)==1', {
3079 'defines': ['USE_OPENSSL_CERTS=1'],
3081 ['>(nacl_untrusted_build)==1', {
3084 'USE_OPENSSL_CERTS=1',
3087 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3088 'defines': ['USE_GLIB=1'],
3090 ['<(use_nss_certs)==1 and >(nacl_untrusted_build)==0', {
3091 'defines': ['USE_NSS_CERTS=1'],
3093 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3094 'defines': ['OS_CHROMEOS=1'],
3096 ['enable_wexit_time_destructors==1 and OS!="win"', {
3097 # TODO: Enable on Windows too, http://crbug.com/404525
3098 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3100 ['chromium_code==0', {
3102 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3103 # We don't want to get warnings from third-party code,
3104 # so remove any existing warning-enabling flags like -Wall.
3110 # Don't warn about hash_map in third-party code.
3114 # Don't warn about printf format problems.
3115 # This is off by default in gcc but on in Ubuntu's gcc(!).
3119 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3123 # TODO: Fix all warnings on chromeos too.
3124 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3129 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3131 # Don't warn about ignoring the return value from e.g. close().
3132 # This is off by default in some gccs but on by default in others.
3133 # BSD systems do not support this option, since they are usually
3134 # using gcc 4.2.1, which does not have this flag yet.
3135 '-Wno-unused-result',
3140 '_CRT_SECURE_NO_DEPRECATE',
3141 '_CRT_NONSTDC_NO_WARNINGS',
3142 '_CRT_NONSTDC_NO_DEPRECATE',
3143 '_SCL_SECURE_NO_DEPRECATE',
3145 'msvs_disabled_warnings': [
3149 'VCCLCompilerTool': {
3150 'WarningLevel': '3',
3151 'WarnAsError': 'true',
3152 'Detect64BitPortabilityProblems': 'false',
3156 ['buildtype=="Official"', {
3158 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3161 [ 'component=="shared_library"', {
3162 # TODO(darin): Unfortunately, some third_party code depends on base.
3163 'msvs_disabled_warnings': [
3164 4251, # class 'std::xx' needs to have dll-interface.
3170 [ 'OS=="mac" or OS=="ios"', {
3172 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3175 ['buildtype=="Official"', {
3177 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3184 # TODO(ios): Fix remaining warnings in third-party code, then
3185 # remove this; the Mac cleanup didn't get everything that's
3186 # flagged in an iOS build.
3187 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3188 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3189 # Several internal ios directories generate numerous warnings for
3190 # -Wobjc-missing-property-synthesis.
3191 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3197 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3198 'filename_rules.gypi',
3200 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3201 # C99 macros on Mac and Linux.
3203 '__STDC_CONSTANT_MACROS',
3204 '__STDC_FORMAT_MACROS',
3208 # turn on warnings for signed/unsigned mismatch on chromium code.
3210 'VCCLCompilerTool': {
3211 'AdditionalOptions': ['/we4389'],
3215 ['OS=="win" and component=="shared_library"', {
3216 'msvs_disabled_warnings': [
3217 4251, # class 'std::xx' needs to have dll-interface.
3222 ], # target_conditions for 'target_defaults'
3223 'default_configuration': 'Debug',
3225 # VCLinkerTool LinkIncremental values below:
3227 # 1 == /INCREMENTAL:NO
3229 # Debug links incremental, Release does not.
3231 # Abstract base configurations to cover common attributes.
3235 'msvs_configuration_attributes': {
3236 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3237 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3238 'CharacterSet': '1',
3240 # Add the default import libs.
3243 'AdditionalDependencies': [
3260 'AdditionalOptions': [
3261 # Suggested by Microsoft Devrel to avoid
3262 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3263 # which started happening more regularly after VS2013 Update 4.
3264 # Needs to be a bit lower for VS2015, or else errors out.
3265 '/maxilksize:0x7ff00000',
3274 'MinimumRequiredVersion': '5.01', # XP.
3275 'TargetMachine': '1',
3277 'VCLibrarianTool': {
3278 'TargetMachine': '1',
3281 'msvs_configuration_platform': 'Win32',
3285 'msvs_configuration_platform': 'x64',
3288 # Make sure to understand http://crbug.com/361720 if you want to
3290 'MinimumRequiredVersion': '5.02', # Server 2003.
3291 'TargetMachine': '17', # x86 - 64
3292 'AdditionalLibraryDirectories!':
3293 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3294 'AdditionalLibraryDirectories':
3295 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3296 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3297 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3299 'VCLibrarianTool': {
3300 'AdditionalLibraryDirectories!':
3301 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3302 'AdditionalLibraryDirectories':
3303 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3304 'TargetMachine': '17', # x64
3311 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3312 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3315 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3317 '<@(debug_extra_cflags)',
3321 'VCCLCompilerTool': {
3322 'Optimization': '<(win_debug_Optimization)',
3323 'PreprocessorDefinitions': ['_DEBUG'],
3324 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3325 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3327 # According to MSVS, InlineFunctionExpansion=0 means
3328 # "default inlining", not "/Ob0".
3329 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3330 ['win_debug_InlineFunctionExpansion==0', {
3331 'AdditionalOptions': ['/Ob0'],
3333 ['win_debug_InlineFunctionExpansion!=""', {
3334 'InlineFunctionExpansion':
3335 '<(win_debug_InlineFunctionExpansion)',
3337 ['win_debug_disable_iterator_debugging==1', {
3338 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3341 # if win_debug_OmitFramePointers is blank, leave as default
3342 ['win_debug_OmitFramePointers==1', {
3343 'OmitFramePointers': 'true',
3345 ['win_debug_OmitFramePointers==0', {
3346 'OmitFramePointers': 'false',
3347 # The above is not sufficient (http://crbug.com/106711): it
3348 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3349 # perform FPO regardless, so we must explicitly disable.
3350 # We still want the false setting above to avoid having
3351 # "/Oy /Oy-" and warnings about overriding.
3352 'AdditionalOptions': ['/Oy-'],
3355 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3358 'LinkIncremental': '<(msvs_debug_link_incremental)',
3359 # ASLR makes debugging with windbg difficult because Chrome.exe and
3360 # Chrome.dll share the same base name. As result, windbg will
3361 # name the Chrome.dll module like chrome_<base address>, where
3362 # <base address> typically changes with each launch. This in turn
3363 # means that breakpoints in Chrome.dll don't stick from one launch
3364 # to the next. For this reason, we turn ASLR off in debug builds.
3365 # Note that this is a three-way bool, where 0 means to pick up
3366 # the default setting, 1 is off and 2 is on.
3367 'RandomizedBaseAddress': 1,
3369 'VCResourceCompilerTool': {
3370 'PreprocessorDefinitions': ['_DEBUG'],
3374 ['OS=="linux" or OS=="android"', {
3375 'target_conditions': [
3376 ['_toolset=="target"', {
3378 '<@(debug_extra_cflags)',
3383 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3384 # Enable libstdc++ debugging facilities to help catch problems
3385 # early, see http://crbug.com/65151 .
3386 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3387 'defines': ['_GLIBCXX_DEBUG=1',],
3389 ['release_valgrind_build==0', {
3392 '-fstack-protector-all', # Implies -fstack-protector
3398 # Allow comparing the address of references and 'this' against 0
3399 # in debug builds. Technically, these can never be null in
3400 # well-defined C/C++ and Clang can optimize such checks away in
3401 # release builds, but they may be used in asserts in debug builds.
3402 '-Wno-undefined-bool-conversion',
3403 '-Wno-tautological-undefined-compare',
3407 '-Wno-undefined-bool-conversion',
3408 '-Wno-tautological-undefined-compare',
3412 'VCCLCompilerTool': {
3413 'AdditionalOptions': [
3414 '-Wno-undefined-bool-conversion',
3415 '-Wno-tautological-undefined-compare',
3428 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3429 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3430 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3433 'VCCLCompilerTool': {
3434 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3436 # In official builds, each target will self-select
3437 # an optimization level.
3438 ['buildtype!="Official"', {
3439 'Optimization': '<(win_release_Optimization)',
3442 # According to MSVS, InlineFunctionExpansion=0 means
3443 # "default inlining", not "/Ob0".
3444 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3445 ['win_release_InlineFunctionExpansion==0', {
3446 'AdditionalOptions': ['/Ob0'],
3448 ['win_release_InlineFunctionExpansion!=""', {
3449 'InlineFunctionExpansion':
3450 '<(win_release_InlineFunctionExpansion)',
3453 # if win_release_OmitFramePointers is blank, leave as default
3454 ['win_release_OmitFramePointers==1', {
3455 'OmitFramePointers': 'true',
3457 ['win_release_OmitFramePointers==0', {
3458 'OmitFramePointers': 'false',
3459 # The above is not sufficient (http://crbug.com/106711): it
3460 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3461 # perform FPO regardless, so we must explicitly disable.
3462 # We still want the false setting above to avoid having
3463 # "/Oy /Oy-" and warnings about overriding.
3464 'AdditionalOptions': ['/Oy-'],
3467 # Put data in separate COMDATs. This allows the linker
3468 # to put bit-identical constants at the same address even if
3469 # they're unrelated constants, which saves binary size.
3470 # This optimization can't be used when ASan is enabled because
3471 # it is not compatible with the ASan ODR checker.
3472 'AdditionalOptions': ['/Gw'],
3475 'AdditionalOptions': [
3476 '/d2Zi+', # Improve debugging of Release builds.
3477 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3478 '<@(win_release_extra_cflags)',
3482 # LinkIncremental is a tri-state boolean, where 0 means default
3483 # (i.e., inherit from parent solution), 1 means false, and
3485 'LinkIncremental': '1',
3486 # This corresponds to the /PROFILE flag which ensures the PDB
3487 # file contains FIXUP information (growing the PDB file by about
3488 # 5%) but does not otherwise alter the output binary. This
3489 # information is used by the Syzygy optimization tool when
3490 # decomposing the release image.
3495 ['msvs_use_common_release', {
3496 'includes': ['release.gypi'],
3498 ['release_valgrind_build==0 and tsan==0', {
3501 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3505 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3506 'MEMORY_SANITIZER_INITIAL_SIZE',
3507 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3508 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3512 'defines': ['NO_TCMALLOC'],
3514 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3515 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3516 # It seems to work fine with Ubuntu 12 headers though, so use it
3517 # in official builds.
3518 ['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")', {
3519 'target_conditions': [
3520 ['chromium_code==1', {
3521 # Non-chromium code is not guaranteed to compile cleanly
3522 # with _FORTIFY_SOURCE. Also, fortified build may fail
3523 # when optimizations are disabled, so only do that for Release
3526 '_FORTIFY_SOURCE=2',
3531 ['OS=="linux" or OS=="android"', {
3532 'target_conditions': [
3533 ['_toolset=="target"', {
3535 '<@(release_extra_cflags)',
3538 ['enable_resource_whitelist_generation==1', {
3540 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3549 'NS_BLOCK_ASSERTIONS=1',
3555 # Concrete configurations
3558 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3561 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3566 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3567 'target_conditions': [
3568 [ '_type=="executable"', {
3569 # To get a real .dSYM bundle produced by dsymutil, set the
3570 # debug information format to dwarf-with-dsym. Since
3571 # strip_from_xcode will not be used, set Xcode to do the
3572 # stripping as well.
3574 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3575 'DEPLOYMENT_POSTPROCESSING': 'YES',
3576 'STRIP_INSTALLED_PRODUCT': 'YES',
3583 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3585 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3588 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3596 'target_defaults': {
3601 # TODO(glider): enable the default options on other systems.
3603 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3605 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3611 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3612 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3613 'target_defaults': {
3615 '-Wl,--fatal-warnings',
3619 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3620 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
3621 'target_defaults': {
3627 ['os_posix==1 and chromeos==0', {
3628 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3629 # and we want to avoid overriding this, so stack-protector is only
3630 # enabled when not building on Chrome OS.
3631 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3633 'target_defaults': {
3635 '-fstack-protector',
3636 '--param=ssp-buffer-size=4',
3640 ['os_posix==1 and OS=="linux"', {
3642 '_LARGEFILE_SOURCE',
3643 '_LARGEFILE64_SOURCE',
3644 '_FILE_OFFSET_BITS=64',
3647 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3648 'target_defaults': {
3649 # Enable -Werror by default, but put it in a variable so it can
3650 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3652 'werror%': '-Werror',
3653 'libraries_for_target%': '',
3656 '_FILE_OFFSET_BITS=64',
3659 '<(werror)', # See note above about the werror variable.
3661 '-fno-strict-aliasing', # See http://crbug.com/32204
3663 # Don't warn about unused function params. We use those everywhere.
3664 '-Wno-unused-parameter',
3665 # Don't warn about the "struct foo f = {0};" initialization pattern.
3666 '-Wno-missing-field-initializers',
3667 # Don't export any symbols (for example, to plugins we dlopen()).
3668 # Note: this is *required* to make some plugins work.
3669 '-fvisibility=hidden',
3675 '-fno-threadsafe-statics',
3676 # Make inline functions have hidden visiblity by default.
3677 # Surprisingly, not covered by -fvisibility=hidden.
3678 '-fvisibility-inlines-hidden',
3679 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3680 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3684 '-pthread', '-Wl,-z,noexecstack',
3687 '<(libraries_for_target)',
3692 'debug_optimize%': '0',
3698 '-O>(debug_optimize)',
3703 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3704 # TODO(jdduke) Re-enable on mips after resolving linking
3705 # issues with libc++ (crbug.com/456380).
3707 # Warn in case of text relocations.
3708 '-Wl,--warn-shared-textrel',
3711 ['OS=="android" and android_full_debug==0', {
3712 # Some configurations are copied from Release_Base to reduce
3715 'debug_optimize%': 's',
3719 '-ffunction-sections',
3726 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3727 # We don't omit frame pointers on arm64 since they are required
3728 # to correctly unwind stackframes which contain system library
3729 # function frames (crbug.com/391706).
3731 '-fomit-frame-pointer',
3734 ['OS=="linux" and target_arch=="ia32"', {
3736 '-Wl,--no-as-needed',
3739 ['debug_unwind_tables==1', {
3740 'cflags': ['-funwind-tables'],
3742 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3743 'defines': ['NO_UNWIND_TABLES'],
3745 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3746 # definitions in to the right scope to use them when setting
3747 # linux_use_debug_fission, so it can be used here alone.
3748 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3749 'cflags': ['-gsplit-dwarf'],
3755 'release_optimize%': '2',
3756 # Binaries become big and gold is unable to perform GC
3757 # and remove unused sections for some of test targets
3758 # on 32 bit platform.
3759 # (This is currently observed only in chromeos valgrind bots)
3760 # The following flag is to disable --gc-sections linker
3761 # option for these bots.
3762 'no_gc_sections%': 0,
3764 # TODO(bradnelson): reexamine how this is done if we change the
3765 # expansion of configurations
3766 'release_valgrind_build%': 0,
3769 '-O<(release_optimize)',
3770 # Don't emit the GCC version ident directives, they just end up
3771 # in the .comment section taking up binary size.
3773 # Put data and code in their own sections, so that unused symbols
3774 # can be removed at link time with --gc-sections.
3776 '-ffunction-sections',
3779 # Specifically tell the linker to perform optimizations.
3780 # See http://lwn.net/Articles/192624/ .
3785 ['no_gc_sections==0', {
3787 '-Wl,--gc-sections',
3790 ['OS=="android" and target_arch!="arm64"', {
3791 # We don't omit frame pointers on arm64 since they are required
3792 # to correctly unwind stackframes which contain system library
3793 # function frames (crbug.com/391706).
3795 '-fomit-frame-pointer',
3798 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3799 # TODO(jdduke) Re-enable on mips after resolving linking
3800 # issues with libc++ (crbug.com/456380).
3802 # Warn in case of text relocations.
3803 '-Wl,--warn-shared-textrel',
3808 'release_optimize%': 's',
3813 '-fno-omit-frame-pointer',
3817 ['profiling_full_stack_frames==1', {
3820 '-fno-optimize-sibling-calls',
3825 ['release_unwind_tables==1', {
3826 'cflags': ['-funwind-tables'],
3828 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3829 'defines': ['NO_UNWIND_TABLES'],
3832 # Non-unique section names appears to make linker dead stripping
3833 # less effective. See http://crbug.com/483026#c20
3834 # TODO(hans): Remove this if resolved upstream.
3836 '-funique-section-names',
3843 ['target_arch=="ia32"', {
3844 'target_conditions': [
3845 ['_toolset=="target"', {
3847 # Needed so that libs with .s files (e.g. libicudata.a)
3848 # are compatible with the general 32-bit-ness.
3851 # All floating-point computations on x87 happens in 80-bit
3852 # precision. Because the C and C++ language standards allow
3853 # the compiler to keep the floating-point values in higher
3854 # precision than what's specified in the source and doing so
3855 # is more efficient than constantly rounding up to 64-bit or
3856 # 32-bit precision as specified in the source, the compiler,
3857 # especially in the optimized mode, tries very hard to keep
3858 # values in x87 floating-point stack (in 80-bit precision)
3859 # as long as possible. This has important side effects, that
3860 # the real value used in computation may change depending on
3861 # how the compiler did the optimization - that is, the value
3862 # kept in 80-bit is different than the value rounded down to
3863 # 64-bit or 32-bit. There are possible compiler options to
3864 # make this behavior consistent (e.g. -ffloat-store would keep
3865 # all floating-values in the memory, thus force them to be
3866 # rounded to its original precision) but they have significant
3867 # runtime performance penalty.
3869 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3870 # which keep floating-point values in SSE registers in its
3871 # native precision (32-bit for single precision, and 64-bit
3872 # for double precision values). This means the floating-point
3873 # value used during computation does not change depending on
3874 # how the compiler optimized the code, since the value is
3875 # always kept in its specified precision.
3877 # Refer to http://crbug.com/348761 for rationale behind SSE2
3878 # being a minimum requirement for 32-bit Linux builds and
3879 # http://crbug.com/313032 for an example where this has "bit"
3884 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3891 # Use gold linker for Android ia32 target.
3897 # Install packages have started cropping up with
3898 # different headers between the 32-bit and 64-bit
3899 # versions, so we have to shadow those differences off
3900 # and make sure a 32-bit-on-64-bit build picks up the
3902 # For android build, use NDK headers instead of host headers
3903 ['host_arch!="ia32" and OS!="android"', {
3912 ['target_arch=="x64"', {
3913 'target_conditions': [
3914 ['_toolset=="target"', {
3916 # Use gold linker for Android x64 target.
3933 ['target_arch=="arm"', {
3934 'target_conditions': [
3935 ['_toolset=="target"', {
3939 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3940 # has changed whenever it encounters a varargs function. This
3941 # silences those warnings, as they are not helpful and
3942 # clutter legitimate warnings.
3946 ['clang==1 and arm_arch!="" and OS!="android"', {
3948 '-target arm-linux-gnueabihf',
3951 '-target arm-linux-gnueabihf',
3956 '-march=<(arm_arch)',
3959 ['use_lto==1 or use_lto_o2==1', {
3961 '-march=<(arm_arch)',
3966 ['clang==1 and OS!="android"', {
3968 # We need to disable clang's builtin assembler as it can't
3969 # handle several asm files, crbug.com/124610
3970 '-no-integrated-as',
3975 '-mtune=<(arm_tune)',
3978 ['use_lto==1 or use_lto_o2==1', {
3980 '-mtune=<(arm_tune)',
3990 ['use_lto==1 or use_lto_o2==1', {
3997 ['arm_float_abi!=""', {
3999 '-mfloat-abi=<(arm_float_abi)',
4002 ['use_lto==1 or use_lto_o2==1', {
4004 '-mfloat-abi=<(arm_float_abi)',
4014 ['use_lto==1 or use_lto_o2==1', {
4022 # Most of the following flags are derived from what Android
4023 # uses by default when building for arm, reference for which
4024 # can be found in the following file in the Android NDK:
4025 # toolchains/arm-linux-androideabi-4.9/setup.mk
4027 # The tree-sra optimization (scalar replacement for
4028 # aggregates enabling subsequent optimizations) leads to
4029 # invalid code generation when using the Android NDK's
4030 # compiler (r5-r7). This can be verified using
4031 # webkit_unit_tests' WTF.Checked_int8_t test.
4033 # The following option is disabled to improve binary
4034 # size and performance in gcc 4.9.
4035 '-fno-caller-saves',
4038 # Android now supports .relro sections properly.
4039 # NOTE: While these flags enable the generation of .relro
4040 # sections, the generated libraries can still be loaded on
4041 # older Android platform versions.
4048 ['gcc_version==48 and clang==0', {
4050 # The following 5 options are disabled to save on
4051 # binary size in GCC 4.8.
4052 '-fno-partial-inlining',
4053 '-fno-early-inlining',
4054 '-fno-tree-copy-prop',
4055 '-fno-tree-loop-optimize',
4056 '-fno-move-loop-invariants',
4060 'cflags': [ '-mthumb-interwork' ],
4064 # Thumb code with frame pointer makes chrome crash
4067 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
4068 # The perf report sometimes incorrectly attributes
4069 # code from tail calls.
4070 '-fno-optimize-sibling-calls',
4073 '-fomit-frame-pointer',
4078 # Clang does not support the following options.
4080 '-mthumb-interwork',
4081 '-finline-limit=64',
4083 '-fno-caller-saves',
4087 # TODO(hans) Enable integrated-as (crbug.com/124610).
4088 '-no-integrated-as',
4089 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4092 ['clang==1 and linux_use_bundled_gold==0', {
4094 # Let clang find the ld.gold in the NDK.
4095 '--gcc-toolchain=<(android_toolchain)/..',
4100 '-marm', # Required for frame pointer based stack traces.
4107 # We set arm_arch to "" so that -march compiler option
4108 # is not set. Otherwise a gcc bug that would complain
4109 # about it conflicting with '-mcpu=cortex-a9'. The flag
4110 # '-march=armv7-a' is actually redundant anyway because
4111 # it is enabled by default when we built the toolchain.
4112 # And using '-mcpu=cortex-a9' should be sufficient.
4115 # Breakpad requires symbols with debugging information
4119 # We want to statically link libstdc++/libgcc_s.
4120 '-static-libstdc++',
4124 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4125 # define their own cflags for arm builds that could
4126 # conflict with the flags we set here (e.g.
4127 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4136 ['target_arch=="arm64"', {
4137 'target_conditions': [
4138 ['_toolset=="target"', {
4142 '-fstack-protector', # stack protector is always enabled on arm64.
4149 ['target_arch=="mipsel"', {
4150 'target_conditions': [
4151 ['_toolset=="target"', {
4153 ['mips_arch_variant=="r6"', {
4156 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ],
4157 'ldflags': [ '-target mipsel-linux-gnu', ],
4159 'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
4161 ['clang==0 and OS=="android"', {
4162 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4166 ['mips_arch_variant=="r2"', {
4168 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4169 'cflags': ['-m<(mips_fpu_mode)'],
4174 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
4175 'ldflags': [ '-target mipsel-linux-android', ],
4179 'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
4183 ['mips_arch_variant=="r1"', {
4188 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
4189 'ldflags': [ '-target mipsel-linux-android', ],
4193 'cflags': ['-mips32', '-Wa,-mips32', ],
4199 # Clang does not support the following options.
4200 '-finline-limit=64',
4203 # TODO(gordanac) Enable integrated-as.
4204 '-no-integrated-as',
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,--no-undefined',
4801 '--sysroot=<(android_ndk_sysroot)',
4803 '-L<(android_libcpp_libs_dir)',
4804 # Don't allow visible symbols from libgcc or libc++ to be
4806 '-Wl,--exclude-libs=libgcc.a',
4807 '-Wl,--exclude-libs=libc++_static.a',
4808 # Don't allow visible symbols from libraries that contain
4809 # assembly code with symbols that aren't hidden properly.
4810 # http://crbug.com/448386
4811 '-Wl,--exclude-libs=libcommon_audio.a',
4812 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4813 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4814 '-Wl,--exclude-libs=libiSACFix.a',
4815 '-Wl,--exclude-libs=libisac_neon.a',
4816 '-Wl,--exclude-libs=libopus.a',
4817 '-Wl,--exclude-libs=libvpx.a',
4820 '-l<(android_libcpp_library)',
4822 # Manually link the libgcc.a that the cross compiler uses.
4823 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4829 ['component=="static_library"', {
4830 'target_conditions': [
4831 ['use_native_jni_exports==0', {
4832 # Use a linker version script to strip JNI exports from
4833 # binaries which have not specifically asked to use them.
4835 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4842 # Clang with libc++ does not require an explicit atomic
4843 # library reference.
4847 # Work around incompatibilities between bionic and clang
4849 '-D__compiler_offsetof=__builtin_offsetof',
4850 '-Dnan=__builtin_nan',
4853 ['target_arch=="arm"', {
4855 '-target arm-linux-androideabi',
4858 '-target arm-linux-androideabi',
4861 ['target_arch=="ia32"', {
4863 '-target x86-linux-androideabi',
4866 '-target x86-linux-androideabi',
4869 # Place holder for x64 support, not tested.
4870 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4871 ['target_arch=="x64"', {
4873 '-target x86_64-linux-androideabi',
4876 '-target x86_64-linux-androideabi',
4883 # Android build relies on -Wl,--gc-sections removing
4884 # unreachable code. ASan instrumentation for globals inhibits
4885 # this and results in a library with unresolvable relocations.
4886 # TODO(eugenis): find a way to reenable this.
4887 '-mllvm -asan-globals=0',
4890 ['target_arch == "arm" and order_profiling==0', {
4892 # Enable identical code folding to reduce size.
4893 '-Wl,--icf=<(gold_icf_level)',
4896 ['target_arch=="ia32"', {
4897 # The x86 toolchain currently has problems with stack-protector.
4899 '-fstack-protector',
4902 '-fno-stack-protector',
4906 'target_conditions': [
4907 ['_type=="executable"', {
4908 # Force android tools to export the "main" symbol so they can be
4909 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4910 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4911 # when ICS support will be dropped.
4914 '-fvisibility=default',
4918 '-Wl,--gc-sections',
4919 '-Wl,-z,nocopyreloc',
4922 # crtbegin_dynamic.o should be the last item in ldflags.
4923 '<(android_ndk_lib)/crtbegin_dynamic.o',
4926 # crtend_android.o needs to be the last item in libraries.
4927 # Do not add any libraries after this!
4928 '<(android_ndk_lib)/crtend_android.o',
4931 ['_type=="shared_library" or _type=="loadable_module"', {
4933 '-Wl,-shared,-Bsymbolic',
4934 # crtbegin_so.o should be the last item in ldflags.
4935 '<(android_ndk_lib)/crtbegin_so.o',
4938 # crtend_so.o needs to be the last item in libraries.
4939 # Do not add any libraries after this!
4940 '<(android_ndk_lib)/crtend_so.o',
4945 # Settings for building host targets using the system toolchain.
4946 ['_toolset=="host"', {
4948 # Due to issues in Clang build system, using ASan on 32-bit
4949 # binaries on x86_64 host is problematic.
4950 # TODO(eugenis): re-enable.
4951 '-fsanitize=address',
4954 '-fsanitize=address',
4955 '-Wl,-z,noexecstack',
4956 '-Wl,--gc-sections',
4959 '-Wl,--warn-shared-textrel',
4960 '-Wl,--fatal-warnings',
4963 # Settings for building host targets on mac.
4964 ['_toolset=="host" and host_os=="mac"', {
4974 'cflags!': ['-fvisibility=hidden'],
4975 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4977 ['OS=="mac" or OS=="ios"', {
4978 'target_defaults': {
4981 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4982 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4983 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4984 'COPY_PHASE_STRIP': 'NO',
4985 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4986 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4987 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4988 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4989 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4990 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4991 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4992 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4993 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4994 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4995 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4996 'GCC_VERSION': '4.2',
4997 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4998 'USE_HEADERMAP': 'NO',
5003 # Don't warn about unused function parameters.
5004 '-Wno-unused-parameter',
5005 # Don't warn about the "struct foo f = {0};" initialization
5007 '-Wno-missing-field-initializers',
5010 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
5011 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
5013 # Note that the prebuilt Clang binaries should not be used for iOS
5014 # development except for ASan builds.
5016 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
5017 # Warn if automatic synthesis is triggered with
5018 # the -Wobjc-missing-property-synthesis flag.
5019 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
5020 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
5022 # This warns on selectors from Cocoa headers (-length, -set).
5023 # cfe-dev is currently discussing the merits of this warning.
5024 # TODO(thakis): Reevaluate what to do with this, based one
5025 # cfe-dev discussion.
5026 '-Wno-selector-type-mismatch',
5029 ['clang_xcode==0', {
5030 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
5031 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
5035 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
5037 '<@(clang_chrome_plugins_flags)',
5040 ['clang==1 and clang_xcode==0 and clang_load!=""', {
5042 '-Xclang', '-load', '-Xclang', '<(clang_load)',
5045 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
5047 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
5050 ['clang==1 and "<(GENERATOR)"=="ninja"', {
5052 # See http://crbug.com/110262
5053 '-fcolor-diagnostics',
5056 ['OS=="ios" and target_subarch!="arm32" and \
5057 "<(GENERATOR)"=="xcode"', {
5059 # TODO(ios): when building Chrome for iOS on 64-bit platform
5060 # with Xcode, the -Wshorted-64-to-32 warning is automatically
5061 # enabled. This cause failures when compiling protobuf code,
5062 # so disable the warning. http://crbug.com/359107
5063 '-Wno-shorten-64-to-32',
5071 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
5077 '-fsanitize=address',
5078 '-mllvm -asan-globals=0', # http://crbug.com/352073
5079 '-gline-tables-only',
5083 ['asan_coverage!=0 and sanitizer_coverage==0', {
5084 'target_conditions': [
5085 ['_toolset=="target"', {
5087 '-fsanitize-coverage=<(asan_coverage)',
5090 'SANITIZER_COVERAGE',
5095 ['sanitizer_coverage!=0', {
5096 'target_conditions': [
5097 ['_toolset=="target"', {
5099 '-fsanitize-coverage=<(sanitizer_coverage)',
5102 'SANITIZER_COVERAGE',
5108 'target_conditions': [
5109 ['_type!="static_library"', {
5110 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5115 '-fsanitize=address',
5119 ['mac_write_linker_maps==1', {
5122 '-Wl,-map,>(_target_name).map',
5129 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5130 'target_conditions': [
5131 ['_type=="executable"', {
5137 # Define copy_asan_dylib_path in a variable ending in
5138 # _path so that gyp understands it's a path and
5139 # performs proper relativization during dict merging.
5140 'copy_asan_dylib_path':
5141 'mac/copy_asan_runtime_dylib.sh',
5143 'postbuild_name': 'Copy ASan runtime dylib',
5145 '<(copy_asan_dylib_path)',
5154 ], # target_conditions
5155 }, # target_defaults
5156 }], # OS=="mac" or OS=="ios"
5158 'target_defaults': {
5160 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5161 # with common names, like 'check', 'require', and 'verify'.
5162 # (Included by system header. Also exists on iOS but not included.)
5163 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5164 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5167 # These should end with %, but there seems to be a bug with % in
5168 # variables that are intended to be set to different values in
5169 # different targets, like these.
5170 'mac_pie': 1, # Most executables can be position-independent.
5171 # Strip debugging symbols from the target.
5172 'mac_strip': '<(mac_strip_release)',
5176 ['mac_want_real_dsym=="default"', {
5179 'mac_real_dsym': '<(mac_want_real_dsym)'
5184 ['mac_want_real_dsym=="default"', {
5185 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5187 'mac_real_dsym': '<(mac_want_real_dsym)'
5196 ['branding=="Chrome" and buildtype=="Official"', {
5199 # The Google Chrome Framework dSYM generated by dsymutil has
5200 # grown larger than 4GB, which dsymutil can't handle. Reduce
5201 # the amount of debug symbols.
5202 '-fno-standalone-debug', # See http://crbug.com/479841
5207 }, # configuration "Release"
5210 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5211 # (Equivalent to -fPIC)
5212 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5213 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5214 # Keep pch files below xcodebuild/.
5215 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5217 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5218 # xcode_setting, but not until all downstream projects' mac bots are
5219 # using xcode >= 4.6, because that's when the default value of the
5220 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5221 # setting is a no-op as far as xcode is concerned, but the compiler
5222 # behaves differently based on whether -fno-strict-aliasing is
5224 '-fno-strict-aliasing', # See http://crbug.com/32204.
5227 'target_conditions': [
5228 ['_type=="executable"', {
5231 # Arranges for data (heap) pages to be protected against
5232 # code execution when running on Mac OS X 10.7 ("Lion"), and
5233 # ensures that the position-independent executable (PIE) bit
5234 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5236 # Define change_mach_o_flags in a variable ending in _path
5237 # so that GYP understands it's a path and performs proper
5238 # relativization during dict merging.
5239 'change_mach_o_flags_path':
5240 'mac/change_mach_o_flags_from_xcode.sh',
5241 'change_mach_o_flags_options%': [
5243 'target_conditions': [
5244 ['mac_pie==0 or release_valgrind_build==1', {
5245 # Don't enable PIE if it's unwanted. It's unwanted if
5246 # the target specifies mac_pie=0 or if building for
5247 # Valgrind, because Valgrind doesn't understand slide.
5248 # See the similar mac_pie/release_valgrind_build check
5250 'change_mach_o_flags_options': [
5256 'postbuild_name': 'Change Mach-O Flags',
5258 '<(change_mach_o_flags_path)',
5259 '>@(change_mach_o_flags_options)',
5263 'target_conditions': [
5264 ['mac_pie==1 and release_valgrind_build==0', {
5265 # Turn on position-independence (ASLR) for executables. When
5266 # PIE is on for the Chrome executables, the framework will
5267 # also be subject to ASLR.
5268 # Don't do this when building for Valgrind, because Valgrind
5269 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5270 # understand slide, and get rid of the Valgrind check.
5273 '-Wl,-pie', # Position-independent executable (MH_PIE)
5279 ['(_type=="executable" or _type=="shared_library" or \
5280 _type=="loadable_module") and mac_strip!=0', {
5281 'target_conditions': [
5282 ['mac_real_dsym == 1', {
5283 # To get a real .dSYM bundle produced by dsymutil, set the
5284 # debug information format to dwarf-with-dsym. Since
5285 # strip_from_xcode will not be used, set Xcode to do the
5286 # stripping as well.
5290 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5291 'DEPLOYMENT_POSTPROCESSING': 'YES',
5292 'STRIP_INSTALLED_PRODUCT': 'YES',
5294 # Only strip non-ASan builds.
5296 'target_conditions': [
5297 ['_type=="shared_library" or _type=="loadable_module"', {
5298 # The Xcode default is to strip debugging symbols
5299 # only (-S). Local symbols should be stripped as
5300 # well, which will be handled by -x. Xcode will
5301 # continue to insert -S when stripping even when
5302 # additional flags are added with STRIPFLAGS.
5304 }], # _type=="shared_library" or _type=="loadable_module"
5305 ], # target_conditions
5311 }, # configuration "Release"
5313 }, { # mac_real_dsym != 1
5314 # To get a fast fake .dSYM bundle, use a post-build step to
5315 # produce the .dSYM and strip the executable. strip_from_xcode
5316 # only operates in the Release configuration.
5320 # Define strip_from_xcode in a variable ending in _path
5321 # so that gyp understands it's a path and performs proper
5322 # relativization during dict merging.
5323 'strip_from_xcode_path': 'mac/strip_from_xcode',
5325 'postbuild_name': 'Strip If Needed',
5326 'action': ['<(strip_from_xcode_path)'],
5330 ], # target_conditions
5331 }], # (_type=="executable" or _type=="shared_library" or
5332 # _type=="loadable_module") and mac_strip!=0
5333 ], # target_conditions
5334 }, # target_defaults
5338 'ios/coverage.gypi',
5340 'target_defaults': {
5341 'xcode_settings' : {
5342 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5345 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5346 # additional flag to suppress the "unknown compiler option" error.
5347 # Restrict this flag to builds that are either compiling with Xcode
5348 # or compiling with Xcode's Clang. This will allow Ninja builds to
5349 # continue failing on unknown compiler options.
5350 # TODO(rohitrao): This flag is temporary and should be removed as
5351 # soon as the iOS bots are updated to use Xcode 5.1.
5352 ['clang_xcode==1', {
5354 '-Wno-unknown-warning-option',
5358 # Limit the valid architectures depending on "target_subarch".
5359 # This need to include the "arm" architectures but also the "x86"
5360 # ones (they are used when building for the simulator).
5361 ['target_subarch=="arm32"', {
5362 'VALID_ARCHS': ['armv7', 'i386'],
5364 ['target_subarch=="arm64"', {
5365 'VALID_ARCHS': ['arm64', 'x86_64'],
5367 ['target_subarch=="both"', {
5368 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5370 ['use_system_libcxx==1', {
5371 'target_conditions': [
5372 # Only use libc++ when building target for iOS not when building
5373 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5374 # does not support libc++.
5375 ['_toolset=="target"', {
5376 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5380 # The default for deployment target of 7.0+ is libc++, so force
5381 # the old behavior unless libc++ is enabled.
5382 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5386 'target_conditions': [
5387 ['_toolset=="host"', {
5389 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5390 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5399 ['_toolset=="target"', {
5401 # This section should be for overriding host settings. But,
5402 # since we can't negate the iphone deployment target above, we
5403 # instead set it here for target only.
5404 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5405 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5408 ['_type=="executable"', {
5412 'DEPLOYMENT_POSTPROCESSING': 'YES',
5413 'STRIP_INSTALLED_PRODUCT': 'YES',
5418 # Remove dSYM to reduce build time.
5419 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5425 ['chromium_ios_signing', {
5426 # iOS SDK wants everything for device signed.
5427 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5429 'CODE_SIGNING_REQUIRED': 'NO',
5430 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5435 ], # target_conditions
5436 }, # target_defaults
5439 'target_defaults': {
5441 '_WIN32_WINNT=0x0603',
5448 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5449 'WIN32_LEAN_AND_MEAN',
5452 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5453 '_HAS_EXCEPTIONS=0',
5454 # Silence some warnings; we can't switch the the 'recommended'
5455 # versions as they're not available on old OSs.
5456 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5459 ['buildtype=="Official"', {
5460 # In official builds, targets can self-select an optimization
5461 # level by defining a variable named 'optimize', and setting it
5463 # - "size", optimizes for minimal code size - the default.
5464 # - "speed", optimizes for speed over code size.
5465 # - "max", whole program optimization and link-time code
5466 # generation. This is very expensive and should be used
5469 'optimize%': 'size',
5473 # Set /LTCG for the official builds.
5474 'LinkTimeCodeGeneration': '1',
5475 'AdditionalOptions': [
5476 # Set the number of LTCG code-gen threads to eight.
5477 # The default is four. This gives a 5-10% link speedup.
5482 'target_conditions': [
5483 ['optimize=="size"', {
5485 'VCCLCompilerTool': {
5486 # 1, optimizeMinSpace, Minimize Size (/O1)
5487 'Optimization': '1',
5488 # 2, favorSize - Favor small code (/Os)
5489 'FavorSizeOrSpeed': '2',
5494 # This config is used to avoid a problem in ffmpeg, see
5495 # http://crbug.com/264459.
5496 ['optimize=="size_no_ltcg"', {
5498 'VCCLCompilerTool': {
5499 # 1, optimizeMinSpace, Minimize Size (/O1)
5500 'Optimization': '1',
5501 # 2, favorSize - Favor small code (/Os)
5502 'FavorSizeOrSpeed': '2',
5507 ['optimize=="speed"', {
5509 'VCCLCompilerTool': {
5510 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5511 'Optimization': '2',
5512 # 1, favorSpeed - Favor fast code (/Ot)
5513 'FavorSizeOrSpeed': '1',
5518 ['optimize=="max"', {
5519 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5520 # builds. Probably anything that this would catch that
5521 # wouldn't be caught in a normal build isn't going to
5522 # actually be a bug, so the incremental value of C4702 for
5523 # PGO builds is likely very small.
5524 'msvs_disabled_warnings': [
5528 'VCCLCompilerTool': {
5529 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5530 'Optimization': '2',
5531 # 1, favorSpeed - Favor fast code (/Ot)
5532 'FavorSizeOrSpeed': '1',
5533 # This implies link time code generation.
5534 'WholeProgramOptimization': 'true',
5542 ['msvs_xtree_patched!=1', {
5543 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5544 # it's enabled. This will generally only be true for system-level
5545 # installed Express users.
5546 'msvs_disabled_warnings': [
5551 'msvs_system_include_dirs': [
5552 '<(windows_sdk_path)/Include/shared',
5553 '<(windows_sdk_path)/Include/um',
5554 '<(windows_sdk_path)/Include/winrt',
5555 '$(VSInstallDir)/VC/atlmfc/include',
5557 'msvs_cygwin_shell': 0,
5558 'msvs_disabled_warnings': [
5559 # C4091: 'typedef ': ignored on left of 'X' when no variable is
5561 # This happens in a number of Windows headers. Dumb.
5564 # C4127: conditional expression is constant
5565 # This warning can in theory catch dead code and other problems, but
5566 # triggers in far too many desirable cases where the conditional
5567 # expression is either set by macros or corresponds some legitimate
5568 # compile-time constant expression (due to constant template args,
5569 # conditionals comparing the sizes of different types, etc.). Some of
5570 # these can be worked around, but it's not worth it.
5573 # C4351: new behavior: elements of array 'array' will be default
5575 # This is a silly "warning" that basically just alerts you that the
5576 # compiler is going to actually follow the language spec like it's
5577 # supposed to, instead of not following it like old buggy versions
5578 # did. There's absolutely no reason to turn this on.
5581 # C4355: 'this': used in base member initializer list
5582 # It's commonly useful to pass |this| to objects in a class'
5583 # initializer list. While this warning can catch real bugs, most of
5584 # the time the constructors in question don't attempt to call methods
5585 # on the passed-in pointer (until later), and annotating every legit
5586 # usage of this is simply more hassle than the warning is worth.
5589 # C4503: 'identifier': decorated name length exceeded, name was
5591 # This only means that some long error messages might have truncated
5592 # identifiers in the presence of lots of templates. It has no effect
5593 # on program correctness and there's no real reason to waste time
5594 # trying to prevent it.
5597 # C4611: interaction between 'function' and C++ object destruction is
5599 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5600 # suggests using exceptions instead of setjmp/longjmp for C++, but
5601 # Chromium code compiles without exception support. We therefore have
5602 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5603 # means we have to turn off this warning (and be careful about how
5604 # object destruction happens in such cases).
5607 # TODO(maruel): These warnings are level 4. They will be slowly
5608 # removed as code is fixed.
5609 4100, # Unreferenced formal parameter
5610 4121, # Alignment of a member was sensitive to packing
5611 4244, # Conversion from 'type1' to 'type2', possible loss of data
5612 4481, # Nonstandard extension used: override specifier 'keyword'
5613 4505, # Unreferenced local function has been removed
5614 4510, # Default constructor could not be generated
5615 4512, # Assignment operator could not be generated
5616 4610, # Object can never be instantiated
5617 4838, # Narrowing conversion. Doesn't seem to be very useful.
5618 4996, # 'X': was declared deprecated (for GetVersionEx).
5620 # These are variable shadowing warnings that are new in VS2015. We
5621 # should work through these at some point -- they may be removed from
5622 # the RTM release in the /W4 set.
5623 4456, 4457, 4458, 4459,
5626 'VCCLCompilerTool': {
5627 'AdditionalOptions': ['/MP'],
5628 'MinimalRebuild': 'false',
5629 'BufferSecurityCheck': 'true',
5630 'EnableFunctionLevelLinking': 'true',
5631 'RuntimeTypeInfo': 'false',
5632 'WarningLevel': '4',
5633 'WarnAsError': 'true',
5634 'DebugInformationFormat': '3',
5635 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5636 'ExceptionHandling': '0',
5638 'VCLibrarianTool': {
5639 'AdditionalOptions': ['/ignore:4221'],
5640 'AdditionalLibraryDirectories': [
5641 '<(windows_sdk_path)/Lib/win8/um/x86',
5645 'AdditionalDependencies': [
5657 'AdditionalLibraryDirectories': [
5658 '<(windows_sdk_path)/Lib/win8/um/x86',
5660 'GenerateDebugInformation': 'true',
5661 'MapFileName': '$(OutDir)\\$(TargetName).map',
5662 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5663 'FixedBaseAddress': '1',
5666 # 1 == /SUBSYSTEM:CONSOLE
5667 # 2 == /SUBSYSTEM:WINDOWS
5668 # Most of the executables we'll ever create are tests
5669 # and utilities with console output.
5673 'GenerateStublessProxies': 'true',
5674 'TypeLibraryName': '$(InputName).tlb',
5675 'OutputDirectory': '$(IntDir)',
5676 'HeaderFileName': '$(InputName).h',
5677 'DLLDataFileName': '$(InputName).dlldata.c',
5678 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5679 'ProxyFileName': '$(InputName)_p.c',
5681 'VCResourceCompilerTool': {
5683 'AdditionalIncludeDirectories': [
5685 '<(SHARED_INTERMEDIATE_DIR)',
5688 'target_conditions': [
5689 ['_type=="executable"', {
5691 'EmbedManifest': 'true',
5694 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5696 'AdditionalManifestFiles': [
5697 '>(win_exe_compatibility_manifest)',
5703 # Building with Clang on Windows is a work in progress and very
5704 # experimental. See crbug.com/82385.
5705 # Keep this in sync with the similar blocks in build/config/compiler/BUILD.gn
5707 'VCCLCompilerTool': {
5708 'AdditionalOptions': [
5709 '-fmsc-version=1800',
5711 # Many files use intrinsics without including this header.
5712 # TODO(hans): Fix those files, or move this to sub-GYPs.
5715 # TODO(hans): Make this list shorter eventually.
5716 '-Qunused-arguments',
5717 '-Wno-c++11-compat-deprecated-writable-strings',
5718 '-Wno-deprecated-declarations',
5720 '-Wno-enum-conversion',
5721 '-Wno-extra-tokens',
5722 '-Wno-ignored-attributes',
5723 '-Wno-incompatible-pointer-types',
5724 '-Wno-int-to-void-pointer-cast',
5725 '-Wno-invalid-noreturn',
5726 '-Wno-logical-op-parentheses',
5728 '-Wno-missing-braces',
5729 '-Wno-missing-declarations',
5730 '-Wno-msvc-include',
5731 '-Wno-null-dereference',
5732 '-Wno-overloaded-virtual',
5734 '-Wno-pointer-sign',
5736 '-Wno-return-type-c-linkage',
5738 '-Wno-sometimes-uninitialized',
5740 '-Wno-tautological-compare',
5741 '-Wno-unknown-pragmas',
5743 '-Wno-unused-function',
5744 '-Wno-unused-private-field',
5745 '-Wno-unused-value',
5746 '-Wno-unused-variable',
5747 '-Wno-unused-local-typedef', # http://crbug.com/411648
5748 '-Wno-inconsistent-missing-override', #http://crbug.com/428099
5752 ['clang==1 and target_arch=="ia32"', {
5753 'VCCLCompilerTool': {
5754 'WarnAsError': 'false',
5755 'AdditionalOptions': [
5760 ['clang==1 and clang_use_chrome_plugins==1', {
5761 'VCCLCompilerTool': {
5762 'AdditionalOptions': [
5763 '<@(clang_chrome_plugins_flags)',
5771 ['disable_nacl==1', {
5772 'target_defaults': {
5778 ['OS=="win" and msvs_use_common_linker_extras', {
5779 'target_defaults': {
5794 'AdditionalOptions': [
5805 'AdditionalOptions': ['/largeaddressaware'],
5809 # TODO(asan/win): Move this down into the general
5810 # win-target_defaults section once the 64-bit asan runtime
5811 # exists. See crbug.com/345874.
5812 'VCCLCompilerTool': {
5813 'AdditionalOptions': [
5814 '-fsanitize=address',
5815 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5817 'AdditionalIncludeDirectories': [
5818 # MSVC needs to be able to find the sanitizer headers when
5819 # invoked via /fallback. This is critical for using macros
5820 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5822 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/include_sanitizer',
5826 'AdditionalLibraryDirectories': [
5827 # TODO(hans): If make_clang_dir is absolute, this breaks.
5828 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/lib/windows',
5831 'target_conditions': [
5832 ['component=="shared_library"', {
5834 'AdditionalDependencies': [
5835 'clang_rt.asan_dynamic-i386.lib',
5836 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5840 ['_type=="executable" and component=="static_library"', {
5842 'AdditionalDependencies': [
5843 'clang_rt.asan-i386.lib',
5847 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5849 'AdditionalDependencies': [
5850 'clang_rt.asan_dll_thunk-i386.lib',
5856 ['sanitizer_coverage!=0', {
5857 # TODO(asan/win): Move this down into the general
5858 # win-target_defaults section once the 64-bit asan runtime
5859 # exists. See crbug.com/345874.
5860 'VCCLCompilerTool': {
5861 'AdditionalOptions': [
5862 '-fsanitize-coverage=<(sanitizer_coverage)',
5869 ['sanitizer_coverage!=0', {
5870 # TODO(asan/win): Move this down into the general
5871 # win-target_defaults section once the 64-bit asan runtime
5872 # exists. See crbug.com/345874.
5874 'SANITIZER_COVERAGE',
5882 'AdditionalOptions': [
5883 # safeseh is not compatible with x64
5895 ['enable_new_npdevice_api==1', {
5896 'target_defaults': {
5898 'ENABLE_NEW_NPDEVICE_API',
5902 # Don't warn about the "typedef 'foo' locally defined but not used"
5903 # for gcc 4.8 and higher.
5904 # TODO: remove this flag once all builds work. See crbug.com/227506
5905 ['gcc_version>=48 and clang==0', {
5906 'target_defaults': {
5908 '-Wno-unused-local-typedefs',
5912 ['gcc_version>=48 and clang==0 and host_clang==1', {
5913 'target_defaults': {
5914 'target_conditions': [
5915 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5919 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5921 'make_global_settings': [
5922 ['CC', '<(make_clang_dir)/bin/clang'],
5923 ['CXX', '<(make_clang_dir)/bin/clang++'],
5924 ['CC.host', '$(CC)'],
5925 ['CXX.host', '$(CXX)'],
5928 ['clang==1 and OS=="win"', {
5929 'make_global_settings': [
5930 # On Windows, gyp's ninja generator only looks at CC.
5931 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5934 ['use_lld==1 and OS=="win"', {
5935 'make_global_settings': [
5936 # Limited to Windows because lld-link is the driver that is compatible
5938 ['LD', '<(make_clang_dir)/bin/lld-link'],
5941 ['OS=="android" and clang==0', {
5942 # Hardcode the compiler names in the Makefile so that
5943 # it won't depend on the environment at make time.
5944 'make_global_settings': [
5945 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5946 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5947 ['CC.host', '<(host_cc)'],
5948 ['CXX.host', '<(host_cxx)'],
5951 ['OS=="linux" and target_arch=="mipsel"', {
5952 'make_global_settings': [
5953 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5954 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5955 ['CC.host', '<(host_cc)'],
5956 ['CXX.host', '<(host_cxx)'],
5959 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5960 # Set default ARM cross compiling on linux. These can be overridden
5961 # using CC/CXX/etc environment variables.
5962 'make_global_settings': [
5963 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5964 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5965 ['CC.host', '<(host_cc)'],
5966 ['CXX.host', '<(host_cxx)'],
5970 # TODO(yyanagisawa): supports GENERATOR==make
5971 # make generator doesn't support CC_wrapper without CC
5972 # in make_global_settings yet.
5973 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5974 'make_global_settings': [
5975 ['CC_wrapper', '<(gomadir)/gomacc'],
5976 ['CXX_wrapper', '<(gomadir)/gomacc'],
5977 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5978 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5982 'target_defaults': {
5983 'target_conditions': [
5984 ['_toolset=="target"', {
5992 # Work-around for http://openradar.appspot.com/20356002
5993 ['_toolset=="target" and _type!="static_library"', {
6003 ['use_lto==1 and clang==0', {
6004 'target_defaults': {
6005 'target_conditions': [
6006 ['_toolset=="target"', {
6008 '-ffat-lto-objects',
6014 ['use_lto==1 and clang==1', {
6015 'target_defaults': {
6016 'target_conditions': [
6017 ['_toolset=="target"', {
6019 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
6025 # Apply a lower LTO optimization level in non-official builds.
6026 ['use_lto==1 and clang==1 and buildtype!="Official"', {
6027 'target_defaults': {
6028 'target_conditions': [
6029 ['_toolset=="target"', {
6031 '-Wl,--plugin-opt,O1',
6034 ['_toolset=="target" and _type!="static_library"', {
6044 ['use_lto==1 and clang==1 and target_arch=="arm"', {
6045 'target_defaults': {
6046 'target_conditions': [
6047 ['_toolset=="target"', {
6048 # Without this flag, LTO produces a .text section that is larger
6049 # than the maximum call displacement, preventing the linker from
6050 # relocating calls (http://llvm.org/PR22999).
6052 '-Wl,-plugin-opt,-function-sections',
6058 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
6059 'target_defaults': {
6060 'target_conditions': [
6061 ['_toolset=="target"', {
6069 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
6070 'target_defaults': {
6071 'target_conditions': [
6072 ['_toolset=="target"', {
6081 'target_defaults': {
6082 'target_conditions': [
6083 ['_toolset=="target"', {
6085 '-fsanitize=cfi-vcall',
6086 '-fsanitize=cfi-derived-cast',
6087 '-fsanitize=cfi-unrelated-cast',
6090 '-fsanitize=cfi-vcall',
6091 '-fsanitize=cfi-derived-cast',
6092 '-fsanitize=cfi-unrelated-cast',
6096 '-fsanitize=cfi-vcall',
6097 '-fsanitize=cfi-derived-cast',
6098 '-fsanitize=cfi-unrelated-cast',
6102 ['_toolset=="target" and _type!="static_library"', {
6105 '-fsanitize=cfi-vcall',
6106 '-fsanitize=cfi-derived-cast',
6107 '-fsanitize=cfi-unrelated-cast',
6115 'target_defaults': {
6116 'target_conditions': [
6117 ['_toolset=="target"', {
6119 '-fsanitize-blacklist=<(cfi_blacklist)',
6123 '-fsanitize-blacklist=<(cfi_blacklist)',
6132 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
6133 # This block adds *project-wide* configuration settings to each project
6134 # file. It's almost always wrong to put things here. Specify your
6135 # custom xcode_settings in target_defaults to add them to targets instead.
6138 # In an Xcode Project Info window, the "Base SDK for All Configurations"
6139 # setting sets the SDK on a project-wide basis. In order to get the
6140 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
6141 # here at the project level.
6144 ['mac_sdk_path==""', {
6145 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
6147 'SDKROOT': '<(mac_sdk_path)', # -isysroot
6153 ['ios_sdk_path==""', {
6155 # TODO(justincohen): Ninja only supports simulator for now.
6156 ['"<(GENERATOR)"=="xcode"', {
6157 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6159 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
6163 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6168 # Target both iPhone and iPad.
6169 'TARGETED_DEVICE_FAMILY': '1,2',
6172 ['target_arch=="x64"', {
6177 ['target_arch=="ia32"', {
6186 # The Xcode generator will look for an xcode_settings section at the root
6187 # of each dict and use it to apply settings on a file-wide basis. Most
6188 # settings should not be here, they should be in target-specific
6189 # xcode_settings sections, or better yet, should use non-Xcode-specific
6190 # settings in target dicts. SYMROOT is a special case, because many other
6191 # Xcode variables depend on it, including variables such as
6192 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6193 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6194 # files to appear (when present) in the UI as actual files and not red
6195 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6196 # and therefore SYMROOT, needs to be set at the project level.
6197 'SYMROOT': '<(DEPTH)/xcodebuild',