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"', {
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 # This is set when building the Android WebView inside the Android
151 # build system, using the 'android' gyp backend. The WebView code is
152 # still built when this is unset, but builds using the normal chromium
154 'android_webview_build%': 0,
156 # This is set when building the Android WebView in ninja for the
158 'android_webview_telemetry_build%': 0,
160 # Set ARM architecture version.
163 # Use aurax11 for clipboard implementation. This is true on linux_aura.
164 'use_clipboard_aurax11%': 0,
168 # If no gomadir is set, it uses the default gomadir.
172 # The system root for cross-compiles. Default: none.
176 # The system libdir used for this ABI.
177 'system_libdir%': 'lib',
185 # Set default value of toolkit_views based on OS.
186 ['OS=="win" or chromeos==1 or use_aura==1', {
192 # Embedded builds use aura without ash or views.
199 # Enable HiDPI on Mac OS, Chrome OS and Windows.
200 ['OS=="mac" or chromeos==1 or OS=="win"', {
204 # Enable App Launcher everywhere but mobile.
205 ['OS!="ios" and OS!="android"', {
206 'enable_app_list%': 1,
208 'enable_app_list%': 0,
211 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
212 'use_default_render_theme%': 1,
214 'use_default_render_theme%': 0,
218 'use_ozone_evdev%': 1,
220 'use_ozone_evdev%': 0,
223 # Set default gomadir.
225 'gomadir': 'c:\\goma\\goma-win',
227 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
230 # Set the default "target_subarch" on iOS. Valid values are "arm32",
231 # "arm64" and "both" (meaning a fat binary).
233 # TODO(sdefresne): change the default from "arm32" to "both" for
234 # "target_subarch" once http://crbug.com/339477 is fixed.
236 # TODO(sdefresne): set the "target_arch" to "arm" once compilation
237 # of skia has been fixed for simulator. http://crbug.com/342377
239 'target_subarch%': 'arm32',
244 # Copy conditionally-set variables out one scope.
245 'chromeos%': '<(chromeos)',
246 'chromecast%': '<(chromecast)',
247 'host_arch%': '<(host_arch)',
248 'target_arch%': '<(target_arch)',
249 'target_subarch%': '<(target_subarch)',
250 'toolkit_views%': '<(toolkit_views)',
251 'desktop_linux%': '<(desktop_linux)',
252 'use_aura%': '<(use_aura)',
253 'use_ash%': '<(use_ash)',
254 'use_cras%': '<(use_cras)',
255 'use_ozone%': '<(use_ozone)',
256 'use_ozone_evdev%': '<(use_ozone_evdev)',
257 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
258 'embedded%': '<(embedded)',
259 'use_openssl%': '<(use_openssl)',
260 'use_openssl_certs%': '<(use_openssl_certs)',
261 'enable_viewport%': '<(enable_viewport)',
262 'enable_hidpi%': '<(enable_hidpi)',
263 'android_webview_build%': '<(android_webview_build)',
264 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
265 'use_goma%': '<(use_goma)',
266 'gomadir%': '<(gomadir)',
267 'enable_app_list%': '<(enable_app_list)',
268 'use_default_render_theme%': '<(use_default_render_theme)',
269 'buildtype%': '<(buildtype)',
270 'branding%': '<(branding)',
271 'arm_version%': '<(arm_version)',
272 'sysroot%': '<(sysroot)',
273 'chroot_cmd%': '<(chroot_cmd)',
274 'system_libdir%': '<(system_libdir)',
276 # Set to 1 to enable fast builds. Set to 2 for even faster builds
277 # (it disables debug info for fastest compilation - only for use
278 # on compile-only bots).
281 # Set to 1 to not store any build metadata (this isn't working yet but
282 # this flag will help us to get there). See http://crbug.com/314403.
283 # TODO(sebmarchand): Update this comment once this flag guarantee that
284 # there's no build metadata in the build artifacts.
285 'dont_embed_build_metadata%': 0,
287 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
288 # This is useful for parallel compilation tools which can't support /Zi.
289 # Only used on Windows.
292 # Set to 1 to enable dcheck in release.
293 'dcheck_always_on%': 0,
295 # Set to 1 to make a build that disables unshipped tracing events.
296 # Note: this setting is ignored if buildtype=="Official".
297 'tracing_like_official_build%': 0,
299 # Disable image loader component extension by default.
300 'image_loader_extension%': 0,
302 # Set NEON compilation flags.
305 # Detect NEON support at run-time.
306 'arm_neon_optional%': 0,
308 # Use libjpeg-turbo as the JPEG codec used by Chromium.
309 'use_libjpeg_turbo%': 1,
311 # Use system libjpeg. Note that the system's libjepg will be used even if
312 # use_libjpeg_turbo is set.
313 'use_system_libjpeg%': 0,
315 # By default, component is set to static_library and it can be overriden
316 # by the GYP command line or by ~/.gyp/include.gypi.
317 'component%': 'static_library',
319 # Set to select the Title Case versions of strings in GRD files.
320 'use_titlecase_in_grd_files%': 0,
322 # Use translations provided by volunteers at launchpad.net. This
323 # currently only works on Linux.
324 'use_third_party_translations%': 0,
326 # Remoting compilation is enabled by default. Set to 0 to disable.
329 # Configuration policy is enabled by default. Set to 0 to disable.
330 'configuration_policy%': 1,
332 # Variable safe_browsing is used to control the build time configuration
333 # for safe browsing feature. Safe browsing can be compiled in 3 different
334 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
335 # reporting features without enabling phishing and malware detection. This
336 # is useful to integrate a third party phishing/malware detection to
337 # existing safe browsing logic.
340 # Web speech is enabled by default. Set to 0 to disable.
341 'enable_web_speech%': 1,
343 # Notifications are compiled in by default. Set to 0 to disable.
344 'notifications%' : 1,
346 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
347 # regular builds and 1 for ASan builds.
348 'mac_want_real_dsym%': 'default',
350 # If this is set, the clang plugins used on the buildbot will be used.
351 # Run tools/clang/scripts/update.sh to make sure they are compiled.
352 # This causes 'clang_chrome_plugins_flags' to be set.
353 # Has no effect if 'clang' is not set as well.
354 'clang_use_chrome_plugins%': 1,
356 # Enable building with ASAN (Clang's -fsanitize=address option).
357 # -fsanitize=address only works with clang, but asan=1 implies clang=1
358 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
360 # Enable coverage gathering instrumentation in ASan. This flag also
361 # controls coverage granularity (1 for function-level coverage, 2 for
362 # block-level coverage).
365 # Enable Chromium overrides of the default configurations for various
366 # dynamic tools (like ASan).
367 'use_sanitizer_options%': 1,
369 # Enable building with SyzyAsan.
370 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
373 # Enable building with LSan (Clang's -fsanitize=leak option).
374 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
375 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
378 # Enable building with TSan (Clang's -fsanitize=thread option).
379 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
380 # See http://clang.llvm.org/docs/ThreadSanitizer.html
382 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
384 # Enable building with MSan (Clang's -fsanitize=memory option).
385 # MemorySanitizer only works with clang, but msan=1 implies clang=1
386 # See http://clang.llvm.org/docs/MemorySanitizer.html
388 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
389 # Track where uninitialized memory originates from. From fastest to
390 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
391 # - track the chain of stores leading from allocation site to use site.
392 'msan_track_origins%': 1,
394 # Enable building with UBSan (Clang's -fsanitize=undefined option).
395 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
396 # See http://clang.llvm.org/docs/UsersManual.html
399 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
400 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
402 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan_vptr/blacklist.txt',
404 # Use the dynamic libraries instrumented by one of the sanitizers
405 # instead of the standard system libraries.
406 'use_instrumented_libraries%': 0,
408 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
409 # stdlibc++ as standard library. This is intended to use for instrumented
411 'use_custom_libcxx%': 0,
413 # Use a modified version of Clang to intercept allocated types and sizes
414 # for allocated objects. clang_type_profiler=1 implies clang=1.
415 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
416 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
417 'clang_type_profiler%': 0,
419 # Set to true to instrument the code with function call logger.
420 # See src/third_party/cygprofile/cyg-profile.cc for details.
421 'order_profiling%': 0,
423 # Use the provided profiled order file to link Chrome image with it.
424 # This makes Chrome faster by better using CPU cache when executing code.
425 # This is known as PGO (profile guided optimization).
426 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
427 'order_text_section%' : "",
429 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
430 # libraries on linux x86-64 and arm, plus ASLR.
433 # Whether one-click signin is enabled or not.
434 'enable_one_click_signin%': 0,
436 # Whether to back up data before sync.
437 'enable_pre_sync_backup%': 0,
439 # Enable Chrome browser extensions
440 'enable_extensions%': 1,
443 'enable_google_now%': 1,
445 # Enable printing support and UI. This variable is used to configure
446 # which parts of printing will be built. 0 disables printing completely,
447 # 1 enables it fully, and 2 enables only the codepath to generate a
448 # Metafile (e.g. usually a PDF or EMF) and disables print preview, cloud
450 'enable_printing%': 1,
452 # Windows prints using a PDF as the metafile from the renderer.
453 'win_pdf_metafile_for_printing%': 1,
455 # Set the version of CLD.
456 # 0: Don't specify the version. This option is for the Finch testing.
461 # For CLD2, the size of the tables that should be included in the build
462 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
464 # See third_party/cld_2/cld_2.gyp for more information.
465 # 0: Small tables, lower accuracy
466 # 1: Medium tables, medium accuracy
467 # 2: Large tables, high accuracy
468 'cld2_table_size%': 2,
470 # The data acquisition mode for CLD2. Possible values are:
471 # static: CLD2 data is statically linked to the executable.
472 # standalone: CLD2 data is provided in a standalone file that is
473 # bundled with the executable.
474 # component: CLD2 data is provided as a Chrome "component" and is
475 # downloaded via the component updater.
477 # For more information on switching the CLD2 data source, see:
478 # https://sites.google.com/a/chromium.org/dev/developers/how-tos/compact-language-detector-cld-data-source-configuration
480 # This string will be exposed in chrome://translate-internals under the
481 # heading "CLD Data Source". This allows easy determination of which
482 # data source the browser was built with.
483 'cld2_data_source%': 'static',
485 # Enable spell checker.
486 'enable_spellcheck%': 1,
488 # Webrtc compilation is enabled by default. Set to 0 to disable.
491 # Enables use of the session service, which is enabled by default.
492 # Support for disabling depends on the platform.
493 'enable_session_service%': 1,
495 # Enables theme support, which is enabled by default. Support for
496 # disabling depends on the platform.
499 # Enables autofill dialog and associated features; disabled by default.
500 'enable_autofill_dialog%' : 0,
502 # Defaults Wallet integration in Autofill dialog to use production
503 # servers. Unofficial builds won't have the proper API keys.
504 'enable_prod_wallet_service%': 0,
506 # Enables support for background apps.
507 'enable_background%': 1,
509 # Enable the task manager by default.
510 'enable_task_manager%': 1,
512 # Enables used resource whitelist generation; disabled by default.
513 'enable_resource_whitelist_generation%': 0,
515 # Enable FILE support by default.
516 'disable_file_support%': 0,
518 # Enable FTP support by default.
519 'disable_ftp_support%': 0,
521 # Use native android functions in place of ICU. Not supported by most
523 'use_icu_alternatives_on_android%': 0,
525 # XInput2 multitouch support is enabled by default (use_xi2_mt=2).
526 # Setting to zero value disables XI2 MT. When XI2 MT is enabled,
527 # the input value also defines the required XI2 minor minimum version.
528 # For example, use_xi2_mt=2 means XI2.2 or above version is required.
531 # Use of precompiled headers on Windows.
533 # This variable may be explicitly set to 1 (enabled) or 0
534 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
535 # This setting will override the default.
538 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
540 'chromium_win_pch%': 0,
542 # Set this to true when building with Clang.
543 # See http://code.google.com/p/chromium/wiki/Clang for details.
546 # Enable plug-in installation by default.
547 'enable_plugin_installation%': 1,
549 # Specifies whether to use canvas_skia.cc in place of platform
550 # specific implementations of gfx::Canvas. Affects text drawing in the
552 # TODO(asvitkine): Enable this on all platforms and delete this flag.
553 # http://crbug.com/105550
554 'use_canvas_skia%': 0,
556 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
557 # with one of those tools.
558 'build_for_tool%': '',
560 # If no directory is specified then a temporary directory will be used.
561 'test_isolation_outdir%': '',
562 # True if isolate should fail if the isolate files refer to files
564 'test_isolation_fail_on_missing': 0,
566 'wix_path%': '<(DEPTH)/third_party/wix',
568 # Managed users are enabled by default.
569 'enable_managed_users%': 1,
571 # Platform natively supports discardable memory.
572 'native_discardable_memory%': 0,
574 # Platform sends memory pressure signals natively.
575 'native_memory_pressure_signals%': 0,
577 'data_reduction_fallback_host%' : '',
578 'data_reduction_dev_host%' : '',
579 'spdy_proxy_auth_origin%' : '',
580 'spdy_proxy_auth_property%' : '',
581 'spdy_proxy_auth_value%' : '',
582 'data_reduction_proxy_probe_url%' : '',
583 'data_reduction_proxy_warmup_url%' : '',
584 'data_reduction_proxy_ssl_origin%' : '',
585 'data_reduction_proxy_alt_origin%' : '',
586 'data_reduction_proxy_alt_fallback_origin%' : '',
588 'enable_service_discovery%': 0,
589 'enable_wifi_bootstrapping%': 0,
590 'enable_hangout_services_extension%': 0,
592 # Enable the Syzygy optimization step.
593 'syzygy_optimize%': 0,
595 # Enable hole punching for the protected video.
598 # Automatically select platforms under ozone. Turn this off to
599 # build only explicitly selected platforms.
600 'ozone_auto_platforms%': 1,
603 # A flag for POSIX platforms
610 # A flag for BSD platforms
611 ['OS=="freebsd" or OS=="openbsd"', {
618 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
624 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
625 # OpenSSL's certificate definition.
626 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
627 'use_openssl_certs%': 1,
629 'use_openssl_certs%': 0,
632 # libudev usage. This currently only affects the content layer.
633 ['OS=="linux" and embedded==0', {
639 # Flags to use X11 on non-Mac POSIX platforms.
640 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
647 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
653 # Flags to use pango and cairo.
654 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
663 ['OS=="linux" and embedded==0', {
669 # We always use skia text rendering in Aura on Windows, since GDI
670 # doesn't agree with our BackingStore.
671 # TODO(beng): remove once skia text rendering is on by default.
672 ['use_aura==1 and OS=="win"', {
673 'enable_skia_text%': 1,
676 # A flag to enable or disable our compile-time dependency
677 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
678 # support will be available. This option is useful
679 # for Linux distributions and for Aura.
680 ['OS!="linux" or chromeos==1', {
681 'use_gnome_keyring%': 0,
683 'use_gnome_keyring%': 1,
686 ['OS=="mac" or OS=="ios"', {
687 # Mac and iOS want Title Case strings
688 'use_titlecase_in_grd_files%': 1,
691 # Enable loader extensions on Chrome OS.
693 'image_loader_extension%': 1,
695 'image_loader_extension%': 0,
698 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
699 'enable_one_click_signin%': 1,
700 'enable_pre_sync_backup%': 1,
704 'enable_extensions%': 0,
705 'enable_google_now%': 0,
707 'enable_spellcheck%': 0,
711 'arm_neon_optional%': 1,
712 'native_discardable_memory%': 1,
713 'native_memory_pressure_signals%': 1,
714 'enable_printing%': 2,
715 'enable_task_manager%':0,
716 # Set to 1 once we have a notification system for Android.
717 # http://crbug.com/115320
722 # Android OS includes support for proprietary codecs regardless of
723 # building Chromium or Google Chrome. We also ship Google Chrome and
724 # Chromecast with proprietary codecs.
725 ['OS=="android" or branding=="Chrome" or chromecast==1', {
726 'proprietary_codecs%': 1,
728 'proprietary_codecs%': 0,
731 ['OS=="mac" or OS=="ios"', {
732 'native_discardable_memory%': 1,
733 'native_memory_pressure_signals%': 1,
736 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
737 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
738 'enable_autofill_dialog%': 1,
741 ['buildtype=="Official"', {
742 'enable_prod_wallet_service%': 1,
752 'disable_ftp_support%': 1,
753 'enable_extensions%': 0,
754 'enable_google_now%': 0,
756 'enable_printing%': 0,
757 'enable_session_service%': 0,
763 'enable_managed_users%': 0,
764 'enable_task_manager%': 0,
767 # Use GPU accelerated cross process image transport by default
768 # on linux builds with the Aura window manager
769 ['use_aura==1 and OS=="linux"', {
770 'ui_compositor_image_transport%': 1,
772 'ui_compositor_image_transport%': 0,
775 # Turn precompiled headers on by default.
776 ['OS=="win" and buildtype!="Official"', {
777 'chromium_win_pch%': 1
780 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
781 'enable_plugin_installation%': 0,
783 'enable_plugin_installation%': 1,
786 # Whether PPAPI is enabled.
787 ['OS=="android" or OS=="ios" or embedded==1', {
788 'enable_plugins%': 0,
790 'enable_plugins%': 1,
793 # linux_use_bundled_gold: whether to use the gold linker binary checked
794 # into third_party/binutils. Force this off via GYP_DEFINES when you
795 # are using a custom toolchain and need to control -B in ldflags.
796 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
797 # for component=static_library builds.
798 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
799 'linux_use_bundled_gold%': 1,
801 'linux_use_bundled_gold%': 0,
804 # linux_use_bundled_binutils: whether to use the binary binutils
805 # checked into third_party/binutils. These are not multi-arch so cannot
806 # be used except on x86 and x86-64 (the only two architectures which
807 # are currently checke in). Force this off via GYP_DEFINES when you
808 # are using a custom toolchain and need to control -B in cflags.
809 ['OS=="linux" and (target_arch=="x64")', {
810 'linux_use_bundled_binutils%': 1,
812 'linux_use_bundled_binutils%': 0,
815 # linux_use_gold_flags: whether to use build flags that rely on gold.
816 # On by default for x64 Linux.
817 ['OS=="linux" and target_arch=="x64"', {
818 'linux_use_gold_flags%': 1,
820 'linux_use_gold_flags%': 0,
823 # linux_use_debug_fission: whether to use split DWARF debug info
824 # files. This can reduce link time significantly, but is incompatible
825 # with some utilities such as icecc and ccache. Requires gold and
826 # gcc >= 4.8 or clang.
827 # http://gcc.gnu.org/wiki/DebugFission
828 ['OS=="linux" and target_arch=="x64"', {
829 'linux_use_debug_fission%': 1,
831 'linux_use_debug_fission%': 0,
834 ['OS=="android" or OS=="ios"', {
835 'enable_captive_portal_detection%': 0,
837 'enable_captive_portal_detection%': 1,
840 # Enable Skia UI text drawing incrementally on different platforms.
841 # http://crbug.com/105550
843 # On Aura, this allows per-tile painting to be used in the browser
846 'use_canvas_skia%': 1,
850 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
851 'use_libjpeg_turbo%': 0,
855 # When building as part of the Android system, use system libraries
856 # where possible to reduce ROM size.
857 'use_system_libjpeg%': '<(android_webview_build)',
860 # Do not enable the Settings App on ChromeOS.
861 ['enable_app_list==1 and chromeos==0', {
862 'enable_settings_app%': 1,
864 'enable_settings_app%': 0,
867 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
868 # Set some defaults for arm/linux chrome builds
869 'use_allocator%': 'none',
870 # sysroot needs to be an absolute path otherwise it generates
871 # incorrect results when passed to pkg-config
872 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot',
873 }], # OS=="linux" and target_arch=="arm" and chromeos==0
875 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
877 ['target_arch=="x64"', {
878 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
880 ['target_arch=="ia32"', {
881 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
884 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
886 ['OS=="linux" and target_arch=="mipsel"', {
887 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
888 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
891 # Whether tests targets should be run, archived or just have the
892 # dependencies verified. All the tests targets have the '_run' suffix,
893 # e.g. base_unittests_run runs the target base_unittests. The test
894 # target always calls tools/swarming_client/isolate.py. See the script's
895 # --help for more information and the valid --mode values. Meant to be
896 # overriden with GYP_DEFINES.
897 # TODO(maruel): Remove the conditions as more configurations are
899 # NOTE: The check for disable_nacl==0 and component=="static_library"
900 # can't be used here because these variables are not defined yet, but it
901 # is still not supported.
902 ['OS!="ios" and OS!="android" and chromeos==0', {
903 'test_isolation_mode%': 'check',
905 'test_isolation_mode%': 'noop',
907 # Whether Android build uses OpenMAX DL FFT.
908 ['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")', {
909 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
910 # When enabled, this will also enable WebAudio support on
911 # Android for these architectures. Default is enabled. Whether
912 # WebAudio is actually available depends on runtime settings
914 'use_openmax_dl_fft%': 1,
916 'use_openmax_dl_fft%': 0,
918 ['OS=="win" or OS=="linux"', {
922 # Turns on compiler optimizations in V8 in Debug build, except
923 # on android_clang, where we're hitting a weird linker error.
924 # TODO(dpranke): http://crbug.com/266155 .
926 'v8_optimized_debug%': 1,
928 'v8_optimized_debug%': 2,
931 # Disable various features by default on embedded.
934 'enable_printing%': 0,
937 # By default, use ICU data file (icudtl.dat) on all platforms
938 # except when building Android WebView or Chromecast.
939 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
940 # Set the data reduction proxy origin for Android Webview.
941 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0', {
942 'icu_use_data_file_flag%' : 1,
943 'spdy_proxy_auth_origin%': '',
944 'data_reduction_proxy_probe_url%': '',
945 'data_reduction_proxy_warmup_url%': '',
946 'data_reduction_dev_host%': '',
947 'data_reduction_fallback_host%': '',
949 'icu_use_data_file_flag%' : 0,
950 'spdy_proxy_auth_origin%': 'https://proxy.googlezip.net:443/',
951 'data_reduction_proxy_probe_url%': 'http://check.googlezip.net/connect',
952 'data_reduction_proxy_warmup_url%': 'http://www.gstatic.com/generate_204',
953 'data_reduction_dev_host%': 'http://proxy-dev.googlezip.net:80/',
954 'data_reduction_fallback_host%': 'http://compress.googlezip.net:80/',
956 ['OS=="win" or OS=="mac"', {
957 'enable_wifi_bootstrapping%' : 1,
960 # Path to sas.dll, which provides the SendSAS function.
961 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
962 ['target_arch=="x64"', {
963 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
965 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
969 # Set this to 1 to enable use of concatenated impulse responses
970 # for the HRTF panner in WebAudio.
971 'use_concatenated_impulse_responses': 1,
973 # You can set the variable 'use_official_google_api_keys' to 1
974 # to use the Google-internal file containing official API keys
975 # for Google Chrome even in a developer build. Setting this
976 # variable explicitly to 1 will cause your build to fail if the
977 # internal file is missing.
979 # The variable is documented here, but not handled in this file;
980 # see //google_apis/determine_use_official_keys.gypi for the
983 # Set the variable to 0 to not use the internal file, even when
984 # it exists in your checkout.
986 # Leave it unset in your include.gypi to have the variable
987 # implicitly set to 1 if you have
988 # src/google_apis/internal/google_chrome_api_keys.h in your
989 # checkout, and implicitly set to 0 if not.
991 # Note that official builds always behave as if the variable
992 # was explicitly set to 1, i.e. they always use official keys,
993 # and will fail to build if the internal file is missing.
995 # NOTE: You MUST NOT explicitly set the variable to 2 in your
996 # include.gypi or by other means. Due to subtleties of GYP, this
997 # is not the same as leaving the variable unset, even though its
999 # //google_apis/determine_use_official_keys.gypi is 2.
1001 # Set these to bake the specified API keys and OAuth client
1002 # IDs/secrets into your build.
1004 # If you create a build without values baked in, you can instead
1005 # set environment variables to provide the keys at runtime (see
1006 # src/google_apis/google_api_keys.h for details). Features that
1007 # require server-side APIs may fail to work if no keys are
1010 # Note that if you are building an official build or if
1011 # use_official_google_api_keys has been set to 1 (explicitly or
1012 # implicitly), these values will be ignored and the official
1013 # keys will be used instead.
1014 'google_api_key%': '',
1015 'google_default_client_id%': '',
1016 'google_default_client_secret%': '',
1017 # Native Client is enabled by default.
1018 'disable_nacl%': '0',
1021 # Copy conditionally-set variables out one scope.
1022 'branding%': '<(branding)',
1023 'buildtype%': '<(buildtype)',
1024 'target_arch%': '<(target_arch)',
1025 'target_subarch%': '<(target_subarch)',
1026 'host_arch%': '<(host_arch)',
1027 'toolkit_views%': '<(toolkit_views)',
1028 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1029 'use_aura%': '<(use_aura)',
1030 'use_ash%': '<(use_ash)',
1031 'use_cras%': '<(use_cras)',
1032 'use_openssl%': '<(use_openssl)',
1033 'use_openssl_certs%': '<(use_openssl_certs)',
1034 'use_nss%': '<(use_nss)',
1035 'use_udev%': '<(use_udev)',
1036 'os_bsd%': '<(os_bsd)',
1037 'os_posix%': '<(os_posix)',
1038 'use_dbus%': '<(use_dbus)',
1039 'use_glib%': '<(use_glib)',
1040 'use_pango%': '<(use_pango)',
1041 'use_cairo%': '<(use_cairo)',
1042 'use_ozone%': '<(use_ozone)',
1043 'use_ozone_evdev%': '<(use_ozone_evdev)',
1044 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1045 'desktop_linux%': '<(desktop_linux)',
1046 'use_x11%': '<(use_x11)',
1047 'use_gnome_keyring%': '<(use_gnome_keyring)',
1048 'linux_fpic%': '<(linux_fpic)',
1049 'chromeos%': '<(chromeos)',
1050 'chromecast%': '<(chromecast)',
1051 'enable_viewport%': '<(enable_viewport)',
1052 'enable_hidpi%': '<(enable_hidpi)',
1053 'use_xi2_mt%':'<(use_xi2_mt)',
1054 'image_loader_extension%': '<(image_loader_extension)',
1055 'fastbuild%': '<(fastbuild)',
1056 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1057 'win_z7%': '<(win_z7)',
1058 'dcheck_always_on%': '<(dcheck_always_on)',
1059 'tracing_like_official_build%': '<(tracing_like_official_build)',
1060 'arm_version%': '<(arm_version)',
1061 'arm_neon%': '<(arm_neon)',
1062 'arm_neon_optional%': '<(arm_neon_optional)',
1063 'sysroot%': '<(sysroot)',
1064 'chroot_cmd%': '<(chroot_cmd)',
1065 'system_libdir%': '<(system_libdir)',
1066 'component%': '<(component)',
1067 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1068 'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
1069 'use_third_party_translations%': '<(use_third_party_translations)',
1070 'remoting%': '<(remoting)',
1071 'enable_one_click_signin%': '<(enable_one_click_signin)',
1072 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1073 'enable_webrtc%': '<(enable_webrtc)',
1074 'chromium_win_pch%': '<(chromium_win_pch)',
1075 'configuration_policy%': '<(configuration_policy)',
1076 'safe_browsing%': '<(safe_browsing)',
1077 'enable_web_speech%': '<(enable_web_speech)',
1078 'notifications%': '<(notifications)',
1079 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1080 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1082 'asan_coverage%': '<(asan_coverage)',
1083 'use_sanitizer_options%': '<(use_sanitizer_options)',
1084 'syzyasan%': '<(syzyasan)',
1085 'syzygy_optimize%': '<(syzygy_optimize)',
1088 'msan_blacklist%': '<(msan_blacklist)',
1089 'msan_track_origins%': '<(msan_track_origins)',
1091 'tsan_blacklist%': '<(tsan_blacklist)',
1092 'ubsan%': '<(ubsan)',
1093 'ubsan_vptr%': '<(ubsan_vptr)',
1094 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1095 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1096 'use_custom_libcxx%': '<(use_custom_libcxx)',
1097 'clang_type_profiler%': '<(clang_type_profiler)',
1098 'order_profiling%': '<(order_profiling)',
1099 'order_text_section%': '<(order_text_section)',
1100 'enable_extensions%': '<(enable_extensions)',
1101 'enable_plugin_installation%': '<(enable_plugin_installation)',
1102 'enable_plugins%': '<(enable_plugins)',
1103 'enable_session_service%': '<(enable_session_service)',
1104 'enable_themes%': '<(enable_themes)',
1105 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1106 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1107 'enable_background%': '<(enable_background)',
1108 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1109 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1110 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1111 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1112 'use_canvas_skia%': '<(use_canvas_skia)',
1113 'test_isolation_mode%': '<(test_isolation_mode)',
1114 'test_isolation_outdir%': '<(test_isolation_outdir)',
1115 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1116 'enable_printing%': '<(enable_printing)',
1117 'win_pdf_metafile_for_printing%': '<(win_pdf_metafile_for_printing)',
1118 'enable_spellcheck%': '<(enable_spellcheck)',
1119 'enable_google_now%': '<(enable_google_now)',
1120 'cld_version%': '<(cld_version)',
1121 'cld2_table_size%': '<(cld2_table_size)',
1122 'cld2_data_source%': '<(cld2_data_source)',
1123 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1124 'disable_file_support%': '<(disable_file_support)',
1125 'disable_ftp_support%': '<(disable_ftp_support)',
1126 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1127 'enable_task_manager%': '<(enable_task_manager)',
1128 'sas_dll_path%': '<(sas_dll_path)',
1129 'wix_path%': '<(wix_path)',
1130 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1131 'use_system_libjpeg%': '<(use_system_libjpeg)',
1132 'android_webview_build%': '<(android_webview_build)',
1133 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
1134 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1135 'gyp_managed_install%': 0,
1136 'create_standalone_apk%': 1,
1137 'enable_app_list%': '<(enable_app_list)',
1138 'use_default_render_theme%': '<(use_default_render_theme)',
1139 'enable_settings_app%': '<(enable_settings_app)',
1140 'google_api_key%': '<(google_api_key)',
1141 'google_default_client_id%': '<(google_default_client_id)',
1142 'google_default_client_secret%': '<(google_default_client_secret)',
1143 'enable_managed_users%': '<(enable_managed_users)',
1144 'native_discardable_memory%': '<(native_discardable_memory)',
1145 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1146 'data_reduction_fallback_host%': '<(data_reduction_fallback_host)',
1147 'data_reduction_dev_host%': '<(data_reduction_dev_host)',
1148 'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)',
1149 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1150 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1151 'data_reduction_proxy_probe_url%': '<(data_reduction_proxy_probe_url)',
1152 'data_reduction_proxy_warmup_url%': '<(data_reduction_proxy_warmup_url)',
1153 'data_reduction_proxy_ssl_origin%' : '<(data_reduction_proxy_ssl_origin)',
1154 'data_reduction_proxy_alt_origin%' : '<(data_reduction_proxy_alt_origin)',
1155 'data_reduction_proxy_alt_fallback_origin%' : '<(data_reduction_proxy_alt_fallback_origin)',
1156 'enable_mdns%' : '<(enable_mdns)',
1157 'enable_service_discovery%' : '<(enable_service_discovery)',
1158 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1159 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1160 'v8_optimized_debug%': '<(v8_optimized_debug)',
1161 'proprietary_codecs%': '<(proprietary_codecs)',
1162 'use_goma%': '<(use_goma)',
1163 'gomadir%': '<(gomadir)',
1164 'video_hole%': '<(video_hole)',
1166 # Use system protobuf instead of bundled one.
1167 'use_system_protobuf%': 0,
1169 # Use system yasm instead of bundled one.
1170 'use_system_yasm%': 0,
1172 # Use system ICU instead of bundled one.
1173 'use_system_icu%' : 0,
1175 # Default to enabled PIE; this is important for ASLR but we may need to be
1176 # able to turn it off for various reasons.
1177 'linux_disable_pie%': 0,
1179 # The release channel that this build targets. This is used to restrict
1180 # channel-specific build options, like which installer packages to create.
1181 # The default is 'all', which does no channel-specific filtering.
1184 # Override chromium_mac_pch and set it to 0 to suppress the use of
1185 # precompiled headers on the Mac. Prefix header injection may still be
1186 # used, but prefix headers will not be precompiled. This is useful when
1187 # using distcc to distribute a build to compile slaves that don't
1188 # share the same compiler executable as the system driving the compilation,
1189 # because precompiled headers rely on pointers into a specific compiler
1190 # executable's image. Setting this to 0 is needed to use an experimental
1191 # Linux-Mac cross compiler distcc farm.
1192 'chromium_mac_pch%': 1,
1194 # The default value for mac_strip in target_defaults. This cannot be
1195 # set there, per the comment about variable% in a target_defaults.
1196 'mac_strip_release%': 0,
1198 # Set to 1 to enable java code coverage. Instruments classes during build
1199 # to produce .ec files during runtime.
1200 'emma_coverage%': 0,
1202 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1203 # separated with whitespace and/or comma. Only has effect if
1204 # 'emma_coverage=1'.
1207 # Set to 1 to enable running Android lint on java/class files.
1210 # Although base/allocator lets you select a heap library via an
1211 # environment variable, the libcmt shim it uses sometimes gets in
1212 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1213 # 'win_use_allocator_shim': 0,
1214 # 'win_release_RuntimeLibrary': 2
1215 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1216 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1218 # TODO(bradnelson): eliminate this when possible.
1219 # To allow local gyp files to prevent release.vsprops from being included.
1220 # Yes(1) means include release.vsprops.
1221 # Once all vsprops settings are migrated into gyp, this can go away.
1222 'msvs_use_common_release%': 1,
1224 # TODO(bradnelson): eliminate this when possible.
1225 # To allow local gyp files to override additional linker options for msvs.
1226 # Yes(1) means set use the common linker options.
1227 'msvs_use_common_linker_extras%': 1,
1229 # TODO(sgk): eliminate this if possible.
1230 # It would be nicer to support this via a setting in 'target_defaults'
1231 # in chrome/app/locales/locales.gypi overriding the setting in the
1232 # 'Debug' configuration in the 'target_defaults' dict below,
1233 # but that doesn't work as we'd like.
1234 'msvs_debug_link_incremental%': '2',
1236 # Needed for some of the largest modules.
1237 'msvs_debug_link_nonincremental%': '1',
1239 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1240 # to get incremental linking to be faster in debug builds.
1241 'incremental_chrome_dll%': '0',
1243 # Experimental setting to break chrome.dll into multiple pieces based on
1245 'chrome_multiple_dll%': '0',
1247 # Experimental setting to optimize Chrome's DLLs with PGO.
1248 'chrome_pgo_phase%': '0',
1251 'clang%': '<(clang)',
1252 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
1254 # Control which version of clang to use when building for iOS. If set to
1255 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1256 # the version of clang that ships with the Chromium source. This variable
1257 # is automatically set to '1' when using the Xcode generator.
1260 # These two variables can be set in GYP_DEFINES while running
1261 # |gclient runhooks| to let clang run a plugin in every compilation.
1262 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1264 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1267 'clang_add_plugin%': '',
1269 # Tell ld64 to write map files describing binary layout. Useful
1270 # for looking at what contributes to binary size, e.g. with
1271 # https://github.com/nico/bloat
1272 'mac_write_linker_maps%': 0,
1274 # The default type of gtest.
1275 'gtest_target_type%': 'executable',
1277 # Enable sampling based profiler.
1278 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1280 # Profile without optimizing out stack frames when profiling==1.
1281 'profiling_full_stack_frames%': '0',
1283 # And if we want to dump symbols for Breakpad-enabled builds.
1284 'linux_dump_symbols%': 0,
1285 # And if we want to strip the binary after dumping symbols.
1286 'linux_strip_binary%': 0,
1287 # If we want stack unwind support for backtrace().
1288 'debug_unwind_tables%': 1,
1289 'release_unwind_tables%': 1,
1291 # Override where to find binutils
1292 'binutils_version%': 0,
1293 'binutils_dir%': '',
1296 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1297 'use_allocator%': 'tcmalloc',
1299 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1300 'linux_link_gnome_keyring%': 0,
1301 # Set to 1 to link against gsettings APIs instead of using dlopen().
1302 'linux_link_gsettings%': 0,
1304 # Default arch variant for MIPS.
1305 'mips_arch_variant%': 'mips32r1',
1307 # Enable use of OpenMAX DL FFT routines.
1308 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1310 # Enable new NPDevice API.
1311 'enable_new_npdevice_api%': 0,
1313 # Enable EGLImage support in OpenMAX
1314 'enable_eglimage%': 1,
1316 # .gyp files or targets should set chromium_code to 1 if they build
1317 # Chromium-specific code, as opposed to external code. This variable is
1318 # used to control such things as the set of warnings to enable, and
1319 # whether warnings are treated as errors.
1320 'chromium_code%': 0,
1322 # Disable fatal linker warnings, similarly to how we make it possible
1323 # to disable -Werror (e.g. for different toolchain versions).
1324 'disable_fatal_linker_warnings%': 0,
1326 'release_valgrind_build%': 0,
1328 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1329 'enable_wexit_time_destructors%': 0,
1331 # Build libpeerconnection as a static library by default.
1332 'libpeer_target_type%': 'static_library',
1334 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1335 'internal_gles2_conform_tests%': 0,
1337 # Set to 1 to compile the filter fuzzer.
1338 'internal_filter_fuzzer%': 0,
1340 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1341 # so Cocoa is happy (http://crbug.com/20441).
1343 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1344 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1345 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1346 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1347 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1348 'vi', 'zh-CN', 'zh-TW',
1351 # Pseudo locales are special locales which are used for testing and
1352 # debugging. They don't get copied to the final app. For more info,
1353 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1360 # If debug_devtools is set to 1, JavaScript files for DevTools are
1361 # stored as is and loaded from disk. Otherwise, a concatenated file
1362 # is stored in resources.pak. It is still possible to load JS files
1363 # from disk by passing --debug-devtools cmdline switch.
1364 'debug_devtools%': 0,
1366 # The Java Bridge is not compiled in by default.
1369 # Code signing for iOS binaries. The bots need to be able to disable this.
1370 'chromium_ios_signing%': 1,
1372 # This flag is only used when disable_nacl==0 and disables all those
1373 # subcomponents which would require the installation of a native_client
1374 # untrusted toolchain.
1375 'disable_nacl_untrusted%': 0,
1377 # Disable Dart by default.
1380 # Copy out the setting of disable_nacl.
1381 'disable_nacl%': '<(disable_nacl)',
1383 # Portable Native Client is enabled by default.
1384 'disable_pnacl%': 0,
1386 # Whether to build full debug version for Debug configuration on Android.
1387 # Compared to full debug version, the default Debug configuration on Android
1388 # has no full v8 debug, has size optimization and linker gc section, so that
1389 # we can build a debug version with acceptable size and performance.
1390 'android_full_debug%': 0,
1392 # Sets the default version name and code for Android app, by default we
1393 # do a developer build.
1394 'android_app_version_name%': 'Developer Build',
1395 'android_app_version_code%': 0,
1397 # Contains data about the attached devices for gyp_managed_install.
1398 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1400 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1401 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1403 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1404 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1406 # Whether we are using the rlz library or not. Platforms like Android send
1407 # rlz codes for searches but do not use the library.
1410 # Turns on the i18n support in V8.
1411 'v8_enable_i18n_support': 1,
1413 # Compile d8 for the host toolset.
1414 'v8_toolset_for_d8': 'host',
1416 # Use the chromium skia by default.
1417 'use_system_skia%': '0',
1419 # Use brlapi from brltty for braille display support.
1422 # Relative path to icu.gyp from this file.
1423 'icu_gyp_path': '../third_party/icu/icu.gyp',
1425 # IPC fuzzer is disabled by default.
1426 'enable_ipc_fuzzer%': 0,
1429 # Force disable libstdc++ debug mode.
1430 'disable_glibcxx_debug%': 0,
1432 # Set to 1 to compile with MSE support for MPEG2 TS
1433 'enable_mpeg2ts_stream_parser%': 0,
1435 # Support ChromeOS touchpad gestures with ozone.
1436 'use_evdev_gestures%': 0,
1438 # Default ozone platform (if no --ozone-platform flag).
1439 'ozone_platform%': "",
1441 # Ozone platforms to include in the build.
1442 'ozone_platform_caca%': 0,
1443 'ozone_platform_dri%': 0,
1444 'ozone_platform_egltest%': 0,
1445 'ozone_platform_gbm%': 0,
1446 'ozone_platform_ozonex%': 0,
1447 'ozone_platform_test%': 0,
1449 # Chrome OS: whether to build ChromeVox from sources in the Chromium
1450 # repository rather than using precompiled JavaScript in
1451 # chrome/third_party/chromevox. This is still experimental.
1452 'use_migrated_chromevox%': 1,
1454 # Chrome OS: whether to also build the upcoming version of
1455 # ChromeVox, which can then be enabled via a command-line switch.
1456 'use_chromevox_next%': 0,
1459 # Enable the Syzygy optimization step for the official builds.
1460 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1461 'syzygy_optimize%': 1,
1463 'syzygy_optimize%': 0,
1465 # Get binutils version so we can enable debug fission if we can.
1466 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1468 # compiler_version doesn't work with clang
1469 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1470 # compiler_version works with clang.
1471 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1472 # that it takes effect here.
1473 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1474 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1476 # On Android we know the binutils version in the toolchain.
1478 'binutils_version%': 222,
1480 ['host_arch=="x64"', {
1481 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1483 ['host_arch=="ia32"', {
1484 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1486 # Our version of binutils in third_party/binutils
1487 ['linux_use_bundled_binutils==1', {
1488 'binutils_version%': 224,
1492 'binutils_version%': 0,
1494 # The version of GCC in use, set later in platforms that use GCC and have
1495 # not explicitly chosen to build with clang. Currently, this means all
1496 # platforms except Windows, Mac and iOS.
1497 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1498 # it takes effect here.
1499 ['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', {
1502 # We directly set the gcc versions since we know what we use.
1505 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1507 ['android_webview_build==1', {
1508 # Android WebView uses a hermetic toolchain even for host, so set it
1511 ['host_os=="mac"', {
1512 'host_gcc_version%': 42,
1514 'host_gcc_version%': 46,
1517 }, { # android_webview_build!=1
1518 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1522 'host_gcc_version%': 0,
1525 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1526 'windows_sdk_path%': '<(windows_sdk_default_path)',
1528 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
1530 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1531 'directx_sdk_path%': '<(directx_sdk_default_path)',
1533 'directx_sdk_path%': '$(DXSDK_DIR)',
1536 'windows_driver_kit_path%': '$(WDK_DIR)',
1538 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1540 ['target_arch=="mipsel"', {
1543 'nacl_untrusted_build%': 0,
1544 'use_allocator%': 'none',
1546 ['OS=="linux" and target_arch=="mipsel"', {
1547 'sysroot%': '<(sysroot)',
1550 # All Chrome builds have breakpad symbols, but only process the
1551 # symbols from official builds.
1552 ['(branding=="Chrome" and buildtype=="Official")', {
1553 'linux_dump_symbols%': 1,
1555 # Omit unwind support in official release builds to save space. We
1556 # can use breakpad for these builds.
1557 'release_unwind_tables%': 0,
1560 # For official builds, use a 64-bit linker to avoid running out
1561 # of address space. The buildbots should have a 64-bit kernel
1562 # and a 64-bit libc installed.
1563 ['host_arch=="ia32" and target_arch=="ia32"', {
1564 'linux_use_bundled_gold%': '1',
1565 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1570 }], # os_posix==1 and OS!="mac" and OS!="ios"
1573 'enable_background%': 0,
1574 'icu_use_data_file_flag%': 1,
1575 'enable_web_speech%': 0,
1576 'use_system_libxml%': 1,
1577 'use_system_sqlite%': 1,
1579 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1580 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1581 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1582 'uk', 'vi', 'zh-CN', 'zh-TW',
1585 # The Mac SDK is set for iOS builds and passed through to Mac
1586 # sub-builds. This allows the Mac sub-build SDK in an iOS build to be
1587 # overridden from the command line the same way it is for a Mac build.
1588 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py 10.6)',
1590 # iOS SDK and deployment target support. The |ios_sdk| value is left
1591 # blank so that when it is set in the project files it will be the
1592 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1593 # causes Xcode to spit out a warning for every single project file for
1594 # not using the "current" SDK.
1596 'ios_sdk_path%': '',
1597 'ios_deployment_target%': '6.0',
1600 # ios_product_name is set to the name of the .app bundle as it should
1602 ['branding=="Chrome"', {
1603 'ios_product_name%': 'Chrome',
1604 }, { # else: branding!="Chrome"
1605 'ios_product_name%': 'Chromium',
1607 ['branding=="Chrome" and buildtype=="Official"', {
1609 }, { # else: branding!="Chrome" or buildtype!="Official"
1615 # Location of Android NDK.
1618 # Unfortunately we have to use absolute paths to the SDK/NDK because
1619 # they're passed to ant which uses a different relative path from
1621 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1622 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1623 'android_host_arch%': '<!(uname -m)',
1624 # Android API-level of the SDK used for compilation.
1625 'android_sdk_version%': '20',
1626 'android_sdk_build_tools_version%': '20.0.0',
1627 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1629 # Copy conditionally-set variables out one scope.
1630 'android_ndk_root%': '<(android_ndk_root)',
1631 'android_sdk_root%': '<(android_sdk_root)',
1632 'android_sdk_version%': '<(android_sdk_version)',
1633 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1634 'host_os%': '<(host_os)',
1636 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1637 # Android SDK build tools (e.g. dx, aapt, aidl)
1638 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1640 # Android API level 14 is ICS (Android 4.0) which is the minimum
1641 # platform requirement for Chrome on Android, we use it for native
1644 ['target_arch == "ia32"', {
1645 'android_app_abi%': 'x86',
1646 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1647 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1648 'android_ndk_lib_dir%': 'usr/lib',
1649 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1651 ['target_arch == "x64"', {
1652 'android_app_abi%': 'x86_64',
1653 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1654 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-x86_64',
1655 'android_ndk_lib_dir%': 'usr/lib64',
1656 'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1658 ['target_arch=="arm"', {
1661 'android_app_abi%': 'armeabi',
1663 'android_app_abi%': 'armeabi-v7a',
1666 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1667 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1668 'android_ndk_lib_dir%': 'usr/lib',
1669 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1671 ['target_arch == "arm64"', {
1672 'android_app_abi%': 'arm64-v8a',
1673 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1674 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-arm64',
1675 'android_ndk_lib_dir%': 'usr/lib',
1676 'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1678 ['target_arch == "mipsel"', {
1679 'android_app_abi%': 'mips',
1680 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1681 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1682 'android_ndk_lib_dir%': 'usr/lib',
1683 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1687 # Copy conditionally-set variables out one scope.
1688 'android_app_abi%': '<(android_app_abi)',
1689 'android_gdbserver%': '<(android_gdbserver)',
1690 'android_ndk_root%': '<(android_ndk_root)',
1691 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1692 'android_sdk_root%': '<(android_sdk_root)',
1693 'android_sdk_version%': '<(android_sdk_version)',
1694 'android_toolchain%': '<(android_toolchain)',
1696 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1697 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1698 'android_sdk_tools%': '<(android_sdk_tools)',
1699 'android_sdk%': '<(android_sdk)',
1700 'android_sdk_jar%': '<(android_sdk)/android.jar',
1702 'android_stlport_root': '<(android_stlport_root)',
1703 'android_stlport_include': '<(android_stlport_root)/stlport',
1704 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1705 'host_os%': '<(host_os)',
1707 # Location of the "objcopy" binary, used by both gyp and scripts.
1708 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1710 # Location of the "strip" binary, used by both gyp and scripts.
1711 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1713 # Location of the "readelf" binary.
1714 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1716 # Determines whether we should optimize JNI generation at the cost of
1717 # breaking assumptions in the build system that when inputs have changed
1718 # the outputs should always change as well. This is meant purely for
1719 # developer builds, to avoid spurious re-linking of native files.
1720 'optimize_jni_generation%': 0,
1722 # Always uses openssl.
1724 'use_openssl_certs%': 1,
1726 'proprietary_codecs%': '<(proprietary_codecs)',
1727 'safe_browsing%': 1,
1728 'enable_web_speech%': 0,
1730 'build_ffmpegsumo%': 0,
1731 'use_allocator%': 'none',
1733 # Disable Native Client.
1736 # Android does not support background apps.
1737 'enable_background%': 0,
1739 # Sessions are store separately in the Java side.
1740 'enable_session_service%': 0,
1744 'gtest_target_type%': 'shared_library',
1746 # Uses system APIs for decoding audio and video.
1747 'use_libffmpeg%': '0',
1749 # When building as part of the Android system, use system libraries
1750 # where possible to reduce ROM size.
1751 # TODO(steveblock): Investigate using the system version of sqlite.
1752 'use_system_sqlite%': 0, # '<(android_webview_build)',
1753 'use_system_expat%': '<(android_webview_build)',
1754 'use_system_icu%': '<(android_webview_build)',
1755 'use_system_stlport%': '<(android_webview_build)',
1757 # Copy it out one scope.
1758 'android_webview_build%': '<(android_webview_build)',
1761 'use_system_fontconfig%': 0,
1763 'use_system_fontconfig%': 1,
1766 'ffmpeg_branding%': 'Chrome',
1767 'ozone_platform_ozonex%': 1,
1769 ['target_arch=="arm"', {
1771 'arm_tune%': 'cortex-a9',
1773 'enable_mpeg2ts_stream_parser%': 1,
1778 ['android_webview_build==1 or android_webview_telemetry_build==1', {
1779 # When building the WebView in the Android tree, jarjar will remap all
1780 # the class names, so the JNI generator needs to know this.
1781 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1783 ['OS=="linux" and target_arch!="mipsel"', {
1784 # TODO(thakis): This is here to measure perf for a while.
1789 # All Chrome builds have breakpad symbols, but only process the
1790 # symbols from official builds.
1791 ['(branding=="Chrome" and buildtype=="Official")', {
1792 'mac_strip_release%': 1,
1796 ['OS=="mac" or OS=="ios"', {
1800 # Mac OS X SDK and deployment target support. The SDK identifies
1801 # the version of the system headers that will be used, and
1802 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1803 # macro. "Maximum allowed" refers to the operating system version
1804 # whose APIs are available in the headers. The deployment target
1805 # identifies the minimum system version that the built products are
1806 # expected to function on. It corresponds to the
1807 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1808 # macros are available, #include <AvailabilityMacros.h>. Additional
1809 # documentation on these macros is available at
1810 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1811 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1812 # deployment target to 10.6. Other projects, such as O3D, may
1813 # override these defaults.
1815 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1816 # about that is at least the specified version. In official builds,
1817 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1818 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1819 # path to the SDK; when set to a non-empty string, SDK detection
1820 # based on mac_sdk_min will be bypassed entirely.
1821 'mac_sdk_min%': '10.6',
1822 'mac_sdk_path%': '',
1824 'mac_deployment_target%': '10.6',
1827 'mac_sdk_min': '<(mac_sdk_min)',
1828 'mac_sdk_path': '<(mac_sdk_path)',
1829 'mac_deployment_target': '<(mac_deployment_target)',
1831 # Compile in Breakpad support by default so that it can be
1832 # tested, even if it is not enabled by default at runtime.
1833 'mac_breakpad_compiled_in%': 1,
1835 # mac_product_name is set to the name of the .app bundle as it should
1836 # appear on disk. This duplicates data from
1837 # chrome/app/theme/chromium/BRANDING and
1838 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1839 # these names into the build system.
1840 ['branding=="Chrome"', {
1841 'mac_product_name%': 'Google Chrome',
1842 }, { # else: branding!="Chrome"
1843 'mac_product_name%': 'Chromium',
1846 ['branding=="Chrome" and buildtype=="Official"', {
1847 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1848 # Enable uploading crash dumps.
1849 'mac_breakpad_uploads%': 1,
1850 # Enable dumping symbols at build time for use by Mac Breakpad.
1852 # Enable Keystone auto-update support.
1854 }, { # else: branding!="Chrome" or buildtype!="Official"
1855 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1856 'mac_breakpad_uploads%': 0,
1861 }], # OS=="mac" or OS=="ios"
1864 # This is the architecture convention used in WinSDK paths.
1865 ['target_arch=="ia32"', {
1866 'winsdk_arch%': 'x86',
1868 'winsdk_arch%': '<(target_arch)',
1870 ['component=="shared_library"', {
1871 'win_use_allocator_shim%': 0,
1873 # Turn on multiple dll by default on Windows when in static_library.
1874 'chrome_multiple_dll%': 1,
1877 'win_use_allocator_shim%': 0,
1879 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1880 # Only enabled by default for ninja because it's buggy in VS.
1881 # Not enabled for component=static_library because some targets
1882 # are too large and the toolchain fails due to the size of the
1884 'incremental_chrome_dll%': 1,
1886 # Don't do incremental linking for large modules on 32-bit or when
1887 # component=static_library as the toolchain fails due to the size of
1889 ['MSVS_OS_BITS==32 or component=="static_library"', {
1890 'msvs_large_module_debug_link_mode%': '1', # No
1892 'msvs_large_module_debug_link_mode%': '2', # Yes
1894 ['MSVS_VERSION=="2013e"', {
1902 'nacl_win64_defines': [
1903 # This flag is used to minimize dependencies when building
1904 # Native Client loader for 64-bit Windows.
1909 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1915 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1916 'enable_pepper_cdms%': 1,
1918 'enable_pepper_cdms%': 0,
1922 'enable_browser_cdms%': 1,
1924 'enable_browser_cdms%': 0,
1927 # Native Client glibc toolchain is enabled
1928 # by default except on arm and mips.
1929 ['target_arch=="arm" or target_arch=="mipsel"', {
1930 'disable_glibc%': 1,
1932 'disable_glibc%': 0,
1935 # Set the relative path from this file to the GYP file of the JPEG
1936 # library used by Chromium.
1937 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1938 # Configuration for using the system libjeg is here.
1939 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1941 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1944 # Options controlling the use of GConf (the classic GNOME configuration
1945 # system) and GIO, which contains GSettings (the new GNOME config system).
1946 ['chromeos==1 or embedded==1', {
1954 # Set up -D and -E flags passed into grit.
1955 ['branding=="Chrome"', {
1956 # TODO(mmoss) The .grd files look for _google_chrome, but for
1957 # consistency they should look for google_chrome_build like C++.
1958 'grit_defines': ['-D', '_google_chrome',
1959 '-E', 'CHROMIUM_BUILD=google_chrome'],
1961 'grit_defines': ['-D', '_chromium',
1962 '-E', 'CHROMIUM_BUILD=chromium'],
1965 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
1967 ['desktop_linux==1', {
1968 'grit_defines': ['-D', 'desktop_linux'],
1970 ['toolkit_views==1', {
1971 'grit_defines': ['-D', 'toolkit_views'],
1974 'grit_defines': ['-D', 'use_aura'],
1977 'grit_defines': ['-D', 'use_ash'],
1980 'grit_defines': ['-D', 'use_nss'],
1983 'grit_defines': ['-D', 'use_ozone'],
1985 ['image_loader_extension==1', {
1986 'grit_defines': ['-D', 'image_loader_extension'],
1989 'grit_defines': ['-D', 'remoting'],
1991 ['use_titlecase_in_grd_files==1', {
1992 'grit_defines': ['-D', 'use_titlecase'],
1994 ['use_third_party_translations==1', {
1995 'grit_defines': ['-D', 'use_third_party_translations'],
1997 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
1998 'ka', 'ku', 'kw', 'ms', 'ug'
2002 'grit_defines': ['-t', 'android',
2003 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true'],
2005 ['OS=="mac" or OS=="ios"', {
2006 'grit_defines': ['-D', 'scale_factors=2x'],
2011 # iOS uses a whitelist to filter resources.
2012 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
2015 # Enable host builds when generating with ninja-ios.
2017 ['"<(GENERATOR)"=="ninja"', {
2021 # TODO(sdefresne): Remove the target_subarch check once Apple has
2022 # upstreamed the support for "arm64". http://crbug.com/341453
2023 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
2028 ['enable_extensions==1', {
2029 'grit_defines': ['-D', 'enable_extensions'],
2031 ['enable_plugins!=0', {
2032 'grit_defines': ['-D', 'enable_plugins'],
2034 ['enable_printing!=0', {
2035 'grit_defines': ['-D', 'enable_printing'],
2037 ['enable_printing==1', {
2038 'grit_defines': ['-D', 'enable_full_printing'],
2040 ['enable_themes==1', {
2041 'grit_defines': ['-D', 'enable_themes'],
2043 ['enable_app_list==1', {
2044 'grit_defines': ['-D', 'enable_app_list'],
2046 ['enable_settings_app==1', {
2047 'grit_defines': ['-D', 'enable_settings_app'],
2049 ['enable_google_now==1', {
2050 'grit_defines': ['-D', 'enable_google_now'],
2052 ['use_concatenated_impulse_responses==1', {
2053 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2055 ['enable_webrtc==1', {
2056 'grit_defines': ['-D', 'enable_webrtc'],
2058 ['enable_hangout_services_extension==1', {
2059 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2061 ['enable_task_manager==1', {
2062 'grit_defines': ['-D', 'enable_task_manager'],
2064 ['notifications==1', {
2065 'grit_defines': ['-D', 'enable_notifications'],
2067 ['enable_wifi_bootstrapping==1', {
2068 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2070 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2071 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2073 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2074 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2076 ['enable_mdns==1 or OS=="mac"', {
2077 'grit_defines': ['-D', 'enable_service_discovery'],
2078 'enable_service_discovery%': 1
2080 ['clang_use_chrome_plugins==1 and OS!="win"', {
2081 'clang_chrome_plugins_flags': [
2082 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
2085 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2087 'use_allocator%': 'none',
2089 ['asan==1 and OS=="linux" and chromeos==0', {
2090 'use_custom_libcxx%': 1,
2098 ['asan==1 and OS=="mac"', {
2099 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
2100 # runtime is fully adopted. See http://crbug.com/242503.
2101 'mac_strip_release': 0,
2104 'use_custom_libcxx%': 1,
2107 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2108 # libstdc++. This is required to avoid false positive reports whenever
2109 # the C++ standard library is used.
2110 'use_custom_libcxx%': 1,
2111 # Running the V8-generated code on an ARM simulator is a powerful hack
2112 # that allows the tool to see the memory accesses from JITted code.
2113 # Without this flag, JS code causes false positive reports from MSan.
2114 'v8_target_arch': 'arm64',
2117 ['OS=="linux" and clang_type_profiler==1', {
2119 'clang_use_chrome_plugins%': 0,
2121 ['host_arch=="x64"', {
2122 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2124 ['host_arch=="ia32"', {
2125 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2126 # Clang in this directory at your own risk if needed for some
2127 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2128 # usage). Any failure by this compiler should not close the tree.
2129 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2135 # The Clang plugins don't currently work on Windows.
2136 # TODO(hans): One day, this will work. (crbug.com/82385)
2137 'clang_use_chrome_plugins%': 0,
2140 # On valgrind bots, override the optimizer settings so we don't inline too
2141 # much and make the stacks harder to figure out.
2143 # TODO(rnk): Kill off variables that no one else uses and just implement
2144 # them under a build_for_tool== condition.
2145 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2147 'mac_debug_optimization': '1',
2148 'mac_release_optimization': '1',
2149 'release_optimize': '1',
2150 'no_gc_sections': 1,
2151 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2152 '-fno-builtin -fno-optimize-sibling-calls',
2153 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2154 '-fno-builtin -fno-optimize-sibling-calls',
2156 # MSVS flags for TSan on Pin and Windows.
2157 'win_debug_RuntimeChecks': '0',
2158 'win_debug_disable_iterator_debugging': '1',
2159 'win_debug_Optimization': '1',
2160 'win_debug_InlineFunctionExpansion': '0',
2161 'win_release_InlineFunctionExpansion': '0',
2162 'win_release_OmitFramePointers': '0',
2164 'use_allocator': 'tcmalloc',
2165 'release_valgrind_build': 1,
2167 'component': 'static_library',
2168 'use_system_zlib': 0,
2171 # Build tweaks for DrMemory.
2172 # TODO(rnk): Combine with tsan config to share the builder.
2173 # http://crbug.com/108155
2174 ['build_for_tool=="drmemory"', {
2175 # These runtime checks force initialization of stack vars which blocks
2176 # DrMemory's uninit detection.
2177 'win_debug_RuntimeChecks': '0',
2178 # Iterator debugging is slow.
2179 'win_debug_disable_iterator_debugging': '1',
2180 # Try to disable optimizations that mess up stacks in a release build.
2181 # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054)
2182 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2183 # compiler bug, so we use /Ob1 instead.
2184 'win_release_InlineFunctionExpansion': '1',
2185 'win_release_OmitFramePointers': '0',
2186 # Ditto for debug, to support bumping win_debug_Optimization.
2187 'win_debug_InlineFunctionExpansion': 0,
2188 'win_debug_OmitFramePointers': 0,
2189 # Keep the code under #ifndef NVALGRIND.
2190 'release_valgrind_build': 1,
2193 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2194 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2198 # Set default compiler flags depending on ARM version.
2199 ['arm_version==6 and android_webview_build==0', {
2200 'arm_arch%': 'armv6',
2203 'arm_float_abi%': 'softfp',
2206 ['arm_version==7 and android_webview_build==0', {
2207 'arm_arch%': 'armv7-a',
2208 'arm_tune%': 'generic-armv7-a',
2213 'arm_fpu%': 'vfpv3-d16',
2216 # Change the default to hard once the armhf transition is complete.
2217 'arm_float_abi%': 'softfp',
2221 ['android_webview_build==1', {
2222 # The WebView build gets its cpu-specific flags from the Android build system.
2226 'arm_float_abi%': '',
2230 # Enable brlapi by default for chromeos.
2235 ['use_ozone==1 and ozone_auto_platforms==1', {
2236 # Use test as the default platform.
2237 'ozone_platform%': 'test',
2239 # Build all platforms whose deps are in install-build-deps.sh.
2240 # Only these platforms will be compile tested by buildbots.
2241 'ozone_platform_dri%': 1,
2242 'ozone_platform_test%': 1,
2243 'ozone_platform_egltest%': 1,
2246 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2247 'use_clipboard_aurax11%': 1,
2250 ['OS=="win" and use_goma==1', {
2251 # goma doesn't support pch yet.
2252 'chromium_win_pch': 0,
2253 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2261 ['OS=="win" and (clang==1 or asan==1)', {
2262 'chromium_win_pch': 0,
2265 # The seccomp-bpf sandbox is only supported on four architectures
2267 # Do not disable seccomp_bpf anywhere without talking to
2268 # security@chromium.org!
2269 ['((OS=="linux" or OS=="android") and '
2270 '(target_arch=="ia32" or target_arch=="x64" or '
2271 'target_arch=="arm" or target_arch=="mipsel"))', {
2272 'use_seccomp_bpf%': 1,
2274 'use_seccomp_bpf%': 0,
2278 # The path to the ANGLE library.
2279 'angle_path': '<(DEPTH)/third_party/angle',
2281 # List of default apps to install in new profiles. The first list contains
2282 # the source files as found in svn. The second list, used only for linux,
2283 # contains the destination location for each of the files. When a crx
2284 # is added or removed from the list, the chrome/browser/resources/
2285 # default_apps/external_extensions.json file must also be updated.
2286 'default_apps_list': [
2287 'browser/resources/default_apps/external_extensions.json',
2288 'browser/resources/default_apps/gmail.crx',
2289 'browser/resources/default_apps/search.crx',
2290 'browser/resources/default_apps/youtube.crx',
2291 'browser/resources/default_apps/drive.crx',
2292 'browser/resources/default_apps/docs.crx',
2294 'default_apps_list_linux_dest': [
2295 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2296 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2297 '<(PRODUCT_DIR)/default_apps/search.crx',
2298 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2299 '<(PRODUCT_DIR)/default_apps/drive.crx',
2300 '<(PRODUCT_DIR)/default_apps/docs.crx',
2303 'target_defaults': {
2305 # The condition that operates on chromium_code is in a target_conditions
2306 # section, and will not have access to the default fallback value of
2307 # chromium_code at the top of this file, or to the chromium_code
2308 # variable placed at the root variables scope of .gyp files, because
2309 # those variables are not set at target scope. As a workaround,
2310 # if chromium_code is not set at target scope, define it in target scope
2311 # to contain whatever value it has during early variable expansion.
2312 # That's enough to make it available during target conditional
2314 'chromium_code%': '<(chromium_code)',
2316 'component%': '<(component)',
2318 'chromecast%': '<(chromecast)',
2320 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2321 'win_release_Optimization%': '2', # 2 = /Os
2322 'win_debug_Optimization%': '0', # 0 = /Od
2324 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2325 # Tri-state: blank is default, 1 on, 0 off
2326 'win_release_OmitFramePointers%': '0',
2327 # Tri-state: blank is default, 1 on, 0 off
2328 'win_debug_OmitFramePointers%': '',
2330 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2331 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2333 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2334 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2335 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2337 # VS inserts quite a lot of extra checks to algorithms like
2338 # std::partial_sort in Debug build which make them O(N^2)
2339 # instead of O(N*logN). This is particularly slow under memory
2340 # tools like ThreadSanitizer so we want it to be disablable.
2341 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2342 'win_debug_disable_iterator_debugging%': '0',
2344 # An application manifest fragment to declare compatibility settings for
2345 # 'executable' targets. Ignored in other target type.
2346 'win_exe_compatibility_manifest%':
2347 '<(DEPTH)\\build\\win\\compatibility.manifest',
2349 'release_extra_cflags%': '',
2350 'debug_extra_cflags%': '',
2352 'release_valgrind_build%': '<(release_valgrind_build)',
2354 # the non-qualified versions are widely assumed to be *nix-only
2355 'win_release_extra_cflags%': '',
2356 'win_debug_extra_cflags%': '',
2358 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2359 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2361 # Only used by Windows build for now. Can be used to build into a
2362 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2363 # output files in src/build/VS2010_{Debug,Release}.
2364 'build_dir_prefix%': '',
2366 # Targets are by default not nacl untrusted code.
2367 'nacl_untrusted_build%': 0,
2369 'pnacl_compile_flags': [
2370 # pnacl uses the clang compiler so we need to suppress all the
2371 # same warnings as we do for clang.
2372 # TODO(sbc): Remove these if/when they are removed from the clang
2374 '-Wno-unused-function',
2375 '-Wno-char-subscripts',
2376 '-Wno-c++11-extensions',
2377 '-Wno-unnamed-type-template-args',
2381 ['OS=="win" and component=="shared_library"', {
2382 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2383 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2384 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2386 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2387 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2388 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2391 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2392 'mac_release_optimization%': 's', # Use -Os unless overridden
2393 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2395 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2396 'mac_release_optimization%': '3', # Use -O3 unless overridden
2397 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2400 'host_os%': '<(host_os)', # See comment above chromium_code.
2405 # Don't use deprecated V8 APIs anywhere.
2406 'V8_DEPRECATION_WARNINGS',
2407 # Temporary suppression until Blink code can be removed.
2408 'BLINK_SCALE_FILTERS_AT_RECORD_TIME',
2411 '<(SHARED_INTERMEDIATE_DIR)',
2414 ['(OS=="mac" or OS=="ios") and asan==1', {
2416 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2419 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2420 'cflags_cc!': ['-fno-rtti'],
2423 '-gline-tables-only',
2424 '-fintercept-allocation-functions',
2426 'defines': ['TYPE_PROFILING'],
2428 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2431 ['OS=="linux" and clang==1 and host_arch=="ia32"', {
2432 # TODO(dmikurube): Remove -Wno-sentinel when Clang/LLVM is fixed.
2433 # See http://crbug.com/162818.
2434 'cflags+': ['-Wno-sentinel'],
2436 ['branding=="Chrome"', {
2437 'defines': ['GOOGLE_CHROME_BUILD'],
2438 }, { # else: branding!="Chrome"
2439 'defines': ['CHROMIUM_BUILD'],
2441 ['OS=="mac" and component=="shared_library"', {
2443 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2444 'LD_RUNPATH_SEARCH_PATHS': [
2445 # For unbundled binaries.
2447 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2448 '@loader_path/../../..',
2452 ['clang==1 and OS!="win"', {
2453 # This is here so that all files get recompiled after a clang roll and
2454 # when turning clang on or off.
2455 # (defines are passed via the command line, and build systems rebuild
2456 # things when their commandline changes). Nothing should ever read this
2458 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2461 'defines': ['ENABLE_RLZ'],
2463 ['component=="shared_library"', {
2464 'defines': ['COMPONENT_BUILD'],
2466 ['toolkit_views==1', {
2467 'defines': ['TOOLKIT_VIEWS=1'],
2469 ['ui_compositor_image_transport==1', {
2470 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2473 'defines': ['USE_AURA=1'],
2476 'defines': ['USE_ASH=1'],
2479 'defines': ['USE_PANGO=1'],
2482 'defines': ['USE_CAIRO=1'],
2485 'defines': ['USE_CRAS=1'],
2488 'defines': ['USE_GLIB=1'],
2491 'defines': ['USE_OZONE=1'],
2493 ['use_default_render_theme==1', {
2494 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2496 ['use_libjpeg_turbo==1', {
2497 'defines': ['USE_LIBJPEG_TURBO=1'],
2500 'defines': ['USE_X11=1'],
2502 ['use_clipboard_aurax11==1', {
2503 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2505 ['enable_one_click_signin==1', {
2506 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2508 ['enable_pre_sync_backup==1', {
2509 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2511 ['use_xi2_mt!=0 and use_x11==1', {
2512 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2514 ['image_loader_extension==1', {
2515 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2518 'defines': ['ENABLE_PROFILING=1'],
2521 'defines': ['ENABLE_REMOTING=1'],
2523 ['enable_webrtc==1', {
2524 'defines': ['ENABLE_WEBRTC=1'],
2526 ['proprietary_codecs==1', {
2527 'defines': ['USE_PROPRIETARY_CODECS'],
2529 ['enable_viewport==1', {
2530 'defines': ['ENABLE_VIEWPORT'],
2532 ['enable_pepper_cdms==1', {
2533 'defines': ['ENABLE_PEPPER_CDMS'],
2535 ['enable_browser_cdms==1', {
2536 'defines': ['ENABLE_BROWSER_CDMS'],
2538 ['configuration_policy==1', {
2539 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2541 ['notifications==1', {
2542 'defines': ['ENABLE_NOTIFICATIONS'],
2544 ['enable_hidpi==1', {
2545 'defines': ['ENABLE_HIDPI=1'],
2547 ['native_discardable_memory==1', {
2548 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2550 ['native_memory_pressure_signals==1', {
2551 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2554 'defines': ['USE_UDEV'],
2558 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2561 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2562 # Clang creates chubby debug information, which makes linking very
2563 # slow. For now, don't create debug information with clang. See
2564 # http://crbug.com/70000
2568 'debug_extra_cflags': '-g0',
2571 # Android builds symbols on release by default, disable them.
2574 'debug_extra_cflags': '-g0',
2575 'release_extra_cflags': '-g0',
2579 }, { # else clang!=1
2581 ['OS=="win" and fastbuild==2', {
2582 # Completely disable debug information.
2585 'GenerateDebugInformation': 'false',
2587 'VCCLCompilerTool': {
2588 'DebugInformationFormat': '0',
2592 ['OS=="win" and fastbuild==1', {
2595 # This tells the linker to generate .pdbs, so that
2596 # we can get meaningful stack traces.
2597 'GenerateDebugInformation': 'true',
2599 'VCCLCompilerTool': {
2600 # No debug info to be generated by compiler.
2601 'DebugInformationFormat': '0',
2605 ['OS=="linux" and fastbuild==2', {
2607 'debug_extra_cflags': '-g0',
2610 ['OS=="linux" and fastbuild==1', {
2612 'debug_extra_cflags': '-g1',
2615 ['OS=="android" and fastbuild==2', {
2617 'debug_extra_cflags': '-g0',
2618 'release_extra_cflags': '-g0',
2621 ['OS=="android" and fastbuild==1', {
2623 'debug_extra_cflags': '-g1',
2624 'release_extra_cflags': '-g1',
2631 ['dont_embed_build_metadata==1', {
2633 'DONT_EMBED_BUILD_METADATA',
2635 }], # dont_embed_build_metadata==1
2636 ['dcheck_always_on!=0', {
2637 'defines': ['DCHECK_ALWAYS_ON=1'],
2638 }], # dcheck_always_on!=0
2639 ['tracing_like_official_build!=0', {
2640 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2641 }], # tracing_like_official_build!=0
2642 ['win_use_allocator_shim==0', {
2645 'defines': ['NO_TCMALLOC'],
2649 ['enable_eglimage==1', {
2651 'ENABLE_EGLIMAGE=1',
2656 'ADDRESS_SANITIZER',
2657 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2658 'MEMORY_SANITIZER_INITIAL_SIZE',
2662 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2670 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2671 'MEMORY_SANITIZER_INITIAL_SIZE',
2677 '_CRT_SECURE_NO_DEPRECATE',
2678 '_SCL_SECURE_NO_DEPRECATE',
2679 # This define is required to pull in the new Win8 interfaces from
2680 # system headers like ShObjIdl.h.
2681 'NTDDI_VERSION=0x06020000',
2682 # This is required for ATL to use XP-safe versions of its functions.
2683 '_USING_V110_SDK71_',
2686 '<(DEPTH)/third_party/wtl/include',
2691 # Generates debug info when win_z7=1
2692 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2694 'GenerateDebugInformation': 'true',
2696 'VCCLCompilerTool': {
2697 'DebugInformationFormat': '1',
2708 ['target_arch=="arm"', {
2710 # TODO(lcwu): Work around an error when building Chromium
2711 # with gcc-4.5.3 (e.g. v8/src/platform-linux.cc). Remove
2712 # this define once the toolchain is updated.
2713 # See crbug.com/388933.
2719 ['enable_task_manager==1', {
2721 'ENABLE_TASK_MANAGER=1',
2724 ['enable_extensions==1', {
2726 'ENABLE_EXTENSIONS=1',
2729 ['OS=="win" and branding=="Chrome"', {
2730 'defines': ['ENABLE_SWIFTSHADER'],
2732 ['enable_dart==1', {
2733 'defines': ['WEBKIT_USING_DART=1'],
2735 ['enable_plugin_installation==1', {
2736 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2738 ['enable_plugins==1', {
2739 'defines': ['ENABLE_PLUGINS=1'],
2741 ['enable_session_service==1', {
2742 'defines': ['ENABLE_SESSION_SERVICE=1'],
2744 ['enable_themes==1', {
2745 'defines': ['ENABLE_THEMES=1'],
2747 ['enable_autofill_dialog==1', {
2748 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2750 ['enable_prod_wallet_service==1', {
2751 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2753 ['enable_background==1', {
2754 'defines': ['ENABLE_BACKGROUND=1'],
2756 ['enable_google_now==1', {
2757 'defines': ['ENABLE_GOOGLE_NOW=1'],
2759 ['cld_version!=0', {
2760 'defines': ['CLD_VERSION=<(cld_version)'],
2762 ['cld_version==2', {
2763 # This is used to populate the "CLD Data Source" field in:
2764 # chrome://translate-internals
2765 'defines': ['CLD2_DATA_SOURCE=<(cld2_data_source)'],
2767 ['enable_printing==1', {
2768 'defines': ['ENABLE_FULL_PRINTING=1', 'ENABLE_PRINTING=1'],
2770 ['enable_printing==2', {
2771 'defines': ['ENABLE_PRINTING=1'],
2773 ['OS=="win" and win_pdf_metafile_for_printing==1', {
2774 'defines': ['WIN_PDF_METAFILE_FOR_PRINTING=1'],
2776 ['enable_spellcheck==1', {
2777 'defines': ['ENABLE_SPELLCHECK=1'],
2779 ['enable_captive_portal_detection==1', {
2780 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2782 ['enable_app_list==1', {
2783 'defines': ['ENABLE_APP_LIST=1'],
2785 ['enable_settings_app==1', {
2786 'defines': ['ENABLE_SETTINGS_APP=1'],
2788 ['disable_file_support==1', {
2789 'defines': ['DISABLE_FILE_SUPPORT=1'],
2791 ['disable_ftp_support==1', {
2792 'defines': ['DISABLE_FTP_SUPPORT=1'],
2794 ['use_icu_alternatives_on_android==1', {
2795 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2797 ['enable_managed_users==1', {
2798 'defines': ['ENABLE_MANAGED_USERS=1'],
2800 ['data_reduction_fallback_host != ""', {
2802 'DATA_REDUCTION_FALLBACK_HOST="<(data_reduction_fallback_host)"'],
2804 ['data_reduction_dev_host != ""', {
2806 'DATA_REDUCTION_DEV_HOST="<(data_reduction_dev_host)"'],
2808 ['spdy_proxy_auth_origin != ""', {
2809 'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'],
2811 ['spdy_proxy_auth_property != ""', {
2812 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2814 ['spdy_proxy_auth_value != ""', {
2815 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2817 ['data_reduction_proxy_probe_url != ""', {
2819 'DATA_REDUCTION_PROXY_PROBE_URL="<(data_reduction_proxy_probe_url)"'],
2821 ['data_reduction_proxy_warmup_url != ""', {
2823 'DATA_REDUCTION_PROXY_WARMUP_URL="<(data_reduction_proxy_warmup_url)"'],
2825 ['data_reduction_proxy_ssl_origin != ""', {
2827 'DATA_REDUCTION_PROXY_SSL_ORIGIN="<(data_reduction_proxy_ssl_origin)"'],
2829 ['data_reduction_proxy_alt_origin != ""', {
2831 'DATA_REDUCTION_PROXY_ALT_ORIGIN="<(data_reduction_proxy_alt_origin)"'],
2833 ['data_reduction_proxy_alt_fallback_origin != ""', {
2835 'DATA_REDUCTION_PROXY_ALT_FALLBACK_ORIGIN="<(data_reduction_proxy_alt_fallback_origin)"'],
2837 ['enable_mdns==1', {
2838 'defines': ['ENABLE_MDNS=1'],
2840 ['enable_service_discovery==1', {
2841 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2843 ['enable_wifi_bootstrapping==1', {
2844 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2846 ['enable_hangout_services_extension==1', {
2847 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2849 ['enable_ipc_fuzzer==1', {
2850 'defines': ['ENABLE_IPC_FUZZER=1'],
2853 'defines': ['VIDEO_HOLE=1'],
2855 ], # conditions for 'target_defaults'
2856 'target_conditions': [
2857 ['<(use_openssl)==1', {
2858 'defines': ['USE_OPENSSL=1'],
2860 ['<(use_openssl_certs)==1', {
2861 'defines': ['USE_OPENSSL_CERTS=1'],
2863 ['>(nacl_untrusted_build)==1', {
2866 'USE_OPENSSL_CERTS=1',
2869 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
2870 'defines': ['USE_NSS=1'],
2872 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
2873 'defines': ['OS_CHROMEOS=1'],
2875 ['enable_wexit_time_destructors==1', {
2879 '-Wexit-time-destructors',
2883 '-Wexit-time-destructors',
2889 ['chromium_code==0', {
2891 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
2892 # We don't want to get warnings from third-party code,
2893 # so remove any existing warning-enabling flags like -Wall.
2899 # Don't warn about hash_map in third-party code.
2903 # Don't warn about printf format problems.
2904 # This is off by default in gcc but on in Ubuntu's gcc(!).
2908 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
2912 # TODO: Fix all warnings on chromeos too.
2913 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
2918 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
2920 # Don't warn about ignoring the return value from e.g. close().
2921 # This is off by default in some gccs but on by default in others.
2922 # BSD systems do not support this option, since they are usually
2923 # using gcc 4.2.1, which does not have this flag yet.
2924 '-Wno-unused-result',
2929 '_CRT_SECURE_NO_DEPRECATE',
2930 '_CRT_NONSTDC_NO_WARNINGS',
2931 '_CRT_NONSTDC_NO_DEPRECATE',
2932 '_SCL_SECURE_NO_DEPRECATE',
2934 'msvs_disabled_warnings': [4800],
2936 'VCCLCompilerTool': {
2937 'WarningLevel': '3',
2938 'WarnAsError': 'true',
2939 'Detect64BitPortabilityProblems': 'false',
2943 ['buildtype=="Official"', {
2945 'VCCLCompilerTool': { 'WarnAsError': 'false' },
2950 'VCCLCompilerTool': { 'WarnAsError': 'false' },
2955 # TODO(darin): Unfortunately, some third_party code depends on base.
2956 [ 'OS=="win" and component=="shared_library"', {
2957 'msvs_disabled_warnings': [
2958 4251, # class 'std::xx' needs to have dll-interface.
2961 [ 'OS=="mac" or OS=="ios"', {
2963 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
2966 ['buildtype=="Official"', {
2968 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
2975 # TODO(ios): Fix remaining warnings in third-party code, then
2976 # remove this; the Mac cleanup didn't get everything that's
2977 # flagged in an iOS build.
2978 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
2979 'RUN_CLANG_STATIC_ANALYZER': 'NO',
2980 # Several internal ios directories generate numerous warnings for
2981 # -Wobjc-missing-property-synthesis.
2982 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
2988 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
2989 'filename_rules.gypi',
2991 # In Chromium code, we define __STDC_foo_MACROS in order to get the
2992 # C99 macros on Mac and Linux.
2994 '__STDC_CONSTANT_MACROS',
2995 '__STDC_FORMAT_MACROS',
2999 # turn on warnings for signed/unsigned mismatch on chromium code.
3001 'VCCLCompilerTool': {
3002 'AdditionalOptions': ['/we4389'],
3006 ['OS=="win" and component=="shared_library"', {
3007 'msvs_disabled_warnings': [
3008 4251, # class 'std::xx' needs to have dll-interface.
3013 ], # target_conditions for 'target_defaults'
3014 'default_configuration': 'Debug',
3016 # VCLinkerTool LinkIncremental values below:
3018 # 1 == /INCREMENTAL:NO
3020 # Debug links incremental, Release does not.
3022 # Abstract base configurations to cover common attributes.
3026 'msvs_configuration_attributes': {
3027 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3028 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3029 'CharacterSet': '1',
3031 # Add the default import libs.
3034 'AdditionalDependencies': [
3058 'MinimumRequiredVersion': '5.01', # XP.
3059 'TargetMachine': '1',
3061 'VCLibrarianTool': {
3062 'TargetMachine': '1',
3065 'msvs_configuration_platform': 'Win32',
3069 'msvs_configuration_platform': 'x64',
3072 # Make sure to understand http://crbug.com/361720 if you want to
3074 'MinimumRequiredVersion': '5.02', # Server 2003.
3075 'TargetMachine': '17', # x86 - 64
3076 'AdditionalLibraryDirectories!':
3077 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3078 'AdditionalLibraryDirectories':
3079 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3080 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3081 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3083 'VCLibrarianTool': {
3084 'AdditionalLibraryDirectories!':
3085 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3086 'AdditionalLibraryDirectories':
3087 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3088 'TargetMachine': '17', # x64
3095 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3096 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3099 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3101 '<@(debug_extra_cflags)',
3105 'VCCLCompilerTool': {
3106 'Optimization': '<(win_debug_Optimization)',
3107 'PreprocessorDefinitions': ['_DEBUG'],
3108 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3109 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3111 # According to MSVS, InlineFunctionExpansion=0 means
3112 # "default inlining", not "/Ob0".
3113 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3114 ['win_debug_InlineFunctionExpansion==0', {
3115 'AdditionalOptions': ['/Ob0'],
3117 ['win_debug_InlineFunctionExpansion!=""', {
3118 'InlineFunctionExpansion':
3119 '<(win_debug_InlineFunctionExpansion)',
3121 ['win_debug_disable_iterator_debugging==1', {
3122 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3125 # if win_debug_OmitFramePointers is blank, leave as default
3126 ['win_debug_OmitFramePointers==1', {
3127 'OmitFramePointers': 'true',
3129 ['win_debug_OmitFramePointers==0', {
3130 'OmitFramePointers': 'false',
3131 # The above is not sufficient (http://crbug.com/106711): it
3132 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3133 # perform FPO regardless, so we must explicitly disable.
3134 # We still want the false setting above to avoid having
3135 # "/Oy /Oy-" and warnings about overriding.
3136 'AdditionalOptions': ['/Oy-'],
3139 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3142 'LinkIncremental': '<(msvs_debug_link_incremental)',
3143 # ASLR makes debugging with windbg difficult because Chrome.exe and
3144 # Chrome.dll share the same base name. As result, windbg will
3145 # name the Chrome.dll module like chrome_<base address>, where
3146 # <base address> typically changes with each launch. This in turn
3147 # means that breakpoints in Chrome.dll don't stick from one launch
3148 # to the next. For this reason, we turn ASLR off in debug builds.
3149 # Note that this is a three-way bool, where 0 means to pick up
3150 # the default setting, 1 is off and 2 is on.
3151 'RandomizedBaseAddress': 1,
3153 'VCResourceCompilerTool': {
3154 'PreprocessorDefinitions': ['_DEBUG'],
3158 ['OS=="linux" or OS=="android"', {
3159 'target_conditions': [
3160 ['_toolset=="target"', {
3162 '<@(debug_extra_cflags)',
3167 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3168 # Enable libstdc++ debugging facilities to help catch problems
3169 # early, see http://crbug.com/65151 .
3170 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3171 'defines': ['_GLIBCXX_DEBUG=1',],
3173 ['release_valgrind_build==0', {
3176 '-fstack-protector-all', # Implies -fstack-protector
3188 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3189 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3190 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3193 'VCCLCompilerTool': {
3194 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3196 # In official builds, each target will self-select
3197 # an optimization level.
3198 ['buildtype!="Official"', {
3199 'Optimization': '<(win_release_Optimization)',
3202 # According to MSVS, InlineFunctionExpansion=0 means
3203 # "default inlining", not "/Ob0".
3204 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3205 ['win_release_InlineFunctionExpansion==0', {
3206 'AdditionalOptions': ['/Ob0'],
3208 ['win_release_InlineFunctionExpansion!=""', {
3209 'InlineFunctionExpansion':
3210 '<(win_release_InlineFunctionExpansion)',
3213 # if win_release_OmitFramePointers is blank, leave as default
3214 ['win_release_OmitFramePointers==1', {
3215 'OmitFramePointers': 'true',
3217 ['win_release_OmitFramePointers==0', {
3218 'OmitFramePointers': 'false',
3219 # The above is not sufficient (http://crbug.com/106711): it
3220 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3221 # perform FPO regardless, so we must explicitly disable.
3222 # We still want the false setting above to avoid having
3223 # "/Oy /Oy-" and warnings about overriding.
3224 'AdditionalOptions': ['/Oy-'],
3227 'AdditionalOptions': [
3228 '/d2Zi+', # Improve debugging of Release builds.
3229 '<@(win_release_extra_cflags)',
3233 # LinkIncremental is a tri-state boolean, where 0 means default
3234 # (i.e., inherit from parent solution), 1 means false, and
3236 'LinkIncremental': '1',
3237 # This corresponds to the /PROFILE flag which ensures the PDB
3238 # file contains FIXUP information (growing the PDB file by about
3239 # 5%) but does not otherwise alter the output binary. This
3240 # information is used by the Syzygy optimization tool when
3241 # decomposing the release image.
3246 ['msvs_use_common_release', {
3247 'includes': ['release.gypi'],
3249 ['release_valgrind_build==0 and tsan==0', {
3252 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3256 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3257 'MEMORY_SANITIZER_INITIAL_SIZE',
3258 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3259 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3262 ['win_use_allocator_shim==0', {
3263 'defines': ['NO_TCMALLOC'],
3265 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3266 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3267 # It seems to work fine with Ubuntu 12 headers though, so use it
3268 # in official builds.
3269 ['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")', {
3270 'target_conditions': [
3271 ['chromium_code==1', {
3272 # Non-chromium code is not guaranteed to compile cleanly
3273 # with _FORTIFY_SOURCE. Also, fortified build may fail
3274 # when optimizations are disabled, so only do that for Release
3277 '_FORTIFY_SOURCE=2',
3282 ['OS=="linux" or OS=="android"', {
3283 'target_conditions': [
3284 ['_toolset=="target"', {
3286 '<@(release_extra_cflags)',
3289 ['enable_resource_whitelist_generation==1', {
3291 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3300 'NS_BLOCK_ASSERTIONS=1',
3306 # Concrete configurations
3309 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3312 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3317 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3318 'target_conditions': [
3319 [ '_type=="executable"', {
3320 # To get a real .dSYM bundle produced by dsymutil, set the
3321 # debug information format to dwarf-with-dsym. Since
3322 # strip_from_xcode will not be used, set Xcode to do the
3323 # stripping as well.
3325 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3326 'DEPLOYMENT_POSTPROCESSING': 'YES',
3327 'STRIP_INSTALLED_PRODUCT': 'YES',
3334 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3336 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3339 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3347 'target_defaults': {
3354 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3355 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3356 'target_defaults': {
3358 '-Wl,--fatal-warnings',
3362 ['os_posix==1 and chromeos==0', {
3363 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3364 # and we want to avoid overriding this, so stack-protector is only
3365 # enabled when not building on Chrome OS.
3366 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3368 'target_defaults': {
3370 '-fstack-protector',
3371 '--param=ssp-buffer-size=4',
3375 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3376 'target_defaults': {
3377 # Enable -Werror by default, but put it in a variable so it can
3378 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3380 'werror%': '-Werror',
3381 'libraries_for_target%': '',
3384 '_FILE_OFFSET_BITS=64',
3387 '<(werror)', # See note above about the werror variable.
3390 '-fno-strict-aliasing', # See http://crbug.com/32204
3392 # TODO(evan): turn this back on once all the builds work.
3394 # Don't warn about unused function params. We use those everywhere.
3395 '-Wno-unused-parameter',
3396 # Don't warn about the "struct foo f = {0};" initialization pattern.
3397 '-Wno-missing-field-initializers',
3398 # Don't export any symbols (for example, to plugins we dlopen()).
3399 # Note: this is *required* to make some plugins work.
3400 '-fvisibility=hidden',
3405 '-fno-threadsafe-statics',
3406 # Make inline functions have hidden visiblity by default.
3407 # Surprisingly, not covered by -fvisibility=hidden.
3408 '-fvisibility-inlines-hidden',
3409 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3410 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3414 '-pthread', '-Wl,-z,noexecstack',
3417 '<(libraries_for_target)',
3422 'debug_optimize%': '0',
3428 '-O>(debug_optimize)',
3434 # Warn in case of text relocations.
3435 '-Wl,--warn-shared-textrel',
3438 ['OS=="android" and android_full_debug==0', {
3439 # Some configurations are copied from Release_Base to reduce
3442 'debug_optimize%': 's',
3446 '-ffunction-sections',
3453 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3454 # We don't omit frame pointers on arm64 since they are required
3455 # to correctly unwind stackframes which contain system library
3456 # function frames (crbug.com/391706).
3458 '-fomit-frame-pointer',
3461 ['OS=="linux" and target_arch=="ia32"', {
3463 '-Wl,--no-as-needed',
3466 ['debug_unwind_tables==1', {
3467 'cflags': ['-funwind-tables'],
3469 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3471 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3472 # definitions in to the right scope to use them when setting
3473 # linux_use_debug_fission, so it can be used here alone.
3474 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3475 'cflags': ['-gsplit-dwarf'],
3481 'release_optimize%': '2',
3482 # Binaries become big and gold is unable to perform GC
3483 # and remove unused sections for some of test targets
3484 # on 32 bit platform.
3485 # (This is currently observed only in chromeos valgrind bots)
3486 # The following flag is to disable --gc-sections linker
3487 # option for these bots.
3488 'no_gc_sections%': 0,
3490 # TODO(bradnelson): reexamine how this is done if we change the
3491 # expansion of configurations
3492 'release_valgrind_build%': 0,
3495 '-O<(release_optimize)',
3496 # Don't emit the GCC version ident directives, they just end up
3497 # in the .comment section taking up binary size.
3499 # Put data and code in their own sections, so that unused symbols
3500 # can be removed at link time with --gc-sections.
3502 '-ffunction-sections',
3505 # Specifically tell the linker to perform optimizations.
3506 # See http://lwn.net/Articles/192624/ .
3511 ['no_gc_sections==0', {
3513 '-Wl,--gc-sections',
3516 ['OS=="android" and target_arch!="arm64"', {
3517 # We don't omit frame pointers on arm64 since they are required
3518 # to correctly unwind stackframes which contain system library
3519 # function frames (crbug.com/391706).
3521 '-fomit-frame-pointer',
3526 'release_optimize%': 's',
3529 # Warn in case of text relocations.
3530 '-Wl,--warn-shared-textrel',
3537 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed
3538 # and the fix is in chromium.
3539 'cflags': [ '-fno-slp-vectorize', ],
3543 '-fno-omit-frame-pointer',
3547 ['profiling_full_stack_frames==1', {
3550 '-fno-optimize-sibling-calls',
3555 ['release_unwind_tables==1', {
3556 'cflags': ['-funwind-tables'],
3558 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3564 ['target_arch=="ia32"', {
3565 'target_conditions': [
3566 ['_toolset=="target"', {
3568 # Needed so that libs with .s files (e.g. libicudata.a)
3569 # are compatible with the general 32-bit-ness.
3572 # All floating-point computations on x87 happens in 80-bit
3573 # precision. Because the C and C++ language standards allow
3574 # the compiler to keep the floating-point values in higher
3575 # precision than what's specified in the source and doing so
3576 # is more efficient than constantly rounding up to 64-bit or
3577 # 32-bit precision as specified in the source, the compiler,
3578 # especially in the optimized mode, tries very hard to keep
3579 # values in x87 floating-point stack (in 80-bit precision)
3580 # as long as possible. This has important side effects, that
3581 # the real value used in computation may change depending on
3582 # how the compiler did the optimization - that is, the value
3583 # kept in 80-bit is different than the value rounded down to
3584 # 64-bit or 32-bit. There are possible compiler options to
3585 # make this behavior consistent (e.g. -ffloat-store would keep
3586 # all floating-values in the memory, thus force them to be
3587 # rounded to its original precision) but they have significant
3588 # runtime performance penalty.
3590 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3591 # which keep floating-point values in SSE registers in its
3592 # native precision (32-bit for single precision, and 64-bit
3593 # for double precision values). This means the floating-point
3594 # value used during computation does not change depending on
3595 # how the compiler optimized the code, since the value is
3596 # always kept in its specified precision.
3598 # Refer to http://crbug.com/348761 for rationale behind SSE2
3599 # being a minimum requirement for 32-bit Linux builds and
3600 # http://crbug.com/313032 for an example where this has "bit"
3605 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3612 # Use gold linker for Android ia32 target.
3618 # Install packages have started cropping up with
3619 # different headers between the 32-bit and 64-bit
3620 # versions, so we have to shadow those differences off
3621 # and make sure a 32-bit-on-64-bit build picks up the
3623 # For android build, use NDK headers instead of host headers
3624 ['host_arch!="ia32" and OS!="android"', {
3633 ['target_arch=="x64"', {
3634 'target_conditions': [
3635 ['_toolset=="target"', {
3637 # Use gold linker for Android x64 target.
3654 ['target_arch=="arm"', {
3655 'target_conditions': [
3656 ['_toolset=="target"', {
3658 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3659 # has changed whenever it encounters a varargs function. This
3660 # silences those warnings, as they are not helpful and
3661 # clutter legitimate warnings.
3667 '-march=<(arm_arch)',
3672 '-mtune=<(arm_tune)',
3680 ['arm_float_abi!=""', {
3682 '-mfloat-abi=<(arm_float_abi)',
3691 # Most of the following flags are derived from what Android
3692 # uses by default when building for arm, reference for which
3693 # can be found in the following file in the Android NDK:
3694 # toolchains/arm-linux-androideabi-4.8/setup.mk
3696 # The tree-sra optimization (scalar replacement for
3697 # aggregates enabling subsequent optimizations) leads to
3698 # invalid code generation when using the Android NDK's
3699 # compiler (r5-r7). This can be verified using
3700 # webkit_unit_tests' WTF.Checked_int8_t test.
3702 # The following 6 options are disabled to save on
3703 # binary size in gcc 4.8.
3704 # TODO(fdegans) Reevaluate when we upgrade GCC.
3705 '-fno-partial-inlining',
3706 '-fno-early-inlining',
3707 '-fno-tree-copy-prop',
3708 '-fno-tree-loop-optimize',
3709 '-fno-move-loop-invariants',
3710 '-fno-caller-saves',
3713 # Android now supports .relro sections properly.
3714 # NOTE: While these flags enable the generation of .relro
3715 # sections, the generated libraries can still be loaded on
3716 # older Android platform versions.
3724 'cflags': [ '-mthumb-interwork' ],
3728 # Thumb code with frame pointer makes chrome crash
3731 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3732 # The perf report sometimes incorrectly attributes
3733 # code from tail calls.
3734 '-fno-optimize-sibling-calls',
3737 '-fomit-frame-pointer',
3742 # Clang does not support the following options.
3743 '-mthumb-interwork',
3744 '-finline-limit=64',
3746 '-fno-partial-inlining',
3747 '-fno-early-inlining',
3748 '-fno-tree-copy-prop',
3749 '-fno-tree-loop-optimize',
3750 '-fno-move-loop-invariants',
3751 '-fno-caller-saves',
3755 # TODO(hans) Enable integrated-as (crbug.com/124610).
3756 '-no-integrated-as',
3757 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3761 # Clang does not support the following options.
3765 # As long as -fuse-ld=gold doesn't work, add a dummy directory
3766 # with an 'ld' that redirects to gold, so that clang uses gold.
3767 '-B<!(cd <(DEPTH) && pwd -P)/build/android/arm-linux-androideabi-gold',
3772 '-marm', # Required for frame pointer based stack traces.
3779 # We set arm_arch to "" so that -march compiler option
3780 # is not set. Otherwise a gcc bug that would complain
3781 # about it conflicting with '-mcpu=cortex-a9'. The flag
3782 # '-march=armv7-a' is actually redundant anyway because
3783 # it is enabled by default when we built the toolchain.
3784 # And using '-mcpu=cortex-a9' should be sufficient.
3787 # Breakpad requires symbols with debugging information
3791 # We want to statically link libstdc++/libgcc_s.
3792 '-static-libstdc++',
3796 # Some components in Chromium (e.g. v8, skia, ffmpeg)
3797 # define their own cflags for arm builds that could
3798 # conflict with the flags we set here (e.g.
3799 # '-mcpu=cortex-a9'). Remove these flags explicitly.
3808 ['target_arch=="arm64"', {
3809 'target_conditions': [
3810 ['_toolset=="target"', {
3814 '-fstack-protector', # stack protector is always enabled on arm64.
3821 ['target_arch=="mipsel"', {
3822 'target_conditions': [
3823 ['_toolset=="target"', {
3825 ['android_webview_build==0 and mips_arch_variant=="mips32r2"', {
3826 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
3828 ['android_webview_build==0 and mips_arch_variant!="mips32r2"', {
3829 'cflags': ['-mips32', '-Wa,-mips32'],
3838 '-Wl,--no-keep-memory'
3841 '-Wno-uninitialized',
3855 'target_conditions': [
3856 ['_toolset=="target"', {
3858 '--sysroot=<(sysroot)',
3861 '--sysroot=<(sysroot)',
3862 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
3870 # Don't die on dtoa code that uses a char as an array index.
3871 '-Wno-char-subscripts',
3873 # TODO(thakis): This used to be implied by -Wno-unused-function,
3874 # which we no longer use. Check if it makes sense to remove
3875 # this as well. http://crbug.com/316352
3876 '-Wno-unneeded-internal-declaration',
3878 # Warns on switches on enums that cover all enum values but
3879 # also contain a default: branch. Chrome is full of that.
3880 '-Wno-covered-switch-default',
3882 # Warns when a const char[] is converted to bool.
3883 '-Wstring-conversion',
3885 # C++11-related flags:
3887 # This warns on using ints as initializers for floats in
3888 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
3889 # which happens in several places in chrome code. Not sure if
3890 # this is worth fixing.
3891 '-Wno-c++11-narrowing',
3893 # TODO(thakis): Remove, http://crbug.com/263960
3894 '-Wno-reserved-user-defined-literal',
3896 # Clang considers the `register` keyword as deprecated, but e.g.
3897 # code generated by flex (used in angle) contains that keyword.
3898 # http://crbug.com/255186
3899 '-Wno-deprecated-register',
3902 # Clang doesn't seem to know know this flag.
3906 # See the comment in the Mac section for what it takes to move
3907 # this to -std=c++11.
3911 ['clang==1 and clang_use_chrome_plugins==1', {
3913 '<@(clang_chrome_plugins_flags)',
3916 ['clang==1 and clang_load!=""', {
3918 '-Xclang', '-load', '-Xclang', '<(clang_load)',
3921 ['clang==1 and clang_add_plugin!=""', {
3923 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
3926 ['clang==1 and target_arch=="ia32"', {
3928 # Else building libyuv gives clang's register allocator issues,
3929 # see llvm.org/PR15798 / crbug.com/233709
3930 '-momit-leaf-frame-pointer',
3933 ['clang==1 and "<(GENERATOR)"=="ninja"', {
3935 # See http://crbug.com/110262
3936 '-fcolor-diagnostics',
3939 # Common options for AddressSanitizer, LeakSanitizer,
3940 # ThreadSanitizer and MemorySanitizer.
3941 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
3942 'target_conditions': [
3943 ['_toolset=="target"', {
3945 '-fno-omit-frame-pointer',
3946 '-gline-tables-only',
3949 '-fomit-frame-pointer',
3954 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
3955 'target_conditions': [
3956 ['_toolset=="target"', {
3958 # Functions interposed by the sanitizers can make ld think
3959 # that some libraries aren't needed when they actually are,
3960 # http://crbug.com/234010. As workaround, disable --as-needed.
3964 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3965 'MEMORY_SANITIZER_INITIAL_SIZE',
3969 # TODO(glider): enable the default options on other systems.
3971 ['use_sanitizer_options==1 and OS=="linux" and (chromeos==0 or target_arch!="ia32")', {
3973 '<(DEPTH)/base/base.gyp:sanitizer_options',
3979 'target_conditions': [
3980 ['_toolset=="target"', {
3982 '-fsanitize=address',
3985 '-fsanitize=address',
3992 '-mllvm -asan-globals=0', # http://crbug.com/352073
3998 'target_conditions': [
3999 ['_toolset=="target"', {
4001 '-fsanitize=undefined',
4002 # -fsanitize=vptr is incompatible with -fno-rtti.
4003 '-fno-sanitize=vptr',
4006 '-fsanitize=undefined',
4007 # -fsanitize=vptr is incompatible with -fno-rtti.
4008 '-fno-sanitize=vptr',
4014 'target_conditions': [
4015 ['_toolset=="target"', {
4018 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4030 'UNDEFINED_SANITIZER',
4035 ['asan_coverage!=0', {
4036 'target_conditions': [
4037 ['_toolset=="target"', {
4039 '-mllvm -asan-coverage=<(asan_coverage)',
4045 'target_conditions': [
4046 ['_toolset=="target"', {
4055 'WTF_USE_LEAK_SANITIZER=1',
4061 'target_conditions': [
4062 ['_toolset=="target"', {
4064 '-fsanitize=thread',
4066 '-fsanitize-blacklist=<(tsan_blacklist)',
4069 '-fsanitize=thread',
4073 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4074 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4076 'target_conditions': [
4077 ['_type=="executable"', {
4087 'target_conditions': [
4088 ['_toolset=="target"', {
4090 '-fsanitize=memory',
4091 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4093 '-fsanitize-blacklist=<(msan_blacklist)',
4096 '-fsanitize=memory',
4101 'target_conditions': [
4102 ['_type=="executable"', {
4111 ['use_instrumented_libraries==1', {
4113 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4116 ['use_custom_libcxx==1', {
4118 '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4121 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4122 'target_conditions' : [
4123 # crazy_linker has an upstream gyp file we can't edit, and we
4124 # don't want to instrument it.
4125 ['_toolset=="target" and _target_name!="crazy_linker"', {
4127 '-finstrument-functions',
4128 # Allow mmx intrinsics to inline, so that the
4129 #0 compiler can expand the intrinsics.
4130 '-finstrument-functions-exclude-file-list=mmintrin.h',
4133 ['_toolset=="target" and OS=="android"', {
4135 # Avoids errors with current NDK:
4136 # "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"
4137 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4142 ['linux_dump_symbols==1', {
4145 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4146 'target_conditions': [
4147 ['_toolset=="target"', {
4149 # Attempt to use less memory to prevent the linker from
4150 # running out of address space. Considering installing a
4151 # 64-bit kernel and switching to a 64-bit linker.
4152 '-Wl,--no-keep-memory',
4159 ['use_allocator!="tcmalloc"', {
4160 'defines': ['NO_TCMALLOC'],
4162 ['linux_use_gold_flags==1', {
4163 'target_conditions': [
4164 ['_toolset=="target"', {
4166 # Experimentation found that using four linking threads
4167 # saved ~20% of link time.
4168 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4169 # Only apply this to the target linker, since the host
4170 # linker might not be gold, but isn't used much anyway.
4171 # TODO(raymes): Disable threading because gold is frequently
4172 # crashing on the bots: crbug.com/161942.
4174 # '-Wl,--thread-count=4',
4179 ['release_valgrind_build==0', {
4180 'target_conditions': [
4181 ['_toolset=="target"', {
4183 # There seems to be a conflict of --icf and -pie
4184 # in gold which can generate crashy binaries. As
4185 # a security measure, -pie takes precedence for
4193 # Newer gcc's support -fuse-ld, use the flag to force gold
4195 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4196 # TODO(mithro): Watch for clang support at following thread:
4197 # http://clang-developers.42468.n3.nabble.com/Adding-fuse-ld-support-to-clang-td4032180.html
4198 ['gcc_version>=48 and clang==0', {
4199 'target_conditions': [
4200 ['_toolset=="target"', {
4207 ['host_gcc_version>=48 and clang==0', {
4208 'target_conditions': [
4209 ['_toolset=="host"', {
4218 ['linux_use_bundled_binutils==1', {
4220 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4223 ['linux_use_bundled_gold==1', {
4224 # Put our binutils, which contains gold in the search path. We pass
4225 # the path to gold to the compiler. gyp leaves unspecified what the
4226 # cwd is when running the compiler, so the normal gyp path-munging
4227 # fails us. This hack gets the right path.
4229 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4232 # Some binutils 2.23 releases may or may not have new dtags enabled,
4233 # but they are all compatible with --disable-new-dtags,
4234 # because the new dynamic tags are not created by default.
4235 ['binutils_version>=223', {
4236 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4237 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4238 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4239 # inside this file to allow usage of --no-as-needed and removal of
4242 '-Wl,--disable-new-dtags',
4245 ['gcc_version>=47 and clang==0', {
4246 'target_conditions': [
4247 ['_toolset=="target"', {
4250 # See comment for -Wno-c++11-narrowing.
4252 # TODO(thakis): Remove, http://crbug.com/263960
4253 '-Wno-literal-suffix',
4258 ['host_gcc_version>=47 and clang==0', {
4259 'target_conditions': [
4260 ['_toolset=="host"', {
4263 # See comment for -Wno-c++11-narrowing.
4265 # TODO(thakis): Remove, http://crbug.com/263960
4266 '-Wno-literal-suffix',
4274 # FreeBSD-specific options; note that most FreeBSD options are set above,
4277 'target_defaults': {
4279 '-Wl,--no-keep-memory',
4283 # Android-specific options; note that most are set above with Linux.
4286 # This is a unique identifier for a given build. It's used for
4287 # identifying various build artifacts corresponding to a particular
4288 # build of chrome (e.g. where to find archived symbols).
4289 'chrome_build_id%': '',
4291 # Use shared stlport library when system one used.
4292 # Figure this out early since it needs symbols from libgcc.a, so it
4293 # has to be before that in the set of libraries.
4294 ['use_system_stlport==1', {
4295 'android_stlport_library': 'stlport',
4298 ['component=="shared_library"', {
4299 'android_stlport_library': 'stlport_shared',
4301 'android_stlport_library': 'stlport_static',
4307 # Placing this variable here prevents from forking libvpx, used
4308 # by remoting. Remoting is off, so it needn't built,
4309 # so forking it's deps seems like overkill.
4310 # But this variable need defined to properly run gyp.
4311 # A proper solution is to have an OS==android conditional
4312 # in third_party/libvpx/libvpx.gyp to define it.
4313 'libvpx_path': 'lib/linux/arm',
4315 'target_defaults': {
4317 'release_extra_cflags%': '',
4319 # If we're using the components build, append "cr" to all shared
4320 # libraries to avoid naming collisions with android system library
4321 # versions with the same name (e.g. skia, icu).
4322 ['component=="shared_library"', {
4323 'android_product_extension': 'cr.so',
4325 'android_product_extension': 'so',
4329 'target_conditions': [
4330 ['_type=="shared_library"', {
4331 'product_extension': '<(android_product_extension)',
4334 # Settings for building device targets using Android's toolchain.
4335 # These are based on the setup.mk file from the Android NDK.
4337 # The NDK Android executable link step looks as follows:
4339 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4340 # $(PRIVATE_OBJECTS) <-- The .o that we built
4341 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4342 # $(TARGET_LIBGCC) <-- libgcc.a
4343 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4344 # $(PRIVATE_LDLIBS) <-- System .so
4345 # $(TARGET_CRTEND_O) <-- crtend.o
4347 # For now the above are approximated for executables by adding
4348 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4351 # The NDK Android shared library link step looks as follows:
4353 # $(PRIVATE_OBJECTS) <-- The .o that we built
4354 # -l,--whole-archive
4355 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4356 # -l,--no-whole-archive
4357 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4358 # $(TARGET_LIBGCC) <-- libgcc.a
4359 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4360 # $(PRIVATE_LDLIBS) <-- System .so
4362 # For now, assume that whole static libraries are not needed.
4364 # For both executables and shared libraries, add the proper
4365 # libgcc.a to the start of libraries which puts it in the
4366 # proper spot after .o and .a files get linked in.
4368 # TODO: The proper thing to do longer-tem would be proper gyp
4369 # support for a custom link command line.
4370 ['_toolset=="target"', {
4372 '-pthread', # Not supported by Android toolchain.
4375 '-ffunction-sections',
4378 '-fstack-protector',
4380 '-finline-limit=64',
4381 '-Wa,--noexecstack',
4382 '<@(release_extra_cflags)',
4386 '__GNU_SOURCE=1', # Necessary for clone()
4388 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4389 'CHROME_BUILD_ID="<(chrome_build_id)"',
4392 '-pthread', # Not supported by Android toolchain.
4396 '-Wl,--no-undefined',
4397 # Don't export symbols from statically linked libraries.
4398 '-Wl,--exclude-libs=ALL',
4401 '-l<(android_stlport_library)',
4402 # Manually link the libgcc.a that the cross compiler uses.
4403 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4409 ['component=="shared_library"', {
4411 '-Wl,--exclude-libs=ALL',
4416 # Work around incompatibilities between bionic and clang
4418 '-D__compiler_offsetof=__builtin_offsetof',
4419 '-Dnan=__builtin_nan',
4422 ['target_arch=="arm"', {
4424 '-target arm-linux-androideabi',
4427 '-target arm-linux-androideabi',
4430 ['target_arch=="ia32"', {
4432 '-target x86-linux-androideabi',
4435 '-target x86-linux-androideabi',
4438 # Place holder for x64 support, not tested.
4439 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4440 ['target_arch=="x64"', {
4442 '-target x86_64-linux-androideabi',
4445 '-target x86_64-linux-androideabi',
4452 # Android build relies on -Wl,--gc-sections removing
4453 # unreachable code. ASan instrumentation for globals inhibits
4454 # this and results in a library with unresolvable relocations.
4455 # TODO(eugenis): find a way to reenable this.
4456 '-mllvm -asan-globals=0',
4459 ['android_webview_build==0', {
4461 # The NDK has these things, but doesn't define the constants
4462 # to say that it does. Define them here instead.
4466 '--sysroot=<(android_ndk_sysroot)',
4469 '--sysroot=<(android_ndk_sysroot)',
4472 ['android_webview_build==1', {
4474 # OpenAL headers from the Android tree.
4475 '<(android_src)/frameworks/wilhelm/include',
4478 # Android predefines this as 1; undefine it here so Chromium
4479 # can redefine it later to be 2 for chromium code and unset
4480 # for third party code. This works because cflags are added
4482 '-U_FORTIFY_SOURCE',
4483 # Disable any additional warnings enabled by the Android build system but which
4484 # chromium does not build cleanly with (when treating warning as errors).
4485 # Things that are part of -Wextra:
4486 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4487 '-Wno-ignored-qualifiers',
4489 '-Wno-unused-but-set-variable',
4492 # Other things unrelated to -Wextra:
4493 '-Wno-non-virtual-dtor',
4497 ['android_webview_build==1', {
4498 'target_conditions': [
4499 ['chromium_code==0', {
4501 # There is a class of warning which:
4502 # 1) Android always enables and also treats as errors
4503 # 2) Chromium ignores in third party code
4504 # So we re-enable those warnings when building Android.
4506 '-Wno-format-security',
4508 '-Wno-sequence-point',
4511 '-Wno-non-virtual-dtor',
4516 ['target_arch == "arm"', {
4518 # Enable identical code folding to reduce size.
4522 # NOTE: The stlport header include paths below are specified in
4523 # cflags rather than include_dirs because they need to come
4524 # after include_dirs. Think of them like system headers, but
4525 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4526 # toolchain (circa Gingerbread) will exhibit strange errors.
4527 # The include ordering here is important; change with caution.
4528 ['use_system_stlport==1', {
4530 # For libstdc++/include, which is used by stlport.
4531 '-I<(android_src)/bionic',
4532 '-I<(android_src)/external/stlport/stlport',
4534 }, { # else: use_system_stlport!=1
4536 '-isystem<(android_stlport_include)',
4539 '-L<(android_stlport_libs_dir)',
4542 ['target_arch=="ia32"', {
4543 # The x86 toolchain currently has problems with stack-protector.
4545 '-fstack-protector',
4548 '-fno-stack-protector',
4552 'target_conditions': [
4553 ['_type=="executable"', {
4554 # Force android tools to export the "main" symbol so they can be
4555 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4556 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4557 # when ICS support will be dropped.
4560 '-fvisibility=default',
4564 '-Wl,--gc-sections',
4565 '-Wl,-z,nocopyreloc',
4568 # crtbegin_dynamic.o should be the last item in ldflags.
4569 '<(android_ndk_lib)/crtbegin_dynamic.o',
4572 # crtend_android.o needs to be the last item in libraries.
4573 # Do not add any libraries after this!
4574 '<(android_ndk_lib)/crtend_android.o',
4577 ['_type=="shared_library" or _type=="loadable_module"', {
4579 '-Wl,--exclude-libs=ALL',
4582 '-Wl,-shared,-Bsymbolic',
4585 ['android_webview_build==0', {
4587 # crtbegin_so.o should be the last item in ldflags.
4588 '<(android_ndk_lib)/crtbegin_so.o',
4591 # crtend_so.o needs to be the last item in libraries.
4592 # Do not add any libraries after this!
4593 '<(android_ndk_lib)/crtend_so.o',
4600 # Settings for building host targets using the system toolchain.
4601 ['_toolset=="host"', {
4603 # Due to issues in Clang build system, using ASan on 32-bit
4604 # binaries on x86_64 host is problematic.
4605 # TODO(eugenis): re-enable.
4606 '-fsanitize=address',
4609 '-fsanitize=address',
4610 '-Wl,-z,noexecstack',
4611 '-Wl,--gc-sections',
4614 '-Wl,--warn-shared-textrel',
4615 '-Wl,--fatal-warnings',
4618 # Settings for building host targets on mac.
4619 ['_toolset=="host" and host_os=="mac"', {
4629 'cflags!': ['-fvisibility=hidden'],
4630 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4632 ['OS=="mac" or OS=="ios"', {
4633 'target_defaults': {
4636 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4637 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4638 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4639 'COPY_PHASE_STRIP': 'NO',
4640 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4641 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4642 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4643 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4644 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4645 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4646 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4647 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4648 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4649 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4650 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4651 'GCC_VERSION': '4.2',
4652 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4653 'USE_HEADERMAP': 'NO',
4658 # Don't warn about unused function parameters.
4659 '-Wno-unused-parameter',
4660 # Don't warn about the "struct foo f = {0};" initialization
4662 '-Wno-missing-field-initializers',
4665 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4666 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4668 # Note that the prebuilt Clang binaries should not be used for iOS
4669 # development except for ASan builds.
4671 # gnu++11 instead of c++11 is needed because some code uses
4672 # typeof() (a GNU extension).
4673 # TODO(thakis): Eventually switch this to c++11 instead of
4674 # gnu++11 (once typeof can be removed, which is blocked on c++11
4675 # being available everywhere).
4676 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', # -std=gnu++11
4677 # Warn if automatic synthesis is triggered with
4678 # the -Wobjc-missing-property-synthesis flag.
4679 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4680 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4684 # This warns on using ints as initializers for floats in
4685 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
4686 # which happens in several places in chrome code. Not sure if
4687 # this is worth fixing.
4688 '-Wno-c++11-narrowing',
4690 # Don't die on dtoa code that uses a char as an array index.
4691 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
4692 '-Wno-char-subscripts',
4694 # TODO(thakis): This used to be implied by -Wno-unused-function,
4695 # which we no longer use. Check if it makes sense to remove
4696 # this as well. http://crbug.com/316352
4697 '-Wno-unneeded-internal-declaration',
4699 # Warns on switches on enums that cover all enum values but
4700 # also contain a default: branch. Chrome is full of that.
4701 '-Wno-covered-switch-default',
4703 # Warns when a const char[] is converted to bool.
4704 '-Wstring-conversion',
4706 # Clang considers the `register` keyword as deprecated, but
4707 # e.g. code generated by flex (used in angle) contains that
4708 # keyword. http://crbug.com/255186
4709 '-Wno-deprecated-register',
4711 # This warns on selectors from Cocoa headers (-length, -set).
4712 # cfe-dev is currently discussing the merits of this warning.
4713 # TODO(thakis): Reevaluate what to do with this, based one
4714 # cfe-dev discussion.
4715 '-Wno-selector-type-mismatch',
4718 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed
4719 # and the fix is in chromium.
4720 '-fno-slp-vectorize',
4724 ['clang_xcode==0', {
4725 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4726 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4730 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4732 '<@(clang_chrome_plugins_flags)',
4735 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4737 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4740 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4742 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4745 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4747 # See http://crbug.com/110262
4748 '-fcolor-diagnostics',
4751 ['OS=="ios" and target_subarch!="arm32" and \
4752 "<(GENERATOR)"=="xcode"', {
4754 # TODO(ios): when building Chrome for iOS on 64-bit platform
4755 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4756 # enabled. This cause failures when compiling protobuf code,
4757 # so disable the warning. http://crbug.com/359107
4758 '-Wno-shorten-64-to-32',
4766 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4772 '-fsanitize=address',
4773 '-mllvm -asan-globals=0', # http://crbug.com/352073
4774 '-gline-tables-only',
4778 ['asan_coverage!=0', {
4779 'target_conditions': [
4780 ['_toolset=="target"', {
4782 '-mllvm -asan-coverage=<(asan_coverage)',
4788 'target_conditions': [
4789 ['_type!="static_library"', {
4790 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4795 '-fsanitize=address',
4799 ['mac_write_linker_maps==1', {
4802 '-Wl,-map,>(_target_name).map',
4809 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4810 'target_conditions': [
4811 ['_type=="executable"', {
4817 # Define copy_asan_dylib_path in a variable ending in
4818 # _path so that gyp understands it's a path and
4819 # performs proper relativization during dict merging.
4820 'copy_asan_dylib_path':
4821 'mac/copy_asan_runtime_dylib.sh',
4823 'postbuild_name': 'Copy ASan runtime dylib',
4825 '<(copy_asan_dylib_path)',
4834 ], # target_conditions
4835 }, # target_defaults
4836 }], # OS=="mac" or OS=="ios"
4838 'target_defaults': {
4840 # Prevent Mac OS X AssertMacros.h from defining macros that collide
4841 # with common names, like 'check', 'require', and 'verify'.
4842 # (Included by system header. Also exists on iOS but not included.)
4843 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
4844 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
4847 # These should end with %, but there seems to be a bug with % in
4848 # variables that are intended to be set to different values in
4849 # different targets, like these.
4850 'mac_pie': 1, # Most executables can be position-independent.
4851 # Strip debugging symbols from the target.
4852 'mac_strip': '<(mac_strip_release)',
4856 ['mac_want_real_dsym=="default"', {
4859 'mac_real_dsym': '<(mac_want_real_dsym)'
4864 ['mac_want_real_dsym=="default"', {
4865 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
4867 'mac_real_dsym': '<(mac_want_real_dsym)'
4874 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
4875 # (Equivalent to -fPIC)
4876 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
4877 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4878 # Keep pch files below xcodebuild/.
4879 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
4881 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
4882 # xcode_setting, but not until all downstream projects' mac bots are
4883 # using xcode >= 4.6, because that's when the default value of the
4884 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
4885 # setting is a no-op as far as xcode is concerned, but the compiler
4886 # behaves differently based on whether -fno-strict-aliasing is
4888 '-fno-strict-aliasing', # See http://crbug.com/32204.
4891 'target_conditions': [
4892 ['_type=="executable"', {
4895 # Arranges for data (heap) pages to be protected against
4896 # code execution when running on Mac OS X 10.7 ("Lion"), and
4897 # ensures that the position-independent executable (PIE) bit
4898 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
4900 # Define change_mach_o_flags in a variable ending in _path
4901 # so that GYP understands it's a path and performs proper
4902 # relativization during dict merging.
4903 'change_mach_o_flags_path':
4904 'mac/change_mach_o_flags_from_xcode.sh',
4905 'change_mach_o_flags_options%': [
4907 'target_conditions': [
4908 ['mac_pie==0 or release_valgrind_build==1', {
4909 # Don't enable PIE if it's unwanted. It's unwanted if
4910 # the target specifies mac_pie=0 or if building for
4911 # Valgrind, because Valgrind doesn't understand slide.
4912 # See the similar mac_pie/release_valgrind_build check
4914 'change_mach_o_flags_options': [
4920 'postbuild_name': 'Change Mach-O Flags',
4922 '<(change_mach_o_flags_path)',
4923 '>@(change_mach_o_flags_options)',
4930 'asan_saves_file': 'asan.saves',
4933 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
4937 'target_conditions': [
4938 ['mac_pie==1 and release_valgrind_build==0', {
4939 # Turn on position-independence (ASLR) for executables. When
4940 # PIE is on for the Chrome executables, the framework will
4941 # also be subject to ASLR.
4942 # Don't do this when building for Valgrind, because Valgrind
4943 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
4944 # understand slide, and get rid of the Valgrind check.
4947 '-Wl,-pie', # Position-independent executable (MH_PIE)
4953 ['(_type=="executable" or _type=="shared_library" or \
4954 _type=="loadable_module") and mac_strip!=0', {
4955 'target_conditions': [
4956 ['mac_real_dsym == 1', {
4957 # To get a real .dSYM bundle produced by dsymutil, set the
4958 # debug information format to dwarf-with-dsym. Since
4959 # strip_from_xcode will not be used, set Xcode to do the
4960 # stripping as well.
4964 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
4965 'DEPLOYMENT_POSTPROCESSING': 'YES',
4966 'STRIP_INSTALLED_PRODUCT': 'YES',
4967 'target_conditions': [
4968 ['_type=="shared_library" or _type=="loadable_module"', {
4969 # The Xcode default is to strip debugging symbols
4970 # only (-S). Local symbols should be stripped as
4971 # well, which will be handled by -x. Xcode will
4972 # continue to insert -S when stripping even when
4973 # additional flags are added with STRIPFLAGS.
4975 }], # _type=="shared_library" or _type=="loadable_module"
4976 ['_type=="executable"', {
4979 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
4982 }], # _type=="executable" and asan==1
4983 ], # target_conditions
4985 }, # configuration "Release"
4987 }, { # mac_real_dsym != 1
4988 # To get a fast fake .dSYM bundle, use a post-build step to
4989 # produce the .dSYM and strip the executable. strip_from_xcode
4990 # only operates in the Release configuration.
4994 # Define strip_from_xcode in a variable ending in _path
4995 # so that gyp understands it's a path and performs proper
4996 # relativization during dict merging.
4997 'strip_from_xcode_path': 'mac/strip_from_xcode',
4999 'postbuild_name': 'Strip If Needed',
5000 'action': ['<(strip_from_xcode_path)'],
5004 ], # target_conditions
5005 }], # (_type=="executable" or _type=="shared_library" or
5006 # _type=="loadable_module") and mac_strip!=0
5007 ], # target_conditions
5008 }, # target_defaults
5011 'target_defaults': {
5012 'xcode_settings' : {
5013 # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang
5015 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',
5018 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5019 # additional flag to suppress the "unknown compiler option" error.
5020 # Restrict this flag to builds that are either compiling with Xcode
5021 # or compiling with Xcode's Clang. This will allow Ninja builds to
5022 # continue failing on unknown compiler options.
5023 # TODO(rohitrao): This flag is temporary and should be removed as
5024 # soon as the iOS bots are updated to use Xcode 5.1.
5025 ['clang_xcode==1', {
5027 '-Wno-unknown-warning-option',
5031 # Limit the valid architectures depending on "target_subarch".
5032 # This need to include the "arm" architectures but also the "x86"
5033 # ones (they are used when building for the simulator).
5034 ['target_subarch=="arm32"', {
5035 'VALID_ARCHS': ['armv7', 'i386'],
5037 ['target_subarch=="arm64"', {
5038 'VALID_ARCHS': ['arm64', 'x86_64'],
5040 ['target_subarch=="both"', {
5041 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5045 'target_conditions': [
5046 ['_toolset=="host"', {
5048 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5049 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5058 ['_toolset=="target"', {
5060 # This section should be for overriding host settings. But,
5061 # since we can't negate the iphone deployment target above, we
5062 # instead set it here for target only.
5063 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5064 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5067 ['_type=="executable"', {
5071 'DEPLOYMENT_POSTPROCESSING': 'YES',
5072 'STRIP_INSTALLED_PRODUCT': 'YES',
5077 # Remove dSYM to reduce build time.
5078 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5084 ['chromium_ios_signing', {
5085 # iOS SDK wants everything for device signed.
5086 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5088 'CODE_SIGNING_REQUIRED': 'NO',
5089 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5094 ], # target_conditions
5095 }, # target_defaults
5098 'target_defaults': {
5100 '_WIN32_WINNT=0x0602',
5107 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5108 'WIN32_LEAN_AND_MEAN',
5110 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5111 '_HAS_EXCEPTIONS=0',
5114 ['buildtype=="Official"', {
5115 # In official builds, targets can self-select an optimization
5116 # level by defining a variable named 'optimize', and setting it
5118 # - "size", optimizes for minimal code size - the default.
5119 # - "speed", optimizes for speed over code size.
5120 # - "max", whole program optimization and link-time code
5121 # generation. This is very expensive and should be used
5124 'optimize%': 'size',
5128 # Set /LTCG for the official builds.
5129 'LinkTimeCodeGeneration': '1',
5132 'target_conditions': [
5133 ['optimize=="size"', {
5135 'VCCLCompilerTool': {
5136 # 1, optimizeMinSpace, Minimize Size (/O1)
5137 'Optimization': '1',
5138 # 2, favorSize - Favor small code (/Os)
5139 'FavorSizeOrSpeed': '2',
5144 ['optimize=="speed"', {
5146 'VCCLCompilerTool': {
5147 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5148 'Optimization': '2',
5149 # 1, favorSpeed - Favor fast code (/Ot)
5150 'FavorSizeOrSpeed': '1',
5155 ['optimize=="max"', {
5156 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5157 # builds. Probably anything that this would catch that
5158 # wouldn't be caught in a normal build isn't going to
5159 # actually be a bug, so the incremental value of C4702 for
5160 # PGO builds is likely very small.
5161 'msvs_disabled_warnings': [
5165 'VCCLCompilerTool': {
5166 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5167 'Optimization': '2',
5168 # 1, favorSpeed - Favor fast code (/Ot)
5169 'FavorSizeOrSpeed': '1',
5170 # This implies link time code generation.
5171 'WholeProgramOptimization': 'true',
5189 'AdditionalLibraryDirectories':
5190 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5192 'VCLibrarianTool': {
5193 'AdditionalLibraryDirectories':
5194 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5200 'VCLibrarianTool': {
5201 'AdditionalLibraryDirectories':
5202 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5205 'AdditionalLibraryDirectories':
5206 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5211 # https://code.google.com/p/chromium/issues/detail?id=372451#c20
5212 # Warning 4702 ("Unreachable code") should be re-enabled once
5213 # Express users are updated to VS2013 Update 2.
5214 'msvs_disabled_warnings': [
5219 # Explicitly required when using the ATL with express
5220 'AdditionalDependencies': ['atlthunk.lib'],
5222 # ATL 8.0 included in WDK 7.1 makes the linker to generate
5223 # almost eight hundred LNK4254 and LNK4078 warnings:
5224 # - warning LNK4254: section 'ATL' (50000040) merged into
5225 # '.rdata' (40000040) with different attributes
5226 # - warning LNK4078: multiple 'ATL' sections found with
5227 # different attributes
5228 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
5231 'msvs_system_include_dirs': [
5232 '<(windows_driver_kit_path)/inc/atl71',
5233 '<(windows_driver_kit_path)/inc/mfc42',
5237 'msvs_system_include_dirs': [
5238 '<(windows_sdk_path)/Include/shared',
5239 '<(windows_sdk_path)/Include/um',
5240 '<(windows_sdk_path)/Include/winrt',
5241 '$(VSInstallDir)/VC/atlmfc/include',
5243 'msvs_cygwin_shell': 0,
5244 'msvs_disabled_warnings': [
5245 # C4127: conditional expression is constant
5246 # This warning can in theory catch dead code and other problems, but
5247 # triggers in far too many desirable cases where the conditional
5248 # expression is either set by macros or corresponds some legitimate
5249 # compile-time constant expression (due to constant template args,
5250 # conditionals comparing the sizes of different types, etc.). Some of
5251 # these can be worked around, but it's not worth it.
5254 # C4351: new behavior: elements of array 'array' will be default
5256 # This is a silly "warning" that basically just alerts you that the
5257 # compiler is going to actually follow the language spec like it's
5258 # supposed to, instead of not following it like old buggy versions
5259 # did. There's absolutely no reason to turn this on.
5262 # C4355: 'this': used in base member initializer list
5263 # It's commonly useful to pass |this| to objects in a class'
5264 # initializer list. While this warning can catch real bugs, most of
5265 # the time the constructors in question don't attempt to call methods
5266 # on the passed-in pointer (until later), and annotating every legit
5267 # usage of this is simply more hassle than the warning is worth.
5270 # C4503: 'identifier': decorated name length exceeded, name was
5272 # This only means that some long error messages might have truncated
5273 # identifiers in the presence of lots of templates. It has no effect
5274 # on program correctness and there's no real reason to waste time
5275 # trying to prevent it.
5278 # C4611: interaction between 'function' and C++ object destruction is
5280 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5281 # suggests using exceptions instead of setjmp/longjmp for C++, but
5282 # Chromium code compiles without exception support. We therefore have
5283 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5284 # means we have to turn off this warning (and be careful about how
5285 # object destruction happens in such cases).
5288 # TODO(maruel): These warnings are level 4. They will be slowly
5289 # removed as code is fixed.
5290 4100, # Unreferenced formal parameter
5291 4121, # Alignment of a member was sensitive to packing
5292 4189, # Local variable is initialized but not referenced
5293 4244, # Conversion from 'type1' to 'type2', possible loss of data
5294 4481, # Nonstandard extension used: override specifier 'keyword'
5295 4505, # Unreferenced local function has been removed
5296 4510, # Default constructor could not be generated
5297 4512, # Assignment operator could not be generated
5298 4610, # Object can never be instantiated
5301 'VCCLCompilerTool': {
5302 'AdditionalOptions': ['/MP'],
5303 'MinimalRebuild': 'false',
5304 'BufferSecurityCheck': 'true',
5305 'EnableFunctionLevelLinking': 'true',
5306 'RuntimeTypeInfo': 'false',
5307 'WarningLevel': '4',
5308 'WarnAsError': 'true',
5309 'DebugInformationFormat': '3',
5310 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5311 'ExceptionHandling': '0',
5313 'VCLibrarianTool': {
5314 'AdditionalOptions': ['/ignore:4221'],
5315 'AdditionalLibraryDirectories': [
5316 '<(windows_sdk_path)/Lib/win8/um/x86',
5320 'AdditionalDependencies': [
5332 'AdditionalLibraryDirectories': [
5333 '<(windows_sdk_path)/Lib/win8/um/x86',
5335 'GenerateDebugInformation': 'true',
5336 'MapFileName': '$(OutDir)\\$(TargetName).map',
5337 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5338 'FixedBaseAddress': '1',
5341 # 1 == /SUBSYSTEM:CONSOLE
5342 # 2 == /SUBSYSTEM:WINDOWS
5343 # Most of the executables we'll ever create are tests
5344 # and utilities with console output.
5348 'GenerateStublessProxies': 'true',
5349 'TypeLibraryName': '$(InputName).tlb',
5350 'OutputDirectory': '$(IntDir)',
5351 'HeaderFileName': '$(InputName).h',
5352 'DLLDataFileName': '$(InputName).dlldata.c',
5353 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5354 'ProxyFileName': '$(InputName)_p.c',
5356 'VCResourceCompilerTool': {
5358 'AdditionalIncludeDirectories': [
5360 '<(SHARED_INTERMEDIATE_DIR)',
5363 'target_conditions': [
5364 ['_type=="executable"', {
5366 'EmbedManifest': 'true',
5369 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5371 'AdditionalManifestFiles': [
5372 '>(win_exe_compatibility_manifest)',
5379 # Building with Clang on Windows is a work in progress and very
5380 # experimental. See crbug.com/82385.
5381 'VCCLCompilerTool': {
5382 'WarnAsError': 'false',
5383 'RuntimeTypeInfo': 'false',
5384 'AdditionalOptions': [
5385 '-fmsc-version=1800',
5388 # Many files use intrinsics without including this header.
5389 # TODO(hans): Fix those files, or move this to sub-GYPs.
5392 # TODO(hans): Make this list shorter eventually.
5393 '-Qunused-arguments',
5394 '-Wno-c++11-compat-deprecated-writable-strings',
5395 '-Wno-char-subscripts',
5396 '-Wno-deprecated-declarations',
5397 '-Wno-deprecated-register',
5399 '-Wno-enum-conversion',
5400 '-Wno-extra-tokens',
5401 '-Wno-ignored-attributes',
5402 '-Wno-incompatible-pointer-types',
5403 '-Wno-int-to-void-pointer-cast',
5404 '-Wno-invalid-noreturn',
5405 '-Wno-logical-op-parentheses',
5407 '-Wno-missing-braces',
5408 '-Wno-missing-declarations',
5409 '-Wno-msvc-include',
5410 '-Wno-null-dereference',
5411 '-Wno-overloaded-virtual',
5413 '-Wno-pointer-sign',
5415 '-Wno-return-type-c-linkage',
5417 '-Wno-sometimes-uninitialized',
5419 '-Wno-tautological-compare',
5420 '-Wno-unknown-pragmas',
5422 '-Wno-unused-function',
5423 '-Wno-unused-private-field',
5424 '-Wno-unused-value',
5425 '-Wno-unused-variable',
5431 # ASan on Windows is a work in progress and very experimental.
5432 # See crbug.com/345874.
5433 'VCCLCompilerTool': {
5434 'AdditionalOptions': [
5435 '-fsanitize=address',
5437 'AdditionalIncludeDirectories': [
5438 # MSVC needs to be able to find the sanitizer headers when
5439 # invoked via /fallback. This is critical for using macros
5440 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5442 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.5.0/include_sanitizer',
5446 'AdditionalLibraryDirectories': [
5447 # TODO(hans): If make_clang_dir is absolute, this breaks.
5448 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.5.0/lib/windows',
5451 'target_conditions': [
5452 ['_type=="executable"', {
5454 'AdditionalDependencies': [
5455 'clang_rt.asan-i386.lib',
5459 ['_type=="shared_library" or _type=="loadable_module"', {
5461 'AdditionalDependencies': [
5462 'clang_rt.asan_dll_thunk-i386.lib',
5472 ['disable_nacl==1', {
5473 'target_defaults': {
5479 ['OS=="win" and msvs_use_common_linker_extras', {
5480 'target_defaults': {
5495 'AdditionalOptions': [
5504 'AdditionalOptions': ['/largeaddressaware'],
5513 'AdditionalOptions': [
5514 # safeseh is not compatible with x64
5526 ['enable_new_npdevice_api==1', {
5527 'target_defaults': {
5529 'ENABLE_NEW_NPDEVICE_API',
5533 # Don't warn about the "typedef 'foo' locally defined but not used"
5535 # TODO: remove this flag once all builds work. See crbug.com/227506
5536 ['gcc_version>=48 and clang==0', {
5537 'target_defaults': {
5539 '-Wno-unused-local-typedefs',
5543 # We need a special case to handle the android webview build on mac because
5544 # the host gcc there doesn't accept this flag, but the target gcc may
5546 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5547 'target_defaults': {
5548 'target_conditions': [
5549 ['_toolset=="host"', {
5551 '-Wno-unused-local-typedefs',
5557 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5559 'make_global_settings': [
5560 ['CC', '<(make_clang_dir)/bin/clang'],
5561 ['CXX', '<(make_clang_dir)/bin/clang++'],
5562 ['CC.host', '$(CC)'],
5563 ['CXX.host', '$(CXX)'],
5566 ['clang==1 and OS=="win"', {
5567 'make_global_settings': [
5568 # On Windows, gyp's ninja generator only looks at CC.
5569 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5572 ['OS=="android" and clang==0', {
5573 # Hardcode the compiler names in the Makefile so that
5574 # it won't depend on the environment at make time.
5575 'make_global_settings': [
5576 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5577 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5578 ['CC.host', '<!(which gcc)'],
5579 ['CXX.host', '<!(which g++)'],
5582 ['OS=="linux" and target_arch=="mipsel"', {
5583 'make_global_settings': [
5584 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5585 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5586 ['CC.host', '<!(which gcc)'],
5587 ['CXX.host', '<!(which g++)'],
5590 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5591 # Set default ARM cross compiling on linux. These can be overridden
5592 # using CC/CXX/etc environment variables.
5593 'make_global_settings': [
5594 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5595 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5596 ['CC.host', '<!(which gcc)'],
5597 ['CXX.host', '<!(which g++)'],
5601 # TODO(yyanagisawa): supports GENERATOR==make
5602 # make generator doesn't support CC_wrapper without CC
5603 # in make_global_settings yet.
5604 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5605 'make_global_settings': [
5606 ['CC_wrapper', '<(gomadir)/gomacc'],
5607 ['CXX_wrapper', '<(gomadir)/gomacc'],
5608 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5609 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5614 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5615 # This block adds *project-wide* configuration settings to each project
5616 # file. It's almost always wrong to put things here. Specify your
5617 # custom xcode_settings in target_defaults to add them to targets instead.
5620 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5621 # setting sets the SDK on a project-wide basis. In order to get the
5622 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5623 # here at the project level.
5626 ['mac_sdk_path==""', {
5627 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5629 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5635 ['ios_sdk_path==""', {
5637 # TODO(justincohen): Ninja only supports simulator for now.
5638 ['"<(GENERATOR)"=="xcode"', {
5639 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5641 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5645 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5650 # Target both iPhone and iPad.
5651 'TARGETED_DEVICE_FAMILY': '1,2',
5654 ['target_arch=="x64"', {
5659 ['target_arch=="ia32"', {
5668 # The Xcode generator will look for an xcode_settings section at the root
5669 # of each dict and use it to apply settings on a file-wide basis. Most
5670 # settings should not be here, they should be in target-specific
5671 # xcode_settings sections, or better yet, should use non-Xcode-specific
5672 # settings in target dicts. SYMROOT is a special case, because many other
5673 # Xcode variables depend on it, including variables such as
5674 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5675 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5676 # files to appear (when present) in the UI as actual files and not red
5677 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5678 # and therefore SYMROOT, needs to be set at the project level.
5679 'SYMROOT': '<(DEPTH)/xcodebuild',