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',
179 # Default MIPS arch variant. This is set in the conditions block
180 # below for MIPS targets.
181 'mips_arch_variant%': '',
189 # Set default value of toolkit_views based on OS.
190 ['OS=="win" or chromeos==1 or use_aura==1', {
196 # Embedded builds use aura without ash or views.
203 # Enable HiDPI on Mac OS, Chrome OS and Windows.
204 ['OS=="mac" or chromeos==1 or OS=="win"', {
208 # Enable App Launcher everywhere but mobile.
209 ['OS!="ios" and OS!="android"', {
210 'enable_app_list%': 1,
212 'enable_app_list%': 0,
215 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
216 'use_default_render_theme%': 1,
218 'use_default_render_theme%': 0,
222 'use_ozone_evdev%': 1,
224 'use_ozone_evdev%': 0,
227 # Set default gomadir.
229 'gomadir': 'c:\\goma\\goma-win',
231 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
234 # Set the default "target_subarch" on iOS. Valid values are "arm32",
235 # "arm64" and "both" (meaning a fat binary).
237 # TODO(sdefresne): change the default from "arm32" to "both" for
238 # "target_subarch" once http://crbug.com/339477 is fixed.
240 # TODO(sdefresne): set the "target_arch" to "arm" once compilation
241 # of skia has been fixed for simulator. http://crbug.com/342377
243 'target_subarch%': 'arm32',
246 # Set arch variants for MIPS platforms.
247 ['target_arch=="mips64el"', {
250 'mips_arch_variant%': 'r6',
252 'mips_arch_variant%': 'r2',
257 ['target_arch=="mipsel"', {
258 'mips_arch_variant%': 'r1',
263 # Copy conditionally-set variables out one scope.
264 'chromeos%': '<(chromeos)',
265 'chromecast%': '<(chromecast)',
266 'host_arch%': '<(host_arch)',
267 'target_arch%': '<(target_arch)',
268 'target_subarch%': '<(target_subarch)',
269 'mips_arch_variant%': '<(mips_arch_variant)',
270 'toolkit_views%': '<(toolkit_views)',
271 'desktop_linux%': '<(desktop_linux)',
272 'use_aura%': '<(use_aura)',
273 'use_ash%': '<(use_ash)',
274 'use_cras%': '<(use_cras)',
275 'use_ozone%': '<(use_ozone)',
276 'use_ozone_evdev%': '<(use_ozone_evdev)',
277 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
278 'embedded%': '<(embedded)',
279 'use_openssl%': '<(use_openssl)',
280 'use_openssl_certs%': '<(use_openssl_certs)',
281 'enable_viewport%': '<(enable_viewport)',
282 'enable_hidpi%': '<(enable_hidpi)',
283 'android_webview_build%': '<(android_webview_build)',
284 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
285 'use_goma%': '<(use_goma)',
286 'gomadir%': '<(gomadir)',
287 'enable_app_list%': '<(enable_app_list)',
288 'use_default_render_theme%': '<(use_default_render_theme)',
289 'buildtype%': '<(buildtype)',
290 'branding%': '<(branding)',
291 'arm_version%': '<(arm_version)',
292 'sysroot%': '<(sysroot)',
293 'chroot_cmd%': '<(chroot_cmd)',
294 'system_libdir%': '<(system_libdir)',
296 # Set to 1 to enable fast builds. Set to 2 for even faster builds
297 # (it disables debug info for fastest compilation - only for use
298 # on compile-only bots).
301 # Set to 1 to not store any build metadata (this isn't working yet but
302 # this flag will help us to get there). See http://crbug.com/314403.
303 # TODO(sebmarchand): Update this comment once this flag guarantee that
304 # there's no build metadata in the build artifacts.
305 'dont_embed_build_metadata%': 0,
307 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
308 # This is useful for parallel compilation tools which can't support /Zi.
309 # Only used on Windows.
312 # Set to 1 to enable dcheck in release.
313 'dcheck_always_on%': 0,
315 # Set to 1 to make a build that disables unshipped tracing events.
316 # Note: this setting is ignored if buildtype=="Official".
317 'tracing_like_official_build%': 0,
319 # Disable image loader component extension by default.
320 'image_loader_extension%': 0,
322 # Set NEON compilation flags.
325 # Detect NEON support at run-time.
326 'arm_neon_optional%': 0,
328 # Use libjpeg-turbo as the JPEG codec used by Chromium.
329 'use_libjpeg_turbo%': 1,
331 # Use system libjpeg. Note that the system's libjepg will be used even if
332 # use_libjpeg_turbo is set.
333 'use_system_libjpeg%': 0,
335 # By default, component is set to static_library and it can be overriden
336 # by the GYP command line or by ~/.gyp/include.gypi.
337 'component%': 'static_library',
339 # Set to select the Title Case versions of strings in GRD files.
340 'use_titlecase_in_grd_files%': 0,
342 # Use translations provided by volunteers at launchpad.net. This
343 # currently only works on Linux.
344 'use_third_party_translations%': 0,
346 # Remoting compilation is enabled by default. Set to 0 to disable.
349 # Configuration policy is enabled by default. Set to 0 to disable.
350 'configuration_policy%': 1,
352 # Variable safe_browsing is used to control the build time configuration
353 # for safe browsing feature. Safe browsing can be compiled in 3 different
354 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
355 # reporting features without enabling phishing and malware detection. This
356 # is useful to integrate a third party phishing/malware detection to
357 # existing safe browsing logic.
360 # Web speech is enabled by default. Set to 0 to disable.
361 'enable_web_speech%': 1,
363 # Notifications are compiled in by default. Set to 0 to disable.
364 'notifications%' : 1,
366 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
367 # regular builds and 1 for ASan builds.
368 'mac_want_real_dsym%': 'default',
370 # If this is set, the clang plugins used on the buildbot will be used.
371 # Run tools/clang/scripts/update.sh to make sure they are compiled.
372 # This causes 'clang_chrome_plugins_flags' to be set.
373 # Has no effect if 'clang' is not set as well.
374 'clang_use_chrome_plugins%': 1,
376 # Enable building with ASAN (Clang's -fsanitize=address option).
377 # -fsanitize=address only works with clang, but asan=1 implies clang=1
378 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
380 # Enable coverage gathering instrumentation in ASan. This flag also
381 # controls coverage granularity (1 for function-level coverage, 2 for
382 # block-level coverage).
385 # Enable Chromium overrides of the default configurations for various
386 # dynamic tools (like ASan).
387 'use_sanitizer_options%': 1,
389 # Enable building with SyzyAsan.
390 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
393 # Enable building with LSan (Clang's -fsanitize=leak option).
394 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
395 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
398 # Enable building with TSan (Clang's -fsanitize=thread option).
399 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
400 # See http://clang.llvm.org/docs/ThreadSanitizer.html
402 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
404 # Enable building with MSan (Clang's -fsanitize=memory option).
405 # MemorySanitizer only works with clang, but msan=1 implies clang=1
406 # See http://clang.llvm.org/docs/MemorySanitizer.html
408 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
409 # Track where uninitialized memory originates from. From fastest to
410 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
411 # - track the chain of stores leading from allocation site to use site.
412 'msan_track_origins%': 1,
414 # Enable building with UBSan (Clang's -fsanitize=undefined option).
415 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
416 # See http://clang.llvm.org/docs/UsersManual.html
419 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
420 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
422 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan_vptr/blacklist.txt',
424 # Use the dynamic libraries instrumented by one of the sanitizers
425 # instead of the standard system libraries.
426 'use_instrumented_libraries%': 0,
428 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
429 # stdlibc++ as standard library. This is intended to use for instrumented
431 'use_custom_libcxx%': 0,
433 # Use system libc++ instead of the default C++ library, usually libstdc++.
434 # This is intended for iOS builds only.
435 'use_system_libcxx%': 0,
437 # Use a modified version of Clang to intercept allocated types and sizes
438 # for allocated objects. clang_type_profiler=1 implies clang=1.
439 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
440 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
441 'clang_type_profiler%': 0,
443 # Set to true to instrument the code with function call logger.
444 # See src/third_party/cygprofile/cyg-profile.cc for details.
445 'order_profiling%': 0,
447 # Use the provided profiled order file to link Chrome image with it.
448 # This makes Chrome faster by better using CPU cache when executing code.
449 # This is known as PGO (profile guided optimization).
450 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
451 'order_text_section%' : "",
453 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
454 # libraries on linux x86-64 and arm, plus ASLR.
457 # Whether one-click signin is enabled or not.
458 'enable_one_click_signin%': 0,
460 # Whether to back up data before sync.
461 'enable_pre_sync_backup%': 0,
463 # Enable Chrome browser extensions
464 'enable_extensions%': 1,
467 'enable_google_now%': 1,
469 # Enable printing support and UI. This variable is used to configure
470 # which parts of printing will be built. 0 disables printing completely,
471 # 1 enables it fully, and 2 enables only the codepath to generate a
472 # Metafile (e.g. usually a PDF or EMF) and disables print preview, cloud
474 'enable_printing%': 1,
476 # Windows prints using a PDF as the metafile from the renderer.
477 'win_pdf_metafile_for_printing%': 1,
479 # Set the version of CLD.
480 # 0: Don't specify the version. This option is for the Finch testing.
485 # For CLD2, the size of the tables that should be included in the build
486 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
488 # See third_party/cld_2/cld_2.gyp for more information.
489 # 0: Small tables, lower accuracy
490 # 1: Medium tables, medium accuracy
491 # 2: Large tables, high accuracy
492 'cld2_table_size%': 2,
494 # The data acquisition mode for CLD2. Possible values are:
495 # static: CLD2 data is statically linked to the executable.
496 # standalone: CLD2 data is provided in a standalone file that is
497 # bundled with the executable.
498 # component: CLD2 data is provided as a Chrome "component" and is
499 # downloaded via the component updater.
501 # For more information on switching the CLD2 data source, see:
502 # https://sites.google.com/a/chromium.org/dev/developers/how-tos/compact-language-detector-cld-data-source-configuration
504 # This string will be exposed in chrome://translate-internals under the
505 # heading "CLD Data Source". This allows easy determination of which
506 # data source the browser was built with.
507 'cld2_data_source%': 'static',
509 # Enable spell checker.
510 'enable_spellcheck%': 1,
512 # Webrtc compilation is enabled by default. Set to 0 to disable.
515 # Enables use of the session service, which is enabled by default.
516 # Support for disabling depends on the platform.
517 'enable_session_service%': 1,
519 # Enables theme support, which is enabled by default. Support for
520 # disabling depends on the platform.
523 # Enables autofill dialog and associated features; disabled by default.
524 'enable_autofill_dialog%' : 0,
526 # Defaults Wallet integration in Autofill dialog to use production
527 # servers. Unofficial builds won't have the proper API keys.
528 'enable_prod_wallet_service%': 0,
530 # Enables support for background apps.
531 'enable_background%': 1,
533 # Enable the task manager by default.
534 'enable_task_manager%': 1,
536 # Enables used resource whitelist generation; disabled by default.
537 'enable_resource_whitelist_generation%': 0,
539 # Enable FILE support by default.
540 'disable_file_support%': 0,
542 # Enable FTP support by default.
543 'disable_ftp_support%': 0,
545 # Use native android functions in place of ICU. Not supported by most
547 'use_icu_alternatives_on_android%': 0,
549 # XInput2 multitouch support is enabled by default (use_xi2_mt=2).
550 # Setting to zero value disables XI2 MT. When XI2 MT is enabled,
551 # the input value also defines the required XI2 minor minimum version.
552 # For example, use_xi2_mt=2 means XI2.2 or above version is required.
555 # Use of precompiled headers on Windows.
557 # This variable may be explicitly set to 1 (enabled) or 0
558 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
559 # This setting will override the default.
562 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
564 'chromium_win_pch%': 0,
567 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
568 # Set this to true when building with Clang.
569 # See http://code.google.com/p/chromium/wiki/Clang for details.
570 # If this is set, clang is used as both host and target compiler in
571 # cross-compile builds.
574 # Enable plug-in installation by default.
575 'enable_plugin_installation%': 1,
577 # Specifies whether to use canvas_skia.cc in place of platform
578 # specific implementations of gfx::Canvas. Affects text drawing in the
580 # TODO(asvitkine): Enable this on all platforms and delete this flag.
581 # http://crbug.com/105550
582 'use_canvas_skia%': 0,
584 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
585 # with one of those tools.
586 'build_for_tool%': '',
588 # If no directory is specified then a temporary directory will be used.
589 'test_isolation_outdir%': '',
590 # True if isolate should fail if the isolate files refer to files
592 'test_isolation_fail_on_missing': 0,
594 'wix_path%': '<(DEPTH)/third_party/wix',
596 # Managed users are enabled by default.
597 'enable_managed_users%': 1,
599 # Platform natively supports discardable memory.
600 'native_discardable_memory%': 0,
602 # Platform sends memory pressure signals natively.
603 'native_memory_pressure_signals%': 0,
605 'data_reduction_fallback_host%' : '',
606 'data_reduction_dev_host%' : '',
607 'spdy_proxy_auth_origin%' : '',
608 'spdy_proxy_auth_property%' : '',
609 'spdy_proxy_auth_value%' : '',
610 'data_reduction_proxy_probe_url%' : '',
611 'data_reduction_proxy_warmup_url%' : '',
612 'data_reduction_proxy_ssl_origin%' : '',
613 'data_reduction_proxy_alt_origin%' : '',
614 'data_reduction_proxy_alt_fallback_origin%' : '',
616 'enable_service_discovery%': 0,
617 'enable_wifi_bootstrapping%': 0,
618 'enable_hangout_services_extension%': 0,
620 # Enable the Syzygy optimization step.
621 'syzygy_optimize%': 0,
623 # Enable hole punching for the protected video.
626 # Automatically select platforms under ozone. Turn this off to
627 # build only explicitly selected platforms.
628 'ozone_auto_platforms%': 1,
631 ['android_webview_build==0', {
632 # If this is set clang is used as host compiler, but not as target
633 # compiler. Always do this by default, except when building for AOSP.
636 # See http://crbug.com/377684
639 # A flag for POSIX platforms
646 # A flag for BSD platforms
647 ['OS=="freebsd" or OS=="openbsd"', {
654 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
660 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
661 # OpenSSL's certificate definition.
662 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
663 'use_openssl_certs%': 1,
665 'use_openssl_certs%': 0,
668 # libudev usage. This currently only affects the content layer.
669 ['OS=="linux" and embedded==0', {
675 # Flags to use X11 on non-Mac POSIX platforms.
676 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
683 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
689 # Flags to use pango and cairo.
690 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
699 ['OS=="linux" and embedded==0', {
705 # We always use skia text rendering in Aura on Windows, since GDI
706 # doesn't agree with our BackingStore.
707 # TODO(beng): remove once skia text rendering is on by default.
708 ['use_aura==1 and OS=="win"', {
709 'enable_skia_text%': 1,
712 # A flag to enable or disable our compile-time dependency
713 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
714 # support will be available. This option is useful
715 # for Linux distributions and for Aura.
716 ['OS!="linux" or chromeos==1', {
717 'use_gnome_keyring%': 0,
719 'use_gnome_keyring%': 1,
722 ['OS=="mac" or OS=="ios"', {
723 # Mac and iOS want Title Case strings
724 'use_titlecase_in_grd_files%': 1,
727 # Enable loader extensions on Chrome OS.
729 'image_loader_extension%': 1,
731 'image_loader_extension%': 0,
734 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
735 'enable_one_click_signin%': 1,
736 'enable_pre_sync_backup%': 1,
740 'enable_extensions%': 0,
741 'enable_google_now%': 0,
743 'enable_spellcheck%': 0,
747 'arm_neon_optional%': 1,
748 'native_discardable_memory%': 1,
749 'native_memory_pressure_signals%': 1,
750 'enable_printing%': 2,
751 'enable_task_manager%':0,
752 # Set to 1 once we have a notification system for Android.
753 # http://crbug.com/115320
758 # Android OS includes support for proprietary codecs regardless of
759 # building Chromium or Google Chrome. We also ship Google Chrome and
760 # Chromecast with proprietary codecs.
761 ['OS=="android" or branding=="Chrome" or chromecast==1', {
762 'proprietary_codecs%': 1,
764 'proprietary_codecs%': 0,
767 ['OS=="mac" or OS=="ios"', {
768 'native_discardable_memory%': 1,
769 'native_memory_pressure_signals%': 1,
772 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
773 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
774 'enable_autofill_dialog%': 1,
777 ['buildtype=="Official"', {
778 'enable_prod_wallet_service%': 1,
788 'disable_ftp_support%': 1,
789 'enable_extensions%': 0,
790 'enable_google_now%': 0,
792 'enable_printing%': 0,
793 'enable_session_service%': 0,
799 'enable_managed_users%': 0,
800 'enable_task_manager%': 0,
803 # Use GPU accelerated cross process image transport by default
804 # on linux builds with the Aura window manager
805 ['use_aura==1 and OS=="linux"', {
806 'ui_compositor_image_transport%': 1,
808 'ui_compositor_image_transport%': 0,
811 # Turn precompiled headers on by default.
812 ['OS=="win" and buildtype!="Official"', {
813 'chromium_win_pch%': 1
816 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
817 'enable_plugin_installation%': 0,
819 'enable_plugin_installation%': 1,
822 # Whether PPAPI is enabled.
823 ['OS=="android" or OS=="ios" or embedded==1', {
824 'enable_plugins%': 0,
826 'enable_plugins%': 1,
829 # linux_use_bundled_gold: whether to use the gold linker binary checked
830 # into third_party/binutils. Force this off via GYP_DEFINES when you
831 # are using a custom toolchain and need to control -B in ldflags.
832 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
833 # for component=static_library builds.
834 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
835 'linux_use_bundled_gold%': 1,
837 'linux_use_bundled_gold%': 0,
840 # linux_use_bundled_binutils: whether to use the binary binutils
841 # checked into third_party/binutils. These are not multi-arch so cannot
842 # be used except on x86 and x86-64 (the only two architectures which
843 # are currently checke in). Force this off via GYP_DEFINES when you
844 # are using a custom toolchain and need to control -B in cflags.
845 ['OS=="linux" and (target_arch=="x64")', {
846 'linux_use_bundled_binutils%': 1,
848 'linux_use_bundled_binutils%': 0,
851 # linux_use_gold_flags: whether to use build flags that rely on gold.
852 # On by default for x64 Linux.
853 ['OS=="linux" and target_arch=="x64"', {
854 'linux_use_gold_flags%': 1,
856 'linux_use_gold_flags%': 0,
859 # linux_use_debug_fission: whether to use split DWARF debug info
860 # files. This can reduce link time significantly, but is incompatible
861 # with some utilities such as icecc and ccache. Requires gold and
862 # gcc >= 4.8 or clang.
863 # http://gcc.gnu.org/wiki/DebugFission
864 ['OS=="linux" and target_arch=="x64"', {
865 'linux_use_debug_fission%': 1,
867 'linux_use_debug_fission%': 0,
870 ['OS=="android" or OS=="ios"', {
871 'enable_captive_portal_detection%': 0,
873 'enable_captive_portal_detection%': 1,
876 # Enable Skia UI text drawing incrementally on different platforms.
877 # http://crbug.com/105550
879 # On Aura, this allows per-tile painting to be used in the browser
882 'use_canvas_skia%': 1,
886 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
887 'use_libjpeg_turbo%': 0,
891 # When building as part of the Android system, use system libraries
892 # where possible to reduce ROM size.
893 'use_system_libjpeg%': '<(android_webview_build)',
896 # Do not enable the Settings App on ChromeOS.
897 ['enable_app_list==1 and chromeos==0', {
898 'enable_settings_app%': 1,
900 'enable_settings_app%': 0,
903 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
904 # Set some defaults for arm/linux chrome builds
905 'use_allocator%': 'none',
906 # sysroot needs to be an absolute path otherwise it generates
907 # incorrect results when passed to pkg-config
908 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot',
909 }], # OS=="linux" and target_arch=="arm" and chromeos==0
911 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
913 ['target_arch=="x64"', {
914 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
916 ['target_arch=="ia32"', {
917 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
920 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
922 ['OS=="linux" and target_arch=="mipsel"', {
923 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
924 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
927 # Whether tests targets should be run, archived or just have the
928 # dependencies verified. All the tests targets have the '_run' suffix,
929 # e.g. base_unittests_run runs the target base_unittests. The test
930 # target always calls tools/swarming_client/isolate.py. See the script's
931 # --help for more information and the valid --mode values. Meant to be
932 # overriden with GYP_DEFINES.
933 # TODO(maruel): Remove the conditions as more configurations are
935 # NOTE: The check for disable_nacl==0 and component=="static_library"
936 # can't be used here because these variables are not defined yet, but it
937 # is still not supported.
938 ['OS!="ios" and OS!="android" and chromeos==0', {
939 'test_isolation_mode%': 'check',
941 'test_isolation_mode%': 'noop',
943 # Whether Android build uses OpenMAX DL FFT.
944 ['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")', {
945 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
946 # When enabled, this will also enable WebAudio support on
947 # Android for these architectures. Default is enabled. Whether
948 # WebAudio is actually available depends on runtime settings
950 'use_openmax_dl_fft%': 1,
952 'use_openmax_dl_fft%': 0,
954 ['OS=="win" or OS=="linux"', {
958 # Turns on compiler optimizations in V8 in Debug build, except
959 # on android_clang, where we're hitting a weird linker error.
960 # TODO(dpranke): http://crbug.com/266155 .
962 'v8_optimized_debug%': 1,
964 'v8_optimized_debug%': 2,
967 # Disable various features by default on embedded.
970 'enable_printing%': 0,
973 # By default, use ICU data file (icudtl.dat) on all platforms
974 # except when building Android WebView or Chromecast.
975 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
976 # Set the data reduction proxy origin for Android Webview.
977 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0', {
978 'icu_use_data_file_flag%' : 1,
979 'spdy_proxy_auth_origin%': '',
980 'data_reduction_proxy_probe_url%': '',
981 'data_reduction_proxy_warmup_url%': '',
982 'data_reduction_dev_host%': '',
983 'data_reduction_fallback_host%': '',
985 'icu_use_data_file_flag%' : 0,
986 'spdy_proxy_auth_origin%': 'https://proxy.googlezip.net:443/',
987 'data_reduction_proxy_probe_url%': 'http://check.googlezip.net/connect',
988 'data_reduction_proxy_warmup_url%': 'http://www.gstatic.com/generate_204',
989 'data_reduction_dev_host%': 'http://proxy-dev.googlezip.net:80/',
990 'data_reduction_fallback_host%': 'http://compress.googlezip.net:80/',
992 ['OS=="win" or OS=="mac"', {
993 'enable_wifi_bootstrapping%' : 1,
996 # Path to sas.dll, which provides the SendSAS function.
997 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
998 ['target_arch=="x64"', {
999 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1001 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1005 # Set this to 1 to enable use of concatenated impulse responses
1006 # for the HRTF panner in WebAudio.
1007 'use_concatenated_impulse_responses': 1,
1009 # You can set the variable 'use_official_google_api_keys' to 1
1010 # to use the Google-internal file containing official API keys
1011 # for Google Chrome even in a developer build. Setting this
1012 # variable explicitly to 1 will cause your build to fail if the
1013 # internal file is missing.
1015 # The variable is documented here, but not handled in this file;
1016 # see //google_apis/determine_use_official_keys.gypi for the
1019 # Set the variable to 0 to not use the internal file, even when
1020 # it exists in your checkout.
1022 # Leave it unset in your include.gypi to have the variable
1023 # implicitly set to 1 if you have
1024 # src/google_apis/internal/google_chrome_api_keys.h in your
1025 # checkout, and implicitly set to 0 if not.
1027 # Note that official builds always behave as if the variable
1028 # was explicitly set to 1, i.e. they always use official keys,
1029 # and will fail to build if the internal file is missing.
1031 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1032 # include.gypi or by other means. Due to subtleties of GYP, this
1033 # is not the same as leaving the variable unset, even though its
1035 # //google_apis/determine_use_official_keys.gypi is 2.
1037 # Set these to bake the specified API keys and OAuth client
1038 # IDs/secrets into your build.
1040 # If you create a build without values baked in, you can instead
1041 # set environment variables to provide the keys at runtime (see
1042 # src/google_apis/google_api_keys.h for details). Features that
1043 # require server-side APIs may fail to work if no keys are
1046 # Note that if you are building an official build or if
1047 # use_official_google_api_keys has been set to 1 (explicitly or
1048 # implicitly), these values will be ignored and the official
1049 # keys will be used instead.
1050 'google_api_key%': '',
1051 'google_default_client_id%': '',
1052 'google_default_client_secret%': '',
1053 # Native Client is enabled by default.
1054 'disable_nacl%': '0',
1057 # Copy conditionally-set variables out one scope.
1058 'branding%': '<(branding)',
1059 'buildtype%': '<(buildtype)',
1060 'target_arch%': '<(target_arch)',
1061 'target_subarch%': '<(target_subarch)',
1062 'mips_arch_variant%': '<(mips_arch_variant)',
1063 'host_arch%': '<(host_arch)',
1064 'toolkit_views%': '<(toolkit_views)',
1065 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1066 'use_aura%': '<(use_aura)',
1067 'use_ash%': '<(use_ash)',
1068 'use_cras%': '<(use_cras)',
1069 'use_openssl%': '<(use_openssl)',
1070 'use_openssl_certs%': '<(use_openssl_certs)',
1071 'use_nss%': '<(use_nss)',
1072 'use_udev%': '<(use_udev)',
1073 'os_bsd%': '<(os_bsd)',
1074 'os_posix%': '<(os_posix)',
1075 'use_dbus%': '<(use_dbus)',
1076 'use_glib%': '<(use_glib)',
1077 'use_pango%': '<(use_pango)',
1078 'use_cairo%': '<(use_cairo)',
1079 'use_ozone%': '<(use_ozone)',
1080 'use_ozone_evdev%': '<(use_ozone_evdev)',
1081 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1082 'desktop_linux%': '<(desktop_linux)',
1083 'use_x11%': '<(use_x11)',
1084 'use_gnome_keyring%': '<(use_gnome_keyring)',
1085 'linux_fpic%': '<(linux_fpic)',
1086 'chromeos%': '<(chromeos)',
1087 'chromecast%': '<(chromecast)',
1088 'enable_viewport%': '<(enable_viewport)',
1089 'enable_hidpi%': '<(enable_hidpi)',
1090 'use_xi2_mt%':'<(use_xi2_mt)',
1091 'image_loader_extension%': '<(image_loader_extension)',
1092 'fastbuild%': '<(fastbuild)',
1093 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1094 'win_z7%': '<(win_z7)',
1095 'dcheck_always_on%': '<(dcheck_always_on)',
1096 'tracing_like_official_build%': '<(tracing_like_official_build)',
1097 'arm_version%': '<(arm_version)',
1098 'arm_neon%': '<(arm_neon)',
1099 'arm_neon_optional%': '<(arm_neon_optional)',
1100 'sysroot%': '<(sysroot)',
1101 'chroot_cmd%': '<(chroot_cmd)',
1102 'system_libdir%': '<(system_libdir)',
1103 'component%': '<(component)',
1104 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1105 'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
1106 'use_third_party_translations%': '<(use_third_party_translations)',
1107 'remoting%': '<(remoting)',
1108 'enable_one_click_signin%': '<(enable_one_click_signin)',
1109 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1110 'enable_webrtc%': '<(enable_webrtc)',
1111 'chromium_win_pch%': '<(chromium_win_pch)',
1112 'configuration_policy%': '<(configuration_policy)',
1113 'safe_browsing%': '<(safe_browsing)',
1114 'enable_web_speech%': '<(enable_web_speech)',
1115 'notifications%': '<(notifications)',
1116 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1117 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1119 'asan_coverage%': '<(asan_coverage)',
1120 'use_sanitizer_options%': '<(use_sanitizer_options)',
1121 'syzyasan%': '<(syzyasan)',
1122 'syzygy_optimize%': '<(syzygy_optimize)',
1125 'msan_blacklist%': '<(msan_blacklist)',
1126 'msan_track_origins%': '<(msan_track_origins)',
1128 'tsan_blacklist%': '<(tsan_blacklist)',
1129 'ubsan%': '<(ubsan)',
1130 'ubsan_vptr%': '<(ubsan_vptr)',
1131 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1132 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1133 'use_custom_libcxx%': '<(use_custom_libcxx)',
1134 'use_system_libcxx%': '<(use_system_libcxx)',
1135 'clang_type_profiler%': '<(clang_type_profiler)',
1136 'order_profiling%': '<(order_profiling)',
1137 'order_text_section%': '<(order_text_section)',
1138 'enable_extensions%': '<(enable_extensions)',
1139 'enable_plugin_installation%': '<(enable_plugin_installation)',
1140 'enable_plugins%': '<(enable_plugins)',
1141 'enable_session_service%': '<(enable_session_service)',
1142 'enable_themes%': '<(enable_themes)',
1143 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1144 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1145 'enable_background%': '<(enable_background)',
1146 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1147 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1148 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1149 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1150 'use_canvas_skia%': '<(use_canvas_skia)',
1151 'test_isolation_mode%': '<(test_isolation_mode)',
1152 'test_isolation_outdir%': '<(test_isolation_outdir)',
1153 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1154 'enable_printing%': '<(enable_printing)',
1155 'win_pdf_metafile_for_printing%': '<(win_pdf_metafile_for_printing)',
1156 'enable_spellcheck%': '<(enable_spellcheck)',
1157 'enable_google_now%': '<(enable_google_now)',
1158 'cld_version%': '<(cld_version)',
1159 'cld2_table_size%': '<(cld2_table_size)',
1160 'cld2_data_source%': '<(cld2_data_source)',
1161 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1162 'disable_file_support%': '<(disable_file_support)',
1163 'disable_ftp_support%': '<(disable_ftp_support)',
1164 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1165 'enable_task_manager%': '<(enable_task_manager)',
1166 'sas_dll_path%': '<(sas_dll_path)',
1167 'wix_path%': '<(wix_path)',
1168 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1169 'use_system_libjpeg%': '<(use_system_libjpeg)',
1170 'android_webview_build%': '<(android_webview_build)',
1171 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
1172 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1173 'gyp_managed_install%': 0,
1174 'create_standalone_apk%': 1,
1175 'enable_app_list%': '<(enable_app_list)',
1176 'use_default_render_theme%': '<(use_default_render_theme)',
1177 'enable_settings_app%': '<(enable_settings_app)',
1178 'google_api_key%': '<(google_api_key)',
1179 'google_default_client_id%': '<(google_default_client_id)',
1180 'google_default_client_secret%': '<(google_default_client_secret)',
1181 'enable_managed_users%': '<(enable_managed_users)',
1182 'native_discardable_memory%': '<(native_discardable_memory)',
1183 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1184 'data_reduction_fallback_host%': '<(data_reduction_fallback_host)',
1185 'data_reduction_dev_host%': '<(data_reduction_dev_host)',
1186 'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)',
1187 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1188 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1189 'data_reduction_proxy_probe_url%': '<(data_reduction_proxy_probe_url)',
1190 'data_reduction_proxy_warmup_url%': '<(data_reduction_proxy_warmup_url)',
1191 'data_reduction_proxy_ssl_origin%' : '<(data_reduction_proxy_ssl_origin)',
1192 'data_reduction_proxy_alt_origin%' : '<(data_reduction_proxy_alt_origin)',
1193 'data_reduction_proxy_alt_fallback_origin%' : '<(data_reduction_proxy_alt_fallback_origin)',
1194 'enable_mdns%' : '<(enable_mdns)',
1195 'enable_service_discovery%' : '<(enable_service_discovery)',
1196 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1197 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1198 'v8_optimized_debug%': '<(v8_optimized_debug)',
1199 'proprietary_codecs%': '<(proprietary_codecs)',
1200 'use_goma%': '<(use_goma)',
1201 'gomadir%': '<(gomadir)',
1202 'video_hole%': '<(video_hole)',
1204 # Use system protobuf instead of bundled one.
1205 'use_system_protobuf%': 0,
1207 # Use system yasm instead of bundled one.
1208 'use_system_yasm%': 0,
1210 # Use system ICU instead of bundled one.
1211 'use_system_icu%' : 0,
1213 # Default to enabled PIE; this is important for ASLR but we may need to be
1214 # able to turn it off for various reasons.
1215 'linux_disable_pie%': 0,
1217 # The release channel that this build targets. This is used to restrict
1218 # channel-specific build options, like which installer packages to create.
1219 # The default is 'all', which does no channel-specific filtering.
1222 # Override chromium_mac_pch and set it to 0 to suppress the use of
1223 # precompiled headers on the Mac. Prefix header injection may still be
1224 # used, but prefix headers will not be precompiled. This is useful when
1225 # using distcc to distribute a build to compile slaves that don't
1226 # share the same compiler executable as the system driving the compilation,
1227 # because precompiled headers rely on pointers into a specific compiler
1228 # executable's image. Setting this to 0 is needed to use an experimental
1229 # Linux-Mac cross compiler distcc farm.
1230 'chromium_mac_pch%': 1,
1232 # The default value for mac_strip in target_defaults. This cannot be
1233 # set there, per the comment about variable% in a target_defaults.
1234 'mac_strip_release%': 0,
1236 # Set to 1 to enable java code coverage. Instruments classes during build
1237 # to produce .ec files during runtime.
1238 'emma_coverage%': 0,
1240 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1241 # separated with whitespace and/or comma. Only has effect if
1242 # 'emma_coverage=1'.
1245 # Set to 1 to enable running Android lint on java/class files.
1248 # Although base/allocator lets you select a heap library via an
1249 # environment variable, the libcmt shim it uses sometimes gets in
1250 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1251 # 'win_use_allocator_shim': 0,
1252 # 'win_release_RuntimeLibrary': 2
1253 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1254 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1256 # TODO(bradnelson): eliminate this when possible.
1257 # To allow local gyp files to prevent release.vsprops from being included.
1258 # Yes(1) means include release.vsprops.
1259 # Once all vsprops settings are migrated into gyp, this can go away.
1260 'msvs_use_common_release%': 1,
1262 # TODO(bradnelson): eliminate this when possible.
1263 # To allow local gyp files to override additional linker options for msvs.
1264 # Yes(1) means set use the common linker options.
1265 'msvs_use_common_linker_extras%': 1,
1267 # TODO(sgk): eliminate this if possible.
1268 # It would be nicer to support this via a setting in 'target_defaults'
1269 # in chrome/app/locales/locales.gypi overriding the setting in the
1270 # 'Debug' configuration in the 'target_defaults' dict below,
1271 # but that doesn't work as we'd like.
1272 'msvs_debug_link_incremental%': '2',
1274 # Needed for some of the largest modules.
1275 'msvs_debug_link_nonincremental%': '1',
1277 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1278 # to get incremental linking to be faster in debug builds.
1279 'incremental_chrome_dll%': '0',
1281 # Experimental setting to break chrome.dll into multiple pieces based on
1283 'chrome_multiple_dll%': '0',
1285 # Experimental setting to optimize Chrome's DLLs with PGO.
1286 'chrome_pgo_phase%': '0',
1289 'clang%': '<(clang)',
1290 'host_clang%': '<(host_clang)',
1291 'make_clang_dir%': '<(make_clang_dir)',
1293 # Control which version of clang to use when building for iOS. If set to
1294 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1295 # the version of clang that ships with the Chromium source. This variable
1296 # is automatically set to '1' when using the Xcode generator.
1299 # These two variables can be set in GYP_DEFINES while running
1300 # |gclient runhooks| to let clang run a plugin in every compilation.
1301 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1303 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1306 'clang_add_plugin%': '',
1308 # Tell ld64 to write map files describing binary layout. Useful
1309 # for looking at what contributes to binary size, e.g. with
1310 # https://github.com/nico/bloat
1311 'mac_write_linker_maps%': 0,
1313 # The default type of gtest.
1314 'gtest_target_type%': 'executable',
1316 # Enable sampling based profiler.
1317 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1319 # Profile without optimizing out stack frames when profiling==1.
1320 'profiling_full_stack_frames%': '0',
1322 # And if we want to dump symbols for Breakpad-enabled builds.
1323 'linux_dump_symbols%': 0,
1324 # And if we want to strip the binary after dumping symbols.
1325 'linux_strip_binary%': 0,
1326 # If we want stack unwind support for backtrace().
1327 'debug_unwind_tables%': 1,
1328 'release_unwind_tables%': 1,
1330 # Override where to find binutils
1331 'binutils_version%': 0,
1332 'binutils_dir%': '',
1335 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1336 'use_allocator%': 'tcmalloc',
1338 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1339 'linux_link_gnome_keyring%': 0,
1340 # Set to 1 to link against gsettings APIs instead of using dlopen().
1341 'linux_link_gsettings%': 0,
1343 # Enable use of OpenMAX DL FFT routines.
1344 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1346 # Enable new NPDevice API.
1347 'enable_new_npdevice_api%': 0,
1349 # Enable EGLImage support in OpenMAX
1350 'enable_eglimage%': 1,
1352 # .gyp files or targets should set chromium_code to 1 if they build
1353 # Chromium-specific code, as opposed to external code. This variable is
1354 # used to control such things as the set of warnings to enable, and
1355 # whether warnings are treated as errors.
1356 'chromium_code%': 0,
1358 # Disable fatal linker warnings, similarly to how we make it possible
1359 # to disable -Werror (e.g. for different toolchain versions).
1360 'disable_fatal_linker_warnings%': 0,
1362 'release_valgrind_build%': 0,
1364 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1365 'enable_wexit_time_destructors%': 0,
1367 # Build libpeerconnection as a static library by default.
1368 'libpeer_target_type%': 'static_library',
1370 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1371 'internal_gles2_conform_tests%': 0,
1373 # Set to 1 to compile the filter fuzzer.
1374 'internal_filter_fuzzer%': 0,
1376 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1377 # so Cocoa is happy (http://crbug.com/20441).
1379 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1380 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1381 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1382 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1383 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1384 'vi', 'zh-CN', 'zh-TW',
1387 # Pseudo locales are special locales which are used for testing and
1388 # debugging. They don't get copied to the final app. For more info,
1389 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1396 # If debug_devtools is set to 1, JavaScript files for DevTools are
1397 # stored as is and loaded from disk. Otherwise, a concatenated file
1398 # is stored in resources.pak. It is still possible to load JS files
1399 # from disk by passing --debug-devtools cmdline switch.
1400 'debug_devtools%': 0,
1402 # The Java Bridge is not compiled in by default.
1405 # Code signing for iOS binaries. The bots need to be able to disable this.
1406 'chromium_ios_signing%': 1,
1408 # This flag is only used when disable_nacl==0 and disables all those
1409 # subcomponents which would require the installation of a native_client
1410 # untrusted toolchain.
1411 'disable_nacl_untrusted%': 0,
1413 # Disable Dart by default.
1416 # Copy out the setting of disable_nacl.
1417 'disable_nacl%': '<(disable_nacl)',
1419 # Portable Native Client is enabled by default.
1420 'disable_pnacl%': 0,
1422 # Whether to build full debug version for Debug configuration on Android.
1423 # Compared to full debug version, the default Debug configuration on Android
1424 # has no full v8 debug, has size optimization and linker gc section, so that
1425 # we can build a debug version with acceptable size and performance.
1426 'android_full_debug%': 0,
1428 # Sets the default version name and code for Android app, by default we
1429 # do a developer build.
1430 'android_app_version_name%': 'Developer Build',
1431 'android_app_version_code%': 0,
1433 # Contains data about the attached devices for gyp_managed_install.
1434 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1436 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1437 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1439 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1440 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1442 # Whether we are using the rlz library or not. Platforms like Android send
1443 # rlz codes for searches but do not use the library.
1446 # Turns on the i18n support in V8.
1447 'v8_enable_i18n_support': 1,
1449 # Compile d8 for the host toolset.
1450 'v8_toolset_for_d8': 'host',
1452 # Use the chromium skia by default.
1453 'use_system_skia%': '0',
1455 # Use brlapi from brltty for braille display support.
1458 # Relative path to icu.gyp from this file.
1459 'icu_gyp_path': '../third_party/icu/icu.gyp',
1461 # IPC fuzzer is disabled by default.
1462 'enable_ipc_fuzzer%': 0,
1465 # Force disable libstdc++ debug mode.
1466 'disable_glibcxx_debug%': 0,
1468 # Set to 1 to compile with MSE support for MPEG2 TS
1469 'enable_mpeg2ts_stream_parser%': 0,
1471 # Support ChromeOS touchpad gestures with ozone.
1472 'use_evdev_gestures%': 0,
1474 # Default ozone platform (if no --ozone-platform flag).
1475 'ozone_platform%': "",
1477 # Ozone platforms to include in the build.
1478 'ozone_platform_caca%': 0,
1479 'ozone_platform_dri%': 0,
1480 'ozone_platform_egltest%': 0,
1481 'ozone_platform_gbm%': 0,
1482 'ozone_platform_ozonex%': 0,
1483 'ozone_platform_test%': 0,
1485 # Chrome OS: whether to build ChromeVox from sources in the Chromium
1486 # repository rather than using precompiled JavaScript in
1487 # chrome/third_party/chromevox. This is still experimental.
1488 'use_migrated_chromevox%': 1,
1490 # Chrome OS: whether to also build the upcoming version of
1491 # ChromeVox, which can then be enabled via a command-line switch.
1492 'use_chromevox_next%': 0,
1495 # The version of clang shipped upstream does not find C++ headers when
1496 # using -stdlib=libc++ so we instead need to use the version of clang
1497 # coming with Xcode.
1498 ['OS=="ios" and use_system_libcxx==1', {
1501 # Enable the Syzygy optimization step for the official builds.
1502 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1503 'syzygy_optimize%': 1,
1505 'syzygy_optimize%': 0,
1507 # Get binutils version so we can enable debug fission if we can.
1508 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1510 # compiler_version doesn't work with clang
1511 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1512 # compiler_version works with clang.
1513 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1514 # that it takes effect here.
1515 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1516 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1518 # On Android we know the binutils version in the toolchain.
1520 'binutils_version%': 222,
1522 ['host_arch=="x64"', {
1523 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1525 ['host_arch=="ia32"', {
1526 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1528 # Our version of binutils in third_party/binutils
1529 ['linux_use_bundled_binutils==1', {
1530 'binutils_version%': 224,
1534 'binutils_version%': 0,
1536 # The version of GCC in use, set later in platforms that use GCC and have
1537 # not explicitly chosen to build with clang. Currently, this means all
1538 # platforms except Windows, Mac and iOS.
1539 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1540 # it takes effect here.
1541 ['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', {
1544 # We directly set the gcc versions since we know what we use.
1547 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1549 ['android_webview_build==1', {
1550 # Android WebView uses a hermetic toolchain even for host, so set it
1553 ['host_os=="mac"', {
1554 'host_gcc_version%': 42,
1556 'host_gcc_version%': 46,
1559 }, { # android_webview_build!=1
1560 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1564 'host_gcc_version%': 0,
1567 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1568 'windows_sdk_path%': '<(windows_sdk_default_path)',
1570 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
1572 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1573 'directx_sdk_path%': '<(directx_sdk_default_path)',
1575 'directx_sdk_path%': '$(DXSDK_DIR)',
1578 'windows_driver_kit_path%': '$(WDK_DIR)',
1580 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1582 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1585 'nacl_untrusted_build%': 0,
1586 'use_allocator%': 'none',
1588 ['OS=="linux" and target_arch=="mipsel"', {
1589 'sysroot%': '<(sysroot)',
1592 # All Chrome builds have breakpad symbols, but only process the
1593 # symbols from official builds.
1594 ['(branding=="Chrome" and buildtype=="Official")', {
1595 'linux_dump_symbols%': 1,
1597 # Omit unwind support in official release builds to save space. We
1598 # can use breakpad for these builds.
1599 'release_unwind_tables%': 0,
1602 # For official builds, use a 64-bit linker to avoid running out
1603 # of address space. The buildbots should have a 64-bit kernel
1604 # and a 64-bit libc installed.
1605 ['host_arch=="ia32" and target_arch=="ia32"', {
1606 'linux_use_bundled_gold%': '1',
1607 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1612 }], # os_posix==1 and OS!="mac" and OS!="ios"
1615 'enable_background%': 0,
1616 'icu_use_data_file_flag%': 1,
1617 'enable_web_speech%': 0,
1618 'use_system_libxml%': 1,
1619 'use_system_sqlite%': 1,
1621 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1622 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1623 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1624 'uk', 'vi', 'zh-CN', 'zh-TW',
1627 # The Mac SDK is set for iOS builds and passed through to Mac
1628 # sub-builds. This allows the Mac sub-build SDK in an iOS build to be
1629 # overridden from the command line the same way it is for a Mac build.
1630 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py 10.6)',
1632 # iOS SDK and deployment target support. The |ios_sdk| value is left
1633 # blank so that when it is set in the project files it will be the
1634 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1635 # causes Xcode to spit out a warning for every single project file for
1636 # not using the "current" SDK.
1638 'ios_sdk_path%': '',
1639 'ios_deployment_target%': '7.0',
1642 # ios_product_name is set to the name of the .app bundle as it should
1644 ['branding=="Chrome"', {
1645 'ios_product_name%': 'Chrome',
1646 }, { # else: branding!="Chrome"
1647 'ios_product_name%': 'Chromium',
1649 ['branding=="Chrome" and buildtype=="Official"', {
1651 }, { # else: branding!="Chrome" or buildtype!="Official"
1657 # Location of Android NDK.
1660 # Unfortunately we have to use absolute paths to the SDK/NDK because
1661 # they're passed to ant which uses a different relative path from
1663 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1664 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1665 'android_host_arch%': '<!(uname -m)',
1666 # Android API-level of the SDK used for compilation.
1667 'android_sdk_version%': '20',
1668 'android_sdk_build_tools_version%': '20.0.0',
1669 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1671 # Copy conditionally-set variables out one scope.
1672 'android_ndk_root%': '<(android_ndk_root)',
1673 'android_sdk_root%': '<(android_sdk_root)',
1674 'android_sdk_version%': '<(android_sdk_version)',
1675 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1676 'host_os%': '<(host_os)',
1678 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1679 # Android SDK build tools (e.g. dx, aapt, aidl)
1680 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1682 # Android API level 14 is ICS (Android 4.0) which is the minimum
1683 # platform requirement for Chrome on Android, we use it for native
1686 ['target_arch == "ia32"', {
1687 'android_app_abi%': 'x86',
1688 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1689 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1690 'android_ndk_lib_dir%': 'usr/lib',
1691 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1693 ['target_arch == "x64"', {
1694 'android_app_abi%': 'x86_64',
1695 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1696 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-x86_64',
1697 'android_ndk_lib_dir%': 'usr/lib64',
1698 'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1700 ['target_arch=="arm"', {
1703 'android_app_abi%': 'armeabi',
1705 'android_app_abi%': 'armeabi-v7a',
1708 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1709 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1710 'android_ndk_lib_dir%': 'usr/lib',
1711 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1713 ['target_arch == "arm64"', {
1714 'android_app_abi%': 'arm64-v8a',
1715 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1716 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-arm64',
1717 'android_ndk_lib_dir%': 'usr/lib',
1718 'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1720 ['target_arch == "mipsel"', {
1721 'android_app_abi%': 'mips',
1722 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1723 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1724 'android_ndk_lib_dir%': 'usr/lib',
1725 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1727 ['target_arch == "mips64el"', {
1728 'android_app_abi%': 'mips64',
1729 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1730 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-mips64',
1731 'android_ndk_lib_dir%': 'usr/lib64',
1732 'android_toolchain%': '<(android_ndk_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1737 # Copy conditionally-set variables out one scope.
1738 'android_app_abi%': '<(android_app_abi)',
1739 'android_gdbserver%': '<(android_gdbserver)',
1740 'android_ndk_root%': '<(android_ndk_root)',
1741 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1742 'android_sdk_root%': '<(android_sdk_root)',
1743 'android_sdk_version%': '<(android_sdk_version)',
1744 'android_toolchain%': '<(android_toolchain)',
1746 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1747 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1748 'android_sdk_tools%': '<(android_sdk_tools)',
1749 'android_sdk%': '<(android_sdk)',
1750 'android_sdk_jar%': '<(android_sdk)/android.jar',
1752 'android_stlport_root': '<(android_stlport_root)',
1753 'android_stlport_include': '<(android_stlport_root)/stlport',
1754 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1755 'host_os%': '<(host_os)',
1757 # Location of the "objcopy" binary, used by both gyp and scripts.
1758 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1760 # Location of the "strip" binary, used by both gyp and scripts.
1761 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1763 # Location of the "readelf" binary.
1764 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1766 # Determines whether we should optimize JNI generation at the cost of
1767 # breaking assumptions in the build system that when inputs have changed
1768 # the outputs should always change as well. This is meant purely for
1769 # developer builds, to avoid spurious re-linking of native files.
1770 'optimize_jni_generation%': 0,
1772 # Always uses openssl.
1774 'use_openssl_certs%': 1,
1776 'proprietary_codecs%': '<(proprietary_codecs)',
1777 'safe_browsing%': 1,
1778 'enable_web_speech%': 0,
1780 'build_ffmpegsumo%': 0,
1781 'use_allocator%': 'none',
1783 # Disable Native Client.
1786 # Android does not support background apps.
1787 'enable_background%': 0,
1789 # Sessions are store separately in the Java side.
1790 'enable_session_service%': 0,
1794 'gtest_target_type%': 'shared_library',
1796 # Uses system APIs for decoding audio and video.
1797 'use_libffmpeg%': '0',
1799 # When building as part of the Android system, use system libraries
1800 # where possible to reduce ROM size.
1801 # TODO(steveblock): Investigate using the system version of sqlite.
1802 'use_system_sqlite%': 0, # '<(android_webview_build)',
1803 'use_system_expat%': '<(android_webview_build)',
1804 'use_system_icu%': '<(android_webview_build)',
1805 'use_system_stlport%': '<(android_webview_build)',
1807 # Copy it out one scope.
1808 'android_webview_build%': '<(android_webview_build)',
1810 # Default android linker script for shared library exports.
1811 'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_exports.lst',
1814 'use_system_fontconfig%': 0,
1816 'use_system_fontconfig%': 1,
1819 'enable_mpeg2ts_stream_parser%': 1,
1820 'ffmpeg_branding%': 'Chrome',
1821 'ozone_platform_ozonex%': 1,
1823 ['target_arch=="arm"', {
1825 'arm_tune%': 'cortex-a9',
1831 ['android_webview_build==1 or android_webview_telemetry_build==1', {
1832 # When building the WebView in the Android tree, jarjar will remap all
1833 # the class names, so the JNI generator needs to know this.
1834 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1836 ['OS=="linux" and target_arch!="mipsel"', {
1837 # TODO(thakis): This is here to measure perf for a while.
1842 # All Chrome builds have breakpad symbols, but only process the
1843 # symbols from official builds.
1844 ['(branding=="Chrome" and buildtype=="Official")', {
1845 'mac_strip_release%': 1,
1849 ['OS=="mac" or OS=="ios"', {
1853 # Mac OS X SDK and deployment target support. The SDK identifies
1854 # the version of the system headers that will be used, and
1855 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1856 # macro. "Maximum allowed" refers to the operating system version
1857 # whose APIs are available in the headers. The deployment target
1858 # identifies the minimum system version that the built products are
1859 # expected to function on. It corresponds to the
1860 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1861 # macros are available, #include <AvailabilityMacros.h>. Additional
1862 # documentation on these macros is available at
1863 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1864 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1865 # deployment target to 10.6. Other projects, such as O3D, may
1866 # override these defaults.
1868 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1869 # about that is at least the specified version. In official builds,
1870 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1871 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1872 # path to the SDK; when set to a non-empty string, SDK detection
1873 # based on mac_sdk_min will be bypassed entirely.
1874 'mac_sdk_min%': '10.6',
1875 'mac_sdk_path%': '',
1877 'mac_deployment_target%': '10.6',
1880 'mac_sdk_min': '<(mac_sdk_min)',
1881 'mac_sdk_path': '<(mac_sdk_path)',
1882 'mac_deployment_target': '<(mac_deployment_target)',
1884 # Compile in Breakpad support by default so that it can be
1885 # tested, even if it is not enabled by default at runtime.
1886 'mac_breakpad_compiled_in%': 1,
1888 # mac_product_name is set to the name of the .app bundle as it should
1889 # appear on disk. This duplicates data from
1890 # chrome/app/theme/chromium/BRANDING and
1891 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1892 # these names into the build system.
1893 ['branding=="Chrome"', {
1894 'mac_product_name%': 'Google Chrome',
1895 }, { # else: branding!="Chrome"
1896 'mac_product_name%': 'Chromium',
1899 ['branding=="Chrome" and buildtype=="Official"', {
1900 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1901 # Enable uploading crash dumps.
1902 'mac_breakpad_uploads%': 1,
1903 # Enable dumping symbols at build time for use by Mac Breakpad.
1905 # Enable Keystone auto-update support.
1907 }, { # else: branding!="Chrome" or buildtype!="Official"
1908 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1909 'mac_breakpad_uploads%': 0,
1914 }], # OS=="mac" or OS=="ios"
1917 # This is the architecture convention used in WinSDK paths.
1918 ['target_arch=="ia32"', {
1919 'winsdk_arch%': 'x86',
1921 'winsdk_arch%': '<(target_arch)',
1923 ['component=="shared_library"', {
1924 'win_use_allocator_shim%': 0,
1926 # Turn on multiple dll by default on Windows when in static_library.
1927 'chrome_multiple_dll%': 1,
1930 'win_use_allocator_shim%': 0,
1932 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1933 # Only enabled by default for ninja because it's buggy in VS.
1934 # Not enabled for component=static_library because some targets
1935 # are too large and the toolchain fails due to the size of the
1937 'incremental_chrome_dll%': 1,
1939 # Don't do incremental linking for large modules on 32-bit or when
1940 # component=static_library as the toolchain fails due to the size of
1942 ['MSVS_OS_BITS==32 or component=="static_library"', {
1943 'msvs_large_module_debug_link_mode%': '1', # No
1945 'msvs_large_module_debug_link_mode%': '2', # Yes
1947 ['MSVS_VERSION=="2013e"', {
1955 'nacl_win64_defines': [
1956 # This flag is used to minimize dependencies when building
1957 # Native Client loader for 64-bit Windows.
1962 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1968 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1969 'enable_pepper_cdms%': 1,
1971 'enable_pepper_cdms%': 0,
1975 'enable_browser_cdms%': 1,
1977 'enable_browser_cdms%': 0,
1980 # Native Client glibc toolchain is enabled
1981 # by default except on arm, mips and mips64.
1982 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
1983 'disable_glibc%': 1,
1985 'disable_glibc%': 0,
1988 # Set the relative path from this file to the GYP file of the JPEG
1989 # library used by Chromium.
1990 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1991 # Configuration for using the system libjeg is here.
1992 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1994 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1997 # Options controlling the use of GConf (the classic GNOME configuration
1998 # system) and GIO, which contains GSettings (the new GNOME config system).
1999 ['chromeos==1 or embedded==1', {
2007 # Set up -D and -E flags passed into grit.
2008 ['branding=="Chrome"', {
2009 # TODO(mmoss) The .grd files look for _google_chrome, but for
2010 # consistency they should look for google_chrome_build like C++.
2011 'grit_defines': ['-D', '_google_chrome',
2012 '-E', 'CHROMIUM_BUILD=google_chrome'],
2014 'grit_defines': ['-D', '_chromium',
2015 '-E', 'CHROMIUM_BUILD=chromium'],
2018 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2020 ['desktop_linux==1', {
2021 'grit_defines': ['-D', 'desktop_linux'],
2023 ['toolkit_views==1', {
2024 'grit_defines': ['-D', 'toolkit_views'],
2027 'grit_defines': ['-D', 'use_aura'],
2030 'grit_defines': ['-D', 'use_ash'],
2033 'grit_defines': ['-D', 'use_nss'],
2036 'grit_defines': ['-D', 'use_ozone'],
2038 ['image_loader_extension==1', {
2039 'grit_defines': ['-D', 'image_loader_extension'],
2042 'grit_defines': ['-D', 'remoting'],
2044 ['use_titlecase_in_grd_files==1', {
2045 'grit_defines': ['-D', 'use_titlecase'],
2047 ['use_third_party_translations==1', {
2048 'grit_defines': ['-D', 'use_third_party_translations'],
2050 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2051 'ka', 'ku', 'kw', 'ms', 'ug'
2055 'grit_defines': ['-t', 'android',
2056 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true'],
2058 ['OS=="mac" or OS=="ios"', {
2059 'grit_defines': ['-D', 'scale_factors=2x'],
2064 # iOS uses a whitelist to filter resources.
2065 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
2068 # Enable host builds when generating with ninja-ios.
2070 ['"<(GENERATOR)"=="ninja"', {
2074 # TODO(sdefresne): Remove the target_subarch check once Apple has
2075 # upstreamed the support for "arm64". http://crbug.com/341453
2076 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
2081 ['enable_extensions==1', {
2082 'grit_defines': ['-D', 'enable_extensions'],
2084 ['enable_plugins!=0', {
2085 'grit_defines': ['-D', 'enable_plugins'],
2087 ['enable_printing!=0', {
2088 'grit_defines': ['-D', 'enable_printing'],
2090 ['enable_printing==1', {
2091 'grit_defines': ['-D', 'enable_full_printing'],
2093 ['enable_themes==1', {
2094 'grit_defines': ['-D', 'enable_themes'],
2096 ['enable_app_list==1', {
2097 'grit_defines': ['-D', 'enable_app_list'],
2099 ['enable_settings_app==1', {
2100 'grit_defines': ['-D', 'enable_settings_app'],
2102 ['enable_google_now==1', {
2103 'grit_defines': ['-D', 'enable_google_now'],
2105 ['use_concatenated_impulse_responses==1', {
2106 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2108 ['enable_webrtc==1', {
2109 'grit_defines': ['-D', 'enable_webrtc'],
2111 ['enable_hangout_services_extension==1', {
2112 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2114 ['enable_task_manager==1', {
2115 'grit_defines': ['-D', 'enable_task_manager'],
2117 ['notifications==1', {
2118 'grit_defines': ['-D', 'enable_notifications'],
2120 ['enable_wifi_bootstrapping==1', {
2121 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2123 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2124 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2126 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2127 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2129 ['enable_mdns==1 or OS=="mac"', {
2130 'grit_defines': ['-D', 'enable_service_discovery'],
2131 'enable_service_discovery%': 1
2133 ['clang_use_chrome_plugins==1 and OS!="win"', {
2134 'clang_chrome_plugins_flags': [
2135 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
2138 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2140 'use_allocator%': 'none',
2142 ['asan==1 and OS=="linux" and chromeos==0', {
2143 'use_custom_libcxx%': 1,
2151 ['asan==1 and OS=="mac"', {
2152 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
2153 # runtime is fully adopted. See http://crbug.com/242503.
2154 'mac_strip_release': 0,
2157 'use_custom_libcxx%': 1,
2160 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2161 # libstdc++. This is required to avoid false positive reports whenever
2162 # the C++ standard library is used.
2163 'use_custom_libcxx%': 1,
2164 # Running the V8-generated code on an ARM simulator is a powerful hack
2165 # that allows the tool to see the memory accesses from JITted code.
2166 # Without this flag, JS code causes false positive reports from MSan.
2167 'v8_target_arch': 'arm64',
2170 ['OS=="linux" and clang_type_profiler==1', {
2172 'clang_use_chrome_plugins%': 0,
2174 ['host_arch=="x64"', {
2175 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2177 ['host_arch=="ia32"', {
2178 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2179 # Clang in this directory at your own risk if needed for some
2180 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2181 # usage). Any failure by this compiler should not close the tree.
2182 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2188 # The Clang plugins don't currently work on Windows.
2189 # TODO(hans): One day, this will work. (crbug.com/82385)
2190 'clang_use_chrome_plugins%': 0,
2193 # On valgrind bots, override the optimizer settings so we don't inline too
2194 # much and make the stacks harder to figure out.
2196 # TODO(rnk): Kill off variables that no one else uses and just implement
2197 # them under a build_for_tool== condition.
2198 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2200 'mac_debug_optimization': '1',
2201 'mac_release_optimization': '1',
2202 'release_optimize': '1',
2203 'no_gc_sections': 1,
2204 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2205 '-fno-builtin -fno-optimize-sibling-calls',
2206 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2207 '-fno-builtin -fno-optimize-sibling-calls',
2209 # MSVS flags for TSan on Pin and Windows.
2210 'win_debug_RuntimeChecks': '0',
2211 'win_debug_disable_iterator_debugging': '1',
2212 'win_debug_Optimization': '1',
2213 'win_debug_InlineFunctionExpansion': '0',
2214 'win_release_InlineFunctionExpansion': '0',
2215 'win_release_OmitFramePointers': '0',
2217 'use_allocator': 'tcmalloc',
2218 'release_valgrind_build': 1,
2220 'component': 'static_library',
2221 'use_system_zlib': 0,
2224 # Build tweaks for DrMemory.
2225 # TODO(rnk): Combine with tsan config to share the builder.
2226 # http://crbug.com/108155
2227 ['build_for_tool=="drmemory"', {
2228 # These runtime checks force initialization of stack vars which blocks
2229 # DrMemory's uninit detection.
2230 'win_debug_RuntimeChecks': '0',
2231 # Iterator debugging is slow.
2232 'win_debug_disable_iterator_debugging': '1',
2233 # Try to disable optimizations that mess up stacks in a release build.
2234 # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054)
2235 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2236 # compiler bug, so we use /Ob1 instead.
2237 'win_release_InlineFunctionExpansion': '1',
2238 'win_release_OmitFramePointers': '0',
2239 # Ditto for debug, to support bumping win_debug_Optimization.
2240 'win_debug_InlineFunctionExpansion': 0,
2241 'win_debug_OmitFramePointers': 0,
2242 # Keep the code under #ifndef NVALGRIND.
2243 'release_valgrind_build': 1,
2246 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2247 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2251 # Set default compiler flags depending on ARM version.
2252 ['arm_version==6 and android_webview_build==0', {
2253 'arm_arch%': 'armv6',
2256 'arm_float_abi%': 'softfp',
2259 ['arm_version==7 and android_webview_build==0', {
2260 'arm_arch%': 'armv7-a',
2261 'arm_tune%': 'generic-armv7-a',
2266 'arm_fpu%': 'vfpv3-d16',
2269 # Change the default to hard once the armhf transition is complete.
2270 'arm_float_abi%': 'softfp',
2274 ['android_webview_build==1', {
2275 # The WebView build gets its cpu-specific flags from the Android build system.
2279 'arm_float_abi%': '',
2283 # Enable brlapi by default for chromeos.
2288 ['use_ozone==1 and ozone_auto_platforms==1', {
2289 # Use test as the default platform.
2290 'ozone_platform%': 'test',
2292 # Build all platforms whose deps are in install-build-deps.sh.
2293 # Only these platforms will be compile tested by buildbots.
2294 'ozone_platform_dri%': 1,
2295 'ozone_platform_test%': 1,
2296 'ozone_platform_egltest%': 1,
2299 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2300 'use_clipboard_aurax11%': 1,
2303 ['OS=="win" and use_goma==1', {
2304 # goma doesn't support pch yet.
2305 'chromium_win_pch': 0,
2306 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2314 ['OS=="win" and (clang==1 or asan==1)', {
2315 'chromium_win_pch': 0,
2319 'host_cc': '<(make_clang_dir)/bin/clang',
2320 'host_cxx': '<(make_clang_dir)/bin/clang++',
2322 'host_cc': '<!(which gcc)',
2323 'host_cxx': '<!(which g++)',
2326 # The seccomp-bpf sandbox is only supported on five architectures
2328 # Do not disable seccomp_bpf anywhere without talking to
2329 # security@chromium.org!
2330 ['((OS=="linux" or OS=="android") and '
2331 '(target_arch=="ia32" or target_arch=="x64" or '
2332 'target_arch=="arm" or target_arch=="mipsel" or '
2333 'target_arch=="arm64"))', {
2334 'use_seccomp_bpf%': 1,
2336 'use_seccomp_bpf%': 0,
2340 # The path to the ANGLE library.
2341 'angle_path': '<(DEPTH)/third_party/angle',
2343 # List of default apps to install in new profiles. The first list contains
2344 # the source files as found in svn. The second list, used only for linux,
2345 # contains the destination location for each of the files. When a crx
2346 # is added or removed from the list, the chrome/browser/resources/
2347 # default_apps/external_extensions.json file must also be updated.
2348 'default_apps_list': [
2349 'browser/resources/default_apps/external_extensions.json',
2350 'browser/resources/default_apps/gmail.crx',
2351 'browser/resources/default_apps/search.crx',
2352 'browser/resources/default_apps/youtube.crx',
2353 'browser/resources/default_apps/drive.crx',
2354 'browser/resources/default_apps/docs.crx',
2356 'default_apps_list_linux_dest': [
2357 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2358 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2359 '<(PRODUCT_DIR)/default_apps/search.crx',
2360 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2361 '<(PRODUCT_DIR)/default_apps/drive.crx',
2362 '<(PRODUCT_DIR)/default_apps/docs.crx',
2365 # Whether to allow building of the GPU-related isolates.
2366 'archive_gpu_tests%': 0,
2368 'target_defaults': {
2370 # The condition that operates on chromium_code is in a target_conditions
2371 # section, and will not have access to the default fallback value of
2372 # chromium_code at the top of this file, or to the chromium_code
2373 # variable placed at the root variables scope of .gyp files, because
2374 # those variables are not set at target scope. As a workaround,
2375 # if chromium_code is not set at target scope, define it in target scope
2376 # to contain whatever value it has during early variable expansion.
2377 # That's enough to make it available during target conditional
2379 'chromium_code%': '<(chromium_code)',
2381 'component%': '<(component)',
2383 'chromecast%': '<(chromecast)',
2385 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2386 'win_release_Optimization%': '2', # 2 = /Os
2387 'win_debug_Optimization%': '0', # 0 = /Od
2389 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2390 # Tri-state: blank is default, 1 on, 0 off
2391 'win_release_OmitFramePointers%': '0',
2392 # Tri-state: blank is default, 1 on, 0 off
2393 'win_debug_OmitFramePointers%': '',
2395 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2396 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2398 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2399 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2400 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2402 # VS inserts quite a lot of extra checks to algorithms like
2403 # std::partial_sort in Debug build which make them O(N^2)
2404 # instead of O(N*logN). This is particularly slow under memory
2405 # tools like ThreadSanitizer so we want it to be disablable.
2406 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2407 'win_debug_disable_iterator_debugging%': '0',
2409 # An application manifest fragment to declare compatibility settings for
2410 # 'executable' targets. Ignored in other target type.
2411 'win_exe_compatibility_manifest%':
2412 '<(DEPTH)\\build\\win\\compatibility.manifest',
2414 'release_extra_cflags%': '',
2415 'debug_extra_cflags%': '',
2417 'release_valgrind_build%': '<(release_valgrind_build)',
2419 # the non-qualified versions are widely assumed to be *nix-only
2420 'win_release_extra_cflags%': '',
2421 'win_debug_extra_cflags%': '',
2423 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2424 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2426 # Only used by Windows build for now. Can be used to build into a
2427 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2428 # output files in src/build/VS2010_{Debug,Release}.
2429 'build_dir_prefix%': '',
2431 # Targets are by default not nacl untrusted code.
2432 'nacl_untrusted_build%': 0,
2434 'pnacl_compile_flags': [
2435 # pnacl uses the clang compiler so we need to suppress all the
2436 # same warnings as we do for clang.
2437 # TODO(sbc): Remove these if/when they are removed from the clang
2439 '-Wno-unused-function',
2440 '-Wno-char-subscripts',
2441 '-Wno-c++11-extensions',
2442 '-Wno-unnamed-type-template-args',
2446 ['OS=="win" and component=="shared_library"', {
2447 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2448 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2449 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2451 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2452 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2453 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2456 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2457 'mac_release_optimization%': 's', # Use -Os unless overridden
2458 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2460 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2461 'mac_release_optimization%': '3', # Use -O3 unless overridden
2462 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2465 'host_os%': '<(host_os)', # See comment above chromium_code.
2468 'clang_warning_flags': [
2471 # Don't die on dtoa code that uses a char as an array index.
2472 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2473 '-Wno-char-subscripts',
2475 # TODO(thakis): This used to be implied by -Wno-unused-function,
2476 # which we no longer use. Check if it makes sense to remove
2477 # this as well. http://crbug.com/316352
2478 '-Wno-unneeded-internal-declaration',
2480 # Warns on switches on enums that cover all enum values but
2481 # also contain a default: branch. Chrome is full of that.
2482 '-Wno-covered-switch-default',
2484 # Warns when a const char[] is converted to bool.
2485 '-Wstring-conversion',
2487 # C++11-related flags:
2489 # This warns on using ints as initializers for floats in
2490 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2491 # which happens in several places in chrome code. Not sure if
2492 # this is worth fixing.
2493 '-Wno-c++11-narrowing',
2495 # Clang considers the `register` keyword as deprecated, but e.g.
2496 # code generated by flex (used in angle) contains that keyword.
2497 # http://crbug.com/255186
2498 '-Wno-deprecated-register',
2501 'includes': [ 'set_clang_warning_flags.gypi', ],
2503 # Don't use deprecated V8 APIs anywhere.
2504 'V8_DEPRECATION_WARNINGS',
2507 '<(SHARED_INTERMEDIATE_DIR)',
2510 ['(OS=="mac" or OS=="ios") and asan==1', {
2512 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2515 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2516 'cflags_cc!': ['-fno-rtti'],
2519 '-gline-tables-only',
2520 '-fintercept-allocation-functions',
2522 'defines': ['TYPE_PROFILING'],
2524 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2527 ['branding=="Chrome"', {
2528 'defines': ['GOOGLE_CHROME_BUILD'],
2529 }, { # else: branding!="Chrome"
2530 'defines': ['CHROMIUM_BUILD'],
2532 ['OS=="mac" and component=="shared_library"', {
2534 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2535 'LD_RUNPATH_SEARCH_PATHS': [
2536 # For unbundled binaries.
2538 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2539 '@loader_path/../../..',
2543 ['clang==1 and OS!="win"', {
2544 # This is here so that all files get recompiled after a clang roll and
2545 # when turning clang on or off.
2546 # (defines are passed via the command line, and build systems rebuild
2547 # things when their commandline changes). Nothing should ever read this
2549 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2552 'defines': ['ENABLE_RLZ'],
2554 ['component=="shared_library"', {
2555 'defines': ['COMPONENT_BUILD'],
2557 ['toolkit_views==1', {
2558 'defines': ['TOOLKIT_VIEWS=1'],
2560 ['ui_compositor_image_transport==1', {
2561 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2564 'defines': ['USE_AURA=1'],
2567 'defines': ['USE_ASH=1'],
2570 'defines': ['USE_PANGO=1'],
2573 'defines': ['USE_CAIRO=1'],
2576 'defines': ['USE_CRAS=1'],
2579 'defines': ['USE_GLIB=1'],
2582 'defines': ['USE_OZONE=1'],
2584 ['use_default_render_theme==1', {
2585 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2587 ['use_libjpeg_turbo==1', {
2588 'defines': ['USE_LIBJPEG_TURBO=1'],
2591 'defines': ['USE_X11=1'],
2593 ['use_clipboard_aurax11==1', {
2594 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2596 ['enable_one_click_signin==1', {
2597 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2599 ['enable_pre_sync_backup==1', {
2600 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2602 ['use_xi2_mt!=0 and use_x11==1', {
2603 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2605 ['image_loader_extension==1', {
2606 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2609 'defines': ['ENABLE_PROFILING=1'],
2612 'defines': ['ENABLE_REMOTING=1'],
2614 ['enable_webrtc==1', {
2615 'defines': ['ENABLE_WEBRTC=1'],
2617 ['proprietary_codecs==1', {
2618 'defines': ['USE_PROPRIETARY_CODECS'],
2620 ['enable_mpeg2ts_stream_parser==1', {
2621 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2625 ['enable_viewport==1', {
2626 'defines': ['ENABLE_VIEWPORT'],
2628 ['enable_pepper_cdms==1', {
2629 'defines': ['ENABLE_PEPPER_CDMS'],
2631 ['enable_browser_cdms==1', {
2632 'defines': ['ENABLE_BROWSER_CDMS'],
2634 ['configuration_policy==1', {
2635 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2637 ['notifications==1', {
2638 'defines': ['ENABLE_NOTIFICATIONS'],
2640 ['enable_hidpi==1', {
2641 'defines': ['ENABLE_HIDPI=1'],
2643 ['native_discardable_memory==1', {
2644 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2646 ['native_memory_pressure_signals==1', {
2647 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2650 'defines': ['USE_UDEV'],
2654 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2657 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2658 # Clang creates chubby debug information, which makes linking very
2659 # slow. For now, don't create debug information with clang. See
2660 # http://crbug.com/70000
2664 'debug_extra_cflags': '-g0',
2667 # Android builds symbols on release by default, disable them.
2670 'debug_extra_cflags': '-g0',
2671 'release_extra_cflags': '-g0',
2675 }, { # else clang!=1
2677 ['OS=="win" and fastbuild==2', {
2678 # Completely disable debug information.
2681 'GenerateDebugInformation': 'false',
2683 'VCCLCompilerTool': {
2684 'DebugInformationFormat': '0',
2688 ['OS=="win" and fastbuild==1', {
2691 # This tells the linker to generate .pdbs, so that
2692 # we can get meaningful stack traces.
2693 'GenerateDebugInformation': 'true',
2695 'VCCLCompilerTool': {
2696 # No debug info to be generated by compiler.
2697 'DebugInformationFormat': '0',
2701 ['OS=="linux" and fastbuild==2', {
2703 'debug_extra_cflags': '-g0',
2706 ['OS=="linux" and fastbuild==1', {
2708 'debug_extra_cflags': '-g1',
2711 ['OS=="android" and fastbuild==2', {
2713 'debug_extra_cflags': '-g0',
2714 'release_extra_cflags': '-g0',
2717 ['OS=="android" and fastbuild==1', {
2719 'debug_extra_cflags': '-g1',
2720 'release_extra_cflags': '-g1',
2727 ['dont_embed_build_metadata==1', {
2729 'DONT_EMBED_BUILD_METADATA',
2731 }], # dont_embed_build_metadata==1
2732 ['dcheck_always_on!=0', {
2733 'defines': ['DCHECK_ALWAYS_ON=1'],
2734 }], # dcheck_always_on!=0
2735 ['tracing_like_official_build!=0', {
2736 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2737 }], # tracing_like_official_build!=0
2738 ['win_use_allocator_shim==0', {
2741 'defines': ['NO_TCMALLOC'],
2745 ['enable_eglimage==1', {
2747 'ENABLE_EGLIMAGE=1',
2752 'ADDRESS_SANITIZER',
2753 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2754 'MEMORY_SANITIZER_INITIAL_SIZE',
2758 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2766 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2767 'MEMORY_SANITIZER_INITIAL_SIZE',
2773 '_CRT_SECURE_NO_DEPRECATE',
2774 '_SCL_SECURE_NO_DEPRECATE',
2775 # This define is required to pull in the new Win8 interfaces from
2776 # system headers like ShObjIdl.h.
2777 'NTDDI_VERSION=0x06020000',
2778 # This is required for ATL to use XP-safe versions of its functions.
2779 '_USING_V110_SDK71_',
2782 '<(DEPTH)/third_party/wtl/include',
2787 # Generates debug info when win_z7=1
2788 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2790 'GenerateDebugInformation': 'true',
2792 'VCCLCompilerTool': {
2793 'DebugInformationFormat': '1',
2804 ['target_arch=="arm"', {
2806 # TODO(lcwu): Work around an error when building Chromium
2807 # with gcc-4.5.3 (e.g. v8/src/platform-linux.cc). Remove
2808 # this define once the toolchain is updated.
2809 # See crbug.com/388933.
2815 ['enable_task_manager==1', {
2817 'ENABLE_TASK_MANAGER=1',
2820 ['enable_extensions==1', {
2822 'ENABLE_EXTENSIONS=1',
2825 ['OS=="win" and branding=="Chrome"', {
2826 'defines': ['ENABLE_SWIFTSHADER'],
2828 ['enable_dart==1', {
2829 'defines': ['WEBKIT_USING_DART=1'],
2831 ['enable_plugin_installation==1', {
2832 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2834 ['enable_plugins==1', {
2835 'defines': ['ENABLE_PLUGINS=1'],
2837 ['enable_session_service==1', {
2838 'defines': ['ENABLE_SESSION_SERVICE=1'],
2840 ['enable_themes==1', {
2841 'defines': ['ENABLE_THEMES=1'],
2843 ['enable_autofill_dialog==1', {
2844 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2846 ['enable_prod_wallet_service==1', {
2847 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2849 ['enable_background==1', {
2850 'defines': ['ENABLE_BACKGROUND=1'],
2852 ['enable_google_now==1', {
2853 'defines': ['ENABLE_GOOGLE_NOW=1'],
2855 ['cld_version!=0', {
2856 'defines': ['CLD_VERSION=<(cld_version)'],
2858 ['cld_version==2', {
2859 # This is used to populate the "CLD Data Source" field in:
2860 # chrome://translate-internals
2861 'defines': ['CLD2_DATA_SOURCE=<(cld2_data_source)'],
2863 ['enable_printing==1', {
2864 'defines': ['ENABLE_FULL_PRINTING=1', 'ENABLE_PRINTING=1'],
2866 ['enable_printing==2', {
2867 'defines': ['ENABLE_PRINTING=1'],
2869 ['OS=="win" and win_pdf_metafile_for_printing==1', {
2870 'defines': ['WIN_PDF_METAFILE_FOR_PRINTING=1'],
2872 ['enable_spellcheck==1', {
2873 'defines': ['ENABLE_SPELLCHECK=1'],
2875 ['enable_captive_portal_detection==1', {
2876 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2878 ['enable_app_list==1', {
2879 'defines': ['ENABLE_APP_LIST=1'],
2881 ['enable_settings_app==1', {
2882 'defines': ['ENABLE_SETTINGS_APP=1'],
2884 ['disable_file_support==1', {
2885 'defines': ['DISABLE_FILE_SUPPORT=1'],
2887 ['disable_ftp_support==1', {
2888 'defines': ['DISABLE_FTP_SUPPORT=1'],
2890 ['use_icu_alternatives_on_android==1', {
2891 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2893 ['enable_managed_users==1', {
2894 'defines': ['ENABLE_MANAGED_USERS=1'],
2896 ['data_reduction_fallback_host != ""', {
2898 'DATA_REDUCTION_FALLBACK_HOST="<(data_reduction_fallback_host)"'],
2900 ['data_reduction_dev_host != ""', {
2902 'DATA_REDUCTION_DEV_HOST="<(data_reduction_dev_host)"'],
2904 ['spdy_proxy_auth_origin != ""', {
2905 'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'],
2907 ['spdy_proxy_auth_property != ""', {
2908 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2910 ['spdy_proxy_auth_value != ""', {
2911 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2913 ['data_reduction_proxy_probe_url != ""', {
2915 'DATA_REDUCTION_PROXY_PROBE_URL="<(data_reduction_proxy_probe_url)"'],
2917 ['data_reduction_proxy_warmup_url != ""', {
2919 'DATA_REDUCTION_PROXY_WARMUP_URL="<(data_reduction_proxy_warmup_url)"'],
2921 ['data_reduction_proxy_ssl_origin != ""', {
2923 'DATA_REDUCTION_PROXY_SSL_ORIGIN="<(data_reduction_proxy_ssl_origin)"'],
2925 ['data_reduction_proxy_alt_origin != ""', {
2927 'DATA_REDUCTION_PROXY_ALT_ORIGIN="<(data_reduction_proxy_alt_origin)"'],
2929 ['data_reduction_proxy_alt_fallback_origin != ""', {
2931 'DATA_REDUCTION_PROXY_ALT_FALLBACK_ORIGIN="<(data_reduction_proxy_alt_fallback_origin)"'],
2933 ['enable_mdns==1', {
2934 'defines': ['ENABLE_MDNS=1'],
2936 ['enable_service_discovery==1', {
2937 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2939 ['enable_wifi_bootstrapping==1', {
2940 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2942 ['enable_hangout_services_extension==1', {
2943 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2945 ['enable_ipc_fuzzer==1', {
2946 'defines': ['ENABLE_IPC_FUZZER=1'],
2949 'defines': ['VIDEO_HOLE=1'],
2951 ], # conditions for 'target_defaults'
2952 'target_conditions': [
2953 ['<(use_openssl)==1', {
2954 'defines': ['USE_OPENSSL=1'],
2956 ['<(use_openssl_certs)==1', {
2957 'defines': ['USE_OPENSSL_CERTS=1'],
2959 ['>(nacl_untrusted_build)==1', {
2962 'USE_OPENSSL_CERTS=1',
2965 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
2966 'defines': ['USE_NSS=1'],
2968 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
2969 'defines': ['OS_CHROMEOS=1'],
2971 ['enable_wexit_time_destructors==1 and OS!="win"', {
2972 # TODO: Enable on Windows too, http://crbug.com/404525
2973 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
2975 ['chromium_code==0', {
2977 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
2978 # We don't want to get warnings from third-party code,
2979 # so remove any existing warning-enabling flags like -Wall.
2985 # Don't warn about hash_map in third-party code.
2989 # Don't warn about printf format problems.
2990 # This is off by default in gcc but on in Ubuntu's gcc(!).
2994 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
2998 # TODO: Fix all warnings on chromeos too.
2999 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3004 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3006 # Don't warn about ignoring the return value from e.g. close().
3007 # This is off by default in some gccs but on by default in others.
3008 # BSD systems do not support this option, since they are usually
3009 # using gcc 4.2.1, which does not have this flag yet.
3010 '-Wno-unused-result',
3015 '_CRT_SECURE_NO_DEPRECATE',
3016 '_CRT_NONSTDC_NO_WARNINGS',
3017 '_CRT_NONSTDC_NO_DEPRECATE',
3018 '_SCL_SECURE_NO_DEPRECATE',
3020 'msvs_disabled_warnings': [4800],
3022 'VCCLCompilerTool': {
3023 'WarningLevel': '3',
3024 'WarnAsError': 'true',
3025 'Detect64BitPortabilityProblems': 'false',
3029 ['buildtype=="Official"', {
3031 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3036 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3041 # TODO(darin): Unfortunately, some third_party code depends on base.
3042 [ 'OS=="win" and component=="shared_library"', {
3043 'msvs_disabled_warnings': [
3044 4251, # class 'std::xx' needs to have dll-interface.
3047 [ 'OS=="mac" or OS=="ios"', {
3049 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3052 ['buildtype=="Official"', {
3054 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3061 # TODO(ios): Fix remaining warnings in third-party code, then
3062 # remove this; the Mac cleanup didn't get everything that's
3063 # flagged in an iOS build.
3064 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3065 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3066 # Several internal ios directories generate numerous warnings for
3067 # -Wobjc-missing-property-synthesis.
3068 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3074 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3075 'filename_rules.gypi',
3077 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3078 # C99 macros on Mac and Linux.
3080 '__STDC_CONSTANT_MACROS',
3081 '__STDC_FORMAT_MACROS',
3085 # turn on warnings for signed/unsigned mismatch on chromium code.
3087 'VCCLCompilerTool': {
3088 'AdditionalOptions': ['/we4389'],
3092 ['OS=="win" and component=="shared_library"', {
3093 'msvs_disabled_warnings': [
3094 4251, # class 'std::xx' needs to have dll-interface.
3099 ], # target_conditions for 'target_defaults'
3100 'default_configuration': 'Debug',
3102 # VCLinkerTool LinkIncremental values below:
3104 # 1 == /INCREMENTAL:NO
3106 # Debug links incremental, Release does not.
3108 # Abstract base configurations to cover common attributes.
3112 'msvs_configuration_attributes': {
3113 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3114 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3115 'CharacterSet': '1',
3117 # Add the default import libs.
3120 'AdditionalDependencies': [
3144 'MinimumRequiredVersion': '5.01', # XP.
3145 'TargetMachine': '1',
3147 'VCLibrarianTool': {
3148 'TargetMachine': '1',
3151 'msvs_configuration_platform': 'Win32',
3155 'msvs_configuration_platform': 'x64',
3158 # Make sure to understand http://crbug.com/361720 if you want to
3160 'MinimumRequiredVersion': '5.02', # Server 2003.
3161 'TargetMachine': '17', # x86 - 64
3162 'AdditionalLibraryDirectories!':
3163 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3164 'AdditionalLibraryDirectories':
3165 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3166 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3167 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3169 'VCLibrarianTool': {
3170 'AdditionalLibraryDirectories!':
3171 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3172 'AdditionalLibraryDirectories':
3173 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3174 'TargetMachine': '17', # x64
3181 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3182 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3185 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3187 '<@(debug_extra_cflags)',
3191 'VCCLCompilerTool': {
3192 'Optimization': '<(win_debug_Optimization)',
3193 'PreprocessorDefinitions': ['_DEBUG'],
3194 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3195 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3197 # According to MSVS, InlineFunctionExpansion=0 means
3198 # "default inlining", not "/Ob0".
3199 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3200 ['win_debug_InlineFunctionExpansion==0', {
3201 'AdditionalOptions': ['/Ob0'],
3203 ['win_debug_InlineFunctionExpansion!=""', {
3204 'InlineFunctionExpansion':
3205 '<(win_debug_InlineFunctionExpansion)',
3207 ['win_debug_disable_iterator_debugging==1', {
3208 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3211 # if win_debug_OmitFramePointers is blank, leave as default
3212 ['win_debug_OmitFramePointers==1', {
3213 'OmitFramePointers': 'true',
3215 ['win_debug_OmitFramePointers==0', {
3216 'OmitFramePointers': 'false',
3217 # The above is not sufficient (http://crbug.com/106711): it
3218 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3219 # perform FPO regardless, so we must explicitly disable.
3220 # We still want the false setting above to avoid having
3221 # "/Oy /Oy-" and warnings about overriding.
3222 'AdditionalOptions': ['/Oy-'],
3225 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3228 'LinkIncremental': '<(msvs_debug_link_incremental)',
3229 # ASLR makes debugging with windbg difficult because Chrome.exe and
3230 # Chrome.dll share the same base name. As result, windbg will
3231 # name the Chrome.dll module like chrome_<base address>, where
3232 # <base address> typically changes with each launch. This in turn
3233 # means that breakpoints in Chrome.dll don't stick from one launch
3234 # to the next. For this reason, we turn ASLR off in debug builds.
3235 # Note that this is a three-way bool, where 0 means to pick up
3236 # the default setting, 1 is off and 2 is on.
3237 'RandomizedBaseAddress': 1,
3239 'VCResourceCompilerTool': {
3240 'PreprocessorDefinitions': ['_DEBUG'],
3244 ['OS=="linux" or OS=="android"', {
3245 'target_conditions': [
3246 ['_toolset=="target"', {
3248 '<@(debug_extra_cflags)',
3253 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3254 # Enable libstdc++ debugging facilities to help catch problems
3255 # early, see http://crbug.com/65151 .
3256 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3257 'defines': ['_GLIBCXX_DEBUG=1',],
3259 ['release_valgrind_build==0', {
3262 '-fstack-protector-all', # Implies -fstack-protector
3268 # Allow comparing the address of references and 'this' against 0
3269 # in debug builds. Technically, these can never be null in
3270 # well-defined C/C++ and Clang can optimize such checks away in
3271 # release builds, but they may be used in asserts in debug builds.
3272 '-Wno-undefined-bool-conversion',
3273 '-Wno-tautological-undefined-compare',
3277 '-Wno-undefined-bool-conversion',
3278 '-Wno-tautological-undefined-compare',
3282 'VCCLCompilerTool': {
3283 'AdditionalOptions': [
3284 '-Wno-undefined-bool-conversion',
3285 '-Wno-tautological-undefined-compare',
3298 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3299 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3300 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3303 'VCCLCompilerTool': {
3304 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3306 # In official builds, each target will self-select
3307 # an optimization level.
3308 ['buildtype!="Official"', {
3309 'Optimization': '<(win_release_Optimization)',
3312 # According to MSVS, InlineFunctionExpansion=0 means
3313 # "default inlining", not "/Ob0".
3314 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3315 ['win_release_InlineFunctionExpansion==0', {
3316 'AdditionalOptions': ['/Ob0'],
3318 ['win_release_InlineFunctionExpansion!=""', {
3319 'InlineFunctionExpansion':
3320 '<(win_release_InlineFunctionExpansion)',
3323 # if win_release_OmitFramePointers is blank, leave as default
3324 ['win_release_OmitFramePointers==1', {
3325 'OmitFramePointers': 'true',
3327 ['win_release_OmitFramePointers==0', {
3328 'OmitFramePointers': 'false',
3329 # The above is not sufficient (http://crbug.com/106711): it
3330 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3331 # perform FPO regardless, so we must explicitly disable.
3332 # We still want the false setting above to avoid having
3333 # "/Oy /Oy-" and warnings about overriding.
3334 'AdditionalOptions': ['/Oy-'],
3337 'AdditionalOptions': [
3338 '/d2Zi+', # Improve debugging of Release builds.
3339 '<@(win_release_extra_cflags)',
3343 # LinkIncremental is a tri-state boolean, where 0 means default
3344 # (i.e., inherit from parent solution), 1 means false, and
3346 'LinkIncremental': '1',
3347 # This corresponds to the /PROFILE flag which ensures the PDB
3348 # file contains FIXUP information (growing the PDB file by about
3349 # 5%) but does not otherwise alter the output binary. This
3350 # information is used by the Syzygy optimization tool when
3351 # decomposing the release image.
3356 ['msvs_use_common_release', {
3357 'includes': ['release.gypi'],
3359 ['release_valgrind_build==0 and tsan==0', {
3362 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3366 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3367 'MEMORY_SANITIZER_INITIAL_SIZE',
3368 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3369 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3372 ['win_use_allocator_shim==0', {
3373 'defines': ['NO_TCMALLOC'],
3375 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3376 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3377 # It seems to work fine with Ubuntu 12 headers though, so use it
3378 # in official builds.
3379 ['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")', {
3380 'target_conditions': [
3381 ['chromium_code==1', {
3382 # Non-chromium code is not guaranteed to compile cleanly
3383 # with _FORTIFY_SOURCE. Also, fortified build may fail
3384 # when optimizations are disabled, so only do that for Release
3387 '_FORTIFY_SOURCE=2',
3392 ['OS=="linux" or OS=="android"', {
3393 'target_conditions': [
3394 ['_toolset=="target"', {
3396 '<@(release_extra_cflags)',
3399 ['enable_resource_whitelist_generation==1', {
3401 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3410 'NS_BLOCK_ASSERTIONS=1',
3416 # Concrete configurations
3419 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3422 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3427 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3428 'target_conditions': [
3429 [ '_type=="executable"', {
3430 # To get a real .dSYM bundle produced by dsymutil, set the
3431 # debug information format to dwarf-with-dsym. Since
3432 # strip_from_xcode will not be used, set Xcode to do the
3433 # stripping as well.
3435 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3436 'DEPLOYMENT_POSTPROCESSING': 'YES',
3437 'STRIP_INSTALLED_PRODUCT': 'YES',
3444 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3446 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3449 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3457 'target_defaults': {
3464 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3465 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3466 'target_defaults': {
3468 '-Wl,--fatal-warnings',
3472 ['os_posix==1 and chromeos==0', {
3473 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3474 # and we want to avoid overriding this, so stack-protector is only
3475 # enabled when not building on Chrome OS.
3476 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3478 'target_defaults': {
3480 '-fstack-protector',
3481 '--param=ssp-buffer-size=4',
3485 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3486 'target_defaults': {
3487 # Enable -Werror by default, but put it in a variable so it can
3488 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3490 'werror%': '-Werror',
3491 'libraries_for_target%': '',
3494 '_FILE_OFFSET_BITS=64',
3497 '<(werror)', # See note above about the werror variable.
3500 '-fno-strict-aliasing', # See http://crbug.com/32204
3502 # TODO(evan): turn this back on once all the builds work.
3504 # Don't warn about unused function params. We use those everywhere.
3505 '-Wno-unused-parameter',
3506 # Don't warn about the "struct foo f = {0};" initialization pattern.
3507 '-Wno-missing-field-initializers',
3508 # Don't export any symbols (for example, to plugins we dlopen()).
3509 # Note: this is *required* to make some plugins work.
3510 '-fvisibility=hidden',
3515 '-fno-threadsafe-statics',
3516 # Make inline functions have hidden visiblity by default.
3517 # Surprisingly, not covered by -fvisibility=hidden.
3518 '-fvisibility-inlines-hidden',
3519 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3520 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3524 '-pthread', '-Wl,-z,noexecstack',
3527 '<(libraries_for_target)',
3532 'debug_optimize%': '0',
3538 '-O>(debug_optimize)',
3544 # Warn in case of text relocations.
3545 '-Wl,--warn-shared-textrel',
3548 ['OS=="android" and android_full_debug==0', {
3549 # Some configurations are copied from Release_Base to reduce
3552 'debug_optimize%': 's',
3556 '-ffunction-sections',
3563 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3564 # We don't omit frame pointers on arm64 since they are required
3565 # to correctly unwind stackframes which contain system library
3566 # function frames (crbug.com/391706).
3568 '-fomit-frame-pointer',
3571 ['OS=="linux" and target_arch=="ia32"', {
3573 '-Wl,--no-as-needed',
3576 ['debug_unwind_tables==1', {
3577 'cflags': ['-funwind-tables'],
3579 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3581 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3582 # definitions in to the right scope to use them when setting
3583 # linux_use_debug_fission, so it can be used here alone.
3584 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3585 'cflags': ['-gsplit-dwarf'],
3591 'release_optimize%': '2',
3592 # Binaries become big and gold is unable to perform GC
3593 # and remove unused sections for some of test targets
3594 # on 32 bit platform.
3595 # (This is currently observed only in chromeos valgrind bots)
3596 # The following flag is to disable --gc-sections linker
3597 # option for these bots.
3598 'no_gc_sections%': 0,
3600 # TODO(bradnelson): reexamine how this is done if we change the
3601 # expansion of configurations
3602 'release_valgrind_build%': 0,
3605 '-O<(release_optimize)',
3606 # Don't emit the GCC version ident directives, they just end up
3607 # in the .comment section taking up binary size.
3609 # Put data and code in their own sections, so that unused symbols
3610 # can be removed at link time with --gc-sections.
3612 '-ffunction-sections',
3615 # Specifically tell the linker to perform optimizations.
3616 # See http://lwn.net/Articles/192624/ .
3621 ['no_gc_sections==0', {
3623 '-Wl,--gc-sections',
3626 ['OS=="android" and target_arch!="arm64"', {
3627 # We don't omit frame pointers on arm64 since they are required
3628 # to correctly unwind stackframes which contain system library
3629 # function frames (crbug.com/391706).
3631 '-fomit-frame-pointer',
3636 'release_optimize%': 's',
3639 # Warn in case of text relocations.
3640 '-Wl,--warn-shared-textrel',
3647 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed
3648 # and the fix is in chromium.
3649 'cflags': [ '-fno-slp-vectorize', ],
3653 '-fno-omit-frame-pointer',
3657 ['profiling_full_stack_frames==1', {
3660 '-fno-optimize-sibling-calls',
3665 ['release_unwind_tables==1', {
3666 'cflags': ['-funwind-tables'],
3668 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3674 ['target_arch=="ia32"', {
3675 'target_conditions': [
3676 ['_toolset=="target"', {
3678 # Needed so that libs with .s files (e.g. libicudata.a)
3679 # are compatible with the general 32-bit-ness.
3682 # All floating-point computations on x87 happens in 80-bit
3683 # precision. Because the C and C++ language standards allow
3684 # the compiler to keep the floating-point values in higher
3685 # precision than what's specified in the source and doing so
3686 # is more efficient than constantly rounding up to 64-bit or
3687 # 32-bit precision as specified in the source, the compiler,
3688 # especially in the optimized mode, tries very hard to keep
3689 # values in x87 floating-point stack (in 80-bit precision)
3690 # as long as possible. This has important side effects, that
3691 # the real value used in computation may change depending on
3692 # how the compiler did the optimization - that is, the value
3693 # kept in 80-bit is different than the value rounded down to
3694 # 64-bit or 32-bit. There are possible compiler options to
3695 # make this behavior consistent (e.g. -ffloat-store would keep
3696 # all floating-values in the memory, thus force them to be
3697 # rounded to its original precision) but they have significant
3698 # runtime performance penalty.
3700 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3701 # which keep floating-point values in SSE registers in its
3702 # native precision (32-bit for single precision, and 64-bit
3703 # for double precision values). This means the floating-point
3704 # value used during computation does not change depending on
3705 # how the compiler optimized the code, since the value is
3706 # always kept in its specified precision.
3708 # Refer to http://crbug.com/348761 for rationale behind SSE2
3709 # being a minimum requirement for 32-bit Linux builds and
3710 # http://crbug.com/313032 for an example where this has "bit"
3715 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3722 # Use gold linker for Android ia32 target.
3728 # Install packages have started cropping up with
3729 # different headers between the 32-bit and 64-bit
3730 # versions, so we have to shadow those differences off
3731 # and make sure a 32-bit-on-64-bit build picks up the
3733 # For android build, use NDK headers instead of host headers
3734 ['host_arch!="ia32" and OS!="android"', {
3743 ['target_arch=="x64"', {
3744 'target_conditions': [
3745 ['_toolset=="target"', {
3747 # Use gold linker for Android x64 target.
3764 ['target_arch=="arm"', {
3765 'target_conditions': [
3766 ['_toolset=="target"', {
3770 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3771 # has changed whenever it encounters a varargs function. This
3772 # silences those warnings, as they are not helpful and
3773 # clutter legitimate warnings.
3777 ['clang==1 and arm_arch!="" and OS!="android"', {
3779 '-target arm-linux-gnueabihf',
3782 '-target arm-linux-gnueabihf',
3787 '-march=<(arm_arch)',
3790 ['clang==1 and OS!="android"', {
3792 # We need to disable clang's builtin assembler as it can't
3793 # handle several asm files, crbug.com/124610
3794 '-no-integrated-as',
3799 '-mtune=<(arm_tune)',
3807 ['arm_float_abi!=""', {
3809 '-mfloat-abi=<(arm_float_abi)',
3818 # Most of the following flags are derived from what Android
3819 # uses by default when building for arm, reference for which
3820 # can be found in the following file in the Android NDK:
3821 # toolchains/arm-linux-androideabi-4.8/setup.mk
3823 # The tree-sra optimization (scalar replacement for
3824 # aggregates enabling subsequent optimizations) leads to
3825 # invalid code generation when using the Android NDK's
3826 # compiler (r5-r7). This can be verified using
3827 # webkit_unit_tests' WTF.Checked_int8_t test.
3829 # The following 6 options are disabled to save on
3830 # binary size in gcc 4.8.
3831 # TODO(fdegans) Reevaluate when we upgrade GCC.
3832 '-fno-partial-inlining',
3833 '-fno-early-inlining',
3834 '-fno-tree-copy-prop',
3835 '-fno-tree-loop-optimize',
3836 '-fno-move-loop-invariants',
3837 '-fno-caller-saves',
3840 # Android now supports .relro sections properly.
3841 # NOTE: While these flags enable the generation of .relro
3842 # sections, the generated libraries can still be loaded on
3843 # older Android platform versions.
3851 'cflags': [ '-mthumb-interwork' ],
3855 # Thumb code with frame pointer makes chrome crash
3858 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3859 # The perf report sometimes incorrectly attributes
3860 # code from tail calls.
3861 '-fno-optimize-sibling-calls',
3864 '-fomit-frame-pointer',
3869 # Clang does not support the following options.
3870 '-mthumb-interwork',
3871 '-finline-limit=64',
3873 '-fno-partial-inlining',
3874 '-fno-early-inlining',
3875 '-fno-tree-copy-prop',
3876 '-fno-tree-loop-optimize',
3877 '-fno-move-loop-invariants',
3878 '-fno-caller-saves',
3882 # TODO(hans) Enable integrated-as (crbug.com/124610).
3883 '-no-integrated-as',
3884 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3887 # Let clang find the ld.gold in the NDK.
3888 '--gcc-toolchain=<(android_toolchain)/..',
3893 '-marm', # Required for frame pointer based stack traces.
3900 # We set arm_arch to "" so that -march compiler option
3901 # is not set. Otherwise a gcc bug that would complain
3902 # about it conflicting with '-mcpu=cortex-a9'. The flag
3903 # '-march=armv7-a' is actually redundant anyway because
3904 # it is enabled by default when we built the toolchain.
3905 # And using '-mcpu=cortex-a9' should be sufficient.
3908 # Breakpad requires symbols with debugging information
3912 # We want to statically link libstdc++/libgcc_s.
3913 '-static-libstdc++',
3917 # Some components in Chromium (e.g. v8, skia, ffmpeg)
3918 # define their own cflags for arm builds that could
3919 # conflict with the flags we set here (e.g.
3920 # '-mcpu=cortex-a9'). Remove these flags explicitly.
3929 ['target_arch=="arm64"', {
3930 'target_conditions': [
3931 ['_toolset=="target"', {
3935 '-fstack-protector', # stack protector is always enabled on arm64.
3942 ['target_arch=="mipsel"', {
3943 'target_conditions': [
3944 ['_toolset=="target"', {
3946 ['android_webview_build==0 and mips_arch_variant=="r6"', {
3947 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
3950 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
3954 ['android_webview_build==0 and mips_arch_variant=="r2"', {
3955 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
3957 ['android_webview_build==0 and mips_arch_variant=="r1"', {
3958 'cflags': ['-mips32', '-Wa,-mips32'],
3962 '-Wl,--no-keep-memory'
3965 '-Wno-uninitialized',
3970 ['target_arch=="mips64el"', {
3971 'target_conditions': [
3972 ['_toolset=="target"', {
3974 ['android_webview_build==0 and mips_arch_variant=="r6"', {
3975 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
3976 'ldflags': [ '-mips64r6' ],
3978 ['android_webview_build==0 and mips_arch_variant=="r2"', {
3979 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
3980 'ldflags': [ '-mips64r2' ],
3984 '-Wno-uninitialized',
3998 'target_conditions': [
3999 ['_toolset=="target"', {
4001 '--sysroot=<(sysroot)',
4004 '--sysroot=<(sysroot)',
4005 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4011 # TODO(thakis): Remove, http://crbug.com/263960
4012 '-Wno-reserved-user-defined-literal',
4015 # See the comment in the Mac section for what it takes to move
4016 # this to -std=c++11.
4020 ['clang==0 and host_clang==1', {
4021 'target_conditions': [
4022 ['_toolset=="host"', {
4023 'cflags_cc': [ '-std=gnu++11', ],
4027 ['clang==1 and clang_use_chrome_plugins==1', {
4029 '<@(clang_chrome_plugins_flags)',
4032 ['clang==1 and clang_load!=""', {
4034 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4037 ['clang==1 and clang_add_plugin!=""', {
4039 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4042 ['clang==1 and target_arch=="ia32"', {
4044 # Else building libyuv gives clang's register allocator issues,
4045 # see llvm.org/PR15798 / crbug.com/233709
4046 '-momit-leaf-frame-pointer',
4049 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4051 # See http://crbug.com/110262
4052 '-fcolor-diagnostics',
4055 # Common options for AddressSanitizer, LeakSanitizer,
4056 # ThreadSanitizer and MemorySanitizer.
4057 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4058 'target_conditions': [
4059 ['_toolset=="target"', {
4061 '-fno-omit-frame-pointer',
4062 '-gline-tables-only',
4065 '-fomit-frame-pointer',
4070 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4071 'target_conditions': [
4072 ['_toolset=="target"', {
4074 # Functions interposed by the sanitizers can make ld think
4075 # that some libraries aren't needed when they actually are,
4076 # http://crbug.com/234010. As workaround, disable --as-needed.
4080 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4081 'MEMORY_SANITIZER_INITIAL_SIZE',
4085 # TODO(glider): enable the default options on other systems.
4087 ['use_sanitizer_options==1 and OS=="linux" and (chromeos==0 or target_arch!="ia32")', {
4089 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
4095 'target_conditions': [
4096 ['_toolset=="target"', {
4098 '-fsanitize=address',
4101 '-fsanitize=address',
4108 '-mllvm -asan-globals=0', # http://crbug.com/352073
4114 'target_conditions': [
4115 ['_toolset=="target"', {
4117 '-fsanitize=undefined',
4118 # -fsanitize=vptr is incompatible with -fno-rtti.
4119 '-fno-sanitize=vptr',
4122 '-fsanitize=undefined',
4123 # -fsanitize=vptr is incompatible with -fno-rtti.
4124 '-fno-sanitize=vptr',
4130 'target_conditions': [
4131 ['_toolset=="target"', {
4134 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4146 'UNDEFINED_SANITIZER',
4151 ['asan_coverage!=0', {
4152 'target_conditions': [
4153 ['_toolset=="target"', {
4155 '-mllvm -asan-coverage=<(asan_coverage)',
4161 'target_conditions': [
4162 ['_toolset=="target"', {
4171 'WTF_USE_LEAK_SANITIZER=1',
4177 'target_conditions': [
4178 ['_toolset=="target"', {
4180 '-fsanitize=thread',
4182 '-fsanitize-blacklist=<(tsan_blacklist)',
4185 '-fsanitize=thread',
4189 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4190 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4192 'target_conditions': [
4193 ['_type=="executable"', {
4203 'target_conditions': [
4204 ['_toolset=="target"', {
4206 '-fsanitize=memory',
4207 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4209 '-fsanitize-blacklist=<(msan_blacklist)',
4212 '-fsanitize=memory',
4217 'target_conditions': [
4218 ['_type=="executable"', {
4227 ['use_instrumented_libraries==1', {
4229 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4232 ['use_custom_libcxx==1', {
4234 '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4237 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4238 'target_conditions' : [
4239 # crazy_linker has an upstream gyp file we can't edit, and we
4240 # don't want to instrument it.
4241 ['_toolset=="target" and _target_name!="crazy_linker"', {
4243 '-finstrument-functions',
4244 # Allow mmx intrinsics to inline, so that the
4245 #0 compiler can expand the intrinsics.
4246 '-finstrument-functions-exclude-file-list=mmintrin.h',
4249 ['_toolset=="target" and OS=="android"', {
4251 # Avoids errors with current NDK:
4252 # "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"
4253 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4258 ['linux_dump_symbols==1', {
4261 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4262 'target_conditions': [
4263 ['_toolset=="target"', {
4265 # Attempt to use less memory to prevent the linker from
4266 # running out of address space. Considering installing a
4267 # 64-bit kernel and switching to a 64-bit linker.
4268 '-Wl,--no-keep-memory',
4275 ['use_allocator!="tcmalloc"', {
4276 'defines': ['NO_TCMALLOC'],
4278 ['linux_use_gold_flags==1', {
4279 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4281 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4282 'ldflags': [ '-fuse-ld=gold', ],
4284 'target_conditions': [
4285 ['_toolset=="target"', {
4287 # Experimentation found that using four linking threads
4288 # saved ~20% of link time.
4289 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4290 # Only apply this to the target linker, since the host
4291 # linker might not be gold, but isn't used much anyway.
4292 # TODO(raymes): Disable threading because gold is frequently
4293 # crashing on the bots: crbug.com/161942.
4295 # '-Wl,--thread-count=4',
4300 ['release_valgrind_build==0', {
4301 'target_conditions': [
4302 ['_toolset=="target"', {
4304 # There seems to be a conflict of --icf and -pie
4305 # in gold which can generate crashy binaries. As
4306 # a security measure, -pie takes precedence for
4316 ['linux_use_bundled_binutils==1', {
4318 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4321 ['linux_use_bundled_gold==1', {
4322 # Put our binutils, which contains gold in the search path. We pass
4323 # the path to gold to the compiler. gyp leaves unspecified what the
4324 # cwd is when running the compiler, so the normal gyp path-munging
4325 # fails us. This hack gets the right path.
4327 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4330 # Some binutils 2.23 releases may or may not have new dtags enabled,
4331 # but they are all compatible with --disable-new-dtags,
4332 # because the new dynamic tags are not created by default.
4333 ['binutils_version>=223', {
4334 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4335 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4336 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4337 # inside this file to allow usage of --no-as-needed and removal of
4340 '-Wl,--disable-new-dtags',
4343 ['gcc_version>=47 and clang==0', {
4344 'target_conditions': [
4345 ['_toolset=="target"', {
4348 # See comment for -Wno-c++11-narrowing.
4350 # TODO(thakis): Remove, http://crbug.com/263960
4351 '-Wno-literal-suffix',
4356 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4357 'target_conditions': [
4358 ['_toolset=="host"', {
4361 # See comment for -Wno-c++11-narrowing.
4363 # TODO(thakis): Remove, http://crbug.com/263960
4364 '-Wno-literal-suffix',
4372 # FreeBSD-specific options; note that most FreeBSD options are set above,
4375 'target_defaults': {
4377 '-Wl,--no-keep-memory',
4381 # Android-specific options; note that most are set above with Linux.
4384 # This is a unique identifier for a given build. It's used for
4385 # identifying various build artifacts corresponding to a particular
4386 # build of chrome (e.g. where to find archived symbols).
4387 'chrome_build_id%': '',
4389 # Use shared stlport library when system one used.
4390 # Figure this out early since it needs symbols from libgcc.a, so it
4391 # has to be before that in the set of libraries.
4392 ['use_system_stlport==1', {
4393 'android_stlport_library': 'stlport',
4396 ['component=="shared_library"', {
4397 'android_stlport_library': 'stlport_shared',
4399 'android_stlport_library': 'stlport_static',
4405 # Placing this variable here prevents from forking libvpx, used
4406 # by remoting. Remoting is off, so it needn't built,
4407 # so forking it's deps seems like overkill.
4408 # But this variable need defined to properly run gyp.
4409 # A proper solution is to have an OS==android conditional
4410 # in third_party/libvpx/libvpx.gyp to define it.
4411 'libvpx_path': 'lib/linux/arm',
4413 'target_defaults': {
4415 'release_extra_cflags%': '',
4417 # If we're using the components build, append "cr" to all shared
4418 # libraries to avoid naming collisions with android system library
4419 # versions with the same name (e.g. skia, icu).
4420 ['component=="shared_library"', {
4421 'android_product_extension': 'cr.so',
4423 'android_product_extension': 'so',
4427 'target_conditions': [
4428 ['_type=="shared_library"', {
4429 'product_extension': '<(android_product_extension)',
4432 # Settings for building device targets using Android's toolchain.
4433 # These are based on the setup.mk file from the Android NDK.
4435 # The NDK Android executable link step looks as follows:
4437 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4438 # $(PRIVATE_OBJECTS) <-- The .o that we built
4439 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4440 # $(TARGET_LIBGCC) <-- libgcc.a
4441 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4442 # $(PRIVATE_LDLIBS) <-- System .so
4443 # $(TARGET_CRTEND_O) <-- crtend.o
4445 # For now the above are approximated for executables by adding
4446 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4449 # The NDK Android shared library link step looks as follows:
4451 # $(PRIVATE_OBJECTS) <-- The .o that we built
4452 # -l,--whole-archive
4453 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4454 # -l,--no-whole-archive
4455 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4456 # $(TARGET_LIBGCC) <-- libgcc.a
4457 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4458 # $(PRIVATE_LDLIBS) <-- System .so
4460 # For now, assume that whole static libraries are not needed.
4462 # For both executables and shared libraries, add the proper
4463 # libgcc.a to the start of libraries which puts it in the
4464 # proper spot after .o and .a files get linked in.
4466 # TODO: The proper thing to do longer-tem would be proper gyp
4467 # support for a custom link command line.
4468 ['_toolset=="target"', {
4470 '-pthread', # Not supported by Android toolchain.
4473 '-ffunction-sections',
4476 '-fstack-protector',
4478 '-finline-limit=64',
4479 '-Wa,--noexecstack',
4480 '<@(release_extra_cflags)',
4484 '__GNU_SOURCE=1', # Necessary for clone()
4486 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4487 'CHROME_BUILD_ID="<(chrome_build_id)"',
4490 '-pthread', # Not supported by Android toolchain.
4494 '-Wl,--no-undefined',
4497 '-l<(android_stlport_library)',
4498 # Manually link the libgcc.a that the cross compiler uses.
4499 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4505 ['component=="static_library"', {
4507 '-Wl,--exclude-libs=ALL',
4512 # Work around incompatibilities between bionic and clang
4514 '-D__compiler_offsetof=__builtin_offsetof',
4515 '-Dnan=__builtin_nan',
4518 ['target_arch=="arm"', {
4520 '-target arm-linux-androideabi',
4523 '-target arm-linux-androideabi',
4526 ['target_arch=="ia32"', {
4528 '-target x86-linux-androideabi',
4531 '-target x86-linux-androideabi',
4534 # Place holder for x64 support, not tested.
4535 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4536 ['target_arch=="x64"', {
4538 '-target x86_64-linux-androideabi',
4541 '-target x86_64-linux-androideabi',
4548 # Android build relies on -Wl,--gc-sections removing
4549 # unreachable code. ASan instrumentation for globals inhibits
4550 # this and results in a library with unresolvable relocations.
4551 # TODO(eugenis): find a way to reenable this.
4552 '-mllvm -asan-globals=0',
4555 ['android_webview_build==0', {
4557 # The NDK has these things, but doesn't define the constants
4558 # to say that it does. Define them here instead.
4562 '--sysroot=<(android_ndk_sysroot)',
4565 '--sysroot=<(android_ndk_sysroot)',
4568 ['android_webview_build==1', {
4570 # OpenAL headers from the Android tree.
4571 '<(android_src)/frameworks/wilhelm/include',
4574 # Android predefines this as 1; undefine it here so Chromium
4575 # can redefine it later to be 2 for chromium code and unset
4576 # for third party code. This works because cflags are added
4578 '-U_FORTIFY_SOURCE',
4579 # Disable any additional warnings enabled by the Android build system but which
4580 # chromium does not build cleanly with (when treating warning as errors).
4581 # Things that are part of -Wextra:
4582 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4583 '-Wno-ignored-qualifiers',
4585 '-Wno-unused-but-set-variable',
4588 # Other things unrelated to -Wextra:
4589 '-Wno-non-virtual-dtor',
4593 ['android_webview_build==1', {
4594 'target_conditions': [
4595 ['chromium_code==0', {
4597 # There is a class of warning which:
4598 # 1) Android always enables and also treats as errors
4599 # 2) Chromium ignores in third party code
4600 # So we re-enable those warnings when building Android.
4602 '-Wno-format-security',
4604 '-Wno-sequence-point',
4607 '-Wno-non-virtual-dtor',
4612 ['target_arch == "arm"', {
4614 # Enable identical code folding to reduce size.
4618 # NOTE: The stlport header include paths below are specified in
4619 # cflags rather than include_dirs because they need to come
4620 # after include_dirs. Think of them like system headers, but
4621 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4622 # toolchain (circa Gingerbread) will exhibit strange errors.
4623 # The include ordering here is important; change with caution.
4624 ['use_system_stlport==1', {
4626 # For libstdc++/include, which is used by stlport.
4627 '-I<(android_src)/bionic',
4628 '-I<(android_src)/external/stlport/stlport',
4630 }, { # else: use_system_stlport!=1
4632 '-isystem<(android_stlport_include)',
4635 '-L<(android_stlport_libs_dir)',
4638 ['target_arch=="ia32"', {
4639 # The x86 toolchain currently has problems with stack-protector.
4641 '-fstack-protector',
4644 '-fno-stack-protector',
4648 'target_conditions': [
4649 ['_type=="executable"', {
4650 # Force android tools to export the "main" symbol so they can be
4651 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4652 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4653 # when ICS support will be dropped.
4656 '-fvisibility=default',
4660 '-Wl,--gc-sections',
4661 '-Wl,-z,nocopyreloc',
4664 # crtbegin_dynamic.o should be the last item in ldflags.
4665 '<(android_ndk_lib)/crtbegin_dynamic.o',
4668 # crtend_android.o needs to be the last item in libraries.
4669 # Do not add any libraries after this!
4670 '<(android_ndk_lib)/crtend_android.o',
4673 ['_type=="shared_library" or _type=="loadable_module"', {
4675 '-Wl,--exclude-libs=ALL',
4678 '-Wl,-shared,-Bsymbolic',
4681 ['android_webview_build==0', {
4683 # crtbegin_so.o should be the last item in ldflags.
4684 '<(android_ndk_lib)/crtbegin_so.o',
4687 # crtend_so.o needs to be the last item in libraries.
4688 # Do not add any libraries after this!
4689 '<(android_ndk_lib)/crtend_so.o',
4696 # Settings for building host targets using the system toolchain.
4697 ['_toolset=="host"', {
4699 # Due to issues in Clang build system, using ASan on 32-bit
4700 # binaries on x86_64 host is problematic.
4701 # TODO(eugenis): re-enable.
4702 '-fsanitize=address',
4705 '-fsanitize=address',
4706 '-Wl,-z,noexecstack',
4707 '-Wl,--gc-sections',
4710 '-Wl,--warn-shared-textrel',
4711 '-Wl,--fatal-warnings',
4714 # Settings for building host targets on mac.
4715 ['_toolset=="host" and host_os=="mac"', {
4725 'cflags!': ['-fvisibility=hidden'],
4726 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4728 ['OS=="mac" or OS=="ios"', {
4729 'target_defaults': {
4732 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4733 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4734 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4735 'COPY_PHASE_STRIP': 'NO',
4736 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4737 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4738 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4739 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4740 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4741 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4742 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4743 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4744 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4745 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4746 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4747 'GCC_VERSION': '4.2',
4748 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4749 'USE_HEADERMAP': 'NO',
4754 # Don't warn about unused function parameters.
4755 '-Wno-unused-parameter',
4756 # Don't warn about the "struct foo f = {0};" initialization
4758 '-Wno-missing-field-initializers',
4761 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4762 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4764 # Note that the prebuilt Clang binaries should not be used for iOS
4765 # development except for ASan builds.
4767 # gnu++11 instead of c++11 is needed because some code uses
4768 # typeof() (a GNU extension).
4769 # TODO(thakis): Eventually switch this to c++11 instead of
4770 # gnu++11 (once typeof can be removed, which is blocked on c++11
4771 # being available everywhere).
4772 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', # -std=gnu++11
4773 # Warn if automatic synthesis is triggered with
4774 # the -Wobjc-missing-property-synthesis flag.
4775 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4776 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4778 # This warns on selectors from Cocoa headers (-length, -set).
4779 # cfe-dev is currently discussing the merits of this warning.
4780 # TODO(thakis): Reevaluate what to do with this, based one
4781 # cfe-dev discussion.
4782 '-Wno-selector-type-mismatch',
4785 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed
4786 # and the fix is in chromium.
4787 '-fno-slp-vectorize',
4791 ['clang_xcode==0', {
4792 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4793 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4797 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4799 '<@(clang_chrome_plugins_flags)',
4802 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4804 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4807 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4809 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4812 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4814 # See http://crbug.com/110262
4815 '-fcolor-diagnostics',
4818 ['OS=="ios" and target_subarch!="arm32" and \
4819 "<(GENERATOR)"=="xcode"', {
4821 # TODO(ios): when building Chrome for iOS on 64-bit platform
4822 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4823 # enabled. This cause failures when compiling protobuf code,
4824 # so disable the warning. http://crbug.com/359107
4825 '-Wno-shorten-64-to-32',
4833 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4839 '-fsanitize=address',
4840 '-mllvm -asan-globals=0', # http://crbug.com/352073
4841 '-gline-tables-only',
4845 ['asan_coverage!=0', {
4846 'target_conditions': [
4847 ['_toolset=="target"', {
4849 '-mllvm -asan-coverage=<(asan_coverage)',
4855 'target_conditions': [
4856 ['_type!="static_library"', {
4857 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4862 '-fsanitize=address',
4866 ['mac_write_linker_maps==1', {
4869 '-Wl,-map,>(_target_name).map',
4876 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4877 'target_conditions': [
4878 ['_type=="executable"', {
4884 # Define copy_asan_dylib_path in a variable ending in
4885 # _path so that gyp understands it's a path and
4886 # performs proper relativization during dict merging.
4887 'copy_asan_dylib_path':
4888 'mac/copy_asan_runtime_dylib.sh',
4890 'postbuild_name': 'Copy ASan runtime dylib',
4892 '<(copy_asan_dylib_path)',
4901 ], # target_conditions
4902 }, # target_defaults
4903 }], # OS=="mac" or OS=="ios"
4905 'target_defaults': {
4907 # Prevent Mac OS X AssertMacros.h from defining macros that collide
4908 # with common names, like 'check', 'require', and 'verify'.
4909 # (Included by system header. Also exists on iOS but not included.)
4910 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
4911 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
4914 # These should end with %, but there seems to be a bug with % in
4915 # variables that are intended to be set to different values in
4916 # different targets, like these.
4917 'mac_pie': 1, # Most executables can be position-independent.
4918 # Strip debugging symbols from the target.
4919 'mac_strip': '<(mac_strip_release)',
4923 ['mac_want_real_dsym=="default"', {
4926 'mac_real_dsym': '<(mac_want_real_dsym)'
4931 ['mac_want_real_dsym=="default"', {
4932 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
4934 'mac_real_dsym': '<(mac_want_real_dsym)'
4941 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
4942 # (Equivalent to -fPIC)
4943 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
4944 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4945 # Keep pch files below xcodebuild/.
4946 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
4948 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
4949 # xcode_setting, but not until all downstream projects' mac bots are
4950 # using xcode >= 4.6, because that's when the default value of the
4951 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
4952 # setting is a no-op as far as xcode is concerned, but the compiler
4953 # behaves differently based on whether -fno-strict-aliasing is
4955 '-fno-strict-aliasing', # See http://crbug.com/32204.
4958 'target_conditions': [
4959 ['_type=="executable"', {
4962 # Arranges for data (heap) pages to be protected against
4963 # code execution when running on Mac OS X 10.7 ("Lion"), and
4964 # ensures that the position-independent executable (PIE) bit
4965 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
4967 # Define change_mach_o_flags in a variable ending in _path
4968 # so that GYP understands it's a path and performs proper
4969 # relativization during dict merging.
4970 'change_mach_o_flags_path':
4971 'mac/change_mach_o_flags_from_xcode.sh',
4972 'change_mach_o_flags_options%': [
4974 'target_conditions': [
4975 ['mac_pie==0 or release_valgrind_build==1', {
4976 # Don't enable PIE if it's unwanted. It's unwanted if
4977 # the target specifies mac_pie=0 or if building for
4978 # Valgrind, because Valgrind doesn't understand slide.
4979 # See the similar mac_pie/release_valgrind_build check
4981 'change_mach_o_flags_options': [
4987 'postbuild_name': 'Change Mach-O Flags',
4989 '<(change_mach_o_flags_path)',
4990 '>@(change_mach_o_flags_options)',
4997 'asan_saves_file': 'asan.saves',
5000 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
5004 'target_conditions': [
5005 ['mac_pie==1 and release_valgrind_build==0', {
5006 # Turn on position-independence (ASLR) for executables. When
5007 # PIE is on for the Chrome executables, the framework will
5008 # also be subject to ASLR.
5009 # Don't do this when building for Valgrind, because Valgrind
5010 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5011 # understand slide, and get rid of the Valgrind check.
5014 '-Wl,-pie', # Position-independent executable (MH_PIE)
5020 ['(_type=="executable" or _type=="shared_library" or \
5021 _type=="loadable_module") and mac_strip!=0', {
5022 'target_conditions': [
5023 ['mac_real_dsym == 1', {
5024 # To get a real .dSYM bundle produced by dsymutil, set the
5025 # debug information format to dwarf-with-dsym. Since
5026 # strip_from_xcode will not be used, set Xcode to do the
5027 # stripping as well.
5031 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5032 'DEPLOYMENT_POSTPROCESSING': 'YES',
5033 'STRIP_INSTALLED_PRODUCT': 'YES',
5034 'target_conditions': [
5035 ['_type=="shared_library" or _type=="loadable_module"', {
5036 # The Xcode default is to strip debugging symbols
5037 # only (-S). Local symbols should be stripped as
5038 # well, which will be handled by -x. Xcode will
5039 # continue to insert -S when stripping even when
5040 # additional flags are added with STRIPFLAGS.
5042 }], # _type=="shared_library" or _type=="loadable_module"
5043 ['_type=="executable"', {
5046 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
5049 }], # _type=="executable" and asan==1
5050 ], # target_conditions
5052 }, # configuration "Release"
5054 }, { # mac_real_dsym != 1
5055 # To get a fast fake .dSYM bundle, use a post-build step to
5056 # produce the .dSYM and strip the executable. strip_from_xcode
5057 # only operates in the Release configuration.
5061 # Define strip_from_xcode in a variable ending in _path
5062 # so that gyp understands it's a path and performs proper
5063 # relativization during dict merging.
5064 'strip_from_xcode_path': 'mac/strip_from_xcode',
5066 'postbuild_name': 'Strip If Needed',
5067 'action': ['<(strip_from_xcode_path)'],
5071 ], # target_conditions
5072 }], # (_type=="executable" or _type=="shared_library" or
5073 # _type=="loadable_module") and mac_strip!=0
5074 ], # target_conditions
5075 }, # target_defaults
5078 'target_defaults': {
5079 'xcode_settings' : {
5080 # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang
5082 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',
5085 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5086 # additional flag to suppress the "unknown compiler option" error.
5087 # Restrict this flag to builds that are either compiling with Xcode
5088 # or compiling with Xcode's Clang. This will allow Ninja builds to
5089 # continue failing on unknown compiler options.
5090 # TODO(rohitrao): This flag is temporary and should be removed as
5091 # soon as the iOS bots are updated to use Xcode 5.1.
5092 ['clang_xcode==1', {
5094 '-Wno-unknown-warning-option',
5098 # Limit the valid architectures depending on "target_subarch".
5099 # This need to include the "arm" architectures but also the "x86"
5100 # ones (they are used when building for the simulator).
5101 ['target_subarch=="arm32"', {
5102 'VALID_ARCHS': ['armv7', 'armv7s', 'i386'],
5104 ['target_subarch=="arm64"', {
5105 'VALID_ARCHS': ['arm64', 'x86_64'],
5107 ['target_subarch=="both"', {
5108 'VALID_ARCHS': ['arm64', 'armv7', 'armv7s', 'x86_64', 'i386'],
5110 ['use_system_libcxx==1', {
5111 'target_conditions': [
5112 # Only use libc++ when building target for iOS not when building
5113 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5114 # does not support libc++.
5115 ['_toolset=="target"', {
5116 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5120 # The default for deployment target of 7.0+ is libc++, so force
5121 # the old behavior unless libc++ is enabled.
5122 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5126 'target_conditions': [
5127 ['_toolset=="host"', {
5129 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5130 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5139 ['_toolset=="target"', {
5141 # This section should be for overriding host settings. But,
5142 # since we can't negate the iphone deployment target above, we
5143 # instead set it here for target only.
5144 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5145 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5148 ['_type=="executable"', {
5152 'DEPLOYMENT_POSTPROCESSING': 'YES',
5153 'STRIP_INSTALLED_PRODUCT': 'YES',
5158 # Remove dSYM to reduce build time.
5159 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5165 ['chromium_ios_signing', {
5166 # iOS SDK wants everything for device signed.
5167 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5169 'CODE_SIGNING_REQUIRED': 'NO',
5170 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5175 ], # target_conditions
5176 }, # target_defaults
5179 'target_defaults': {
5181 '_WIN32_WINNT=0x0602',
5188 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5189 'WIN32_LEAN_AND_MEAN',
5191 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5192 '_HAS_EXCEPTIONS=0',
5195 ['buildtype=="Official"', {
5196 # In official builds, targets can self-select an optimization
5197 # level by defining a variable named 'optimize', and setting it
5199 # - "size", optimizes for minimal code size - the default.
5200 # - "speed", optimizes for speed over code size.
5201 # - "max", whole program optimization and link-time code
5202 # generation. This is very expensive and should be used
5205 'optimize%': 'size',
5209 # Set /LTCG for the official builds.
5210 'LinkTimeCodeGeneration': '1',
5213 'target_conditions': [
5214 ['optimize=="size"', {
5216 'VCCLCompilerTool': {
5217 # 1, optimizeMinSpace, Minimize Size (/O1)
5218 'Optimization': '1',
5219 # 2, favorSize - Favor small code (/Os)
5220 'FavorSizeOrSpeed': '2',
5225 ['optimize=="speed"', {
5227 'VCCLCompilerTool': {
5228 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5229 'Optimization': '2',
5230 # 1, favorSpeed - Favor fast code (/Ot)
5231 'FavorSizeOrSpeed': '1',
5236 ['optimize=="max"', {
5237 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5238 # builds. Probably anything that this would catch that
5239 # wouldn't be caught in a normal build isn't going to
5240 # actually be a bug, so the incremental value of C4702 for
5241 # PGO builds is likely very small.
5242 'msvs_disabled_warnings': [
5246 'VCCLCompilerTool': {
5247 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5248 'Optimization': '2',
5249 # 1, favorSpeed - Favor fast code (/Ot)
5250 'FavorSizeOrSpeed': '1',
5251 # This implies link time code generation.
5252 'WholeProgramOptimization': 'true',
5270 'AdditionalLibraryDirectories':
5271 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5273 'VCLibrarianTool': {
5274 'AdditionalLibraryDirectories':
5275 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5281 'VCLibrarianTool': {
5282 'AdditionalLibraryDirectories':
5283 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5286 'AdditionalLibraryDirectories':
5287 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5292 # https://code.google.com/p/chromium/issues/detail?id=372451#c20
5293 # Warning 4702 ("Unreachable code") should be re-enabled once
5294 # Express users are updated to VS2013 Update 2.
5295 'msvs_disabled_warnings': [
5300 # Explicitly required when using the ATL with express
5301 'AdditionalDependencies': ['atlthunk.lib'],
5303 # ATL 8.0 included in WDK 7.1 makes the linker to generate
5304 # almost eight hundred LNK4254 and LNK4078 warnings:
5305 # - warning LNK4254: section 'ATL' (50000040) merged into
5306 # '.rdata' (40000040) with different attributes
5307 # - warning LNK4078: multiple 'ATL' sections found with
5308 # different attributes
5309 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
5312 'msvs_system_include_dirs': [
5313 '<(windows_driver_kit_path)/inc/atl71',
5314 '<(windows_driver_kit_path)/inc/mfc42',
5318 'msvs_system_include_dirs': [
5319 '<(windows_sdk_path)/Include/shared',
5320 '<(windows_sdk_path)/Include/um',
5321 '<(windows_sdk_path)/Include/winrt',
5322 '$(VSInstallDir)/VC/atlmfc/include',
5324 'msvs_cygwin_shell': 0,
5325 'msvs_disabled_warnings': [
5326 # C4127: conditional expression is constant
5327 # This warning can in theory catch dead code and other problems, but
5328 # triggers in far too many desirable cases where the conditional
5329 # expression is either set by macros or corresponds some legitimate
5330 # compile-time constant expression (due to constant template args,
5331 # conditionals comparing the sizes of different types, etc.). Some of
5332 # these can be worked around, but it's not worth it.
5335 # C4351: new behavior: elements of array 'array' will be default
5337 # This is a silly "warning" that basically just alerts you that the
5338 # compiler is going to actually follow the language spec like it's
5339 # supposed to, instead of not following it like old buggy versions
5340 # did. There's absolutely no reason to turn this on.
5343 # C4355: 'this': used in base member initializer list
5344 # It's commonly useful to pass |this| to objects in a class'
5345 # initializer list. While this warning can catch real bugs, most of
5346 # the time the constructors in question don't attempt to call methods
5347 # on the passed-in pointer (until later), and annotating every legit
5348 # usage of this is simply more hassle than the warning is worth.
5351 # C4503: 'identifier': decorated name length exceeded, name was
5353 # This only means that some long error messages might have truncated
5354 # identifiers in the presence of lots of templates. It has no effect
5355 # on program correctness and there's no real reason to waste time
5356 # trying to prevent it.
5359 # C4611: interaction between 'function' and C++ object destruction is
5361 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5362 # suggests using exceptions instead of setjmp/longjmp for C++, but
5363 # Chromium code compiles without exception support. We therefore have
5364 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5365 # means we have to turn off this warning (and be careful about how
5366 # object destruction happens in such cases).
5369 # TODO(maruel): These warnings are level 4. They will be slowly
5370 # removed as code is fixed.
5371 4100, # Unreferenced formal parameter
5372 4121, # Alignment of a member was sensitive to packing
5373 4189, # Local variable is initialized but not referenced
5374 4244, # Conversion from 'type1' to 'type2', possible loss of data
5375 4481, # Nonstandard extension used: override specifier 'keyword'
5376 4505, # Unreferenced local function has been removed
5377 4510, # Default constructor could not be generated
5378 4512, # Assignment operator could not be generated
5379 4610, # Object can never be instantiated
5382 'VCCLCompilerTool': {
5383 'AdditionalOptions': ['/MP'],
5384 'MinimalRebuild': 'false',
5385 'BufferSecurityCheck': 'true',
5386 'EnableFunctionLevelLinking': 'true',
5387 'RuntimeTypeInfo': 'false',
5388 'WarningLevel': '4',
5389 'WarnAsError': 'true',
5390 'DebugInformationFormat': '3',
5391 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5392 'ExceptionHandling': '0',
5394 'VCLibrarianTool': {
5395 'AdditionalOptions': ['/ignore:4221'],
5396 'AdditionalLibraryDirectories': [
5397 '<(windows_sdk_path)/Lib/win8/um/x86',
5401 'AdditionalDependencies': [
5413 'AdditionalLibraryDirectories': [
5414 '<(windows_sdk_path)/Lib/win8/um/x86',
5416 'GenerateDebugInformation': 'true',
5417 'MapFileName': '$(OutDir)\\$(TargetName).map',
5418 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5419 'FixedBaseAddress': '1',
5422 # 1 == /SUBSYSTEM:CONSOLE
5423 # 2 == /SUBSYSTEM:WINDOWS
5424 # Most of the executables we'll ever create are tests
5425 # and utilities with console output.
5429 'GenerateStublessProxies': 'true',
5430 'TypeLibraryName': '$(InputName).tlb',
5431 'OutputDirectory': '$(IntDir)',
5432 'HeaderFileName': '$(InputName).h',
5433 'DLLDataFileName': '$(InputName).dlldata.c',
5434 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5435 'ProxyFileName': '$(InputName)_p.c',
5437 'VCResourceCompilerTool': {
5439 'AdditionalIncludeDirectories': [
5441 '<(SHARED_INTERMEDIATE_DIR)',
5444 'target_conditions': [
5445 ['_type=="executable"', {
5447 'EmbedManifest': 'true',
5450 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5452 'AdditionalManifestFiles': [
5453 '>(win_exe_compatibility_manifest)',
5460 # Building with Clang on Windows is a work in progress and very
5461 # experimental. See crbug.com/82385.
5462 'VCCLCompilerTool': {
5463 'WarnAsError': 'false',
5464 'RuntimeTypeInfo': 'false',
5465 'AdditionalOptions': [
5466 '-fmsc-version=1800',
5469 # Many files use intrinsics without including this header.
5470 # TODO(hans): Fix those files, or move this to sub-GYPs.
5473 # TODO(hans): Make this list shorter eventually.
5474 '-Qunused-arguments',
5475 '-Wno-c++11-compat-deprecated-writable-strings',
5476 '-Wno-deprecated-declarations',
5478 '-Wno-enum-conversion',
5479 '-Wno-extra-tokens',
5480 '-Wno-ignored-attributes',
5481 '-Wno-incompatible-pointer-types',
5482 '-Wno-int-to-void-pointer-cast',
5483 '-Wno-invalid-noreturn',
5484 '-Wno-logical-op-parentheses',
5486 '-Wno-missing-braces',
5487 '-Wno-missing-declarations',
5488 '-Wno-msvc-include',
5489 '-Wno-null-dereference',
5490 '-Wno-overloaded-virtual',
5492 '-Wno-pointer-sign',
5494 '-Wno-return-type-c-linkage',
5496 '-Wno-sometimes-uninitialized',
5498 '-Wno-tautological-compare',
5499 '-Wno-unknown-pragmas',
5501 '-Wno-unused-function',
5502 '-Wno-unused-private-field',
5503 '-Wno-unused-value',
5504 '-Wno-unused-variable',
5510 # ASan on Windows is a work in progress and very experimental.
5511 # See crbug.com/345874.
5512 'VCCLCompilerTool': {
5513 'AdditionalOptions': [
5514 '-fsanitize=address',
5516 'AdditionalIncludeDirectories': [
5517 # MSVC needs to be able to find the sanitizer headers when
5518 # invoked via /fallback. This is critical for using macros
5519 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5521 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/include_sanitizer',
5525 'AdditionalLibraryDirectories': [
5526 # TODO(hans): If make_clang_dir is absolute, this breaks.
5527 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/lib/windows',
5530 'target_conditions': [
5531 ['_type=="executable"', {
5533 'AdditionalDependencies': [
5534 'clang_rt.asan-i386.lib',
5538 ['_type=="shared_library" or _type=="loadable_module"', {
5540 'AdditionalDependencies': [
5541 'clang_rt.asan_dll_thunk-i386.lib',
5551 ['disable_nacl==1', {
5552 'target_defaults': {
5558 ['OS=="win" and msvs_use_common_linker_extras', {
5559 'target_defaults': {
5574 'AdditionalOptions': [
5583 'AdditionalOptions': ['/largeaddressaware'],
5592 'AdditionalOptions': [
5593 # safeseh is not compatible with x64
5605 ['enable_new_npdevice_api==1', {
5606 'target_defaults': {
5608 'ENABLE_NEW_NPDEVICE_API',
5612 # Don't warn about the "typedef 'foo' locally defined but not used"
5614 # TODO: remove this flag once all builds work. See crbug.com/227506
5615 ['gcc_version>=48 and clang==0', {
5616 'target_defaults': {
5618 '-Wno-unused-local-typedefs',
5622 ['gcc_version>=48 and clang==0 and host_clang==1', {
5623 'target_defaults': {
5624 'target_conditions': [
5625 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5629 # We need a special case to handle the android webview build on mac because
5630 # the host gcc there doesn't accept this flag, but the target gcc may
5632 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5633 'target_defaults': {
5634 'target_conditions': [
5635 ['_toolset=="host"', {
5637 '-Wno-unused-local-typedefs',
5643 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5645 'make_global_settings': [
5646 ['CC', '<(make_clang_dir)/bin/clang'],
5647 ['CXX', '<(make_clang_dir)/bin/clang++'],
5648 ['CC.host', '$(CC)'],
5649 ['CXX.host', '$(CXX)'],
5652 ['clang==1 and OS=="win"', {
5653 'make_global_settings': [
5654 # On Windows, gyp's ninja generator only looks at CC.
5655 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5658 ['OS=="android" and clang==0', {
5659 # Hardcode the compiler names in the Makefile so that
5660 # it won't depend on the environment at make time.
5661 'make_global_settings': [
5662 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5663 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5664 ['CC.host', '<(host_cc)'],
5665 ['CXX.host', '<(host_cxx)'],
5668 ['OS=="linux" and target_arch=="mipsel"', {
5669 'make_global_settings': [
5670 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5671 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5672 ['CC.host', '<(host_cc)'],
5673 ['CXX.host', '<(host_cxx)'],
5676 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5677 # Set default ARM cross compiling on linux. These can be overridden
5678 # using CC/CXX/etc environment variables.
5679 'make_global_settings': [
5680 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5681 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5682 ['CC.host', '<(host_cc)'],
5683 ['CXX.host', '<(host_cxx)'],
5687 # TODO(yyanagisawa): supports GENERATOR==make
5688 # make generator doesn't support CC_wrapper without CC
5689 # in make_global_settings yet.
5690 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5691 'make_global_settings': [
5692 ['CC_wrapper', '<(gomadir)/gomacc'],
5693 ['CXX_wrapper', '<(gomadir)/gomacc'],
5694 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5695 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5700 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5701 # This block adds *project-wide* configuration settings to each project
5702 # file. It's almost always wrong to put things here. Specify your
5703 # custom xcode_settings in target_defaults to add them to targets instead.
5706 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5707 # setting sets the SDK on a project-wide basis. In order to get the
5708 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5709 # here at the project level.
5712 ['mac_sdk_path==""', {
5713 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5715 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5721 ['ios_sdk_path==""', {
5723 # TODO(justincohen): Ninja only supports simulator for now.
5724 ['"<(GENERATOR)"=="xcode"', {
5725 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5727 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5731 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5736 # Target both iPhone and iPad.
5737 'TARGETED_DEVICE_FAMILY': '1,2',
5740 ['target_arch=="x64"', {
5745 ['target_arch=="ia32"', {
5754 # The Xcode generator will look for an xcode_settings section at the root
5755 # of each dict and use it to apply settings on a file-wide basis. Most
5756 # settings should not be here, they should be in target-specific
5757 # xcode_settings sections, or better yet, should use non-Xcode-specific
5758 # settings in target dicts. SYMROOT is a special case, because many other
5759 # Xcode variables depend on it, including variables such as
5760 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5761 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5762 # files to appear (when present) in the UI as actual files and not red
5763 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5764 # and therefore SYMROOT, needs to be set at the project level.
5765 'SYMROOT': '<(DEPTH)/xcodebuild',