1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6 # Please don't directly include this file if you are building via gyp_chromium,
7 # since gyp_chromium is automatically forcing its inclusion.
9 # Variables expected to be overriden on the GYP command line (-D) or by
10 # ~/.gyp/include.gypi.
12 # Putting a variables dict inside another variables dict looks kind of
13 # weird. This is done so that 'host_arch', 'chromeos', etc are defined as
14 # variables within the outer variables dict here. This is necessary
15 # to get these variables defined for the conditions within this variables
16 # dict that operate on these variables.
21 # Whether we're building a ChromeOS build.
24 # Whether we're building the cast (chromecast) shell
27 # Whether or not we are using the Aura windowing framework.
30 # Whether or not we are building the Ash shell.
33 # Whether or not we are using CRAS, the ChromeOS Audio Server.
36 # Use a raw surface abstraction.
39 # Configure the build for small devices. See crbug.com/318413
43 # Compute the architecture that we're building on.
44 ['OS=="win" or OS=="ios"', {
47 'host_arch%': '<!pymod_do_main(detect_host_arch)',
51 # Copy conditionally-set variables out one scope.
52 'chromeos%': '<(chromeos)',
53 'chromecast%': '<(chromecast)',
54 'use_aura%': '<(use_aura)',
55 'use_ash%': '<(use_ash)',
56 'use_cras%': '<(use_cras)',
57 'use_ozone%': '<(use_ozone)',
58 'embedded%': '<(embedded)',
59 'host_arch%': '<(host_arch)',
61 # Whether we are using Views Toolkit
64 # Use the PCI lib to collect GPU information.
67 # Use OpenSSL instead of NSS as the underlying SSL and crypto
68 # implementation. Certificate verification will in most cases be
69 # handled by the OS. If OpenSSL's struct X509 is used to represent
70 # certificates, use_openssl_certs must be set.
73 # Use OpenSSL for representing certificates. When targeting Android,
74 # the platform certificate library is used for certificate
75 # verification. On other targets, this flag also enables OpenSSL for
76 # certificate verification, but this configuration is unsupported.
77 'use_openssl_certs%': 0,
79 # Disable viewport meta tag by default.
80 'enable_viewport%': 0,
82 # Enable HiDPI support.
85 # Enable top chrome material design.
86 'enable_topchrome_md%' : 0,
88 # Force building against pre-built sysroot image on linux. By default
89 # the sysroot image is only used for Official builds or when cross
90 # compiling to arm or mips.
93 # Override buildtype to select the desired build flavor.
94 # Dev - everyday build for development/testing
95 # Official - release build (generally implies additional processing)
96 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
97 # conversion is done), some of the things which are now controlled by
98 # 'branding', such as symbol generation, will need to be refactored
99 # based on 'buildtype' (i.e. we don't care about saving symbols for
100 # non-Official # builds).
103 # Override branding to select the desired branding flavor.
104 'branding%': 'Chromium',
107 # ChromeOS and Windows use Aura and Ash.
108 ['chromeos==1 or OS=="win" or OS=="linux"', {
113 ['chromecast==1 and OS!="android"', {
123 # Whether we're a traditional desktop unix.
124 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
130 # Embedded implies ozone.
136 'target_arch%': 'arm',
138 # Default architecture we're building for is the architecture we're
139 # building on, and possibly sub-architecture (for iOS builds).
140 'target_arch%': '<(host_arch)',
144 # Copy conditionally-set variables out one scope.
145 'chromeos%': '<(chromeos)',
146 'chromecast%': '<(chromecast)',
147 'desktop_linux%': '<(desktop_linux)',
148 'use_aura%': '<(use_aura)',
149 'use_ash%': '<(use_ash)',
150 'use_cras%': '<(use_cras)',
151 'use_ozone%': '<(use_ozone)',
152 'embedded%': '<(embedded)',
153 'use_libpci%': '<(use_libpci)',
154 'use_openssl%': '<(use_openssl)',
155 'use_openssl_certs%': '<(use_openssl_certs)',
156 'enable_viewport%': '<(enable_viewport)',
157 'enable_hidpi%': '<(enable_hidpi)',
158 'enable_topchrome_md%': '<(enable_topchrome_md)',
159 'buildtype%': '<(buildtype)',
160 'branding%': '<(branding)',
161 'branding_path_component%': '<(branding)',
162 'host_arch%': '<(host_arch)',
163 'target_arch%': '<(target_arch)',
165 'target_subarch%': '',
167 # The channel to build on Android: stable, beta, dev, canary, or
168 # default. "default" should be used on non-official builds.
169 'android_channel%': 'default',
171 # Set ARM architecture version.
174 # Use aurax11 for clipboard implementation. This is true on linux_aura.
175 'use_clipboard_aurax11%': 0,
179 # If no gomadir is set, it uses the default gomadir.
183 # The system root for cross-compiles. Default: none.
187 # The system libdir used for this ABI.
188 'system_libdir%': 'lib',
190 # Default MIPS arch variant. This is set in the conditions block
191 # below for MIPS targets.
192 'mips_arch_variant%': '',
194 # MIPS DSP ASE revision. Possible values are:
201 ['branding == "Chrome"', {
202 'branding_path_component%': 'google_chrome',
205 ['branding == "Chromium"', {
206 'branding_path_component%': 'chromium',
214 # Set default value of toolkit_views based on OS.
215 ['OS=="mac" or OS=="win" or chromeos==1 or use_aura==1', {
221 # Embedded builds use aura without ash or views.
228 # Enable HiDPI on Mac OS, Chrome OS, Windows and Linux.
229 ['OS=="mac" or chromeos==1 or OS=="win" or OS=="linux"', {
233 # Enable Top Chrome Material Design on Chrome OS, Windows, and Linux.
234 ['chromeos==1 or OS=="win" or OS=="linux"', {
235 'enable_topchrome_md%': 1,
238 # Enable the OpenSSL backend on Mac OS and Windows.
239 ['OS=="mac" or OS=="win"', {
243 # Enable App Launcher everywhere but mobile.
244 ['OS!="ios" and OS!="android"', {
245 'enable_app_list%': 1,
247 'enable_app_list%': 0,
250 ['use_aura==1 and OS!="android"', {
251 'use_default_render_theme%': 1,
253 'use_default_render_theme%': 0,
257 'use_ozone_evdev%': 1,
259 'use_ozone_evdev%': 0,
262 # Set default gomadir.
264 'gomadir': 'c:\\goma\\goma-win',
266 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
269 # Set the default "target_subarch" on iOS. Valid values are "arm32",
270 # "arm64" and "both" (meaning a fat binary).
272 'target_subarch%': 'arm64',
275 # Set arch variants for MIPS platforms.
276 ['target_arch=="mips64el"', {
279 'mips_arch_variant%': 'r6',
281 'mips_arch_variant%': 'r2',
286 ['target_arch=="mipsel"', {
287 'mips_arch_variant%': 'r1',
290 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
291 # sysroot needs to be an absolute path otherwise it generates
292 # incorrect results when passed to pkg-config
293 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/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)/mipsel-sysroot/sysroot',
313 # Copy conditionally-set variables out one scope.
314 'chromeos%': '<(chromeos)',
315 'chromecast%': '<(chromecast)',
316 'host_arch%': '<(host_arch)',
317 'target_arch%': '<(target_arch)',
318 'target_subarch%': '<(target_subarch)',
319 'mips_arch_variant%': '<(mips_arch_variant)',
320 'mips_dsp_rev%': '<(mips_dsp_rev)',
321 'toolkit_views%': '<(toolkit_views)',
322 'desktop_linux%': '<(desktop_linux)',
323 'use_aura%': '<(use_aura)',
324 'use_ash%': '<(use_ash)',
325 'use_cras%': '<(use_cras)',
326 'use_libpci%': '<(use_libpci)',
327 'use_ozone%': '<(use_ozone)',
328 'use_ozone_evdev%': '<(use_ozone_evdev)',
329 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
330 'embedded%': '<(embedded)',
331 'use_openssl%': '<(use_openssl)',
332 'use_openssl_certs%': '<(use_openssl_certs)',
333 'enable_viewport%': '<(enable_viewport)',
334 'enable_hidpi%': '<(enable_hidpi)',
335 'enable_topchrome_md%': '<(enable_topchrome_md)',
336 'android_channel%': '<(android_channel)',
337 'use_goma%': '<(use_goma)',
338 'gomadir%': '<(gomadir)',
339 'enable_app_list%': '<(enable_app_list)',
340 'use_default_render_theme%': '<(use_default_render_theme)',
341 'buildtype%': '<(buildtype)',
342 'branding%': '<(branding)',
343 'branding_path_component%': '<(branding_path_component)',
344 'arm_version%': '<(arm_version)',
345 'sysroot%': '<(sysroot)',
346 'chroot_cmd%': '<(chroot_cmd)',
347 'system_libdir%': '<(system_libdir)',
349 # Set to 1 to enable fast builds. Set to 2 for even faster builds
350 # (it disables debug info for fastest compilation - only for use
351 # on compile-only bots).
354 # Set to 1 to not store any build metadata, e.g. ifdef out all __DATE__
355 # and __TIME__. Set to 0 to reenable the use of these macros in the code
356 # base. See http://crbug.com/314403.
357 'dont_embed_build_metadata%': 1,
359 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
360 # This is useful for parallel compilation tools which can't support /Zi.
361 # Only used on Windows.
364 # Set to 1 to enable dcheck in Release build.
365 'dcheck_always_on%': 0,
367 # Set to 1 to make a build that disables unshipped tracing events.
368 # Note: this setting is ignored if buildtype=="Official".
369 'tracing_like_official_build%': 0,
371 # Disable image loader component extension by default.
372 'image_loader_extension%': 0,
374 # Set NEON compilation flags.
377 # Detect NEON support at run-time.
378 'arm_neon_optional%': 0,
380 # Use libjpeg-turbo as the JPEG codec used by Chromium.
381 'use_libjpeg_turbo%': 1,
383 # Use system libjpeg. Note that the system's libjepg will be used even if
384 # use_libjpeg_turbo is set.
385 'use_system_libjpeg%': 0,
387 # By default, component is set to static_library and it can be overriden
388 # by the GYP command line or by ~/.gyp/include.gypi.
389 'component%': 'static_library',
391 # /analyze is off by default on Windows because it is very slow and noisy.
392 # Enable with GYP_DEFINES=win_analyze=1
395 # Set to select the Title Case versions of strings in GRD files.
396 'use_titlecase_in_grd%': 0,
398 # Use translations provided by volunteers at launchpad.net. This
399 # currently only works on Linux.
400 'use_third_party_translations%': 0,
402 # Remoting compilation is enabled by default. Set to 0 to disable.
405 # Configuration policy is enabled by default. Set to 0 to disable.
406 'configuration_policy%': 1,
408 # Variable safe_browsing is used to control the build time configuration
409 # for safe browsing feature. Safe browsing can be compiled in 4 different
410 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
411 # reporting features for use with Data Saver on Mobile, and 3 enables
412 # extended mobile protection via an external API. When 3 is fully
413 # deployed, it will replace 2.
416 # Web speech is enabled by default. Set to 0 to disable.
417 'enable_web_speech%': 1,
419 # 'Ok Google' hotwording is disabled by default in open source builds. Set
420 # to 1 to enable. (This will download a closed-source NaCl module at
421 # startup.) Chrome-branded builds have this enabled by default.
422 'enable_hotwording%': 0,
424 # Notifications are compiled in by default. Set to 0 to disable.
425 'notifications%' : 1,
427 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
428 # regular builds and 1 for ASan builds.
429 'mac_want_real_dsym%': 'default',
431 # If this is set, the clang plugins used on the buildbot will be used.
432 # Run tools/clang/scripts/update.sh to make sure they are compiled.
433 # This causes 'clang_chrome_plugins_flags' to be set.
434 # Has no effect if 'clang' is not set as well.
435 'clang_use_chrome_plugins%': 1,
437 # Enable building with ASAN (Clang's -fsanitize=address option).
438 # -fsanitize=address only works with clang, but asan=1 implies clang=1
439 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
441 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
442 # Enable coverage gathering instrumentation in sanitizer tools. This flag
443 # also controls coverage granularity (1 for function-level coverage, 2
444 # for block-level coverage).
445 'sanitizer_coverage%': 0,
446 # Deprecated, only works if |sanitizer_coverage| isn't set.
447 # TODO(glider): remove this flag.
449 # Enable intra-object-overflow detection in ASan (experimental).
450 'asan_field_padding%': 0,
452 # Enable Chromium overrides of the default configurations for various
453 # dynamic tools (like ASan).
454 'use_sanitizer_options%': 0,
456 # Enable building with SyzyAsan.
457 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
460 # Enable crash reporting via Kasko.
463 # Enable building with LSan (Clang's -fsanitize=leak option).
464 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
465 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
468 # Enable building with TSan (Clang's -fsanitize=thread option).
469 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
470 # See http://clang.llvm.org/docs/ThreadSanitizer.html
472 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
474 # Enable building with MSan (Clang's -fsanitize=memory option).
475 # MemorySanitizer only works with clang, but msan=1 implies clang=1
476 # See http://clang.llvm.org/docs/MemorySanitizer.html
478 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
479 # Track where uninitialized memory originates from. From fastest to
480 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
481 # - track the chain of stores leading from allocation site to use site.
482 'msan_track_origins%': 2,
484 # Enable building with UBSan (Clang's -fsanitize=undefined option).
485 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
486 # See http://clang.llvm.org/docs/UsersManual.html
488 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
489 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/vptr_blacklist.txt',
491 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
492 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
495 # Use dynamic libraries instrumented by one of the sanitizers
496 # instead of the standard system libraries. Set this flag to build the
497 # libraries from source.
498 'use_instrumented_libraries%': 0,
500 # Use dynamic libraries instrumented by one of the sanitizers
501 # instead of the standard system libraries. Set this flag to download
502 # prebuilt binaries from GCS.
503 'use_prebuilt_instrumented_libraries%': 0,
505 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
506 # stdlibc++ as standard library. This is intended to use for instrumented
508 'use_custom_libcxx%': 0,
510 # Use system libc++ instead of the default C++ library, usually libstdc++.
511 # This is intended for iOS builds only.
512 'use_system_libcxx%': 0,
514 # Use a modified version of Clang to intercept allocated types and sizes
515 # for allocated objects. clang_type_profiler=1 implies clang=1.
516 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
517 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
518 'clang_type_profiler%': 0,
520 # Set to true to instrument the code with function call logger.
521 # See src/third_party/cygprofile/cyg-profile.cc for details.
522 'order_profiling%': 0,
524 # Use the provided profiled order file to link Chrome image with it.
525 # This makes Chrome faster by better using CPU cache when executing code.
526 # This is known as PGO (profile guided optimization).
527 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
528 'order_text_section%' : "",
530 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
531 # libraries on linux x86-64 and arm, plus ASLR.
534 # Whether one-click signin is enabled or not.
535 'enable_one_click_signin%': 0,
537 # Whether to back up data before sync.
538 'enable_pre_sync_backup%': 0,
540 # Enable Chrome browser extensions
541 'enable_extensions%': 1,
544 'enable_google_now%': 1,
546 # Enable basic printing support and UI.
547 'enable_basic_printing%': 1,
549 # Enable printing with print preview. It does not imply
550 # enable_basic_printing. It's possible to build Chrome with preview only.
551 'enable_print_preview%': 1,
553 # Set the version of CLD.
554 # 0: Don't specify the version. This option is for the Finch testing.
559 # For CLD2, the size of the tables that should be included in the build
560 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
562 # See third_party/cld_2/cld_2.gyp for more information.
563 # 0: Small tables, lower accuracy
564 # 2: Large tables, high accuracy
565 'cld2_table_size%': 2,
567 # Enable spell checker.
568 'enable_spellcheck%': 1,
570 # Webrtc compilation is enabled by default. Set to 0 to disable.
573 # Media router support is enabled by default. Set to 0 to disable.
574 'enable_media_router%': 1,
576 # Enables use of the session service, which is enabled by default.
577 # Support for disabling depends on the platform.
578 'enable_session_service%': 1,
580 # Enables theme support, which is enabled by default. Support for
581 # disabling depends on the platform.
584 # Enables autofill dialog and associated features; disabled by default.
585 'enable_autofill_dialog%' : 0,
587 # Defaults Wallet integration in Autofill dialog to use production
588 # servers. Unofficial builds won't have the proper API keys.
589 'enable_prod_wallet_service%': 0,
591 # Enables support for background apps.
592 'enable_background%': 1,
594 # Enable the task manager by default.
595 'enable_task_manager%': 1,
597 # Enables used resource whitelist generation; disabled by default.
598 'enable_resource_whitelist_generation%': 0,
600 # Enable FILE support by default.
601 'disable_file_support%': 0,
603 # Enable FTP support by default.
604 'disable_ftp_support%': 0,
606 # Use native android functions in place of ICU. Not supported by most
608 'use_icu_alternatives_on_android%': 0,
610 # Use of precompiled headers on Windows.
612 # This variable may be explicitly set to 1 (enabled) or 0
613 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
614 # This setting will override the default.
617 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
619 'chromium_win_pch%': 0,
622 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
623 # Set this to true when building with Clang.
624 # See http://code.google.com/p/chromium/wiki/Clang for details.
625 # If this is set, clang is used as both host and target compiler in
626 # cross-compile builds.
629 # Use experimental lld linker instead of the platform's default linker.
632 # Enable plugin installation by default.
633 'enable_plugin_installation%': 1,
635 # Specifies whether to use canvas_skia.cc in place of platform
636 # specific implementations of gfx::Canvas. Affects text drawing in the
638 # TODO(asvitkine): Enable this on all platforms and delete this flag.
639 # http://crbug.com/105550
640 'use_canvas_skia%': 0,
642 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
643 # with one of those tools.
644 'build_for_tool%': '',
646 'wix_path%': '<(DEPTH)/third_party/wix',
648 # Supervised users are enabled by default.
649 'enable_supervised_users%': 1,
651 # Platform sends memory pressure signals natively.
652 'native_memory_pressure_signals%': 0,
655 'enable_service_discovery%': 0,
656 'enable_wifi_bootstrapping%': 0,
657 'enable_hangout_services_extension%': 0,
659 # Enable the Syzygy optimization step.
660 'syzygy_optimize%': 0,
662 # Enable hole punching for the protected video.
665 # Automatically select platforms under ozone. Turn this off to
666 # build only explicitly selected platforms.
667 'ozone_auto_platforms%': 1,
669 # If this is set clang is used as host compiler, but not as target
670 # compiler. Always do this by default.
673 # Variables to control Link-Time Optimization (LTO).
674 # On Android, the variable use_lto enables LTO on code compiled with -Os,
675 # and use_lto_o2 enables LTO on code compiled with -O2. On other
676 # platforms, use_lto enables LTO in all translation units, and use_lto_o2
679 # On Linux and Android, when using LLVM LTO, the script
680 # build/download_gold_plugin.py must be run to download a linker plugin.
681 # On Mac, LLVM needs to be built from scratch using
682 # tools/clang/scripts/update.py and the absolute path to
683 # third_party/llvm-build/Release+Asserts/lib must be added to
684 # $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin.
686 # On Android, the variables must *not* be enabled at the same time.
687 # In this case LTO would 'merge' the optimization flags at link-time
688 # which would lead to all code be optimized with -O2. See crbug.com/407544
692 # Allowed level of identical code folding in the gold linker.
693 'gold_icf_level%': 'all',
695 # Libxkbcommon usage.
698 # Control Flow Integrity for virtual calls and casts.
699 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
702 'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
704 # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
705 'mac_views_browser%': 0,
707 # By default, use ICU data file (icudtl.dat).
708 'icu_use_data_file_flag%': 1,
710 # Turn on JNI generation optimizations by default.
711 'optimize_jni_generation%': 1,
714 # A flag for POSIX platforms
721 # A flag for BSD platforms
722 ['OS=="freebsd" or OS=="openbsd"', {
729 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris")', {
735 # libudev usage. This currently only affects the content layer.
736 ['OS=="linux" and embedded==0', {
742 # Flags to use X11 on non-Mac POSIX platforms.
743 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
750 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
756 # Flags to use pango and cairo.
757 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
766 ['OS=="linux" and embedded==0', {
772 # We always use skia text rendering in Aura on Windows, since GDI
773 # doesn't agree with our BackingStore.
774 # TODO(beng): remove once skia text rendering is on by default.
775 ['use_aura==1 and OS=="win"', {
776 'enable_skia_text%': 1,
779 # A flag to enable or disable our compile-time dependency
780 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
781 # support will be available. This option is useful
782 # for Linux distributions and for Aura.
783 ['OS!="linux" or chromeos==1', {
784 'use_gnome_keyring%': 0,
786 'use_gnome_keyring%': 1,
789 ['OS=="mac" or OS=="ios"', {
790 # Mac and iOS want Title Case strings
791 'use_titlecase_in_grd%': 1,
794 # Enable loader extensions on Chrome OS.
796 'image_loader_extension%': 1,
798 'image_loader_extension%': 0,
801 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
802 'enable_one_click_signin%': 1,
803 'enable_pre_sync_backup%': 1,
807 'enable_extensions%': 0,
808 'enable_google_now%': 0,
810 'enable_spellcheck%': 0,
814 'arm_neon_optional%': 1,
815 'native_memory_pressure_signals%': 1,
816 'enable_basic_printing%': 1,
817 'enable_print_preview%': 0,
818 'enable_task_manager%':0,
822 # Android OS includes support for proprietary codecs regardless of
823 # building Chromium or Google Chrome. We also ship Google Chrome and
824 # Chromecast with proprietary codecs.
825 ['OS=="android" or branding=="Chrome" or chromecast==1', {
826 'proprietary_codecs%': 1,
828 'proprietary_codecs%': 0,
831 ['OS=="mac" or OS=="ios"', {
832 'native_memory_pressure_signals%': 1,
835 # Enable autofill dialog when not on iOS.
837 'enable_autofill_dialog%': 1,
840 ['buildtype=="Official"', {
841 'enable_prod_wallet_service%': 1,
844 ['branding=="Chrome"', {
845 'enable_hotwording%': 1,
853 'disable_ftp_support%': 1,
854 'enable_extensions%': 0,
855 'enable_google_now%': 0,
857 'cld2_table_size%': 0,
858 'enable_basic_printing%': 0,
859 'enable_print_preview%': 0,
860 'enable_session_service%': 0,
861 'enable_spellcheck%': 0,
867 'enable_supervised_users%': 0,
868 'enable_task_manager%': 0,
869 'use_system_libcxx%': 1,
872 # Use GPU accelerated cross process image transport by default
873 # on linux builds with the Aura window manager
874 ['use_aura==1 and OS=="linux"', {
875 'ui_compositor_image_transport%': 1,
877 'ui_compositor_image_transport%': 0,
880 # Turn precompiled headers on by default.
881 ['OS=="win" and buildtype!="Official"', {
882 'chromium_win_pch%': 1
885 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
886 'enable_plugin_installation%': 0,
888 'enable_plugin_installation%': 1,
891 # Whether PPAPI is enabled.
892 ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
893 'enable_plugins%': 0,
895 'enable_plugins%': 1,
898 # linux_use_bundled_gold: whether to use the gold linker binary checked
899 # into third_party/binutils. Force this off via GYP_DEFINES when you
900 # are using a custom toolchain and need to control -B in ldflags.
901 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
902 # for component=static_library builds.
903 ['(OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm")', {
904 'linux_use_bundled_gold%': 1,
906 'linux_use_bundled_gold%': 0,
909 # linux_use_bundled_binutils: whether to use the binary binutils
910 # checked into third_party/binutils. These are not multi-arch so cannot
911 # be used except on x86 and x86-64 (the only two architectures which
912 # are currently checke in). Force this off via GYP_DEFINES when you
913 # are using a custom toolchain and need to control -B in cflags.
914 ['OS=="linux" and (target_arch=="x64")', {
915 'linux_use_bundled_binutils%': 1,
917 'linux_use_bundled_binutils%': 0,
920 # linux_use_gold_flags: whether to use build flags that rely on gold.
921 # On by default for x64 Linux.
922 ['OS=="linux" and target_arch=="x64"', {
923 'linux_use_gold_flags%': 1,
925 'linux_use_gold_flags%': 0,
928 # linux_use_debug_fission: whether to use split DWARF debug info
929 # files. This can reduce link time significantly, but is incompatible
930 # with some utilities such as icecc and ccache. Requires gold and
931 # gcc >= 4.8 or clang.
932 # http://gcc.gnu.org/wiki/DebugFission
933 ['OS=="linux" and target_arch=="x64"', {
934 'linux_use_debug_fission%': 1,
936 'linux_use_debug_fission%': 0,
939 ['OS=="android" or OS=="ios"', {
940 'enable_captive_portal_detection%': 0,
941 'enable_media_router%': 0,
943 'enable_captive_portal_detection%': 1,
944 'enable_media_router%': 1,
947 # Enable Skia UI text drawing incrementally on different platforms.
948 # http://crbug.com/105550
950 # On Aura, this allows per-tile painting to be used in the browser
952 ['OS!="android" and OS!="ios"', {
953 'use_canvas_skia%': 1,
957 'enable_basic_printing%': 0,
958 'enable_print_preview%': 1,
961 # Do not enable the Settings App on ChromeOS.
962 ['enable_app_list==1 and chromeos==0', {
963 'enable_settings_app%': 1,
965 'enable_settings_app%': 0,
968 # Whether tests targets should be run, archived or just have the
969 # dependencies verified. All the tests targets have the '_run' suffix,
970 # e.g. base_unittests_run runs the target base_unittests. The test
971 # target always calls tools/swarming_client/isolate.py. See the script's
972 # --help for more information. Meant to be overriden with GYP_DEFINES.
973 # TODO(maruel): Remove the conditions as more configurations are
975 ['OS!="ios" and OS!="android" and chromeos==0', {
976 'test_isolation_mode%': 'check',
978 'test_isolation_mode%': 'noop',
980 # Whether Android build uses OpenMAX DL FFT.
981 ['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")', {
982 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
983 # When enabled, this will also enable WebAudio support on
984 # Android for these architectures. Default is enabled. Whether
985 # WebAudio is actually available depends on runtime settings
987 'use_openmax_dl_fft%': 1,
989 'use_openmax_dl_fft%': 0,
991 ['OS=="win" or OS=="linux"', {
995 # Disable various features by default on embedded.
998 'enable_basic_printing%': 0,
999 'enable_print_preview%': 0,
1002 ['OS=="win" or OS=="mac"', {
1003 'enable_wifi_bootstrapping%' : 1,
1006 # Path to sas.dll, which provides the SendSAS function.
1007 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1008 ['target_arch=="x64"', {
1009 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1011 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1015 'pkg-config': '<(chroot_cmd) <(DEPTH)/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
1017 'pkg-config': 'pkg-config'
1021 # WebVR support disabled until platform implementations have been added
1024 # Setting this to '0' will cause V8's startup snapshot to be
1025 # embedded in the binary instead of being a external files.
1026 'v8_use_external_startup_data%': 1,
1028 # Set this to 1 to enable use of concatenated impulse responses
1029 # for the HRTF panner in WebAudio.
1030 'use_concatenated_impulse_responses': 1,
1032 # You can set the variable 'use_official_google_api_keys' to 1
1033 # to use the Google-internal file containing official API keys
1034 # for Google Chrome even in a developer build. Setting this
1035 # variable explicitly to 1 will cause your build to fail if the
1036 # internal file is missing.
1038 # The variable is documented here, but not handled in this file;
1039 # see //google_apis/determine_use_official_keys.gypi for the
1042 # Set the variable to 0 to not use the internal file, even when
1043 # it exists in your checkout.
1045 # Leave it unset in your include.gypi to have the variable
1046 # implicitly set to 1 if you have
1047 # src/google_apis/internal/google_chrome_api_keys.h in your
1048 # checkout, and implicitly set to 0 if not.
1050 # Note that official builds always behave as if the variable
1051 # was explicitly set to 1, i.e. they always use official keys,
1052 # and will fail to build if the internal file is missing.
1054 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1055 # include.gypi or by other means. Due to subtleties of GYP, this
1056 # is not the same as leaving the variable unset, even though its
1058 # //google_apis/determine_use_official_keys.gypi is 2.
1060 # Set these to bake the specified API keys and OAuth client
1061 # IDs/secrets into your build.
1063 # If you create a build without values baked in, you can instead
1064 # set environment variables to provide the keys at runtime (see
1065 # src/google_apis/google_api_keys.h for details). Features that
1066 # require server-side APIs may fail to work if no keys are
1069 # Note that if you are building an official build or if
1070 # use_official_google_api_keys has been set to 1 (explicitly or
1071 # implicitly), these values will be ignored and the official
1072 # keys will be used instead.
1073 'google_api_key%': '',
1074 'google_default_client_id%': '',
1075 'google_default_client_secret%': '',
1076 # Native Client is enabled by default.
1077 'disable_nacl%': '0',
1079 # Sets the default version name and code for Android app, by default we
1080 # do a developer build.
1081 'android_app_version_name%': 'Developer Build',
1082 'android_app_version_code%': 1,
1085 # Copy conditionally-set variables out one scope.
1086 'branding%': '<(branding)',
1087 'branding_path_component%': '<(branding_path_component)',
1088 'buildtype%': '<(buildtype)',
1089 'target_arch%': '<(target_arch)',
1090 'target_subarch%': '<(target_subarch)',
1091 'mips_arch_variant%': '<(mips_arch_variant)',
1092 'mips_dsp_rev%': '<(mips_dsp_rev)',
1093 'host_arch%': '<(host_arch)',
1094 'toolkit_views%': '<(toolkit_views)',
1095 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1096 'use_aura%': '<(use_aura)',
1097 'use_ash%': '<(use_ash)',
1098 'use_cras%': '<(use_cras)',
1099 'use_libpci%': '<(use_libpci)',
1100 'use_openssl%': '<(use_openssl)',
1101 'use_openssl_certs%': '<(use_openssl_certs)',
1102 'use_nss_certs%': '<(use_nss_certs)',
1103 'use_udev%': '<(use_udev)',
1104 'os_bsd%': '<(os_bsd)',
1105 'os_posix%': '<(os_posix)',
1106 'use_dbus%': '<(use_dbus)',
1107 'use_glib%': '<(use_glib)',
1108 'use_pango%': '<(use_pango)',
1109 'use_cairo%': '<(use_cairo)',
1110 'use_ozone%': '<(use_ozone)',
1111 'use_ozone_evdev%': '<(use_ozone_evdev)',
1112 'use_xkbcommon%': '<(use_xkbcommon)',
1113 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1114 'desktop_linux%': '<(desktop_linux)',
1115 'use_x11%': '<(use_x11)',
1116 'use_gnome_keyring%': '<(use_gnome_keyring)',
1117 'linux_fpic%': '<(linux_fpic)',
1118 'chromeos%': '<(chromeos)',
1119 'chromecast%': '<(chromecast)',
1120 'enable_viewport%': '<(enable_viewport)',
1121 'enable_hidpi%': '<(enable_hidpi)',
1122 'enable_topchrome_md%': '<(enable_topchrome_md)',
1123 'image_loader_extension%': '<(image_loader_extension)',
1124 'fastbuild%': '<(fastbuild)',
1125 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1126 'win_z7%': '<(win_z7)',
1127 'dcheck_always_on%': '<(dcheck_always_on)',
1128 'tracing_like_official_build%': '<(tracing_like_official_build)',
1129 'arm_version%': '<(arm_version)',
1130 'arm_neon%': '<(arm_neon)',
1131 'arm_neon_optional%': '<(arm_neon_optional)',
1132 'sysroot%': '<(sysroot)',
1133 'pkg-config%': '<(pkg-config)',
1134 'chroot_cmd%': '<(chroot_cmd)',
1135 'system_libdir%': '<(system_libdir)',
1136 'component%': '<(component)',
1137 'win_analyze%': '<(win_analyze)',
1138 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1139 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1140 'use_third_party_translations%': '<(use_third_party_translations)',
1141 'remoting%': '<(remoting)',
1142 'enable_one_click_signin%': '<(enable_one_click_signin)',
1143 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1144 'enable_media_router%': '<(enable_media_router)',
1145 'enable_webrtc%': '<(enable_webrtc)',
1146 'chromium_win_pch%': '<(chromium_win_pch)',
1147 'configuration_policy%': '<(configuration_policy)',
1148 'safe_browsing%': '<(safe_browsing)',
1149 'enable_web_speech%': '<(enable_web_speech)',
1150 'enable_hotwording%': '<(enable_hotwording)',
1151 'notifications%': '<(notifications)',
1152 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1153 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1155 'asan_blacklist%': '<(asan_blacklist)',
1156 'asan_coverage%': '<(asan_coverage)',
1157 'sanitizer_coverage%': '<(sanitizer_coverage)',
1158 'asan_field_padding%': '<(asan_field_padding)',
1159 'use_sanitizer_options%': '<(use_sanitizer_options)',
1160 'syzyasan%': '<(syzyasan)',
1161 'kasko%': '<(kasko)',
1162 'syzygy_optimize%': '<(syzygy_optimize)',
1165 'msan_blacklist%': '<(msan_blacklist)',
1166 'msan_track_origins%': '<(msan_track_origins)',
1168 'tsan_blacklist%': '<(tsan_blacklist)',
1169 'ubsan%': '<(ubsan)',
1170 'ubsan_blacklist%': '<(ubsan_blacklist)',
1171 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1172 'ubsan_vptr%': '<(ubsan_vptr)',
1173 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1174 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
1175 'use_custom_libcxx%': '<(use_custom_libcxx)',
1176 'use_system_libcxx%': '<(use_system_libcxx)',
1177 'clang_type_profiler%': '<(clang_type_profiler)',
1178 'order_profiling%': '<(order_profiling)',
1179 'order_text_section%': '<(order_text_section)',
1180 'enable_extensions%': '<(enable_extensions)',
1181 'enable_plugin_installation%': '<(enable_plugin_installation)',
1182 'enable_plugins%': '<(enable_plugins)',
1183 'enable_session_service%': '<(enable_session_service)',
1184 'enable_themes%': '<(enable_themes)',
1185 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1186 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1187 'enable_background%': '<(enable_background)',
1188 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1189 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1190 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1191 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1192 'use_canvas_skia%': '<(use_canvas_skia)',
1193 'test_isolation_mode%': '<(test_isolation_mode)',
1194 'enable_basic_printing%': '<(enable_basic_printing)',
1195 'enable_print_preview%': '<(enable_print_preview)',
1196 'enable_spellcheck%': '<(enable_spellcheck)',
1197 'enable_google_now%': '<(enable_google_now)',
1198 'cld_version%': '<(cld_version)',
1199 'cld2_table_size%': '<(cld2_table_size)',
1200 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1201 'disable_file_support%': '<(disable_file_support)',
1202 'disable_ftp_support%': '<(disable_ftp_support)',
1203 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1204 'enable_task_manager%': '<(enable_task_manager)',
1205 'sas_dll_path%': '<(sas_dll_path)',
1206 'wix_path%': '<(wix_path)',
1207 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1208 'use_system_libjpeg%': '<(use_system_libjpeg)',
1209 'android_channel%': '<(android_channel)',
1210 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1211 'gyp_managed_install%': 0,
1212 'create_standalone_apk%': 1,
1213 'enable_app_list%': '<(enable_app_list)',
1214 'use_default_render_theme%': '<(use_default_render_theme)',
1215 'enable_settings_app%': '<(enable_settings_app)',
1216 'google_api_key%': '<(google_api_key)',
1217 'google_default_client_id%': '<(google_default_client_id)',
1218 'google_default_client_secret%': '<(google_default_client_secret)',
1219 'enable_supervised_users%': '<(enable_supervised_users)',
1220 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1221 'enable_mdns%' : '<(enable_mdns)',
1222 'enable_service_discovery%' : '<(enable_service_discovery)',
1223 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1224 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1225 'proprietary_codecs%': '<(proprietary_codecs)',
1226 'use_goma%': '<(use_goma)',
1227 'gomadir%': '<(gomadir)',
1228 'use_lto%': '<(use_lto)',
1229 'use_lto_o2%': '<(use_lto_o2)',
1230 'gold_icf_level%': '<(gold_icf_level)',
1231 'video_hole%': '<(video_hole)',
1232 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1233 'cfi_vptr%': '<(cfi_vptr)',
1234 'cfi_blacklist%': '<(cfi_blacklist)',
1235 'mac_views_browser%': '<(mac_views_browser)',
1236 'android_app_version_name%': '<(android_app_version_name)',
1237 'android_app_version_code%': '<(android_app_version_code)',
1238 'enable_webvr%': '<(enable_webvr)',
1240 # Turns on compiler optimizations in V8 in Debug build.
1241 'v8_optimized_debug%': 1,
1243 # Use system protobuf instead of bundled one.
1244 'use_system_protobuf%': 0,
1246 # Use system yasm instead of bundled one.
1247 'use_system_yasm%': 0,
1249 # Use system ICU instead of bundled one.
1250 'use_system_icu%' : 0,
1252 # Default to enabled PIE; this is important for ASLR but we may need to be
1253 # able to turn it off for various reasons.
1254 'linux_disable_pie%': 0,
1256 # The release channel that this build targets. This is used to restrict
1257 # channel-specific build options, like which installer packages to create.
1258 # The default is 'all', which does no channel-specific filtering.
1261 # Override chromium_mac_pch and set it to 0 to suppress the use of
1262 # precompiled headers on the Mac. Prefix header injection may still be
1263 # used, but prefix headers will not be precompiled. This is useful when
1264 # using distcc to distribute a build to compile slaves that don't
1265 # share the same compiler executable as the system driving the compilation,
1266 # because precompiled headers rely on pointers into a specific compiler
1267 # executable's image. Setting this to 0 is needed to use an experimental
1268 # Linux-Mac cross compiler distcc farm.
1269 'chromium_mac_pch%': 1,
1271 # The default value for mac_strip in target_defaults. This cannot be
1272 # set there, per the comment about variable% in a target_defaults.
1273 'mac_strip_release%': 0,
1275 # Set to 1 to enable java code coverage. Instruments classes during build
1276 # to produce .ec files during runtime.
1277 'emma_coverage%': 0,
1279 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1280 # separated with whitespace and/or comma. Only has effect if
1281 # 'emma_coverage=1'.
1284 # Set to 1 to enable running Android lint on java/class files.
1287 # Although base/allocator lets you select a heap library via an
1288 # environment variable, the libcmt shim it uses sometimes gets in
1289 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1290 # 'win_use_allocator_shim': 0,
1291 # 'win_release_RuntimeLibrary': 2
1292 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1293 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1295 # TODO(bradnelson): eliminate this when possible.
1296 # To allow local gyp files to prevent release.vsprops from being included.
1297 # Yes(1) means include release.vsprops.
1298 # Once all vsprops settings are migrated into gyp, this can go away.
1299 'msvs_use_common_release%': 1,
1301 # TODO(bradnelson): eliminate this when possible.
1302 # To allow local gyp files to override additional linker options for msvs.
1303 # Yes(1) means set use the common linker options.
1304 'msvs_use_common_linker_extras%': 1,
1306 # TODO(sgk): eliminate this if possible.
1307 # It would be nicer to support this via a setting in 'target_defaults'
1308 # in chrome/app/locales/locales.gypi overriding the setting in the
1309 # 'Debug' configuration in the 'target_defaults' dict below,
1310 # but that doesn't work as we'd like.
1311 'msvs_debug_link_incremental%': '2',
1313 # Needed for some of the largest modules.
1314 'msvs_debug_link_nonincremental%': '1',
1316 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1317 # to get incremental linking to be faster in debug builds.
1318 'incremental_chrome_dll%': '0',
1320 # Experimental setting to break chrome.dll into multiple pieces based on
1322 'chrome_multiple_dll%': '0',
1324 # Experimental setting to optimize Chrome's DLLs with PGO.
1325 'chrome_pgo_phase%': '0',
1327 # Whether the VS xtree header has been patched to disable warning 4702. If
1328 # it has, then we don't need to disable 4702 (unreachable code warning).
1329 # The patch is preapplied to the internal toolchain and hence all bots.
1330 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1333 'clang%': '<(clang)',
1334 'host_clang%': '<(host_clang)',
1335 'make_clang_dir%': '<(make_clang_dir)',
1336 'use_lld%': '<(use_lld)',
1338 # Control which version of clang to use when building for iOS. If set to
1339 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1340 # the version of clang that ships with the Chromium source. This variable
1341 # is automatically set to '1' in Official builds.
1344 # These two variables can be set in GYP_DEFINES while running
1345 # |gclient runhooks| to let clang run a plugin in every compilation.
1346 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1348 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1351 'clang_add_plugin%': '',
1353 # Tell ld64 to write map files describing binary layout. Useful
1354 # for looking at what contributes to binary size, e.g. with
1355 # https://github.com/nico/bloat
1356 'mac_write_linker_maps%': 0,
1358 # The default type of gtest.
1359 'gtest_target_type%': 'executable',
1361 # Enable sampling based profiler.
1362 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1364 # Profile without optimizing out stack frames when profiling==1.
1365 'profiling_full_stack_frames%': '0',
1367 # And if we want to dump symbols for Breakpad-enabled builds.
1368 'linux_dump_symbols%': 0,
1369 # And if we want to strip the binary after dumping symbols.
1370 'linux_strip_binary%': 0,
1371 # If we want stack unwind support for backtrace().
1372 'debug_unwind_tables%': 1,
1373 'release_unwind_tables%': 1,
1375 # Override where to find binutils
1376 'binutils_version%': 0,
1377 'binutils_dir%': '',
1380 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1381 'use_allocator%': 'tcmalloc',
1383 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1384 'linux_link_gnome_keyring%': 0,
1385 # Set to 1 to link against gsettings APIs instead of using dlopen().
1386 'linux_link_gsettings%': 0,
1388 # Enable use of OpenMAX DL FFT routines.
1389 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1391 # Enable new NPDevice API.
1392 'enable_new_npdevice_api%': 0,
1394 # .gyp files or targets should set chromium_code to 1 if they build
1395 # Chromium-specific code, as opposed to external code. This variable is
1396 # used to control such things as the set of warnings to enable, and
1397 # whether warnings are treated as errors.
1398 'chromium_code%': 0,
1400 # Disable fatal linker warnings, similarly to how we make it possible
1401 # to disable -Werror (e.g. for different toolchain versions).
1402 'disable_fatal_linker_warnings%': 0,
1404 'release_valgrind_build%': 0,
1406 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1407 'enable_wexit_time_destructors%': 0,
1409 # Build libpeerconnection as a static library by default.
1410 'libpeer_target_type%': 'static_library',
1412 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1413 'internal_gles2_conform_tests%': 0,
1415 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1416 'internal_khronos_glcts_tests%': 0,
1418 # Set to 1 to compile the filter fuzzer.
1419 'internal_filter_fuzzer%': 0,
1421 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1422 # so Cocoa is happy (http://crbug.com/20441).
1424 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1425 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1426 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1427 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1428 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1429 'vi', 'zh-CN', 'zh-TW',
1432 # Pseudo locales are special locales which are used for testing and
1433 # debugging. They don't get copied to the final app. For more info,
1434 # check out https://www.chromium.org/developers/testing/fake-bidi
1441 # If debug_devtools is set to 1, JavaScript files for DevTools are
1442 # stored as is and loaded from disk. Otherwise, a concatenated file
1443 # is stored in resources.pak. It is still possible to load JS files
1444 # from disk by passing --debug-devtools cmdline switch.
1445 'debug_devtools%': 0,
1447 # The Java Bridge is not compiled in by default.
1450 # Code signing for iOS binaries. The bots need to be able to disable this.
1451 'chromium_ios_signing%': 1,
1453 # This flag is only used when disable_nacl==0 and disables all those
1454 # subcomponents which would require the installation of a native_client
1455 # untrusted toolchain.
1456 'disable_nacl_untrusted%': 0,
1458 # PNaCl toolchain does not support sanitizers. Disable by default.
1459 'enable_nacl_nonsfi_test%': 0,
1461 # Disable Dart by default.
1464 # Copy out the setting of disable_nacl.
1465 'disable_nacl%': '<(disable_nacl)',
1467 # Portable Native Client is enabled by default.
1468 'disable_pnacl%': 0,
1470 # Whether to build full debug version for Debug configuration on Android.
1471 # Compared to full debug version, the default Debug configuration on Android
1472 # has no full v8 debug, has size optimization and linker gc section, so that
1473 # we can build a debug version with acceptable size and performance.
1474 'android_full_debug%': 0,
1476 # Contains data about the attached devices for gyp_managed_install.
1477 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1479 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1480 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1482 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1483 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1485 # Whether we are using the rlz library or not. Platforms like Android send
1486 # rlz codes for searches but do not use the library.
1489 # Turns on the i18n support in V8.
1490 'v8_enable_i18n_support': 1,
1492 # Compile d8 for the host toolset.
1493 'v8_toolset_for_d8': 'host',
1495 # Use brlapi from brltty for braille display support.
1498 # Relative path to icu.gyp from this file.
1499 'icu_gyp_path': '../third_party/icu/icu.gyp',
1501 # IPC fuzzer is disabled by default.
1502 'enable_ipc_fuzzer%': 0,
1504 # Force disable libstdc++ debug mode.
1505 'disable_glibcxx_debug%': 0,
1507 # Set to 1 to compile with MSE support for MPEG2 TS
1508 'enable_mpeg2ts_stream_parser%': 0,
1510 # Support ChromeOS touchpad gestures with ozone.
1511 'use_evdev_gestures%': 0,
1513 # Default ozone platform (if no --ozone-platform flag).
1514 'ozone_platform%': "",
1516 # Ozone platforms to include in the build.
1517 'ozone_platform_caca%': 0,
1518 'ozone_platform_cast%': 0,
1519 'ozone_platform_dri%': 0,
1520 'ozone_platform_drm%': 0,
1521 'ozone_platform_egltest%': 0,
1522 'ozone_platform_gbm%': 0,
1523 'ozone_platform_ozonex%': 0,
1524 'ozone_platform_test%': 0,
1526 # Experiment: http://crbug.com/426914
1529 # Used to set libjpeg_gyp_path. Chrome OS ui/gfx/gfx.gyp uses the IJG path
1530 # for robust login screen decoding.
1531 'libjpeg_ijg_gyp_path': '<(DEPTH)/third_party/libjpeg/libjpeg.gyp',
1532 'libjpeg_turbo_gyp_path': '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp',
1535 ['buildtype=="Official"', {
1536 # Continue to embed build meta data in Official builds, basically the
1537 # time it was built.
1538 # TODO(maruel): This decision should be revisited because having an
1539 # official deterministic build has high value too but MSVC toolset can't
1540 # generate anything deterministic with WPO enabled AFAIK.
1541 'dont_embed_build_metadata%': 0,
1543 # Enable the Syzygy optimization step for the official builds.
1544 ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
1545 'syzygy_optimize%': 1,
1547 'syzygy_optimize%': 0,
1549 # Get binutils version so we can enable debug fission if we can.
1550 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1552 # compiler_version doesn't work with clang
1553 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1554 # compiler_version works with clang.
1555 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1556 # that it takes effect here.
1557 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1558 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1560 # On Android we know the binutils version in the toolchain.
1562 'binutils_version%': 222,
1564 ['host_arch=="x64"', {
1565 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1567 ['host_arch=="ia32"', {
1568 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1570 # Our version of binutils in third_party/binutils
1571 ['linux_use_bundled_binutils==1', {
1572 'binutils_version%': 224,
1576 'binutils_version%': 0,
1578 # The version of GCC in use, set later in platforms that use GCC and have
1579 # not explicitly chosen to build with clang. Currently, this means all
1580 # platforms except Windows, Mac and iOS.
1581 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1582 # it takes effect here.
1583 ['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', {
1586 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1587 # We directly set the gcc version since we know what we use.
1590 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1591 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1595 'host_gcc_version%': 0,
1598 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1599 'directx_sdk_path%': '<(directx_sdk_default_path)',
1601 'directx_sdk_path%': '$(DXSDK_DIR)',
1604 'windows_driver_kit_path%': '$(WDK_DIR)',
1606 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1608 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1611 'nacl_untrusted_build%': 0,
1612 'use_allocator%': 'none',
1614 # Use a 64-bit linker to avoid running out of address space. The
1615 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1616 ['host_arch=="ia32" and target_arch=="ia32"', {
1617 # TODO(thestig) This is a horrible way to force the desired
1618 # configuration. Our gyp variable scoping is likely wrong and
1619 # needs to be cleaned up. The GN configuration should be changed
1621 'binutils_version%': 224,
1622 'linux_use_bundled_binutils%': '1',
1623 'linux_use_bundled_gold%': '1',
1624 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1626 # All Chrome builds have breakpad symbols, but only process the
1627 # symbols from official builds.
1628 ['(branding=="Chrome" and buildtype=="Official")', {
1629 'linux_dump_symbols%': 1,
1631 # Omit unwind support in official release builds to save space. We
1632 # can use breakpad for these builds.
1633 'release_unwind_tables%': 0,
1636 }], # os_posix==1 and OS!="mac" and OS!="ios"
1639 'enable_background%': 0,
1640 'icu_use_data_file_flag%': 1,
1641 'enable_web_speech%': 0,
1642 'use_system_libxml%': 1,
1643 'use_system_sqlite%': 1,
1645 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1646 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1647 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1648 'uk', 'vi', 'zh-CN', 'zh-TW',
1651 # iOS SDK and deployment target support. The |ios_sdk| value is left
1652 # blank so that when it is set in the project files it will be the
1653 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1654 # causes Xcode to spit out a warning for every single project file for
1655 # not using the "current" SDK.
1657 'ios_sdk_path%': '',
1658 'ios_deployment_target%': '7.0',
1661 # ios_product_name is set to the name of the .app bundle as it should
1663 ['branding=="Chrome"', {
1664 'ios_product_name%': 'Chrome',
1665 }, { # else: branding!="Chrome"
1666 'ios_product_name%': 'Chromium',
1668 ['branding=="Chrome" and buildtype=="Official"', {
1670 }, { # else: branding!="Chrome" or buildtype!="Official"
1676 # Location of Android NDK.
1679 # Standard libraries can use the relative path to the NDK.
1680 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1681 # Unfortunately, it is required to use the absolute path to the SDK
1682 # because it us passed to ant which uses a different relative path
1684 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1685 # Similarly, gdbserver and the Android toolchain need to use the
1686 # absolute path to the NDK because they are used at different levels
1688 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1689 'android_host_arch%': '<!(uname -m)',
1690 # Android API-level of the SDK used for compilation.
1691 'android_sdk_version%': '22',
1692 'android_sdk_build_tools_version%': '22.0.0',
1693 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1695 # Copy conditionally-set variables out one scope.
1696 'android_ndk_root%': '<(android_ndk_root)',
1697 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1698 'android_sdk_root%': '<(android_sdk_root)',
1699 'android_sdk_version%': '<(android_sdk_version)',
1700 'android_libcpp_root': '<(android_ndk_root)/sources/cxx-stl/llvm-libc++',
1701 'host_os%': '<(host_os)',
1703 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1704 # Android SDK build tools (e.g. dx, aidl)
1705 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1707 # Android API level 16 is JB (Android 4.1) which is the minimum
1708 # platform requirement for Chrome on Android, we use it for native
1711 ['target_arch == "ia32"', {
1712 'android_app_abi%': 'x86',
1713 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
1714 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-x86',
1715 'android_ndk_lib_dir%': 'usr/lib',
1716 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1718 ['target_arch == "x64"', {
1719 'android_app_abi%': 'x86_64',
1720 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1721 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1722 'android_ndk_lib_dir%': 'usr/lib64',
1723 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1725 ['target_arch=="arm"', {
1728 'android_app_abi%': 'armeabi',
1730 'android_app_abi%': 'armeabi-v7a',
1733 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
1734 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-arm',
1735 'android_ndk_lib_dir%': 'usr/lib',
1736 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1738 ['target_arch == "arm64"', {
1739 'android_app_abi%': 'arm64-v8a',
1740 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1741 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1742 'android_ndk_lib_dir%': 'usr/lib',
1743 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1745 ['target_arch == "mipsel"', {
1746 'android_app_abi%': 'mips',
1747 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
1748 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-mips',
1749 'android_ndk_lib_dir%': 'usr/lib',
1750 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1752 ['target_arch == "mips64el"', {
1753 'android_app_abi%': 'mips64',
1754 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1755 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1756 'android_ndk_lib_dir%': 'usr/lib64',
1757 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1761 # Copy conditionally-set variables out one scope.
1762 'android_app_abi%': '<(android_app_abi)',
1763 'android_gdbserver%': '<(android_gdbserver)',
1764 'android_ndk_root%': '<(android_ndk_root)',
1765 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1766 'android_sdk_root%': '<(android_sdk_root)',
1767 'android_sdk_version%': '<(android_sdk_version)',
1768 'android_toolchain%': '<(android_toolchain)',
1770 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1771 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1772 'android_sdk_tools%': '<(android_sdk_tools)',
1773 'android_aapt_path%': '<(android_sdk_tools)/aapt',
1774 'android_sdk%': '<(android_sdk)',
1775 'android_sdk_jar%': '<(android_sdk)/android.jar',
1777 'android_libcpp_root': '<(android_libcpp_root)',
1778 'android_libcpp_include': '<(android_libcpp_root)/libcxx/include',
1779 'android_libcpp_libs_dir': '<(android_libcpp_root)/libs/<(android_app_abi)',
1780 'host_os%': '<(host_os)',
1782 # Location of the "objcopy" binary, used by both gyp and scripts.
1783 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1785 # Location of the "strip" binary, used by both gyp and scripts.
1786 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1788 # Location of the "readelf" binary.
1789 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1791 # Determines whether we should optimize JNI generation at the cost of
1792 # breaking assumptions in the build system that when inputs have changed
1793 # the outputs should always change as well. This is meant purely for
1794 # developer builds, to avoid spurious re-linking of native files.
1795 'optimize_jni_generation%': '<(optimize_jni_generation)',
1797 # Always uses openssl.
1799 'use_openssl_certs%': 1,
1801 'proprietary_codecs%': '<(proprietary_codecs)',
1802 'safe_browsing%': 2,
1803 'enable_web_speech%': 0,
1805 'build_ffmpegsumo%': 0,
1806 'use_allocator%': 'none',
1808 # Disable Native Client.
1811 # Android does not support background apps.
1812 'enable_background%': 0,
1814 # Sessions are store separately in the Java side.
1815 'enable_session_service%': 0,
1819 'gtest_target_type%': 'shared_library',
1822 'use_system_fontconfig%': 0,
1824 'use_system_fontconfig%': 1,
1827 'enable_mpeg2ts_stream_parser%': 1,
1828 'ffmpeg_branding%': 'ChromeOS',
1829 'ozone_platform_ozonex%': 1,
1830 'use_custom_freetype%': 0,
1831 'use_playready%': 0,
1833 ['target_arch=="arm"', {
1835 'arm_tune%': 'cortex-a9',
1841 ['chromecast==1 and OS!="android"', {
1842 'ozone_platform_cast%': 1
1844 ['OS=="linux" and target_arch!="mipsel"', {
1849 # All Chrome builds have breakpad symbols, but only process the
1850 # symbols from official builds.
1851 ['(branding=="Chrome" and buildtype=="Official")', {
1852 'mac_strip_release%': 1,
1856 ['OS=="mac" or OS=="ios"', {
1860 # Mac OS X SDK and deployment target support. The SDK identifies
1861 # the version of the system headers that will be used, and
1862 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1863 # macro. "Maximum allowed" refers to the operating system version
1864 # whose APIs are available in the headers. The deployment target
1865 # identifies the minimum system version that the built products are
1866 # expected to function on. It corresponds to the
1867 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1868 # macros are available, #include <AvailabilityMacros.h>. Additional
1869 # documentation on these macros is available at
1870 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1871 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1872 # deployment target to 10.6. Other projects, such as O3D, may
1873 # override these defaults.
1875 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1876 # about that is at least the specified version. In official builds,
1877 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1878 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1879 # path to the SDK; when set to a non-empty string, SDK detection
1880 # based on mac_sdk_min will be bypassed entirely.
1883 'mac_sdk_min%': '10.8',
1884 }, { # else OS!="ios"
1885 'mac_sdk_min%': '10.6',
1888 'mac_sdk_path%': '',
1890 'mac_deployment_target%': '10.6',
1893 'mac_sdk_min': '<(mac_sdk_min)',
1894 'mac_sdk_path': '<(mac_sdk_path)',
1895 'mac_deployment_target': '<(mac_deployment_target)',
1897 # Compile in Breakpad support by default so that it can be
1898 # tested, even if it is not enabled by default at runtime.
1899 'mac_breakpad_compiled_in%': 1,
1901 # mac_product_name is set to the name of the .app bundle as it should
1902 # appear on disk. This duplicates data from
1903 # chrome/app/theme/chromium/BRANDING and
1904 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1905 # these names into the build system.
1906 ['branding=="Chrome"', {
1907 'mac_product_name%': 'Google Chrome',
1908 }, { # else: branding!="Chrome"
1909 'mac_product_name%': 'Chromium',
1911 # Official mac builds require a specific OS X SDK, but iOS and
1912 # non-official mac builds do not.
1913 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1914 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1916 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1918 ['branding=="Chrome" and buildtype=="Official"', {
1919 # Enable uploading crash dumps.
1920 'mac_breakpad_uploads%': 1,
1921 # Enable dumping symbols at build time for use by Mac Breakpad.
1923 # Enable Keystone auto-update support.
1925 }, { # else: branding!="Chrome" or buildtype!="Official"
1926 'mac_breakpad_uploads%': 0,
1931 }], # OS=="mac" or OS=="ios"
1934 # This is the architecture convention used in WinSDK paths.
1935 ['target_arch=="ia32"', {
1936 'winsdk_arch%': 'x86',
1938 'winsdk_arch%': '<(target_arch)',
1940 ['component=="shared_library" or MSVS_VERSION == "2015"', {
1941 # TODO(scottmg): The allocator shimming doesn't work on the 2015 CRT
1942 # and we are hoping to be able to remove it if an additional feature
1943 # lands in the 2015 CRT API. For now, don't shim and revisit once
1944 # VS2015 is RTM: http://crbug.com/481611.
1945 'win_use_allocator_shim%': 0,
1947 ['component=="static_library"', {
1948 # Turn on multiple dll by default on Windows when in static_library.
1949 'chrome_multiple_dll%': 1,
1951 ['asan==1 or syzyasan==1', {
1952 'win_use_allocator_shim%': 0,
1957 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1958 # Only enabled by default for ninja because it's buggy in VS.
1959 # Not enabled for component=static_library because some targets
1960 # are too large and the toolchain fails due to the size of the
1962 'incremental_chrome_dll%': 1,
1964 # Don't do incremental linking for large modules on 32-bit or when
1965 # component=static_library as the toolchain fails due to the size of
1967 ['MSVS_OS_BITS==32 or component=="static_library"', {
1968 'msvs_large_module_debug_link_mode%': '1', # No
1970 'msvs_large_module_debug_link_mode%': '2', # Yes
1973 'nacl_win64_defines': [
1974 # This flag is used to minimize dependencies when building
1975 # Native Client loader for 64-bit Windows.
1978 # Need to include allocator target, but exclude tcmalloc files.
1979 'use_allocator%': 'winheap',
1982 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1988 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win") and chromecast==0', {
1989 'enable_pepper_cdms%': 1,
1991 'enable_pepper_cdms%': 0,
1994 ['OS=="android" or chromecast==1', {
1995 'enable_browser_cdms%': 1,
1997 'enable_browser_cdms%': 0,
2000 # Native Client glibc toolchain is enabled
2001 # by default except on arm, mips and mips64.
2002 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
2003 'disable_glibc%': 1,
2005 'disable_glibc%': 0,
2008 # Set the relative path from this file to the GYP file of the JPEG
2009 # library used by Chromium.
2010 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2011 # Configuration for using the system libjeg is here.
2012 'libjpeg_gyp_path': '<(libjpeg_ijg_gyp_path)',
2014 'libjpeg_gyp_path': '<(libjpeg_turbo_gyp_path)',
2017 # Options controlling the use of GConf (the classic GNOME configuration
2018 # system) and GIO, which contains GSettings (the new GNOME config system).
2019 ['chromeos==1 or embedded==1', {
2027 # Set up -D and -E flags passed into grit.
2028 ['branding=="Chrome"', {
2029 # TODO(mmoss) The .grd files look for _google_chrome, but for
2030 # consistency they should look for google_chrome_build like C++.
2031 'grit_defines': ['-D', '_google_chrome',
2032 '-E', 'CHROMIUM_BUILD=google_chrome'],
2034 'grit_defines': ['-D', '_chromium',
2035 '-E', 'CHROMIUM_BUILD=chromium'],
2038 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2040 ['desktop_linux==1', {
2041 'grit_defines': ['-D', 'desktop_linux'],
2043 ['toolkit_views==1', {
2044 'grit_defines': ['-D', 'toolkit_views'],
2047 'grit_defines': ['-D', 'use_aura'],
2050 'grit_defines': ['-D', 'use_ash'],
2052 ['use_nss_certs==1', {
2053 'grit_defines': ['-D', 'use_nss_certs'],
2056 'grit_defines': ['-D', 'use_ozone'],
2058 ['image_loader_extension==1', {
2059 'grit_defines': ['-D', 'image_loader_extension'],
2062 'grit_defines': ['-D', 'remoting'],
2064 ['use_titlecase_in_grd==1', {
2065 'grit_defines': ['-D', 'use_titlecase'],
2067 ['use_third_party_translations==1', {
2068 'grit_defines': ['-D', 'use_third_party_translations'],
2070 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2071 'ka', 'ku', 'kw', 'ms', 'ug'
2077 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2078 '--no-output-all-resource-defines',
2081 ['OS=="mac" or OS=="ios"', {
2082 'grit_defines': ['-D', 'scale_factors=2x'],
2086 'enable_coverage%': 0,
2090 '--no-output-all-resource-defines',
2092 # iOS uses a whitelist to filter resources.
2093 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2095 # Enable host builds when generating with ninja-ios.
2097 ['"<(GENERATOR)"=="ninja"', {
2101 # Use the version of clang shipped with Xcode when building official
2102 # version of Chrome for iOS.
2104 # TODO(eugenebut): Remove enable_coverage check once
2105 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2106 # http://crbug.com/450379
2108 # TODO(sdefresne): Remove xcodebuild version check onces clang ToT
2109 # supports "nullable" and related. https://crbug.com/499448
2110 ['buildtype=="Official" or enable_coverage or '
2111 '<!(xcodebuild -version|awk \'/Xcode/{print ($2 >= 7.0)}\')==1', {
2116 ['enable_extensions==1', {
2117 'grit_defines': ['-D', 'enable_extensions'],
2119 ['enable_plugins!=0', {
2120 'grit_defines': ['-D', 'enable_plugins'],
2122 ['enable_basic_printing==1 or enable_print_preview==1', {
2123 'grit_defines': ['-D', 'enable_printing'],
2125 ['enable_print_preview==1', {
2126 'grit_defines': ['-D', 'enable_print_preview'],
2128 ['enable_themes==1', {
2129 'grit_defines': ['-D', 'enable_themes'],
2131 ['enable_app_list==1', {
2132 'grit_defines': ['-D', 'enable_app_list'],
2134 ['enable_settings_app==1', {
2135 'grit_defines': ['-D', 'enable_settings_app'],
2137 ['enable_google_now==1', {
2138 'grit_defines': ['-D', 'enable_google_now'],
2140 ['use_concatenated_impulse_responses==1', {
2141 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2143 ['enable_media_router==1', {
2144 'grit_defines': ['-D', 'enable_media_router'],
2146 ['enable_webrtc==1', {
2147 'grit_defines': ['-D', 'enable_webrtc'],
2149 ['enable_hangout_services_extension==1', {
2150 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2152 ['enable_task_manager==1', {
2153 'grit_defines': ['-D', 'enable_task_manager'],
2155 ['notifications==1', {
2156 'grit_defines': ['-D', 'enable_notifications'],
2158 ['enable_wifi_bootstrapping==1', {
2159 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2161 ['mac_views_browser==1', {
2162 'grit_defines': ['-D', 'mac_views_browser'],
2164 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2165 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2167 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2168 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2170 ['enable_mdns==1 or OS=="mac"', {
2171 'grit_defines': ['-D', 'enable_service_discovery'],
2172 'enable_service_discovery%': 1
2174 ['clang_use_chrome_plugins==1', {
2180 ['OS=="mac" or OS=="ios"', {
2181 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2182 }, { # OS != "mac" or OS != "ios"
2183 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
2187 'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ',
2189 # On Windows, the plugin is built directly into clang, so there's
2190 # no need to load it dynamically.
2191 'clang_dynlib_flags%': '',
2193 # https://crbug.com/441916
2194 ['OS=="android" or OS=="linux" or OS=="mac"', {
2195 'clang_plugin_args%': '-Xclang -plugin-arg-find-bad-constructs -Xclang check-templates ',
2196 }, { # OS != "linux"
2197 'clang_plugin_args%': ''
2201 # If you change these, also change build/config/clang/BUILD.gn.
2202 'clang_chrome_plugins_flags%':
2203 '<(clang_dynlib_flags)'
2204 '-Xclang -add-plugin -Xclang find-bad-constructs <(clang_plugin_args)',
2206 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2208 'use_allocator%': 'none',
2209 'use_sanitizer_options%': 1,
2212 ['OS=="linux" and asan==0 and msan==0 and lsan==0 and tsan==0', {
2213 # PNaCl toolchain Non-SFI build only supports linux OS build.
2214 # Also, it does not support sanitizers.
2215 'enable_nacl_nonsfi_test%': 1,
2217 ['asan==1 and OS=="linux" and chromeos==0', {
2218 'use_custom_libcxx%': 1,
2226 ['asan==1 and OS=="mac"', {
2227 'mac_strip_release': 1,
2230 'use_custom_libcxx%': 1,
2233 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2234 # libstdc++. This is required to avoid false positive reports whenever
2235 # the C++ standard library is used.
2236 'use_custom_libcxx%': 1,
2237 # Running the V8-generated code on an ARM simulator is a powerful hack
2238 # that allows the tool to see the memory accesses from JITted code.
2239 # Without this flag, JS code causes false positive reports from MSan.
2240 'v8_target_arch': 'arm64',
2243 ['OS=="linux" and clang_type_profiler==1', {
2245 'clang_use_chrome_plugins%': 0,
2247 ['host_arch=="x64"', {
2248 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2250 ['host_arch=="ia32"', {
2251 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2252 # Clang in this directory at your own risk if needed for some
2253 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2254 # usage). Any failure by this compiler should not close the tree.
2255 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2260 # On valgrind bots, override the optimizer settings so we don't inline too
2261 # much and make the stacks harder to figure out.
2263 # TODO(rnk): Kill off variables that no one else uses and just implement
2264 # them under a build_for_tool== condition.
2265 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2267 'mac_debug_optimization': '1',
2268 'mac_release_optimization': '1',
2269 'release_optimize': '1',
2270 'no_gc_sections': 1,
2271 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2272 '-fno-builtin -fno-optimize-sibling-calls',
2273 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2274 '-fno-builtin -fno-optimize-sibling-calls',
2276 # MSVS flags for TSan on Pin and Windows.
2277 'win_debug_RuntimeChecks': '0',
2278 'win_debug_disable_iterator_debugging': '1',
2279 'win_debug_Optimization': '1',
2280 'win_debug_InlineFunctionExpansion': '0',
2281 'win_release_InlineFunctionExpansion': '0',
2282 'win_release_OmitFramePointers': '0',
2284 'use_allocator': 'tcmalloc',
2285 'release_valgrind_build': 1,
2287 'component': 'static_library',
2288 'use_system_zlib': 0,
2291 # Build tweaks for DrMemory.
2292 # TODO(rnk): Combine with tsan config to share the builder.
2293 # http://crbug.com/108155
2294 ['build_for_tool=="drmemory"', {
2295 # These runtime checks force initialization of stack vars which blocks
2296 # DrMemory's uninit detection.
2297 'win_debug_RuntimeChecks': '0',
2298 # Iterator debugging is slow.
2299 'win_debug_disable_iterator_debugging': '1',
2300 # Try to disable optimizations that mess up stacks in a release build.
2301 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2302 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2303 # compiler bug, so we use /Ob1 instead.
2304 'win_release_InlineFunctionExpansion': '1',
2305 'win_release_OmitFramePointers': '0',
2306 # Ditto for debug, to support bumping win_debug_Optimization.
2307 'win_debug_InlineFunctionExpansion': 0,
2308 'win_debug_OmitFramePointers': 0,
2309 # Keep the code under #ifndef NVALGRIND.
2310 'release_valgrind_build': 1,
2313 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2314 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2318 # Set default compiler flags depending on ARM version.
2319 ['arm_version==6', {
2320 'arm_arch%': 'armv6',
2323 'arm_float_abi%': 'softfp',
2326 ['arm_version==7', {
2327 'arm_arch%': 'armv7-a',
2328 'arm_tune%': 'generic-armv7-a',
2333 'arm_fpu%': 'vfpv3-d16',
2336 'arm_float_abi%': 'softfp',
2338 'arm_float_abi%': 'hard',
2344 # Set default compiler flags for MIPS floating-point support.
2345 ['target_arch=="mipsel"', {
2346 'mips_float_abi%': 'hard',
2348 ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
2349 'mips_fpu_mode%': 'fp32',
2352 # Enable brlapi by default for chromeos.
2357 ['use_ozone==1 and ozone_auto_platforms==1', {
2358 # Use test as the default platform.
2359 'ozone_platform%': 'test',
2361 # Build all platforms whose deps are in install-build-deps.sh.
2362 # Only these platforms will be compile tested by buildbots.
2363 'ozone_platform_dri%': 1,
2364 'ozone_platform_drm%': 1,
2365 'ozone_platform_test%': 1,
2366 'ozone_platform_egltest%': 1,
2369 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2370 'use_clipboard_aurax11%': 1,
2373 ['OS=="win" and use_goma==1', {
2374 # goma doesn't support pch yet.
2375 'chromium_win_pch': 0,
2376 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2378 ['win_z7==0 and fastbuild==0', {
2384 ['OS=="win" and (clang==1 or asan==1)', {
2385 'chromium_win_pch': 0,
2389 'host_cc': '<(make_clang_dir)/bin/clang',
2390 'host_cxx': '<(make_clang_dir)/bin/clang++',
2392 'host_cc': '<!(which gcc)',
2393 'host_cxx': '<!(which g++)',
2396 # The seccomp-bpf sandbox is only supported on five architectures
2398 # Do not disable seccomp_bpf anywhere without talking to
2399 # security@chromium.org!
2400 ['((OS=="linux" or OS=="android") and '
2401 '(target_arch=="ia32" or target_arch=="x64" or '
2402 'target_arch=="arm" or target_arch=="mipsel" or '
2403 'target_arch=="arm64"))', {
2404 'use_seccomp_bpf%': 1,
2406 'use_seccomp_bpf%': 0,
2413 ['branding=="Chrome" and buildtype=="Official"', {
2414 'enable_hangout_services_extension%': 1,
2416 'enable_hangout_services_extension%': 0,
2420 # The path to the ANGLE library.
2421 'angle_path': '<(DEPTH)/third_party/angle',
2423 # List of default apps to install in new profiles. The first list contains
2424 # the source files as found in svn. The second list, used only for linux,
2425 # contains the destination location for each of the files. When a crx
2426 # is added or removed from the list, the chrome/browser/resources/
2427 # default_apps/external_extensions.json file must also be updated.
2429 # README: GN version of these is in the target //chrome:default_apps
2430 # (there's no global variable like in GYP). Be sure to update that target
2431 # if you change these lists!
2432 'default_apps_list': [
2433 'browser/resources/default_apps/external_extensions.json',
2434 'browser/resources/default_apps/gmail.crx',
2435 'browser/resources/default_apps/search.crx',
2436 'browser/resources/default_apps/youtube.crx',
2437 'browser/resources/default_apps/drive.crx',
2438 'browser/resources/default_apps/docs.crx',
2440 'default_apps_list_linux_dest': [
2441 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2442 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2443 '<(PRODUCT_DIR)/default_apps/search.crx',
2444 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2445 '<(PRODUCT_DIR)/default_apps/drive.crx',
2446 '<(PRODUCT_DIR)/default_apps/docs.crx',
2449 # Whether to allow building of the GPU-related isolates.
2450 'archive_gpu_tests%': 0,
2452 # Whether to allow building of chromoting related isolates.
2453 'archive_chromoting_tests%': 0,
2455 'target_defaults': {
2457 # The condition that operates on chromium_code is in a target_conditions
2458 # section, and will not have access to the default fallback value of
2459 # chromium_code at the top of this file, or to the chromium_code
2460 # variable placed at the root variables scope of .gyp files, because
2461 # those variables are not set at target scope. As a workaround,
2462 # if chromium_code is not set at target scope, define it in target scope
2463 # to contain whatever value it has during early variable expansion.
2464 # That's enough to make it available during target conditional
2466 'chromium_code%': '<(chromium_code)',
2468 'component%': '<(component)',
2470 'chromecast%': '<(chromecast)',
2472 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2473 'win_release_Optimization%': '2', # 2 = /O2
2474 'win_debug_Optimization%': '0', # 0 = /Od
2476 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2477 # Tri-state: blank is default, 1 on, 0 off
2478 'win_release_OmitFramePointers%': '0',
2479 # Tri-state: blank is default, 1 on, 0 off
2480 'win_debug_OmitFramePointers%': '',
2482 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2483 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2485 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2486 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2487 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2489 # VS inserts quite a lot of extra checks to algorithms like
2490 # std::partial_sort in Debug build which make them O(N^2)
2491 # instead of O(N*logN). This is particularly slow under memory
2492 # tools like ThreadSanitizer so we want it to be disablable.
2493 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2494 'win_debug_disable_iterator_debugging%': '0',
2496 # An application manifest fragment to declare compatibility settings for
2497 # 'executable' targets. Ignored in other target type.
2498 'win_exe_compatibility_manifest%':
2499 '<(DEPTH)\\build\\win\\compatibility.manifest',
2501 'release_extra_cflags%': '',
2502 'debug_extra_cflags%': '',
2504 'release_valgrind_build%': '<(release_valgrind_build)',
2506 # the non-qualified versions are widely assumed to be *nix-only
2507 'win_release_extra_cflags%': '',
2508 'win_debug_extra_cflags%': '',
2510 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2511 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2513 # Only used by Windows build for now. Can be used to build into a
2514 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2515 # output files in src/build/VS2010_{Debug,Release}.
2516 'build_dir_prefix%': '',
2518 # Targets are by default not nacl untrusted code.
2519 'nacl_untrusted_build%': 0,
2521 'pnacl_compile_flags': [
2522 # pnacl uses the clang compiler so we need to suppress all the
2523 # same warnings as we do for clang.
2524 # TODO(sbc): Remove these if/when they are removed from the clang
2526 '-Wno-unused-function',
2527 '-Wno-char-subscripts',
2528 '-Wno-c++11-extensions',
2529 '-Wno-unnamed-type-template-args',
2532 # By default, Android targets have their exported JNI symbols stripped,
2533 # so we test the manual JNI registration code paths that are required
2534 # when using the crazy linker. To allow use of native JNI exports (lazily
2535 # resolved by the JVM), targets can enable this variable, which will stop
2536 # the stripping from happening. Only targets which do not need to be
2537 # compatible with the crazy linker are permitted to set this.
2538 'use_native_jni_exports%': 0,
2541 ['OS=="win" and component=="shared_library"', {
2542 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2543 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2544 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2546 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2547 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2548 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2551 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2552 'mac_release_optimization%': 's', # Use -Os unless overridden
2553 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2555 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2556 'mac_release_optimization%': '2', # Use -O2 unless overridden
2557 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2560 'host_os%': '<(host_os)', # See comment above chromium_code.
2563 'clang_warning_flags': [
2566 # Don't die on dtoa code that uses a char as an array index.
2567 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2568 '-Wno-char-subscripts',
2570 # TODO(thakis): This used to be implied by -Wno-unused-function,
2571 # which we no longer use. Check if it makes sense to remove
2572 # this as well. http://crbug.com/316352
2573 '-Wno-unneeded-internal-declaration',
2575 # Warns on switches on enums that cover all enum values but
2576 # also contain a default: branch. Chrome is full of that.
2577 '-Wno-covered-switch-default',
2579 # Warns when a const char[] is converted to bool.
2580 '-Wstring-conversion',
2582 # C++11-related flags:
2584 # This warns on using ints as initializers for floats in
2585 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2586 # which happens in several places in chrome code. Not sure if
2587 # this is worth fixing.
2588 '-Wno-c++11-narrowing',
2590 # Clang considers the `register` keyword as deprecated, but e.g.
2591 # code generated by flex (used in angle) contains that keyword.
2592 # http://crbug.com/255186
2593 '-Wno-deprecated-register',
2595 # TODO(hans): Get this cleaned up, http://crbug.com/428099
2596 '-Wno-inconsistent-missing-override',
2599 'includes': [ 'set_clang_warning_flags.gypi', ],
2601 # Don't use deprecated V8 APIs anywhere.
2602 'V8_DEPRECATION_WARNINGS',
2605 '<(SHARED_INTERMEDIATE_DIR)',
2609 # When compiling Objective C, warns if a method is used whose
2610 # availability is newer than the deployment target.
2611 'xcode_settings': { 'WARNING_CFLAGS': ['-Wpartial-availability']},
2613 ['(OS=="mac" or OS=="ios") and asan==1', {
2615 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2618 ['OS=="win" and asan==1 and component=="shared_library"', {
2620 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2623 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2624 'cflags_cc!': ['-fno-rtti'],
2627 '-gline-tables-only',
2628 '-fintercept-allocation-functions',
2630 'defines': ['TYPE_PROFILING'],
2632 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2635 ['branding=="Chrome"', {
2636 'defines': ['GOOGLE_CHROME_BUILD'],
2637 }, { # else: branding!="Chrome"
2638 'defines': ['CHROMIUM_BUILD'],
2640 ['OS=="mac" and component=="shared_library"', {
2642 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2643 'LD_RUNPATH_SEARCH_PATHS': [
2644 # For unbundled binaries.
2646 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2647 '@loader_path/../../..',
2651 ['clang==1 or host_clang==1', {
2652 # This is here so that all files get recompiled after a clang roll and
2653 # when turning clang on or off.
2654 # (defines are passed via the command line, and build systems rebuild
2655 # things when their commandline changes). Nothing should ever read this
2657 'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
2660 'defines': ['ENABLE_RLZ'],
2662 ['component=="shared_library"', {
2663 'defines': ['COMPONENT_BUILD'],
2665 ['ui_compositor_image_transport==1', {
2666 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2669 'defines': ['USE_AURA=1'],
2672 'defines': ['USE_ASH=1'],
2675 'defines': ['USE_PANGO=1'],
2678 'defines': ['USE_CAIRO=1'],
2681 'defines': ['USE_CRAS=1'],
2684 'defines': ['USE_OZONE=1'],
2686 ['use_default_render_theme==1', {
2687 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2689 ['use_libjpeg_turbo==1', {
2690 'defines': ['USE_LIBJPEG_TURBO=1'],
2693 'defines': ['USE_X11=1'],
2695 ['use_clipboard_aurax11==1', {
2696 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2698 ['enable_one_click_signin==1', {
2699 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2701 ['enable_pre_sync_backup==1', {
2702 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2704 ['image_loader_extension==1', {
2705 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2708 'defines': ['ENABLE_PROFILING=1'],
2711 'defines': ['ENABLE_REMOTING=1'],
2713 ['enable_webrtc==1', {
2714 'defines': ['ENABLE_WEBRTC=1'],
2716 ['enable_media_router==1', {
2717 'defines': ['ENABLE_MEDIA_ROUTER=1'],
2719 ['proprietary_codecs==1', {
2720 'defines': ['USE_PROPRIETARY_CODECS'],
2722 ['enable_mpeg2ts_stream_parser==1', {
2723 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2727 ['enable_viewport==1', {
2728 'defines': ['ENABLE_VIEWPORT'],
2730 ['enable_pepper_cdms==1', {
2731 'defines': ['ENABLE_PEPPER_CDMS'],
2733 ['enable_browser_cdms==1', {
2734 'defines': ['ENABLE_BROWSER_CDMS'],
2736 ['configuration_policy==1', {
2737 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2739 ['notifications==1', {
2740 'defines': ['ENABLE_NOTIFICATIONS'],
2742 ['enable_hidpi==1', {
2743 'defines': ['ENABLE_HIDPI=1'],
2745 ['enable_topchrome_md==1', {
2746 'defines': ['ENABLE_TOPCHROME_MD=1'],
2748 ['native_memory_pressure_signals==1', {
2749 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2752 'defines': ['USE_UDEV'],
2756 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2759 ['OS=="win" and fastbuild==2', {
2760 # Completely disable debug information.
2763 'GenerateDebugInformation': 'false',
2765 'VCCLCompilerTool': {
2766 'DebugInformationFormat': '0',
2770 ['OS=="win" and fastbuild==1', {
2773 # This tells the linker to generate .pdbs, so that
2774 # we can get meaningful stack traces.
2775 'GenerateDebugInformation': 'true',
2777 'VCCLCompilerTool': {
2778 # No debug info to be generated by compiler.
2779 'DebugInformationFormat': '0',
2783 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2784 'variables': { 'debug_extra_cflags': '-g0', },
2786 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2787 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2789 'variables': { 'debug_extra_cflags': '-g0', },
2791 # Android builds symbols on release by default, disable them.
2792 ['OS=="android" and fastbuild==2', {
2793 'variables': { 'release_extra_cflags': '-g0', },
2795 ['OS=="android" and fastbuild==1', {
2796 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2798 'variables': { 'release_extra_cflags': '-g0', },
2802 ['dont_embed_build_metadata==1', {
2804 'DONT_EMBED_BUILD_METADATA',
2806 }], # dont_embed_build_metadata==1
2807 ['dcheck_always_on!=0', {
2808 'defines': ['DCHECK_ALWAYS_ON=1'],
2809 }], # dcheck_always_on!=0
2810 ['tracing_like_official_build!=0', {
2811 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2812 }], # tracing_like_official_build!=0
2814 'defines': ['NO_TCMALLOC'],
2816 ['win_use_allocator_shim==1', {
2817 'defines': ['ALLOCATOR_SHIM'],
2823 'ADDRESS_SANITIZER',
2824 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2825 'MEMORY_SANITIZER_INITIAL_SIZE',
2829 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2837 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2838 'MEMORY_SANITIZER_INITIAL_SIZE',
2846 '<(DEPTH)/third_party/kasko/include',
2852 '_CRT_SECURE_NO_DEPRECATE',
2853 '_SCL_SECURE_NO_DEPRECATE',
2854 # This define is required to pull in the new Win8 interfaces from
2855 # system headers like ShObjIdl.h.
2856 'NTDDI_VERSION=0x06030000',
2857 # This is required for ATL to use XP-safe versions of its functions.
2858 '_USING_V110_SDK71_',
2861 '<(DEPTH)/third_party/wtl/include',
2866 # Generates debug info when win_z7=1
2867 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2869 'GenerateDebugInformation': 'true',
2871 'VCCLCompilerTool': {
2872 'DebugInformationFormat': '1',
2878 # This is prohibited when running /analyze.
2879 '_USING_V110_SDK71_',
2882 'VCCLCompilerTool': {
2883 # Set WarnAsError to false to disable this setting for most
2884 # projects so that compilation continues.
2885 'WarnAsError': 'false',
2886 # When win_analyze is specified add the /analyze switch.
2887 # Also add /WX- to force-disable WarnAsError for projects that
2888 # override WarnAsError.
2889 # Also, disable various noisy warnings that have low value.
2890 'AdditionalOptions': [
2892 '/wd6011', # Dereferencing NULL pointer
2893 '/wd6312', # Possible infinite loop: use of the constant
2894 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2895 '/wd6326', # Potential comparison of constant with constant
2896 '/wd28159', # Consider using 'GetTickCount64'
2897 '/wd28204', # Inconsistent SAL annotations
2898 '/wd28251', # Inconsistent SAL annotations
2899 '/wd28252', # Inconsistent SAL annotations
2900 '/wd28253', # Inconsistent SAL annotations
2901 '/wd28196', # The precondition is not satisfied
2902 '/wd28301', # Inconsistent SAL annotations
2903 '/wd6340', # Sign mismatch in function parameter
2904 '/wd28182', # Dereferencing NULL pointer
2905 # C6285 is ~16% of raw warnings and has low value
2906 '/wd6285', # non-zero constant || non-zero constant
2907 # C6334 is ~80% of raw warnings and has low value
2908 '/wd6334', # sizeof applied to an expression with an operator
2920 ['use_playready==1', {
2922 'PLAYREADY_CDM_AVAILABLE',
2927 ['enable_task_manager==1', {
2929 'ENABLE_TASK_MANAGER=1',
2932 ['enable_extensions==1', {
2934 'ENABLE_EXTENSIONS=1',
2937 ['OS=="win" and branding=="Chrome"', {
2938 'defines': ['ENABLE_SWIFTSHADER'],
2940 ['enable_dart==1', {
2941 'defines': ['WEBKIT_USING_DART=1'],
2943 ['enable_plugin_installation==1', {
2944 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2946 ['enable_plugins==1', {
2947 'defines': ['ENABLE_PLUGINS=1'],
2949 ['enable_session_service==1', {
2950 'defines': ['ENABLE_SESSION_SERVICE=1'],
2952 ['enable_themes==1', {
2953 'defines': ['ENABLE_THEMES=1'],
2955 ['enable_autofill_dialog==1', {
2956 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2958 ['enable_prod_wallet_service==1', {
2959 # In GN, this is set on the autofill tagets only. See
2960 # //components/autofill/core/browser:wallet_service
2961 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2963 ['enable_background==1', {
2964 'defines': ['ENABLE_BACKGROUND=1'],
2966 ['enable_google_now==1', {
2967 'defines': ['ENABLE_GOOGLE_NOW=1'],
2969 ['cld_version!=0', {
2970 'defines': ['CLD_VERSION=<(cld_version)'],
2972 ['enable_basic_printing==1 or enable_print_preview==1', {
2973 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2974 'defines': ['ENABLE_PRINTING=1'],
2976 ['enable_basic_printing==1', {
2977 # Enable basic printing support and UI.
2978 'defines': ['ENABLE_BASIC_PRINTING=1'],
2980 ['enable_print_preview==1', {
2981 # Enable printing with print preview.
2982 # Can be defined without ENABLE_BASIC_PRINTING.
2983 'defines': ['ENABLE_PRINT_PREVIEW=1'],
2985 ['enable_spellcheck==1', {
2986 'defines': ['ENABLE_SPELLCHECK=1'],
2988 ['enable_captive_portal_detection==1', {
2989 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2991 ['enable_app_list==1', {
2992 'defines': ['ENABLE_APP_LIST=1'],
2994 ['enable_settings_app==1', {
2995 'defines': ['ENABLE_SETTINGS_APP=1'],
2997 ['disable_file_support==1', {
2998 'defines': ['DISABLE_FILE_SUPPORT=1'],
3000 ['disable_ftp_support==1', {
3001 'defines': ['DISABLE_FTP_SUPPORT=1'],
3003 ['enable_supervised_users==1', {
3004 'defines': ['ENABLE_SUPERVISED_USERS=1'],
3006 ['enable_mdns==1', {
3007 'defines': ['ENABLE_MDNS=1'],
3009 ['enable_service_discovery==1', {
3010 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
3012 ['enable_wifi_bootstrapping==1', {
3013 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
3015 ['enable_hangout_services_extension==1', {
3016 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
3018 ['enable_ipc_fuzzer==1', {
3019 'defines': ['ENABLE_IPC_FUZZER=1'],
3022 'defines': ['VIDEO_HOLE=1'],
3024 ['v8_use_external_startup_data==1', {
3025 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
3027 ['enable_webvr==1', {
3028 'defines': ['ENABLE_WEBVR'],
3031 # SAFE_BROWSING_SERVICE - browser manages a safe-browsing service.
3032 # SAFE_BROWSING_DB_LOCAL - service manages a local database.
3033 # SAFE_BROWSING_DB_REMOTE - service talks via API to a database
3034 # SAFE_BROWSING_CSD - enable client-side phishing detection.
3035 ['safe_browsing==1', {
3037 # TODO(nparker): Remove existing uses of FULL_SAFE_BROWSING
3038 'FULL_SAFE_BROWSING',
3039 'SAFE_BROWSING_CSD',
3040 'SAFE_BROWSING_DB_LOCAL',
3041 'SAFE_BROWSING_SERVICE',
3044 ['safe_browsing==2', {
3046 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3047 'MOBILE_SAFE_BROWSING',
3048 'SAFE_BROWSING_SERVICE',
3051 ['safe_browsing==3', {
3053 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3054 'MOBILE_SAFE_BROWSING',
3055 'SAFE_BROWSING_DB_REMOTE',
3056 'SAFE_BROWSING_SERVICE',
3059 ], # conditions for 'target_defaults'
3060 'target_conditions': [
3061 ['<(use_libpci)==1', {
3062 'defines': ['USE_LIBPCI=1'],
3064 ['<(use_openssl)==1', {
3065 'defines': ['USE_OPENSSL=1'],
3067 ['<(use_openssl_certs)==1', {
3068 'defines': ['USE_OPENSSL_CERTS=1'],
3070 ['>(nacl_untrusted_build)==1', {
3073 'USE_OPENSSL_CERTS=1',
3076 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3077 'defines': ['USE_GLIB=1'],
3079 ['<(use_nss_certs)==1 and >(nacl_untrusted_build)==0', {
3080 'defines': ['USE_NSS_CERTS=1'],
3082 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3083 'defines': ['OS_CHROMEOS=1'],
3085 ['enable_wexit_time_destructors==1 and OS!="win"', {
3086 # TODO: Enable on Windows too, http://crbug.com/404525
3087 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3089 ['chromium_code==0', {
3091 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3092 # We don't want to get warnings from third-party code,
3093 # so remove any existing warning-enabling flags like -Wall.
3099 # Don't warn about hash_map in third-party code.
3103 # Don't warn about printf format problems.
3104 # This is off by default in gcc but on in Ubuntu's gcc(!).
3108 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3112 # TODO: Fix all warnings on chromeos too.
3113 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3118 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3120 # Don't warn about ignoring the return value from e.g. close().
3121 # This is off by default in some gccs but on by default in others.
3122 # BSD systems do not support this option, since they are usually
3123 # using gcc 4.2.1, which does not have this flag yet.
3124 '-Wno-unused-result',
3129 '_CRT_SECURE_NO_DEPRECATE',
3130 '_CRT_NONSTDC_NO_WARNINGS',
3131 '_CRT_NONSTDC_NO_DEPRECATE',
3132 '_SCL_SECURE_NO_DEPRECATE',
3134 'msvs_disabled_warnings': [
3138 'VCCLCompilerTool': {
3139 'WarningLevel': '3',
3140 'WarnAsError': 'true',
3141 'Detect64BitPortabilityProblems': 'false',
3145 ['buildtype=="Official"', {
3147 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3150 [ 'component=="shared_library"', {
3151 # TODO(darin): Unfortunately, some third_party code depends on base.
3152 'msvs_disabled_warnings': [
3153 4251, # class 'std::xx' needs to have dll-interface.
3159 [ 'OS=="mac" or OS=="ios"', {
3161 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3164 ['buildtype=="Official"', {
3166 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3173 # TODO(ios): Fix remaining warnings in third-party code, then
3174 # remove this; the Mac cleanup didn't get everything that's
3175 # flagged in an iOS build.
3176 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3177 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3178 # Several internal ios directories generate numerous warnings for
3179 # -Wobjc-missing-property-synthesis.
3180 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3186 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3187 'filename_rules.gypi',
3189 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3190 # C99 macros on Mac and Linux.
3192 '__STDC_CONSTANT_MACROS',
3193 '__STDC_FORMAT_MACROS',
3197 # turn on warnings for signed/unsigned mismatch on chromium code.
3199 'VCCLCompilerTool': {
3200 'AdditionalOptions': ['/we4389'],
3204 ['OS=="win" and component=="shared_library"', {
3205 'msvs_disabled_warnings': [
3206 4251, # class 'std::xx' needs to have dll-interface.
3211 ], # target_conditions for 'target_defaults'
3212 'default_configuration': 'Debug',
3214 # VCLinkerTool LinkIncremental values below:
3216 # 1 == /INCREMENTAL:NO
3218 # Debug links incremental, Release does not.
3220 # Abstract base configurations to cover common attributes.
3224 'msvs_configuration_attributes': {
3225 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3226 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3227 'CharacterSet': '1',
3230 'VCCLCompilerTool': {
3231 'AdditionalOptions': [
3236 # Add the default import libs.
3237 'AdditionalDependencies': [
3254 'AdditionalOptions': [
3255 # Suggested by Microsoft Devrel to avoid
3256 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3257 # which started happening more regularly after VS2013 Update 4.
3258 # Needs to be a bit lower for VS2015, or else errors out.
3259 '/maxilksize:0x7ff00000',
3268 'MinimumRequiredVersion': '5.01', # XP.
3269 'TargetMachine': '1',
3271 'VCLibrarianTool': {
3272 'TargetMachine': '1',
3275 'msvs_configuration_platform': 'Win32',
3279 'msvs_configuration_platform': 'x64',
3282 # Make sure to understand http://crbug.com/361720 if you want to
3284 'MinimumRequiredVersion': '5.02', # Server 2003.
3285 'TargetMachine': '17', # x86 - 64
3286 'AdditionalLibraryDirectories!':
3287 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3288 'AdditionalLibraryDirectories':
3289 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3290 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3291 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3293 'VCLibrarianTool': {
3294 'AdditionalLibraryDirectories!':
3295 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3296 'AdditionalLibraryDirectories':
3297 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3298 'TargetMachine': '17', # x64
3305 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3306 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3309 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3311 '<@(debug_extra_cflags)',
3315 'VCCLCompilerTool': {
3316 'Optimization': '<(win_debug_Optimization)',
3317 'PreprocessorDefinitions': ['_DEBUG'],
3318 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3319 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3321 # According to MSVS, InlineFunctionExpansion=0 means
3322 # "default inlining", not "/Ob0".
3323 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3324 ['win_debug_InlineFunctionExpansion==0', {
3325 'AdditionalOptions': ['/Ob0'],
3327 ['win_debug_InlineFunctionExpansion!=""', {
3328 'InlineFunctionExpansion':
3329 '<(win_debug_InlineFunctionExpansion)',
3331 ['win_debug_disable_iterator_debugging==1', {
3332 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3335 # if win_debug_OmitFramePointers is blank, leave as default
3336 ['win_debug_OmitFramePointers==1', {
3337 'OmitFramePointers': 'true',
3339 ['win_debug_OmitFramePointers==0', {
3340 'OmitFramePointers': 'false',
3341 # The above is not sufficient (http://crbug.com/106711): it
3342 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3343 # perform FPO regardless, so we must explicitly disable.
3344 # We still want the false setting above to avoid having
3345 # "/Oy /Oy-" and warnings about overriding.
3346 'AdditionalOptions': ['/Oy-'],
3349 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3352 'LinkIncremental': '<(msvs_debug_link_incremental)',
3353 # ASLR makes debugging with windbg difficult because Chrome.exe and
3354 # Chrome.dll share the same base name. As result, windbg will
3355 # name the Chrome.dll module like chrome_<base address>, where
3356 # <base address> typically changes with each launch. This in turn
3357 # means that breakpoints in Chrome.dll don't stick from one launch
3358 # to the next. For this reason, we turn ASLR off in debug builds.
3359 # Note that this is a three-way bool, where 0 means to pick up
3360 # the default setting, 1 is off and 2 is on.
3361 'RandomizedBaseAddress': 1,
3363 'VCResourceCompilerTool': {
3364 'PreprocessorDefinitions': ['_DEBUG'],
3368 ['OS=="linux" or OS=="android"', {
3369 'target_conditions': [
3370 ['_toolset=="target"', {
3372 '<@(debug_extra_cflags)',
3377 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3378 # Enable libstdc++ debugging facilities to help catch problems
3379 # early, see http://crbug.com/65151 .
3380 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3381 'defines': ['_GLIBCXX_DEBUG=1',],
3383 ['release_valgrind_build==0', {
3386 '-fstack-protector-all', # Implies -fstack-protector
3392 # Allow comparing the address of references and 'this' against 0
3393 # in debug builds. Technically, these can never be null in
3394 # well-defined C/C++ and Clang can optimize such checks away in
3395 # release builds, but they may be used in asserts in debug builds.
3396 '-Wno-undefined-bool-conversion',
3397 '-Wno-tautological-undefined-compare',
3401 '-Wno-undefined-bool-conversion',
3402 '-Wno-tautological-undefined-compare',
3406 'VCCLCompilerTool': {
3407 'AdditionalOptions': [
3408 '-Wno-undefined-bool-conversion',
3409 '-Wno-tautological-undefined-compare',
3422 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3423 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3424 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3427 'VCCLCompilerTool': {
3428 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3430 # In official builds, each target will self-select
3431 # an optimization level.
3432 ['buildtype!="Official"', {
3433 'Optimization': '<(win_release_Optimization)',
3436 # According to MSVS, InlineFunctionExpansion=0 means
3437 # "default inlining", not "/Ob0".
3438 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3439 ['win_release_InlineFunctionExpansion==0', {
3440 'AdditionalOptions': ['/Ob0'],
3442 ['win_release_InlineFunctionExpansion!=""', {
3443 'InlineFunctionExpansion':
3444 '<(win_release_InlineFunctionExpansion)',
3447 # if win_release_OmitFramePointers is blank, leave as default
3448 ['win_release_OmitFramePointers==1', {
3449 'OmitFramePointers': 'true',
3451 ['win_release_OmitFramePointers==0', {
3452 'OmitFramePointers': 'false',
3453 # The above is not sufficient (http://crbug.com/106711): it
3454 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3455 # perform FPO regardless, so we must explicitly disable.
3456 # We still want the false setting above to avoid having
3457 # "/Oy /Oy-" and warnings about overriding.
3458 'AdditionalOptions': ['/Oy-'],
3461 # Put data in separate COMDATs. This allows the linker
3462 # to put bit-identical constants at the same address even if
3463 # they're unrelated constants, which saves binary size.
3464 # This optimization can't be used when ASan is enabled because
3465 # it is not compatible with the ASan ODR checker.
3466 'AdditionalOptions': ['/Gw'],
3469 'AdditionalOptions': [
3470 '/d2Zi+', # Improve debugging of Release builds.
3471 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3472 '<@(win_release_extra_cflags)',
3476 # LinkIncremental is a tri-state boolean, where 0 means default
3477 # (i.e., inherit from parent solution), 1 means false, and
3479 'LinkIncremental': '1',
3480 # This corresponds to the /PROFILE flag which ensures the PDB
3481 # file contains FIXUP information (growing the PDB file by about
3482 # 5%) but does not otherwise alter the output binary. This
3483 # information is used by the Syzygy optimization tool when
3484 # decomposing the release image.
3489 ['msvs_use_common_release', {
3490 'includes': ['release.gypi'],
3492 ['release_valgrind_build==0 and tsan==0', {
3495 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3499 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3500 'MEMORY_SANITIZER_INITIAL_SIZE',
3501 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3502 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3506 'defines': ['NO_TCMALLOC'],
3508 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3509 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3510 # It seems to work fine with Ubuntu 12 headers though, so use it
3511 # in official builds.
3512 ['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")', {
3513 'target_conditions': [
3514 ['chromium_code==1', {
3515 # Non-chromium code is not guaranteed to compile cleanly
3516 # with _FORTIFY_SOURCE. Also, fortified build may fail
3517 # when optimizations are disabled, so only do that for Release
3520 '_FORTIFY_SOURCE=2',
3525 ['OS=="linux" or OS=="android"', {
3526 'target_conditions': [
3527 ['_toolset=="target"', {
3529 '<@(release_extra_cflags)',
3532 ['enable_resource_whitelist_generation==1', {
3534 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3543 'NS_BLOCK_ASSERTIONS=1',
3549 # Concrete configurations
3552 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3555 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3560 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3561 'target_conditions': [
3562 [ '_type=="executable"', {
3563 # To get a real .dSYM bundle produced by dsymutil, set the
3564 # debug information format to dwarf-with-dsym. Since
3565 # strip_from_xcode will not be used, set Xcode to do the
3566 # stripping as well.
3568 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3569 'DEPLOYMENT_POSTPROCESSING': 'YES',
3570 'STRIP_INSTALLED_PRODUCT': 'YES',
3577 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3579 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3582 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3590 'target_defaults': {
3595 # TODO(glider): enable the default options on other systems.
3597 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3599 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3605 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3606 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3607 'target_defaults': {
3609 '-Wl,--fatal-warnings',
3613 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3614 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
3615 'target_defaults': {
3621 ['os_posix==1 and chromeos==0', {
3622 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3623 # and we want to avoid overriding this, so stack-protector is only
3624 # enabled when not building on Chrome OS.
3625 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3627 'target_defaults': {
3629 '-fstack-protector',
3630 '--param=ssp-buffer-size=4',
3634 ['os_posix==1 and OS=="linux"', {
3636 '_LARGEFILE_SOURCE',
3637 '_LARGEFILE64_SOURCE',
3638 '_FILE_OFFSET_BITS=64',
3641 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3642 'target_defaults': {
3643 # Enable -Werror by default, but put it in a variable so it can
3644 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3646 'werror%': '-Werror',
3647 'libraries_for_target%': '',
3650 '_FILE_OFFSET_BITS=64',
3653 '<(werror)', # See note above about the werror variable.
3655 '-fno-strict-aliasing', # See http://crbug.com/32204
3657 # Don't warn about unused function params. We use those everywhere.
3658 '-Wno-unused-parameter',
3659 # Don't warn about the "struct foo f = {0};" initialization pattern.
3660 '-Wno-missing-field-initializers',
3661 # Don't export any symbols (for example, to plugins we dlopen()).
3662 # Note: this is *required* to make some plugins work.
3663 '-fvisibility=hidden',
3669 '-fno-threadsafe-statics',
3670 # Make inline functions have hidden visiblity by default.
3671 # Surprisingly, not covered by -fvisibility=hidden.
3672 '-fvisibility-inlines-hidden',
3673 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3674 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3678 '-pthread', '-Wl,-z,noexecstack',
3681 '<(libraries_for_target)',
3686 'debug_optimize%': '0',
3692 '-O>(debug_optimize)',
3696 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3697 # TODO(jdduke) Re-enable on mips after resolving linking
3698 # issues with libc++ (crbug.com/456380).
3700 # Warn in case of text relocations.
3701 '-Wl,--warn-shared-textrel',
3704 ['OS=="android" and android_full_debug==0', {
3705 # Some configurations are copied from Release_Base to reduce
3708 'debug_optimize%': 's',
3712 '-ffunction-sections',
3719 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3720 # We don't omit frame pointers on arm64 since they are required
3721 # to correctly unwind stackframes which contain system library
3722 # function frames (crbug.com/391706).
3724 '-fomit-frame-pointer',
3727 ['OS=="linux" and target_arch=="ia32"', {
3729 '-Wl,--no-as-needed',
3732 ['debug_unwind_tables==1', {
3733 'cflags': ['-funwind-tables'],
3735 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3736 'defines': ['NO_UNWIND_TABLES'],
3738 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3739 # definitions in to the right scope to use them when setting
3740 # linux_use_debug_fission, so it can be used here alone.
3741 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3742 'cflags': ['-gsplit-dwarf'],
3748 'release_optimize%': '2',
3749 # Binaries become big and gold is unable to perform GC
3750 # and remove unused sections for some of test targets
3751 # on 32 bit platform.
3752 # (This is currently observed only in chromeos valgrind bots)
3753 # The following flag is to disable --gc-sections linker
3754 # option for these bots.
3755 'no_gc_sections%': 0,
3757 # TODO(bradnelson): reexamine how this is done if we change the
3758 # expansion of configurations
3759 'release_valgrind_build%': 0,
3762 '-O<(release_optimize)',
3763 # Don't emit the GCC version ident directives, they just end up
3764 # in the .comment section taking up binary size.
3766 # Put data and code in their own sections, so that unused symbols
3767 # can be removed at link time with --gc-sections.
3769 '-ffunction-sections',
3772 # Specifically tell the linker to perform optimizations.
3773 # See http://lwn.net/Articles/192624/ .
3778 ['no_gc_sections==0', {
3780 '-Wl,--gc-sections',
3783 ['OS=="android" and target_arch!="arm64"', {
3784 # We don't omit frame pointers on arm64 since they are required
3785 # to correctly unwind stackframes which contain system library
3786 # function frames (crbug.com/391706).
3788 '-fomit-frame-pointer',
3791 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3792 # TODO(jdduke) Re-enable on mips after resolving linking
3793 # issues with libc++ (crbug.com/456380).
3795 # Warn in case of text relocations.
3796 '-Wl,--warn-shared-textrel',
3801 'release_optimize%': 's',
3806 '-fno-omit-frame-pointer',
3810 ['profiling_full_stack_frames==1', {
3813 '-fno-optimize-sibling-calls',
3818 ['release_unwind_tables==1', {
3819 'cflags': ['-funwind-tables'],
3821 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3822 'defines': ['NO_UNWIND_TABLES'],
3828 ['target_arch=="ia32"', {
3829 'target_conditions': [
3830 ['_toolset=="target"', {
3832 # Needed so that libs with .s files (e.g. libicudata.a)
3833 # are compatible with the general 32-bit-ness.
3836 # All floating-point computations on x87 happens in 80-bit
3837 # precision. Because the C and C++ language standards allow
3838 # the compiler to keep the floating-point values in higher
3839 # precision than what's specified in the source and doing so
3840 # is more efficient than constantly rounding up to 64-bit or
3841 # 32-bit precision as specified in the source, the compiler,
3842 # especially in the optimized mode, tries very hard to keep
3843 # values in x87 floating-point stack (in 80-bit precision)
3844 # as long as possible. This has important side effects, that
3845 # the real value used in computation may change depending on
3846 # how the compiler did the optimization - that is, the value
3847 # kept in 80-bit is different than the value rounded down to
3848 # 64-bit or 32-bit. There are possible compiler options to
3849 # make this behavior consistent (e.g. -ffloat-store would keep
3850 # all floating-values in the memory, thus force them to be
3851 # rounded to its original precision) but they have significant
3852 # runtime performance penalty.
3854 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3855 # which keep floating-point values in SSE registers in its
3856 # native precision (32-bit for single precision, and 64-bit
3857 # for double precision values). This means the floating-point
3858 # value used during computation does not change depending on
3859 # how the compiler optimized the code, since the value is
3860 # always kept in its specified precision.
3862 # Refer to http://crbug.com/348761 for rationale behind SSE2
3863 # being a minimum requirement for 32-bit Linux builds and
3864 # http://crbug.com/313032 for an example where this has "bit"
3869 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3876 # Use gold linker for Android ia32 target.
3886 ['target_arch=="x64"', {
3887 'target_conditions': [
3888 ['_toolset=="target"', {
3890 # Use gold linker for Android x64 target.
3907 ['target_arch=="arm"', {
3908 'target_conditions': [
3909 ['_toolset=="target"', {
3913 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3914 # has changed whenever it encounters a varargs function. This
3915 # silences those warnings, as they are not helpful and
3916 # clutter legitimate warnings.
3920 ['clang==1 and arm_arch!="" and OS!="android"', {
3922 '-target arm-linux-gnueabihf',
3925 '-target arm-linux-gnueabihf',
3930 '-march=<(arm_arch)',
3933 ['use_lto==1 or use_lto_o2==1', {
3935 '-march=<(arm_arch)',
3940 ['clang==1 and OS!="android"', {
3942 # We need to disable clang's builtin assembler as it can't
3943 # handle several asm files, crbug.com/124610
3944 '-no-integrated-as',
3949 '-mtune=<(arm_tune)',
3952 ['use_lto==1 or use_lto_o2==1', {
3954 '-mtune=<(arm_tune)',
3964 ['use_lto==1 or use_lto_o2==1', {
3971 ['arm_float_abi!=""', {
3973 '-mfloat-abi=<(arm_float_abi)',
3976 ['use_lto==1 or use_lto_o2==1', {
3978 '-mfloat-abi=<(arm_float_abi)',
3988 ['use_lto==1 or use_lto_o2==1', {
3996 # Most of the following flags are derived from what Android
3997 # uses by default when building for arm, reference for which
3998 # can be found in the following file in the Android NDK:
3999 # toolchains/arm-linux-androideabi-4.9/setup.mk
4001 # The tree-sra optimization (scalar replacement for
4002 # aggregates enabling subsequent optimizations) leads to
4003 # invalid code generation when using the Android NDK's
4004 # compiler (r5-r7). This can be verified using
4005 # webkit_unit_tests' WTF.Checked_int8_t test.
4007 # The following option is disabled to improve binary
4008 # size and performance in gcc 4.9.
4009 '-fno-caller-saves',
4012 # Android now supports .relro sections properly.
4013 # NOTE: While these flags enable the generation of .relro
4014 # sections, the generated libraries can still be loaded on
4015 # older Android platform versions.
4022 ['gcc_version==48 and clang==0', {
4024 # The following 5 options are disabled to save on
4025 # binary size in GCC 4.8.
4026 '-fno-partial-inlining',
4027 '-fno-early-inlining',
4028 '-fno-tree-copy-prop',
4029 '-fno-tree-loop-optimize',
4030 '-fno-move-loop-invariants',
4034 'cflags': [ '-mthumb-interwork' ],
4038 # Thumb code with frame pointer makes chrome crash
4041 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
4042 # The perf report sometimes incorrectly attributes
4043 # code from tail calls.
4044 '-fno-optimize-sibling-calls',
4047 '-fomit-frame-pointer',
4052 # Clang does not support the following options.
4054 '-mthumb-interwork',
4055 '-finline-limit=64',
4057 '-fno-caller-saves',
4061 # TODO(hans) Enable integrated-as (crbug.com/124610).
4062 '-no-integrated-as',
4063 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4066 ['clang==1 and linux_use_bundled_gold==0', {
4068 # Let clang find the ld.gold in the NDK.
4069 '--gcc-toolchain=<(android_toolchain)/..',
4074 '-marm', # Required for frame pointer based stack traces.
4081 # We set arm_arch to "" so that -march compiler option
4082 # is not set. Otherwise a gcc bug that would complain
4083 # about it conflicting with '-mcpu=cortex-a9'. The flag
4084 # '-march=armv7-a' is actually redundant anyway because
4085 # it is enabled by default when we built the toolchain.
4086 # And using '-mcpu=cortex-a9' should be sufficient.
4089 # Breakpad requires symbols with debugging information
4093 # We want to statically link libstdc++/libgcc_s.
4094 '-static-libstdc++',
4098 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4099 # define their own cflags for arm builds that could
4100 # conflict with the flags we set here (e.g.
4101 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4110 ['target_arch=="arm64"', {
4111 'target_conditions': [
4112 ['_toolset=="target"', {
4116 '-fstack-protector', # stack protector is always enabled on arm64.
4123 ['target_arch=="mipsel"', {
4124 'target_conditions': [
4125 ['_toolset=="target"', {
4127 ['mips_arch_variant=="r6"', {
4130 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ],
4131 'ldflags': [ '-target mipsel-linux-gnu', ],
4133 'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
4135 ['clang==0 and OS=="android"', {
4136 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4140 ['mips_arch_variant=="r2"', {
4142 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4143 'cflags': ['-m<(mips_fpu_mode)'],
4148 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
4149 'ldflags': [ '-target mipsel-linux-android', ],
4151 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32r2'],
4152 'ldflags': [ '-target mipsel-linux-gnu', ],
4156 'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
4160 ['mips_arch_variant=="r1"', {
4165 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
4166 'ldflags': [ '-target mipsel-linux-android', ],
4168 'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32'],
4169 'ldflags': [ '-target mipsel-linux-gnu', ],
4173 'cflags': ['-mips32', '-Wa,-mips32', ],
4179 # Clang does not support the following options.
4180 '-finline-limit=64',
4183 # TODO(gordanac) Enable integrated-as.
4184 '-no-integrated-as',
4187 ['clang==1 and OS=="android"', {
4189 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4192 # Let clang find the ld in the NDK.
4193 '--gcc-toolchain=<(android_toolchain)/..',
4196 ['mips_dsp_rev==1', {
4197 'cflags': ['-mdsp'],
4199 ['mips_dsp_rev==2', {
4200 'cflags': ['-mdspr2'],
4204 '-m<(mips_float_abi)-float'
4207 '-Wl,--no-keep-memory'
4210 '-Wno-uninitialized',
4215 ['target_arch=="mips64el"', {
4216 'target_conditions': [
4217 ['_toolset=="target"', {
4219 ['mips_arch_variant=="r6"', {
4220 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4221 'ldflags': ['-mips64r6'],
4223 ['mips_arch_variant=="r2"', {
4224 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4225 'ldflags': ['-mips64r2'],
4229 '-Wno-uninitialized',
4243 'target_conditions': [
4244 ['_toolset=="target"', {
4246 '--sysroot=<(sysroot)',
4249 '--sysroot=<(sysroot)',
4250 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4256 # TODO(thakis): Remove, http://crbug.com/263960
4257 '-Wno-reserved-user-defined-literal',
4260 # gnu++11 instead of c++11 is needed because some code uses
4261 # typeof() (a GNU extension).
4262 # TODO(thakis): Eventually switch this to c++11 instead,
4263 # http://crbug.com/427584
4267 ['clang==0 and host_clang==1', {
4268 'target_conditions': [
4269 ['_toolset=="host"', {
4270 'cflags_cc': [ '-std=gnu++11', ],
4274 ['clang==1 and clang_use_chrome_plugins==1', {
4276 '<@(clang_chrome_plugins_flags)',
4279 ['clang==1 and clang_load!=""', {
4281 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4284 ['clang==1 and clang_add_plugin!=""', {
4286 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4289 ['clang==1 and target_arch=="ia32"', {
4291 # Else building libyuv gives clang's register allocator issues,
4292 # see llvm.org/PR15798 / crbug.com/233709
4293 '-momit-leaf-frame-pointer',
4294 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4295 '-mstack-alignment=16',
4299 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4301 # See http://crbug.com/110262
4302 '-fcolor-diagnostics',
4305 # Common options for AddressSanitizer, LeakSanitizer,
4306 # ThreadSanitizer and MemorySanitizer.
4307 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4308 'target_conditions': [
4309 ['_toolset=="target"', {
4311 '-fno-omit-frame-pointer',
4312 '-gline-tables-only',
4315 '-fomit-frame-pointer',
4320 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4321 'target_conditions': [
4322 ['_toolset=="target"', {
4324 # Functions interposed by the sanitizers can make ld think
4325 # that some libraries aren't needed when they actually are,
4326 # http://crbug.com/234010. As workaround, disable --as-needed.
4330 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4331 'MEMORY_SANITIZER_INITIAL_SIZE',
4337 'target_conditions': [
4338 ['_toolset=="target"', {
4340 '-fsanitize=address',
4341 # TODO(earthdok): Re-enable. http://crbug.com/427202
4342 #'-fsanitize-blacklist=<(asan_blacklist)',
4345 '-fsanitize=address',
4352 '-mllvm -asan-globals=0', # http://crbug.com/352073
4358 'target_conditions': [
4359 ['_toolset=="target"', {
4361 # FIXME: work on enabling more flags and getting rid of false
4362 # positives. http://crbug.com/174801.
4363 '-fsanitize=bounds',
4364 '-fsanitize=float-divide-by-zero',
4365 '-fsanitize=integer-divide-by-zero',
4367 '-fsanitize=object-size',
4368 '-fsanitize=return',
4369 '-fsanitize=returns-nonnull-attribute',
4370 '-fsanitize=shift-exponent',
4371 '-fsanitize=signed-integer-overflow',
4372 '-fsanitize=unreachable',
4373 '-fsanitize=vla-bound',
4374 '-fsanitize-blacklist=<(ubsan_blacklist)',
4375 # Employ the experimental PBQP register allocator to avoid
4376 # slow compilation on files with too many basic blocks.
4377 # See http://crbug.com/426271.
4378 '-mllvm -regalloc=pbqp',
4379 # Speculatively use coalescing to slightly improve the code
4380 # generated by PBQP regallocator. May increase compile time.
4381 '-mllvm -pbqp-coalescing',
4390 '-fsanitize=undefined',
4393 'UNDEFINED_SANITIZER',
4399 'target_conditions': [
4400 ['_toolset=="target"', {
4403 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4415 'UNDEFINED_SANITIZER',
4420 ['asan_coverage!=0 and sanitizer_coverage==0', {
4421 'target_conditions': [
4422 ['_toolset=="target"', {
4424 '-fsanitize-coverage=<(asan_coverage)',
4427 'SANITIZER_COVERAGE',
4432 ['sanitizer_coverage!=0', {
4433 'target_conditions': [
4434 ['_toolset=="target"', {
4436 '-fsanitize-coverage=<(sanitizer_coverage)',
4439 'SANITIZER_COVERAGE',
4444 ['asan_field_padding!=0', {
4445 'target_conditions': [
4446 ['_toolset=="target"', {
4448 '-fsanitize-address-field-padding=<(asan_field_padding)',
4454 'target_conditions': [
4455 ['_toolset=="target"', {
4464 'WTF_USE_LEAK_SANITIZER=1',
4470 'target_conditions': [
4471 ['_toolset=="target"', {
4473 '-fsanitize=thread',
4474 '-fsanitize-blacklist=<(tsan_blacklist)',
4477 '-fsanitize=thread',
4481 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4482 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4488 'target_conditions': [
4489 ['_toolset=="target"', {
4491 '-fsanitize=memory',
4492 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4493 '-fsanitize-blacklist=<(msan_blacklist)',
4496 '-fsanitize=memory',
4504 ['use_instrumented_libraries==1', {
4506 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4509 ['use_prebuilt_instrumented_libraries==1', {
4511 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
4514 ['use_custom_libcxx==1', {
4516 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4519 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4520 'target_conditions' : [
4521 # crazy_linker has an upstream gyp file we can't edit, and we
4522 # don't want to instrument it.
4523 ['_toolset=="target" and _target_name!="crazy_linker"', {
4525 '-finstrument-functions',
4526 # Allow mmx intrinsics to inline, so that the
4527 #0 compiler can expand the intrinsics.
4528 '-finstrument-functions-exclude-file-list=mmintrin.h',
4531 ['_toolset=="target" and OS=="android"', {
4533 # Avoids errors with current NDK:
4534 # "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"
4535 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4540 ['linux_dump_symbols==1', {
4543 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4544 'target_conditions': [
4545 ['_toolset=="target"', {
4547 # Attempt to use less memory to prevent the linker from
4548 # running out of address space. Considering installing a
4549 # 64-bit kernel and switching to a 64-bit linker.
4550 '-Wl,--no-keep-memory',
4557 ['use_allocator!="tcmalloc"', {
4558 'defines': ['NO_TCMALLOC'],
4560 ['linux_use_gold_flags==1', {
4561 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4563 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4564 'ldflags': [ '-fuse-ld=gold', ],
4566 'target_conditions': [
4567 ['_toolset=="target"', {
4569 # Experimentation found that using four linking threads
4570 # saved ~20% of link time.
4571 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4572 # Only apply this to the target linker, since the host
4573 # linker might not be gold, but isn't used much anyway.
4574 # TODO(raymes): Disable threading because gold is frequently
4575 # crashing on the bots: crbug.com/161942.
4577 # '-Wl,--thread-count=4',
4580 # TODO(thestig): Enable this for disabled cases.
4581 [ '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', {
4583 '-Wl,--detect-odr-violations',
4590 ['release_valgrind_build==0 and order_profiling==0 and asan==0 and msan==0 and lsan==0 and tsan==0', {
4591 'target_conditions': [
4592 ['_toolset=="target"', {
4594 '-Wl,--icf=<(gold_icf_level)',
4601 ['linux_use_bundled_binutils==1', {
4603 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4606 ['linux_use_bundled_gold==1 and '
4607 'not (clang==0 and (use_lto==1 or use_lto_o2==1))', {
4608 # Put our binutils, which contains gold in the search path. We pass
4609 # the path to gold to the compiler. gyp leaves unspecified what the
4610 # cwd is when running the compiler, so the normal gyp path-munging
4611 # fails us. This hack gets the right path.
4613 # Disabled when using GCC LTO because GCC also uses the -B search
4614 # path at link time to find "as", and our bundled "as" can only
4617 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4620 # Some binutils 2.23 releases may or may not have new dtags enabled,
4621 # but they are all compatible with --disable-new-dtags,
4622 # because the new dynamic tags are not created by default.
4623 ['binutils_version>=223', {
4624 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4625 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4626 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4627 # inside this file to allow usage of --no-as-needed and removal of
4630 '-Wl,--disable-new-dtags',
4633 ['gcc_version>=47 and clang==0', {
4634 'target_conditions': [
4635 ['_toolset=="target"', {
4638 # See comment for -Wno-c++11-narrowing.
4640 # TODO(thakis): Remove, http://crbug.com/263960
4641 '-Wno-literal-suffix',
4646 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4647 'target_conditions': [
4648 ['_toolset=="host"', {
4651 # See comment for -Wno-c++11-narrowing.
4653 # TODO(thakis): Remove, http://crbug.com/263960
4654 '-Wno-literal-suffix',
4662 # FreeBSD-specific options; note that most FreeBSD options are set above,
4665 'target_defaults': {
4667 '-Wl,--no-keep-memory',
4671 # Android-specific options; note that most are set above with Linux.
4674 # This is a unique identifier for a given build. It's used for
4675 # identifying various build artifacts corresponding to a particular
4676 # build of chrome (e.g. where to find archived symbols).
4677 'chrome_build_id%': '',
4679 # Figure this out early since it needs symbols from libgcc.a, so it
4680 # has to be before that in the set of libraries.
4681 ['component=="shared_library"', {
4682 'android_libcpp_library': 'c++_shared',
4684 'android_libcpp_library': 'c++_static',
4688 # Placing this variable here prevents from forking libvpx, used
4689 # by remoting. Remoting is off, so it needn't built,
4690 # so forking it's deps seems like overkill.
4691 # But this variable need defined to properly run gyp.
4692 # A proper solution is to have an OS==android conditional
4693 # in third_party/libvpx/libvpx.gyp to define it.
4694 'libvpx_path': 'lib/linux/arm',
4696 'target_defaults': {
4698 'release_extra_cflags%': '',
4700 # If we're using the components build, append "cr" to all shared
4701 # libraries to avoid naming collisions with android system library
4702 # versions with the same name (e.g. skia, icu).
4703 ['component=="shared_library"', {
4704 'android_product_extension': 'cr.so',
4706 'android_product_extension': 'so',
4710 'target_conditions': [
4711 ['_type=="shared_library"', {
4712 'product_extension': '<(android_product_extension)',
4715 # Settings for building device targets using Android's toolchain.
4716 # These are based on the setup.mk file from the Android NDK.
4718 # The NDK Android executable link step looks as follows:
4720 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4721 # $(PRIVATE_OBJECTS) <-- The .o that we built
4722 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4723 # $(TARGET_LIBGCC) <-- libgcc.a
4724 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4725 # $(PRIVATE_LDLIBS) <-- System .so
4726 # $(TARGET_CRTEND_O) <-- crtend.o
4728 # For now the above are approximated for executables by adding
4729 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4732 # The NDK Android shared library link step looks as follows:
4734 # $(PRIVATE_OBJECTS) <-- The .o that we built
4735 # -l,--whole-archive
4736 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4737 # -l,--no-whole-archive
4738 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4739 # $(TARGET_LIBGCC) <-- libgcc.a
4740 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4741 # $(PRIVATE_LDLIBS) <-- System .so
4743 # For now, assume that whole static libraries are not needed.
4745 # For both executables and shared libraries, add the proper
4746 # libgcc.a to the start of libraries which puts it in the
4747 # proper spot after .o and .a files get linked in.
4749 # TODO: The proper thing to do longer-tem would be proper gyp
4750 # support for a custom link command line.
4751 ['_toolset=="target"', {
4753 '-pthread', # Not supported by Android toolchain.
4756 '-ffunction-sections',
4759 '-fstack-protector',
4761 '-finline-limit=64',
4762 '<@(release_extra_cflags)',
4763 '--sysroot=<(android_ndk_sysroot)',
4764 # NOTE: The libc++ header include paths below are specified in
4765 # cflags rather than include_dirs because they need to come
4766 # after include_dirs.
4767 # The include ordering here is important; change with caution.
4768 '-isystem<(android_libcpp_include)',
4769 '-isystem<(android_ndk_root)/sources/cxx-stl/llvm-libc++abi/libcxxabi/include',
4770 '-isystem<(android_ndk_root)/sources/android/support/include',
4774 '__GNU_SOURCE=1', # Necessary for clone()
4775 'CHROME_BUILD_ID="<(chrome_build_id)"',
4776 # The NDK has these things, but doesn't define the constants
4777 # to say that it does. Define them here instead.
4781 '-pthread', # Not supported by Android toolchain.
4784 '-Wl,--build-id=sha1',
4785 '-Wl,--no-undefined',
4786 '--sysroot=<(android_ndk_sysroot)',
4788 '-L<(android_libcpp_libs_dir)',
4789 # Don't allow visible symbols from libgcc or libc++ to be
4791 '-Wl,--exclude-libs=libgcc.a',
4792 '-Wl,--exclude-libs=libc++_static.a',
4793 # Don't allow visible symbols from libraries that contain
4794 # assembly code with symbols that aren't hidden properly.
4795 # http://crbug.com/448386
4796 '-Wl,--exclude-libs=libcommon_audio.a',
4797 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4798 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4799 '-Wl,--exclude-libs=libiSACFix.a',
4800 '-Wl,--exclude-libs=libisac_neon.a',
4801 '-Wl,--exclude-libs=libopus.a',
4802 '-Wl,--exclude-libs=libvpx.a',
4805 '-l<(android_libcpp_library)',
4807 # Manually link the libgcc.a that the cross compiler uses.
4808 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4814 ['component=="static_library"', {
4815 'target_conditions': [
4816 ['use_native_jni_exports==0', {
4817 # Use a linker version script to strip JNI exports from
4818 # binaries which have not specifically asked to use them.
4820 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4827 # Clang with libc++ does not require an explicit atomic
4828 # library reference.
4832 # Work around incompatibilities between bionic and clang
4834 '-D__compiler_offsetof=__builtin_offsetof',
4835 '-Dnan=__builtin_nan',
4838 ['target_arch=="arm"', {
4840 '-target arm-linux-androideabi',
4843 '-target arm-linux-androideabi',
4846 ['target_arch=="ia32"', {
4848 '-target x86-linux-androideabi',
4851 '-target x86-linux-androideabi',
4854 # Place holder for x64 support, not tested.
4855 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4856 ['target_arch=="x64"', {
4858 '-target x86_64-linux-androideabi',
4861 '-target x86_64-linux-androideabi',
4868 # Android build relies on -Wl,--gc-sections removing
4869 # unreachable code. ASan instrumentation for globals inhibits
4870 # this and results in a library with unresolvable relocations.
4871 # TODO(eugenis): find a way to reenable this.
4872 '-mllvm -asan-globals=0',
4875 ['target_arch == "arm" and order_profiling==0', {
4877 # Enable identical code folding to reduce size.
4878 '-Wl,--icf=<(gold_icf_level)',
4881 ['target_arch=="ia32"', {
4882 # The x86 toolchain currently has problems with stack-protector.
4884 '-fstack-protector',
4887 '-fno-stack-protector',
4891 'target_conditions': [
4892 ['_type=="executable"', {
4893 # Force android tools to export the "main" symbol so they can be
4894 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4895 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4896 # when ICS support will be dropped.
4899 '-fvisibility=default',
4903 '-Wl,--gc-sections',
4904 '-Wl,-z,nocopyreloc',
4907 # crtbegin_dynamic.o should be the last item in ldflags.
4908 '<(android_ndk_lib)/crtbegin_dynamic.o',
4911 # crtend_android.o needs to be the last item in libraries.
4912 # Do not add any libraries after this!
4913 '<(android_ndk_lib)/crtend_android.o',
4916 ['_type=="shared_library" or _type=="loadable_module"', {
4918 '-Wl,-shared,-Bsymbolic',
4919 # crtbegin_so.o should be the last item in ldflags.
4920 '<(android_ndk_lib)/crtbegin_so.o',
4923 # crtend_so.o needs to be the last item in libraries.
4924 # Do not add any libraries after this!
4925 '<(android_ndk_lib)/crtend_so.o',
4930 # Settings for building host targets using the system toolchain.
4931 ['_toolset=="host"', {
4933 # Due to issues in Clang build system, using ASan on 32-bit
4934 # binaries on x86_64 host is problematic.
4935 # TODO(eugenis): re-enable.
4936 '-fsanitize=address',
4939 '-fsanitize=address',
4940 '-Wl,-z,noexecstack',
4941 '-Wl,--gc-sections',
4944 '-Wl,--warn-shared-textrel',
4945 '-Wl,--fatal-warnings',
4948 # Settings for building host targets on mac.
4949 ['_toolset=="host" and host_os=="mac"', {
4959 'cflags!': ['-fvisibility=hidden'],
4960 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4962 ['OS=="mac" or OS=="ios"', {
4963 'target_defaults': {
4966 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4967 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4968 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4969 'COPY_PHASE_STRIP': 'NO',
4970 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4971 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4972 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4973 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4974 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4975 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4976 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4977 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4978 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4979 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4980 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4981 'GCC_VERSION': '4.2',
4982 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4983 'USE_HEADERMAP': 'NO',
4988 # Don't warn about unused function parameters.
4989 '-Wno-unused-parameter',
4990 # Don't warn about the "struct foo f = {0};" initialization
4992 '-Wno-missing-field-initializers',
4995 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4996 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4998 # Note that the prebuilt Clang binaries should not be used for iOS
4999 # development except for ASan builds.
5001 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
5002 # Warn if automatic synthesis is triggered with
5003 # the -Wobjc-missing-property-synthesis flag.
5004 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
5005 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
5007 # This warns on selectors from Cocoa headers (-length, -set).
5008 # cfe-dev is currently discussing the merits of this warning.
5009 # TODO(thakis): Reevaluate what to do with this, based one
5010 # cfe-dev discussion.
5011 '-Wno-selector-type-mismatch',
5014 ['clang_xcode==0', {
5015 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
5016 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
5020 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
5022 '<@(clang_chrome_plugins_flags)',
5025 ['clang==1 and clang_xcode==0 and clang_load!=""', {
5027 '-Xclang', '-load', '-Xclang', '<(clang_load)',
5030 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
5032 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
5035 ['clang==1 and "<(GENERATOR)"=="ninja"', {
5037 # See http://crbug.com/110262
5038 '-fcolor-diagnostics',
5041 ['OS=="ios" and target_subarch!="arm32" and \
5042 "<(GENERATOR)"=="xcode"', {
5044 # TODO(ios): when building Chrome for iOS on 64-bit platform
5045 # with Xcode, the -Wshorted-64-to-32 warning is automatically
5046 # enabled. This cause failures when compiling protobuf code,
5047 # so disable the warning. http://crbug.com/359107
5048 '-Wno-shorten-64-to-32',
5056 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
5062 '-fsanitize=address',
5063 '-mllvm -asan-globals=0', # http://crbug.com/352073
5064 '-gline-tables-only',
5068 ['asan_coverage!=0 and sanitizer_coverage==0', {
5069 'target_conditions': [
5070 ['_toolset=="target"', {
5072 '-fsanitize-coverage=<(asan_coverage)',
5075 'SANITIZER_COVERAGE',
5080 ['sanitizer_coverage!=0', {
5081 'target_conditions': [
5082 ['_toolset=="target"', {
5084 '-fsanitize-coverage=<(sanitizer_coverage)',
5087 'SANITIZER_COVERAGE',
5093 'target_conditions': [
5094 ['_type!="static_library"', {
5095 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5100 '-fsanitize=address',
5104 ['mac_write_linker_maps==1', {
5107 '-Wl,-map,>(_target_name).map',
5114 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5115 'target_conditions': [
5116 ['_type=="executable"', {
5122 # Define copy_asan_dylib_path in a variable ending in
5123 # _path so that gyp understands it's a path and
5124 # performs proper relativization during dict merging.
5125 'copy_asan_dylib_path':
5126 'mac/copy_asan_runtime_dylib.sh',
5128 'postbuild_name': 'Copy ASan runtime dylib',
5130 '<(copy_asan_dylib_path)',
5139 ], # target_conditions
5140 }, # target_defaults
5141 }], # OS=="mac" or OS=="ios"
5143 'target_defaults': {
5145 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5146 # with common names, like 'check', 'require', and 'verify'.
5147 # (Included by system header. Also exists on iOS but not included.)
5148 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5149 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5152 # These should end with %, but there seems to be a bug with % in
5153 # variables that are intended to be set to different values in
5154 # different targets, like these.
5155 'mac_pie': 1, # Most executables can be position-independent.
5156 # Strip debugging symbols from the target.
5157 'mac_strip': '<(mac_strip_release)',
5161 ['mac_want_real_dsym=="default"', {
5164 'mac_real_dsym': '<(mac_want_real_dsym)'
5169 ['mac_want_real_dsym=="default"', {
5170 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5172 'mac_real_dsym': '<(mac_want_real_dsym)'
5181 ['branding=="Chrome" and buildtype=="Official"', {
5184 # The Google Chrome Framework dSYM generated by dsymutil has
5185 # grown larger than 4GB, which dsymutil can't handle. Reduce
5186 # the amount of debug symbols.
5187 '-fno-standalone-debug', # See http://crbug.com/479841
5192 }, # configuration "Release"
5195 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5196 # (Equivalent to -fPIC)
5197 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5198 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5199 # Keep pch files below xcodebuild/.
5200 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5202 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5203 # xcode_setting, but not until all downstream projects' mac bots are
5204 # using xcode >= 4.6, because that's when the default value of the
5205 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5206 # setting is a no-op as far as xcode is concerned, but the compiler
5207 # behaves differently based on whether -fno-strict-aliasing is
5209 '-fno-strict-aliasing', # See http://crbug.com/32204.
5212 'target_conditions': [
5213 ['_type=="executable"', {
5216 # Arranges for data (heap) pages to be protected against
5217 # code execution when running on Mac OS X 10.7 ("Lion"), and
5218 # ensures that the position-independent executable (PIE) bit
5219 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5221 # Define change_mach_o_flags in a variable ending in _path
5222 # so that GYP understands it's a path and performs proper
5223 # relativization during dict merging.
5224 'change_mach_o_flags_path':
5225 'mac/change_mach_o_flags_from_xcode.sh',
5226 'change_mach_o_flags_options%': [
5228 'target_conditions': [
5229 ['mac_pie==0 or release_valgrind_build==1', {
5230 # Don't enable PIE if it's unwanted. It's unwanted if
5231 # the target specifies mac_pie=0 or if building for
5232 # Valgrind, because Valgrind doesn't understand slide.
5233 # See the similar mac_pie/release_valgrind_build check
5235 'change_mach_o_flags_options': [
5241 'postbuild_name': 'Change Mach-O Flags',
5243 '<(change_mach_o_flags_path)',
5244 '>@(change_mach_o_flags_options)',
5248 'target_conditions': [
5249 ['mac_pie==1 and release_valgrind_build==0', {
5250 # Turn on position-independence (ASLR) for executables. When
5251 # PIE is on for the Chrome executables, the framework will
5252 # also be subject to ASLR.
5253 # Don't do this when building for Valgrind, because Valgrind
5254 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5255 # understand slide, and get rid of the Valgrind check.
5258 '-Wl,-pie', # Position-independent executable (MH_PIE)
5264 ['(_type=="executable" or _type=="shared_library" or \
5265 _type=="loadable_module") and mac_strip!=0', {
5266 'target_conditions': [
5267 ['mac_real_dsym == 1', {
5268 # To get a real .dSYM bundle produced by dsymutil, set the
5269 # debug information format to dwarf-with-dsym. Since
5270 # strip_from_xcode will not be used, set Xcode to do the
5271 # stripping as well.
5275 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5276 'DEPLOYMENT_POSTPROCESSING': 'YES',
5277 'STRIP_INSTALLED_PRODUCT': 'YES',
5279 # Only strip non-ASan builds.
5281 'target_conditions': [
5282 ['_type=="shared_library" or _type=="loadable_module"', {
5283 # The Xcode default is to strip debugging symbols
5284 # only (-S). Local symbols should be stripped as
5285 # well, which will be handled by -x. Xcode will
5286 # continue to insert -S when stripping even when
5287 # additional flags are added with STRIPFLAGS.
5289 }], # _type=="shared_library" or _type=="loadable_module"
5290 ], # target_conditions
5296 }, # configuration "Release"
5298 }, { # mac_real_dsym != 1
5299 # To get a fast fake .dSYM bundle, use a post-build step to
5300 # produce the .dSYM and strip the executable. strip_from_xcode
5301 # only operates in the Release configuration.
5305 # Define strip_from_xcode in a variable ending in _path
5306 # so that gyp understands it's a path and performs proper
5307 # relativization during dict merging.
5308 'strip_from_xcode_path': 'mac/strip_from_xcode',
5310 'postbuild_name': 'Strip If Needed',
5311 'action': ['<(strip_from_xcode_path)'],
5315 ], # target_conditions
5316 }], # (_type=="executable" or _type=="shared_library" or
5317 # _type=="loadable_module") and mac_strip!=0
5318 ], # target_conditions
5319 }, # target_defaults
5323 'ios/coverage.gypi',
5325 'target_defaults': {
5326 'xcode_settings' : {
5327 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5330 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5331 # additional flag to suppress the "unknown compiler option" error.
5332 # Restrict this flag to builds that are either compiling with Xcode
5333 # or compiling with Xcode's Clang. This will allow Ninja builds to
5334 # continue failing on unknown compiler options.
5335 # TODO(rohitrao): This flag is temporary and should be removed as
5336 # soon as the iOS bots are updated to use Xcode 5.1.
5337 ['clang_xcode==1', {
5339 '-Wno-unknown-warning-option',
5340 # It's not possible to achieve nullability completeness before
5341 # all builders are running Xcode 7. crbug.com/499809
5342 '-Wno-nullability-completeness',
5346 # Limit the valid architectures depending on "target_subarch".
5347 # This need to include the "arm" architectures but also the "x86"
5348 # ones (they are used when building for the simulator).
5349 ['target_subarch=="arm32"', {
5350 'VALID_ARCHS': ['armv7', 'i386'],
5352 ['target_subarch=="arm64"', {
5353 'VALID_ARCHS': ['arm64', 'x86_64'],
5355 ['target_subarch=="both"', {
5356 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5358 ['use_system_libcxx==1', {
5359 'target_conditions': [
5360 # Only use libc++ when building target for iOS not when building
5361 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5362 # does not support libc++.
5363 ['_toolset=="target"', {
5364 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5368 # The default for deployment target of 7.0+ is libc++, so force
5369 # the old behavior unless libc++ is enabled.
5370 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5374 'target_conditions': [
5375 ['_toolset=="host"', {
5377 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5378 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5387 ['_toolset=="target"', {
5389 # This section should be for overriding host settings. But,
5390 # since we can't negate the iphone deployment target above, we
5391 # instead set it here for target only.
5392 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5393 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5396 ['_type=="executable"', {
5400 'DEPLOYMENT_POSTPROCESSING': 'YES',
5401 'STRIP_INSTALLED_PRODUCT': 'YES',
5406 # Remove dSYM to reduce build time.
5407 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5413 ['chromium_ios_signing', {
5414 # iOS SDK wants everything for device signed.
5415 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5417 'CODE_SIGNING_REQUIRED': 'NO',
5418 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5423 ], # target_conditions
5424 }, # target_defaults
5427 'target_defaults': {
5429 '_WIN32_WINNT=0x0603',
5436 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5437 'WIN32_LEAN_AND_MEAN',
5440 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5441 '_HAS_EXCEPTIONS=0',
5442 # Silence some warnings; we can't switch the the 'recommended'
5443 # versions as they're not available on old OSs.
5444 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5447 ['buildtype=="Official"', {
5448 # In official builds, targets can self-select an optimization
5449 # level by defining a variable named 'optimize', and setting it
5451 # - "size", optimizes for minimal code size - the default.
5452 # - "speed", optimizes for speed over code size.
5453 # - "max", whole program optimization and link-time code
5454 # generation. This is very expensive and should be used
5457 'optimize%': 'size',
5461 # Set /LTCG for the official builds.
5462 'LinkTimeCodeGeneration': '1',
5463 'AdditionalOptions': [
5464 # Set the number of LTCG code-gen threads to eight.
5465 # The default is four. This gives a 5-10% link speedup.
5470 'target_conditions': [
5471 ['optimize=="size"', {
5473 'VCCLCompilerTool': {
5474 # 1, optimizeMinSpace, Minimize Size (/O1)
5475 'Optimization': '1',
5476 # 2, favorSize - Favor small code (/Os)
5477 'FavorSizeOrSpeed': '2',
5482 # This config is used to avoid a problem in ffmpeg, see
5483 # http://crbug.com/264459.
5484 ['optimize=="size_no_ltcg"', {
5486 'VCCLCompilerTool': {
5487 # 1, optimizeMinSpace, Minimize Size (/O1)
5488 'Optimization': '1',
5489 # 2, favorSize - Favor small code (/Os)
5490 'FavorSizeOrSpeed': '2',
5495 ['optimize=="speed"', {
5497 'VCCLCompilerTool': {
5498 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5499 'Optimization': '2',
5500 # 1, favorSpeed - Favor fast code (/Ot)
5501 'FavorSizeOrSpeed': '1',
5506 ['optimize=="max"', {
5507 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5508 # builds. Probably anything that this would catch that
5509 # wouldn't be caught in a normal build isn't going to
5510 # actually be a bug, so the incremental value of C4702 for
5511 # PGO builds is likely very small.
5512 'msvs_disabled_warnings': [
5516 'VCCLCompilerTool': {
5517 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5518 'Optimization': '2',
5519 # 1, favorSpeed - Favor fast code (/Ot)
5520 'FavorSizeOrSpeed': '1',
5521 # This implies link time code generation.
5522 'WholeProgramOptimization': 'true',
5530 ['msvs_xtree_patched!=1', {
5531 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5532 # it's enabled. This will generally only be true for system-level
5533 # installed Express users.
5534 'msvs_disabled_warnings': [
5539 'msvs_system_include_dirs': [
5540 '<(windows_sdk_path)/Include/shared',
5541 '<(windows_sdk_path)/Include/um',
5542 '<(windows_sdk_path)/Include/winrt',
5543 '$(VSInstallDir)/VC/atlmfc/include',
5545 'msvs_cygwin_shell': 0,
5546 'msvs_disabled_warnings': [
5547 # C4091: 'typedef ': ignored on left of 'X' when no variable is
5549 # This happens in a number of Windows headers. Dumb.
5552 # C4127: conditional expression is constant
5553 # This warning can in theory catch dead code and other problems, but
5554 # triggers in far too many desirable cases where the conditional
5555 # expression is either set by macros or corresponds some legitimate
5556 # compile-time constant expression (due to constant template args,
5557 # conditionals comparing the sizes of different types, etc.). Some of
5558 # these can be worked around, but it's not worth it.
5561 # C4351: new behavior: elements of array 'array' will be default
5563 # This is a silly "warning" that basically just alerts you that the
5564 # compiler is going to actually follow the language spec like it's
5565 # supposed to, instead of not following it like old buggy versions
5566 # did. There's absolutely no reason to turn this on.
5569 # C4355: 'this': used in base member initializer list
5570 # It's commonly useful to pass |this| to objects in a class'
5571 # initializer list. While this warning can catch real bugs, most of
5572 # the time the constructors in question don't attempt to call methods
5573 # on the passed-in pointer (until later), and annotating every legit
5574 # usage of this is simply more hassle than the warning is worth.
5577 # C4503: 'identifier': decorated name length exceeded, name was
5579 # This only means that some long error messages might have truncated
5580 # identifiers in the presence of lots of templates. It has no effect
5581 # on program correctness and there's no real reason to waste time
5582 # trying to prevent it.
5585 # C4611: interaction between 'function' and C++ object destruction is
5587 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5588 # suggests using exceptions instead of setjmp/longjmp for C++, but
5589 # Chromium code compiles without exception support. We therefore have
5590 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5591 # means we have to turn off this warning (and be careful about how
5592 # object destruction happens in such cases).
5595 # TODO(maruel): These warnings are level 4. They will be slowly
5596 # removed as code is fixed.
5597 4100, # Unreferenced formal parameter
5598 4121, # Alignment of a member was sensitive to packing
5599 4244, # Conversion from 'type1' to 'type2', possible loss of data
5600 4481, # Nonstandard extension used: override specifier 'keyword'
5601 4505, # Unreferenced local function has been removed
5602 4510, # Default constructor could not be generated
5603 4512, # Assignment operator could not be generated
5604 4610, # Object can never be instantiated
5605 4838, # Narrowing conversion. Doesn't seem to be very useful.
5606 4996, # 'X': was declared deprecated (for GetVersionEx).
5608 # These are variable shadowing warnings that are new in VS2015. We
5609 # should work through these at some point -- they may be removed from
5610 # the RTM release in the /W4 set.
5611 4456, 4457, 4458, 4459,
5614 'VCCLCompilerTool': {
5615 'AdditionalOptions': ['/MP'],
5616 'MinimalRebuild': 'false',
5617 'BufferSecurityCheck': 'true',
5618 'EnableFunctionLevelLinking': 'true',
5619 'RuntimeTypeInfo': 'false',
5620 'WarningLevel': '4',
5621 'WarnAsError': 'true',
5622 'DebugInformationFormat': '3',
5623 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5624 'ExceptionHandling': '0',
5626 'VCLibrarianTool': {
5627 'AdditionalOptions': ['/ignore:4221'],
5628 'AdditionalLibraryDirectories': [
5629 '<(windows_sdk_path)/Lib/win8/um/x86',
5633 'AdditionalDependencies': [
5645 'AdditionalLibraryDirectories': [
5646 '<(windows_sdk_path)/Lib/win8/um/x86',
5648 'GenerateDebugInformation': 'true',
5649 'MapFileName': '$(OutDir)\\$(TargetName).map',
5650 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5651 'FixedBaseAddress': '1',
5654 # 1 == /SUBSYSTEM:CONSOLE
5655 # 2 == /SUBSYSTEM:WINDOWS
5656 # Most of the executables we'll ever create are tests
5657 # and utilities with console output.
5661 'GenerateStublessProxies': 'true',
5662 'TypeLibraryName': '$(InputName).tlb',
5663 'OutputDirectory': '$(IntDir)',
5664 'HeaderFileName': '$(InputName).h',
5665 'DLLDataFileName': '$(InputName).dlldata.c',
5666 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5667 'ProxyFileName': '$(InputName)_p.c',
5669 'VCResourceCompilerTool': {
5671 'AdditionalIncludeDirectories': [
5673 '<(SHARED_INTERMEDIATE_DIR)',
5676 'target_conditions': [
5677 ['_type=="executable"', {
5679 'EmbedManifest': 'true',
5682 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5684 'AdditionalManifestFiles': [
5685 '>(win_exe_compatibility_manifest)',
5691 # Building with Clang on Windows is a work in progress and very
5692 # experimental. See crbug.com/82385.
5693 # Keep this in sync with the similar blocks in build/config/compiler/BUILD.gn
5695 'VCCLCompilerTool': {
5696 'AdditionalOptions': [
5697 # Many files use intrinsics without including this header.
5698 # TODO(hans): Fix those files, or move this to sub-GYPs.
5701 # TODO(hans): Make this list shorter eventually, http://crbug.com/504657
5702 '-Qunused-arguments', # http://crbug.com/504658
5703 '-Wno-c++11-compat-deprecated-writable-strings', # http://crbug.com/504659
5704 '-Wno-deprecated-declarations', # http://crbug.com/504660
5705 '-Wno-empty-body', # http://crbug.com/504661
5706 '-Wno-enum-conversion', # http://crbug.com/504662
5707 '-Wno-extra-tokens', # http://crbug.com/504663
5708 '-Wno-ignored-attributes', # http://crbug.com/504695
5709 '-Wno-incompatible-pointer-types', # http://crbug.com/504696
5710 '-Wno-int-to-void-pointer-cast', # http://crbug.com/504697
5711 '-Wno-invalid-noreturn', # http://crbug.com/504698
5712 '-Wno-logical-op-parentheses', # http://crbug.com/504699
5713 '-Wno-microsoft', # http://crbug.com/505296
5714 '-Wno-missing-braces', # http://crbug.com/505297
5715 '-Wno-msvc-include', # http://crbug.com/505299
5716 '-Wno-overloaded-virtual', # http://crbug.com/505301
5717 '-Wno-pointer-sign', # http://crbug.com/505303
5718 '-Wno-reorder', # http://crbug.com/505304
5719 '-Wno-return-type-c-linkage', # http://crbug.com/505305
5720 '-Wno-sometimes-uninitialized', # http://crbug.com/505307
5721 '-Wno-switch', # http://crbug.com/505308
5722 '-Wno-unknown-pragmas', # http://crbug.com/505314
5723 '-Wno-unused-function', # http://crbug.com/505316
5724 '-Wno-unused-private-field', # http://crbug.com/505317
5725 '-Wno-unused-value', # http://crbug.com/505318
5726 '-Wno-unused-variable', # http://crbug.com/505319
5727 '-Wno-unused-local-typedef', # http://crbug.com/411648
5731 ['clang==1 and target_arch=="ia32"', {
5732 'VCCLCompilerTool': {
5733 'WarnAsError': 'false',
5734 'AdditionalOptions': [
5739 ['clang==1 and clang_use_chrome_plugins==1', {
5740 'VCCLCompilerTool': {
5741 'AdditionalOptions': [
5742 '<@(clang_chrome_plugins_flags)',
5746 ['clang==1 and MSVS_VERSION == "2013"', {
5747 'VCCLCompilerTool': {
5748 'AdditionalOptions': [
5749 '-fmsc-version=1800',
5753 ['clang==1 and MSVS_VERSION == "2015"', {
5754 'VCCLCompilerTool': {
5755 'AdditionalOptions': [
5756 '-fmsc-version=1900',
5760 ['clang==1 and "<!(python <(DEPTH)/build/win/use_ansi_codes.py)"=="True"', {
5761 'VCCLCompilerTool': {
5762 'AdditionalOptions': [
5763 # cmd.exe doesn't understand ANSI escape codes by default,
5764 # so only enable them if something emulating them is around.
5765 '-fansi-escape-codes',
5766 # Also see http://crbug.com/110262
5767 '-fcolor-diagnostics',
5775 ['disable_nacl==1', {
5776 'target_defaults': {
5782 ['OS=="win" and msvs_use_common_linker_extras', {
5783 'target_defaults': {
5798 'AdditionalOptions': [
5809 'AdditionalOptions': ['/largeaddressaware'],
5813 # TODO(asan/win): Move this down into the general
5814 # win-target_defaults section once the 64-bit asan runtime
5815 # exists. See crbug.com/345874.
5816 'VCCLCompilerTool': {
5817 'AdditionalOptions': [
5818 '-fsanitize=address',
5819 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5821 'AdditionalIncludeDirectories': [
5822 # MSVC needs to be able to find the sanitizer headers when
5823 # invoked via /fallback. This is critical for using macros
5824 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5826 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/include_sanitizer',
5830 'AdditionalLibraryDirectories': [
5831 # TODO(hans): If make_clang_dir is absolute, this breaks.
5832 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/lib/windows',
5835 'target_conditions': [
5836 ['component=="shared_library"', {
5838 'AdditionalDependencies': [
5839 'clang_rt.asan_dynamic-i386.lib',
5840 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5844 ['_type=="executable" and component=="static_library"', {
5846 'AdditionalDependencies': [
5847 'clang_rt.asan-i386.lib',
5851 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5853 'AdditionalDependencies': [
5854 'clang_rt.asan_dll_thunk-i386.lib',
5860 ['sanitizer_coverage!=0', {
5861 # TODO(asan/win): Move this down into the general
5862 # win-target_defaults section once the 64-bit asan runtime
5863 # exists. See crbug.com/345874.
5864 'VCCLCompilerTool': {
5865 'AdditionalOptions': [
5866 '-fsanitize-coverage=<(sanitizer_coverage)',
5873 ['sanitizer_coverage!=0', {
5874 # TODO(asan/win): Move this down into the general
5875 # win-target_defaults section once the 64-bit asan runtime
5876 # exists. See crbug.com/345874.
5878 'SANITIZER_COVERAGE',
5886 'AdditionalOptions': [
5887 # safeseh is not compatible with x64
5899 ['enable_new_npdevice_api==1', {
5900 'target_defaults': {
5902 'ENABLE_NEW_NPDEVICE_API',
5906 # Don't warn about the "typedef 'foo' locally defined but not used"
5907 # for gcc 4.8 and higher.
5908 # TODO: remove this flag once all builds work. See crbug.com/227506
5909 ['gcc_version>=48 and clang==0', {
5910 'target_defaults': {
5912 '-Wno-unused-local-typedefs',
5916 ['gcc_version>=48 and clang==0 and host_clang==1', {
5917 'target_defaults': {
5918 'target_conditions': [
5919 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5923 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5925 'make_global_settings': [
5926 ['CC', '<(make_clang_dir)/bin/clang'],
5927 ['CXX', '<(make_clang_dir)/bin/clang++'],
5928 ['CC.host', '$(CC)'],
5929 ['CXX.host', '$(CXX)'],
5932 ['clang==1 and OS=="win"', {
5933 'make_global_settings': [
5934 # On Windows, gyp's ninja generator only looks at CC.
5935 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5938 ['use_lld==1 and OS=="win"', {
5939 'make_global_settings': [
5940 # Limited to Windows because lld-link is the driver that is compatible
5942 ['LD', '<(make_clang_dir)/bin/lld-link'],
5945 ['OS=="android" and clang==0', {
5946 # Hardcode the compiler names in the Makefile so that
5947 # it won't depend on the environment at make time.
5948 'make_global_settings': [
5949 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5950 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5951 ['CC.host', '<(host_cc)'],
5952 ['CXX.host', '<(host_cxx)'],
5955 ['OS=="linux" and target_arch=="mipsel" and clang==0', {
5956 'make_global_settings': [
5957 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5958 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5959 ['CC.host', '<(host_cc)'],
5960 ['CXX.host', '<(host_cxx)'],
5963 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5964 # Set default ARM cross compiling on linux. These can be overridden
5965 # using CC/CXX/etc environment variables.
5966 'make_global_settings': [
5967 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5968 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5969 ['CC.host', '<(host_cc)'],
5970 ['CXX.host', '<(host_cxx)'],
5974 # TODO(yyanagisawa): supports GENERATOR==make
5975 # make generator doesn't support CC_wrapper without CC
5976 # in make_global_settings yet.
5977 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5978 'make_global_settings': [
5979 ['CC_wrapper', '<(gomadir)/gomacc'],
5980 ['CXX_wrapper', '<(gomadir)/gomacc'],
5981 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5982 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5986 'target_defaults': {
5987 'target_conditions': [
5988 ['_toolset=="target"', {
5996 # Work-around for http://openradar.appspot.com/20356002
5997 ['_toolset=="target" and _type!="static_library"', {
6007 ['use_lto==1 and clang==0', {
6008 'target_defaults': {
6009 'target_conditions': [
6010 ['_toolset=="target"', {
6012 '-ffat-lto-objects',
6018 ['use_lto==1 and clang==1', {
6019 'target_defaults': {
6020 'target_conditions': [
6021 ['_toolset=="target"', {
6023 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
6029 # Apply a lower LTO optimization level in non-official builds.
6030 ['use_lto==1 and clang==1 and buildtype!="Official"', {
6031 'target_defaults': {
6032 'target_conditions': [
6033 ['_toolset=="target"', {
6035 '-Wl,--plugin-opt,O1',
6038 ['_toolset=="target" and _type!="static_library"', {
6048 ['use_lto==1 and clang==1 and target_arch=="arm"', {
6049 'target_defaults': {
6050 'target_conditions': [
6051 ['_toolset=="target"', {
6052 # Without this flag, LTO produces a .text section that is larger
6053 # than the maximum call displacement, preventing the linker from
6054 # relocating calls (http://llvm.org/PR22999).
6056 '-Wl,-plugin-opt,-function-sections',
6062 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
6063 'target_defaults': {
6064 'target_conditions': [
6065 ['_toolset=="target"', {
6073 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
6074 'target_defaults': {
6075 'target_conditions': [
6076 ['_toolset=="target"', {
6085 'target_defaults': {
6086 'target_conditions': [
6087 ['_toolset=="target"', {
6089 '-fsanitize=cfi-vcall',
6090 '-fsanitize=cfi-derived-cast',
6091 '-fsanitize=cfi-unrelated-cast',
6094 '-fsanitize=cfi-vcall',
6095 '-fsanitize=cfi-derived-cast',
6096 '-fsanitize=cfi-unrelated-cast',
6100 '-fsanitize=cfi-vcall',
6101 '-fsanitize=cfi-derived-cast',
6102 '-fsanitize=cfi-unrelated-cast',
6106 ['_toolset=="target" and _type!="static_library"', {
6109 '-fsanitize=cfi-vcall',
6110 '-fsanitize=cfi-derived-cast',
6111 '-fsanitize=cfi-unrelated-cast',
6119 'target_defaults': {
6120 'target_conditions': [
6121 ['_toolset=="target"', {
6123 '-fsanitize-blacklist=<(cfi_blacklist)',
6127 '-fsanitize-blacklist=<(cfi_blacklist)',
6136 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
6137 # This block adds *project-wide* configuration settings to each project
6138 # file. It's almost always wrong to put things here. Specify your
6139 # custom xcode_settings in target_defaults to add them to targets instead.
6142 # In an Xcode Project Info window, the "Base SDK for All Configurations"
6143 # setting sets the SDK on a project-wide basis. In order to get the
6144 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
6145 # here at the project level.
6148 ['mac_sdk_path==""', {
6149 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
6151 'SDKROOT': '<(mac_sdk_path)', # -isysroot
6157 ['ios_sdk_path==""', {
6159 # TODO(justincohen): Ninja only supports simulator for now.
6160 ['"<(GENERATOR)"=="xcode"', {
6161 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6163 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
6167 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6172 # Target both iPhone and iPad.
6173 'TARGETED_DEVICE_FAMILY': '1,2',
6176 ['target_arch=="x64"', {
6181 ['target_arch=="ia32"', {
6190 # The Xcode generator will look for an xcode_settings section at the root
6191 # of each dict and use it to apply settings on a file-wide basis. Most
6192 # settings should not be here, they should be in target-specific
6193 # xcode_settings sections, or better yet, should use non-Xcode-specific
6194 # settings in target dicts. SYMROOT is a special case, because many other
6195 # Xcode variables depend on it, including variables such as
6196 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6197 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6198 # files to appear (when present) in the UI as actual files and not red
6199 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6200 # and therefore SYMROOT, needs to be set at the project level.
6201 'SYMROOT': '<(DEPTH)/xcodebuild',