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=="mac" 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 OpenSSL instead of NSS as the underlying SSL and crypto
65 # implementation. Certificate verification will in most cases be
66 # handled by the OS. If OpenSSL's struct X509 is used to represent
67 # certificates, use_openssl_certs must be set.
70 # Typedef X509Certificate::OSCertHandle to OpenSSL's struct X509*.
71 'use_openssl_certs%': 0,
73 # Disable viewport meta tag by default.
74 'enable_viewport%': 0,
76 # Enable HiDPI support.
79 # Override buildtype to select the desired build flavor.
80 # Dev - everyday build for development/testing
81 # Official - release build (generally implies additional processing)
82 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
83 # conversion is done), some of the things which are now controlled by
84 # 'branding', such as symbol generation, will need to be refactored
85 # based on 'buildtype' (i.e. we don't care about saving symbols for
86 # non-Official # builds).
89 # Override branding to select the desired branding flavor.
90 'branding%': 'Chromium',
93 # ChromeOS and Windows use Aura and Ash.
94 ['chromeos==1 or OS=="win" or OS=="linux"', {
99 ['chromecast==1 and OS!="android"', {
109 # Whether we're a traditional desktop unix.
110 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
116 # Embedded implies ozone.
122 'target_arch%': 'arm',
124 # Default architecture we're building for is the architecture we're
125 # building on, and possibly sub-architecture (for iOS builds).
126 'target_arch%': '<(host_arch)',
130 # Copy conditionally-set variables out one scope.
131 'chromeos%': '<(chromeos)',
132 'chromecast%': '<(chromecast)',
133 'desktop_linux%': '<(desktop_linux)',
134 'use_aura%': '<(use_aura)',
135 'use_ash%': '<(use_ash)',
136 'use_cras%': '<(use_cras)',
137 'use_ozone%': '<(use_ozone)',
138 'embedded%': '<(embedded)',
139 'use_openssl%': '<(use_openssl)',
140 'use_openssl_certs%': '<(use_openssl_certs)',
141 'enable_viewport%': '<(enable_viewport)',
142 'enable_hidpi%': '<(enable_hidpi)',
143 'buildtype%': '<(buildtype)',
144 'branding%': '<(branding)',
145 'host_arch%': '<(host_arch)',
146 'target_arch%': '<(target_arch)',
148 'target_subarch%': '',
150 # The channel to build on Android: stable, beta, dev, canary, or
151 # default. "default" should be used on non-official builds.
152 'android_channel%': 'default',
154 # This is set when building the Android WebView inside the Android
155 # build system, using the 'android' gyp backend. The WebView code is
156 # still built when this is unset, but builds using the normal chromium
158 'android_webview_build%': 0,
160 # This is set when building the Android WebView in ninja for the
162 'android_webview_telemetry_build%': 0,
164 # Set ARM architecture version.
167 # Use aurax11 for clipboard implementation. This is true on linux_aura.
168 'use_clipboard_aurax11%': 0,
172 # If no gomadir is set, it uses the default gomadir.
176 # The system root for cross-compiles. Default: none.
180 # The system libdir used for this ABI.
181 'system_libdir%': 'lib',
183 # Default MIPS arch variant. This is set in the conditions block
184 # below for MIPS targets.
185 'mips_arch_variant%': '',
193 # Set default value of toolkit_views based on OS.
194 ['OS=="win" or chromeos==1 or use_aura==1', {
200 # Embedded builds use aura without ash or views.
207 # Enable HiDPI on Mac OS, Chrome OS and Windows.
208 ['OS=="mac" or chromeos==1 or OS=="win"', {
212 # Enable the OpenSSL backend on Mac OS.
217 # Enable App Launcher everywhere but mobile.
218 ['OS!="ios" and OS!="android"', {
219 'enable_app_list%': 1,
221 'enable_app_list%': 0,
224 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
225 'use_default_render_theme%': 1,
227 'use_default_render_theme%': 0,
231 'use_ozone_evdev%': 1,
233 'use_ozone_evdev%': 0,
236 # Set default gomadir.
238 'gomadir': 'c:\\goma\\goma-win',
240 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
243 # Set the default "target_subarch" on iOS. Valid values are "arm32",
244 # "arm64" and "both" (meaning a fat binary).
246 # TODO(sdefresne): change the default from "arm32" to "both" for
247 # "target_subarch" once http://crbug.com/339477 is fixed.
249 # TODO(sdefresne): set the "target_arch" to "arm" once compilation
250 # of skia has been fixed for simulator. http://crbug.com/342377
252 'target_subarch%': 'arm32',
255 # Set arch variants for MIPS platforms.
256 ['target_arch=="mips64el"', {
259 'mips_arch_variant%': 'r6',
261 'mips_arch_variant%': 'r2',
266 ['target_arch=="mipsel"', {
267 'mips_arch_variant%': 'r1',
272 # Copy conditionally-set variables out one scope.
273 'chromeos%': '<(chromeos)',
274 'chromecast%': '<(chromecast)',
275 'host_arch%': '<(host_arch)',
276 'target_arch%': '<(target_arch)',
277 'target_subarch%': '<(target_subarch)',
278 'mips_arch_variant%': '<(mips_arch_variant)',
279 'toolkit_views%': '<(toolkit_views)',
280 'desktop_linux%': '<(desktop_linux)',
281 'use_aura%': '<(use_aura)',
282 'use_ash%': '<(use_ash)',
283 'use_cras%': '<(use_cras)',
284 'use_ozone%': '<(use_ozone)',
285 'use_ozone_evdev%': '<(use_ozone_evdev)',
286 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
287 'embedded%': '<(embedded)',
288 'use_openssl%': '<(use_openssl)',
289 'use_openssl_certs%': '<(use_openssl_certs)',
290 'enable_viewport%': '<(enable_viewport)',
291 'enable_hidpi%': '<(enable_hidpi)',
292 'android_channel%': '<(android_channel)',
293 'android_webview_build%': '<(android_webview_build)',
294 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
295 'use_goma%': '<(use_goma)',
296 'gomadir%': '<(gomadir)',
297 'enable_app_list%': '<(enable_app_list)',
298 'use_default_render_theme%': '<(use_default_render_theme)',
299 'buildtype%': '<(buildtype)',
300 'branding%': '<(branding)',
301 'arm_version%': '<(arm_version)',
302 'sysroot%': '<(sysroot)',
303 'chroot_cmd%': '<(chroot_cmd)',
304 'system_libdir%': '<(system_libdir)',
306 # Set to 1 to enable fast builds. Set to 2 for even faster builds
307 # (it disables debug info for fastest compilation - only for use
308 # on compile-only bots).
311 # Set to 1 to not store any build metadata (this isn't working yet but
312 # this flag will help us to get there). See http://crbug.com/314403.
313 # TODO(sebmarchand): Update this comment once this flag guarantee that
314 # there's no build metadata in the build artifacts.
315 'dont_embed_build_metadata%': 0,
317 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
318 # This is useful for parallel compilation tools which can't support /Zi.
319 # Only used on Windows.
322 # Set to 1 to enable dcheck in release.
323 'dcheck_always_on%': 0,
325 # Set to 1 to make a build that disables unshipped tracing events.
326 # Note: this setting is ignored if buildtype=="Official".
327 'tracing_like_official_build%': 0,
329 # Disable image loader component extension by default.
330 'image_loader_extension%': 0,
332 # Set NEON compilation flags.
335 # Detect NEON support at run-time.
336 'arm_neon_optional%': 0,
338 # Use libjpeg-turbo as the JPEG codec used by Chromium.
339 'use_libjpeg_turbo%': 1,
341 # Use system libjpeg. Note that the system's libjepg will be used even if
342 # use_libjpeg_turbo is set.
343 'use_system_libjpeg%': 0,
345 # By default, component is set to static_library and it can be overriden
346 # by the GYP command line or by ~/.gyp/include.gypi.
347 'component%': 'static_library',
349 # Set to select the Title Case versions of strings in GRD files.
350 'use_titlecase_in_grd%': 0,
352 # Use translations provided by volunteers at launchpad.net. This
353 # currently only works on Linux.
354 'use_third_party_translations%': 0,
356 # Remoting compilation is enabled by default. Set to 0 to disable.
359 # Configuration policy is enabled by default. Set to 0 to disable.
360 'configuration_policy%': 1,
362 # Variable safe_browsing is used to control the build time configuration
363 # for safe browsing feature. Safe browsing can be compiled in 3 different
364 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
365 # reporting features without enabling phishing and malware detection. This
366 # is useful to integrate a third party phishing/malware detection to
367 # existing safe browsing logic.
370 # Web speech is enabled by default. Set to 0 to disable.
371 'enable_web_speech%': 1,
373 # Notifications are compiled in by default. Set to 0 to disable.
374 'notifications%' : 1,
376 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
377 # regular builds and 1 for ASan builds.
378 'mac_want_real_dsym%': 'default',
380 # If this is set, the clang plugins used on the buildbot will be used.
381 # Run tools/clang/scripts/update.sh to make sure they are compiled.
382 # This causes 'clang_chrome_plugins_flags' to be set.
383 # Has no effect if 'clang' is not set as well.
384 'clang_use_chrome_plugins%': 1,
386 # Enable building with ASAN (Clang's -fsanitize=address option).
387 # -fsanitize=address only works with clang, but asan=1 implies clang=1
388 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
390 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
391 # Enable coverage gathering instrumentation in ASan. This flag also
392 # controls coverage granularity (1 for function-level coverage, 2 for
393 # block-level coverage).
395 # Enable intra-object-overflow detection in ASan (experimental).
396 'asan_field_padding%': 0,
398 # Enable Chromium overrides of the default configurations for various
399 # dynamic tools (like ASan).
400 'use_sanitizer_options%': 0,
402 # Enable building with SyzyAsan.
403 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
406 # Enable building with LSan (Clang's -fsanitize=leak option).
407 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
408 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
411 # Enable building with TSan (Clang's -fsanitize=thread option).
412 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
413 # See http://clang.llvm.org/docs/ThreadSanitizer.html
415 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
417 # Enable building with MSan (Clang's -fsanitize=memory option).
418 # MemorySanitizer only works with clang, but msan=1 implies clang=1
419 # See http://clang.llvm.org/docs/MemorySanitizer.html
421 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
422 # Track where uninitialized memory originates from. From fastest to
423 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
424 # - track the chain of stores leading from allocation site to use site.
425 'msan_track_origins%': 1,
427 # Enable building with UBSan (Clang's -fsanitize=undefined option).
428 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
429 # See http://clang.llvm.org/docs/UsersManual.html
432 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
433 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
435 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan_vptr/blacklist.txt',
437 # Use the dynamic libraries instrumented by one of the sanitizers
438 # instead of the standard system libraries.
439 'use_instrumented_libraries%': 0,
441 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
442 # stdlibc++ as standard library. This is intended to use for instrumented
444 'use_custom_libcxx%': 0,
446 # Use system libc++ instead of the default C++ library, usually libstdc++.
447 # This is intended for iOS builds only.
448 'use_system_libcxx%': 0,
450 # Use a modified version of Clang to intercept allocated types and sizes
451 # for allocated objects. clang_type_profiler=1 implies clang=1.
452 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
453 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
454 'clang_type_profiler%': 0,
456 # Set to true to instrument the code with function call logger.
457 # See src/third_party/cygprofile/cyg-profile.cc for details.
458 'order_profiling%': 0,
460 # Use the provided profiled order file to link Chrome image with it.
461 # This makes Chrome faster by better using CPU cache when executing code.
462 # This is known as PGO (profile guided optimization).
463 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
464 'order_text_section%' : "",
466 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
467 # libraries on linux x86-64 and arm, plus ASLR.
470 # Whether one-click signin is enabled or not.
471 'enable_one_click_signin%': 0,
473 # Whether to back up data before sync.
474 'enable_pre_sync_backup%': 0,
476 # Enable Chrome browser extensions
477 'enable_extensions%': 1,
480 'enable_google_now%': 1,
482 # Enable printing support and UI. This variable is used to configure
483 # which parts of printing will be built. 0 disables printing completely,
484 # 1 enables it fully, and 2 enables only the codepath to generate a
485 # Metafile (e.g. usually a PDF or EMF) and disables print preview, cloud
487 'enable_printing%': 1,
489 # Set the version of CLD.
490 # 0: Don't specify the version. This option is for the Finch testing.
495 # For CLD2, the size of the tables that should be included in the build
496 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
498 # See third_party/cld_2/cld_2.gyp for more information.
499 # 0: Small tables, lower accuracy
500 # 1: Medium tables, medium accuracy
501 # 2: Large tables, high accuracy
502 'cld2_table_size%': 2,
504 # The data acquisition mode for CLD2. Possible values are:
505 # static: CLD2 data is statically linked to the executable.
506 # standalone: CLD2 data is provided in a standalone file that is
507 # bundled with the executable.
508 # component: CLD2 data is provided as a Chrome "component" and is
509 # downloaded via the component updater.
511 # For more information on switching the CLD2 data source, see:
512 # https://sites.google.com/a/chromium.org/dev/developers/how-tos/compact-language-detector-cld-data-source-configuration
514 # This string will be exposed in chrome://translate-internals under the
515 # heading "CLD Data Source". This allows easy determination of which
516 # data source the browser was built with.
517 'cld2_data_source%': 'static',
519 # Enable spell checker.
520 'enable_spellcheck%': 1,
522 # Webrtc compilation is enabled by default. Set to 0 to disable.
525 # Enables use of the session service, which is enabled by default.
526 # Support for disabling depends on the platform.
527 'enable_session_service%': 1,
529 # Enables theme support, which is enabled by default. Support for
530 # disabling depends on the platform.
533 # Enables autofill dialog and associated features; disabled by default.
534 'enable_autofill_dialog%' : 0,
536 # Defaults Wallet integration in Autofill dialog to use production
537 # servers. Unofficial builds won't have the proper API keys.
538 'enable_prod_wallet_service%': 0,
540 # Enables support for background apps.
541 'enable_background%': 1,
543 # Enable the task manager by default.
544 'enable_task_manager%': 1,
546 # Enables used resource whitelist generation; disabled by default.
547 'enable_resource_whitelist_generation%': 0,
549 # Enable FILE support by default.
550 'disable_file_support%': 0,
552 # Enable FTP support by default.
553 'disable_ftp_support%': 0,
555 # Use native android functions in place of ICU. Not supported by most
557 'use_icu_alternatives_on_android%': 0,
559 # XInput2 multitouch support is enabled by default (use_xi2_mt=2).
560 # Setting to zero value disables XI2 MT. When XI2 MT is enabled,
561 # the input value also defines the required XI2 minor minimum version.
562 # For example, use_xi2_mt=2 means XI2.2 or above version is required.
565 # Use of precompiled headers on Windows.
567 # This variable may be explicitly set to 1 (enabled) or 0
568 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
569 # This setting will override the default.
572 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
574 'chromium_win_pch%': 0,
577 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
578 # Set this to true when building with Clang.
579 # See http://code.google.com/p/chromium/wiki/Clang for details.
580 # If this is set, clang is used as both host and target compiler in
581 # cross-compile builds.
584 # Enable plug-in installation by default.
585 'enable_plugin_installation%': 1,
587 # Specifies whether to use canvas_skia.cc in place of platform
588 # specific implementations of gfx::Canvas. Affects text drawing in the
590 # TODO(asvitkine): Enable this on all platforms and delete this flag.
591 # http://crbug.com/105550
592 'use_canvas_skia%': 0,
594 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
595 # with one of those tools.
596 'build_for_tool%': '',
598 # If no directory is specified then a temporary directory will be used.
599 'test_isolation_outdir%': '',
600 # True if isolate should fail if the isolate files refer to files
602 'test_isolation_fail_on_missing': 1,
604 'wix_path%': '<(DEPTH)/third_party/wix',
606 # Managed users are enabled by default.
607 'enable_managed_users%': 1,
609 # Platform natively supports discardable memory.
610 'native_discardable_memory%': 0,
612 # Platform sends memory pressure signals natively.
613 'native_memory_pressure_signals%': 0,
615 'spdy_proxy_auth_property%' : '',
616 'spdy_proxy_auth_value%' : '',
618 'enable_service_discovery%': 0,
619 'enable_wifi_bootstrapping%': 0,
620 'enable_hangout_services_extension%': 0,
622 # Enable the Syzygy optimization step.
623 'syzygy_optimize%': 0,
625 # Enable hole punching for the protected video.
628 # Temporary hack to allow us to unify blink's definitions of load
629 # completion. blink uses a crazy set of constraints to determine load
630 # completion, but only actually requires them for layout tests. However,
631 # we need to maintain all the old behaviors while the plumbing is put in
632 # place on both sides of the repo boundary.
633 'enable_load_completion_hacks%': 1,
635 # Automatically select platforms under ozone. Turn this off to
636 # build only explicitly selected platforms.
637 'ozone_auto_platforms%': 1,
639 # If this is set clang is used as host compiler, but not as target
640 # compiler. Always do this by default.
643 # Variables to control Link-Time Optimizations (LTO).
644 # Note: the variables must *not* be enabled at the same time.
645 # In this case LTO would 'merge' the optimization flags
646 # at link-time which would lead to all code be optimized with -O2.
647 # Enable LTO on the code compiled with -Os.
648 # See crbug.com/407544
650 # Enable LTO on code compiled with -O2.
654 # A flag for POSIX platforms
661 # A flag for BSD platforms
662 ['OS=="freebsd" or OS=="openbsd"', {
669 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
675 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
676 # OpenSSL's certificate definition.
677 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
678 'use_openssl_certs%': 1,
680 'use_openssl_certs%': 0,
683 # libudev usage. This currently only affects the content layer.
684 ['OS=="linux" and embedded==0', {
690 # Flags to use X11 on non-Mac POSIX platforms.
691 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
698 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
704 # Flags to use pango and cairo.
705 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
714 ['OS=="linux" and embedded==0', {
720 # We always use skia text rendering in Aura on Windows, since GDI
721 # doesn't agree with our BackingStore.
722 # TODO(beng): remove once skia text rendering is on by default.
723 ['use_aura==1 and OS=="win"', {
724 'enable_skia_text%': 1,
727 # A flag to enable or disable our compile-time dependency
728 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
729 # support will be available. This option is useful
730 # for Linux distributions and for Aura.
731 ['OS!="linux" or chromeos==1', {
732 'use_gnome_keyring%': 0,
734 'use_gnome_keyring%': 1,
737 ['OS=="mac" or OS=="ios"', {
738 # Mac and iOS want Title Case strings
739 'use_titlecase_in_grd%': 1,
742 # Enable loader extensions on Chrome OS.
744 'image_loader_extension%': 1,
746 'image_loader_extension%': 0,
749 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
750 'enable_one_click_signin%': 1,
751 'enable_pre_sync_backup%': 1,
755 'enable_extensions%': 0,
756 'enable_google_now%': 0,
758 'enable_spellcheck%': 0,
762 'arm_neon_optional%': 1,
763 'native_discardable_memory%': 1,
764 'native_memory_pressure_signals%': 1,
765 'enable_printing%': 2,
766 'enable_task_manager%':0,
767 # Set to 1 once we have a notification system for Android.
768 # http://crbug.com/115320
773 # Android OS includes support for proprietary codecs regardless of
774 # building Chromium or Google Chrome. We also ship Google Chrome and
775 # Chromecast with proprietary codecs.
776 ['OS=="android" or branding=="Chrome" or chromecast==1', {
777 'proprietary_codecs%': 1,
779 'proprietary_codecs%': 0,
782 ['OS=="mac" or OS=="ios"', {
783 'native_discardable_memory%': 1,
784 'native_memory_pressure_signals%': 1,
787 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
788 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
789 'enable_autofill_dialog%': 1,
792 ['buildtype=="Official"', {
793 'enable_prod_wallet_service%': 1,
803 'disable_ftp_support%': 1,
804 'enable_extensions%': 0,
805 'enable_google_now%': 0,
807 'enable_printing%': 0,
808 'enable_session_service%': 0,
814 'enable_managed_users%': 0,
815 'enable_task_manager%': 0,
816 'use_system_libcxx%': 1,
817 'support_pre_M6_history_database%': 0,
820 # Use GPU accelerated cross process image transport by default
821 # on linux builds with the Aura window manager
822 ['use_aura==1 and OS=="linux"', {
823 'ui_compositor_image_transport%': 1,
825 'ui_compositor_image_transport%': 0,
828 # Turn precompiled headers on by default.
829 ['OS=="win" and buildtype!="Official"', {
830 'chromium_win_pch%': 1
833 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
834 'enable_plugin_installation%': 0,
836 'enable_plugin_installation%': 1,
839 # Whether PPAPI is enabled.
840 ['OS=="android" or OS=="ios" or embedded==1', {
841 'enable_plugins%': 0,
843 'enable_plugins%': 1,
846 # linux_use_bundled_gold: whether to use the gold linker binary checked
847 # into third_party/binutils. Force this off via GYP_DEFINES when you
848 # are using a custom toolchain and need to control -B in ldflags.
849 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
850 # for component=static_library builds.
851 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
852 'linux_use_bundled_gold%': 1,
854 'linux_use_bundled_gold%': 0,
857 # linux_use_bundled_binutils: whether to use the binary binutils
858 # checked into third_party/binutils. These are not multi-arch so cannot
859 # be used except on x86 and x86-64 (the only two architectures which
860 # are currently checke in). Force this off via GYP_DEFINES when you
861 # are using a custom toolchain and need to control -B in cflags.
862 ['OS=="linux" and (target_arch=="x64")', {
863 'linux_use_bundled_binutils%': 1,
865 'linux_use_bundled_binutils%': 0,
868 # linux_use_gold_flags: whether to use build flags that rely on gold.
869 # On by default for x64 Linux.
870 ['OS=="linux" and target_arch=="x64"', {
871 'linux_use_gold_flags%': 1,
873 'linux_use_gold_flags%': 0,
876 # linux_use_debug_fission: whether to use split DWARF debug info
877 # files. This can reduce link time significantly, but is incompatible
878 # with some utilities such as icecc and ccache. Requires gold and
879 # gcc >= 4.8 or clang.
880 # http://gcc.gnu.org/wiki/DebugFission
881 ['OS=="linux" and target_arch=="x64"', {
882 'linux_use_debug_fission%': 1,
884 'linux_use_debug_fission%': 0,
887 ['OS=="android" or OS=="ios"', {
888 'enable_captive_portal_detection%': 0,
890 'enable_captive_portal_detection%': 1,
893 # Enable Skia UI text drawing incrementally on different platforms.
894 # http://crbug.com/105550
896 # On Aura, this allows per-tile painting to be used in the browser
899 'use_canvas_skia%': 1,
903 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
904 'use_libjpeg_turbo%': 0,
907 # Do not enable the Settings App on ChromeOS.
908 ['enable_app_list==1 and chromeos==0', {
909 'enable_settings_app%': 1,
911 'enable_settings_app%': 0,
914 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
915 # Set some defaults for arm/linux chrome builds
916 'use_allocator%': 'none',
917 # sysroot needs to be an absolute path otherwise it generates
918 # incorrect results when passed to pkg-config
919 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot',
920 }], # OS=="linux" and target_arch=="arm" and chromeos==0
922 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
924 ['target_arch=="x64"', {
925 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
927 ['target_arch=="ia32"', {
928 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
931 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
933 ['OS=="linux" and target_arch=="mipsel"', {
934 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
935 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
938 # Whether tests targets should be run, archived or just have the
939 # dependencies verified. All the tests targets have the '_run' suffix,
940 # e.g. base_unittests_run runs the target base_unittests. The test
941 # target always calls tools/swarming_client/isolate.py. See the script's
942 # --help for more information. Meant to be overriden with GYP_DEFINES.
943 # TODO(maruel): Remove the conditions as more configurations are
945 ['OS!="ios" and OS!="android" and chromeos==0', {
946 'test_isolation_mode%': 'check',
948 'test_isolation_mode%': 'noop',
950 # Whether Android build uses OpenMAX DL FFT.
951 ['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")', {
952 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
953 # When enabled, this will also enable WebAudio support on
954 # Android for these architectures. Default is enabled. Whether
955 # WebAudio is actually available depends on runtime settings
957 'use_openmax_dl_fft%': 1,
959 'use_openmax_dl_fft%': 0,
961 ['OS=="win" or OS=="linux"', {
965 # Turns on compiler optimizations in V8 in Debug build, except
966 # on android_clang, where we're hitting a weird linker error.
967 # TODO(dpranke): http://crbug.com/266155 .
969 'v8_optimized_debug%': 1,
971 'v8_optimized_debug%': 2,
974 # Disable various features by default on embedded.
977 'enable_printing%': 0,
980 # By default, use ICU data file (icudtl.dat) on all platforms
981 # except when building Android WebView or Chromecast.
982 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
983 # Set the data reduction proxy origin for Android Webview.
984 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0', {
985 'icu_use_data_file_flag%' : 1,
987 'icu_use_data_file_flag%' : 0,
989 ['OS=="win" or OS=="mac"', {
990 'enable_wifi_bootstrapping%' : 1,
993 # Path to sas.dll, which provides the SendSAS function.
994 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
995 ['target_arch=="x64"', {
996 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
998 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1001 # Turn on JNI generation optimizations on non-WebView builds.
1002 ['OS=="android" and android_webview_build==0', {
1003 'optimize_jni_generation%': 1,
1005 'optimize_jni_generation%': 0,
1009 # Set this to 1 to enable use of concatenated impulse responses
1010 # for the HRTF panner in WebAudio.
1011 'use_concatenated_impulse_responses': 1,
1013 # You can set the variable 'use_official_google_api_keys' to 1
1014 # to use the Google-internal file containing official API keys
1015 # for Google Chrome even in a developer build. Setting this
1016 # variable explicitly to 1 will cause your build to fail if the
1017 # internal file is missing.
1019 # The variable is documented here, but not handled in this file;
1020 # see //google_apis/determine_use_official_keys.gypi for the
1023 # Set the variable to 0 to not use the internal file, even when
1024 # it exists in your checkout.
1026 # Leave it unset in your include.gypi to have the variable
1027 # implicitly set to 1 if you have
1028 # src/google_apis/internal/google_chrome_api_keys.h in your
1029 # checkout, and implicitly set to 0 if not.
1031 # Note that official builds always behave as if the variable
1032 # was explicitly set to 1, i.e. they always use official keys,
1033 # and will fail to build if the internal file is missing.
1035 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1036 # include.gypi or by other means. Due to subtleties of GYP, this
1037 # is not the same as leaving the variable unset, even though its
1039 # //google_apis/determine_use_official_keys.gypi is 2.
1041 # Set these to bake the specified API keys and OAuth client
1042 # IDs/secrets into your build.
1044 # If you create a build without values baked in, you can instead
1045 # set environment variables to provide the keys at runtime (see
1046 # src/google_apis/google_api_keys.h for details). Features that
1047 # require server-side APIs may fail to work if no keys are
1050 # Note that if you are building an official build or if
1051 # use_official_google_api_keys has been set to 1 (explicitly or
1052 # implicitly), these values will be ignored and the official
1053 # keys will be used instead.
1054 'google_api_key%': '',
1055 'google_default_client_id%': '',
1056 'google_default_client_secret%': '',
1057 # Native Client is enabled by default.
1058 'disable_nacl%': '0',
1060 # Set to 1 to support old history files
1061 'support_pre_M6_history_database%': '1',
1064 # Copy conditionally-set variables out one scope.
1065 'branding%': '<(branding)',
1066 'buildtype%': '<(buildtype)',
1067 'target_arch%': '<(target_arch)',
1068 'target_subarch%': '<(target_subarch)',
1069 'mips_arch_variant%': '<(mips_arch_variant)',
1070 'host_arch%': '<(host_arch)',
1071 'toolkit_views%': '<(toolkit_views)',
1072 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1073 'use_aura%': '<(use_aura)',
1074 'use_ash%': '<(use_ash)',
1075 'use_cras%': '<(use_cras)',
1076 'use_openssl%': '<(use_openssl)',
1077 'use_openssl_certs%': '<(use_openssl_certs)',
1078 'use_nss%': '<(use_nss)',
1079 'use_udev%': '<(use_udev)',
1080 'os_bsd%': '<(os_bsd)',
1081 'os_posix%': '<(os_posix)',
1082 'use_dbus%': '<(use_dbus)',
1083 'use_glib%': '<(use_glib)',
1084 'use_pango%': '<(use_pango)',
1085 'use_cairo%': '<(use_cairo)',
1086 'use_ozone%': '<(use_ozone)',
1087 'use_ozone_evdev%': '<(use_ozone_evdev)',
1088 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1089 'desktop_linux%': '<(desktop_linux)',
1090 'use_x11%': '<(use_x11)',
1091 'use_gnome_keyring%': '<(use_gnome_keyring)',
1092 'linux_fpic%': '<(linux_fpic)',
1093 'chromeos%': '<(chromeos)',
1094 'chromecast%': '<(chromecast)',
1095 'enable_viewport%': '<(enable_viewport)',
1096 'enable_hidpi%': '<(enable_hidpi)',
1097 'use_xi2_mt%':'<(use_xi2_mt)',
1098 'image_loader_extension%': '<(image_loader_extension)',
1099 'fastbuild%': '<(fastbuild)',
1100 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1101 'win_z7%': '<(win_z7)',
1102 'dcheck_always_on%': '<(dcheck_always_on)',
1103 'tracing_like_official_build%': '<(tracing_like_official_build)',
1104 'arm_version%': '<(arm_version)',
1105 'arm_neon%': '<(arm_neon)',
1106 'arm_neon_optional%': '<(arm_neon_optional)',
1107 'sysroot%': '<(sysroot)',
1108 'chroot_cmd%': '<(chroot_cmd)',
1109 'system_libdir%': '<(system_libdir)',
1110 'component%': '<(component)',
1111 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1112 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1113 'use_third_party_translations%': '<(use_third_party_translations)',
1114 'remoting%': '<(remoting)',
1115 'enable_one_click_signin%': '<(enable_one_click_signin)',
1116 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1117 'enable_webrtc%': '<(enable_webrtc)',
1118 'chromium_win_pch%': '<(chromium_win_pch)',
1119 'configuration_policy%': '<(configuration_policy)',
1120 'safe_browsing%': '<(safe_browsing)',
1121 'enable_web_speech%': '<(enable_web_speech)',
1122 'notifications%': '<(notifications)',
1123 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1124 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1126 'asan_blacklist%': '<(asan_blacklist)',
1127 'asan_coverage%': '<(asan_coverage)',
1128 'asan_field_padding%': '<(asan_field_padding)',
1129 'use_sanitizer_options%': '<(use_sanitizer_options)',
1130 'syzyasan%': '<(syzyasan)',
1131 'syzygy_optimize%': '<(syzygy_optimize)',
1134 'msan_blacklist%': '<(msan_blacklist)',
1135 'msan_track_origins%': '<(msan_track_origins)',
1137 'tsan_blacklist%': '<(tsan_blacklist)',
1138 'ubsan%': '<(ubsan)',
1139 'ubsan_vptr%': '<(ubsan_vptr)',
1140 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1141 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1142 'use_custom_libcxx%': '<(use_custom_libcxx)',
1143 'use_system_libcxx%': '<(use_system_libcxx)',
1144 'clang_type_profiler%': '<(clang_type_profiler)',
1145 'order_profiling%': '<(order_profiling)',
1146 'order_text_section%': '<(order_text_section)',
1147 'enable_extensions%': '<(enable_extensions)',
1148 'enable_plugin_installation%': '<(enable_plugin_installation)',
1149 'enable_plugins%': '<(enable_plugins)',
1150 'enable_session_service%': '<(enable_session_service)',
1151 'enable_themes%': '<(enable_themes)',
1152 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1153 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1154 'enable_background%': '<(enable_background)',
1155 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1156 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1157 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1158 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1159 'use_canvas_skia%': '<(use_canvas_skia)',
1160 'test_isolation_mode%': '<(test_isolation_mode)',
1161 'test_isolation_outdir%': '<(test_isolation_outdir)',
1162 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1163 'enable_printing%': '<(enable_printing)',
1164 'enable_spellcheck%': '<(enable_spellcheck)',
1165 'enable_google_now%': '<(enable_google_now)',
1166 'cld_version%': '<(cld_version)',
1167 'cld2_table_size%': '<(cld2_table_size)',
1168 'cld2_data_source%': '<(cld2_data_source)',
1169 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1170 'disable_file_support%': '<(disable_file_support)',
1171 'disable_ftp_support%': '<(disable_ftp_support)',
1172 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1173 'enable_task_manager%': '<(enable_task_manager)',
1174 'sas_dll_path%': '<(sas_dll_path)',
1175 'wix_path%': '<(wix_path)',
1176 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1177 'use_system_libjpeg%': '<(use_system_libjpeg)',
1178 'android_channel%': '<(android_channel)',
1179 'android_webview_build%': '<(android_webview_build)',
1180 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
1181 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1182 'gyp_managed_install%': 0,
1183 'create_standalone_apk%': 1,
1184 'enable_app_list%': '<(enable_app_list)',
1185 'use_default_render_theme%': '<(use_default_render_theme)',
1186 'enable_settings_app%': '<(enable_settings_app)',
1187 'google_api_key%': '<(google_api_key)',
1188 'google_default_client_id%': '<(google_default_client_id)',
1189 'google_default_client_secret%': '<(google_default_client_secret)',
1190 'enable_managed_users%': '<(enable_managed_users)',
1191 'native_discardable_memory%': '<(native_discardable_memory)',
1192 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1193 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1194 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1195 'enable_mdns%' : '<(enable_mdns)',
1196 'enable_service_discovery%' : '<(enable_service_discovery)',
1197 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1198 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1199 'v8_optimized_debug%': '<(v8_optimized_debug)',
1200 'proprietary_codecs%': '<(proprietary_codecs)',
1201 'use_goma%': '<(use_goma)',
1202 'gomadir%': '<(gomadir)',
1203 'use_lto%': '<(use_lto)',
1204 'use_lto_o2%': '<(use_lto_o2)',
1205 'video_hole%': '<(video_hole)',
1206 'enable_load_completion_hacks%': '<(enable_load_completion_hacks)',
1207 'support_pre_M6_history_database%': '<(support_pre_M6_history_database)',
1209 # Whether or not we are building the Athena shell.
1212 # Use system protobuf instead of bundled one.
1213 'use_system_protobuf%': 0,
1215 # Use system yasm instead of bundled one.
1216 'use_system_yasm%': 0,
1218 # Use system ICU instead of bundled one.
1219 'use_system_icu%' : 0,
1221 # Default to enabled PIE; this is important for ASLR but we may need to be
1222 # able to turn it off for various reasons.
1223 'linux_disable_pie%': 0,
1225 # The release channel that this build targets. This is used to restrict
1226 # channel-specific build options, like which installer packages to create.
1227 # The default is 'all', which does no channel-specific filtering.
1230 # Override chromium_mac_pch and set it to 0 to suppress the use of
1231 # precompiled headers on the Mac. Prefix header injection may still be
1232 # used, but prefix headers will not be precompiled. This is useful when
1233 # using distcc to distribute a build to compile slaves that don't
1234 # share the same compiler executable as the system driving the compilation,
1235 # because precompiled headers rely on pointers into a specific compiler
1236 # executable's image. Setting this to 0 is needed to use an experimental
1237 # Linux-Mac cross compiler distcc farm.
1238 'chromium_mac_pch%': 1,
1240 # The default value for mac_strip in target_defaults. This cannot be
1241 # set there, per the comment about variable% in a target_defaults.
1242 'mac_strip_release%': 0,
1244 # Set to 1 to enable java code coverage. Instruments classes during build
1245 # to produce .ec files during runtime.
1246 'emma_coverage%': 0,
1248 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1249 # separated with whitespace and/or comma. Only has effect if
1250 # 'emma_coverage=1'.
1253 # Set to 1 to enable running Android lint on java/class files.
1256 # Although base/allocator lets you select a heap library via an
1257 # environment variable, the libcmt shim it uses sometimes gets in
1258 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1259 # 'win_use_allocator_shim': 0,
1260 # 'win_release_RuntimeLibrary': 2
1261 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1262 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1264 # TODO(bradnelson): eliminate this when possible.
1265 # To allow local gyp files to prevent release.vsprops from being included.
1266 # Yes(1) means include release.vsprops.
1267 # Once all vsprops settings are migrated into gyp, this can go away.
1268 'msvs_use_common_release%': 1,
1270 # TODO(bradnelson): eliminate this when possible.
1271 # To allow local gyp files to override additional linker options for msvs.
1272 # Yes(1) means set use the common linker options.
1273 'msvs_use_common_linker_extras%': 1,
1275 # TODO(sgk): eliminate this if possible.
1276 # It would be nicer to support this via a setting in 'target_defaults'
1277 # in chrome/app/locales/locales.gypi overriding the setting in the
1278 # 'Debug' configuration in the 'target_defaults' dict below,
1279 # but that doesn't work as we'd like.
1280 'msvs_debug_link_incremental%': '2',
1282 # Needed for some of the largest modules.
1283 'msvs_debug_link_nonincremental%': '1',
1285 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1286 # to get incremental linking to be faster in debug builds.
1287 'incremental_chrome_dll%': '0',
1289 # Experimental setting to break chrome.dll into multiple pieces based on
1291 'chrome_multiple_dll%': '0',
1293 # Experimental setting to optimize Chrome's DLLs with PGO.
1294 'chrome_pgo_phase%': '0',
1297 'clang%': '<(clang)',
1298 'host_clang%': '<(host_clang)',
1299 'make_clang_dir%': '<(make_clang_dir)',
1301 # Control which version of clang to use when building for iOS. If set to
1302 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1303 # the version of clang that ships with the Chromium source. This variable
1304 # is automatically set to '1' when using the Xcode generator.
1307 # These two variables can be set in GYP_DEFINES while running
1308 # |gclient runhooks| to let clang run a plugin in every compilation.
1309 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1311 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1314 'clang_add_plugin%': '',
1316 # Tell ld64 to write map files describing binary layout. Useful
1317 # for looking at what contributes to binary size, e.g. with
1318 # https://github.com/nico/bloat
1319 'mac_write_linker_maps%': 0,
1321 # The default type of gtest.
1322 'gtest_target_type%': 'executable',
1324 # Enable sampling based profiler.
1325 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1327 # Profile without optimizing out stack frames when profiling==1.
1328 'profiling_full_stack_frames%': '0',
1330 # And if we want to dump symbols for Breakpad-enabled builds.
1331 'linux_dump_symbols%': 0,
1332 # And if we want to strip the binary after dumping symbols.
1333 'linux_strip_binary%': 0,
1334 # If we want stack unwind support for backtrace().
1335 'debug_unwind_tables%': 1,
1336 'release_unwind_tables%': 1,
1338 # Override where to find binutils
1339 'binutils_version%': 0,
1340 'binutils_dir%': '',
1343 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1344 'use_allocator%': 'tcmalloc',
1346 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1347 'linux_link_gnome_keyring%': 0,
1348 # Set to 1 to link against gsettings APIs instead of using dlopen().
1349 'linux_link_gsettings%': 0,
1351 # Enable use of OpenMAX DL FFT routines.
1352 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1354 # Enable new NPDevice API.
1355 'enable_new_npdevice_api%': 0,
1357 # Enable EGLImage support in OpenMAX
1358 'enable_eglimage%': 1,
1360 # .gyp files or targets should set chromium_code to 1 if they build
1361 # Chromium-specific code, as opposed to external code. This variable is
1362 # used to control such things as the set of warnings to enable, and
1363 # whether warnings are treated as errors.
1364 'chromium_code%': 0,
1366 # Disable fatal linker warnings, similarly to how we make it possible
1367 # to disable -Werror (e.g. for different toolchain versions).
1368 'disable_fatal_linker_warnings%': 0,
1370 'release_valgrind_build%': 0,
1372 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1373 'enable_wexit_time_destructors%': 0,
1375 # Build libpeerconnection as a static library by default.
1376 'libpeer_target_type%': 'static_library',
1378 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1379 'internal_gles2_conform_tests%': 0,
1381 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1382 'internal_khronos_glcts_tests%': 0,
1384 # Set to 1 to compile the filter fuzzer.
1385 'internal_filter_fuzzer%': 0,
1387 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1388 # so Cocoa is happy (http://crbug.com/20441).
1390 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1391 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1392 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1393 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1394 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1395 'vi', 'zh-CN', 'zh-TW',
1398 # Pseudo locales are special locales which are used for testing and
1399 # debugging. They don't get copied to the final app. For more info,
1400 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1407 # If debug_devtools is set to 1, JavaScript files for DevTools are
1408 # stored as is and loaded from disk. Otherwise, a concatenated file
1409 # is stored in resources.pak. It is still possible to load JS files
1410 # from disk by passing --debug-devtools cmdline switch.
1411 'debug_devtools%': 0,
1413 # The Java Bridge is not compiled in by default.
1416 # Code signing for iOS binaries. The bots need to be able to disable this.
1417 'chromium_ios_signing%': 1,
1419 # This flag is only used when disable_nacl==0 and disables all those
1420 # subcomponents which would require the installation of a native_client
1421 # untrusted toolchain.
1422 'disable_nacl_untrusted%': 0,
1424 # Disable Dart by default.
1427 # Copy out the setting of disable_nacl.
1428 'disable_nacl%': '<(disable_nacl)',
1430 # Portable Native Client is enabled by default.
1431 'disable_pnacl%': 0,
1433 # Whether to build full debug version for Debug configuration on Android.
1434 # Compared to full debug version, the default Debug configuration on Android
1435 # has no full v8 debug, has size optimization and linker gc section, so that
1436 # we can build a debug version with acceptable size and performance.
1437 'android_full_debug%': 0,
1439 # Sets the default version name and code for Android app, by default we
1440 # do a developer build.
1441 'android_app_version_name%': 'Developer Build',
1442 'android_app_version_code%': 1,
1444 # Contains data about the attached devices for gyp_managed_install.
1445 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1447 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1448 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1450 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1451 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1453 # Whether we are using the rlz library or not. Platforms like Android send
1454 # rlz codes for searches but do not use the library.
1457 # Turns on the i18n support in V8.
1458 'v8_enable_i18n_support': 1,
1460 # Compile d8 for the host toolset.
1461 'v8_toolset_for_d8': 'host',
1463 # Use the chromium skia by default.
1464 'use_system_skia%': '0',
1466 # Use brlapi from brltty for braille display support.
1469 # Relative path to icu.gyp from this file.
1470 'icu_gyp_path': '../third_party/icu/icu.gyp',
1472 # IPC fuzzer is disabled by default.
1473 'enable_ipc_fuzzer%': 0,
1476 # Force disable libstdc++ debug mode.
1477 'disable_glibcxx_debug%': 0,
1479 # Set to 1 to compile with MSE support for MPEG2 TS
1480 'enable_mpeg2ts_stream_parser%': 0,
1482 # Support ChromeOS touchpad gestures with ozone.
1483 'use_evdev_gestures%': 0,
1485 # Default ozone platform (if no --ozone-platform flag).
1486 'ozone_platform%': "",
1488 # Ozone platforms to include in the build.
1489 'ozone_platform_caca%': 0,
1490 'ozone_platform_dri%': 0,
1491 'ozone_platform_egltest%': 0,
1492 'ozone_platform_gbm%': 0,
1493 'ozone_platform_ozonex%': 0,
1494 'ozone_platform_test%': 0,
1497 # Enable the Syzygy optimization step for the official builds.
1498 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1499 'syzygy_optimize%': 1,
1501 'syzygy_optimize%': 0,
1503 # Get binutils version so we can enable debug fission if we can.
1504 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1506 # compiler_version doesn't work with clang
1507 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1508 # compiler_version works with clang.
1509 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1510 # that it takes effect here.
1511 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1512 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1514 # On Android we know the binutils version in the toolchain.
1516 'binutils_version%': 222,
1518 ['host_arch=="x64"', {
1519 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1521 ['host_arch=="ia32"', {
1522 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1524 # Our version of binutils in third_party/binutils
1525 ['linux_use_bundled_binutils==1', {
1526 'binutils_version%': 224,
1530 'binutils_version%': 0,
1532 # The version of GCC in use, set later in platforms that use GCC and have
1533 # not explicitly chosen to build with clang. Currently, this means all
1534 # platforms except Windows, Mac and iOS.
1535 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1536 # it takes effect here.
1537 ['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', {
1539 ['OS=="android" and android_webview_build==0', {
1540 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1541 # We directly set the gcc version since we know what we use.
1544 ['OS=="android" and android_webview_build==1', {
1545 # Android WebView uses a hermetic clang toolchain for host builds.
1546 'host_gcc_version%': 0,
1547 # Android WebView uses the GCC toolchain from the Android build.
1551 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1552 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1556 'host_gcc_version%': 0,
1559 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1560 'windows_sdk_path%': '<(windows_sdk_default_path)',
1562 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
1564 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1565 'directx_sdk_path%': '<(directx_sdk_default_path)',
1567 'directx_sdk_path%': '$(DXSDK_DIR)',
1570 'windows_driver_kit_path%': '$(WDK_DIR)',
1572 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1574 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1577 'nacl_untrusted_build%': 0,
1578 'use_allocator%': 'none',
1580 ['OS=="linux" and target_arch=="mipsel"', {
1581 'sysroot%': '<(sysroot)',
1584 # All Chrome builds have breakpad symbols, but only process the
1585 # symbols from official builds.
1586 ['(branding=="Chrome" and buildtype=="Official")', {
1587 'linux_dump_symbols%': 1,
1589 # Omit unwind support in official release builds to save space. We
1590 # can use breakpad for these builds.
1591 'release_unwind_tables%': 0,
1594 # For official builds, use a 64-bit linker to avoid running out
1595 # of address space. The buildbots should have a 64-bit kernel
1596 # and a 64-bit libc installed.
1597 ['host_arch=="ia32" and target_arch=="ia32"', {
1598 'linux_use_bundled_gold%': '1',
1599 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1604 }], # os_posix==1 and OS!="mac" and OS!="ios"
1607 'enable_background%': 0,
1608 'icu_use_data_file_flag%': 1,
1609 'enable_web_speech%': 0,
1610 'use_system_libxml%': 1,
1611 'use_system_sqlite%': 1,
1613 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1614 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1615 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1616 'uk', 'vi', 'zh-CN', 'zh-TW',
1619 # iOS SDK and deployment target support. The |ios_sdk| value is left
1620 # blank so that when it is set in the project files it will be the
1621 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1622 # causes Xcode to spit out a warning for every single project file for
1623 # not using the "current" SDK.
1625 'ios_sdk_path%': '',
1626 'ios_deployment_target%': '7.0',
1629 # ios_product_name is set to the name of the .app bundle as it should
1631 ['branding=="Chrome"', {
1632 'ios_product_name%': 'Chrome',
1633 }, { # else: branding!="Chrome"
1634 'ios_product_name%': 'Chromium',
1636 ['branding=="Chrome" and buildtype=="Official"', {
1638 }, { # else: branding!="Chrome" or buildtype!="Official"
1644 # Location of Android NDK.
1647 # Unfortunately we have to use absolute paths to the SDK/NDK because
1648 # they're passed to ant which uses a different relative path from
1650 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1651 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1652 'android_host_arch%': '<!(uname -m)',
1653 # Android API-level of the SDK used for compilation.
1654 'android_sdk_version%': '21',
1655 'android_sdk_build_tools_version%': '21.0.1',
1656 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1658 # Copy conditionally-set variables out one scope.
1659 'android_ndk_root%': '<(android_ndk_root)',
1660 'android_sdk_root%': '<(android_sdk_root)',
1661 'android_sdk_version%': '<(android_sdk_version)',
1662 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1663 'host_os%': '<(host_os)',
1665 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1666 # Android SDK build tools (e.g. dx, aapt, aidl)
1667 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1669 # Android API level 14 is ICS (Android 4.0) which is the minimum
1670 # platform requirement for Chrome on Android, we use it for native
1673 ['target_arch == "ia32"', {
1674 'android_app_abi%': 'x86',
1675 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1676 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1677 'android_ndk_lib_dir%': 'usr/lib',
1678 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1680 ['target_arch == "x64"', {
1681 'android_app_abi%': 'x86_64',
1682 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1683 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1684 'android_ndk_lib_dir%': 'usr/lib64',
1685 'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1687 ['target_arch=="arm"', {
1690 'android_app_abi%': 'armeabi',
1692 'android_app_abi%': 'armeabi-v7a',
1695 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1696 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1697 'android_ndk_lib_dir%': 'usr/lib',
1698 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1700 ['target_arch == "arm64"', {
1701 'android_app_abi%': 'arm64-v8a',
1702 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1703 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1704 'android_ndk_lib_dir%': 'usr/lib',
1705 'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1707 ['target_arch == "mipsel"', {
1708 'android_app_abi%': 'mips',
1709 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1710 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1711 'android_ndk_lib_dir%': 'usr/lib',
1712 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1714 ['target_arch == "mips64el"', {
1715 'android_app_abi%': 'mips64',
1716 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1717 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1718 'android_ndk_lib_dir%': 'usr/lib64',
1719 'android_toolchain%': '<(android_ndk_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1724 # Copy conditionally-set variables out one scope.
1725 'android_app_abi%': '<(android_app_abi)',
1726 'android_gdbserver%': '<(android_gdbserver)',
1727 'android_ndk_root%': '<(android_ndk_root)',
1728 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1729 'android_sdk_root%': '<(android_sdk_root)',
1730 'android_sdk_version%': '<(android_sdk_version)',
1731 'android_toolchain%': '<(android_toolchain)',
1733 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1734 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1735 'android_sdk_tools%': '<(android_sdk_tools)',
1736 'android_sdk%': '<(android_sdk)',
1737 'android_sdk_jar%': '<(android_sdk)/android.jar',
1739 'android_stlport_root': '<(android_stlport_root)',
1740 'android_stlport_include': '<(android_stlport_root)/stlport',
1741 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1742 'host_os%': '<(host_os)',
1744 # Location of the "objcopy" binary, used by both gyp and scripts.
1745 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1747 # Location of the "strip" binary, used by both gyp and scripts.
1748 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1750 # Location of the "readelf" binary.
1751 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1753 # Determines whether we should optimize JNI generation at the cost of
1754 # breaking assumptions in the build system that when inputs have changed
1755 # the outputs should always change as well. This is meant purely for
1756 # developer builds, to avoid spurious re-linking of native files.
1757 'optimize_jni_generation%': '<(optimize_jni_generation)',
1759 # Always uses openssl.
1761 'use_openssl_certs%': 1,
1763 'proprietary_codecs%': '<(proprietary_codecs)',
1764 'safe_browsing%': 1,
1765 'enable_web_speech%': 0,
1767 'build_ffmpegsumo%': 0,
1768 'use_allocator%': 'none',
1770 # Disable Native Client.
1773 # Android does not support background apps.
1774 'enable_background%': 0,
1776 # Sessions are store separately in the Java side.
1777 'enable_session_service%': 0,
1781 'gtest_target_type%': 'shared_library',
1783 # Uses system APIs for decoding audio and video.
1784 'use_libffmpeg%': '0',
1786 # TODO(torne): Remove this unsupported option once all the places that
1787 # test it have been updated.
1788 'use_system_stlport%': 0,
1790 # Copy it out one scope.
1791 'android_webview_build%': '<(android_webview_build)',
1793 # Default android linker script for shared library exports.
1794 'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_exports.lst',
1797 'use_system_fontconfig%': 0,
1799 'use_system_fontconfig%': 1,
1802 'enable_mpeg2ts_stream_parser%': 1,
1803 'ffmpeg_branding%': 'Chrome',
1804 'ozone_platform_ozonex%': 1,
1805 'use_playready%': 0,
1807 ['target_arch=="arm"', {
1809 'arm_tune%': 'cortex-a9',
1815 ['android_webview_build==1', {
1816 # When building the WebView in the Android tree, jarjar will remap all
1817 # the class names, so the JNI generator needs to know this.
1818 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1820 ['OS=="linux" and target_arch!="mipsel"', {
1821 # TODO(thakis): This is here to measure perf for a while.
1826 # All Chrome builds have breakpad symbols, but only process the
1827 # symbols from official builds.
1828 ['(branding=="Chrome" and buildtype=="Official")', {
1829 'mac_strip_release%': 1,
1833 ['OS=="mac" or OS=="ios"', {
1837 # Mac OS X SDK and deployment target support. The SDK identifies
1838 # the version of the system headers that will be used, and
1839 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1840 # macro. "Maximum allowed" refers to the operating system version
1841 # whose APIs are available in the headers. The deployment target
1842 # identifies the minimum system version that the built products are
1843 # expected to function on. It corresponds to the
1844 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1845 # macros are available, #include <AvailabilityMacros.h>. Additional
1846 # documentation on these macros is available at
1847 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1848 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1849 # deployment target to 10.6. Other projects, such as O3D, may
1850 # override these defaults.
1852 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1853 # about that is at least the specified version. In official builds,
1854 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1855 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1856 # path to the SDK; when set to a non-empty string, SDK detection
1857 # based on mac_sdk_min will be bypassed entirely.
1860 'mac_sdk_min%': '10.8',
1861 }, { # else OS!="ios"
1862 'mac_sdk_min%': '10.6',
1865 'mac_sdk_path%': '',
1867 'mac_deployment_target%': '10.6',
1870 'mac_sdk_min': '<(mac_sdk_min)',
1871 'mac_sdk_path': '<(mac_sdk_path)',
1872 'mac_deployment_target': '<(mac_deployment_target)',
1874 # Compile in Breakpad support by default so that it can be
1875 # tested, even if it is not enabled by default at runtime.
1876 'mac_breakpad_compiled_in%': 1,
1878 # mac_product_name is set to the name of the .app bundle as it should
1879 # appear on disk. This duplicates data from
1880 # chrome/app/theme/chromium/BRANDING and
1881 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1882 # these names into the build system.
1883 ['branding=="Chrome"', {
1884 'mac_product_name%': 'Google Chrome',
1885 }, { # else: branding!="Chrome"
1886 'mac_product_name%': 'Chromium',
1888 # Official mac builds require a specific OS X SDK, but iOS and
1889 # non-official mac builds do not.
1890 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1891 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1893 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1895 ['branding=="Chrome" and buildtype=="Official"', {
1896 # Enable uploading crash dumps.
1897 'mac_breakpad_uploads%': 1,
1898 # Enable dumping symbols at build time for use by Mac Breakpad.
1900 # Enable Keystone auto-update support.
1902 }, { # else: branding!="Chrome" or buildtype!="Official"
1903 'mac_breakpad_uploads%': 0,
1908 }], # OS=="mac" or OS=="ios"
1911 # This is the architecture convention used in WinSDK paths.
1912 ['target_arch=="ia32"', {
1913 'winsdk_arch%': 'x86',
1915 'winsdk_arch%': '<(target_arch)',
1917 ['component=="shared_library"', {
1918 'win_use_allocator_shim%': 0,
1920 # Turn on multiple dll by default on Windows when in static_library.
1921 'chrome_multiple_dll%': 1,
1924 'win_use_allocator_shim%': 0,
1926 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1927 # Only enabled by default for ninja because it's buggy in VS.
1928 # Not enabled for component=static_library because some targets
1929 # are too large and the toolchain fails due to the size of the
1931 'incremental_chrome_dll%': 1,
1933 # Don't do incremental linking for large modules on 32-bit or when
1934 # component=static_library as the toolchain fails due to the size of
1936 ['MSVS_OS_BITS==32 or component=="static_library"', {
1937 'msvs_large_module_debug_link_mode%': '1', # No
1939 'msvs_large_module_debug_link_mode%': '2', # Yes
1941 ['MSVS_VERSION=="2013e"', {
1949 'nacl_win64_defines': [
1950 # This flag is used to minimize dependencies when building
1951 # Native Client loader for 64-bit Windows.
1956 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1962 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1963 'enable_pepper_cdms%': 1,
1965 'enable_pepper_cdms%': 0,
1969 'enable_browser_cdms%': 1,
1971 'enable_browser_cdms%': 0,
1974 # Native Client glibc toolchain is enabled
1975 # by default except on arm, mips and mips64.
1976 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
1977 'disable_glibc%': 1,
1979 'disable_glibc%': 0,
1982 # Set the relative path from this file to the GYP file of the JPEG
1983 # library used by Chromium.
1984 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1985 # Configuration for using the system libjeg is here.
1986 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1988 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1991 # Options controlling the use of GConf (the classic GNOME configuration
1992 # system) and GIO, which contains GSettings (the new GNOME config system).
1993 ['chromeos==1 or embedded==1', {
2001 # Set up -D and -E flags passed into grit.
2002 ['branding=="Chrome"', {
2003 # TODO(mmoss) The .grd files look for _google_chrome, but for
2004 # consistency they should look for google_chrome_build like C++.
2005 'grit_defines': ['-D', '_google_chrome',
2006 '-E', 'CHROMIUM_BUILD=google_chrome'],
2008 'grit_defines': ['-D', '_chromium',
2009 '-E', 'CHROMIUM_BUILD=chromium'],
2012 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2014 ['desktop_linux==1', {
2015 'grit_defines': ['-D', 'desktop_linux'],
2017 ['toolkit_views==1', {
2018 'grit_defines': ['-D', 'toolkit_views'],
2021 'grit_defines': ['-D', 'use_aura'],
2024 'grit_defines': ['-D', 'use_ash'],
2027 'grit_defines': ['-D', 'use_nss'],
2030 'grit_defines': ['-D', 'use_ozone'],
2032 ['image_loader_extension==1', {
2033 'grit_defines': ['-D', 'image_loader_extension'],
2036 'grit_defines': ['-D', 'remoting'],
2038 ['use_titlecase_in_grd==1', {
2039 'grit_defines': ['-D', 'use_titlecase'],
2041 ['use_third_party_translations==1', {
2042 'grit_defines': ['-D', 'use_third_party_translations'],
2044 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2045 'ka', 'ku', 'kw', 'ms', 'ug'
2049 'grit_defines': ['-t', 'android',
2050 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true'],
2052 ['OS=="mac" or OS=="ios"', {
2053 'grit_defines': ['-D', 'scale_factors=2x'],
2058 # iOS uses a whitelist to filter resources.
2059 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
2062 # Enable host builds when generating with ninja-ios.
2064 ['"<(GENERATOR)"=="ninja"', {
2068 # TODO(sdefresne): Remove the target_subarch check once Apple has
2069 # upstreamed the support for "arm64". http://crbug.com/341453
2070 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
2075 ['enable_extensions==1', {
2076 'grit_defines': ['-D', 'enable_extensions'],
2078 ['enable_plugins!=0', {
2079 'grit_defines': ['-D', 'enable_plugins'],
2081 ['enable_printing!=0', {
2082 'grit_defines': ['-D', 'enable_printing'],
2084 ['enable_printing==1', {
2085 'grit_defines': ['-D', 'enable_full_printing'],
2087 ['enable_themes==1', {
2088 'grit_defines': ['-D', 'enable_themes'],
2090 ['enable_app_list==1', {
2091 'grit_defines': ['-D', 'enable_app_list'],
2093 ['enable_settings_app==1', {
2094 'grit_defines': ['-D', 'enable_settings_app'],
2096 ['enable_google_now==1', {
2097 'grit_defines': ['-D', 'enable_google_now'],
2099 ['use_concatenated_impulse_responses==1', {
2100 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2102 ['enable_webrtc==1', {
2103 'grit_defines': ['-D', 'enable_webrtc'],
2105 ['enable_hangout_services_extension==1', {
2106 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2108 ['enable_task_manager==1', {
2109 'grit_defines': ['-D', 'enable_task_manager'],
2111 ['notifications==1', {
2112 'grit_defines': ['-D', 'enable_notifications'],
2114 ['enable_wifi_bootstrapping==1', {
2115 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2117 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2118 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2120 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2121 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2123 ['enable_mdns==1 or OS=="mac"', {
2124 'grit_defines': ['-D', 'enable_service_discovery'],
2125 'enable_service_discovery%': 1
2127 ['clang_use_chrome_plugins==1 and OS!="win"', {
2128 'clang_chrome_plugins_flags': [
2129 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
2132 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2134 'use_allocator%': 'none',
2135 'use_sanitizer_options%': 1,
2137 ['asan==1 and OS=="linux" and chromeos==0', {
2138 'use_custom_libcxx%': 1,
2146 ['asan==1 and OS=="mac"', {
2147 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
2148 # runtime is fully adopted. See http://crbug.com/242503.
2149 'mac_strip_release': 0,
2152 'use_custom_libcxx%': 1,
2155 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2156 # libstdc++. This is required to avoid false positive reports whenever
2157 # the C++ standard library is used.
2158 'use_custom_libcxx%': 1,
2159 # Running the V8-generated code on an ARM simulator is a powerful hack
2160 # that allows the tool to see the memory accesses from JITted code.
2161 # Without this flag, JS code causes false positive reports from MSan.
2162 'v8_target_arch': 'arm64',
2165 ['OS=="linux" and clang_type_profiler==1', {
2167 'clang_use_chrome_plugins%': 0,
2169 ['host_arch=="x64"', {
2170 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2172 ['host_arch=="ia32"', {
2173 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2174 # Clang in this directory at your own risk if needed for some
2175 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2176 # usage). Any failure by this compiler should not close the tree.
2177 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2183 # The Clang plugins don't currently work on Windows.
2184 # TODO(hans): One day, this will work. (crbug.com/82385)
2185 'clang_use_chrome_plugins%': 0,
2188 # On valgrind bots, override the optimizer settings so we don't inline too
2189 # much and make the stacks harder to figure out.
2191 # TODO(rnk): Kill off variables that no one else uses and just implement
2192 # them under a build_for_tool== condition.
2193 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2195 'mac_debug_optimization': '1',
2196 'mac_release_optimization': '1',
2197 'release_optimize': '1',
2198 'no_gc_sections': 1,
2199 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2200 '-fno-builtin -fno-optimize-sibling-calls',
2201 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2202 '-fno-builtin -fno-optimize-sibling-calls',
2204 # MSVS flags for TSan on Pin and Windows.
2205 'win_debug_RuntimeChecks': '0',
2206 'win_debug_disable_iterator_debugging': '1',
2207 'win_debug_Optimization': '1',
2208 'win_debug_InlineFunctionExpansion': '0',
2209 'win_release_InlineFunctionExpansion': '0',
2210 'win_release_OmitFramePointers': '0',
2212 'use_allocator': 'tcmalloc',
2213 'release_valgrind_build': 1,
2215 'component': 'static_library',
2216 'use_system_zlib': 0,
2219 # Build tweaks for DrMemory.
2220 # TODO(rnk): Combine with tsan config to share the builder.
2221 # http://crbug.com/108155
2222 ['build_for_tool=="drmemory"', {
2223 # These runtime checks force initialization of stack vars which blocks
2224 # DrMemory's uninit detection.
2225 'win_debug_RuntimeChecks': '0',
2226 # Iterator debugging is slow.
2227 'win_debug_disable_iterator_debugging': '1',
2228 # Try to disable optimizations that mess up stacks in a release build.
2229 # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054)
2230 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2231 # compiler bug, so we use /Ob1 instead.
2232 'win_release_InlineFunctionExpansion': '1',
2233 'win_release_OmitFramePointers': '0',
2234 # Ditto for debug, to support bumping win_debug_Optimization.
2235 'win_debug_InlineFunctionExpansion': 0,
2236 'win_debug_OmitFramePointers': 0,
2237 # Keep the code under #ifndef NVALGRIND.
2238 'release_valgrind_build': 1,
2241 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2242 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2246 # Set default compiler flags depending on ARM version.
2247 ['arm_version==6 and android_webview_build==0', {
2248 'arm_arch%': 'armv6',
2251 'arm_float_abi%': 'softfp',
2254 ['arm_version==7 and android_webview_build==0', {
2255 'arm_arch%': 'armv7-a',
2256 'arm_tune%': 'generic-armv7-a',
2261 'arm_fpu%': 'vfpv3-d16',
2264 # Change the default to hard once the armhf transition is complete.
2265 'arm_float_abi%': 'softfp',
2269 ['android_webview_build==1', {
2270 # The WebView build gets its cpu-specific flags from the Android build system.
2274 'arm_float_abi%': '',
2278 # Enable brlapi by default for chromeos.
2283 ['use_ozone==1 and ozone_auto_platforms==1', {
2284 # Use test as the default platform.
2285 'ozone_platform%': 'test',
2287 # Build all platforms whose deps are in install-build-deps.sh.
2288 # Only these platforms will be compile tested by buildbots.
2289 'ozone_platform_dri%': 1,
2290 'ozone_platform_test%': 1,
2291 'ozone_platform_egltest%': 1,
2294 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2295 'use_clipboard_aurax11%': 1,
2298 ['OS=="win" and use_goma==1', {
2299 # goma doesn't support pch yet.
2300 'chromium_win_pch': 0,
2301 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2303 ['win_z7==0 and fastbuild==0', {
2309 ['OS=="win" and (clang==1 or asan==1)', {
2310 'chromium_win_pch': 0,
2314 'host_cc': '<(make_clang_dir)/bin/clang',
2315 'host_cxx': '<(make_clang_dir)/bin/clang++',
2317 'host_cc': '<!(which gcc)',
2318 'host_cxx': '<!(which g++)',
2321 # The seccomp-bpf sandbox is only supported on five architectures
2323 # Do not disable seccomp_bpf anywhere without talking to
2324 # security@chromium.org!
2325 ['((OS=="linux" or OS=="android") and '
2326 '(target_arch=="ia32" or target_arch=="x64" or '
2327 'target_arch=="arm" or target_arch=="mipsel" or '
2328 'target_arch=="arm64"))', {
2329 'use_seccomp_bpf%': 1,
2331 'use_seccomp_bpf%': 0,
2333 # Set component build with LTO until all tests pass.
2334 # This also reduces link time.
2336 'component%': "shared_library",
2340 # older history files use fts2 instead of fts3
2341 'sqlite_enable_fts2%': '<(support_pre_M6_history_database)',
2343 # The path to the ANGLE library.
2344 'angle_path': '<(DEPTH)/third_party/angle',
2346 # List of default apps to install in new profiles. The first list contains
2347 # the source files as found in svn. The second list, used only for linux,
2348 # contains the destination location for each of the files. When a crx
2349 # is added or removed from the list, the chrome/browser/resources/
2350 # default_apps/external_extensions.json file must also be updated.
2351 'default_apps_list': [
2352 'browser/resources/default_apps/external_extensions.json',
2353 'browser/resources/default_apps/gmail.crx',
2354 'browser/resources/default_apps/search.crx',
2355 'browser/resources/default_apps/youtube.crx',
2356 'browser/resources/default_apps/drive.crx',
2357 'browser/resources/default_apps/docs.crx',
2359 'default_apps_list_linux_dest': [
2360 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2361 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2362 '<(PRODUCT_DIR)/default_apps/search.crx',
2363 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2364 '<(PRODUCT_DIR)/default_apps/drive.crx',
2365 '<(PRODUCT_DIR)/default_apps/docs.crx',
2368 # Whether to allow building of the GPU-related isolates.
2369 'archive_gpu_tests%': 0,
2371 # Whether to allow building of chromoting related isolates.
2372 'archive_chromoting_tests%': 0,
2374 'target_defaults': {
2376 # The condition that operates on chromium_code is in a target_conditions
2377 # section, and will not have access to the default fallback value of
2378 # chromium_code at the top of this file, or to the chromium_code
2379 # variable placed at the root variables scope of .gyp files, because
2380 # those variables are not set at target scope. As a workaround,
2381 # if chromium_code is not set at target scope, define it in target scope
2382 # to contain whatever value it has during early variable expansion.
2383 # That's enough to make it available during target conditional
2385 'chromium_code%': '<(chromium_code)',
2387 'component%': '<(component)',
2389 'chromecast%': '<(chromecast)',
2391 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2392 'win_release_Optimization%': '2', # 2 = /Os
2393 'win_debug_Optimization%': '0', # 0 = /Od
2395 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2396 # Tri-state: blank is default, 1 on, 0 off
2397 'win_release_OmitFramePointers%': '0',
2398 # Tri-state: blank is default, 1 on, 0 off
2399 'win_debug_OmitFramePointers%': '',
2401 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2402 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2404 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2405 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2406 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2408 # VS inserts quite a lot of extra checks to algorithms like
2409 # std::partial_sort in Debug build which make them O(N^2)
2410 # instead of O(N*logN). This is particularly slow under memory
2411 # tools like ThreadSanitizer so we want it to be disablable.
2412 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2413 'win_debug_disable_iterator_debugging%': '0',
2415 # An application manifest fragment to declare compatibility settings for
2416 # 'executable' targets. Ignored in other target type.
2417 'win_exe_compatibility_manifest%':
2418 '<(DEPTH)\\build\\win\\compatibility.manifest',
2420 'release_extra_cflags%': '',
2421 'debug_extra_cflags%': '',
2423 'release_valgrind_build%': '<(release_valgrind_build)',
2425 # the non-qualified versions are widely assumed to be *nix-only
2426 'win_release_extra_cflags%': '',
2427 'win_debug_extra_cflags%': '',
2429 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2430 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2432 # Only used by Windows build for now. Can be used to build into a
2433 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2434 # output files in src/build/VS2010_{Debug,Release}.
2435 'build_dir_prefix%': '',
2437 # Targets are by default not nacl untrusted code.
2438 'nacl_untrusted_build%': 0,
2440 'pnacl_compile_flags': [
2441 # pnacl uses the clang compiler so we need to suppress all the
2442 # same warnings as we do for clang.
2443 # TODO(sbc): Remove these if/when they are removed from the clang
2445 '-Wno-unused-function',
2446 '-Wno-char-subscripts',
2447 '-Wno-c++11-extensions',
2448 '-Wno-unnamed-type-template-args',
2452 ['OS=="win" and component=="shared_library"', {
2453 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2454 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2455 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2457 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2458 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2459 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2462 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2463 'mac_release_optimization%': 's', # Use -Os unless overridden
2464 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2466 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2467 'mac_release_optimization%': '3', # Use -O3 unless overridden
2468 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2471 'host_os%': '<(host_os)', # See comment above chromium_code.
2474 'clang_warning_flags': [
2477 # Don't die on dtoa code that uses a char as an array index.
2478 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2479 '-Wno-char-subscripts',
2481 # TODO(thakis): This used to be implied by -Wno-unused-function,
2482 # which we no longer use. Check if it makes sense to remove
2483 # this as well. http://crbug.com/316352
2484 '-Wno-unneeded-internal-declaration',
2486 # Warns on switches on enums that cover all enum values but
2487 # also contain a default: branch. Chrome is full of that.
2488 '-Wno-covered-switch-default',
2490 # Warns when a const char[] is converted to bool.
2491 '-Wstring-conversion',
2493 # C++11-related flags:
2495 # This warns on using ints as initializers for floats in
2496 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2497 # which happens in several places in chrome code. Not sure if
2498 # this is worth fixing.
2499 '-Wno-c++11-narrowing',
2501 # Clang considers the `register` keyword as deprecated, but e.g.
2502 # code generated by flex (used in angle) contains that keyword.
2503 # http://crbug.com/255186
2504 '-Wno-deprecated-register',
2506 # TODO(hans): Clean this up. Or disable with finer granularity.
2507 '-Wno-unused-local-typedef',
2510 'includes': [ 'set_clang_warning_flags.gypi', ],
2512 # Don't use deprecated V8 APIs anywhere.
2513 'V8_DEPRECATION_WARNINGS',
2516 '<(SHARED_INTERMEDIATE_DIR)',
2519 ['(OS=="mac" or OS=="ios") and asan==1', {
2521 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2524 ['OS=="win" and asan==1 and component=="shared_library"', {
2526 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2529 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2530 'cflags_cc!': ['-fno-rtti'],
2533 '-gline-tables-only',
2534 '-fintercept-allocation-functions',
2536 'defines': ['TYPE_PROFILING'],
2538 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2541 ['branding=="Chrome"', {
2542 'defines': ['GOOGLE_CHROME_BUILD'],
2543 }, { # else: branding!="Chrome"
2544 'defines': ['CHROMIUM_BUILD'],
2546 ['OS=="mac" and component=="shared_library"', {
2548 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2549 'LD_RUNPATH_SEARCH_PATHS': [
2550 # For unbundled binaries.
2552 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2553 '@loader_path/../../..',
2557 ['clang==1 and OS!="win"', {
2558 # This is here so that all files get recompiled after a clang roll and
2559 # when turning clang on or off.
2560 # (defines are passed via the command line, and build systems rebuild
2561 # things when their commandline changes). Nothing should ever read this
2563 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2566 'defines': ['ENABLE_RLZ'],
2568 ['component=="shared_library"', {
2569 'defines': ['COMPONENT_BUILD'],
2571 ['toolkit_views==1', {
2572 'defines': ['TOOLKIT_VIEWS=1'],
2574 ['ui_compositor_image_transport==1', {
2575 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2578 'defines': ['USE_AURA=1'],
2581 'defines': ['USE_ASH=1'],
2584 'defines': ['USE_PANGO=1'],
2587 'defines': ['USE_CAIRO=1'],
2590 'defines': ['USE_CRAS=1'],
2593 'defines': ['USE_OZONE=1'],
2595 ['use_default_render_theme==1', {
2596 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2598 ['use_libjpeg_turbo==1', {
2599 'defines': ['USE_LIBJPEG_TURBO=1'],
2602 'defines': ['USE_X11=1'],
2604 ['use_clipboard_aurax11==1', {
2605 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2607 ['enable_one_click_signin==1', {
2608 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2610 ['enable_pre_sync_backup==1', {
2611 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2613 ['use_xi2_mt!=0 and use_x11==1', {
2614 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2616 ['image_loader_extension==1', {
2617 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2620 'defines': ['ENABLE_PROFILING=1'],
2623 'defines': ['ENABLE_REMOTING=1'],
2625 ['enable_webrtc==1', {
2626 'defines': ['ENABLE_WEBRTC=1'],
2628 ['proprietary_codecs==1', {
2629 'defines': ['USE_PROPRIETARY_CODECS'],
2631 ['enable_mpeg2ts_stream_parser==1', {
2632 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2636 ['enable_viewport==1', {
2637 'defines': ['ENABLE_VIEWPORT'],
2639 ['enable_pepper_cdms==1', {
2640 'defines': ['ENABLE_PEPPER_CDMS'],
2642 ['enable_browser_cdms==1', {
2643 'defines': ['ENABLE_BROWSER_CDMS'],
2645 ['configuration_policy==1', {
2646 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2648 ['notifications==1', {
2649 'defines': ['ENABLE_NOTIFICATIONS'],
2651 ['enable_hidpi==1', {
2652 'defines': ['ENABLE_HIDPI=1'],
2654 ['native_discardable_memory==1', {
2655 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2657 ['native_memory_pressure_signals==1', {
2658 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2661 'defines': ['USE_UDEV'],
2665 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2668 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2669 # Clang creates chubby debug information, which makes linking very
2670 # slow. For now, don't create debug information with clang. See
2671 # http://crbug.com/70000
2675 'debug_extra_cflags': '-g0',
2678 # Android builds symbols on release by default, disable them.
2681 'debug_extra_cflags': '-g0',
2682 'release_extra_cflags': '-g0',
2686 }, { # else clang!=1
2688 ['OS=="win" and fastbuild==2', {
2689 # Completely disable debug information.
2692 'GenerateDebugInformation': 'false',
2694 'VCCLCompilerTool': {
2695 'DebugInformationFormat': '0',
2699 ['OS=="win" and fastbuild==1', {
2702 # This tells the linker to generate .pdbs, so that
2703 # we can get meaningful stack traces.
2704 'GenerateDebugInformation': 'true',
2706 'VCCLCompilerTool': {
2707 # No debug info to be generated by compiler.
2708 'DebugInformationFormat': '0',
2712 ['OS=="linux" and fastbuild==2', {
2714 'debug_extra_cflags': '-g0',
2717 ['OS=="linux" and fastbuild==1', {
2719 'debug_extra_cflags': '-g1',
2722 ['OS=="android" and fastbuild==2', {
2724 'debug_extra_cflags': '-g0',
2725 'release_extra_cflags': '-g0',
2728 ['OS=="android" and fastbuild==1', {
2730 'debug_extra_cflags': '-g1',
2731 'release_extra_cflags': '-g1',
2738 ['dont_embed_build_metadata==1', {
2740 'DONT_EMBED_BUILD_METADATA',
2742 }], # dont_embed_build_metadata==1
2743 ['dcheck_always_on!=0', {
2744 'defines': ['DCHECK_ALWAYS_ON=1'],
2745 }], # dcheck_always_on!=0
2746 ['tracing_like_official_build!=0', {
2747 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2748 }], # tracing_like_official_build!=0
2749 ['win_use_allocator_shim==0', {
2752 'defines': ['NO_TCMALLOC'],
2756 ['enable_eglimage==1', {
2758 'ENABLE_EGLIMAGE=1',
2763 'ADDRESS_SANITIZER',
2764 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2765 'MEMORY_SANITIZER_INITIAL_SIZE',
2769 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2777 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2778 'MEMORY_SANITIZER_INITIAL_SIZE',
2784 '_CRT_SECURE_NO_DEPRECATE',
2785 '_SCL_SECURE_NO_DEPRECATE',
2786 # This define is required to pull in the new Win8 interfaces from
2787 # system headers like ShObjIdl.h.
2788 'NTDDI_VERSION=0x06020000',
2789 # This is required for ATL to use XP-safe versions of its functions.
2790 '_USING_V110_SDK71_',
2793 '<(DEPTH)/third_party/wtl/include',
2798 # Generates debug info when win_z7=1
2799 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2801 'GenerateDebugInformation': 'true',
2803 'VCCLCompilerTool': {
2804 'DebugInformationFormat': '1',
2815 ['target_arch=="arm"', {
2817 # TODO(lcwu): Work around an error when building Chromium
2818 # with gcc-4.5.3 (e.g. v8/src/platform-linux.cc). Remove
2819 # this define once the toolchain is updated.
2820 # See crbug.com/388933.
2824 ['use_playready==1', {
2826 'PLAYREADY_CDM_AVAILABLE',
2831 ['enable_task_manager==1', {
2833 'ENABLE_TASK_MANAGER=1',
2836 ['enable_extensions==1', {
2838 'ENABLE_EXTENSIONS=1',
2841 ['OS=="win" and branding=="Chrome"', {
2842 'defines': ['ENABLE_SWIFTSHADER'],
2844 ['enable_dart==1', {
2845 'defines': ['WEBKIT_USING_DART=1'],
2847 ['enable_plugin_installation==1', {
2848 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2850 ['enable_plugins==1', {
2851 'defines': ['ENABLE_PLUGINS=1'],
2853 ['enable_session_service==1', {
2854 'defines': ['ENABLE_SESSION_SERVICE=1'],
2856 ['enable_themes==1', {
2857 'defines': ['ENABLE_THEMES=1'],
2859 ['enable_autofill_dialog==1', {
2860 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2862 ['enable_prod_wallet_service==1', {
2863 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2865 ['enable_background==1', {
2866 'defines': ['ENABLE_BACKGROUND=1'],
2868 ['enable_google_now==1', {
2869 'defines': ['ENABLE_GOOGLE_NOW=1'],
2871 ['cld_version!=0', {
2872 'defines': ['CLD_VERSION=<(cld_version)'],
2874 ['cld_version==2', {
2875 # This is used to populate the "CLD Data Source" field in:
2876 # chrome://translate-internals
2877 'defines': ['CLD2_DATA_SOURCE=<(cld2_data_source)'],
2879 ['enable_printing==1', {
2880 'defines': ['ENABLE_FULL_PRINTING=1', 'ENABLE_PRINTING=1'],
2882 ['enable_printing==2', {
2883 'defines': ['ENABLE_PRINTING=1'],
2885 ['enable_spellcheck==1', {
2886 'defines': ['ENABLE_SPELLCHECK=1'],
2888 ['enable_captive_portal_detection==1', {
2889 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2891 ['enable_app_list==1', {
2892 'defines': ['ENABLE_APP_LIST=1'],
2894 ['enable_settings_app==1', {
2895 'defines': ['ENABLE_SETTINGS_APP=1'],
2897 ['disable_file_support==1', {
2898 'defines': ['DISABLE_FILE_SUPPORT=1'],
2900 ['disable_ftp_support==1', {
2901 'defines': ['DISABLE_FTP_SUPPORT=1'],
2903 ['use_icu_alternatives_on_android==1', {
2904 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2906 ['enable_managed_users==1', {
2907 'defines': ['ENABLE_MANAGED_USERS=1'],
2909 ['spdy_proxy_auth_property != ""', {
2910 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2912 ['spdy_proxy_auth_value != ""', {
2913 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2915 ['enable_mdns==1', {
2916 'defines': ['ENABLE_MDNS=1'],
2918 ['enable_service_discovery==1', {
2919 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2921 ['enable_wifi_bootstrapping==1', {
2922 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2924 ['enable_hangout_services_extension==1', {
2925 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2927 ['enable_ipc_fuzzer==1', {
2928 'defines': ['ENABLE_IPC_FUZZER=1'],
2931 'defines': ['VIDEO_HOLE=1'],
2933 ['enable_load_completion_hacks==1', {
2934 'defines': ['ENABLE_LOAD_COMPLETION_HACKS=1'],
2936 ], # conditions for 'target_defaults'
2937 'target_conditions': [
2938 ['<(use_openssl)==1', {
2939 'defines': ['USE_OPENSSL=1'],
2941 ['<(use_openssl_certs)==1', {
2942 'defines': ['USE_OPENSSL_CERTS=1'],
2944 ['>(nacl_untrusted_build)==1', {
2947 'USE_OPENSSL_CERTS=1',
2950 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
2951 'defines': ['USE_GLIB=1'],
2953 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
2954 'defines': ['USE_NSS=1'],
2956 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
2957 'defines': ['OS_CHROMEOS=1'],
2959 ['enable_wexit_time_destructors==1 and OS!="win"', {
2960 # TODO: Enable on Windows too, http://crbug.com/404525
2961 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
2963 ['chromium_code==0', {
2965 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
2966 # We don't want to get warnings from third-party code,
2967 # so remove any existing warning-enabling flags like -Wall.
2973 # Don't warn about hash_map in third-party code.
2977 # Don't warn about printf format problems.
2978 # This is off by default in gcc but on in Ubuntu's gcc(!).
2982 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
2986 # TODO: Fix all warnings on chromeos too.
2987 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
2992 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
2994 # Don't warn about ignoring the return value from e.g. close().
2995 # This is off by default in some gccs but on by default in others.
2996 # BSD systems do not support this option, since they are usually
2997 # using gcc 4.2.1, which does not have this flag yet.
2998 '-Wno-unused-result',
3003 '_CRT_SECURE_NO_DEPRECATE',
3004 '_CRT_NONSTDC_NO_WARNINGS',
3005 '_CRT_NONSTDC_NO_DEPRECATE',
3006 '_SCL_SECURE_NO_DEPRECATE',
3008 'msvs_disabled_warnings': [4800],
3010 'VCCLCompilerTool': {
3011 'WarningLevel': '3',
3012 'WarnAsError': 'true',
3013 'Detect64BitPortabilityProblems': 'false',
3017 ['buildtype=="Official"', {
3019 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3024 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3027 [ 'component=="shared_library"', {
3028 # TODO(darin): Unfortunately, some third_party code depends on base.
3029 'msvs_disabled_warnings': [
3030 4251, # class 'std::xx' needs to have dll-interface.
3036 [ 'OS=="mac" or OS=="ios"', {
3038 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3041 ['buildtype=="Official"', {
3043 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3050 # TODO(ios): Fix remaining warnings in third-party code, then
3051 # remove this; the Mac cleanup didn't get everything that's
3052 # flagged in an iOS build.
3053 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3054 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3055 # Several internal ios directories generate numerous warnings for
3056 # -Wobjc-missing-property-synthesis.
3057 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3063 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3064 'filename_rules.gypi',
3066 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3067 # C99 macros on Mac and Linux.
3069 '__STDC_CONSTANT_MACROS',
3070 '__STDC_FORMAT_MACROS',
3074 # turn on warnings for signed/unsigned mismatch on chromium code.
3076 'VCCLCompilerTool': {
3077 'AdditionalOptions': ['/we4389'],
3081 ['OS=="win" and component=="shared_library"', {
3082 'msvs_disabled_warnings': [
3083 4251, # class 'std::xx' needs to have dll-interface.
3088 ], # target_conditions for 'target_defaults'
3089 'default_configuration': 'Debug',
3091 # VCLinkerTool LinkIncremental values below:
3093 # 1 == /INCREMENTAL:NO
3095 # Debug links incremental, Release does not.
3097 # Abstract base configurations to cover common attributes.
3101 'msvs_configuration_attributes': {
3102 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3103 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3104 'CharacterSet': '1',
3106 # Add the default import libs.
3109 'AdditionalDependencies': [
3133 'MinimumRequiredVersion': '5.01', # XP.
3134 'TargetMachine': '1',
3136 'VCLibrarianTool': {
3137 'TargetMachine': '1',
3140 'msvs_configuration_platform': 'Win32',
3144 'msvs_configuration_platform': 'x64',
3147 # Make sure to understand http://crbug.com/361720 if you want to
3149 'MinimumRequiredVersion': '5.02', # Server 2003.
3150 'TargetMachine': '17', # x86 - 64
3151 'AdditionalLibraryDirectories!':
3152 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3153 'AdditionalLibraryDirectories':
3154 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3155 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3156 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3158 'VCLibrarianTool': {
3159 'AdditionalLibraryDirectories!':
3160 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3161 'AdditionalLibraryDirectories':
3162 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3163 'TargetMachine': '17', # x64
3170 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3171 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3174 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3176 '<@(debug_extra_cflags)',
3180 'VCCLCompilerTool': {
3181 'Optimization': '<(win_debug_Optimization)',
3182 'PreprocessorDefinitions': ['_DEBUG'],
3183 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3184 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3186 # According to MSVS, InlineFunctionExpansion=0 means
3187 # "default inlining", not "/Ob0".
3188 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3189 ['win_debug_InlineFunctionExpansion==0', {
3190 'AdditionalOptions': ['/Ob0'],
3192 ['win_debug_InlineFunctionExpansion!=""', {
3193 'InlineFunctionExpansion':
3194 '<(win_debug_InlineFunctionExpansion)',
3196 ['win_debug_disable_iterator_debugging==1', {
3197 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3200 # if win_debug_OmitFramePointers is blank, leave as default
3201 ['win_debug_OmitFramePointers==1', {
3202 'OmitFramePointers': 'true',
3204 ['win_debug_OmitFramePointers==0', {
3205 'OmitFramePointers': 'false',
3206 # The above is not sufficient (http://crbug.com/106711): it
3207 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3208 # perform FPO regardless, so we must explicitly disable.
3209 # We still want the false setting above to avoid having
3210 # "/Oy /Oy-" and warnings about overriding.
3211 'AdditionalOptions': ['/Oy-'],
3214 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3217 'LinkIncremental': '<(msvs_debug_link_incremental)',
3218 # ASLR makes debugging with windbg difficult because Chrome.exe and
3219 # Chrome.dll share the same base name. As result, windbg will
3220 # name the Chrome.dll module like chrome_<base address>, where
3221 # <base address> typically changes with each launch. This in turn
3222 # means that breakpoints in Chrome.dll don't stick from one launch
3223 # to the next. For this reason, we turn ASLR off in debug builds.
3224 # Note that this is a three-way bool, where 0 means to pick up
3225 # the default setting, 1 is off and 2 is on.
3226 'RandomizedBaseAddress': 1,
3228 'VCResourceCompilerTool': {
3229 'PreprocessorDefinitions': ['_DEBUG'],
3233 ['OS=="linux" or OS=="android"', {
3234 'target_conditions': [
3235 ['_toolset=="target"', {
3237 '<@(debug_extra_cflags)',
3242 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3243 # Enable libstdc++ debugging facilities to help catch problems
3244 # early, see http://crbug.com/65151 .
3245 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3246 'defines': ['_GLIBCXX_DEBUG=1',],
3248 ['release_valgrind_build==0', {
3251 '-fstack-protector-all', # Implies -fstack-protector
3257 # Allow comparing the address of references and 'this' against 0
3258 # in debug builds. Technically, these can never be null in
3259 # well-defined C/C++ and Clang can optimize such checks away in
3260 # release builds, but they may be used in asserts in debug builds.
3261 '-Wno-undefined-bool-conversion',
3262 '-Wno-tautological-undefined-compare',
3266 '-Wno-undefined-bool-conversion',
3267 '-Wno-tautological-undefined-compare',
3271 'VCCLCompilerTool': {
3272 'AdditionalOptions': [
3273 '-Wno-undefined-bool-conversion',
3274 '-Wno-tautological-undefined-compare',
3287 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3288 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3289 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3292 'VCCLCompilerTool': {
3293 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3295 # In official builds, each target will self-select
3296 # an optimization level.
3297 ['buildtype!="Official"', {
3298 'Optimization': '<(win_release_Optimization)',
3301 # According to MSVS, InlineFunctionExpansion=0 means
3302 # "default inlining", not "/Ob0".
3303 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3304 ['win_release_InlineFunctionExpansion==0', {
3305 'AdditionalOptions': ['/Ob0'],
3307 ['win_release_InlineFunctionExpansion!=""', {
3308 'InlineFunctionExpansion':
3309 '<(win_release_InlineFunctionExpansion)',
3312 # if win_release_OmitFramePointers is blank, leave as default
3313 ['win_release_OmitFramePointers==1', {
3314 'OmitFramePointers': 'true',
3316 ['win_release_OmitFramePointers==0', {
3317 'OmitFramePointers': 'false',
3318 # The above is not sufficient (http://crbug.com/106711): it
3319 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3320 # perform FPO regardless, so we must explicitly disable.
3321 # We still want the false setting above to avoid having
3322 # "/Oy /Oy-" and warnings about overriding.
3323 'AdditionalOptions': ['/Oy-'],
3326 'AdditionalOptions': [
3327 '/d2Zi+', # Improve debugging of Release builds.
3328 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3329 '<@(win_release_extra_cflags)',
3333 # LinkIncremental is a tri-state boolean, where 0 means default
3334 # (i.e., inherit from parent solution), 1 means false, and
3336 'LinkIncremental': '1',
3337 # This corresponds to the /PROFILE flag which ensures the PDB
3338 # file contains FIXUP information (growing the PDB file by about
3339 # 5%) but does not otherwise alter the output binary. This
3340 # information is used by the Syzygy optimization tool when
3341 # decomposing the release image.
3346 ['msvs_use_common_release', {
3347 'includes': ['release.gypi'],
3349 ['release_valgrind_build==0 and tsan==0', {
3352 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3356 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3357 'MEMORY_SANITIZER_INITIAL_SIZE',
3358 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3359 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3362 ['win_use_allocator_shim==0', {
3363 'defines': ['NO_TCMALLOC'],
3365 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3366 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3367 # It seems to work fine with Ubuntu 12 headers though, so use it
3368 # in official builds.
3369 ['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")', {
3370 'target_conditions': [
3371 ['chromium_code==1', {
3372 # Non-chromium code is not guaranteed to compile cleanly
3373 # with _FORTIFY_SOURCE. Also, fortified build may fail
3374 # when optimizations are disabled, so only do that for Release
3377 '_FORTIFY_SOURCE=2',
3382 ['OS=="linux" or OS=="android"', {
3383 'target_conditions': [
3384 ['_toolset=="target"', {
3386 '<@(release_extra_cflags)',
3389 ['enable_resource_whitelist_generation==1', {
3391 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3400 'NS_BLOCK_ASSERTIONS=1',
3406 # Concrete configurations
3409 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3412 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3417 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3418 'target_conditions': [
3419 [ '_type=="executable"', {
3420 # To get a real .dSYM bundle produced by dsymutil, set the
3421 # debug information format to dwarf-with-dsym. Since
3422 # strip_from_xcode will not be used, set Xcode to do the
3423 # stripping as well.
3425 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3426 'DEPLOYMENT_POSTPROCESSING': 'YES',
3427 'STRIP_INSTALLED_PRODUCT': 'YES',
3434 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3436 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3439 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3447 'target_defaults': {
3452 # TODO(glider): enable the default options on other systems.
3454 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3456 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3462 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3463 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3464 'target_defaults': {
3466 '-Wl,--fatal-warnings',
3470 ['os_posix==1 and chromeos==0', {
3471 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3472 # and we want to avoid overriding this, so stack-protector is only
3473 # enabled when not building on Chrome OS.
3474 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3476 'target_defaults': {
3478 '-fstack-protector',
3479 '--param=ssp-buffer-size=4',
3483 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3484 'target_defaults': {
3485 # Enable -Werror by default, but put it in a variable so it can
3486 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3488 'werror%': '-Werror',
3489 'libraries_for_target%': '',
3492 '_FILE_OFFSET_BITS=64',
3495 '<(werror)', # See note above about the werror variable.
3497 '-fno-strict-aliasing', # See http://crbug.com/32204
3499 # TODO(evan): turn this back on once all the builds work.
3501 # Don't warn about unused function params. We use those everywhere.
3502 '-Wno-unused-parameter',
3503 # Don't warn about the "struct foo f = {0};" initialization pattern.
3504 '-Wno-missing-field-initializers',
3505 # Don't export any symbols (for example, to plugins we dlopen()).
3506 # Note: this is *required* to make some plugins work.
3507 '-fvisibility=hidden',
3513 '-fno-threadsafe-statics',
3514 # Make inline functions have hidden visiblity by default.
3515 # Surprisingly, not covered by -fvisibility=hidden.
3516 '-fvisibility-inlines-hidden',
3517 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3518 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3522 '-pthread', '-Wl,-z,noexecstack',
3525 '<(libraries_for_target)',
3530 'debug_optimize%': '0',
3536 '-O>(debug_optimize)',
3543 # Warn in case of text relocations.
3544 '-Wl,--warn-shared-textrel',
3547 ['OS=="android" and android_full_debug==0', {
3548 # Some configurations are copied from Release_Base to reduce
3551 'debug_optimize%': 's',
3555 '-ffunction-sections',
3562 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3563 # We don't omit frame pointers on arm64 since they are required
3564 # to correctly unwind stackframes which contain system library
3565 # function frames (crbug.com/391706).
3567 '-fomit-frame-pointer',
3570 ['OS=="linux" and target_arch=="ia32"', {
3572 '-Wl,--no-as-needed',
3575 ['debug_unwind_tables==1', {
3576 'cflags': ['-funwind-tables'],
3578 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3580 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3581 # definitions in to the right scope to use them when setting
3582 # linux_use_debug_fission, so it can be used here alone.
3583 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3584 'cflags': ['-gsplit-dwarf'],
3590 'release_optimize%': '2',
3591 # Binaries become big and gold is unable to perform GC
3592 # and remove unused sections for some of test targets
3593 # on 32 bit platform.
3594 # (This is currently observed only in chromeos valgrind bots)
3595 # The following flag is to disable --gc-sections linker
3596 # option for these bots.
3597 'no_gc_sections%': 0,
3599 # TODO(bradnelson): reexamine how this is done if we change the
3600 # expansion of configurations
3601 'release_valgrind_build%': 0,
3604 '-O<(release_optimize)',
3605 # Don't emit the GCC version ident directives, they just end up
3606 # in the .comment section taking up binary size.
3608 # Put data and code in their own sections, so that unused symbols
3609 # can be removed at link time with --gc-sections.
3611 '-ffunction-sections',
3614 # Specifically tell the linker to perform optimizations.
3615 # See http://lwn.net/Articles/192624/ .
3620 ['no_gc_sections==0', {
3622 '-Wl,--gc-sections',
3625 ['OS=="android" and target_arch!="arm64"', {
3626 # We don't omit frame pointers on arm64 since they are required
3627 # to correctly unwind stackframes which contain system library
3628 # function frames (crbug.com/391706).
3630 '-fomit-frame-pointer',
3635 'release_optimize%': 's',
3638 # Warn in case of text relocations.
3639 '-Wl,--warn-shared-textrel',
3644 '-fno-omit-frame-pointer',
3648 ['profiling_full_stack_frames==1', {
3651 '-fno-optimize-sibling-calls',
3656 ['release_unwind_tables==1', {
3657 'cflags': ['-funwind-tables'],
3659 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3665 ['target_arch=="ia32"', {
3666 'target_conditions': [
3667 ['_toolset=="target"', {
3669 # Needed so that libs with .s files (e.g. libicudata.a)
3670 # are compatible with the general 32-bit-ness.
3673 # All floating-point computations on x87 happens in 80-bit
3674 # precision. Because the C and C++ language standards allow
3675 # the compiler to keep the floating-point values in higher
3676 # precision than what's specified in the source and doing so
3677 # is more efficient than constantly rounding up to 64-bit or
3678 # 32-bit precision as specified in the source, the compiler,
3679 # especially in the optimized mode, tries very hard to keep
3680 # values in x87 floating-point stack (in 80-bit precision)
3681 # as long as possible. This has important side effects, that
3682 # the real value used in computation may change depending on
3683 # how the compiler did the optimization - that is, the value
3684 # kept in 80-bit is different than the value rounded down to
3685 # 64-bit or 32-bit. There are possible compiler options to
3686 # make this behavior consistent (e.g. -ffloat-store would keep
3687 # all floating-values in the memory, thus force them to be
3688 # rounded to its original precision) but they have significant
3689 # runtime performance penalty.
3691 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3692 # which keep floating-point values in SSE registers in its
3693 # native precision (32-bit for single precision, and 64-bit
3694 # for double precision values). This means the floating-point
3695 # value used during computation does not change depending on
3696 # how the compiler optimized the code, since the value is
3697 # always kept in its specified precision.
3699 # Refer to http://crbug.com/348761 for rationale behind SSE2
3700 # being a minimum requirement for 32-bit Linux builds and
3701 # http://crbug.com/313032 for an example where this has "bit"
3706 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3713 # Use gold linker for Android ia32 target.
3719 # Install packages have started cropping up with
3720 # different headers between the 32-bit and 64-bit
3721 # versions, so we have to shadow those differences off
3722 # and make sure a 32-bit-on-64-bit build picks up the
3724 # For android build, use NDK headers instead of host headers
3725 ['host_arch!="ia32" and OS!="android"', {
3734 ['target_arch=="x64"', {
3735 'target_conditions': [
3736 ['_toolset=="target"', {
3738 # Use gold linker for Android x64 target.
3755 ['target_arch=="arm"', {
3756 'target_conditions': [
3757 ['_toolset=="target"', {
3761 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3762 # has changed whenever it encounters a varargs function. This
3763 # silences those warnings, as they are not helpful and
3764 # clutter legitimate warnings.
3768 ['clang==1 and arm_arch!="" and OS!="android"', {
3770 '-target arm-linux-gnueabihf',
3773 '-target arm-linux-gnueabihf',
3778 '-march=<(arm_arch)',
3781 ['use_lto==1 or use_lto_o2==1', {
3783 '-march=<(arm_arch)',
3788 ['clang==1 and OS!="android"', {
3790 # We need to disable clang's builtin assembler as it can't
3791 # handle several asm files, crbug.com/124610
3792 '-no-integrated-as',
3797 '-mtune=<(arm_tune)',
3800 ['use_lto==1 or use_lto_o2==1', {
3802 '-mtune=<(arm_tune)',
3812 ['use_lto==1 or use_lto_o2==1', {
3819 ['arm_float_abi!=""', {
3821 '-mfloat-abi=<(arm_float_abi)',
3824 ['use_lto==1 or use_lto_o2==1', {
3826 '-mfloat-abi=<(arm_float_abi)',
3836 ['use_lto==1 or use_lto_o2==1', {
3844 # Most of the following flags are derived from what Android
3845 # uses by default when building for arm, reference for which
3846 # can be found in the following file in the Android NDK:
3847 # toolchains/arm-linux-androideabi-4.9/setup.mk
3849 # The tree-sra optimization (scalar replacement for
3850 # aggregates enabling subsequent optimizations) leads to
3851 # invalid code generation when using the Android NDK's
3852 # compiler (r5-r7). This can be verified using
3853 # webkit_unit_tests' WTF.Checked_int8_t test.
3855 # The following option is disabled to improve binary
3856 # size and performance in gcc 4.9.
3857 '-fno-caller-saves',
3860 # Android now supports .relro sections properly.
3861 # NOTE: While these flags enable the generation of .relro
3862 # sections, the generated libraries can still be loaded on
3863 # older Android platform versions.
3870 ['gcc_version==48 and clang==0', {
3872 # The following 5 options are disabled to save on
3873 # binary size in GCC 4.8.
3874 '-fno-partial-inlining',
3875 '-fno-early-inlining',
3876 '-fno-tree-copy-prop',
3877 '-fno-tree-loop-optimize',
3878 '-fno-move-loop-invariants',
3882 'cflags': [ '-mthumb-interwork' ],
3886 # Thumb code with frame pointer makes chrome crash
3889 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3890 # The perf report sometimes incorrectly attributes
3891 # code from tail calls.
3892 '-fno-optimize-sibling-calls',
3895 '-fomit-frame-pointer',
3900 # Clang does not support the following options.
3901 '-mthumb-interwork',
3902 '-finline-limit=64',
3904 '-fno-caller-saves',
3908 # TODO(hans) Enable integrated-as (crbug.com/124610).
3909 '-no-integrated-as',
3910 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3913 # Let clang find the ld.gold in the NDK.
3914 '--gcc-toolchain=<(android_toolchain)/..',
3919 '-marm', # Required for frame pointer based stack traces.
3926 # We set arm_arch to "" so that -march compiler option
3927 # is not set. Otherwise a gcc bug that would complain
3928 # about it conflicting with '-mcpu=cortex-a9'. The flag
3929 # '-march=armv7-a' is actually redundant anyway because
3930 # it is enabled by default when we built the toolchain.
3931 # And using '-mcpu=cortex-a9' should be sufficient.
3934 # Breakpad requires symbols with debugging information
3938 # We want to statically link libstdc++/libgcc_s.
3939 '-static-libstdc++',
3943 # Some components in Chromium (e.g. v8, skia, ffmpeg)
3944 # define their own cflags for arm builds that could
3945 # conflict with the flags we set here (e.g.
3946 # '-mcpu=cortex-a9'). Remove these flags explicitly.
3955 ['target_arch=="arm64"', {
3956 'target_conditions': [
3957 ['_toolset=="target"', {
3961 '-fstack-protector', # stack protector is always enabled on arm64.
3968 ['target_arch=="mipsel"', {
3969 'target_conditions': [
3970 ['_toolset=="target"', {
3972 ['android_webview_build==0 and mips_arch_variant=="r6"', {
3973 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
3976 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
3980 ['android_webview_build==0 and mips_arch_variant=="r2"', {
3981 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
3983 ['android_webview_build==0 and mips_arch_variant=="r1"', {
3984 'cflags': ['-mips32', '-Wa,-mips32'],
3988 '-Wl,--no-keep-memory'
3991 '-Wno-uninitialized',
3996 ['target_arch=="mips64el"', {
3997 'target_conditions': [
3998 ['_toolset=="target"', {
4000 ['android_webview_build==0 and mips_arch_variant=="r6"', {
4001 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4002 'ldflags': [ '-mips64r6' ],
4004 ['android_webview_build==0 and mips_arch_variant=="r2"', {
4005 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4006 'ldflags': [ '-mips64r2' ],
4010 '-Wno-uninitialized',
4024 'target_conditions': [
4025 ['_toolset=="target"', {
4027 '--sysroot=<(sysroot)',
4030 '--sysroot=<(sysroot)',
4031 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4037 # TODO(thakis): Remove, http://crbug.com/263960
4038 '-Wno-reserved-user-defined-literal',
4041 # See the comment in the Mac section for what it takes to move
4042 # this to -std=c++11.
4046 ['clang==0 and host_clang==1', {
4047 'target_conditions': [
4048 ['_toolset=="host"', {
4049 'cflags_cc': [ '-std=gnu++11', ],
4053 ['clang==1 and clang_use_chrome_plugins==1', {
4055 '<@(clang_chrome_plugins_flags)',
4058 ['clang==1 and clang_load!=""', {
4060 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4063 ['clang==1 and clang_add_plugin!=""', {
4065 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4068 ['clang==1 and target_arch=="ia32"', {
4070 # Else building libyuv gives clang's register allocator issues,
4071 # see llvm.org/PR15798 / crbug.com/233709
4072 '-momit-leaf-frame-pointer',
4073 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4074 '-mstack-alignment=16',
4078 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4080 # See http://crbug.com/110262
4081 '-fcolor-diagnostics',
4084 # Common options for AddressSanitizer, LeakSanitizer,
4085 # ThreadSanitizer and MemorySanitizer.
4086 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4087 'target_conditions': [
4088 ['_toolset=="target"', {
4090 '-fno-omit-frame-pointer',
4091 '-gline-tables-only',
4094 '-fomit-frame-pointer',
4099 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4100 'target_conditions': [
4101 ['_toolset=="target"', {
4103 # Functions interposed by the sanitizers can make ld think
4104 # that some libraries aren't needed when they actually are,
4105 # http://crbug.com/234010. As workaround, disable --as-needed.
4109 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4110 'MEMORY_SANITIZER_INITIAL_SIZE',
4116 'target_conditions': [
4117 ['_toolset=="target"', {
4119 '-fsanitize=address',
4120 '-fsanitize-blacklist=<(asan_blacklist)',
4123 '-fsanitize=address',
4130 '-mllvm -asan-globals=0', # http://crbug.com/352073
4136 'target_conditions': [
4137 ['_toolset=="target"', {
4139 '-fsanitize=undefined',
4140 # -fsanitize=vptr is incompatible with -fno-rtti.
4141 '-fno-sanitize=vptr',
4144 '-fsanitize=undefined',
4145 # -fsanitize=vptr is incompatible with -fno-rtti.
4146 '-fno-sanitize=vptr',
4152 'target_conditions': [
4153 ['_toolset=="target"', {
4156 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4168 'UNDEFINED_SANITIZER',
4173 ['asan_coverage!=0', {
4174 'target_conditions': [
4175 ['_toolset=="target"', {
4177 '-mllvm -asan-coverage=<(asan_coverage)',
4182 ['asan_field_padding!=0', {
4183 'target_conditions': [
4184 ['_toolset=="target"', {
4186 '-fsanitize-address-field-padding=<(asan_field_padding)',
4192 'target_conditions': [
4193 ['_toolset=="target"', {
4202 'WTF_USE_LEAK_SANITIZER=1',
4208 'target_conditions': [
4209 ['_toolset=="target"', {
4211 '-fsanitize=thread',
4213 '-fsanitize-blacklist=<(tsan_blacklist)',
4216 '-fsanitize=thread',
4220 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4221 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4223 'target_conditions': [
4224 ['_type=="executable"', {
4234 'target_conditions': [
4235 ['_toolset=="target"', {
4237 '-fsanitize=memory',
4238 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4240 '-fsanitize-blacklist=<(msan_blacklist)',
4243 '-fsanitize=memory',
4248 'target_conditions': [
4249 ['_type=="executable"', {
4258 ['use_instrumented_libraries==1', {
4260 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4263 ['use_custom_libcxx==1', {
4265 '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4268 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4269 'target_conditions' : [
4270 # crazy_linker has an upstream gyp file we can't edit, and we
4271 # don't want to instrument it.
4272 ['_toolset=="target" and _target_name!="crazy_linker"', {
4274 '-finstrument-functions',
4275 # Allow mmx intrinsics to inline, so that the
4276 #0 compiler can expand the intrinsics.
4277 '-finstrument-functions-exclude-file-list=mmintrin.h',
4280 ['_toolset=="target" and OS=="android"', {
4282 # Avoids errors with current NDK:
4283 # "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"
4284 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4289 ['linux_dump_symbols==1', {
4292 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4293 'target_conditions': [
4294 ['_toolset=="target"', {
4296 # Attempt to use less memory to prevent the linker from
4297 # running out of address space. Considering installing a
4298 # 64-bit kernel and switching to a 64-bit linker.
4299 '-Wl,--no-keep-memory',
4306 ['use_allocator!="tcmalloc"', {
4307 'defines': ['NO_TCMALLOC'],
4309 ['linux_use_gold_flags==1', {
4310 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4312 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4313 'ldflags': [ '-fuse-ld=gold', ],
4315 'target_conditions': [
4316 ['_toolset=="target"', {
4318 # Experimentation found that using four linking threads
4319 # saved ~20% of link time.
4320 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4321 # Only apply this to the target linker, since the host
4322 # linker might not be gold, but isn't used much anyway.
4323 # TODO(raymes): Disable threading because gold is frequently
4324 # crashing on the bots: crbug.com/161942.
4326 # '-Wl,--thread-count=4',
4331 ['release_valgrind_build==0', {
4332 'target_conditions': [
4333 ['_toolset=="target"', {
4342 ['linux_use_bundled_binutils==1', {
4344 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4347 ['linux_use_bundled_gold==1', {
4348 # Put our binutils, which contains gold in the search path. We pass
4349 # the path to gold to the compiler. gyp leaves unspecified what the
4350 # cwd is when running the compiler, so the normal gyp path-munging
4351 # fails us. This hack gets the right path.
4353 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4356 # Some binutils 2.23 releases may or may not have new dtags enabled,
4357 # but they are all compatible with --disable-new-dtags,
4358 # because the new dynamic tags are not created by default.
4359 ['binutils_version>=223', {
4360 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4361 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4362 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4363 # inside this file to allow usage of --no-as-needed and removal of
4366 '-Wl,--disable-new-dtags',
4369 ['gcc_version>=47 and clang==0', {
4370 'target_conditions': [
4371 ['_toolset=="target"', {
4374 # See comment for -Wno-c++11-narrowing.
4376 # TODO(thakis): Remove, http://crbug.com/263960
4377 '-Wno-literal-suffix',
4382 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4383 'target_conditions': [
4384 ['_toolset=="host"', {
4387 # See comment for -Wno-c++11-narrowing.
4389 # TODO(thakis): Remove, http://crbug.com/263960
4390 '-Wno-literal-suffix',
4398 # FreeBSD-specific options; note that most FreeBSD options are set above,
4401 'target_defaults': {
4403 '-Wl,--no-keep-memory',
4407 # Android-specific options; note that most are set above with Linux.
4410 # This is a unique identifier for a given build. It's used for
4411 # identifying various build artifacts corresponding to a particular
4412 # build of chrome (e.g. where to find archived symbols).
4413 'chrome_build_id%': '',
4415 # Figure this out early since it needs symbols from libgcc.a, so it
4416 # has to be before that in the set of libraries.
4417 ['component=="shared_library"', {
4418 'android_stlport_library': 'stlport_shared',
4420 'android_stlport_library': 'stlport_static',
4424 # Placing this variable here prevents from forking libvpx, used
4425 # by remoting. Remoting is off, so it needn't built,
4426 # so forking it's deps seems like overkill.
4427 # But this variable need defined to properly run gyp.
4428 # A proper solution is to have an OS==android conditional
4429 # in third_party/libvpx/libvpx.gyp to define it.
4430 'libvpx_path': 'lib/linux/arm',
4432 'target_defaults': {
4434 'release_extra_cflags%': '',
4436 # If we're using the components build, append "cr" to all shared
4437 # libraries to avoid naming collisions with android system library
4438 # versions with the same name (e.g. skia, icu).
4439 ['component=="shared_library"', {
4440 'android_product_extension': 'cr.so',
4442 'android_product_extension': 'so',
4446 'target_conditions': [
4447 ['_type=="shared_library"', {
4448 'product_extension': '<(android_product_extension)',
4451 # Settings for building device targets using Android's toolchain.
4452 # These are based on the setup.mk file from the Android NDK.
4454 # The NDK Android executable link step looks as follows:
4456 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4457 # $(PRIVATE_OBJECTS) <-- The .o that we built
4458 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4459 # $(TARGET_LIBGCC) <-- libgcc.a
4460 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4461 # $(PRIVATE_LDLIBS) <-- System .so
4462 # $(TARGET_CRTEND_O) <-- crtend.o
4464 # For now the above are approximated for executables by adding
4465 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4468 # The NDK Android shared library link step looks as follows:
4470 # $(PRIVATE_OBJECTS) <-- The .o that we built
4471 # -l,--whole-archive
4472 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4473 # -l,--no-whole-archive
4474 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4475 # $(TARGET_LIBGCC) <-- libgcc.a
4476 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4477 # $(PRIVATE_LDLIBS) <-- System .so
4479 # For now, assume that whole static libraries are not needed.
4481 # For both executables and shared libraries, add the proper
4482 # libgcc.a to the start of libraries which puts it in the
4483 # proper spot after .o and .a files get linked in.
4485 # TODO: The proper thing to do longer-tem would be proper gyp
4486 # support for a custom link command line.
4487 ['_toolset=="target"', {
4489 '-pthread', # Not supported by Android toolchain.
4492 '-ffunction-sections',
4495 '-fstack-protector',
4497 '-finline-limit=64',
4498 '-Wa,--noexecstack',
4499 '<@(release_extra_cflags)',
4503 '__GNU_SOURCE=1', # Necessary for clone()
4505 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4506 'CHROME_BUILD_ID="<(chrome_build_id)"',
4509 '-pthread', # Not supported by Android toolchain.
4512 '-Wl,--no-undefined',
4515 ['component=="static_library"', {
4517 '-Wl,--exclude-libs=ALL',
4522 # Work around incompatibilities between bionic and clang
4524 '-D__compiler_offsetof=__builtin_offsetof',
4525 '-Dnan=__builtin_nan',
4528 ['target_arch=="arm"', {
4530 '-target arm-linux-androideabi',
4533 '-target arm-linux-androideabi',
4536 ['target_arch=="ia32"', {
4538 '-target x86-linux-androideabi',
4541 '-target x86-linux-androideabi',
4544 # Place holder for x64 support, not tested.
4545 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4546 ['target_arch=="x64"', {
4548 '-target x86_64-linux-androideabi',
4551 '-target x86_64-linux-androideabi',
4558 # Android build relies on -Wl,--gc-sections removing
4559 # unreachable code. ASan instrumentation for globals inhibits
4560 # this and results in a library with unresolvable relocations.
4561 # TODO(eugenis): find a way to reenable this.
4562 '-mllvm -asan-globals=0',
4565 ['target_arch=="arm"', {
4567 # TODO(hans): The ASan runtime is no longer automatically
4568 # added to the link line when using -nostdlib. Can we
4569 # stop adding -nostdlib? (crbug.com/423429)
4570 '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/lib/clang/3.6.0/lib/linux/libclang_rt.asan-arm-android.so',
4575 ['android_webview_build==0', {
4577 # The NDK has these things, but doesn't define the constants
4578 # to say that it does. Define them here instead.
4582 '--sysroot=<(android_ndk_sysroot)',
4585 '--sysroot=<(android_ndk_sysroot)',
4589 '-l<(android_stlport_library)',
4590 # Manually link the libgcc.a that the cross compiler uses.
4591 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4597 ['android_webview_build==1', {
4599 # Android predefines this as 1; undefine it here so Chromium
4600 # can redefine it later to be 2 for chromium code and unset
4601 # for third party code. This works because cflags are added
4603 '-U_FORTIFY_SOURCE',
4604 # Disable any additional warnings enabled by the Android build system but which
4605 # chromium does not build cleanly with (when treating warning as errors).
4606 # Things that are part of -Wextra:
4607 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4608 '-Wno-ignored-qualifiers',
4610 '-Wno-unused-but-set-variable',
4613 # Other things unrelated to -Wextra:
4614 '-Wno-non-virtual-dtor',
4621 ['android_webview_build==1', {
4622 'target_conditions': [
4623 ['chromium_code==0', {
4625 # There is a class of warning which:
4626 # 1) Android always enables and also treats as errors
4627 # 2) Chromium ignores in third party code
4628 # So we re-enable those warnings when building Android.
4630 '-Wno-format-security',
4632 '-Wno-sequence-point',
4635 '-Wno-non-virtual-dtor',
4640 ['target_arch == "arm"', {
4642 # Enable identical code folding to reduce size.
4646 # NOTE: The stlport header include paths below are specified in
4647 # cflags rather than include_dirs because they need to come
4648 # after include_dirs. Think of them like system headers, but
4649 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4650 # toolchain (circa Gingerbread) will exhibit strange errors.
4651 # The include ordering here is important; change with caution.
4652 ['android_webview_build==0', {
4654 '-isystem<(android_stlport_include)',
4657 '-L<(android_stlport_libs_dir)',
4659 }, { # else: android_webview_build!=0
4660 'aosp_build_settings': {
4661 # Specify that we want to statically link stlport from the
4662 # NDK. This will provide all the include and library paths
4663 # automatically at build time, and link the right library.
4664 'LOCAL_NDK_STL_VARIANT': 'stlport_static',
4667 ['target_arch=="ia32"', {
4668 # The x86 toolchain currently has problems with stack-protector.
4670 '-fstack-protector',
4673 '-fno-stack-protector',
4677 'target_conditions': [
4678 ['_type=="executable"', {
4679 # Force android tools to export the "main" symbol so they can be
4680 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4681 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4682 # when ICS support will be dropped.
4685 '-fvisibility=default',
4689 '-Wl,--gc-sections',
4690 '-Wl,-z,nocopyreloc',
4693 # crtbegin_dynamic.o should be the last item in ldflags.
4694 '<(android_ndk_lib)/crtbegin_dynamic.o',
4697 # crtend_android.o needs to be the last item in libraries.
4698 # Do not add any libraries after this!
4699 '<(android_ndk_lib)/crtend_android.o',
4702 ['_type=="shared_library" or _type=="loadable_module"', {
4704 '-Wl,--exclude-libs=ALL',
4707 '-Wl,-shared,-Bsymbolic',
4710 ['android_webview_build==0', {
4712 # crtbegin_so.o should be the last item in ldflags.
4713 '<(android_ndk_lib)/crtbegin_so.o',
4716 # crtend_so.o needs to be the last item in libraries.
4717 # Do not add any libraries after this!
4718 '<(android_ndk_lib)/crtend_so.o',
4725 # Settings for building host targets using the system toolchain.
4726 ['_toolset=="host"', {
4728 # Due to issues in Clang build system, using ASan on 32-bit
4729 # binaries on x86_64 host is problematic.
4730 # TODO(eugenis): re-enable.
4731 '-fsanitize=address',
4734 '-fsanitize=address',
4735 '-Wl,-z,noexecstack',
4736 '-Wl,--gc-sections',
4739 '-Wl,--warn-shared-textrel',
4740 '-Wl,--fatal-warnings',
4743 # Settings for building host targets on mac.
4744 ['_toolset=="host" and host_os=="mac"', {
4754 'cflags!': ['-fvisibility=hidden'],
4755 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4757 ['OS=="mac" or OS=="ios"', {
4758 'target_defaults': {
4761 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4762 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4763 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4764 'COPY_PHASE_STRIP': 'NO',
4765 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4766 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4767 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4768 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4769 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4770 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4771 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4772 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4773 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4774 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4775 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4776 'GCC_VERSION': '4.2',
4777 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4778 'USE_HEADERMAP': 'NO',
4783 # Don't warn about unused function parameters.
4784 '-Wno-unused-parameter',
4785 # Don't warn about the "struct foo f = {0};" initialization
4787 '-Wno-missing-field-initializers',
4790 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4791 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4793 # Note that the prebuilt Clang binaries should not be used for iOS
4794 # development except for ASan builds.
4796 # gnu++11 instead of c++11 is needed because some code uses
4797 # typeof() (a GNU extension).
4798 # TODO(thakis): Eventually switch this to c++11 instead of
4799 # gnu++11 (once typeof can be removed, which is blocked on c++11
4800 # being available everywhere).
4801 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', # -std=gnu++11
4802 # Warn if automatic synthesis is triggered with
4803 # the -Wobjc-missing-property-synthesis flag.
4804 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4805 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4807 # This warns on selectors from Cocoa headers (-length, -set).
4808 # cfe-dev is currently discussing the merits of this warning.
4809 # TODO(thakis): Reevaluate what to do with this, based one
4810 # cfe-dev discussion.
4811 '-Wno-selector-type-mismatch',
4814 ['clang_xcode==0', {
4815 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4816 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4820 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4822 '<@(clang_chrome_plugins_flags)',
4825 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4827 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4830 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4832 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4835 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4837 # See http://crbug.com/110262
4838 '-fcolor-diagnostics',
4841 ['OS=="ios" and target_subarch!="arm32" and \
4842 "<(GENERATOR)"=="xcode"', {
4844 # TODO(ios): when building Chrome for iOS on 64-bit platform
4845 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4846 # enabled. This cause failures when compiling protobuf code,
4847 # so disable the warning. http://crbug.com/359107
4848 '-Wno-shorten-64-to-32',
4856 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4862 '-fsanitize=address',
4863 '-mllvm -asan-globals=0', # http://crbug.com/352073
4864 '-gline-tables-only',
4868 ['asan_coverage!=0', {
4869 'target_conditions': [
4870 ['_toolset=="target"', {
4872 '-mllvm -asan-coverage=<(asan_coverage)',
4878 'target_conditions': [
4879 ['_type!="static_library"', {
4880 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4885 '-fsanitize=address',
4889 ['mac_write_linker_maps==1', {
4892 '-Wl,-map,>(_target_name).map',
4899 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4900 'target_conditions': [
4901 ['_type=="executable"', {
4907 # Define copy_asan_dylib_path in a variable ending in
4908 # _path so that gyp understands it's a path and
4909 # performs proper relativization during dict merging.
4910 'copy_asan_dylib_path':
4911 'mac/copy_asan_runtime_dylib.sh',
4913 'postbuild_name': 'Copy ASan runtime dylib',
4915 '<(copy_asan_dylib_path)',
4924 ], # target_conditions
4925 }, # target_defaults
4926 }], # OS=="mac" or OS=="ios"
4928 'target_defaults': {
4930 # Prevent Mac OS X AssertMacros.h from defining macros that collide
4931 # with common names, like 'check', 'require', and 'verify'.
4932 # (Included by system header. Also exists on iOS but not included.)
4933 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
4934 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
4937 # These should end with %, but there seems to be a bug with % in
4938 # variables that are intended to be set to different values in
4939 # different targets, like these.
4940 'mac_pie': 1, # Most executables can be position-independent.
4941 # Strip debugging symbols from the target.
4942 'mac_strip': '<(mac_strip_release)',
4946 ['mac_want_real_dsym=="default"', {
4949 'mac_real_dsym': '<(mac_want_real_dsym)'
4954 ['mac_want_real_dsym=="default"', {
4955 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
4957 'mac_real_dsym': '<(mac_want_real_dsym)'
4964 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
4965 # (Equivalent to -fPIC)
4966 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
4967 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4968 # Keep pch files below xcodebuild/.
4969 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
4971 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
4972 # xcode_setting, but not until all downstream projects' mac bots are
4973 # using xcode >= 4.6, because that's when the default value of the
4974 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
4975 # setting is a no-op as far as xcode is concerned, but the compiler
4976 # behaves differently based on whether -fno-strict-aliasing is
4978 '-fno-strict-aliasing', # See http://crbug.com/32204.
4981 'target_conditions': [
4982 ['_type=="executable"', {
4985 # Arranges for data (heap) pages to be protected against
4986 # code execution when running on Mac OS X 10.7 ("Lion"), and
4987 # ensures that the position-independent executable (PIE) bit
4988 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
4990 # Define change_mach_o_flags in a variable ending in _path
4991 # so that GYP understands it's a path and performs proper
4992 # relativization during dict merging.
4993 'change_mach_o_flags_path':
4994 'mac/change_mach_o_flags_from_xcode.sh',
4995 'change_mach_o_flags_options%': [
4997 'target_conditions': [
4998 ['mac_pie==0 or release_valgrind_build==1', {
4999 # Don't enable PIE if it's unwanted. It's unwanted if
5000 # the target specifies mac_pie=0 or if building for
5001 # Valgrind, because Valgrind doesn't understand slide.
5002 # See the similar mac_pie/release_valgrind_build check
5004 'change_mach_o_flags_options': [
5010 'postbuild_name': 'Change Mach-O Flags',
5012 '<(change_mach_o_flags_path)',
5013 '>@(change_mach_o_flags_options)',
5020 'asan_saves_file': 'asan.saves',
5023 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
5027 'target_conditions': [
5028 ['mac_pie==1 and release_valgrind_build==0', {
5029 # Turn on position-independence (ASLR) for executables. When
5030 # PIE is on for the Chrome executables, the framework will
5031 # also be subject to ASLR.
5032 # Don't do this when building for Valgrind, because Valgrind
5033 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5034 # understand slide, and get rid of the Valgrind check.
5037 '-Wl,-pie', # Position-independent executable (MH_PIE)
5043 ['(_type=="executable" or _type=="shared_library" or \
5044 _type=="loadable_module") and mac_strip!=0', {
5045 'target_conditions': [
5046 ['mac_real_dsym == 1', {
5047 # To get a real .dSYM bundle produced by dsymutil, set the
5048 # debug information format to dwarf-with-dsym. Since
5049 # strip_from_xcode will not be used, set Xcode to do the
5050 # stripping as well.
5054 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5055 'DEPLOYMENT_POSTPROCESSING': 'YES',
5056 'STRIP_INSTALLED_PRODUCT': 'YES',
5057 'target_conditions': [
5058 ['_type=="shared_library" or _type=="loadable_module"', {
5059 # The Xcode default is to strip debugging symbols
5060 # only (-S). Local symbols should be stripped as
5061 # well, which will be handled by -x. Xcode will
5062 # continue to insert -S when stripping even when
5063 # additional flags are added with STRIPFLAGS.
5065 }], # _type=="shared_library" or _type=="loadable_module"
5066 ['_type=="executable"', {
5069 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
5072 }], # _type=="executable" and asan==1
5073 ], # target_conditions
5075 }, # configuration "Release"
5077 }, { # mac_real_dsym != 1
5078 # To get a fast fake .dSYM bundle, use a post-build step to
5079 # produce the .dSYM and strip the executable. strip_from_xcode
5080 # only operates in the Release configuration.
5084 # Define strip_from_xcode in a variable ending in _path
5085 # so that gyp understands it's a path and performs proper
5086 # relativization during dict merging.
5087 'strip_from_xcode_path': 'mac/strip_from_xcode',
5089 'postbuild_name': 'Strip If Needed',
5090 'action': ['<(strip_from_xcode_path)'],
5094 ], # target_conditions
5095 }], # (_type=="executable" or _type=="shared_library" or
5096 # _type=="loadable_module") and mac_strip!=0
5097 ], # target_conditions
5098 }, # target_defaults
5101 'target_defaults': {
5102 'xcode_settings' : {
5103 # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang
5105 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',
5108 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5109 # additional flag to suppress the "unknown compiler option" error.
5110 # Restrict this flag to builds that are either compiling with Xcode
5111 # or compiling with Xcode's Clang. This will allow Ninja builds to
5112 # continue failing on unknown compiler options.
5113 # TODO(rohitrao): This flag is temporary and should be removed as
5114 # soon as the iOS bots are updated to use Xcode 5.1.
5115 ['clang_xcode==1', {
5117 '-Wno-unknown-warning-option',
5121 # Limit the valid architectures depending on "target_subarch".
5122 # This need to include the "arm" architectures but also the "x86"
5123 # ones (they are used when building for the simulator).
5124 ['target_subarch=="arm32"', {
5125 'VALID_ARCHS': ['armv7', 'i386'],
5127 ['target_subarch=="arm64"', {
5128 'VALID_ARCHS': ['arm64', 'x86_64'],
5130 ['target_subarch=="both"', {
5131 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5133 ['use_system_libcxx==1', {
5134 'target_conditions': [
5135 # Only use libc++ when building target for iOS not when building
5136 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5137 # does not support libc++.
5138 ['_toolset=="target"', {
5139 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5143 # The default for deployment target of 7.0+ is libc++, so force
5144 # the old behavior unless libc++ is enabled.
5145 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5149 'target_conditions': [
5150 ['_toolset=="host"', {
5152 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5153 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5162 ['_toolset=="target"', {
5164 # This section should be for overriding host settings. But,
5165 # since we can't negate the iphone deployment target above, we
5166 # instead set it here for target only.
5167 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5168 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5171 ['_type=="executable"', {
5175 'DEPLOYMENT_POSTPROCESSING': 'YES',
5176 'STRIP_INSTALLED_PRODUCT': 'YES',
5181 # Remove dSYM to reduce build time.
5182 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5188 ['chromium_ios_signing', {
5189 # iOS SDK wants everything for device signed.
5190 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5192 'CODE_SIGNING_REQUIRED': 'NO',
5193 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5198 ], # target_conditions
5199 }, # target_defaults
5202 'target_defaults': {
5204 '_WIN32_WINNT=0x0602',
5211 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5212 'WIN32_LEAN_AND_MEAN',
5214 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5215 '_HAS_EXCEPTIONS=0',
5218 ['buildtype=="Official"', {
5219 # In official builds, targets can self-select an optimization
5220 # level by defining a variable named 'optimize', and setting it
5222 # - "size", optimizes for minimal code size - the default.
5223 # - "speed", optimizes for speed over code size.
5224 # - "max", whole program optimization and link-time code
5225 # generation. This is very expensive and should be used
5228 'optimize%': 'size',
5232 # Set /LTCG for the official builds.
5233 'LinkTimeCodeGeneration': '1',
5236 'target_conditions': [
5237 ['optimize=="size"', {
5239 'VCCLCompilerTool': {
5240 # 1, optimizeMinSpace, Minimize Size (/O1)
5241 'Optimization': '1',
5242 # 2, favorSize - Favor small code (/Os)
5243 'FavorSizeOrSpeed': '2',
5248 ['optimize=="speed"', {
5250 'VCCLCompilerTool': {
5251 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5252 'Optimization': '2',
5253 # 1, favorSpeed - Favor fast code (/Ot)
5254 'FavorSizeOrSpeed': '1',
5259 ['optimize=="max"', {
5260 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5261 # builds. Probably anything that this would catch that
5262 # wouldn't be caught in a normal build isn't going to
5263 # actually be a bug, so the incremental value of C4702 for
5264 # PGO builds is likely very small.
5265 'msvs_disabled_warnings': [
5269 'VCCLCompilerTool': {
5270 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5271 'Optimization': '2',
5272 # 1, favorSpeed - Favor fast code (/Ot)
5273 'FavorSizeOrSpeed': '1',
5274 # This implies link time code generation.
5275 'WholeProgramOptimization': 'true',
5293 'AdditionalLibraryDirectories':
5294 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5296 'VCLibrarianTool': {
5297 'AdditionalLibraryDirectories':
5298 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5304 'VCLibrarianTool': {
5305 'AdditionalLibraryDirectories':
5306 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5309 'AdditionalLibraryDirectories':
5310 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5315 # https://code.google.com/p/chromium/issues/detail?id=372451#c20
5316 # Warning 4702 ("Unreachable code") should be re-enabled once
5317 # Express users are updated to VS2013 Update 2.
5318 'msvs_disabled_warnings': [
5322 'VCCLCompilerTool': {
5323 'AdditionalOptions!': [
5324 '/Zc:inline', # Not supported on non-updated Express.
5328 # Explicitly required when using the ATL with express
5329 'AdditionalDependencies': ['atlthunk.lib'],
5331 # ATL 8.0 included in WDK 7.1 makes the linker to generate
5332 # almost eight hundred LNK4254 and LNK4078 warnings:
5333 # - warning LNK4254: section 'ATL' (50000040) merged into
5334 # '.rdata' (40000040) with different attributes
5335 # - warning LNK4078: multiple 'ATL' sections found with
5336 # different attributes
5337 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
5340 'msvs_system_include_dirs': [
5341 '<(windows_driver_kit_path)/inc/atl71',
5342 '<(windows_driver_kit_path)/inc/mfc42',
5346 'msvs_system_include_dirs': [
5347 '<(windows_sdk_path)/Include/shared',
5348 '<(windows_sdk_path)/Include/um',
5349 '<(windows_sdk_path)/Include/winrt',
5350 '$(VSInstallDir)/VC/atlmfc/include',
5352 'msvs_cygwin_shell': 0,
5353 'msvs_disabled_warnings': [
5354 # C4127: conditional expression is constant
5355 # This warning can in theory catch dead code and other problems, but
5356 # triggers in far too many desirable cases where the conditional
5357 # expression is either set by macros or corresponds some legitimate
5358 # compile-time constant expression (due to constant template args,
5359 # conditionals comparing the sizes of different types, etc.). Some of
5360 # these can be worked around, but it's not worth it.
5363 # C4351: new behavior: elements of array 'array' will be default
5365 # This is a silly "warning" that basically just alerts you that the
5366 # compiler is going to actually follow the language spec like it's
5367 # supposed to, instead of not following it like old buggy versions
5368 # did. There's absolutely no reason to turn this on.
5371 # C4355: 'this': used in base member initializer list
5372 # It's commonly useful to pass |this| to objects in a class'
5373 # initializer list. While this warning can catch real bugs, most of
5374 # the time the constructors in question don't attempt to call methods
5375 # on the passed-in pointer (until later), and annotating every legit
5376 # usage of this is simply more hassle than the warning is worth.
5379 # C4503: 'identifier': decorated name length exceeded, name was
5381 # This only means that some long error messages might have truncated
5382 # identifiers in the presence of lots of templates. It has no effect
5383 # on program correctness and there's no real reason to waste time
5384 # trying to prevent it.
5387 # C4611: interaction between 'function' and C++ object destruction is
5389 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5390 # suggests using exceptions instead of setjmp/longjmp for C++, but
5391 # Chromium code compiles without exception support. We therefore have
5392 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5393 # means we have to turn off this warning (and be careful about how
5394 # object destruction happens in such cases).
5397 # TODO(maruel): These warnings are level 4. They will be slowly
5398 # removed as code is fixed.
5399 4100, # Unreferenced formal parameter
5400 4121, # Alignment of a member was sensitive to packing
5401 4189, # Local variable is initialized but not referenced
5402 4244, # Conversion from 'type1' to 'type2', possible loss of data
5403 4481, # Nonstandard extension used: override specifier 'keyword'
5404 4505, # Unreferenced local function has been removed
5405 4510, # Default constructor could not be generated
5406 4512, # Assignment operator could not be generated
5407 4610, # Object can never be instantiated
5410 'VCCLCompilerTool': {
5411 'AdditionalOptions': ['/MP'],
5412 'MinimalRebuild': 'false',
5413 'BufferSecurityCheck': 'true',
5414 'EnableFunctionLevelLinking': 'true',
5415 'RuntimeTypeInfo': 'false',
5416 'WarningLevel': '4',
5417 'WarnAsError': 'true',
5418 'DebugInformationFormat': '3',
5419 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5420 'ExceptionHandling': '0',
5422 'VCLibrarianTool': {
5423 'AdditionalOptions': ['/ignore:4221'],
5424 'AdditionalLibraryDirectories': [
5425 '<(windows_sdk_path)/Lib/win8/um/x86',
5429 'AdditionalDependencies': [
5441 'AdditionalLibraryDirectories': [
5442 '<(windows_sdk_path)/Lib/win8/um/x86',
5444 'GenerateDebugInformation': 'true',
5445 'MapFileName': '$(OutDir)\\$(TargetName).map',
5446 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5447 'FixedBaseAddress': '1',
5450 # 1 == /SUBSYSTEM:CONSOLE
5451 # 2 == /SUBSYSTEM:WINDOWS
5452 # Most of the executables we'll ever create are tests
5453 # and utilities with console output.
5457 'GenerateStublessProxies': 'true',
5458 'TypeLibraryName': '$(InputName).tlb',
5459 'OutputDirectory': '$(IntDir)',
5460 'HeaderFileName': '$(InputName).h',
5461 'DLLDataFileName': '$(InputName).dlldata.c',
5462 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5463 'ProxyFileName': '$(InputName)_p.c',
5465 'VCResourceCompilerTool': {
5467 'AdditionalIncludeDirectories': [
5469 '<(SHARED_INTERMEDIATE_DIR)',
5472 'target_conditions': [
5473 ['_type=="executable"', {
5475 'EmbedManifest': 'true',
5478 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5480 'AdditionalManifestFiles': [
5481 '>(win_exe_compatibility_manifest)',
5488 # Building with Clang on Windows is a work in progress and very
5489 # experimental. See crbug.com/82385.
5490 'VCCLCompilerTool': {
5491 'WarnAsError': 'false',
5492 'RuntimeTypeInfo': 'false',
5493 'AdditionalOptions': [
5494 '-fmsc-version=1800',
5497 # Many files use intrinsics without including this header.
5498 # TODO(hans): Fix those files, or move this to sub-GYPs.
5501 # TODO(hans): Make this list shorter eventually.
5502 '-Qunused-arguments',
5503 '-Wno-c++11-compat-deprecated-writable-strings',
5504 '-Wno-deprecated-declarations',
5506 '-Wno-enum-conversion',
5507 '-Wno-extra-tokens',
5508 '-Wno-ignored-attributes',
5509 '-Wno-incompatible-pointer-types',
5510 '-Wno-int-to-void-pointer-cast',
5511 '-Wno-invalid-noreturn',
5512 '-Wno-logical-op-parentheses',
5514 '-Wno-missing-braces',
5515 '-Wno-missing-declarations',
5516 '-Wno-msvc-include',
5517 '-Wno-null-dereference',
5518 '-Wno-overloaded-virtual',
5520 '-Wno-pointer-sign',
5522 '-Wno-return-type-c-linkage',
5524 '-Wno-sometimes-uninitialized',
5526 '-Wno-tautological-compare',
5527 '-Wno-unknown-pragmas',
5529 '-Wno-unused-function',
5530 '-Wno-unused-private-field',
5531 '-Wno-unused-value',
5532 '-Wno-unused-variable',
5533 '-Wno-unused-local-typedef', # http://crbug.com/411648
5538 # ASan on Windows is a work in progress and very experimental.
5539 # See crbug.com/345874.
5540 'VCCLCompilerTool': {
5541 'AdditionalOptions': [
5542 '-fsanitize=address',
5544 'AdditionalIncludeDirectories': [
5545 # MSVC needs to be able to find the sanitizer headers when
5546 # invoked via /fallback. This is critical for using macros
5547 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5549 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/include_sanitizer',
5553 'AdditionalLibraryDirectories': [
5554 # TODO(hans): If make_clang_dir is absolute, this breaks.
5555 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/lib/windows',
5558 'target_conditions': [
5559 ['component=="shared_library"', {
5561 'AdditionalDependencies': [
5562 'clang_rt.asan_dynamic-i386.lib',
5563 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5567 ['_type=="executable" and component=="static_library"', {
5569 'AdditionalDependencies': [
5570 'clang_rt.asan-i386.lib',
5574 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5576 'AdditionalDependencies': [
5577 'clang_rt.asan_dll_thunk-i386.lib',
5587 ['disable_nacl==1', {
5588 'target_defaults': {
5594 ['OS=="win" and msvs_use_common_linker_extras', {
5595 'target_defaults': {
5610 'AdditionalOptions': [
5619 'AdditionalOptions': ['/largeaddressaware'],
5628 'AdditionalOptions': [
5629 # safeseh is not compatible with x64
5641 ['enable_new_npdevice_api==1', {
5642 'target_defaults': {
5644 'ENABLE_NEW_NPDEVICE_API',
5648 # Don't warn about the "typedef 'foo' locally defined but not used"
5649 # for gcc 4.8 and higher.
5650 # TODO: remove this flag once all builds work. See crbug.com/227506
5651 ['gcc_version>=48 and clang==0', {
5652 'target_defaults': {
5654 '-Wno-unused-local-typedefs',
5658 ['gcc_version>=48 and clang==0 and host_clang==1', {
5659 'target_defaults': {
5660 'target_conditions': [
5661 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5665 # In the android webview build, force host targets to be compiled with clang
5666 # as the hermetic host gcc is very old on some platforms. This is already
5667 # the default on the current development version of AOSP but we force it
5668 # here in case we need to compile against an older release version. We also
5669 # explicitly set it to false for target binaries to avoid causing problems
5670 # for the work to enable clang by default in AOSP.
5671 ['android_webview_build==1', {
5672 'target_defaults': {
5673 'target_conditions': [
5674 ['_toolset=="host"', {
5675 'aosp_build_settings': {
5676 'LOCAL_CLANG': 'true',
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 ['OS=="android" and clang==0', {
5716 # Hardcode the compiler names in the Makefile so that
5717 # it won't depend on the environment at make time.
5718 'make_global_settings': [
5719 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5720 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5721 ['CC.host', '<(host_cc)'],
5722 ['CXX.host', '<(host_cxx)'],
5725 ['OS=="linux" and target_arch=="mipsel"', {
5726 'make_global_settings': [
5727 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5728 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5729 ['CC.host', '<(host_cc)'],
5730 ['CXX.host', '<(host_cxx)'],
5733 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5734 # Set default ARM cross compiling on linux. These can be overridden
5735 # using CC/CXX/etc environment variables.
5736 'make_global_settings': [
5737 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5738 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5739 ['CC.host', '<(host_cc)'],
5740 ['CXX.host', '<(host_cxx)'],
5744 # TODO(yyanagisawa): supports GENERATOR==make
5745 # make generator doesn't support CC_wrapper without CC
5746 # in make_global_settings yet.
5747 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5748 'make_global_settings': [
5749 ['CC_wrapper', '<(gomadir)/gomacc'],
5750 ['CXX_wrapper', '<(gomadir)/gomacc'],
5751 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5752 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5756 'target_defaults': {
5757 'target_conditions': [
5758 ['_toolset=="target"', {
5761 '-ffat-lto-objects',
5767 ['use_lto==1 or use_lto_o2==1', {
5768 'target_defaults': {
5769 'target_conditions': [
5770 ['_toolset=="target"', {
5780 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5781 # This block adds *project-wide* configuration settings to each project
5782 # file. It's almost always wrong to put things here. Specify your
5783 # custom xcode_settings in target_defaults to add them to targets instead.
5786 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5787 # setting sets the SDK on a project-wide basis. In order to get the
5788 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5789 # here at the project level.
5792 ['mac_sdk_path==""', {
5793 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5795 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5801 ['ios_sdk_path==""', {
5803 # TODO(justincohen): Ninja only supports simulator for now.
5804 ['"<(GENERATOR)"=="xcode"', {
5805 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5807 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5811 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5816 # Target both iPhone and iPad.
5817 'TARGETED_DEVICE_FAMILY': '1,2',
5820 ['target_arch=="x64"', {
5825 ['target_arch=="ia32"', {
5834 # The Xcode generator will look for an xcode_settings section at the root
5835 # of each dict and use it to apply settings on a file-wide basis. Most
5836 # settings should not be here, they should be in target-specific
5837 # xcode_settings sections, or better yet, should use non-Xcode-specific
5838 # settings in target dicts. SYMROOT is a special case, because many other
5839 # Xcode variables depend on it, including variables such as
5840 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5841 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5842 # files to appear (when present) in the UI as actual files and not red
5843 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5844 # and therefore SYMROOT, needs to be set at the project level.
5845 'SYMROOT': '<(DEPTH)/xcodebuild',