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 # Override buildtype to select the desired build flavor.
86 # Dev - everyday build for development/testing
87 # Official - release build (generally implies additional processing)
88 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
89 # conversion is done), some of the things which are now controlled by
90 # 'branding', such as symbol generation, will need to be refactored
91 # based on 'buildtype' (i.e. we don't care about saving symbols for
92 # non-Official # builds).
95 # Override branding to select the desired branding flavor.
96 'branding%': 'Chromium',
99 # ChromeOS and Windows use Aura and Ash.
100 ['chromeos==1 or OS=="win" or OS=="linux"', {
105 ['chromecast==1 and OS!="android"', {
115 # Whether we're a traditional desktop unix.
116 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
122 # Embedded implies ozone.
128 'target_arch%': 'arm',
130 # Default architecture we're building for is the architecture we're
131 # building on, and possibly sub-architecture (for iOS builds).
132 'target_arch%': '<(host_arch)',
136 # Copy conditionally-set variables out one scope.
137 'chromeos%': '<(chromeos)',
138 'chromecast%': '<(chromecast)',
139 'desktop_linux%': '<(desktop_linux)',
140 'use_aura%': '<(use_aura)',
141 'use_ash%': '<(use_ash)',
142 'use_cras%': '<(use_cras)',
143 'use_ozone%': '<(use_ozone)',
144 'embedded%': '<(embedded)',
145 'use_libpci%': '<(use_libpci)',
146 'use_openssl%': '<(use_openssl)',
147 'use_openssl_certs%': '<(use_openssl_certs)',
148 'enable_viewport%': '<(enable_viewport)',
149 'enable_hidpi%': '<(enable_hidpi)',
150 'buildtype%': '<(buildtype)',
151 'branding%': '<(branding)',
152 'branding_path_component%': '<(branding)',
153 'host_arch%': '<(host_arch)',
154 'target_arch%': '<(target_arch)',
156 'target_subarch%': '',
158 # The channel to build on Android: stable, beta, dev, canary, or
159 # default. "default" should be used on non-official builds.
160 'android_channel%': 'default',
162 # Set ARM architecture version.
165 # Use aurax11 for clipboard implementation. This is true on linux_aura.
166 'use_clipboard_aurax11%': 0,
170 # If no gomadir is set, it uses the default gomadir.
174 # The system root for cross-compiles. Default: none.
179 # The system libdir used for this ABI.
180 'system_libdir%': 'lib',
182 # Default MIPS arch variant. This is set in the conditions block
183 # below for MIPS targets.
184 'mips_arch_variant%': '',
186 # MIPS DSP ASE revision. Possible values are:
193 ['branding == "Chrome"', {
194 'branding_path_component%': 'google_chrome',
197 ['branding == "Chromium"', {
198 'branding_path_component%': 'chromium',
206 # Set default value of toolkit_views based on OS.
207 ['OS=="mac" or OS=="win" or chromeos==1 or use_aura==1', {
213 # Embedded builds use aura without ash or views.
220 # Enable HiDPI on Mac OS, Chrome OS, Windows and Linux.
221 ['OS=="mac" or chromeos==1 or OS=="win" or OS=="linux"', {
225 # Enable the OpenSSL backend on Mac OS and Windows.
226 ['OS=="mac" or OS=="win"', {
230 # Enable App Launcher everywhere but mobile.
231 ['OS!="ios" and OS!="android"', {
232 'enable_app_list%': 1,
234 'enable_app_list%': 0,
237 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
238 'use_default_render_theme%': 1,
240 'use_default_render_theme%': 0,
244 'use_ozone_evdev%': 1,
246 'use_ozone_evdev%': 0,
249 # Set default gomadir.
251 'gomadir': 'c:\\goma\\goma-win',
253 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
256 # Set the default "target_subarch" on iOS. Valid values are "arm32",
257 # "arm64" and "both" (meaning a fat binary).
259 'target_subarch%': 'arm64',
262 # Set arch variants for MIPS platforms.
263 ['target_arch=="mips64el"', {
266 'mips_arch_variant%': 'r6',
268 'mips_arch_variant%': 'r2',
273 ['target_arch=="mipsel"', {
274 'mips_arch_variant%': 'r1',
279 # Copy conditionally-set variables out one scope.
280 'chromeos%': '<(chromeos)',
281 'chromecast%': '<(chromecast)',
282 'host_arch%': '<(host_arch)',
283 'target_arch%': '<(target_arch)',
284 'target_subarch%': '<(target_subarch)',
285 'mips_arch_variant%': '<(mips_arch_variant)',
286 'mips_dsp_rev%': '<(mips_dsp_rev)',
287 'toolkit_views%': '<(toolkit_views)',
288 'desktop_linux%': '<(desktop_linux)',
289 'use_aura%': '<(use_aura)',
290 'use_ash%': '<(use_ash)',
291 'use_cras%': '<(use_cras)',
292 'use_libpci%': '<(use_libpci)',
293 'use_ozone%': '<(use_ozone)',
294 'use_ozone_evdev%': '<(use_ozone_evdev)',
295 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
296 'embedded%': '<(embedded)',
297 'use_openssl%': '<(use_openssl)',
298 'use_openssl_certs%': '<(use_openssl_certs)',
299 'enable_viewport%': '<(enable_viewport)',
300 'enable_hidpi%': '<(enable_hidpi)',
301 'android_channel%': '<(android_channel)',
302 'use_goma%': '<(use_goma)',
303 'gomadir%': '<(gomadir)',
304 'enable_app_list%': '<(enable_app_list)',
305 'use_default_render_theme%': '<(use_default_render_theme)',
306 'buildtype%': '<(buildtype)',
307 'branding%': '<(branding)',
308 'branding_path_component%': '<(branding_path_component)',
309 'arm_version%': '<(arm_version)',
310 'sysroot%': '<(sysroot)',
311 'chroot_cmd%': '<(chroot_cmd)',
312 'system_libdir%': '<(system_libdir)',
314 # Set to 1 to enable fast builds. Set to 2 for even faster builds
315 # (it disables debug info for fastest compilation - only for use
316 # on compile-only bots).
319 # Set to 1 to not store any build metadata, e.g. ifdef out all __DATE__
320 # and __TIME__. Set to 0 to reenable the use of these macros in the code
321 # base. See http://crbug.com/314403.
322 'dont_embed_build_metadata%': 1,
324 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
325 # This is useful for parallel compilation tools which can't support /Zi.
326 # Only used on Windows.
329 # Set to 1 to enable dcheck in Release build.
330 'dcheck_always_on%': 0,
332 # Set to 1 to make a build that disables unshipped tracing events.
333 # Note: this setting is ignored if buildtype=="Official".
334 'tracing_like_official_build%': 0,
336 # Disable image loader component extension by default.
337 'image_loader_extension%': 0,
339 # Set NEON compilation flags.
342 # Detect NEON support at run-time.
343 'arm_neon_optional%': 0,
345 # Use libjpeg-turbo as the JPEG codec used by Chromium.
346 'use_libjpeg_turbo%': 1,
348 # Use system libjpeg. Note that the system's libjepg will be used even if
349 # use_libjpeg_turbo is set.
350 'use_system_libjpeg%': 0,
352 # By default, component is set to static_library and it can be overriden
353 # by the GYP command line or by ~/.gyp/include.gypi.
354 'component%': 'static_library',
356 # /analyze is off by default on Windows because it is very slow and noisy.
357 # Enable with GYP_DEFINES=win_analyze=1
360 # Set to select the Title Case versions of strings in GRD files.
361 'use_titlecase_in_grd%': 0,
363 # Use translations provided by volunteers at launchpad.net. This
364 # currently only works on Linux.
365 'use_third_party_translations%': 0,
367 # Remoting compilation is enabled by default. Set to 0 to disable.
370 # Configuration policy is enabled by default. Set to 0 to disable.
371 'configuration_policy%': 1,
373 # Variable safe_browsing is used to control the build time configuration
374 # for safe browsing feature. Safe browsing can be compiled in 3 different
375 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
376 # reporting features without enabling phishing and malware detection. This
377 # is useful to integrate a third party phishing/malware detection to
378 # existing safe browsing logic.
381 # Web speech is enabled by default. Set to 0 to disable.
382 'enable_web_speech%': 1,
384 # Notifications are compiled in by default. Set to 0 to disable.
385 'notifications%' : 1,
387 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
388 # regular builds and 1 for ASan builds.
389 'mac_want_real_dsym%': 'default',
391 # If this is set, the clang plugins used on the buildbot will be used.
392 # Run tools/clang/scripts/update.sh to make sure they are compiled.
393 # This causes 'clang_chrome_plugins_flags' to be set.
394 # Has no effect if 'clang' is not set as well.
395 'clang_use_chrome_plugins%': 1,
397 # Enable building with ASAN (Clang's -fsanitize=address option).
398 # -fsanitize=address only works with clang, but asan=1 implies clang=1
399 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
401 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
402 # Enable coverage gathering instrumentation in sanitizer tools. This flag
403 # also controls coverage granularity (1 for function-level coverage, 2
404 # for block-level coverage).
405 'sanitizer_coverage%': 0,
406 # Deprecated, only works if |sanitizer_coverage| isn't set.
407 # TODO(glider): remove this flag.
409 # Enable intra-object-overflow detection in ASan (experimental).
410 'asan_field_padding%': 0,
412 # Enable Chromium overrides of the default configurations for various
413 # dynamic tools (like ASan).
414 'use_sanitizer_options%': 0,
416 # Enable building with SyzyAsan.
417 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
420 # Enable crash reporting via Kasko.
423 # Enable building with LSan (Clang's -fsanitize=leak option).
424 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
425 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
428 # Enable building with TSan (Clang's -fsanitize=thread option).
429 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
430 # See http://clang.llvm.org/docs/ThreadSanitizer.html
432 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
434 # Enable building with MSan (Clang's -fsanitize=memory option).
435 # MemorySanitizer only works with clang, but msan=1 implies clang=1
436 # See http://clang.llvm.org/docs/MemorySanitizer.html
438 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
439 # Track where uninitialized memory originates from. From fastest to
440 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
441 # - track the chain of stores leading from allocation site to use site.
442 'msan_track_origins%': 2,
444 # Enable building with UBSan (Clang's -fsanitize=undefined option).
445 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
446 # See http://clang.llvm.org/docs/UsersManual.html
448 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
450 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
451 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
454 # Use dynamic libraries instrumented by one of the sanitizers
455 # instead of the standard system libraries. Set this flag to build the
456 # libraries from source.
457 'use_instrumented_libraries%': 0,
459 # Use dynamic libraries instrumented by one of the sanitizers
460 # instead of the standard system libraries. Set this flag to download
461 # prebuilt binaries from GCS.
462 'use_prebuilt_instrumented_libraries%': 0,
464 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
465 # stdlibc++ as standard library. This is intended to use for instrumented
467 'use_custom_libcxx%': 0,
469 # Use system libc++ instead of the default C++ library, usually libstdc++.
470 # This is intended for iOS builds only.
471 'use_system_libcxx%': 0,
473 # Use a modified version of Clang to intercept allocated types and sizes
474 # for allocated objects. clang_type_profiler=1 implies clang=1.
475 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
476 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
477 'clang_type_profiler%': 0,
479 # Set to true to instrument the code with function call logger.
480 # See src/third_party/cygprofile/cyg-profile.cc for details.
481 'order_profiling%': 0,
483 # Use the provided profiled order file to link Chrome image with it.
484 # This makes Chrome faster by better using CPU cache when executing code.
485 # This is known as PGO (profile guided optimization).
486 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
487 'order_text_section%' : "",
489 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
490 # libraries on linux x86-64 and arm, plus ASLR.
493 # Whether one-click signin is enabled or not.
494 'enable_one_click_signin%': 0,
496 # Whether to back up data before sync.
497 'enable_pre_sync_backup%': 0,
499 # Enable Chrome browser extensions
500 'enable_extensions%': 1,
503 'enable_google_now%': 1,
505 # Enable basic printing support and UI.
506 'enable_basic_printing%': 1,
508 # Enable printing with print preview. It does not imply
509 # enable_basic_printing. It's possible to build Chrome with preview only.
510 'enable_print_preview%': 1,
512 # Set the version of CLD.
513 # 0: Don't specify the version. This option is for the Finch testing.
518 # For CLD2, the size of the tables that should be included in the build
519 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
521 # See third_party/cld_2/cld_2.gyp for more information.
522 # 0: Small tables, lower accuracy
523 # 2: Large tables, high accuracy
524 'cld2_table_size%': 2,
526 # Enable spell checker.
527 'enable_spellcheck%': 1,
529 # Webrtc compilation is enabled by default. Set to 0 to disable.
532 # Media router support is enabled by default. Set to 0 to disable.
533 'enable_media_router%': 1,
535 # Enables use of the session service, which is enabled by default.
536 # Support for disabling depends on the platform.
537 'enable_session_service%': 1,
539 # Enables theme support, which is enabled by default. Support for
540 # disabling depends on the platform.
543 # Enables autofill dialog and associated features; disabled by default.
544 'enable_autofill_dialog%' : 0,
546 # Defaults Wallet integration in Autofill dialog to use production
547 # servers. Unofficial builds won't have the proper API keys.
548 'enable_prod_wallet_service%': 0,
550 # Enables support for background apps.
551 'enable_background%': 1,
553 # Enable the task manager by default.
554 'enable_task_manager%': 1,
556 # Enables used resource whitelist generation; disabled by default.
557 'enable_resource_whitelist_generation%': 0,
559 # Enable FILE support by default.
560 'disable_file_support%': 0,
562 # Enable FTP support by default.
563 'disable_ftp_support%': 0,
565 # Use native android functions in place of ICU. Not supported by most
567 'use_icu_alternatives_on_android%': 0,
569 # Use of precompiled headers on Windows.
571 # This variable may be explicitly set to 1 (enabled) or 0
572 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
573 # This setting will override the default.
576 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
578 'chromium_win_pch%': 0,
581 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
582 # Set this to true when building with Clang.
583 # See http://code.google.com/p/chromium/wiki/Clang for details.
584 # If this is set, clang is used as both host and target compiler in
585 # cross-compile builds.
588 # Use experimental lld linker instead of the platform's default linker.
591 # Enable plugin installation by default.
592 'enable_plugin_installation%': 1,
594 # Specifies whether to use canvas_skia.cc in place of platform
595 # specific implementations of gfx::Canvas. Affects text drawing in the
597 # TODO(asvitkine): Enable this on all platforms and delete this flag.
598 # http://crbug.com/105550
599 'use_canvas_skia%': 0,
601 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
602 # with one of those tools.
603 'build_for_tool%': '',
605 # If no directory is specified then a temporary directory will be used.
606 'test_isolation_outdir%': '',
608 'wix_path%': '<(DEPTH)/third_party/wix',
610 # Supervised users are enabled by default.
611 'enable_supervised_users%': 1,
613 # Platform sends memory pressure signals natively.
614 'native_memory_pressure_signals%': 0,
616 'spdy_proxy_auth_property%' : '',
617 'spdy_proxy_auth_value%' : '',
619 'enable_service_discovery%': 0,
620 'enable_wifi_bootstrapping%': 0,
621 'enable_hangout_services_extension%': 0,
623 # Enable the Syzygy optimization step.
624 'syzygy_optimize%': 0,
626 # Enable hole punching for the protected video.
629 # Automatically select platforms under ozone. Turn this off to
630 # build only explicitly selected platforms.
631 'ozone_auto_platforms%': 1,
633 # If this is set clang is used as host compiler, but not as target
634 # compiler. Always do this by default.
637 # Variables to control Link-Time Optimization (LTO).
638 # On Android, the variable use_lto enables LTO on code compiled with -Os,
639 # and use_lto_o2 enables LTO on code compiled with -O2. On other
640 # platforms, use_lto enables LTO in all translation units, and use_lto_o2
643 # On Linux and Android, when using LLVM LTO, the script
644 # build/download_gold_plugin.py must be run to download a linker plugin.
645 # On Mac, LLVM needs to be built from scratch using
646 # tools/clang/scripts/update.py and the absolute path to
647 # third_party/llvm-build/Release+Asserts/lib must be added to
648 # $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin.
650 # On Android, the variables must *not* be enabled at the same time.
651 # In this case LTO would 'merge' the optimization flags at link-time
652 # which would lead to all code be optimized with -O2. See crbug.com/407544
656 # Allowed level of identical code folding in the gold linker.
657 'gold_icf_level%': 'safe',
659 # Libxkbcommon usage.
662 # Control Flow Integrity for virtual calls.
663 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
666 # Control Flow Integrity for casts.
667 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
668 'cfi_derived_cast%': 0,
669 'cfi_unrelated_cast%': 0,
671 'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
673 # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
674 'mac_views_browser%': 0,
676 # By default, use ICU data file (icudtl.dat).
677 'icu_use_data_file_flag%': 1,
679 # Turn on JNI generation optimizations by default.
680 'optimize_jni_generation%': 1,
683 # A flag for POSIX platforms
690 # A flag for BSD platforms
691 ['OS=="freebsd" or OS=="openbsd"', {
698 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris")', {
704 # libudev usage. This currently only affects the content layer.
705 ['OS=="linux" and embedded==0', {
711 # Flags to use X11 on non-Mac POSIX platforms.
712 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
719 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
725 # Flags to use pango and cairo.
726 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
735 ['OS=="linux" and embedded==0', {
741 # We always use skia text rendering in Aura on Windows, since GDI
742 # doesn't agree with our BackingStore.
743 # TODO(beng): remove once skia text rendering is on by default.
744 ['use_aura==1 and OS=="win"', {
745 'enable_skia_text%': 1,
748 # A flag to enable or disable our compile-time dependency
749 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
750 # support will be available. This option is useful
751 # for Linux distributions and for Aura.
752 ['OS!="linux" or chromeos==1', {
753 'use_gnome_keyring%': 0,
755 'use_gnome_keyring%': 1,
758 ['OS=="mac" or OS=="ios"', {
759 # Mac and iOS want Title Case strings
760 'use_titlecase_in_grd%': 1,
763 # Enable loader extensions on Chrome OS.
765 'image_loader_extension%': 1,
767 'image_loader_extension%': 0,
770 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
771 'enable_one_click_signin%': 1,
772 'enable_pre_sync_backup%': 1,
776 'enable_extensions%': 0,
777 'enable_google_now%': 0,
779 'enable_spellcheck%': 0,
783 'arm_neon_optional%': 1,
784 'native_memory_pressure_signals%': 1,
785 'enable_basic_printing%': 1,
786 'enable_print_preview%': 0,
787 'enable_task_manager%':0,
791 # Android OS includes support for proprietary codecs regardless of
792 # building Chromium or Google Chrome. We also ship Google Chrome and
793 # Chromecast with proprietary codecs.
794 ['OS=="android" or branding=="Chrome" or chromecast==1', {
795 'proprietary_codecs%': 1,
797 'proprietary_codecs%': 0,
800 ['OS=="mac" or OS=="ios"', {
801 'native_memory_pressure_signals%': 1,
804 # Enable autofill dialog when not on iOS.
806 'enable_autofill_dialog%': 1,
809 ['buildtype=="Official"', {
810 'enable_prod_wallet_service%': 1,
820 'disable_ftp_support%': 1,
821 'enable_extensions%': 0,
822 'enable_google_now%': 0,
824 'cld2_table_size%': 0,
825 'enable_basic_printing%': 0,
826 'enable_print_preview%': 0,
827 'enable_session_service%': 0,
828 'enable_spellcheck%': 0,
834 'enable_supervised_users%': 0,
835 'enable_task_manager%': 0,
836 'use_system_libcxx%': 1,
839 # Use GPU accelerated cross process image transport by default
840 # on linux builds with the Aura window manager
841 ['use_aura==1 and OS=="linux"', {
842 'ui_compositor_image_transport%': 1,
844 'ui_compositor_image_transport%': 0,
847 # Turn precompiled headers on by default.
848 ['OS=="win" and buildtype!="Official"', {
849 'chromium_win_pch%': 1
852 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
853 'enable_plugin_installation%': 0,
855 'enable_plugin_installation%': 1,
858 # Whether PPAPI is enabled.
859 ['OS=="android" or OS=="ios" or embedded==1', {
860 'enable_plugins%': 0,
862 'enable_plugins%': 1,
865 # linux_use_bundled_gold: whether to use the gold linker binary checked
866 # into third_party/binutils. Force this off via GYP_DEFINES when you
867 # are using a custom toolchain and need to control -B in ldflags.
868 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
869 # for component=static_library builds.
870 ['(OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm")', {
871 'linux_use_bundled_gold%': 1,
873 'linux_use_bundled_gold%': 0,
876 # linux_use_bundled_binutils: whether to use the binary binutils
877 # checked into third_party/binutils. These are not multi-arch so cannot
878 # be used except on x86 and x86-64 (the only two architectures which
879 # are currently checke in). Force this off via GYP_DEFINES when you
880 # are using a custom toolchain and need to control -B in cflags.
881 ['OS=="linux" and (target_arch=="x64")', {
882 'linux_use_bundled_binutils%': 1,
884 'linux_use_bundled_binutils%': 0,
887 # linux_use_gold_flags: whether to use build flags that rely on gold.
888 # On by default for x64 Linux.
889 ['OS=="linux" and target_arch=="x64"', {
890 'linux_use_gold_flags%': 1,
892 'linux_use_gold_flags%': 0,
895 # linux_use_debug_fission: whether to use split DWARF debug info
896 # files. This can reduce link time significantly, but is incompatible
897 # with some utilities such as icecc and ccache. Requires gold and
898 # gcc >= 4.8 or clang.
899 # http://gcc.gnu.org/wiki/DebugFission
900 ['OS=="linux" and target_arch=="x64"', {
901 'linux_use_debug_fission%': 1,
903 'linux_use_debug_fission%': 0,
906 ['OS=="android" or OS=="ios"', {
907 'enable_captive_portal_detection%': 0,
908 'enable_media_router%': 0,
910 'enable_captive_portal_detection%': 1,
911 'enable_media_router%': 1,
914 # Enable Skia UI text drawing incrementally on different platforms.
915 # http://crbug.com/105550
917 # On Aura, this allows per-tile painting to be used in the browser
919 ['OS!="android" and OS!="ios"', {
920 'use_canvas_skia%': 1,
924 'enable_basic_printing%': 0,
925 'enable_print_preview%': 1,
928 # Do not enable the Settings App on ChromeOS.
929 ['enable_app_list==1 and chromeos==0', {
930 'enable_settings_app%': 1,
932 'enable_settings_app%': 0,
935 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
936 # Set some defaults for arm/linux chrome builds
937 'use_allocator%': 'none',
938 # sysroot needs to be an absolute path otherwise it generates
939 # incorrect results when passed to pkg-config
940 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot',
941 }], # OS=="linux" and target_arch=="arm" and chromeos==0
943 ['OS=="linux" and ((branding=="Chrome" and buildtype=="Official" and chromeos==0) or use_sysroot==1)' , {
945 ['target_arch=="x64"', {
946 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
948 ['target_arch=="ia32"', {
949 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
952 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
954 ['OS=="linux" and target_arch=="mipsel"', {
955 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
956 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
959 # Whether tests targets should be run, archived or just have the
960 # dependencies verified. All the tests targets have the '_run' suffix,
961 # e.g. base_unittests_run runs the target base_unittests. The test
962 # target always calls tools/swarming_client/isolate.py. See the script's
963 # --help for more information. Meant to be overriden with GYP_DEFINES.
964 # TODO(maruel): Remove the conditions as more configurations are
966 ['OS!="ios" and OS!="android" and chromeos==0', {
967 'test_isolation_mode%': 'check',
969 'test_isolation_mode%': 'noop',
971 # Whether Android build uses OpenMAX DL FFT.
972 ['OS=="android" and ((target_arch=="arm" and arm_version >= 7) or target_arch=="ia32" or target_arch=="x64" or target_arch=="arm64" or target_arch=="mipsel")', {
973 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
974 # When enabled, this will also enable WebAudio support on
975 # Android for these architectures. Default is enabled. Whether
976 # WebAudio is actually available depends on runtime settings
978 'use_openmax_dl_fft%': 1,
980 'use_openmax_dl_fft%': 0,
982 ['OS=="win" or OS=="linux"', {
986 # Turns on compiler optimizations in V8 in Debug build, except
987 # on android_clang, where we're hitting a weird linker error.
988 # TODO(dpranke): http://crbug.com/266155 .
990 'v8_optimized_debug%': 1,
992 'v8_optimized_debug%': 2,
995 # Disable various features by default on embedded.
998 'enable_basic_printing%': 0,
999 'enable_print_preview%': 0,
1002 ['OS=="win" or OS=="mac"', {
1003 'enable_wifi_bootstrapping%' : 1,
1006 # Path to sas.dll, which provides the SendSAS function.
1007 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1008 ['target_arch=="x64"', {
1009 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1011 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1015 # Setting this to '0' will cause V8's startup snapshot to be
1016 # embedded in the binary instead of being a external files.
1017 'v8_use_external_startup_data%': 1,
1019 # Set this to 1 to enable use of concatenated impulse responses
1020 # for the HRTF panner in WebAudio.
1021 'use_concatenated_impulse_responses': 1,
1023 # You can set the variable 'use_official_google_api_keys' to 1
1024 # to use the Google-internal file containing official API keys
1025 # for Google Chrome even in a developer build. Setting this
1026 # variable explicitly to 1 will cause your build to fail if the
1027 # internal file is missing.
1029 # The variable is documented here, but not handled in this file;
1030 # see //google_apis/determine_use_official_keys.gypi for the
1033 # Set the variable to 0 to not use the internal file, even when
1034 # it exists in your checkout.
1036 # Leave it unset in your include.gypi to have the variable
1037 # implicitly set to 1 if you have
1038 # src/google_apis/internal/google_chrome_api_keys.h in your
1039 # checkout, and implicitly set to 0 if not.
1041 # Note that official builds always behave as if the variable
1042 # was explicitly set to 1, i.e. they always use official keys,
1043 # and will fail to build if the internal file is missing.
1045 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1046 # include.gypi or by other means. Due to subtleties of GYP, this
1047 # is not the same as leaving the variable unset, even though its
1049 # //google_apis/determine_use_official_keys.gypi is 2.
1051 # Set these to bake the specified API keys and OAuth client
1052 # IDs/secrets into your build.
1054 # If you create a build without values baked in, you can instead
1055 # set environment variables to provide the keys at runtime (see
1056 # src/google_apis/google_api_keys.h for details). Features that
1057 # require server-side APIs may fail to work if no keys are
1060 # Note that if you are building an official build or if
1061 # use_official_google_api_keys has been set to 1 (explicitly or
1062 # implicitly), these values will be ignored and the official
1063 # keys will be used instead.
1064 'google_api_key%': '',
1065 'google_default_client_id%': '',
1066 'google_default_client_secret%': '',
1067 # Native Client is enabled by default.
1068 'disable_nacl%': '0',
1070 # Sets the default version name and code for Android app, by default we
1071 # do a developer build.
1072 'android_app_version_name%': 'Developer Build',
1073 'android_app_version_code%': 1,
1076 # Copy conditionally-set variables out one scope.
1077 'branding%': '<(branding)',
1078 'branding_path_component%': '<(branding_path_component)',
1079 'buildtype%': '<(buildtype)',
1080 'target_arch%': '<(target_arch)',
1081 'target_subarch%': '<(target_subarch)',
1082 'mips_arch_variant%': '<(mips_arch_variant)',
1083 'mips_dsp_rev%': '<(mips_dsp_rev)',
1084 'host_arch%': '<(host_arch)',
1085 'toolkit_views%': '<(toolkit_views)',
1086 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1087 'use_aura%': '<(use_aura)',
1088 'use_ash%': '<(use_ash)',
1089 'use_cras%': '<(use_cras)',
1090 'use_libpci%': '<(use_libpci)',
1091 'use_openssl%': '<(use_openssl)',
1092 'use_openssl_certs%': '<(use_openssl_certs)',
1093 'use_nss_certs%': '<(use_nss_certs)',
1094 'use_udev%': '<(use_udev)',
1095 'os_bsd%': '<(os_bsd)',
1096 'os_posix%': '<(os_posix)',
1097 'use_dbus%': '<(use_dbus)',
1098 'use_glib%': '<(use_glib)',
1099 'use_pango%': '<(use_pango)',
1100 'use_cairo%': '<(use_cairo)',
1101 'use_ozone%': '<(use_ozone)',
1102 'use_ozone_evdev%': '<(use_ozone_evdev)',
1103 'use_xkbcommon%': '<(use_xkbcommon)',
1104 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1105 'desktop_linux%': '<(desktop_linux)',
1106 'use_x11%': '<(use_x11)',
1107 'use_gnome_keyring%': '<(use_gnome_keyring)',
1108 'linux_fpic%': '<(linux_fpic)',
1109 'chromeos%': '<(chromeos)',
1110 'chromecast%': '<(chromecast)',
1111 'enable_viewport%': '<(enable_viewport)',
1112 'enable_hidpi%': '<(enable_hidpi)',
1113 'image_loader_extension%': '<(image_loader_extension)',
1114 'fastbuild%': '<(fastbuild)',
1115 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1116 'win_z7%': '<(win_z7)',
1117 'dcheck_always_on%': '<(dcheck_always_on)',
1118 'tracing_like_official_build%': '<(tracing_like_official_build)',
1119 'arm_version%': '<(arm_version)',
1120 'arm_neon%': '<(arm_neon)',
1121 'arm_neon_optional%': '<(arm_neon_optional)',
1122 'sysroot%': '<(sysroot)',
1123 'chroot_cmd%': '<(chroot_cmd)',
1124 'system_libdir%': '<(system_libdir)',
1125 'component%': '<(component)',
1126 'win_analyze%': '<(win_analyze)',
1127 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1128 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1129 'use_third_party_translations%': '<(use_third_party_translations)',
1130 'remoting%': '<(remoting)',
1131 'enable_one_click_signin%': '<(enable_one_click_signin)',
1132 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1133 'enable_media_router%': '<(enable_media_router)',
1134 'enable_webrtc%': '<(enable_webrtc)',
1135 'chromium_win_pch%': '<(chromium_win_pch)',
1136 'configuration_policy%': '<(configuration_policy)',
1137 'safe_browsing%': '<(safe_browsing)',
1138 'enable_web_speech%': '<(enable_web_speech)',
1139 'notifications%': '<(notifications)',
1140 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1141 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1143 'asan_blacklist%': '<(asan_blacklist)',
1144 'asan_coverage%': '<(asan_coverage)',
1145 'sanitizer_coverage%': '<(sanitizer_coverage)',
1146 'asan_field_padding%': '<(asan_field_padding)',
1147 'use_sanitizer_options%': '<(use_sanitizer_options)',
1148 'syzyasan%': '<(syzyasan)',
1149 'kasko%': '<(kasko)',
1150 'syzygy_optimize%': '<(syzygy_optimize)',
1153 'msan_blacklist%': '<(msan_blacklist)',
1154 'msan_track_origins%': '<(msan_track_origins)',
1156 'tsan_blacklist%': '<(tsan_blacklist)',
1157 'ubsan%': '<(ubsan)',
1158 'ubsan_blacklist%': '<(ubsan_blacklist)',
1159 'ubsan_vptr%': '<(ubsan_vptr)',
1160 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1161 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
1162 'use_custom_libcxx%': '<(use_custom_libcxx)',
1163 'use_system_libcxx%': '<(use_system_libcxx)',
1164 'clang_type_profiler%': '<(clang_type_profiler)',
1165 'order_profiling%': '<(order_profiling)',
1166 'order_text_section%': '<(order_text_section)',
1167 'enable_extensions%': '<(enable_extensions)',
1168 'enable_plugin_installation%': '<(enable_plugin_installation)',
1169 'enable_plugins%': '<(enable_plugins)',
1170 'enable_session_service%': '<(enable_session_service)',
1171 'enable_themes%': '<(enable_themes)',
1172 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1173 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1174 'enable_background%': '<(enable_background)',
1175 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1176 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1177 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1178 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1179 'use_canvas_skia%': '<(use_canvas_skia)',
1180 'test_isolation_mode%': '<(test_isolation_mode)',
1181 'test_isolation_outdir%': '<(test_isolation_outdir)',
1182 'enable_basic_printing%': '<(enable_basic_printing)',
1183 'enable_print_preview%': '<(enable_print_preview)',
1184 'enable_spellcheck%': '<(enable_spellcheck)',
1185 'enable_google_now%': '<(enable_google_now)',
1186 'cld_version%': '<(cld_version)',
1187 'cld2_table_size%': '<(cld2_table_size)',
1188 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1189 'disable_file_support%': '<(disable_file_support)',
1190 'disable_ftp_support%': '<(disable_ftp_support)',
1191 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1192 'enable_task_manager%': '<(enable_task_manager)',
1193 'sas_dll_path%': '<(sas_dll_path)',
1194 'wix_path%': '<(wix_path)',
1195 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1196 'use_system_libjpeg%': '<(use_system_libjpeg)',
1197 'android_channel%': '<(android_channel)',
1198 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1199 'gyp_managed_install%': 0,
1200 'create_standalone_apk%': 1,
1201 'enable_app_list%': '<(enable_app_list)',
1202 'use_default_render_theme%': '<(use_default_render_theme)',
1203 'enable_settings_app%': '<(enable_settings_app)',
1204 'google_api_key%': '<(google_api_key)',
1205 'google_default_client_id%': '<(google_default_client_id)',
1206 'google_default_client_secret%': '<(google_default_client_secret)',
1207 'enable_supervised_users%': '<(enable_supervised_users)',
1208 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1209 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1210 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1211 'enable_mdns%' : '<(enable_mdns)',
1212 'enable_service_discovery%' : '<(enable_service_discovery)',
1213 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1214 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1215 'v8_optimized_debug%': '<(v8_optimized_debug)',
1216 'proprietary_codecs%': '<(proprietary_codecs)',
1217 'use_goma%': '<(use_goma)',
1218 'gomadir%': '<(gomadir)',
1219 'use_lto%': '<(use_lto)',
1220 'use_lto_o2%': '<(use_lto_o2)',
1221 'gold_icf_level%': '<(gold_icf_level)',
1222 'video_hole%': '<(video_hole)',
1223 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1224 'cfi_vptr%': '<(cfi_vptr)',
1225 'cfi_derived_cast%': '<(cfi_derived_cast)',
1226 'cfi_unrelated_cast%': '<(cfi_unrelated_cast)',
1227 'cfi_blacklist%': '<(cfi_blacklist)',
1228 'mac_views_browser%': '<(mac_views_browser)',
1229 'android_app_version_name%': '<(android_app_version_name)',
1230 'android_app_version_code%': '<(android_app_version_code)',
1232 # Use system protobuf instead of bundled one.
1233 'use_system_protobuf%': 0,
1235 # Use system yasm instead of bundled one.
1236 'use_system_yasm%': 0,
1238 # Use system ICU instead of bundled one.
1239 'use_system_icu%' : 0,
1241 # Default to enabled PIE; this is important for ASLR but we may need to be
1242 # able to turn it off for various reasons.
1243 'linux_disable_pie%': 0,
1245 # The release channel that this build targets. This is used to restrict
1246 # channel-specific build options, like which installer packages to create.
1247 # The default is 'all', which does no channel-specific filtering.
1250 # Override chromium_mac_pch and set it to 0 to suppress the use of
1251 # precompiled headers on the Mac. Prefix header injection may still be
1252 # used, but prefix headers will not be precompiled. This is useful when
1253 # using distcc to distribute a build to compile slaves that don't
1254 # share the same compiler executable as the system driving the compilation,
1255 # because precompiled headers rely on pointers into a specific compiler
1256 # executable's image. Setting this to 0 is needed to use an experimental
1257 # Linux-Mac cross compiler distcc farm.
1258 'chromium_mac_pch%': 1,
1260 # The default value for mac_strip in target_defaults. This cannot be
1261 # set there, per the comment about variable% in a target_defaults.
1262 'mac_strip_release%': 0,
1264 # Set to 1 to enable java code coverage. Instruments classes during build
1265 # to produce .ec files during runtime.
1266 'emma_coverage%': 0,
1268 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1269 # separated with whitespace and/or comma. Only has effect if
1270 # 'emma_coverage=1'.
1273 # Set to 1 to enable running Android lint on java/class files.
1276 # Although base/allocator lets you select a heap library via an
1277 # environment variable, the libcmt shim it uses sometimes gets in
1278 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1279 # 'win_use_allocator_shim': 0,
1280 # 'win_release_RuntimeLibrary': 2
1281 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1282 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1284 # TODO(bradnelson): eliminate this when possible.
1285 # To allow local gyp files to prevent release.vsprops from being included.
1286 # Yes(1) means include release.vsprops.
1287 # Once all vsprops settings are migrated into gyp, this can go away.
1288 'msvs_use_common_release%': 1,
1290 # TODO(bradnelson): eliminate this when possible.
1291 # To allow local gyp files to override additional linker options for msvs.
1292 # Yes(1) means set use the common linker options.
1293 'msvs_use_common_linker_extras%': 1,
1295 # TODO(sgk): eliminate this if possible.
1296 # It would be nicer to support this via a setting in 'target_defaults'
1297 # in chrome/app/locales/locales.gypi overriding the setting in the
1298 # 'Debug' configuration in the 'target_defaults' dict below,
1299 # but that doesn't work as we'd like.
1300 'msvs_debug_link_incremental%': '2',
1302 # Needed for some of the largest modules.
1303 'msvs_debug_link_nonincremental%': '1',
1305 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1306 # to get incremental linking to be faster in debug builds.
1307 'incremental_chrome_dll%': '0',
1309 # Experimental setting to break chrome.dll into multiple pieces based on
1311 'chrome_multiple_dll%': '0',
1313 # Experimental setting to optimize Chrome's DLLs with PGO.
1314 'chrome_pgo_phase%': '0',
1316 # Whether the VS xtree header has been patched to disable warning 4702. If
1317 # it has, then we don't need to disable 4702 (unreachable code warning).
1318 # The patch is preapplied to the internal toolchain and hence all bots.
1319 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1322 'clang%': '<(clang)',
1323 'host_clang%': '<(host_clang)',
1324 'make_clang_dir%': '<(make_clang_dir)',
1325 'use_lld%': '<(use_lld)',
1327 # Control which version of clang to use when building for iOS. If set to
1328 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1329 # the version of clang that ships with the Chromium source. This variable
1330 # is automatically set to '1' when using the Xcode generator.
1333 # These two variables can be set in GYP_DEFINES while running
1334 # |gclient runhooks| to let clang run a plugin in every compilation.
1335 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1337 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1340 'clang_add_plugin%': '',
1342 # Tell ld64 to write map files describing binary layout. Useful
1343 # for looking at what contributes to binary size, e.g. with
1344 # https://github.com/nico/bloat
1345 'mac_write_linker_maps%': 0,
1347 # The default type of gtest.
1348 'gtest_target_type%': 'executable',
1350 # Enable sampling based profiler.
1351 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1353 # Profile without optimizing out stack frames when profiling==1.
1354 'profiling_full_stack_frames%': '0',
1356 # And if we want to dump symbols for Breakpad-enabled builds.
1357 'linux_dump_symbols%': 0,
1358 # And if we want to strip the binary after dumping symbols.
1359 'linux_strip_binary%': 0,
1360 # If we want stack unwind support for backtrace().
1361 'debug_unwind_tables%': 1,
1362 'release_unwind_tables%': 1,
1364 # Override where to find binutils
1365 'binutils_version%': 0,
1366 'binutils_dir%': '',
1369 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1370 'use_allocator%': 'tcmalloc',
1372 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1373 'linux_link_gnome_keyring%': 0,
1374 # Set to 1 to link against gsettings APIs instead of using dlopen().
1375 'linux_link_gsettings%': 0,
1377 # Enable use of OpenMAX DL FFT routines.
1378 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1380 # Enable new NPDevice API.
1381 'enable_new_npdevice_api%': 0,
1383 # .gyp files or targets should set chromium_code to 1 if they build
1384 # Chromium-specific code, as opposed to external code. This variable is
1385 # used to control such things as the set of warnings to enable, and
1386 # whether warnings are treated as errors.
1387 'chromium_code%': 0,
1389 # Disable fatal linker warnings, similarly to how we make it possible
1390 # to disable -Werror (e.g. for different toolchain versions).
1391 'disable_fatal_linker_warnings%': 0,
1393 'release_valgrind_build%': 0,
1395 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1396 'enable_wexit_time_destructors%': 0,
1398 # Build libpeerconnection as a static library by default.
1399 'libpeer_target_type%': 'static_library',
1401 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1402 'internal_gles2_conform_tests%': 0,
1404 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1405 'internal_khronos_glcts_tests%': 0,
1407 # Set to 1 to compile the filter fuzzer.
1408 'internal_filter_fuzzer%': 0,
1410 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1411 # so Cocoa is happy (http://crbug.com/20441).
1413 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1414 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1415 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1416 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1417 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1418 'vi', 'zh-CN', 'zh-TW',
1421 # Pseudo locales are special locales which are used for testing and
1422 # debugging. They don't get copied to the final app. For more info,
1423 # check out https://www.chromium.org/developers/testing/fake-bidi
1430 # If debug_devtools is set to 1, JavaScript files for DevTools are
1431 # stored as is and loaded from disk. Otherwise, a concatenated file
1432 # is stored in resources.pak. It is still possible to load JS files
1433 # from disk by passing --debug-devtools cmdline switch.
1434 'debug_devtools%': 0,
1436 # The Java Bridge is not compiled in by default.
1439 # Code signing for iOS binaries. The bots need to be able to disable this.
1440 'chromium_ios_signing%': 1,
1442 # This flag is only used when disable_nacl==0 and disables all those
1443 # subcomponents which would require the installation of a native_client
1444 # untrusted toolchain.
1445 'disable_nacl_untrusted%': 0,
1447 # Disable Dart by default.
1450 # Copy out the setting of disable_nacl.
1451 'disable_nacl%': '<(disable_nacl)',
1453 # Portable Native Client is enabled by default.
1454 'disable_pnacl%': 0,
1456 # Whether to build full debug version for Debug configuration on Android.
1457 # Compared to full debug version, the default Debug configuration on Android
1458 # has no full v8 debug, has size optimization and linker gc section, so that
1459 # we can build a debug version with acceptable size and performance.
1460 'android_full_debug%': 0,
1462 # Contains data about the attached devices for gyp_managed_install.
1463 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1465 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1466 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1468 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1469 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1471 # Whether we are using the rlz library or not. Platforms like Android send
1472 # rlz codes for searches but do not use the library.
1475 # Turns on the i18n support in V8.
1476 'v8_enable_i18n_support': 1,
1478 # Compile d8 for the host toolset.
1479 'v8_toolset_for_d8': 'host',
1481 # Use brlapi from brltty for braille display support.
1484 # Relative path to icu.gyp from this file.
1485 'icu_gyp_path': '../third_party/icu/icu.gyp',
1487 # IPC fuzzer is disabled by default.
1488 'enable_ipc_fuzzer%': 0,
1490 # Force disable libstdc++ debug mode.
1491 'disable_glibcxx_debug%': 0,
1493 # Set to 1 to compile with MSE support for MPEG2 TS
1494 'enable_mpeg2ts_stream_parser%': 0,
1496 # Support ChromeOS touchpad gestures with ozone.
1497 'use_evdev_gestures%': 0,
1499 # Default ozone platform (if no --ozone-platform flag).
1500 'ozone_platform%': "",
1502 # Ozone platforms to include in the build.
1503 'ozone_platform_caca%': 0,
1504 'ozone_platform_cast%': 0,
1505 'ozone_platform_dri%': 0,
1506 'ozone_platform_drm%': 0,
1507 'ozone_platform_egltest%': 0,
1508 'ozone_platform_gbm%': 0,
1509 'ozone_platform_ozonex%': 0,
1510 'ozone_platform_test%': 0,
1512 # Experiment: http://crbug.com/426914
1515 # Used to set libjpeg_gyp_path. Chrome OS ui/gfx/gfx.gyp uses the IJG path
1516 # for robust login screen decoding.
1517 'libjpeg_ijg_gyp_path': '<(DEPTH)/third_party/libjpeg/libjpeg.gyp',
1518 'libjpeg_turbo_gyp_path': '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp',
1521 ['buildtype=="Official"', {
1522 # Continue to embed build meta data in Official builds, basically the
1523 # time it was built.
1524 # TODO(maruel): This decision should be revisited because having an
1525 # official deterministic build has high value too but MSVC toolset can't
1526 # generate anything deterministic with WPO enabled AFAIK.
1527 'dont_embed_build_metadata%': 0,
1529 # Enable the Syzygy optimization step for the official builds.
1530 ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
1531 'syzygy_optimize%': 1,
1533 'syzygy_optimize%': 0,
1535 # Get binutils version so we can enable debug fission if we can.
1536 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1538 # compiler_version doesn't work with clang
1539 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1540 # compiler_version works with clang.
1541 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1542 # that it takes effect here.
1543 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1544 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1546 # On Android we know the binutils version in the toolchain.
1548 'binutils_version%': 222,
1550 ['host_arch=="x64"', {
1551 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1553 ['host_arch=="ia32"', {
1554 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1556 # Our version of binutils in third_party/binutils
1557 ['linux_use_bundled_binutils==1', {
1558 'binutils_version%': 224,
1562 'binutils_version%': 0,
1564 # The version of GCC in use, set later in platforms that use GCC and have
1565 # not explicitly chosen to build with clang. Currently, this means all
1566 # platforms except Windows, Mac and iOS.
1567 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1568 # it takes effect here.
1569 ['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', {
1572 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1573 # We directly set the gcc version since we know what we use.
1576 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1577 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1581 'host_gcc_version%': 0,
1584 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1585 'windows_sdk_path%': '<(windows_sdk_default_path)',
1587 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1589 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1590 'directx_sdk_path%': '<(directx_sdk_default_path)',
1592 'directx_sdk_path%': '$(DXSDK_DIR)',
1595 'windows_driver_kit_path%': '$(WDK_DIR)',
1597 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1599 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1602 'nacl_untrusted_build%': 0,
1603 'use_allocator%': 'none',
1605 ['OS=="linux" and target_arch=="mipsel"', {
1606 'sysroot%': '<(sysroot)',
1609 # Use a 64-bit linker to avoid running out of address space. The
1610 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1611 ['host_arch=="ia32" and target_arch=="ia32"', {
1612 # TODO(thestig) This is a horrible way to force the desired
1613 # configuration. Our gyp variable scoping is likely wrong and
1614 # needs to be cleaned up. The GN configuration should be changed
1616 'binutils_version%': 224,
1617 'linux_use_bundled_binutils%': '1',
1618 'linux_use_bundled_gold%': '1',
1619 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1621 # All Chrome builds have breakpad symbols, but only process the
1622 # symbols from official builds.
1623 ['(branding=="Chrome" and buildtype=="Official")', {
1624 'linux_dump_symbols%': 1,
1626 # Omit unwind support in official release builds to save space. We
1627 # can use breakpad for these builds.
1628 'release_unwind_tables%': 0,
1631 }], # os_posix==1 and OS!="mac" and OS!="ios"
1634 'enable_background%': 0,
1635 'icu_use_data_file_flag%': 1,
1636 'enable_web_speech%': 0,
1637 'use_system_libxml%': 1,
1638 'use_system_sqlite%': 1,
1640 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1641 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1642 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1643 'uk', 'vi', 'zh-CN', 'zh-TW',
1646 # iOS SDK and deployment target support. The |ios_sdk| value is left
1647 # blank so that when it is set in the project files it will be the
1648 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1649 # causes Xcode to spit out a warning for every single project file for
1650 # not using the "current" SDK.
1652 'ios_sdk_path%': '',
1653 'ios_deployment_target%': '7.0',
1656 # ios_product_name is set to the name of the .app bundle as it should
1658 ['branding=="Chrome"', {
1659 'ios_product_name%': 'Chrome',
1660 }, { # else: branding!="Chrome"
1661 'ios_product_name%': 'Chromium',
1663 ['branding=="Chrome" and buildtype=="Official"', {
1665 }, { # else: branding!="Chrome" or buildtype!="Official"
1671 # Location of Android NDK.
1674 # Standard libraries can use the relative path to the NDK.
1675 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1676 # Unfortunately, it is required to use the absolute path to the SDK
1677 # because it us passed to ant which uses a different relative path
1679 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1680 # Similarly, gdbserver and the Android toolchain need to use the
1681 # absolute path to the NDK because they are used at different levels
1683 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1684 'android_host_arch%': '<!(uname -m)',
1685 # Android API-level of the SDK used for compilation.
1686 'android_sdk_version%': '22',
1687 'android_sdk_build_tools_version%': '22.0.0',
1688 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1690 # Copy conditionally-set variables out one scope.
1691 'android_ndk_root%': '<(android_ndk_root)',
1692 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1693 'android_sdk_root%': '<(android_sdk_root)',
1694 'android_sdk_version%': '<(android_sdk_version)',
1695 'android_libcpp_root': '<(android_ndk_root)/sources/cxx-stl/llvm-libc++',
1696 'host_os%': '<(host_os)',
1698 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1699 # Android SDK build tools (e.g. dx, aapt, aidl)
1700 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1702 # Android API level 14 is ICS (Android 4.0) which is the minimum
1703 # platform requirement for Chrome on Android, we use it for native
1706 ['target_arch == "ia32"', {
1707 'android_app_abi%': 'x86',
1708 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
1709 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1710 'android_ndk_lib_dir%': 'usr/lib',
1711 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1713 ['target_arch == "x64"', {
1714 'android_app_abi%': 'x86_64',
1715 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1716 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1717 'android_ndk_lib_dir%': 'usr/lib64',
1718 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1720 ['target_arch=="arm"', {
1723 'android_app_abi%': 'armeabi',
1725 'android_app_abi%': 'armeabi-v7a',
1728 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
1729 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1730 'android_ndk_lib_dir%': 'usr/lib',
1731 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1733 ['target_arch == "arm64"', {
1734 'android_app_abi%': 'arm64-v8a',
1735 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1736 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1737 'android_ndk_lib_dir%': 'usr/lib',
1738 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1740 ['target_arch == "mipsel"', {
1741 'android_app_abi%': 'mips',
1742 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
1743 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1744 'android_ndk_lib_dir%': 'usr/lib',
1745 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1747 ['target_arch == "mips64el"', {
1748 'android_app_abi%': 'mips64',
1749 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1750 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1751 'android_ndk_lib_dir%': 'usr/lib64',
1752 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1756 # Copy conditionally-set variables out one scope.
1757 'android_app_abi%': '<(android_app_abi)',
1758 'android_gdbserver%': '<(android_gdbserver)',
1759 'android_ndk_root%': '<(android_ndk_root)',
1760 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1761 'android_sdk_root%': '<(android_sdk_root)',
1762 'android_sdk_version%': '<(android_sdk_version)',
1763 'android_toolchain%': '<(android_toolchain)',
1765 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1766 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1767 'android_sdk_tools%': '<(android_sdk_tools)',
1768 'android_sdk%': '<(android_sdk)',
1769 'android_sdk_jar%': '<(android_sdk)/android.jar',
1771 'android_libcpp_root': '<(android_libcpp_root)',
1772 'android_libcpp_include': '<(android_libcpp_root)/libcxx/include',
1773 'android_libcpp_libs_dir': '<(android_libcpp_root)/libs/<(android_app_abi)',
1774 'host_os%': '<(host_os)',
1776 # Location of the "objcopy" binary, used by both gyp and scripts.
1777 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1779 # Location of the "strip" binary, used by both gyp and scripts.
1780 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1782 # Location of the "readelf" binary.
1783 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1785 # Determines whether we should optimize JNI generation at the cost of
1786 # breaking assumptions in the build system that when inputs have changed
1787 # the outputs should always change as well. This is meant purely for
1788 # developer builds, to avoid spurious re-linking of native files.
1789 'optimize_jni_generation%': '<(optimize_jni_generation)',
1791 # Always uses openssl.
1793 'use_openssl_certs%': 1,
1795 'proprietary_codecs%': '<(proprietary_codecs)',
1796 'safe_browsing%': 2,
1797 'enable_web_speech%': 0,
1799 'build_ffmpegsumo%': 0,
1800 'use_allocator%': 'none',
1802 # Disable Native Client.
1805 # Android does not support background apps.
1806 'enable_background%': 0,
1808 # Sessions are store separately in the Java side.
1809 'enable_session_service%': 0,
1813 'gtest_target_type%': 'shared_library',
1815 # Uses system APIs for decoding audio and video.
1816 'use_libffmpeg%': '0',
1819 'use_system_fontconfig%': 0,
1821 'use_system_fontconfig%': 1,
1824 'enable_mpeg2ts_stream_parser%': 1,
1825 'ffmpeg_branding%': 'ChromeOS',
1826 'ozone_platform_ozonex%': 1,
1827 'use_playready%': 0,
1829 ['target_arch=="arm"', {
1831 'arm_tune%': 'cortex-a9',
1837 ['chromecast==1 and OS!="android"', {
1838 'ozone_platform_cast%': 1
1840 ['OS=="linux" and target_arch!="mipsel"', {
1845 # All Chrome builds have breakpad symbols, but only process the
1846 # symbols from official builds.
1847 ['(branding=="Chrome" and buildtype=="Official")', {
1848 'mac_strip_release%': 1,
1852 ['OS=="mac" or OS=="ios"', {
1856 # Mac OS X SDK and deployment target support. The SDK identifies
1857 # the version of the system headers that will be used, and
1858 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1859 # macro. "Maximum allowed" refers to the operating system version
1860 # whose APIs are available in the headers. The deployment target
1861 # identifies the minimum system version that the built products are
1862 # expected to function on. It corresponds to the
1863 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1864 # macros are available, #include <AvailabilityMacros.h>. Additional
1865 # documentation on these macros is available at
1866 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1867 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1868 # deployment target to 10.6. Other projects, such as O3D, may
1869 # override these defaults.
1871 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1872 # about that is at least the specified version. In official builds,
1873 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1874 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1875 # path to the SDK; when set to a non-empty string, SDK detection
1876 # based on mac_sdk_min will be bypassed entirely.
1879 'mac_sdk_min%': '10.8',
1880 }, { # else OS!="ios"
1881 'mac_sdk_min%': '10.6',
1884 'mac_sdk_path%': '',
1886 'mac_deployment_target%': '10.6',
1889 'mac_sdk_min': '<(mac_sdk_min)',
1890 'mac_sdk_path': '<(mac_sdk_path)',
1891 'mac_deployment_target': '<(mac_deployment_target)',
1893 # Compile in Breakpad support by default so that it can be
1894 # tested, even if it is not enabled by default at runtime.
1895 'mac_breakpad_compiled_in%': 1,
1897 # mac_product_name is set to the name of the .app bundle as it should
1898 # appear on disk. This duplicates data from
1899 # chrome/app/theme/chromium/BRANDING and
1900 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1901 # these names into the build system.
1902 ['branding=="Chrome"', {
1903 'mac_product_name%': 'Google Chrome',
1904 }, { # else: branding!="Chrome"
1905 'mac_product_name%': 'Chromium',
1907 # Official mac builds require a specific OS X SDK, but iOS and
1908 # non-official mac builds do not.
1909 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1910 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1912 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1914 ['branding=="Chrome" and buildtype=="Official"', {
1915 # Enable uploading crash dumps.
1916 'mac_breakpad_uploads%': 1,
1917 # Enable dumping symbols at build time for use by Mac Breakpad.
1919 # Enable Keystone auto-update support.
1921 }, { # else: branding!="Chrome" or buildtype!="Official"
1922 'mac_breakpad_uploads%': 0,
1927 }], # OS=="mac" or OS=="ios"
1930 # This is the architecture convention used in WinSDK paths.
1931 ['target_arch=="ia32"', {
1932 'winsdk_arch%': 'x86',
1934 'winsdk_arch%': '<(target_arch)',
1936 ['component=="shared_library" or MSVS_VERSION == "2015"', {
1937 # TODO(scottmg): The allocator shimming doesn't work on the 2015 CRT
1938 # and we are hoping to be able to remove it if an additional feature
1939 # lands in the 2015 CRT API. For now, don't shim and revisit once
1940 # VS2015 is RTM: http://crbug.com/481611.
1941 'win_use_allocator_shim%': 0,
1943 ['component=="static_library"', {
1944 # Turn on multiple dll by default on Windows when in static_library.
1945 'chrome_multiple_dll%': 1,
1947 ['asan==1 or syzyasan==1', {
1948 'win_use_allocator_shim%': 0,
1953 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1954 # Only enabled by default for ninja because it's buggy in VS.
1955 # Not enabled for component=static_library because some targets
1956 # are too large and the toolchain fails due to the size of the
1958 'incremental_chrome_dll%': 1,
1960 # Don't do incremental linking for large modules on 32-bit or when
1961 # component=static_library as the toolchain fails due to the size of
1963 ['MSVS_OS_BITS==32 or component=="static_library"', {
1964 'msvs_large_module_debug_link_mode%': '1', # No
1966 'msvs_large_module_debug_link_mode%': '2', # Yes
1969 'nacl_win64_defines': [
1970 # This flag is used to minimize dependencies when building
1971 # Native Client loader for 64-bit Windows.
1974 # Need to include allocator target, but exclude tcmalloc files.
1975 'use_allocator%': 'winheap',
1978 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1984 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1985 'enable_pepper_cdms%': 1,
1987 'enable_pepper_cdms%': 0,
1990 ['OS=="android" or chromecast==1', {
1991 'enable_browser_cdms%': 1,
1993 'enable_browser_cdms%': 0,
1996 # Native Client glibc toolchain is enabled
1997 # by default except on arm, mips and mips64.
1998 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
1999 'disable_glibc%': 1,
2001 'disable_glibc%': 0,
2004 # Set the relative path from this file to the GYP file of the JPEG
2005 # library used by Chromium.
2006 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2007 # Configuration for using the system libjeg is here.
2008 'libjpeg_gyp_path': '<(libjpeg_ijg_gyp_path)',
2010 'libjpeg_gyp_path': '<(libjpeg_turbo_gyp_path)',
2013 # Options controlling the use of GConf (the classic GNOME configuration
2014 # system) and GIO, which contains GSettings (the new GNOME config system).
2015 ['chromeos==1 or embedded==1', {
2023 # Set up -D and -E flags passed into grit.
2024 ['branding=="Chrome"', {
2025 # TODO(mmoss) The .grd files look for _google_chrome, but for
2026 # consistency they should look for google_chrome_build like C++.
2027 'grit_defines': ['-D', '_google_chrome',
2028 '-E', 'CHROMIUM_BUILD=google_chrome'],
2030 'grit_defines': ['-D', '_chromium',
2031 '-E', 'CHROMIUM_BUILD=chromium'],
2034 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2036 ['desktop_linux==1', {
2037 'grit_defines': ['-D', 'desktop_linux'],
2039 ['toolkit_views==1', {
2040 'grit_defines': ['-D', 'toolkit_views'],
2043 'grit_defines': ['-D', 'use_aura'],
2046 'grit_defines': ['-D', 'use_ash'],
2048 ['use_nss_certs==1', {
2049 'grit_defines': ['-D', 'use_nss_certs'],
2052 'grit_defines': ['-D', 'use_ozone'],
2054 ['image_loader_extension==1', {
2055 'grit_defines': ['-D', 'image_loader_extension'],
2058 'grit_defines': ['-D', 'remoting'],
2060 ['use_titlecase_in_grd==1', {
2061 'grit_defines': ['-D', 'use_titlecase'],
2063 ['use_third_party_translations==1', {
2064 'grit_defines': ['-D', 'use_third_party_translations'],
2066 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2067 'ka', 'ku', 'kw', 'ms', 'ug'
2073 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2074 '--no-output-all-resource-defines',
2077 ['OS=="mac" or OS=="ios"', {
2078 'grit_defines': ['-D', 'scale_factors=2x'],
2082 'enable_coverage%': 0,
2086 '--no-output-all-resource-defines',
2088 # iOS uses a whitelist to filter resources.
2089 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2091 # Enable host builds when generating with ninja-ios.
2093 ['"<(GENERATOR)"=="ninja"', {
2097 # Use the version of clang shipped with Xcode when building official
2098 # version of Chrome for iOS.
2100 # TODO(eugenebut): Remove enable_coverage check once
2101 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2102 # http://crbug.com/450379
2103 ['buildtype=="Official" or enable_coverage', {
2108 ['enable_extensions==1', {
2109 'grit_defines': ['-D', 'enable_extensions'],
2111 ['enable_plugins!=0', {
2112 'grit_defines': ['-D', 'enable_plugins'],
2114 ['enable_basic_printing==1 or enable_print_preview==1', {
2115 'grit_defines': ['-D', 'enable_printing'],
2117 ['enable_print_preview==1', {
2118 'grit_defines': ['-D', 'enable_print_preview'],
2120 ['enable_themes==1', {
2121 'grit_defines': ['-D', 'enable_themes'],
2123 ['enable_app_list==1', {
2124 'grit_defines': ['-D', 'enable_app_list'],
2126 ['enable_settings_app==1', {
2127 'grit_defines': ['-D', 'enable_settings_app'],
2129 ['enable_google_now==1', {
2130 'grit_defines': ['-D', 'enable_google_now'],
2132 ['use_concatenated_impulse_responses==1', {
2133 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2135 ['enable_media_router==1', {
2136 'grit_defines': ['-D', 'enable_media_router'],
2138 ['enable_webrtc==1', {
2139 'grit_defines': ['-D', 'enable_webrtc'],
2141 ['enable_hangout_services_extension==1', {
2142 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2144 ['enable_task_manager==1', {
2145 'grit_defines': ['-D', 'enable_task_manager'],
2147 ['notifications==1', {
2148 'grit_defines': ['-D', 'enable_notifications'],
2150 ['enable_wifi_bootstrapping==1', {
2151 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2153 ['mac_views_browser==1', {
2154 'grit_defines': ['-D', 'mac_views_browser'],
2156 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2157 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2159 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2160 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2162 ['enable_mdns==1 or OS=="mac"', {
2163 'grit_defines': ['-D', 'enable_service_discovery'],
2164 'enable_service_discovery%': 1
2166 ['clang_use_chrome_plugins==1', {
2172 ['OS=="mac" or OS=="ios"', {
2173 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2174 }, { # OS != "mac" or OS != "ios"
2175 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
2179 'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ',
2180 'clang_plugin_args%': '',
2182 # On Windows, the plugin is built directly into clang, so there's
2183 # no need to load it dynamically.
2184 'clang_dynlib_flags%': '',
2186 # Don't error on plugin warnings on Windows until pre-existing warnings
2187 # are cleaned up. https://crbug.com/467287
2188 'clang_plugin_args%': '-Xclang -plugin-arg-find-bad-constructs -Xclang warn-only',
2192 # If you change these, also change build/config/clang/BUILD.gn.
2193 'clang_chrome_plugins_flags%':
2194 '<(clang_dynlib_flags)'
2195 '-Xclang -add-plugin -Xclang find-bad-constructs '
2196 '<(clang_plugin_args)',
2198 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2200 'use_allocator%': 'none',
2201 'use_sanitizer_options%': 1,
2202 # Disable ICF in the linker to avoid debug info loss.
2203 'gold_icf_level%': 'none',
2205 ['asan==1 and OS=="linux" and chromeos==0', {
2206 'use_custom_libcxx%': 1,
2214 ['asan==1 and OS=="mac"', {
2215 'mac_strip_release': 1,
2218 'use_custom_libcxx%': 1,
2221 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2222 # libstdc++. This is required to avoid false positive reports whenever
2223 # the C++ standard library is used.
2224 'use_custom_libcxx%': 1,
2225 # Running the V8-generated code on an ARM simulator is a powerful hack
2226 # that allows the tool to see the memory accesses from JITted code.
2227 # Without this flag, JS code causes false positive reports from MSan.
2228 'v8_target_arch': 'arm64',
2231 ['OS=="linux" and clang_type_profiler==1', {
2233 'clang_use_chrome_plugins%': 0,
2235 ['host_arch=="x64"', {
2236 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2238 ['host_arch=="ia32"', {
2239 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2240 # Clang in this directory at your own risk if needed for some
2241 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2242 # usage). Any failure by this compiler should not close the tree.
2243 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2248 ['OS=="win" and target_arch=="x64"', {
2249 # TODO(thakis): Enable on x64 once all warnings are fixed.
2250 # http://crbug.com/486571
2251 'blink_gc_plugin%': 0,
2254 # On valgrind bots, override the optimizer settings so we don't inline too
2255 # much and make the stacks harder to figure out.
2257 # TODO(rnk): Kill off variables that no one else uses and just implement
2258 # them under a build_for_tool== condition.
2259 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2261 'mac_debug_optimization': '1',
2262 'mac_release_optimization': '1',
2263 'release_optimize': '1',
2264 'no_gc_sections': 1,
2265 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2266 '-fno-builtin -fno-optimize-sibling-calls',
2267 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2268 '-fno-builtin -fno-optimize-sibling-calls',
2270 # MSVS flags for TSan on Pin and Windows.
2271 'win_debug_RuntimeChecks': '0',
2272 'win_debug_disable_iterator_debugging': '1',
2273 'win_debug_Optimization': '1',
2274 'win_debug_InlineFunctionExpansion': '0',
2275 'win_release_InlineFunctionExpansion': '0',
2276 'win_release_OmitFramePointers': '0',
2278 'use_allocator': 'tcmalloc',
2279 'release_valgrind_build': 1,
2281 'component': 'static_library',
2282 'use_system_zlib': 0,
2285 # Build tweaks for DrMemory.
2286 # TODO(rnk): Combine with tsan config to share the builder.
2287 # http://crbug.com/108155
2288 ['build_for_tool=="drmemory"', {
2289 # These runtime checks force initialization of stack vars which blocks
2290 # DrMemory's uninit detection.
2291 'win_debug_RuntimeChecks': '0',
2292 # Iterator debugging is slow.
2293 'win_debug_disable_iterator_debugging': '1',
2294 # Try to disable optimizations that mess up stacks in a release build.
2295 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2296 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2297 # compiler bug, so we use /Ob1 instead.
2298 'win_release_InlineFunctionExpansion': '1',
2299 'win_release_OmitFramePointers': '0',
2300 # Ditto for debug, to support bumping win_debug_Optimization.
2301 'win_debug_InlineFunctionExpansion': 0,
2302 'win_debug_OmitFramePointers': 0,
2303 # Keep the code under #ifndef NVALGRIND.
2304 'release_valgrind_build': 1,
2307 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2308 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2312 # Set default compiler flags depending on ARM version.
2313 ['arm_version==6', {
2314 'arm_arch%': 'armv6',
2317 'arm_float_abi%': 'softfp',
2320 ['arm_version==7', {
2321 'arm_arch%': 'armv7-a',
2322 'arm_tune%': 'generic-armv7-a',
2327 'arm_fpu%': 'vfpv3-d16',
2330 # Change the default to hard once the armhf transition is complete.
2331 'arm_float_abi%': 'softfp',
2335 # Set default compiler flags for MIPS floating-point support.
2336 ['target_arch=="mipsel"', {
2337 'mips_float_abi%': 'hard',
2339 ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
2340 'mips_fpu_mode%': 'fp32',
2343 # Enable brlapi by default for chromeos.
2348 ['use_ozone==1 and ozone_auto_platforms==1', {
2349 # Use test as the default platform.
2350 'ozone_platform%': 'test',
2352 # Build all platforms whose deps are in install-build-deps.sh.
2353 # Only these platforms will be compile tested by buildbots.
2354 'ozone_platform_dri%': 1,
2355 'ozone_platform_drm%': 1,
2356 'ozone_platform_test%': 1,
2357 'ozone_platform_egltest%': 1,
2360 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2361 'use_clipboard_aurax11%': 1,
2364 ['OS=="win" and use_goma==1', {
2365 # goma doesn't support pch yet.
2366 'chromium_win_pch': 0,
2367 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2369 ['win_z7==0 and fastbuild==0', {
2375 ['OS=="win" and (clang==1 or asan==1)', {
2376 'chromium_win_pch': 0,
2380 'host_cc': '<(make_clang_dir)/bin/clang',
2381 'host_cxx': '<(make_clang_dir)/bin/clang++',
2383 'host_cc': '<!(which gcc)',
2384 'host_cxx': '<!(which g++)',
2387 # The seccomp-bpf sandbox is only supported on five architectures
2389 # Do not disable seccomp_bpf anywhere without talking to
2390 # security@chromium.org!
2391 ['((OS=="linux" or OS=="android") and '
2392 '(target_arch=="ia32" or target_arch=="x64" or '
2393 'target_arch=="arm" or target_arch=="mipsel" or '
2394 'target_arch=="arm64"))', {
2395 'use_seccomp_bpf%': 1,
2397 'use_seccomp_bpf%': 0,
2400 ['cfi_vptr==1 or cfi_derived_cast==1 or cfi_unrelated_cast==1', {
2405 # The path to the ANGLE library.
2406 'angle_path': '<(DEPTH)/third_party/angle',
2408 # List of default apps to install in new profiles. The first list contains
2409 # the source files as found in svn. The second list, used only for linux,
2410 # contains the destination location for each of the files. When a crx
2411 # is added or removed from the list, the chrome/browser/resources/
2412 # default_apps/external_extensions.json file must also be updated.
2414 # README: GN version of these is in the target //chrome:default_apps
2415 # (there's no global variable like in GYP). Be sure to update that target
2416 # if you change these lists!
2417 'default_apps_list': [
2418 'browser/resources/default_apps/external_extensions.json',
2419 'browser/resources/default_apps/gmail.crx',
2420 'browser/resources/default_apps/search.crx',
2421 'browser/resources/default_apps/youtube.crx',
2422 'browser/resources/default_apps/drive.crx',
2423 'browser/resources/default_apps/docs.crx',
2425 'default_apps_list_linux_dest': [
2426 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2427 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2428 '<(PRODUCT_DIR)/default_apps/search.crx',
2429 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2430 '<(PRODUCT_DIR)/default_apps/drive.crx',
2431 '<(PRODUCT_DIR)/default_apps/docs.crx',
2434 # Whether to allow building of the GPU-related isolates.
2435 'archive_gpu_tests%': 0,
2437 # Whether to allow building of chromoting related isolates.
2438 'archive_chromoting_tests%': 0,
2440 'target_defaults': {
2442 # The condition that operates on chromium_code is in a target_conditions
2443 # section, and will not have access to the default fallback value of
2444 # chromium_code at the top of this file, or to the chromium_code
2445 # variable placed at the root variables scope of .gyp files, because
2446 # those variables are not set at target scope. As a workaround,
2447 # if chromium_code is not set at target scope, define it in target scope
2448 # to contain whatever value it has during early variable expansion.
2449 # That's enough to make it available during target conditional
2451 'chromium_code%': '<(chromium_code)',
2453 'component%': '<(component)',
2455 'chromecast%': '<(chromecast)',
2457 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2458 'win_release_Optimization%': '2', # 2 = /O2
2459 'win_debug_Optimization%': '0', # 0 = /Od
2461 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2462 # Tri-state: blank is default, 1 on, 0 off
2463 'win_release_OmitFramePointers%': '0',
2464 # Tri-state: blank is default, 1 on, 0 off
2465 'win_debug_OmitFramePointers%': '',
2467 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2468 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2470 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2471 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2472 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2474 # VS inserts quite a lot of extra checks to algorithms like
2475 # std::partial_sort in Debug build which make them O(N^2)
2476 # instead of O(N*logN). This is particularly slow under memory
2477 # tools like ThreadSanitizer so we want it to be disablable.
2478 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2479 'win_debug_disable_iterator_debugging%': '0',
2481 # An application manifest fragment to declare compatibility settings for
2482 # 'executable' targets. Ignored in other target type.
2483 'win_exe_compatibility_manifest%':
2484 '<(DEPTH)\\build\\win\\compatibility.manifest',
2486 'release_extra_cflags%': '',
2487 'debug_extra_cflags%': '',
2489 'release_valgrind_build%': '<(release_valgrind_build)',
2491 # the non-qualified versions are widely assumed to be *nix-only
2492 'win_release_extra_cflags%': '',
2493 'win_debug_extra_cflags%': '',
2495 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2496 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2498 # Only used by Windows build for now. Can be used to build into a
2499 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2500 # output files in src/build/VS2010_{Debug,Release}.
2501 'build_dir_prefix%': '',
2503 # Targets are by default not nacl untrusted code.
2504 'nacl_untrusted_build%': 0,
2506 'pnacl_compile_flags': [
2507 # pnacl uses the clang compiler so we need to suppress all the
2508 # same warnings as we do for clang.
2509 # TODO(sbc): Remove these if/when they are removed from the clang
2511 '-Wno-unused-function',
2512 '-Wno-char-subscripts',
2513 '-Wno-c++11-extensions',
2514 '-Wno-unnamed-type-template-args',
2517 # By default, Android targets have their exported JNI symbols stripped,
2518 # so we test the manual JNI registration code paths that are required
2519 # when using the crazy linker. To allow use of native JNI exports (lazily
2520 # resolved by the JVM), targets can enable this variable, which will stop
2521 # the stripping from happening. Only targets which do not need to be
2522 # compatible with the crazy linker are permitted to set this.
2523 'use_native_jni_exports%': 0,
2526 ['OS=="win" and component=="shared_library"', {
2527 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2528 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2529 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2531 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2532 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2533 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2536 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2537 'mac_release_optimization%': 's', # Use -Os unless overridden
2538 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2540 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2541 'mac_release_optimization%': '2', # Use -O2 unless overridden
2542 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2545 'host_os%': '<(host_os)', # See comment above chromium_code.
2548 'clang_warning_flags': [
2551 # Don't die on dtoa code that uses a char as an array index.
2552 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2553 '-Wno-char-subscripts',
2555 # TODO(thakis): This used to be implied by -Wno-unused-function,
2556 # which we no longer use. Check if it makes sense to remove
2557 # this as well. http://crbug.com/316352
2558 '-Wno-unneeded-internal-declaration',
2560 # Warns on switches on enums that cover all enum values but
2561 # also contain a default: branch. Chrome is full of that.
2562 '-Wno-covered-switch-default',
2564 # Warns when a const char[] is converted to bool.
2565 '-Wstring-conversion',
2567 # C++11-related flags:
2569 # This warns on using ints as initializers for floats in
2570 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2571 # which happens in several places in chrome code. Not sure if
2572 # this is worth fixing.
2573 '-Wno-c++11-narrowing',
2575 # Clang considers the `register` keyword as deprecated, but e.g.
2576 # code generated by flex (used in angle) contains that keyword.
2577 # http://crbug.com/255186
2578 '-Wno-deprecated-register',
2580 # TODO(hans): Get this cleaned up.
2581 '-Wno-inconsistent-missing-override',
2584 'includes': [ 'set_clang_warning_flags.gypi', ],
2586 # Don't use deprecated V8 APIs anywhere.
2587 'V8_DEPRECATION_WARNINGS',
2590 '<(SHARED_INTERMEDIATE_DIR)',
2593 ['(OS=="mac" or OS=="ios") and asan==1', {
2595 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2598 ['OS=="win" and asan==1 and component=="shared_library"', {
2600 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2603 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2604 'cflags_cc!': ['-fno-rtti'],
2607 '-gline-tables-only',
2608 '-fintercept-allocation-functions',
2610 'defines': ['TYPE_PROFILING'],
2612 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2615 ['branding=="Chrome"', {
2616 'defines': ['GOOGLE_CHROME_BUILD'],
2617 }, { # else: branding!="Chrome"
2618 'defines': ['CHROMIUM_BUILD'],
2620 ['OS=="mac" and component=="shared_library"', {
2622 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2623 'LD_RUNPATH_SEARCH_PATHS': [
2624 # For unbundled binaries.
2626 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2627 '@loader_path/../../..',
2631 ['clang==1 or host_clang==1', {
2632 # This is here so that all files get recompiled after a clang roll and
2633 # when turning clang on or off.
2634 # (defines are passed via the command line, and build systems rebuild
2635 # things when their commandline changes). Nothing should ever read this
2637 'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
2640 'defines': ['ENABLE_RLZ'],
2642 ['component=="shared_library"', {
2643 'defines': ['COMPONENT_BUILD'],
2645 ['toolkit_views==1', {
2646 'defines': ['TOOLKIT_VIEWS=1'],
2648 ['ui_compositor_image_transport==1', {
2649 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2652 'defines': ['USE_AURA=1'],
2655 'defines': ['USE_ASH=1'],
2658 'defines': ['USE_PANGO=1'],
2661 'defines': ['USE_CAIRO=1'],
2664 'defines': ['USE_CRAS=1'],
2667 'defines': ['USE_OZONE=1'],
2669 ['use_default_render_theme==1', {
2670 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2672 ['use_libjpeg_turbo==1', {
2673 'defines': ['USE_LIBJPEG_TURBO=1'],
2676 'defines': ['USE_X11=1'],
2678 ['use_clipboard_aurax11==1', {
2679 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2681 ['enable_one_click_signin==1', {
2682 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2684 ['enable_pre_sync_backup==1', {
2685 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2687 ['image_loader_extension==1', {
2688 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2691 'defines': ['ENABLE_PROFILING=1'],
2694 'defines': ['ENABLE_REMOTING=1'],
2696 ['enable_webrtc==1', {
2697 'defines': ['ENABLE_WEBRTC=1'],
2699 ['enable_media_router==1', {
2700 'defines': ['ENABLE_MEDIA_ROUTER=1'],
2702 ['proprietary_codecs==1', {
2703 'defines': ['USE_PROPRIETARY_CODECS'],
2705 ['enable_mpeg2ts_stream_parser==1', {
2706 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2710 ['enable_viewport==1', {
2711 'defines': ['ENABLE_VIEWPORT'],
2713 ['enable_pepper_cdms==1', {
2714 'defines': ['ENABLE_PEPPER_CDMS'],
2716 ['enable_browser_cdms==1', {
2717 'defines': ['ENABLE_BROWSER_CDMS'],
2719 ['configuration_policy==1', {
2720 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2722 ['notifications==1', {
2723 'defines': ['ENABLE_NOTIFICATIONS'],
2725 ['enable_hidpi==1', {
2726 'defines': ['ENABLE_HIDPI=1'],
2728 ['native_memory_pressure_signals==1', {
2729 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2732 'defines': ['USE_UDEV'],
2736 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2739 ['OS=="win" and fastbuild==2', {
2740 # Completely disable debug information.
2743 'GenerateDebugInformation': 'false',
2745 'VCCLCompilerTool': {
2746 'DebugInformationFormat': '0',
2750 ['OS=="win" and fastbuild==1', {
2753 # This tells the linker to generate .pdbs, so that
2754 # we can get meaningful stack traces.
2755 'GenerateDebugInformation': 'true',
2757 'VCCLCompilerTool': {
2758 # No debug info to be generated by compiler.
2759 'DebugInformationFormat': '0',
2763 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2764 'variables': { 'debug_extra_cflags': '-g0', },
2766 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2767 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2769 'variables': { 'debug_extra_cflags': '-g0', },
2771 # Android builds symbols on release by default, disable them.
2772 ['OS=="android" and fastbuild==2', {
2773 'variables': { 'release_extra_cflags': '-g0', },
2775 ['OS=="android" and fastbuild==1', {
2776 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2778 'variables': { 'release_extra_cflags': '-g0', },
2782 ['dont_embed_build_metadata==1', {
2784 'DONT_EMBED_BUILD_METADATA',
2786 }], # dont_embed_build_metadata==1
2787 ['dcheck_always_on!=0', {
2788 'defines': ['DCHECK_ALWAYS_ON=1'],
2789 }], # dcheck_always_on!=0
2790 ['tracing_like_official_build!=0', {
2791 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2792 }], # tracing_like_official_build!=0
2794 'defines': ['NO_TCMALLOC'],
2796 ['win_use_allocator_shim==1', {
2797 'defines': ['ALLOCATOR_SHIM'],
2803 'ADDRESS_SANITIZER',
2804 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2805 'MEMORY_SANITIZER_INITIAL_SIZE',
2809 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2817 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2818 'MEMORY_SANITIZER_INITIAL_SIZE',
2826 '<(DEPTH)/third_party/kasko/include',
2832 '_CRT_SECURE_NO_DEPRECATE',
2833 '_SCL_SECURE_NO_DEPRECATE',
2834 # This define is required to pull in the new Win8 interfaces from
2835 # system headers like ShObjIdl.h.
2836 'NTDDI_VERSION=0x06030000',
2837 # This is required for ATL to use XP-safe versions of its functions.
2838 '_USING_V110_SDK71_',
2841 '<(DEPTH)/third_party/wtl/include',
2846 # Generates debug info when win_z7=1
2847 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2849 'GenerateDebugInformation': 'true',
2851 'VCCLCompilerTool': {
2852 'DebugInformationFormat': '1',
2858 # This is prohibited when running /analyze.
2859 '_USING_V110_SDK71_',
2862 'VCCLCompilerTool': {
2863 # Set WarnAsError to false to disable this setting for most
2864 # projects so that compilation continues.
2865 'WarnAsError': 'false',
2866 # When win_analyze is specified add the /analyze switch.
2867 # Also add /WX- to force-disable WarnAsError for projects that
2868 # override WarnAsError.
2869 # Also, disable various noisy warnings that have low value.
2870 'AdditionalOptions': [
2873 '/wd6011', # Dereferencing NULL pointer
2874 '/wd6312', # Possible infinite loop: use of the constant
2875 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2876 '/wd6326', # Potential comparison of constant with constant
2877 '/wd28159', # Consider using 'GetTickCount64'
2878 '/wd28204', # Inconsistent SAL annotations
2879 '/wd28251', # Inconsistent SAL annotations
2880 '/wd28252', # Inconsistent SAL annotations
2881 '/wd28253', # Inconsistent SAL annotations
2882 '/wd28196', # The precondition is not satisfied
2883 '/wd28301', # Inconsistent SAL annotations
2884 '/wd6340', # Sign mismatch in function parameter
2885 '/wd28182', # Dereferencing NULL pointer
2886 # C6285 is ~16% of raw warnings and has low value
2887 '/wd6285', # non-zero constant || non-zero constant
2888 # C6334 is ~80% of raw warnings and has low value
2889 '/wd6334', # sizeof applied to an expression with an operator
2901 ['use_playready==1', {
2903 'PLAYREADY_CDM_AVAILABLE',
2908 ['enable_task_manager==1', {
2910 'ENABLE_TASK_MANAGER=1',
2913 ['enable_extensions==1', {
2915 'ENABLE_EXTENSIONS=1',
2918 ['OS=="win" and branding=="Chrome"', {
2919 'defines': ['ENABLE_SWIFTSHADER'],
2921 ['enable_dart==1', {
2922 'defines': ['WEBKIT_USING_DART=1'],
2924 ['enable_plugin_installation==1', {
2925 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2927 ['enable_plugins==1', {
2928 'defines': ['ENABLE_PLUGINS=1'],
2930 ['enable_session_service==1', {
2931 'defines': ['ENABLE_SESSION_SERVICE=1'],
2933 ['enable_themes==1', {
2934 'defines': ['ENABLE_THEMES=1'],
2936 ['enable_autofill_dialog==1', {
2937 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2939 ['enable_prod_wallet_service==1', {
2940 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2942 ['enable_background==1', {
2943 'defines': ['ENABLE_BACKGROUND=1'],
2945 ['enable_google_now==1', {
2946 'defines': ['ENABLE_GOOGLE_NOW=1'],
2948 ['cld_version!=0', {
2949 'defines': ['CLD_VERSION=<(cld_version)'],
2951 ['enable_basic_printing==1 or enable_print_preview==1', {
2952 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2953 'defines': ['ENABLE_PRINTING=1'],
2955 ['enable_basic_printing==1', {
2956 # Enable basic printing support and UI.
2957 'defines': ['ENABLE_BASIC_PRINTING=1'],
2959 ['enable_print_preview==1', {
2960 # Enable printing with print preview.
2961 # Can be defined without ENABLE_BASIC_PRINTING.
2962 'defines': ['ENABLE_PRINT_PREVIEW=1'],
2964 ['enable_spellcheck==1', {
2965 'defines': ['ENABLE_SPELLCHECK=1'],
2967 ['enable_captive_portal_detection==1', {
2968 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2970 ['enable_app_list==1', {
2971 'defines': ['ENABLE_APP_LIST=1'],
2973 ['enable_settings_app==1', {
2974 'defines': ['ENABLE_SETTINGS_APP=1'],
2976 ['disable_file_support==1', {
2977 'defines': ['DISABLE_FILE_SUPPORT=1'],
2979 ['disable_ftp_support==1', {
2980 'defines': ['DISABLE_FTP_SUPPORT=1'],
2982 ['enable_supervised_users==1', {
2983 'defines': ['ENABLE_SUPERVISED_USERS=1'],
2985 ['spdy_proxy_auth_property != ""', {
2986 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2988 ['spdy_proxy_auth_value != ""', {
2989 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2991 ['enable_mdns==1', {
2992 'defines': ['ENABLE_MDNS=1'],
2994 ['enable_service_discovery==1', {
2995 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2997 ['enable_wifi_bootstrapping==1', {
2998 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
3000 ['enable_hangout_services_extension==1', {
3001 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
3003 ['enable_ipc_fuzzer==1', {
3004 'defines': ['ENABLE_IPC_FUZZER=1'],
3007 'defines': ['VIDEO_HOLE=1'],
3009 ['v8_use_external_startup_data==1', {
3010 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
3013 # SAFE_BROWSING_SERVICE - browser manages a safe-browsing service.
3014 # SAFE_BROWSING_DB_LOCAL - service manages a local database.
3015 # SAFE_BROWSING_DB_REMOTE - service talks via API to a database
3016 # SAFE_BROWSING_CSD - enable client-side phishing detection.
3017 ['safe_browsing==1', {
3018 # TODO(nparker): Remove existing uses of FULL_SAFE_BROWSING
3020 'FULL_SAFE_BROWSING',
3021 'SAFE_BROWSING_CSD',
3022 'SAFE_BROWSING_DB_LOCAL',
3023 'SAFE_BROWSING_SERVICE',
3026 ['safe_browsing==2', {
3028 # TODO(nparker): Remove existing uses of MOBILE_SAFE_BROWSING
3029 'MOBILE_SAFE_BROWSING',
3030 'SAFE_BROWSING_SERVICE',
3033 ], # conditions for 'target_defaults'
3034 'target_conditions': [
3035 ['<(use_libpci)==1', {
3036 'defines': ['USE_LIBPCI=1'],
3038 ['<(use_openssl)==1', {
3039 'defines': ['USE_OPENSSL=1'],
3041 ['<(use_openssl_certs)==1', {
3042 'defines': ['USE_OPENSSL_CERTS=1'],
3044 ['>(nacl_untrusted_build)==1', {
3047 'USE_OPENSSL_CERTS=1',
3050 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3051 'defines': ['USE_GLIB=1'],
3053 ['<(use_nss_certs)==1 and >(nacl_untrusted_build)==0', {
3054 'defines': ['USE_NSS_CERTS=1'],
3056 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3057 'defines': ['OS_CHROMEOS=1'],
3059 ['enable_wexit_time_destructors==1 and OS!="win"', {
3060 # TODO: Enable on Windows too, http://crbug.com/404525
3061 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3063 ['chromium_code==0', {
3065 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3066 # We don't want to get warnings from third-party code,
3067 # so remove any existing warning-enabling flags like -Wall.
3073 # Don't warn about hash_map in third-party code.
3077 # Don't warn about printf format problems.
3078 # This is off by default in gcc but on in Ubuntu's gcc(!).
3082 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3086 # TODO: Fix all warnings on chromeos too.
3087 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3092 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3094 # Don't warn about ignoring the return value from e.g. close().
3095 # This is off by default in some gccs but on by default in others.
3096 # BSD systems do not support this option, since they are usually
3097 # using gcc 4.2.1, which does not have this flag yet.
3098 '-Wno-unused-result',
3103 '_CRT_SECURE_NO_DEPRECATE',
3104 '_CRT_NONSTDC_NO_WARNINGS',
3105 '_CRT_NONSTDC_NO_DEPRECATE',
3106 '_SCL_SECURE_NO_DEPRECATE',
3108 'msvs_disabled_warnings': [
3109 # These are variable shadowing warnings that are new in VS2015.
3110 # We should probably work through these at some point for
3111 # non-chromium code, but for now, focus on chromium_code==1 code.
3112 4456, 4457, 4458, 4459,
3117 'VCCLCompilerTool': {
3118 'WarningLevel': '3',
3119 'WarnAsError': 'true',
3120 'Detect64BitPortabilityProblems': 'false',
3124 ['buildtype=="Official"', {
3126 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3129 [ 'component=="shared_library"', {
3130 # TODO(darin): Unfortunately, some third_party code depends on base.
3131 'msvs_disabled_warnings': [
3132 4251, # class 'std::xx' needs to have dll-interface.
3138 [ 'OS=="mac" or OS=="ios"', {
3140 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3143 ['buildtype=="Official"', {
3145 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3152 # TODO(ios): Fix remaining warnings in third-party code, then
3153 # remove this; the Mac cleanup didn't get everything that's
3154 # flagged in an iOS build.
3155 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3156 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3157 # Several internal ios directories generate numerous warnings for
3158 # -Wobjc-missing-property-synthesis.
3159 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3165 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3166 'filename_rules.gypi',
3168 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3169 # C99 macros on Mac and Linux.
3171 '__STDC_CONSTANT_MACROS',
3172 '__STDC_FORMAT_MACROS',
3176 # turn on warnings for signed/unsigned mismatch on chromium code.
3178 'VCCLCompilerTool': {
3179 'AdditionalOptions': ['/we4389'],
3183 ['OS=="win" and component=="shared_library"', {
3184 'msvs_disabled_warnings': [
3185 4251, # class 'std::xx' needs to have dll-interface.
3190 ], # target_conditions for 'target_defaults'
3191 'default_configuration': 'Debug',
3193 # VCLinkerTool LinkIncremental values below:
3195 # 1 == /INCREMENTAL:NO
3197 # Debug links incremental, Release does not.
3199 # Abstract base configurations to cover common attributes.
3203 'msvs_configuration_attributes': {
3204 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3205 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3206 'CharacterSet': '1',
3208 # Add the default import libs.
3211 'AdditionalDependencies': [
3228 'AdditionalOptions': [
3229 # Suggested by Microsoft Devrel to avoid
3230 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3231 # which started happening more regularly after VS2013 Update 4.
3232 # Needs to be a bit lower for VS2015, or else errors out.
3233 '/maxilksize:0x7ff00000',
3242 'MinimumRequiredVersion': '5.01', # XP.
3243 'TargetMachine': '1',
3245 'VCLibrarianTool': {
3246 'TargetMachine': '1',
3249 'msvs_configuration_platform': 'Win32',
3253 'msvs_configuration_platform': 'x64',
3256 # Make sure to understand http://crbug.com/361720 if you want to
3258 'MinimumRequiredVersion': '5.02', # Server 2003.
3259 'TargetMachine': '17', # x86 - 64
3260 'AdditionalLibraryDirectories!':
3261 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3262 'AdditionalLibraryDirectories':
3263 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3264 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3265 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3267 'VCLibrarianTool': {
3268 'AdditionalLibraryDirectories!':
3269 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3270 'AdditionalLibraryDirectories':
3271 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3272 'TargetMachine': '17', # x64
3279 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3280 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3283 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3285 '<@(debug_extra_cflags)',
3289 'VCCLCompilerTool': {
3290 'Optimization': '<(win_debug_Optimization)',
3291 'PreprocessorDefinitions': ['_DEBUG'],
3292 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3293 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3295 # According to MSVS, InlineFunctionExpansion=0 means
3296 # "default inlining", not "/Ob0".
3297 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3298 ['win_debug_InlineFunctionExpansion==0', {
3299 'AdditionalOptions': ['/Ob0'],
3301 ['win_debug_InlineFunctionExpansion!=""', {
3302 'InlineFunctionExpansion':
3303 '<(win_debug_InlineFunctionExpansion)',
3305 ['win_debug_disable_iterator_debugging==1', {
3306 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3309 # if win_debug_OmitFramePointers is blank, leave as default
3310 ['win_debug_OmitFramePointers==1', {
3311 'OmitFramePointers': 'true',
3313 ['win_debug_OmitFramePointers==0', {
3314 'OmitFramePointers': 'false',
3315 # The above is not sufficient (http://crbug.com/106711): it
3316 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3317 # perform FPO regardless, so we must explicitly disable.
3318 # We still want the false setting above to avoid having
3319 # "/Oy /Oy-" and warnings about overriding.
3320 'AdditionalOptions': ['/Oy-'],
3323 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3326 'LinkIncremental': '<(msvs_debug_link_incremental)',
3327 # ASLR makes debugging with windbg difficult because Chrome.exe and
3328 # Chrome.dll share the same base name. As result, windbg will
3329 # name the Chrome.dll module like chrome_<base address>, where
3330 # <base address> typically changes with each launch. This in turn
3331 # means that breakpoints in Chrome.dll don't stick from one launch
3332 # to the next. For this reason, we turn ASLR off in debug builds.
3333 # Note that this is a three-way bool, where 0 means to pick up
3334 # the default setting, 1 is off and 2 is on.
3335 'RandomizedBaseAddress': 1,
3337 'VCResourceCompilerTool': {
3338 'PreprocessorDefinitions': ['_DEBUG'],
3342 ['OS=="linux" or OS=="android"', {
3343 'target_conditions': [
3344 ['_toolset=="target"', {
3346 '<@(debug_extra_cflags)',
3351 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3352 # Enable libstdc++ debugging facilities to help catch problems
3353 # early, see http://crbug.com/65151 .
3354 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3355 'defines': ['_GLIBCXX_DEBUG=1',],
3357 ['release_valgrind_build==0', {
3360 '-fstack-protector-all', # Implies -fstack-protector
3366 # Allow comparing the address of references and 'this' against 0
3367 # in debug builds. Technically, these can never be null in
3368 # well-defined C/C++ and Clang can optimize such checks away in
3369 # release builds, but they may be used in asserts in debug builds.
3370 '-Wno-undefined-bool-conversion',
3371 '-Wno-tautological-undefined-compare',
3375 '-Wno-undefined-bool-conversion',
3376 '-Wno-tautological-undefined-compare',
3380 'VCCLCompilerTool': {
3381 'AdditionalOptions': [
3382 '-Wno-undefined-bool-conversion',
3383 '-Wno-tautological-undefined-compare',
3396 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3397 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3398 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3401 'VCCLCompilerTool': {
3402 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3404 # In official builds, each target will self-select
3405 # an optimization level.
3406 ['buildtype!="Official"', {
3407 'Optimization': '<(win_release_Optimization)',
3410 # According to MSVS, InlineFunctionExpansion=0 means
3411 # "default inlining", not "/Ob0".
3412 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3413 ['win_release_InlineFunctionExpansion==0', {
3414 'AdditionalOptions': ['/Ob0'],
3416 ['win_release_InlineFunctionExpansion!=""', {
3417 'InlineFunctionExpansion':
3418 '<(win_release_InlineFunctionExpansion)',
3421 # if win_release_OmitFramePointers is blank, leave as default
3422 ['win_release_OmitFramePointers==1', {
3423 'OmitFramePointers': 'true',
3425 ['win_release_OmitFramePointers==0', {
3426 'OmitFramePointers': 'false',
3427 # The above is not sufficient (http://crbug.com/106711): it
3428 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3429 # perform FPO regardless, so we must explicitly disable.
3430 # We still want the false setting above to avoid having
3431 # "/Oy /Oy-" and warnings about overriding.
3432 'AdditionalOptions': ['/Oy-'],
3435 # Put data in separate COMDATs. This allows the linker
3436 # to put bit-identical constants at the same address even if
3437 # they're unrelated constants, which saves binary size.
3438 # This optimization can't be used when ASan is enabled because
3439 # it is not compatible with the ASan ODR checker.
3440 'AdditionalOptions': ['/Gw'],
3443 'AdditionalOptions': [
3444 '/d2Zi+', # Improve debugging of Release builds.
3445 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3446 '<@(win_release_extra_cflags)',
3450 # LinkIncremental is a tri-state boolean, where 0 means default
3451 # (i.e., inherit from parent solution), 1 means false, and
3453 'LinkIncremental': '1',
3454 # This corresponds to the /PROFILE flag which ensures the PDB
3455 # file contains FIXUP information (growing the PDB file by about
3456 # 5%) but does not otherwise alter the output binary. This
3457 # information is used by the Syzygy optimization tool when
3458 # decomposing the release image.
3463 ['msvs_use_common_release', {
3464 'includes': ['release.gypi'],
3466 ['release_valgrind_build==0 and tsan==0', {
3469 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3473 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3474 'MEMORY_SANITIZER_INITIAL_SIZE',
3475 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3476 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3480 'defines': ['NO_TCMALLOC'],
3482 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3483 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3484 # It seems to work fine with Ubuntu 12 headers though, so use it
3485 # in official builds.
3486 ['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")', {
3487 'target_conditions': [
3488 ['chromium_code==1', {
3489 # Non-chromium code is not guaranteed to compile cleanly
3490 # with _FORTIFY_SOURCE. Also, fortified build may fail
3491 # when optimizations are disabled, so only do that for Release
3494 '_FORTIFY_SOURCE=2',
3499 ['OS=="linux" or OS=="android"', {
3500 'target_conditions': [
3501 ['_toolset=="target"', {
3503 '<@(release_extra_cflags)',
3506 ['enable_resource_whitelist_generation==1', {
3508 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3517 'NS_BLOCK_ASSERTIONS=1',
3523 # Concrete configurations
3526 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3529 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3534 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3535 'target_conditions': [
3536 [ '_type=="executable"', {
3537 # To get a real .dSYM bundle produced by dsymutil, set the
3538 # debug information format to dwarf-with-dsym. Since
3539 # strip_from_xcode will not be used, set Xcode to do the
3540 # stripping as well.
3542 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3543 'DEPLOYMENT_POSTPROCESSING': 'YES',
3544 'STRIP_INSTALLED_PRODUCT': 'YES',
3551 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3553 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3556 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3564 'target_defaults': {
3569 # TODO(glider): enable the default options on other systems.
3571 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3573 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3579 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3580 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3581 'target_defaults': {
3583 '-Wl,--fatal-warnings',
3587 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3588 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
3589 'target_defaults': {
3595 ['os_posix==1 and chromeos==0', {
3596 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3597 # and we want to avoid overriding this, so stack-protector is only
3598 # enabled when not building on Chrome OS.
3599 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3601 'target_defaults': {
3603 '-fstack-protector',
3604 '--param=ssp-buffer-size=4',
3608 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3609 'target_defaults': {
3610 # Enable -Werror by default, but put it in a variable so it can
3611 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3613 'werror%': '-Werror',
3614 'libraries_for_target%': '',
3617 '_FILE_OFFSET_BITS=64',
3620 '<(werror)', # See note above about the werror variable.
3622 '-fno-strict-aliasing', # See http://crbug.com/32204
3624 # Don't warn about unused function params. We use those everywhere.
3625 '-Wno-unused-parameter',
3626 # Don't warn about the "struct foo f = {0};" initialization pattern.
3627 '-Wno-missing-field-initializers',
3628 # Don't export any symbols (for example, to plugins we dlopen()).
3629 # Note: this is *required* to make some plugins work.
3630 '-fvisibility=hidden',
3636 '-fno-threadsafe-statics',
3637 # Make inline functions have hidden visiblity by default.
3638 # Surprisingly, not covered by -fvisibility=hidden.
3639 '-fvisibility-inlines-hidden',
3640 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3641 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3645 '-pthread', '-Wl,-z,noexecstack',
3648 '<(libraries_for_target)',
3653 'debug_optimize%': '0',
3659 '-O>(debug_optimize)',
3664 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3665 # TODO(jdduke) Re-enable on mips after resolving linking
3666 # issues with libc++ (crbug.com/456380).
3668 # Warn in case of text relocations.
3669 '-Wl,--warn-shared-textrel',
3672 ['OS=="android" and android_full_debug==0', {
3673 # Some configurations are copied from Release_Base to reduce
3676 'debug_optimize%': 's',
3680 '-ffunction-sections',
3687 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3688 # We don't omit frame pointers on arm64 since they are required
3689 # to correctly unwind stackframes which contain system library
3690 # function frames (crbug.com/391706).
3692 '-fomit-frame-pointer',
3697 '_LARGEFILE_SOURCE',
3698 '_LARGEFILE64_SOURCE',
3701 ['OS=="linux" and target_arch=="ia32"', {
3703 '-Wl,--no-as-needed',
3706 ['debug_unwind_tables==1', {
3707 'cflags': ['-funwind-tables'],
3709 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3710 'defines': ['NO_UNWIND_TABLES'],
3712 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3713 # definitions in to the right scope to use them when setting
3714 # linux_use_debug_fission, so it can be used here alone.
3715 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3716 'cflags': ['-gsplit-dwarf'],
3722 'release_optimize%': '2',
3723 # Binaries become big and gold is unable to perform GC
3724 # and remove unused sections for some of test targets
3725 # on 32 bit platform.
3726 # (This is currently observed only in chromeos valgrind bots)
3727 # The following flag is to disable --gc-sections linker
3728 # option for these bots.
3729 'no_gc_sections%': 0,
3731 # TODO(bradnelson): reexamine how this is done if we change the
3732 # expansion of configurations
3733 'release_valgrind_build%': 0,
3736 '-O<(release_optimize)',
3737 # Don't emit the GCC version ident directives, they just end up
3738 # in the .comment section taking up binary size.
3740 # Put data and code in their own sections, so that unused symbols
3741 # can be removed at link time with --gc-sections.
3743 '-ffunction-sections',
3746 # Specifically tell the linker to perform optimizations.
3747 # See http://lwn.net/Articles/192624/ .
3752 ['no_gc_sections==0', {
3754 '-Wl,--gc-sections',
3757 ['OS=="android" and target_arch!="arm64"', {
3758 # We don't omit frame pointers on arm64 since they are required
3759 # to correctly unwind stackframes which contain system library
3760 # function frames (crbug.com/391706).
3762 '-fomit-frame-pointer',
3765 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3766 # TODO(jdduke) Re-enable on mips after resolving linking
3767 # issues with libc++ (crbug.com/456380).
3769 # Warn in case of text relocations.
3770 '-Wl,--warn-shared-textrel',
3775 'release_optimize%': 's',
3780 '-fno-omit-frame-pointer',
3784 ['profiling_full_stack_frames==1', {
3787 '-fno-optimize-sibling-calls',
3792 ['release_unwind_tables==1', {
3793 'cflags': ['-funwind-tables'],
3795 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3796 'defines': ['NO_UNWIND_TABLES'],
3802 ['target_arch=="ia32"', {
3803 'target_conditions': [
3804 ['_toolset=="target"', {
3806 # Needed so that libs with .s files (e.g. libicudata.a)
3807 # are compatible with the general 32-bit-ness.
3810 # All floating-point computations on x87 happens in 80-bit
3811 # precision. Because the C and C++ language standards allow
3812 # the compiler to keep the floating-point values in higher
3813 # precision than what's specified in the source and doing so
3814 # is more efficient than constantly rounding up to 64-bit or
3815 # 32-bit precision as specified in the source, the compiler,
3816 # especially in the optimized mode, tries very hard to keep
3817 # values in x87 floating-point stack (in 80-bit precision)
3818 # as long as possible. This has important side effects, that
3819 # the real value used in computation may change depending on
3820 # how the compiler did the optimization - that is, the value
3821 # kept in 80-bit is different than the value rounded down to
3822 # 64-bit or 32-bit. There are possible compiler options to
3823 # make this behavior consistent (e.g. -ffloat-store would keep
3824 # all floating-values in the memory, thus force them to be
3825 # rounded to its original precision) but they have significant
3826 # runtime performance penalty.
3828 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3829 # which keep floating-point values in SSE registers in its
3830 # native precision (32-bit for single precision, and 64-bit
3831 # for double precision values). This means the floating-point
3832 # value used during computation does not change depending on
3833 # how the compiler optimized the code, since the value is
3834 # always kept in its specified precision.
3836 # Refer to http://crbug.com/348761 for rationale behind SSE2
3837 # being a minimum requirement for 32-bit Linux builds and
3838 # http://crbug.com/313032 for an example where this has "bit"
3843 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3850 # Use gold linker for Android ia32 target.
3856 # Install packages have started cropping up with
3857 # different headers between the 32-bit and 64-bit
3858 # versions, so we have to shadow those differences off
3859 # and make sure a 32-bit-on-64-bit build picks up the
3861 # For android build, use NDK headers instead of host headers
3862 ['host_arch!="ia32" and OS!="android"', {
3871 ['target_arch=="x64"', {
3872 'target_conditions': [
3873 ['_toolset=="target"', {
3875 # Use gold linker for Android x64 target.
3892 ['target_arch=="arm"', {
3893 'target_conditions': [
3894 ['_toolset=="target"', {
3898 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3899 # has changed whenever it encounters a varargs function. This
3900 # silences those warnings, as they are not helpful and
3901 # clutter legitimate warnings.
3905 ['clang==1 and arm_arch!="" and OS!="android"', {
3907 '-target arm-linux-gnueabihf',
3910 '-target arm-linux-gnueabihf',
3915 '-march=<(arm_arch)',
3918 ['use_lto==1 or use_lto_o2==1', {
3920 '-march=<(arm_arch)',
3925 ['clang==1 and OS!="android"', {
3927 # We need to disable clang's builtin assembler as it can't
3928 # handle several asm files, crbug.com/124610
3929 '-no-integrated-as',
3934 '-mtune=<(arm_tune)',
3937 ['use_lto==1 or use_lto_o2==1', {
3939 '-mtune=<(arm_tune)',
3949 ['use_lto==1 or use_lto_o2==1', {
3956 ['arm_float_abi!=""', {
3958 '-mfloat-abi=<(arm_float_abi)',
3961 ['use_lto==1 or use_lto_o2==1', {
3963 '-mfloat-abi=<(arm_float_abi)',
3973 ['use_lto==1 or use_lto_o2==1', {
3981 # Most of the following flags are derived from what Android
3982 # uses by default when building for arm, reference for which
3983 # can be found in the following file in the Android NDK:
3984 # toolchains/arm-linux-androideabi-4.9/setup.mk
3986 # The tree-sra optimization (scalar replacement for
3987 # aggregates enabling subsequent optimizations) leads to
3988 # invalid code generation when using the Android NDK's
3989 # compiler (r5-r7). This can be verified using
3990 # webkit_unit_tests' WTF.Checked_int8_t test.
3992 # The following option is disabled to improve binary
3993 # size and performance in gcc 4.9.
3994 '-fno-caller-saves',
3997 # Android now supports .relro sections properly.
3998 # NOTE: While these flags enable the generation of .relro
3999 # sections, the generated libraries can still be loaded on
4000 # older Android platform versions.
4007 ['gcc_version==48 and clang==0', {
4009 # The following 5 options are disabled to save on
4010 # binary size in GCC 4.8.
4011 '-fno-partial-inlining',
4012 '-fno-early-inlining',
4013 '-fno-tree-copy-prop',
4014 '-fno-tree-loop-optimize',
4015 '-fno-move-loop-invariants',
4019 'cflags': [ '-mthumb-interwork' ],
4023 # Thumb code with frame pointer makes chrome crash
4026 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
4027 # The perf report sometimes incorrectly attributes
4028 # code from tail calls.
4029 '-fno-optimize-sibling-calls',
4032 '-fomit-frame-pointer',
4037 # Clang does not support the following options.
4039 '-mthumb-interwork',
4040 '-finline-limit=64',
4042 '-fno-caller-saves',
4046 # TODO(hans) Enable integrated-as (crbug.com/124610).
4047 '-no-integrated-as',
4048 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4051 ['clang==1 and linux_use_bundled_gold==0', {
4053 # Let clang find the ld.gold in the NDK.
4054 '--gcc-toolchain=<(android_toolchain)/..',
4059 '-marm', # Required for frame pointer based stack traces.
4066 # We set arm_arch to "" so that -march compiler option
4067 # is not set. Otherwise a gcc bug that would complain
4068 # about it conflicting with '-mcpu=cortex-a9'. The flag
4069 # '-march=armv7-a' is actually redundant anyway because
4070 # it is enabled by default when we built the toolchain.
4071 # And using '-mcpu=cortex-a9' should be sufficient.
4074 # Breakpad requires symbols with debugging information
4078 # We want to statically link libstdc++/libgcc_s.
4079 '-static-libstdc++',
4083 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4084 # define their own cflags for arm builds that could
4085 # conflict with the flags we set here (e.g.
4086 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4095 ['target_arch=="arm64"', {
4096 'target_conditions': [
4097 ['_toolset=="target"', {
4101 '-fstack-protector', # stack protector is always enabled on arm64.
4108 ['target_arch=="mipsel"', {
4109 'target_conditions': [
4110 ['_toolset=="target"', {
4112 ['mips_arch_variant=="r6"', {
4115 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ],
4116 'ldflags': [ '-target mipsel-linux-gnu', ],
4118 'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
4120 ['clang==0 and OS=="android"', {
4121 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4125 ['mips_arch_variant=="r2"', {
4127 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4128 'cflags': ['-m<(mips_fpu_mode)'],
4133 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
4134 'ldflags': [ '-target mipsel-linux-android', ],
4138 'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
4142 ['mips_arch_variant=="r1"', {
4147 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
4148 'ldflags': [ '-target mipsel-linux-android', ],
4152 'cflags': ['-mips32', '-Wa,-mips32', ],
4158 # Clang does not support the following options.
4159 '-finline-limit=64',
4162 # TODO(gordanac) Enable integrated-as.
4163 '-no-integrated-as',
4164 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4167 # Let clang find the ld in the NDK.
4168 '--gcc-toolchain=<(android_toolchain)/..',
4171 ['mips_dsp_rev==1', {
4172 'cflags': ['-mdsp'],
4174 ['mips_dsp_rev==2', {
4175 'cflags': ['-mdspr2'],
4179 '-m<(mips_float_abi)-float'
4182 '-Wl,--no-keep-memory'
4185 '-Wno-uninitialized',
4190 ['target_arch=="mips64el"', {
4191 'target_conditions': [
4192 ['_toolset=="target"', {
4194 ['mips_arch_variant=="r6"', {
4195 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4196 'ldflags': ['-mips64r6'],
4198 ['mips_arch_variant=="r2"', {
4199 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4200 'ldflags': ['-mips64r2'],
4204 '-Wno-uninitialized',
4218 'target_conditions': [
4219 ['_toolset=="target"', {
4221 '--sysroot=<(sysroot)',
4224 '--sysroot=<(sysroot)',
4225 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4231 # TODO(thakis): Remove, http://crbug.com/263960
4232 '-Wno-reserved-user-defined-literal',
4235 # gnu++11 instead of c++11 is needed because some code uses
4236 # typeof() (a GNU extension).
4237 # TODO(thakis): Eventually switch this to c++11 instead,
4238 # http://crbug.com/427584
4242 ['clang==0 and host_clang==1', {
4243 'target_conditions': [
4244 ['_toolset=="host"', {
4245 'cflags_cc': [ '-std=gnu++11', ],
4249 ['clang==1 and clang_use_chrome_plugins==1', {
4251 '<@(clang_chrome_plugins_flags)',
4254 ['clang==1 and clang_load!=""', {
4256 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4259 ['clang==1 and clang_add_plugin!=""', {
4261 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4264 ['clang==1 and target_arch=="ia32"', {
4266 # Else building libyuv gives clang's register allocator issues,
4267 # see llvm.org/PR15798 / crbug.com/233709
4268 '-momit-leaf-frame-pointer',
4269 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4270 '-mstack-alignment=16',
4274 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4276 # See http://crbug.com/110262
4277 '-fcolor-diagnostics',
4280 # Common options for AddressSanitizer, LeakSanitizer,
4281 # ThreadSanitizer and MemorySanitizer.
4282 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4283 'target_conditions': [
4284 ['_toolset=="target"', {
4286 '-fno-omit-frame-pointer',
4287 '-gline-tables-only',
4290 '-fomit-frame-pointer',
4295 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4296 'target_conditions': [
4297 ['_toolset=="target"', {
4299 # Functions interposed by the sanitizers can make ld think
4300 # that some libraries aren't needed when they actually are,
4301 # http://crbug.com/234010. As workaround, disable --as-needed.
4305 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4306 'MEMORY_SANITIZER_INITIAL_SIZE',
4312 'target_conditions': [
4313 ['_toolset=="target"', {
4315 '-fsanitize=address',
4316 # TODO(earthdok): Re-enable. http://crbug.com/427202
4317 #'-fsanitize-blacklist=<(asan_blacklist)',
4320 '-fsanitize=address',
4327 '-mllvm -asan-globals=0', # http://crbug.com/352073
4333 'target_conditions': [
4334 ['_toolset=="target"', {
4336 '-fsanitize=undefined',
4337 '-fsanitize-blacklist=<(ubsan_blacklist)',
4338 # Employ the experimental PBQP register allocator to avoid
4339 # slow compilation on files with too many basic blocks.
4340 # See http://crbug.com/426271.
4341 '-mllvm -regalloc=pbqp',
4342 # Speculatively use coalescing to slightly improve the code
4343 # generated by PBQP regallocator. May increase compile time.
4344 '-mllvm -pbqp-coalescing',
4353 '-fsanitize=undefined',
4356 'UNDEFINED_SANITIZER',
4362 'target_conditions': [
4363 ['_toolset=="target"', {
4366 '-fsanitize-blacklist=<(ubsan_blacklist)',
4378 'UNDEFINED_SANITIZER',
4383 ['asan_coverage!=0 and sanitizer_coverage==0', {
4384 'target_conditions': [
4385 ['_toolset=="target"', {
4387 '-fsanitize-coverage=<(asan_coverage)',
4390 'SANITIZER_COVERAGE',
4395 ['sanitizer_coverage!=0', {
4396 'target_conditions': [
4397 ['_toolset=="target"', {
4399 '-fsanitize-coverage=<(sanitizer_coverage)',
4402 'SANITIZER_COVERAGE',
4407 ['asan_field_padding!=0', {
4408 'target_conditions': [
4409 ['_toolset=="target"', {
4411 '-fsanitize-address-field-padding=<(asan_field_padding)',
4417 'target_conditions': [
4418 ['_toolset=="target"', {
4427 'WTF_USE_LEAK_SANITIZER=1',
4433 'target_conditions': [
4434 ['_toolset=="target"', {
4436 '-fsanitize=thread',
4437 '-fsanitize-blacklist=<(tsan_blacklist)',
4440 '-fsanitize=thread',
4444 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4445 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4451 'target_conditions': [
4452 ['_toolset=="target"', {
4454 '-fsanitize=memory',
4455 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4456 '-fsanitize-blacklist=<(msan_blacklist)',
4459 '-fsanitize=memory',
4467 ['use_instrumented_libraries==1', {
4469 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4472 ['use_prebuilt_instrumented_libraries==1', {
4474 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
4477 ['use_custom_libcxx==1', {
4479 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4482 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4483 'target_conditions' : [
4484 # crazy_linker has an upstream gyp file we can't edit, and we
4485 # don't want to instrument it.
4486 ['_toolset=="target" and _target_name!="crazy_linker"', {
4488 '-finstrument-functions',
4489 # Allow mmx intrinsics to inline, so that the
4490 #0 compiler can expand the intrinsics.
4491 '-finstrument-functions-exclude-file-list=mmintrin.h',
4494 ['_toolset=="target" and OS=="android"', {
4496 # Avoids errors with current NDK:
4497 # "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"
4498 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4503 ['linux_dump_symbols==1', {
4506 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4507 'target_conditions': [
4508 ['_toolset=="target"', {
4510 # Attempt to use less memory to prevent the linker from
4511 # running out of address space. Considering installing a
4512 # 64-bit kernel and switching to a 64-bit linker.
4513 '-Wl,--no-keep-memory',
4520 ['use_allocator!="tcmalloc"', {
4521 'defines': ['NO_TCMALLOC'],
4523 ['linux_use_gold_flags==1', {
4524 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4526 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4527 'ldflags': [ '-fuse-ld=gold', ],
4529 'target_conditions': [
4530 ['_toolset=="target"', {
4532 # Experimentation found that using four linking threads
4533 # saved ~20% of link time.
4534 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4535 # Only apply this to the target linker, since the host
4536 # linker might not be gold, but isn't used much anyway.
4537 # TODO(raymes): Disable threading because gold is frequently
4538 # crashing on the bots: crbug.com/161942.
4540 # '-Wl,--thread-count=4',
4543 # TODO(thestig): Enable this for disabled cases.
4544 [ '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', {
4546 '-Wl,--detect-odr-violations',
4553 ['release_valgrind_build==0 and order_profiling==0', {
4554 'target_conditions': [
4555 ['_toolset=="target"', {
4557 '-Wl,--icf=<(gold_icf_level)',
4564 ['linux_use_bundled_binutils==1', {
4566 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4569 ['linux_use_bundled_gold==1 and '
4570 'not (clang==0 and (use_lto==1 or use_lto_o2==1))', {
4571 # Put our binutils, which contains gold in the search path. We pass
4572 # the path to gold to the compiler. gyp leaves unspecified what the
4573 # cwd is when running the compiler, so the normal gyp path-munging
4574 # fails us. This hack gets the right path.
4576 # Disabled when using GCC LTO because GCC also uses the -B search
4577 # path at link time to find "as", and our bundled "as" can only
4580 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4583 # Some binutils 2.23 releases may or may not have new dtags enabled,
4584 # but they are all compatible with --disable-new-dtags,
4585 # because the new dynamic tags are not created by default.
4586 ['binutils_version>=223', {
4587 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4588 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4589 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4590 # inside this file to allow usage of --no-as-needed and removal of
4593 '-Wl,--disable-new-dtags',
4596 ['gcc_version>=47 and clang==0', {
4597 'target_conditions': [
4598 ['_toolset=="target"', {
4601 # See comment for -Wno-c++11-narrowing.
4603 # TODO(thakis): Remove, http://crbug.com/263960
4604 '-Wno-literal-suffix',
4609 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4610 'target_conditions': [
4611 ['_toolset=="host"', {
4614 # See comment for -Wno-c++11-narrowing.
4616 # TODO(thakis): Remove, http://crbug.com/263960
4617 '-Wno-literal-suffix',
4625 # FreeBSD-specific options; note that most FreeBSD options are set above,
4628 'target_defaults': {
4630 '-Wl,--no-keep-memory',
4634 # Android-specific options; note that most are set above with Linux.
4637 # This is a unique identifier for a given build. It's used for
4638 # identifying various build artifacts corresponding to a particular
4639 # build of chrome (e.g. where to find archived symbols).
4640 'chrome_build_id%': '',
4642 # Figure this out early since it needs symbols from libgcc.a, so it
4643 # has to be before that in the set of libraries.
4644 ['component=="shared_library"', {
4645 'android_libcpp_library': 'c++_shared',
4647 'android_libcpp_library': 'c++_static',
4651 # Placing this variable here prevents from forking libvpx, used
4652 # by remoting. Remoting is off, so it needn't built,
4653 # so forking it's deps seems like overkill.
4654 # But this variable need defined to properly run gyp.
4655 # A proper solution is to have an OS==android conditional
4656 # in third_party/libvpx/libvpx.gyp to define it.
4657 'libvpx_path': 'lib/linux/arm',
4659 'target_defaults': {
4661 'release_extra_cflags%': '',
4663 # If we're using the components build, append "cr" to all shared
4664 # libraries to avoid naming collisions with android system library
4665 # versions with the same name (e.g. skia, icu).
4666 ['component=="shared_library"', {
4667 'android_product_extension': 'cr.so',
4669 'android_product_extension': 'so',
4673 'target_conditions': [
4674 ['_type=="shared_library"', {
4675 'product_extension': '<(android_product_extension)',
4678 # Settings for building device targets using Android's toolchain.
4679 # These are based on the setup.mk file from the Android NDK.
4681 # The NDK Android executable link step looks as follows:
4683 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4684 # $(PRIVATE_OBJECTS) <-- The .o that we built
4685 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4686 # $(TARGET_LIBGCC) <-- libgcc.a
4687 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4688 # $(PRIVATE_LDLIBS) <-- System .so
4689 # $(TARGET_CRTEND_O) <-- crtend.o
4691 # For now the above are approximated for executables by adding
4692 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4695 # The NDK Android shared library link step looks as follows:
4697 # $(PRIVATE_OBJECTS) <-- The .o that we built
4698 # -l,--whole-archive
4699 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4700 # -l,--no-whole-archive
4701 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4702 # $(TARGET_LIBGCC) <-- libgcc.a
4703 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4704 # $(PRIVATE_LDLIBS) <-- System .so
4706 # For now, assume that whole static libraries are not needed.
4708 # For both executables and shared libraries, add the proper
4709 # libgcc.a to the start of libraries which puts it in the
4710 # proper spot after .o and .a files get linked in.
4712 # TODO: The proper thing to do longer-tem would be proper gyp
4713 # support for a custom link command line.
4714 ['_toolset=="target"', {
4716 '-pthread', # Not supported by Android toolchain.
4719 '-ffunction-sections',
4722 '-fstack-protector',
4724 '-finline-limit=64',
4725 '<@(release_extra_cflags)',
4726 '--sysroot=<(android_ndk_sysroot)',
4727 # NOTE: The libc++ header include paths below are specified in
4728 # cflags rather than include_dirs because they need to come
4729 # after include_dirs.
4730 # The include ordering here is important; change with caution.
4731 '-isystem<(android_libcpp_include)',
4732 '-isystem<(android_ndk_root)/sources/cxx-stl/llvm-libc++abi/libcxxabi/include',
4733 '-isystem<(android_ndk_root)/sources/android/support/include',
4737 '__GNU_SOURCE=1', # Necessary for clone()
4738 'CHROME_BUILD_ID="<(chrome_build_id)"',
4739 # The NDK has these things, but doesn't define the constants
4740 # to say that it does. Define them here instead.
4744 '-pthread', # Not supported by Android toolchain.
4747 '-Wl,--no-undefined',
4748 '--sysroot=<(android_ndk_sysroot)',
4750 '-L<(android_libcpp_libs_dir)',
4751 # Don't allow visible symbols from libgcc or libc++ to be
4753 '-Wl,--exclude-libs=libgcc.a',
4754 '-Wl,--exclude-libs=libc++_static.a',
4755 # Don't allow visible symbols from libraries that contain
4756 # assembly code with symbols that aren't hidden properly.
4757 # http://crbug.com/448386
4758 '-Wl,--exclude-libs=libcommon_audio.a',
4759 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4760 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4761 '-Wl,--exclude-libs=libiSACFix.a',
4762 '-Wl,--exclude-libs=libisac_neon.a',
4763 '-Wl,--exclude-libs=libopus.a',
4764 '-Wl,--exclude-libs=libvpx.a',
4767 '-l<(android_libcpp_library)',
4769 # Manually link the libgcc.a that the cross compiler uses.
4770 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4776 ['component=="static_library"', {
4777 'target_conditions': [
4778 ['use_native_jni_exports==0', {
4779 # Use a linker version script to strip JNI exports from
4780 # binaries which have not specifically asked to use them.
4782 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4789 # Clang with libc++ does not require an explicit atomic
4790 # library reference.
4794 # Work around incompatibilities between bionic and clang
4796 '-D__compiler_offsetof=__builtin_offsetof',
4797 '-Dnan=__builtin_nan',
4800 ['target_arch=="arm"', {
4802 '-target arm-linux-androideabi',
4805 '-target arm-linux-androideabi',
4808 ['target_arch=="ia32"', {
4810 '-target x86-linux-androideabi',
4813 '-target x86-linux-androideabi',
4816 # Place holder for x64 support, not tested.
4817 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4818 ['target_arch=="x64"', {
4820 '-target x86_64-linux-androideabi',
4823 '-target x86_64-linux-androideabi',
4830 # Android build relies on -Wl,--gc-sections removing
4831 # unreachable code. ASan instrumentation for globals inhibits
4832 # this and results in a library with unresolvable relocations.
4833 # TODO(eugenis): find a way to reenable this.
4834 '-mllvm -asan-globals=0',
4837 ['target_arch == "arm" and order_profiling==0', {
4839 # Enable identical code folding to reduce size.
4840 '-Wl,--icf=<(gold_icf_level)',
4843 ['target_arch=="ia32"', {
4844 # The x86 toolchain currently has problems with stack-protector.
4846 '-fstack-protector',
4849 '-fno-stack-protector',
4853 'target_conditions': [
4854 ['_type=="executable"', {
4855 # Force android tools to export the "main" symbol so they can be
4856 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4857 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4858 # when ICS support will be dropped.
4861 '-fvisibility=default',
4865 '-Wl,--gc-sections',
4866 '-Wl,-z,nocopyreloc',
4869 # crtbegin_dynamic.o should be the last item in ldflags.
4870 '<(android_ndk_lib)/crtbegin_dynamic.o',
4873 # crtend_android.o needs to be the last item in libraries.
4874 # Do not add any libraries after this!
4875 '<(android_ndk_lib)/crtend_android.o',
4878 ['_type=="shared_library" or _type=="loadable_module"', {
4880 '-Wl,-shared,-Bsymbolic',
4881 # crtbegin_so.o should be the last item in ldflags.
4882 '<(android_ndk_lib)/crtbegin_so.o',
4885 # crtend_so.o needs to be the last item in libraries.
4886 # Do not add any libraries after this!
4887 '<(android_ndk_lib)/crtend_so.o',
4892 # Settings for building host targets using the system toolchain.
4893 ['_toolset=="host"', {
4895 # Due to issues in Clang build system, using ASan on 32-bit
4896 # binaries on x86_64 host is problematic.
4897 # TODO(eugenis): re-enable.
4898 '-fsanitize=address',
4901 '-fsanitize=address',
4902 '-Wl,-z,noexecstack',
4903 '-Wl,--gc-sections',
4906 '-Wl,--warn-shared-textrel',
4907 '-Wl,--fatal-warnings',
4910 # Settings for building host targets on mac.
4911 ['_toolset=="host" and host_os=="mac"', {
4921 'cflags!': ['-fvisibility=hidden'],
4922 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4924 ['OS=="mac" or OS=="ios"', {
4925 'target_defaults': {
4928 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4929 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4930 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4931 'COPY_PHASE_STRIP': 'NO',
4932 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4933 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4934 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4935 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4936 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4937 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4938 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4939 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4940 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4941 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4942 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4943 'GCC_VERSION': '4.2',
4944 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4945 'USE_HEADERMAP': 'NO',
4950 # Don't warn about unused function parameters.
4951 '-Wno-unused-parameter',
4952 # Don't warn about the "struct foo f = {0};" initialization
4954 '-Wno-missing-field-initializers',
4957 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4958 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4960 # Note that the prebuilt Clang binaries should not be used for iOS
4961 # development except for ASan builds.
4963 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
4964 # Warn if automatic synthesis is triggered with
4965 # the -Wobjc-missing-property-synthesis flag.
4966 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4967 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4969 # This warns on selectors from Cocoa headers (-length, -set).
4970 # cfe-dev is currently discussing the merits of this warning.
4971 # TODO(thakis): Reevaluate what to do with this, based one
4972 # cfe-dev discussion.
4973 '-Wno-selector-type-mismatch',
4976 ['clang_xcode==0', {
4977 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4978 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4982 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4984 '<@(clang_chrome_plugins_flags)',
4987 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4989 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4992 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4994 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4997 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4999 # See http://crbug.com/110262
5000 '-fcolor-diagnostics',
5003 ['OS=="ios" and target_subarch!="arm32" and \
5004 "<(GENERATOR)"=="xcode"', {
5006 # TODO(ios): when building Chrome for iOS on 64-bit platform
5007 # with Xcode, the -Wshorted-64-to-32 warning is automatically
5008 # enabled. This cause failures when compiling protobuf code,
5009 # so disable the warning. http://crbug.com/359107
5010 '-Wno-shorten-64-to-32',
5018 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
5024 '-fsanitize=address',
5025 '-mllvm -asan-globals=0', # http://crbug.com/352073
5026 '-gline-tables-only',
5030 ['asan_coverage!=0 and sanitizer_coverage==0', {
5031 'target_conditions': [
5032 ['_toolset=="target"', {
5034 '-fsanitize-coverage=<(asan_coverage)',
5037 'SANITIZER_COVERAGE',
5042 ['sanitizer_coverage!=0', {
5043 'target_conditions': [
5044 ['_toolset=="target"', {
5046 '-fsanitize-coverage=<(sanitizer_coverage)',
5049 'SANITIZER_COVERAGE',
5055 'target_conditions': [
5056 ['_type!="static_library"', {
5057 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5062 '-fsanitize=address',
5066 ['mac_write_linker_maps==1', {
5069 '-Wl,-map,>(_target_name).map',
5076 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5077 'target_conditions': [
5078 ['_type=="executable"', {
5084 # Define copy_asan_dylib_path in a variable ending in
5085 # _path so that gyp understands it's a path and
5086 # performs proper relativization during dict merging.
5087 'copy_asan_dylib_path':
5088 'mac/copy_asan_runtime_dylib.sh',
5090 'postbuild_name': 'Copy ASan runtime dylib',
5092 '<(copy_asan_dylib_path)',
5101 ], # target_conditions
5102 }, # target_defaults
5103 }], # OS=="mac" or OS=="ios"
5105 'target_defaults': {
5107 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5108 # with common names, like 'check', 'require', and 'verify'.
5109 # (Included by system header. Also exists on iOS but not included.)
5110 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5111 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5114 # These should end with %, but there seems to be a bug with % in
5115 # variables that are intended to be set to different values in
5116 # different targets, like these.
5117 'mac_pie': 1, # Most executables can be position-independent.
5118 # Strip debugging symbols from the target.
5119 'mac_strip': '<(mac_strip_release)',
5123 ['mac_want_real_dsym=="default"', {
5126 'mac_real_dsym': '<(mac_want_real_dsym)'
5131 ['mac_want_real_dsym=="default"', {
5132 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5134 'mac_real_dsym': '<(mac_want_real_dsym)'
5143 ['branding=="Chrome" and buildtype=="Official"', {
5146 # The Google Chrome Framework dSYM generated by dsymutil has
5147 # grown larger than 4GB, which dsymutil can't handle. Reduce
5148 # the amount of debug symbols.
5149 '-fno-standalone-debug', # See http://crbug.com/479841
5154 }, # configuration "Release"
5157 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5158 # (Equivalent to -fPIC)
5159 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5160 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5161 # Keep pch files below xcodebuild/.
5162 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5164 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5165 # xcode_setting, but not until all downstream projects' mac bots are
5166 # using xcode >= 4.6, because that's when the default value of the
5167 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5168 # setting is a no-op as far as xcode is concerned, but the compiler
5169 # behaves differently based on whether -fno-strict-aliasing is
5171 '-fno-strict-aliasing', # See http://crbug.com/32204.
5174 'target_conditions': [
5175 ['_type=="executable"', {
5178 # Arranges for data (heap) pages to be protected against
5179 # code execution when running on Mac OS X 10.7 ("Lion"), and
5180 # ensures that the position-independent executable (PIE) bit
5181 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5183 # Define change_mach_o_flags in a variable ending in _path
5184 # so that GYP understands it's a path and performs proper
5185 # relativization during dict merging.
5186 'change_mach_o_flags_path':
5187 'mac/change_mach_o_flags_from_xcode.sh',
5188 'change_mach_o_flags_options%': [
5190 'target_conditions': [
5191 ['mac_pie==0 or release_valgrind_build==1', {
5192 # Don't enable PIE if it's unwanted. It's unwanted if
5193 # the target specifies mac_pie=0 or if building for
5194 # Valgrind, because Valgrind doesn't understand slide.
5195 # See the similar mac_pie/release_valgrind_build check
5197 'change_mach_o_flags_options': [
5203 'postbuild_name': 'Change Mach-O Flags',
5205 '<(change_mach_o_flags_path)',
5206 '>@(change_mach_o_flags_options)',
5210 'target_conditions': [
5211 ['mac_pie==1 and release_valgrind_build==0', {
5212 # Turn on position-independence (ASLR) for executables. When
5213 # PIE is on for the Chrome executables, the framework will
5214 # also be subject to ASLR.
5215 # Don't do this when building for Valgrind, because Valgrind
5216 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5217 # understand slide, and get rid of the Valgrind check.
5220 '-Wl,-pie', # Position-independent executable (MH_PIE)
5226 ['(_type=="executable" or _type=="shared_library" or \
5227 _type=="loadable_module") and mac_strip!=0', {
5228 'target_conditions': [
5229 ['mac_real_dsym == 1', {
5230 # To get a real .dSYM bundle produced by dsymutil, set the
5231 # debug information format to dwarf-with-dsym. Since
5232 # strip_from_xcode will not be used, set Xcode to do the
5233 # stripping as well.
5237 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5238 'DEPLOYMENT_POSTPROCESSING': 'YES',
5239 'STRIP_INSTALLED_PRODUCT': 'YES',
5241 # Only strip non-ASan builds.
5243 'target_conditions': [
5244 ['_type=="shared_library" or _type=="loadable_module"', {
5245 # The Xcode default is to strip debugging symbols
5246 # only (-S). Local symbols should be stripped as
5247 # well, which will be handled by -x. Xcode will
5248 # continue to insert -S when stripping even when
5249 # additional flags are added with STRIPFLAGS.
5251 }], # _type=="shared_library" or _type=="loadable_module"
5252 ], # target_conditions
5258 }, # configuration "Release"
5260 }, { # mac_real_dsym != 1
5261 # To get a fast fake .dSYM bundle, use a post-build step to
5262 # produce the .dSYM and strip the executable. strip_from_xcode
5263 # only operates in the Release configuration.
5267 # Define strip_from_xcode in a variable ending in _path
5268 # so that gyp understands it's a path and performs proper
5269 # relativization during dict merging.
5270 'strip_from_xcode_path': 'mac/strip_from_xcode',
5272 'postbuild_name': 'Strip If Needed',
5273 'action': ['<(strip_from_xcode_path)'],
5277 ], # target_conditions
5278 }], # (_type=="executable" or _type=="shared_library" or
5279 # _type=="loadable_module") and mac_strip!=0
5280 ], # target_conditions
5281 }, # target_defaults
5285 'ios/coverage.gypi',
5287 'target_defaults': {
5288 'xcode_settings' : {
5289 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5292 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5293 # additional flag to suppress the "unknown compiler option" error.
5294 # Restrict this flag to builds that are either compiling with Xcode
5295 # or compiling with Xcode's Clang. This will allow Ninja builds to
5296 # continue failing on unknown compiler options.
5297 # TODO(rohitrao): This flag is temporary and should be removed as
5298 # soon as the iOS bots are updated to use Xcode 5.1.
5299 ['clang_xcode==1', {
5301 '-Wno-unknown-warning-option',
5305 # Limit the valid architectures depending on "target_subarch".
5306 # This need to include the "arm" architectures but also the "x86"
5307 # ones (they are used when building for the simulator).
5308 ['target_subarch=="arm32"', {
5309 'VALID_ARCHS': ['armv7', 'i386'],
5311 ['target_subarch=="arm64"', {
5312 'VALID_ARCHS': ['arm64', 'x86_64'],
5314 ['target_subarch=="both"', {
5315 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5317 ['use_system_libcxx==1', {
5318 'target_conditions': [
5319 # Only use libc++ when building target for iOS not when building
5320 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5321 # does not support libc++.
5322 ['_toolset=="target"', {
5323 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5327 # The default for deployment target of 7.0+ is libc++, so force
5328 # the old behavior unless libc++ is enabled.
5329 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5333 'target_conditions': [
5334 ['_toolset=="host"', {
5336 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5337 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5346 ['_toolset=="target"', {
5348 # This section should be for overriding host settings. But,
5349 # since we can't negate the iphone deployment target above, we
5350 # instead set it here for target only.
5351 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5352 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5355 ['_type=="executable"', {
5359 'DEPLOYMENT_POSTPROCESSING': 'YES',
5360 'STRIP_INSTALLED_PRODUCT': 'YES',
5365 # Remove dSYM to reduce build time.
5366 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5372 ['chromium_ios_signing', {
5373 # iOS SDK wants everything for device signed.
5374 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5376 'CODE_SIGNING_REQUIRED': 'NO',
5377 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5382 ], # target_conditions
5383 }, # target_defaults
5386 'target_defaults': {
5388 '_WIN32_WINNT=0x0603',
5395 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5396 'WIN32_LEAN_AND_MEAN',
5399 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5400 '_HAS_EXCEPTIONS=0',
5401 # Silence some warnings; we can't switch the the 'recommended'
5402 # versions as they're not available on old OSs.
5403 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5406 ['buildtype=="Official"', {
5407 # In official builds, targets can self-select an optimization
5408 # level by defining a variable named 'optimize', and setting it
5410 # - "size", optimizes for minimal code size - the default.
5411 # - "speed", optimizes for speed over code size.
5412 # - "max", whole program optimization and link-time code
5413 # generation. This is very expensive and should be used
5416 'optimize%': 'size',
5420 # Set /LTCG for the official builds.
5421 'LinkTimeCodeGeneration': '1',
5422 'AdditionalOptions': [
5423 # Set the number of LTCG code-gen threads to eight.
5424 # The default is four. This gives a 5-10% link speedup.
5429 'target_conditions': [
5430 ['optimize=="size"', {
5432 'VCCLCompilerTool': {
5433 # 1, optimizeMinSpace, Minimize Size (/O1)
5434 'Optimization': '1',
5435 # 2, favorSize - Favor small code (/Os)
5436 'FavorSizeOrSpeed': '2',
5441 ['optimize=="speed"', {
5443 'VCCLCompilerTool': {
5444 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5445 'Optimization': '2',
5446 # 1, favorSpeed - Favor fast code (/Ot)
5447 'FavorSizeOrSpeed': '1',
5452 ['optimize=="max"', {
5453 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5454 # builds. Probably anything that this would catch that
5455 # wouldn't be caught in a normal build isn't going to
5456 # actually be a bug, so the incremental value of C4702 for
5457 # PGO builds is likely very small.
5458 'msvs_disabled_warnings': [
5462 'VCCLCompilerTool': {
5463 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5464 'Optimization': '2',
5465 # 1, favorSpeed - Favor fast code (/Ot)
5466 'FavorSizeOrSpeed': '1',
5467 # This implies link time code generation.
5468 'WholeProgramOptimization': 'true',
5476 ['msvs_xtree_patched!=1', {
5477 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5478 # it's enabled. This will generally only be true for system-level
5479 # installed Express users.
5480 'msvs_disabled_warnings': [
5485 'msvs_system_include_dirs': [
5486 '<(windows_sdk_path)/Include/shared',
5487 '<(windows_sdk_path)/Include/um',
5488 '<(windows_sdk_path)/Include/winrt',
5489 '$(VSInstallDir)/VC/atlmfc/include',
5491 'msvs_cygwin_shell': 0,
5492 'msvs_disabled_warnings': [
5493 # C4091: 'typedef ': ignored on left of 'X' when no variable is
5495 # This happens in a number of Windows headers. Dumb.
5498 # C4127: conditional expression is constant
5499 # This warning can in theory catch dead code and other problems, but
5500 # triggers in far too many desirable cases where the conditional
5501 # expression is either set by macros or corresponds some legitimate
5502 # compile-time constant expression (due to constant template args,
5503 # conditionals comparing the sizes of different types, etc.). Some of
5504 # these can be worked around, but it's not worth it.
5507 # C4351: new behavior: elements of array 'array' will be default
5509 # This is a silly "warning" that basically just alerts you that the
5510 # compiler is going to actually follow the language spec like it's
5511 # supposed to, instead of not following it like old buggy versions
5512 # did. There's absolutely no reason to turn this on.
5515 # C4355: 'this': used in base member initializer list
5516 # It's commonly useful to pass |this| to objects in a class'
5517 # initializer list. While this warning can catch real bugs, most of
5518 # the time the constructors in question don't attempt to call methods
5519 # on the passed-in pointer (until later), and annotating every legit
5520 # usage of this is simply more hassle than the warning is worth.
5523 # C4503: 'identifier': decorated name length exceeded, name was
5525 # This only means that some long error messages might have truncated
5526 # identifiers in the presence of lots of templates. It has no effect
5527 # on program correctness and there's no real reason to waste time
5528 # trying to prevent it.
5531 # C4611: interaction between 'function' and C++ object destruction is
5533 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5534 # suggests using exceptions instead of setjmp/longjmp for C++, but
5535 # Chromium code compiles without exception support. We therefore have
5536 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5537 # means we have to turn off this warning (and be careful about how
5538 # object destruction happens in such cases).
5541 # TODO(maruel): These warnings are level 4. They will be slowly
5542 # removed as code is fixed.
5543 4100, # Unreferenced formal parameter
5544 4121, # Alignment of a member was sensitive to packing
5545 4244, # Conversion from 'type1' to 'type2', possible loss of data
5546 4481, # Nonstandard extension used: override specifier 'keyword'
5547 4505, # Unreferenced local function has been removed
5548 4510, # Default constructor could not be generated
5549 4512, # Assignment operator could not be generated
5550 4610, # Object can never be instantiated
5551 4996, # 'X': was declared deprecated (for GetVersionEx).
5553 # These are variable shadowing warnings that are new in VS2015. We
5554 # should work through these at some point -- they may be removed from
5555 # the RTM release in the /W4 set.
5556 4456, 4457, 4458, 4459,
5559 'VCCLCompilerTool': {
5560 'AdditionalOptions': ['/MP'],
5561 'MinimalRebuild': 'false',
5562 'BufferSecurityCheck': 'true',
5563 'EnableFunctionLevelLinking': 'true',
5564 'RuntimeTypeInfo': 'false',
5565 'WarningLevel': '4',
5566 'WarnAsError': 'true',
5567 'DebugInformationFormat': '3',
5568 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5569 'ExceptionHandling': '0',
5571 'VCLibrarianTool': {
5572 'AdditionalOptions': ['/ignore:4221'],
5573 'AdditionalLibraryDirectories': [
5574 '<(windows_sdk_path)/Lib/win8/um/x86',
5578 'AdditionalDependencies': [
5590 'AdditionalLibraryDirectories': [
5591 '<(windows_sdk_path)/Lib/win8/um/x86',
5593 'GenerateDebugInformation': 'true',
5594 'MapFileName': '$(OutDir)\\$(TargetName).map',
5595 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5596 'FixedBaseAddress': '1',
5599 # 1 == /SUBSYSTEM:CONSOLE
5600 # 2 == /SUBSYSTEM:WINDOWS
5601 # Most of the executables we'll ever create are tests
5602 # and utilities with console output.
5606 'GenerateStublessProxies': 'true',
5607 'TypeLibraryName': '$(InputName).tlb',
5608 'OutputDirectory': '$(IntDir)',
5609 'HeaderFileName': '$(InputName).h',
5610 'DLLDataFileName': '$(InputName).dlldata.c',
5611 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5612 'ProxyFileName': '$(InputName)_p.c',
5614 'VCResourceCompilerTool': {
5616 'AdditionalIncludeDirectories': [
5618 '<(SHARED_INTERMEDIATE_DIR)',
5621 'target_conditions': [
5622 ['_type=="executable"', {
5624 'EmbedManifest': 'true',
5627 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5629 'AdditionalManifestFiles': [
5630 '>(win_exe_compatibility_manifest)',
5636 # Building with Clang on Windows is a work in progress and very
5637 # experimental. See crbug.com/82385.
5639 'VCCLCompilerTool': {
5640 'AdditionalOptions': [
5641 '-fmsc-version=1800',
5643 # Many files use intrinsics without including this header.
5644 # TODO(hans): Fix those files, or move this to sub-GYPs.
5647 # TODO(hans): Make this list shorter eventually.
5648 '-Qunused-arguments',
5649 '-Wno-c++11-compat-deprecated-writable-strings',
5650 '-Wno-deprecated-declarations',
5652 '-Wno-enum-conversion',
5653 '-Wno-extra-tokens',
5654 '-Wno-ignored-attributes',
5655 '-Wno-incompatible-pointer-types',
5656 '-Wno-int-to-void-pointer-cast',
5657 '-Wno-invalid-noreturn',
5658 '-Wno-logical-op-parentheses',
5660 '-Wno-missing-braces',
5661 '-Wno-missing-declarations',
5662 '-Wno-msvc-include',
5663 '-Wno-null-dereference',
5664 '-Wno-overloaded-virtual',
5666 '-Wno-pointer-sign',
5668 '-Wno-return-type-c-linkage',
5670 '-Wno-sometimes-uninitialized',
5672 '-Wno-tautological-compare',
5673 '-Wno-unknown-pragmas',
5675 '-Wno-unused-function',
5676 '-Wno-unused-private-field',
5677 '-Wno-unused-value',
5678 '-Wno-unused-variable',
5679 '-Wno-unused-local-typedef', # http://crbug.com/411648
5680 '-Wno-inconsistent-missing-override', #http://crbug.com/428099
5684 ['clang==1 and target_arch=="ia32"', {
5685 'VCCLCompilerTool': {
5686 'WarnAsError': 'false',
5687 'AdditionalOptions': [
5692 ['clang==1 and clang_use_chrome_plugins==1', {
5693 'VCCLCompilerTool': {
5694 'AdditionalOptions': [
5695 '<@(clang_chrome_plugins_flags)',
5703 ['disable_nacl==1', {
5704 'target_defaults': {
5710 ['OS=="win" and msvs_use_common_linker_extras', {
5711 'target_defaults': {
5726 'AdditionalOptions': [
5737 'AdditionalOptions': ['/largeaddressaware'],
5741 # TODO(asan/win): Move this down into the general
5742 # win-target_defaults section once the 64-bit asan runtime
5743 # exists. See crbug.com/345874.
5744 'VCCLCompilerTool': {
5745 'AdditionalOptions': [
5746 '-fsanitize=address',
5747 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5749 'AdditionalIncludeDirectories': [
5750 # MSVC needs to be able to find the sanitizer headers when
5751 # invoked via /fallback. This is critical for using macros
5752 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5754 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/include_sanitizer',
5758 'AdditionalLibraryDirectories': [
5759 # TODO(hans): If make_clang_dir is absolute, this breaks.
5760 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/lib/windows',
5763 'target_conditions': [
5764 ['component=="shared_library"', {
5766 'AdditionalDependencies': [
5767 'clang_rt.asan_dynamic-i386.lib',
5768 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5772 ['_type=="executable" and component=="static_library"', {
5774 'AdditionalDependencies': [
5775 'clang_rt.asan-i386.lib',
5779 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5781 'AdditionalDependencies': [
5782 'clang_rt.asan_dll_thunk-i386.lib',
5788 ['sanitizer_coverage!=0', {
5789 # TODO(asan/win): Move this down into the general
5790 # win-target_defaults section once the 64-bit asan runtime
5791 # exists. See crbug.com/345874.
5792 'VCCLCompilerTool': {
5793 'AdditionalOptions': [
5794 '-fsanitize-coverage=<(sanitizer_coverage)',
5801 ['sanitizer_coverage!=0', {
5802 # TODO(asan/win): Move this down into the general
5803 # win-target_defaults section once the 64-bit asan runtime
5804 # exists. See crbug.com/345874.
5806 'SANITIZER_COVERAGE',
5814 'AdditionalOptions': [
5815 # safeseh is not compatible with x64
5827 ['enable_new_npdevice_api==1', {
5828 'target_defaults': {
5830 'ENABLE_NEW_NPDEVICE_API',
5834 # Don't warn about the "typedef 'foo' locally defined but not used"
5835 # for gcc 4.8 and higher.
5836 # TODO: remove this flag once all builds work. See crbug.com/227506
5837 ['gcc_version>=48 and clang==0', {
5838 'target_defaults': {
5840 '-Wno-unused-local-typedefs',
5844 ['gcc_version>=48 and clang==0 and host_clang==1', {
5845 'target_defaults': {
5846 'target_conditions': [
5847 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5851 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5853 'make_global_settings': [
5854 ['CC', '<(make_clang_dir)/bin/clang'],
5855 ['CXX', '<(make_clang_dir)/bin/clang++'],
5856 ['CC.host', '$(CC)'],
5857 ['CXX.host', '$(CXX)'],
5860 ['clang==1 and OS=="win"', {
5861 'make_global_settings': [
5862 # On Windows, gyp's ninja generator only looks at CC.
5863 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5866 ['use_lld==1 and OS=="win"', {
5867 'make_global_settings': [
5868 # Limited to Windows because lld-link is the driver that is compatible
5870 ['LD', '<(make_clang_dir)/bin/lld-link'],
5873 ['OS=="android" and clang==0', {
5874 # Hardcode the compiler names in the Makefile so that
5875 # it won't depend on the environment at make time.
5876 'make_global_settings': [
5877 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5878 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5879 ['CC.host', '<(host_cc)'],
5880 ['CXX.host', '<(host_cxx)'],
5883 ['OS=="linux" and target_arch=="mipsel"', {
5884 'make_global_settings': [
5885 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5886 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5887 ['CC.host', '<(host_cc)'],
5888 ['CXX.host', '<(host_cxx)'],
5891 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5892 # Set default ARM cross compiling on linux. These can be overridden
5893 # using CC/CXX/etc environment variables.
5894 'make_global_settings': [
5895 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5896 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5897 ['CC.host', '<(host_cc)'],
5898 ['CXX.host', '<(host_cxx)'],
5902 # TODO(yyanagisawa): supports GENERATOR==make
5903 # make generator doesn't support CC_wrapper without CC
5904 # in make_global_settings yet.
5905 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5906 'make_global_settings': [
5907 ['CC_wrapper', '<(gomadir)/gomacc'],
5908 ['CXX_wrapper', '<(gomadir)/gomacc'],
5909 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5910 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5914 'target_defaults': {
5915 'target_conditions': [
5916 ['_toolset=="target"', {
5924 # Work-around for http://openradar.appspot.com/20356002
5925 ['_toolset=="target" and _type!="static_library"', {
5935 ['use_lto==1 and clang==0', {
5936 'target_defaults': {
5937 'target_conditions': [
5938 ['_toolset=="target"', {
5940 '-ffat-lto-objects',
5946 ['use_lto==1 and clang==1', {
5947 'target_defaults': {
5948 'target_conditions': [
5949 ['_toolset=="target"', {
5951 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
5957 # Apply a lower LTO optimization level in non-official builds.
5958 ['use_lto==1 and clang==1 and buildtype!="Official"', {
5959 'target_defaults': {
5960 'target_conditions': [
5961 ['_toolset=="target"', {
5963 '-Wl,--plugin-opt,O1',
5966 ['_toolset=="target" and _type!="static_library"', {
5976 ['use_lto==1 and clang==1 and (target_arch=="ia32" or target_arch=="x64")', {
5977 'target_defaults': {
5978 'target_conditions': [
5979 # Required for third_party/zlib/crc_folding.c and various other code
5980 # that uses SSE. TODO(pcc): Remove this once we properly support
5981 # subtarget specific code generation in LLVM.
5982 ['_toolset=="target"', {
5984 '-Wl,-plugin-opt,mcpu=corei7-avx',
5987 ['_toolset=="target" and _type!="static_library"', {
5990 '-Wl,-mcpu,corei7-avx',
5997 ['use_lto==1 and clang==1 and target_arch=="arm"', {
5998 'target_defaults': {
5999 'target_conditions': [
6000 ['_toolset=="target"', {
6001 # Without this flag, LTO produces a .text section that is larger
6002 # than the maximum call displacement, preventing the linker from
6003 # relocating calls (http://llvm.org/PR22999).
6005 '-Wl,-plugin-opt,-function-sections',
6011 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
6012 'target_defaults': {
6013 'target_conditions': [
6014 ['_toolset=="target"', {
6022 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
6023 'target_defaults': {
6024 'target_conditions': [
6025 ['_toolset=="target"', {
6034 'target_defaults': {
6035 'target_conditions': [
6036 ['_toolset=="target"', {
6038 '-fsanitize=cfi-vptr',
6041 '-fsanitize=cfi-vptr',
6045 '-fsanitize=cfi-vptr',
6049 ['_toolset=="target" and _type!="static_library"', {
6052 '-fsanitize=cfi-vptr',
6059 ['cfi_derived_cast==1', {
6060 'target_defaults': {
6061 'target_conditions': [
6062 ['_toolset=="target"', {
6064 '-fsanitize=cfi-derived-cast',
6067 '-fsanitize=cfi-derived-cast',
6071 '-fsanitize=cfi-derived-cast',
6075 ['_toolset=="target" and _type!="static_library"', {
6078 '-fsanitize=cfi-derived-cast',
6085 ['cfi_unrelated_cast==1', {
6086 'target_defaults': {
6087 'target_conditions': [
6088 ['_toolset=="target"', {
6090 '-fsanitize=cfi-unrelated-cast',
6093 '-fsanitize=cfi-unrelated-cast',
6097 '-fsanitize=cfi-unrelated-cast',
6101 ['_toolset=="target" and _type!="static_library"', {
6104 '-fsanitize=cfi-unrelated-cast',
6111 ['cfi_vptr==1 or cfi_derived_cast==1 or cfi_unrelated_cast==1', {
6112 'target_defaults': {
6113 'target_conditions': [
6114 ['_toolset=="target"', {
6116 '-fsanitize-blacklist=<(cfi_blacklist)',
6120 '-fsanitize-blacklist=<(cfi_blacklist)',
6129 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
6130 # This block adds *project-wide* configuration settings to each project
6131 # file. It's almost always wrong to put things here. Specify your
6132 # custom xcode_settings in target_defaults to add them to targets instead.
6135 # In an Xcode Project Info window, the "Base SDK for All Configurations"
6136 # setting sets the SDK on a project-wide basis. In order to get the
6137 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
6138 # here at the project level.
6141 ['mac_sdk_path==""', {
6142 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
6144 'SDKROOT': '<(mac_sdk_path)', # -isysroot
6150 ['ios_sdk_path==""', {
6152 # TODO(justincohen): Ninja only supports simulator for now.
6153 ['"<(GENERATOR)"=="xcode"', {
6154 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6156 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
6160 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6165 # Target both iPhone and iPad.
6166 'TARGETED_DEVICE_FAMILY': '1,2',
6169 ['target_arch=="x64"', {
6174 ['target_arch=="ia32"', {
6183 # The Xcode generator will look for an xcode_settings section at the root
6184 # of each dict and use it to apply settings on a file-wide basis. Most
6185 # settings should not be here, they should be in target-specific
6186 # xcode_settings sections, or better yet, should use non-Xcode-specific
6187 # settings in target dicts. SYMROOT is a special case, because many other
6188 # Xcode variables depend on it, including variables such as
6189 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6190 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6191 # files to appear (when present) in the UI as actual files and not red
6192 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6193 # and therefore SYMROOT, needs to be set at the project level.
6194 'SYMROOT': '<(DEPTH)/xcodebuild',