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.
2403 'clang_warning_flags': [
2406 # Don't die on dtoa code that uses a char as an array index.
2407 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2408 '-Wno-char-subscripts',
2410 # TODO(thakis): This used to be implied by -Wno-unused-function,
2411 # which we no longer use. Check if it makes sense to remove
2412 # this as well. http://crbug.com/316352
2413 '-Wno-unneeded-internal-declaration',
2415 # Warns on switches on enums that cover all enum values but
2416 # also contain a default: branch. Chrome is full of that.
2417 '-Wno-covered-switch-default',
2419 # Warns when a const char[] is converted to bool.
2420 '-Wstring-conversion',
2422 # C++11-related flags:
2424 # This warns on using ints as initializers for floats in
2425 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2426 # which happens in several places in chrome code. Not sure if
2427 # this is worth fixing.
2428 '-Wno-c++11-narrowing',
2430 # Clang considers the `register` keyword as deprecated, but e.g.
2431 # code generated by flex (used in angle) contains that keyword.
2432 # http://crbug.com/255186
2433 '-Wno-deprecated-register',
2436 'includes': [ 'set_clang_warning_flags.gypi', ],
2438 # Don't use deprecated V8 APIs anywhere.
2439 'V8_DEPRECATION_WARNINGS',
2440 # Temporary suppression until Blink code can be removed.
2441 'BLINK_SCALE_FILTERS_AT_RECORD_TIME',
2444 '<(SHARED_INTERMEDIATE_DIR)',
2447 ['(OS=="mac" or OS=="ios") and asan==1', {
2449 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2452 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2453 'cflags_cc!': ['-fno-rtti'],
2456 '-gline-tables-only',
2457 '-fintercept-allocation-functions',
2459 'defines': ['TYPE_PROFILING'],
2461 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2464 ['OS=="linux" and clang==1 and host_arch=="ia32"', {
2465 # TODO(dmikurube): Remove -Wno-sentinel when Clang/LLVM is fixed.
2466 # See http://crbug.com/162818.
2467 'cflags+': ['-Wno-sentinel'],
2469 ['branding=="Chrome"', {
2470 'defines': ['GOOGLE_CHROME_BUILD'],
2471 }, { # else: branding!="Chrome"
2472 'defines': ['CHROMIUM_BUILD'],
2474 ['OS=="mac" and component=="shared_library"', {
2476 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2477 'LD_RUNPATH_SEARCH_PATHS': [
2478 # For unbundled binaries.
2480 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2481 '@loader_path/../../..',
2485 ['clang==1 and OS!="win"', {
2486 # This is here so that all files get recompiled after a clang roll and
2487 # when turning clang on or off.
2488 # (defines are passed via the command line, and build systems rebuild
2489 # things when their commandline changes). Nothing should ever read this
2491 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2494 'defines': ['ENABLE_RLZ'],
2496 ['component=="shared_library"', {
2497 'defines': ['COMPONENT_BUILD'],
2499 ['toolkit_views==1', {
2500 'defines': ['TOOLKIT_VIEWS=1'],
2502 ['ui_compositor_image_transport==1', {
2503 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2506 'defines': ['USE_AURA=1'],
2509 'defines': ['USE_ASH=1'],
2512 'defines': ['USE_PANGO=1'],
2515 'defines': ['USE_CAIRO=1'],
2518 'defines': ['USE_CRAS=1'],
2521 'defines': ['USE_GLIB=1'],
2524 'defines': ['USE_OZONE=1'],
2526 ['use_default_render_theme==1', {
2527 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2529 ['use_libjpeg_turbo==1', {
2530 'defines': ['USE_LIBJPEG_TURBO=1'],
2533 'defines': ['USE_X11=1'],
2535 ['use_clipboard_aurax11==1', {
2536 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2538 ['enable_one_click_signin==1', {
2539 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2541 ['enable_pre_sync_backup==1', {
2542 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2544 ['use_xi2_mt!=0 and use_x11==1', {
2545 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2547 ['image_loader_extension==1', {
2548 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2551 'defines': ['ENABLE_PROFILING=1'],
2554 'defines': ['ENABLE_REMOTING=1'],
2556 ['enable_webrtc==1', {
2557 'defines': ['ENABLE_WEBRTC=1'],
2559 ['proprietary_codecs==1', {
2560 'defines': ['USE_PROPRIETARY_CODECS'],
2562 ['enable_viewport==1', {
2563 'defines': ['ENABLE_VIEWPORT'],
2565 ['enable_pepper_cdms==1', {
2566 'defines': ['ENABLE_PEPPER_CDMS'],
2568 ['enable_browser_cdms==1', {
2569 'defines': ['ENABLE_BROWSER_CDMS'],
2571 ['configuration_policy==1', {
2572 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2574 ['notifications==1', {
2575 'defines': ['ENABLE_NOTIFICATIONS'],
2577 ['enable_hidpi==1', {
2578 'defines': ['ENABLE_HIDPI=1'],
2580 ['native_discardable_memory==1', {
2581 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2583 ['native_memory_pressure_signals==1', {
2584 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2587 'defines': ['USE_UDEV'],
2591 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2594 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2595 # Clang creates chubby debug information, which makes linking very
2596 # slow. For now, don't create debug information with clang. See
2597 # http://crbug.com/70000
2601 'debug_extra_cflags': '-g0',
2604 # Android builds symbols on release by default, disable them.
2607 'debug_extra_cflags': '-g0',
2608 'release_extra_cflags': '-g0',
2612 }, { # else clang!=1
2614 ['OS=="win" and fastbuild==2', {
2615 # Completely disable debug information.
2618 'GenerateDebugInformation': 'false',
2620 'VCCLCompilerTool': {
2621 'DebugInformationFormat': '0',
2625 ['OS=="win" and fastbuild==1', {
2628 # This tells the linker to generate .pdbs, so that
2629 # we can get meaningful stack traces.
2630 'GenerateDebugInformation': 'true',
2632 'VCCLCompilerTool': {
2633 # No debug info to be generated by compiler.
2634 'DebugInformationFormat': '0',
2638 ['OS=="linux" and fastbuild==2', {
2640 'debug_extra_cflags': '-g0',
2643 ['OS=="linux" and fastbuild==1', {
2645 'debug_extra_cflags': '-g1',
2648 ['OS=="android" and fastbuild==2', {
2650 'debug_extra_cflags': '-g0',
2651 'release_extra_cflags': '-g0',
2654 ['OS=="android" and fastbuild==1', {
2656 'debug_extra_cflags': '-g1',
2657 'release_extra_cflags': '-g1',
2664 ['dont_embed_build_metadata==1', {
2666 'DONT_EMBED_BUILD_METADATA',
2668 }], # dont_embed_build_metadata==1
2669 ['dcheck_always_on!=0', {
2670 'defines': ['DCHECK_ALWAYS_ON=1'],
2671 }], # dcheck_always_on!=0
2672 ['tracing_like_official_build!=0', {
2673 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2674 }], # tracing_like_official_build!=0
2675 ['win_use_allocator_shim==0', {
2678 'defines': ['NO_TCMALLOC'],
2682 ['enable_eglimage==1', {
2684 'ENABLE_EGLIMAGE=1',
2689 'ADDRESS_SANITIZER',
2690 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2691 'MEMORY_SANITIZER_INITIAL_SIZE',
2695 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2703 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2704 'MEMORY_SANITIZER_INITIAL_SIZE',
2710 '_CRT_SECURE_NO_DEPRECATE',
2711 '_SCL_SECURE_NO_DEPRECATE',
2712 # This define is required to pull in the new Win8 interfaces from
2713 # system headers like ShObjIdl.h.
2714 'NTDDI_VERSION=0x06020000',
2715 # This is required for ATL to use XP-safe versions of its functions.
2716 '_USING_V110_SDK71_',
2719 '<(DEPTH)/third_party/wtl/include',
2724 # Generates debug info when win_z7=1
2725 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2727 'GenerateDebugInformation': 'true',
2729 'VCCLCompilerTool': {
2730 'DebugInformationFormat': '1',
2741 ['target_arch=="arm"', {
2743 # TODO(lcwu): Work around an error when building Chromium
2744 # with gcc-4.5.3 (e.g. v8/src/platform-linux.cc). Remove
2745 # this define once the toolchain is updated.
2746 # See crbug.com/388933.
2752 ['enable_task_manager==1', {
2754 'ENABLE_TASK_MANAGER=1',
2757 ['enable_extensions==1', {
2759 'ENABLE_EXTENSIONS=1',
2762 ['OS=="win" and branding=="Chrome"', {
2763 'defines': ['ENABLE_SWIFTSHADER'],
2765 ['enable_dart==1', {
2766 'defines': ['WEBKIT_USING_DART=1'],
2768 ['enable_plugin_installation==1', {
2769 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2771 ['enable_plugins==1', {
2772 'defines': ['ENABLE_PLUGINS=1'],
2774 ['enable_session_service==1', {
2775 'defines': ['ENABLE_SESSION_SERVICE=1'],
2777 ['enable_themes==1', {
2778 'defines': ['ENABLE_THEMES=1'],
2780 ['enable_autofill_dialog==1', {
2781 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2783 ['enable_prod_wallet_service==1', {
2784 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2786 ['enable_background==1', {
2787 'defines': ['ENABLE_BACKGROUND=1'],
2789 ['enable_google_now==1', {
2790 'defines': ['ENABLE_GOOGLE_NOW=1'],
2792 ['cld_version!=0', {
2793 'defines': ['CLD_VERSION=<(cld_version)'],
2795 ['cld_version==2', {
2796 # This is used to populate the "CLD Data Source" field in:
2797 # chrome://translate-internals
2798 'defines': ['CLD2_DATA_SOURCE=<(cld2_data_source)'],
2800 ['enable_printing==1', {
2801 'defines': ['ENABLE_FULL_PRINTING=1', 'ENABLE_PRINTING=1'],
2803 ['enable_printing==2', {
2804 'defines': ['ENABLE_PRINTING=1'],
2806 ['OS=="win" and win_pdf_metafile_for_printing==1', {
2807 'defines': ['WIN_PDF_METAFILE_FOR_PRINTING=1'],
2809 ['enable_spellcheck==1', {
2810 'defines': ['ENABLE_SPELLCHECK=1'],
2812 ['enable_captive_portal_detection==1', {
2813 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2815 ['enable_app_list==1', {
2816 'defines': ['ENABLE_APP_LIST=1'],
2818 ['enable_settings_app==1', {
2819 'defines': ['ENABLE_SETTINGS_APP=1'],
2821 ['disable_file_support==1', {
2822 'defines': ['DISABLE_FILE_SUPPORT=1'],
2824 ['disable_ftp_support==1', {
2825 'defines': ['DISABLE_FTP_SUPPORT=1'],
2827 ['use_icu_alternatives_on_android==1', {
2828 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2830 ['enable_managed_users==1', {
2831 'defines': ['ENABLE_MANAGED_USERS=1'],
2833 ['data_reduction_fallback_host != ""', {
2835 'DATA_REDUCTION_FALLBACK_HOST="<(data_reduction_fallback_host)"'],
2837 ['data_reduction_dev_host != ""', {
2839 'DATA_REDUCTION_DEV_HOST="<(data_reduction_dev_host)"'],
2841 ['spdy_proxy_auth_origin != ""', {
2842 'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'],
2844 ['spdy_proxy_auth_property != ""', {
2845 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2847 ['spdy_proxy_auth_value != ""', {
2848 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2850 ['data_reduction_proxy_probe_url != ""', {
2852 'DATA_REDUCTION_PROXY_PROBE_URL="<(data_reduction_proxy_probe_url)"'],
2854 ['data_reduction_proxy_warmup_url != ""', {
2856 'DATA_REDUCTION_PROXY_WARMUP_URL="<(data_reduction_proxy_warmup_url)"'],
2858 ['data_reduction_proxy_ssl_origin != ""', {
2860 'DATA_REDUCTION_PROXY_SSL_ORIGIN="<(data_reduction_proxy_ssl_origin)"'],
2862 ['data_reduction_proxy_alt_origin != ""', {
2864 'DATA_REDUCTION_PROXY_ALT_ORIGIN="<(data_reduction_proxy_alt_origin)"'],
2866 ['data_reduction_proxy_alt_fallback_origin != ""', {
2868 'DATA_REDUCTION_PROXY_ALT_FALLBACK_ORIGIN="<(data_reduction_proxy_alt_fallback_origin)"'],
2870 ['enable_mdns==1', {
2871 'defines': ['ENABLE_MDNS=1'],
2873 ['enable_service_discovery==1', {
2874 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2876 ['enable_wifi_bootstrapping==1', {
2877 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2879 ['enable_hangout_services_extension==1', {
2880 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2882 ['enable_ipc_fuzzer==1', {
2883 'defines': ['ENABLE_IPC_FUZZER=1'],
2886 'defines': ['VIDEO_HOLE=1'],
2888 ], # conditions for 'target_defaults'
2889 'target_conditions': [
2890 ['<(use_openssl)==1', {
2891 'defines': ['USE_OPENSSL=1'],
2893 ['<(use_openssl_certs)==1', {
2894 'defines': ['USE_OPENSSL_CERTS=1'],
2896 ['>(nacl_untrusted_build)==1', {
2899 'USE_OPENSSL_CERTS=1',
2902 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
2903 'defines': ['USE_NSS=1'],
2905 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
2906 'defines': ['OS_CHROMEOS=1'],
2908 ['enable_wexit_time_destructors==1', {
2909 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
2911 ['chromium_code==0', {
2913 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
2914 # We don't want to get warnings from third-party code,
2915 # so remove any existing warning-enabling flags like -Wall.
2921 # Don't warn about hash_map in third-party code.
2925 # Don't warn about printf format problems.
2926 # This is off by default in gcc but on in Ubuntu's gcc(!).
2930 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
2934 # TODO: Fix all warnings on chromeos too.
2935 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
2940 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
2942 # Don't warn about ignoring the return value from e.g. close().
2943 # This is off by default in some gccs but on by default in others.
2944 # BSD systems do not support this option, since they are usually
2945 # using gcc 4.2.1, which does not have this flag yet.
2946 '-Wno-unused-result',
2951 '_CRT_SECURE_NO_DEPRECATE',
2952 '_CRT_NONSTDC_NO_WARNINGS',
2953 '_CRT_NONSTDC_NO_DEPRECATE',
2954 '_SCL_SECURE_NO_DEPRECATE',
2956 'msvs_disabled_warnings': [4800],
2958 'VCCLCompilerTool': {
2959 'WarningLevel': '3',
2960 'WarnAsError': 'true',
2961 'Detect64BitPortabilityProblems': 'false',
2965 ['buildtype=="Official"', {
2967 'VCCLCompilerTool': { 'WarnAsError': 'false' },
2972 'VCCLCompilerTool': { 'WarnAsError': 'false' },
2977 # TODO(darin): Unfortunately, some third_party code depends on base.
2978 [ 'OS=="win" and component=="shared_library"', {
2979 'msvs_disabled_warnings': [
2980 4251, # class 'std::xx' needs to have dll-interface.
2983 [ 'OS=="mac" or OS=="ios"', {
2985 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
2988 ['buildtype=="Official"', {
2990 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
2997 # TODO(ios): Fix remaining warnings in third-party code, then
2998 # remove this; the Mac cleanup didn't get everything that's
2999 # flagged in an iOS build.
3000 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3001 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3002 # Several internal ios directories generate numerous warnings for
3003 # -Wobjc-missing-property-synthesis.
3004 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3010 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3011 'filename_rules.gypi',
3013 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3014 # C99 macros on Mac and Linux.
3016 '__STDC_CONSTANT_MACROS',
3017 '__STDC_FORMAT_MACROS',
3021 # turn on warnings for signed/unsigned mismatch on chromium code.
3023 'VCCLCompilerTool': {
3024 'AdditionalOptions': ['/we4389'],
3028 ['OS=="win" and component=="shared_library"', {
3029 'msvs_disabled_warnings': [
3030 4251, # class 'std::xx' needs to have dll-interface.
3035 ], # target_conditions for 'target_defaults'
3036 'default_configuration': 'Debug',
3038 # VCLinkerTool LinkIncremental values below:
3040 # 1 == /INCREMENTAL:NO
3042 # Debug links incremental, Release does not.
3044 # Abstract base configurations to cover common attributes.
3048 'msvs_configuration_attributes': {
3049 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3050 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3051 'CharacterSet': '1',
3053 # Add the default import libs.
3056 'AdditionalDependencies': [
3080 'MinimumRequiredVersion': '5.01', # XP.
3081 'TargetMachine': '1',
3083 'VCLibrarianTool': {
3084 'TargetMachine': '1',
3087 'msvs_configuration_platform': 'Win32',
3091 'msvs_configuration_platform': 'x64',
3094 # Make sure to understand http://crbug.com/361720 if you want to
3096 'MinimumRequiredVersion': '5.02', # Server 2003.
3097 'TargetMachine': '17', # x86 - 64
3098 'AdditionalLibraryDirectories!':
3099 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3100 'AdditionalLibraryDirectories':
3101 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3102 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3103 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3105 'VCLibrarianTool': {
3106 'AdditionalLibraryDirectories!':
3107 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3108 'AdditionalLibraryDirectories':
3109 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3110 'TargetMachine': '17', # x64
3117 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3118 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3121 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3123 '<@(debug_extra_cflags)',
3127 'VCCLCompilerTool': {
3128 'Optimization': '<(win_debug_Optimization)',
3129 'PreprocessorDefinitions': ['_DEBUG'],
3130 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3131 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3133 # According to MSVS, InlineFunctionExpansion=0 means
3134 # "default inlining", not "/Ob0".
3135 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3136 ['win_debug_InlineFunctionExpansion==0', {
3137 'AdditionalOptions': ['/Ob0'],
3139 ['win_debug_InlineFunctionExpansion!=""', {
3140 'InlineFunctionExpansion':
3141 '<(win_debug_InlineFunctionExpansion)',
3143 ['win_debug_disable_iterator_debugging==1', {
3144 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3147 # if win_debug_OmitFramePointers is blank, leave as default
3148 ['win_debug_OmitFramePointers==1', {
3149 'OmitFramePointers': 'true',
3151 ['win_debug_OmitFramePointers==0', {
3152 'OmitFramePointers': 'false',
3153 # The above is not sufficient (http://crbug.com/106711): it
3154 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3155 # perform FPO regardless, so we must explicitly disable.
3156 # We still want the false setting above to avoid having
3157 # "/Oy /Oy-" and warnings about overriding.
3158 'AdditionalOptions': ['/Oy-'],
3161 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3164 'LinkIncremental': '<(msvs_debug_link_incremental)',
3165 # ASLR makes debugging with windbg difficult because Chrome.exe and
3166 # Chrome.dll share the same base name. As result, windbg will
3167 # name the Chrome.dll module like chrome_<base address>, where
3168 # <base address> typically changes with each launch. This in turn
3169 # means that breakpoints in Chrome.dll don't stick from one launch
3170 # to the next. For this reason, we turn ASLR off in debug builds.
3171 # Note that this is a three-way bool, where 0 means to pick up
3172 # the default setting, 1 is off and 2 is on.
3173 'RandomizedBaseAddress': 1,
3175 'VCResourceCompilerTool': {
3176 'PreprocessorDefinitions': ['_DEBUG'],
3180 ['OS=="linux" or OS=="android"', {
3181 'target_conditions': [
3182 ['_toolset=="target"', {
3184 '<@(debug_extra_cflags)',
3189 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3190 # Enable libstdc++ debugging facilities to help catch problems
3191 # early, see http://crbug.com/65151 .
3192 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3193 'defines': ['_GLIBCXX_DEBUG=1',],
3195 ['release_valgrind_build==0', {
3198 '-fstack-protector-all', # Implies -fstack-protector
3210 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3211 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3212 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3215 'VCCLCompilerTool': {
3216 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3218 # In official builds, each target will self-select
3219 # an optimization level.
3220 ['buildtype!="Official"', {
3221 'Optimization': '<(win_release_Optimization)',
3224 # According to MSVS, InlineFunctionExpansion=0 means
3225 # "default inlining", not "/Ob0".
3226 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3227 ['win_release_InlineFunctionExpansion==0', {
3228 'AdditionalOptions': ['/Ob0'],
3230 ['win_release_InlineFunctionExpansion!=""', {
3231 'InlineFunctionExpansion':
3232 '<(win_release_InlineFunctionExpansion)',
3235 # if win_release_OmitFramePointers is blank, leave as default
3236 ['win_release_OmitFramePointers==1', {
3237 'OmitFramePointers': 'true',
3239 ['win_release_OmitFramePointers==0', {
3240 'OmitFramePointers': 'false',
3241 # The above is not sufficient (http://crbug.com/106711): it
3242 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3243 # perform FPO regardless, so we must explicitly disable.
3244 # We still want the false setting above to avoid having
3245 # "/Oy /Oy-" and warnings about overriding.
3246 'AdditionalOptions': ['/Oy-'],
3249 'AdditionalOptions': [
3250 '/d2Zi+', # Improve debugging of Release builds.
3251 '<@(win_release_extra_cflags)',
3255 # LinkIncremental is a tri-state boolean, where 0 means default
3256 # (i.e., inherit from parent solution), 1 means false, and
3258 'LinkIncremental': '1',
3259 # This corresponds to the /PROFILE flag which ensures the PDB
3260 # file contains FIXUP information (growing the PDB file by about
3261 # 5%) but does not otherwise alter the output binary. This
3262 # information is used by the Syzygy optimization tool when
3263 # decomposing the release image.
3268 ['msvs_use_common_release', {
3269 'includes': ['release.gypi'],
3271 ['release_valgrind_build==0 and tsan==0', {
3274 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3278 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3279 'MEMORY_SANITIZER_INITIAL_SIZE',
3280 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3281 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3284 ['win_use_allocator_shim==0', {
3285 'defines': ['NO_TCMALLOC'],
3287 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3288 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3289 # It seems to work fine with Ubuntu 12 headers though, so use it
3290 # in official builds.
3291 ['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")', {
3292 'target_conditions': [
3293 ['chromium_code==1', {
3294 # Non-chromium code is not guaranteed to compile cleanly
3295 # with _FORTIFY_SOURCE. Also, fortified build may fail
3296 # when optimizations are disabled, so only do that for Release
3299 '_FORTIFY_SOURCE=2',
3304 ['OS=="linux" or OS=="android"', {
3305 'target_conditions': [
3306 ['_toolset=="target"', {
3308 '<@(release_extra_cflags)',
3311 ['enable_resource_whitelist_generation==1', {
3313 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3322 'NS_BLOCK_ASSERTIONS=1',
3328 # Concrete configurations
3331 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3334 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3339 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3340 'target_conditions': [
3341 [ '_type=="executable"', {
3342 # To get a real .dSYM bundle produced by dsymutil, set the
3343 # debug information format to dwarf-with-dsym. Since
3344 # strip_from_xcode will not be used, set Xcode to do the
3345 # stripping as well.
3347 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3348 'DEPLOYMENT_POSTPROCESSING': 'YES',
3349 'STRIP_INSTALLED_PRODUCT': 'YES',
3356 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3358 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3361 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3369 'target_defaults': {
3376 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3377 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3378 'target_defaults': {
3380 '-Wl,--fatal-warnings',
3384 ['os_posix==1 and chromeos==0', {
3385 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3386 # and we want to avoid overriding this, so stack-protector is only
3387 # enabled when not building on Chrome OS.
3388 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3390 'target_defaults': {
3392 '-fstack-protector',
3393 '--param=ssp-buffer-size=4',
3397 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3398 'target_defaults': {
3399 # Enable -Werror by default, but put it in a variable so it can
3400 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3402 'werror%': '-Werror',
3403 'libraries_for_target%': '',
3406 '_FILE_OFFSET_BITS=64',
3409 '<(werror)', # See note above about the werror variable.
3412 '-fno-strict-aliasing', # See http://crbug.com/32204
3414 # TODO(evan): turn this back on once all the builds work.
3416 # Don't warn about unused function params. We use those everywhere.
3417 '-Wno-unused-parameter',
3418 # Don't warn about the "struct foo f = {0};" initialization pattern.
3419 '-Wno-missing-field-initializers',
3420 # Don't export any symbols (for example, to plugins we dlopen()).
3421 # Note: this is *required* to make some plugins work.
3422 '-fvisibility=hidden',
3427 '-fno-threadsafe-statics',
3428 # Make inline functions have hidden visiblity by default.
3429 # Surprisingly, not covered by -fvisibility=hidden.
3430 '-fvisibility-inlines-hidden',
3431 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3432 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3436 '-pthread', '-Wl,-z,noexecstack',
3439 '<(libraries_for_target)',
3444 'debug_optimize%': '0',
3450 '-O>(debug_optimize)',
3456 # Warn in case of text relocations.
3457 '-Wl,--warn-shared-textrel',
3460 ['OS=="android" and android_full_debug==0', {
3461 # Some configurations are copied from Release_Base to reduce
3464 'debug_optimize%': 's',
3468 '-ffunction-sections',
3475 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3476 # We don't omit frame pointers on arm64 since they are required
3477 # to correctly unwind stackframes which contain system library
3478 # function frames (crbug.com/391706).
3480 '-fomit-frame-pointer',
3483 ['OS=="linux" and target_arch=="ia32"', {
3485 '-Wl,--no-as-needed',
3488 ['debug_unwind_tables==1', {
3489 'cflags': ['-funwind-tables'],
3491 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3493 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3494 # definitions in to the right scope to use them when setting
3495 # linux_use_debug_fission, so it can be used here alone.
3496 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3497 'cflags': ['-gsplit-dwarf'],
3503 'release_optimize%': '2',
3504 # Binaries become big and gold is unable to perform GC
3505 # and remove unused sections for some of test targets
3506 # on 32 bit platform.
3507 # (This is currently observed only in chromeos valgrind bots)
3508 # The following flag is to disable --gc-sections linker
3509 # option for these bots.
3510 'no_gc_sections%': 0,
3512 # TODO(bradnelson): reexamine how this is done if we change the
3513 # expansion of configurations
3514 'release_valgrind_build%': 0,
3517 '-O<(release_optimize)',
3518 # Don't emit the GCC version ident directives, they just end up
3519 # in the .comment section taking up binary size.
3521 # Put data and code in their own sections, so that unused symbols
3522 # can be removed at link time with --gc-sections.
3524 '-ffunction-sections',
3527 # Specifically tell the linker to perform optimizations.
3528 # See http://lwn.net/Articles/192624/ .
3533 ['no_gc_sections==0', {
3535 '-Wl,--gc-sections',
3538 ['OS=="android" and target_arch!="arm64"', {
3539 # We don't omit frame pointers on arm64 since they are required
3540 # to correctly unwind stackframes which contain system library
3541 # function frames (crbug.com/391706).
3543 '-fomit-frame-pointer',
3548 'release_optimize%': 's',
3551 # Warn in case of text relocations.
3552 '-Wl,--warn-shared-textrel',
3559 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed
3560 # and the fix is in chromium.
3561 'cflags': [ '-fno-slp-vectorize', ],
3565 '-fno-omit-frame-pointer',
3569 ['profiling_full_stack_frames==1', {
3572 '-fno-optimize-sibling-calls',
3577 ['release_unwind_tables==1', {
3578 'cflags': ['-funwind-tables'],
3580 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3586 ['target_arch=="ia32"', {
3587 'target_conditions': [
3588 ['_toolset=="target"', {
3590 # Needed so that libs with .s files (e.g. libicudata.a)
3591 # are compatible with the general 32-bit-ness.
3594 # All floating-point computations on x87 happens in 80-bit
3595 # precision. Because the C and C++ language standards allow
3596 # the compiler to keep the floating-point values in higher
3597 # precision than what's specified in the source and doing so
3598 # is more efficient than constantly rounding up to 64-bit or
3599 # 32-bit precision as specified in the source, the compiler,
3600 # especially in the optimized mode, tries very hard to keep
3601 # values in x87 floating-point stack (in 80-bit precision)
3602 # as long as possible. This has important side effects, that
3603 # the real value used in computation may change depending on
3604 # how the compiler did the optimization - that is, the value
3605 # kept in 80-bit is different than the value rounded down to
3606 # 64-bit or 32-bit. There are possible compiler options to
3607 # make this behavior consistent (e.g. -ffloat-store would keep
3608 # all floating-values in the memory, thus force them to be
3609 # rounded to its original precision) but they have significant
3610 # runtime performance penalty.
3612 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3613 # which keep floating-point values in SSE registers in its
3614 # native precision (32-bit for single precision, and 64-bit
3615 # for double precision values). This means the floating-point
3616 # value used during computation does not change depending on
3617 # how the compiler optimized the code, since the value is
3618 # always kept in its specified precision.
3620 # Refer to http://crbug.com/348761 for rationale behind SSE2
3621 # being a minimum requirement for 32-bit Linux builds and
3622 # http://crbug.com/313032 for an example where this has "bit"
3627 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3634 # Use gold linker for Android ia32 target.
3640 # Install packages have started cropping up with
3641 # different headers between the 32-bit and 64-bit
3642 # versions, so we have to shadow those differences off
3643 # and make sure a 32-bit-on-64-bit build picks up the
3645 # For android build, use NDK headers instead of host headers
3646 ['host_arch!="ia32" and OS!="android"', {
3655 ['target_arch=="x64"', {
3656 'target_conditions': [
3657 ['_toolset=="target"', {
3659 # Use gold linker for Android x64 target.
3676 ['target_arch=="arm"', {
3677 'target_conditions': [
3678 ['_toolset=="target"', {
3680 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3681 # has changed whenever it encounters a varargs function. This
3682 # silences those warnings, as they are not helpful and
3683 # clutter legitimate warnings.
3689 '-march=<(arm_arch)',
3694 '-mtune=<(arm_tune)',
3702 ['arm_float_abi!=""', {
3704 '-mfloat-abi=<(arm_float_abi)',
3713 # Most of the following flags are derived from what Android
3714 # uses by default when building for arm, reference for which
3715 # can be found in the following file in the Android NDK:
3716 # toolchains/arm-linux-androideabi-4.8/setup.mk
3718 # The tree-sra optimization (scalar replacement for
3719 # aggregates enabling subsequent optimizations) leads to
3720 # invalid code generation when using the Android NDK's
3721 # compiler (r5-r7). This can be verified using
3722 # webkit_unit_tests' WTF.Checked_int8_t test.
3724 # The following 6 options are disabled to save on
3725 # binary size in gcc 4.8.
3726 # TODO(fdegans) Reevaluate when we upgrade GCC.
3727 '-fno-partial-inlining',
3728 '-fno-early-inlining',
3729 '-fno-tree-copy-prop',
3730 '-fno-tree-loop-optimize',
3731 '-fno-move-loop-invariants',
3732 '-fno-caller-saves',
3735 # Android now supports .relro sections properly.
3736 # NOTE: While these flags enable the generation of .relro
3737 # sections, the generated libraries can still be loaded on
3738 # older Android platform versions.
3746 'cflags': [ '-mthumb-interwork' ],
3750 # Thumb code with frame pointer makes chrome crash
3753 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3754 # The perf report sometimes incorrectly attributes
3755 # code from tail calls.
3756 '-fno-optimize-sibling-calls',
3759 '-fomit-frame-pointer',
3764 # Clang does not support the following options.
3765 '-mthumb-interwork',
3766 '-finline-limit=64',
3768 '-fno-partial-inlining',
3769 '-fno-early-inlining',
3770 '-fno-tree-copy-prop',
3771 '-fno-tree-loop-optimize',
3772 '-fno-move-loop-invariants',
3773 '-fno-caller-saves',
3777 # TODO(hans) Enable integrated-as (crbug.com/124610).
3778 '-no-integrated-as',
3779 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3783 # Clang does not support the following options.
3787 # As long as -fuse-ld=gold doesn't work, add a dummy directory
3788 # with an 'ld' that redirects to gold, so that clang uses gold.
3789 '-B<!(cd <(DEPTH) && pwd -P)/build/android/arm-linux-androideabi-gold',
3794 '-marm', # Required for frame pointer based stack traces.
3801 # We set arm_arch to "" so that -march compiler option
3802 # is not set. Otherwise a gcc bug that would complain
3803 # about it conflicting with '-mcpu=cortex-a9'. The flag
3804 # '-march=armv7-a' is actually redundant anyway because
3805 # it is enabled by default when we built the toolchain.
3806 # And using '-mcpu=cortex-a9' should be sufficient.
3809 # Breakpad requires symbols with debugging information
3813 # We want to statically link libstdc++/libgcc_s.
3814 '-static-libstdc++',
3818 # Some components in Chromium (e.g. v8, skia, ffmpeg)
3819 # define their own cflags for arm builds that could
3820 # conflict with the flags we set here (e.g.
3821 # '-mcpu=cortex-a9'). Remove these flags explicitly.
3830 ['target_arch=="arm64"', {
3831 'target_conditions': [
3832 ['_toolset=="target"', {
3836 '-fstack-protector', # stack protector is always enabled on arm64.
3843 ['target_arch=="mipsel"', {
3844 'target_conditions': [
3845 ['_toolset=="target"', {
3847 ['android_webview_build==0 and mips_arch_variant=="mips32r2"', {
3848 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
3850 ['android_webview_build==0 and mips_arch_variant!="mips32r2"', {
3851 'cflags': ['-mips32', '-Wa,-mips32'],
3860 '-Wl,--no-keep-memory'
3863 '-Wno-uninitialized',
3877 'target_conditions': [
3878 ['_toolset=="target"', {
3880 '--sysroot=<(sysroot)',
3883 '--sysroot=<(sysroot)',
3884 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
3890 # TODO(thakis): Remove, http://crbug.com/263960
3891 '-Wno-reserved-user-defined-literal',
3894 # See the comment in the Mac section for what it takes to move
3895 # this to -std=c++11.
3899 ['clang==1 and clang_use_chrome_plugins==1', {
3901 '<@(clang_chrome_plugins_flags)',
3904 ['clang==1 and clang_load!=""', {
3906 '-Xclang', '-load', '-Xclang', '<(clang_load)',
3909 ['clang==1 and clang_add_plugin!=""', {
3911 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
3914 ['clang==1 and target_arch=="ia32"', {
3916 # Else building libyuv gives clang's register allocator issues,
3917 # see llvm.org/PR15798 / crbug.com/233709
3918 '-momit-leaf-frame-pointer',
3921 ['clang==1 and "<(GENERATOR)"=="ninja"', {
3923 # See http://crbug.com/110262
3924 '-fcolor-diagnostics',
3927 # Common options for AddressSanitizer, LeakSanitizer,
3928 # ThreadSanitizer and MemorySanitizer.
3929 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
3930 'target_conditions': [
3931 ['_toolset=="target"', {
3933 '-fno-omit-frame-pointer',
3934 '-gline-tables-only',
3937 '-fomit-frame-pointer',
3942 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
3943 'target_conditions': [
3944 ['_toolset=="target"', {
3946 # Functions interposed by the sanitizers can make ld think
3947 # that some libraries aren't needed when they actually are,
3948 # http://crbug.com/234010. As workaround, disable --as-needed.
3952 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3953 'MEMORY_SANITIZER_INITIAL_SIZE',
3957 # TODO(glider): enable the default options on other systems.
3959 ['use_sanitizer_options==1 and OS=="linux" and (chromeos==0 or target_arch!="ia32")', {
3961 '<(DEPTH)/base/base.gyp:sanitizer_options',
3967 'target_conditions': [
3968 ['_toolset=="target"', {
3970 '-fsanitize=address',
3973 '-fsanitize=address',
3980 '-mllvm -asan-globals=0', # http://crbug.com/352073
3986 'target_conditions': [
3987 ['_toolset=="target"', {
3989 '-fsanitize=undefined',
3990 # -fsanitize=vptr is incompatible with -fno-rtti.
3991 '-fno-sanitize=vptr',
3994 '-fsanitize=undefined',
3995 # -fsanitize=vptr is incompatible with -fno-rtti.
3996 '-fno-sanitize=vptr',
4002 'target_conditions': [
4003 ['_toolset=="target"', {
4006 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4018 'UNDEFINED_SANITIZER',
4023 ['asan_coverage!=0', {
4024 'target_conditions': [
4025 ['_toolset=="target"', {
4027 '-mllvm -asan-coverage=<(asan_coverage)',
4033 'target_conditions': [
4034 ['_toolset=="target"', {
4043 'WTF_USE_LEAK_SANITIZER=1',
4049 'target_conditions': [
4050 ['_toolset=="target"', {
4052 '-fsanitize=thread',
4054 '-fsanitize-blacklist=<(tsan_blacklist)',
4057 '-fsanitize=thread',
4061 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4062 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4064 'target_conditions': [
4065 ['_type=="executable"', {
4075 'target_conditions': [
4076 ['_toolset=="target"', {
4078 '-fsanitize=memory',
4079 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4081 '-fsanitize-blacklist=<(msan_blacklist)',
4084 '-fsanitize=memory',
4089 'target_conditions': [
4090 ['_type=="executable"', {
4099 ['use_instrumented_libraries==1', {
4101 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4104 ['use_custom_libcxx==1', {
4106 '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4109 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4110 'target_conditions' : [
4111 # crazy_linker has an upstream gyp file we can't edit, and we
4112 # don't want to instrument it.
4113 ['_toolset=="target" and _target_name!="crazy_linker"', {
4115 '-finstrument-functions',
4116 # Allow mmx intrinsics to inline, so that the
4117 #0 compiler can expand the intrinsics.
4118 '-finstrument-functions-exclude-file-list=mmintrin.h',
4121 ['_toolset=="target" and OS=="android"', {
4123 # Avoids errors with current NDK:
4124 # "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"
4125 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4130 ['linux_dump_symbols==1', {
4133 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4134 'target_conditions': [
4135 ['_toolset=="target"', {
4137 # Attempt to use less memory to prevent the linker from
4138 # running out of address space. Considering installing a
4139 # 64-bit kernel and switching to a 64-bit linker.
4140 '-Wl,--no-keep-memory',
4147 ['use_allocator!="tcmalloc"', {
4148 'defines': ['NO_TCMALLOC'],
4150 ['linux_use_gold_flags==1', {
4151 'target_conditions': [
4152 ['_toolset=="target"', {
4154 # Experimentation found that using four linking threads
4155 # saved ~20% of link time.
4156 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4157 # Only apply this to the target linker, since the host
4158 # linker might not be gold, but isn't used much anyway.
4159 # TODO(raymes): Disable threading because gold is frequently
4160 # crashing on the bots: crbug.com/161942.
4162 # '-Wl,--thread-count=4',
4167 ['release_valgrind_build==0', {
4168 'target_conditions': [
4169 ['_toolset=="target"', {
4171 # There seems to be a conflict of --icf and -pie
4172 # in gold which can generate crashy binaries. As
4173 # a security measure, -pie takes precedence for
4181 # Newer gcc's support -fuse-ld, use the flag to force gold
4183 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4184 # TODO(mithro): Watch for clang support at following thread:
4185 # http://clang-developers.42468.n3.nabble.com/Adding-fuse-ld-support-to-clang-td4032180.html
4186 ['gcc_version>=48 and clang==0', {
4187 'target_conditions': [
4188 ['_toolset=="target"', {
4195 ['host_gcc_version>=48 and clang==0', {
4196 'target_conditions': [
4197 ['_toolset=="host"', {
4206 ['linux_use_bundled_binutils==1', {
4208 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4211 ['linux_use_bundled_gold==1', {
4212 # Put our binutils, which contains gold in the search path. We pass
4213 # the path to gold to the compiler. gyp leaves unspecified what the
4214 # cwd is when running the compiler, so the normal gyp path-munging
4215 # fails us. This hack gets the right path.
4217 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4220 # Some binutils 2.23 releases may or may not have new dtags enabled,
4221 # but they are all compatible with --disable-new-dtags,
4222 # because the new dynamic tags are not created by default.
4223 ['binutils_version>=223', {
4224 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4225 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4226 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4227 # inside this file to allow usage of --no-as-needed and removal of
4230 '-Wl,--disable-new-dtags',
4233 ['gcc_version>=47 and clang==0', {
4234 'target_conditions': [
4235 ['_toolset=="target"', {
4238 # See comment for -Wno-c++11-narrowing.
4240 # TODO(thakis): Remove, http://crbug.com/263960
4241 '-Wno-literal-suffix',
4246 ['host_gcc_version>=47 and clang==0', {
4247 'target_conditions': [
4248 ['_toolset=="host"', {
4251 # See comment for -Wno-c++11-narrowing.
4253 # TODO(thakis): Remove, http://crbug.com/263960
4254 '-Wno-literal-suffix',
4262 # FreeBSD-specific options; note that most FreeBSD options are set above,
4265 'target_defaults': {
4267 '-Wl,--no-keep-memory',
4271 # Android-specific options; note that most are set above with Linux.
4274 # This is a unique identifier for a given build. It's used for
4275 # identifying various build artifacts corresponding to a particular
4276 # build of chrome (e.g. where to find archived symbols).
4277 'chrome_build_id%': '',
4279 # Use shared stlport library when system one used.
4280 # Figure this out early since it needs symbols from libgcc.a, so it
4281 # has to be before that in the set of libraries.
4282 ['use_system_stlport==1', {
4283 'android_stlport_library': 'stlport',
4286 ['component=="shared_library"', {
4287 'android_stlport_library': 'stlport_shared',
4289 'android_stlport_library': 'stlport_static',
4295 # Placing this variable here prevents from forking libvpx, used
4296 # by remoting. Remoting is off, so it needn't built,
4297 # so forking it's deps seems like overkill.
4298 # But this variable need defined to properly run gyp.
4299 # A proper solution is to have an OS==android conditional
4300 # in third_party/libvpx/libvpx.gyp to define it.
4301 'libvpx_path': 'lib/linux/arm',
4303 'target_defaults': {
4305 'release_extra_cflags%': '',
4307 # If we're using the components build, append "cr" to all shared
4308 # libraries to avoid naming collisions with android system library
4309 # versions with the same name (e.g. skia, icu).
4310 ['component=="shared_library"', {
4311 'android_product_extension': 'cr.so',
4313 'android_product_extension': 'so',
4317 'target_conditions': [
4318 ['_type=="shared_library"', {
4319 'product_extension': '<(android_product_extension)',
4322 # Settings for building device targets using Android's toolchain.
4323 # These are based on the setup.mk file from the Android NDK.
4325 # The NDK Android executable link step looks as follows:
4327 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4328 # $(PRIVATE_OBJECTS) <-- The .o that we built
4329 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4330 # $(TARGET_LIBGCC) <-- libgcc.a
4331 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4332 # $(PRIVATE_LDLIBS) <-- System .so
4333 # $(TARGET_CRTEND_O) <-- crtend.o
4335 # For now the above are approximated for executables by adding
4336 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4339 # The NDK Android shared library link step looks as follows:
4341 # $(PRIVATE_OBJECTS) <-- The .o that we built
4342 # -l,--whole-archive
4343 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4344 # -l,--no-whole-archive
4345 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4346 # $(TARGET_LIBGCC) <-- libgcc.a
4347 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4348 # $(PRIVATE_LDLIBS) <-- System .so
4350 # For now, assume that whole static libraries are not needed.
4352 # For both executables and shared libraries, add the proper
4353 # libgcc.a to the start of libraries which puts it in the
4354 # proper spot after .o and .a files get linked in.
4356 # TODO: The proper thing to do longer-tem would be proper gyp
4357 # support for a custom link command line.
4358 ['_toolset=="target"', {
4360 '-pthread', # Not supported by Android toolchain.
4363 '-ffunction-sections',
4366 '-fstack-protector',
4368 '-finline-limit=64',
4369 '-Wa,--noexecstack',
4370 '<@(release_extra_cflags)',
4374 '__GNU_SOURCE=1', # Necessary for clone()
4376 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4377 'CHROME_BUILD_ID="<(chrome_build_id)"',
4380 '-pthread', # Not supported by Android toolchain.
4384 '-Wl,--no-undefined',
4385 # Don't export symbols from statically linked libraries.
4386 '-Wl,--exclude-libs=ALL',
4389 '-l<(android_stlport_library)',
4390 # Manually link the libgcc.a that the cross compiler uses.
4391 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4397 ['component=="shared_library"', {
4399 '-Wl,--exclude-libs=ALL',
4404 # Work around incompatibilities between bionic and clang
4406 '-D__compiler_offsetof=__builtin_offsetof',
4407 '-Dnan=__builtin_nan',
4410 ['target_arch=="arm"', {
4412 '-target arm-linux-androideabi',
4415 '-target arm-linux-androideabi',
4418 ['target_arch=="ia32"', {
4420 '-target x86-linux-androideabi',
4423 '-target x86-linux-androideabi',
4426 # Place holder for x64 support, not tested.
4427 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4428 ['target_arch=="x64"', {
4430 '-target x86_64-linux-androideabi',
4433 '-target x86_64-linux-androideabi',
4440 # Android build relies on -Wl,--gc-sections removing
4441 # unreachable code. ASan instrumentation for globals inhibits
4442 # this and results in a library with unresolvable relocations.
4443 # TODO(eugenis): find a way to reenable this.
4444 '-mllvm -asan-globals=0',
4447 ['android_webview_build==0', {
4449 # The NDK has these things, but doesn't define the constants
4450 # to say that it does. Define them here instead.
4454 '--sysroot=<(android_ndk_sysroot)',
4457 '--sysroot=<(android_ndk_sysroot)',
4460 ['android_webview_build==1', {
4462 # OpenAL headers from the Android tree.
4463 '<(android_src)/frameworks/wilhelm/include',
4466 # Android predefines this as 1; undefine it here so Chromium
4467 # can redefine it later to be 2 for chromium code and unset
4468 # for third party code. This works because cflags are added
4470 '-U_FORTIFY_SOURCE',
4471 # Disable any additional warnings enabled by the Android build system but which
4472 # chromium does not build cleanly with (when treating warning as errors).
4473 # Things that are part of -Wextra:
4474 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4475 '-Wno-ignored-qualifiers',
4477 '-Wno-unused-but-set-variable',
4480 # Other things unrelated to -Wextra:
4481 '-Wno-non-virtual-dtor',
4485 ['android_webview_build==1', {
4486 'target_conditions': [
4487 ['chromium_code==0', {
4489 # There is a class of warning which:
4490 # 1) Android always enables and also treats as errors
4491 # 2) Chromium ignores in third party code
4492 # So we re-enable those warnings when building Android.
4494 '-Wno-format-security',
4496 '-Wno-sequence-point',
4499 '-Wno-non-virtual-dtor',
4504 ['target_arch == "arm"', {
4506 # Enable identical code folding to reduce size.
4510 # NOTE: The stlport header include paths below are specified in
4511 # cflags rather than include_dirs because they need to come
4512 # after include_dirs. Think of them like system headers, but
4513 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4514 # toolchain (circa Gingerbread) will exhibit strange errors.
4515 # The include ordering here is important; change with caution.
4516 ['use_system_stlport==1', {
4518 # For libstdc++/include, which is used by stlport.
4519 '-I<(android_src)/bionic',
4520 '-I<(android_src)/external/stlport/stlport',
4522 }, { # else: use_system_stlport!=1
4524 '-isystem<(android_stlport_include)',
4527 '-L<(android_stlport_libs_dir)',
4530 ['target_arch=="ia32"', {
4531 # The x86 toolchain currently has problems with stack-protector.
4533 '-fstack-protector',
4536 '-fno-stack-protector',
4540 'target_conditions': [
4541 ['_type=="executable"', {
4542 # Force android tools to export the "main" symbol so they can be
4543 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4544 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4545 # when ICS support will be dropped.
4548 '-fvisibility=default',
4552 '-Wl,--gc-sections',
4553 '-Wl,-z,nocopyreloc',
4556 # crtbegin_dynamic.o should be the last item in ldflags.
4557 '<(android_ndk_lib)/crtbegin_dynamic.o',
4560 # crtend_android.o needs to be the last item in libraries.
4561 # Do not add any libraries after this!
4562 '<(android_ndk_lib)/crtend_android.o',
4565 ['_type=="shared_library" or _type=="loadable_module"', {
4567 '-Wl,--exclude-libs=ALL',
4570 '-Wl,-shared,-Bsymbolic',
4573 ['android_webview_build==0', {
4575 # crtbegin_so.o should be the last item in ldflags.
4576 '<(android_ndk_lib)/crtbegin_so.o',
4579 # crtend_so.o needs to be the last item in libraries.
4580 # Do not add any libraries after this!
4581 '<(android_ndk_lib)/crtend_so.o',
4588 # Settings for building host targets using the system toolchain.
4589 ['_toolset=="host"', {
4591 # Due to issues in Clang build system, using ASan on 32-bit
4592 # binaries on x86_64 host is problematic.
4593 # TODO(eugenis): re-enable.
4594 '-fsanitize=address',
4597 '-fsanitize=address',
4598 '-Wl,-z,noexecstack',
4599 '-Wl,--gc-sections',
4602 '-Wl,--warn-shared-textrel',
4603 '-Wl,--fatal-warnings',
4606 # Settings for building host targets on mac.
4607 ['_toolset=="host" and host_os=="mac"', {
4617 'cflags!': ['-fvisibility=hidden'],
4618 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4620 ['OS=="mac" or OS=="ios"', {
4621 'target_defaults': {
4624 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4625 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4626 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4627 'COPY_PHASE_STRIP': 'NO',
4628 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4629 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4630 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4631 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4632 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4633 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4634 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4635 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4636 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4637 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4638 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4639 'GCC_VERSION': '4.2',
4640 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4641 'USE_HEADERMAP': 'NO',
4646 # Don't warn about unused function parameters.
4647 '-Wno-unused-parameter',
4648 # Don't warn about the "struct foo f = {0};" initialization
4650 '-Wno-missing-field-initializers',
4653 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4654 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4656 # Note that the prebuilt Clang binaries should not be used for iOS
4657 # development except for ASan builds.
4659 # gnu++11 instead of c++11 is needed because some code uses
4660 # typeof() (a GNU extension).
4661 # TODO(thakis): Eventually switch this to c++11 instead of
4662 # gnu++11 (once typeof can be removed, which is blocked on c++11
4663 # being available everywhere).
4664 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', # -std=gnu++11
4665 # Warn if automatic synthesis is triggered with
4666 # the -Wobjc-missing-property-synthesis flag.
4667 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4668 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4670 # This warns on selectors from Cocoa headers (-length, -set).
4671 # cfe-dev is currently discussing the merits of this warning.
4672 # TODO(thakis): Reevaluate what to do with this, based one
4673 # cfe-dev discussion.
4674 '-Wno-selector-type-mismatch',
4677 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed
4678 # and the fix is in chromium.
4679 '-fno-slp-vectorize',
4683 ['clang_xcode==0', {
4684 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4685 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4689 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4691 '<@(clang_chrome_plugins_flags)',
4694 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4696 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4699 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4701 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4704 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4706 # See http://crbug.com/110262
4707 '-fcolor-diagnostics',
4710 ['OS=="ios" and target_subarch!="arm32" and \
4711 "<(GENERATOR)"=="xcode"', {
4713 # TODO(ios): when building Chrome for iOS on 64-bit platform
4714 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4715 # enabled. This cause failures when compiling protobuf code,
4716 # so disable the warning. http://crbug.com/359107
4717 '-Wno-shorten-64-to-32',
4725 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4731 '-fsanitize=address',
4732 '-mllvm -asan-globals=0', # http://crbug.com/352073
4733 '-gline-tables-only',
4737 ['asan_coverage!=0', {
4738 'target_conditions': [
4739 ['_toolset=="target"', {
4741 '-mllvm -asan-coverage=<(asan_coverage)',
4747 'target_conditions': [
4748 ['_type!="static_library"', {
4749 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4754 '-fsanitize=address',
4758 ['mac_write_linker_maps==1', {
4761 '-Wl,-map,>(_target_name).map',
4768 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4769 'target_conditions': [
4770 ['_type=="executable"', {
4776 # Define copy_asan_dylib_path in a variable ending in
4777 # _path so that gyp understands it's a path and
4778 # performs proper relativization during dict merging.
4779 'copy_asan_dylib_path':
4780 'mac/copy_asan_runtime_dylib.sh',
4782 'postbuild_name': 'Copy ASan runtime dylib',
4784 '<(copy_asan_dylib_path)',
4793 ], # target_conditions
4794 }, # target_defaults
4795 }], # OS=="mac" or OS=="ios"
4797 'target_defaults': {
4799 # Prevent Mac OS X AssertMacros.h from defining macros that collide
4800 # with common names, like 'check', 'require', and 'verify'.
4801 # (Included by system header. Also exists on iOS but not included.)
4802 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
4803 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
4806 # These should end with %, but there seems to be a bug with % in
4807 # variables that are intended to be set to different values in
4808 # different targets, like these.
4809 'mac_pie': 1, # Most executables can be position-independent.
4810 # Strip debugging symbols from the target.
4811 'mac_strip': '<(mac_strip_release)',
4815 ['mac_want_real_dsym=="default"', {
4818 'mac_real_dsym': '<(mac_want_real_dsym)'
4823 ['mac_want_real_dsym=="default"', {
4824 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
4826 'mac_real_dsym': '<(mac_want_real_dsym)'
4833 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
4834 # (Equivalent to -fPIC)
4835 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
4836 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4837 # Keep pch files below xcodebuild/.
4838 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
4840 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
4841 # xcode_setting, but not until all downstream projects' mac bots are
4842 # using xcode >= 4.6, because that's when the default value of the
4843 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
4844 # setting is a no-op as far as xcode is concerned, but the compiler
4845 # behaves differently based on whether -fno-strict-aliasing is
4847 '-fno-strict-aliasing', # See http://crbug.com/32204.
4850 'target_conditions': [
4851 ['_type=="executable"', {
4854 # Arranges for data (heap) pages to be protected against
4855 # code execution when running on Mac OS X 10.7 ("Lion"), and
4856 # ensures that the position-independent executable (PIE) bit
4857 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
4859 # Define change_mach_o_flags in a variable ending in _path
4860 # so that GYP understands it's a path and performs proper
4861 # relativization during dict merging.
4862 'change_mach_o_flags_path':
4863 'mac/change_mach_o_flags_from_xcode.sh',
4864 'change_mach_o_flags_options%': [
4866 'target_conditions': [
4867 ['mac_pie==0 or release_valgrind_build==1', {
4868 # Don't enable PIE if it's unwanted. It's unwanted if
4869 # the target specifies mac_pie=0 or if building for
4870 # Valgrind, because Valgrind doesn't understand slide.
4871 # See the similar mac_pie/release_valgrind_build check
4873 'change_mach_o_flags_options': [
4879 'postbuild_name': 'Change Mach-O Flags',
4881 '<(change_mach_o_flags_path)',
4882 '>@(change_mach_o_flags_options)',
4889 'asan_saves_file': 'asan.saves',
4892 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
4896 'target_conditions': [
4897 ['mac_pie==1 and release_valgrind_build==0', {
4898 # Turn on position-independence (ASLR) for executables. When
4899 # PIE is on for the Chrome executables, the framework will
4900 # also be subject to ASLR.
4901 # Don't do this when building for Valgrind, because Valgrind
4902 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
4903 # understand slide, and get rid of the Valgrind check.
4906 '-Wl,-pie', # Position-independent executable (MH_PIE)
4912 ['(_type=="executable" or _type=="shared_library" or \
4913 _type=="loadable_module") and mac_strip!=0', {
4914 'target_conditions': [
4915 ['mac_real_dsym == 1', {
4916 # To get a real .dSYM bundle produced by dsymutil, set the
4917 # debug information format to dwarf-with-dsym. Since
4918 # strip_from_xcode will not be used, set Xcode to do the
4919 # stripping as well.
4923 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
4924 'DEPLOYMENT_POSTPROCESSING': 'YES',
4925 'STRIP_INSTALLED_PRODUCT': 'YES',
4926 'target_conditions': [
4927 ['_type=="shared_library" or _type=="loadable_module"', {
4928 # The Xcode default is to strip debugging symbols
4929 # only (-S). Local symbols should be stripped as
4930 # well, which will be handled by -x. Xcode will
4931 # continue to insert -S when stripping even when
4932 # additional flags are added with STRIPFLAGS.
4934 }], # _type=="shared_library" or _type=="loadable_module"
4935 ['_type=="executable"', {
4938 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
4941 }], # _type=="executable" and asan==1
4942 ], # target_conditions
4944 }, # configuration "Release"
4946 }, { # mac_real_dsym != 1
4947 # To get a fast fake .dSYM bundle, use a post-build step to
4948 # produce the .dSYM and strip the executable. strip_from_xcode
4949 # only operates in the Release configuration.
4953 # Define strip_from_xcode in a variable ending in _path
4954 # so that gyp understands it's a path and performs proper
4955 # relativization during dict merging.
4956 'strip_from_xcode_path': 'mac/strip_from_xcode',
4958 'postbuild_name': 'Strip If Needed',
4959 'action': ['<(strip_from_xcode_path)'],
4963 ], # target_conditions
4964 }], # (_type=="executable" or _type=="shared_library" or
4965 # _type=="loadable_module") and mac_strip!=0
4966 ], # target_conditions
4967 }, # target_defaults
4970 'target_defaults': {
4971 'xcode_settings' : {
4972 # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang
4974 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',
4977 # Older Xcodes do not support -Wno-deprecated-register, so pass an
4978 # additional flag to suppress the "unknown compiler option" error.
4979 # Restrict this flag to builds that are either compiling with Xcode
4980 # or compiling with Xcode's Clang. This will allow Ninja builds to
4981 # continue failing on unknown compiler options.
4982 # TODO(rohitrao): This flag is temporary and should be removed as
4983 # soon as the iOS bots are updated to use Xcode 5.1.
4984 ['clang_xcode==1', {
4986 '-Wno-unknown-warning-option',
4990 # Limit the valid architectures depending on "target_subarch".
4991 # This need to include the "arm" architectures but also the "x86"
4992 # ones (they are used when building for the simulator).
4993 ['target_subarch=="arm32"', {
4994 'VALID_ARCHS': ['armv7', 'i386'],
4996 ['target_subarch=="arm64"', {
4997 'VALID_ARCHS': ['arm64', 'x86_64'],
4999 ['target_subarch=="both"', {
5000 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5004 'target_conditions': [
5005 ['_toolset=="host"', {
5007 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5008 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5017 ['_toolset=="target"', {
5019 # This section should be for overriding host settings. But,
5020 # since we can't negate the iphone deployment target above, we
5021 # instead set it here for target only.
5022 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5023 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5026 ['_type=="executable"', {
5030 'DEPLOYMENT_POSTPROCESSING': 'YES',
5031 'STRIP_INSTALLED_PRODUCT': 'YES',
5036 # Remove dSYM to reduce build time.
5037 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5043 ['chromium_ios_signing', {
5044 # iOS SDK wants everything for device signed.
5045 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5047 'CODE_SIGNING_REQUIRED': 'NO',
5048 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5053 ], # target_conditions
5054 }, # target_defaults
5057 'target_defaults': {
5059 '_WIN32_WINNT=0x0602',
5066 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5067 'WIN32_LEAN_AND_MEAN',
5069 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5070 '_HAS_EXCEPTIONS=0',
5073 ['buildtype=="Official"', {
5074 # In official builds, targets can self-select an optimization
5075 # level by defining a variable named 'optimize', and setting it
5077 # - "size", optimizes for minimal code size - the default.
5078 # - "speed", optimizes for speed over code size.
5079 # - "max", whole program optimization and link-time code
5080 # generation. This is very expensive and should be used
5083 'optimize%': 'size',
5087 # Set /LTCG for the official builds.
5088 'LinkTimeCodeGeneration': '1',
5091 'target_conditions': [
5092 ['optimize=="size"', {
5094 'VCCLCompilerTool': {
5095 # 1, optimizeMinSpace, Minimize Size (/O1)
5096 'Optimization': '1',
5097 # 2, favorSize - Favor small code (/Os)
5098 'FavorSizeOrSpeed': '2',
5103 ['optimize=="speed"', {
5105 'VCCLCompilerTool': {
5106 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5107 'Optimization': '2',
5108 # 1, favorSpeed - Favor fast code (/Ot)
5109 'FavorSizeOrSpeed': '1',
5114 ['optimize=="max"', {
5115 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5116 # builds. Probably anything that this would catch that
5117 # wouldn't be caught in a normal build isn't going to
5118 # actually be a bug, so the incremental value of C4702 for
5119 # PGO builds is likely very small.
5120 'msvs_disabled_warnings': [
5124 'VCCLCompilerTool': {
5125 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5126 'Optimization': '2',
5127 # 1, favorSpeed - Favor fast code (/Ot)
5128 'FavorSizeOrSpeed': '1',
5129 # This implies link time code generation.
5130 'WholeProgramOptimization': 'true',
5148 'AdditionalLibraryDirectories':
5149 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5151 'VCLibrarianTool': {
5152 'AdditionalLibraryDirectories':
5153 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5159 'VCLibrarianTool': {
5160 'AdditionalLibraryDirectories':
5161 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5164 'AdditionalLibraryDirectories':
5165 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5170 # https://code.google.com/p/chromium/issues/detail?id=372451#c20
5171 # Warning 4702 ("Unreachable code") should be re-enabled once
5172 # Express users are updated to VS2013 Update 2.
5173 'msvs_disabled_warnings': [
5178 # Explicitly required when using the ATL with express
5179 'AdditionalDependencies': ['atlthunk.lib'],
5181 # ATL 8.0 included in WDK 7.1 makes the linker to generate
5182 # almost eight hundred LNK4254 and LNK4078 warnings:
5183 # - warning LNK4254: section 'ATL' (50000040) merged into
5184 # '.rdata' (40000040) with different attributes
5185 # - warning LNK4078: multiple 'ATL' sections found with
5186 # different attributes
5187 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
5190 'msvs_system_include_dirs': [
5191 '<(windows_driver_kit_path)/inc/atl71',
5192 '<(windows_driver_kit_path)/inc/mfc42',
5196 'msvs_system_include_dirs': [
5197 '<(windows_sdk_path)/Include/shared',
5198 '<(windows_sdk_path)/Include/um',
5199 '<(windows_sdk_path)/Include/winrt',
5200 '$(VSInstallDir)/VC/atlmfc/include',
5202 'msvs_cygwin_shell': 0,
5203 'msvs_disabled_warnings': [
5204 # C4127: conditional expression is constant
5205 # This warning can in theory catch dead code and other problems, but
5206 # triggers in far too many desirable cases where the conditional
5207 # expression is either set by macros or corresponds some legitimate
5208 # compile-time constant expression (due to constant template args,
5209 # conditionals comparing the sizes of different types, etc.). Some of
5210 # these can be worked around, but it's not worth it.
5213 # C4351: new behavior: elements of array 'array' will be default
5215 # This is a silly "warning" that basically just alerts you that the
5216 # compiler is going to actually follow the language spec like it's
5217 # supposed to, instead of not following it like old buggy versions
5218 # did. There's absolutely no reason to turn this on.
5221 # C4355: 'this': used in base member initializer list
5222 # It's commonly useful to pass |this| to objects in a class'
5223 # initializer list. While this warning can catch real bugs, most of
5224 # the time the constructors in question don't attempt to call methods
5225 # on the passed-in pointer (until later), and annotating every legit
5226 # usage of this is simply more hassle than the warning is worth.
5229 # C4503: 'identifier': decorated name length exceeded, name was
5231 # This only means that some long error messages might have truncated
5232 # identifiers in the presence of lots of templates. It has no effect
5233 # on program correctness and there's no real reason to waste time
5234 # trying to prevent it.
5237 # C4611: interaction between 'function' and C++ object destruction is
5239 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5240 # suggests using exceptions instead of setjmp/longjmp for C++, but
5241 # Chromium code compiles without exception support. We therefore have
5242 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5243 # means we have to turn off this warning (and be careful about how
5244 # object destruction happens in such cases).
5247 # TODO(maruel): These warnings are level 4. They will be slowly
5248 # removed as code is fixed.
5249 4100, # Unreferenced formal parameter
5250 4121, # Alignment of a member was sensitive to packing
5251 4189, # Local variable is initialized but not referenced
5252 4244, # Conversion from 'type1' to 'type2', possible loss of data
5253 4481, # Nonstandard extension used: override specifier 'keyword'
5254 4505, # Unreferenced local function has been removed
5255 4510, # Default constructor could not be generated
5256 4512, # Assignment operator could not be generated
5257 4610, # Object can never be instantiated
5260 'VCCLCompilerTool': {
5261 'AdditionalOptions': ['/MP'],
5262 'MinimalRebuild': 'false',
5263 'BufferSecurityCheck': 'true',
5264 'EnableFunctionLevelLinking': 'true',
5265 'RuntimeTypeInfo': 'false',
5266 'WarningLevel': '4',
5267 'WarnAsError': 'true',
5268 'DebugInformationFormat': '3',
5269 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5270 'ExceptionHandling': '0',
5272 'VCLibrarianTool': {
5273 'AdditionalOptions': ['/ignore:4221'],
5274 'AdditionalLibraryDirectories': [
5275 '<(windows_sdk_path)/Lib/win8/um/x86',
5279 'AdditionalDependencies': [
5291 'AdditionalLibraryDirectories': [
5292 '<(windows_sdk_path)/Lib/win8/um/x86',
5294 'GenerateDebugInformation': 'true',
5295 'MapFileName': '$(OutDir)\\$(TargetName).map',
5296 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5297 'FixedBaseAddress': '1',
5300 # 1 == /SUBSYSTEM:CONSOLE
5301 # 2 == /SUBSYSTEM:WINDOWS
5302 # Most of the executables we'll ever create are tests
5303 # and utilities with console output.
5307 'GenerateStublessProxies': 'true',
5308 'TypeLibraryName': '$(InputName).tlb',
5309 'OutputDirectory': '$(IntDir)',
5310 'HeaderFileName': '$(InputName).h',
5311 'DLLDataFileName': '$(InputName).dlldata.c',
5312 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5313 'ProxyFileName': '$(InputName)_p.c',
5315 'VCResourceCompilerTool': {
5317 'AdditionalIncludeDirectories': [
5319 '<(SHARED_INTERMEDIATE_DIR)',
5322 'target_conditions': [
5323 ['_type=="executable"', {
5325 'EmbedManifest': 'true',
5328 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5330 'AdditionalManifestFiles': [
5331 '>(win_exe_compatibility_manifest)',
5338 # Building with Clang on Windows is a work in progress and very
5339 # experimental. See crbug.com/82385.
5340 'VCCLCompilerTool': {
5341 'WarnAsError': 'false',
5342 'RuntimeTypeInfo': 'false',
5343 'AdditionalOptions': [
5344 '-fmsc-version=1800',
5347 # Many files use intrinsics without including this header.
5348 # TODO(hans): Fix those files, or move this to sub-GYPs.
5351 # TODO(hans): Make this list shorter eventually.
5352 '-Qunused-arguments',
5353 '-Wno-c++11-compat-deprecated-writable-strings',
5354 '-Wno-char-subscripts',
5355 '-Wno-deprecated-declarations',
5356 '-Wno-deprecated-register',
5358 '-Wno-enum-conversion',
5359 '-Wno-extra-tokens',
5360 '-Wno-ignored-attributes',
5361 '-Wno-incompatible-pointer-types',
5362 '-Wno-int-to-void-pointer-cast',
5363 '-Wno-invalid-noreturn',
5364 '-Wno-logical-op-parentheses',
5366 '-Wno-missing-braces',
5367 '-Wno-missing-declarations',
5368 '-Wno-msvc-include',
5369 '-Wno-null-dereference',
5370 '-Wno-overloaded-virtual',
5372 '-Wno-pointer-sign',
5374 '-Wno-return-type-c-linkage',
5376 '-Wno-sometimes-uninitialized',
5378 '-Wno-tautological-compare',
5379 '-Wno-unknown-pragmas',
5381 '-Wno-unused-function',
5382 '-Wno-unused-private-field',
5383 '-Wno-unused-value',
5384 '-Wno-unused-variable',
5390 # ASan on Windows is a work in progress and very experimental.
5391 # See crbug.com/345874.
5392 'VCCLCompilerTool': {
5393 'AdditionalOptions': [
5394 '-fsanitize=address',
5396 'AdditionalIncludeDirectories': [
5397 # MSVC needs to be able to find the sanitizer headers when
5398 # invoked via /fallback. This is critical for using macros
5399 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5401 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.5.0/include_sanitizer',
5405 'AdditionalLibraryDirectories': [
5406 # TODO(hans): If make_clang_dir is absolute, this breaks.
5407 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.5.0/lib/windows',
5410 'target_conditions': [
5411 ['_type=="executable"', {
5413 'AdditionalDependencies': [
5414 'clang_rt.asan-i386.lib',
5418 ['_type=="shared_library" or _type=="loadable_module"', {
5420 'AdditionalDependencies': [
5421 'clang_rt.asan_dll_thunk-i386.lib',
5431 ['disable_nacl==1', {
5432 'target_defaults': {
5438 ['OS=="win" and msvs_use_common_linker_extras', {
5439 'target_defaults': {
5454 'AdditionalOptions': [
5463 'AdditionalOptions': ['/largeaddressaware'],
5472 'AdditionalOptions': [
5473 # safeseh is not compatible with x64
5485 ['enable_new_npdevice_api==1', {
5486 'target_defaults': {
5488 'ENABLE_NEW_NPDEVICE_API',
5492 # Don't warn about the "typedef 'foo' locally defined but not used"
5494 # TODO: remove this flag once all builds work. See crbug.com/227506
5495 ['gcc_version>=48 and clang==0', {
5496 'target_defaults': {
5498 '-Wno-unused-local-typedefs',
5502 # We need a special case to handle the android webview build on mac because
5503 # the host gcc there doesn't accept this flag, but the target gcc may
5505 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5506 'target_defaults': {
5507 'target_conditions': [
5508 ['_toolset=="host"', {
5510 '-Wno-unused-local-typedefs',
5516 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5518 'make_global_settings': [
5519 ['CC', '<(make_clang_dir)/bin/clang'],
5520 ['CXX', '<(make_clang_dir)/bin/clang++'],
5521 ['CC.host', '$(CC)'],
5522 ['CXX.host', '$(CXX)'],
5525 ['clang==1 and OS=="win"', {
5526 'make_global_settings': [
5527 # On Windows, gyp's ninja generator only looks at CC.
5528 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5531 ['OS=="android" and clang==0', {
5532 # Hardcode the compiler names in the Makefile so that
5533 # it won't depend on the environment at make time.
5534 'make_global_settings': [
5535 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5536 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5537 ['CC.host', '<!(which gcc)'],
5538 ['CXX.host', '<!(which g++)'],
5541 ['OS=="linux" and target_arch=="mipsel"', {
5542 'make_global_settings': [
5543 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5544 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5545 ['CC.host', '<!(which gcc)'],
5546 ['CXX.host', '<!(which g++)'],
5549 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5550 # Set default ARM cross compiling on linux. These can be overridden
5551 # using CC/CXX/etc environment variables.
5552 'make_global_settings': [
5553 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5554 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5555 ['CC.host', '<!(which gcc)'],
5556 ['CXX.host', '<!(which g++)'],
5560 # TODO(yyanagisawa): supports GENERATOR==make
5561 # make generator doesn't support CC_wrapper without CC
5562 # in make_global_settings yet.
5563 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5564 'make_global_settings': [
5565 ['CC_wrapper', '<(gomadir)/gomacc'],
5566 ['CXX_wrapper', '<(gomadir)/gomacc'],
5567 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5568 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5573 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5574 # This block adds *project-wide* configuration settings to each project
5575 # file. It's almost always wrong to put things here. Specify your
5576 # custom xcode_settings in target_defaults to add them to targets instead.
5579 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5580 # setting sets the SDK on a project-wide basis. In order to get the
5581 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5582 # here at the project level.
5585 ['mac_sdk_path==""', {
5586 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5588 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5594 ['ios_sdk_path==""', {
5596 # TODO(justincohen): Ninja only supports simulator for now.
5597 ['"<(GENERATOR)"=="xcode"', {
5598 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5600 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5604 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5609 # Target both iPhone and iPad.
5610 'TARGETED_DEVICE_FAMILY': '1,2',
5613 ['target_arch=="x64"', {
5618 ['target_arch=="ia32"', {
5627 # The Xcode generator will look for an xcode_settings section at the root
5628 # of each dict and use it to apply settings on a file-wide basis. Most
5629 # settings should not be here, they should be in target-specific
5630 # xcode_settings sections, or better yet, should use non-Xcode-specific
5631 # settings in target dicts. SYMROOT is a special case, because many other
5632 # Xcode variables depend on it, including variables such as
5633 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5634 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5635 # files to appear (when present) in the UI as actual files and not red
5636 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5637 # and therefore SYMROOT, needs to be set at the project level.
5638 'SYMROOT': '<(DEPTH)/xcodebuild',