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 # Typedef X509Certificate::OSCertHandle to OpenSSL's struct X509*.
74 'use_openssl_certs%': 0,
76 # Disable viewport meta tag by default.
77 'enable_viewport%': 0,
79 # Enable HiDPI support.
82 # Override buildtype to select the desired build flavor.
83 # Dev - everyday build for development/testing
84 # Official - release build (generally implies additional processing)
85 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
86 # conversion is done), some of the things which are now controlled by
87 # 'branding', such as symbol generation, will need to be refactored
88 # based on 'buildtype' (i.e. we don't care about saving symbols for
89 # non-Official # builds).
92 # Override branding to select the desired branding flavor.
93 'branding%': 'Chromium',
96 # ChromeOS and Windows use Aura and Ash.
97 ['chromeos==1 or OS=="win" or OS=="linux"', {
102 ['chromecast==1 and OS!="android"', {
112 # Whether we're a traditional desktop unix.
113 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
119 # Embedded implies ozone.
125 'target_arch%': 'arm',
127 # Default architecture we're building for is the architecture we're
128 # building on, and possibly sub-architecture (for iOS builds).
129 'target_arch%': '<(host_arch)',
133 # Copy conditionally-set variables out one scope.
134 'chromeos%': '<(chromeos)',
135 'chromecast%': '<(chromecast)',
136 'desktop_linux%': '<(desktop_linux)',
137 'use_aura%': '<(use_aura)',
138 'use_ash%': '<(use_ash)',
139 'use_cras%': '<(use_cras)',
140 'use_ozone%': '<(use_ozone)',
141 'embedded%': '<(embedded)',
142 'use_libpci%': '<(use_libpci)',
143 'use_openssl%': '<(use_openssl)',
144 'use_openssl_certs%': '<(use_openssl_certs)',
145 'enable_viewport%': '<(enable_viewport)',
146 'enable_hidpi%': '<(enable_hidpi)',
147 'buildtype%': '<(buildtype)',
148 'branding%': '<(branding)',
149 'host_arch%': '<(host_arch)',
150 'target_arch%': '<(target_arch)',
152 'target_subarch%': '',
154 # The channel to build on Android: stable, beta, dev, canary, or
155 # default. "default" should be used on non-official builds.
156 'android_channel%': 'default',
158 # WebView now builds in a normal android build; don't use this.
159 # TODO(torne): remove this. http://crbug.com/440793
160 'android_webview_build%': 0,
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.
178 # The system libdir used for this ABI.
179 'system_libdir%': 'lib',
181 # Default MIPS arch variant. This is set in the conditions block
182 # below for MIPS targets.
183 'mips_arch_variant%': '',
185 # MIPS DSP ASE revision. Possible values are:
197 # Set default value of toolkit_views based on OS.
198 ['OS=="mac" or OS=="win" or chromeos==1 or use_aura==1', {
204 # Embedded builds use aura without ash or views.
211 # Enable HiDPI on Mac OS, Chrome OS, Windows and Linux.
212 ['OS=="mac" or chromeos==1 or OS=="win" or OS=="linux"', {
216 # Enable the OpenSSL backend on Mac OS and Windows.
217 ['OS=="mac" or OS=="win"', {
221 # Enable App Launcher everywhere but mobile.
222 ['OS!="ios" and OS!="android"', {
223 'enable_app_list%': 1,
225 'enable_app_list%': 0,
228 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
229 'use_default_render_theme%': 1,
231 'use_default_render_theme%': 0,
235 'use_ozone_evdev%': 1,
237 'use_ozone_evdev%': 0,
240 # Set default gomadir.
242 'gomadir': 'c:\\goma\\goma-win',
244 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
247 # Set the default "target_subarch" on iOS. Valid values are "arm32",
248 # "arm64" and "both" (meaning a fat binary).
250 'target_subarch%': 'arm64',
253 # Set arch variants for MIPS platforms.
254 ['target_arch=="mips64el"', {
257 'mips_arch_variant%': 'r6',
259 'mips_arch_variant%': 'r2',
264 ['target_arch=="mipsel"', {
265 'mips_arch_variant%': 'r1',
270 # Copy conditionally-set variables out one scope.
271 'chromeos%': '<(chromeos)',
272 'chromecast%': '<(chromecast)',
273 'host_arch%': '<(host_arch)',
274 'target_arch%': '<(target_arch)',
275 'target_subarch%': '<(target_subarch)',
276 'mips_arch_variant%': '<(mips_arch_variant)',
277 'mips_dsp_rev%': '<(mips_dsp_rev)',
278 'toolkit_views%': '<(toolkit_views)',
279 'desktop_linux%': '<(desktop_linux)',
280 'use_aura%': '<(use_aura)',
281 'use_ash%': '<(use_ash)',
282 'use_cras%': '<(use_cras)',
283 'use_libpci%': '<(use_libpci)',
284 'use_ozone%': '<(use_ozone)',
285 'use_ozone_evdev%': '<(use_ozone_evdev)',
286 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
287 'embedded%': '<(embedded)',
288 'use_openssl%': '<(use_openssl)',
289 'use_openssl_certs%': '<(use_openssl_certs)',
290 'enable_viewport%': '<(enable_viewport)',
291 'enable_hidpi%': '<(enable_hidpi)',
292 'android_channel%': '<(android_channel)',
293 'android_webview_build%': '<(android_webview_build)',
294 'use_goma%': '<(use_goma)',
295 'gomadir%': '<(gomadir)',
296 'enable_app_list%': '<(enable_app_list)',
297 'use_default_render_theme%': '<(use_default_render_theme)',
298 'buildtype%': '<(buildtype)',
299 'branding%': '<(branding)',
300 'arm_version%': '<(arm_version)',
301 'sysroot%': '<(sysroot)',
302 'chroot_cmd%': '<(chroot_cmd)',
303 'system_libdir%': '<(system_libdir)',
305 # Set to 1 to enable fast builds. Set to 2 for even faster builds
306 # (it disables debug info for fastest compilation - only for use
307 # on compile-only bots).
310 # Set to 1 to not store any build metadata, e.g. ifdef out all __DATE__
311 # and __TIME__. Set to 0 to reenable the use of these macros in the code
312 # base. See http://crbug.com/314403.
313 'dont_embed_build_metadata%': 1,
315 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
316 # This is useful for parallel compilation tools which can't support /Zi.
317 # Only used on Windows.
320 # Set to 1 to enable dcheck in Release build.
321 'dcheck_always_on%': 0,
323 # Set to 1 to make a build that disables unshipped tracing events.
324 # Note: this setting is ignored if buildtype=="Official".
325 'tracing_like_official_build%': 0,
327 # Disable image loader component extension by default.
328 'image_loader_extension%': 0,
330 # Set NEON compilation flags.
333 # Detect NEON support at run-time.
334 'arm_neon_optional%': 0,
336 # Use libjpeg-turbo as the JPEG codec used by Chromium.
337 'use_libjpeg_turbo%': 1,
339 # Use system libjpeg. Note that the system's libjepg will be used even if
340 # use_libjpeg_turbo is set.
341 'use_system_libjpeg%': 0,
343 # By default, component is set to static_library and it can be overriden
344 # by the GYP command line or by ~/.gyp/include.gypi.
345 'component%': 'static_library',
347 # /analyze is off by default on Windows because it is very slow and noisy.
348 # Enable with GYP_DEFINES=win_analyze=1
351 # Set to select the Title Case versions of strings in GRD files.
352 'use_titlecase_in_grd%': 0,
354 # Use translations provided by volunteers at launchpad.net. This
355 # currently only works on Linux.
356 'use_third_party_translations%': 0,
358 # Remoting compilation is enabled by default. Set to 0 to disable.
361 # Configuration policy is enabled by default. Set to 0 to disable.
362 'configuration_policy%': 1,
364 # Variable safe_browsing is used to control the build time configuration
365 # for safe browsing feature. Safe browsing can be compiled in 3 different
366 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
367 # reporting features without enabling phishing and malware detection. This
368 # is useful to integrate a third party phishing/malware detection to
369 # existing safe browsing logic.
372 # Web speech is enabled by default. Set to 0 to disable.
373 'enable_web_speech%': 1,
375 # Notifications are compiled in by default. Set to 0 to disable.
376 'notifications%' : 1,
378 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
379 # regular builds and 1 for ASan builds.
380 'mac_want_real_dsym%': 'default',
382 # If this is set, the clang plugins used on the buildbot will be used.
383 # Run tools/clang/scripts/update.sh to make sure they are compiled.
384 # This causes 'clang_chrome_plugins_flags' to be set.
385 # Has no effect if 'clang' is not set as well.
386 'clang_use_chrome_plugins%': 1,
388 # Enable building with ASAN (Clang's -fsanitize=address option).
389 # -fsanitize=address only works with clang, but asan=1 implies clang=1
390 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
392 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
393 # Enable coverage gathering instrumentation in sanitizer tools. This flag
394 # also controls coverage granularity (1 for function-level coverage, 2
395 # for block-level coverage).
396 'sanitizer_coverage%': 0,
397 # Deprecated, only works if |sanitizer_coverage| isn't set.
398 # TODO(glider): remove this flag.
400 # Enable intra-object-overflow detection in ASan (experimental).
401 'asan_field_padding%': 0,
403 # Enable Chromium overrides of the default configurations for various
404 # dynamic tools (like ASan).
405 'use_sanitizer_options%': 0,
407 # Enable building with SyzyAsan.
408 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
411 # Enable crash reporting via Kasko.
414 # Enable building with LSan (Clang's -fsanitize=leak option).
415 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
416 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
419 # Enable building with TSan (Clang's -fsanitize=thread option).
420 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
421 # See http://clang.llvm.org/docs/ThreadSanitizer.html
423 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
425 # Enable building with MSan (Clang's -fsanitize=memory option).
426 # MemorySanitizer only works with clang, but msan=1 implies clang=1
427 # See http://clang.llvm.org/docs/MemorySanitizer.html
429 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
430 # Track where uninitialized memory originates from. From fastest to
431 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
432 # - track the chain of stores leading from allocation site to use site.
433 'msan_track_origins%': 2,
435 # Enable building with UBSan (Clang's -fsanitize=undefined option).
436 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
437 # See http://clang.llvm.org/docs/UsersManual.html
439 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
441 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
442 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
445 # Use dynamic libraries instrumented by one of the sanitizers
446 # instead of the standard system libraries. Set this flag to build the
447 # libraries from source.
448 'use_instrumented_libraries%': 0,
450 # Use dynamic libraries instrumented by one of the sanitizers
451 # instead of the standard system libraries. Set this flag to download
452 # prebuilt binaries from GCS.
453 'use_prebuilt_instrumented_libraries%': 0,
455 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
456 # stdlibc++ as standard library. This is intended to use for instrumented
458 'use_custom_libcxx%': 0,
460 # Use system libc++ instead of the default C++ library, usually libstdc++.
461 # This is intended for iOS builds only.
462 'use_system_libcxx%': 0,
464 # Use a modified version of Clang to intercept allocated types and sizes
465 # for allocated objects. clang_type_profiler=1 implies clang=1.
466 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
467 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
468 'clang_type_profiler%': 0,
470 # Set to true to instrument the code with function call logger.
471 # See src/third_party/cygprofile/cyg-profile.cc for details.
472 'order_profiling%': 0,
474 # Use the provided profiled order file to link Chrome image with it.
475 # This makes Chrome faster by better using CPU cache when executing code.
476 # This is known as PGO (profile guided optimization).
477 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
478 'order_text_section%' : "",
480 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
481 # libraries on linux x86-64 and arm, plus ASLR.
484 # Whether one-click signin is enabled or not.
485 'enable_one_click_signin%': 0,
487 # Whether to back up data before sync.
488 'enable_pre_sync_backup%': 0,
490 # Enable Chrome browser extensions
491 'enable_extensions%': 1,
494 'enable_google_now%': 1,
496 # Enable basic printing support and UI.
497 'enable_basic_printing%': 1,
499 # Enable printing with print preview. It does not imply
500 # enable_basic_printing. It's possible to build Chrome with preview only.
501 'enable_print_preview%': 1,
503 # Set the version of CLD.
504 # 0: Don't specify the version. This option is for the Finch testing.
509 # For CLD2, the size of the tables that should be included in the build
510 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
512 # See third_party/cld_2/cld_2.gyp for more information.
513 # 0: Small tables, lower accuracy
514 # 2: Large tables, high accuracy
515 'cld2_table_size%': 2,
517 # Enable spell checker.
518 'enable_spellcheck%': 1,
520 # Webrtc compilation is enabled by default. Set to 0 to disable.
523 # Media router support is enabled by default. Set to 0 to disable.
524 'enable_media_router%': 1,
526 # Enables use of the session service, which is enabled by default.
527 # Support for disabling depends on the platform.
528 'enable_session_service%': 1,
530 # Enables theme support, which is enabled by default. Support for
531 # disabling depends on the platform.
534 # Enables autofill dialog and associated features; disabled by default.
535 'enable_autofill_dialog%' : 0,
537 # Defaults Wallet integration in Autofill dialog to use production
538 # servers. Unofficial builds won't have the proper API keys.
539 'enable_prod_wallet_service%': 0,
541 # Enables support for background apps.
542 'enable_background%': 1,
544 # Enable the task manager by default.
545 'enable_task_manager%': 1,
547 # Enables used resource whitelist generation; disabled by default.
548 'enable_resource_whitelist_generation%': 0,
550 # Enable FILE support by default.
551 'disable_file_support%': 0,
553 # Enable FTP support by default.
554 'disable_ftp_support%': 0,
556 # Use native android functions in place of ICU. Not supported by most
558 'use_icu_alternatives_on_android%': 0,
560 # Use of precompiled headers on Windows.
562 # This variable may be explicitly set to 1 (enabled) or 0
563 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
564 # This setting will override the default.
567 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
569 'chromium_win_pch%': 0,
572 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
573 # Set this to true when building with Clang.
574 # See http://code.google.com/p/chromium/wiki/Clang for details.
575 # If this is set, clang is used as both host and target compiler in
576 # cross-compile builds.
579 # Use experimental lld linker instead of the platform's default linker.
582 # Enable plugin installation by default.
583 'enable_plugin_installation%': 1,
585 # Specifies whether to use canvas_skia.cc in place of platform
586 # specific implementations of gfx::Canvas. Affects text drawing in the
588 # TODO(asvitkine): Enable this on all platforms and delete this flag.
589 # http://crbug.com/105550
590 'use_canvas_skia%': 0,
592 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
593 # with one of those tools.
594 'build_for_tool%': '',
596 # If no directory is specified then a temporary directory will be used.
597 'test_isolation_outdir%': '',
599 'wix_path%': '<(DEPTH)/third_party/wix',
601 # Supervised users are enabled by default.
602 'enable_supervised_users%': 1,
604 # Platform sends memory pressure signals natively.
605 'native_memory_pressure_signals%': 0,
607 'spdy_proxy_auth_property%' : '',
608 'spdy_proxy_auth_value%' : '',
610 'enable_service_discovery%': 0,
611 'enable_wifi_bootstrapping%': 0,
612 'enable_hangout_services_extension%': 0,
614 # Enable the Syzygy optimization step.
615 'syzygy_optimize%': 0,
617 # Enable hole punching for the protected video.
620 # Automatically select platforms under ozone. Turn this off to
621 # build only explicitly selected platforms.
622 'ozone_auto_platforms%': 1,
624 # If this is set clang is used as host compiler, but not as target
625 # compiler. Always do this by default.
628 # Variables to control Link-Time Optimization (LTO).
629 # On Android, the variable use_lto enables LTO on code compiled with -Os,
630 # and use_lto_o2 enables LTO on code compiled with -O2. On other
631 # platforms, use_lto enables LTO in all translation units, and use_lto_o2
634 # On Linux and Android, when using LLVM LTO, the script
635 # build/download_gold_plugin.py must be run to download a linker plugin.
636 # On Mac, LLVM needs to be built from scratch using
637 # tools/clang/scripts/update.py and the absolute path to
638 # third_party/llvm-build/Release+Asserts/lib must be added to
639 # $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin.
641 # On Android, the variables must *not* be enabled at the same time.
642 # In this case LTO would 'merge' the optimization flags at link-time
643 # which would lead to all code be optimized with -O2. See crbug.com/407544
647 # Allowed level of identical code folding in the gold linker.
648 'gold_icf_level%': 'safe',
650 # Libxkbcommon usage.
653 # Control Flow Integrity for virtual calls.
654 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
657 # Control Flow Integrity for casts.
658 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
659 'cfi_derived_cast%': 0,
660 'cfi_unrelated_cast%': 0,
662 'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
664 # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
665 'mac_views_browser%': 0,
668 # A flag for POSIX platforms
675 # A flag for BSD platforms
676 ['OS=="freebsd" or OS=="openbsd"', {
683 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
689 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
690 # OpenSSL's certificate definition.
691 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
692 'use_openssl_certs%': 1,
694 'use_openssl_certs%': 0,
697 # libudev usage. This currently only affects the content layer.
698 ['OS=="linux" and embedded==0', {
704 # Flags to use X11 on non-Mac POSIX platforms.
705 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
712 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
718 # Flags to use pango and cairo.
719 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
728 ['OS=="linux" and embedded==0', {
734 # We always use skia text rendering in Aura on Windows, since GDI
735 # doesn't agree with our BackingStore.
736 # TODO(beng): remove once skia text rendering is on by default.
737 ['use_aura==1 and OS=="win"', {
738 'enable_skia_text%': 1,
741 # A flag to enable or disable our compile-time dependency
742 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
743 # support will be available. This option is useful
744 # for Linux distributions and for Aura.
745 ['OS!="linux" or chromeos==1', {
746 'use_gnome_keyring%': 0,
748 'use_gnome_keyring%': 1,
751 ['OS=="mac" or OS=="ios"', {
752 # Mac and iOS want Title Case strings
753 'use_titlecase_in_grd%': 1,
756 # Enable loader extensions on Chrome OS.
758 'image_loader_extension%': 1,
760 'image_loader_extension%': 0,
763 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
764 'enable_one_click_signin%': 1,
765 'enable_pre_sync_backup%': 1,
769 'enable_extensions%': 0,
770 'enable_google_now%': 0,
772 'enable_spellcheck%': 0,
776 'arm_neon_optional%': 1,
777 'native_memory_pressure_signals%': 1,
778 'enable_basic_printing%': 1,
779 'enable_print_preview%': 0,
780 'enable_task_manager%':0,
784 # Android OS includes support for proprietary codecs regardless of
785 # building Chromium or Google Chrome. We also ship Google Chrome and
786 # Chromecast with proprietary codecs.
787 ['OS=="android" or branding=="Chrome" or chromecast==1', {
788 'proprietary_codecs%': 1,
790 'proprietary_codecs%': 0,
793 ['OS=="mac" or OS=="ios"', {
794 'native_memory_pressure_signals%': 1,
797 # Enable autofill dialog when not on iOS.
799 'enable_autofill_dialog%': 1,
802 ['buildtype=="Official"', {
803 'enable_prod_wallet_service%': 1,
813 'disable_ftp_support%': 1,
814 'enable_extensions%': 0,
815 'enable_google_now%': 0,
817 'cld2_table_size%': 0,
818 'enable_basic_printing%': 0,
819 'enable_print_preview%': 0,
820 'enable_session_service%': 0,
821 'enable_spellcheck%': 0,
827 'enable_supervised_users%': 0,
828 'enable_task_manager%': 0,
829 'use_system_libcxx%': 1,
832 # Use GPU accelerated cross process image transport by default
833 # on linux builds with the Aura window manager
834 ['use_aura==1 and OS=="linux"', {
835 'ui_compositor_image_transport%': 1,
837 'ui_compositor_image_transport%': 0,
840 # Turn precompiled headers on by default.
841 ['OS=="win" and buildtype!="Official"', {
842 'chromium_win_pch%': 1
845 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
846 'enable_plugin_installation%': 0,
848 'enable_plugin_installation%': 1,
851 # Whether PPAPI is enabled.
852 ['OS=="android" or OS=="ios" or embedded==1', {
853 'enable_plugins%': 0,
855 'enable_plugins%': 1,
858 # linux_use_bundled_gold: whether to use the gold linker binary checked
859 # into third_party/binutils. Force this off via GYP_DEFINES when you
860 # are using a custom toolchain and need to control -B in ldflags.
861 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
862 # for component=static_library builds.
863 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
864 'linux_use_bundled_gold%': 1,
866 'linux_use_bundled_gold%': 0,
869 # linux_use_bundled_binutils: whether to use the binary binutils
870 # checked into third_party/binutils. These are not multi-arch so cannot
871 # be used except on x86 and x86-64 (the only two architectures which
872 # are currently checke in). Force this off via GYP_DEFINES when you
873 # are using a custom toolchain and need to control -B in cflags.
874 ['OS=="linux" and (target_arch=="x64")', {
875 'linux_use_bundled_binutils%': 1,
877 'linux_use_bundled_binutils%': 0,
880 # linux_use_gold_flags: whether to use build flags that rely on gold.
881 # On by default for x64 Linux.
882 ['OS=="linux" and target_arch=="x64"', {
883 'linux_use_gold_flags%': 1,
885 'linux_use_gold_flags%': 0,
888 # linux_use_debug_fission: whether to use split DWARF debug info
889 # files. This can reduce link time significantly, but is incompatible
890 # with some utilities such as icecc and ccache. Requires gold and
891 # gcc >= 4.8 or clang.
892 # http://gcc.gnu.org/wiki/DebugFission
893 ['OS=="linux" and target_arch=="x64"', {
894 'linux_use_debug_fission%': 1,
896 'linux_use_debug_fission%': 0,
899 ['OS=="android" or OS=="ios"', {
900 'enable_captive_portal_detection%': 0,
901 'enable_media_router%': 0,
903 'enable_captive_portal_detection%': 1,
904 'enable_media_router%': 1,
907 # Enable Skia UI text drawing incrementally on different platforms.
908 # http://crbug.com/105550
910 # On Aura, this allows per-tile painting to be used in the browser
912 ['OS!="android" and OS!="ios"', {
913 'use_canvas_skia%': 1,
917 'enable_basic_printing%': 0,
918 'enable_print_preview%': 1,
919 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
920 'use_libjpeg_turbo%': 0,
923 # Do not enable the Settings App on ChromeOS.
924 ['enable_app_list==1 and chromeos==0', {
925 'enable_settings_app%': 1,
927 'enable_settings_app%': 0,
930 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
931 # Set some defaults for arm/linux chrome builds
932 'use_allocator%': 'none',
933 # sysroot needs to be an absolute path otherwise it generates
934 # incorrect results when passed to pkg-config
935 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot',
936 }], # OS=="linux" and target_arch=="arm" and chromeos==0
938 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
940 ['target_arch=="x64"', {
941 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
943 ['target_arch=="ia32"', {
944 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
947 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
949 ['OS=="linux" and target_arch=="mipsel"', {
950 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
951 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
954 # Whether tests targets should be run, archived or just have the
955 # dependencies verified. All the tests targets have the '_run' suffix,
956 # e.g. base_unittests_run runs the target base_unittests. The test
957 # target always calls tools/swarming_client/isolate.py. See the script's
958 # --help for more information. Meant to be overriden with GYP_DEFINES.
959 # TODO(maruel): Remove the conditions as more configurations are
961 ['OS!="ios" and OS!="android" and chromeos==0', {
962 'test_isolation_mode%': 'check',
964 'test_isolation_mode%': 'noop',
966 # Whether Android build uses OpenMAX DL FFT.
967 ['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")', {
968 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
969 # When enabled, this will also enable WebAudio support on
970 # Android for these architectures. Default is enabled. Whether
971 # WebAudio is actually available depends on runtime settings
973 'use_openmax_dl_fft%': 1,
975 'use_openmax_dl_fft%': 0,
977 ['OS=="win" or OS=="linux"', {
981 # Turns on compiler optimizations in V8 in Debug build, except
982 # on android_clang, where we're hitting a weird linker error.
983 # TODO(dpranke): http://crbug.com/266155 .
985 'v8_optimized_debug%': 1,
987 'v8_optimized_debug%': 2,
990 # Disable various features by default on embedded.
993 'enable_basic_printing%': 0,
994 'enable_print_preview%': 0,
997 # By default, use ICU data file (icudtl.dat) on all platforms
998 # except when building Android WebView.
999 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
1000 # Set the data reduction proxy origin for Android Webview.
1001 ['android_webview_build==0', {
1002 'icu_use_data_file_flag%' : 1,
1004 'icu_use_data_file_flag%' : 0,
1006 ['OS=="win" or OS=="mac"', {
1007 'enable_wifi_bootstrapping%' : 1,
1010 # Path to sas.dll, which provides the SendSAS function.
1011 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1012 ['target_arch=="x64"', {
1013 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1015 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1018 # Turn on JNI generation optimizations on non-WebView builds.
1019 ['OS=="android" and android_webview_build==0', {
1020 'optimize_jni_generation%': 1,
1022 'optimize_jni_generation%': 0,
1025 # TODO(rmcilroy): Remove ios check. http://crbug.com/421063.
1027 'v8_use_external_startup_data%': 1,
1029 'v8_use_external_startup_data%': 0,
1033 # Set this to 1 to enable use of concatenated impulse responses
1034 # for the HRTF panner in WebAudio.
1035 'use_concatenated_impulse_responses': 1,
1037 # You can set the variable 'use_official_google_api_keys' to 1
1038 # to use the Google-internal file containing official API keys
1039 # for Google Chrome even in a developer build. Setting this
1040 # variable explicitly to 1 will cause your build to fail if the
1041 # internal file is missing.
1043 # The variable is documented here, but not handled in this file;
1044 # see //google_apis/determine_use_official_keys.gypi for the
1047 # Set the variable to 0 to not use the internal file, even when
1048 # it exists in your checkout.
1050 # Leave it unset in your include.gypi to have the variable
1051 # implicitly set to 1 if you have
1052 # src/google_apis/internal/google_chrome_api_keys.h in your
1053 # checkout, and implicitly set to 0 if not.
1055 # Note that official builds always behave as if the variable
1056 # was explicitly set to 1, i.e. they always use official keys,
1057 # and will fail to build if the internal file is missing.
1059 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1060 # include.gypi or by other means. Due to subtleties of GYP, this
1061 # is not the same as leaving the variable unset, even though its
1063 # //google_apis/determine_use_official_keys.gypi is 2.
1065 # Set these to bake the specified API keys and OAuth client
1066 # IDs/secrets into your build.
1068 # If you create a build without values baked in, you can instead
1069 # set environment variables to provide the keys at runtime (see
1070 # src/google_apis/google_api_keys.h for details). Features that
1071 # require server-side APIs may fail to work if no keys are
1074 # Note that if you are building an official build or if
1075 # use_official_google_api_keys has been set to 1 (explicitly or
1076 # implicitly), these values will be ignored and the official
1077 # keys will be used instead.
1078 'google_api_key%': '',
1079 'google_default_client_id%': '',
1080 'google_default_client_secret%': '',
1081 # Native Client is enabled by default.
1082 'disable_nacl%': '0',
1084 # Sets the default version name and code for Android app, by default we
1085 # do a developer build.
1086 'android_app_version_name%': 'Developer Build',
1087 'android_app_version_code%': 1,
1090 # Copy conditionally-set variables out one scope.
1091 'branding%': '<(branding)',
1092 'buildtype%': '<(buildtype)',
1093 'target_arch%': '<(target_arch)',
1094 'target_subarch%': '<(target_subarch)',
1095 'mips_arch_variant%': '<(mips_arch_variant)',
1096 'mips_dsp_rev%': '<(mips_dsp_rev)',
1097 'host_arch%': '<(host_arch)',
1098 'toolkit_views%': '<(toolkit_views)',
1099 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1100 'use_aura%': '<(use_aura)',
1101 'use_ash%': '<(use_ash)',
1102 'use_cras%': '<(use_cras)',
1103 'use_libpci%': '<(use_libpci)',
1104 'use_openssl%': '<(use_openssl)',
1105 'use_openssl_certs%': '<(use_openssl_certs)',
1106 'use_nss%': '<(use_nss)',
1107 'use_udev%': '<(use_udev)',
1108 'os_bsd%': '<(os_bsd)',
1109 'os_posix%': '<(os_posix)',
1110 'use_dbus%': '<(use_dbus)',
1111 'use_glib%': '<(use_glib)',
1112 'use_pango%': '<(use_pango)',
1113 'use_cairo%': '<(use_cairo)',
1114 'use_ozone%': '<(use_ozone)',
1115 'use_ozone_evdev%': '<(use_ozone_evdev)',
1116 'use_xkbcommon%': '<(use_xkbcommon)',
1117 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1118 'desktop_linux%': '<(desktop_linux)',
1119 'use_x11%': '<(use_x11)',
1120 'use_gnome_keyring%': '<(use_gnome_keyring)',
1121 'linux_fpic%': '<(linux_fpic)',
1122 'chromeos%': '<(chromeos)',
1123 'chromecast%': '<(chromecast)',
1124 'enable_viewport%': '<(enable_viewport)',
1125 'enable_hidpi%': '<(enable_hidpi)',
1126 'image_loader_extension%': '<(image_loader_extension)',
1127 'fastbuild%': '<(fastbuild)',
1128 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1129 'win_z7%': '<(win_z7)',
1130 'dcheck_always_on%': '<(dcheck_always_on)',
1131 'tracing_like_official_build%': '<(tracing_like_official_build)',
1132 'arm_version%': '<(arm_version)',
1133 'arm_neon%': '<(arm_neon)',
1134 'arm_neon_optional%': '<(arm_neon_optional)',
1135 'sysroot%': '<(sysroot)',
1136 'chroot_cmd%': '<(chroot_cmd)',
1137 'system_libdir%': '<(system_libdir)',
1138 'component%': '<(component)',
1139 'win_analyze%': '<(win_analyze)',
1140 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1141 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1142 'use_third_party_translations%': '<(use_third_party_translations)',
1143 'remoting%': '<(remoting)',
1144 'enable_one_click_signin%': '<(enable_one_click_signin)',
1145 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1146 'enable_media_router%': '<(enable_media_router)',
1147 'enable_webrtc%': '<(enable_webrtc)',
1148 'chromium_win_pch%': '<(chromium_win_pch)',
1149 'configuration_policy%': '<(configuration_policy)',
1150 'safe_browsing%': '<(safe_browsing)',
1151 'enable_web_speech%': '<(enable_web_speech)',
1152 'notifications%': '<(notifications)',
1153 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1154 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1156 'asan_blacklist%': '<(asan_blacklist)',
1157 'asan_coverage%': '<(asan_coverage)',
1158 'sanitizer_coverage%': '<(sanitizer_coverage)',
1159 'asan_field_padding%': '<(asan_field_padding)',
1160 'use_sanitizer_options%': '<(use_sanitizer_options)',
1161 'syzyasan%': '<(syzyasan)',
1162 'kasko%': '<(kasko)',
1163 'syzygy_optimize%': '<(syzygy_optimize)',
1166 'msan_blacklist%': '<(msan_blacklist)',
1167 'msan_track_origins%': '<(msan_track_origins)',
1169 'tsan_blacklist%': '<(tsan_blacklist)',
1170 'ubsan%': '<(ubsan)',
1171 'ubsan_blacklist%': '<(ubsan_blacklist)',
1172 'ubsan_vptr%': '<(ubsan_vptr)',
1173 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1174 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
1175 'use_custom_libcxx%': '<(use_custom_libcxx)',
1176 'use_system_libcxx%': '<(use_system_libcxx)',
1177 'clang_type_profiler%': '<(clang_type_profiler)',
1178 'order_profiling%': '<(order_profiling)',
1179 'order_text_section%': '<(order_text_section)',
1180 'enable_extensions%': '<(enable_extensions)',
1181 'enable_plugin_installation%': '<(enable_plugin_installation)',
1182 'enable_plugins%': '<(enable_plugins)',
1183 'enable_session_service%': '<(enable_session_service)',
1184 'enable_themes%': '<(enable_themes)',
1185 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1186 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1187 'enable_background%': '<(enable_background)',
1188 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1189 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1190 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1191 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1192 'use_canvas_skia%': '<(use_canvas_skia)',
1193 'test_isolation_mode%': '<(test_isolation_mode)',
1194 'test_isolation_outdir%': '<(test_isolation_outdir)',
1195 'enable_basic_printing%': '<(enable_basic_printing)',
1196 'enable_print_preview%': '<(enable_print_preview)',
1197 'enable_spellcheck%': '<(enable_spellcheck)',
1198 'enable_google_now%': '<(enable_google_now)',
1199 'cld_version%': '<(cld_version)',
1200 'cld2_table_size%': '<(cld2_table_size)',
1201 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1202 'disable_file_support%': '<(disable_file_support)',
1203 'disable_ftp_support%': '<(disable_ftp_support)',
1204 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1205 'enable_task_manager%': '<(enable_task_manager)',
1206 'sas_dll_path%': '<(sas_dll_path)',
1207 'wix_path%': '<(wix_path)',
1208 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1209 'use_system_libjpeg%': '<(use_system_libjpeg)',
1210 'android_channel%': '<(android_channel)',
1211 'android_webview_build%': '<(android_webview_build)',
1212 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1213 'gyp_managed_install%': 0,
1214 'create_standalone_apk%': 1,
1215 'enable_app_list%': '<(enable_app_list)',
1216 'use_default_render_theme%': '<(use_default_render_theme)',
1217 'enable_settings_app%': '<(enable_settings_app)',
1218 'google_api_key%': '<(google_api_key)',
1219 'google_default_client_id%': '<(google_default_client_id)',
1220 'google_default_client_secret%': '<(google_default_client_secret)',
1221 'enable_supervised_users%': '<(enable_supervised_users)',
1222 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1223 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1224 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1225 'enable_mdns%' : '<(enable_mdns)',
1226 'enable_service_discovery%' : '<(enable_service_discovery)',
1227 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1228 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1229 'v8_optimized_debug%': '<(v8_optimized_debug)',
1230 'proprietary_codecs%': '<(proprietary_codecs)',
1231 'use_goma%': '<(use_goma)',
1232 'gomadir%': '<(gomadir)',
1233 'use_lto%': '<(use_lto)',
1234 'use_lto_o2%': '<(use_lto_o2)',
1235 'gold_icf_level%': '<(gold_icf_level)',
1236 'video_hole%': '<(video_hole)',
1237 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1238 'cfi_vptr%': '<(cfi_vptr)',
1239 'cfi_derived_cast%': '<(cfi_derived_cast)',
1240 'cfi_unrelated_cast%': '<(cfi_unrelated_cast)',
1241 'cfi_blacklist%': '<(cfi_blacklist)',
1242 'mac_views_browser%': '<(mac_views_browser)',
1243 'android_app_version_name%': '<(android_app_version_name)',
1244 'android_app_version_code%': '<(android_app_version_code)',
1246 # Use system protobuf instead of bundled one.
1247 'use_system_protobuf%': 0,
1249 # Use system yasm instead of bundled one.
1250 'use_system_yasm%': 0,
1252 # Use system ICU instead of bundled one.
1253 'use_system_icu%' : 0,
1255 # Default to enabled PIE; this is important for ASLR but we may need to be
1256 # able to turn it off for various reasons.
1257 'linux_disable_pie%': 0,
1259 # The release channel that this build targets. This is used to restrict
1260 # channel-specific build options, like which installer packages to create.
1261 # The default is 'all', which does no channel-specific filtering.
1264 # Override chromium_mac_pch and set it to 0 to suppress the use of
1265 # precompiled headers on the Mac. Prefix header injection may still be
1266 # used, but prefix headers will not be precompiled. This is useful when
1267 # using distcc to distribute a build to compile slaves that don't
1268 # share the same compiler executable as the system driving the compilation,
1269 # because precompiled headers rely on pointers into a specific compiler
1270 # executable's image. Setting this to 0 is needed to use an experimental
1271 # Linux-Mac cross compiler distcc farm.
1272 'chromium_mac_pch%': 1,
1274 # The default value for mac_strip in target_defaults. This cannot be
1275 # set there, per the comment about variable% in a target_defaults.
1276 'mac_strip_release%': 0,
1278 # Set to 1 to enable java code coverage. Instruments classes during build
1279 # to produce .ec files during runtime.
1280 'emma_coverage%': 0,
1282 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1283 # separated with whitespace and/or comma. Only has effect if
1284 # 'emma_coverage=1'.
1287 # Set to 1 to enable running Android lint on java/class files.
1290 # Although base/allocator lets you select a heap library via an
1291 # environment variable, the libcmt shim it uses sometimes gets in
1292 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1293 # 'win_use_allocator_shim': 0,
1294 # 'win_release_RuntimeLibrary': 2
1295 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1296 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1298 # TODO(bradnelson): eliminate this when possible.
1299 # To allow local gyp files to prevent release.vsprops from being included.
1300 # Yes(1) means include release.vsprops.
1301 # Once all vsprops settings are migrated into gyp, this can go away.
1302 'msvs_use_common_release%': 1,
1304 # TODO(bradnelson): eliminate this when possible.
1305 # To allow local gyp files to override additional linker options for msvs.
1306 # Yes(1) means set use the common linker options.
1307 'msvs_use_common_linker_extras%': 1,
1309 # TODO(sgk): eliminate this if possible.
1310 # It would be nicer to support this via a setting in 'target_defaults'
1311 # in chrome/app/locales/locales.gypi overriding the setting in the
1312 # 'Debug' configuration in the 'target_defaults' dict below,
1313 # but that doesn't work as we'd like.
1314 'msvs_debug_link_incremental%': '2',
1316 # Needed for some of the largest modules.
1317 'msvs_debug_link_nonincremental%': '1',
1319 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1320 # to get incremental linking to be faster in debug builds.
1321 'incremental_chrome_dll%': '0',
1323 # Experimental setting to break chrome.dll into multiple pieces based on
1325 'chrome_multiple_dll%': '0',
1327 # Experimental setting to optimize Chrome's DLLs with PGO.
1328 'chrome_pgo_phase%': '0',
1330 # Whether the VS xtree header has been patched to disable warning 4702. If
1331 # it has, then we don't need to disable 4702 (unreachable code warning).
1332 # The patch is preapplied to the internal toolchain and hence all bots.
1333 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1336 'clang%': '<(clang)',
1337 'host_clang%': '<(host_clang)',
1338 'make_clang_dir%': '<(make_clang_dir)',
1339 'use_lld%': '<(use_lld)',
1341 # Control which version of clang to use when building for iOS. If set to
1342 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1343 # the version of clang that ships with the Chromium source. This variable
1344 # is automatically set to '1' when using the Xcode generator.
1347 # These two variables can be set in GYP_DEFINES while running
1348 # |gclient runhooks| to let clang run a plugin in every compilation.
1349 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1351 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1354 'clang_add_plugin%': '',
1356 # Tell ld64 to write map files describing binary layout. Useful
1357 # for looking at what contributes to binary size, e.g. with
1358 # https://github.com/nico/bloat
1359 'mac_write_linker_maps%': 0,
1361 # The default type of gtest.
1362 'gtest_target_type%': 'executable',
1364 # Enable sampling based profiler.
1365 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1367 # Profile without optimizing out stack frames when profiling==1.
1368 'profiling_full_stack_frames%': '0',
1370 # And if we want to dump symbols for Breakpad-enabled builds.
1371 'linux_dump_symbols%': 0,
1372 # And if we want to strip the binary after dumping symbols.
1373 'linux_strip_binary%': 0,
1374 # If we want stack unwind support for backtrace().
1375 'debug_unwind_tables%': 1,
1376 'release_unwind_tables%': 1,
1378 # Override where to find binutils
1379 'binutils_version%': 0,
1380 'binutils_dir%': '',
1383 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1384 'use_allocator%': 'tcmalloc',
1386 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1387 'linux_link_gnome_keyring%': 0,
1388 # Set to 1 to link against gsettings APIs instead of using dlopen().
1389 'linux_link_gsettings%': 0,
1391 # Enable use of OpenMAX DL FFT routines.
1392 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1394 # Enable new NPDevice API.
1395 'enable_new_npdevice_api%': 0,
1397 # .gyp files or targets should set chromium_code to 1 if they build
1398 # Chromium-specific code, as opposed to external code. This variable is
1399 # used to control such things as the set of warnings to enable, and
1400 # whether warnings are treated as errors.
1401 'chromium_code%': 0,
1403 # Disable fatal linker warnings, similarly to how we make it possible
1404 # to disable -Werror (e.g. for different toolchain versions).
1405 'disable_fatal_linker_warnings%': 0,
1407 'release_valgrind_build%': 0,
1409 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1410 'enable_wexit_time_destructors%': 0,
1412 # Build libpeerconnection as a static library by default.
1413 'libpeer_target_type%': 'static_library',
1415 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1416 'internal_gles2_conform_tests%': 0,
1418 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1419 'internal_khronos_glcts_tests%': 0,
1421 # Set to 1 to compile the filter fuzzer.
1422 'internal_filter_fuzzer%': 0,
1424 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1425 # so Cocoa is happy (http://crbug.com/20441).
1427 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1428 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1429 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1430 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1431 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1432 'vi', 'zh-CN', 'zh-TW',
1435 # Pseudo locales are special locales which are used for testing and
1436 # debugging. They don't get copied to the final app. For more info,
1437 # check out https://www.chromium.org/developers/testing/fake-bidi
1444 # If debug_devtools is set to 1, JavaScript files for DevTools are
1445 # stored as is and loaded from disk. Otherwise, a concatenated file
1446 # is stored in resources.pak. It is still possible to load JS files
1447 # from disk by passing --debug-devtools cmdline switch.
1448 'debug_devtools%': 0,
1450 # The Java Bridge is not compiled in by default.
1453 # Code signing for iOS binaries. The bots need to be able to disable this.
1454 'chromium_ios_signing%': 1,
1456 # This flag is only used when disable_nacl==0 and disables all those
1457 # subcomponents which would require the installation of a native_client
1458 # untrusted toolchain.
1459 'disable_nacl_untrusted%': 0,
1461 # Disable Dart by default.
1464 # Copy out the setting of disable_nacl.
1465 'disable_nacl%': '<(disable_nacl)',
1467 # Portable Native Client is enabled by default.
1468 'disable_pnacl%': 0,
1470 # Whether to build full debug version for Debug configuration on Android.
1471 # Compared to full debug version, the default Debug configuration on Android
1472 # has no full v8 debug, has size optimization and linker gc section, so that
1473 # we can build a debug version with acceptable size and performance.
1474 'android_full_debug%': 0,
1476 # Contains data about the attached devices for gyp_managed_install.
1477 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1479 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1480 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1482 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1483 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1485 # Whether we are using the rlz library or not. Platforms like Android send
1486 # rlz codes for searches but do not use the library.
1489 # Turns on the i18n support in V8.
1490 'v8_enable_i18n_support': 1,
1492 # Compile d8 for the host toolset.
1493 'v8_toolset_for_d8': 'host',
1495 # Use brlapi from brltty for braille display support.
1498 # Relative path to icu.gyp from this file.
1499 'icu_gyp_path': '../third_party/icu/icu.gyp',
1501 # IPC fuzzer is disabled by default.
1502 'enable_ipc_fuzzer%': 0,
1504 # Force disable libstdc++ debug mode.
1505 'disable_glibcxx_debug%': 0,
1507 # Set to 1 to compile with MSE support for MPEG2 TS
1508 'enable_mpeg2ts_stream_parser%': 0,
1510 # Support ChromeOS touchpad gestures with ozone.
1511 'use_evdev_gestures%': 0,
1513 # Default ozone platform (if no --ozone-platform flag).
1514 'ozone_platform%': "",
1516 # Ozone platforms to include in the build.
1517 'ozone_platform_caca%': 0,
1518 'ozone_platform_cast%': 0,
1519 'ozone_platform_dri%': 0,
1520 'ozone_platform_drm%': 0,
1521 'ozone_platform_egltest%': 0,
1522 'ozone_platform_gbm%': 0,
1523 'ozone_platform_ozonex%': 0,
1524 'ozone_platform_test%': 0,
1526 # Experiment: http://crbug.com/426914
1530 ['buildtype=="Official"', {
1531 # Continue to embed build meta data in Official builds, basically the
1532 # time it was built.
1533 # TODO(maruel): This decision should be revisited because having an
1534 # official deterministic build has high value too but MSVC toolset can't
1535 # generate anything deterministic with WPO enabled AFAIK.
1536 'dont_embed_build_metadata%': 0,
1538 # Enable the Syzygy optimization step for the official builds.
1539 ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
1540 'syzygy_optimize%': 1,
1542 'syzygy_optimize%': 0,
1544 # Get binutils version so we can enable debug fission if we can.
1545 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1547 # compiler_version doesn't work with clang
1548 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1549 # compiler_version works with clang.
1550 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1551 # that it takes effect here.
1552 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1553 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1555 # On Android we know the binutils version in the toolchain.
1557 'binutils_version%': 222,
1559 ['host_arch=="x64"', {
1560 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1562 ['host_arch=="ia32"', {
1563 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1565 # Our version of binutils in third_party/binutils
1566 ['linux_use_bundled_binutils==1', {
1567 'binutils_version%': 224,
1571 'binutils_version%': 0,
1573 # The version of GCC in use, set later in platforms that use GCC and have
1574 # not explicitly chosen to build with clang. Currently, this means all
1575 # platforms except Windows, Mac and iOS.
1576 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1577 # it takes effect here.
1578 ['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', {
1581 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1582 # We directly set the gcc version since we know what we use.
1585 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1586 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1590 'host_gcc_version%': 0,
1593 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1594 'windows_sdk_path%': '<(windows_sdk_default_path)',
1596 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1598 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1599 'directx_sdk_path%': '<(directx_sdk_default_path)',
1601 'directx_sdk_path%': '$(DXSDK_DIR)',
1604 'windows_driver_kit_path%': '$(WDK_DIR)',
1606 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1608 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1611 'nacl_untrusted_build%': 0,
1612 'use_allocator%': 'none',
1614 ['OS=="linux" and target_arch=="mipsel"', {
1615 'sysroot%': '<(sysroot)',
1618 # Use a 64-bit linker to avoid running out of address space. The
1619 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1620 ['host_arch=="ia32" and target_arch=="ia32"', {
1621 # TODO(thestig) This is a horrible way to force the desired
1622 # configuration. Our gyp variable scoping is likely wrong and
1623 # needs to be cleaned up. The GN configuration should be changed
1625 'binutils_version%': 224,
1626 'linux_use_bundled_binutils%': '1',
1627 'linux_use_bundled_gold%': '1',
1628 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1630 # All Chrome builds have breakpad symbols, but only process the
1631 # symbols from official builds.
1632 ['(branding=="Chrome" and buildtype=="Official")', {
1633 'linux_dump_symbols%': 1,
1635 # Omit unwind support in official release builds to save space. We
1636 # can use breakpad for these builds.
1637 'release_unwind_tables%': 0,
1640 }], # os_posix==1 and OS!="mac" and OS!="ios"
1643 'enable_background%': 0,
1644 'icu_use_data_file_flag%': 1,
1645 'enable_web_speech%': 0,
1646 'use_system_libxml%': 1,
1647 'use_system_sqlite%': 1,
1649 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1650 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1651 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1652 'uk', 'vi', 'zh-CN', 'zh-TW',
1655 # iOS SDK and deployment target support. The |ios_sdk| value is left
1656 # blank so that when it is set in the project files it will be the
1657 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1658 # causes Xcode to spit out a warning for every single project file for
1659 # not using the "current" SDK.
1661 'ios_sdk_path%': '',
1662 'ios_deployment_target%': '7.0',
1665 # ios_product_name is set to the name of the .app bundle as it should
1667 ['branding=="Chrome"', {
1668 'ios_product_name%': 'Chrome',
1669 }, { # else: branding!="Chrome"
1670 'ios_product_name%': 'Chromium',
1672 ['branding=="Chrome" and buildtype=="Official"', {
1674 }, { # else: branding!="Chrome" or buildtype!="Official"
1680 # Location of Android NDK.
1683 # Standard libraries can use the relative path to the NDK.
1684 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1685 # Unfortunately, it is required to use the absolute path to the SDK
1686 # because it us passed to ant which uses a different relative path
1688 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1689 # Similarly, gdbserver and the Android toolchain need to use the
1690 # absolute path to the NDK because they are used at different levels
1692 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1693 'android_host_arch%': '<!(uname -m)',
1694 # Android API-level of the SDK used for compilation.
1695 'android_sdk_version%': '22',
1696 'android_sdk_build_tools_version%': '22.0.0',
1697 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1699 # Copy conditionally-set variables out one scope.
1700 'android_ndk_root%': '<(android_ndk_root)',
1701 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1702 'android_sdk_root%': '<(android_sdk_root)',
1703 'android_sdk_version%': '<(android_sdk_version)',
1704 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1705 'host_os%': '<(host_os)',
1707 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1708 # Android SDK build tools (e.g. dx, aapt, aidl)
1709 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1711 # Android API level 14 is ICS (Android 4.0) which is the minimum
1712 # platform requirement for Chrome on Android, we use it for native
1715 ['target_arch == "ia32"', {
1716 'android_app_abi%': 'x86',
1717 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
1718 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1719 'android_ndk_lib_dir%': 'usr/lib',
1720 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1722 ['target_arch == "x64"', {
1723 'android_app_abi%': 'x86_64',
1724 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1725 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1726 'android_ndk_lib_dir%': 'usr/lib64',
1727 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1729 ['target_arch=="arm"', {
1732 'android_app_abi%': 'armeabi',
1734 'android_app_abi%': 'armeabi-v7a',
1737 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
1738 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1739 'android_ndk_lib_dir%': 'usr/lib',
1740 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1742 ['target_arch == "arm64"', {
1743 'android_app_abi%': 'arm64-v8a',
1744 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1745 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1746 'android_ndk_lib_dir%': 'usr/lib',
1747 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1749 ['target_arch == "mipsel"', {
1750 'android_app_abi%': 'mips',
1751 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
1752 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1753 'android_ndk_lib_dir%': 'usr/lib',
1754 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1756 ['target_arch == "mips64el"', {
1757 'android_app_abi%': 'mips64',
1758 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1759 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1760 'android_ndk_lib_dir%': 'usr/lib64',
1761 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1765 # Copy conditionally-set variables out one scope.
1766 'android_app_abi%': '<(android_app_abi)',
1767 'android_gdbserver%': '<(android_gdbserver)',
1768 'android_ndk_root%': '<(android_ndk_root)',
1769 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1770 'android_sdk_root%': '<(android_sdk_root)',
1771 'android_sdk_version%': '<(android_sdk_version)',
1772 'android_toolchain%': '<(android_toolchain)',
1774 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1775 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1776 'android_sdk_tools%': '<(android_sdk_tools)',
1777 'android_sdk%': '<(android_sdk)',
1778 'android_sdk_jar%': '<(android_sdk)/android.jar',
1780 'android_stlport_root': '<(android_stlport_root)',
1781 'android_stlport_include': '<(android_stlport_root)/stlport',
1782 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1783 'host_os%': '<(host_os)',
1785 # Location of the "objcopy" binary, used by both gyp and scripts.
1786 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1788 # Location of the "strip" binary, used by both gyp and scripts.
1789 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1791 # Location of the "readelf" binary.
1792 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1794 # Determines whether we should optimize JNI generation at the cost of
1795 # breaking assumptions in the build system that when inputs have changed
1796 # the outputs should always change as well. This is meant purely for
1797 # developer builds, to avoid spurious re-linking of native files.
1798 'optimize_jni_generation%': '<(optimize_jni_generation)',
1800 # Always uses openssl.
1802 'use_openssl_certs%': 1,
1804 'proprietary_codecs%': '<(proprietary_codecs)',
1805 'safe_browsing%': 2,
1806 'enable_web_speech%': 0,
1808 'build_ffmpegsumo%': 0,
1809 'use_allocator%': 'none',
1811 # Disable Native Client.
1814 # Android does not support background apps.
1815 'enable_background%': 0,
1817 # Sessions are store separately in the Java side.
1818 'enable_session_service%': 0,
1822 'gtest_target_type%': 'shared_library',
1824 # Uses system APIs for decoding audio and video.
1825 'use_libffmpeg%': '0',
1827 # TODO(torne): Remove this unsupported option once all the places that
1828 # test it have been updated.
1829 'use_system_stlport%': 0,
1831 # Copy it out one scope.
1832 'android_webview_build%': '<(android_webview_build)',
1835 'use_system_fontconfig%': 0,
1837 'use_system_fontconfig%': 1,
1840 'enable_mpeg2ts_stream_parser%': 1,
1841 'ffmpeg_branding%': 'ChromeOS',
1842 'ozone_platform_ozonex%': 1,
1843 'use_playready%': 0,
1845 ['target_arch=="arm"', {
1847 'arm_tune%': 'cortex-a9',
1853 ['chromecast==1 and OS!="android"', {
1854 'ozone_platform_cast%': 1
1856 ['OS=="linux" and target_arch!="mipsel"', {
1861 # All Chrome builds have breakpad symbols, but only process the
1862 # symbols from official builds.
1863 ['(branding=="Chrome" and buildtype=="Official")', {
1864 'mac_strip_release%': 1,
1868 ['OS=="mac" or OS=="ios"', {
1872 # Mac OS X SDK and deployment target support. The SDK identifies
1873 # the version of the system headers that will be used, and
1874 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1875 # macro. "Maximum allowed" refers to the operating system version
1876 # whose APIs are available in the headers. The deployment target
1877 # identifies the minimum system version that the built products are
1878 # expected to function on. It corresponds to the
1879 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1880 # macros are available, #include <AvailabilityMacros.h>. Additional
1881 # documentation on these macros is available at
1882 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1883 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1884 # deployment target to 10.6. Other projects, such as O3D, may
1885 # override these defaults.
1887 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1888 # about that is at least the specified version. In official builds,
1889 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1890 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1891 # path to the SDK; when set to a non-empty string, SDK detection
1892 # based on mac_sdk_min will be bypassed entirely.
1895 'mac_sdk_min%': '10.8',
1896 }, { # else OS!="ios"
1897 'mac_sdk_min%': '10.6',
1900 'mac_sdk_path%': '',
1902 'mac_deployment_target%': '10.6',
1905 'mac_sdk_min': '<(mac_sdk_min)',
1906 'mac_sdk_path': '<(mac_sdk_path)',
1907 'mac_deployment_target': '<(mac_deployment_target)',
1909 # Compile in Breakpad support by default so that it can be
1910 # tested, even if it is not enabled by default at runtime.
1911 'mac_breakpad_compiled_in%': 1,
1913 # mac_product_name is set to the name of the .app bundle as it should
1914 # appear on disk. This duplicates data from
1915 # chrome/app/theme/chromium/BRANDING and
1916 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1917 # these names into the build system.
1918 ['branding=="Chrome"', {
1919 'mac_product_name%': 'Google Chrome',
1920 }, { # else: branding!="Chrome"
1921 'mac_product_name%': 'Chromium',
1923 # Official mac builds require a specific OS X SDK, but iOS and
1924 # non-official mac builds do not.
1925 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1926 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1928 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1930 ['branding=="Chrome" and buildtype=="Official"', {
1931 # Enable uploading crash dumps.
1932 'mac_breakpad_uploads%': 1,
1933 # Enable dumping symbols at build time for use by Mac Breakpad.
1935 # Enable Keystone auto-update support.
1937 }, { # else: branding!="Chrome" or buildtype!="Official"
1938 'mac_breakpad_uploads%': 0,
1943 }], # OS=="mac" or OS=="ios"
1946 # This is the architecture convention used in WinSDK paths.
1947 ['target_arch=="ia32"', {
1948 'winsdk_arch%': 'x86',
1950 'winsdk_arch%': '<(target_arch)',
1952 ['component=="shared_library"', {
1953 'win_use_allocator_shim%': 0,
1955 # Turn on multiple dll by default on Windows when in static_library.
1956 'chrome_multiple_dll%': 1,
1958 ['asan==1 or syzyasan==1', {
1959 'win_use_allocator_shim%': 0,
1964 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1965 # Only enabled by default for ninja because it's buggy in VS.
1966 # Not enabled for component=static_library because some targets
1967 # are too large and the toolchain fails due to the size of the
1969 'incremental_chrome_dll%': 1,
1971 # Don't do incremental linking for large modules on 32-bit or when
1972 # component=static_library as the toolchain fails due to the size of
1974 ['MSVS_OS_BITS==32 or component=="static_library"', {
1975 'msvs_large_module_debug_link_mode%': '1', # No
1977 'msvs_large_module_debug_link_mode%': '2', # Yes
1980 'nacl_win64_defines': [
1981 # This flag is used to minimize dependencies when building
1982 # Native Client loader for 64-bit Windows.
1985 # Need to include allocator target, but exclude tcmalloc files.
1986 'use_allocator%': 'winheap',
1989 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1995 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1996 'enable_pepper_cdms%': 1,
1998 'enable_pepper_cdms%': 0,
2001 ['OS=="android" or chromecast==1', {
2002 'enable_browser_cdms%': 1,
2004 'enable_browser_cdms%': 0,
2007 # Native Client glibc toolchain is enabled
2008 # by default except on arm, mips and mips64.
2009 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
2010 'disable_glibc%': 1,
2012 'disable_glibc%': 0,
2015 # Set the relative path from this file to the GYP file of the JPEG
2016 # library used by Chromium.
2017 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2018 # Configuration for using the system libjeg is here.
2019 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
2021 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
2024 # Options controlling the use of GConf (the classic GNOME configuration
2025 # system) and GIO, which contains GSettings (the new GNOME config system).
2026 ['chromeos==1 or embedded==1', {
2034 # Set up -D and -E flags passed into grit.
2035 ['branding=="Chrome"', {
2036 # TODO(mmoss) The .grd files look for _google_chrome, but for
2037 # consistency they should look for google_chrome_build like C++.
2038 'grit_defines': ['-D', '_google_chrome',
2039 '-E', 'CHROMIUM_BUILD=google_chrome'],
2041 'grit_defines': ['-D', '_chromium',
2042 '-E', 'CHROMIUM_BUILD=chromium'],
2045 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2047 ['desktop_linux==1', {
2048 'grit_defines': ['-D', 'desktop_linux'],
2050 ['toolkit_views==1', {
2051 'grit_defines': ['-D', 'toolkit_views'],
2054 'grit_defines': ['-D', 'use_aura'],
2057 'grit_defines': ['-D', 'use_ash'],
2060 'grit_defines': ['-D', 'use_nss'],
2063 'grit_defines': ['-D', 'use_ozone'],
2065 ['image_loader_extension==1', {
2066 'grit_defines': ['-D', 'image_loader_extension'],
2069 'grit_defines': ['-D', 'remoting'],
2071 ['use_titlecase_in_grd==1', {
2072 'grit_defines': ['-D', 'use_titlecase'],
2074 ['use_third_party_translations==1', {
2075 'grit_defines': ['-D', 'use_third_party_translations'],
2077 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2078 'ka', 'ku', 'kw', 'ms', 'ug'
2084 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2085 '--no-output-all-resource-defines',
2088 ['OS=="mac" or OS=="ios"', {
2089 'grit_defines': ['-D', 'scale_factors=2x'],
2093 'enable_coverage%': 0,
2097 '--no-output-all-resource-defines',
2099 # iOS uses a whitelist to filter resources.
2100 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2102 # Enable host builds when generating with ninja-ios.
2104 ['"<(GENERATOR)"=="ninja"', {
2108 # Use the version of clang shipped with Xcode when building official
2109 # version of Chrome for iOS.
2111 # TODO(eugenebut): Remove enable_coverage check once
2112 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2113 # http://crbug.com/450379
2114 ['buildtype=="Official" or enable_coverage', {
2119 ['enable_extensions==1', {
2120 'grit_defines': ['-D', 'enable_extensions'],
2122 ['enable_plugins!=0', {
2123 'grit_defines': ['-D', 'enable_plugins'],
2125 ['enable_basic_printing==1 or enable_print_preview==1', {
2126 'grit_defines': ['-D', 'enable_printing'],
2128 ['enable_print_preview==1', {
2129 'grit_defines': ['-D', 'enable_print_preview'],
2131 ['enable_themes==1', {
2132 'grit_defines': ['-D', 'enable_themes'],
2134 ['enable_app_list==1', {
2135 'grit_defines': ['-D', 'enable_app_list'],
2137 ['enable_settings_app==1', {
2138 'grit_defines': ['-D', 'enable_settings_app'],
2140 ['enable_google_now==1', {
2141 'grit_defines': ['-D', 'enable_google_now'],
2143 ['use_concatenated_impulse_responses==1', {
2144 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2146 ['enable_media_router==1', {
2147 'grit_defines': ['-D', 'enable_media_router'],
2149 ['enable_webrtc==1', {
2150 'grit_defines': ['-D', 'enable_webrtc'],
2152 ['enable_hangout_services_extension==1', {
2153 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2155 ['enable_task_manager==1', {
2156 'grit_defines': ['-D', 'enable_task_manager'],
2158 ['notifications==1', {
2159 'grit_defines': ['-D', 'enable_notifications'],
2161 ['enable_wifi_bootstrapping==1', {
2162 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2164 ['mac_views_browser==1', {
2165 'grit_defines': ['-D', 'mac_views_browser'],
2167 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2168 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2170 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2171 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2173 ['enable_mdns==1 or OS=="mac"', {
2174 'grit_defines': ['-D', 'enable_service_discovery'],
2175 'enable_service_discovery%': 1
2177 ['clang_use_chrome_plugins==1 and OS!="win"', {
2180 ['OS=="mac" or OS=="ios"', {
2181 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2182 }, { # OS != "mac" or OS != "ios"
2183 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
2187 # If you change these, also change build/config/clang/BUILD.gn.
2188 'clang_chrome_plugins_flags%':
2189 '-Xclang -load -Xclang <(clang_lib_path)'
2190 ' -Xclang -add-plugin -Xclang find-bad-constructs',
2192 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2194 'use_allocator%': 'none',
2195 'use_sanitizer_options%': 1,
2196 # Disable ICF in the linker to avoid debug info loss.
2197 'gold_icf_level%': 'none',
2199 ['asan==1 and OS=="linux" and chromeos==0', {
2200 'use_custom_libcxx%': 1,
2208 ['asan==1 and OS=="mac"', {
2209 'mac_strip_release': 1,
2212 'use_custom_libcxx%': 1,
2215 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2216 # libstdc++. This is required to avoid false positive reports whenever
2217 # the C++ standard library is used.
2218 'use_custom_libcxx%': 1,
2219 # Running the V8-generated code on an ARM simulator is a powerful hack
2220 # that allows the tool to see the memory accesses from JITted code.
2221 # Without this flag, JS code causes false positive reports from MSan.
2222 'v8_target_arch': 'arm64',
2225 ['OS=="linux" and clang_type_profiler==1', {
2227 'clang_use_chrome_plugins%': 0,
2229 ['host_arch=="x64"', {
2230 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2232 ['host_arch=="ia32"', {
2233 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2234 # Clang in this directory at your own risk if needed for some
2235 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2236 # usage). Any failure by this compiler should not close the tree.
2237 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2243 # The Clang plugins don't currently work on Windows.
2244 # TODO(hans): One day, this will work. (crbug.com/82385)
2245 'clang_use_chrome_plugins%': 0,
2248 # On valgrind bots, override the optimizer settings so we don't inline too
2249 # much and make the stacks harder to figure out.
2251 # TODO(rnk): Kill off variables that no one else uses and just implement
2252 # them under a build_for_tool== condition.
2253 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2255 'mac_debug_optimization': '1',
2256 'mac_release_optimization': '1',
2257 'release_optimize': '1',
2258 'no_gc_sections': 1,
2259 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2260 '-fno-builtin -fno-optimize-sibling-calls',
2261 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2262 '-fno-builtin -fno-optimize-sibling-calls',
2264 # MSVS flags for TSan on Pin and Windows.
2265 'win_debug_RuntimeChecks': '0',
2266 'win_debug_disable_iterator_debugging': '1',
2267 'win_debug_Optimization': '1',
2268 'win_debug_InlineFunctionExpansion': '0',
2269 'win_release_InlineFunctionExpansion': '0',
2270 'win_release_OmitFramePointers': '0',
2272 'use_allocator': 'tcmalloc',
2273 'release_valgrind_build': 1,
2275 'component': 'static_library',
2276 'use_system_zlib': 0,
2279 # Build tweaks for DrMemory.
2280 # TODO(rnk): Combine with tsan config to share the builder.
2281 # http://crbug.com/108155
2282 ['build_for_tool=="drmemory"', {
2283 # These runtime checks force initialization of stack vars which blocks
2284 # DrMemory's uninit detection.
2285 'win_debug_RuntimeChecks': '0',
2286 # Iterator debugging is slow.
2287 'win_debug_disable_iterator_debugging': '1',
2288 # Try to disable optimizations that mess up stacks in a release build.
2289 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2290 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2291 # compiler bug, so we use /Ob1 instead.
2292 'win_release_InlineFunctionExpansion': '1',
2293 'win_release_OmitFramePointers': '0',
2294 # Ditto for debug, to support bumping win_debug_Optimization.
2295 'win_debug_InlineFunctionExpansion': 0,
2296 'win_debug_OmitFramePointers': 0,
2297 # Keep the code under #ifndef NVALGRIND.
2298 'release_valgrind_build': 1,
2301 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2302 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2306 # Set default compiler flags depending on ARM version.
2307 ['arm_version==6', {
2308 'arm_arch%': 'armv6',
2311 'arm_float_abi%': 'softfp',
2314 ['arm_version==7', {
2315 'arm_arch%': 'armv7-a',
2316 'arm_tune%': 'generic-armv7-a',
2321 'arm_fpu%': 'vfpv3-d16',
2324 # Change the default to hard once the armhf transition is complete.
2325 'arm_float_abi%': 'softfp',
2329 # Set default compiler flags for MIPS floating-point support.
2330 ['target_arch=="mipsel"', {
2331 'mips_float_abi%': 'hard',
2333 ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
2334 'mips_fpu_mode%': 'fp32',
2337 # Enable brlapi by default for chromeos.
2342 ['use_ozone==1 and ozone_auto_platforms==1', {
2343 # Use test as the default platform.
2344 'ozone_platform%': 'test',
2346 # Build all platforms whose deps are in install-build-deps.sh.
2347 # Only these platforms will be compile tested by buildbots.
2348 'ozone_platform_dri%': 1,
2349 'ozone_platform_drm%': 1,
2350 'ozone_platform_test%': 1,
2351 'ozone_platform_egltest%': 1,
2354 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2355 'use_clipboard_aurax11%': 1,
2358 ['OS=="win" and use_goma==1', {
2359 # goma doesn't support pch yet.
2360 'chromium_win_pch': 0,
2361 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2363 ['win_z7==0 and fastbuild==0', {
2369 ['OS=="win" and (clang==1 or asan==1)', {
2370 'chromium_win_pch': 0,
2374 'host_cc': '<(make_clang_dir)/bin/clang',
2375 'host_cxx': '<(make_clang_dir)/bin/clang++',
2377 'host_cc': '<!(which gcc)',
2378 'host_cxx': '<!(which g++)',
2381 # The seccomp-bpf sandbox is only supported on five architectures
2383 # Do not disable seccomp_bpf anywhere without talking to
2384 # security@chromium.org!
2385 ['((OS=="linux" or OS=="android") and '
2386 '(target_arch=="ia32" or target_arch=="x64" or '
2387 'target_arch=="arm" or target_arch=="mipsel" or '
2388 'target_arch=="arm64"))', {
2389 'use_seccomp_bpf%': 1,
2391 'use_seccomp_bpf%': 0,
2394 ['cfi_vptr==1 or cfi_derived_cast==1 or cfi_unrelated_cast==1', {
2399 # The path to the ANGLE library.
2400 'angle_path': '<(DEPTH)/third_party/angle',
2402 # List of default apps to install in new profiles. The first list contains
2403 # the source files as found in svn. The second list, used only for linux,
2404 # contains the destination location for each of the files. When a crx
2405 # is added or removed from the list, the chrome/browser/resources/
2406 # default_apps/external_extensions.json file must also be updated.
2408 # README: GN version of these is in the target //chrome:default_apps
2409 # (there's no global variable like in GYP). Be sure to update that target
2410 # if you change these lists!
2411 'default_apps_list': [
2412 'browser/resources/default_apps/external_extensions.json',
2413 'browser/resources/default_apps/gmail.crx',
2414 'browser/resources/default_apps/search.crx',
2415 'browser/resources/default_apps/youtube.crx',
2416 'browser/resources/default_apps/drive.crx',
2417 'browser/resources/default_apps/docs.crx',
2419 'default_apps_list_linux_dest': [
2420 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2421 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2422 '<(PRODUCT_DIR)/default_apps/search.crx',
2423 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2424 '<(PRODUCT_DIR)/default_apps/drive.crx',
2425 '<(PRODUCT_DIR)/default_apps/docs.crx',
2428 # Whether to allow building of the GPU-related isolates.
2429 'archive_gpu_tests%': 0,
2431 # Whether to allow building of chromoting related isolates.
2432 'archive_chromoting_tests%': 0,
2434 'target_defaults': {
2436 # The condition that operates on chromium_code is in a target_conditions
2437 # section, and will not have access to the default fallback value of
2438 # chromium_code at the top of this file, or to the chromium_code
2439 # variable placed at the root variables scope of .gyp files, because
2440 # those variables are not set at target scope. As a workaround,
2441 # if chromium_code is not set at target scope, define it in target scope
2442 # to contain whatever value it has during early variable expansion.
2443 # That's enough to make it available during target conditional
2445 'chromium_code%': '<(chromium_code)',
2447 'component%': '<(component)',
2449 'chromecast%': '<(chromecast)',
2451 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2452 'win_release_Optimization%': '2', # 2 = /O2
2453 'win_debug_Optimization%': '0', # 0 = /Od
2455 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2456 # Tri-state: blank is default, 1 on, 0 off
2457 'win_release_OmitFramePointers%': '0',
2458 # Tri-state: blank is default, 1 on, 0 off
2459 'win_debug_OmitFramePointers%': '',
2461 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2462 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2464 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2465 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2466 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2468 # VS inserts quite a lot of extra checks to algorithms like
2469 # std::partial_sort in Debug build which make them O(N^2)
2470 # instead of O(N*logN). This is particularly slow under memory
2471 # tools like ThreadSanitizer so we want it to be disablable.
2472 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2473 'win_debug_disable_iterator_debugging%': '0',
2475 # An application manifest fragment to declare compatibility settings for
2476 # 'executable' targets. Ignored in other target type.
2477 'win_exe_compatibility_manifest%':
2478 '<(DEPTH)\\build\\win\\compatibility.manifest',
2480 'release_extra_cflags%': '',
2481 'debug_extra_cflags%': '',
2483 'release_valgrind_build%': '<(release_valgrind_build)',
2485 # the non-qualified versions are widely assumed to be *nix-only
2486 'win_release_extra_cflags%': '',
2487 'win_debug_extra_cflags%': '',
2489 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2490 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2492 # Only used by Windows build for now. Can be used to build into a
2493 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2494 # output files in src/build/VS2010_{Debug,Release}.
2495 'build_dir_prefix%': '',
2497 # Targets are by default not nacl untrusted code.
2498 'nacl_untrusted_build%': 0,
2500 'pnacl_compile_flags': [
2501 # pnacl uses the clang compiler so we need to suppress all the
2502 # same warnings as we do for clang.
2503 # TODO(sbc): Remove these if/when they are removed from the clang
2505 '-Wno-unused-function',
2506 '-Wno-char-subscripts',
2507 '-Wno-c++11-extensions',
2508 '-Wno-unnamed-type-template-args',
2511 # By default, Android targets have their exported JNI symbols stripped,
2512 # so we test the manual JNI registration code paths that are required
2513 # when using the crazy linker. To allow use of native JNI exports (lazily
2514 # resolved by the JVM), targets can enable this variable, which will stop
2515 # the stripping from happening. Only targets which do not need to be
2516 # compatible with the crazy linker are permitted to set this.
2517 'use_native_jni_exports%': 0,
2520 ['OS=="win" and component=="shared_library"', {
2521 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2522 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2523 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2525 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2526 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2527 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2530 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2531 'mac_release_optimization%': 's', # Use -Os unless overridden
2532 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2534 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2535 'mac_release_optimization%': '2', # Use -O2 unless overridden
2536 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2539 'host_os%': '<(host_os)', # See comment above chromium_code.
2542 'clang_warning_flags': [
2545 # Don't die on dtoa code that uses a char as an array index.
2546 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2547 '-Wno-char-subscripts',
2549 # TODO(thakis): This used to be implied by -Wno-unused-function,
2550 # which we no longer use. Check if it makes sense to remove
2551 # this as well. http://crbug.com/316352
2552 '-Wno-unneeded-internal-declaration',
2554 # Warns on switches on enums that cover all enum values but
2555 # also contain a default: branch. Chrome is full of that.
2556 '-Wno-covered-switch-default',
2558 # Warns when a const char[] is converted to bool.
2559 '-Wstring-conversion',
2561 # C++11-related flags:
2563 # This warns on using ints as initializers for floats in
2564 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2565 # which happens in several places in chrome code. Not sure if
2566 # this is worth fixing.
2567 '-Wno-c++11-narrowing',
2569 # Clang considers the `register` keyword as deprecated, but e.g.
2570 # code generated by flex (used in angle) contains that keyword.
2571 # http://crbug.com/255186
2572 '-Wno-deprecated-register',
2574 # TODO(hans): Get this cleaned up.
2575 '-Wno-inconsistent-missing-override',
2578 'includes': [ 'set_clang_warning_flags.gypi', ],
2580 # Don't use deprecated V8 APIs anywhere.
2581 'V8_DEPRECATION_WARNINGS',
2584 '<(SHARED_INTERMEDIATE_DIR)',
2587 ['(OS=="mac" or OS=="ios") and asan==1', {
2589 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2592 ['OS=="win" and asan==1 and component=="shared_library"', {
2594 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2597 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2598 'cflags_cc!': ['-fno-rtti'],
2601 '-gline-tables-only',
2602 '-fintercept-allocation-functions',
2604 'defines': ['TYPE_PROFILING'],
2606 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2609 ['branding=="Chrome"', {
2610 'defines': ['GOOGLE_CHROME_BUILD'],
2611 }, { # else: branding!="Chrome"
2612 'defines': ['CHROMIUM_BUILD'],
2614 ['OS=="mac" and component=="shared_library"', {
2616 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2617 'LD_RUNPATH_SEARCH_PATHS': [
2618 # For unbundled binaries.
2620 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2621 '@loader_path/../../..',
2625 ['(clang==1 or host_clang==1) and OS!="win"', {
2626 # This is here so that all files get recompiled after a clang roll and
2627 # when turning clang on or off.
2628 # (defines are passed via the command line, and build systems rebuild
2629 # things when their commandline changes). Nothing should ever read this
2631 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2634 'defines': ['ENABLE_RLZ'],
2636 ['component=="shared_library"', {
2637 'defines': ['COMPONENT_BUILD'],
2639 ['toolkit_views==1', {
2640 'defines': ['TOOLKIT_VIEWS=1'],
2642 ['ui_compositor_image_transport==1', {
2643 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2646 'defines': ['USE_AURA=1'],
2649 'defines': ['USE_ASH=1'],
2652 'defines': ['USE_PANGO=1'],
2655 'defines': ['USE_CAIRO=1'],
2658 'defines': ['USE_CRAS=1'],
2661 'defines': ['USE_OZONE=1'],
2663 ['use_default_render_theme==1', {
2664 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2666 ['use_libjpeg_turbo==1', {
2667 'defines': ['USE_LIBJPEG_TURBO=1'],
2670 'defines': ['USE_X11=1'],
2672 ['use_clipboard_aurax11==1', {
2673 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2675 ['enable_one_click_signin==1', {
2676 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2678 ['enable_pre_sync_backup==1', {
2679 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2681 ['image_loader_extension==1', {
2682 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2685 'defines': ['ENABLE_PROFILING=1'],
2688 'defines': ['ENABLE_REMOTING=1'],
2690 ['enable_webrtc==1', {
2691 'defines': ['ENABLE_WEBRTC=1'],
2693 ['proprietary_codecs==1', {
2694 'defines': ['USE_PROPRIETARY_CODECS'],
2696 ['enable_mpeg2ts_stream_parser==1', {
2697 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2701 ['enable_viewport==1', {
2702 'defines': ['ENABLE_VIEWPORT'],
2704 ['enable_pepper_cdms==1', {
2705 'defines': ['ENABLE_PEPPER_CDMS'],
2707 ['enable_browser_cdms==1', {
2708 'defines': ['ENABLE_BROWSER_CDMS'],
2710 ['configuration_policy==1', {
2711 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2713 ['notifications==1', {
2714 'defines': ['ENABLE_NOTIFICATIONS'],
2716 ['enable_hidpi==1', {
2717 'defines': ['ENABLE_HIDPI=1'],
2719 ['native_memory_pressure_signals==1', {
2720 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2723 'defines': ['USE_UDEV'],
2727 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2730 ['OS=="win" and fastbuild==2', {
2731 # Completely disable debug information.
2734 'GenerateDebugInformation': 'false',
2736 'VCCLCompilerTool': {
2737 'DebugInformationFormat': '0',
2741 ['OS=="win" and fastbuild==1', {
2744 # This tells the linker to generate .pdbs, so that
2745 # we can get meaningful stack traces.
2746 'GenerateDebugInformation': 'true',
2748 'VCCLCompilerTool': {
2749 # No debug info to be generated by compiler.
2750 'DebugInformationFormat': '0',
2754 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2755 'variables': { 'debug_extra_cflags': '-g0', },
2757 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2758 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2760 'variables': { 'debug_extra_cflags': '-g0', },
2762 # Android builds symbols on release by default, disable them.
2763 ['OS=="android" and fastbuild==2', {
2764 'variables': { 'release_extra_cflags': '-g0', },
2766 ['OS=="android" and fastbuild==1', {
2767 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2769 'variables': { 'release_extra_cflags': '-g0', },
2773 ['dont_embed_build_metadata==1', {
2775 'DONT_EMBED_BUILD_METADATA',
2777 }], # dont_embed_build_metadata==1
2778 ['dcheck_always_on!=0', {
2779 'defines': ['DCHECK_ALWAYS_ON=1'],
2780 }], # dcheck_always_on!=0
2781 ['tracing_like_official_build!=0', {
2782 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2783 }], # tracing_like_official_build!=0
2785 'defines': ['NO_TCMALLOC'],
2787 ['win_use_allocator_shim==1', {
2788 'defines': ['ALLOCATOR_SHIM'],
2794 'ADDRESS_SANITIZER',
2795 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2796 'MEMORY_SANITIZER_INITIAL_SIZE',
2800 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2808 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2809 'MEMORY_SANITIZER_INITIAL_SIZE',
2817 '<(DEPTH)/third_party/kasko/include',
2823 '_CRT_SECURE_NO_DEPRECATE',
2824 '_SCL_SECURE_NO_DEPRECATE',
2825 # This define is required to pull in the new Win8 interfaces from
2826 # system headers like ShObjIdl.h.
2827 'NTDDI_VERSION=0x06030000',
2828 # This is required for ATL to use XP-safe versions of its functions.
2829 '_USING_V110_SDK71_',
2832 '<(DEPTH)/third_party/wtl/include',
2837 # Generates debug info when win_z7=1
2838 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2840 'GenerateDebugInformation': 'true',
2842 'VCCLCompilerTool': {
2843 'DebugInformationFormat': '1',
2849 # This is prohibited when running /analyze.
2850 '_USING_V110_SDK71_',
2853 'VCCLCompilerTool': {
2854 # Set WarnAsError to false to disable this setting for most
2855 # projects so that compilation continues.
2856 'WarnAsError': 'false',
2857 # When win_analyze is specified add the /analyze switch.
2858 # Also add /WX- to force-disable WarnAsError for projects that
2859 # override WarnAsError.
2860 # Also, disable various noisy warnings that have low value.
2861 'AdditionalOptions': [
2864 '/wd6011', # Dereferencing NULL pointer
2865 '/wd6312', # Possible infinite loop: use of the constant
2866 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2867 '/wd6326', # Potential comparison of constant with constant
2868 '/wd28159', # Consider using 'GetTickCount64'
2869 '/wd28204', # Inconsistent SAL annotations
2870 '/wd28251', # Inconsistent SAL annotations
2871 '/wd28252', # Inconsistent SAL annotations
2872 '/wd28253', # Inconsistent SAL annotations
2873 '/wd28196', # The precondition is not satisfied
2874 '/wd28301', # Inconsistent SAL annotations
2875 '/wd6340', # Sign mismatch in function parameter
2876 '/wd28182', # Dereferencing NULL pointer
2877 # C6285 is ~16% of raw warnings and has low value
2878 '/wd6285', # non-zero constant || non-zero constant
2879 # C6334 is ~80% of raw warnings and has low value
2880 '/wd6334', # sizeof applied to an expression with an operator
2892 ['use_playready==1', {
2894 'PLAYREADY_CDM_AVAILABLE',
2899 ['enable_task_manager==1', {
2901 'ENABLE_TASK_MANAGER=1',
2904 ['enable_extensions==1', {
2906 'ENABLE_EXTENSIONS=1',
2909 ['OS=="win" and branding=="Chrome"', {
2910 'defines': ['ENABLE_SWIFTSHADER'],
2912 ['enable_dart==1', {
2913 'defines': ['WEBKIT_USING_DART=1'],
2915 ['enable_plugin_installation==1', {
2916 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2918 ['enable_plugins==1', {
2919 'defines': ['ENABLE_PLUGINS=1'],
2921 ['enable_session_service==1', {
2922 'defines': ['ENABLE_SESSION_SERVICE=1'],
2924 ['enable_themes==1', {
2925 'defines': ['ENABLE_THEMES=1'],
2927 ['enable_autofill_dialog==1', {
2928 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2930 ['enable_prod_wallet_service==1', {
2931 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2933 ['enable_background==1', {
2934 'defines': ['ENABLE_BACKGROUND=1'],
2936 ['enable_google_now==1', {
2937 'defines': ['ENABLE_GOOGLE_NOW=1'],
2939 ['cld_version!=0', {
2940 'defines': ['CLD_VERSION=<(cld_version)'],
2942 ['enable_basic_printing==1 or enable_print_preview==1', {
2943 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2944 'defines': ['ENABLE_PRINTING=1'],
2946 ['enable_basic_printing==1', {
2947 # Enable basic printing support and UI.
2948 'defines': ['ENABLE_BASIC_PRINTING=1'],
2950 ['enable_print_preview==1', {
2951 # Enable printing with print preview.
2952 # Can be defined without ENABLE_BASIC_PRINTING.
2953 'defines': ['ENABLE_PRINT_PREVIEW=1'],
2955 ['enable_spellcheck==1', {
2956 'defines': ['ENABLE_SPELLCHECK=1'],
2958 ['enable_captive_portal_detection==1', {
2959 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2961 ['enable_app_list==1', {
2962 'defines': ['ENABLE_APP_LIST=1'],
2964 ['enable_settings_app==1', {
2965 'defines': ['ENABLE_SETTINGS_APP=1'],
2967 ['disable_file_support==1', {
2968 'defines': ['DISABLE_FILE_SUPPORT=1'],
2970 ['disable_ftp_support==1', {
2971 'defines': ['DISABLE_FTP_SUPPORT=1'],
2973 ['enable_supervised_users==1', {
2974 'defines': ['ENABLE_SUPERVISED_USERS=1'],
2976 ['spdy_proxy_auth_property != ""', {
2977 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2979 ['spdy_proxy_auth_value != ""', {
2980 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2982 ['enable_mdns==1', {
2983 'defines': ['ENABLE_MDNS=1'],
2985 ['enable_service_discovery==1', {
2986 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2988 ['enable_wifi_bootstrapping==1', {
2989 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2991 ['enable_hangout_services_extension==1', {
2992 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2994 ['enable_ipc_fuzzer==1', {
2995 'defines': ['ENABLE_IPC_FUZZER=1'],
2998 'defines': ['VIDEO_HOLE=1'],
3000 ['v8_use_external_startup_data==1', {
3001 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
3003 ], # conditions for 'target_defaults'
3004 'target_conditions': [
3005 ['<(use_libpci)==1', {
3006 'defines': ['USE_LIBPCI=1'],
3008 ['<(use_openssl)==1', {
3009 'defines': ['USE_OPENSSL=1'],
3011 ['<(use_openssl_certs)==1', {
3012 'defines': ['USE_OPENSSL_CERTS=1'],
3014 ['>(nacl_untrusted_build)==1', {
3017 'USE_OPENSSL_CERTS=1',
3020 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3021 'defines': ['USE_GLIB=1'],
3023 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
3024 'defines': ['USE_NSS=1'],
3026 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3027 'defines': ['OS_CHROMEOS=1'],
3029 ['enable_wexit_time_destructors==1 and OS!="win"', {
3030 # TODO: Enable on Windows too, http://crbug.com/404525
3031 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3033 ['chromium_code==0', {
3035 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3036 # We don't want to get warnings from third-party code,
3037 # so remove any existing warning-enabling flags like -Wall.
3043 # Don't warn about hash_map in third-party code.
3047 # Don't warn about printf format problems.
3048 # This is off by default in gcc but on in Ubuntu's gcc(!).
3052 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3056 # TODO: Fix all warnings on chromeos too.
3057 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3062 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3064 # Don't warn about ignoring the return value from e.g. close().
3065 # This is off by default in some gccs but on by default in others.
3066 # BSD systems do not support this option, since they are usually
3067 # using gcc 4.2.1, which does not have this flag yet.
3068 '-Wno-unused-result',
3073 '_CRT_SECURE_NO_DEPRECATE',
3074 '_CRT_NONSTDC_NO_WARNINGS',
3075 '_CRT_NONSTDC_NO_DEPRECATE',
3076 '_SCL_SECURE_NO_DEPRECATE',
3078 'msvs_disabled_warnings': [
3079 # These are variable shadowing warnings that are new in VS2015.
3080 # We should probably work through these at some point for
3081 # non-chromium code, but for now, focus on chromium_code==1 code.
3082 4456, 4457, 4458, 4459,
3087 'VCCLCompilerTool': {
3088 'WarningLevel': '3',
3089 'WarnAsError': 'true',
3090 'Detect64BitPortabilityProblems': 'false',
3094 ['buildtype=="Official"', {
3096 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3099 [ 'component=="shared_library"', {
3100 # TODO(darin): Unfortunately, some third_party code depends on base.
3101 'msvs_disabled_warnings': [
3102 4251, # class 'std::xx' needs to have dll-interface.
3108 [ 'OS=="mac" or OS=="ios"', {
3110 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3113 ['buildtype=="Official"', {
3115 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3122 # TODO(ios): Fix remaining warnings in third-party code, then
3123 # remove this; the Mac cleanup didn't get everything that's
3124 # flagged in an iOS build.
3125 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3126 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3127 # Several internal ios directories generate numerous warnings for
3128 # -Wobjc-missing-property-synthesis.
3129 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3135 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3136 'filename_rules.gypi',
3138 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3139 # C99 macros on Mac and Linux.
3141 '__STDC_CONSTANT_MACROS',
3142 '__STDC_FORMAT_MACROS',
3146 # turn on warnings for signed/unsigned mismatch on chromium code.
3148 'VCCLCompilerTool': {
3149 'AdditionalOptions': ['/we4389'],
3153 ['OS=="win" and component=="shared_library"', {
3154 'msvs_disabled_warnings': [
3155 4251, # class 'std::xx' needs to have dll-interface.
3160 ], # target_conditions for 'target_defaults'
3161 'default_configuration': 'Debug',
3163 # VCLinkerTool LinkIncremental values below:
3165 # 1 == /INCREMENTAL:NO
3167 # Debug links incremental, Release does not.
3169 # Abstract base configurations to cover common attributes.
3173 'msvs_configuration_attributes': {
3174 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3175 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3176 'CharacterSet': '1',
3178 # Add the default import libs.
3181 'AdditionalDependencies': [
3198 'AdditionalOptions': [
3199 # Suggested by Microsoft Devrel to avoid
3200 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3201 # which started happening more regularly after VS2013 Update 4.
3202 # Needs to be a bit lower for VS2015, or else errors out.
3203 '/maxilksize:0x7ff00000',
3212 'MinimumRequiredVersion': '5.01', # XP.
3213 'TargetMachine': '1',
3215 'VCLibrarianTool': {
3216 'TargetMachine': '1',
3219 'msvs_configuration_platform': 'Win32',
3223 'msvs_configuration_platform': 'x64',
3226 # Make sure to understand http://crbug.com/361720 if you want to
3228 'MinimumRequiredVersion': '5.02', # Server 2003.
3229 'TargetMachine': '17', # x86 - 64
3230 'AdditionalLibraryDirectories!':
3231 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3232 'AdditionalLibraryDirectories':
3233 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3234 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3235 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3237 'VCLibrarianTool': {
3238 'AdditionalLibraryDirectories!':
3239 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3240 'AdditionalLibraryDirectories':
3241 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3242 'TargetMachine': '17', # x64
3249 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3250 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3253 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3255 '<@(debug_extra_cflags)',
3259 'VCCLCompilerTool': {
3260 'Optimization': '<(win_debug_Optimization)',
3261 'PreprocessorDefinitions': ['_DEBUG'],
3262 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3263 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3265 # According to MSVS, InlineFunctionExpansion=0 means
3266 # "default inlining", not "/Ob0".
3267 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3268 ['win_debug_InlineFunctionExpansion==0', {
3269 'AdditionalOptions': ['/Ob0'],
3271 ['win_debug_InlineFunctionExpansion!=""', {
3272 'InlineFunctionExpansion':
3273 '<(win_debug_InlineFunctionExpansion)',
3275 ['win_debug_disable_iterator_debugging==1', {
3276 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3279 # if win_debug_OmitFramePointers is blank, leave as default
3280 ['win_debug_OmitFramePointers==1', {
3281 'OmitFramePointers': 'true',
3283 ['win_debug_OmitFramePointers==0', {
3284 'OmitFramePointers': 'false',
3285 # The above is not sufficient (http://crbug.com/106711): it
3286 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3287 # perform FPO regardless, so we must explicitly disable.
3288 # We still want the false setting above to avoid having
3289 # "/Oy /Oy-" and warnings about overriding.
3290 'AdditionalOptions': ['/Oy-'],
3293 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3296 'LinkIncremental': '<(msvs_debug_link_incremental)',
3297 # ASLR makes debugging with windbg difficult because Chrome.exe and
3298 # Chrome.dll share the same base name. As result, windbg will
3299 # name the Chrome.dll module like chrome_<base address>, where
3300 # <base address> typically changes with each launch. This in turn
3301 # means that breakpoints in Chrome.dll don't stick from one launch
3302 # to the next. For this reason, we turn ASLR off in debug builds.
3303 # Note that this is a three-way bool, where 0 means to pick up
3304 # the default setting, 1 is off and 2 is on.
3305 'RandomizedBaseAddress': 1,
3307 'VCResourceCompilerTool': {
3308 'PreprocessorDefinitions': ['_DEBUG'],
3312 ['OS=="linux" or OS=="android"', {
3313 'target_conditions': [
3314 ['_toolset=="target"', {
3316 '<@(debug_extra_cflags)',
3321 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3322 # Enable libstdc++ debugging facilities to help catch problems
3323 # early, see http://crbug.com/65151 .
3324 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3325 'defines': ['_GLIBCXX_DEBUG=1',],
3327 ['release_valgrind_build==0', {
3330 '-fstack-protector-all', # Implies -fstack-protector
3336 # Allow comparing the address of references and 'this' against 0
3337 # in debug builds. Technically, these can never be null in
3338 # well-defined C/C++ and Clang can optimize such checks away in
3339 # release builds, but they may be used in asserts in debug builds.
3340 '-Wno-undefined-bool-conversion',
3341 '-Wno-tautological-undefined-compare',
3345 '-Wno-undefined-bool-conversion',
3346 '-Wno-tautological-undefined-compare',
3350 'VCCLCompilerTool': {
3351 'AdditionalOptions': [
3352 '-Wno-undefined-bool-conversion',
3353 '-Wno-tautological-undefined-compare',
3366 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3367 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3368 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3371 'VCCLCompilerTool': {
3372 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3374 # In official builds, each target will self-select
3375 # an optimization level.
3376 ['buildtype!="Official"', {
3377 'Optimization': '<(win_release_Optimization)',
3380 # According to MSVS, InlineFunctionExpansion=0 means
3381 # "default inlining", not "/Ob0".
3382 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3383 ['win_release_InlineFunctionExpansion==0', {
3384 'AdditionalOptions': ['/Ob0'],
3386 ['win_release_InlineFunctionExpansion!=""', {
3387 'InlineFunctionExpansion':
3388 '<(win_release_InlineFunctionExpansion)',
3391 # if win_release_OmitFramePointers is blank, leave as default
3392 ['win_release_OmitFramePointers==1', {
3393 'OmitFramePointers': 'true',
3395 ['win_release_OmitFramePointers==0', {
3396 'OmitFramePointers': 'false',
3397 # The above is not sufficient (http://crbug.com/106711): it
3398 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3399 # perform FPO regardless, so we must explicitly disable.
3400 # We still want the false setting above to avoid having
3401 # "/Oy /Oy-" and warnings about overriding.
3402 'AdditionalOptions': ['/Oy-'],
3405 # Put data in separate COMDATs. This allows the linker
3406 # to put bit-identical constants at the same address even if
3407 # they're unrelated constants, which saves binary size.
3408 # This optimization can't be used when ASan is enabled because
3409 # it is not compatible with the ASan ODR checker.
3410 'AdditionalOptions': ['/Gw'],
3413 'AdditionalOptions': [
3414 '/d2Zi+', # Improve debugging of Release builds.
3415 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3416 '<@(win_release_extra_cflags)',
3420 # LinkIncremental is a tri-state boolean, where 0 means default
3421 # (i.e., inherit from parent solution), 1 means false, and
3423 'LinkIncremental': '1',
3424 # This corresponds to the /PROFILE flag which ensures the PDB
3425 # file contains FIXUP information (growing the PDB file by about
3426 # 5%) but does not otherwise alter the output binary. This
3427 # information is used by the Syzygy optimization tool when
3428 # decomposing the release image.
3433 ['msvs_use_common_release', {
3434 'includes': ['release.gypi'],
3436 ['release_valgrind_build==0 and tsan==0', {
3439 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3443 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3444 'MEMORY_SANITIZER_INITIAL_SIZE',
3445 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3446 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3450 'defines': ['NO_TCMALLOC'],
3452 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3453 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3454 # It seems to work fine with Ubuntu 12 headers though, so use it
3455 # in official builds.
3456 ['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")', {
3457 'target_conditions': [
3458 ['chromium_code==1', {
3459 # Non-chromium code is not guaranteed to compile cleanly
3460 # with _FORTIFY_SOURCE. Also, fortified build may fail
3461 # when optimizations are disabled, so only do that for Release
3464 '_FORTIFY_SOURCE=2',
3469 ['OS=="linux" or OS=="android"', {
3470 'target_conditions': [
3471 ['_toolset=="target"', {
3473 '<@(release_extra_cflags)',
3476 ['enable_resource_whitelist_generation==1', {
3478 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3487 'NS_BLOCK_ASSERTIONS=1',
3493 # Concrete configurations
3496 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3499 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3504 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3505 'target_conditions': [
3506 [ '_type=="executable"', {
3507 # To get a real .dSYM bundle produced by dsymutil, set the
3508 # debug information format to dwarf-with-dsym. Since
3509 # strip_from_xcode will not be used, set Xcode to do the
3510 # stripping as well.
3512 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3513 'DEPLOYMENT_POSTPROCESSING': 'YES',
3514 'STRIP_INSTALLED_PRODUCT': 'YES',
3521 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3523 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3526 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3534 'target_defaults': {
3539 # TODO(glider): enable the default options on other systems.
3541 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3543 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3549 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3550 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3551 'target_defaults': {
3553 '-Wl,--fatal-warnings',
3557 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3558 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
3559 'target_defaults': {
3565 ['os_posix==1 and chromeos==0', {
3566 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3567 # and we want to avoid overriding this, so stack-protector is only
3568 # enabled when not building on Chrome OS.
3569 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3571 'target_defaults': {
3573 '-fstack-protector',
3574 '--param=ssp-buffer-size=4',
3578 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3579 'target_defaults': {
3580 # Enable -Werror by default, but put it in a variable so it can
3581 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3583 'werror%': '-Werror',
3584 'libraries_for_target%': '',
3587 '_FILE_OFFSET_BITS=64',
3590 '<(werror)', # See note above about the werror variable.
3592 '-fno-strict-aliasing', # See http://crbug.com/32204
3594 # Don't warn about unused function params. We use those everywhere.
3595 '-Wno-unused-parameter',
3596 # Don't warn about the "struct foo f = {0};" initialization pattern.
3597 '-Wno-missing-field-initializers',
3598 # Don't export any symbols (for example, to plugins we dlopen()).
3599 # Note: this is *required* to make some plugins work.
3600 '-fvisibility=hidden',
3606 '-fno-threadsafe-statics',
3607 # Make inline functions have hidden visiblity by default.
3608 # Surprisingly, not covered by -fvisibility=hidden.
3609 '-fvisibility-inlines-hidden',
3610 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3611 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3615 '-pthread', '-Wl,-z,noexecstack',
3618 '<(libraries_for_target)',
3623 'debug_optimize%': '0',
3629 '-O>(debug_optimize)',
3634 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3635 # TODO(jdduke) Re-enable on mips after resolving linking
3636 # issues with libc++ (crbug.com/456380).
3638 # Warn in case of text relocations.
3639 '-Wl,--warn-shared-textrel',
3642 ['OS=="android" and android_full_debug==0', {
3643 # Some configurations are copied from Release_Base to reduce
3646 'debug_optimize%': 's',
3650 '-ffunction-sections',
3657 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3658 # We don't omit frame pointers on arm64 since they are required
3659 # to correctly unwind stackframes which contain system library
3660 # function frames (crbug.com/391706).
3662 '-fomit-frame-pointer',
3667 '_LARGEFILE_SOURCE',
3668 '_LARGEFILE64_SOURCE',
3671 ['OS=="linux" and target_arch=="ia32"', {
3673 '-Wl,--no-as-needed',
3676 ['debug_unwind_tables==1', {
3677 'cflags': ['-funwind-tables'],
3679 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3680 'defines': ['NO_UNWIND_TABLES'],
3682 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3683 # definitions in to the right scope to use them when setting
3684 # linux_use_debug_fission, so it can be used here alone.
3685 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3686 'cflags': ['-gsplit-dwarf'],
3692 'release_optimize%': '2',
3693 # Binaries become big and gold is unable to perform GC
3694 # and remove unused sections for some of test targets
3695 # on 32 bit platform.
3696 # (This is currently observed only in chromeos valgrind bots)
3697 # The following flag is to disable --gc-sections linker
3698 # option for these bots.
3699 'no_gc_sections%': 0,
3701 # TODO(bradnelson): reexamine how this is done if we change the
3702 # expansion of configurations
3703 'release_valgrind_build%': 0,
3706 '-O<(release_optimize)',
3707 # Don't emit the GCC version ident directives, they just end up
3708 # in the .comment section taking up binary size.
3710 # Put data and code in their own sections, so that unused symbols
3711 # can be removed at link time with --gc-sections.
3713 '-ffunction-sections',
3716 # Specifically tell the linker to perform optimizations.
3717 # See http://lwn.net/Articles/192624/ .
3722 ['no_gc_sections==0', {
3724 '-Wl,--gc-sections',
3727 ['OS=="android" and target_arch!="arm64"', {
3728 # We don't omit frame pointers on arm64 since they are required
3729 # to correctly unwind stackframes which contain system library
3730 # function frames (crbug.com/391706).
3732 '-fomit-frame-pointer',
3735 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3736 # TODO(jdduke) Re-enable on mips after resolving linking
3737 # issues with libc++ (crbug.com/456380).
3739 # Warn in case of text relocations.
3740 '-Wl,--warn-shared-textrel',
3745 'release_optimize%': 's',
3750 '-fno-omit-frame-pointer',
3754 ['profiling_full_stack_frames==1', {
3757 '-fno-optimize-sibling-calls',
3762 ['release_unwind_tables==1', {
3763 'cflags': ['-funwind-tables'],
3765 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3766 'defines': ['NO_UNWIND_TABLES'],
3772 ['target_arch=="ia32"', {
3773 'target_conditions': [
3774 ['_toolset=="target"', {
3776 # Needed so that libs with .s files (e.g. libicudata.a)
3777 # are compatible with the general 32-bit-ness.
3780 # All floating-point computations on x87 happens in 80-bit
3781 # precision. Because the C and C++ language standards allow
3782 # the compiler to keep the floating-point values in higher
3783 # precision than what's specified in the source and doing so
3784 # is more efficient than constantly rounding up to 64-bit or
3785 # 32-bit precision as specified in the source, the compiler,
3786 # especially in the optimized mode, tries very hard to keep
3787 # values in x87 floating-point stack (in 80-bit precision)
3788 # as long as possible. This has important side effects, that
3789 # the real value used in computation may change depending on
3790 # how the compiler did the optimization - that is, the value
3791 # kept in 80-bit is different than the value rounded down to
3792 # 64-bit or 32-bit. There are possible compiler options to
3793 # make this behavior consistent (e.g. -ffloat-store would keep
3794 # all floating-values in the memory, thus force them to be
3795 # rounded to its original precision) but they have significant
3796 # runtime performance penalty.
3798 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3799 # which keep floating-point values in SSE registers in its
3800 # native precision (32-bit for single precision, and 64-bit
3801 # for double precision values). This means the floating-point
3802 # value used during computation does not change depending on
3803 # how the compiler optimized the code, since the value is
3804 # always kept in its specified precision.
3806 # Refer to http://crbug.com/348761 for rationale behind SSE2
3807 # being a minimum requirement for 32-bit Linux builds and
3808 # http://crbug.com/313032 for an example where this has "bit"
3813 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3820 # Use gold linker for Android ia32 target.
3826 # Install packages have started cropping up with
3827 # different headers between the 32-bit and 64-bit
3828 # versions, so we have to shadow those differences off
3829 # and make sure a 32-bit-on-64-bit build picks up the
3831 # For android build, use NDK headers instead of host headers
3832 ['host_arch!="ia32" and OS!="android"', {
3841 ['target_arch=="x64"', {
3842 'target_conditions': [
3843 ['_toolset=="target"', {
3845 # Use gold linker for Android x64 target.
3862 ['target_arch=="arm"', {
3863 'target_conditions': [
3864 ['_toolset=="target"', {
3868 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3869 # has changed whenever it encounters a varargs function. This
3870 # silences those warnings, as they are not helpful and
3871 # clutter legitimate warnings.
3875 ['clang==1 and arm_arch!="" and OS!="android"', {
3877 '-target arm-linux-gnueabihf',
3880 '-target arm-linux-gnueabihf',
3885 '-march=<(arm_arch)',
3888 ['use_lto==1 or use_lto_o2==1', {
3890 '-march=<(arm_arch)',
3895 ['clang==1 and OS!="android"', {
3897 # We need to disable clang's builtin assembler as it can't
3898 # handle several asm files, crbug.com/124610
3899 '-no-integrated-as',
3904 '-mtune=<(arm_tune)',
3907 ['use_lto==1 or use_lto_o2==1', {
3909 '-mtune=<(arm_tune)',
3919 ['use_lto==1 or use_lto_o2==1', {
3926 ['arm_float_abi!=""', {
3928 '-mfloat-abi=<(arm_float_abi)',
3931 ['use_lto==1 or use_lto_o2==1', {
3933 '-mfloat-abi=<(arm_float_abi)',
3943 ['use_lto==1 or use_lto_o2==1', {
3951 # Most of the following flags are derived from what Android
3952 # uses by default when building for arm, reference for which
3953 # can be found in the following file in the Android NDK:
3954 # toolchains/arm-linux-androideabi-4.9/setup.mk
3956 # The tree-sra optimization (scalar replacement for
3957 # aggregates enabling subsequent optimizations) leads to
3958 # invalid code generation when using the Android NDK's
3959 # compiler (r5-r7). This can be verified using
3960 # webkit_unit_tests' WTF.Checked_int8_t test.
3962 # The following option is disabled to improve binary
3963 # size and performance in gcc 4.9.
3964 '-fno-caller-saves',
3967 # Android now supports .relro sections properly.
3968 # NOTE: While these flags enable the generation of .relro
3969 # sections, the generated libraries can still be loaded on
3970 # older Android platform versions.
3977 ['gcc_version==48 and clang==0', {
3979 # The following 5 options are disabled to save on
3980 # binary size in GCC 4.8.
3981 '-fno-partial-inlining',
3982 '-fno-early-inlining',
3983 '-fno-tree-copy-prop',
3984 '-fno-tree-loop-optimize',
3985 '-fno-move-loop-invariants',
3989 'cflags': [ '-mthumb-interwork' ],
3993 # Thumb code with frame pointer makes chrome crash
3996 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3997 # The perf report sometimes incorrectly attributes
3998 # code from tail calls.
3999 '-fno-optimize-sibling-calls',
4002 '-fomit-frame-pointer',
4007 # Clang does not support the following options.
4009 '-mthumb-interwork',
4010 '-finline-limit=64',
4012 '-fno-caller-saves',
4016 # TODO(hans) Enable integrated-as (crbug.com/124610).
4017 '-no-integrated-as',
4018 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4021 # Let clang find the ld.gold in the NDK.
4022 '--gcc-toolchain=<(android_toolchain)/..',
4027 '-marm', # Required for frame pointer based stack traces.
4034 # We set arm_arch to "" so that -march compiler option
4035 # is not set. Otherwise a gcc bug that would complain
4036 # about it conflicting with '-mcpu=cortex-a9'. The flag
4037 # '-march=armv7-a' is actually redundant anyway because
4038 # it is enabled by default when we built the toolchain.
4039 # And using '-mcpu=cortex-a9' should be sufficient.
4042 # Breakpad requires symbols with debugging information
4046 # We want to statically link libstdc++/libgcc_s.
4047 '-static-libstdc++',
4051 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4052 # define their own cflags for arm builds that could
4053 # conflict with the flags we set here (e.g.
4054 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4063 ['target_arch=="arm64"', {
4064 'target_conditions': [
4065 ['_toolset=="target"', {
4069 '-fstack-protector', # stack protector is always enabled on arm64.
4079 ['target_arch=="mipsel"', {
4080 'target_conditions': [
4081 ['_toolset=="target"', {
4083 ['mips_arch_variant=="r6"', {
4086 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ],
4087 'ldflags': [ '-target mipsel-linux-gnu', ],
4089 'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
4091 ['clang==0 and OS=="android"', {
4092 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4096 ['mips_arch_variant=="r2"', {
4098 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4099 'cflags': ['-m<(mips_fpu_mode)'],
4104 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
4105 'ldflags': [ '-target mipsel-linux-android', ],
4109 'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
4113 ['mips_arch_variant=="r1"', {
4118 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
4119 'ldflags': [ '-target mipsel-linux-android', ],
4123 'cflags': ['-mips32', '-Wa,-mips32', ],
4129 # Clang does not support the following options.
4130 '-finline-limit=64',
4133 # TODO(gordanac) Enable integrated-as.
4134 '-no-integrated-as',
4135 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4138 # Let clang find the ld in the NDK.
4139 '--gcc-toolchain=<(android_toolchain)/..',
4142 ['mips_dsp_rev==1', {
4143 'cflags': ['-mdsp'],
4145 ['mips_dsp_rev==2', {
4146 'cflags': ['-mdspr2'],
4150 '-m<(mips_float_abi)-float'
4153 '-Wl,--no-keep-memory',
4157 '-Wno-uninitialized',
4162 ['target_arch=="mips64el"', {
4163 'target_conditions': [
4164 ['_toolset=="target"', {
4166 ['mips_arch_variant=="r6"', {
4167 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4168 'ldflags': ['-mips64r6'],
4170 ['mips_arch_variant=="r2"', {
4171 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4172 'ldflags': ['-mips64r2'],
4176 '-Wno-uninitialized',
4193 'target_conditions': [
4194 ['_toolset=="target"', {
4196 '--sysroot=<(sysroot)',
4199 '--sysroot=<(sysroot)',
4200 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4206 # TODO(thakis): Remove, http://crbug.com/263960
4207 '-Wno-reserved-user-defined-literal',
4210 # gnu++11 instead of c++11 is needed because some code uses
4211 # typeof() (a GNU extension).
4212 # TODO(thakis): Eventually switch this to c++11 instead,
4213 # http://crbug.com/427584
4217 ['clang==0 and host_clang==1', {
4218 'target_conditions': [
4219 ['_toolset=="host"', {
4220 'cflags_cc': [ '-std=gnu++11', ],
4224 ['clang==1 and clang_use_chrome_plugins==1', {
4226 '<@(clang_chrome_plugins_flags)',
4229 ['clang==1 and clang_load!=""', {
4231 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4234 ['clang==1 and clang_add_plugin!=""', {
4236 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4239 ['clang==1 and target_arch=="ia32"', {
4241 # Else building libyuv gives clang's register allocator issues,
4242 # see llvm.org/PR15798 / crbug.com/233709
4243 '-momit-leaf-frame-pointer',
4244 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4245 '-mstack-alignment=16',
4249 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4251 # See http://crbug.com/110262
4252 '-fcolor-diagnostics',
4255 # Common options for AddressSanitizer, LeakSanitizer,
4256 # ThreadSanitizer and MemorySanitizer.
4257 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4258 'target_conditions': [
4259 ['_toolset=="target"', {
4261 '-fno-omit-frame-pointer',
4262 '-gline-tables-only',
4265 '-fomit-frame-pointer',
4270 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4271 'target_conditions': [
4272 ['_toolset=="target"', {
4274 # Functions interposed by the sanitizers can make ld think
4275 # that some libraries aren't needed when they actually are,
4276 # http://crbug.com/234010. As workaround, disable --as-needed.
4280 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4281 'MEMORY_SANITIZER_INITIAL_SIZE',
4287 'target_conditions': [
4288 ['_toolset=="target"', {
4290 '-fsanitize=address',
4291 # TODO(earthdok): Re-enable. http://crbug.com/427202
4292 #'-fsanitize-blacklist=<(asan_blacklist)',
4295 '-fsanitize=address',
4302 '-mllvm -asan-globals=0', # http://crbug.com/352073
4308 'target_conditions': [
4309 ['_toolset=="target"', {
4311 '-fsanitize=undefined',
4312 '-fsanitize-blacklist=<(ubsan_blacklist)',
4313 # Employ the experimental PBQP register allocator to avoid
4314 # slow compilation on files with too many basic blocks.
4315 # See http://crbug.com/426271.
4316 '-mllvm -regalloc=pbqp',
4317 # Speculatively use coalescing to slightly improve the code
4318 # generated by PBQP regallocator. May increase compile time.
4319 '-mllvm -pbqp-coalescing',
4328 '-fsanitize=undefined',
4331 'UNDEFINED_SANITIZER',
4337 'target_conditions': [
4338 ['_toolset=="target"', {
4341 '-fsanitize-blacklist=<(ubsan_blacklist)',
4353 'UNDEFINED_SANITIZER',
4358 ['asan_coverage!=0 and sanitizer_coverage==0', {
4359 'target_conditions': [
4360 ['_toolset=="target"', {
4362 '-fsanitize-coverage=<(asan_coverage)',
4365 'SANITIZER_COVERAGE',
4370 ['sanitizer_coverage!=0', {
4371 'target_conditions': [
4372 ['_toolset=="target"', {
4374 '-fsanitize-coverage=<(sanitizer_coverage)',
4377 'SANITIZER_COVERAGE',
4382 ['asan_field_padding!=0', {
4383 'target_conditions': [
4384 ['_toolset=="target"', {
4386 '-fsanitize-address-field-padding=<(asan_field_padding)',
4392 'target_conditions': [
4393 ['_toolset=="target"', {
4402 'WTF_USE_LEAK_SANITIZER=1',
4408 'target_conditions': [
4409 ['_toolset=="target"', {
4411 '-fsanitize=thread',
4412 '-fsanitize-blacklist=<(tsan_blacklist)',
4415 '-fsanitize=thread',
4419 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4420 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4426 'target_conditions': [
4427 ['_toolset=="target"', {
4429 '-fsanitize=memory',
4430 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4431 '-fsanitize-blacklist=<(msan_blacklist)',
4434 '-fsanitize=memory',
4442 ['use_instrumented_libraries==1', {
4444 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4447 ['use_prebuilt_instrumented_libraries==1', {
4449 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
4452 ['use_custom_libcxx==1', {
4454 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4457 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4458 'target_conditions' : [
4459 # crazy_linker has an upstream gyp file we can't edit, and we
4460 # don't want to instrument it.
4461 ['_toolset=="target" and _target_name!="crazy_linker"', {
4463 '-finstrument-functions',
4464 # Allow mmx intrinsics to inline, so that the
4465 #0 compiler can expand the intrinsics.
4466 '-finstrument-functions-exclude-file-list=mmintrin.h',
4469 ['_toolset=="target" and OS=="android"', {
4471 # Avoids errors with current NDK:
4472 # "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"
4473 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4478 ['linux_dump_symbols==1', {
4481 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4482 'target_conditions': [
4483 ['_toolset=="target"', {
4485 # Attempt to use less memory to prevent the linker from
4486 # running out of address space. Considering installing a
4487 # 64-bit kernel and switching to a 64-bit linker.
4488 '-Wl,--no-keep-memory',
4495 ['use_allocator!="tcmalloc"', {
4496 'defines': ['NO_TCMALLOC'],
4498 ['linux_use_gold_flags==1', {
4499 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4501 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4502 'ldflags': [ '-fuse-ld=gold', ],
4504 'target_conditions': [
4505 ['_toolset=="target"', {
4507 # Experimentation found that using four linking threads
4508 # saved ~20% of link time.
4509 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4510 # Only apply this to the target linker, since the host
4511 # linker might not be gold, but isn't used much anyway.
4512 # TODO(raymes): Disable threading because gold is frequently
4513 # crashing on the bots: crbug.com/161942.
4515 # '-Wl,--thread-count=4',
4518 # TODO(thestig): Enable this for disabled cases.
4519 [ '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', {
4521 '-Wl,--detect-odr-violations',
4528 ['release_valgrind_build==0 and order_profiling==0', {
4529 'target_conditions': [
4530 ['_toolset=="target"', {
4532 '-Wl,--icf=<(gold_icf_level)',
4539 ['linux_use_bundled_binutils==1', {
4541 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4544 ['linux_use_bundled_gold==1', {
4545 # Put our binutils, which contains gold in the search path. We pass
4546 # the path to gold to the compiler. gyp leaves unspecified what the
4547 # cwd is when running the compiler, so the normal gyp path-munging
4548 # fails us. This hack gets the right path.
4550 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4553 # Some binutils 2.23 releases may or may not have new dtags enabled,
4554 # but they are all compatible with --disable-new-dtags,
4555 # because the new dynamic tags are not created by default.
4556 ['binutils_version>=223', {
4557 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4558 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4559 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4560 # inside this file to allow usage of --no-as-needed and removal of
4563 '-Wl,--disable-new-dtags',
4566 ['gcc_version>=47 and clang==0', {
4567 'target_conditions': [
4568 ['_toolset=="target"', {
4571 # See comment for -Wno-c++11-narrowing.
4573 # TODO(thakis): Remove, http://crbug.com/263960
4574 '-Wno-literal-suffix',
4579 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4580 'target_conditions': [
4581 ['_toolset=="host"', {
4584 # See comment for -Wno-c++11-narrowing.
4586 # TODO(thakis): Remove, http://crbug.com/263960
4587 '-Wno-literal-suffix',
4595 # FreeBSD-specific options; note that most FreeBSD options are set above,
4598 'target_defaults': {
4600 '-Wl,--no-keep-memory',
4604 # Android-specific options; note that most are set above with Linux.
4607 # This is a unique identifier for a given build. It's used for
4608 # identifying various build artifacts corresponding to a particular
4609 # build of chrome (e.g. where to find archived symbols).
4610 'chrome_build_id%': '',
4612 # Figure this out early since it needs symbols from libgcc.a, so it
4613 # has to be before that in the set of libraries.
4614 ['component=="shared_library"', {
4615 'android_stlport_library': 'stlport_shared',
4617 'android_stlport_library': 'stlport_static',
4621 # Placing this variable here prevents from forking libvpx, used
4622 # by remoting. Remoting is off, so it needn't built,
4623 # so forking it's deps seems like overkill.
4624 # But this variable need defined to properly run gyp.
4625 # A proper solution is to have an OS==android conditional
4626 # in third_party/libvpx/libvpx.gyp to define it.
4627 'libvpx_path': 'lib/linux/arm',
4629 'target_defaults': {
4631 'release_extra_cflags%': '',
4633 # If we're using the components build, append "cr" to all shared
4634 # libraries to avoid naming collisions with android system library
4635 # versions with the same name (e.g. skia, icu).
4636 ['component=="shared_library"', {
4637 'android_product_extension': 'cr.so',
4639 'android_product_extension': 'so',
4643 'target_conditions': [
4644 ['_type=="shared_library"', {
4645 'product_extension': '<(android_product_extension)',
4648 # Settings for building device targets using Android's toolchain.
4649 # These are based on the setup.mk file from the Android NDK.
4651 # The NDK Android executable link step looks as follows:
4653 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4654 # $(PRIVATE_OBJECTS) <-- The .o that we built
4655 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4656 # $(TARGET_LIBGCC) <-- libgcc.a
4657 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4658 # $(PRIVATE_LDLIBS) <-- System .so
4659 # $(TARGET_CRTEND_O) <-- crtend.o
4661 # For now the above are approximated for executables by adding
4662 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4665 # The NDK Android shared library link step looks as follows:
4667 # $(PRIVATE_OBJECTS) <-- The .o that we built
4668 # -l,--whole-archive
4669 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4670 # -l,--no-whole-archive
4671 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4672 # $(TARGET_LIBGCC) <-- libgcc.a
4673 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4674 # $(PRIVATE_LDLIBS) <-- System .so
4676 # For now, assume that whole static libraries are not needed.
4678 # For both executables and shared libraries, add the proper
4679 # libgcc.a to the start of libraries which puts it in the
4680 # proper spot after .o and .a files get linked in.
4682 # TODO: The proper thing to do longer-tem would be proper gyp
4683 # support for a custom link command line.
4684 ['_toolset=="target"', {
4686 '-pthread', # Not supported by Android toolchain.
4689 '-ffunction-sections',
4692 '-fstack-protector',
4694 '-finline-limit=64',
4695 '-Wa,--noexecstack',
4696 '<@(release_extra_cflags)',
4697 '--sysroot=<(android_ndk_sysroot)',
4698 # NOTE: The stlport header include paths below are specified in
4699 # cflags rather than include_dirs because they need to come
4700 # after include_dirs.
4701 # The include ordering here is important; change with caution.
4702 '-isystem<(android_stlport_include)',
4706 '__GNU_SOURCE=1', # Necessary for clone()
4708 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4709 'CHROME_BUILD_ID="<(chrome_build_id)"',
4710 # The NDK has these things, but doesn't define the constants
4711 # to say that it does. Define them here instead.
4715 '-pthread', # Not supported by Android toolchain.
4718 '-Wl,--no-undefined',
4719 '--sysroot=<(android_ndk_sysroot)',
4721 '-L<(android_stlport_libs_dir)',
4722 # Don't allow visible symbols from libgcc or stlport to be
4724 '-Wl,--exclude-libs=libgcc.a',
4725 '-Wl,--exclude-libs=libstlport_static.a',
4726 # Don't allow visible symbols from libraries that contain
4727 # assembly code with symbols that aren't hidden properly.
4728 # http://crbug.com/448386
4729 '-Wl,--exclude-libs=libcommon_audio.a',
4730 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4731 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4732 '-Wl,--exclude-libs=libiSACFix.a',
4733 '-Wl,--exclude-libs=libisac_neon.a',
4734 '-Wl,--exclude-libs=libopus.a',
4735 '-Wl,--exclude-libs=libvpx.a',
4738 '-l<(android_stlport_library)',
4739 # Manually link the libgcc.a that the cross compiler uses.
4740 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4746 ['component=="static_library"', {
4747 'target_conditions': [
4748 ['use_native_jni_exports==0', {
4749 # Use a linker version script to strip JNI exports from
4750 # binaries which have not specifically asked to use them.
4752 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4759 # Work around incompatibilities between bionic and clang
4761 '-D__compiler_offsetof=__builtin_offsetof',
4762 '-Dnan=__builtin_nan',
4765 ['target_arch=="arm"', {
4767 '-target arm-linux-androideabi',
4770 '-target arm-linux-androideabi',
4773 ['target_arch=="ia32"', {
4775 '-target x86-linux-androideabi',
4778 '-target x86-linux-androideabi',
4781 # Place holder for x64 support, not tested.
4782 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4783 ['target_arch=="x64"', {
4785 '-target x86_64-linux-androideabi',
4788 '-target x86_64-linux-androideabi',
4795 # Android build relies on -Wl,--gc-sections removing
4796 # unreachable code. ASan instrumentation for globals inhibits
4797 # this and results in a library with unresolvable relocations.
4798 # TODO(eugenis): find a way to reenable this.
4799 '-mllvm -asan-globals=0',
4802 ['target_arch == "arm" and order_profiling==0', {
4804 # Enable identical code folding to reduce size.
4805 '-Wl,--icf=<(gold_icf_level)',
4808 ['target_arch=="ia32"', {
4809 # The x86 toolchain currently has problems with stack-protector.
4811 '-fstack-protector',
4814 '-fno-stack-protector',
4818 'target_conditions': [
4819 ['_type=="executable"', {
4820 # Force android tools to export the "main" symbol so they can be
4821 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4822 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4823 # when ICS support will be dropped.
4826 '-fvisibility=default',
4830 '-Wl,--gc-sections',
4831 '-Wl,-z,nocopyreloc',
4834 # crtbegin_dynamic.o should be the last item in ldflags.
4835 '<(android_ndk_lib)/crtbegin_dynamic.o',
4838 # crtend_android.o needs to be the last item in libraries.
4839 # Do not add any libraries after this!
4840 '<(android_ndk_lib)/crtend_android.o',
4843 ['_type=="shared_library" or _type=="loadable_module"', {
4845 '-Wl,-shared,-Bsymbolic',
4846 # crtbegin_so.o should be the last item in ldflags.
4847 '<(android_ndk_lib)/crtbegin_so.o',
4850 # crtend_so.o needs to be the last item in libraries.
4851 # Do not add any libraries after this!
4852 '<(android_ndk_lib)/crtend_so.o',
4857 # Settings for building host targets using the system toolchain.
4858 ['_toolset=="host"', {
4860 # Due to issues in Clang build system, using ASan on 32-bit
4861 # binaries on x86_64 host is problematic.
4862 # TODO(eugenis): re-enable.
4863 '-fsanitize=address',
4866 '-fsanitize=address',
4867 '-Wl,-z,noexecstack',
4868 '-Wl,--gc-sections',
4871 '-Wl,--warn-shared-textrel',
4872 '-Wl,--fatal-warnings',
4875 # Settings for building host targets on mac.
4876 ['_toolset=="host" and host_os=="mac"', {
4886 'cflags!': ['-fvisibility=hidden'],
4887 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4889 ['OS=="mac" or OS=="ios"', {
4890 'target_defaults': {
4893 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4894 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4895 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4896 'COPY_PHASE_STRIP': 'NO',
4897 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4898 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4899 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4900 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4901 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4902 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4903 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4904 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4905 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4906 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4907 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4908 'GCC_VERSION': '4.2',
4909 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4910 'USE_HEADERMAP': 'NO',
4915 # Don't warn about unused function parameters.
4916 '-Wno-unused-parameter',
4917 # Don't warn about the "struct foo f = {0};" initialization
4919 '-Wno-missing-field-initializers',
4922 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4923 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4925 # Note that the prebuilt Clang binaries should not be used for iOS
4926 # development except for ASan builds.
4928 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
4929 # Warn if automatic synthesis is triggered with
4930 # the -Wobjc-missing-property-synthesis flag.
4931 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4932 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4934 # This warns on selectors from Cocoa headers (-length, -set).
4935 # cfe-dev is currently discussing the merits of this warning.
4936 # TODO(thakis): Reevaluate what to do with this, based one
4937 # cfe-dev discussion.
4938 '-Wno-selector-type-mismatch',
4941 ['clang_xcode==0', {
4942 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4943 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4947 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4949 '<@(clang_chrome_plugins_flags)',
4952 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4954 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4957 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4959 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4962 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4964 # See http://crbug.com/110262
4965 '-fcolor-diagnostics',
4968 ['OS=="ios" and target_subarch!="arm32" and \
4969 "<(GENERATOR)"=="xcode"', {
4971 # TODO(ios): when building Chrome for iOS on 64-bit platform
4972 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4973 # enabled. This cause failures when compiling protobuf code,
4974 # so disable the warning. http://crbug.com/359107
4975 '-Wno-shorten-64-to-32',
4983 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4989 '-fsanitize=address',
4990 '-mllvm -asan-globals=0', # http://crbug.com/352073
4991 '-gline-tables-only',
4995 ['asan_coverage!=0 and sanitizer_coverage==0', {
4996 'target_conditions': [
4997 ['_toolset=="target"', {
4999 '-fsanitize-coverage=<(asan_coverage)',
5002 'SANITIZER_COVERAGE',
5007 ['sanitizer_coverage!=0', {
5008 'target_conditions': [
5009 ['_toolset=="target"', {
5011 '-fsanitize-coverage=<(sanitizer_coverage)',
5014 'SANITIZER_COVERAGE',
5020 'target_conditions': [
5021 ['_type!="static_library"', {
5022 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5027 '-fsanitize=address',
5031 ['mac_write_linker_maps==1', {
5034 '-Wl,-map,>(_target_name).map',
5041 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5042 'target_conditions': [
5043 ['_type=="executable"', {
5049 # Define copy_asan_dylib_path in a variable ending in
5050 # _path so that gyp understands it's a path and
5051 # performs proper relativization during dict merging.
5052 'copy_asan_dylib_path':
5053 'mac/copy_asan_runtime_dylib.sh',
5055 'postbuild_name': 'Copy ASan runtime dylib',
5057 '<(copy_asan_dylib_path)',
5066 ], # target_conditions
5067 }, # target_defaults
5068 }], # OS=="mac" or OS=="ios"
5070 'target_defaults': {
5072 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5073 # with common names, like 'check', 'require', and 'verify'.
5074 # (Included by system header. Also exists on iOS but not included.)
5075 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5076 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5079 # These should end with %, but there seems to be a bug with % in
5080 # variables that are intended to be set to different values in
5081 # different targets, like these.
5082 'mac_pie': 1, # Most executables can be position-independent.
5083 # Strip debugging symbols from the target.
5084 'mac_strip': '<(mac_strip_release)',
5088 ['mac_want_real_dsym=="default"', {
5091 'mac_real_dsym': '<(mac_want_real_dsym)'
5096 ['mac_want_real_dsym=="default"', {
5097 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5099 'mac_real_dsym': '<(mac_want_real_dsym)'
5106 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5107 # (Equivalent to -fPIC)
5108 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5109 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5110 # Keep pch files below xcodebuild/.
5111 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5113 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5114 # xcode_setting, but not until all downstream projects' mac bots are
5115 # using xcode >= 4.6, because that's when the default value of the
5116 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5117 # setting is a no-op as far as xcode is concerned, but the compiler
5118 # behaves differently based on whether -fno-strict-aliasing is
5120 '-fno-strict-aliasing', # See http://crbug.com/32204.
5123 'target_conditions': [
5124 ['_type=="executable"', {
5127 # Arranges for data (heap) pages to be protected against
5128 # code execution when running on Mac OS X 10.7 ("Lion"), and
5129 # ensures that the position-independent executable (PIE) bit
5130 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5132 # Define change_mach_o_flags in a variable ending in _path
5133 # so that GYP understands it's a path and performs proper
5134 # relativization during dict merging.
5135 'change_mach_o_flags_path':
5136 'mac/change_mach_o_flags_from_xcode.sh',
5137 'change_mach_o_flags_options%': [
5139 'target_conditions': [
5140 ['mac_pie==0 or release_valgrind_build==1', {
5141 # Don't enable PIE if it's unwanted. It's unwanted if
5142 # the target specifies mac_pie=0 or if building for
5143 # Valgrind, because Valgrind doesn't understand slide.
5144 # See the similar mac_pie/release_valgrind_build check
5146 'change_mach_o_flags_options': [
5152 'postbuild_name': 'Change Mach-O Flags',
5154 '<(change_mach_o_flags_path)',
5155 '>@(change_mach_o_flags_options)',
5159 'target_conditions': [
5160 ['mac_pie==1 and release_valgrind_build==0', {
5161 # Turn on position-independence (ASLR) for executables. When
5162 # PIE is on for the Chrome executables, the framework will
5163 # also be subject to ASLR.
5164 # Don't do this when building for Valgrind, because Valgrind
5165 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5166 # understand slide, and get rid of the Valgrind check.
5169 '-Wl,-pie', # Position-independent executable (MH_PIE)
5175 ['(_type=="executable" or _type=="shared_library" or \
5176 _type=="loadable_module") and mac_strip!=0', {
5177 'target_conditions': [
5178 ['mac_real_dsym == 1', {
5179 # To get a real .dSYM bundle produced by dsymutil, set the
5180 # debug information format to dwarf-with-dsym. Since
5181 # strip_from_xcode will not be used, set Xcode to do the
5182 # stripping as well.
5186 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5187 'DEPLOYMENT_POSTPROCESSING': 'YES',
5188 'STRIP_INSTALLED_PRODUCT': 'YES',
5190 # Only strip non-ASan builds.
5192 'target_conditions': [
5193 ['_type=="shared_library" or _type=="loadable_module"', {
5194 # The Xcode default is to strip debugging symbols
5195 # only (-S). Local symbols should be stripped as
5196 # well, which will be handled by -x. Xcode will
5197 # continue to insert -S when stripping even when
5198 # additional flags are added with STRIPFLAGS.
5200 }], # _type=="shared_library" or _type=="loadable_module"
5201 ], # target_conditions
5207 }, # configuration "Release"
5209 }, { # mac_real_dsym != 1
5210 # To get a fast fake .dSYM bundle, use a post-build step to
5211 # produce the .dSYM and strip the executable. strip_from_xcode
5212 # only operates in the Release configuration.
5216 # Define strip_from_xcode in a variable ending in _path
5217 # so that gyp understands it's a path and performs proper
5218 # relativization during dict merging.
5219 'strip_from_xcode_path': 'mac/strip_from_xcode',
5221 'postbuild_name': 'Strip If Needed',
5222 'action': ['<(strip_from_xcode_path)'],
5226 ], # target_conditions
5227 }], # (_type=="executable" or _type=="shared_library" or
5228 # _type=="loadable_module") and mac_strip!=0
5229 ], # target_conditions
5230 }, # target_defaults
5234 'ios/coverage.gypi',
5236 'target_defaults': {
5237 'xcode_settings' : {
5238 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5241 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5242 # additional flag to suppress the "unknown compiler option" error.
5243 # Restrict this flag to builds that are either compiling with Xcode
5244 # or compiling with Xcode's Clang. This will allow Ninja builds to
5245 # continue failing on unknown compiler options.
5246 # TODO(rohitrao): This flag is temporary and should be removed as
5247 # soon as the iOS bots are updated to use Xcode 5.1.
5248 ['clang_xcode==1', {
5250 '-Wno-unknown-warning-option',
5254 # Limit the valid architectures depending on "target_subarch".
5255 # This need to include the "arm" architectures but also the "x86"
5256 # ones (they are used when building for the simulator).
5257 ['target_subarch=="arm32"', {
5258 'VALID_ARCHS': ['armv7', 'i386'],
5260 ['target_subarch=="arm64"', {
5261 'VALID_ARCHS': ['arm64', 'x86_64'],
5263 ['target_subarch=="both"', {
5264 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5266 ['use_system_libcxx==1', {
5267 'target_conditions': [
5268 # Only use libc++ when building target for iOS not when building
5269 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5270 # does not support libc++.
5271 ['_toolset=="target"', {
5272 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5276 # The default for deployment target of 7.0+ is libc++, so force
5277 # the old behavior unless libc++ is enabled.
5278 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5282 'target_conditions': [
5283 ['_toolset=="host"', {
5285 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5286 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5295 ['_toolset=="target"', {
5297 # This section should be for overriding host settings. But,
5298 # since we can't negate the iphone deployment target above, we
5299 # instead set it here for target only.
5300 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5301 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5304 ['_type=="executable"', {
5308 'DEPLOYMENT_POSTPROCESSING': 'YES',
5309 'STRIP_INSTALLED_PRODUCT': 'YES',
5314 # Remove dSYM to reduce build time.
5315 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5321 ['chromium_ios_signing', {
5322 # iOS SDK wants everything for device signed.
5323 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5325 'CODE_SIGNING_REQUIRED': 'NO',
5326 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5331 ], # target_conditions
5332 }, # target_defaults
5335 'target_defaults': {
5337 '_WIN32_WINNT=0x0603',
5344 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5345 'WIN32_LEAN_AND_MEAN',
5348 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5349 '_HAS_EXCEPTIONS=0',
5350 # Silence some warnings; we can't switch the the 'recommended'
5351 # versions as they're not available on old OSs.
5352 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5355 ['buildtype=="Official"', {
5356 # In official builds, targets can self-select an optimization
5357 # level by defining a variable named 'optimize', and setting it
5359 # - "size", optimizes for minimal code size - the default.
5360 # - "speed", optimizes for speed over code size.
5361 # - "max", whole program optimization and link-time code
5362 # generation. This is very expensive and should be used
5365 'optimize%': 'size',
5369 # Set /LTCG for the official builds.
5370 'LinkTimeCodeGeneration': '1',
5371 'AdditionalOptions': [
5372 # Set the number of LTCG code-gen threads to eight.
5373 # The default is four. This gives a 5-10% link speedup.
5378 'target_conditions': [
5379 ['optimize=="size"', {
5381 'VCCLCompilerTool': {
5382 # 1, optimizeMinSpace, Minimize Size (/O1)
5383 'Optimization': '1',
5384 # 2, favorSize - Favor small code (/Os)
5385 'FavorSizeOrSpeed': '2',
5390 ['optimize=="speed"', {
5392 'VCCLCompilerTool': {
5393 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5394 'Optimization': '2',
5395 # 1, favorSpeed - Favor fast code (/Ot)
5396 'FavorSizeOrSpeed': '1',
5401 ['optimize=="max"', {
5402 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5403 # builds. Probably anything that this would catch that
5404 # wouldn't be caught in a normal build isn't going to
5405 # actually be a bug, so the incremental value of C4702 for
5406 # PGO builds is likely very small.
5407 'msvs_disabled_warnings': [
5411 'VCCLCompilerTool': {
5412 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5413 'Optimization': '2',
5414 # 1, favorSpeed - Favor fast code (/Ot)
5415 'FavorSizeOrSpeed': '1',
5416 # This implies link time code generation.
5417 'WholeProgramOptimization': 'true',
5425 ['msvs_xtree_patched!=1', {
5426 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5427 # it's enabled. This will generally only be true for system-level
5428 # installed Express users.
5429 'msvs_disabled_warnings': [
5434 'msvs_system_include_dirs': [
5435 '<(windows_sdk_path)/Include/shared',
5436 '<(windows_sdk_path)/Include/um',
5437 '<(windows_sdk_path)/Include/winrt',
5438 '$(VSInstallDir)/VC/atlmfc/include',
5440 'msvs_cygwin_shell': 0,
5441 'msvs_disabled_warnings': [
5442 # C4091: 'typedef ': ignored on left of 'X' when no variable is
5444 # This happens in a number of Windows headers. Dumb.
5447 # C4127: conditional expression is constant
5448 # This warning can in theory catch dead code and other problems, but
5449 # triggers in far too many desirable cases where the conditional
5450 # expression is either set by macros or corresponds some legitimate
5451 # compile-time constant expression (due to constant template args,
5452 # conditionals comparing the sizes of different types, etc.). Some of
5453 # these can be worked around, but it's not worth it.
5456 # C4351: new behavior: elements of array 'array' will be default
5458 # This is a silly "warning" that basically just alerts you that the
5459 # compiler is going to actually follow the language spec like it's
5460 # supposed to, instead of not following it like old buggy versions
5461 # did. There's absolutely no reason to turn this on.
5464 # C4355: 'this': used in base member initializer list
5465 # It's commonly useful to pass |this| to objects in a class'
5466 # initializer list. While this warning can catch real bugs, most of
5467 # the time the constructors in question don't attempt to call methods
5468 # on the passed-in pointer (until later), and annotating every legit
5469 # usage of this is simply more hassle than the warning is worth.
5472 # C4503: 'identifier': decorated name length exceeded, name was
5474 # This only means that some long error messages might have truncated
5475 # identifiers in the presence of lots of templates. It has no effect
5476 # on program correctness and there's no real reason to waste time
5477 # trying to prevent it.
5480 # C4611: interaction between 'function' and C++ object destruction is
5482 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5483 # suggests using exceptions instead of setjmp/longjmp for C++, but
5484 # Chromium code compiles without exception support. We therefore have
5485 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5486 # means we have to turn off this warning (and be careful about how
5487 # object destruction happens in such cases).
5490 # TODO(maruel): These warnings are level 4. They will be slowly
5491 # removed as code is fixed.
5492 4100, # Unreferenced formal parameter
5493 4121, # Alignment of a member was sensitive to packing
5494 4244, # Conversion from 'type1' to 'type2', possible loss of data
5495 4481, # Nonstandard extension used: override specifier 'keyword'
5496 4505, # Unreferenced local function has been removed
5497 4510, # Default constructor could not be generated
5498 4512, # Assignment operator could not be generated
5499 4610, # Object can never be instantiated
5500 4996, # 'X': was declared deprecated (for GetVersionEx).
5503 'VCCLCompilerTool': {
5504 'AdditionalOptions': ['/MP'],
5505 'MinimalRebuild': 'false',
5506 'BufferSecurityCheck': 'true',
5507 'EnableFunctionLevelLinking': 'true',
5508 'RuntimeTypeInfo': 'false',
5509 'WarningLevel': '4',
5510 'WarnAsError': 'true',
5511 'DebugInformationFormat': '3',
5512 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5513 'ExceptionHandling': '0',
5515 'VCLibrarianTool': {
5516 'AdditionalOptions': ['/ignore:4221'],
5517 'AdditionalLibraryDirectories': [
5518 '<(windows_sdk_path)/Lib/win8/um/x86',
5522 'AdditionalDependencies': [
5534 'AdditionalLibraryDirectories': [
5535 '<(windows_sdk_path)/Lib/win8/um/x86',
5537 'GenerateDebugInformation': 'true',
5538 'MapFileName': '$(OutDir)\\$(TargetName).map',
5539 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5540 'FixedBaseAddress': '1',
5543 # 1 == /SUBSYSTEM:CONSOLE
5544 # 2 == /SUBSYSTEM:WINDOWS
5545 # Most of the executables we'll ever create are tests
5546 # and utilities with console output.
5550 'GenerateStublessProxies': 'true',
5551 'TypeLibraryName': '$(InputName).tlb',
5552 'OutputDirectory': '$(IntDir)',
5553 'HeaderFileName': '$(InputName).h',
5554 'DLLDataFileName': '$(InputName).dlldata.c',
5555 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5556 'ProxyFileName': '$(InputName)_p.c',
5558 'VCResourceCompilerTool': {
5560 'AdditionalIncludeDirectories': [
5562 '<(SHARED_INTERMEDIATE_DIR)',
5565 'target_conditions': [
5566 ['_type=="executable"', {
5568 'EmbedManifest': 'true',
5571 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5573 'AdditionalManifestFiles': [
5574 '>(win_exe_compatibility_manifest)',
5580 # Building with Clang on Windows is a work in progress and very
5581 # experimental. See crbug.com/82385.
5583 'VCCLCompilerTool': {
5584 'AdditionalOptions': [
5585 '-fmsc-version=1800',
5587 # Many files use intrinsics without including this header.
5588 # TODO(hans): Fix those files, or move this to sub-GYPs.
5591 # TODO(hans): Make this list shorter eventually.
5592 '-Qunused-arguments',
5593 '-Wno-c++11-compat-deprecated-writable-strings',
5594 '-Wno-deprecated-declarations',
5596 '-Wno-enum-conversion',
5597 '-Wno-extra-tokens',
5598 '-Wno-ignored-attributes',
5599 '-Wno-incompatible-pointer-types',
5600 '-Wno-int-to-void-pointer-cast',
5601 '-Wno-invalid-noreturn',
5602 '-Wno-logical-op-parentheses',
5604 '-Wno-missing-braces',
5605 '-Wno-missing-declarations',
5606 '-Wno-msvc-include',
5607 '-Wno-null-dereference',
5608 '-Wno-overloaded-virtual',
5610 '-Wno-pointer-sign',
5612 '-Wno-return-type-c-linkage',
5614 '-Wno-sometimes-uninitialized',
5616 '-Wno-tautological-compare',
5617 '-Wno-unknown-pragmas',
5619 '-Wno-unused-function',
5620 '-Wno-unused-private-field',
5621 '-Wno-unused-value',
5622 '-Wno-unused-variable',
5623 '-Wno-unused-local-typedef', # http://crbug.com/411648
5624 '-Wno-inconsistent-missing-override', #http://crbug.com/428099
5628 ['clang==1 and target_arch=="ia32"', {
5629 'VCCLCompilerTool': {
5630 'WarnAsError': 'false',
5631 'AdditionalOptions': [
5640 ['disable_nacl==1', {
5641 'target_defaults': {
5647 ['OS=="win" and msvs_use_common_linker_extras', {
5648 'target_defaults': {
5663 'AdditionalOptions': [
5674 'AdditionalOptions': ['/largeaddressaware'],
5678 # TODO(asan/win): Move this down into the general
5679 # win-target_defaults section once the 64-bit asan runtime
5680 # exists. See crbug.com/345874.
5681 'VCCLCompilerTool': {
5682 'AdditionalOptions': [
5683 '-fsanitize=address',
5684 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5686 'AdditionalIncludeDirectories': [
5687 # MSVC needs to be able to find the sanitizer headers when
5688 # invoked via /fallback. This is critical for using macros
5689 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5691 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/include_sanitizer',
5695 'AdditionalLibraryDirectories': [
5696 # TODO(hans): If make_clang_dir is absolute, this breaks.
5697 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/lib/windows',
5700 'target_conditions': [
5701 ['component=="shared_library"', {
5703 'AdditionalDependencies': [
5704 'clang_rt.asan_dynamic-i386.lib',
5705 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5709 ['_type=="executable" and component=="static_library"', {
5711 'AdditionalDependencies': [
5712 'clang_rt.asan-i386.lib',
5716 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5718 'AdditionalDependencies': [
5719 'clang_rt.asan_dll_thunk-i386.lib',
5731 'AdditionalOptions': [
5732 # safeseh is not compatible with x64
5744 ['enable_new_npdevice_api==1', {
5745 'target_defaults': {
5747 'ENABLE_NEW_NPDEVICE_API',
5751 # Don't warn about the "typedef 'foo' locally defined but not used"
5752 # for gcc 4.8 and higher.
5753 # TODO: remove this flag once all builds work. See crbug.com/227506
5754 ['gcc_version>=48 and clang==0', {
5755 'target_defaults': {
5757 '-Wno-unused-local-typedefs',
5761 ['gcc_version>=48 and clang==0 and host_clang==1', {
5762 'target_defaults': {
5763 'target_conditions': [
5764 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5768 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5770 'make_global_settings': [
5771 ['CC', '<(make_clang_dir)/bin/clang'],
5772 ['CXX', '<(make_clang_dir)/bin/clang++'],
5773 ['CC.host', '$(CC)'],
5774 ['CXX.host', '$(CXX)'],
5777 ['clang==1 and OS=="win"', {
5778 'make_global_settings': [
5779 # On Windows, gyp's ninja generator only looks at CC.
5780 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5783 ['use_lld==1 and OS=="win"', {
5784 'make_global_settings': [
5785 # Limited to Windows because lld-link is the driver that is compatible
5787 ['LD', '<(make_clang_dir)/bin/lld-link'],
5790 ['OS=="android" and clang==0', {
5791 # Hardcode the compiler names in the Makefile so that
5792 # it won't depend on the environment at make time.
5793 'make_global_settings': [
5794 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5795 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5796 ['CC.host', '<(host_cc)'],
5797 ['CXX.host', '<(host_cxx)'],
5800 ['OS=="linux" and target_arch=="mipsel"', {
5801 'make_global_settings': [
5802 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5803 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5804 ['CC.host', '<(host_cc)'],
5805 ['CXX.host', '<(host_cxx)'],
5808 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5809 # Set default ARM cross compiling on linux. These can be overridden
5810 # using CC/CXX/etc environment variables.
5811 'make_global_settings': [
5812 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5813 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5814 ['CC.host', '<(host_cc)'],
5815 ['CXX.host', '<(host_cxx)'],
5819 # TODO(yyanagisawa): supports GENERATOR==make
5820 # make generator doesn't support CC_wrapper without CC
5821 # in make_global_settings yet.
5822 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5823 'make_global_settings': [
5824 ['CC_wrapper', '<(gomadir)/gomacc'],
5825 ['CXX_wrapper', '<(gomadir)/gomacc'],
5826 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5827 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5831 'target_defaults': {
5832 'target_conditions': [
5833 ['_toolset=="target"', {
5841 # Work-around for http://openradar.appspot.com/20356002
5842 ['_toolset=="target" and _type!="static_library"', {
5852 ['use_lto==1 and clang==0', {
5853 'target_defaults': {
5854 'target_conditions': [
5855 ['_toolset=="target"', {
5857 '-ffat-lto-objects',
5863 ['use_lto==1 and clang==1', {
5864 'target_defaults': {
5865 'target_conditions': [
5866 ['_toolset=="target"', {
5868 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
5874 # Apply a lower LTO optimization level in non-official builds.
5875 ['use_lto==1 and clang==1 and buildtype!="Official"', {
5876 'target_defaults': {
5877 'target_conditions': [
5878 ['_toolset=="target"', {
5880 '-Wl,--plugin-opt,O1',
5883 ['_toolset=="target" and _type!="static_library"', {
5893 ['use_lto==1 and clang==1 and (target_arch=="ia32" or target_arch=="x64")', {
5894 'target_defaults': {
5895 'target_conditions': [
5896 # Required for third_party/zlib/crc_folding.c and various other code
5897 # that uses SSE. TODO(pcc): Remove this once we properly support
5898 # subtarget specific code generation in LLVM.
5899 ['_toolset=="target"', {
5901 '-Wl,-plugin-opt,mcpu=corei7-avx',
5904 ['_toolset=="target" and _type!="static_library"', {
5907 '-Wl,-mcpu,corei7-avx',
5914 ['use_lto==1 and clang==1 and target_arch=="arm"', {
5915 'target_defaults': {
5916 'target_conditions': [
5917 ['_toolset=="target"', {
5918 # Without this flag, LTO produces a .text section that is larger
5919 # than the maximum call displacement, preventing the linker from
5920 # relocating calls (http://llvm.org/PR22999).
5922 '-Wl,-plugin-opt,-function-sections',
5928 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
5929 'target_defaults': {
5930 'target_conditions': [
5931 ['_toolset=="target"', {
5939 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
5940 'target_defaults': {
5941 'target_conditions': [
5942 ['_toolset=="target"', {
5951 'target_defaults': {
5952 'target_conditions': [
5953 ['_toolset=="target"', {
5955 '-fsanitize=cfi-vptr',
5958 '-fsanitize=cfi-vptr',
5962 '-fsanitize=cfi-vptr',
5966 ['_toolset=="target" and _type!="static_library"', {
5969 '-fsanitize=cfi-vptr',
5976 ['cfi_derived_cast==1', {
5977 'target_defaults': {
5978 'target_conditions': [
5979 ['_toolset=="target"', {
5981 '-fsanitize=cfi-derived-cast',
5984 '-fsanitize=cfi-derived-cast',
5988 '-fsanitize=cfi-derived-cast',
5992 ['_toolset=="target" and _type!="static_library"', {
5995 '-fsanitize=cfi-derived-cast',
6002 ['cfi_unrelated_cast==1', {
6003 'target_defaults': {
6004 'target_conditions': [
6005 ['_toolset=="target"', {
6007 '-fsanitize=cfi-unrelated-cast',
6010 '-fsanitize=cfi-unrelated-cast',
6014 '-fsanitize=cfi-unrelated-cast',
6018 ['_toolset=="target" and _type!="static_library"', {
6021 '-fsanitize=cfi-unrelated-cast',
6028 ['cfi_vptr==1 or cfi_derived_cast==1 or cfi_unrelated_cast==1', {
6029 'target_defaults': {
6030 'target_conditions': [
6031 ['_toolset=="target"', {
6033 '-fsanitize-blacklist=<(cfi_blacklist)',
6037 '-fsanitize-blacklist=<(cfi_blacklist)',
6046 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
6047 # This block adds *project-wide* configuration settings to each project
6048 # file. It's almost always wrong to put things here. Specify your
6049 # custom xcode_settings in target_defaults to add them to targets instead.
6052 # In an Xcode Project Info window, the "Base SDK for All Configurations"
6053 # setting sets the SDK on a project-wide basis. In order to get the
6054 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
6055 # here at the project level.
6058 ['mac_sdk_path==""', {
6059 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
6061 'SDKROOT': '<(mac_sdk_path)', # -isysroot
6067 ['ios_sdk_path==""', {
6069 # TODO(justincohen): Ninja only supports simulator for now.
6070 ['"<(GENERATOR)"=="xcode"', {
6071 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6073 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
6077 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6082 # Target both iPhone and iPad.
6083 'TARGETED_DEVICE_FAMILY': '1,2',
6086 ['target_arch=="x64"', {
6091 ['target_arch=="ia32"', {
6100 # The Xcode generator will look for an xcode_settings section at the root
6101 # of each dict and use it to apply settings on a file-wide basis. Most
6102 # settings should not be here, they should be in target-specific
6103 # xcode_settings sections, or better yet, should use non-Xcode-specific
6104 # settings in target dicts. SYMROOT is a special case, because many other
6105 # Xcode variables depend on it, including variables such as
6106 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6107 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6108 # files to appear (when present) in the UI as actual files and not red
6109 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6110 # and therefore SYMROOT, needs to be set at the project level.
6111 'SYMROOT': '<(DEPTH)/xcodebuild',