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 # This is set when building the Android WebView inside the Android
159 # build system, using the 'android' gyp backend. The WebView code is
160 # still built when this is unset, but builds using the normal chromium
162 'android_webview_build%': 0,
164 # This is set when building the Android WebView in ninja for the
166 'android_webview_telemetry_build%': 0,
168 # Set ARM architecture version.
171 # Use aurax11 for clipboard implementation. This is true on linux_aura.
172 'use_clipboard_aurax11%': 0,
176 # If no gomadir is set, it uses the default gomadir.
180 # The system root for cross-compiles. Default: none.
184 # The system libdir used for this ABI.
185 'system_libdir%': 'lib',
187 # Default MIPS arch variant. This is set in the conditions block
188 # below for MIPS targets.
189 'mips_arch_variant%': '',
197 # Set default value of toolkit_views based on OS.
198 ['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 and Windows.
212 ['OS=="mac" or chromeos==1 or OS=="win"', {
216 # Enable the OpenSSL backend on Mac OS.
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 # TODO(sdefresne): change the default from "arm32" to "both" for
251 # "target_subarch" once http://crbug.com/339477 is fixed.
253 # TODO(sdefresne): set the "target_arch" to "arm" once compilation
254 # of skia has been fixed for simulator. http://crbug.com/342377
256 'target_subarch%': 'arm32',
259 # Set arch variants for MIPS platforms.
260 ['target_arch=="mips64el"', {
263 'mips_arch_variant%': 'r6',
265 'mips_arch_variant%': 'r2',
270 ['target_arch=="mipsel"', {
271 'mips_arch_variant%': 'r1',
276 # Copy conditionally-set variables out one scope.
277 'chromeos%': '<(chromeos)',
278 'chromecast%': '<(chromecast)',
279 'host_arch%': '<(host_arch)',
280 'target_arch%': '<(target_arch)',
281 'target_subarch%': '<(target_subarch)',
282 'mips_arch_variant%': '<(mips_arch_variant)',
283 'toolkit_views%': '<(toolkit_views)',
284 'desktop_linux%': '<(desktop_linux)',
285 'use_aura%': '<(use_aura)',
286 'use_ash%': '<(use_ash)',
287 'use_cras%': '<(use_cras)',
288 'use_libpci%': '<(use_libpci)',
289 'use_ozone%': '<(use_ozone)',
290 'use_ozone_evdev%': '<(use_ozone_evdev)',
291 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
292 'embedded%': '<(embedded)',
293 'use_openssl%': '<(use_openssl)',
294 'use_openssl_certs%': '<(use_openssl_certs)',
295 'enable_viewport%': '<(enable_viewport)',
296 'enable_hidpi%': '<(enable_hidpi)',
297 'android_channel%': '<(android_channel)',
298 'android_webview_build%': '<(android_webview_build)',
299 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
300 'use_goma%': '<(use_goma)',
301 'gomadir%': '<(gomadir)',
302 'enable_app_list%': '<(enable_app_list)',
303 'use_default_render_theme%': '<(use_default_render_theme)',
304 'buildtype%': '<(buildtype)',
305 'branding%': '<(branding)',
306 'arm_version%': '<(arm_version)',
307 'sysroot%': '<(sysroot)',
308 'chroot_cmd%': '<(chroot_cmd)',
309 'system_libdir%': '<(system_libdir)',
311 # Set to 1 to enable fast builds. Set to 2 for even faster builds
312 # (it disables debug info for fastest compilation - only for use
313 # on compile-only bots).
316 # Set to 1 to not store any build metadata, e.g. ifdef out all __DATE__
317 # and __TIME__. Set to 0 to reenable the use of these macros in the code
318 # base. See http://crbug.com/314403.
319 'dont_embed_build_metadata%': 1,
321 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
322 # This is useful for parallel compilation tools which can't support /Zi.
323 # Only used on Windows.
326 # Set to 1 to enable dcheck in release.
327 'dcheck_always_on%': 0,
329 # Set to 1 to make a build that disables unshipped tracing events.
330 # Note: this setting is ignored if buildtype=="Official".
331 'tracing_like_official_build%': 0,
333 # Disable image loader component extension by default.
334 'image_loader_extension%': 0,
336 # Set NEON compilation flags.
339 # Detect NEON support at run-time.
340 'arm_neon_optional%': 0,
342 # Use libjpeg-turbo as the JPEG codec used by Chromium.
343 'use_libjpeg_turbo%': 1,
345 # Use system libjpeg. Note that the system's libjepg will be used even if
346 # use_libjpeg_turbo is set.
347 'use_system_libjpeg%': 0,
349 # By default, component is set to static_library and it can be overriden
350 # by the GYP command line or by ~/.gyp/include.gypi.
351 'component%': 'static_library',
353 # /analyze is off by default on Windows because it is very slow and noisy.
354 # Enable with GYP_DEFINES=win_analyze=1
357 # Set to select the Title Case versions of strings in GRD files.
358 'use_titlecase_in_grd%': 0,
360 # Use translations provided by volunteers at launchpad.net. This
361 # currently only works on Linux.
362 'use_third_party_translations%': 0,
364 # Remoting compilation is enabled by default. Set to 0 to disable.
367 # Configuration policy is enabled by default. Set to 0 to disable.
368 'configuration_policy%': 1,
370 # Variable safe_browsing is used to control the build time configuration
371 # for safe browsing feature. Safe browsing can be compiled in 3 different
372 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
373 # reporting features without enabling phishing and malware detection. This
374 # is useful to integrate a third party phishing/malware detection to
375 # existing safe browsing logic.
378 # Web speech is enabled by default. Set to 0 to disable.
379 'enable_web_speech%': 1,
381 # Notifications are compiled in by default. Set to 0 to disable.
382 'notifications%' : 1,
384 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
385 # regular builds and 1 for ASan builds.
386 'mac_want_real_dsym%': 'default',
388 # If this is set, the clang plugins used on the buildbot will be used.
389 # Run tools/clang/scripts/update.sh to make sure they are compiled.
390 # This causes 'clang_chrome_plugins_flags' to be set.
391 # Has no effect if 'clang' is not set as well.
392 'clang_use_chrome_plugins%': 1,
394 # Enable building with ASAN (Clang's -fsanitize=address option).
395 # -fsanitize=address only works with clang, but asan=1 implies clang=1
396 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
398 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
399 # Enable coverage gathering instrumentation in ASan. This flag also
400 # controls coverage granularity (1 for function-level coverage, 2 for
401 # block-level coverage).
403 # Enable intra-object-overflow detection in ASan (experimental).
404 'asan_field_padding%': 0,
406 # Enable Chromium overrides of the default configurations for various
407 # dynamic tools (like ASan).
408 'use_sanitizer_options%': 0,
410 # Enable building with SyzyAsan.
411 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
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%': 1,
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
440 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
441 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
443 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan_vptr/blacklist.txt',
445 # Use the dynamic libraries instrumented by one of the sanitizers
446 # instead of the standard system libraries.
447 'use_instrumented_libraries%': 0,
449 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
450 # stdlibc++ as standard library. This is intended to use for instrumented
452 'use_custom_libcxx%': 0,
454 # Use system libc++ instead of the default C++ library, usually libstdc++.
455 # This is intended for iOS builds only.
456 'use_system_libcxx%': 0,
458 # Use a modified version of Clang to intercept allocated types and sizes
459 # for allocated objects. clang_type_profiler=1 implies clang=1.
460 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
461 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
462 'clang_type_profiler%': 0,
464 # Set to true to instrument the code with function call logger.
465 # See src/third_party/cygprofile/cyg-profile.cc for details.
466 'order_profiling%': 0,
468 # Use the provided profiled order file to link Chrome image with it.
469 # This makes Chrome faster by better using CPU cache when executing code.
470 # This is known as PGO (profile guided optimization).
471 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
472 'order_text_section%' : "",
474 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
475 # libraries on linux x86-64 and arm, plus ASLR.
478 # Whether one-click signin is enabled or not.
479 'enable_one_click_signin%': 0,
481 # Whether to back up data before sync.
482 'enable_pre_sync_backup%': 0,
484 # Enable Chrome browser extensions
485 'enable_extensions%': 1,
488 'enable_google_now%': 1,
490 # Enable basic printing support and UI.
491 'enable_basic_printing%': 1,
493 # Enable printing with print preview. It does not imply
494 # enable_basic_printing. It's possible to build Chrome with preview only.
495 'enable_print_preview%': 1,
497 # Set the version of CLD.
498 # 0: Don't specify the version. This option is for the Finch testing.
503 # For CLD2, the size of the tables that should be included in the build
504 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
506 # See third_party/cld_2/cld_2.gyp for more information.
507 # 0: Small tables, lower accuracy
508 # 2: Large tables, high accuracy
509 'cld2_table_size%': 2,
511 # Enable spell checker.
512 'enable_spellcheck%': 1,
514 # Webrtc compilation is enabled by default. Set to 0 to disable.
517 # Enables use of the session service, which is enabled by default.
518 # Support for disabling depends on the platform.
519 'enable_session_service%': 1,
521 # Enables theme support, which is enabled by default. Support for
522 # disabling depends on the platform.
525 # Enables autofill dialog and associated features; disabled by default.
526 'enable_autofill_dialog%' : 0,
528 # Defaults Wallet integration in Autofill dialog to use production
529 # servers. Unofficial builds won't have the proper API keys.
530 'enable_prod_wallet_service%': 0,
532 # Enables support for background apps.
533 'enable_background%': 1,
535 # Enable the task manager by default.
536 'enable_task_manager%': 1,
538 # Enables used resource whitelist generation; disabled by default.
539 'enable_resource_whitelist_generation%': 0,
541 # Enable FILE support by default.
542 'disable_file_support%': 0,
544 # Enable FTP support by default.
545 'disable_ftp_support%': 0,
547 # Use native android functions in place of ICU. Not supported by most
549 'use_icu_alternatives_on_android%': 0,
551 # Use of precompiled headers on Windows.
553 # This variable may be explicitly set to 1 (enabled) or 0
554 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
555 # This setting will override the default.
558 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
560 'chromium_win_pch%': 0,
563 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
564 # Set this to true when building with Clang.
565 # See http://code.google.com/p/chromium/wiki/Clang for details.
566 # If this is set, clang is used as both host and target compiler in
567 # cross-compile builds.
570 # Use experimental lld linker instead of the platform's default linker.
573 # Enable plug-in installation by default.
574 'enable_plugin_installation%': 1,
576 # Specifies whether to use canvas_skia.cc in place of platform
577 # specific implementations of gfx::Canvas. Affects text drawing in the
579 # TODO(asvitkine): Enable this on all platforms and delete this flag.
580 # http://crbug.com/105550
581 'use_canvas_skia%': 0,
583 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
584 # with one of those tools.
585 'build_for_tool%': '',
587 # If no directory is specified then a temporary directory will be used.
588 'test_isolation_outdir%': '',
589 # True if isolate should fail if the isolate files refer to files
591 'test_isolation_fail_on_missing': 1,
593 'wix_path%': '<(DEPTH)/third_party/wix',
595 # Supervised users are enabled by default.
596 'enable_supervised_users%': 1,
598 # Platform natively supports discardable memory.
599 'native_discardable_memory%': 0,
601 # Platform sends memory pressure signals natively.
602 'native_memory_pressure_signals%': 0,
604 'spdy_proxy_auth_property%' : '',
605 'spdy_proxy_auth_value%' : '',
607 'enable_service_discovery%': 0,
608 'enable_wifi_bootstrapping%': 0,
609 'enable_hangout_services_extension%': 0,
611 # Enable the Syzygy optimization step.
612 'syzygy_optimize%': 0,
614 # Enable hole punching for the protected video.
617 # Temporary hack to allow us to unify blink's definitions of load
618 # completion. blink uses a crazy set of constraints to determine load
619 # completion, but only actually requires them for layout tests. However,
620 # we need to maintain all the old behaviors while the plumbing is put in
621 # place on both sides of the repo boundary.
622 'enable_load_completion_hacks%': 1,
624 # Automatically select platforms under ozone. Turn this off to
625 # build only explicitly selected platforms.
626 'ozone_auto_platforms%': 1,
628 # If this is set clang is used as host compiler, but not as target
629 # compiler. Always do this by default.
632 # Variables to control Link-Time Optimizations (LTO).
633 # Note: the variables must *not* be enabled at the same time.
634 # In this case LTO would 'merge' the optimization flags
635 # at link-time which would lead to all code be optimized with -O2.
636 # Enable LTO on the code compiled with -Os.
637 # See crbug.com/407544
639 # Enable LTO on code compiled with -O2.
643 # A flag for POSIX platforms
650 # A flag for BSD platforms
651 ['OS=="freebsd" or OS=="openbsd"', {
658 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
664 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
665 # OpenSSL's certificate definition.
666 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
667 'use_openssl_certs%': 1,
669 'use_openssl_certs%': 0,
672 # libudev usage. This currently only affects the content layer.
673 ['OS=="linux" and embedded==0', {
679 # Flags to use X11 on non-Mac POSIX platforms.
680 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
687 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
693 # Flags to use pango and cairo.
694 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
703 ['OS=="linux" and embedded==0', {
709 # We always use skia text rendering in Aura on Windows, since GDI
710 # doesn't agree with our BackingStore.
711 # TODO(beng): remove once skia text rendering is on by default.
712 ['use_aura==1 and OS=="win"', {
713 'enable_skia_text%': 1,
716 # A flag to enable or disable our compile-time dependency
717 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
718 # support will be available. This option is useful
719 # for Linux distributions and for Aura.
720 ['OS!="linux" or chromeos==1', {
721 'use_gnome_keyring%': 0,
723 'use_gnome_keyring%': 1,
726 ['OS=="mac" or OS=="ios"', {
727 # Mac and iOS want Title Case strings
728 'use_titlecase_in_grd%': 1,
731 # Enable loader extensions on Chrome OS.
733 'image_loader_extension%': 1,
735 'image_loader_extension%': 0,
738 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
739 'enable_one_click_signin%': 1,
740 'enable_pre_sync_backup%': 1,
744 'enable_extensions%': 0,
745 'enable_google_now%': 0,
747 'enable_spellcheck%': 0,
751 'arm_neon_optional%': 1,
752 'native_discardable_memory%': 1,
753 'native_memory_pressure_signals%': 1,
754 'enable_basic_printing%': 1,
755 'enable_print_preview%': 0,
756 'enable_task_manager%':0,
760 # Android OS includes support for proprietary codecs regardless of
761 # building Chromium or Google Chrome. We also ship Google Chrome and
762 # Chromecast with proprietary codecs.
763 ['OS=="android" or branding=="Chrome" or chromecast==1', {
764 'proprietary_codecs%': 1,
766 'proprietary_codecs%': 0,
769 ['OS=="mac" or OS=="ios"', {
770 'native_discardable_memory%': 1,
771 'native_memory_pressure_signals%': 1,
774 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
775 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
776 'enable_autofill_dialog%': 1,
779 ['buildtype=="Official"', {
780 'enable_prod_wallet_service%': 1,
790 'disable_ftp_support%': 1,
791 'enable_extensions%': 0,
792 'enable_google_now%': 0,
794 'cld2_table_size%': 0,
795 'enable_basic_printing%': 0,
796 'enable_print_preview%': 0,
797 'enable_session_service%': 0,
798 'enable_spellcheck%': 0,
804 'enable_supervised_users%': 0,
805 'enable_task_manager%': 0,
806 'use_system_libcxx%': 1,
807 'support_pre_M6_history_database%': 0,
810 # Use GPU accelerated cross process image transport by default
811 # on linux builds with the Aura window manager
812 ['use_aura==1 and OS=="linux"', {
813 'ui_compositor_image_transport%': 1,
815 'ui_compositor_image_transport%': 0,
818 # Turn precompiled headers on by default.
819 ['OS=="win" and buildtype!="Official"', {
820 'chromium_win_pch%': 1
823 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
824 'enable_plugin_installation%': 0,
826 'enable_plugin_installation%': 1,
829 # Whether PPAPI is enabled.
830 ['OS=="android" or OS=="ios" or embedded==1', {
831 'enable_plugins%': 0,
833 'enable_plugins%': 1,
836 # linux_use_bundled_gold: whether to use the gold linker binary checked
837 # into third_party/binutils. Force this off via GYP_DEFINES when you
838 # are using a custom toolchain and need to control -B in ldflags.
839 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
840 # for component=static_library builds.
841 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
842 'linux_use_bundled_gold%': 1,
844 'linux_use_bundled_gold%': 0,
847 # linux_use_bundled_binutils: whether to use the binary binutils
848 # checked into third_party/binutils. These are not multi-arch so cannot
849 # be used except on x86 and x86-64 (the only two architectures which
850 # are currently checke in). Force this off via GYP_DEFINES when you
851 # are using a custom toolchain and need to control -B in cflags.
852 ['OS=="linux" and (target_arch=="x64")', {
853 'linux_use_bundled_binutils%': 1,
855 'linux_use_bundled_binutils%': 0,
858 # linux_use_gold_flags: whether to use build flags that rely on gold.
859 # On by default for x64 Linux.
860 ['OS=="linux" and target_arch=="x64"', {
861 'linux_use_gold_flags%': 1,
863 'linux_use_gold_flags%': 0,
866 # linux_use_debug_fission: whether to use split DWARF debug info
867 # files. This can reduce link time significantly, but is incompatible
868 # with some utilities such as icecc and ccache. Requires gold and
869 # gcc >= 4.8 or clang.
870 # http://gcc.gnu.org/wiki/DebugFission
871 ['OS=="linux" and target_arch=="x64"', {
872 'linux_use_debug_fission%': 1,
874 'linux_use_debug_fission%': 0,
877 ['OS=="android" or OS=="ios"', {
878 'enable_captive_portal_detection%': 0,
880 'enable_captive_portal_detection%': 1,
883 # Enable Skia UI text drawing incrementally on different platforms.
884 # http://crbug.com/105550
886 # On Aura, this allows per-tile painting to be used in the browser
889 'use_canvas_skia%': 1,
893 'enable_basic_printing%': 0,
894 'enable_print_preview%': 1,
895 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
896 'use_libjpeg_turbo%': 0,
899 # Do not enable the Settings App on ChromeOS.
900 ['enable_app_list==1 and chromeos==0', {
901 'enable_settings_app%': 1,
903 'enable_settings_app%': 0,
906 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
907 # Set some defaults for arm/linux chrome builds
908 'use_allocator%': 'none',
909 # sysroot needs to be an absolute path otherwise it generates
910 # incorrect results when passed to pkg-config
911 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot',
912 }], # OS=="linux" and target_arch=="arm" and chromeos==0
914 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
916 ['target_arch=="x64"', {
917 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
919 ['target_arch=="ia32"', {
920 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
923 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
925 ['OS=="linux" and target_arch=="mipsel"', {
926 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
927 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
930 # Whether tests targets should be run, archived or just have the
931 # dependencies verified. All the tests targets have the '_run' suffix,
932 # e.g. base_unittests_run runs the target base_unittests. The test
933 # target always calls tools/swarming_client/isolate.py. See the script's
934 # --help for more information. Meant to be overriden with GYP_DEFINES.
935 # TODO(maruel): Remove the conditions as more configurations are
937 ['OS!="ios" and OS!="android" and chromeos==0', {
938 'test_isolation_mode%': 'check',
940 'test_isolation_mode%': 'noop',
942 # Whether Android build uses OpenMAX DL FFT.
943 ['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")', {
944 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
945 # When enabled, this will also enable WebAudio support on
946 # Android for these architectures. Default is enabled. Whether
947 # WebAudio is actually available depends on runtime settings
949 'use_openmax_dl_fft%': 1,
951 'use_openmax_dl_fft%': 0,
953 ['OS=="win" or OS=="linux"', {
957 # Turns on compiler optimizations in V8 in Debug build, except
958 # on android_clang, where we're hitting a weird linker error.
959 # TODO(dpranke): http://crbug.com/266155 .
961 'v8_optimized_debug%': 1,
963 'v8_optimized_debug%': 2,
966 # Disable various features by default on embedded.
969 'enable_basic_printing%': 0,
970 'enable_print_preview%': 0,
973 # By default, use ICU data file (icudtl.dat) on all platforms
974 # except when building Android WebView or Chromecast.
975 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
976 # Set the data reduction proxy origin for Android Webview.
977 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0', {
978 'icu_use_data_file_flag%' : 1,
980 'icu_use_data_file_flag%' : 0,
982 ['OS=="win" or OS=="mac"', {
983 'enable_wifi_bootstrapping%' : 1,
986 # Path to sas.dll, which provides the SendSAS function.
987 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
988 ['target_arch=="x64"', {
989 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
991 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
994 # Turn on JNI generation optimizations on non-WebView builds.
995 ['OS=="android" and android_webview_build==0', {
996 'optimize_jni_generation%': 1,
998 'optimize_jni_generation%': 0,
1001 # TODO(baixo): Enable v8_use_external_startup_data
1002 # http://crbug.com/421063
1003 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0 and chromeos==0 and (OS=="android" or OS=="linux" or OS=="mac")', {
1004 'v8_use_external_startup_data': 1,
1006 'v8_use_external_startup_data': 0,
1010 # Set this to 1 to enable use of concatenated impulse responses
1011 # for the HRTF panner in WebAudio.
1012 'use_concatenated_impulse_responses': 1,
1014 # You can set the variable 'use_official_google_api_keys' to 1
1015 # to use the Google-internal file containing official API keys
1016 # for Google Chrome even in a developer build. Setting this
1017 # variable explicitly to 1 will cause your build to fail if the
1018 # internal file is missing.
1020 # The variable is documented here, but not handled in this file;
1021 # see //google_apis/determine_use_official_keys.gypi for the
1024 # Set the variable to 0 to not use the internal file, even when
1025 # it exists in your checkout.
1027 # Leave it unset in your include.gypi to have the variable
1028 # implicitly set to 1 if you have
1029 # src/google_apis/internal/google_chrome_api_keys.h in your
1030 # checkout, and implicitly set to 0 if not.
1032 # Note that official builds always behave as if the variable
1033 # was explicitly set to 1, i.e. they always use official keys,
1034 # and will fail to build if the internal file is missing.
1036 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1037 # include.gypi or by other means. Due to subtleties of GYP, this
1038 # is not the same as leaving the variable unset, even though its
1040 # //google_apis/determine_use_official_keys.gypi is 2.
1042 # Set these to bake the specified API keys and OAuth client
1043 # IDs/secrets into your build.
1045 # If you create a build without values baked in, you can instead
1046 # set environment variables to provide the keys at runtime (see
1047 # src/google_apis/google_api_keys.h for details). Features that
1048 # require server-side APIs may fail to work if no keys are
1051 # Note that if you are building an official build or if
1052 # use_official_google_api_keys has been set to 1 (explicitly or
1053 # implicitly), these values will be ignored and the official
1054 # keys will be used instead.
1055 'google_api_key%': '',
1056 'google_default_client_id%': '',
1057 'google_default_client_secret%': '',
1058 # Native Client is enabled by default.
1059 'disable_nacl%': '0',
1061 # Set to 1 to support old history files
1062 'support_pre_M6_history_database%': '1',
1065 # Copy conditionally-set variables out one scope.
1066 'branding%': '<(branding)',
1067 'buildtype%': '<(buildtype)',
1068 'target_arch%': '<(target_arch)',
1069 'target_subarch%': '<(target_subarch)',
1070 'mips_arch_variant%': '<(mips_arch_variant)',
1071 'host_arch%': '<(host_arch)',
1072 'toolkit_views%': '<(toolkit_views)',
1073 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1074 'use_aura%': '<(use_aura)',
1075 'use_ash%': '<(use_ash)',
1076 'use_cras%': '<(use_cras)',
1077 'use_libpci%': '<(use_libpci)',
1078 'use_openssl%': '<(use_openssl)',
1079 'use_openssl_certs%': '<(use_openssl_certs)',
1080 'use_nss%': '<(use_nss)',
1081 'use_udev%': '<(use_udev)',
1082 'os_bsd%': '<(os_bsd)',
1083 'os_posix%': '<(os_posix)',
1084 'use_dbus%': '<(use_dbus)',
1085 'use_glib%': '<(use_glib)',
1086 'use_pango%': '<(use_pango)',
1087 'use_cairo%': '<(use_cairo)',
1088 'use_ozone%': '<(use_ozone)',
1089 'use_ozone_evdev%': '<(use_ozone_evdev)',
1090 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1091 'desktop_linux%': '<(desktop_linux)',
1092 'use_x11%': '<(use_x11)',
1093 'use_gnome_keyring%': '<(use_gnome_keyring)',
1094 'linux_fpic%': '<(linux_fpic)',
1095 'chromeos%': '<(chromeos)',
1096 'chromecast%': '<(chromecast)',
1097 'enable_viewport%': '<(enable_viewport)',
1098 'enable_hidpi%': '<(enable_hidpi)',
1099 'image_loader_extension%': '<(image_loader_extension)',
1100 'fastbuild%': '<(fastbuild)',
1101 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1102 'win_z7%': '<(win_z7)',
1103 'dcheck_always_on%': '<(dcheck_always_on)',
1104 'tracing_like_official_build%': '<(tracing_like_official_build)',
1105 'arm_version%': '<(arm_version)',
1106 'arm_neon%': '<(arm_neon)',
1107 'arm_neon_optional%': '<(arm_neon_optional)',
1108 'sysroot%': '<(sysroot)',
1109 'chroot_cmd%': '<(chroot_cmd)',
1110 'system_libdir%': '<(system_libdir)',
1111 'component%': '<(component)',
1112 'win_analyze%': '<(win_analyze)',
1113 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1114 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1115 'use_third_party_translations%': '<(use_third_party_translations)',
1116 'remoting%': '<(remoting)',
1117 'enable_one_click_signin%': '<(enable_one_click_signin)',
1118 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1119 'enable_webrtc%': '<(enable_webrtc)',
1120 'chromium_win_pch%': '<(chromium_win_pch)',
1121 'configuration_policy%': '<(configuration_policy)',
1122 'safe_browsing%': '<(safe_browsing)',
1123 'enable_web_speech%': '<(enable_web_speech)',
1124 'notifications%': '<(notifications)',
1125 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1126 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1128 'asan_blacklist%': '<(asan_blacklist)',
1129 'asan_coverage%': '<(asan_coverage)',
1130 'asan_field_padding%': '<(asan_field_padding)',
1131 'use_sanitizer_options%': '<(use_sanitizer_options)',
1132 'syzyasan%': '<(syzyasan)',
1133 'syzygy_optimize%': '<(syzygy_optimize)',
1136 'msan_blacklist%': '<(msan_blacklist)',
1137 'msan_track_origins%': '<(msan_track_origins)',
1139 'tsan_blacklist%': '<(tsan_blacklist)',
1140 'ubsan%': '<(ubsan)',
1141 'ubsan_vptr%': '<(ubsan_vptr)',
1142 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1143 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1144 'use_custom_libcxx%': '<(use_custom_libcxx)',
1145 'use_system_libcxx%': '<(use_system_libcxx)',
1146 'clang_type_profiler%': '<(clang_type_profiler)',
1147 'order_profiling%': '<(order_profiling)',
1148 'order_text_section%': '<(order_text_section)',
1149 'enable_extensions%': '<(enable_extensions)',
1150 'enable_plugin_installation%': '<(enable_plugin_installation)',
1151 'enable_plugins%': '<(enable_plugins)',
1152 'enable_session_service%': '<(enable_session_service)',
1153 'enable_themes%': '<(enable_themes)',
1154 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1155 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1156 'enable_background%': '<(enable_background)',
1157 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1158 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1159 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1160 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1161 'use_canvas_skia%': '<(use_canvas_skia)',
1162 'test_isolation_mode%': '<(test_isolation_mode)',
1163 'test_isolation_outdir%': '<(test_isolation_outdir)',
1164 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1165 'enable_basic_printing%': '<(enable_basic_printing)',
1166 'enable_print_preview%': '<(enable_print_preview)',
1167 'enable_spellcheck%': '<(enable_spellcheck)',
1168 'enable_google_now%': '<(enable_google_now)',
1169 'cld_version%': '<(cld_version)',
1170 'cld2_table_size%': '<(cld2_table_size)',
1171 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1172 'disable_file_support%': '<(disable_file_support)',
1173 'disable_ftp_support%': '<(disable_ftp_support)',
1174 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1175 'enable_task_manager%': '<(enable_task_manager)',
1176 'sas_dll_path%': '<(sas_dll_path)',
1177 'wix_path%': '<(wix_path)',
1178 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1179 'use_system_libjpeg%': '<(use_system_libjpeg)',
1180 'android_channel%': '<(android_channel)',
1181 'android_webview_build%': '<(android_webview_build)',
1182 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
1183 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1184 'gyp_managed_install%': 0,
1185 'create_standalone_apk%': 1,
1186 'enable_app_list%': '<(enable_app_list)',
1187 'use_default_render_theme%': '<(use_default_render_theme)',
1188 'enable_settings_app%': '<(enable_settings_app)',
1189 'google_api_key%': '<(google_api_key)',
1190 'google_default_client_id%': '<(google_default_client_id)',
1191 'google_default_client_secret%': '<(google_default_client_secret)',
1192 'enable_supervised_users%': '<(enable_supervised_users)',
1193 'native_discardable_memory%': '<(native_discardable_memory)',
1194 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1195 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1196 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1197 'enable_mdns%' : '<(enable_mdns)',
1198 'enable_service_discovery%' : '<(enable_service_discovery)',
1199 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1200 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1201 'v8_optimized_debug%': '<(v8_optimized_debug)',
1202 'proprietary_codecs%': '<(proprietary_codecs)',
1203 'use_goma%': '<(use_goma)',
1204 'gomadir%': '<(gomadir)',
1205 'use_lto%': '<(use_lto)',
1206 'use_lto_o2%': '<(use_lto_o2)',
1207 'video_hole%': '<(video_hole)',
1208 'enable_load_completion_hacks%': '<(enable_load_completion_hacks)',
1209 'support_pre_M6_history_database%': '<(support_pre_M6_history_database)',
1210 'v8_use_external_startup_data': '<(v8_use_external_startup_data)',
1212 # Whether or not we are building the Athena shell.
1215 # Use system protobuf instead of bundled one.
1216 'use_system_protobuf%': 0,
1218 # Use system yasm instead of bundled one.
1219 'use_system_yasm%': 0,
1221 # Use system ICU instead of bundled one.
1222 'use_system_icu%' : 0,
1224 # Default to enabled PIE; this is important for ASLR but we may need to be
1225 # able to turn it off for various reasons.
1226 'linux_disable_pie%': 0,
1228 # The release channel that this build targets. This is used to restrict
1229 # channel-specific build options, like which installer packages to create.
1230 # The default is 'all', which does no channel-specific filtering.
1233 # Override chromium_mac_pch and set it to 0 to suppress the use of
1234 # precompiled headers on the Mac. Prefix header injection may still be
1235 # used, but prefix headers will not be precompiled. This is useful when
1236 # using distcc to distribute a build to compile slaves that don't
1237 # share the same compiler executable as the system driving the compilation,
1238 # because precompiled headers rely on pointers into a specific compiler
1239 # executable's image. Setting this to 0 is needed to use an experimental
1240 # Linux-Mac cross compiler distcc farm.
1241 'chromium_mac_pch%': 1,
1243 # The default value for mac_strip in target_defaults. This cannot be
1244 # set there, per the comment about variable% in a target_defaults.
1245 'mac_strip_release%': 0,
1247 # Set to 1 to enable java code coverage. Instruments classes during build
1248 # to produce .ec files during runtime.
1249 'emma_coverage%': 0,
1251 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1252 # separated with whitespace and/or comma. Only has effect if
1253 # 'emma_coverage=1'.
1256 # Set to 1 to enable running Android lint on java/class files.
1259 # Although base/allocator lets you select a heap library via an
1260 # environment variable, the libcmt shim it uses sometimes gets in
1261 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1262 # 'win_use_allocator_shim': 0,
1263 # 'win_release_RuntimeLibrary': 2
1264 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1265 'win_use_allocator_shim%': 0, # 1 = shim allocator via libcmt; 0 = msvcrt
1267 # TODO(bradnelson): eliminate this when possible.
1268 # To allow local gyp files to prevent release.vsprops from being included.
1269 # Yes(1) means include release.vsprops.
1270 # Once all vsprops settings are migrated into gyp, this can go away.
1271 'msvs_use_common_release%': 1,
1273 # TODO(bradnelson): eliminate this when possible.
1274 # To allow local gyp files to override additional linker options for msvs.
1275 # Yes(1) means set use the common linker options.
1276 'msvs_use_common_linker_extras%': 1,
1278 # TODO(sgk): eliminate this if possible.
1279 # It would be nicer to support this via a setting in 'target_defaults'
1280 # in chrome/app/locales/locales.gypi overriding the setting in the
1281 # 'Debug' configuration in the 'target_defaults' dict below,
1282 # but that doesn't work as we'd like.
1283 'msvs_debug_link_incremental%': '2',
1285 # Needed for some of the largest modules.
1286 'msvs_debug_link_nonincremental%': '1',
1288 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1289 # to get incremental linking to be faster in debug builds.
1290 'incremental_chrome_dll%': '0',
1292 # Experimental setting to break chrome.dll into multiple pieces based on
1294 'chrome_multiple_dll%': '0',
1296 # Experimental setting to optimize Chrome's DLLs with PGO.
1297 'chrome_pgo_phase%': '0',
1299 # Whether the VS xtree header has been patched to disable warning 4702. If
1300 # it has, then we don't need to disable 4702 (unreachable code warning).
1301 # The patch is preapplied to the internal toolchain and hence all bots.
1302 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1305 'clang%': '<(clang)',
1306 'host_clang%': '<(host_clang)',
1307 'make_clang_dir%': '<(make_clang_dir)',
1308 'use_lld%': '<(use_lld)',
1310 # Control which version of clang to use when building for iOS. If set to
1311 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1312 # the version of clang that ships with the Chromium source. This variable
1313 # is automatically set to '1' when using the Xcode generator.
1316 # These two variables can be set in GYP_DEFINES while running
1317 # |gclient runhooks| to let clang run a plugin in every compilation.
1318 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1320 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1323 'clang_add_plugin%': '',
1325 # Tell ld64 to write map files describing binary layout. Useful
1326 # for looking at what contributes to binary size, e.g. with
1327 # https://github.com/nico/bloat
1328 'mac_write_linker_maps%': 0,
1330 # The default type of gtest.
1331 'gtest_target_type%': 'executable',
1333 # Enable sampling based profiler.
1334 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1336 # Profile without optimizing out stack frames when profiling==1.
1337 'profiling_full_stack_frames%': '0',
1339 # And if we want to dump symbols for Breakpad-enabled builds.
1340 'linux_dump_symbols%': 0,
1341 # And if we want to strip the binary after dumping symbols.
1342 'linux_strip_binary%': 0,
1343 # If we want stack unwind support for backtrace().
1344 'debug_unwind_tables%': 1,
1345 'release_unwind_tables%': 1,
1347 # Override where to find binutils
1348 'binutils_version%': 0,
1349 'binutils_dir%': '',
1352 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1353 'use_allocator%': 'tcmalloc',
1355 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1356 'linux_link_gnome_keyring%': 0,
1357 # Set to 1 to link against gsettings APIs instead of using dlopen().
1358 'linux_link_gsettings%': 0,
1360 # Enable use of OpenMAX DL FFT routines.
1361 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1363 # Enable new NPDevice API.
1364 'enable_new_npdevice_api%': 0,
1366 # .gyp files or targets should set chromium_code to 1 if they build
1367 # Chromium-specific code, as opposed to external code. This variable is
1368 # used to control such things as the set of warnings to enable, and
1369 # whether warnings are treated as errors.
1370 'chromium_code%': 0,
1372 # Disable fatal linker warnings, similarly to how we make it possible
1373 # to disable -Werror (e.g. for different toolchain versions).
1374 'disable_fatal_linker_warnings%': 0,
1376 'release_valgrind_build%': 0,
1378 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1379 'enable_wexit_time_destructors%': 0,
1381 # Build libpeerconnection as a static library by default.
1382 'libpeer_target_type%': 'static_library',
1384 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1385 'internal_gles2_conform_tests%': 0,
1387 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1388 'internal_khronos_glcts_tests%': 0,
1390 # Set to 1 to compile the filter fuzzer.
1391 'internal_filter_fuzzer%': 0,
1393 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1394 # so Cocoa is happy (http://crbug.com/20441).
1396 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1397 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1398 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1399 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1400 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1401 'vi', 'zh-CN', 'zh-TW',
1404 # Pseudo locales are special locales which are used for testing and
1405 # debugging. They don't get copied to the final app. For more info,
1406 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1413 # If debug_devtools is set to 1, JavaScript files for DevTools are
1414 # stored as is and loaded from disk. Otherwise, a concatenated file
1415 # is stored in resources.pak. It is still possible to load JS files
1416 # from disk by passing --debug-devtools cmdline switch.
1417 'debug_devtools%': 0,
1419 # The Java Bridge is not compiled in by default.
1422 # Code signing for iOS binaries. The bots need to be able to disable this.
1423 'chromium_ios_signing%': 1,
1425 # This flag is only used when disable_nacl==0 and disables all those
1426 # subcomponents which would require the installation of a native_client
1427 # untrusted toolchain.
1428 'disable_nacl_untrusted%': 0,
1430 # Disable Dart by default.
1433 # Copy out the setting of disable_nacl.
1434 'disable_nacl%': '<(disable_nacl)',
1436 # Portable Native Client is enabled by default.
1437 'disable_pnacl%': 0,
1439 # Whether to build full debug version for Debug configuration on Android.
1440 # Compared to full debug version, the default Debug configuration on Android
1441 # has no full v8 debug, has size optimization and linker gc section, so that
1442 # we can build a debug version with acceptable size and performance.
1443 'android_full_debug%': 0,
1445 # Sets the default version name and code for Android app, by default we
1446 # do a developer build.
1447 'android_app_version_name%': 'Developer Build',
1448 'android_app_version_code%': 1,
1450 # Contains data about the attached devices for gyp_managed_install.
1451 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1453 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1454 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1456 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1457 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1459 # Whether we are using the rlz library or not. Platforms like Android send
1460 # rlz codes for searches but do not use the library.
1463 # Turns on the i18n support in V8.
1464 'v8_enable_i18n_support': 1,
1466 # Compile d8 for the host toolset.
1467 'v8_toolset_for_d8': 'host',
1469 # Use brlapi from brltty for braille display support.
1472 # Relative path to icu.gyp from this file.
1473 'icu_gyp_path': '../third_party/icu/icu.gyp',
1475 # IPC fuzzer is disabled by default.
1476 'enable_ipc_fuzzer%': 0,
1478 # Force disable libstdc++ debug mode.
1479 'disable_glibcxx_debug%': 0,
1481 # Set to 1 to compile with MSE support for MPEG2 TS
1482 'enable_mpeg2ts_stream_parser%': 0,
1484 # Support ChromeOS touchpad gestures with ozone.
1485 'use_evdev_gestures%': 0,
1487 # Default ozone platform (if no --ozone-platform flag).
1488 'ozone_platform%': "",
1490 # Ozone platforms to include in the build.
1491 'ozone_platform_caca%': 0,
1492 'ozone_platform_dri%': 0,
1493 'ozone_platform_egltest%': 0,
1494 'ozone_platform_gbm%': 0,
1495 'ozone_platform_ozonex%': 0,
1496 'ozone_platform_test%': 0,
1498 # Whether the browser is non-native (using Views Toolkit) on Mac.
1499 'mac_views_browser%': 0,
1501 # Experiment: http://crbug.com/426914
1505 ['buildtype=="Official"', {
1506 # Continue to embed build meta data in Official builds, basically the
1507 # time it was built.
1508 # TODO(maruel): This decision should be revisited because having an
1509 # official deterministic build has high value too but MSVC toolset can't
1510 # generate anything deterministic with WPO enabled AFAIK.
1511 'dont_embed_build_metadata%': 0,
1513 # Enable the Syzygy optimization step for the official builds.
1514 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1515 'syzygy_optimize%': 1,
1517 'syzygy_optimize%': 0,
1519 # Get binutils version so we can enable debug fission if we can.
1520 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1522 # compiler_version doesn't work with clang
1523 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1524 # compiler_version works with clang.
1525 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1526 # that it takes effect here.
1527 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1528 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1530 # On Android we know the binutils version in the toolchain.
1532 'binutils_version%': 222,
1534 ['host_arch=="x64"', {
1535 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1537 ['host_arch=="ia32"', {
1538 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1540 # Our version of binutils in third_party/binutils
1541 ['linux_use_bundled_binutils==1', {
1542 'binutils_version%': 224,
1546 'binutils_version%': 0,
1548 # The version of GCC in use, set later in platforms that use GCC and have
1549 # not explicitly chosen to build with clang. Currently, this means all
1550 # platforms except Windows, Mac and iOS.
1551 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1552 # it takes effect here.
1553 ['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', {
1555 ['OS=="android" and android_webview_build==0', {
1556 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1557 # We directly set the gcc version since we know what we use.
1560 ['OS=="android" and android_webview_build==1', {
1561 # Android WebView uses a hermetic clang toolchain for host builds.
1562 'host_gcc_version%': 0,
1563 # Android WebView uses the GCC toolchain from the Android build.
1567 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1568 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1572 'host_gcc_version%': 0,
1575 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1576 'windows_sdk_path%': '<(windows_sdk_default_path)',
1578 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1580 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1581 'directx_sdk_path%': '<(directx_sdk_default_path)',
1583 'directx_sdk_path%': '$(DXSDK_DIR)',
1586 'windows_driver_kit_path%': '$(WDK_DIR)',
1588 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1590 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1593 'nacl_untrusted_build%': 0,
1594 'use_allocator%': 'none',
1596 ['OS=="linux" and target_arch=="mipsel"', {
1597 'sysroot%': '<(sysroot)',
1600 # All Chrome builds have breakpad symbols, but only process the
1601 # symbols from official builds.
1602 ['(branding=="Chrome" and buildtype=="Official")', {
1603 'linux_dump_symbols%': 1,
1605 # Omit unwind support in official release builds to save space. We
1606 # can use breakpad for these builds.
1607 'release_unwind_tables%': 0,
1610 # For official builds, use a 64-bit linker to avoid running out
1611 # of address space. The buildbots should have a 64-bit kernel
1612 # and a 64-bit libc installed.
1613 ['host_arch=="ia32" and target_arch=="ia32"', {
1614 'linux_use_bundled_gold%': '1',
1615 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1620 }], # os_posix==1 and OS!="mac" and OS!="ios"
1623 'enable_background%': 0,
1624 'icu_use_data_file_flag%': 1,
1625 'enable_web_speech%': 0,
1626 'use_system_libxml%': 1,
1627 'use_system_sqlite%': 1,
1629 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1630 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1631 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1632 'uk', 'vi', 'zh-CN', 'zh-TW',
1635 # iOS SDK and deployment target support. The |ios_sdk| value is left
1636 # blank so that when it is set in the project files it will be the
1637 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1638 # causes Xcode to spit out a warning for every single project file for
1639 # not using the "current" SDK.
1641 'ios_sdk_path%': '',
1642 'ios_deployment_target%': '7.0',
1645 # ios_product_name is set to the name of the .app bundle as it should
1647 ['branding=="Chrome"', {
1648 'ios_product_name%': 'Chrome',
1649 }, { # else: branding!="Chrome"
1650 'ios_product_name%': 'Chromium',
1652 ['branding=="Chrome" and buildtype=="Official"', {
1654 }, { # else: branding!="Chrome" or buildtype!="Official"
1660 # Location of Android NDK.
1663 # Unfortunately we have to use absolute paths to the SDK/NDK because
1664 # they're passed to ant which uses a different relative path from
1666 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1667 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1668 'android_host_arch%': '<!(uname -m)',
1669 # Android API-level of the SDK used for compilation.
1670 'android_sdk_version%': '21',
1671 'android_sdk_build_tools_version%': '21.0.1',
1672 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1674 # Copy conditionally-set variables out one scope.
1675 'android_ndk_root%': '<(android_ndk_root)',
1676 'android_sdk_root%': '<(android_sdk_root)',
1677 'android_sdk_version%': '<(android_sdk_version)',
1678 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1679 'host_os%': '<(host_os)',
1681 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1682 # Android SDK build tools (e.g. dx, aapt, aidl)
1683 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1685 # Android API level 14 is ICS (Android 4.0) which is the minimum
1686 # platform requirement for Chrome on Android, we use it for native
1689 ['target_arch == "ia32"', {
1690 'android_app_abi%': 'x86',
1691 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1692 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1693 'android_ndk_lib_dir%': 'usr/lib',
1694 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1696 ['target_arch == "x64"', {
1697 'android_app_abi%': 'x86_64',
1698 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1699 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1700 'android_ndk_lib_dir%': 'usr/lib64',
1701 'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1703 ['target_arch=="arm"', {
1706 'android_app_abi%': 'armeabi',
1708 'android_app_abi%': 'armeabi-v7a',
1711 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1712 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1713 'android_ndk_lib_dir%': 'usr/lib',
1714 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1716 ['target_arch == "arm64"', {
1717 'android_app_abi%': 'arm64-v8a',
1718 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1719 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1720 'android_ndk_lib_dir%': 'usr/lib',
1721 'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1723 ['target_arch == "mipsel"', {
1724 'android_app_abi%': 'mips',
1725 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1726 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1727 'android_ndk_lib_dir%': 'usr/lib',
1728 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1730 ['target_arch == "mips64el"', {
1731 'android_app_abi%': 'mips64',
1732 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1733 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1734 'android_ndk_lib_dir%': 'usr/lib64',
1735 'android_toolchain%': '<(android_ndk_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1740 # Copy conditionally-set variables out one scope.
1741 'android_app_abi%': '<(android_app_abi)',
1742 'android_gdbserver%': '<(android_gdbserver)',
1743 'android_ndk_root%': '<(android_ndk_root)',
1744 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1745 'android_sdk_root%': '<(android_sdk_root)',
1746 'android_sdk_version%': '<(android_sdk_version)',
1747 'android_toolchain%': '<(android_toolchain)',
1749 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1750 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1751 'android_sdk_tools%': '<(android_sdk_tools)',
1752 'android_sdk%': '<(android_sdk)',
1753 'android_sdk_jar%': '<(android_sdk)/android.jar',
1755 'android_stlport_root': '<(android_stlport_root)',
1756 'android_stlport_include': '<(android_stlport_root)/stlport',
1757 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1758 'host_os%': '<(host_os)',
1760 # Location of the "objcopy" binary, used by both gyp and scripts.
1761 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1763 # Location of the "strip" binary, used by both gyp and scripts.
1764 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1766 # Location of the "readelf" binary.
1767 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1769 # Determines whether we should optimize JNI generation at the cost of
1770 # breaking assumptions in the build system that when inputs have changed
1771 # the outputs should always change as well. This is meant purely for
1772 # developer builds, to avoid spurious re-linking of native files.
1773 'optimize_jni_generation%': '<(optimize_jni_generation)',
1775 # Always uses openssl.
1777 'use_openssl_certs%': 1,
1779 'proprietary_codecs%': '<(proprietary_codecs)',
1780 'safe_browsing%': 2,
1781 'enable_web_speech%': 0,
1783 'build_ffmpegsumo%': 0,
1784 'use_allocator%': 'none',
1786 # Disable Native Client.
1789 # Android does not support background apps.
1790 'enable_background%': 0,
1792 # Sessions are store separately in the Java side.
1793 'enable_session_service%': 0,
1797 'gtest_target_type%': 'shared_library',
1799 # Uses system APIs for decoding audio and video.
1800 'use_libffmpeg%': '0',
1802 # TODO(torne): Remove this unsupported option once all the places that
1803 # test it have been updated.
1804 'use_system_stlport%': 0,
1806 # Copy it out one scope.
1807 'android_webview_build%': '<(android_webview_build)',
1809 # Default android linker script for shared library exports.
1810 'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_exports.lst',
1813 'use_system_fontconfig%': 0,
1815 'use_system_fontconfig%': 1,
1818 'enable_mpeg2ts_stream_parser%': 1,
1819 'ffmpeg_branding%': 'Chrome',
1820 'ozone_platform_ozonex%': 1,
1821 'use_playready%': 0,
1823 ['target_arch=="arm"', {
1825 'arm_tune%': 'cortex-a9',
1831 ['android_webview_build==1', {
1832 # When building the WebView in the Android tree, jarjar will remap all
1833 # the class names, so the JNI generator needs to know this.
1834 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1836 ['OS=="linux" and target_arch!="mipsel"', {
1837 # TODO(thakis): This is here to measure perf for a while.
1842 # All Chrome builds have breakpad symbols, but only process the
1843 # symbols from official builds.
1844 ['(branding=="Chrome" and buildtype=="Official")', {
1845 'mac_strip_release%': 1,
1849 ['OS=="mac" or OS=="ios"', {
1853 # Mac OS X SDK and deployment target support. The SDK identifies
1854 # the version of the system headers that will be used, and
1855 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1856 # macro. "Maximum allowed" refers to the operating system version
1857 # whose APIs are available in the headers. The deployment target
1858 # identifies the minimum system version that the built products are
1859 # expected to function on. It corresponds to the
1860 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1861 # macros are available, #include <AvailabilityMacros.h>. Additional
1862 # documentation on these macros is available at
1863 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1864 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1865 # deployment target to 10.6. Other projects, such as O3D, may
1866 # override these defaults.
1868 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1869 # about that is at least the specified version. In official builds,
1870 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1871 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1872 # path to the SDK; when set to a non-empty string, SDK detection
1873 # based on mac_sdk_min will be bypassed entirely.
1876 'mac_sdk_min%': '10.8',
1877 }, { # else OS!="ios"
1878 'mac_sdk_min%': '10.6',
1881 'mac_sdk_path%': '',
1883 'mac_deployment_target%': '10.6',
1886 'mac_sdk_min': '<(mac_sdk_min)',
1887 'mac_sdk_path': '<(mac_sdk_path)',
1888 'mac_deployment_target': '<(mac_deployment_target)',
1890 # Compile in Breakpad support by default so that it can be
1891 # tested, even if it is not enabled by default at runtime.
1892 'mac_breakpad_compiled_in%': 1,
1894 # mac_product_name is set to the name of the .app bundle as it should
1895 # appear on disk. This duplicates data from
1896 # chrome/app/theme/chromium/BRANDING and
1897 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1898 # these names into the build system.
1899 ['branding=="Chrome"', {
1900 'mac_product_name%': 'Google Chrome',
1901 }, { # else: branding!="Chrome"
1902 'mac_product_name%': 'Chromium',
1904 # Official mac builds require a specific OS X SDK, but iOS and
1905 # non-official mac builds do not.
1906 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1907 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1909 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1911 ['branding=="Chrome" and buildtype=="Official"', {
1912 # Enable uploading crash dumps.
1913 'mac_breakpad_uploads%': 1,
1914 # Enable dumping symbols at build time for use by Mac Breakpad.
1916 # Enable Keystone auto-update support.
1918 }, { # else: branding!="Chrome" or buildtype!="Official"
1919 'mac_breakpad_uploads%': 0,
1924 }], # OS=="mac" or OS=="ios"
1927 # This is the architecture convention used in WinSDK paths.
1928 ['target_arch=="ia32"', {
1929 'winsdk_arch%': 'x86',
1931 'winsdk_arch%': '<(target_arch)',
1933 ['component=="shared_library"', {
1934 'win_use_allocator_shim%': 0,
1936 # Turn on multiple dll by default on Windows when in static_library.
1937 'chrome_multiple_dll%': 1,
1940 'win_use_allocator_shim%': 0,
1942 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1943 # Only enabled by default for ninja because it's buggy in VS.
1944 # Not enabled for component=static_library because some targets
1945 # are too large and the toolchain fails due to the size of the
1947 'incremental_chrome_dll%': 1,
1949 # Don't do incremental linking for large modules on 32-bit or when
1950 # component=static_library as the toolchain fails due to the size of
1952 ['MSVS_OS_BITS==32 or component=="static_library"', {
1953 'msvs_large_module_debug_link_mode%': '1', # No
1955 'msvs_large_module_debug_link_mode%': '2', # Yes
1958 'nacl_win64_defines': [
1959 # This flag is used to minimize dependencies when building
1960 # Native Client loader for 64-bit Windows.
1965 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1971 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1972 'enable_pepper_cdms%': 1,
1974 'enable_pepper_cdms%': 0,
1978 'enable_browser_cdms%': 1,
1980 'enable_browser_cdms%': 0,
1983 # Native Client glibc toolchain is enabled
1984 # by default except on arm, mips and mips64.
1985 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
1986 'disable_glibc%': 1,
1988 'disable_glibc%': 0,
1991 # Set the relative path from this file to the GYP file of the JPEG
1992 # library used by Chromium.
1993 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1994 # Configuration for using the system libjeg is here.
1995 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1997 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
2000 # Options controlling the use of GConf (the classic GNOME configuration
2001 # system) and GIO, which contains GSettings (the new GNOME config system).
2002 ['chromeos==1 or embedded==1', {
2010 # Set up -D and -E flags passed into grit.
2011 ['branding=="Chrome"', {
2012 # TODO(mmoss) The .grd files look for _google_chrome, but for
2013 # consistency they should look for google_chrome_build like C++.
2014 'grit_defines': ['-D', '_google_chrome',
2015 '-E', 'CHROMIUM_BUILD=google_chrome'],
2017 'grit_defines': ['-D', '_chromium',
2018 '-E', 'CHROMIUM_BUILD=chromium'],
2021 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2023 ['desktop_linux==1', {
2024 'grit_defines': ['-D', 'desktop_linux'],
2026 ['toolkit_views==1', {
2027 'grit_defines': ['-D', 'toolkit_views'],
2030 'grit_defines': ['-D', 'use_aura'],
2033 'grit_defines': ['-D', 'use_ash'],
2036 'grit_defines': ['-D', 'use_nss'],
2039 'grit_defines': ['-D', 'use_ozone'],
2041 ['image_loader_extension==1', {
2042 'grit_defines': ['-D', 'image_loader_extension'],
2045 'grit_defines': ['-D', 'remoting'],
2047 ['use_titlecase_in_grd==1', {
2048 'grit_defines': ['-D', 'use_titlecase'],
2050 ['use_third_party_translations==1', {
2051 'grit_defines': ['-D', 'use_third_party_translations'],
2053 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2054 'ka', 'ku', 'kw', 'ms', 'ug'
2060 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2061 '--no-output-all-resource-defines',
2064 ['OS=="mac" or OS=="ios"', {
2065 'grit_defines': ['-D', 'scale_factors=2x'],
2070 # iOS uses a whitelist to filter resources.
2071 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt',
2072 '--no-output-all-resource-defines',
2075 # Enable host builds when generating with ninja-ios.
2077 ['"<(GENERATOR)"=="ninja"', {
2081 # TODO(sdefresne): Remove the target_subarch check once Apple has
2082 # upstreamed the support for "arm64". http://crbug.com/341453
2083 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
2088 ['enable_extensions==1', {
2089 'grit_defines': ['-D', 'enable_extensions'],
2091 ['enable_plugins!=0', {
2092 'grit_defines': ['-D', 'enable_plugins'],
2094 ['enable_basic_printing==1 or enable_print_preview==1', {
2095 'grit_defines': ['-D', 'enable_printing'],
2097 ['enable_print_preview==1', {
2098 'grit_defines': ['-D', 'enable_print_preview'],
2100 ['enable_themes==1', {
2101 'grit_defines': ['-D', 'enable_themes'],
2103 ['enable_app_list==1', {
2104 'grit_defines': ['-D', 'enable_app_list'],
2106 ['enable_settings_app==1', {
2107 'grit_defines': ['-D', 'enable_settings_app'],
2109 ['enable_google_now==1', {
2110 'grit_defines': ['-D', 'enable_google_now'],
2112 ['use_concatenated_impulse_responses==1', {
2113 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2115 ['enable_webrtc==1', {
2116 'grit_defines': ['-D', 'enable_webrtc'],
2118 ['enable_hangout_services_extension==1', {
2119 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2121 ['enable_task_manager==1', {
2122 'grit_defines': ['-D', 'enable_task_manager'],
2124 ['notifications==1', {
2125 'grit_defines': ['-D', 'enable_notifications'],
2127 ['enable_wifi_bootstrapping==1', {
2128 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2130 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2131 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2133 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2134 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2136 ['enable_mdns==1 or OS=="mac"', {
2137 'grit_defines': ['-D', 'enable_service_discovery'],
2138 'enable_service_discovery%': 1
2140 ['clang_use_chrome_plugins==1 and OS!="win"', {
2141 'clang_chrome_plugins_flags': [
2142 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
2145 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2147 'use_allocator%': 'none',
2148 'use_sanitizer_options%': 1,
2150 ['asan==1 and OS=="linux" and chromeos==0', {
2151 'use_custom_libcxx%': 1,
2159 ['asan==1 and OS=="mac"', {
2160 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
2161 # runtime is fully adopted. See http://crbug.com/242503.
2162 'mac_strip_release': 0,
2165 'use_custom_libcxx%': 1,
2168 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2169 # libstdc++. This is required to avoid false positive reports whenever
2170 # the C++ standard library is used.
2171 'use_custom_libcxx%': 1,
2172 # Running the V8-generated code on an ARM simulator is a powerful hack
2173 # that allows the tool to see the memory accesses from JITted code.
2174 # Without this flag, JS code causes false positive reports from MSan.
2175 'v8_target_arch': 'arm64',
2178 ['OS=="linux" and clang_type_profiler==1', {
2180 'clang_use_chrome_plugins%': 0,
2182 ['host_arch=="x64"', {
2183 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2185 ['host_arch=="ia32"', {
2186 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2187 # Clang in this directory at your own risk if needed for some
2188 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2189 # usage). Any failure by this compiler should not close the tree.
2190 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2196 # The Clang plugins don't currently work on Windows.
2197 # TODO(hans): One day, this will work. (crbug.com/82385)
2198 'clang_use_chrome_plugins%': 0,
2201 # On valgrind bots, override the optimizer settings so we don't inline too
2202 # much and make the stacks harder to figure out.
2204 # TODO(rnk): Kill off variables that no one else uses and just implement
2205 # them under a build_for_tool== condition.
2206 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2208 'mac_debug_optimization': '1',
2209 'mac_release_optimization': '1',
2210 'release_optimize': '1',
2211 'no_gc_sections': 1,
2212 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2213 '-fno-builtin -fno-optimize-sibling-calls',
2214 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2215 '-fno-builtin -fno-optimize-sibling-calls',
2217 # MSVS flags for TSan on Pin and Windows.
2218 'win_debug_RuntimeChecks': '0',
2219 'win_debug_disable_iterator_debugging': '1',
2220 'win_debug_Optimization': '1',
2221 'win_debug_InlineFunctionExpansion': '0',
2222 'win_release_InlineFunctionExpansion': '0',
2223 'win_release_OmitFramePointers': '0',
2225 'use_allocator': 'tcmalloc',
2226 'release_valgrind_build': 1,
2228 'component': 'static_library',
2229 'use_system_zlib': 0,
2232 # Build tweaks for DrMemory.
2233 # TODO(rnk): Combine with tsan config to share the builder.
2234 # http://crbug.com/108155
2235 ['build_for_tool=="drmemory"', {
2236 # These runtime checks force initialization of stack vars which blocks
2237 # DrMemory's uninit detection.
2238 'win_debug_RuntimeChecks': '0',
2239 # Iterator debugging is slow.
2240 'win_debug_disable_iterator_debugging': '1',
2241 # Try to disable optimizations that mess up stacks in a release build.
2242 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2243 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2244 # compiler bug, so we use /Ob1 instead.
2245 'win_release_InlineFunctionExpansion': '1',
2246 'win_release_OmitFramePointers': '0',
2247 # Ditto for debug, to support bumping win_debug_Optimization.
2248 'win_debug_InlineFunctionExpansion': 0,
2249 'win_debug_OmitFramePointers': 0,
2250 # Keep the code under #ifndef NVALGRIND.
2251 'release_valgrind_build': 1,
2254 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2255 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2259 # Set default compiler flags depending on ARM version.
2260 ['arm_version==6 and android_webview_build==0', {
2261 'arm_arch%': 'armv6',
2264 'arm_float_abi%': 'softfp',
2267 ['arm_version==7 and android_webview_build==0', {
2268 'arm_arch%': 'armv7-a',
2269 'arm_tune%': 'generic-armv7-a',
2274 'arm_fpu%': 'vfpv3-d16',
2277 # Change the default to hard once the armhf transition is complete.
2278 'arm_float_abi%': 'softfp',
2282 # Set default compiler flags depending on MIPS architecture variant.
2283 ['target_arch=="mipsel" and mips_arch_variant=="r2" and android_webview_build==0', {
2284 'mips_fpu_mode%': 'fp32',
2287 ['android_webview_build==1', {
2288 # The WebView build gets its cpu-specific flags from the Android build system.
2292 'arm_float_abi%': '',
2294 'mips_fpu_mode%': '',
2297 # Enable brlapi by default for chromeos.
2302 ['use_ozone==1 and ozone_auto_platforms==1', {
2303 # Use test as the default platform.
2304 'ozone_platform%': 'test',
2306 # Build all platforms whose deps are in install-build-deps.sh.
2307 # Only these platforms will be compile tested by buildbots.
2308 'ozone_platform_dri%': 1,
2309 'ozone_platform_test%': 1,
2310 'ozone_platform_egltest%': 1,
2313 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2314 'use_clipboard_aurax11%': 1,
2317 ['OS=="win" and use_goma==1', {
2318 # goma doesn't support pch yet.
2319 'chromium_win_pch': 0,
2320 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2322 ['win_z7==0 and fastbuild==0', {
2328 ['OS=="win" and (clang==1 or asan==1)', {
2329 'chromium_win_pch': 0,
2333 'host_cc': '<(make_clang_dir)/bin/clang',
2334 'host_cxx': '<(make_clang_dir)/bin/clang++',
2336 'host_cc': '<!(which gcc)',
2337 'host_cxx': '<!(which g++)',
2340 # The seccomp-bpf sandbox is only supported on five architectures
2342 # Do not disable seccomp_bpf anywhere without talking to
2343 # security@chromium.org!
2344 ['((OS=="linux" or OS=="android") and '
2345 '(target_arch=="ia32" or target_arch=="x64" or '
2346 'target_arch=="arm" or target_arch=="mipsel" or '
2347 'target_arch=="arm64"))', {
2348 'use_seccomp_bpf%': 1,
2350 'use_seccomp_bpf%': 0,
2352 # Set component build with LTO until all tests pass.
2353 # This also reduces link time.
2355 'component%': "shared_library",
2359 # older history files use fts2 instead of fts3
2360 'sqlite_enable_fts2%': '<(support_pre_M6_history_database)',
2362 # The path to the ANGLE library.
2363 'angle_path': '<(DEPTH)/third_party/angle',
2365 # List of default apps to install in new profiles. The first list contains
2366 # the source files as found in svn. The second list, used only for linux,
2367 # contains the destination location for each of the files. When a crx
2368 # is added or removed from the list, the chrome/browser/resources/
2369 # default_apps/external_extensions.json file must also be updated.
2370 'default_apps_list': [
2371 'browser/resources/default_apps/external_extensions.json',
2372 'browser/resources/default_apps/gmail.crx',
2373 'browser/resources/default_apps/search.crx',
2374 'browser/resources/default_apps/youtube.crx',
2375 'browser/resources/default_apps/drive.crx',
2376 'browser/resources/default_apps/docs.crx',
2378 'default_apps_list_linux_dest': [
2379 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2380 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2381 '<(PRODUCT_DIR)/default_apps/search.crx',
2382 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2383 '<(PRODUCT_DIR)/default_apps/drive.crx',
2384 '<(PRODUCT_DIR)/default_apps/docs.crx',
2387 # Whether to allow building of the GPU-related isolates.
2388 'archive_gpu_tests%': 0,
2390 # Whether to allow building of chromoting related isolates.
2391 'archive_chromoting_tests%': 0,
2393 'target_defaults': {
2395 # The condition that operates on chromium_code is in a target_conditions
2396 # section, and will not have access to the default fallback value of
2397 # chromium_code at the top of this file, or to the chromium_code
2398 # variable placed at the root variables scope of .gyp files, because
2399 # those variables are not set at target scope. As a workaround,
2400 # if chromium_code is not set at target scope, define it in target scope
2401 # to contain whatever value it has during early variable expansion.
2402 # That's enough to make it available during target conditional
2404 'chromium_code%': '<(chromium_code)',
2406 'component%': '<(component)',
2408 'chromecast%': '<(chromecast)',
2410 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2411 'win_release_Optimization%': '2', # 2 = /Os
2412 'win_debug_Optimization%': '0', # 0 = /Od
2414 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2415 # Tri-state: blank is default, 1 on, 0 off
2416 'win_release_OmitFramePointers%': '0',
2417 # Tri-state: blank is default, 1 on, 0 off
2418 'win_debug_OmitFramePointers%': '',
2420 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2421 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2423 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2424 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2425 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2427 # VS inserts quite a lot of extra checks to algorithms like
2428 # std::partial_sort in Debug build which make them O(N^2)
2429 # instead of O(N*logN). This is particularly slow under memory
2430 # tools like ThreadSanitizer so we want it to be disablable.
2431 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2432 'win_debug_disable_iterator_debugging%': '0',
2434 # An application manifest fragment to declare compatibility settings for
2435 # 'executable' targets. Ignored in other target type.
2436 'win_exe_compatibility_manifest%':
2437 '<(DEPTH)\\build\\win\\compatibility.manifest',
2439 'release_extra_cflags%': '',
2440 'debug_extra_cflags%': '',
2442 'release_valgrind_build%': '<(release_valgrind_build)',
2444 # the non-qualified versions are widely assumed to be *nix-only
2445 'win_release_extra_cflags%': '',
2446 'win_debug_extra_cflags%': '',
2448 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2449 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2451 # Only used by Windows build for now. Can be used to build into a
2452 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2453 # output files in src/build/VS2010_{Debug,Release}.
2454 'build_dir_prefix%': '',
2456 # Targets are by default not nacl untrusted code.
2457 'nacl_untrusted_build%': 0,
2459 'pnacl_compile_flags': [
2460 # pnacl uses the clang compiler so we need to suppress all the
2461 # same warnings as we do for clang.
2462 # TODO(sbc): Remove these if/when they are removed from the clang
2464 '-Wno-unused-function',
2465 '-Wno-char-subscripts',
2466 '-Wno-c++11-extensions',
2467 '-Wno-unnamed-type-template-args',
2471 ['OS=="win" and component=="shared_library"', {
2472 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2473 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2474 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2476 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2477 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2478 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2481 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2482 'mac_release_optimization%': 's', # Use -Os unless overridden
2483 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2485 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2486 'mac_release_optimization%': '2', # Use -O2 unless overridden
2487 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2490 'host_os%': '<(host_os)', # See comment above chromium_code.
2493 'clang_warning_flags': [
2496 # Don't die on dtoa code that uses a char as an array index.
2497 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2498 '-Wno-char-subscripts',
2500 # TODO(thakis): This used to be implied by -Wno-unused-function,
2501 # which we no longer use. Check if it makes sense to remove
2502 # this as well. http://crbug.com/316352
2503 '-Wno-unneeded-internal-declaration',
2505 # Warns on switches on enums that cover all enum values but
2506 # also contain a default: branch. Chrome is full of that.
2507 '-Wno-covered-switch-default',
2509 # Warns when a const char[] is converted to bool.
2510 '-Wstring-conversion',
2512 # C++11-related flags:
2514 # This warns on using ints as initializers for floats in
2515 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2516 # which happens in several places in chrome code. Not sure if
2517 # this is worth fixing.
2518 '-Wno-c++11-narrowing',
2520 # Clang considers the `register` keyword as deprecated, but e.g.
2521 # code generated by flex (used in angle) contains that keyword.
2522 # http://crbug.com/255186
2523 '-Wno-deprecated-register',
2526 'includes': [ 'set_clang_warning_flags.gypi', ],
2528 # Don't use deprecated V8 APIs anywhere.
2529 'V8_DEPRECATION_WARNINGS',
2532 '<(SHARED_INTERMEDIATE_DIR)',
2535 ['(OS=="mac" or OS=="ios") and asan==1', {
2537 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2540 ['OS=="win" and asan==1 and component=="shared_library"', {
2542 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2545 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2546 'cflags_cc!': ['-fno-rtti'],
2549 '-gline-tables-only',
2550 '-fintercept-allocation-functions',
2552 'defines': ['TYPE_PROFILING'],
2554 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2557 ['branding=="Chrome"', {
2558 'defines': ['GOOGLE_CHROME_BUILD'],
2559 }, { # else: branding!="Chrome"
2560 'defines': ['CHROMIUM_BUILD'],
2562 ['OS=="mac" and component=="shared_library"', {
2564 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2565 'LD_RUNPATH_SEARCH_PATHS': [
2566 # For unbundled binaries.
2568 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2569 '@loader_path/../../..',
2573 ['clang==1 and OS!="win"', {
2574 # This is here so that all files get recompiled after a clang roll and
2575 # when turning clang on or off.
2576 # (defines are passed via the command line, and build systems rebuild
2577 # things when their commandline changes). Nothing should ever read this
2579 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2582 'defines': ['ENABLE_RLZ'],
2584 ['component=="shared_library"', {
2585 'defines': ['COMPONENT_BUILD'],
2587 ['toolkit_views==1', {
2588 'defines': ['TOOLKIT_VIEWS=1'],
2590 ['ui_compositor_image_transport==1', {
2591 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2594 'defines': ['USE_AURA=1'],
2597 'defines': ['USE_ASH=1'],
2600 'defines': ['USE_PANGO=1'],
2603 'defines': ['USE_CAIRO=1'],
2606 'defines': ['USE_CRAS=1'],
2609 'defines': ['USE_OZONE=1'],
2611 ['use_default_render_theme==1', {
2612 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2614 ['use_libjpeg_turbo==1', {
2615 'defines': ['USE_LIBJPEG_TURBO=1'],
2618 'defines': ['USE_X11=1'],
2620 ['use_clipboard_aurax11==1', {
2621 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2623 ['enable_one_click_signin==1', {
2624 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2626 ['enable_pre_sync_backup==1', {
2627 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2629 ['image_loader_extension==1', {
2630 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2633 'defines': ['ENABLE_PROFILING=1'],
2636 'defines': ['ENABLE_REMOTING=1'],
2638 ['enable_webrtc==1', {
2639 'defines': ['ENABLE_WEBRTC=1'],
2641 ['proprietary_codecs==1', {
2642 'defines': ['USE_PROPRIETARY_CODECS'],
2644 ['enable_mpeg2ts_stream_parser==1', {
2645 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2649 ['enable_viewport==1', {
2650 'defines': ['ENABLE_VIEWPORT'],
2652 ['enable_pepper_cdms==1', {
2653 'defines': ['ENABLE_PEPPER_CDMS'],
2655 ['enable_browser_cdms==1', {
2656 'defines': ['ENABLE_BROWSER_CDMS'],
2658 ['configuration_policy==1', {
2659 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2661 ['notifications==1', {
2662 'defines': ['ENABLE_NOTIFICATIONS'],
2664 ['enable_hidpi==1', {
2665 'defines': ['ENABLE_HIDPI=1'],
2667 ['native_discardable_memory==1', {
2668 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2670 ['native_memory_pressure_signals==1', {
2671 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2674 'defines': ['USE_UDEV'],
2678 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2681 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2682 # Clang creates chubby debug information, which makes linking very
2683 # slow. For now, don't create debug information with clang. See
2684 # http://crbug.com/70000
2688 'debug_extra_cflags': '-g0',
2691 # Android builds symbols on release by default, disable them.
2694 'debug_extra_cflags': '-g0',
2695 'release_extra_cflags': '-g0',
2699 }, { # else clang!=1
2701 ['OS=="win" and fastbuild==2', {
2702 # Completely disable debug information.
2705 'GenerateDebugInformation': 'false',
2707 'VCCLCompilerTool': {
2708 'DebugInformationFormat': '0',
2712 ['OS=="win" and fastbuild==1', {
2715 # This tells the linker to generate .pdbs, so that
2716 # we can get meaningful stack traces.
2717 'GenerateDebugInformation': 'true',
2719 'VCCLCompilerTool': {
2720 # No debug info to be generated by compiler.
2721 'DebugInformationFormat': '0',
2725 ['OS=="linux" and fastbuild==2', {
2727 'debug_extra_cflags': '-g0',
2730 ['OS=="linux" and fastbuild==1', {
2732 'debug_extra_cflags': '-g1',
2735 ['OS=="android" and fastbuild==2', {
2737 'debug_extra_cflags': '-g0',
2738 'release_extra_cflags': '-g0',
2741 ['OS=="android" and fastbuild==1', {
2743 'debug_extra_cflags': '-g1',
2744 'release_extra_cflags': '-g1',
2751 ['dont_embed_build_metadata==1', {
2753 'DONT_EMBED_BUILD_METADATA',
2755 }], # dont_embed_build_metadata==1
2756 ['dcheck_always_on!=0', {
2757 'defines': ['DCHECK_ALWAYS_ON=1'],
2758 }], # dcheck_always_on!=0
2759 ['tracing_like_official_build!=0', {
2760 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2761 }], # tracing_like_official_build!=0
2762 ['win_use_allocator_shim==0', {
2765 'defines': ['NO_TCMALLOC'],
2771 'ADDRESS_SANITIZER',
2772 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2773 'MEMORY_SANITIZER_INITIAL_SIZE',
2777 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2785 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2786 'MEMORY_SANITIZER_INITIAL_SIZE',
2792 '_CRT_SECURE_NO_DEPRECATE',
2793 '_SCL_SECURE_NO_DEPRECATE',
2794 # This define is required to pull in the new Win8 interfaces from
2795 # system headers like ShObjIdl.h.
2796 'NTDDI_VERSION=0x06030000',
2797 # This is required for ATL to use XP-safe versions of its functions.
2798 '_USING_V110_SDK71_',
2801 '<(DEPTH)/third_party/wtl/include',
2806 # Generates debug info when win_z7=1
2807 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2809 'GenerateDebugInformation': 'true',
2811 'VCCLCompilerTool': {
2812 'DebugInformationFormat': '1',
2818 # This is prohibited when running /analyze.
2819 '_USING_V110_SDK71_',
2822 'VCCLCompilerTool': {
2823 # Set WarnAsError to false to disable this setting for most
2824 # projects so that compilation continues.
2825 'WarnAsError': 'false',
2826 # When win_analyze is specified add the /analyze switch.
2827 # Also add /WX- to force-disable WarnAsError for projects that
2828 # override WarnAsError.
2829 # Also, disable various noisy warnings that have low value.
2830 'AdditionalOptions': [
2833 '/wd6011', # Dereferencing NULL pointer
2834 '/wd6312', # Possible infinite loop: use of the constant
2835 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2836 '/wd6326', # Potential comparison of constant with constant
2837 '/wd28159', # Consider using 'GetTickCount64'
2838 '/wd28204', # Inconsistent SAL annotations
2839 '/wd28251', # Inconsistent SAL annotations
2840 '/wd28252', # Inconsistent SAL annotations
2841 '/wd28253', # Inconsistent SAL annotations
2842 '/wd28196', # The precondition is not satisfied
2843 '/wd28301', # Inconsistent SAL annotations
2844 '/wd6340', # Sign mismatch in function parameter
2845 '/wd28182', # Dereferencing NULL pointer
2857 ['target_arch=="arm"', {
2859 # TODO(lcwu): Work around an error when building Chromium
2860 # with gcc-4.5.3 (e.g. v8/src/platform-linux.cc). Remove
2861 # this define once the toolchain is updated.
2862 # See crbug.com/388933.
2866 ['use_playready==1', {
2868 'PLAYREADY_CDM_AVAILABLE',
2873 ['enable_task_manager==1', {
2875 'ENABLE_TASK_MANAGER=1',
2878 ['enable_extensions==1', {
2880 'ENABLE_EXTENSIONS=1',
2883 ['OS=="win" and branding=="Chrome"', {
2884 'defines': ['ENABLE_SWIFTSHADER'],
2886 ['enable_dart==1', {
2887 'defines': ['WEBKIT_USING_DART=1'],
2889 ['enable_plugin_installation==1', {
2890 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2892 ['enable_plugins==1', {
2893 'defines': ['ENABLE_PLUGINS=1'],
2895 ['enable_session_service==1', {
2896 'defines': ['ENABLE_SESSION_SERVICE=1'],
2898 ['enable_themes==1', {
2899 'defines': ['ENABLE_THEMES=1'],
2901 ['enable_autofill_dialog==1', {
2902 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2904 ['enable_prod_wallet_service==1', {
2905 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2907 ['enable_background==1', {
2908 'defines': ['ENABLE_BACKGROUND=1'],
2910 ['enable_google_now==1', {
2911 'defines': ['ENABLE_GOOGLE_NOW=1'],
2913 ['cld_version!=0', {
2914 'defines': ['CLD_VERSION=<(cld_version)'],
2916 ['enable_basic_printing==1 or enable_print_preview==1', {
2917 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2918 'defines': ['ENABLE_PRINTING=1'],
2920 ['enable_basic_printing==1', {
2921 # Enable basic printing support and UI.
2922 'defines': ['ENABLE_BASIC_PRINTING=1'],
2924 ['enable_print_preview==1', {
2925 # Enable printing with print preview.
2926 # Can be defined without ENABLE_BASIC_PRINTING.
2927 'defines': ['ENABLE_PRINT_PREVIEW=1'],
2929 ['enable_spellcheck==1', {
2930 'defines': ['ENABLE_SPELLCHECK=1'],
2932 ['enable_captive_portal_detection==1', {
2933 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2935 ['enable_app_list==1', {
2936 'defines': ['ENABLE_APP_LIST=1'],
2938 ['enable_settings_app==1', {
2939 'defines': ['ENABLE_SETTINGS_APP=1'],
2941 ['disable_file_support==1', {
2942 'defines': ['DISABLE_FILE_SUPPORT=1'],
2944 ['disable_ftp_support==1', {
2945 'defines': ['DISABLE_FTP_SUPPORT=1'],
2947 ['use_icu_alternatives_on_android==1', {
2948 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2950 ['enable_supervised_users==1', {
2951 'defines': ['ENABLE_SUPERVISED_USERS=1'],
2953 ['spdy_proxy_auth_property != ""', {
2954 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2956 ['spdy_proxy_auth_value != ""', {
2957 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2959 ['enable_mdns==1', {
2960 'defines': ['ENABLE_MDNS=1'],
2962 ['enable_service_discovery==1', {
2963 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2965 ['enable_wifi_bootstrapping==1', {
2966 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2968 ['enable_hangout_services_extension==1', {
2969 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2971 ['enable_ipc_fuzzer==1', {
2972 'defines': ['ENABLE_IPC_FUZZER=1'],
2975 'defines': ['VIDEO_HOLE=1'],
2977 ['enable_load_completion_hacks==1', {
2978 'defines': ['ENABLE_LOAD_COMPLETION_HACKS=1'],
2980 ['v8_use_external_startup_data==1', {
2981 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
2983 ], # conditions for 'target_defaults'
2984 'target_conditions': [
2985 ['<(use_libpci)==1', {
2986 'defines': ['USE_LIBPCI=1'],
2988 ['<(use_openssl)==1', {
2989 'defines': ['USE_OPENSSL=1'],
2991 ['<(use_openssl_certs)==1', {
2992 'defines': ['USE_OPENSSL_CERTS=1'],
2994 ['>(nacl_untrusted_build)==1', {
2997 'USE_OPENSSL_CERTS=1',
3000 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3001 'defines': ['USE_GLIB=1'],
3003 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
3004 'defines': ['USE_NSS=1'],
3006 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3007 'defines': ['OS_CHROMEOS=1'],
3009 ['enable_wexit_time_destructors==1 and OS!="win"', {
3010 # TODO: Enable on Windows too, http://crbug.com/404525
3011 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3013 ['chromium_code==0', {
3015 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3016 # We don't want to get warnings from third-party code,
3017 # so remove any existing warning-enabling flags like -Wall.
3023 # Don't warn about hash_map in third-party code.
3027 # Don't warn about printf format problems.
3028 # This is off by default in gcc but on in Ubuntu's gcc(!).
3032 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3036 # TODO: Fix all warnings on chromeos too.
3037 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3042 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3044 # Don't warn about ignoring the return value from e.g. close().
3045 # This is off by default in some gccs but on by default in others.
3046 # BSD systems do not support this option, since they are usually
3047 # using gcc 4.2.1, which does not have this flag yet.
3048 '-Wno-unused-result',
3053 '_CRT_SECURE_NO_DEPRECATE',
3054 '_CRT_NONSTDC_NO_WARNINGS',
3055 '_CRT_NONSTDC_NO_DEPRECATE',
3056 '_SCL_SECURE_NO_DEPRECATE',
3058 'msvs_disabled_warnings': [4800],
3060 'VCCLCompilerTool': {
3061 'WarningLevel': '3',
3062 'WarnAsError': 'true',
3063 'Detect64BitPortabilityProblems': 'false',
3067 ['buildtype=="Official"', {
3069 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3074 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3077 [ 'component=="shared_library"', {
3078 # TODO(darin): Unfortunately, some third_party code depends on base.
3079 'msvs_disabled_warnings': [
3080 4251, # class 'std::xx' needs to have dll-interface.
3086 [ 'OS=="mac" or OS=="ios"', {
3088 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3091 ['buildtype=="Official"', {
3093 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3100 # TODO(ios): Fix remaining warnings in third-party code, then
3101 # remove this; the Mac cleanup didn't get everything that's
3102 # flagged in an iOS build.
3103 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3104 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3105 # Several internal ios directories generate numerous warnings for
3106 # -Wobjc-missing-property-synthesis.
3107 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3113 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3114 'filename_rules.gypi',
3116 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3117 # C99 macros on Mac and Linux.
3119 '__STDC_CONSTANT_MACROS',
3120 '__STDC_FORMAT_MACROS',
3124 # turn on warnings for signed/unsigned mismatch on chromium code.
3126 'VCCLCompilerTool': {
3127 'AdditionalOptions': ['/we4389'],
3131 ['OS=="win" and component=="shared_library"', {
3132 'msvs_disabled_warnings': [
3133 4251, # class 'std::xx' needs to have dll-interface.
3138 ], # target_conditions for 'target_defaults'
3139 'default_configuration': 'Debug',
3141 # VCLinkerTool LinkIncremental values below:
3143 # 1 == /INCREMENTAL:NO
3145 # Debug links incremental, Release does not.
3147 # Abstract base configurations to cover common attributes.
3151 'msvs_configuration_attributes': {
3152 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3153 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3154 'CharacterSet': '1',
3156 # Add the default import libs.
3159 'AdditionalDependencies': [
3176 'AdditionalOptions': [
3177 # Suggested by Microsoft Devrel to avoid
3178 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3179 # which started happening more regularly after VS2013 Update 4.
3180 '/maxilksize:2147483647',
3189 'MinimumRequiredVersion': '5.01', # XP.
3190 'TargetMachine': '1',
3192 'VCLibrarianTool': {
3193 'TargetMachine': '1',
3196 'msvs_configuration_platform': 'Win32',
3200 'msvs_configuration_platform': 'x64',
3203 # Make sure to understand http://crbug.com/361720 if you want to
3205 'MinimumRequiredVersion': '5.02', # Server 2003.
3206 'TargetMachine': '17', # x86 - 64
3207 'AdditionalLibraryDirectories!':
3208 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3209 'AdditionalLibraryDirectories':
3210 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3211 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3212 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3214 'VCLibrarianTool': {
3215 'AdditionalLibraryDirectories!':
3216 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3217 'AdditionalLibraryDirectories':
3218 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3219 'TargetMachine': '17', # x64
3226 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3227 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3230 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3232 '<@(debug_extra_cflags)',
3236 'VCCLCompilerTool': {
3237 'Optimization': '<(win_debug_Optimization)',
3238 'PreprocessorDefinitions': ['_DEBUG'],
3239 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3240 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3242 # According to MSVS, InlineFunctionExpansion=0 means
3243 # "default inlining", not "/Ob0".
3244 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3245 ['win_debug_InlineFunctionExpansion==0', {
3246 'AdditionalOptions': ['/Ob0'],
3248 ['win_debug_InlineFunctionExpansion!=""', {
3249 'InlineFunctionExpansion':
3250 '<(win_debug_InlineFunctionExpansion)',
3252 ['win_debug_disable_iterator_debugging==1', {
3253 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3256 # if win_debug_OmitFramePointers is blank, leave as default
3257 ['win_debug_OmitFramePointers==1', {
3258 'OmitFramePointers': 'true',
3260 ['win_debug_OmitFramePointers==0', {
3261 'OmitFramePointers': 'false',
3262 # The above is not sufficient (http://crbug.com/106711): it
3263 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3264 # perform FPO regardless, so we must explicitly disable.
3265 # We still want the false setting above to avoid having
3266 # "/Oy /Oy-" and warnings about overriding.
3267 'AdditionalOptions': ['/Oy-'],
3270 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3273 'LinkIncremental': '<(msvs_debug_link_incremental)',
3274 # ASLR makes debugging with windbg difficult because Chrome.exe and
3275 # Chrome.dll share the same base name. As result, windbg will
3276 # name the Chrome.dll module like chrome_<base address>, where
3277 # <base address> typically changes with each launch. This in turn
3278 # means that breakpoints in Chrome.dll don't stick from one launch
3279 # to the next. For this reason, we turn ASLR off in debug builds.
3280 # Note that this is a three-way bool, where 0 means to pick up
3281 # the default setting, 1 is off and 2 is on.
3282 'RandomizedBaseAddress': 1,
3284 'VCResourceCompilerTool': {
3285 'PreprocessorDefinitions': ['_DEBUG'],
3289 ['OS=="linux" or OS=="android"', {
3290 'target_conditions': [
3291 ['_toolset=="target"', {
3293 '<@(debug_extra_cflags)',
3298 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3299 # Enable libstdc++ debugging facilities to help catch problems
3300 # early, see http://crbug.com/65151 .
3301 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3302 'defines': ['_GLIBCXX_DEBUG=1',],
3304 ['release_valgrind_build==0', {
3307 '-fstack-protector-all', # Implies -fstack-protector
3313 # Allow comparing the address of references and 'this' against 0
3314 # in debug builds. Technically, these can never be null in
3315 # well-defined C/C++ and Clang can optimize such checks away in
3316 # release builds, but they may be used in asserts in debug builds.
3317 '-Wno-undefined-bool-conversion',
3318 '-Wno-tautological-undefined-compare',
3322 '-Wno-undefined-bool-conversion',
3323 '-Wno-tautological-undefined-compare',
3327 'VCCLCompilerTool': {
3328 'AdditionalOptions': [
3329 '-Wno-undefined-bool-conversion',
3330 '-Wno-tautological-undefined-compare',
3343 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3344 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3345 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3348 'VCCLCompilerTool': {
3349 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3351 # In official builds, each target will self-select
3352 # an optimization level.
3353 ['buildtype!="Official"', {
3354 'Optimization': '<(win_release_Optimization)',
3357 # According to MSVS, InlineFunctionExpansion=0 means
3358 # "default inlining", not "/Ob0".
3359 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3360 ['win_release_InlineFunctionExpansion==0', {
3361 'AdditionalOptions': ['/Ob0'],
3363 ['win_release_InlineFunctionExpansion!=""', {
3364 'InlineFunctionExpansion':
3365 '<(win_release_InlineFunctionExpansion)',
3368 # if win_release_OmitFramePointers is blank, leave as default
3369 ['win_release_OmitFramePointers==1', {
3370 'OmitFramePointers': 'true',
3372 ['win_release_OmitFramePointers==0', {
3373 'OmitFramePointers': 'false',
3374 # The above is not sufficient (http://crbug.com/106711): it
3375 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3376 # perform FPO regardless, so we must explicitly disable.
3377 # We still want the false setting above to avoid having
3378 # "/Oy /Oy-" and warnings about overriding.
3379 'AdditionalOptions': ['/Oy-'],
3382 'AdditionalOptions': [
3383 '/d2Zi+', # Improve debugging of Release builds.
3384 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3385 '<@(win_release_extra_cflags)',
3389 # LinkIncremental is a tri-state boolean, where 0 means default
3390 # (i.e., inherit from parent solution), 1 means false, and
3392 'LinkIncremental': '1',
3393 # This corresponds to the /PROFILE flag which ensures the PDB
3394 # file contains FIXUP information (growing the PDB file by about
3395 # 5%) but does not otherwise alter the output binary. This
3396 # information is used by the Syzygy optimization tool when
3397 # decomposing the release image.
3402 ['msvs_use_common_release', {
3403 'includes': ['release.gypi'],
3405 ['release_valgrind_build==0 and tsan==0', {
3408 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3412 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3413 'MEMORY_SANITIZER_INITIAL_SIZE',
3414 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3415 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3418 ['OS=="win" and win_use_allocator_shim==0', {
3419 'defines': ['NO_TCMALLOC'],
3421 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3422 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3423 # It seems to work fine with Ubuntu 12 headers though, so use it
3424 # in official builds.
3425 ['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")', {
3426 'target_conditions': [
3427 ['chromium_code==1', {
3428 # Non-chromium code is not guaranteed to compile cleanly
3429 # with _FORTIFY_SOURCE. Also, fortified build may fail
3430 # when optimizations are disabled, so only do that for Release
3433 '_FORTIFY_SOURCE=2',
3438 ['OS=="linux" or OS=="android"', {
3439 'target_conditions': [
3440 ['_toolset=="target"', {
3442 '<@(release_extra_cflags)',
3445 ['enable_resource_whitelist_generation==1', {
3447 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3456 'NS_BLOCK_ASSERTIONS=1',
3462 # Concrete configurations
3465 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3468 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3473 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3474 'target_conditions': [
3475 [ '_type=="executable"', {
3476 # To get a real .dSYM bundle produced by dsymutil, set the
3477 # debug information format to dwarf-with-dsym. Since
3478 # strip_from_xcode will not be used, set Xcode to do the
3479 # stripping as well.
3481 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3482 'DEPLOYMENT_POSTPROCESSING': 'YES',
3483 'STRIP_INSTALLED_PRODUCT': 'YES',
3490 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3492 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3495 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3503 'target_defaults': {
3508 # TODO(glider): enable the default options on other systems.
3510 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3512 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3518 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3519 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3520 'target_defaults': {
3522 '-Wl,--fatal-warnings',
3526 ['os_posix==1 and chromeos==0', {
3527 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3528 # and we want to avoid overriding this, so stack-protector is only
3529 # enabled when not building on Chrome OS.
3530 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3532 'target_defaults': {
3534 '-fstack-protector',
3535 '--param=ssp-buffer-size=4',
3539 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3540 'target_defaults': {
3541 # Enable -Werror by default, but put it in a variable so it can
3542 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3544 'werror%': '-Werror',
3545 'libraries_for_target%': '',
3548 '_FILE_OFFSET_BITS=64',
3551 '<(werror)', # See note above about the werror variable.
3553 '-fno-strict-aliasing', # See http://crbug.com/32204
3555 # TODO(evan): turn this back on once all the builds work.
3557 # Don't warn about unused function params. We use those everywhere.
3558 '-Wno-unused-parameter',
3559 # Don't warn about the "struct foo f = {0};" initialization pattern.
3560 '-Wno-missing-field-initializers',
3561 # Don't export any symbols (for example, to plugins we dlopen()).
3562 # Note: this is *required* to make some plugins work.
3563 '-fvisibility=hidden',
3569 '-fno-threadsafe-statics',
3570 # Make inline functions have hidden visiblity by default.
3571 # Surprisingly, not covered by -fvisibility=hidden.
3572 '-fvisibility-inlines-hidden',
3573 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3574 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3578 '-pthread', '-Wl,-z,noexecstack',
3581 '<(libraries_for_target)',
3586 'debug_optimize%': '0',
3592 '-O>(debug_optimize)',
3599 # Warn in case of text relocations.
3600 '-Wl,--warn-shared-textrel',
3603 ['OS=="android" and android_full_debug==0', {
3604 # Some configurations are copied from Release_Base to reduce
3607 'debug_optimize%': 's',
3611 '-ffunction-sections',
3618 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3619 # We don't omit frame pointers on arm64 since they are required
3620 # to correctly unwind stackframes which contain system library
3621 # function frames (crbug.com/391706).
3623 '-fomit-frame-pointer',
3626 ['OS=="linux" and target_arch=="ia32"', {
3628 '-Wl,--no-as-needed',
3631 ['debug_unwind_tables==1', {
3632 'cflags': ['-funwind-tables'],
3634 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3635 'defines': ['NO_UNWIND_TABLES'],
3637 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3638 # definitions in to the right scope to use them when setting
3639 # linux_use_debug_fission, so it can be used here alone.
3640 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3641 'cflags': ['-gsplit-dwarf'],
3647 'release_optimize%': '2',
3648 # Binaries become big and gold is unable to perform GC
3649 # and remove unused sections for some of test targets
3650 # on 32 bit platform.
3651 # (This is currently observed only in chromeos valgrind bots)
3652 # The following flag is to disable --gc-sections linker
3653 # option for these bots.
3654 'no_gc_sections%': 0,
3656 # TODO(bradnelson): reexamine how this is done if we change the
3657 # expansion of configurations
3658 'release_valgrind_build%': 0,
3661 '-O<(release_optimize)',
3662 # Don't emit the GCC version ident directives, they just end up
3663 # in the .comment section taking up binary size.
3665 # Put data and code in their own sections, so that unused symbols
3666 # can be removed at link time with --gc-sections.
3668 '-ffunction-sections',
3671 # Specifically tell the linker to perform optimizations.
3672 # See http://lwn.net/Articles/192624/ .
3677 ['no_gc_sections==0', {
3679 '-Wl,--gc-sections',
3682 ['OS=="android" and target_arch!="arm64"', {
3683 # We don't omit frame pointers on arm64 since they are required
3684 # to correctly unwind stackframes which contain system library
3685 # function frames (crbug.com/391706).
3687 '-fomit-frame-pointer',
3692 'release_optimize%': 's',
3695 # Warn in case of text relocations.
3696 '-Wl,--warn-shared-textrel',
3701 '-fno-omit-frame-pointer',
3705 ['profiling_full_stack_frames==1', {
3708 '-fno-optimize-sibling-calls',
3713 ['release_unwind_tables==1', {
3714 'cflags': ['-funwind-tables'],
3716 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3717 'defines': ['NO_UNWIND_TABLES'],
3723 ['target_arch=="ia32"', {
3724 'target_conditions': [
3725 ['_toolset=="target"', {
3727 # Needed so that libs with .s files (e.g. libicudata.a)
3728 # are compatible with the general 32-bit-ness.
3731 # All floating-point computations on x87 happens in 80-bit
3732 # precision. Because the C and C++ language standards allow
3733 # the compiler to keep the floating-point values in higher
3734 # precision than what's specified in the source and doing so
3735 # is more efficient than constantly rounding up to 64-bit or
3736 # 32-bit precision as specified in the source, the compiler,
3737 # especially in the optimized mode, tries very hard to keep
3738 # values in x87 floating-point stack (in 80-bit precision)
3739 # as long as possible. This has important side effects, that
3740 # the real value used in computation may change depending on
3741 # how the compiler did the optimization - that is, the value
3742 # kept in 80-bit is different than the value rounded down to
3743 # 64-bit or 32-bit. There are possible compiler options to
3744 # make this behavior consistent (e.g. -ffloat-store would keep
3745 # all floating-values in the memory, thus force them to be
3746 # rounded to its original precision) but they have significant
3747 # runtime performance penalty.
3749 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3750 # which keep floating-point values in SSE registers in its
3751 # native precision (32-bit for single precision, and 64-bit
3752 # for double precision values). This means the floating-point
3753 # value used during computation does not change depending on
3754 # how the compiler optimized the code, since the value is
3755 # always kept in its specified precision.
3757 # Refer to http://crbug.com/348761 for rationale behind SSE2
3758 # being a minimum requirement for 32-bit Linux builds and
3759 # http://crbug.com/313032 for an example where this has "bit"
3764 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3771 # Use gold linker for Android ia32 target.
3777 # Install packages have started cropping up with
3778 # different headers between the 32-bit and 64-bit
3779 # versions, so we have to shadow those differences off
3780 # and make sure a 32-bit-on-64-bit build picks up the
3782 # For android build, use NDK headers instead of host headers
3783 ['host_arch!="ia32" and OS!="android"', {
3792 ['target_arch=="x64"', {
3793 'target_conditions': [
3794 ['_toolset=="target"', {
3796 # Use gold linker for Android x64 target.
3813 ['target_arch=="arm"', {
3814 'target_conditions': [
3815 ['_toolset=="target"', {
3819 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3820 # has changed whenever it encounters a varargs function. This
3821 # silences those warnings, as they are not helpful and
3822 # clutter legitimate warnings.
3826 ['clang==1 and arm_arch!="" and OS!="android"', {
3828 '-target arm-linux-gnueabihf',
3831 '-target arm-linux-gnueabihf',
3836 '-march=<(arm_arch)',
3839 ['use_lto==1 or use_lto_o2==1', {
3841 '-march=<(arm_arch)',
3846 ['clang==1 and OS!="android"', {
3848 # We need to disable clang's builtin assembler as it can't
3849 # handle several asm files, crbug.com/124610
3850 '-no-integrated-as',
3855 '-mtune=<(arm_tune)',
3858 ['use_lto==1 or use_lto_o2==1', {
3860 '-mtune=<(arm_tune)',
3870 ['use_lto==1 or use_lto_o2==1', {
3877 ['arm_float_abi!=""', {
3879 '-mfloat-abi=<(arm_float_abi)',
3882 ['use_lto==1 or use_lto_o2==1', {
3884 '-mfloat-abi=<(arm_float_abi)',
3894 ['use_lto==1 or use_lto_o2==1', {
3902 # Most of the following flags are derived from what Android
3903 # uses by default when building for arm, reference for which
3904 # can be found in the following file in the Android NDK:
3905 # toolchains/arm-linux-androideabi-4.9/setup.mk
3907 # The tree-sra optimization (scalar replacement for
3908 # aggregates enabling subsequent optimizations) leads to
3909 # invalid code generation when using the Android NDK's
3910 # compiler (r5-r7). This can be verified using
3911 # webkit_unit_tests' WTF.Checked_int8_t test.
3913 # The following option is disabled to improve binary
3914 # size and performance in gcc 4.9.
3915 '-fno-caller-saves',
3918 # Android now supports .relro sections properly.
3919 # NOTE: While these flags enable the generation of .relro
3920 # sections, the generated libraries can still be loaded on
3921 # older Android platform versions.
3928 ['gcc_version==48 and clang==0', {
3930 # The following 5 options are disabled to save on
3931 # binary size in GCC 4.8.
3932 '-fno-partial-inlining',
3933 '-fno-early-inlining',
3934 '-fno-tree-copy-prop',
3935 '-fno-tree-loop-optimize',
3936 '-fno-move-loop-invariants',
3940 'cflags': [ '-mthumb-interwork' ],
3944 # Thumb code with frame pointer makes chrome crash
3947 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3948 # The perf report sometimes incorrectly attributes
3949 # code from tail calls.
3950 '-fno-optimize-sibling-calls',
3953 '-fomit-frame-pointer',
3958 # Clang does not support the following options.
3959 '-mthumb-interwork',
3960 '-finline-limit=64',
3962 '-fno-caller-saves',
3966 # TODO(hans) Enable integrated-as (crbug.com/124610).
3967 '-no-integrated-as',
3968 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3971 # Let clang find the ld.gold in the NDK.
3972 '--gcc-toolchain=<(android_toolchain)/..',
3977 '-marm', # Required for frame pointer based stack traces.
3984 # We set arm_arch to "" so that -march compiler option
3985 # is not set. Otherwise a gcc bug that would complain
3986 # about it conflicting with '-mcpu=cortex-a9'. The flag
3987 # '-march=armv7-a' is actually redundant anyway because
3988 # it is enabled by default when we built the toolchain.
3989 # And using '-mcpu=cortex-a9' should be sufficient.
3992 # Breakpad requires symbols with debugging information
3996 # We want to statically link libstdc++/libgcc_s.
3997 '-static-libstdc++',
4001 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4002 # define their own cflags for arm builds that could
4003 # conflict with the flags we set here (e.g.
4004 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4013 ['target_arch=="arm64"', {
4014 'target_conditions': [
4015 ['_toolset=="target"', {
4019 '-fstack-protector', # stack protector is always enabled on arm64.
4026 ['target_arch=="mipsel"', {
4027 'target_conditions': [
4028 ['_toolset=="target"', {
4030 ['android_webview_build==0 and mips_arch_variant=="r6"', {
4031 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
4034 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4038 ['android_webview_build==0 and mips_arch_variant=="r2"', {
4039 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
4041 ['android_webview_build==0 and mips_arch_variant=="r1"', {
4042 'cflags': ['-mips32', '-Wa,-mips32'],
4046 '-Wl,--no-keep-memory'
4049 '-Wno-uninitialized',
4054 ['target_arch=="mips64el"', {
4055 'target_conditions': [
4056 ['_toolset=="target"', {
4058 ['android_webview_build==0 and mips_arch_variant=="r6"', {
4059 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4060 'ldflags': [ '-mips64r6' ],
4062 ['android_webview_build==0 and mips_arch_variant=="r2"', {
4063 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4064 'ldflags': [ '-mips64r2' ],
4068 '-Wno-uninitialized',
4082 'target_conditions': [
4083 ['_toolset=="target"', {
4085 '--sysroot=<(sysroot)',
4088 '--sysroot=<(sysroot)',
4089 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4095 # TODO(thakis): Remove, http://crbug.com/263960
4096 '-Wno-reserved-user-defined-literal',
4099 # gnu++11 instead of c++11 is needed because some code uses
4100 # typeof() (a GNU extension).
4101 # TODO(thakis): Eventually switch this to c++11 instead,
4102 # http://crbug.com/427584
4106 ['clang==0 and host_clang==1', {
4107 'target_conditions': [
4108 ['_toolset=="host"', {
4109 'cflags_cc': [ '-std=gnu++11', ],
4113 ['clang==1 and clang_use_chrome_plugins==1', {
4115 '<@(clang_chrome_plugins_flags)',
4118 ['clang==1 and clang_load!=""', {
4120 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4123 ['clang==1 and clang_add_plugin!=""', {
4125 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4128 ['clang==1 and target_arch=="ia32"', {
4130 # Else building libyuv gives clang's register allocator issues,
4131 # see llvm.org/PR15798 / crbug.com/233709
4132 '-momit-leaf-frame-pointer',
4133 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4134 '-mstack-alignment=16',
4138 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4140 # See http://crbug.com/110262
4141 '-fcolor-diagnostics',
4144 # Common options for AddressSanitizer, LeakSanitizer,
4145 # ThreadSanitizer and MemorySanitizer.
4146 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4147 'target_conditions': [
4148 ['_toolset=="target"', {
4150 '-fno-omit-frame-pointer',
4151 '-gline-tables-only',
4154 '-fomit-frame-pointer',
4159 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4160 'target_conditions': [
4161 ['_toolset=="target"', {
4163 # Functions interposed by the sanitizers can make ld think
4164 # that some libraries aren't needed when they actually are,
4165 # http://crbug.com/234010. As workaround, disable --as-needed.
4169 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4170 'MEMORY_SANITIZER_INITIAL_SIZE',
4176 'target_conditions': [
4177 ['_toolset=="target"', {
4179 '-fsanitize=address',
4180 # TODO(earthdok): Re-enable. http://crbug.com/427202
4181 #'-fsanitize-blacklist=<(asan_blacklist)',
4184 '-fsanitize=address',
4191 '-mllvm -asan-globals=0', # http://crbug.com/352073
4197 'target_conditions': [
4198 ['_toolset=="target"', {
4200 '-fsanitize=undefined',
4201 # -fsanitize=vptr is incompatible with -fno-rtti.
4202 '-fno-sanitize=vptr',
4203 # Employ the experimental PBQP register allocator to avoid
4204 # slow compilation on files with too many basic blocks.
4205 # See http://crbug.com/426271.
4206 '-mllvm -regalloc=pbqp',
4207 # Speculatively use coalescing to slightly improve the code
4208 # generated by PBQP regallocator. May increase compile time.
4209 '-mllvm -pbqp-coalescing',
4212 '-fsanitize=undefined',
4213 # -fsanitize=vptr is incompatible with -fno-rtti.
4214 '-fno-sanitize=vptr',
4220 'target_conditions': [
4221 ['_toolset=="target"', {
4224 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4236 'UNDEFINED_SANITIZER',
4241 ['asan_coverage!=0', {
4242 'target_conditions': [
4243 ['_toolset=="target"', {
4245 '-mllvm -asan-coverage=<(asan_coverage)',
4250 ['asan_field_padding!=0', {
4251 'target_conditions': [
4252 ['_toolset=="target"', {
4254 '-fsanitize-address-field-padding=<(asan_field_padding)',
4260 'target_conditions': [
4261 ['_toolset=="target"', {
4270 'WTF_USE_LEAK_SANITIZER=1',
4276 'target_conditions': [
4277 ['_toolset=="target"', {
4279 '-fsanitize=thread',
4280 '-fsanitize-blacklist=<(tsan_blacklist)',
4283 '-fsanitize=thread',
4287 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4288 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4294 'target_conditions': [
4295 ['_toolset=="target"', {
4297 '-fsanitize=memory',
4298 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4299 '-fsanitize-blacklist=<(msan_blacklist)',
4302 '-fsanitize=memory',
4310 ['use_instrumented_libraries==1', {
4312 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4315 ['use_custom_libcxx==1', {
4317 '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4320 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4321 'target_conditions' : [
4322 # crazy_linker has an upstream gyp file we can't edit, and we
4323 # don't want to instrument it.
4324 ['_toolset=="target" and _target_name!="crazy_linker"', {
4326 '-finstrument-functions',
4327 # Allow mmx intrinsics to inline, so that the
4328 #0 compiler can expand the intrinsics.
4329 '-finstrument-functions-exclude-file-list=mmintrin.h',
4332 ['_toolset=="target" and OS=="android"', {
4334 # Avoids errors with current NDK:
4335 # "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"
4336 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4341 ['linux_dump_symbols==1', {
4344 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4345 'target_conditions': [
4346 ['_toolset=="target"', {
4348 # Attempt to use less memory to prevent the linker from
4349 # running out of address space. Considering installing a
4350 # 64-bit kernel and switching to a 64-bit linker.
4351 '-Wl,--no-keep-memory',
4358 ['use_allocator!="tcmalloc"', {
4359 'defines': ['NO_TCMALLOC'],
4361 ['linux_use_gold_flags==1', {
4362 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4364 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4365 'ldflags': [ '-fuse-ld=gold', ],
4367 'target_conditions': [
4368 ['_toolset=="target"', {
4370 # Experimentation found that using four linking threads
4371 # saved ~20% of link time.
4372 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4373 # Only apply this to the target linker, since the host
4374 # linker might not be gold, but isn't used much anyway.
4375 # TODO(raymes): Disable threading because gold is frequently
4376 # crashing on the bots: crbug.com/161942.
4378 # '-Wl,--thread-count=4',
4383 ['release_valgrind_build==0', {
4384 'target_conditions': [
4385 ['_toolset=="target"', {
4394 ['linux_use_bundled_binutils==1', {
4396 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4399 ['linux_use_bundled_gold==1', {
4400 # Put our binutils, which contains gold in the search path. We pass
4401 # the path to gold to the compiler. gyp leaves unspecified what the
4402 # cwd is when running the compiler, so the normal gyp path-munging
4403 # fails us. This hack gets the right path.
4405 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4408 # Some binutils 2.23 releases may or may not have new dtags enabled,
4409 # but they are all compatible with --disable-new-dtags,
4410 # because the new dynamic tags are not created by default.
4411 ['binutils_version>=223', {
4412 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4413 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4414 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4415 # inside this file to allow usage of --no-as-needed and removal of
4418 '-Wl,--disable-new-dtags',
4421 ['gcc_version>=47 and clang==0', {
4422 'target_conditions': [
4423 ['_toolset=="target"', {
4426 # See comment for -Wno-c++11-narrowing.
4428 # TODO(thakis): Remove, http://crbug.com/263960
4429 '-Wno-literal-suffix',
4434 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4435 'target_conditions': [
4436 ['_toolset=="host"', {
4439 # See comment for -Wno-c++11-narrowing.
4441 # TODO(thakis): Remove, http://crbug.com/263960
4442 '-Wno-literal-suffix',
4450 # FreeBSD-specific options; note that most FreeBSD options are set above,
4453 'target_defaults': {
4455 '-Wl,--no-keep-memory',
4459 # Android-specific options; note that most are set above with Linux.
4462 # This is a unique identifier for a given build. It's used for
4463 # identifying various build artifacts corresponding to a particular
4464 # build of chrome (e.g. where to find archived symbols).
4465 'chrome_build_id%': '',
4467 # Figure this out early since it needs symbols from libgcc.a, so it
4468 # has to be before that in the set of libraries.
4469 ['component=="shared_library"', {
4470 'android_stlport_library': 'stlport_shared',
4472 'android_stlport_library': 'stlport_static',
4476 # Placing this variable here prevents from forking libvpx, used
4477 # by remoting. Remoting is off, so it needn't built,
4478 # so forking it's deps seems like overkill.
4479 # But this variable need defined to properly run gyp.
4480 # A proper solution is to have an OS==android conditional
4481 # in third_party/libvpx/libvpx.gyp to define it.
4482 'libvpx_path': 'lib/linux/arm',
4484 'target_defaults': {
4486 'release_extra_cflags%': '',
4488 # If we're using the components build, append "cr" to all shared
4489 # libraries to avoid naming collisions with android system library
4490 # versions with the same name (e.g. skia, icu).
4491 ['component=="shared_library"', {
4492 'android_product_extension': 'cr.so',
4494 'android_product_extension': 'so',
4498 'target_conditions': [
4499 ['_type=="shared_library"', {
4500 'product_extension': '<(android_product_extension)',
4503 # Settings for building device targets using Android's toolchain.
4504 # These are based on the setup.mk file from the Android NDK.
4506 # The NDK Android executable link step looks as follows:
4508 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4509 # $(PRIVATE_OBJECTS) <-- The .o that we built
4510 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4511 # $(TARGET_LIBGCC) <-- libgcc.a
4512 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4513 # $(PRIVATE_LDLIBS) <-- System .so
4514 # $(TARGET_CRTEND_O) <-- crtend.o
4516 # For now the above are approximated for executables by adding
4517 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4520 # The NDK Android shared library link step looks as follows:
4522 # $(PRIVATE_OBJECTS) <-- The .o that we built
4523 # -l,--whole-archive
4524 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4525 # -l,--no-whole-archive
4526 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4527 # $(TARGET_LIBGCC) <-- libgcc.a
4528 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4529 # $(PRIVATE_LDLIBS) <-- System .so
4531 # For now, assume that whole static libraries are not needed.
4533 # For both executables and shared libraries, add the proper
4534 # libgcc.a to the start of libraries which puts it in the
4535 # proper spot after .o and .a files get linked in.
4537 # TODO: The proper thing to do longer-tem would be proper gyp
4538 # support for a custom link command line.
4539 ['_toolset=="target"', {
4541 '-pthread', # Not supported by Android toolchain.
4544 '-ffunction-sections',
4547 '-fstack-protector',
4549 '-finline-limit=64',
4550 '-Wa,--noexecstack',
4551 '<@(release_extra_cflags)',
4555 '__GNU_SOURCE=1', # Necessary for clone()
4557 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4558 'CHROME_BUILD_ID="<(chrome_build_id)"',
4561 '-pthread', # Not supported by Android toolchain.
4564 '-Wl,--no-undefined',
4567 ['component=="static_library"', {
4569 '-Wl,--exclude-libs=ALL',
4574 # Work around incompatibilities between bionic and clang
4576 '-D__compiler_offsetof=__builtin_offsetof',
4577 '-Dnan=__builtin_nan',
4580 ['target_arch=="arm"', {
4582 '-target arm-linux-androideabi',
4585 '-target arm-linux-androideabi',
4588 ['target_arch=="ia32"', {
4590 '-target x86-linux-androideabi',
4593 '-target x86-linux-androideabi',
4596 # Place holder for x64 support, not tested.
4597 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4598 ['target_arch=="x64"', {
4600 '-target x86_64-linux-androideabi',
4603 '-target x86_64-linux-androideabi',
4610 # Android build relies on -Wl,--gc-sections removing
4611 # unreachable code. ASan instrumentation for globals inhibits
4612 # this and results in a library with unresolvable relocations.
4613 # TODO(eugenis): find a way to reenable this.
4614 '-mllvm -asan-globals=0',
4617 ['target_arch=="arm"', {
4619 # TODO(hans): The ASan runtime is no longer automatically
4620 # added to the link line when using -nostdlib. Can we
4621 # stop adding -nostdlib? (crbug.com/423429)
4622 '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/lib/clang/3.6.0/lib/linux/libclang_rt.asan-arm-android.so',
4627 ['android_webview_build==0', {
4629 # The NDK has these things, but doesn't define the constants
4630 # to say that it does. Define them here instead.
4634 '--sysroot=<(android_ndk_sysroot)',
4637 '--sysroot=<(android_ndk_sysroot)',
4641 '-l<(android_stlport_library)',
4642 # Manually link the libgcc.a that the cross compiler uses.
4643 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4649 ['android_webview_build==1', {
4651 # Android predefines this as 1; undefine it here so Chromium
4652 # can redefine it later to be 2 for chromium code and unset
4653 # for third party code. This works because cflags are added
4655 '-U_FORTIFY_SOURCE',
4656 # Disable any additional warnings enabled by the Android build system but which
4657 # chromium does not build cleanly with (when treating warning as errors).
4658 # Things that are part of -Wextra:
4659 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4660 '-Wno-ignored-qualifiers',
4662 '-Wno-unused-but-set-variable',
4665 # Other things unrelated to -Wextra:
4666 '-Wno-non-virtual-dtor',
4673 ['android_webview_build==1', {
4674 'target_conditions': [
4675 ['chromium_code==0', {
4677 # There is a class of warning which:
4678 # 1) Android always enables and also treats as errors
4679 # 2) Chromium ignores in third party code
4680 # So we re-enable those warnings when building Android.
4682 '-Wno-format-security',
4684 '-Wno-sequence-point',
4687 '-Wno-non-virtual-dtor',
4692 ['target_arch == "arm"', {
4694 # Enable identical code folding to reduce size.
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. Think of them like system headers, but
4701 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4702 # toolchain (circa Gingerbread) will exhibit strange errors.
4703 # The include ordering here is important; change with caution.
4704 ['android_webview_build==0', {
4706 '-isystem<(android_stlport_include)',
4709 '-L<(android_stlport_libs_dir)',
4711 }, { # else: android_webview_build!=0
4712 'aosp_build_settings': {
4713 # Specify that we want to statically link stlport from the
4714 # NDK. This will provide all the include and library paths
4715 # automatically at build time, and link the right library.
4716 'LOCAL_NDK_STL_VARIANT': 'stlport_static',
4719 ['target_arch=="ia32"', {
4720 # The x86 toolchain currently has problems with stack-protector.
4722 '-fstack-protector',
4725 '-fno-stack-protector',
4729 'target_conditions': [
4730 ['_type=="executable"', {
4731 # Force android tools to export the "main" symbol so they can be
4732 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4733 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4734 # when ICS support will be dropped.
4737 '-fvisibility=default',
4741 '-Wl,--gc-sections',
4742 '-Wl,-z,nocopyreloc',
4745 # crtbegin_dynamic.o should be the last item in ldflags.
4746 '<(android_ndk_lib)/crtbegin_dynamic.o',
4749 # crtend_android.o needs to be the last item in libraries.
4750 # Do not add any libraries after this!
4751 '<(android_ndk_lib)/crtend_android.o',
4754 ['_type=="shared_library" or _type=="loadable_module"', {
4756 '-Wl,--exclude-libs=ALL',
4759 '-Wl,-shared,-Bsymbolic',
4762 ['android_webview_build==0', {
4764 # crtbegin_so.o should be the last item in ldflags.
4765 '<(android_ndk_lib)/crtbegin_so.o',
4768 # crtend_so.o needs to be the last item in libraries.
4769 # Do not add any libraries after this!
4770 '<(android_ndk_lib)/crtend_so.o',
4777 # Settings for building host targets using the system toolchain.
4778 ['_toolset=="host"', {
4780 # Due to issues in Clang build system, using ASan on 32-bit
4781 # binaries on x86_64 host is problematic.
4782 # TODO(eugenis): re-enable.
4783 '-fsanitize=address',
4786 '-fsanitize=address',
4787 '-Wl,-z,noexecstack',
4788 '-Wl,--gc-sections',
4791 '-Wl,--warn-shared-textrel',
4792 '-Wl,--fatal-warnings',
4795 # Settings for building host targets on mac.
4796 ['_toolset=="host" and host_os=="mac"', {
4806 'cflags!': ['-fvisibility=hidden'],
4807 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4809 ['OS=="mac" or OS=="ios"', {
4810 'target_defaults': {
4813 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4814 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4815 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4816 'COPY_PHASE_STRIP': 'NO',
4817 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4818 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4819 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4820 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4821 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4822 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4823 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4824 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4825 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4826 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4827 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4828 'GCC_VERSION': '4.2',
4829 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4830 'USE_HEADERMAP': 'NO',
4835 # Don't warn about unused function parameters.
4836 '-Wno-unused-parameter',
4837 # Don't warn about the "struct foo f = {0};" initialization
4839 '-Wno-missing-field-initializers',
4842 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4843 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4845 # Note that the prebuilt Clang binaries should not be used for iOS
4846 # development except for ASan builds.
4848 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
4849 # Warn if automatic synthesis is triggered with
4850 # the -Wobjc-missing-property-synthesis flag.
4851 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4852 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4854 # This warns on selectors from Cocoa headers (-length, -set).
4855 # cfe-dev is currently discussing the merits of this warning.
4856 # TODO(thakis): Reevaluate what to do with this, based one
4857 # cfe-dev discussion.
4858 '-Wno-selector-type-mismatch',
4861 ['clang_xcode==0', {
4862 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4863 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4867 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4869 '<@(clang_chrome_plugins_flags)',
4872 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4874 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4877 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4879 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4882 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4884 # See http://crbug.com/110262
4885 '-fcolor-diagnostics',
4888 ['OS=="ios" and target_subarch!="arm32" and \
4889 "<(GENERATOR)"=="xcode"', {
4891 # TODO(ios): when building Chrome for iOS on 64-bit platform
4892 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4893 # enabled. This cause failures when compiling protobuf code,
4894 # so disable the warning. http://crbug.com/359107
4895 '-Wno-shorten-64-to-32',
4903 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4909 '-fsanitize=address',
4910 '-mllvm -asan-globals=0', # http://crbug.com/352073
4911 '-gline-tables-only',
4915 ['asan_coverage!=0', {
4916 'target_conditions': [
4917 ['_toolset=="target"', {
4919 '-mllvm -asan-coverage=<(asan_coverage)',
4925 'target_conditions': [
4926 ['_type!="static_library"', {
4927 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4932 '-fsanitize=address',
4936 ['mac_write_linker_maps==1', {
4939 '-Wl,-map,>(_target_name).map',
4946 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4947 'target_conditions': [
4948 ['_type=="executable"', {
4954 # Define copy_asan_dylib_path in a variable ending in
4955 # _path so that gyp understands it's a path and
4956 # performs proper relativization during dict merging.
4957 'copy_asan_dylib_path':
4958 'mac/copy_asan_runtime_dylib.sh',
4960 'postbuild_name': 'Copy ASan runtime dylib',
4962 '<(copy_asan_dylib_path)',
4971 ], # target_conditions
4972 }, # target_defaults
4973 }], # OS=="mac" or OS=="ios"
4975 'target_defaults': {
4977 # Prevent Mac OS X AssertMacros.h from defining macros that collide
4978 # with common names, like 'check', 'require', and 'verify'.
4979 # (Included by system header. Also exists on iOS but not included.)
4980 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
4981 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
4984 # These should end with %, but there seems to be a bug with % in
4985 # variables that are intended to be set to different values in
4986 # different targets, like these.
4987 'mac_pie': 1, # Most executables can be position-independent.
4988 # Strip debugging symbols from the target.
4989 'mac_strip': '<(mac_strip_release)',
4993 ['mac_want_real_dsym=="default"', {
4996 'mac_real_dsym': '<(mac_want_real_dsym)'
5001 ['mac_want_real_dsym=="default"', {
5002 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5004 'mac_real_dsym': '<(mac_want_real_dsym)'
5011 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5012 # (Equivalent to -fPIC)
5013 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5014 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5015 # Keep pch files below xcodebuild/.
5016 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5018 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5019 # xcode_setting, but not until all downstream projects' mac bots are
5020 # using xcode >= 4.6, because that's when the default value of the
5021 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5022 # setting is a no-op as far as xcode is concerned, but the compiler
5023 # behaves differently based on whether -fno-strict-aliasing is
5025 '-fno-strict-aliasing', # See http://crbug.com/32204.
5028 'target_conditions': [
5029 ['_type=="executable"', {
5032 # Arranges for data (heap) pages to be protected against
5033 # code execution when running on Mac OS X 10.7 ("Lion"), and
5034 # ensures that the position-independent executable (PIE) bit
5035 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5037 # Define change_mach_o_flags in a variable ending in _path
5038 # so that GYP understands it's a path and performs proper
5039 # relativization during dict merging.
5040 'change_mach_o_flags_path':
5041 'mac/change_mach_o_flags_from_xcode.sh',
5042 'change_mach_o_flags_options%': [
5044 'target_conditions': [
5045 ['mac_pie==0 or release_valgrind_build==1', {
5046 # Don't enable PIE if it's unwanted. It's unwanted if
5047 # the target specifies mac_pie=0 or if building for
5048 # Valgrind, because Valgrind doesn't understand slide.
5049 # See the similar mac_pie/release_valgrind_build check
5051 'change_mach_o_flags_options': [
5057 'postbuild_name': 'Change Mach-O Flags',
5059 '<(change_mach_o_flags_path)',
5060 '>@(change_mach_o_flags_options)',
5067 'asan_saves_file': 'asan.saves',
5070 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
5074 'target_conditions': [
5075 ['mac_pie==1 and release_valgrind_build==0', {
5076 # Turn on position-independence (ASLR) for executables. When
5077 # PIE is on for the Chrome executables, the framework will
5078 # also be subject to ASLR.
5079 # Don't do this when building for Valgrind, because Valgrind
5080 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5081 # understand slide, and get rid of the Valgrind check.
5084 '-Wl,-pie', # Position-independent executable (MH_PIE)
5090 ['(_type=="executable" or _type=="shared_library" or \
5091 _type=="loadable_module") and mac_strip!=0', {
5092 'target_conditions': [
5093 ['mac_real_dsym == 1', {
5094 # To get a real .dSYM bundle produced by dsymutil, set the
5095 # debug information format to dwarf-with-dsym. Since
5096 # strip_from_xcode will not be used, set Xcode to do the
5097 # stripping as well.
5101 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5102 'DEPLOYMENT_POSTPROCESSING': 'YES',
5103 'STRIP_INSTALLED_PRODUCT': 'YES',
5104 'target_conditions': [
5105 ['_type=="shared_library" or _type=="loadable_module"', {
5106 # The Xcode default is to strip debugging symbols
5107 # only (-S). Local symbols should be stripped as
5108 # well, which will be handled by -x. Xcode will
5109 # continue to insert -S when stripping even when
5110 # additional flags are added with STRIPFLAGS.
5112 }], # _type=="shared_library" or _type=="loadable_module"
5113 ['_type=="executable"', {
5116 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
5119 }], # _type=="executable" and asan==1
5120 ], # target_conditions
5122 }, # configuration "Release"
5124 }, { # mac_real_dsym != 1
5125 # To get a fast fake .dSYM bundle, use a post-build step to
5126 # produce the .dSYM and strip the executable. strip_from_xcode
5127 # only operates in the Release configuration.
5131 # Define strip_from_xcode in a variable ending in _path
5132 # so that gyp understands it's a path and performs proper
5133 # relativization during dict merging.
5134 'strip_from_xcode_path': 'mac/strip_from_xcode',
5136 'postbuild_name': 'Strip If Needed',
5137 'action': ['<(strip_from_xcode_path)'],
5141 ], # target_conditions
5142 }], # (_type=="executable" or _type=="shared_library" or
5143 # _type=="loadable_module") and mac_strip!=0
5144 ], # target_conditions
5145 }, # target_defaults
5148 'target_defaults': {
5149 'xcode_settings' : {
5150 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5153 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5154 # additional flag to suppress the "unknown compiler option" error.
5155 # Restrict this flag to builds that are either compiling with Xcode
5156 # or compiling with Xcode's Clang. This will allow Ninja builds to
5157 # continue failing on unknown compiler options.
5158 # TODO(rohitrao): This flag is temporary and should be removed as
5159 # soon as the iOS bots are updated to use Xcode 5.1.
5160 ['clang_xcode==1', {
5162 '-Wno-unknown-warning-option',
5166 # Limit the valid architectures depending on "target_subarch".
5167 # This need to include the "arm" architectures but also the "x86"
5168 # ones (they are used when building for the simulator).
5169 ['target_subarch=="arm32"', {
5170 'VALID_ARCHS': ['armv7', 'i386'],
5172 ['target_subarch=="arm64"', {
5173 'VALID_ARCHS': ['arm64', 'x86_64'],
5175 ['target_subarch=="both"', {
5176 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5178 ['use_system_libcxx==1', {
5179 'target_conditions': [
5180 # Only use libc++ when building target for iOS not when building
5181 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5182 # does not support libc++.
5183 ['_toolset=="target"', {
5184 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5188 # The default for deployment target of 7.0+ is libc++, so force
5189 # the old behavior unless libc++ is enabled.
5190 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5194 'target_conditions': [
5195 ['_toolset=="host"', {
5197 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5198 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5207 ['_toolset=="target"', {
5209 # This section should be for overriding host settings. But,
5210 # since we can't negate the iphone deployment target above, we
5211 # instead set it here for target only.
5212 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5213 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5216 ['_type=="executable"', {
5220 'DEPLOYMENT_POSTPROCESSING': 'YES',
5221 'STRIP_INSTALLED_PRODUCT': 'YES',
5226 # Remove dSYM to reduce build time.
5227 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5233 ['chromium_ios_signing', {
5234 # iOS SDK wants everything for device signed.
5235 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5237 'CODE_SIGNING_REQUIRED': 'NO',
5238 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5243 ], # target_conditions
5244 }, # target_defaults
5247 'target_defaults': {
5249 '_WIN32_WINNT=0x0603',
5256 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5257 'WIN32_LEAN_AND_MEAN',
5260 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5261 '_HAS_EXCEPTIONS=0',
5262 # Silence some warnings; we can't switch the the 'recommended'
5263 # versions as they're not available on old OSs.
5264 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5267 ['buildtype=="Official"', {
5268 # In official builds, targets can self-select an optimization
5269 # level by defining a variable named 'optimize', and setting it
5271 # - "size", optimizes for minimal code size - the default.
5272 # - "speed", optimizes for speed over code size.
5273 # - "max", whole program optimization and link-time code
5274 # generation. This is very expensive and should be used
5277 'optimize%': 'size',
5281 # Set /LTCG for the official builds.
5282 'LinkTimeCodeGeneration': '1',
5285 'target_conditions': [
5286 ['optimize=="size"', {
5288 'VCCLCompilerTool': {
5289 # 1, optimizeMinSpace, Minimize Size (/O1)
5290 'Optimization': '1',
5291 # 2, favorSize - Favor small code (/Os)
5292 'FavorSizeOrSpeed': '2',
5297 ['optimize=="speed"', {
5299 'VCCLCompilerTool': {
5300 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5301 'Optimization': '2',
5302 # 1, favorSpeed - Favor fast code (/Ot)
5303 'FavorSizeOrSpeed': '1',
5308 ['optimize=="max"', {
5309 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5310 # builds. Probably anything that this would catch that
5311 # wouldn't be caught in a normal build isn't going to
5312 # actually be a bug, so the incremental value of C4702 for
5313 # PGO builds is likely very small.
5314 'msvs_disabled_warnings': [
5318 'VCCLCompilerTool': {
5319 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5320 'Optimization': '2',
5321 # 1, favorSpeed - Favor fast code (/Ot)
5322 'FavorSizeOrSpeed': '1',
5323 # This implies link time code generation.
5324 'WholeProgramOptimization': 'true',
5332 ['msvs_xtree_patched!=1', {
5333 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5334 # it's enabled. This will generally only be true for system-level
5335 # installed Express users.
5336 'msvs_disabled_warnings': [
5341 'msvs_system_include_dirs': [
5342 '<(windows_sdk_path)/Include/shared',
5343 '<(windows_sdk_path)/Include/um',
5344 '<(windows_sdk_path)/Include/winrt',
5345 '$(VSInstallDir)/VC/atlmfc/include',
5347 'msvs_cygwin_shell': 0,
5348 'msvs_disabled_warnings': [
5349 # C4127: conditional expression is constant
5350 # This warning can in theory catch dead code and other problems, but
5351 # triggers in far too many desirable cases where the conditional
5352 # expression is either set by macros or corresponds some legitimate
5353 # compile-time constant expression (due to constant template args,
5354 # conditionals comparing the sizes of different types, etc.). Some of
5355 # these can be worked around, but it's not worth it.
5358 # C4351: new behavior: elements of array 'array' will be default
5360 # This is a silly "warning" that basically just alerts you that the
5361 # compiler is going to actually follow the language spec like it's
5362 # supposed to, instead of not following it like old buggy versions
5363 # did. There's absolutely no reason to turn this on.
5366 # C4355: 'this': used in base member initializer list
5367 # It's commonly useful to pass |this| to objects in a class'
5368 # initializer list. While this warning can catch real bugs, most of
5369 # the time the constructors in question don't attempt to call methods
5370 # on the passed-in pointer (until later), and annotating every legit
5371 # usage of this is simply more hassle than the warning is worth.
5374 # C4503: 'identifier': decorated name length exceeded, name was
5376 # This only means that some long error messages might have truncated
5377 # identifiers in the presence of lots of templates. It has no effect
5378 # on program correctness and there's no real reason to waste time
5379 # trying to prevent it.
5382 # C4611: interaction between 'function' and C++ object destruction is
5384 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5385 # suggests using exceptions instead of setjmp/longjmp for C++, but
5386 # Chromium code compiles without exception support. We therefore have
5387 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5388 # means we have to turn off this warning (and be careful about how
5389 # object destruction happens in such cases).
5392 # TODO(maruel): These warnings are level 4. They will be slowly
5393 # removed as code is fixed.
5394 4100, # Unreferenced formal parameter
5395 4121, # Alignment of a member was sensitive to packing
5396 4244, # Conversion from 'type1' to 'type2', possible loss of data
5397 4481, # Nonstandard extension used: override specifier 'keyword'
5398 4505, # Unreferenced local function has been removed
5399 4510, # Default constructor could not be generated
5400 4512, # Assignment operator could not be generated
5401 4610, # Object can never be instantiated
5402 4996, # 'X': was declared deprecated (for GetVersionEx).
5405 'VCCLCompilerTool': {
5406 'AdditionalOptions': ['/MP'],
5407 'MinimalRebuild': 'false',
5408 'BufferSecurityCheck': 'true',
5409 'EnableFunctionLevelLinking': 'true',
5410 'RuntimeTypeInfo': 'false',
5411 'WarningLevel': '4',
5412 'WarnAsError': 'true',
5413 'DebugInformationFormat': '3',
5414 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5415 'ExceptionHandling': '0',
5417 'VCLibrarianTool': {
5418 'AdditionalOptions': ['/ignore:4221'],
5419 'AdditionalLibraryDirectories': [
5420 '<(windows_sdk_path)/Lib/win8/um/x86',
5424 'AdditionalDependencies': [
5436 'AdditionalLibraryDirectories': [
5437 '<(windows_sdk_path)/Lib/win8/um/x86',
5439 'GenerateDebugInformation': 'true',
5440 'MapFileName': '$(OutDir)\\$(TargetName).map',
5441 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5442 'FixedBaseAddress': '1',
5445 # 1 == /SUBSYSTEM:CONSOLE
5446 # 2 == /SUBSYSTEM:WINDOWS
5447 # Most of the executables we'll ever create are tests
5448 # and utilities with console output.
5452 'GenerateStublessProxies': 'true',
5453 'TypeLibraryName': '$(InputName).tlb',
5454 'OutputDirectory': '$(IntDir)',
5455 'HeaderFileName': '$(InputName).h',
5456 'DLLDataFileName': '$(InputName).dlldata.c',
5457 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5458 'ProxyFileName': '$(InputName)_p.c',
5460 'VCResourceCompilerTool': {
5462 'AdditionalIncludeDirectories': [
5464 '<(SHARED_INTERMEDIATE_DIR)',
5467 'target_conditions': [
5468 ['_type=="executable"', {
5470 'EmbedManifest': 'true',
5473 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5475 'AdditionalManifestFiles': [
5476 '>(win_exe_compatibility_manifest)',
5483 # Building with Clang on Windows is a work in progress and very
5484 # experimental. See crbug.com/82385.
5485 'VCCLCompilerTool': {
5486 'WarnAsError': 'false',
5487 'RuntimeTypeInfo': 'false',
5488 'AdditionalOptions': [
5489 '-fmsc-version=1800',
5492 # Many files use intrinsics without including this header.
5493 # TODO(hans): Fix those files, or move this to sub-GYPs.
5496 # TODO(hans): Make this list shorter eventually.
5497 '-Qunused-arguments',
5498 '-Wno-c++11-compat-deprecated-writable-strings',
5499 '-Wno-deprecated-declarations',
5501 '-Wno-enum-conversion',
5502 '-Wno-extra-tokens',
5503 '-Wno-ignored-attributes',
5504 '-Wno-incompatible-pointer-types',
5505 '-Wno-int-to-void-pointer-cast',
5506 '-Wno-invalid-noreturn',
5507 '-Wno-logical-op-parentheses',
5509 '-Wno-missing-braces',
5510 '-Wno-missing-declarations',
5511 '-Wno-msvc-include',
5512 '-Wno-null-dereference',
5513 '-Wno-overloaded-virtual',
5515 '-Wno-pointer-sign',
5517 '-Wno-return-type-c-linkage',
5519 '-Wno-sometimes-uninitialized',
5521 '-Wno-tautological-compare',
5522 '-Wno-unknown-pragmas',
5524 '-Wno-unused-function',
5525 '-Wno-unused-private-field',
5526 '-Wno-unused-value',
5527 '-Wno-unused-variable',
5528 '-Wno-unused-local-typedef', # http://crbug.com/411648
5529 '-Wno-inconsistent-missing-override', #http://crbug.com/428099
5534 # ASan on Windows is a work in progress and very experimental.
5535 # See crbug.com/345874.
5536 'VCCLCompilerTool': {
5537 'AdditionalOptions': [
5538 '-fsanitize=address',
5540 'AdditionalIncludeDirectories': [
5541 # MSVC needs to be able to find the sanitizer headers when
5542 # invoked via /fallback. This is critical for using macros
5543 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5545 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/include_sanitizer',
5549 'AdditionalLibraryDirectories': [
5550 # TODO(hans): If make_clang_dir is absolute, this breaks.
5551 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/lib/windows',
5554 'target_conditions': [
5555 ['component=="shared_library"', {
5557 'AdditionalDependencies': [
5558 'clang_rt.asan_dynamic-i386.lib',
5559 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5563 ['_type=="executable" and component=="static_library"', {
5565 'AdditionalDependencies': [
5566 'clang_rt.asan-i386.lib',
5570 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5572 'AdditionalDependencies': [
5573 'clang_rt.asan_dll_thunk-i386.lib',
5583 ['disable_nacl==1', {
5584 'target_defaults': {
5590 ['OS=="win" and msvs_use_common_linker_extras', {
5591 'target_defaults': {
5606 'AdditionalOptions': [
5615 'AdditionalOptions': ['/largeaddressaware'],
5624 'AdditionalOptions': [
5625 # safeseh is not compatible with x64
5637 ['enable_new_npdevice_api==1', {
5638 'target_defaults': {
5640 'ENABLE_NEW_NPDEVICE_API',
5644 # Don't warn about the "typedef 'foo' locally defined but not used"
5645 # for gcc 4.8 and higher.
5646 # TODO: remove this flag once all builds work. See crbug.com/227506
5647 ['gcc_version>=48 and clang==0', {
5648 'target_defaults': {
5650 '-Wno-unused-local-typedefs',
5654 ['gcc_version>=48 and clang==0 and host_clang==1', {
5655 'target_defaults': {
5656 'target_conditions': [
5657 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5661 # In the android webview build, force host targets to be compiled with clang
5662 # as the hermetic host gcc is very old on some platforms. This is already
5663 # the default on the current development version of AOSP but we force it
5664 # here in case we need to compile against an older release version. We also
5665 # explicitly set it to false for target binaries to avoid causing problems
5666 # for the work to enable clang by default in AOSP. We also force the use of
5667 # libstdc++ on host as peculiarities of the android gyp backend mean that
5668 # using libc++ doesn't work, and Chromium doesn't yet require a more modern
5670 ['android_webview_build==1', {
5671 'target_defaults': {
5672 'target_conditions': [
5673 ['_toolset=="host"', {
5674 'aosp_build_settings': {
5675 'LOCAL_CLANG': 'true',
5676 'LOCAL_CXX_STL': 'libstdc++',
5678 }, { # else: _toolset != "host"
5679 'aosp_build_settings': {
5680 'LOCAL_CLANG': 'false',
5686 # We need a special case to handle the android webview build on mac because
5687 # the host gcc there doesn't accept this flag, but the target gcc may
5689 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5690 'target_defaults': {
5691 'target_conditions': [
5692 ['_toolset=="host"', {
5694 '-Wno-unused-local-typedefs',
5700 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5702 'make_global_settings': [
5703 ['CC', '<(make_clang_dir)/bin/clang'],
5704 ['CXX', '<(make_clang_dir)/bin/clang++'],
5705 ['CC.host', '$(CC)'],
5706 ['CXX.host', '$(CXX)'],
5709 ['clang==1 and OS=="win"', {
5710 'make_global_settings': [
5711 # On Windows, gyp's ninja generator only looks at CC.
5712 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5715 ['use_lld==1 and OS=="win"', {
5716 'make_global_settings': [
5717 # Limited to Windows because lld-link is the driver that is compatible
5719 ['LD', '<(make_clang_dir)/bin/lld-link'],
5722 ['OS=="android" and clang==0', {
5723 # Hardcode the compiler names in the Makefile so that
5724 # it won't depend on the environment at make time.
5725 'make_global_settings': [
5726 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5727 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5728 ['CC.host', '<(host_cc)'],
5729 ['CXX.host', '<(host_cxx)'],
5732 ['OS=="linux" and target_arch=="mipsel"', {
5733 'make_global_settings': [
5734 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5735 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5736 ['CC.host', '<(host_cc)'],
5737 ['CXX.host', '<(host_cxx)'],
5740 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5741 # Set default ARM cross compiling on linux. These can be overridden
5742 # using CC/CXX/etc environment variables.
5743 'make_global_settings': [
5744 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5745 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5746 ['CC.host', '<(host_cc)'],
5747 ['CXX.host', '<(host_cxx)'],
5751 # TODO(yyanagisawa): supports GENERATOR==make
5752 # make generator doesn't support CC_wrapper without CC
5753 # in make_global_settings yet.
5754 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5755 'make_global_settings': [
5756 ['CC_wrapper', '<(gomadir)/gomacc'],
5757 ['CXX_wrapper', '<(gomadir)/gomacc'],
5758 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5759 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5763 'target_defaults': {
5764 'target_conditions': [
5765 ['_toolset=="target"', {
5768 '-ffat-lto-objects',
5774 ['use_lto==1 or use_lto_o2==1', {
5775 'target_defaults': {
5776 'target_conditions': [
5777 ['_toolset=="target"', {
5787 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5788 # This block adds *project-wide* configuration settings to each project
5789 # file. It's almost always wrong to put things here. Specify your
5790 # custom xcode_settings in target_defaults to add them to targets instead.
5793 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5794 # setting sets the SDK on a project-wide basis. In order to get the
5795 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5796 # here at the project level.
5799 ['mac_sdk_path==""', {
5800 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5802 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5808 ['ios_sdk_path==""', {
5810 # TODO(justincohen): Ninja only supports simulator for now.
5811 ['"<(GENERATOR)"=="xcode"', {
5812 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5814 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5818 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5823 # Target both iPhone and iPad.
5824 'TARGETED_DEVICE_FAMILY': '1,2',
5827 ['target_arch=="x64"', {
5832 ['target_arch=="ia32"', {
5841 # The Xcode generator will look for an xcode_settings section at the root
5842 # of each dict and use it to apply settings on a file-wide basis. Most
5843 # settings should not be here, they should be in target-specific
5844 # xcode_settings sections, or better yet, should use non-Xcode-specific
5845 # settings in target dicts. SYMROOT is a special case, because many other
5846 # Xcode variables depend on it, including variables such as
5847 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5848 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5849 # files to appear (when present) in the UI as actual files and not red
5850 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5851 # and therefore SYMROOT, needs to be set at the project level.
5852 'SYMROOT': '<(DEPTH)/xcodebuild',