1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6 # Please don't directly include this file if you are building via gyp_chromium,
7 # since gyp_chromium is automatically forcing its inclusion.
9 # Variables expected to be overriden on the GYP command line (-D) or by
10 # ~/.gyp/include.gypi.
12 # Putting a variables dict inside another variables dict looks kind of
13 # weird. This is done so that 'host_arch', 'chromeos', etc are defined as
14 # variables within the outer variables dict here. This is necessary
15 # to get these variables defined for the conditions within this variables
16 # dict that operate on these variables.
21 # Whether we're building a ChromeOS build.
24 # Whether we're building the cast (chromecast) shell
27 # Whether or not we are using the Aura windowing framework.
30 # Whether or not we are building the Ash shell.
33 # Whether or not we are using CRAS, the ChromeOS Audio Server.
36 # Use a raw surface abstraction.
39 # Configure the build for small devices. See crbug.com/318413
43 # Compute the architecture that we're building on.
44 ['OS=="win" or OS=="ios"', {
47 'host_arch%': '<!pymod_do_main(detect_host_arch)',
51 # Copy conditionally-set variables out one scope.
52 'chromeos%': '<(chromeos)',
53 'chromecast%': '<(chromecast)',
54 'use_aura%': '<(use_aura)',
55 'use_ash%': '<(use_ash)',
56 'use_cras%': '<(use_cras)',
57 'use_ozone%': '<(use_ozone)',
58 'embedded%': '<(embedded)',
59 'host_arch%': '<(host_arch)',
61 # Whether we are using Views Toolkit
64 # Use the PCI lib to collect GPU information.
67 # Use OpenSSL instead of NSS as the underlying SSL and crypto
68 # implementation. Certificate verification will in most cases be
69 # handled by the OS. If OpenSSL's struct X509 is used to represent
70 # certificates, use_openssl_certs must be set.
73 # Use OpenSSL for representing certificates. When targeting Android,
74 # the platform certificate library is used for certificate
75 # verification. On other targets, this flag also enables OpenSSL for
76 # certificate verification, but this configuration is unsupported.
77 'use_openssl_certs%': 0,
79 # Disable viewport meta tag by default.
80 'enable_viewport%': 0,
82 # Enable HiDPI support.
85 # Enable top chrome material design.
86 'enable_topchrome_md%' : 0,
88 # Force building against pre-built sysroot image on linux. By default
89 # the sysroot image is only used for Official builds or when cross
90 # compiling to arm or mips.
93 # Override buildtype to select the desired build flavor.
94 # Dev - everyday build for development/testing
95 # Official - release build (generally implies additional processing)
96 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
97 # conversion is done), some of the things which are now controlled by
98 # 'branding', such as symbol generation, will need to be refactored
99 # based on 'buildtype' (i.e. we don't care about saving symbols for
100 # non-Official # builds).
103 # Override branding to select the desired branding flavor.
104 'branding%': 'Chromium',
107 # Windows and Linux (including Chrome OS) use Aura and Ash.
108 ['OS=="win" or OS=="linux"', {
113 ['chromecast==1 and OS!="android"', {
123 # Whether we're a traditional desktop unix.
124 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
130 # Embedded implies ozone.
136 'target_arch%': 'arm',
138 # Default architecture we're building for is the architecture we're
139 # building on, and possibly sub-architecture (for iOS builds).
140 'target_arch%': '<(host_arch)',
144 # Copy conditionally-set variables out one scope.
145 'chromeos%': '<(chromeos)',
146 'chromecast%': '<(chromecast)',
147 'desktop_linux%': '<(desktop_linux)',
148 'use_aura%': '<(use_aura)',
149 'use_ash%': '<(use_ash)',
150 'use_cras%': '<(use_cras)',
151 'use_ozone%': '<(use_ozone)',
152 'embedded%': '<(embedded)',
153 'use_libpci%': '<(use_libpci)',
154 'use_openssl%': '<(use_openssl)',
155 'use_openssl_certs%': '<(use_openssl_certs)',
156 'enable_viewport%': '<(enable_viewport)',
157 'enable_hidpi%': '<(enable_hidpi)',
158 'enable_topchrome_md%': '<(enable_topchrome_md)',
159 'buildtype%': '<(buildtype)',
160 'branding%': '<(branding)',
161 'branding_path_component%': '<(branding)',
162 'host_arch%': '<(host_arch)',
163 'target_arch%': '<(target_arch)',
165 'target_subarch%': '',
167 # The channel to build on Android: stable, beta, dev, canary, or
168 # default. "default" should be used on non-official builds.
169 'android_channel%': 'default',
171 # Set ARM architecture version.
174 # Use aurax11 for clipboard implementation. This is true on linux_aura.
175 'use_clipboard_aurax11%': 0,
179 # If no gomadir is set, it uses the default gomadir.
183 # The system root for cross-compiles. Default: none.
187 # The system libdir used for this ABI.
188 'system_libdir%': 'lib',
190 # Default MIPS arch variant. This is set in the conditions block
191 # below for MIPS targets.
192 'mips_arch_variant%': '',
194 # MIPS DSP ASE revision. Possible values are:
201 ['branding == "Chrome"', {
202 'branding_path_component%': 'google_chrome',
205 ['branding == "Chromium"', {
206 'branding_path_component%': 'chromium',
214 # Set default value of toolkit_views based on OS.
215 ['OS=="mac" or OS=="win" or chromeos==1 or use_aura==1', {
221 # Embedded builds use aura without ash or views.
228 # Enable HiDPI on Mac OS, Windows and Linux (including Chrome OS).
229 ['OS=="mac" or OS=="win" or OS=="linux"', {
233 # Enable Top Chrome Material Design on Chrome OS, Windows, and Linux.
234 ['chromeos==1 or OS=="win" or OS=="linux"', {
235 'enable_topchrome_md%': 1,
238 # On iOS, use NSS rather than OpenSSL. See http://crbug.com/338886.
243 # Enable App Launcher everywhere but mobile.
244 ['OS!="ios" and OS!="android"', {
245 'enable_app_list%': 1,
247 'enable_app_list%': 0,
250 ['use_aura==1 and OS!="android"', {
251 'use_default_render_theme%': 1,
253 'use_default_render_theme%': 0,
257 'use_ozone_evdev%': 1,
259 'use_ozone_evdev%': 0,
262 # Set default gomadir.
264 'gomadir': 'c:\\goma\\goma-win',
266 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
269 # Set the default "target_subarch" on iOS. Valid values are "arm32",
270 # "arm64" and "both" (meaning a fat binary).
272 'target_subarch%': 'arm64',
275 # Set arch variants for MIPS platforms.
276 ['target_arch=="mips64el"', {
279 'mips_arch_variant%': 'r6',
281 'mips_arch_variant%': 'r2',
286 ['target_arch=="mipsel"', {
287 'mips_arch_variant%': 'r1',
290 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
291 # sysroot needs to be an absolute path otherwise it generates
292 # incorrect results when passed to pkg-config
293 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy_arm-sysroot',
294 }], # OS=="linux" and target_arch=="arm" and chromeos==0
296 ['OS=="linux" and ((branding=="Chrome" and buildtype=="Official" and chromeos==0) or use_sysroot==1)' , {
298 ['target_arch=="x64"', {
299 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy_amd64-sysroot',
301 ['target_arch=="ia32"', {
302 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy_i386-sysroot',
305 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
307 ['OS=="linux" and target_arch=="mipsel"', {
308 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy_mips-sysroot',
313 # Copy conditionally-set variables out one scope.
314 'chromeos%': '<(chromeos)',
315 'chromecast%': '<(chromecast)',
316 'host_arch%': '<(host_arch)',
317 'target_arch%': '<(target_arch)',
318 'target_subarch%': '<(target_subarch)',
319 'mips_arch_variant%': '<(mips_arch_variant)',
320 'mips_dsp_rev%': '<(mips_dsp_rev)',
321 'toolkit_views%': '<(toolkit_views)',
322 'desktop_linux%': '<(desktop_linux)',
323 'use_aura%': '<(use_aura)',
324 'use_ash%': '<(use_ash)',
325 'use_cras%': '<(use_cras)',
326 'use_libpci%': '<(use_libpci)',
327 'use_ozone%': '<(use_ozone)',
328 'use_ozone_evdev%': '<(use_ozone_evdev)',
329 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
330 'embedded%': '<(embedded)',
331 'use_openssl%': '<(use_openssl)',
332 'use_openssl_certs%': '<(use_openssl_certs)',
333 'enable_viewport%': '<(enable_viewport)',
334 'enable_hidpi%': '<(enable_hidpi)',
335 'enable_topchrome_md%': '<(enable_topchrome_md)',
336 'android_channel%': '<(android_channel)',
337 'use_goma%': '<(use_goma)',
338 'gomadir%': '<(gomadir)',
339 'enable_app_list%': '<(enable_app_list)',
340 'use_default_render_theme%': '<(use_default_render_theme)',
341 'buildtype%': '<(buildtype)',
342 'branding%': '<(branding)',
343 'branding_path_component%': '<(branding_path_component)',
344 'arm_version%': '<(arm_version)',
345 'sysroot%': '<(sysroot)',
346 'chroot_cmd%': '<(chroot_cmd)',
347 'system_libdir%': '<(system_libdir)',
349 # Set to 1 to enable fast builds. Set to 2 for even faster builds
350 # (it disables debug info for fastest compilation - only for use
351 # on compile-only bots).
354 # Set to 1 to not store any build metadata, e.g. ifdef out all __DATE__
355 # and __TIME__. Set to 0 to reenable the use of these macros in the code
356 # base. See http://crbug.com/314403.
357 'dont_embed_build_metadata%': 1,
359 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
360 # This is useful for parallel compilation tools which can't support /Zi.
361 # Only used on Windows.
364 # Set to 1 to enable dcheck in Release build.
365 'dcheck_always_on%': 0,
367 # Set to 1 to make a build that disables unshipped tracing events.
368 # Note: this setting is ignored if buildtype=="Official".
369 'tracing_like_official_build%': 0,
371 # Set to 1 to make a build that disables activation of field trial tests
372 # specified in testing/variations/fieldtrial_testing_config_*.json.
373 # Note: this setting is ignored if branding=="Chrome".
374 'fieldtrial_testing_like_official_build%': 0,
376 # Disable image loader component extension by default.
377 'image_loader_extension%': 0,
379 # Set NEON compilation flags.
382 # Detect NEON support at run-time.
383 'arm_neon_optional%': 0,
385 # Use libjpeg-turbo as the JPEG codec used by Chromium.
386 'use_libjpeg_turbo%': 1,
388 # Use system libjpeg. Note that the system's libjepg will be used even if
389 # use_libjpeg_turbo is set.
390 'use_system_libjpeg%': 0,
392 # By default, component is set to static_library and it can be overriden
393 # by the GYP command line or by ~/.gyp/include.gypi.
394 'component%': 'static_library',
396 # /analyze is off by default on Windows because it is very slow and noisy.
397 # Enable with GYP_DEFINES=win_analyze=1
400 # /debug:fastlink is off by default on Windows because it generates PDBs
401 # that are machine-local. But, great for local builds.
402 # Enable with GYP_DEFINES=win_fastlink=1
405 # Set to select the Title Case versions of strings in GRD files.
406 'use_titlecase_in_grd%': 0,
408 # Remoting compilation is enabled by default. Set to 0 to disable.
411 # Configuration policy is enabled by default. Set to 0 to disable.
412 'configuration_policy%': 1,
414 # Variable safe_browsing is used to control the build time configuration
415 # for safe browsing feature. Safe browsing can be compiled in 4 different
416 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
417 # reporting features for use with Data Saver on Mobile, and 3 enables
418 # extended mobile protection via an external API. When 3 is fully
419 # deployed, it will replace 2.
422 # Web speech is enabled by default. Set to 0 to disable.
423 'enable_web_speech%': 1,
425 # 'Ok Google' hotwording is disabled by default. Set to 1 to enable. (This
426 # will download a closed-source NaCl module at startup.) Chrome-branded
427 # ChromeOS builds have this enabled by default.
428 'enable_hotwording%': 0,
430 # Notifications are compiled in by default. Set to 0 to disable.
431 'notifications%' : 1,
433 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
434 # regular builds and 1 for ASan builds.
435 'mac_want_real_dsym%': 'default',
437 # If this is set, the clang plugins used on the buildbot will be used.
438 # Run tools/clang/scripts/update.sh to make sure they are compiled.
439 # This causes 'clang_chrome_plugins_flags' to be set.
440 # Has no effect if 'clang' is not set as well.
441 'clang_use_chrome_plugins%': 1,
443 # Enable building with ASAN (Clang's -fsanitize=address option).
444 # -fsanitize=address only works with clang, but asan=1 implies clang=1
445 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
447 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
448 # Enable coverage gathering instrumentation in sanitizer tools. This flag
449 # also controls coverage granularity (1 for function-level coverage, 2
450 # for block-level coverage).
451 'sanitizer_coverage%': 0,
452 # Deprecated, only works if |sanitizer_coverage| isn't set.
453 # TODO(glider): remove this flag.
455 # Enable intra-object-overflow detection in ASan (experimental).
456 'asan_field_padding%': 0,
458 # Enable Chromium overrides of the default configurations for various
459 # dynamic tools (like ASan).
460 'use_sanitizer_options%': 0,
462 # Enable building with SyzyAsan.
463 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
466 # Enable crash reporting via Kasko.
469 # Enable building with LSan (Clang's -fsanitize=leak option).
470 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
471 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
474 # Enable building with TSan (Clang's -fsanitize=thread option).
475 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
476 # See http://clang.llvm.org/docs/ThreadSanitizer.html
478 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
480 # Enable building with MSan (Clang's -fsanitize=memory option).
481 # MemorySanitizer only works with clang, but msan=1 implies clang=1
482 # See http://clang.llvm.org/docs/MemorySanitizer.html
484 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
485 # Track where uninitialized memory originates from. From fastest to
486 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
487 # - track the chain of stores leading from allocation site to use site.
488 'msan_track_origins%': 2,
490 # Enable building with UBSan (Clang's -fsanitize=undefined option).
491 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
492 # See http://clang.llvm.org/docs/UsersManual.html
494 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
495 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/vptr_blacklist.txt',
497 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
498 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
501 # Use dynamic libraries instrumented by one of the sanitizers
502 # instead of the standard system libraries. Set this flag to build the
503 # libraries from source.
504 'use_instrumented_libraries%': 0,
506 # Use dynamic libraries instrumented by one of the sanitizers
507 # instead of the standard system libraries. Set this flag to download
508 # prebuilt binaries from GCS.
509 'use_prebuilt_instrumented_libraries%': 0,
511 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
512 # stdlibc++ as standard library. This is intended to use for instrumented
514 'use_custom_libcxx%': 0,
516 # Use system libc++ instead of the default C++ library, usually libstdc++.
517 # This is intended for iOS builds only.
518 'use_system_libcxx%': 0,
520 # Use a modified version of Clang to intercept allocated types and sizes
521 # for allocated objects. clang_type_profiler=1 implies clang=1.
522 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
523 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
524 'clang_type_profiler%': 0,
526 # Set to true to instrument the code with function call logger.
527 # See src/third_party/cygprofile/cyg-profile.cc for details.
528 'order_profiling%': 0,
530 # Use the provided profiled order file to link Chrome image with it.
531 # This makes Chrome faster by better using CPU cache when executing code.
532 # This is known as PGO (profile guided optimization).
533 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
534 'order_text_section%' : "",
536 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
537 # libraries on linux x86-64 and arm, plus ASLR.
540 # Whether one-click signin is enabled or not.
541 'enable_one_click_signin%': 0,
543 # Whether to back up data before sync.
544 'enable_pre_sync_backup%': 0,
546 # Enable Chrome browser extensions
547 'enable_extensions%': 1,
550 'enable_google_now%': 1,
552 # Enable basic printing support and UI.
553 'enable_basic_printing%': 1,
555 # Enable printing with print preview. It does not imply
556 # enable_basic_printing. It's possible to build Chrome with preview only.
557 'enable_print_preview%': 1,
559 # Set the version of CLD.
560 # 1: (DEPRECATED! See http://crbug.com/528305 for info) Use only CLD1.
564 # For CLD2, the size of the tables that should be included in the build
565 # Only evaluated if cld_version == 2.
566 # See third_party/cld_2/cld_2.gyp for more information.
567 # 0: Small tables, high accuracy
568 # 2: Large tables, higher accuracy
569 'cld2_table_size%': 2,
571 # Enable spell checker.
572 'enable_spellcheck%': 1,
574 # Use the operating system spellchecker, e.g. NSSpellChecker on Mac or
575 # SpellCheckerSession on Android.
576 'use_browser_spellchecker%': 0,
578 # Webrtc compilation is enabled by default. Set to 0 to disable.
581 # Media router support is enabled by default. Set to 0 to disable.
582 'enable_media_router%': 1,
584 # Enables use of the session service, which is enabled by default.
585 # Support for disabling depends on the platform.
586 'enable_session_service%': 1,
588 # Enables theme support, which is enabled by default. Support for
589 # disabling depends on the platform.
592 # Enables autofill dialog and associated features; disabled by default.
593 'enable_autofill_dialog%' : 0,
595 # Defaults Wallet integration in Autofill dialog to use production
596 # servers. Unofficial builds won't have the proper API keys.
597 'enable_prod_wallet_service%': 0,
599 # Enables support for background apps.
600 'enable_background%': 1,
602 # Enable the task manager by default.
603 'enable_task_manager%': 1,
605 # Enables used resource whitelist generation; disabled by default.
606 'enable_resource_whitelist_generation%': 0,
608 # Enable FILE support by default.
609 'disable_file_support%': 0,
611 # Enable FTP support by default.
612 'disable_ftp_support%': 0,
614 # Use of precompiled headers on Windows.
616 # This variable may be explicitly set to 1 (enabled) or 0
617 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
618 # This setting will override the default.
621 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
623 'chromium_win_pch%': 0,
626 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
627 # Set this to true when building with Clang.
628 # See http://code.google.com/p/chromium/wiki/Clang for details.
629 # If this is set, clang is used as both host and target compiler in
630 # cross-compile builds.
633 # Use experimental lld linker instead of the platform's default linker.
636 # Enable plugin installation by default.
637 'enable_plugin_installation%': 1,
639 # Specifies whether to use canvas_skia.cc in place of platform
640 # specific implementations of gfx::Canvas. Affects text drawing in the
642 # TODO(asvitkine): Enable this on all platforms and delete this flag.
643 # http://crbug.com/105550
644 'use_canvas_skia%': 0,
646 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
647 # with one of those tools.
648 'build_for_tool%': '',
650 'wix_path%': '<(DEPTH)/third_party/wix',
652 # Supervised users are enabled by default.
653 'enable_supervised_users%': 1,
655 # Platform sends memory pressure signals natively.
656 'native_memory_pressure_signals%': 0,
659 'enable_service_discovery%': 0,
660 'enable_wifi_bootstrapping%': 0,
661 'enable_hangout_services_extension%': 0,
663 # Enable the Syzygy optimization step.
664 'syzygy_optimize%': 0,
666 # Enable hole punching for the protected video.
669 # Automatically select platforms under ozone. Turn this off to
670 # build only explicitly selected platforms.
671 'ozone_auto_platforms%': 1,
673 # If this is set clang is used as host compiler, but not as target
674 # compiler. Always do this by default.
677 # Variables to control Link-Time Optimization (LTO).
678 # On Android, when using GCC LTO, the variable use_lto enables LTO on code
679 # compiled with -Os, and use_lto_o2 enables LTO on code compiled with -O2.
680 # On other platforms (including Android with Clang), use_lto enables LTO
681 # in all translation units, and use_lto_o2 has no effect.
683 # On Linux and Android, when using LLVM LTO, the script
684 # build/download_gold_plugin.py must be run to download a linker plugin.
685 # On Mac, LLVM needs to be built from scratch using
686 # tools/clang/scripts/update.py and the absolute path to
687 # third_party/llvm-build/Release+Asserts/lib must be added to
688 # $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin.
689 # TODO(pcc): Teach build system to use -lto_library flag to specify path
690 # to linker plugin on Mac.
692 # On Android/GCC, the variables must *not* be enabled at the same time.
693 # In this case LTO would 'merge' the optimization flags at link-time
694 # which would lead to all code be optimized with -O2. See crbug.com/407544
698 # Allowed level of identical code folding in the gold linker.
699 'gold_icf_level%': 'all',
701 # Libxkbcommon usage.
704 # Whether we use GTKv3 on linux.
707 # Control Flow Integrity for virtual calls and casts.
708 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
712 'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
714 # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
715 'mac_views_browser%': 0,
717 # By default, use ICU data file (icudtl.dat).
718 'icu_use_data_file_flag%': 1,
720 # Turn on JNI generation optimizations by default.
721 'optimize_jni_generation%': 1,
724 # A flag for POSIX platforms
731 # A flag for BSD platforms
732 ['OS=="freebsd" or OS=="openbsd"', {
739 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris")', {
745 # libudev usage. This currently only affects the content layer.
746 ['OS=="linux" and embedded==0', {
752 # Flags to use X11 on non-Mac POSIX platforms.
753 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
760 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
766 # Flags to use pango and cairo.
767 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
776 ['OS=="linux" and embedded==0', {
782 # We always use skia text rendering in Aura on Windows, since GDI
783 # doesn't agree with our BackingStore.
784 # TODO(beng): remove once skia text rendering is on by default.
785 ['use_aura==1 and OS=="win"', {
786 'enable_skia_text%': 1,
789 # A flag to enable or disable our compile-time dependency
790 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
791 # support will be available. This option is useful
792 # for Linux distributions and for Aura.
793 ['OS!="linux" or chromeos==1', {
794 'use_gnome_keyring%': 0,
796 'use_gnome_keyring%': 1,
799 ['OS=="mac" or OS=="ios"', {
800 # Mac and iOS want Title Case strings
801 'use_titlecase_in_grd%': 1,
804 # Enable loader extensions on Chrome OS.
806 'image_loader_extension%': 1,
808 'image_loader_extension%': 0,
811 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
812 'enable_one_click_signin%': 1,
813 'enable_pre_sync_backup%': 1,
817 'enable_extensions%': 0,
818 'enable_google_now%': 0,
819 'cld2_table_size%': 0,
823 'arm_neon_optional%': 1,
824 'native_memory_pressure_signals%': 1,
825 'enable_basic_printing%': 1,
826 'enable_print_preview%': 0,
827 'enable_task_manager%':0,
831 # Android and OSX have built-in spellcheckers that can be utilized.
832 ['OS=="android" or OS=="mac"', {
833 'use_browser_spellchecker%': 1,
836 # Android OS includes support for proprietary codecs regardless of
837 # building Chromium or Google Chrome. We also ship Google Chrome and
838 # Chromecast with proprietary codecs.
839 ['OS=="android" or branding=="Chrome" or chromecast==1', {
840 'proprietary_codecs%': 1,
842 'proprietary_codecs%': 0,
845 ['OS=="mac" or OS=="ios"', {
846 'native_memory_pressure_signals%': 1,
849 # Enable autofill dialog when not on iOS.
851 'enable_autofill_dialog%': 1,
854 ['buildtype=="Official"', {
855 'enable_prod_wallet_service%': 1,
858 # Enable hotwording on Chrome-branded ChromeOS builds.
859 ['branding=="Chrome" and chromeos==1', {
860 'enable_hotwording%': 1,
868 'disable_ftp_support%': 1,
869 'enable_extensions%': 0,
870 'enable_google_now%': 0,
871 'cld2_table_size%': 0,
872 'enable_basic_printing%': 0,
873 'enable_print_preview%': 0,
874 'enable_session_service%': 0,
875 'enable_spellcheck%': 0,
881 'enable_supervised_users%': 0,
882 'enable_task_manager%': 0,
883 'use_system_libcxx%': 1,
884 'enable_media_router%': 0,
887 # Use GPU accelerated cross process image transport by default
888 # on linux builds with the Aura window manager
889 ['use_aura==1 and OS=="linux"', {
890 'ui_compositor_image_transport%': 1,
892 'ui_compositor_image_transport%': 0,
895 # Turn precompiled headers on by default.
896 ['OS=="win" and buildtype!="Official"', {
897 'chromium_win_pch%': 1
900 # Whether PDF plugin is enabled.
901 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
907 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
908 'enable_plugin_installation%': 0,
910 'enable_plugin_installation%': 1,
913 # Whether PPAPI is enabled.
914 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
915 'enable_plugins%': 0,
917 'enable_plugins%': 1,
920 # linux_use_bundled_gold: whether to use the gold linker binary checked
921 # into third_party/binutils. Force this off via GYP_DEFINES when you
922 # are using a custom toolchain and need to control -B in ldflags.
923 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
924 # for component=static_library builds.
925 ['(OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm" or (target_arch=="ia32" and host_arch=="x64"))', {
926 'linux_use_bundled_gold%': 1,
928 'linux_use_bundled_gold%': 0,
931 # linux_use_bundled_binutils: whether to use the binary binutils
932 # checked into third_party/binutils. These are not multi-arch so cannot
933 # be used except on x86 and x86-64 (the only two architectures which
934 # are currently checke in). Force this off via GYP_DEFINES when you
935 # are using a custom toolchain and need to control -B in cflags.
936 ['OS=="linux" and (target_arch=="x64")', {
937 'linux_use_bundled_binutils%': 1,
939 'linux_use_bundled_binutils%': 0,
942 # linux_use_gold_flags: whether to use build flags that rely on gold.
943 # On by default for x64 Linux.
944 ['OS=="linux" and target_arch=="x64"', {
945 'linux_use_gold_flags%': 1,
947 'linux_use_gold_flags%': 0,
950 # linux_use_debug_fission: whether to use split DWARF debug info
951 # files. This can reduce link time significantly, but is incompatible
952 # with some utilities such as icecc and ccache. Requires gold and
953 # gcc >= 4.8 or clang.
954 # http://gcc.gnu.org/wiki/DebugFission
955 ['OS=="linux" and target_arch=="x64"', {
956 'linux_use_debug_fission%': 1,
958 'linux_use_debug_fission%': 0,
961 ['OS=="android" or OS=="ios"', {
962 'enable_captive_portal_detection%': 0,
964 'enable_captive_portal_detection%': 1,
967 # Enable Skia UI text drawing incrementally on different platforms.
968 # http://crbug.com/105550
970 # On Aura, this allows per-tile painting to be used in the browser
972 ['OS!="android" and OS!="ios"', {
973 'use_canvas_skia%': 1,
977 'enable_basic_printing%': 0,
978 'enable_print_preview%': 1,
981 # Do not enable the Settings App on ChromeOS.
982 ['enable_app_list==1 and chromeos==0', {
983 'enable_settings_app%': 1,
985 'enable_settings_app%': 0,
988 # Whether tests targets should be run, archived or just have the
989 # dependencies verified. All the tests targets have the '_run' suffix,
990 # e.g. base_unittests_run runs the target base_unittests. The test
991 # target always calls tools/swarming_client/isolate.py. See the script's
992 # --help for more information. Meant to be overriden with GYP_DEFINES.
993 # TODO(maruel): Remove the conditions as more configurations are
995 ['OS!="ios" and OS!="android" and chromeos==0', {
996 'test_isolation_mode%': 'check',
998 'test_isolation_mode%': 'noop',
1000 # Whether Android build uses OpenMAX DL FFT.
1001 ['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")', {
1002 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
1003 # When enabled, this will also enable WebAudio support on
1004 # Android for these architectures. Default is enabled. Whether
1005 # WebAudio is actually available depends on runtime settings
1007 'use_openmax_dl_fft%': 1,
1009 'use_openmax_dl_fft%': 0,
1011 ['OS=="win" or OS=="linux"', {
1015 # Disable various features by default on embedded.
1018 'enable_basic_printing%': 0,
1019 'enable_print_preview%': 0,
1022 ['OS=="win" or OS=="mac"', {
1023 'enable_wifi_bootstrapping%' : 1,
1026 # Path to sas.dll, which provides the SendSAS function.
1027 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1028 ['target_arch=="x64"', {
1029 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1031 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1035 'pkg-config': '<(chroot_cmd) <(DEPTH)/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
1037 'pkg-config': 'pkg-config'
1040 # Enable WebVR support by default on Android
1041 # Still requires command line flag to access API
1049 # Setting this to '0' will cause V8's startup snapshot to be
1050 # embedded in the binary instead of being a external files.
1051 'v8_use_external_startup_data%': 1,
1053 # Set this to 1 to enable use of concatenated impulse responses
1054 # for the HRTF panner in WebAudio.
1055 'use_concatenated_impulse_responses': 1,
1057 # You can set the variable 'use_official_google_api_keys' to 1
1058 # to use the Google-internal file containing official API keys
1059 # for Google Chrome even in a developer build. Setting this
1060 # variable explicitly to 1 will cause your build to fail if the
1061 # internal file is missing.
1063 # The variable is documented here, but not handled in this file;
1064 # see //google_apis/determine_use_official_keys.gypi for the
1067 # Set the variable to 0 to not use the internal file, even when
1068 # it exists in your checkout.
1070 # Leave it unset in your include.gypi to have the variable
1071 # implicitly set to 1 if you have
1072 # src/google_apis/internal/google_chrome_api_keys.h in your
1073 # checkout, and implicitly set to 0 if not.
1075 # Note that official builds always behave as if the variable
1076 # was explicitly set to 1, i.e. they always use official keys,
1077 # and will fail to build if the internal file is missing.
1079 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1080 # include.gypi or by other means. Due to subtleties of GYP, this
1081 # is not the same as leaving the variable unset, even though its
1083 # //google_apis/determine_use_official_keys.gypi is 2.
1085 # Set these to bake the specified API keys and OAuth client
1086 # IDs/secrets into your build.
1088 # If you create a build without values baked in, you can instead
1089 # set environment variables to provide the keys at runtime (see
1090 # src/google_apis/google_api_keys.h for details). Features that
1091 # require server-side APIs may fail to work if no keys are
1094 # Note that if you are building an official build or if
1095 # use_official_google_api_keys has been set to 1 (explicitly or
1096 # implicitly), these values will be ignored and the official
1097 # keys will be used instead.
1098 'google_api_key%': '',
1099 'google_default_client_id%': '',
1100 'google_default_client_secret%': '',
1101 # Native Client is enabled by default.
1102 'disable_nacl%': '0',
1104 # Native Client toolchains, enabled by default.
1105 'disable_pnacl%': 0,
1106 'disable_newlib%': 0,
1108 # Sets the default version name and code for Android app, by default we
1109 # do a developer build.
1110 'android_app_version_name%': 'Developer Build',
1111 'android_app_version_code%': 1,
1114 # Copy conditionally-set variables out one scope.
1115 'branding%': '<(branding)',
1116 'branding_path_component%': '<(branding_path_component)',
1117 'buildtype%': '<(buildtype)',
1118 'target_arch%': '<(target_arch)',
1119 'target_subarch%': '<(target_subarch)',
1120 'mips_arch_variant%': '<(mips_arch_variant)',
1121 'mips_dsp_rev%': '<(mips_dsp_rev)',
1122 'host_arch%': '<(host_arch)',
1123 'toolkit_views%': '<(toolkit_views)',
1124 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1125 'use_aura%': '<(use_aura)',
1126 'use_ash%': '<(use_ash)',
1127 'use_cras%': '<(use_cras)',
1128 'use_libpci%': '<(use_libpci)',
1129 'use_openssl%': '<(use_openssl)',
1130 'use_openssl_certs%': '<(use_openssl_certs)',
1131 'use_nss_certs%': '<(use_nss_certs)',
1132 'use_udev%': '<(use_udev)',
1133 'os_bsd%': '<(os_bsd)',
1134 'os_posix%': '<(os_posix)',
1135 'use_dbus%': '<(use_dbus)',
1136 'use_glib%': '<(use_glib)',
1137 'use_pango%': '<(use_pango)',
1138 'use_cairo%': '<(use_cairo)',
1139 'use_ozone%': '<(use_ozone)',
1140 'use_ozone_evdev%': '<(use_ozone_evdev)',
1141 'use_xkbcommon%': '<(use_xkbcommon)',
1142 'use_gtk3%': '<(use_gtk3)',
1143 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1144 'desktop_linux%': '<(desktop_linux)',
1145 'use_x11%': '<(use_x11)',
1146 'use_gnome_keyring%': '<(use_gnome_keyring)',
1147 'linux_fpic%': '<(linux_fpic)',
1148 'chromeos%': '<(chromeos)',
1149 'chromecast%': '<(chromecast)',
1150 'enable_viewport%': '<(enable_viewport)',
1151 'enable_hidpi%': '<(enable_hidpi)',
1152 'enable_topchrome_md%': '<(enable_topchrome_md)',
1153 'image_loader_extension%': '<(image_loader_extension)',
1154 'fastbuild%': '<(fastbuild)',
1155 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1156 'win_z7%': '<(win_z7)',
1157 'dcheck_always_on%': '<(dcheck_always_on)',
1158 'tracing_like_official_build%': '<(tracing_like_official_build)',
1159 'fieldtrial_testing_like_official_build%': '<(fieldtrial_testing_like_official_build)',
1160 'arm_version%': '<(arm_version)',
1161 'arm_neon%': '<(arm_neon)',
1162 'arm_neon_optional%': '<(arm_neon_optional)',
1163 'sysroot%': '<(sysroot)',
1164 'pkg-config%': '<(pkg-config)',
1165 'chroot_cmd%': '<(chroot_cmd)',
1166 'system_libdir%': '<(system_libdir)',
1167 'component%': '<(component)',
1168 'win_analyze%': '<(win_analyze)',
1169 'win_fastlink%': '<(win_fastlink)',
1170 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1171 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1172 'remoting%': '<(remoting)',
1173 'enable_one_click_signin%': '<(enable_one_click_signin)',
1174 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1175 'enable_media_router%': '<(enable_media_router)',
1176 'enable_webrtc%': '<(enable_webrtc)',
1177 'chromium_win_pch%': '<(chromium_win_pch)',
1178 'configuration_policy%': '<(configuration_policy)',
1179 'safe_browsing%': '<(safe_browsing)',
1180 'enable_web_speech%': '<(enable_web_speech)',
1181 'enable_hotwording%': '<(enable_hotwording)',
1182 'notifications%': '<(notifications)',
1183 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1184 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1186 'asan_blacklist%': '<(asan_blacklist)',
1187 'asan_coverage%': '<(asan_coverage)',
1188 'sanitizer_coverage%': '<(sanitizer_coverage)',
1189 'asan_field_padding%': '<(asan_field_padding)',
1190 'use_sanitizer_options%': '<(use_sanitizer_options)',
1191 'syzyasan%': '<(syzyasan)',
1192 'kasko%': '<(kasko)',
1193 'syzygy_optimize%': '<(syzygy_optimize)',
1196 'msan_blacklist%': '<(msan_blacklist)',
1197 'msan_track_origins%': '<(msan_track_origins)',
1199 'tsan_blacklist%': '<(tsan_blacklist)',
1200 'ubsan%': '<(ubsan)',
1201 'ubsan_blacklist%': '<(ubsan_blacklist)',
1202 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1203 'ubsan_vptr%': '<(ubsan_vptr)',
1204 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1205 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
1206 'use_custom_libcxx%': '<(use_custom_libcxx)',
1207 'use_system_libcxx%': '<(use_system_libcxx)',
1208 'clang_type_profiler%': '<(clang_type_profiler)',
1209 'order_profiling%': '<(order_profiling)',
1210 'order_text_section%': '<(order_text_section)',
1211 'enable_extensions%': '<(enable_extensions)',
1212 'enable_pdf%': '<(enable_pdf)',
1213 'enable_plugin_installation%': '<(enable_plugin_installation)',
1214 'enable_plugins%': '<(enable_plugins)',
1215 'enable_session_service%': '<(enable_session_service)',
1216 'enable_themes%': '<(enable_themes)',
1217 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1218 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1219 'enable_background%': '<(enable_background)',
1220 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1221 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1222 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1223 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1224 'use_canvas_skia%': '<(use_canvas_skia)',
1225 'test_isolation_mode%': '<(test_isolation_mode)',
1226 'enable_basic_printing%': '<(enable_basic_printing)',
1227 'enable_print_preview%': '<(enable_print_preview)',
1228 'enable_spellcheck%': '<(enable_spellcheck)',
1229 'use_browser_spellchecker%': '<(use_browser_spellchecker)',
1230 'enable_google_now%': '<(enable_google_now)',
1231 'cld_version%': '<(cld_version)',
1232 'cld2_table_size%': '<(cld2_table_size)',
1233 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1234 'disable_file_support%': '<(disable_file_support)',
1235 'disable_ftp_support%': '<(disable_ftp_support)',
1236 'enable_task_manager%': '<(enable_task_manager)',
1237 'sas_dll_path%': '<(sas_dll_path)',
1238 'wix_path%': '<(wix_path)',
1239 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1240 'use_system_libjpeg%': '<(use_system_libjpeg)',
1241 'android_channel%': '<(android_channel)',
1242 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1243 'gyp_managed_install%': 0,
1244 'create_standalone_apk%': 1,
1245 'enable_app_list%': '<(enable_app_list)',
1246 'use_default_render_theme%': '<(use_default_render_theme)',
1247 'enable_settings_app%': '<(enable_settings_app)',
1248 'google_api_key%': '<(google_api_key)',
1249 'google_default_client_id%': '<(google_default_client_id)',
1250 'google_default_client_secret%': '<(google_default_client_secret)',
1251 'enable_supervised_users%': '<(enable_supervised_users)',
1252 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1253 'enable_mdns%' : '<(enable_mdns)',
1254 'enable_service_discovery%' : '<(enable_service_discovery)',
1255 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1256 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1257 'proprietary_codecs%': '<(proprietary_codecs)',
1258 'use_goma%': '<(use_goma)',
1259 'gomadir%': '<(gomadir)',
1260 'use_lto%': '<(use_lto)',
1261 'use_lto_o2%': '<(use_lto_o2)',
1262 'gold_icf_level%': '<(gold_icf_level)',
1263 'video_hole%': '<(video_hole)',
1264 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1265 'cfi_vptr%': '<(cfi_vptr)',
1266 'cfi_diag%': '<(cfi_diag)',
1267 'cfi_blacklist%': '<(cfi_blacklist)',
1268 'mac_views_browser%': '<(mac_views_browser)',
1269 'android_app_version_name%': '<(android_app_version_name)',
1270 'android_app_version_code%': '<(android_app_version_code)',
1271 'enable_webvr%': '<(enable_webvr)',
1273 # Turns on compiler optimizations in V8 in Debug build.
1274 'v8_optimized_debug%': 1,
1276 # Use system protobuf instead of bundled one.
1277 'use_system_protobuf%': 0,
1279 # Use system yasm instead of bundled one.
1280 'use_system_yasm%': 0,
1282 # Use system ICU instead of bundled one.
1283 'use_system_icu%' : 0,
1285 # Default to enabled PIE; this is important for ASLR but we may need to be
1286 # able to turn it off for various reasons.
1287 'linux_disable_pie%': 0,
1289 # The release channel that this build targets. This is used to restrict
1290 # channel-specific build options, like which installer packages to create.
1291 # The default is 'all', which does no channel-specific filtering.
1294 # Override chromium_mac_pch and set it to 0 to suppress the use of
1295 # precompiled headers on the Mac. Prefix header injection may still be
1296 # used, but prefix headers will not be precompiled. This is useful when
1297 # using distcc to distribute a build to compile slaves that don't
1298 # share the same compiler executable as the system driving the compilation,
1299 # because precompiled headers rely on pointers into a specific compiler
1300 # executable's image. Setting this to 0 is needed to use an experimental
1301 # Linux-Mac cross compiler distcc farm.
1302 'chromium_mac_pch%': 1,
1304 # The default value for mac_strip in target_defaults. This cannot be
1305 # set there, per the comment about variable% in a target_defaults.
1306 'mac_strip_release%': 0,
1308 # Set to 1 to enable java code coverage. Instruments classes during build
1309 # to produce .ec files during runtime.
1310 'emma_coverage%': 0,
1312 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1313 # separated with whitespace and/or comma. Only has effect if
1314 # 'emma_coverage=1'.
1317 # Set to 1 to enable running Android lint on java/class files.
1320 # Although base/allocator lets you select a heap library via an
1321 # environment variable, the libcmt shim it uses sometimes gets in
1322 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1323 # 'win_use_allocator_shim': 0,
1324 # 'win_release_RuntimeLibrary': 2
1325 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1326 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1328 # TODO(bradnelson): eliminate this when possible.
1329 # To allow local gyp files to prevent release.vsprops from being included.
1330 # Yes(1) means include release.vsprops.
1331 # Once all vsprops settings are migrated into gyp, this can go away.
1332 'msvs_use_common_release%': 1,
1334 # TODO(bradnelson): eliminate this when possible.
1335 # To allow local gyp files to override additional linker options for msvs.
1336 # Yes(1) means set use the common linker options.
1337 'msvs_use_common_linker_extras%': 1,
1339 # TODO(sgk): eliminate this if possible.
1340 # It would be nicer to support this via a setting in 'target_defaults'
1341 # in chrome/app/locales/locales.gypi overriding the setting in the
1342 # 'Debug' configuration in the 'target_defaults' dict below,
1343 # but that doesn't work as we'd like.
1344 'msvs_debug_link_incremental%': '2',
1346 # Needed for some of the largest modules.
1347 'msvs_debug_link_nonincremental%': '1',
1349 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1350 # to get incremental linking to be faster in debug builds.
1351 'incremental_chrome_dll%': '0',
1353 # Experimental setting to break chrome.dll into multiple pieces based on
1355 'chrome_multiple_dll%': '0',
1357 # Experimental setting to optimize Chrome's DLLs with PGO.
1358 'chrome_pgo_phase%': '0',
1360 # Whether the VS xtree header has been patched to disable warning 4702. If
1361 # it has, then we don't need to disable 4702 (unreachable code warning).
1362 # The patch is preapplied to the internal toolchain and hence all bots.
1363 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1366 'clang%': '<(clang)',
1367 'host_clang%': '<(host_clang)',
1368 'make_clang_dir%': '<(make_clang_dir)',
1369 'use_lld%': '<(use_lld)',
1371 # Control which version of clang to use when building for iOS. If set to
1372 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1373 # the version of clang that ships with the Chromium source. This variable
1374 # is automatically set to '1' in Official builds.
1377 # These two variables can be set in GYP_DEFINES while running
1378 # |gclient runhooks| to let clang run a plugin in every compilation.
1379 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1381 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1384 'clang_add_plugin%': '',
1386 # Tell ld64 to write map files describing binary layout. Useful
1387 # for looking at what contributes to binary size, e.g. with
1388 # https://github.com/nico/bloat
1389 'mac_write_linker_maps%': 0,
1391 # The default type of gtest.
1392 'gtest_target_type%': 'executable',
1394 # Enable sampling based profiler.
1395 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1397 # Profile without optimizing out stack frames when profiling==1.
1398 'profiling_full_stack_frames%': '0',
1400 # And if we want to dump symbols for Breakpad-enabled builds.
1401 'linux_dump_symbols%': 0,
1402 # And if we want to strip the binary after dumping symbols.
1403 'linux_strip_binary%': 0,
1404 # If we want stack unwind support for backtrace().
1405 'debug_unwind_tables%': 1,
1406 'release_unwind_tables%': 1,
1408 # Override where to find binutils
1409 'binutils_version%': 0,
1410 'binutils_dir%': '',
1413 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1414 'use_allocator%': 'tcmalloc',
1416 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1417 'linux_link_gnome_keyring%': 0,
1418 # Set to 1 to link against gsettings APIs instead of using dlopen().
1419 'linux_link_gsettings%': 0,
1421 # Enable use of OpenMAX DL FFT routines.
1422 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1424 # Enable new NPDevice API.
1425 'enable_new_npdevice_api%': 0,
1427 # .gyp files or targets should set chromium_code to 1 if they build
1428 # Chromium-specific code, as opposed to external code. This variable is
1429 # used to control such things as the set of warnings to enable, and
1430 # whether warnings are treated as errors.
1431 'chromium_code%': 0,
1433 # Disable fatal linker warnings, similarly to how we make it possible
1434 # to disable -Werror (e.g. for different toolchain versions).
1435 'disable_fatal_linker_warnings%': 0,
1437 'release_valgrind_build%': 0,
1439 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1440 'enable_wexit_time_destructors%': 0,
1442 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1443 'internal_gles2_conform_tests%': 0,
1445 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1446 'internal_khronos_glcts_tests%': 0,
1448 # Set to 1 to compile the filter fuzzer.
1449 'internal_filter_fuzzer%': 0,
1451 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1452 # so Cocoa is happy (http://crbug.com/20441).
1454 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1455 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1456 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1457 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1458 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1459 'vi', 'zh-CN', 'zh-TW',
1462 # Pseudo locales are special locales which are used for testing and
1463 # debugging. They don't get copied to the final app. For more info,
1464 # check out https://www.chromium.org/developers/testing/fake-bidi
1471 # If debug_devtools is set to 1, JavaScript files for DevTools are
1472 # stored as is and loaded from disk. Otherwise, a concatenated file
1473 # is stored in resources.pak. It is still possible to load JS files
1474 # from disk by passing --debug-devtools cmdline switch.
1475 'debug_devtools%': 0,
1477 # The Java Bridge is not compiled in by default.
1480 # Code signing for iOS binaries. The bots need to be able to disable this.
1481 'chromium_ios_signing%': 1,
1483 # This flag is only used when disable_nacl==0 and disables all those
1484 # subcomponents which would require the installation of a native_client
1485 # untrusted toolchain.
1486 'disable_nacl_untrusted%': 0,
1488 # PNaCl toolchain does not support sanitizers. Disable by default.
1489 'enable_nacl_nonsfi_test%': 0,
1491 # Disable Dart by default.
1494 # Copy out the setting of disable_nacl.
1495 'disable_nacl%': '<(disable_nacl)',
1497 # Native Client toolchains, enabled by default.
1498 'disable_pnacl%': '<(disable_pnacl)',
1499 'disable_newlib%': '<(disable_newlib)',
1501 # Whether to build full debug version for Debug configuration on Android.
1502 # Compared to full debug version, the default Debug configuration on Android
1503 # has no full v8 debug, has size optimization and linker gc section, so that
1504 # we can build a debug version with acceptable size and performance.
1505 'android_full_debug%': 0,
1507 # Contains data about the attached devices for gyp_managed_install.
1508 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1510 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1511 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1513 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1514 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1516 # Whether we are using the rlz library or not. Platforms like Android send
1517 # rlz codes for searches but do not use the library.
1518 'enable_rlz_support%': 0,
1521 # Turns on the i18n support in V8.
1522 'v8_enable_i18n_support': 1,
1524 # Compile d8 for the host toolset.
1525 'v8_toolset_for_d8': 'host',
1527 # Use brlapi from brltty for braille display support.
1530 # Relative path to icu.gyp from this file.
1531 'icu_gyp_path': '../third_party/icu/icu.gyp',
1533 # IPC fuzzer is disabled by default.
1534 'enable_ipc_fuzzer%': 0,
1536 # Force disable libstdc++ debug mode.
1537 'disable_glibcxx_debug%': 0,
1539 # Set to 1 to compile with MSE support for MPEG2 TS
1540 'enable_mpeg2ts_stream_parser%': 0,
1542 # Support ChromeOS touchpad gestures with ozone.
1543 'use_evdev_gestures%': 0,
1545 # Default ozone platform (if no --ozone-platform flag).
1546 'ozone_platform%': "",
1548 # Ozone platforms to include in the build.
1549 'ozone_platform_caca%': 0,
1550 'ozone_platform_cast%': 0,
1551 'ozone_platform_drm%': 0,
1552 'ozone_platform_egltest%': 0,
1553 'ozone_platform_gbm%': 0,
1554 'ozone_platform_ozonex%': 0,
1555 'ozone_platform_test%': 0,
1557 # Experiment: http://crbug.com/426914
1560 # Used to set libjpeg_gyp_path. Chrome OS ui/gfx/gfx.gyp uses the IJG path
1561 # for robust login screen decoding.
1562 'libjpeg_ijg_gyp_path': '<(DEPTH)/third_party/libjpeg/libjpeg.gyp',
1563 'libjpeg_turbo_gyp_path': '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp',
1566 ['buildtype=="Official"', {
1567 # Continue to embed build meta data in Official builds, basically the
1568 # time it was built.
1569 # TODO(maruel): This decision should be revisited because having an
1570 # official deterministic build has high value too but MSVC toolset can't
1571 # generate anything deterministic with WPO enabled AFAIK.
1572 'dont_embed_build_metadata%': 0,
1574 # Enable the Syzygy optimization step for the official builds.
1575 ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
1576 'syzygy_optimize%': 1,
1578 'syzygy_optimize%': 0,
1580 # Get binutils version so we can enable debug fission if we can.
1581 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1583 # compiler_version doesn't work with clang
1584 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1585 # compiler_version works with clang.
1586 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1587 # that it takes effect here.
1588 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1589 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1591 # On Android we know the binutils version in the toolchain.
1593 'binutils_version%': 222,
1595 ['host_arch=="x64"', {
1596 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1598 ['host_arch=="ia32"', {
1599 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1601 # Our version of binutils in third_party/binutils
1602 ['linux_use_bundled_binutils==1', {
1603 'binutils_version%': 224,
1607 'binutils_version%': 0,
1609 # The version of GCC in use, set later in platforms that use GCC and have
1610 # not explicitly chosen to build with clang. Currently, this means all
1611 # platforms except Windows, Mac and iOS.
1612 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1613 # it takes effect here.
1614 ['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', {
1617 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1618 # We directly set the gcc version since we know what we use.
1621 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1622 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1626 'host_gcc_version%': 0,
1629 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1630 'directx_sdk_path%': '<(directx_sdk_default_path)',
1632 'directx_sdk_path%': '$(DXSDK_DIR)',
1635 'windows_driver_kit_path%': '$(WDK_DIR)',
1637 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1639 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1642 'nacl_untrusted_build%': 0,
1643 'use_allocator%': 'none',
1645 # Use a 64-bit linker to avoid running out of address space. The
1646 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1647 ['host_arch=="ia32" and target_arch=="ia32"', {
1648 # TODO(thestig) This is a horrible way to force the desired
1649 # configuration. Our gyp variable scoping is likely wrong and
1650 # needs to be cleaned up. The GN configuration should be changed
1652 'binutils_version%': 224,
1653 'linux_use_bundled_binutils%': '1',
1654 'linux_use_bundled_gold%': '1',
1655 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1657 # All Chrome builds have breakpad symbols, but only process the
1658 # symbols from official builds.
1659 ['(branding=="Chrome" and buildtype=="Official")', {
1660 'linux_dump_symbols%': 1,
1662 # Omit unwind support in official release builds to save space. We
1663 # can use breakpad for these builds.
1664 'release_unwind_tables%': 0,
1667 }], # os_posix==1 and OS!="mac" and OS!="ios"
1670 'enable_background%': 0,
1671 'icu_use_data_file_flag%': 1,
1672 'enable_web_speech%': 0,
1673 'use_system_libxml%': 1,
1674 'use_system_sqlite%': 1,
1676 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1677 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1678 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1679 'uk', 'vi', 'zh-CN', 'zh-TW',
1682 # iOS SDK and deployment target support. The |ios_sdk| value is left
1683 # blank so that when it is set in the project files it will be the
1684 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1685 # causes Xcode to spit out a warning for every single project file for
1686 # not using the "current" SDK.
1688 'ios_sdk_path%': '',
1689 'ios_deployment_target%': '7.0',
1692 # ios_product_name is set to the name of the .app bundle as it should
1694 ['branding=="Chrome"', {
1695 'ios_product_name%': 'Chrome',
1696 }, { # else: branding!="Chrome"
1697 'ios_product_name%': 'Chromium',
1699 ['branding=="Chrome" and buildtype=="Official"', {
1701 }, { # else: branding!="Chrome" or buildtype!="Official"
1707 # Location of Android NDK.
1710 # Standard libraries can use the relative path to the NDK.
1711 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1712 # Unfortunately, it is required to use the absolute path to the SDK
1713 # because it us passed to ant which uses a different relative path
1715 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1716 # Similarly, gdbserver and the Android toolchain need to use the
1717 # absolute path to the NDK because they are used at different levels
1719 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1720 'android_host_arch%': '<!(uname -m)',
1721 # Android API-level of the SDK used for compilation.
1722 'android_sdk_version%': '23',
1723 'android_sdk_build_tools_version%': '23.0.0',
1724 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1727 # Figure this out early since it needs symbols from libgcc.a, so it
1728 # has to be before that in the set of libraries.
1729 # ASan needs to dynamically link to libc++ even in static builds so
1730 # that it can interpose operator new.
1731 ['component=="shared_library" or asan==1', {
1732 'android_libcpp_library': 'c++_shared',
1733 'android_must_copy_system_libraries': 1,
1735 'android_libcpp_library': 'c++_static',
1736 'android_must_copy_system_libraries': 0,
1741 # Copy conditionally-set variables out one scope.
1742 'android_ndk_root%': '<(android_ndk_root)',
1743 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1744 'android_sdk_root%': '<(android_sdk_root)',
1745 'android_sdk_version%': '<(android_sdk_version)',
1746 'android_libcpp_root': '<(android_ndk_root)/sources/cxx-stl/llvm-libc++',
1747 'android_libcpp_library': '<(android_libcpp_library)',
1748 'android_must_copy_system_libraries': '<(android_must_copy_system_libraries)',
1749 'host_os%': '<(host_os)',
1751 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1752 # Android SDK build tools (e.g. dx, aidl)
1753 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1755 # Android API level 16 is JB (Android 4.1) which is the minimum
1756 # platform requirement for Chrome on Android, we use it for native
1759 ['target_arch == "ia32"', {
1760 'android_app_abi%': 'x86',
1761 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
1762 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-x86',
1763 'android_ndk_lib_dir%': 'usr/lib',
1764 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1766 ['target_arch == "x64"', {
1767 'android_app_abi%': 'x86_64',
1768 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1769 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1770 'android_ndk_lib_dir%': 'usr/lib64',
1771 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1773 ['target_arch=="arm"', {
1776 'android_app_abi%': 'armeabi',
1778 'android_app_abi%': 'armeabi-v7a',
1781 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
1782 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-arm',
1783 'android_ndk_lib_dir%': 'usr/lib',
1784 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1786 ['target_arch == "arm64"', {
1787 'android_app_abi%': 'arm64-v8a',
1788 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1789 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1790 'android_ndk_lib_dir%': 'usr/lib',
1791 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1793 ['target_arch == "mipsel"', {
1794 'android_app_abi%': 'mips',
1795 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
1796 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-mips',
1797 'android_ndk_lib_dir%': 'usr/lib',
1798 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1800 ['target_arch == "mips64el"', {
1801 'android_app_abi%': 'mips64',
1802 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1803 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1804 'android_ndk_lib_dir%': 'usr/lib64',
1805 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1809 # Copy conditionally-set variables out one scope.
1810 'android_app_abi%': '<(android_app_abi)',
1811 'android_gdbserver%': '<(android_gdbserver)',
1812 'android_ndk_root%': '<(android_ndk_root)',
1813 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1814 'android_sdk_root%': '<(android_sdk_root)',
1815 'android_sdk_version%': '<(android_sdk_version)',
1816 'android_toolchain%': '<(android_toolchain)',
1818 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1819 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1820 'android_sdk_tools%': '<(android_sdk_tools)',
1821 'android_aapt_path%': '<(android_sdk_tools)/aapt',
1822 'android_sdk%': '<(android_sdk)',
1823 'android_sdk_jar%': '<(android_sdk)/android.jar',
1825 'android_libcpp_root': '<(android_libcpp_root)',
1826 'android_libcpp_library': '<(android_libcpp_library)',
1827 'android_libcpp_include': '<(android_libcpp_root)/libcxx/include',
1828 'android_libcpp_libs_dir%': '<(android_libcpp_root)/libs/<(android_app_abi)',
1829 'android_must_copy_system_libraries': '<(android_must_copy_system_libraries)',
1830 'host_os%': '<(host_os)',
1832 # Location of the "objcopy" binary, used by both gyp and scripts.
1833 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1835 # Location of the "strip" binary, used by both gyp and scripts.
1836 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1838 # Location of the "readelf" binary.
1839 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1841 # Determines whether we should optimize JNI generation at the cost of
1842 # breaking assumptions in the build system that when inputs have changed
1843 # the outputs should always change as well. This is meant purely for
1844 # developer builds, to avoid spurious re-linking of native files.
1845 'optimize_jni_generation%': '<(optimize_jni_generation)',
1847 # Use OpenSSL's struct X509 to represent certificates.
1848 'use_openssl_certs%': 1,
1850 'proprietary_codecs%': '<(proprietary_codecs)',
1852 # safe_browsing defaults to 2 for public builds and is switched to 3 in
1853 # //clank/supplement.gypi since mode 3 requires an internal API.
1854 'safe_browsing%': 2,
1856 'enable_web_speech%': 0,
1858 'use_allocator%': 'none',
1860 # Disable Native Client.
1863 # Android does not support background apps.
1864 'enable_background%': 0,
1866 # Sessions are store separately in the Java side.
1867 'enable_session_service%': 0,
1871 'gtest_target_type%': 'shared_library',
1874 'use_system_fontconfig%': 0,
1876 'use_system_fontconfig%': 1,
1879 'enable_mpeg2ts_stream_parser%': 1,
1880 'ffmpeg_branding%': 'ChromeOS',
1881 'ozone_platform_ozonex%': 1,
1882 'use_custom_freetype%': 0,
1883 'use_playready%': 0,
1885 ['target_arch=="arm"', {
1887 'arm_tune%': 'cortex-a9',
1893 ['chromecast==1 and OS!="android"', {
1894 'ozone_platform_cast%': 1
1901 # All Chrome builds have breakpad symbols, but only process the
1902 # symbols from official builds.
1903 ['(branding=="Chrome" and buildtype=="Official")', {
1904 'mac_strip_release%': 1,
1908 ['OS=="mac" or OS=="ios"', {
1912 # Mac OS X SDK and deployment target support. The SDK identifies
1913 # the version of the system headers that will be used, and
1914 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1915 # macro. "Maximum allowed" refers to the operating system version
1916 # whose APIs are available in the headers. The deployment target
1917 # identifies the minimum system version that the built products are
1918 # expected to function on. It corresponds to the
1919 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1920 # macros are available, #include <AvailabilityMacros.h>. Additional
1921 # documentation on these macros is available at
1922 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1923 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1924 # deployment target to 10.6. Other projects, such as O3D, may
1925 # override these defaults.
1927 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1928 # about that is at least the specified version. In official builds,
1929 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1930 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1931 # path to the SDK; when set to a non-empty string, SDK detection
1932 # based on mac_sdk_min will be bypassed entirely.
1935 'mac_sdk_min%': '10.8',
1936 }, { # else OS!="ios"
1937 'mac_sdk_min%': '10.10',
1940 'mac_sdk_path%': '',
1942 'mac_deployment_target%': '10.6',
1945 'mac_sdk_min': '<(mac_sdk_min)',
1946 'mac_sdk_path': '<(mac_sdk_path)',
1947 'mac_deployment_target': '<(mac_deployment_target)',
1949 # Compile in Breakpad support by default so that it can be
1950 # tested, even if it is not enabled by default at runtime.
1951 'mac_breakpad_compiled_in%': 1,
1953 # mac_product_name is set to the name of the .app bundle as it should
1954 # appear on disk. This duplicates data from
1955 # chrome/app/theme/chromium/BRANDING and
1956 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1957 # these names into the build system.
1958 ['branding=="Chrome"', {
1959 'mac_product_name%': 'Google Chrome',
1960 }, { # else: branding!="Chrome"
1961 'mac_product_name%': 'Chromium',
1963 # Official mac builds require a specific OS X SDK, but iOS and
1964 # non-official mac builds do not.
1965 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1966 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1968 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1970 ['branding=="Chrome" and buildtype=="Official"', {
1971 # Enable uploading crash dumps.
1972 'mac_breakpad_uploads%': 1,
1973 # Enable dumping symbols at build time for use by Mac Breakpad.
1975 # Enable Keystone auto-update support.
1977 }, { # else: branding!="Chrome" or buildtype!="Official"
1978 'mac_breakpad_uploads%': 0,
1983 }], # OS=="mac" or OS=="ios"
1986 # This is the architecture convention used in WinSDK paths.
1987 ['target_arch=="ia32"', {
1988 'winsdk_arch%': 'x86',
1990 'winsdk_arch%': '<(target_arch)',
1992 ['component=="shared_library" or MSVS_VERSION == "2015"', {
1993 # TODO(scottmg): The allocator shimming doesn't work on the 2015 CRT
1994 # and we are hoping to be able to remove it if an additional feature
1995 # lands in the 2015 CRT API. For now, don't shim and revisit once
1996 # VS2015 is RTM: http://crbug.com/481611.
1997 'win_use_allocator_shim%': 0,
1999 ['component=="static_library"', {
2000 # Turn on multiple dll by default on Windows when in static_library.
2001 'chrome_multiple_dll%': 1,
2003 ['asan==1 or syzyasan==1', {
2004 'win_use_allocator_shim%': 0,
2009 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
2010 # Only enabled by default for ninja because it's buggy in VS.
2011 # Not enabled for component=static_library because some targets
2012 # are too large and the toolchain fails due to the size of the
2014 'incremental_chrome_dll%': 1,
2016 # Don't do incremental linking for large modules on 32-bit or when
2017 # component=static_library as the toolchain fails due to the size of
2019 ['MSVS_OS_BITS==32 or component=="static_library"', {
2020 'msvs_large_module_debug_link_mode%': '1', # No
2022 'msvs_large_module_debug_link_mode%': '2', # Yes
2025 'nacl_win64_defines': [
2026 # This flag is used to minimize dependencies when building
2027 # Native Client loader for 64-bit Windows.
2030 # Need to include allocator target, but exclude tcmalloc files.
2031 'use_allocator%': 'winheap',
2034 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
2040 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win") and chromecast==0', {
2041 'enable_pepper_cdms%': 1,
2043 'enable_pepper_cdms%': 0,
2046 ['OS=="android" or chromecast==1', {
2047 'enable_browser_cdms%': 1,
2049 'enable_browser_cdms%': 0,
2052 # Native Client glibc toolchain is enabled
2053 # by default except on arm, mips and mips64.
2054 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
2055 'disable_glibc%': 1,
2057 'disable_glibc%': 0,
2060 # Set the relative path from this file to the GYP file of the JPEG
2061 # library used by Chromium.
2062 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2063 # Configuration for using the system libjeg is here.
2064 'libjpeg_gyp_path': '<(libjpeg_ijg_gyp_path)',
2066 'libjpeg_gyp_path': '<(libjpeg_turbo_gyp_path)',
2069 # Options controlling the use of GConf (the classic GNOME configuration
2070 # system) and GIO, which contains GSettings (the new GNOME config system).
2071 ['chromeos==1 or embedded==1', {
2079 # Set up -D and -E flags passed into grit.
2080 ['branding=="Chrome"', {
2081 # TODO(mmoss) The .grd files look for _google_chrome, but for
2082 # consistency they should look for google_chrome_build like C++.
2083 'grit_defines': ['-D', '_google_chrome',
2084 '-E', 'CHROMIUM_BUILD=google_chrome'],
2086 'grit_defines': ['-D', '_chromium',
2087 '-E', 'CHROMIUM_BUILD=chromium'],
2090 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2092 ['desktop_linux==1', {
2093 'grit_defines': ['-D', 'desktop_linux'],
2095 ['toolkit_views==1', {
2096 'grit_defines': ['-D', 'toolkit_views'],
2099 'grit_defines': ['-D', 'use_aura'],
2102 'grit_defines': ['-D', 'use_ash'],
2104 ['use_nss_certs==1', {
2105 'grit_defines': ['-D', 'use_nss_certs'],
2108 'grit_defines': ['-D', 'use_ozone'],
2110 ['image_loader_extension==1', {
2111 'grit_defines': ['-D', 'image_loader_extension'],
2113 ['use_titlecase_in_grd==1', {
2114 'grit_defines': ['-D', 'use_titlecase'],
2119 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2120 '--no-output-all-resource-defines',
2123 ['OS=="mac" or OS=="ios"', {
2124 'grit_defines': ['-D', 'scale_factors=2x'],
2128 'enable_coverage%': 0,
2132 '--no-output-all-resource-defines',
2134 # iOS uses a whitelist to filter resources.
2135 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2137 # Enable host builds when generating with ninja-ios.
2139 ['"<(GENERATOR)"=="ninja"', {
2143 # Use the version of clang shipped with Xcode when building official
2144 # version of Chrome for iOS.
2146 # TODO(eugenebut): Remove enable_coverage check once
2147 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2148 # http://crbug.com/450379
2149 ['buildtype=="Official" or enable_coverage', {
2154 ['enable_extensions==1', {
2155 'grit_defines': ['-D', 'enable_extensions'],
2157 ['enable_plugins!=0', {
2158 'grit_defines': ['-D', 'enable_plugins'],
2160 ['enable_basic_printing==1 or enable_print_preview==1', {
2161 'grit_defines': ['-D', 'enable_printing'],
2163 ['enable_print_preview==1', {
2164 'grit_defines': ['-D', 'enable_print_preview'],
2166 ['enable_themes==1', {
2167 'grit_defines': ['-D', 'enable_themes'],
2169 ['enable_app_list==1', {
2170 'grit_defines': ['-D', 'enable_app_list'],
2172 ['enable_settings_app==1', {
2173 'grit_defines': ['-D', 'enable_settings_app'],
2175 ['enable_google_now==1', {
2176 'grit_defines': ['-D', 'enable_google_now'],
2178 ['use_concatenated_impulse_responses==1', {
2179 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2181 ['enable_media_router==1', {
2182 'grit_defines': ['-D', 'enable_media_router'],
2184 ['enable_webrtc==1', {
2185 'grit_defines': ['-D', 'enable_webrtc'],
2187 ['enable_hangout_services_extension==1', {
2188 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2190 ['enable_task_manager==1', {
2191 'grit_defines': ['-D', 'enable_task_manager'],
2193 ['notifications==1', {
2194 'grit_defines': ['-D', 'enable_notifications'],
2196 ['enable_wifi_bootstrapping==1', {
2197 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2199 ['mac_views_browser==1', {
2200 'grit_defines': ['-D', 'mac_views_browser'],
2202 ['enable_topchrome_md==1', {
2203 'grit_defines': ['-D', 'enable_topchrome_md'],
2205 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2206 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2208 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2209 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2211 ['enable_mdns==1 or OS=="mac"', {
2212 'grit_defines': ['-D', 'enable_service_discovery'],
2213 'enable_service_discovery%': 1
2215 ['clang_use_chrome_plugins==1', {
2221 ['OS=="mac" or OS=="ios"', {
2222 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2223 }, { # OS != "mac" or OS != "ios"
2224 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
2228 'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ',
2230 # On Windows, the plugin is built directly into clang, so there's
2231 # no need to load it dynamically.
2232 'clang_dynlib_flags%': '',
2234 # https://crbug.com/441916
2235 ['OS=="android" or OS=="linux" or OS=="mac"', {
2236 'clang_plugin_args%': '-Xclang -plugin-arg-find-bad-constructs -Xclang check-templates ',
2237 }, { # OS != "linux"
2238 'clang_plugin_args%': ''
2242 # If you change these, also change build/config/clang/BUILD.gn.
2243 'clang_chrome_plugins_flags%':
2244 '<(clang_dynlib_flags)'
2245 '-Xclang -add-plugin -Xclang find-bad-constructs <(clang_plugin_args)',
2247 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2249 'use_allocator%': 'none',
2250 'use_sanitizer_options%': 1,
2253 ['OS=="linux" and asan==0 and msan==0 and lsan==0 and tsan==0', {
2254 # PNaCl toolchain Non-SFI build only supports linux OS build.
2255 # Also, it does not support sanitizers.
2256 'enable_nacl_nonsfi_test%': 1,
2258 ['asan==1 and OS=="linux" and chromeos==0', {
2259 'use_custom_libcxx%': 1,
2267 ['asan==1 and OS=="mac"', {
2268 'mac_strip_release': 1,
2271 'use_custom_libcxx%': 1,
2274 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2275 # libstdc++. This is required to avoid false positive reports whenever
2276 # the C++ standard library is used.
2277 'use_custom_libcxx%': 1,
2278 # Running the V8-generated code on an ARM simulator is a powerful hack
2279 # that allows the tool to see the memory accesses from JITted code.
2280 # Without this flag, JS code causes false positive reports from MSan.
2281 'v8_target_arch': 'arm64',
2284 ['OS=="linux" and clang_type_profiler==1', {
2286 'clang_use_chrome_plugins%': 0,
2288 ['host_arch=="x64"', {
2289 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2291 ['host_arch=="ia32"', {
2292 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2293 # Clang in this directory at your own risk if needed for some
2294 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2295 # usage). Any failure by this compiler should not close the tree.
2296 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2301 # On valgrind bots, override the optimizer settings so we don't inline too
2302 # much and make the stacks harder to figure out.
2304 # TODO(rnk): Kill off variables that no one else uses and just implement
2305 # them under a build_for_tool== condition.
2306 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2308 'mac_debug_optimization': '1',
2309 'mac_release_optimization': '1',
2310 'release_optimize': '1',
2311 'no_gc_sections': 1,
2312 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2313 '-fno-builtin -fno-optimize-sibling-calls',
2314 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2315 '-fno-builtin -fno-optimize-sibling-calls',
2317 # MSVS flags for TSan on Pin and Windows.
2318 'win_debug_RuntimeChecks': '0',
2319 'win_debug_disable_iterator_debugging': '1',
2320 'win_debug_Optimization': '1',
2321 'win_debug_InlineFunctionExpansion': '0',
2322 'win_release_InlineFunctionExpansion': '0',
2323 'win_release_OmitFramePointers': '0',
2325 'use_allocator': 'tcmalloc',
2326 'release_valgrind_build': 1,
2328 'component': 'static_library',
2329 'use_system_zlib': 0,
2332 # Build tweaks for DrMemory.
2333 # TODO(rnk): Combine with tsan config to share the builder.
2334 # http://crbug.com/108155
2335 ['build_for_tool=="drmemory"', {
2336 # These runtime checks force initialization of stack vars which blocks
2337 # DrMemory's uninit detection.
2338 'win_debug_RuntimeChecks': '0',
2339 # Iterator debugging is slow.
2340 'win_debug_disable_iterator_debugging': '1',
2341 # Try to disable optimizations that mess up stacks in a release build.
2342 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2343 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2344 # compiler bug, so we use /Ob1 instead.
2345 'win_release_InlineFunctionExpansion': '1',
2346 'win_release_OmitFramePointers': '0',
2347 # Ditto for debug, to support bumping win_debug_Optimization.
2348 'win_debug_InlineFunctionExpansion': 0,
2349 'win_debug_OmitFramePointers': 0,
2350 # Keep the code under #ifndef NVALGRIND.
2351 'release_valgrind_build': 1,
2354 # RLZ library is used on Win, Mac, iOS and ChromeOS.
2355 ['OS=="win" or OS=="mac" or OS=="ios" or chromeos==1', {
2356 'enable_rlz_support%': 1,
2358 # RLZ is enabled for "Chrome" builds.
2359 ['branding=="Chrome"', {
2365 # Set default compiler flags depending on ARM version.
2366 ['arm_version==6', {
2367 'arm_arch%': 'armv6',
2370 'arm_float_abi%': 'softfp',
2373 ['arm_version==7', {
2374 'arm_arch%': 'armv7-a',
2375 'arm_tune%': 'generic-armv7-a',
2380 'arm_fpu%': 'vfpv3-d16',
2383 'arm_float_abi%': 'softfp',
2385 'arm_float_abi%': 'hard',
2391 # Set default compiler flags for MIPS floating-point support.
2392 ['target_arch=="mipsel"', {
2393 'mips_float_abi%': 'hard',
2395 ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
2396 'mips_fpu_mode%': 'fp32',
2398 'mips_fpu_mode%': '',
2401 # Enable brlapi by default for chromeos.
2406 ['use_ozone==1 and ozone_auto_platforms==1', {
2407 # Use test as the default platform.
2408 'ozone_platform%': 'test',
2410 # Build all platforms whose deps are in install-build-deps.sh.
2411 # Only these platforms will be compile tested by buildbots.
2412 'ozone_platform_drm%': 1,
2413 'ozone_platform_test%': 1,
2414 'ozone_platform_egltest%': 1,
2417 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2418 'use_clipboard_aurax11%': 1,
2421 ['OS=="win" and use_goma==1', {
2422 # goma doesn't support pch yet.
2423 'chromium_win_pch': 0,
2424 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2426 ['win_z7==0 and fastbuild==0', {
2432 ['OS=="win" and (clang==1 or asan==1)', {
2433 'chromium_win_pch': 0,
2437 'host_cc': '<(make_clang_dir)/bin/clang',
2438 'host_cxx': '<(make_clang_dir)/bin/clang++',
2440 'host_cc': '<!(which gcc)',
2441 'host_cxx': '<!(which g++)',
2444 # The seccomp-bpf sandbox is only supported on five architectures
2446 # Do not disable seccomp_bpf anywhere without talking to
2447 # security@chromium.org!
2448 ['((OS=="linux" or OS=="android") and '
2449 '(target_arch=="ia32" or target_arch=="x64" or '
2450 'target_arch=="arm" or target_arch=="mipsel" or '
2451 'target_arch=="arm64"))', {
2452 'use_seccomp_bpf%': 1,
2454 'use_seccomp_bpf%': 0,
2461 ['branding=="Chrome" and buildtype=="Official"', {
2462 'enable_hangout_services_extension%': 1,
2464 'enable_hangout_services_extension%': 0,
2468 # The path to the ANGLE library.
2469 'angle_path': '<(DEPTH)/third_party/angle',
2471 # List of default apps to install in new profiles. The first list contains
2472 # the source files as found in svn. The second list, used only for linux,
2473 # contains the destination location for each of the files. When a crx
2474 # is added or removed from the list, the chrome/browser/resources/
2475 # default_apps/external_extensions.json file must also be updated.
2477 # README: GN version of these is in the target //chrome:default_apps
2478 # (there's no global variable like in GYP). Be sure to update that target
2479 # if you change these lists!
2480 'default_apps_list': [
2481 'browser/resources/default_apps/external_extensions.json',
2482 'browser/resources/default_apps/gmail.crx',
2483 'browser/resources/default_apps/search.crx',
2484 'browser/resources/default_apps/youtube.crx',
2485 'browser/resources/default_apps/drive.crx',
2486 'browser/resources/default_apps/docs.crx',
2488 'default_apps_list_linux_dest': [
2489 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2490 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2491 '<(PRODUCT_DIR)/default_apps/search.crx',
2492 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2493 '<(PRODUCT_DIR)/default_apps/drive.crx',
2494 '<(PRODUCT_DIR)/default_apps/docs.crx',
2497 # Whether to allow building of the GPU-related isolates.
2498 'archive_gpu_tests%': 0,
2500 # Whether to allow building of chromoting related isolates.
2501 'archive_chromoting_tests%': 0,
2503 # Whether to allow building of Media Router related isolates.
2504 'archive_media_router_tests%': 0,
2506 'target_defaults': {
2508 # The condition that operates on chromium_code is in a target_conditions
2509 # section, and will not have access to the default fallback value of
2510 # chromium_code at the top of this file, or to the chromium_code
2511 # variable placed at the root variables scope of .gyp files, because
2512 # those variables are not set at target scope. As a workaround,
2513 # if chromium_code is not set at target scope, define it in target scope
2514 # to contain whatever value it has during early variable expansion.
2515 # That's enough to make it available during target conditional
2517 'chromium_code%': '<(chromium_code)',
2519 'component%': '<(component)',
2521 'chromecast%': '<(chromecast)',
2523 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2524 'win_release_Optimization%': '2', # 2 = /O2
2525 'win_debug_Optimization%': '0', # 0 = /Od
2527 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2528 # Tri-state: blank is default, 1 on, 0 off
2529 'win_release_OmitFramePointers%': '0',
2530 # Tri-state: blank is default, 1 on, 0 off
2531 'win_debug_OmitFramePointers%': '',
2533 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2534 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2536 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2537 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2538 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2540 # VS inserts quite a lot of extra checks to algorithms like
2541 # std::partial_sort in Debug build which make them O(N^2)
2542 # instead of O(N*logN). This is particularly slow under memory
2543 # tools like ThreadSanitizer so we want it to be disablable.
2544 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2545 'win_debug_disable_iterator_debugging%': '0',
2547 # An application manifest fragment to declare compatibility settings for
2548 # 'executable' targets. Ignored in other target type.
2549 'win_exe_compatibility_manifest%':
2550 '<(DEPTH)\\build\\win\\compatibility.manifest',
2552 'release_extra_cflags%': '',
2553 'debug_extra_cflags%': '',
2555 'release_valgrind_build%': '<(release_valgrind_build)',
2557 # the non-qualified versions are widely assumed to be *nix-only
2558 'win_release_extra_cflags%': '',
2559 'win_debug_extra_cflags%': '',
2561 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2562 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2564 # Only used by Windows build for now. Can be used to build into a
2565 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2566 # output files in src/build/VS2010_{Debug,Release}.
2567 'build_dir_prefix%': '',
2569 # Targets are by default not nacl untrusted code.
2570 'nacl_untrusted_build%': 0,
2572 'pnacl_compile_flags': [
2573 # pnacl uses the clang compiler so we need to suppress all the
2574 # same warnings as we do for clang.
2575 # TODO(sbc): Remove these if/when they are removed from the clang
2577 '-Wno-unused-function',
2578 '-Wno-char-subscripts',
2579 '-Wno-c++11-extensions',
2580 '-Wno-unnamed-type-template-args',
2583 # By default, Android targets have their exported JNI symbols stripped,
2584 # so we test the manual JNI registration code paths that are required
2585 # when using the crazy linker. To allow use of native JNI exports (lazily
2586 # resolved by the JVM), targets can enable this variable, which will stop
2587 # the stripping from happening. Only targets which do not need to be
2588 # compatible with the crazy linker are permitted to set this.
2589 'use_native_jni_exports%': 0,
2592 ['OS=="win" and component=="shared_library"', {
2593 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2594 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2595 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2597 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2598 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2599 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2602 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2603 'mac_release_optimization%': 's', # Use -Os unless overridden
2604 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2606 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2607 'mac_release_optimization%': '2', # Use -O2 unless overridden
2608 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2611 'host_os%': '<(host_os)', # See comment above chromium_code.
2614 'clang_warning_flags': [
2617 # Don't die on dtoa code that uses a char as an array index.
2618 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2619 '-Wno-char-subscripts',
2621 # TODO(thakis): This used to be implied by -Wno-unused-function,
2622 # which we no longer use. Check if it makes sense to remove
2623 # this as well. http://crbug.com/316352
2624 '-Wno-unneeded-internal-declaration',
2626 # Warns on switches on enums that cover all enum values but
2627 # also contain a default: branch. Chrome is full of that.
2628 '-Wno-covered-switch-default',
2630 # Warns when a const char[] is converted to bool.
2631 '-Wstring-conversion',
2633 # C++11-related flags:
2635 # This warns on using ints as initializers for floats in
2636 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2637 # which happens in several places in chrome code. Not sure if
2638 # this is worth fixing.
2639 '-Wno-c++11-narrowing',
2641 # Clang considers the `register` keyword as deprecated, but e.g.
2642 # code generated by flex (used in angle) contains that keyword.
2643 # http://crbug.com/255186
2644 '-Wno-deprecated-register',
2646 # TODO(hans): Get this cleaned up, http://crbug.com/428099
2647 '-Wno-inconsistent-missing-override',
2649 # TODO(thakis): Enable this, crbug.com/507717
2650 '-Wno-shift-negative-value',
2653 'includes': [ 'set_clang_warning_flags.gypi', ],
2655 # Don't use deprecated V8 APIs anywhere.
2656 'V8_DEPRECATION_WARNINGS',
2657 'CLD_VERSION=<(cld_version)',
2660 '<(SHARED_INTERMEDIATE_DIR)',
2664 # When compiling Objective C, warns if a method is used whose
2665 # availability is newer than the deployment target.
2666 'xcode_settings': { 'WARNING_CFLAGS': ['-Wpartial-availability']},
2668 ['(OS=="mac" or OS=="ios") and asan==1', {
2670 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2673 ['OS=="win" and asan==1 and component=="shared_library"', {
2675 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2678 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2679 'cflags_cc!': ['-fno-rtti'],
2682 '-gline-tables-only',
2683 '-fintercept-allocation-functions',
2685 'defines': ['TYPE_PROFILING'],
2687 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2690 ['branding=="Chrome"', {
2691 'defines': ['GOOGLE_CHROME_BUILD'],
2692 }, { # else: branding!="Chrome"
2693 'defines': ['CHROMIUM_BUILD'],
2695 ['OS=="mac" and component=="shared_library"', {
2697 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2698 'LD_RUNPATH_SEARCH_PATHS': [
2699 # For unbundled binaries.
2701 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2702 '@loader_path/../../..',
2706 ['clang==1 or host_clang==1', {
2707 # This is here so that all files get recompiled after a clang roll and
2708 # when turning clang on or off.
2709 # (defines are passed via the command line, and build systems rebuild
2710 # things when their commandline changes). Nothing should ever read this
2712 'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
2715 'defines': ['ENABLE_RLZ'],
2717 ['component=="shared_library"', {
2718 'defines': ['COMPONENT_BUILD'],
2720 ['ui_compositor_image_transport==1', {
2721 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2724 'defines': ['USE_AURA=1'],
2727 'defines': ['USE_ASH=1'],
2730 'defines': ['USE_PANGO=1'],
2733 'defines': ['USE_CAIRO=1'],
2736 'defines': ['USE_CRAS=1'],
2739 'defines': ['USE_OZONE=1'],
2741 ['use_default_render_theme==1', {
2742 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2744 ['use_libjpeg_turbo==1', {
2745 'defines': ['USE_LIBJPEG_TURBO=1'],
2748 'defines': ['USE_X11=1'],
2750 ['use_clipboard_aurax11==1', {
2751 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2753 ['enable_one_click_signin==1', {
2754 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2756 ['enable_pre_sync_backup==1', {
2757 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2759 ['image_loader_extension==1', {
2760 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2763 'defines': ['ENABLE_PROFILING=1'],
2765 ['enable_webrtc==1', {
2766 'defines': ['ENABLE_WEBRTC=1'],
2768 ['enable_media_router==1', {
2769 'defines': ['ENABLE_MEDIA_ROUTER=1'],
2771 ['proprietary_codecs==1', {
2772 'defines': ['USE_PROPRIETARY_CODECS'],
2774 ['enable_mpeg2ts_stream_parser==1', {
2775 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2779 ['enable_viewport==1', {
2780 'defines': ['ENABLE_VIEWPORT'],
2782 ['enable_pepper_cdms==1', {
2783 'defines': ['ENABLE_PEPPER_CDMS'],
2785 ['enable_browser_cdms==1', {
2786 'defines': ['ENABLE_BROWSER_CDMS'],
2788 ['configuration_policy==1', {
2789 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2791 ['notifications==1', {
2792 'defines': ['ENABLE_NOTIFICATIONS'],
2794 ['enable_hidpi==1', {
2795 'defines': ['ENABLE_HIDPI=1'],
2797 ['enable_topchrome_md==1', {
2798 'defines': ['ENABLE_TOPCHROME_MD=1'],
2800 ['native_memory_pressure_signals==1', {
2801 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2804 'defines': ['USE_UDEV'],
2808 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2811 ['OS=="win" and fastbuild==2', {
2812 # Completely disable debug information.
2815 'GenerateDebugInformation': 'false',
2817 'VCCLCompilerTool': {
2818 'DebugInformationFormat': '0',
2822 ['OS=="win" and fastbuild==1', {
2825 # This tells the linker to generate .pdbs, so that
2826 # we can get meaningful stack traces.
2827 'GenerateDebugInformation': 'true',
2829 'VCCLCompilerTool': {
2830 # No debug info to be generated by compiler.
2831 'DebugInformationFormat': '0',
2835 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2836 'variables': { 'debug_extra_cflags': '-g0', },
2838 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2839 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2841 'variables': { 'debug_extra_cflags': '-g0', },
2843 # Android builds symbols on release by default, disable them.
2844 ['OS=="android" and fastbuild==2', {
2845 'variables': { 'release_extra_cflags': '-g0', },
2847 ['OS=="android" and fastbuild==1', {
2848 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2850 'variables': { 'release_extra_cflags': '-g0', },
2854 ['dont_embed_build_metadata==1', {
2856 'DONT_EMBED_BUILD_METADATA',
2858 }], # dont_embed_build_metadata==1
2859 ['dcheck_always_on!=0', {
2860 'defines': ['DCHECK_ALWAYS_ON=1'],
2861 }], # dcheck_always_on!=0
2862 ['tracing_like_official_build!=0', {
2863 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2864 }], # tracing_like_official_build!=0
2865 ['fieldtrial_testing_like_official_build==0 and branding!="Chrome"', {
2866 'defines': ['FIELDTRIAL_TESTING_ENABLED'],
2867 }], # fieldtrial_testing_like_official_build==0 and branding!="Chrome"
2869 'defines': ['NO_TCMALLOC'],
2871 ['win_use_allocator_shim==1', {
2872 'defines': ['ALLOCATOR_SHIM'],
2878 'ADDRESS_SANITIZER',
2879 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2880 'MEMORY_SANITIZER_INITIAL_SIZE',
2884 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2892 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2893 'MEMORY_SANITIZER_INITIAL_SIZE',
2901 '<(DEPTH)/third_party/kasko/include',
2907 '_CRT_SECURE_NO_DEPRECATE',
2908 '_SCL_SECURE_NO_DEPRECATE',
2909 # This define is required to pull in the new Win8 interfaces from
2910 # system headers like ShObjIdl.h.
2911 'NTDDI_VERSION=0x06030000',
2912 # This is required for ATL to use XP-safe versions of its functions.
2913 '_USING_V110_SDK71_',
2916 '<(DEPTH)/third_party/wtl/include',
2921 # Generates debug info when win_z7=1
2922 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2924 'GenerateDebugInformation': 'true',
2926 'VCCLCompilerTool': {
2927 'DebugInformationFormat': '1',
2933 # This is prohibited when running /analyze.
2934 '_USING_V110_SDK71_',
2937 'VCCLCompilerTool': {
2938 # Set WarnAsError to false to disable this setting for most
2939 # projects so that compilation continues.
2940 'WarnAsError': 'false',
2941 # When win_analyze is specified add the /analyze switch.
2942 # Also add /WX- to force-disable WarnAsError for projects that
2943 # override WarnAsError.
2944 # Also, disable various noisy warnings that have low value.
2945 'AdditionalOptions': [
2947 '/wd6011', # Dereferencing NULL pointer
2948 '/wd6312', # Possible infinite loop: use of the constant
2949 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2950 '/wd6326', # Potential comparison of constant with constant
2951 '/wd28159', # Consider using 'GetTickCount64'
2952 '/wd28204', # Inconsistent SAL annotations
2953 '/wd28251', # Inconsistent SAL annotations
2954 '/wd28252', # Inconsistent SAL annotations
2955 '/wd28253', # Inconsistent SAL annotations
2956 '/wd28196', # The precondition is not satisfied
2957 '/wd28301', # Inconsistent SAL annotations
2958 '/wd6340', # Sign mismatch in function parameter
2959 '/wd28182', # Dereferencing NULL pointer
2960 # C6285 is ~16% of raw warnings and has low value
2961 '/wd6285', # non-zero constant || non-zero constant
2962 # C6334 is ~80% of raw warnings and has low value
2963 '/wd6334', # sizeof applied to an expression with an operator
2975 ['use_playready==1', {
2977 'PLAYREADY_CDM_AVAILABLE',
2982 ['enable_task_manager==1', {
2984 'ENABLE_TASK_MANAGER=1',
2987 ['enable_extensions==1', {
2989 'ENABLE_EXTENSIONS=1',
2992 ['OS=="win" and branding=="Chrome"', {
2993 'defines': ['ENABLE_SWIFTSHADER'],
2995 ['enable_dart==1', {
2996 'defines': ['WEBKIT_USING_DART=1'],
2999 'defines': ['ENABLE_PDF=1'],
3001 ['enable_plugin_installation==1', {
3002 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
3004 ['enable_plugins==1', {
3005 'defines': ['ENABLE_PLUGINS=1'],
3007 ['enable_session_service==1', {
3008 'defines': ['ENABLE_SESSION_SERVICE=1'],
3010 ['enable_themes==1', {
3011 'defines': ['ENABLE_THEMES=1'],
3013 ['enable_autofill_dialog==1', {
3014 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
3016 ['enable_prod_wallet_service==1', {
3017 # In GN, this is set on the autofill tagets only. See
3018 # //components/autofill/core/browser:wallet_service
3019 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
3021 ['enable_background==1', {
3022 'defines': ['ENABLE_BACKGROUND=1'],
3024 ['enable_google_now==1', {
3025 'defines': ['ENABLE_GOOGLE_NOW=1'],
3027 ['enable_basic_printing==1 or enable_print_preview==1', {
3028 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
3029 'defines': ['ENABLE_PRINTING=1'],
3031 ['enable_basic_printing==1', {
3032 # Enable basic printing support and UI.
3033 'defines': ['ENABLE_BASIC_PRINTING=1'],
3035 ['enable_print_preview==1', {
3036 # Enable printing with print preview.
3037 # Can be defined without ENABLE_BASIC_PRINTING.
3038 'defines': ['ENABLE_PRINT_PREVIEW=1'],
3040 ['enable_spellcheck==1', {
3041 'defines': ['ENABLE_SPELLCHECK=1'],
3043 ['use_browser_spellchecker', {
3044 'defines': ['USE_BROWSER_SPELLCHECKER=1'],
3046 ['enable_captive_portal_detection==1', {
3047 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
3049 ['enable_app_list==1', {
3050 'defines': ['ENABLE_APP_LIST=1'],
3052 ['enable_settings_app==1', {
3053 'defines': ['ENABLE_SETTINGS_APP=1'],
3055 ['disable_file_support==1', {
3056 'defines': ['DISABLE_FILE_SUPPORT=1'],
3058 ['disable_ftp_support==1', {
3059 'defines': ['DISABLE_FTP_SUPPORT=1'],
3061 ['enable_supervised_users==1', {
3062 'defines': ['ENABLE_SUPERVISED_USERS=1'],
3064 ['enable_mdns==1', {
3065 'defines': ['ENABLE_MDNS=1'],
3067 ['enable_service_discovery==1', {
3068 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
3070 ['enable_wifi_bootstrapping==1', {
3071 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
3073 ['enable_hangout_services_extension==1', {
3074 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
3076 ['enable_ipc_fuzzer==1', {
3077 'defines': ['ENABLE_IPC_FUZZER=1'],
3080 'defines': ['VIDEO_HOLE=1'],
3082 ['v8_use_external_startup_data==1', {
3083 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
3085 ['enable_webvr==1', {
3086 'defines': ['ENABLE_WEBVR'],
3089 # SAFE_BROWSING_SERVICE - browser manages a safe-browsing service.
3090 # SAFE_BROWSING_DB_LOCAL - service manages a local database.
3091 # SAFE_BROWSING_DB_REMOTE - service talks via API to a database
3092 # SAFE_BROWSING_CSD - enable client-side phishing detection.
3093 ['safe_browsing==1', {
3095 # TODO(nparker): Remove existing uses of FULL_SAFE_BROWSING
3096 'FULL_SAFE_BROWSING',
3097 'SAFE_BROWSING_CSD',
3098 'SAFE_BROWSING_DB_LOCAL',
3099 'SAFE_BROWSING_SERVICE',
3102 ['safe_browsing==2', {
3104 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3105 'MOBILE_SAFE_BROWSING',
3106 'SAFE_BROWSING_SERVICE',
3109 ['safe_browsing==3', {
3111 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3112 'MOBILE_SAFE_BROWSING',
3113 'SAFE_BROWSING_DB_REMOTE',
3114 'SAFE_BROWSING_SERVICE',
3117 ], # conditions for 'target_defaults'
3118 'target_conditions': [
3119 ['<(use_libpci)==1', {
3120 'defines': ['USE_LIBPCI=1'],
3122 ['<(use_openssl)==1', {
3123 'defines': ['USE_OPENSSL=1'],
3125 ['<(use_openssl_certs)==1', {
3126 'defines': ['USE_OPENSSL_CERTS=1'],
3128 ['>(nacl_untrusted_build)==1', {
3131 'USE_OPENSSL_CERTS=1',
3134 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3135 'defines': ['USE_GLIB=1'],
3137 ['<(use_nss_certs)==1 and >(nacl_untrusted_build)==0', {
3138 'defines': ['USE_NSS_CERTS=1'],
3140 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3141 'defines': ['OS_CHROMEOS=1'],
3143 ['enable_wexit_time_destructors==1 and OS!="win"', {
3144 # TODO: Enable on Windows too, http://crbug.com/404525
3145 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3147 ['chromium_code==0', {
3149 'clang_warning_flags': [
3150 # TODO(thakis): Move this suppression into individual third-party
3151 # libraries as required. http://crbug.com/505316.
3152 '-Wno-unused-function',
3153 # Lots of third-party libraries have unused variables. Instead of
3154 # suppressing them individually, we just blanket suppress them here.
3155 '-Wno-unused-variable',
3159 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3160 # We don't want to get warnings from third-party code,
3161 # so remove any existing warning-enabling flags like -Wall.
3167 # Don't warn about hash_map in third-party code.
3171 # Don't warn about printf format problems.
3172 # This is off by default in gcc but on in Ubuntu's gcc(!).
3176 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3180 # TODO: Fix all warnings on chromeos too.
3181 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3186 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3188 # Don't warn about ignoring the return value from e.g. close().
3189 # This is off by default in some gccs but on by default in others.
3190 # BSD systems do not support this option, since they are usually
3191 # using gcc 4.2.1, which does not have this flag yet.
3192 '-Wno-unused-result',
3197 '_CRT_SECURE_NO_DEPRECATE',
3198 '_CRT_NONSTDC_NO_WARNINGS',
3199 '_CRT_NONSTDC_NO_DEPRECATE',
3200 '_SCL_SECURE_NO_DEPRECATE',
3202 'msvs_disabled_warnings': [
3206 'VCCLCompilerTool': {
3207 'WarningLevel': '3',
3208 'WarnAsError': 'true',
3209 'Detect64BitPortabilityProblems': 'false',
3213 ['buildtype=="Official"', {
3215 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3218 [ 'component=="shared_library"', {
3219 # TODO(darin): Unfortunately, some third_party code depends on base.
3220 'msvs_disabled_warnings': [
3221 4251, # class 'std::xx' needs to have dll-interface.
3227 [ 'OS=="mac" or OS=="ios"', {
3229 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3232 ['buildtype=="Official"', {
3234 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3241 # TODO(ios): Fix remaining warnings in third-party code, then
3242 # remove this; the Mac cleanup didn't get everything that's
3243 # flagged in an iOS build.
3244 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3245 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3246 # Several internal ios directories generate numerous warnings for
3247 # -Wobjc-missing-property-synthesis.
3248 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3254 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3255 'filename_rules.gypi',
3257 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3258 # C99 macros on Mac and Linux.
3260 '__STDC_CONSTANT_MACROS',
3261 '__STDC_FORMAT_MACROS',
3265 # turn on warnings for signed/unsigned mismatch on chromium code.
3267 'VCCLCompilerTool': {
3268 'AdditionalOptions': ['/we4389'],
3272 ['OS=="win" and component=="shared_library"', {
3273 'msvs_disabled_warnings': [
3274 4251, # class 'std::xx' needs to have dll-interface.
3279 ], # target_conditions for 'target_defaults'
3280 'default_configuration': 'Debug',
3282 # VCLinkerTool LinkIncremental values below:
3284 # 1 == /INCREMENTAL:NO
3286 # Debug links incremental, Release does not.
3288 # Abstract base configurations to cover common attributes.
3292 'msvs_configuration_attributes': {
3293 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3294 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3295 'CharacterSet': '1',
3298 'VCCLCompilerTool': {
3299 'AdditionalOptions': [
3304 # Add the default import libs.
3305 'AdditionalDependencies': [
3322 'AdditionalOptions': [
3323 # Suggested by Microsoft Devrel to avoid
3324 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3325 # which started happening more regularly after VS2013 Update 4.
3326 # Needs to be a bit lower for VS2015, or else errors out.
3327 '/maxilksize:0x7ff00000',
3332 ['OS=="win" and win_fastlink==1', {
3335 # /PROFILE is incompatible with /debug:fastlink
3337 'AdditionalOptions': [
3338 # Tell VS 2015+ to create a PDB that references debug
3339 # information in .obj and .lib files instead of copying
3346 ['OS=="win" and MSVS_VERSION == "2015"', {
3348 'VCCLCompilerTool': {
3349 'AdditionalOptions': [
3350 # Work around crbug.com/526851, bug in VS 2015 RTM compiler.
3351 '/Zc:sizedDealloc-',
3362 'MinimumRequiredVersion': '5.01', # XP.
3363 'TargetMachine': '1',
3365 'VCLibrarianTool': {
3366 'TargetMachine': '1',
3369 'msvs_configuration_platform': 'Win32',
3373 'msvs_configuration_platform': 'x64',
3376 # Make sure to understand http://crbug.com/361720 if you want to
3378 'MinimumRequiredVersion': '5.02', # Server 2003.
3379 'TargetMachine': '17', # x86 - 64
3380 'AdditionalLibraryDirectories!':
3381 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3382 'AdditionalLibraryDirectories':
3383 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3384 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3385 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3387 'VCLibrarianTool': {
3388 'AdditionalLibraryDirectories!':
3389 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3390 'AdditionalLibraryDirectories':
3391 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3392 'TargetMachine': '17', # x64
3399 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3400 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3403 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3405 '<@(debug_extra_cflags)',
3409 'VCCLCompilerTool': {
3410 'Optimization': '<(win_debug_Optimization)',
3411 'PreprocessorDefinitions': ['_DEBUG'],
3412 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3413 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3415 # According to MSVS, InlineFunctionExpansion=0 means
3416 # "default inlining", not "/Ob0".
3417 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3418 ['win_debug_InlineFunctionExpansion==0', {
3419 'AdditionalOptions': ['/Ob0'],
3421 ['win_debug_InlineFunctionExpansion!=""', {
3422 'InlineFunctionExpansion':
3423 '<(win_debug_InlineFunctionExpansion)',
3425 ['win_debug_disable_iterator_debugging==1', {
3426 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3429 # if win_debug_OmitFramePointers is blank, leave as default
3430 ['win_debug_OmitFramePointers==1', {
3431 'OmitFramePointers': 'true',
3433 ['win_debug_OmitFramePointers==0', {
3434 'OmitFramePointers': 'false',
3435 # The above is not sufficient (http://crbug.com/106711): it
3436 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3437 # perform FPO regardless, so we must explicitly disable.
3438 # We still want the false setting above to avoid having
3439 # "/Oy /Oy-" and warnings about overriding.
3440 'AdditionalOptions': ['/Oy-'],
3443 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3446 'LinkIncremental': '<(msvs_debug_link_incremental)',
3447 # ASLR makes debugging with windbg difficult because Chrome.exe and
3448 # Chrome.dll share the same base name. As result, windbg will
3449 # name the Chrome.dll module like chrome_<base address>, where
3450 # <base address> typically changes with each launch. This in turn
3451 # means that breakpoints in Chrome.dll don't stick from one launch
3452 # to the next. For this reason, we turn ASLR off in debug builds.
3453 # Note that this is a three-way bool, where 0 means to pick up
3454 # the default setting, 1 is off and 2 is on.
3455 'RandomizedBaseAddress': 1,
3457 'VCResourceCompilerTool': {
3458 'PreprocessorDefinitions': ['_DEBUG'],
3462 ['OS=="linux" or OS=="android"', {
3463 'target_conditions': [
3464 ['_toolset=="target"', {
3466 '<@(debug_extra_cflags)',
3471 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3472 # Enable libstdc++ debugging facilities to help catch problems
3473 # early, see http://crbug.com/65151 .
3474 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3475 'defines': ['_GLIBCXX_DEBUG=1',],
3477 ['release_valgrind_build==0', {
3480 '-fstack-protector-all', # Implies -fstack-protector
3486 # Allow comparing the address of references and 'this' against 0
3487 # in debug builds. Technically, these can never be null in
3488 # well-defined C/C++ and Clang can optimize such checks away in
3489 # release builds, but they may be used in asserts in debug builds.
3490 '-Wno-undefined-bool-conversion',
3491 '-Wno-tautological-undefined-compare',
3495 '-Wno-undefined-bool-conversion',
3496 '-Wno-tautological-undefined-compare',
3500 'VCCLCompilerTool': {
3501 'AdditionalOptions': [
3502 '-Wno-undefined-bool-conversion',
3503 '-Wno-tautological-undefined-compare',
3516 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3517 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3518 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3521 'VCCLCompilerTool': {
3522 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3524 # In official builds, each target will self-select
3525 # an optimization level.
3526 ['buildtype!="Official"', {
3527 'Optimization': '<(win_release_Optimization)',
3530 # According to MSVS, InlineFunctionExpansion=0 means
3531 # "default inlining", not "/Ob0".
3532 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3533 ['win_release_InlineFunctionExpansion==0', {
3534 'AdditionalOptions': ['/Ob0'],
3536 ['win_release_InlineFunctionExpansion!=""', {
3537 'InlineFunctionExpansion':
3538 '<(win_release_InlineFunctionExpansion)',
3541 # if win_release_OmitFramePointers is blank, leave as default
3542 ['win_release_OmitFramePointers==1', {
3543 'OmitFramePointers': 'true',
3545 ['win_release_OmitFramePointers==0', {
3546 'OmitFramePointers': 'false',
3547 # The above is not sufficient (http://crbug.com/106711): it
3548 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3549 # perform FPO regardless, so we must explicitly disable.
3550 # We still want the false setting above to avoid having
3551 # "/Oy /Oy-" and warnings about overriding.
3552 'AdditionalOptions': ['/Oy-'],
3555 # Put data in separate COMDATs. This allows the linker
3556 # to put bit-identical constants at the same address even if
3557 # they're unrelated constants, which saves binary size.
3558 # This optimization can't be used when ASan is enabled because
3559 # it is not compatible with the ASan ODR checker.
3560 'AdditionalOptions': ['/Gw'],
3563 'AdditionalOptions': [
3564 '/d2Zi+', # Improve debugging of Release builds.
3565 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3566 '<@(win_release_extra_cflags)',
3570 # LinkIncremental is a tri-state boolean, where 0 means default
3571 # (i.e., inherit from parent solution), 1 means false, and
3573 'LinkIncremental': '1',
3574 # This corresponds to the /PROFILE flag which ensures the PDB
3575 # file contains FIXUP information (growing the PDB file by about
3576 # 5%) but does not otherwise alter the output binary. This
3577 # information is used by the Syzygy optimization tool when
3578 # decomposing the release image.
3583 ['msvs_use_common_release', {
3584 'includes': ['release.gypi'],
3586 ['release_valgrind_build==0 and tsan==0', {
3589 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3593 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3594 'MEMORY_SANITIZER_INITIAL_SIZE',
3595 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3596 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3600 'defines': ['NO_TCMALLOC'],
3602 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3603 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3604 # It seems to work fine with Ubuntu 12 headers though, so use it
3605 # in official builds.
3606 ['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")', {
3607 'target_conditions': [
3608 ['chromium_code==1', {
3609 # Non-chromium code is not guaranteed to compile cleanly
3610 # with _FORTIFY_SOURCE. Also, fortified build may fail
3611 # when optimizations are disabled, so only do that for Release
3614 '_FORTIFY_SOURCE=2',
3619 ['OS=="linux" or OS=="android"', {
3620 'target_conditions': [
3621 ['_toolset=="target"', {
3623 '<@(release_extra_cflags)',
3626 ['enable_resource_whitelist_generation==1', {
3628 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3637 'NS_BLOCK_ASSERTIONS=1',
3643 # Concrete configurations
3646 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3649 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3654 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3655 'target_conditions': [
3656 [ '_type=="executable"', {
3657 # To get a real .dSYM bundle produced by dsymutil, set the
3658 # debug information format to dwarf-with-dsym. Since
3659 # strip_from_xcode will not be used, set Xcode to do the
3660 # stripping as well.
3662 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3663 'DEPLOYMENT_POSTPROCESSING': 'YES',
3664 'STRIP_INSTALLED_PRODUCT': 'YES',
3671 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3673 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3676 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3684 'target_defaults': {
3689 # TODO(glider): enable the default options on other systems.
3691 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3693 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3699 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3700 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3701 'target_defaults': {
3703 '-Wl,--fatal-warnings',
3707 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3708 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0 and cfi_diag==0', {
3709 'target_defaults': {
3715 ['os_posix==1 and chromeos==0', {
3716 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3717 # and we want to avoid overriding this, so stack-protector is only
3718 # enabled when not building on Chrome OS.
3719 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3721 'target_defaults': {
3723 '-fstack-protector',
3724 '--param=ssp-buffer-size=4',
3728 ['os_posix==1 and OS=="linux"', {
3730 '_LARGEFILE_SOURCE',
3731 '_LARGEFILE64_SOURCE',
3732 '_FILE_OFFSET_BITS=64',
3735 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3736 'target_defaults': {
3737 # Enable -Werror by default, but put it in a variable so it can
3738 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3740 'werror%': '-Werror',
3741 'libraries_for_target%': '',
3744 '_FILE_OFFSET_BITS=64',
3747 '<(werror)', # See note above about the werror variable.
3749 '-fno-strict-aliasing', # See http://crbug.com/32204
3751 # Don't warn about unused function params. We use those everywhere.
3752 '-Wno-unused-parameter',
3753 # Don't warn about the "struct foo f = {0};" initialization pattern.
3754 '-Wno-missing-field-initializers',
3755 # Don't export any symbols (for example, to plugins we dlopen()).
3756 # Note: this is *required* to make some plugins work.
3757 '-fvisibility=hidden',
3763 '-fno-threadsafe-statics',
3764 # Make inline functions have hidden visiblity by default.
3765 # Surprisingly, not covered by -fvisibility=hidden.
3766 '-fvisibility-inlines-hidden',
3767 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3768 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3772 '-pthread', '-Wl,-z,noexecstack',
3775 '<(libraries_for_target)',
3780 'debug_optimize%': '0',
3786 '-O>(debug_optimize)',
3790 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3791 # TODO(jdduke) Re-enable on mips after resolving linking
3792 # issues with libc++ (crbug.com/456380).
3794 # Warn in case of text relocations.
3795 '-Wl,--warn-shared-textrel',
3798 ['OS=="android" and android_full_debug==0', {
3799 # Some configurations are copied from Release_Base to reduce
3802 'debug_optimize%': 's',
3806 '-ffunction-sections',
3813 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3814 # We don't omit frame pointers on arm64 since they are required
3815 # to correctly unwind stackframes which contain system library
3816 # function frames (crbug.com/391706).
3818 '-fomit-frame-pointer',
3821 ['OS=="linux" and target_arch=="ia32"', {
3823 '-Wl,--no-as-needed',
3826 ['debug_unwind_tables==1', {
3827 'cflags': ['-funwind-tables'],
3829 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3830 'defines': ['NO_UNWIND_TABLES'],
3832 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3833 # definitions in to the right scope to use them when setting
3834 # linux_use_debug_fission, so it can be used here alone.
3835 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3836 'cflags': ['-gsplit-dwarf'],
3842 'release_optimize%': '2',
3843 # Binaries become big and gold is unable to perform GC
3844 # and remove unused sections for some of test targets
3845 # on 32 bit platform.
3846 # (This is currently observed only in chromeos valgrind bots)
3847 # The following flag is to disable --gc-sections linker
3848 # option for these bots.
3849 'no_gc_sections%': 0,
3851 # TODO(bradnelson): reexamine how this is done if we change the
3852 # expansion of configurations
3853 'release_valgrind_build%': 0,
3856 '-O<(release_optimize)',
3857 # Don't emit the GCC version ident directives, they just end up
3858 # in the .comment section taking up binary size.
3860 # Put data and code in their own sections, so that unused symbols
3861 # can be removed at link time with --gc-sections.
3863 '-ffunction-sections',
3866 # Specifically tell the linker to perform optimizations.
3867 # See http://lwn.net/Articles/192624/ .
3872 ['no_gc_sections==0', {
3874 '-Wl,--gc-sections',
3877 ['OS=="android" and target_arch!="arm64"', {
3878 # We don't omit frame pointers on arm64 since they are required
3879 # to correctly unwind stackframes which contain system library
3880 # function frames (crbug.com/391706).
3882 '-fomit-frame-pointer',
3885 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3886 # TODO(jdduke) Re-enable on mips after resolving linking
3887 # issues with libc++ (crbug.com/456380).
3889 # Warn in case of text relocations.
3890 '-Wl,--warn-shared-textrel',
3895 'release_optimize%': 's',
3900 '-fno-omit-frame-pointer',
3904 ['profiling_full_stack_frames==1', {
3907 '-fno-optimize-sibling-calls',
3912 ['release_unwind_tables==1', {
3913 'cflags': ['-funwind-tables'],
3915 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3916 'defines': ['NO_UNWIND_TABLES'],
3922 ['target_arch=="ia32"', {
3923 'target_conditions': [
3924 ['_toolset=="target"', {
3926 # Needed so that libs with .s files (e.g. libicudata.a)
3927 # are compatible with the general 32-bit-ness.
3930 # All floating-point computations on x87 happens in 80-bit
3931 # precision. Because the C and C++ language standards allow
3932 # the compiler to keep the floating-point values in higher
3933 # precision than what's specified in the source and doing so
3934 # is more efficient than constantly rounding up to 64-bit or
3935 # 32-bit precision as specified in the source, the compiler,
3936 # especially in the optimized mode, tries very hard to keep
3937 # values in x87 floating-point stack (in 80-bit precision)
3938 # as long as possible. This has important side effects, that
3939 # the real value used in computation may change depending on
3940 # how the compiler did the optimization - that is, the value
3941 # kept in 80-bit is different than the value rounded down to
3942 # 64-bit or 32-bit. There are possible compiler options to
3943 # make this behavior consistent (e.g. -ffloat-store would keep
3944 # all floating-values in the memory, thus force them to be
3945 # rounded to its original precision) but they have significant
3946 # runtime performance penalty.
3948 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3949 # which keep floating-point values in SSE registers in its
3950 # native precision (32-bit for single precision, and 64-bit
3951 # for double precision values). This means the floating-point
3952 # value used during computation does not change depending on
3953 # how the compiler optimized the code, since the value is
3954 # always kept in its specified precision.
3956 # Refer to http://crbug.com/348761 for rationale behind SSE2
3957 # being a minimum requirement for 32-bit Linux builds and
3958 # http://crbug.com/313032 for an example where this has "bit"
3963 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3970 # Use gold linker for Android ia32 target.
3972 # Use gold linker for Android ia32 target.
3976 # Use -mstackrealign due to a bug on ia32 Jelly Bean.
3977 # See crbug.com/521527
3986 ['target_arch=="x64"', {
3987 'target_conditions': [
3988 ['_toolset=="target"', {
3990 # Use gold linker for Android x64 target.
4007 ['target_arch=="arm"', {
4008 'target_conditions': [
4009 ['_toolset=="target"', {
4013 # The codesourcery arm-2009q3 toolchain warns at that the ABI
4014 # has changed whenever it encounters a varargs function. This
4015 # silences those warnings, as they are not helpful and
4016 # clutter legitimate warnings.
4020 ['clang==1 and arm_arch!="" and OS!="android"', {
4022 '-target arm-linux-gnueabihf',
4025 '-target arm-linux-gnueabihf',
4030 '-march=<(arm_arch)',
4033 ['use_lto==1 or use_lto_o2==1', {
4035 '-march=<(arm_arch)',
4040 ['clang==1 and OS!="android"', {
4042 # We need to disable clang's builtin assembler as it can't
4043 # handle several asm files, crbug.com/124610
4044 '-no-integrated-as',
4049 '-mtune=<(arm_tune)',
4052 ['use_lto==1 or use_lto_o2==1', {
4054 '-mtune=<(arm_tune)',
4064 ['use_lto==1 or use_lto_o2==1', {
4071 ['arm_float_abi!=""', {
4073 '-mfloat-abi=<(arm_float_abi)',
4076 ['use_lto==1 or use_lto_o2==1', {
4078 '-mfloat-abi=<(arm_float_abi)',
4088 ['use_lto==1 or use_lto_o2==1', {
4096 # Most of the following flags are derived from what Android
4097 # uses by default when building for arm, reference for which
4098 # can be found in the following file in the Android NDK:
4099 # toolchains/arm-linux-androideabi-4.9/setup.mk
4101 # The tree-sra optimization (scalar replacement for
4102 # aggregates enabling subsequent optimizations) leads to
4103 # invalid code generation when using the Android NDK's
4104 # compiler (r5-r7). This can be verified using
4105 # webkit_unit_tests' WTF.Checked_int8_t test.
4107 # The following option is disabled to improve binary
4108 # size and performance in gcc 4.9.
4109 '-fno-caller-saves',
4112 # Android now supports .relro sections properly.
4113 # NOTE: While these flags enable the generation of .relro
4114 # sections, the generated libraries can still be loaded on
4115 # older Android platform versions.
4122 ['gcc_version==48 and clang==0', {
4124 # The following 5 options are disabled to save on
4125 # binary size in GCC 4.8.
4126 '-fno-partial-inlining',
4127 '-fno-early-inlining',
4128 '-fno-tree-copy-prop',
4129 '-fno-tree-loop-optimize',
4130 '-fno-move-loop-invariants',
4134 'cflags': [ '-mthumb-interwork' ],
4138 # Thumb code with frame pointer makes chrome crash
4141 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
4142 # The perf report sometimes incorrectly attributes
4143 # code from tail calls.
4144 '-fno-optimize-sibling-calls',
4147 '-fomit-frame-pointer',
4152 # Clang does not support the following options.
4154 '-mthumb-interwork',
4155 '-finline-limit=64',
4157 '-fno-caller-saves',
4161 # TODO(hans) Enable integrated-as (crbug.com/124610).
4162 '-no-integrated-as',
4163 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4166 ['clang==1 and linux_use_bundled_gold==0', {
4168 # Let clang find the ld.gold in the NDK.
4169 '--gcc-toolchain=<(android_toolchain)/..',
4174 '-marm', # Required for frame pointer based stack traces.
4181 # We set arm_arch to "" so that -march compiler option
4182 # is not set. Otherwise a gcc bug that would complain
4183 # about it conflicting with '-mcpu=cortex-a9'. The flag
4184 # '-march=armv7-a' is actually redundant anyway because
4185 # it is enabled by default when we built the toolchain.
4186 # And using '-mcpu=cortex-a9' should be sufficient.
4189 # Breakpad requires symbols with debugging information
4193 # We want to statically link libstdc++/libgcc_s.
4194 '-static-libstdc++',
4198 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4199 # define their own cflags for arm builds that could
4200 # conflict with the flags we set here (e.g.
4201 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4210 ['target_arch=="arm64"', {
4211 'target_conditions': [
4212 ['_toolset=="target"', {
4216 '-fstack-protector', # stack protector is always enabled on arm64.
4223 ['target_arch=="mipsel"', {
4224 'target_conditions': [
4225 ['_toolset=="target"', {
4227 ['mips_arch_variant=="r6"', {
4230 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ],
4231 'ldflags': [ '-target mipsel-linux-gnu', ],
4233 'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
4235 ['clang==0 and OS=="android"', {
4236 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4240 ['mips_arch_variant=="r2"', {
4242 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4243 'cflags': ['-m<(mips_fpu_mode)'],
4248 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
4249 'ldflags': [ '-target mipsel-linux-android', ],
4251 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32r2'],
4252 'ldflags': [ '-target mipsel-linux-gnu', ],
4256 'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
4260 ['mips_arch_variant=="r1"', {
4265 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
4266 'ldflags': [ '-target mipsel-linux-android', ],
4268 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32'],
4269 'ldflags': [ '-target mipsel-linux-gnu', ],
4273 'cflags': ['-mips32', '-Wa,-mips32', ],
4279 # Clang does not support the following options.
4280 '-finline-limit=64',
4283 # TODO(gordanac) Enable integrated-as.
4284 '-no-integrated-as',
4287 ['clang==1 and OS=="android"', {
4289 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4292 # Let clang find the ld in the NDK.
4293 '--gcc-toolchain=<(android_toolchain)/..',
4296 ['mips_dsp_rev==1', {
4297 'cflags': ['-mdsp'],
4299 ['mips_dsp_rev==2', {
4300 'cflags': ['-mdspr2'],
4304 '-m<(mips_float_abi)-float'
4307 '-Wl,--no-keep-memory'
4310 '-Wno-uninitialized',
4315 ['target_arch=="mips64el"', {
4316 'target_conditions': [
4317 ['_toolset=="target"', {
4319 ['mips_arch_variant=="r6"', {
4320 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4321 'ldflags': ['-mips64r6'],
4323 ['mips_arch_variant=="r2"', {
4324 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4325 'ldflags': ['-mips64r2'],
4329 '-Wno-uninitialized',
4343 'target_conditions': [
4344 ['_toolset=="target"', {
4346 '--sysroot=<(sysroot)',
4349 '--sysroot=<(sysroot)',
4350 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4356 # TODO(thakis): Remove, http://crbug.com/263960
4357 '-Wno-reserved-user-defined-literal',
4360 # gnu++11 instead of c++11 is needed because some code uses
4361 # typeof() (a GNU extension).
4362 # TODO(thakis): Eventually switch this to c++11 instead,
4363 # http://crbug.com/427584
4367 ['clang==0 and host_clang==1', {
4368 'target_conditions': [
4369 ['_toolset=="host"', {
4370 'cflags_cc': [ '-std=gnu++11', ],
4374 ['clang==1 and clang_use_chrome_plugins==1', {
4376 '<@(clang_chrome_plugins_flags)',
4379 ['clang==1 and clang_load!=""', {
4381 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4384 ['clang==1 and clang_add_plugin!=""', {
4386 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4389 ['clang==1 and target_arch=="ia32"', {
4391 # Else building libyuv gives clang's register allocator issues,
4392 # see llvm.org/PR15798 / crbug.com/233709
4393 '-momit-leaf-frame-pointer',
4394 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4395 '-mstack-alignment=16',
4399 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4401 # See http://crbug.com/110262
4402 '-fcolor-diagnostics',
4405 # Common options for AddressSanitizer, LeakSanitizer,
4406 # ThreadSanitizer, MemorySanitizer and non-official CFI builds.
4407 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1 or '
4408 '(cfi_vptr==1 and buildtype!="Official")', {
4409 'target_conditions': [
4410 ['_toolset=="target"', {
4412 '-fno-omit-frame-pointer',
4413 '-gline-tables-only',
4416 '-fomit-frame-pointer',
4421 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4422 'target_conditions': [
4423 ['_toolset=="target"', {
4425 # Functions interposed by the sanitizers can make ld think
4426 # that some libraries aren't needed when they actually are,
4427 # http://crbug.com/234010. As workaround, disable --as-needed.
4431 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4432 'MEMORY_SANITIZER_INITIAL_SIZE',
4438 'target_conditions': [
4439 ['_toolset=="target"', {
4441 '-fsanitize=address',
4442 # TODO(earthdok): Re-enable. http://crbug.com/427202
4443 #'-fsanitize-blacklist=<(asan_blacklist)',
4446 '-fsanitize=address',
4453 '-mllvm -asan-globals=0', # http://crbug.com/352073
4459 'target_conditions': [
4460 ['_toolset=="target"', {
4462 # FIXME: work on enabling more flags and getting rid of false
4463 # positives. http://crbug.com/174801.
4464 '-fsanitize=bounds',
4465 '-fsanitize=float-divide-by-zero',
4466 '-fsanitize=integer-divide-by-zero',
4468 '-fsanitize=object-size',
4469 '-fsanitize=return',
4470 '-fsanitize=returns-nonnull-attribute',
4471 '-fsanitize=shift-exponent',
4472 '-fsanitize=signed-integer-overflow',
4473 '-fsanitize=unreachable',
4474 '-fsanitize=vla-bound',
4475 '-fsanitize-blacklist=<(ubsan_blacklist)',
4476 # Employ the experimental PBQP register allocator to avoid
4477 # slow compilation on files with too many basic blocks.
4478 # See http://crbug.com/426271.
4479 '-mllvm -regalloc=pbqp',
4480 # Speculatively use coalescing to slightly improve the code
4481 # generated by PBQP regallocator. May increase compile time.
4482 '-mllvm -pbqp-coalescing',
4491 '-fsanitize=undefined',
4494 'UNDEFINED_SANITIZER',
4500 'target_conditions': [
4501 ['_toolset=="target"', {
4504 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4516 'UNDEFINED_SANITIZER',
4521 ['asan_coverage!=0 and sanitizer_coverage==0', {
4522 'target_conditions': [
4523 ['_toolset=="target"', {
4525 '-fsanitize-coverage=<(asan_coverage)',
4528 'SANITIZER_COVERAGE',
4533 ['sanitizer_coverage!=0', {
4534 'target_conditions': [
4535 ['_toolset=="target"', {
4537 '-fsanitize-coverage=<(sanitizer_coverage)',
4540 'SANITIZER_COVERAGE',
4545 ['(asan_coverage>1 or sanitizer_coverage>1) and target_arch=="arm"', {
4546 'target_conditions': [
4547 ['_toolset=="target"', {
4549 '-mllvm -sanitizer-coverage-block-threshold=0', # http://crbug.com/517105
4554 ['asan_field_padding!=0', {
4555 'target_conditions': [
4556 ['_toolset=="target"', {
4558 '-fsanitize-address-field-padding=<(asan_field_padding)',
4564 'target_conditions': [
4565 ['_toolset=="target"', {
4574 'WTF_USE_LEAK_SANITIZER=1',
4580 'target_conditions': [
4581 ['_toolset=="target"', {
4583 '-fsanitize=thread',
4584 '-fsanitize-blacklist=<(tsan_blacklist)',
4587 '-fsanitize=thread',
4591 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4592 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4598 'target_conditions': [
4599 ['_toolset=="target"', {
4601 '-fsanitize=memory',
4602 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4603 '-fsanitize-blacklist=<(msan_blacklist)',
4606 '-fsanitize=memory',
4614 ['use_instrumented_libraries==1', {
4616 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4619 ['use_prebuilt_instrumented_libraries==1', {
4621 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
4624 ['use_custom_libcxx==1', {
4626 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4629 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4630 'target_conditions' : [
4631 # crazy_linker has an upstream gyp file we can't edit, and we
4632 # don't want to instrument it.
4633 ['_toolset=="target" and _target_name!="crazy_linker"', {
4635 '-finstrument-functions',
4636 # Allow mmx intrinsics to inline, so that the
4637 # compiler can expand the intrinsics.
4638 '-finstrument-functions-exclude-file-list=mmintrin.h',
4640 'defines': ['CYGPROFILE_INSTRUMENTATION'],
4642 ['_toolset=="target" and OS=="android"', {
4644 # Avoids errors with current NDK:
4645 # "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"
4646 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4651 ['linux_dump_symbols==1', {
4654 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4655 'target_conditions': [
4656 ['_toolset=="target"', {
4658 # Attempt to use less memory to prevent the linker from
4659 # running out of address space. Considering installing a
4660 # 64-bit kernel and switching to a 64-bit linker.
4661 '-Wl,--no-keep-memory',
4668 ['use_allocator!="tcmalloc"', {
4669 'defines': ['NO_TCMALLOC'],
4671 ['linux_use_gold_flags==1', {
4672 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4674 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4675 'ldflags': [ '-fuse-ld=gold', ],
4677 'target_conditions': [
4678 ['_toolset=="target"', {
4680 # Experimentation found that using four linking threads
4681 # saved ~20% of link time.
4682 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4683 # Only apply this to the target linker, since the host
4684 # linker might not be gold, but isn't used much anyway.
4685 # TODO(raymes): Disable threading because gold is frequently
4686 # crashing on the bots: crbug.com/161942.
4688 # '-Wl,--thread-count=4',
4691 # TODO(thestig): Enable this for disabled cases.
4692 [ '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', {
4694 '-Wl,--detect-odr-violations',
4701 ['release_valgrind_build==0 and order_profiling==0 and asan==0 and msan==0 and lsan==0 and tsan==0', {
4702 'target_conditions': [
4703 ['_toolset=="target"', {
4705 '-Wl,--icf=<(gold_icf_level)',
4712 ['linux_use_bundled_binutils==1', {
4714 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4717 ['linux_use_bundled_gold==1 and '
4718 'not (clang==0 and (use_lto==1 or use_lto_o2==1))', {
4719 # Put our binutils, which contains gold in the search path. We pass
4720 # the path to gold to the compiler. gyp leaves unspecified what the
4721 # cwd is when running the compiler, so the normal gyp path-munging
4722 # fails us. This hack gets the right path.
4724 # Disabled when using GCC LTO because GCC also uses the -B search
4725 # path at link time to find "as", and our bundled "as" can only
4728 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4731 # Some binutils 2.23 releases may or may not have new dtags enabled,
4732 # but they are all compatible with --disable-new-dtags,
4733 # because the new dynamic tags are not created by default.
4734 ['binutils_version>=223', {
4735 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4736 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4737 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4738 # inside this file to allow usage of --no-as-needed and removal of
4741 '-Wl,--disable-new-dtags',
4744 ['gcc_version>=47 and clang==0', {
4745 'target_conditions': [
4746 ['_toolset=="target"', {
4749 # See comment for -Wno-c++11-narrowing.
4751 # TODO(thakis): Remove, http://crbug.com/263960
4752 '-Wno-literal-suffix',
4757 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4758 'target_conditions': [
4759 ['_toolset=="host"', {
4762 # See comment for -Wno-c++11-narrowing.
4764 # TODO(thakis): Remove, http://crbug.com/263960
4765 '-Wno-literal-suffix',
4773 # FreeBSD-specific options; note that most FreeBSD options are set above,
4776 'target_defaults': {
4778 '-Wl,--no-keep-memory',
4782 # Android-specific options; note that most are set above with Linux.
4785 # This is a unique identifier for a given build. It's used for
4786 # identifying various build artifacts corresponding to a particular
4787 # build of chrome (e.g. where to find archived symbols).
4788 'chrome_build_id%': '',
4790 # Placing this variable here prevents from forking libvpx, used
4791 # by remoting. Remoting is off, so it needn't built,
4792 # so forking it's deps seems like overkill.
4793 # But this variable need defined to properly run gyp.
4794 # A proper solution is to have an OS==android conditional
4795 # in third_party/libvpx/libvpx.gyp to define it.
4796 'libvpx_path': 'lib/linux/arm',
4798 'target_defaults': {
4800 'release_extra_cflags%': '',
4802 # If we're using the components build, append "cr" to all shared
4803 # libraries to avoid naming collisions with android system library
4804 # versions with the same name (e.g. skia, icu).
4805 ['component=="shared_library"', {
4806 'android_product_extension': 'cr.so',
4808 'android_product_extension': 'so',
4812 'target_conditions': [
4813 ['_type=="shared_library"', {
4814 'product_extension': '<(android_product_extension)',
4817 # Settings for building device targets using Android's toolchain.
4818 # These are based on the setup.mk file from the Android NDK.
4820 # The NDK Android executable link step looks as follows:
4822 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4823 # $(PRIVATE_OBJECTS) <-- The .o that we built
4824 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4825 # $(TARGET_LIBGCC) <-- libgcc.a
4826 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4827 # $(PRIVATE_LDLIBS) <-- System .so
4828 # $(TARGET_CRTEND_O) <-- crtend.o
4830 # For now the above are approximated for executables by adding
4831 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4834 # The NDK Android shared library link step looks as follows:
4836 # $(PRIVATE_OBJECTS) <-- The .o that we built
4837 # -l,--whole-archive
4838 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4839 # -l,--no-whole-archive
4840 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4841 # $(TARGET_LIBGCC) <-- libgcc.a
4842 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4843 # $(PRIVATE_LDLIBS) <-- System .so
4845 # For now, assume that whole static libraries are not needed.
4847 # For both executables and shared libraries, add the proper
4848 # libgcc.a to the start of libraries which puts it in the
4849 # proper spot after .o and .a files get linked in.
4851 # TODO: The proper thing to do longer-tem would be proper gyp
4852 # support for a custom link command line.
4853 ['_toolset=="target"', {
4855 '-pthread', # Not supported by Android toolchain.
4858 '-ffunction-sections',
4861 '-fstack-protector',
4863 '-finline-limit=64',
4864 '<@(release_extra_cflags)',
4865 '--sysroot=<(android_ndk_sysroot)',
4866 # NOTE: The libc++ header include paths below are specified in
4867 # cflags rather than include_dirs because they need to come
4868 # after include_dirs.
4869 # The include ordering here is important; change with caution.
4870 '-isystem<(android_libcpp_include)',
4871 '-isystem<(android_ndk_root)/sources/cxx-stl/llvm-libc++abi/libcxxabi/include',
4872 '-isystem<(android_ndk_root)/sources/android/support/include',
4876 '__GNU_SOURCE=1', # Necessary for clone()
4877 'CHROME_BUILD_ID="<(chrome_build_id)"',
4878 # The NDK has these things, but doesn't define the constants
4879 # to say that it does. Define them here instead.
4883 '-pthread', # Not supported by Android toolchain.
4886 '-Wl,--build-id=sha1',
4887 '-Wl,--no-undefined',
4888 '--sysroot=<(android_ndk_sysroot)',
4890 '-L<(android_libcpp_libs_dir)',
4891 # Don't allow visible symbols from libgcc or libc++ to be
4893 '-Wl,--exclude-libs=libgcc.a',
4894 '-Wl,--exclude-libs=libc++_static.a',
4895 # Don't allow visible symbols from libraries that contain
4896 # assembly code with symbols that aren't hidden properly.
4897 # http://crbug.com/448386
4898 '-Wl,--exclude-libs=libcommon_audio.a',
4899 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4900 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4901 '-Wl,--exclude-libs=libiSACFix.a',
4902 '-Wl,--exclude-libs=libisac_neon.a',
4903 '-Wl,--exclude-libs=libopus.a',
4904 '-Wl,--exclude-libs=libvpx.a',
4907 '-l<(android_libcpp_library)',
4909 # Manually link the libgcc.a that the cross compiler uses.
4910 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4916 ['component=="static_library"', {
4917 'target_conditions': [
4918 ['use_native_jni_exports==0', {
4919 # Use a linker version script to strip JNI exports from
4920 # binaries which have not specifically asked to use them.
4922 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4929 # Clang with libc++ does not require an explicit atomic
4930 # library reference.
4934 # Work around incompatibilities between bionic and clang
4936 '-D__compiler_offsetof=__builtin_offsetof',
4937 '-Dnan=__builtin_nan',
4940 # Clang does not support the following options.
4941 '-finline-limit=64',
4944 ['target_arch=="arm"', {
4946 '-target arm-linux-androideabi',
4949 '-target arm-linux-androideabi',
4952 ['target_arch=="ia32"', {
4954 '-target i686-linux-androideabi',
4957 '-target i686-linux-androideabi',
4960 # Place holder for x64 support, not tested.
4961 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4962 ['target_arch=="x64"', {
4964 '-target x86_64-linux-androideabi',
4967 '-target x86_64-linux-androideabi',
4974 # Android build relies on -Wl,--gc-sections removing
4975 # unreachable code. ASan instrumentation for globals inhibits
4976 # this and results in a library with unresolvable relocations.
4977 # TODO(eugenis): find a way to reenable this.
4978 '-mllvm -asan-globals=0',
4981 ['target_arch == "arm" and order_profiling==0', {
4983 # Enable identical code folding to reduce size.
4984 '-Wl,--icf=<(gold_icf_level)',
4987 ['target_arch=="ia32"', {
4988 # The x86 toolchain currently has problems with stack-protector.
4990 '-fstack-protector',
4993 '-fno-stack-protector',
4997 'target_conditions': [
4998 ['_type=="executable"', {
4999 # Force android tools to export the "main" symbol so they can be
5000 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
5001 # TODO(primiano): remove -fvisibility and -rdynamic flags below
5002 # when ICS support will be dropped.
5005 '-fvisibility=default',
5009 '-Wl,--gc-sections',
5010 '-Wl,-z,nocopyreloc',
5013 # crtbegin_dynamic.o should be the last item in ldflags.
5014 '<(android_ndk_lib)/crtbegin_dynamic.o',
5017 # crtend_android.o needs to be the last item in libraries.
5018 # Do not add any libraries after this!
5019 '<(android_ndk_lib)/crtend_android.o',
5022 ['_type=="shared_library" or _type=="loadable_module"', {
5024 '-Wl,-shared,-Bsymbolic',
5025 # crtbegin_so.o should be the last item in ldflags.
5026 '<(android_ndk_lib)/crtbegin_so.o',
5029 # crtend_so.o needs to be the last item in libraries.
5030 # Do not add any libraries after this!
5031 '<(android_ndk_lib)/crtend_so.o',
5036 # Settings for building host targets using the system toolchain.
5037 ['_toolset=="host"', {
5039 # Due to issues in Clang build system, using ASan on 32-bit
5040 # binaries on x86_64 host is problematic.
5041 # TODO(eugenis): re-enable.
5042 '-fsanitize=address',
5045 '-fsanitize=address',
5046 '-Wl,-z,noexecstack',
5047 '-Wl,--gc-sections',
5050 '-Wl,--warn-shared-textrel',
5051 '-Wl,--fatal-warnings',
5054 # Settings for building host targets on mac.
5055 ['_toolset=="host" and host_os=="mac"', {
5065 'cflags!': ['-fvisibility=hidden'],
5066 'cflags_cc!': ['-fvisibility-inlines-hidden'],
5068 ['OS=="mac" or OS=="ios"', {
5069 'target_defaults': {
5072 'ALWAYS_SEARCH_USER_PATHS': 'NO',
5073 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
5074 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
5075 'COPY_PHASE_STRIP': 'NO',
5076 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
5077 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
5078 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
5079 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
5080 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
5081 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
5082 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
5083 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
5084 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
5085 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
5086 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
5087 'GCC_VERSION': '4.2',
5088 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
5089 'USE_HEADERMAP': 'NO',
5094 # Don't warn about unused function parameters.
5095 '-Wno-unused-parameter',
5096 # Don't warn about the "struct foo f = {0};" initialization
5098 '-Wno-missing-field-initializers',
5101 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
5102 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
5104 # Note that the prebuilt Clang binaries should not be used for iOS
5105 # development except for ASan builds.
5107 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
5108 # Warn if automatic synthesis is triggered with
5109 # the -Wobjc-missing-property-synthesis flag.
5110 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
5111 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
5113 # This warns on selectors from Cocoa headers (-length, -set).
5114 # cfe-dev is currently discussing the merits of this warning.
5115 # TODO(thakis): Reevaluate what to do with this, based one
5116 # cfe-dev discussion.
5117 '-Wno-selector-type-mismatch',
5120 ['clang_xcode==0', {
5121 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
5122 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
5126 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
5128 '<@(clang_chrome_plugins_flags)',
5131 ['clang==1 and clang_xcode==0 and clang_load!=""', {
5133 '-Xclang', '-load', '-Xclang', '<(clang_load)',
5136 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
5138 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
5141 ['clang==1 and "<(GENERATOR)"=="ninja"', {
5143 # See http://crbug.com/110262
5144 '-fcolor-diagnostics',
5147 ['OS=="ios" and target_subarch!="arm32" and \
5148 "<(GENERATOR)"=="xcode"', {
5150 # TODO(ios): when building Chrome for iOS on 64-bit platform
5151 # with Xcode, the -Wshorted-64-to-32 warning is automatically
5152 # enabled. This cause failures when compiling protobuf code,
5153 # so disable the warning. http://crbug.com/359107
5154 '-Wno-shorten-64-to-32',
5162 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
5168 '-fsanitize=address',
5169 '-mllvm -asan-globals=0', # http://crbug.com/352073
5170 '-gline-tables-only',
5174 ['asan_coverage!=0 and sanitizer_coverage==0', {
5175 'target_conditions': [
5176 ['_toolset=="target"', {
5178 '-fsanitize-coverage=<(asan_coverage)',
5181 'SANITIZER_COVERAGE',
5186 ['sanitizer_coverage!=0', {
5187 'target_conditions': [
5188 ['_toolset=="target"', {
5190 '-fsanitize-coverage=<(sanitizer_coverage)',
5193 'SANITIZER_COVERAGE',
5199 'target_conditions': [
5200 ['_type!="static_library"', {
5201 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5206 '-fsanitize=address',
5210 ['mac_write_linker_maps==1', {
5213 '-Wl,-map,>(_target_name).map',
5220 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5221 'target_conditions': [
5222 ['_type=="executable"', {
5228 # Define copy_asan_dylib_path in a variable ending in
5229 # _path so that gyp understands it's a path and
5230 # performs proper relativization during dict merging.
5231 'copy_asan_dylib_path':
5232 'mac/copy_asan_runtime_dylib.sh',
5234 'postbuild_name': 'Copy ASan runtime dylib',
5236 '<(copy_asan_dylib_path)',
5245 ], # target_conditions
5246 }, # target_defaults
5247 }], # OS=="mac" or OS=="ios"
5249 'target_defaults': {
5251 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5252 # with common names, like 'check', 'require', and 'verify'.
5253 # (Included by system header. Also exists on iOS but not included.)
5254 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5255 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5258 # These should end with %, but there seems to be a bug with % in
5259 # variables that are intended to be set to different values in
5260 # different targets, like these.
5261 'mac_pie': 1, # Most executables can be position-independent.
5262 # Strip debugging symbols from the target.
5263 'mac_strip': '<(mac_strip_release)',
5267 ['mac_want_real_dsym=="default"', {
5270 'mac_real_dsym': '<(mac_want_real_dsym)'
5275 ['mac_want_real_dsym=="default"', {
5276 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5278 'mac_real_dsym': '<(mac_want_real_dsym)'
5287 ['branding=="Chrome" and buildtype=="Official"', {
5290 # The Google Chrome Framework dSYM generated by dsymutil has
5291 # grown larger than 4GB, which dsymutil can't handle. Reduce
5292 # the amount of debug symbols.
5293 '-fno-standalone-debug', # See http://crbug.com/479841
5298 }, # configuration "Release"
5301 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5302 # (Equivalent to -fPIC)
5303 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5304 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5305 # Keep pch files below xcodebuild/.
5306 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5308 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5309 # xcode_setting, but not until all downstream projects' mac bots are
5310 # using xcode >= 4.6, because that's when the default value of the
5311 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5312 # setting is a no-op as far as xcode is concerned, but the compiler
5313 # behaves differently based on whether -fno-strict-aliasing is
5315 '-fno-strict-aliasing', # See http://crbug.com/32204.
5318 'target_conditions': [
5319 ['_type=="executable"', {
5322 # Arranges for data (heap) pages to be protected against
5323 # code execution when running on Mac OS X 10.7 ("Lion"), and
5324 # ensures that the position-independent executable (PIE) bit
5325 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5327 # Define change_mach_o_flags in a variable ending in _path
5328 # so that GYP understands it's a path and performs proper
5329 # relativization during dict merging.
5330 'change_mach_o_flags_path':
5331 'mac/change_mach_o_flags_from_xcode.sh',
5332 'change_mach_o_flags_options%': [
5334 'target_conditions': [
5335 ['mac_pie==0 or release_valgrind_build==1', {
5336 # Don't enable PIE if it's unwanted. It's unwanted if
5337 # the target specifies mac_pie=0 or if building for
5338 # Valgrind, because Valgrind doesn't understand slide.
5339 # See the similar mac_pie/release_valgrind_build check
5341 'change_mach_o_flags_options': [
5347 'postbuild_name': 'Change Mach-O Flags',
5349 '<(change_mach_o_flags_path)',
5350 '>@(change_mach_o_flags_options)',
5354 'target_conditions': [
5355 ['mac_pie==1 and release_valgrind_build==0', {
5356 # Turn on position-independence (ASLR) for executables. When
5357 # PIE is on for the Chrome executables, the framework will
5358 # also be subject to ASLR.
5359 # Don't do this when building for Valgrind, because Valgrind
5360 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5361 # understand slide, and get rid of the Valgrind check.
5364 '-Wl,-pie', # Position-independent executable (MH_PIE)
5370 ['(_type=="executable" or _type=="shared_library" or \
5371 _type=="loadable_module") and mac_strip!=0', {
5372 'target_conditions': [
5373 ['mac_real_dsym == 1', {
5374 # To get a real .dSYM bundle produced by dsymutil, set the
5375 # debug information format to dwarf-with-dsym. Since
5376 # strip_from_xcode will not be used, set Xcode to do the
5377 # stripping as well.
5381 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5382 'DEPLOYMENT_POSTPROCESSING': 'YES',
5383 'STRIP_INSTALLED_PRODUCT': 'YES',
5385 # Only strip non-ASan builds.
5387 'target_conditions': [
5388 ['_type=="shared_library" or _type=="loadable_module"', {
5389 # The Xcode default is to strip debugging symbols
5390 # only (-S). Local symbols should be stripped as
5391 # well, which will be handled by -x. Xcode will
5392 # continue to insert -S when stripping even when
5393 # additional flags are added with STRIPFLAGS.
5395 }], # _type=="shared_library" or _type=="loadable_module"
5396 ], # target_conditions
5402 }, # configuration "Release"
5404 }, { # mac_real_dsym != 1
5405 # To get a fast fake .dSYM bundle, use a post-build step to
5406 # produce the .dSYM and strip the executable. strip_from_xcode
5407 # only operates in the Release configuration.
5411 # Define strip_from_xcode in a variable ending in _path
5412 # so that gyp understands it's a path and performs proper
5413 # relativization during dict merging.
5414 'strip_from_xcode_path': 'mac/strip_from_xcode',
5416 'postbuild_name': 'Strip If Needed',
5417 'action': ['<(strip_from_xcode_path)'],
5421 ], # target_conditions
5422 }], # (_type=="executable" or _type=="shared_library" or
5423 # _type=="loadable_module") and mac_strip!=0
5424 ], # target_conditions
5425 }, # target_defaults
5429 'ios/coverage.gypi',
5431 'target_defaults': {
5432 'xcode_settings' : {
5433 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5434 'ENABLE_BITCODE': 'NO',
5437 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5438 # additional flag to suppress the "unknown compiler option" error.
5439 # Restrict this flag to builds that are either compiling with Xcode
5440 # or compiling with Xcode's Clang. This will allow Ninja builds to
5441 # continue failing on unknown compiler options.
5442 # TODO(rohitrao): This flag is temporary and should be removed as
5443 # soon as the iOS bots are updated to use Xcode 5.1.
5444 ['clang_xcode==1', {
5446 '-Wno-unknown-warning-option',
5447 # It's not possible to achieve nullability completeness before
5448 # all builders are running Xcode 7. crbug.com/499809
5449 '-Wno-nullability-completeness',
5453 # Limit the valid architectures depending on "target_subarch".
5454 # This need to include the "arm" architectures but also the "x86"
5455 # ones (they are used when building for the simulator).
5456 ['target_subarch=="arm32"', {
5457 'VALID_ARCHS': ['armv7', 'i386'],
5459 ['target_subarch=="arm64"', {
5460 'VALID_ARCHS': ['arm64', 'x86_64'],
5462 ['target_subarch=="both"', {
5463 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5465 ['use_system_libcxx==1', {
5466 'target_conditions': [
5467 # Only use libc++ when building target for iOS not when building
5468 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5469 # does not support libc++.
5470 ['_toolset=="target"', {
5471 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5475 # The default for deployment target of 7.0+ is libc++, so force
5476 # the old behavior unless libc++ is enabled.
5477 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5481 'target_conditions': [
5482 ['_toolset=="host"', {
5484 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5485 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5494 ['_toolset=="target"', {
5496 # This section should be for overriding host settings. But,
5497 # since we can't negate the iphone deployment target above, we
5498 # instead set it here for target only.
5499 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5500 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5503 ['_type=="executable"', {
5507 'DEPLOYMENT_POSTPROCESSING': 'YES',
5508 'STRIP_INSTALLED_PRODUCT': 'YES',
5510 ['buildtype!="Official"', {
5511 # Remove dSYM to reduce build time.
5512 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5519 # Remove dSYM to reduce build time.
5520 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5526 ['chromium_ios_signing', {
5527 # iOS SDK wants everything for device signed.
5528 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5530 'CODE_SIGNING_REQUIRED': 'NO',
5531 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5536 ], # target_conditions
5537 }, # target_defaults
5540 'target_defaults': {
5542 '_WIN32_WINNT=0x0603',
5549 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5550 'WIN32_LEAN_AND_MEAN',
5553 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5554 '_HAS_EXCEPTIONS=0',
5555 # Silence some warnings; we can't switch the the 'recommended'
5556 # versions as they're not available on old OSs.
5557 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5560 ['buildtype=="Official"', {
5561 # In official builds, targets can self-select an optimization
5562 # level by defining a variable named 'optimize', and setting it
5564 # - "size", optimizes for minimal code size - the default.
5565 # - "speed", optimizes for speed over code size.
5566 # - "max", whole program optimization and link-time code
5567 # generation. This is very expensive and should be used
5570 'optimize%': 'size',
5574 # Set /LTCG for the official builds.
5575 'LinkTimeCodeGeneration': '1',
5576 'AdditionalOptions': [
5577 # Set the number of LTCG code-gen threads to eight.
5578 # The default is four. This gives a 5-10% link speedup.
5583 'target_conditions': [
5584 ['optimize=="size"', {
5586 'VCCLCompilerTool': {
5587 # 1, optimizeMinSpace, Minimize Size (/O1)
5588 'Optimization': '1',
5589 # 2, favorSize - Favor small code (/Os)
5590 'FavorSizeOrSpeed': '2',
5595 # This config is used to avoid a problem in ffmpeg, see
5596 # http://crbug.com/264459.
5597 ['optimize=="size_no_ltcg"', {
5599 'VCCLCompilerTool': {
5600 # 1, optimizeMinSpace, Minimize Size (/O1)
5601 'Optimization': '1',
5602 # 2, favorSize - Favor small code (/Os)
5603 'FavorSizeOrSpeed': '2',
5608 ['optimize=="speed"', {
5610 'VCCLCompilerTool': {
5611 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5612 'Optimization': '2',
5613 # 1, favorSpeed - Favor fast code (/Ot)
5614 'FavorSizeOrSpeed': '1',
5619 ['optimize=="max"', {
5620 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5621 # builds. Probably anything that this would catch that
5622 # wouldn't be caught in a normal build isn't going to
5623 # actually be a bug, so the incremental value of C4702 for
5624 # PGO builds is likely very small.
5625 'msvs_disabled_warnings': [
5629 'VCCLCompilerTool': {
5630 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5631 'Optimization': '2',
5632 # 1, favorSpeed - Favor fast code (/Ot)
5633 'FavorSizeOrSpeed': '1',
5634 # This implies link time code generation.
5635 'WholeProgramOptimization': 'true',
5643 ['msvs_xtree_patched!=1', {
5644 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5645 # it's enabled. This will generally only be true for system-level
5646 # installed Express users.
5647 'msvs_disabled_warnings': [
5652 'msvs_system_include_dirs': [
5653 '<(windows_sdk_path)/Include/shared',
5654 '<(windows_sdk_path)/Include/um',
5655 '<(windows_sdk_path)/Include/winrt',
5656 '$(VSInstallDir)/VC/atlmfc/include',
5658 'msvs_cygwin_shell': 0,
5659 'msvs_disabled_warnings': [
5660 # C4091: 'typedef ': ignored on left of 'X' when no variable is
5662 # This happens in a number of Windows headers. Dumb.
5665 # C4127: conditional expression is constant
5666 # This warning can in theory catch dead code and other problems, but
5667 # triggers in far too many desirable cases where the conditional
5668 # expression is either set by macros or corresponds some legitimate
5669 # compile-time constant expression (due to constant template args,
5670 # conditionals comparing the sizes of different types, etc.). Some of
5671 # these can be worked around, but it's not worth it.
5674 # C4351: new behavior: elements of array 'array' will be default
5676 # This is a silly "warning" that basically just alerts you that the
5677 # compiler is going to actually follow the language spec like it's
5678 # supposed to, instead of not following it like old buggy versions
5679 # did. There's absolutely no reason to turn this on.
5682 # C4355: 'this': used in base member initializer list
5683 # It's commonly useful to pass |this| to objects in a class'
5684 # initializer list. While this warning can catch real bugs, most of
5685 # the time the constructors in question don't attempt to call methods
5686 # on the passed-in pointer (until later), and annotating every legit
5687 # usage of this is simply more hassle than the warning is worth.
5690 # C4503: 'identifier': decorated name length exceeded, name was
5692 # This only means that some long error messages might have truncated
5693 # identifiers in the presence of lots of templates. It has no effect
5694 # on program correctness and there's no real reason to waste time
5695 # trying to prevent it.
5698 # Warning C4589 says: "Constructor of abstract class ignores
5699 # initializer for virtual base class." Disable this warning because it
5700 # is flaky in VS 2015 RTM. It triggers on compiler generated
5701 # copy-constructors in some cases.
5704 # C4611: interaction between 'function' and C++ object destruction is
5706 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5707 # suggests using exceptions instead of setjmp/longjmp for C++, but
5708 # Chromium code compiles without exception support. We therefore have
5709 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5710 # means we have to turn off this warning (and be careful about how
5711 # object destruction happens in such cases).
5714 # TODO(maruel): These warnings are level 4. They will be slowly
5715 # removed as code is fixed.
5716 4100, # Unreferenced formal parameter
5717 4121, # Alignment of a member was sensitive to packing
5718 4244, # Conversion from 'type1' to 'type2', possible loss of data
5719 4481, # Nonstandard extension used: override specifier 'keyword'
5720 4505, # Unreferenced local function has been removed
5721 4510, # Default constructor could not be generated
5722 4512, # Assignment operator could not be generated
5723 4610, # Object can never be instantiated
5724 4838, # Narrowing conversion. Doesn't seem to be very useful.
5725 4995, # 'X': name was marked as #pragma deprecated
5726 4996, # 'X': was declared deprecated (for GetVersionEx).
5728 # These are variable shadowing warnings that are new in VS2015. We
5729 # should work through these at some point -- they may be removed from
5730 # the RTM release in the /W4 set.
5731 4456, 4457, 4458, 4459,
5734 'VCCLCompilerTool': {
5735 'AdditionalOptions': ['/MP'],
5736 'MinimalRebuild': 'false',
5737 'BufferSecurityCheck': 'true',
5738 'EnableFunctionLevelLinking': 'true',
5739 'RuntimeTypeInfo': 'false',
5740 'WarningLevel': '4',
5741 'WarnAsError': 'true',
5742 'DebugInformationFormat': '3',
5743 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5744 'ExceptionHandling': '0',
5746 'VCLibrarianTool': {
5747 'AdditionalOptions': ['/ignore:4221'],
5748 'AdditionalLibraryDirectories': [
5749 '<(windows_sdk_path)/Lib/win8/um/x86',
5753 'AdditionalDependencies': [
5765 'AdditionalLibraryDirectories': [
5766 '<(windows_sdk_path)/Lib/win8/um/x86',
5768 'GenerateDebugInformation': 'true',
5769 'MapFileName': '$(OutDir)\\$(TargetName).map',
5770 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5771 'FixedBaseAddress': '1',
5774 # 1 == /SUBSYSTEM:CONSOLE
5775 # 2 == /SUBSYSTEM:WINDOWS
5776 # Most of the executables we'll ever create are tests
5777 # and utilities with console output.
5781 'GenerateStublessProxies': 'true',
5782 'TypeLibraryName': '$(InputName).tlb',
5783 'OutputDirectory': '$(IntDir)',
5784 'HeaderFileName': '$(InputName).h',
5785 'DLLDataFileName': '$(InputName).dlldata.c',
5786 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5787 'ProxyFileName': '$(InputName)_p.c',
5789 'VCResourceCompilerTool': {
5791 'AdditionalIncludeDirectories': [
5793 '<(SHARED_INTERMEDIATE_DIR)',
5796 'target_conditions': [
5797 ['_type=="executable"', {
5799 'EmbedManifest': 'true',
5802 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5804 'AdditionalManifestFiles': [
5805 '>(win_exe_compatibility_manifest)',
5811 # Building with Clang on Windows is a work in progress and very
5812 # experimental. See crbug.com/82385.
5813 # Keep this in sync with the similar blocks in build/config/compiler/BUILD.gn
5815 'VCCLCompilerTool': {
5816 'AdditionalOptions': [
5817 # Many files use intrinsics without including this header.
5818 # TODO(hans): Fix those files, or move this to sub-GYPs.
5821 # TODO(hans): Make this list shorter eventually, http://crbug.com/504657
5822 '-Qunused-arguments', # http://crbug.com/504658
5823 '-Wno-microsoft-enum-value', # http://crbug.com/505296
5824 '-Wno-unknown-pragmas', # http://crbug.com/505314
5825 '-Wno-unused-value', # http://crbug.com/505318
5829 ['clang==1 and clang_use_chrome_plugins==1', {
5830 'VCCLCompilerTool': {
5831 'AdditionalOptions': [
5832 '<@(clang_chrome_plugins_flags)',
5836 ['clang==1 and MSVS_VERSION == "2013"', {
5837 'VCCLCompilerTool': {
5838 'AdditionalOptions': [
5839 '-fmsc-version=1800',
5843 ['clang==1 and MSVS_VERSION == "2015"', {
5844 'VCCLCompilerTool': {
5845 'AdditionalOptions': [
5846 '-fmsc-version=1900',
5850 ['clang==1 and "<!(python <(DEPTH)/build/win/use_ansi_codes.py)"=="True"', {
5851 'VCCLCompilerTool': {
5852 'AdditionalOptions': [
5853 # cmd.exe doesn't understand ANSI escape codes by default,
5854 # so only enable them if something emulating them is around.
5855 '-fansi-escape-codes',
5856 # Also see http://crbug.com/110262
5857 '-fcolor-diagnostics',
5865 ['disable_nacl==1', {
5866 'target_defaults': {
5872 ['OS=="win" and msvs_use_common_linker_extras', {
5873 'target_defaults': {
5888 'AdditionalOptions': [
5899 'AdditionalOptions': ['/largeaddressaware'],
5903 # TODO(asan/win): Move this down into the general
5904 # win-target_defaults section once the 64-bit asan runtime
5905 # exists. See crbug.com/345874.
5906 'VCCLCompilerTool': {
5907 'AdditionalOptions': [
5908 '-fsanitize=address',
5909 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5911 'AdditionalIncludeDirectories': [
5912 # MSVC needs to be able to find the sanitizer headers when
5913 # invoked via /fallback. This is critical for using macros
5914 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5916 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/include_sanitizer',
5920 'AdditionalLibraryDirectories': [
5921 # TODO(hans): If make_clang_dir is absolute, this breaks.
5922 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/lib/windows',
5925 'target_conditions': [
5926 ['component=="shared_library"', {
5928 'AdditionalDependencies': [
5929 'clang_rt.asan_dynamic-i386.lib',
5930 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5934 ['_type=="executable" and component=="static_library"', {
5936 'AdditionalDependencies': [
5937 'clang_rt.asan-i386.lib',
5941 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5943 'AdditionalDependencies': [
5944 'clang_rt.asan_dll_thunk-i386.lib',
5950 ['sanitizer_coverage!=0', {
5951 # TODO(asan/win): Move this down into the general
5952 # win-target_defaults section once the 64-bit asan runtime
5953 # exists. See crbug.com/345874.
5954 'VCCLCompilerTool': {
5955 'AdditionalOptions': [
5956 '-fsanitize-coverage=<(sanitizer_coverage)',
5963 ['sanitizer_coverage!=0', {
5964 # TODO(asan/win): Move this down into the general
5965 # win-target_defaults section once the 64-bit asan runtime
5966 # exists. See crbug.com/345874.
5968 'SANITIZER_COVERAGE',
5976 'AdditionalOptions': [
5977 # safeseh is not compatible with x64
5989 ['enable_new_npdevice_api==1', {
5990 'target_defaults': {
5992 'ENABLE_NEW_NPDEVICE_API',
5996 # Don't warn about the "typedef 'foo' locally defined but not used"
5997 # for gcc 4.8 and higher.
5998 # TODO: remove this flag once all builds work. See crbug.com/227506
5999 ['gcc_version>=48 and clang==0', {
6000 'target_defaults': {
6002 '-Wno-unused-local-typedefs',
6006 ['gcc_version>=48 and clang==0 and host_clang==1', {
6007 'target_defaults': {
6008 'target_conditions': [
6009 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
6013 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
6015 'make_global_settings': [
6016 ['CC', '<(make_clang_dir)/bin/clang'],
6017 ['CXX', '<(make_clang_dir)/bin/clang++'],
6018 ['CC.host', '$(CC)'],
6019 ['CXX.host', '$(CXX)'],
6022 ['clang==1 and OS=="win"', {
6023 'make_global_settings': [
6024 # On Windows, gyp's ninja generator only looks at CC.
6025 ['CC', '<(make_clang_dir)/bin/clang-cl'],
6028 ['use_lld==1 and OS=="win"', {
6029 'make_global_settings': [
6030 # Limited to Windows because lld-link is the driver that is
6031 # compatible with link.exe.
6032 ['LD', '<(make_clang_dir)/bin/lld-link'],
6035 ['OS=="android" and clang==0', {
6036 # Hardcode the compiler names in the Makefile so that
6037 # it won't depend on the environment at make time.
6038 'make_global_settings': [
6039 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
6040 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
6041 ['CC.host', '<(host_cc)'],
6042 ['CXX.host', '<(host_cxx)'],
6045 ['OS=="linux" and target_arch=="mipsel" and host_arch!="mipsel" and chromeos==0 and clang==0', {
6046 # Set default mips cross tools on linux. These can be overridden
6047 # using CC,CXX,CC.host and CXX.host environment variables.
6048 'make_global_settings': [
6049 ['CC', '<!(which mipsel-linux-gnu-gcc)'],
6050 ['CXX', '<!(which mipsel-linux-gnu-g++)'],
6051 ['CC.host', '<(host_cc)'],
6052 ['CXX.host', '<(host_cxx)'],
6055 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
6056 # Set default ARM cross tools on linux. These can be overridden
6057 # using CC,CXX,CC.host and CXX.host environment variables.
6058 'make_global_settings': [
6059 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
6060 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
6061 ['CC.host', '<(host_cc)'],
6062 ['CXX.host', '<(host_cxx)'],
6065 # TODO(yyanagisawa): supports GENERATOR==make
6066 # make generator doesn't support CC_wrapper without CC
6067 # in make_global_settings yet.
6068 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
6069 'make_global_settings': [
6070 ['CC_wrapper', '<(gomadir)/gomacc'],
6071 ['CXX_wrapper', '<(gomadir)/gomacc'],
6072 ['CC.host_wrapper', '<(gomadir)/gomacc'],
6073 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
6077 'target_defaults': {
6078 'target_conditions': [
6079 ['_toolset=="target"', {
6087 # Work-around for http://openradar.appspot.com/20356002
6088 ['_toolset=="target" and _type!="static_library"', {
6098 ['use_lto==1 and clang==0', {
6099 'target_defaults': {
6100 'target_conditions': [
6101 ['_toolset=="target"', {
6103 '-ffat-lto-objects',
6109 ['use_lto==1 and clang==1', {
6110 'target_defaults': {
6111 'target_conditions': [
6112 ['_toolset=="target"', {
6114 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
6120 # Apply a lower LTO optimization level in non-official builds.
6121 ['use_lto==1 and clang==1 and buildtype!="Official"', {
6122 'target_defaults': {
6123 'target_conditions': [
6124 ['_toolset=="target"', {
6126 '-Wl,--plugin-opt,O1',
6129 ['_toolset=="target" and _type!="static_library"', {
6139 ['use_lto==1 and clang==1 and target_arch=="arm"', {
6140 'target_defaults': {
6141 'target_conditions': [
6142 ['_toolset=="target"', {
6143 # Without this flag, LTO produces a .text section that is larger
6144 # than the maximum call displacement, preventing the linker from
6145 # relocating calls (http://llvm.org/PR22999).
6147 '-Wl,-plugin-opt,-function-sections',
6153 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
6154 'target_defaults': {
6155 'target_conditions': [
6156 ['_toolset=="target"', {
6164 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
6165 'target_defaults': {
6166 'target_conditions': [
6167 ['_toolset=="target"', {
6176 'target_defaults': {
6177 'target_conditions': [
6178 ['_toolset=="target"', {
6180 '-fno-sanitize-trap=cfi',
6181 '-fsanitize-recover=cfi',
6190 '-fno-sanitize-trap=cfi',
6191 '-fsanitize-recover=cfi',
6195 '-fno-sanitize-trap=cfi',
6196 '-fsanitize-recover=cfi',
6200 'VCCLCompilerTool': {
6201 'AdditionalOptions': [
6202 '-fno-sanitize-trap=cfi',
6203 '-fsanitize-recover=cfi',
6208 ['_toolset=="target" and _type!="static_library"', {
6211 '-fno-sanitize-trap=cfi',
6212 '-fsanitize-recover=cfi',
6219 ['cfi_vptr==1 and cfi_diag==0', {
6220 'target_defaults': {
6221 'target_conditions': [
6222 ['_toolset=="target"', {
6231 'target_defaults': {
6232 'target_conditions': [
6233 ['_toolset=="target"', {
6235 '-fsanitize=cfi-vcall',
6236 '-fsanitize=cfi-derived-cast',
6237 '-fsanitize=cfi-unrelated-cast',
6238 '-fsanitize-blacklist=<(cfi_blacklist)',
6241 '-fsanitize=cfi-vcall',
6242 '-fsanitize=cfi-derived-cast',
6243 '-fsanitize=cfi-unrelated-cast',
6247 '-fsanitize=cfi-vcall',
6248 '-fsanitize=cfi-derived-cast',
6249 '-fsanitize=cfi-unrelated-cast',
6250 '-fsanitize-blacklist=<(cfi_blacklist)',
6254 'VCCLCompilerTool': {
6255 'AdditionalOptions': [
6256 '-fsanitize=cfi-vcall',
6257 '-fsanitize=cfi-derived-cast',
6258 '-fsanitize=cfi-unrelated-cast',
6259 '-fsanitize-blacklist=<(cfi_blacklist)',
6264 ['_toolset=="target" and _type!="static_library"', {
6267 '-fsanitize=cfi-vcall',
6268 '-fsanitize=cfi-derived-cast',
6269 '-fsanitize=cfi-unrelated-cast',
6278 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
6279 # This block adds *project-wide* configuration settings to each project
6280 # file. It's almost always wrong to put things here. Specify your
6281 # custom xcode_settings in target_defaults to add them to targets instead.
6284 # In an Xcode Project Info window, the "Base SDK for All Configurations"
6285 # setting sets the SDK on a project-wide basis. In order to get the
6286 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
6287 # here at the project level.
6290 ['mac_sdk_path==""', {
6291 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
6293 'SDKROOT': '<(mac_sdk_path)', # -isysroot
6299 ['ios_sdk_path==""', {
6301 # TODO(justincohen): Ninja only supports simulator for now.
6302 ['"<(GENERATOR)"=="xcode"', {
6303 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6305 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
6309 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6314 # Target both iPhone and iPad.
6315 'TARGETED_DEVICE_FAMILY': '1,2',
6318 ['target_arch=="x64"', {
6323 ['target_arch=="ia32"', {
6332 # The Xcode generator will look for an xcode_settings section at the root
6333 # of each dict and use it to apply settings on a file-wide basis. Most
6334 # settings should not be here, they should be in target-specific
6335 # xcode_settings sections, or better yet, should use non-Xcode-specific
6336 # settings in target dicts. SYMROOT is a special case, because many other
6337 # Xcode variables depend on it, including variables such as
6338 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6339 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6340 # files to appear (when present) in the UI as actual files and not red
6341 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6342 # and therefore SYMROOT, needs to be set at the project level.
6343 'SYMROOT': '<(DEPTH)/xcodebuild',