1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6 # Please don't directly include this file if you are building via gyp_chromium,
7 # since gyp_chromium is automatically forcing its inclusion.
9 # Variables expected to be overriden on the GYP command line (-D) or by
10 # ~/.gyp/include.gypi.
12 # Putting a variables dict inside another variables dict looks kind of
13 # weird. This is done so that 'host_arch', 'chromeos', etc are defined as
14 # variables within the outer variables dict here. This is necessary
15 # to get these variables defined for the conditions within this variables
16 # dict that operate on these variables.
21 # Whether we're building a ChromeOS build.
24 # Whether we're building the cast (chromecast) shell
27 # Whether or not we are using the Aura windowing framework.
30 # Whether or not we are building the Ash shell.
33 # Whether or not we are using CRAS, the ChromeOS Audio Server.
36 # Use a raw surface abstraction.
39 # Configure the build for small devices. See crbug.com/318413
43 # Compute the architecture that we're building on.
44 ['OS=="win" or OS=="mac" or OS=="ios"', {
47 'host_arch%': '<!pymod_do_main(detect_host_arch)',
51 # Copy conditionally-set variables out one scope.
52 'chromeos%': '<(chromeos)',
53 'chromecast%': '<(chromecast)',
54 'use_aura%': '<(use_aura)',
55 'use_ash%': '<(use_ash)',
56 'use_cras%': '<(use_cras)',
57 'use_ozone%': '<(use_ozone)',
58 'embedded%': '<(embedded)',
59 'host_arch%': '<(host_arch)',
61 # Whether we are using Views Toolkit
64 # Use OpenSSL instead of NSS as the underlying SSL and crypto
65 # implementation. Certificate verification will in most cases be
66 # handled by the OS. If OpenSSL's struct X509 is used to represent
67 # certificates, use_openssl_certs must be set.
70 # Typedef X509Certificate::OSCertHandle to OpenSSL's struct X509*.
71 'use_openssl_certs%': 0,
73 # Disable viewport meta tag by default.
74 'enable_viewport%': 0,
76 # Enable HiDPI support.
79 # Override buildtype to select the desired build flavor.
80 # Dev - everyday build for development/testing
81 # Official - release build (generally implies additional processing)
82 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
83 # conversion is done), some of the things which are now controlled by
84 # 'branding', such as symbol generation, will need to be refactored
85 # based on 'buildtype' (i.e. we don't care about saving symbols for
86 # non-Official # builds).
89 # Override branding to select the desired branding flavor.
90 'branding%': 'Chromium',
93 # ChromeOS and Windows use Aura and Ash.
94 ['chromeos==1 or OS=="win" or OS=="linux"', {
99 ['chromecast==1 and OS!="android"', {
109 # Whether we're a traditional desktop unix.
110 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
116 # Embedded implies ozone.
122 'target_arch%': 'arm',
124 # Default architecture we're building for is the architecture we're
125 # building on, and possibly sub-architecture (for iOS builds).
126 'target_arch%': '<(host_arch)',
130 # Copy conditionally-set variables out one scope.
131 'chromeos%': '<(chromeos)',
132 'chromecast%': '<(chromecast)',
133 'desktop_linux%': '<(desktop_linux)',
134 'use_aura%': '<(use_aura)',
135 'use_ash%': '<(use_ash)',
136 'use_cras%': '<(use_cras)',
137 'use_ozone%': '<(use_ozone)',
138 'embedded%': '<(embedded)',
139 'use_openssl%': '<(use_openssl)',
140 'use_openssl_certs%': '<(use_openssl_certs)',
141 'enable_viewport%': '<(enable_viewport)',
142 'enable_hidpi%': '<(enable_hidpi)',
143 'buildtype%': '<(buildtype)',
144 'branding%': '<(branding)',
145 'host_arch%': '<(host_arch)',
146 'target_arch%': '<(target_arch)',
148 'target_subarch%': '',
150 # 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 the OpenSSL backend on Mac OS.
213 # Enable App Launcher everywhere but mobile.
214 ['OS!="ios" and OS!="android"', {
215 'enable_app_list%': 1,
217 'enable_app_list%': 0,
220 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
221 'use_default_render_theme%': 1,
223 'use_default_render_theme%': 0,
227 'use_ozone_evdev%': 1,
229 'use_ozone_evdev%': 0,
232 # Set default gomadir.
234 'gomadir': 'c:\\goma\\goma-win',
236 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
239 # Set the default "target_subarch" on iOS. Valid values are "arm32",
240 # "arm64" and "both" (meaning a fat binary).
242 # TODO(sdefresne): change the default from "arm32" to "both" for
243 # "target_subarch" once http://crbug.com/339477 is fixed.
245 # TODO(sdefresne): set the "target_arch" to "arm" once compilation
246 # of skia has been fixed for simulator. http://crbug.com/342377
248 'target_subarch%': 'arm32',
251 # Set arch variants for MIPS platforms.
252 ['target_arch=="mips64el"', {
255 'mips_arch_variant%': 'r6',
257 'mips_arch_variant%': 'r2',
262 ['target_arch=="mipsel"', {
263 'mips_arch_variant%': 'r1',
268 # Copy conditionally-set variables out one scope.
269 'chromeos%': '<(chromeos)',
270 'chromecast%': '<(chromecast)',
271 'host_arch%': '<(host_arch)',
272 'target_arch%': '<(target_arch)',
273 'target_subarch%': '<(target_subarch)',
274 'mips_arch_variant%': '<(mips_arch_variant)',
275 'toolkit_views%': '<(toolkit_views)',
276 'desktop_linux%': '<(desktop_linux)',
277 'use_aura%': '<(use_aura)',
278 'use_ash%': '<(use_ash)',
279 'use_cras%': '<(use_cras)',
280 'use_ozone%': '<(use_ozone)',
281 'use_ozone_evdev%': '<(use_ozone_evdev)',
282 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
283 'embedded%': '<(embedded)',
284 'use_openssl%': '<(use_openssl)',
285 'use_openssl_certs%': '<(use_openssl_certs)',
286 'enable_viewport%': '<(enable_viewport)',
287 'enable_hidpi%': '<(enable_hidpi)',
288 'android_webview_build%': '<(android_webview_build)',
289 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
290 'use_goma%': '<(use_goma)',
291 'gomadir%': '<(gomadir)',
292 'enable_app_list%': '<(enable_app_list)',
293 'use_default_render_theme%': '<(use_default_render_theme)',
294 'buildtype%': '<(buildtype)',
295 'branding%': '<(branding)',
296 'arm_version%': '<(arm_version)',
297 'sysroot%': '<(sysroot)',
298 'chroot_cmd%': '<(chroot_cmd)',
299 'system_libdir%': '<(system_libdir)',
301 # Set to 1 to enable fast builds. Set to 2 for even faster builds
302 # (it disables debug info for fastest compilation - only for use
303 # on compile-only bots).
306 # Set to 1 to not store any build metadata (this isn't working yet but
307 # this flag will help us to get there). See http://crbug.com/314403.
308 # TODO(sebmarchand): Update this comment once this flag guarantee that
309 # there's no build metadata in the build artifacts.
310 'dont_embed_build_metadata%': 0,
312 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
313 # This is useful for parallel compilation tools which can't support /Zi.
314 # Only used on Windows.
317 # Set to 1 to enable dcheck in release.
318 'dcheck_always_on%': 0,
320 # Set to 1 to make a build that disables unshipped tracing events.
321 # Note: this setting is ignored if buildtype=="Official".
322 'tracing_like_official_build%': 0,
324 # Disable image loader component extension by default.
325 'image_loader_extension%': 0,
327 # Set NEON compilation flags.
330 # Detect NEON support at run-time.
331 'arm_neon_optional%': 0,
333 # Use libjpeg-turbo as the JPEG codec used by Chromium.
334 'use_libjpeg_turbo%': 1,
336 # Use system libjpeg. Note that the system's libjepg will be used even if
337 # use_libjpeg_turbo is set.
338 'use_system_libjpeg%': 0,
340 # By default, component is set to static_library and it can be overriden
341 # by the GYP command line or by ~/.gyp/include.gypi.
342 'component%': 'static_library',
344 # Set to select the Title Case versions of strings in GRD files.
345 'use_titlecase_in_grd%': 0,
347 # Use translations provided by volunteers at launchpad.net. This
348 # currently only works on Linux.
349 'use_third_party_translations%': 0,
351 # Remoting compilation is enabled by default. Set to 0 to disable.
354 # Configuration policy is enabled by default. Set to 0 to disable.
355 'configuration_policy%': 1,
357 # Variable safe_browsing is used to control the build time configuration
358 # for safe browsing feature. Safe browsing can be compiled in 3 different
359 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
360 # reporting features without enabling phishing and malware detection. This
361 # is useful to integrate a third party phishing/malware detection to
362 # existing safe browsing logic.
365 # Web speech is enabled by default. Set to 0 to disable.
366 'enable_web_speech%': 1,
368 # Notifications are compiled in by default. Set to 0 to disable.
369 'notifications%' : 1,
371 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
372 # regular builds and 1 for ASan builds.
373 'mac_want_real_dsym%': 'default',
375 # If this is set, the clang plugins used on the buildbot will be used.
376 # Run tools/clang/scripts/update.sh to make sure they are compiled.
377 # This causes 'clang_chrome_plugins_flags' to be set.
378 # Has no effect if 'clang' is not set as well.
379 'clang_use_chrome_plugins%': 1,
381 # Enable building with ASAN (Clang's -fsanitize=address option).
382 # -fsanitize=address only works with clang, but asan=1 implies clang=1
383 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
385 # Enable coverage gathering instrumentation in ASan. This flag also
386 # controls coverage granularity (1 for function-level coverage, 2 for
387 # block-level coverage).
390 # Enable Chromium overrides of the default configurations for various
391 # dynamic tools (like ASan).
392 'use_sanitizer_options%': 0,
394 # Enable building with SyzyAsan.
395 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
398 # Enable building with LSan (Clang's -fsanitize=leak option).
399 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
400 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
403 # Enable building with TSan (Clang's -fsanitize=thread option).
404 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
405 # See http://clang.llvm.org/docs/ThreadSanitizer.html
407 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
409 # Enable building with MSan (Clang's -fsanitize=memory option).
410 # MemorySanitizer only works with clang, but msan=1 implies clang=1
411 # See http://clang.llvm.org/docs/MemorySanitizer.html
413 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
414 # Track where uninitialized memory originates from. From fastest to
415 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
416 # - track the chain of stores leading from allocation site to use site.
417 'msan_track_origins%': 1,
419 # Enable building with UBSan (Clang's -fsanitize=undefined option).
420 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
421 # See http://clang.llvm.org/docs/UsersManual.html
424 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
425 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
427 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan_vptr/blacklist.txt',
429 # Use the dynamic libraries instrumented by one of the sanitizers
430 # instead of the standard system libraries.
431 'use_instrumented_libraries%': 0,
433 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
434 # stdlibc++ as standard library. This is intended to use for instrumented
436 'use_custom_libcxx%': 0,
438 # Use system libc++ instead of the default C++ library, usually libstdc++.
439 # This is intended for iOS builds only.
440 'use_system_libcxx%': 0,
442 # Use a modified version of Clang to intercept allocated types and sizes
443 # for allocated objects. clang_type_profiler=1 implies clang=1.
444 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
445 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
446 'clang_type_profiler%': 0,
448 # Set to true to instrument the code with function call logger.
449 # See src/third_party/cygprofile/cyg-profile.cc for details.
450 'order_profiling%': 0,
452 # Use the provided profiled order file to link Chrome image with it.
453 # This makes Chrome faster by better using CPU cache when executing code.
454 # This is known as PGO (profile guided optimization).
455 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
456 'order_text_section%' : "",
458 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
459 # libraries on linux x86-64 and arm, plus ASLR.
462 # Whether one-click signin is enabled or not.
463 'enable_one_click_signin%': 0,
465 # Whether to back up data before sync.
466 'enable_pre_sync_backup%': 0,
468 # Enable Chrome browser extensions
469 'enable_extensions%': 1,
472 'enable_google_now%': 1,
474 # Enable printing support and UI. This variable is used to configure
475 # which parts of printing will be built. 0 disables printing completely,
476 # 1 enables it fully, and 2 enables only the codepath to generate a
477 # Metafile (e.g. usually a PDF or EMF) and disables print preview, cloud
479 'enable_printing%': 1,
481 # Set the version of CLD.
482 # 0: Don't specify the version. This option is for the Finch testing.
487 # For CLD2, the size of the tables that should be included in the build
488 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
490 # See third_party/cld_2/cld_2.gyp for more information.
491 # 0: Small tables, lower accuracy
492 # 1: Medium tables, medium accuracy
493 # 2: Large tables, high accuracy
494 'cld2_table_size%': 2,
496 # The data acquisition mode for CLD2. Possible values are:
497 # static: CLD2 data is statically linked to the executable.
498 # standalone: CLD2 data is provided in a standalone file that is
499 # bundled with the executable.
500 # component: CLD2 data is provided as a Chrome "component" and is
501 # downloaded via the component updater.
503 # For more information on switching the CLD2 data source, see:
504 # https://sites.google.com/a/chromium.org/dev/developers/how-tos/compact-language-detector-cld-data-source-configuration
506 # This string will be exposed in chrome://translate-internals under the
507 # heading "CLD Data Source". This allows easy determination of which
508 # data source the browser was built with.
509 'cld2_data_source%': 'static',
511 # Enable spell checker.
512 'enable_spellcheck%': 1,
514 # Webrtc compilation is enabled by default. Set to 0 to disable.
517 # Enables use of the session service, which is enabled by default.
518 # Support for disabling depends on the platform.
519 'enable_session_service%': 1,
521 # Enables theme support, which is enabled by default. Support for
522 # disabling depends on the platform.
525 # Enables autofill dialog and associated features; disabled by default.
526 'enable_autofill_dialog%' : 0,
528 # Defaults Wallet integration in Autofill dialog to use production
529 # servers. Unofficial builds won't have the proper API keys.
530 'enable_prod_wallet_service%': 0,
532 # Enables support for background apps.
533 'enable_background%': 1,
535 # Enable the task manager by default.
536 'enable_task_manager%': 1,
538 # Enables used resource whitelist generation; disabled by default.
539 'enable_resource_whitelist_generation%': 0,
541 # Enable FILE support by default.
542 'disable_file_support%': 0,
544 # Enable FTP support by default.
545 'disable_ftp_support%': 0,
547 # Use native android functions in place of ICU. Not supported by most
549 'use_icu_alternatives_on_android%': 0,
551 # XInput2 multitouch support is enabled by default (use_xi2_mt=2).
552 # Setting to zero value disables XI2 MT. When XI2 MT is enabled,
553 # the input value also defines the required XI2 minor minimum version.
554 # For example, use_xi2_mt=2 means XI2.2 or above version is required.
557 # Use of precompiled headers on Windows.
559 # This variable may be explicitly set to 1 (enabled) or 0
560 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
561 # This setting will override the default.
564 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
566 'chromium_win_pch%': 0,
569 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
570 # Set this to true when building with Clang.
571 # See http://code.google.com/p/chromium/wiki/Clang for details.
572 # If this is set, clang is used as both host and target compiler in
573 # cross-compile builds.
576 # Enable plug-in installation by default.
577 'enable_plugin_installation%': 1,
579 # Specifies whether to use canvas_skia.cc in place of platform
580 # specific implementations of gfx::Canvas. Affects text drawing in the
582 # TODO(asvitkine): Enable this on all platforms and delete this flag.
583 # http://crbug.com/105550
584 'use_canvas_skia%': 0,
586 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
587 # with one of those tools.
588 'build_for_tool%': '',
590 # If no directory is specified then a temporary directory will be used.
591 'test_isolation_outdir%': '',
592 # True if isolate should fail if the isolate files refer to files
594 'test_isolation_fail_on_missing': 1,
596 'wix_path%': '<(DEPTH)/third_party/wix',
598 # Managed users are enabled by default.
599 'enable_managed_users%': 1,
601 # Platform natively supports discardable memory.
602 'native_discardable_memory%': 0,
604 # Platform sends memory pressure signals natively.
605 'native_memory_pressure_signals%': 0,
607 'spdy_proxy_auth_property%' : '',
608 'spdy_proxy_auth_value%' : '',
610 'enable_service_discovery%': 0,
611 'enable_wifi_bootstrapping%': 0,
612 'enable_hangout_services_extension%': 0,
614 # Enable the Syzygy optimization step.
615 'syzygy_optimize%': 0,
617 # Enable hole punching for the protected video.
620 # Temporary hack to allow us to unify blink's definitions of load
621 # completion. blink uses a crazy set of constraints to determine load
622 # completion, but only actually requires them for layout tests. However,
623 # we need to maintain all the old behaviors while the plumbing is put in
624 # place on both sides of the repo boundary.
625 'enable_load_completion_hacks%': 1,
627 # Automatically select platforms under ozone. Turn this off to
628 # build only explicitly selected platforms.
629 'ozone_auto_platforms%': 1,
631 # If this is set clang is used as host compiler, but not as target
632 # compiler. Always do this by default.
636 # A flag for POSIX platforms
643 # A flag for BSD platforms
644 ['OS=="freebsd" or OS=="openbsd"', {
651 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
657 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
658 # OpenSSL's certificate definition.
659 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
660 'use_openssl_certs%': 1,
662 'use_openssl_certs%': 0,
665 # libudev usage. This currently only affects the content layer.
666 ['OS=="linux" and embedded==0', {
672 # Flags to use X11 on non-Mac POSIX platforms.
673 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
680 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
686 # Flags to use pango and cairo.
687 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
696 ['OS=="linux" and embedded==0', {
702 # We always use skia text rendering in Aura on Windows, since GDI
703 # doesn't agree with our BackingStore.
704 # TODO(beng): remove once skia text rendering is on by default.
705 ['use_aura==1 and OS=="win"', {
706 'enable_skia_text%': 1,
709 # A flag to enable or disable our compile-time dependency
710 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
711 # support will be available. This option is useful
712 # for Linux distributions and for Aura.
713 ['OS!="linux" or chromeos==1', {
714 'use_gnome_keyring%': 0,
716 'use_gnome_keyring%': 1,
719 ['OS=="mac" or OS=="ios"', {
720 # Mac and iOS want Title Case strings
721 'use_titlecase_in_grd%': 1,
724 # Enable loader extensions on Chrome OS.
726 'image_loader_extension%': 1,
728 'image_loader_extension%': 0,
731 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
732 'enable_one_click_signin%': 1,
733 'enable_pre_sync_backup%': 1,
737 'enable_extensions%': 0,
738 'enable_google_now%': 0,
740 'enable_spellcheck%': 0,
744 'arm_neon_optional%': 1,
745 'native_discardable_memory%': 1,
746 'native_memory_pressure_signals%': 1,
747 'enable_printing%': 2,
748 'enable_task_manager%':0,
749 # Set to 1 once we have a notification system for Android.
750 # http://crbug.com/115320
755 # Android OS includes support for proprietary codecs regardless of
756 # building Chromium or Google Chrome. We also ship Google Chrome and
757 # Chromecast with proprietary codecs.
758 ['OS=="android" or branding=="Chrome" or chromecast==1', {
759 'proprietary_codecs%': 1,
761 'proprietary_codecs%': 0,
764 ['OS=="mac" or OS=="ios"', {
765 'native_discardable_memory%': 1,
766 'native_memory_pressure_signals%': 1,
769 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
770 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
771 'enable_autofill_dialog%': 1,
774 ['buildtype=="Official"', {
775 'enable_prod_wallet_service%': 1,
785 'disable_ftp_support%': 1,
786 'enable_extensions%': 0,
787 'enable_google_now%': 0,
789 'enable_printing%': 0,
790 'enable_session_service%': 0,
796 'enable_managed_users%': 0,
797 'enable_task_manager%': 0,
798 'use_system_libcxx%': 1,
799 'support_pre_M6_history_database%': 0,
802 # Use GPU accelerated cross process image transport by default
803 # on linux builds with the Aura window manager
804 ['use_aura==1 and OS=="linux"', {
805 'ui_compositor_image_transport%': 1,
807 'ui_compositor_image_transport%': 0,
810 # Turn precompiled headers on by default.
811 ['OS=="win" and buildtype!="Official"', {
812 'chromium_win_pch%': 1
815 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
816 'enable_plugin_installation%': 0,
818 'enable_plugin_installation%': 1,
821 # Whether PPAPI is enabled.
822 ['OS=="android" or OS=="ios" or embedded==1', {
823 'enable_plugins%': 0,
825 'enable_plugins%': 1,
828 # linux_use_bundled_gold: whether to use the gold linker binary checked
829 # into third_party/binutils. Force this off via GYP_DEFINES when you
830 # are using a custom toolchain and need to control -B in ldflags.
831 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
832 # for component=static_library builds.
833 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
834 'linux_use_bundled_gold%': 1,
836 'linux_use_bundled_gold%': 0,
839 # linux_use_bundled_binutils: whether to use the binary binutils
840 # checked into third_party/binutils. These are not multi-arch so cannot
841 # be used except on x86 and x86-64 (the only two architectures which
842 # are currently checke in). Force this off via GYP_DEFINES when you
843 # are using a custom toolchain and need to control -B in cflags.
844 ['OS=="linux" and (target_arch=="x64")', {
845 'linux_use_bundled_binutils%': 1,
847 'linux_use_bundled_binutils%': 0,
850 # linux_use_gold_flags: whether to use build flags that rely on gold.
851 # On by default for x64 Linux.
852 ['OS=="linux" and target_arch=="x64"', {
853 'linux_use_gold_flags%': 1,
855 'linux_use_gold_flags%': 0,
858 # linux_use_debug_fission: whether to use split DWARF debug info
859 # files. This can reduce link time significantly, but is incompatible
860 # with some utilities such as icecc and ccache. Requires gold and
861 # gcc >= 4.8 or clang.
862 # http://gcc.gnu.org/wiki/DebugFission
863 ['OS=="linux" and target_arch=="x64"', {
864 'linux_use_debug_fission%': 1,
866 'linux_use_debug_fission%': 0,
869 ['OS=="android" or OS=="ios"', {
870 'enable_captive_portal_detection%': 0,
872 'enable_captive_portal_detection%': 1,
875 # Enable Skia UI text drawing incrementally on different platforms.
876 # http://crbug.com/105550
878 # On Aura, this allows per-tile painting to be used in the browser
881 'use_canvas_skia%': 1,
885 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
886 'use_libjpeg_turbo%': 0,
889 # Do not enable the Settings App on ChromeOS.
890 ['enable_app_list==1 and chromeos==0', {
891 'enable_settings_app%': 1,
893 'enable_settings_app%': 0,
896 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
897 # Set some defaults for arm/linux chrome builds
898 'use_allocator%': 'none',
899 # sysroot needs to be an absolute path otherwise it generates
900 # incorrect results when passed to pkg-config
901 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot',
902 }], # OS=="linux" and target_arch=="arm" and chromeos==0
904 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
906 ['target_arch=="x64"', {
907 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
909 ['target_arch=="ia32"', {
910 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
913 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
915 ['OS=="linux" and target_arch=="mipsel"', {
916 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
917 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
920 # Whether tests targets should be run, archived or just have the
921 # dependencies verified. All the tests targets have the '_run' suffix,
922 # e.g. base_unittests_run runs the target base_unittests. The test
923 # target always calls tools/swarming_client/isolate.py. See the script's
924 # --help for more information. Meant to be overriden with GYP_DEFINES.
925 # TODO(maruel): Remove the conditions as more configurations are
927 ['OS!="ios" and OS!="android" and chromeos==0', {
928 'test_isolation_mode%': 'check',
930 'test_isolation_mode%': 'noop',
932 # Whether Android build uses OpenMAX DL FFT.
933 ['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")', {
934 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
935 # When enabled, this will also enable WebAudio support on
936 # Android for these architectures. Default is enabled. Whether
937 # WebAudio is actually available depends on runtime settings
939 'use_openmax_dl_fft%': 1,
941 'use_openmax_dl_fft%': 0,
943 ['OS=="win" or OS=="linux"', {
947 # Turns on compiler optimizations in V8 in Debug build, except
948 # on android_clang, where we're hitting a weird linker error.
949 # TODO(dpranke): http://crbug.com/266155 .
951 'v8_optimized_debug%': 1,
953 'v8_optimized_debug%': 2,
956 # Disable various features by default on embedded.
959 'enable_printing%': 0,
962 # By default, use ICU data file (icudtl.dat) on all platforms
963 # except when building Android WebView or Chromecast.
964 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
965 # Set the data reduction proxy origin for Android Webview.
966 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0', {
967 'icu_use_data_file_flag%' : 1,
969 'icu_use_data_file_flag%' : 0,
971 ['OS=="win" or OS=="mac"', {
972 'enable_wifi_bootstrapping%' : 1,
975 # Path to sas.dll, which provides the SendSAS function.
976 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
977 ['target_arch=="x64"', {
978 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
980 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
983 # Turn on JNI generation optimizations on non-WebView builds.
984 ['OS=="android" and android_webview_build==0', {
985 'optimize_jni_generation%': 1,
987 'optimize_jni_generation%': 0,
991 # Set this to 1 to enable use of concatenated impulse responses
992 # for the HRTF panner in WebAudio.
993 'use_concatenated_impulse_responses': 1,
995 # You can set the variable 'use_official_google_api_keys' to 1
996 # to use the Google-internal file containing official API keys
997 # for Google Chrome even in a developer build. Setting this
998 # variable explicitly to 1 will cause your build to fail if the
999 # internal file is missing.
1001 # The variable is documented here, but not handled in this file;
1002 # see //google_apis/determine_use_official_keys.gypi for the
1005 # Set the variable to 0 to not use the internal file, even when
1006 # it exists in your checkout.
1008 # Leave it unset in your include.gypi to have the variable
1009 # implicitly set to 1 if you have
1010 # src/google_apis/internal/google_chrome_api_keys.h in your
1011 # checkout, and implicitly set to 0 if not.
1013 # Note that official builds always behave as if the variable
1014 # was explicitly set to 1, i.e. they always use official keys,
1015 # and will fail to build if the internal file is missing.
1017 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1018 # include.gypi or by other means. Due to subtleties of GYP, this
1019 # is not the same as leaving the variable unset, even though its
1021 # //google_apis/determine_use_official_keys.gypi is 2.
1023 # Set these to bake the specified API keys and OAuth client
1024 # IDs/secrets into your build.
1026 # If you create a build without values baked in, you can instead
1027 # set environment variables to provide the keys at runtime (see
1028 # src/google_apis/google_api_keys.h for details). Features that
1029 # require server-side APIs may fail to work if no keys are
1032 # Note that if you are building an official build or if
1033 # use_official_google_api_keys has been set to 1 (explicitly or
1034 # implicitly), these values will be ignored and the official
1035 # keys will be used instead.
1036 'google_api_key%': '',
1037 'google_default_client_id%': '',
1038 'google_default_client_secret%': '',
1039 # Native Client is enabled by default.
1040 'disable_nacl%': '0',
1042 # Set to 1 to support old history files
1043 'support_pre_M6_history_database%': '1',
1046 # Copy conditionally-set variables out one scope.
1047 'branding%': '<(branding)',
1048 'buildtype%': '<(buildtype)',
1049 'target_arch%': '<(target_arch)',
1050 'target_subarch%': '<(target_subarch)',
1051 'mips_arch_variant%': '<(mips_arch_variant)',
1052 'host_arch%': '<(host_arch)',
1053 'toolkit_views%': '<(toolkit_views)',
1054 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1055 'use_aura%': '<(use_aura)',
1056 'use_ash%': '<(use_ash)',
1057 'use_cras%': '<(use_cras)',
1058 'use_openssl%': '<(use_openssl)',
1059 'use_openssl_certs%': '<(use_openssl_certs)',
1060 'use_nss%': '<(use_nss)',
1061 'use_udev%': '<(use_udev)',
1062 'os_bsd%': '<(os_bsd)',
1063 'os_posix%': '<(os_posix)',
1064 'use_dbus%': '<(use_dbus)',
1065 'use_glib%': '<(use_glib)',
1066 'use_pango%': '<(use_pango)',
1067 'use_cairo%': '<(use_cairo)',
1068 'use_ozone%': '<(use_ozone)',
1069 'use_ozone_evdev%': '<(use_ozone_evdev)',
1070 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1071 'desktop_linux%': '<(desktop_linux)',
1072 'use_x11%': '<(use_x11)',
1073 'use_gnome_keyring%': '<(use_gnome_keyring)',
1074 'linux_fpic%': '<(linux_fpic)',
1075 'chromeos%': '<(chromeos)',
1076 'chromecast%': '<(chromecast)',
1077 'enable_viewport%': '<(enable_viewport)',
1078 'enable_hidpi%': '<(enable_hidpi)',
1079 'use_xi2_mt%':'<(use_xi2_mt)',
1080 'image_loader_extension%': '<(image_loader_extension)',
1081 'fastbuild%': '<(fastbuild)',
1082 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1083 'win_z7%': '<(win_z7)',
1084 'dcheck_always_on%': '<(dcheck_always_on)',
1085 'tracing_like_official_build%': '<(tracing_like_official_build)',
1086 'arm_version%': '<(arm_version)',
1087 'arm_neon%': '<(arm_neon)',
1088 'arm_neon_optional%': '<(arm_neon_optional)',
1089 'sysroot%': '<(sysroot)',
1090 'chroot_cmd%': '<(chroot_cmd)',
1091 'system_libdir%': '<(system_libdir)',
1092 'component%': '<(component)',
1093 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1094 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1095 'use_third_party_translations%': '<(use_third_party_translations)',
1096 'remoting%': '<(remoting)',
1097 'enable_one_click_signin%': '<(enable_one_click_signin)',
1098 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1099 'enable_webrtc%': '<(enable_webrtc)',
1100 'chromium_win_pch%': '<(chromium_win_pch)',
1101 'configuration_policy%': '<(configuration_policy)',
1102 'safe_browsing%': '<(safe_browsing)',
1103 'enable_web_speech%': '<(enable_web_speech)',
1104 'notifications%': '<(notifications)',
1105 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1106 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1108 'asan_coverage%': '<(asan_coverage)',
1109 'use_sanitizer_options%': '<(use_sanitizer_options)',
1110 'syzyasan%': '<(syzyasan)',
1111 'syzygy_optimize%': '<(syzygy_optimize)',
1114 'msan_blacklist%': '<(msan_blacklist)',
1115 'msan_track_origins%': '<(msan_track_origins)',
1117 'tsan_blacklist%': '<(tsan_blacklist)',
1118 'ubsan%': '<(ubsan)',
1119 'ubsan_vptr%': '<(ubsan_vptr)',
1120 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1121 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1122 'use_custom_libcxx%': '<(use_custom_libcxx)',
1123 'use_system_libcxx%': '<(use_system_libcxx)',
1124 'clang_type_profiler%': '<(clang_type_profiler)',
1125 'order_profiling%': '<(order_profiling)',
1126 'order_text_section%': '<(order_text_section)',
1127 'enable_extensions%': '<(enable_extensions)',
1128 'enable_plugin_installation%': '<(enable_plugin_installation)',
1129 'enable_plugins%': '<(enable_plugins)',
1130 'enable_session_service%': '<(enable_session_service)',
1131 'enable_themes%': '<(enable_themes)',
1132 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1133 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1134 'enable_background%': '<(enable_background)',
1135 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1136 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1137 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1138 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1139 'use_canvas_skia%': '<(use_canvas_skia)',
1140 'test_isolation_mode%': '<(test_isolation_mode)',
1141 'test_isolation_outdir%': '<(test_isolation_outdir)',
1142 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1143 'enable_printing%': '<(enable_printing)',
1144 'enable_spellcheck%': '<(enable_spellcheck)',
1145 'enable_google_now%': '<(enable_google_now)',
1146 'cld_version%': '<(cld_version)',
1147 'cld2_table_size%': '<(cld2_table_size)',
1148 'cld2_data_source%': '<(cld2_data_source)',
1149 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1150 'disable_file_support%': '<(disable_file_support)',
1151 'disable_ftp_support%': '<(disable_ftp_support)',
1152 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1153 'enable_task_manager%': '<(enable_task_manager)',
1154 'sas_dll_path%': '<(sas_dll_path)',
1155 'wix_path%': '<(wix_path)',
1156 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1157 'use_system_libjpeg%': '<(use_system_libjpeg)',
1158 'android_webview_build%': '<(android_webview_build)',
1159 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
1160 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1161 'gyp_managed_install%': 0,
1162 'create_standalone_apk%': 1,
1163 'enable_app_list%': '<(enable_app_list)',
1164 'use_default_render_theme%': '<(use_default_render_theme)',
1165 'enable_settings_app%': '<(enable_settings_app)',
1166 'google_api_key%': '<(google_api_key)',
1167 'google_default_client_id%': '<(google_default_client_id)',
1168 'google_default_client_secret%': '<(google_default_client_secret)',
1169 'enable_managed_users%': '<(enable_managed_users)',
1170 'native_discardable_memory%': '<(native_discardable_memory)',
1171 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1172 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1173 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1174 'enable_mdns%' : '<(enable_mdns)',
1175 'enable_service_discovery%' : '<(enable_service_discovery)',
1176 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1177 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1178 'v8_optimized_debug%': '<(v8_optimized_debug)',
1179 'proprietary_codecs%': '<(proprietary_codecs)',
1180 'use_goma%': '<(use_goma)',
1181 'gomadir%': '<(gomadir)',
1182 'video_hole%': '<(video_hole)',
1183 'enable_load_completion_hacks%': '<(enable_load_completion_hacks)',
1184 'support_pre_M6_history_database%': '<(support_pre_M6_history_database)',
1186 # Whether or not we are building the Athena shell.
1189 # Use system protobuf instead of bundled one.
1190 'use_system_protobuf%': 0,
1192 # Use system yasm instead of bundled one.
1193 'use_system_yasm%': 0,
1195 # Use system ICU instead of bundled one.
1196 'use_system_icu%' : 0,
1198 # Default to enabled PIE; this is important for ASLR but we may need to be
1199 # able to turn it off for various reasons.
1200 'linux_disable_pie%': 0,
1202 # The release channel that this build targets. This is used to restrict
1203 # channel-specific build options, like which installer packages to create.
1204 # The default is 'all', which does no channel-specific filtering.
1207 # Override chromium_mac_pch and set it to 0 to suppress the use of
1208 # precompiled headers on the Mac. Prefix header injection may still be
1209 # used, but prefix headers will not be precompiled. This is useful when
1210 # using distcc to distribute a build to compile slaves that don't
1211 # share the same compiler executable as the system driving the compilation,
1212 # because precompiled headers rely on pointers into a specific compiler
1213 # executable's image. Setting this to 0 is needed to use an experimental
1214 # Linux-Mac cross compiler distcc farm.
1215 'chromium_mac_pch%': 1,
1217 # The default value for mac_strip in target_defaults. This cannot be
1218 # set there, per the comment about variable% in a target_defaults.
1219 'mac_strip_release%': 0,
1221 # Set to 1 to enable java code coverage. Instruments classes during build
1222 # to produce .ec files during runtime.
1223 'emma_coverage%': 0,
1225 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1226 # separated with whitespace and/or comma. Only has effect if
1227 # 'emma_coverage=1'.
1230 # Set to 1 to enable running Android lint on java/class files.
1233 # Although base/allocator lets you select a heap library via an
1234 # environment variable, the libcmt shim it uses sometimes gets in
1235 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1236 # 'win_use_allocator_shim': 0,
1237 # 'win_release_RuntimeLibrary': 2
1238 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1239 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1241 # TODO(bradnelson): eliminate this when possible.
1242 # To allow local gyp files to prevent release.vsprops from being included.
1243 # Yes(1) means include release.vsprops.
1244 # Once all vsprops settings are migrated into gyp, this can go away.
1245 'msvs_use_common_release%': 1,
1247 # TODO(bradnelson): eliminate this when possible.
1248 # To allow local gyp files to override additional linker options for msvs.
1249 # Yes(1) means set use the common linker options.
1250 'msvs_use_common_linker_extras%': 1,
1252 # TODO(sgk): eliminate this if possible.
1253 # It would be nicer to support this via a setting in 'target_defaults'
1254 # in chrome/app/locales/locales.gypi overriding the setting in the
1255 # 'Debug' configuration in the 'target_defaults' dict below,
1256 # but that doesn't work as we'd like.
1257 'msvs_debug_link_incremental%': '2',
1259 # Needed for some of the largest modules.
1260 'msvs_debug_link_nonincremental%': '1',
1262 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1263 # to get incremental linking to be faster in debug builds.
1264 'incremental_chrome_dll%': '0',
1266 # Experimental setting to break chrome.dll into multiple pieces based on
1268 'chrome_multiple_dll%': '0',
1270 # Experimental setting to optimize Chrome's DLLs with PGO.
1271 'chrome_pgo_phase%': '0',
1274 'clang%': '<(clang)',
1275 'host_clang%': '<(host_clang)',
1276 'make_clang_dir%': '<(make_clang_dir)',
1278 # Control which version of clang to use when building for iOS. If set to
1279 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1280 # the version of clang that ships with the Chromium source. This variable
1281 # is automatically set to '1' when using the Xcode generator.
1284 # These two variables can be set in GYP_DEFINES while running
1285 # |gclient runhooks| to let clang run a plugin in every compilation.
1286 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1288 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1291 'clang_add_plugin%': '',
1293 # Tell ld64 to write map files describing binary layout. Useful
1294 # for looking at what contributes to binary size, e.g. with
1295 # https://github.com/nico/bloat
1296 'mac_write_linker_maps%': 0,
1298 # The default type of gtest.
1299 'gtest_target_type%': 'executable',
1301 # Enable sampling based profiler.
1302 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1304 # Profile without optimizing out stack frames when profiling==1.
1305 'profiling_full_stack_frames%': '0',
1307 # And if we want to dump symbols for Breakpad-enabled builds.
1308 'linux_dump_symbols%': 0,
1309 # And if we want to strip the binary after dumping symbols.
1310 'linux_strip_binary%': 0,
1311 # If we want stack unwind support for backtrace().
1312 'debug_unwind_tables%': 1,
1313 'release_unwind_tables%': 1,
1315 # Override where to find binutils
1316 'binutils_version%': 0,
1317 'binutils_dir%': '',
1320 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1321 'use_allocator%': 'tcmalloc',
1323 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1324 'linux_link_gnome_keyring%': 0,
1325 # Set to 1 to link against gsettings APIs instead of using dlopen().
1326 'linux_link_gsettings%': 0,
1328 # Enable use of OpenMAX DL FFT routines.
1329 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1331 # Enable new NPDevice API.
1332 'enable_new_npdevice_api%': 0,
1334 # Enable EGLImage support in OpenMAX
1335 'enable_eglimage%': 1,
1337 # .gyp files or targets should set chromium_code to 1 if they build
1338 # Chromium-specific code, as opposed to external code. This variable is
1339 # used to control such things as the set of warnings to enable, and
1340 # whether warnings are treated as errors.
1341 'chromium_code%': 0,
1343 # Disable fatal linker warnings, similarly to how we make it possible
1344 # to disable -Werror (e.g. for different toolchain versions).
1345 'disable_fatal_linker_warnings%': 0,
1347 'release_valgrind_build%': 0,
1349 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1350 'enable_wexit_time_destructors%': 0,
1352 # Build libpeerconnection as a static library by default.
1353 'libpeer_target_type%': 'static_library',
1355 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1356 'internal_gles2_conform_tests%': 0,
1358 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1359 'internal_khronos_glcts_tests%': 0,
1361 # Set to 1 to compile the filter fuzzer.
1362 'internal_filter_fuzzer%': 0,
1364 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1365 # so Cocoa is happy (http://crbug.com/20441).
1367 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1368 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1369 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1370 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1371 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1372 'vi', 'zh-CN', 'zh-TW',
1375 # Pseudo locales are special locales which are used for testing and
1376 # debugging. They don't get copied to the final app. For more info,
1377 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1384 # If debug_devtools is set to 1, JavaScript files for DevTools are
1385 # stored as is and loaded from disk. Otherwise, a concatenated file
1386 # is stored in resources.pak. It is still possible to load JS files
1387 # from disk by passing --debug-devtools cmdline switch.
1388 'debug_devtools%': 0,
1390 # The Java Bridge is not compiled in by default.
1393 # Code signing for iOS binaries. The bots need to be able to disable this.
1394 'chromium_ios_signing%': 1,
1396 # This flag is only used when disable_nacl==0 and disables all those
1397 # subcomponents which would require the installation of a native_client
1398 # untrusted toolchain.
1399 'disable_nacl_untrusted%': 0,
1401 # Disable Dart by default.
1404 # Copy out the setting of disable_nacl.
1405 'disable_nacl%': '<(disable_nacl)',
1407 # Portable Native Client is enabled by default.
1408 'disable_pnacl%': 0,
1410 # Whether to build full debug version for Debug configuration on Android.
1411 # Compared to full debug version, the default Debug configuration on Android
1412 # has no full v8 debug, has size optimization and linker gc section, so that
1413 # we can build a debug version with acceptable size and performance.
1414 'android_full_debug%': 0,
1416 # Sets the default version name and code for Android app, by default we
1417 # do a developer build.
1418 'android_app_version_name%': 'Developer Build',
1419 'android_app_version_code%': 0,
1421 # Contains data about the attached devices for gyp_managed_install.
1422 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1424 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1425 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1427 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1428 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1430 # Whether we are using the rlz library or not. Platforms like Android send
1431 # rlz codes for searches but do not use the library.
1434 # Turns on the i18n support in V8.
1435 'v8_enable_i18n_support': 1,
1437 # Compile d8 for the host toolset.
1438 'v8_toolset_for_d8': 'host',
1440 # Use the chromium skia by default.
1441 'use_system_skia%': '0',
1443 # Use brlapi from brltty for braille display support.
1446 # Relative path to icu.gyp from this file.
1447 'icu_gyp_path': '../third_party/icu/icu.gyp',
1449 # IPC fuzzer is disabled by default.
1450 'enable_ipc_fuzzer%': 0,
1453 # Force disable libstdc++ debug mode.
1454 'disable_glibcxx_debug%': 0,
1456 # Set to 1 to compile with MSE support for MPEG2 TS
1457 'enable_mpeg2ts_stream_parser%': 0,
1459 # Support ChromeOS touchpad gestures with ozone.
1460 'use_evdev_gestures%': 0,
1462 # Default ozone platform (if no --ozone-platform flag).
1463 'ozone_platform%': "",
1465 # Ozone platforms to include in the build.
1466 'ozone_platform_caca%': 0,
1467 'ozone_platform_dri%': 0,
1468 'ozone_platform_egltest%': 0,
1469 'ozone_platform_gbm%': 0,
1470 'ozone_platform_ozonex%': 0,
1471 'ozone_platform_test%': 0,
1474 # Enable the Syzygy optimization step for the official builds.
1475 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1476 'syzygy_optimize%': 1,
1478 'syzygy_optimize%': 0,
1480 # Get binutils version so we can enable debug fission if we can.
1481 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1483 # compiler_version doesn't work with clang
1484 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1485 # compiler_version works with clang.
1486 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1487 # that it takes effect here.
1488 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1489 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1491 # On Android we know the binutils version in the toolchain.
1493 'binutils_version%': 222,
1495 ['host_arch=="x64"', {
1496 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1498 ['host_arch=="ia32"', {
1499 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1501 # Our version of binutils in third_party/binutils
1502 ['linux_use_bundled_binutils==1', {
1503 'binutils_version%': 224,
1507 'binutils_version%': 0,
1509 # The version of GCC in use, set later in platforms that use GCC and have
1510 # not explicitly chosen to build with clang. Currently, this means all
1511 # platforms except Windows, Mac and iOS.
1512 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1513 # it takes effect here.
1514 ['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', {
1516 ['OS=="android" and android_webview_build==0', {
1517 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1518 # We directly set the gcc version since we know what we use.
1521 ['OS=="android" and android_webview_build==1', {
1522 # Android WebView uses a hermetic clang toolchain for host builds.
1523 'host_gcc_version%': 0,
1524 # Android WebView uses the GCC toolchain from the Android build.
1528 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1529 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1533 'host_gcc_version%': 0,
1536 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1537 'windows_sdk_path%': '<(windows_sdk_default_path)',
1539 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
1541 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1542 'directx_sdk_path%': '<(directx_sdk_default_path)',
1544 'directx_sdk_path%': '$(DXSDK_DIR)',
1547 'windows_driver_kit_path%': '$(WDK_DIR)',
1549 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1551 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1554 'nacl_untrusted_build%': 0,
1555 'use_allocator%': 'none',
1557 ['OS=="linux" and target_arch=="mipsel"', {
1558 'sysroot%': '<(sysroot)',
1561 # All Chrome builds have breakpad symbols, but only process the
1562 # symbols from official builds.
1563 ['(branding=="Chrome" and buildtype=="Official")', {
1564 'linux_dump_symbols%': 1,
1566 # Omit unwind support in official release builds to save space. We
1567 # can use breakpad for these builds.
1568 'release_unwind_tables%': 0,
1571 # For official builds, use a 64-bit linker to avoid running out
1572 # of address space. The buildbots should have a 64-bit kernel
1573 # and a 64-bit libc installed.
1574 ['host_arch=="ia32" and target_arch=="ia32"', {
1575 'linux_use_bundled_gold%': '1',
1576 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1581 }], # os_posix==1 and OS!="mac" and OS!="ios"
1584 'enable_background%': 0,
1585 'icu_use_data_file_flag%': 1,
1586 'enable_web_speech%': 0,
1587 'use_system_libxml%': 1,
1588 'use_system_sqlite%': 1,
1590 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1591 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1592 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1593 'uk', 'vi', 'zh-CN', 'zh-TW',
1596 # The Mac SDK is set for iOS builds and passed through to Mac
1597 # sub-builds. This allows the Mac sub-build SDK in an iOS build to be
1598 # overridden from the command line the same way it is for a Mac build.
1599 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py 10.6)',
1601 # iOS SDK and deployment target support. The |ios_sdk| value is left
1602 # blank so that when it is set in the project files it will be the
1603 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1604 # causes Xcode to spit out a warning for every single project file for
1605 # not using the "current" SDK.
1607 'ios_sdk_path%': '',
1608 'ios_deployment_target%': '7.0',
1611 # ios_product_name is set to the name of the .app bundle as it should
1613 ['branding=="Chrome"', {
1614 'ios_product_name%': 'Chrome',
1615 }, { # else: branding!="Chrome"
1616 'ios_product_name%': 'Chromium',
1618 ['branding=="Chrome" and buildtype=="Official"', {
1620 }, { # else: branding!="Chrome" or buildtype!="Official"
1626 # Location of Android NDK.
1629 # Unfortunately we have to use absolute paths to the SDK/NDK because
1630 # they're passed to ant which uses a different relative path from
1632 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1633 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1634 'android_host_arch%': '<!(uname -m)',
1635 # Android API-level of the SDK used for compilation.
1636 'android_sdk_version%': '20',
1637 'android_sdk_build_tools_version%': '20.0.0',
1638 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1640 # Copy conditionally-set variables out one scope.
1641 'android_ndk_root%': '<(android_ndk_root)',
1642 'android_sdk_root%': '<(android_sdk_root)',
1643 'android_sdk_version%': '<(android_sdk_version)',
1644 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1645 'host_os%': '<(host_os)',
1647 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1648 # Android SDK build tools (e.g. dx, aapt, aidl)
1649 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1651 # Android API level 14 is ICS (Android 4.0) which is the minimum
1652 # platform requirement for Chrome on Android, we use it for native
1655 ['target_arch == "ia32"', {
1656 'android_app_abi%': 'x86',
1657 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1658 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1659 'android_ndk_lib_dir%': 'usr/lib',
1660 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1662 ['target_arch == "x64"', {
1663 'android_app_abi%': 'x86_64',
1664 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1665 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-x86_64',
1666 'android_ndk_lib_dir%': 'usr/lib64',
1667 'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1669 ['target_arch=="arm"', {
1672 'android_app_abi%': 'armeabi',
1674 'android_app_abi%': 'armeabi-v7a',
1677 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1678 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1679 'android_ndk_lib_dir%': 'usr/lib',
1680 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1682 ['target_arch == "arm64"', {
1683 'android_app_abi%': 'arm64-v8a',
1684 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1685 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-arm64',
1686 'android_ndk_lib_dir%': 'usr/lib',
1687 'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1689 ['target_arch == "mipsel"', {
1690 'android_app_abi%': 'mips',
1691 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1692 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1693 'android_ndk_lib_dir%': 'usr/lib',
1694 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1696 ['target_arch == "mips64el"', {
1697 'android_app_abi%': 'mips64',
1698 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1699 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-mips64',
1700 'android_ndk_lib_dir%': 'usr/lib64',
1701 'android_toolchain%': '<(android_ndk_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1706 # Copy conditionally-set variables out one scope.
1707 'android_app_abi%': '<(android_app_abi)',
1708 'android_gdbserver%': '<(android_gdbserver)',
1709 'android_ndk_root%': '<(android_ndk_root)',
1710 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1711 'android_sdk_root%': '<(android_sdk_root)',
1712 'android_sdk_version%': '<(android_sdk_version)',
1713 'android_toolchain%': '<(android_toolchain)',
1715 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1716 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1717 'android_sdk_tools%': '<(android_sdk_tools)',
1718 'android_sdk%': '<(android_sdk)',
1719 'android_sdk_jar%': '<(android_sdk)/android.jar',
1721 'android_stlport_root': '<(android_stlport_root)',
1722 'android_stlport_include': '<(android_stlport_root)/stlport',
1723 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1724 'host_os%': '<(host_os)',
1726 # Location of the "objcopy" binary, used by both gyp and scripts.
1727 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1729 # Location of the "strip" binary, used by both gyp and scripts.
1730 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1732 # Location of the "readelf" binary.
1733 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1735 # Determines whether we should optimize JNI generation at the cost of
1736 # breaking assumptions in the build system that when inputs have changed
1737 # the outputs should always change as well. This is meant purely for
1738 # developer builds, to avoid spurious re-linking of native files.
1739 'optimize_jni_generation%': '<(optimize_jni_generation)',
1741 # Always uses openssl.
1743 'use_openssl_certs%': 1,
1745 'proprietary_codecs%': '<(proprietary_codecs)',
1746 'safe_browsing%': 1,
1747 'enable_web_speech%': 0,
1749 'build_ffmpegsumo%': 0,
1750 'use_allocator%': 'none',
1752 # Disable Native Client.
1755 # Android does not support background apps.
1756 'enable_background%': 0,
1758 # Sessions are store separately in the Java side.
1759 'enable_session_service%': 0,
1763 'gtest_target_type%': 'shared_library',
1765 # Uses system APIs for decoding audio and video.
1766 'use_libffmpeg%': '0',
1768 # When building as part of the Android system, use system libraries
1769 # where possible to reduce ROM size.
1770 'use_system_icu%': '<(android_webview_build)',
1771 'use_system_stlport%': '<(android_webview_build)',
1773 # Copy it out one scope.
1774 'android_webview_build%': '<(android_webview_build)',
1776 # Default android linker script for shared library exports.
1777 'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_exports.lst',
1780 'use_system_fontconfig%': 0,
1782 'use_system_fontconfig%': 1,
1785 'enable_mpeg2ts_stream_parser%': 1,
1786 'ffmpeg_branding%': 'Chrome',
1787 'ozone_platform_ozonex%': 1,
1788 'use_playready%': 0,
1790 ['target_arch=="arm"', {
1792 'arm_tune%': 'cortex-a9',
1798 ['android_webview_build==1', {
1799 # When building the WebView in the Android tree, jarjar will remap all
1800 # the class names, so the JNI generator needs to know this.
1801 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1803 ['OS=="linux" and target_arch!="mipsel"', {
1804 # TODO(thakis): This is here to measure perf for a while.
1809 # All Chrome builds have breakpad symbols, but only process the
1810 # symbols from official builds.
1811 ['(branding=="Chrome" and buildtype=="Official")', {
1812 'mac_strip_release%': 1,
1816 ['OS=="mac" or OS=="ios"', {
1820 # Mac OS X SDK and deployment target support. The SDK identifies
1821 # the version of the system headers that will be used, and
1822 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1823 # macro. "Maximum allowed" refers to the operating system version
1824 # whose APIs are available in the headers. The deployment target
1825 # identifies the minimum system version that the built products are
1826 # expected to function on. It corresponds to the
1827 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1828 # macros are available, #include <AvailabilityMacros.h>. Additional
1829 # documentation on these macros is available at
1830 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1831 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1832 # deployment target to 10.6. Other projects, such as O3D, may
1833 # override these defaults.
1835 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1836 # about that is at least the specified version. In official builds,
1837 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1838 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1839 # path to the SDK; when set to a non-empty string, SDK detection
1840 # based on mac_sdk_min will be bypassed entirely.
1841 'mac_sdk_min%': '10.6',
1842 'mac_sdk_path%': '',
1844 'mac_deployment_target%': '10.6',
1847 'mac_sdk_min': '<(mac_sdk_min)',
1848 'mac_sdk_path': '<(mac_sdk_path)',
1849 'mac_deployment_target': '<(mac_deployment_target)',
1851 # Compile in Breakpad support by default so that it can be
1852 # tested, even if it is not enabled by default at runtime.
1853 'mac_breakpad_compiled_in%': 1,
1855 # mac_product_name is set to the name of the .app bundle as it should
1856 # appear on disk. This duplicates data from
1857 # chrome/app/theme/chromium/BRANDING and
1858 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1859 # these names into the build system.
1860 ['branding=="Chrome"', {
1861 'mac_product_name%': 'Google Chrome',
1862 }, { # else: branding!="Chrome"
1863 'mac_product_name%': 'Chromium',
1866 ['branding=="Chrome" and buildtype=="Official"', {
1867 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1868 # Enable uploading crash dumps.
1869 'mac_breakpad_uploads%': 1,
1870 # Enable dumping symbols at build time for use by Mac Breakpad.
1872 # Enable Keystone auto-update support.
1874 }, { # else: branding!="Chrome" or buildtype!="Official"
1875 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1876 'mac_breakpad_uploads%': 0,
1881 }], # OS=="mac" or OS=="ios"
1884 # This is the architecture convention used in WinSDK paths.
1885 ['target_arch=="ia32"', {
1886 'winsdk_arch%': 'x86',
1888 'winsdk_arch%': '<(target_arch)',
1890 ['component=="shared_library"', {
1891 'win_use_allocator_shim%': 0,
1893 # Turn on multiple dll by default on Windows when in static_library.
1894 'chrome_multiple_dll%': 1,
1897 'win_use_allocator_shim%': 0,
1899 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1900 # Only enabled by default for ninja because it's buggy in VS.
1901 # Not enabled for component=static_library because some targets
1902 # are too large and the toolchain fails due to the size of the
1904 'incremental_chrome_dll%': 1,
1906 # Don't do incremental linking for large modules on 32-bit or when
1907 # component=static_library as the toolchain fails due to the size of
1909 ['MSVS_OS_BITS==32 or component=="static_library"', {
1910 'msvs_large_module_debug_link_mode%': '1', # No
1912 'msvs_large_module_debug_link_mode%': '2', # Yes
1914 ['MSVS_VERSION=="2013e"', {
1922 'nacl_win64_defines': [
1923 # This flag is used to minimize dependencies when building
1924 # Native Client loader for 64-bit Windows.
1929 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1935 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1936 'enable_pepper_cdms%': 1,
1938 'enable_pepper_cdms%': 0,
1942 'enable_browser_cdms%': 1,
1944 'enable_browser_cdms%': 0,
1947 # Native Client glibc toolchain is enabled
1948 # by default except on arm, mips and mips64.
1949 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
1950 'disable_glibc%': 1,
1952 'disable_glibc%': 0,
1955 # Set the relative path from this file to the GYP file of the JPEG
1956 # library used by Chromium.
1957 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1958 # Configuration for using the system libjeg is here.
1959 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1961 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1964 # Options controlling the use of GConf (the classic GNOME configuration
1965 # system) and GIO, which contains GSettings (the new GNOME config system).
1966 ['chromeos==1 or embedded==1', {
1974 # Set up -D and -E flags passed into grit.
1975 ['branding=="Chrome"', {
1976 # TODO(mmoss) The .grd files look for _google_chrome, but for
1977 # consistency they should look for google_chrome_build like C++.
1978 'grit_defines': ['-D', '_google_chrome',
1979 '-E', 'CHROMIUM_BUILD=google_chrome'],
1981 'grit_defines': ['-D', '_chromium',
1982 '-E', 'CHROMIUM_BUILD=chromium'],
1985 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
1987 ['desktop_linux==1', {
1988 'grit_defines': ['-D', 'desktop_linux'],
1990 ['toolkit_views==1', {
1991 'grit_defines': ['-D', 'toolkit_views'],
1994 'grit_defines': ['-D', 'use_aura'],
1997 'grit_defines': ['-D', 'use_ash'],
2000 'grit_defines': ['-D', 'use_nss'],
2003 'grit_defines': ['-D', 'use_ozone'],
2005 ['image_loader_extension==1', {
2006 'grit_defines': ['-D', 'image_loader_extension'],
2009 'grit_defines': ['-D', 'remoting'],
2011 ['use_titlecase_in_grd==1', {
2012 'grit_defines': ['-D', 'use_titlecase'],
2014 ['use_third_party_translations==1', {
2015 'grit_defines': ['-D', 'use_third_party_translations'],
2017 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2018 'ka', 'ku', 'kw', 'ms', 'ug'
2022 'grit_defines': ['-t', 'android',
2023 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true'],
2025 ['OS=="mac" or OS=="ios"', {
2026 'grit_defines': ['-D', 'scale_factors=2x'],
2031 # iOS uses a whitelist to filter resources.
2032 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
2035 # Enable host builds when generating with ninja-ios.
2037 ['"<(GENERATOR)"=="ninja"', {
2041 # TODO(sdefresne): Remove the target_subarch check once Apple has
2042 # upstreamed the support for "arm64". http://crbug.com/341453
2043 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
2048 ['enable_extensions==1', {
2049 'grit_defines': ['-D', 'enable_extensions'],
2051 ['enable_plugins!=0', {
2052 'grit_defines': ['-D', 'enable_plugins'],
2054 ['enable_printing!=0', {
2055 'grit_defines': ['-D', 'enable_printing'],
2057 ['enable_printing==1', {
2058 'grit_defines': ['-D', 'enable_full_printing'],
2060 ['enable_themes==1', {
2061 'grit_defines': ['-D', 'enable_themes'],
2063 ['enable_app_list==1', {
2064 'grit_defines': ['-D', 'enable_app_list'],
2066 ['enable_settings_app==1', {
2067 'grit_defines': ['-D', 'enable_settings_app'],
2069 ['enable_google_now==1', {
2070 'grit_defines': ['-D', 'enable_google_now'],
2072 ['use_concatenated_impulse_responses==1', {
2073 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2075 ['enable_webrtc==1', {
2076 'grit_defines': ['-D', 'enable_webrtc'],
2078 ['enable_hangout_services_extension==1', {
2079 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2081 ['enable_task_manager==1', {
2082 'grit_defines': ['-D', 'enable_task_manager'],
2084 ['notifications==1', {
2085 'grit_defines': ['-D', 'enable_notifications'],
2087 ['enable_wifi_bootstrapping==1', {
2088 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2090 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2091 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2093 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2094 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2096 ['enable_mdns==1 or OS=="mac"', {
2097 'grit_defines': ['-D', 'enable_service_discovery'],
2098 'enable_service_discovery%': 1
2100 ['clang_use_chrome_plugins==1 and OS!="win"', {
2101 'clang_chrome_plugins_flags': [
2102 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
2105 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2107 'use_allocator%': 'none',
2108 'use_sanitizer_options%': 1,
2110 ['asan==1 and OS=="linux" and chromeos==0', {
2111 'use_custom_libcxx%': 1,
2119 ['asan==1 and OS=="mac"', {
2120 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
2121 # runtime is fully adopted. See http://crbug.com/242503.
2122 'mac_strip_release': 0,
2125 'use_custom_libcxx%': 1,
2128 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2129 # libstdc++. This is required to avoid false positive reports whenever
2130 # the C++ standard library is used.
2131 'use_custom_libcxx%': 1,
2132 # Running the V8-generated code on an ARM simulator is a powerful hack
2133 # that allows the tool to see the memory accesses from JITted code.
2134 # Without this flag, JS code causes false positive reports from MSan.
2135 'v8_target_arch': 'arm64',
2138 ['OS=="linux" and clang_type_profiler==1', {
2140 'clang_use_chrome_plugins%': 0,
2142 ['host_arch=="x64"', {
2143 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2145 ['host_arch=="ia32"', {
2146 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2147 # Clang in this directory at your own risk if needed for some
2148 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2149 # usage). Any failure by this compiler should not close the tree.
2150 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2156 # The Clang plugins don't currently work on Windows.
2157 # TODO(hans): One day, this will work. (crbug.com/82385)
2158 'clang_use_chrome_plugins%': 0,
2161 # On valgrind bots, override the optimizer settings so we don't inline too
2162 # much and make the stacks harder to figure out.
2164 # TODO(rnk): Kill off variables that no one else uses and just implement
2165 # them under a build_for_tool== condition.
2166 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2168 'mac_debug_optimization': '1',
2169 'mac_release_optimization': '1',
2170 'release_optimize': '1',
2171 'no_gc_sections': 1,
2172 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2173 '-fno-builtin -fno-optimize-sibling-calls',
2174 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2175 '-fno-builtin -fno-optimize-sibling-calls',
2177 # MSVS flags for TSan on Pin and Windows.
2178 'win_debug_RuntimeChecks': '0',
2179 'win_debug_disable_iterator_debugging': '1',
2180 'win_debug_Optimization': '1',
2181 'win_debug_InlineFunctionExpansion': '0',
2182 'win_release_InlineFunctionExpansion': '0',
2183 'win_release_OmitFramePointers': '0',
2185 'use_allocator': 'tcmalloc',
2186 'release_valgrind_build': 1,
2188 'component': 'static_library',
2189 'use_system_zlib': 0,
2192 # Build tweaks for DrMemory.
2193 # TODO(rnk): Combine with tsan config to share the builder.
2194 # http://crbug.com/108155
2195 ['build_for_tool=="drmemory"', {
2196 # These runtime checks force initialization of stack vars which blocks
2197 # DrMemory's uninit detection.
2198 'win_debug_RuntimeChecks': '0',
2199 # Iterator debugging is slow.
2200 'win_debug_disable_iterator_debugging': '1',
2201 # Try to disable optimizations that mess up stacks in a release build.
2202 # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054)
2203 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2204 # compiler bug, so we use /Ob1 instead.
2205 'win_release_InlineFunctionExpansion': '1',
2206 'win_release_OmitFramePointers': '0',
2207 # Ditto for debug, to support bumping win_debug_Optimization.
2208 'win_debug_InlineFunctionExpansion': 0,
2209 'win_debug_OmitFramePointers': 0,
2210 # Keep the code under #ifndef NVALGRIND.
2211 'release_valgrind_build': 1,
2214 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2215 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2219 # Set default compiler flags depending on ARM version.
2220 ['arm_version==6 and android_webview_build==0', {
2221 'arm_arch%': 'armv6',
2224 'arm_float_abi%': 'softfp',
2227 ['arm_version==7 and android_webview_build==0', {
2228 'arm_arch%': 'armv7-a',
2229 'arm_tune%': 'generic-armv7-a',
2234 'arm_fpu%': 'vfpv3-d16',
2237 # Change the default to hard once the armhf transition is complete.
2238 'arm_float_abi%': 'softfp',
2242 ['android_webview_build==1', {
2243 # The WebView build gets its cpu-specific flags from the Android build system.
2247 'arm_float_abi%': '',
2251 # Enable brlapi by default for chromeos.
2256 ['use_ozone==1 and ozone_auto_platforms==1', {
2257 # Use test as the default platform.
2258 'ozone_platform%': 'test',
2260 # Build all platforms whose deps are in install-build-deps.sh.
2261 # Only these platforms will be compile tested by buildbots.
2262 'ozone_platform_dri%': 1,
2263 'ozone_platform_test%': 1,
2264 'ozone_platform_egltest%': 1,
2267 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2268 'use_clipboard_aurax11%': 1,
2271 ['OS=="win" and use_goma==1', {
2272 # goma doesn't support pch yet.
2273 'chromium_win_pch': 0,
2274 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2276 ['win_z7==0 and fastbuild==0', {
2282 ['OS=="win" and (clang==1 or asan==1)', {
2283 'chromium_win_pch': 0,
2287 'host_cc': '<(make_clang_dir)/bin/clang',
2288 'host_cxx': '<(make_clang_dir)/bin/clang++',
2290 'host_cc': '<!(which gcc)',
2291 'host_cxx': '<!(which g++)',
2294 # The seccomp-bpf sandbox is only supported on five architectures
2296 # Do not disable seccomp_bpf anywhere without talking to
2297 # security@chromium.org!
2298 ['((OS=="linux" or OS=="android") and '
2299 '(target_arch=="ia32" or target_arch=="x64" or '
2300 'target_arch=="arm" or target_arch=="mipsel" or '
2301 'target_arch=="arm64"))', {
2302 'use_seccomp_bpf%': 1,
2304 'use_seccomp_bpf%': 0,
2308 # older history files use fts2 instead of fts3
2309 'sqlite_enable_fts2%': '<(support_pre_M6_history_database)',
2311 # The path to the ANGLE library.
2312 'angle_path': '<(DEPTH)/third_party/angle',
2314 # List of default apps to install in new profiles. The first list contains
2315 # the source files as found in svn. The second list, used only for linux,
2316 # contains the destination location for each of the files. When a crx
2317 # is added or removed from the list, the chrome/browser/resources/
2318 # default_apps/external_extensions.json file must also be updated.
2319 'default_apps_list': [
2320 'browser/resources/default_apps/external_extensions.json',
2321 'browser/resources/default_apps/gmail.crx',
2322 'browser/resources/default_apps/search.crx',
2323 'browser/resources/default_apps/youtube.crx',
2324 'browser/resources/default_apps/drive.crx',
2325 'browser/resources/default_apps/docs.crx',
2327 'default_apps_list_linux_dest': [
2328 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2329 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2330 '<(PRODUCT_DIR)/default_apps/search.crx',
2331 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2332 '<(PRODUCT_DIR)/default_apps/drive.crx',
2333 '<(PRODUCT_DIR)/default_apps/docs.crx',
2336 # Whether to allow building of the GPU-related isolates.
2337 'archive_gpu_tests%': 0,
2339 # Whether to allow building of chromoting related isolates.
2340 'archive_chromoting_tests%': 0,
2342 'target_defaults': {
2344 # The condition that operates on chromium_code is in a target_conditions
2345 # section, and will not have access to the default fallback value of
2346 # chromium_code at the top of this file, or to the chromium_code
2347 # variable placed at the root variables scope of .gyp files, because
2348 # those variables are not set at target scope. As a workaround,
2349 # if chromium_code is not set at target scope, define it in target scope
2350 # to contain whatever value it has during early variable expansion.
2351 # That's enough to make it available during target conditional
2353 'chromium_code%': '<(chromium_code)',
2355 'component%': '<(component)',
2357 'chromecast%': '<(chromecast)',
2359 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2360 'win_release_Optimization%': '2', # 2 = /Os
2361 'win_debug_Optimization%': '0', # 0 = /Od
2363 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2364 # Tri-state: blank is default, 1 on, 0 off
2365 'win_release_OmitFramePointers%': '0',
2366 # Tri-state: blank is default, 1 on, 0 off
2367 'win_debug_OmitFramePointers%': '',
2369 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2370 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2372 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2373 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2374 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2376 # VS inserts quite a lot of extra checks to algorithms like
2377 # std::partial_sort in Debug build which make them O(N^2)
2378 # instead of O(N*logN). This is particularly slow under memory
2379 # tools like ThreadSanitizer so we want it to be disablable.
2380 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2381 'win_debug_disable_iterator_debugging%': '0',
2383 # An application manifest fragment to declare compatibility settings for
2384 # 'executable' targets. Ignored in other target type.
2385 'win_exe_compatibility_manifest%':
2386 '<(DEPTH)\\build\\win\\compatibility.manifest',
2388 'release_extra_cflags%': '',
2389 'debug_extra_cflags%': '',
2391 'release_valgrind_build%': '<(release_valgrind_build)',
2393 # the non-qualified versions are widely assumed to be *nix-only
2394 'win_release_extra_cflags%': '',
2395 'win_debug_extra_cflags%': '',
2397 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2398 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2400 # Only used by Windows build for now. Can be used to build into a
2401 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2402 # output files in src/build/VS2010_{Debug,Release}.
2403 'build_dir_prefix%': '',
2405 # Targets are by default not nacl untrusted code.
2406 'nacl_untrusted_build%': 0,
2408 'pnacl_compile_flags': [
2409 # pnacl uses the clang compiler so we need to suppress all the
2410 # same warnings as we do for clang.
2411 # TODO(sbc): Remove these if/when they are removed from the clang
2413 '-Wno-unused-function',
2414 '-Wno-char-subscripts',
2415 '-Wno-c++11-extensions',
2416 '-Wno-unnamed-type-template-args',
2420 ['OS=="win" and component=="shared_library"', {
2421 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2422 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2423 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2425 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2426 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2427 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2430 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2431 'mac_release_optimization%': 's', # Use -Os unless overridden
2432 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2434 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2435 'mac_release_optimization%': '3', # Use -O3 unless overridden
2436 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2439 'host_os%': '<(host_os)', # See comment above chromium_code.
2442 'clang_warning_flags': [
2445 # Don't die on dtoa code that uses a char as an array index.
2446 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2447 '-Wno-char-subscripts',
2449 # TODO(thakis): This used to be implied by -Wno-unused-function,
2450 # which we no longer use. Check if it makes sense to remove
2451 # this as well. http://crbug.com/316352
2452 '-Wno-unneeded-internal-declaration',
2454 # Warns on switches on enums that cover all enum values but
2455 # also contain a default: branch. Chrome is full of that.
2456 '-Wno-covered-switch-default',
2458 # Warns when a const char[] is converted to bool.
2459 '-Wstring-conversion',
2461 # C++11-related flags:
2463 # This warns on using ints as initializers for floats in
2464 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2465 # which happens in several places in chrome code. Not sure if
2466 # this is worth fixing.
2467 '-Wno-c++11-narrowing',
2469 # Clang considers the `register` keyword as deprecated, but e.g.
2470 # code generated by flex (used in angle) contains that keyword.
2471 # http://crbug.com/255186
2472 '-Wno-deprecated-register',
2474 # TODO(hans): Clean this up. Or disable with finer granularity.
2475 '-Wno-unused-local-typedef',
2478 'includes': [ 'set_clang_warning_flags.gypi', ],
2480 # Don't use deprecated V8 APIs anywhere.
2481 'V8_DEPRECATION_WARNINGS',
2484 '<(SHARED_INTERMEDIATE_DIR)',
2487 ['(OS=="mac" or OS=="ios") and asan==1', {
2489 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2492 ['OS=="win" and asan==1 and component=="shared_library"', {
2494 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2497 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2498 'cflags_cc!': ['-fno-rtti'],
2501 '-gline-tables-only',
2502 '-fintercept-allocation-functions',
2504 'defines': ['TYPE_PROFILING'],
2506 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2509 ['branding=="Chrome"', {
2510 'defines': ['GOOGLE_CHROME_BUILD'],
2511 }, { # else: branding!="Chrome"
2512 'defines': ['CHROMIUM_BUILD'],
2514 ['OS=="mac" and component=="shared_library"', {
2516 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2517 'LD_RUNPATH_SEARCH_PATHS': [
2518 # For unbundled binaries.
2520 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2521 '@loader_path/../../..',
2525 ['clang==1 and OS!="win"', {
2526 # This is here so that all files get recompiled after a clang roll and
2527 # when turning clang on or off.
2528 # (defines are passed via the command line, and build systems rebuild
2529 # things when their commandline changes). Nothing should ever read this
2531 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2534 'defines': ['ENABLE_RLZ'],
2536 ['component=="shared_library"', {
2537 'defines': ['COMPONENT_BUILD'],
2539 ['toolkit_views==1', {
2540 'defines': ['TOOLKIT_VIEWS=1'],
2542 ['ui_compositor_image_transport==1', {
2543 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2546 'defines': ['USE_AURA=1'],
2549 'defines': ['USE_ASH=1'],
2552 'defines': ['USE_PANGO=1'],
2555 'defines': ['USE_CAIRO=1'],
2558 'defines': ['USE_CRAS=1'],
2561 'defines': ['USE_GLIB=1'],
2564 'defines': ['USE_OZONE=1'],
2566 ['use_default_render_theme==1', {
2567 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2569 ['use_libjpeg_turbo==1', {
2570 'defines': ['USE_LIBJPEG_TURBO=1'],
2573 'defines': ['USE_X11=1'],
2575 ['use_clipboard_aurax11==1', {
2576 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2578 ['enable_one_click_signin==1', {
2579 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2581 ['enable_pre_sync_backup==1', {
2582 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2584 ['use_xi2_mt!=0 and use_x11==1', {
2585 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2587 ['image_loader_extension==1', {
2588 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2591 'defines': ['ENABLE_PROFILING=1'],
2594 'defines': ['ENABLE_REMOTING=1'],
2596 ['enable_webrtc==1', {
2597 'defines': ['ENABLE_WEBRTC=1'],
2599 ['proprietary_codecs==1', {
2600 'defines': ['USE_PROPRIETARY_CODECS'],
2602 ['enable_mpeg2ts_stream_parser==1', {
2603 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2607 ['enable_viewport==1', {
2608 'defines': ['ENABLE_VIEWPORT'],
2610 ['enable_pepper_cdms==1', {
2611 'defines': ['ENABLE_PEPPER_CDMS'],
2613 ['enable_browser_cdms==1', {
2614 'defines': ['ENABLE_BROWSER_CDMS'],
2616 ['configuration_policy==1', {
2617 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2619 ['notifications==1', {
2620 'defines': ['ENABLE_NOTIFICATIONS'],
2622 ['enable_hidpi==1', {
2623 'defines': ['ENABLE_HIDPI=1'],
2625 ['native_discardable_memory==1', {
2626 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2628 ['native_memory_pressure_signals==1', {
2629 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2632 'defines': ['USE_UDEV'],
2636 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2639 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2640 # Clang creates chubby debug information, which makes linking very
2641 # slow. For now, don't create debug information with clang. See
2642 # http://crbug.com/70000
2646 'debug_extra_cflags': '-g0',
2649 # Android builds symbols on release by default, disable them.
2652 'debug_extra_cflags': '-g0',
2653 'release_extra_cflags': '-g0',
2657 }, { # else clang!=1
2659 ['OS=="win" and fastbuild==2', {
2660 # Completely disable debug information.
2663 'GenerateDebugInformation': 'false',
2665 'VCCLCompilerTool': {
2666 'DebugInformationFormat': '0',
2670 ['OS=="win" and fastbuild==1', {
2673 # This tells the linker to generate .pdbs, so that
2674 # we can get meaningful stack traces.
2675 'GenerateDebugInformation': 'true',
2677 'VCCLCompilerTool': {
2678 # No debug info to be generated by compiler.
2679 'DebugInformationFormat': '0',
2683 ['OS=="linux" and fastbuild==2', {
2685 'debug_extra_cflags': '-g0',
2688 ['OS=="linux" and fastbuild==1', {
2690 'debug_extra_cflags': '-g1',
2693 ['OS=="android" and fastbuild==2', {
2695 'debug_extra_cflags': '-g0',
2696 'release_extra_cflags': '-g0',
2699 ['OS=="android" and fastbuild==1', {
2701 'debug_extra_cflags': '-g1',
2702 'release_extra_cflags': '-g1',
2709 ['dont_embed_build_metadata==1', {
2711 'DONT_EMBED_BUILD_METADATA',
2713 }], # dont_embed_build_metadata==1
2714 ['dcheck_always_on!=0', {
2715 'defines': ['DCHECK_ALWAYS_ON=1'],
2716 }], # dcheck_always_on!=0
2717 ['tracing_like_official_build!=0', {
2718 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2719 }], # tracing_like_official_build!=0
2720 ['win_use_allocator_shim==0', {
2723 'defines': ['NO_TCMALLOC'],
2727 ['enable_eglimage==1', {
2729 'ENABLE_EGLIMAGE=1',
2734 'ADDRESS_SANITIZER',
2735 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2736 'MEMORY_SANITIZER_INITIAL_SIZE',
2740 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2748 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2749 'MEMORY_SANITIZER_INITIAL_SIZE',
2755 '_CRT_SECURE_NO_DEPRECATE',
2756 '_SCL_SECURE_NO_DEPRECATE',
2757 # This define is required to pull in the new Win8 interfaces from
2758 # system headers like ShObjIdl.h.
2759 'NTDDI_VERSION=0x06020000',
2760 # This is required for ATL to use XP-safe versions of its functions.
2761 '_USING_V110_SDK71_',
2764 '<(DEPTH)/third_party/wtl/include',
2769 # Generates debug info when win_z7=1
2770 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2772 'GenerateDebugInformation': 'true',
2774 'VCCLCompilerTool': {
2775 'DebugInformationFormat': '1',
2786 ['target_arch=="arm"', {
2788 # TODO(lcwu): Work around an error when building Chromium
2789 # with gcc-4.5.3 (e.g. v8/src/platform-linux.cc). Remove
2790 # this define once the toolchain is updated.
2791 # See crbug.com/388933.
2795 ['use_playready==1', {
2797 'PLAYREADY_CDM_AVAILABLE',
2802 ['enable_task_manager==1', {
2804 'ENABLE_TASK_MANAGER=1',
2807 ['enable_extensions==1', {
2809 'ENABLE_EXTENSIONS=1',
2812 ['OS=="win" and branding=="Chrome"', {
2813 'defines': ['ENABLE_SWIFTSHADER'],
2815 ['enable_dart==1', {
2816 'defines': ['WEBKIT_USING_DART=1'],
2818 ['enable_plugin_installation==1', {
2819 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2821 ['enable_plugins==1', {
2822 'defines': ['ENABLE_PLUGINS=1'],
2824 ['enable_session_service==1', {
2825 'defines': ['ENABLE_SESSION_SERVICE=1'],
2827 ['enable_themes==1', {
2828 'defines': ['ENABLE_THEMES=1'],
2830 ['enable_autofill_dialog==1', {
2831 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2833 ['enable_prod_wallet_service==1', {
2834 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2836 ['enable_background==1', {
2837 'defines': ['ENABLE_BACKGROUND=1'],
2839 ['enable_google_now==1', {
2840 'defines': ['ENABLE_GOOGLE_NOW=1'],
2842 ['cld_version!=0', {
2843 'defines': ['CLD_VERSION=<(cld_version)'],
2845 ['cld_version==2', {
2846 # This is used to populate the "CLD Data Source" field in:
2847 # chrome://translate-internals
2848 'defines': ['CLD2_DATA_SOURCE=<(cld2_data_source)'],
2850 ['enable_printing==1', {
2851 'defines': ['ENABLE_FULL_PRINTING=1', 'ENABLE_PRINTING=1'],
2853 ['enable_printing==2', {
2854 'defines': ['ENABLE_PRINTING=1'],
2856 ['enable_spellcheck==1', {
2857 'defines': ['ENABLE_SPELLCHECK=1'],
2859 ['enable_captive_portal_detection==1', {
2860 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2862 ['enable_app_list==1', {
2863 'defines': ['ENABLE_APP_LIST=1'],
2865 ['enable_settings_app==1', {
2866 'defines': ['ENABLE_SETTINGS_APP=1'],
2868 ['disable_file_support==1', {
2869 'defines': ['DISABLE_FILE_SUPPORT=1'],
2871 ['disable_ftp_support==1', {
2872 'defines': ['DISABLE_FTP_SUPPORT=1'],
2874 ['use_icu_alternatives_on_android==1', {
2875 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2877 ['enable_managed_users==1', {
2878 'defines': ['ENABLE_MANAGED_USERS=1'],
2880 ['spdy_proxy_auth_property != ""', {
2881 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2883 ['spdy_proxy_auth_value != ""', {
2884 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2886 ['enable_mdns==1', {
2887 'defines': ['ENABLE_MDNS=1'],
2889 ['enable_service_discovery==1', {
2890 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2892 ['enable_wifi_bootstrapping==1', {
2893 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2895 ['enable_hangout_services_extension==1', {
2896 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2898 ['enable_ipc_fuzzer==1', {
2899 'defines': ['ENABLE_IPC_FUZZER=1'],
2902 'defines': ['VIDEO_HOLE=1'],
2904 ['enable_load_completion_hacks==1', {
2905 'defines': ['ENABLE_LOAD_COMPLETION_HACKS=1'],
2907 ], # conditions for 'target_defaults'
2908 'target_conditions': [
2909 ['<(use_openssl)==1', {
2910 'defines': ['USE_OPENSSL=1'],
2912 ['<(use_openssl_certs)==1', {
2913 'defines': ['USE_OPENSSL_CERTS=1'],
2915 ['>(nacl_untrusted_build)==1', {
2918 'USE_OPENSSL_CERTS=1',
2921 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
2922 'defines': ['USE_NSS=1'],
2924 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
2925 'defines': ['OS_CHROMEOS=1'],
2927 ['enable_wexit_time_destructors==1 and OS!="win"', {
2928 # TODO: Enable on Windows too, http://crbug.com/404525
2929 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
2931 ['chromium_code==0', {
2933 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
2934 # We don't want to get warnings from third-party code,
2935 # so remove any existing warning-enabling flags like -Wall.
2941 # Don't warn about hash_map in third-party code.
2945 # Don't warn about printf format problems.
2946 # This is off by default in gcc but on in Ubuntu's gcc(!).
2950 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
2954 # TODO: Fix all warnings on chromeos too.
2955 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
2960 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
2962 # Don't warn about ignoring the return value from e.g. close().
2963 # This is off by default in some gccs but on by default in others.
2964 # BSD systems do not support this option, since they are usually
2965 # using gcc 4.2.1, which does not have this flag yet.
2966 '-Wno-unused-result',
2971 '_CRT_SECURE_NO_DEPRECATE',
2972 '_CRT_NONSTDC_NO_WARNINGS',
2973 '_CRT_NONSTDC_NO_DEPRECATE',
2974 '_SCL_SECURE_NO_DEPRECATE',
2976 'msvs_disabled_warnings': [4800],
2978 'VCCLCompilerTool': {
2979 'WarningLevel': '3',
2980 'WarnAsError': 'true',
2981 'Detect64BitPortabilityProblems': 'false',
2985 ['buildtype=="Official"', {
2987 'VCCLCompilerTool': { 'WarnAsError': 'false' },
2992 'VCCLCompilerTool': { 'WarnAsError': 'false' },
2995 [ 'component=="shared_library"', {
2996 # TODO(darin): Unfortunately, some third_party code depends on base.
2997 'msvs_disabled_warnings': [
2998 4251, # class 'std::xx' needs to have dll-interface.
3004 [ 'OS=="mac" or OS=="ios"', {
3006 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3009 ['buildtype=="Official"', {
3011 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3018 # TODO(ios): Fix remaining warnings in third-party code, then
3019 # remove this; the Mac cleanup didn't get everything that's
3020 # flagged in an iOS build.
3021 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3022 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3023 # Several internal ios directories generate numerous warnings for
3024 # -Wobjc-missing-property-synthesis.
3025 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3031 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3032 'filename_rules.gypi',
3034 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3035 # C99 macros on Mac and Linux.
3037 '__STDC_CONSTANT_MACROS',
3038 '__STDC_FORMAT_MACROS',
3042 # turn on warnings for signed/unsigned mismatch on chromium code.
3044 'VCCLCompilerTool': {
3045 'AdditionalOptions': ['/we4389'],
3049 ['OS=="win" and component=="shared_library"', {
3050 'msvs_disabled_warnings': [
3051 4251, # class 'std::xx' needs to have dll-interface.
3056 ], # target_conditions for 'target_defaults'
3057 'default_configuration': 'Debug',
3059 # VCLinkerTool LinkIncremental values below:
3061 # 1 == /INCREMENTAL:NO
3063 # Debug links incremental, Release does not.
3065 # Abstract base configurations to cover common attributes.
3069 'msvs_configuration_attributes': {
3070 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3071 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3072 'CharacterSet': '1',
3074 # Add the default import libs.
3077 'AdditionalDependencies': [
3101 'MinimumRequiredVersion': '5.01', # XP.
3102 'TargetMachine': '1',
3104 'VCLibrarianTool': {
3105 'TargetMachine': '1',
3108 'msvs_configuration_platform': 'Win32',
3112 'msvs_configuration_platform': 'x64',
3115 # Make sure to understand http://crbug.com/361720 if you want to
3117 'MinimumRequiredVersion': '5.02', # Server 2003.
3118 'TargetMachine': '17', # x86 - 64
3119 'AdditionalLibraryDirectories!':
3120 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3121 'AdditionalLibraryDirectories':
3122 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3123 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3124 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3126 'VCLibrarianTool': {
3127 'AdditionalLibraryDirectories!':
3128 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3129 'AdditionalLibraryDirectories':
3130 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3131 'TargetMachine': '17', # x64
3138 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3139 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3142 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3144 '<@(debug_extra_cflags)',
3148 'VCCLCompilerTool': {
3149 'Optimization': '<(win_debug_Optimization)',
3150 'PreprocessorDefinitions': ['_DEBUG'],
3151 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3152 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3154 # According to MSVS, InlineFunctionExpansion=0 means
3155 # "default inlining", not "/Ob0".
3156 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3157 ['win_debug_InlineFunctionExpansion==0', {
3158 'AdditionalOptions': ['/Ob0'],
3160 ['win_debug_InlineFunctionExpansion!=""', {
3161 'InlineFunctionExpansion':
3162 '<(win_debug_InlineFunctionExpansion)',
3164 ['win_debug_disable_iterator_debugging==1', {
3165 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3168 # if win_debug_OmitFramePointers is blank, leave as default
3169 ['win_debug_OmitFramePointers==1', {
3170 'OmitFramePointers': 'true',
3172 ['win_debug_OmitFramePointers==0', {
3173 'OmitFramePointers': 'false',
3174 # The above is not sufficient (http://crbug.com/106711): it
3175 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3176 # perform FPO regardless, so we must explicitly disable.
3177 # We still want the false setting above to avoid having
3178 # "/Oy /Oy-" and warnings about overriding.
3179 'AdditionalOptions': ['/Oy-'],
3182 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3185 'LinkIncremental': '<(msvs_debug_link_incremental)',
3186 # ASLR makes debugging with windbg difficult because Chrome.exe and
3187 # Chrome.dll share the same base name. As result, windbg will
3188 # name the Chrome.dll module like chrome_<base address>, where
3189 # <base address> typically changes with each launch. This in turn
3190 # means that breakpoints in Chrome.dll don't stick from one launch
3191 # to the next. For this reason, we turn ASLR off in debug builds.
3192 # Note that this is a three-way bool, where 0 means to pick up
3193 # the default setting, 1 is off and 2 is on.
3194 'RandomizedBaseAddress': 1,
3196 'VCResourceCompilerTool': {
3197 'PreprocessorDefinitions': ['_DEBUG'],
3201 ['OS=="linux" or OS=="android"', {
3202 'target_conditions': [
3203 ['_toolset=="target"', {
3205 '<@(debug_extra_cflags)',
3210 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3211 # Enable libstdc++ debugging facilities to help catch problems
3212 # early, see http://crbug.com/65151 .
3213 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3214 'defines': ['_GLIBCXX_DEBUG=1',],
3216 ['release_valgrind_build==0', {
3219 '-fstack-protector-all', # Implies -fstack-protector
3225 # Allow comparing the address of references and 'this' against 0
3226 # in debug builds. Technically, these can never be null in
3227 # well-defined C/C++ and Clang can optimize such checks away in
3228 # release builds, but they may be used in asserts in debug builds.
3229 '-Wno-undefined-bool-conversion',
3230 '-Wno-tautological-undefined-compare',
3234 '-Wno-undefined-bool-conversion',
3235 '-Wno-tautological-undefined-compare',
3239 'VCCLCompilerTool': {
3240 'AdditionalOptions': [
3241 '-Wno-undefined-bool-conversion',
3242 '-Wno-tautological-undefined-compare',
3255 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3256 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3257 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3260 'VCCLCompilerTool': {
3261 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3263 # In official builds, each target will self-select
3264 # an optimization level.
3265 ['buildtype!="Official"', {
3266 'Optimization': '<(win_release_Optimization)',
3269 # According to MSVS, InlineFunctionExpansion=0 means
3270 # "default inlining", not "/Ob0".
3271 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3272 ['win_release_InlineFunctionExpansion==0', {
3273 'AdditionalOptions': ['/Ob0'],
3275 ['win_release_InlineFunctionExpansion!=""', {
3276 'InlineFunctionExpansion':
3277 '<(win_release_InlineFunctionExpansion)',
3280 # if win_release_OmitFramePointers is blank, leave as default
3281 ['win_release_OmitFramePointers==1', {
3282 'OmitFramePointers': 'true',
3284 ['win_release_OmitFramePointers==0', {
3285 'OmitFramePointers': 'false',
3286 # The above is not sufficient (http://crbug.com/106711): it
3287 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3288 # perform FPO regardless, so we must explicitly disable.
3289 # We still want the false setting above to avoid having
3290 # "/Oy /Oy-" and warnings about overriding.
3291 'AdditionalOptions': ['/Oy-'],
3294 'AdditionalOptions': [
3295 '/d2Zi+', # Improve debugging of Release builds.
3296 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3297 '<@(win_release_extra_cflags)',
3301 # LinkIncremental is a tri-state boolean, where 0 means default
3302 # (i.e., inherit from parent solution), 1 means false, and
3304 'LinkIncremental': '1',
3305 # This corresponds to the /PROFILE flag which ensures the PDB
3306 # file contains FIXUP information (growing the PDB file by about
3307 # 5%) but does not otherwise alter the output binary. This
3308 # information is used by the Syzygy optimization tool when
3309 # decomposing the release image.
3314 ['msvs_use_common_release', {
3315 'includes': ['release.gypi'],
3317 ['release_valgrind_build==0 and tsan==0', {
3320 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3324 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3325 'MEMORY_SANITIZER_INITIAL_SIZE',
3326 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3327 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3330 ['win_use_allocator_shim==0', {
3331 'defines': ['NO_TCMALLOC'],
3333 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3334 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3335 # It seems to work fine with Ubuntu 12 headers though, so use it
3336 # in official builds.
3337 ['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")', {
3338 'target_conditions': [
3339 ['chromium_code==1', {
3340 # Non-chromium code is not guaranteed to compile cleanly
3341 # with _FORTIFY_SOURCE. Also, fortified build may fail
3342 # when optimizations are disabled, so only do that for Release
3345 '_FORTIFY_SOURCE=2',
3350 ['OS=="linux" or OS=="android"', {
3351 'target_conditions': [
3352 ['_toolset=="target"', {
3354 '<@(release_extra_cflags)',
3357 ['enable_resource_whitelist_generation==1', {
3359 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3368 'NS_BLOCK_ASSERTIONS=1',
3374 # Concrete configurations
3377 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3380 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3385 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3386 'target_conditions': [
3387 [ '_type=="executable"', {
3388 # To get a real .dSYM bundle produced by dsymutil, set the
3389 # debug information format to dwarf-with-dsym. Since
3390 # strip_from_xcode will not be used, set Xcode to do the
3391 # stripping as well.
3393 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3394 'DEPLOYMENT_POSTPROCESSING': 'YES',
3395 'STRIP_INSTALLED_PRODUCT': 'YES',
3402 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3404 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3407 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3415 'target_defaults': {
3420 # TODO(glider): enable the default options on other systems.
3422 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3424 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3430 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3431 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3432 'target_defaults': {
3434 '-Wl,--fatal-warnings',
3438 ['os_posix==1 and chromeos==0', {
3439 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3440 # and we want to avoid overriding this, so stack-protector is only
3441 # enabled when not building on Chrome OS.
3442 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3444 'target_defaults': {
3446 '-fstack-protector',
3447 '--param=ssp-buffer-size=4',
3451 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3452 'target_defaults': {
3453 # Enable -Werror by default, but put it in a variable so it can
3454 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3456 'werror%': '-Werror',
3457 'libraries_for_target%': '',
3460 '_FILE_OFFSET_BITS=64',
3463 '<(werror)', # See note above about the werror variable.
3465 '-fno-strict-aliasing', # See http://crbug.com/32204
3467 # TODO(evan): turn this back on once all the builds work.
3469 # Don't warn about unused function params. We use those everywhere.
3470 '-Wno-unused-parameter',
3471 # Don't warn about the "struct foo f = {0};" initialization pattern.
3472 '-Wno-missing-field-initializers',
3473 # Don't export any symbols (for example, to plugins we dlopen()).
3474 # Note: this is *required* to make some plugins work.
3475 '-fvisibility=hidden',
3481 '-fno-threadsafe-statics',
3482 # Make inline functions have hidden visiblity by default.
3483 # Surprisingly, not covered by -fvisibility=hidden.
3484 '-fvisibility-inlines-hidden',
3485 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3486 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3490 '-pthread', '-Wl,-z,noexecstack',
3493 '<(libraries_for_target)',
3498 'debug_optimize%': '0',
3504 '-O>(debug_optimize)',
3511 # Warn in case of text relocations.
3512 '-Wl,--warn-shared-textrel',
3515 ['OS=="android" and android_full_debug==0', {
3516 # Some configurations are copied from Release_Base to reduce
3519 'debug_optimize%': 's',
3523 '-ffunction-sections',
3530 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3531 # We don't omit frame pointers on arm64 since they are required
3532 # to correctly unwind stackframes which contain system library
3533 # function frames (crbug.com/391706).
3535 '-fomit-frame-pointer',
3538 ['OS=="linux" and target_arch=="ia32"', {
3540 '-Wl,--no-as-needed',
3543 ['debug_unwind_tables==1', {
3544 'cflags': ['-funwind-tables'],
3546 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3548 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3549 # definitions in to the right scope to use them when setting
3550 # linux_use_debug_fission, so it can be used here alone.
3551 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3552 'cflags': ['-gsplit-dwarf'],
3558 'release_optimize%': '2',
3559 # Binaries become big and gold is unable to perform GC
3560 # and remove unused sections for some of test targets
3561 # on 32 bit platform.
3562 # (This is currently observed only in chromeos valgrind bots)
3563 # The following flag is to disable --gc-sections linker
3564 # option for these bots.
3565 'no_gc_sections%': 0,
3567 # TODO(bradnelson): reexamine how this is done if we change the
3568 # expansion of configurations
3569 'release_valgrind_build%': 0,
3572 '-O<(release_optimize)',
3573 # Don't emit the GCC version ident directives, they just end up
3574 # in the .comment section taking up binary size.
3576 # Put data and code in their own sections, so that unused symbols
3577 # can be removed at link time with --gc-sections.
3579 '-ffunction-sections',
3582 # Specifically tell the linker to perform optimizations.
3583 # See http://lwn.net/Articles/192624/ .
3588 ['no_gc_sections==0', {
3590 '-Wl,--gc-sections',
3593 ['OS=="android" and target_arch!="arm64"', {
3594 # We don't omit frame pointers on arm64 since they are required
3595 # to correctly unwind stackframes which contain system library
3596 # function frames (crbug.com/391706).
3598 '-fomit-frame-pointer',
3603 'release_optimize%': 's',
3606 # Warn in case of text relocations.
3607 '-Wl,--warn-shared-textrel',
3612 '-fno-omit-frame-pointer',
3616 ['profiling_full_stack_frames==1', {
3619 '-fno-optimize-sibling-calls',
3624 ['release_unwind_tables==1', {
3625 'cflags': ['-funwind-tables'],
3627 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3633 ['target_arch=="ia32"', {
3634 'target_conditions': [
3635 ['_toolset=="target"', {
3637 # Needed so that libs with .s files (e.g. libicudata.a)
3638 # are compatible with the general 32-bit-ness.
3641 # All floating-point computations on x87 happens in 80-bit
3642 # precision. Because the C and C++ language standards allow
3643 # the compiler to keep the floating-point values in higher
3644 # precision than what's specified in the source and doing so
3645 # is more efficient than constantly rounding up to 64-bit or
3646 # 32-bit precision as specified in the source, the compiler,
3647 # especially in the optimized mode, tries very hard to keep
3648 # values in x87 floating-point stack (in 80-bit precision)
3649 # as long as possible. This has important side effects, that
3650 # the real value used in computation may change depending on
3651 # how the compiler did the optimization - that is, the value
3652 # kept in 80-bit is different than the value rounded down to
3653 # 64-bit or 32-bit. There are possible compiler options to
3654 # make this behavior consistent (e.g. -ffloat-store would keep
3655 # all floating-values in the memory, thus force them to be
3656 # rounded to its original precision) but they have significant
3657 # runtime performance penalty.
3659 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3660 # which keep floating-point values in SSE registers in its
3661 # native precision (32-bit for single precision, and 64-bit
3662 # for double precision values). This means the floating-point
3663 # value used during computation does not change depending on
3664 # how the compiler optimized the code, since the value is
3665 # always kept in its specified precision.
3667 # Refer to http://crbug.com/348761 for rationale behind SSE2
3668 # being a minimum requirement for 32-bit Linux builds and
3669 # http://crbug.com/313032 for an example where this has "bit"
3674 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3681 # Use gold linker for Android ia32 target.
3687 # Install packages have started cropping up with
3688 # different headers between the 32-bit and 64-bit
3689 # versions, so we have to shadow those differences off
3690 # and make sure a 32-bit-on-64-bit build picks up the
3692 # For android build, use NDK headers instead of host headers
3693 ['host_arch!="ia32" and OS!="android"', {
3702 ['target_arch=="x64"', {
3703 'target_conditions': [
3704 ['_toolset=="target"', {
3706 # Use gold linker for Android x64 target.
3723 ['target_arch=="arm"', {
3724 'target_conditions': [
3725 ['_toolset=="target"', {
3729 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3730 # has changed whenever it encounters a varargs function. This
3731 # silences those warnings, as they are not helpful and
3732 # clutter legitimate warnings.
3736 ['clang==1 and arm_arch!="" and OS!="android"', {
3738 '-target arm-linux-gnueabihf',
3741 '-target arm-linux-gnueabihf',
3746 '-march=<(arm_arch)',
3749 ['clang==1 and OS!="android"', {
3751 # We need to disable clang's builtin assembler as it can't
3752 # handle several asm files, crbug.com/124610
3753 '-no-integrated-as',
3758 '-mtune=<(arm_tune)',
3766 ['arm_float_abi!=""', {
3768 '-mfloat-abi=<(arm_float_abi)',
3777 # Most of the following flags are derived from what Android
3778 # uses by default when building for arm, reference for which
3779 # can be found in the following file in the Android NDK:
3780 # toolchains/arm-linux-androideabi-4.9/setup.mk
3782 # The tree-sra optimization (scalar replacement for
3783 # aggregates enabling subsequent optimizations) leads to
3784 # invalid code generation when using the Android NDK's
3785 # compiler (r5-r7). This can be verified using
3786 # webkit_unit_tests' WTF.Checked_int8_t test.
3788 # The following option is disabled to improve binary
3789 # size and performance in gcc 4.9.
3790 '-fno-caller-saves',
3793 # Android now supports .relro sections properly.
3794 # NOTE: While these flags enable the generation of .relro
3795 # sections, the generated libraries can still be loaded on
3796 # older Android platform versions.
3803 ['gcc_version==48 and clang==0', {
3805 # The following 5 options are disabled to save on
3806 # binary size in GCC 4.8.
3807 '-fno-partial-inlining',
3808 '-fno-early-inlining',
3809 '-fno-tree-copy-prop',
3810 '-fno-tree-loop-optimize',
3811 '-fno-move-loop-invariants',
3815 'cflags': [ '-mthumb-interwork' ],
3819 # Thumb code with frame pointer makes chrome crash
3822 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3823 # The perf report sometimes incorrectly attributes
3824 # code from tail calls.
3825 '-fno-optimize-sibling-calls',
3828 '-fomit-frame-pointer',
3833 # Clang does not support the following options.
3834 '-mthumb-interwork',
3835 '-finline-limit=64',
3837 '-fno-caller-saves',
3841 # TODO(hans) Enable integrated-as (crbug.com/124610).
3842 '-no-integrated-as',
3843 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3846 # Let clang find the ld.gold in the NDK.
3847 '--gcc-toolchain=<(android_toolchain)/..',
3852 '-marm', # Required for frame pointer based stack traces.
3859 # We set arm_arch to "" so that -march compiler option
3860 # is not set. Otherwise a gcc bug that would complain
3861 # about it conflicting with '-mcpu=cortex-a9'. The flag
3862 # '-march=armv7-a' is actually redundant anyway because
3863 # it is enabled by default when we built the toolchain.
3864 # And using '-mcpu=cortex-a9' should be sufficient.
3867 # Breakpad requires symbols with debugging information
3871 # We want to statically link libstdc++/libgcc_s.
3872 '-static-libstdc++',
3876 # Some components in Chromium (e.g. v8, skia, ffmpeg)
3877 # define their own cflags for arm builds that could
3878 # conflict with the flags we set here (e.g.
3879 # '-mcpu=cortex-a9'). Remove these flags explicitly.
3888 ['target_arch=="arm64"', {
3889 'target_conditions': [
3890 ['_toolset=="target"', {
3894 '-fstack-protector', # stack protector is always enabled on arm64.
3901 ['target_arch=="mipsel"', {
3902 'target_conditions': [
3903 ['_toolset=="target"', {
3905 ['android_webview_build==0 and mips_arch_variant=="r6"', {
3906 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
3909 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
3913 ['android_webview_build==0 and mips_arch_variant=="r2"', {
3914 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
3916 ['android_webview_build==0 and mips_arch_variant=="r1"', {
3917 'cflags': ['-mips32', '-Wa,-mips32'],
3921 '-Wl,--no-keep-memory'
3924 '-Wno-uninitialized',
3929 ['target_arch=="mips64el"', {
3930 'target_conditions': [
3931 ['_toolset=="target"', {
3933 ['android_webview_build==0 and mips_arch_variant=="r6"', {
3934 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
3935 'ldflags': [ '-mips64r6' ],
3937 ['android_webview_build==0 and mips_arch_variant=="r2"', {
3938 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
3939 'ldflags': [ '-mips64r2' ],
3943 '-Wno-uninitialized',
3957 'target_conditions': [
3958 ['_toolset=="target"', {
3960 '--sysroot=<(sysroot)',
3963 '--sysroot=<(sysroot)',
3964 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
3970 # TODO(thakis): Remove, http://crbug.com/263960
3971 '-Wno-reserved-user-defined-literal',
3974 # See the comment in the Mac section for what it takes to move
3975 # this to -std=c++11.
3979 ['clang==0 and host_clang==1', {
3980 'target_conditions': [
3981 ['_toolset=="host"', {
3982 'cflags_cc': [ '-std=gnu++11', ],
3986 ['clang==1 and clang_use_chrome_plugins==1', {
3988 '<@(clang_chrome_plugins_flags)',
3991 ['clang==1 and clang_load!=""', {
3993 '-Xclang', '-load', '-Xclang', '<(clang_load)',
3996 ['clang==1 and clang_add_plugin!=""', {
3998 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4001 ['clang==1 and target_arch=="ia32"', {
4003 # Else building libyuv gives clang's register allocator issues,
4004 # see llvm.org/PR15798 / crbug.com/233709
4005 '-momit-leaf-frame-pointer',
4008 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4010 # See http://crbug.com/110262
4011 '-fcolor-diagnostics',
4014 # Common options for AddressSanitizer, LeakSanitizer,
4015 # ThreadSanitizer and MemorySanitizer.
4016 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4017 'target_conditions': [
4018 ['_toolset=="target"', {
4020 '-fno-omit-frame-pointer',
4021 '-gline-tables-only',
4024 '-fomit-frame-pointer',
4029 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4030 'target_conditions': [
4031 ['_toolset=="target"', {
4033 # Functions interposed by the sanitizers can make ld think
4034 # that some libraries aren't needed when they actually are,
4035 # http://crbug.com/234010. As workaround, disable --as-needed.
4039 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4040 'MEMORY_SANITIZER_INITIAL_SIZE',
4046 'target_conditions': [
4047 ['_toolset=="target"', {
4049 '-fsanitize=address',
4052 '-fsanitize=address',
4059 '-mllvm -asan-globals=0', # http://crbug.com/352073
4065 'target_conditions': [
4066 ['_toolset=="target"', {
4068 '-fsanitize=undefined',
4069 # -fsanitize=vptr is incompatible with -fno-rtti.
4070 '-fno-sanitize=vptr',
4073 '-fsanitize=undefined',
4074 # -fsanitize=vptr is incompatible with -fno-rtti.
4075 '-fno-sanitize=vptr',
4081 'target_conditions': [
4082 ['_toolset=="target"', {
4085 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4097 'UNDEFINED_SANITIZER',
4102 ['asan_coverage!=0', {
4103 'target_conditions': [
4104 ['_toolset=="target"', {
4106 '-mllvm -asan-coverage=<(asan_coverage)',
4112 'target_conditions': [
4113 ['_toolset=="target"', {
4122 'WTF_USE_LEAK_SANITIZER=1',
4128 'target_conditions': [
4129 ['_toolset=="target"', {
4131 '-fsanitize=thread',
4133 '-fsanitize-blacklist=<(tsan_blacklist)',
4136 '-fsanitize=thread',
4140 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4141 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4143 'target_conditions': [
4144 ['_type=="executable"', {
4154 'target_conditions': [
4155 ['_toolset=="target"', {
4157 '-fsanitize=memory',
4158 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4160 '-fsanitize-blacklist=<(msan_blacklist)',
4163 '-fsanitize=memory',
4168 'target_conditions': [
4169 ['_type=="executable"', {
4178 ['use_instrumented_libraries==1', {
4180 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4183 ['use_custom_libcxx==1', {
4185 '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4188 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4189 'target_conditions' : [
4190 # crazy_linker has an upstream gyp file we can't edit, and we
4191 # don't want to instrument it.
4192 ['_toolset=="target" and _target_name!="crazy_linker"', {
4194 '-finstrument-functions',
4195 # Allow mmx intrinsics to inline, so that the
4196 #0 compiler can expand the intrinsics.
4197 '-finstrument-functions-exclude-file-list=mmintrin.h',
4200 ['_toolset=="target" and OS=="android"', {
4202 # Avoids errors with current NDK:
4203 # "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"
4204 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4209 ['linux_dump_symbols==1', {
4212 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4213 'target_conditions': [
4214 ['_toolset=="target"', {
4216 # Attempt to use less memory to prevent the linker from
4217 # running out of address space. Considering installing a
4218 # 64-bit kernel and switching to a 64-bit linker.
4219 '-Wl,--no-keep-memory',
4226 ['use_allocator!="tcmalloc"', {
4227 'defines': ['NO_TCMALLOC'],
4229 ['linux_use_gold_flags==1', {
4230 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4232 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4233 'ldflags': [ '-fuse-ld=gold', ],
4235 'target_conditions': [
4236 ['_toolset=="target"', {
4238 # Experimentation found that using four linking threads
4239 # saved ~20% of link time.
4240 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4241 # Only apply this to the target linker, since the host
4242 # linker might not be gold, but isn't used much anyway.
4243 # TODO(raymes): Disable threading because gold is frequently
4244 # crashing on the bots: crbug.com/161942.
4246 # '-Wl,--thread-count=4',
4251 ['release_valgrind_build==0', {
4252 'target_conditions': [
4253 ['_toolset=="target"', {
4262 ['linux_use_bundled_binutils==1', {
4264 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4267 ['linux_use_bundled_gold==1', {
4268 # Put our binutils, which contains gold in the search path. We pass
4269 # the path to gold to the compiler. gyp leaves unspecified what the
4270 # cwd is when running the compiler, so the normal gyp path-munging
4271 # fails us. This hack gets the right path.
4273 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4276 # Some binutils 2.23 releases may or may not have new dtags enabled,
4277 # but they are all compatible with --disable-new-dtags,
4278 # because the new dynamic tags are not created by default.
4279 ['binutils_version>=223', {
4280 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4281 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4282 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4283 # inside this file to allow usage of --no-as-needed and removal of
4286 '-Wl,--disable-new-dtags',
4289 ['gcc_version>=47 and clang==0', {
4290 'target_conditions': [
4291 ['_toolset=="target"', {
4294 # See comment for -Wno-c++11-narrowing.
4296 # TODO(thakis): Remove, http://crbug.com/263960
4297 '-Wno-literal-suffix',
4302 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4303 'target_conditions': [
4304 ['_toolset=="host"', {
4307 # See comment for -Wno-c++11-narrowing.
4309 # TODO(thakis): Remove, http://crbug.com/263960
4310 '-Wno-literal-suffix',
4318 # FreeBSD-specific options; note that most FreeBSD options are set above,
4321 'target_defaults': {
4323 '-Wl,--no-keep-memory',
4327 # Android-specific options; note that most are set above with Linux.
4330 # This is a unique identifier for a given build. It's used for
4331 # identifying various build artifacts corresponding to a particular
4332 # build of chrome (e.g. where to find archived symbols).
4333 'chrome_build_id%': '',
4335 # Use shared stlport library when system one used.
4336 # Figure this out early since it needs symbols from libgcc.a, so it
4337 # has to be before that in the set of libraries.
4338 ['use_system_stlport==1', {
4339 'android_stlport_library': 'stlport',
4342 ['component=="shared_library"', {
4343 'android_stlport_library': 'stlport_shared',
4345 'android_stlport_library': 'stlport_static',
4351 # Placing this variable here prevents from forking libvpx, used
4352 # by remoting. Remoting is off, so it needn't built,
4353 # so forking it's deps seems like overkill.
4354 # But this variable need defined to properly run gyp.
4355 # A proper solution is to have an OS==android conditional
4356 # in third_party/libvpx/libvpx.gyp to define it.
4357 'libvpx_path': 'lib/linux/arm',
4359 'target_defaults': {
4361 'release_extra_cflags%': '',
4363 # If we're using the components build, append "cr" to all shared
4364 # libraries to avoid naming collisions with android system library
4365 # versions with the same name (e.g. skia, icu).
4366 ['component=="shared_library"', {
4367 'android_product_extension': 'cr.so',
4369 'android_product_extension': 'so',
4373 'target_conditions': [
4374 ['_type=="shared_library"', {
4375 'product_extension': '<(android_product_extension)',
4378 # Settings for building device targets using Android's toolchain.
4379 # These are based on the setup.mk file from the Android NDK.
4381 # The NDK Android executable link step looks as follows:
4383 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4384 # $(PRIVATE_OBJECTS) <-- The .o that we built
4385 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4386 # $(TARGET_LIBGCC) <-- libgcc.a
4387 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4388 # $(PRIVATE_LDLIBS) <-- System .so
4389 # $(TARGET_CRTEND_O) <-- crtend.o
4391 # For now the above are approximated for executables by adding
4392 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4395 # The NDK Android shared library link step looks as follows:
4397 # $(PRIVATE_OBJECTS) <-- The .o that we built
4398 # -l,--whole-archive
4399 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4400 # -l,--no-whole-archive
4401 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4402 # $(TARGET_LIBGCC) <-- libgcc.a
4403 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4404 # $(PRIVATE_LDLIBS) <-- System .so
4406 # For now, assume that whole static libraries are not needed.
4408 # For both executables and shared libraries, add the proper
4409 # libgcc.a to the start of libraries which puts it in the
4410 # proper spot after .o and .a files get linked in.
4412 # TODO: The proper thing to do longer-tem would be proper gyp
4413 # support for a custom link command line.
4414 ['_toolset=="target"', {
4416 '-pthread', # Not supported by Android toolchain.
4419 '-ffunction-sections',
4422 '-fstack-protector',
4424 '-finline-limit=64',
4425 '-Wa,--noexecstack',
4426 '<@(release_extra_cflags)',
4430 '__GNU_SOURCE=1', # Necessary for clone()
4432 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4433 'CHROME_BUILD_ID="<(chrome_build_id)"',
4436 '-pthread', # Not supported by Android toolchain.
4440 '-Wl,--no-undefined',
4443 '-l<(android_stlport_library)',
4444 # Manually link the libgcc.a that the cross compiler uses.
4445 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4451 ['component=="static_library"', {
4453 '-Wl,--exclude-libs=ALL',
4458 # Work around incompatibilities between bionic and clang
4460 '-D__compiler_offsetof=__builtin_offsetof',
4461 '-Dnan=__builtin_nan',
4464 ['target_arch=="arm"', {
4466 '-target arm-linux-androideabi',
4469 '-target arm-linux-androideabi',
4472 ['target_arch=="ia32"', {
4474 '-target x86-linux-androideabi',
4477 '-target x86-linux-androideabi',
4480 # Place holder for x64 support, not tested.
4481 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4482 ['target_arch=="x64"', {
4484 '-target x86_64-linux-androideabi',
4487 '-target x86_64-linux-androideabi',
4494 # Android build relies on -Wl,--gc-sections removing
4495 # unreachable code. ASan instrumentation for globals inhibits
4496 # this and results in a library with unresolvable relocations.
4497 # TODO(eugenis): find a way to reenable this.
4498 '-mllvm -asan-globals=0',
4501 ['android_webview_build==0', {
4503 # The NDK has these things, but doesn't define the constants
4504 # to say that it does. Define them here instead.
4508 '--sysroot=<(android_ndk_sysroot)',
4511 '--sysroot=<(android_ndk_sysroot)',
4514 ['android_webview_build==1', {
4516 # OpenAL headers from the Android tree.
4517 '<(android_src)/frameworks/wilhelm/include',
4520 # Android predefines this as 1; undefine it here so Chromium
4521 # can redefine it later to be 2 for chromium code and unset
4522 # for third party code. This works because cflags are added
4524 '-U_FORTIFY_SOURCE',
4525 # Disable any additional warnings enabled by the Android build system but which
4526 # chromium does not build cleanly with (when treating warning as errors).
4527 # Things that are part of -Wextra:
4528 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4529 '-Wno-ignored-qualifiers',
4531 '-Wno-unused-but-set-variable',
4534 # Other things unrelated to -Wextra:
4535 '-Wno-non-virtual-dtor',
4539 ['android_webview_build==1', {
4540 'target_conditions': [
4541 ['chromium_code==0', {
4543 # There is a class of warning which:
4544 # 1) Android always enables and also treats as errors
4545 # 2) Chromium ignores in third party code
4546 # So we re-enable those warnings when building Android.
4548 '-Wno-format-security',
4550 '-Wno-sequence-point',
4553 '-Wno-non-virtual-dtor',
4558 ['target_arch == "arm"', {
4560 # Enable identical code folding to reduce size.
4564 # NOTE: The stlport header include paths below are specified in
4565 # cflags rather than include_dirs because they need to come
4566 # after include_dirs. Think of them like system headers, but
4567 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4568 # toolchain (circa Gingerbread) will exhibit strange errors.
4569 # The include ordering here is important; change with caution.
4570 ['use_system_stlport==1', {
4572 # For libstdc++/include, which is used by stlport.
4573 '-I<(android_src)/bionic',
4574 '-I<(android_src)/external/stlport/stlport',
4576 }, { # else: use_system_stlport!=1
4578 '-isystem<(android_stlport_include)',
4581 '-L<(android_stlport_libs_dir)',
4584 ['target_arch=="ia32"', {
4585 # The x86 toolchain currently has problems with stack-protector.
4587 '-fstack-protector',
4590 '-fno-stack-protector',
4594 'target_conditions': [
4595 ['_type=="executable"', {
4596 # Force android tools to export the "main" symbol so they can be
4597 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4598 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4599 # when ICS support will be dropped.
4602 '-fvisibility=default',
4606 '-Wl,--gc-sections',
4607 '-Wl,-z,nocopyreloc',
4610 # crtbegin_dynamic.o should be the last item in ldflags.
4611 '<(android_ndk_lib)/crtbegin_dynamic.o',
4614 # crtend_android.o needs to be the last item in libraries.
4615 # Do not add any libraries after this!
4616 '<(android_ndk_lib)/crtend_android.o',
4619 ['_type=="shared_library" or _type=="loadable_module"', {
4621 '-Wl,--exclude-libs=ALL',
4624 '-Wl,-shared,-Bsymbolic',
4627 ['android_webview_build==0', {
4629 # crtbegin_so.o should be the last item in ldflags.
4630 '<(android_ndk_lib)/crtbegin_so.o',
4633 # crtend_so.o needs to be the last item in libraries.
4634 # Do not add any libraries after this!
4635 '<(android_ndk_lib)/crtend_so.o',
4642 # Settings for building host targets using the system toolchain.
4643 ['_toolset=="host"', {
4645 # Due to issues in Clang build system, using ASan on 32-bit
4646 # binaries on x86_64 host is problematic.
4647 # TODO(eugenis): re-enable.
4648 '-fsanitize=address',
4651 '-fsanitize=address',
4652 '-Wl,-z,noexecstack',
4653 '-Wl,--gc-sections',
4656 '-Wl,--warn-shared-textrel',
4657 '-Wl,--fatal-warnings',
4660 # Settings for building host targets on mac.
4661 ['_toolset=="host" and host_os=="mac"', {
4671 'cflags!': ['-fvisibility=hidden'],
4672 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4674 ['OS=="mac" or OS=="ios"', {
4675 'target_defaults': {
4678 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4679 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4680 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4681 'COPY_PHASE_STRIP': 'NO',
4682 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4683 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4684 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4685 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4686 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4687 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4688 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4689 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4690 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4691 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4692 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4693 'GCC_VERSION': '4.2',
4694 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4695 'USE_HEADERMAP': 'NO',
4700 # Don't warn about unused function parameters.
4701 '-Wno-unused-parameter',
4702 # Don't warn about the "struct foo f = {0};" initialization
4704 '-Wno-missing-field-initializers',
4707 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4708 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4710 # Note that the prebuilt Clang binaries should not be used for iOS
4711 # development except for ASan builds.
4713 # gnu++11 instead of c++11 is needed because some code uses
4714 # typeof() (a GNU extension).
4715 # TODO(thakis): Eventually switch this to c++11 instead of
4716 # gnu++11 (once typeof can be removed, which is blocked on c++11
4717 # being available everywhere).
4718 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', # -std=gnu++11
4719 # Warn if automatic synthesis is triggered with
4720 # the -Wobjc-missing-property-synthesis flag.
4721 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4722 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4724 # This warns on selectors from Cocoa headers (-length, -set).
4725 # cfe-dev is currently discussing the merits of this warning.
4726 # TODO(thakis): Reevaluate what to do with this, based one
4727 # cfe-dev discussion.
4728 '-Wno-selector-type-mismatch',
4731 ['clang_xcode==0', {
4732 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4733 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4737 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4739 '<@(clang_chrome_plugins_flags)',
4742 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4744 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4747 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4749 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4752 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4754 # See http://crbug.com/110262
4755 '-fcolor-diagnostics',
4758 ['OS=="ios" and target_subarch!="arm32" and \
4759 "<(GENERATOR)"=="xcode"', {
4761 # TODO(ios): when building Chrome for iOS on 64-bit platform
4762 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4763 # enabled. This cause failures when compiling protobuf code,
4764 # so disable the warning. http://crbug.com/359107
4765 '-Wno-shorten-64-to-32',
4773 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4779 '-fsanitize=address',
4780 '-mllvm -asan-globals=0', # http://crbug.com/352073
4781 '-gline-tables-only',
4785 ['asan_coverage!=0', {
4786 'target_conditions': [
4787 ['_toolset=="target"', {
4789 '-mllvm -asan-coverage=<(asan_coverage)',
4795 'target_conditions': [
4796 ['_type!="static_library"', {
4797 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4802 '-fsanitize=address',
4806 ['mac_write_linker_maps==1', {
4809 '-Wl,-map,>(_target_name).map',
4816 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4817 'target_conditions': [
4818 ['_type=="executable"', {
4824 # Define copy_asan_dylib_path in a variable ending in
4825 # _path so that gyp understands it's a path and
4826 # performs proper relativization during dict merging.
4827 'copy_asan_dylib_path':
4828 'mac/copy_asan_runtime_dylib.sh',
4830 'postbuild_name': 'Copy ASan runtime dylib',
4832 '<(copy_asan_dylib_path)',
4841 ], # target_conditions
4842 }, # target_defaults
4843 }], # OS=="mac" or OS=="ios"
4845 'target_defaults': {
4847 # Prevent Mac OS X AssertMacros.h from defining macros that collide
4848 # with common names, like 'check', 'require', and 'verify'.
4849 # (Included by system header. Also exists on iOS but not included.)
4850 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
4851 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
4854 # These should end with %, but there seems to be a bug with % in
4855 # variables that are intended to be set to different values in
4856 # different targets, like these.
4857 'mac_pie': 1, # Most executables can be position-independent.
4858 # Strip debugging symbols from the target.
4859 'mac_strip': '<(mac_strip_release)',
4863 ['mac_want_real_dsym=="default"', {
4866 'mac_real_dsym': '<(mac_want_real_dsym)'
4871 ['mac_want_real_dsym=="default"', {
4872 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
4874 'mac_real_dsym': '<(mac_want_real_dsym)'
4881 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
4882 # (Equivalent to -fPIC)
4883 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
4884 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4885 # Keep pch files below xcodebuild/.
4886 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
4888 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
4889 # xcode_setting, but not until all downstream projects' mac bots are
4890 # using xcode >= 4.6, because that's when the default value of the
4891 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
4892 # setting is a no-op as far as xcode is concerned, but the compiler
4893 # behaves differently based on whether -fno-strict-aliasing is
4895 '-fno-strict-aliasing', # See http://crbug.com/32204.
4898 'target_conditions': [
4899 ['_type=="executable"', {
4902 # Arranges for data (heap) pages to be protected against
4903 # code execution when running on Mac OS X 10.7 ("Lion"), and
4904 # ensures that the position-independent executable (PIE) bit
4905 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
4907 # Define change_mach_o_flags in a variable ending in _path
4908 # so that GYP understands it's a path and performs proper
4909 # relativization during dict merging.
4910 'change_mach_o_flags_path':
4911 'mac/change_mach_o_flags_from_xcode.sh',
4912 'change_mach_o_flags_options%': [
4914 'target_conditions': [
4915 ['mac_pie==0 or release_valgrind_build==1', {
4916 # Don't enable PIE if it's unwanted. It's unwanted if
4917 # the target specifies mac_pie=0 or if building for
4918 # Valgrind, because Valgrind doesn't understand slide.
4919 # See the similar mac_pie/release_valgrind_build check
4921 'change_mach_o_flags_options': [
4927 'postbuild_name': 'Change Mach-O Flags',
4929 '<(change_mach_o_flags_path)',
4930 '>@(change_mach_o_flags_options)',
4937 'asan_saves_file': 'asan.saves',
4940 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
4944 'target_conditions': [
4945 ['mac_pie==1 and release_valgrind_build==0', {
4946 # Turn on position-independence (ASLR) for executables. When
4947 # PIE is on for the Chrome executables, the framework will
4948 # also be subject to ASLR.
4949 # Don't do this when building for Valgrind, because Valgrind
4950 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
4951 # understand slide, and get rid of the Valgrind check.
4954 '-Wl,-pie', # Position-independent executable (MH_PIE)
4960 ['(_type=="executable" or _type=="shared_library" or \
4961 _type=="loadable_module") and mac_strip!=0', {
4962 'target_conditions': [
4963 ['mac_real_dsym == 1', {
4964 # To get a real .dSYM bundle produced by dsymutil, set the
4965 # debug information format to dwarf-with-dsym. Since
4966 # strip_from_xcode will not be used, set Xcode to do the
4967 # stripping as well.
4971 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
4972 'DEPLOYMENT_POSTPROCESSING': 'YES',
4973 'STRIP_INSTALLED_PRODUCT': 'YES',
4974 'target_conditions': [
4975 ['_type=="shared_library" or _type=="loadable_module"', {
4976 # The Xcode default is to strip debugging symbols
4977 # only (-S). Local symbols should be stripped as
4978 # well, which will be handled by -x. Xcode will
4979 # continue to insert -S when stripping even when
4980 # additional flags are added with STRIPFLAGS.
4982 }], # _type=="shared_library" or _type=="loadable_module"
4983 ['_type=="executable"', {
4986 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
4989 }], # _type=="executable" and asan==1
4990 ], # target_conditions
4992 }, # configuration "Release"
4994 }, { # mac_real_dsym != 1
4995 # To get a fast fake .dSYM bundle, use a post-build step to
4996 # produce the .dSYM and strip the executable. strip_from_xcode
4997 # only operates in the Release configuration.
5001 # Define strip_from_xcode in a variable ending in _path
5002 # so that gyp understands it's a path and performs proper
5003 # relativization during dict merging.
5004 'strip_from_xcode_path': 'mac/strip_from_xcode',
5006 'postbuild_name': 'Strip If Needed',
5007 'action': ['<(strip_from_xcode_path)'],
5011 ], # target_conditions
5012 }], # (_type=="executable" or _type=="shared_library" or
5013 # _type=="loadable_module") and mac_strip!=0
5014 ], # target_conditions
5015 }, # target_defaults
5018 'target_defaults': {
5019 'xcode_settings' : {
5020 # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang
5022 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',
5025 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5026 # additional flag to suppress the "unknown compiler option" error.
5027 # Restrict this flag to builds that are either compiling with Xcode
5028 # or compiling with Xcode's Clang. This will allow Ninja builds to
5029 # continue failing on unknown compiler options.
5030 # TODO(rohitrao): This flag is temporary and should be removed as
5031 # soon as the iOS bots are updated to use Xcode 5.1.
5032 ['clang_xcode==1', {
5034 '-Wno-unknown-warning-option',
5038 # Limit the valid architectures depending on "target_subarch".
5039 # This need to include the "arm" architectures but also the "x86"
5040 # ones (they are used when building for the simulator).
5041 ['target_subarch=="arm32"', {
5042 'VALID_ARCHS': ['armv7', 'i386'],
5044 ['target_subarch=="arm64"', {
5045 'VALID_ARCHS': ['arm64', 'x86_64'],
5047 ['target_subarch=="both"', {
5048 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5050 ['use_system_libcxx==1', {
5051 'target_conditions': [
5052 # Only use libc++ when building target for iOS not when building
5053 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5054 # does not support libc++.
5055 ['_toolset=="target"', {
5056 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5060 # The default for deployment target of 7.0+ is libc++, so force
5061 # the old behavior unless libc++ is enabled.
5062 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5066 'target_conditions': [
5067 ['_toolset=="host"', {
5069 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5070 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5079 ['_toolset=="target"', {
5081 # This section should be for overriding host settings. But,
5082 # since we can't negate the iphone deployment target above, we
5083 # instead set it here for target only.
5084 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5085 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5088 ['_type=="executable"', {
5092 'DEPLOYMENT_POSTPROCESSING': 'YES',
5093 'STRIP_INSTALLED_PRODUCT': 'YES',
5098 # Remove dSYM to reduce build time.
5099 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5105 ['chromium_ios_signing', {
5106 # iOS SDK wants everything for device signed.
5107 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5109 'CODE_SIGNING_REQUIRED': 'NO',
5110 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5115 ], # target_conditions
5116 }, # target_defaults
5119 'target_defaults': {
5121 '_WIN32_WINNT=0x0602',
5128 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5129 'WIN32_LEAN_AND_MEAN',
5131 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5132 '_HAS_EXCEPTIONS=0',
5135 ['buildtype=="Official"', {
5136 # In official builds, targets can self-select an optimization
5137 # level by defining a variable named 'optimize', and setting it
5139 # - "size", optimizes for minimal code size - the default.
5140 # - "speed", optimizes for speed over code size.
5141 # - "max", whole program optimization and link-time code
5142 # generation. This is very expensive and should be used
5145 'optimize%': 'size',
5149 # Set /LTCG for the official builds.
5150 'LinkTimeCodeGeneration': '1',
5153 'target_conditions': [
5154 ['optimize=="size"', {
5156 'VCCLCompilerTool': {
5157 # 1, optimizeMinSpace, Minimize Size (/O1)
5158 'Optimization': '1',
5159 # 2, favorSize - Favor small code (/Os)
5160 'FavorSizeOrSpeed': '2',
5165 ['optimize=="speed"', {
5167 'VCCLCompilerTool': {
5168 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5169 'Optimization': '2',
5170 # 1, favorSpeed - Favor fast code (/Ot)
5171 'FavorSizeOrSpeed': '1',
5176 ['optimize=="max"', {
5177 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5178 # builds. Probably anything that this would catch that
5179 # wouldn't be caught in a normal build isn't going to
5180 # actually be a bug, so the incremental value of C4702 for
5181 # PGO builds is likely very small.
5182 'msvs_disabled_warnings': [
5186 'VCCLCompilerTool': {
5187 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5188 'Optimization': '2',
5189 # 1, favorSpeed - Favor fast code (/Ot)
5190 'FavorSizeOrSpeed': '1',
5191 # This implies link time code generation.
5192 'WholeProgramOptimization': 'true',
5210 'AdditionalLibraryDirectories':
5211 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5213 'VCLibrarianTool': {
5214 'AdditionalLibraryDirectories':
5215 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5221 'VCLibrarianTool': {
5222 'AdditionalLibraryDirectories':
5223 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5226 'AdditionalLibraryDirectories':
5227 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5232 # https://code.google.com/p/chromium/issues/detail?id=372451#c20
5233 # Warning 4702 ("Unreachable code") should be re-enabled once
5234 # Express users are updated to VS2013 Update 2.
5235 'msvs_disabled_warnings': [
5239 'VCCLCompilerTool': {
5240 'AdditionalOptions!': [
5241 '/Zc:inline', # Not supported on non-updated Express.
5245 # Explicitly required when using the ATL with express
5246 'AdditionalDependencies': ['atlthunk.lib'],
5248 # ATL 8.0 included in WDK 7.1 makes the linker to generate
5249 # almost eight hundred LNK4254 and LNK4078 warnings:
5250 # - warning LNK4254: section 'ATL' (50000040) merged into
5251 # '.rdata' (40000040) with different attributes
5252 # - warning LNK4078: multiple 'ATL' sections found with
5253 # different attributes
5254 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
5257 'msvs_system_include_dirs': [
5258 '<(windows_driver_kit_path)/inc/atl71',
5259 '<(windows_driver_kit_path)/inc/mfc42',
5263 'msvs_system_include_dirs': [
5264 '<(windows_sdk_path)/Include/shared',
5265 '<(windows_sdk_path)/Include/um',
5266 '<(windows_sdk_path)/Include/winrt',
5267 '$(VSInstallDir)/VC/atlmfc/include',
5269 'msvs_cygwin_shell': 0,
5270 'msvs_disabled_warnings': [
5271 # C4127: conditional expression is constant
5272 # This warning can in theory catch dead code and other problems, but
5273 # triggers in far too many desirable cases where the conditional
5274 # expression is either set by macros or corresponds some legitimate
5275 # compile-time constant expression (due to constant template args,
5276 # conditionals comparing the sizes of different types, etc.). Some of
5277 # these can be worked around, but it's not worth it.
5280 # C4351: new behavior: elements of array 'array' will be default
5282 # This is a silly "warning" that basically just alerts you that the
5283 # compiler is going to actually follow the language spec like it's
5284 # supposed to, instead of not following it like old buggy versions
5285 # did. There's absolutely no reason to turn this on.
5288 # C4355: 'this': used in base member initializer list
5289 # It's commonly useful to pass |this| to objects in a class'
5290 # initializer list. While this warning can catch real bugs, most of
5291 # the time the constructors in question don't attempt to call methods
5292 # on the passed-in pointer (until later), and annotating every legit
5293 # usage of this is simply more hassle than the warning is worth.
5296 # C4503: 'identifier': decorated name length exceeded, name was
5298 # This only means that some long error messages might have truncated
5299 # identifiers in the presence of lots of templates. It has no effect
5300 # on program correctness and there's no real reason to waste time
5301 # trying to prevent it.
5304 # C4611: interaction between 'function' and C++ object destruction is
5306 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5307 # suggests using exceptions instead of setjmp/longjmp for C++, but
5308 # Chromium code compiles without exception support. We therefore have
5309 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5310 # means we have to turn off this warning (and be careful about how
5311 # object destruction happens in such cases).
5314 # TODO(maruel): These warnings are level 4. They will be slowly
5315 # removed as code is fixed.
5316 4100, # Unreferenced formal parameter
5317 4121, # Alignment of a member was sensitive to packing
5318 4189, # Local variable is initialized but not referenced
5319 4244, # Conversion from 'type1' to 'type2', possible loss of data
5320 4481, # Nonstandard extension used: override specifier 'keyword'
5321 4505, # Unreferenced local function has been removed
5322 4510, # Default constructor could not be generated
5323 4512, # Assignment operator could not be generated
5324 4610, # Object can never be instantiated
5327 'VCCLCompilerTool': {
5328 'AdditionalOptions': ['/MP'],
5329 'MinimalRebuild': 'false',
5330 'BufferSecurityCheck': 'true',
5331 'EnableFunctionLevelLinking': 'true',
5332 'RuntimeTypeInfo': 'false',
5333 'WarningLevel': '4',
5334 'WarnAsError': 'true',
5335 'DebugInformationFormat': '3',
5336 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5337 'ExceptionHandling': '0',
5339 'VCLibrarianTool': {
5340 'AdditionalOptions': ['/ignore:4221'],
5341 'AdditionalLibraryDirectories': [
5342 '<(windows_sdk_path)/Lib/win8/um/x86',
5346 'AdditionalDependencies': [
5358 'AdditionalLibraryDirectories': [
5359 '<(windows_sdk_path)/Lib/win8/um/x86',
5361 'GenerateDebugInformation': 'true',
5362 'MapFileName': '$(OutDir)\\$(TargetName).map',
5363 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5364 'FixedBaseAddress': '1',
5367 # 1 == /SUBSYSTEM:CONSOLE
5368 # 2 == /SUBSYSTEM:WINDOWS
5369 # Most of the executables we'll ever create are tests
5370 # and utilities with console output.
5374 'GenerateStublessProxies': 'true',
5375 'TypeLibraryName': '$(InputName).tlb',
5376 'OutputDirectory': '$(IntDir)',
5377 'HeaderFileName': '$(InputName).h',
5378 'DLLDataFileName': '$(InputName).dlldata.c',
5379 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5380 'ProxyFileName': '$(InputName)_p.c',
5382 'VCResourceCompilerTool': {
5384 'AdditionalIncludeDirectories': [
5386 '<(SHARED_INTERMEDIATE_DIR)',
5389 'target_conditions': [
5390 ['_type=="executable"', {
5392 'EmbedManifest': 'true',
5395 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5397 'AdditionalManifestFiles': [
5398 '>(win_exe_compatibility_manifest)',
5405 # Building with Clang on Windows is a work in progress and very
5406 # experimental. See crbug.com/82385.
5407 'VCCLCompilerTool': {
5408 'WarnAsError': 'false',
5409 'RuntimeTypeInfo': 'false',
5410 'AdditionalOptions': [
5411 '-fmsc-version=1800',
5414 # Many files use intrinsics without including this header.
5415 # TODO(hans): Fix those files, or move this to sub-GYPs.
5418 # TODO(hans): Make this list shorter eventually.
5419 '-Qunused-arguments',
5420 '-Wno-c++11-compat-deprecated-writable-strings',
5421 '-Wno-deprecated-declarations',
5423 '-Wno-enum-conversion',
5424 '-Wno-extra-tokens',
5425 '-Wno-ignored-attributes',
5426 '-Wno-incompatible-pointer-types',
5427 '-Wno-int-to-void-pointer-cast',
5428 '-Wno-invalid-noreturn',
5429 '-Wno-logical-op-parentheses',
5431 '-Wno-missing-braces',
5432 '-Wno-missing-declarations',
5433 '-Wno-msvc-include',
5434 '-Wno-null-dereference',
5435 '-Wno-overloaded-virtual',
5437 '-Wno-pointer-sign',
5439 '-Wno-return-type-c-linkage',
5441 '-Wno-sometimes-uninitialized',
5443 '-Wno-tautological-compare',
5444 '-Wno-unknown-pragmas',
5446 '-Wno-unused-function',
5447 '-Wno-unused-private-field',
5448 '-Wno-unused-value',
5449 '-Wno-unused-variable',
5450 '-Wno-unused-local-typedef', # http://crbug.com/411648
5455 # ASan on Windows is a work in progress and very experimental.
5456 # See crbug.com/345874.
5457 'VCCLCompilerTool': {
5458 'AdditionalOptions': [
5459 '-fsanitize=address',
5461 'AdditionalIncludeDirectories': [
5462 # MSVC needs to be able to find the sanitizer headers when
5463 # invoked via /fallback. This is critical for using macros
5464 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5466 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/include_sanitizer',
5470 'AdditionalLibraryDirectories': [
5471 # TODO(hans): If make_clang_dir is absolute, this breaks.
5472 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/lib/windows',
5475 'target_conditions': [
5476 ['component=="shared_library"', {
5478 'AdditionalDependencies': [
5479 'clang_rt.asan_dynamic-i386.lib',
5480 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5484 ['_type=="executable" and component=="static_library"', {
5486 'AdditionalDependencies': [
5487 'clang_rt.asan-i386.lib',
5491 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5493 'AdditionalDependencies': [
5494 'clang_rt.asan_dll_thunk-i386.lib',
5504 ['disable_nacl==1', {
5505 'target_defaults': {
5511 ['OS=="win" and msvs_use_common_linker_extras', {
5512 'target_defaults': {
5527 'AdditionalOptions': [
5536 'AdditionalOptions': ['/largeaddressaware'],
5545 'AdditionalOptions': [
5546 # safeseh is not compatible with x64
5558 ['enable_new_npdevice_api==1', {
5559 'target_defaults': {
5561 'ENABLE_NEW_NPDEVICE_API',
5565 # Don't warn about the "typedef 'foo' locally defined but not used"
5566 # for gcc 4.8 and higher.
5567 # TODO: remove this flag once all builds work. See crbug.com/227506
5568 ['gcc_version>=48 and clang==0', {
5569 'target_defaults': {
5571 '-Wno-unused-local-typedefs',
5575 ['gcc_version>=48 and clang==0 and host_clang==1', {
5576 'target_defaults': {
5577 'target_conditions': [
5578 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5582 # We need a special case to handle the android webview build on mac because
5583 # the host gcc there doesn't accept this flag, but the target gcc may
5585 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5586 'target_defaults': {
5587 'target_conditions': [
5588 ['_toolset=="host"', {
5590 '-Wno-unused-local-typedefs',
5596 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5598 'make_global_settings': [
5599 ['CC', '<(make_clang_dir)/bin/clang'],
5600 ['CXX', '<(make_clang_dir)/bin/clang++'],
5601 ['CC.host', '$(CC)'],
5602 ['CXX.host', '$(CXX)'],
5605 ['clang==1 and OS=="win"', {
5606 'make_global_settings': [
5607 # On Windows, gyp's ninja generator only looks at CC.
5608 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5611 ['OS=="android" and clang==0', {
5612 # Hardcode the compiler names in the Makefile so that
5613 # it won't depend on the environment at make time.
5614 'make_global_settings': [
5615 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5616 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5617 ['CC.host', '<(host_cc)'],
5618 ['CXX.host', '<(host_cxx)'],
5621 ['OS=="linux" and target_arch=="mipsel"', {
5622 'make_global_settings': [
5623 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5624 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5625 ['CC.host', '<(host_cc)'],
5626 ['CXX.host', '<(host_cxx)'],
5629 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5630 # Set default ARM cross compiling on linux. These can be overridden
5631 # using CC/CXX/etc environment variables.
5632 'make_global_settings': [
5633 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5634 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5635 ['CC.host', '<(host_cc)'],
5636 ['CXX.host', '<(host_cxx)'],
5640 # TODO(yyanagisawa): supports GENERATOR==make
5641 # make generator doesn't support CC_wrapper without CC
5642 # in make_global_settings yet.
5643 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5644 'make_global_settings': [
5645 ['CC_wrapper', '<(gomadir)/gomacc'],
5646 ['CXX_wrapper', '<(gomadir)/gomacc'],
5647 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5648 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5653 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5654 # This block adds *project-wide* configuration settings to each project
5655 # file. It's almost always wrong to put things here. Specify your
5656 # custom xcode_settings in target_defaults to add them to targets instead.
5659 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5660 # setting sets the SDK on a project-wide basis. In order to get the
5661 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5662 # here at the project level.
5665 ['mac_sdk_path==""', {
5666 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5668 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5674 ['ios_sdk_path==""', {
5676 # TODO(justincohen): Ninja only supports simulator for now.
5677 ['"<(GENERATOR)"=="xcode"', {
5678 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5680 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5684 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5689 # Target both iPhone and iPad.
5690 'TARGETED_DEVICE_FAMILY': '1,2',
5693 ['target_arch=="x64"', {
5698 ['target_arch=="ia32"', {
5707 # The Xcode generator will look for an xcode_settings section at the root
5708 # of each dict and use it to apply settings on a file-wide basis. Most
5709 # settings should not be here, they should be in target-specific
5710 # xcode_settings sections, or better yet, should use non-Xcode-specific
5711 # settings in target dicts. SYMROOT is a special case, because many other
5712 # Xcode variables depend on it, including variables such as
5713 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5714 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5715 # files to appear (when present) in the UI as actual files and not red
5716 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5717 # and therefore SYMROOT, needs to be set at the project level.
5718 'SYMROOT': '<(DEPTH)/xcodebuild',