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%': 1,
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 'data_reduction_fallback_host%' : '',
608 'data_reduction_dev_host%' : '',
609 'data_reduction_dev_fallback_host%' : '',
610 'spdy_proxy_auth_origin%' : '',
611 'spdy_proxy_auth_property%' : '',
612 'spdy_proxy_auth_value%' : '',
613 'data_reduction_proxy_probe_url%' : '',
614 'data_reduction_proxy_warmup_url%' : '',
615 'data_reduction_proxy_ssl_origin%' : '',
616 'data_reduction_proxy_alt_origin%' : '',
617 'data_reduction_proxy_alt_fallback_origin%' : '',
619 'enable_service_discovery%': 0,
620 'enable_wifi_bootstrapping%': 0,
621 'enable_hangout_services_extension%': 0,
623 # Enable the Syzygy optimization step.
624 'syzygy_optimize%': 0,
626 # Enable hole punching for the protected video.
629 # Temporary hack to allow us to unify blink's definitions of load
630 # completion. blink uses a crazy set of constraints to determine load
631 # completion, but only actually requires them for layout tests. However,
632 # we need to maintain all the old behaviors while the plumbing is put in
633 # place on both sides of the repo boundary.
634 'enable_load_completion_hacks%': 1,
636 # Automatically select platforms under ozone. Turn this off to
637 # build only explicitly selected platforms.
638 'ozone_auto_platforms%': 1,
640 # If this is set clang is used as host compiler, but not as target
641 # compiler. Always do this by default.
645 # A flag for POSIX platforms
652 # A flag for BSD platforms
653 ['OS=="freebsd" or OS=="openbsd"', {
660 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
666 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
667 # OpenSSL's certificate definition.
668 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
669 'use_openssl_certs%': 1,
671 'use_openssl_certs%': 0,
674 # libudev usage. This currently only affects the content layer.
675 ['OS=="linux" and embedded==0', {
681 # Flags to use X11 on non-Mac POSIX platforms.
682 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
689 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
695 # Flags to use pango and cairo.
696 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
705 ['OS=="linux" and embedded==0', {
711 # We always use skia text rendering in Aura on Windows, since GDI
712 # doesn't agree with our BackingStore.
713 # TODO(beng): remove once skia text rendering is on by default.
714 ['use_aura==1 and OS=="win"', {
715 'enable_skia_text%': 1,
718 # A flag to enable or disable our compile-time dependency
719 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
720 # support will be available. This option is useful
721 # for Linux distributions and for Aura.
722 ['OS!="linux" or chromeos==1', {
723 'use_gnome_keyring%': 0,
725 'use_gnome_keyring%': 1,
728 ['OS=="mac" or OS=="ios"', {
729 # Mac and iOS want Title Case strings
730 'use_titlecase_in_grd%': 1,
733 # Enable loader extensions on Chrome OS.
735 'image_loader_extension%': 1,
737 'image_loader_extension%': 0,
740 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
741 'enable_one_click_signin%': 1,
742 'enable_pre_sync_backup%': 1,
746 'enable_extensions%': 0,
747 'enable_google_now%': 0,
749 'enable_spellcheck%': 0,
753 'arm_neon_optional%': 1,
754 'native_discardable_memory%': 1,
755 'native_memory_pressure_signals%': 1,
756 'enable_printing%': 2,
757 'enable_task_manager%':0,
758 # Set to 1 once we have a notification system for Android.
759 # http://crbug.com/115320
764 # Android OS includes support for proprietary codecs regardless of
765 # building Chromium or Google Chrome. We also ship Google Chrome and
766 # Chromecast with proprietary codecs.
767 ['OS=="android" or branding=="Chrome" or chromecast==1', {
768 'proprietary_codecs%': 1,
770 'proprietary_codecs%': 0,
773 ['OS=="mac" or OS=="ios"', {
774 'native_discardable_memory%': 1,
775 'native_memory_pressure_signals%': 1,
778 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
779 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
780 'enable_autofill_dialog%': 1,
783 ['buildtype=="Official"', {
784 'enable_prod_wallet_service%': 1,
794 'disable_ftp_support%': 1,
795 'enable_extensions%': 0,
796 'enable_google_now%': 0,
798 'enable_printing%': 0,
799 'enable_session_service%': 0,
805 'enable_managed_users%': 0,
806 'enable_task_manager%': 0,
809 # Use GPU accelerated cross process image transport by default
810 # on linux builds with the Aura window manager
811 ['use_aura==1 and OS=="linux"', {
812 'ui_compositor_image_transport%': 1,
814 'ui_compositor_image_transport%': 0,
817 # Turn precompiled headers on by default.
818 ['OS=="win" and buildtype!="Official"', {
819 'chromium_win_pch%': 1
822 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
823 'enable_plugin_installation%': 0,
825 'enable_plugin_installation%': 1,
828 # Whether PPAPI is enabled.
829 ['OS=="android" or OS=="ios" or embedded==1', {
830 'enable_plugins%': 0,
832 'enable_plugins%': 1,
835 # linux_use_bundled_gold: whether to use the gold linker binary checked
836 # into third_party/binutils. Force this off via GYP_DEFINES when you
837 # are using a custom toolchain and need to control -B in ldflags.
838 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
839 # for component=static_library builds.
840 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
841 'linux_use_bundled_gold%': 1,
843 'linux_use_bundled_gold%': 0,
846 # linux_use_bundled_binutils: whether to use the binary binutils
847 # checked into third_party/binutils. These are not multi-arch so cannot
848 # be used except on x86 and x86-64 (the only two architectures which
849 # are currently checke in). Force this off via GYP_DEFINES when you
850 # are using a custom toolchain and need to control -B in cflags.
851 ['OS=="linux" and (target_arch=="x64")', {
852 'linux_use_bundled_binutils%': 1,
854 'linux_use_bundled_binutils%': 0,
857 # linux_use_gold_flags: whether to use build flags that rely on gold.
858 # On by default for x64 Linux.
859 ['OS=="linux" and target_arch=="x64"', {
860 'linux_use_gold_flags%': 1,
862 'linux_use_gold_flags%': 0,
865 # linux_use_debug_fission: whether to use split DWARF debug info
866 # files. This can reduce link time significantly, but is incompatible
867 # with some utilities such as icecc and ccache. Requires gold and
868 # gcc >= 4.8 or clang.
869 # http://gcc.gnu.org/wiki/DebugFission
870 ['OS=="linux" and target_arch=="x64"', {
871 'linux_use_debug_fission%': 1,
873 'linux_use_debug_fission%': 0,
876 ['OS=="android" or OS=="ios"', {
877 'enable_captive_portal_detection%': 0,
879 'enable_captive_portal_detection%': 1,
882 # Enable Skia UI text drawing incrementally on different platforms.
883 # http://crbug.com/105550
885 # On Aura, this allows per-tile painting to be used in the browser
888 'use_canvas_skia%': 1,
892 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
893 'use_libjpeg_turbo%': 0,
896 # Do not enable the Settings App on ChromeOS.
897 ['enable_app_list==1 and chromeos==0', {
898 'enable_settings_app%': 1,
900 'enable_settings_app%': 0,
903 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
904 # Set some defaults for arm/linux chrome builds
905 'use_allocator%': 'none',
906 # sysroot needs to be an absolute path otherwise it generates
907 # incorrect results when passed to pkg-config
908 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot',
909 }], # OS=="linux" and target_arch=="arm" and chromeos==0
911 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
913 ['target_arch=="x64"', {
914 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
916 ['target_arch=="ia32"', {
917 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
920 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
922 ['OS=="linux" and target_arch=="mipsel"', {
923 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
924 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
927 # Whether tests targets should be run, archived or just have the
928 # dependencies verified. All the tests targets have the '_run' suffix,
929 # e.g. base_unittests_run runs the target base_unittests. The test
930 # target always calls tools/swarming_client/isolate.py. See the script's
931 # --help for more information and the valid --mode values. Meant to be
932 # overriden with GYP_DEFINES.
933 # TODO(maruel): Remove the conditions as more configurations are
935 # NOTE: The check for disable_nacl==0 and component=="static_library"
936 # can't be used here because these variables are not defined yet, but it
937 # is still not supported.
938 ['OS!="ios" and OS!="android" and chromeos==0', {
939 'test_isolation_mode%': 'check',
941 'test_isolation_mode%': 'noop',
943 # Whether Android build uses OpenMAX DL FFT.
944 ['OS=="android" and ((target_arch=="arm" and arm_version >= 7) or target_arch=="ia32" or target_arch=="x64" or target_arch=="arm64" or target_arch=="mipsel")', {
945 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
946 # When enabled, this will also enable WebAudio support on
947 # Android for these architectures. Default is enabled. Whether
948 # WebAudio is actually available depends on runtime settings
950 'use_openmax_dl_fft%': 1,
952 'use_openmax_dl_fft%': 0,
954 ['OS=="win" or OS=="linux"', {
958 # Turns on compiler optimizations in V8 in Debug build, except
959 # on android_clang, where we're hitting a weird linker error.
960 # TODO(dpranke): http://crbug.com/266155 .
962 'v8_optimized_debug%': 1,
964 'v8_optimized_debug%': 2,
967 # Disable various features by default on embedded.
970 'enable_printing%': 0,
973 # By default, use ICU data file (icudtl.dat) on all platforms
974 # except when building Android WebView or Chromecast.
975 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
976 # Set the data reduction proxy origin for Android Webview.
977 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0', {
978 'icu_use_data_file_flag%' : 1,
979 'spdy_proxy_auth_origin%': '',
980 'data_reduction_proxy_probe_url%': '',
981 'data_reduction_proxy_warmup_url%': '',
982 'data_reduction_dev_host%': '',
983 'data_reduction_dev_fallback_host%': '',
984 'data_reduction_fallback_host%': '',
986 'icu_use_data_file_flag%' : 0,
987 'spdy_proxy_auth_origin%': 'https://proxy.googlezip.net:443/',
988 'data_reduction_proxy_probe_url%': 'http://check.googlezip.net/connect',
989 'data_reduction_proxy_warmup_url%': 'http://www.gstatic.com/generate_204',
990 'data_reduction_dev_host%': 'https://proxy-dev.googlezip.net:443/',
991 'data_reduction_dev_fallback_host%': 'http://proxy-dev.googlezip.net:80/',
992 'data_reduction_fallback_host%': 'http://compress.googlezip.net:80/',
994 ['OS=="win" or OS=="mac"', {
995 'enable_wifi_bootstrapping%' : 1,
998 # Path to sas.dll, which provides the SendSAS function.
999 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1000 ['target_arch=="x64"', {
1001 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1003 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1006 # Turn on JNI generation optimizations on non-WebView builds.
1007 ['OS=="android" and android_webview_build==0', {
1008 'optimize_jni_generation%': 1,
1010 'optimize_jni_generation%': 0,
1014 # Set this to 1 to enable use of concatenated impulse responses
1015 # for the HRTF panner in WebAudio.
1016 'use_concatenated_impulse_responses': 1,
1018 # You can set the variable 'use_official_google_api_keys' to 1
1019 # to use the Google-internal file containing official API keys
1020 # for Google Chrome even in a developer build. Setting this
1021 # variable explicitly to 1 will cause your build to fail if the
1022 # internal file is missing.
1024 # The variable is documented here, but not handled in this file;
1025 # see //google_apis/determine_use_official_keys.gypi for the
1028 # Set the variable to 0 to not use the internal file, even when
1029 # it exists in your checkout.
1031 # Leave it unset in your include.gypi to have the variable
1032 # implicitly set to 1 if you have
1033 # src/google_apis/internal/google_chrome_api_keys.h in your
1034 # checkout, and implicitly set to 0 if not.
1036 # Note that official builds always behave as if the variable
1037 # was explicitly set to 1, i.e. they always use official keys,
1038 # and will fail to build if the internal file is missing.
1040 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1041 # include.gypi or by other means. Due to subtleties of GYP, this
1042 # is not the same as leaving the variable unset, even though its
1044 # //google_apis/determine_use_official_keys.gypi is 2.
1046 # Set these to bake the specified API keys and OAuth client
1047 # IDs/secrets into your build.
1049 # If you create a build without values baked in, you can instead
1050 # set environment variables to provide the keys at runtime (see
1051 # src/google_apis/google_api_keys.h for details). Features that
1052 # require server-side APIs may fail to work if no keys are
1055 # Note that if you are building an official build or if
1056 # use_official_google_api_keys has been set to 1 (explicitly or
1057 # implicitly), these values will be ignored and the official
1058 # keys will be used instead.
1059 'google_api_key%': '',
1060 'google_default_client_id%': '',
1061 'google_default_client_secret%': '',
1062 # Native Client is enabled by default.
1063 'disable_nacl%': '0',
1066 # Copy conditionally-set variables out one scope.
1067 'branding%': '<(branding)',
1068 'buildtype%': '<(buildtype)',
1069 'target_arch%': '<(target_arch)',
1070 'target_subarch%': '<(target_subarch)',
1071 'mips_arch_variant%': '<(mips_arch_variant)',
1072 'host_arch%': '<(host_arch)',
1073 'toolkit_views%': '<(toolkit_views)',
1074 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1075 'use_aura%': '<(use_aura)',
1076 'use_ash%': '<(use_ash)',
1077 'use_cras%': '<(use_cras)',
1078 'use_openssl%': '<(use_openssl)',
1079 'use_openssl_certs%': '<(use_openssl_certs)',
1080 'use_nss%': '<(use_nss)',
1081 'use_udev%': '<(use_udev)',
1082 'os_bsd%': '<(os_bsd)',
1083 'os_posix%': '<(os_posix)',
1084 'use_dbus%': '<(use_dbus)',
1085 'use_glib%': '<(use_glib)',
1086 'use_pango%': '<(use_pango)',
1087 'use_cairo%': '<(use_cairo)',
1088 'use_ozone%': '<(use_ozone)',
1089 'use_ozone_evdev%': '<(use_ozone_evdev)',
1090 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1091 'desktop_linux%': '<(desktop_linux)',
1092 'use_x11%': '<(use_x11)',
1093 'use_gnome_keyring%': '<(use_gnome_keyring)',
1094 'linux_fpic%': '<(linux_fpic)',
1095 'chromeos%': '<(chromeos)',
1096 'chromecast%': '<(chromecast)',
1097 'enable_viewport%': '<(enable_viewport)',
1098 'enable_hidpi%': '<(enable_hidpi)',
1099 'use_xi2_mt%':'<(use_xi2_mt)',
1100 'image_loader_extension%': '<(image_loader_extension)',
1101 'fastbuild%': '<(fastbuild)',
1102 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1103 'win_z7%': '<(win_z7)',
1104 'dcheck_always_on%': '<(dcheck_always_on)',
1105 'tracing_like_official_build%': '<(tracing_like_official_build)',
1106 'arm_version%': '<(arm_version)',
1107 'arm_neon%': '<(arm_neon)',
1108 'arm_neon_optional%': '<(arm_neon_optional)',
1109 'sysroot%': '<(sysroot)',
1110 'chroot_cmd%': '<(chroot_cmd)',
1111 'system_libdir%': '<(system_libdir)',
1112 'component%': '<(component)',
1113 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1114 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1115 'use_third_party_translations%': '<(use_third_party_translations)',
1116 'remoting%': '<(remoting)',
1117 'enable_one_click_signin%': '<(enable_one_click_signin)',
1118 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1119 'enable_webrtc%': '<(enable_webrtc)',
1120 'chromium_win_pch%': '<(chromium_win_pch)',
1121 'configuration_policy%': '<(configuration_policy)',
1122 'safe_browsing%': '<(safe_browsing)',
1123 'enable_web_speech%': '<(enable_web_speech)',
1124 'notifications%': '<(notifications)',
1125 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1126 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1128 'asan_coverage%': '<(asan_coverage)',
1129 'use_sanitizer_options%': '<(use_sanitizer_options)',
1130 'syzyasan%': '<(syzyasan)',
1131 'syzygy_optimize%': '<(syzygy_optimize)',
1134 'msan_blacklist%': '<(msan_blacklist)',
1135 'msan_track_origins%': '<(msan_track_origins)',
1137 'tsan_blacklist%': '<(tsan_blacklist)',
1138 'ubsan%': '<(ubsan)',
1139 'ubsan_vptr%': '<(ubsan_vptr)',
1140 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1141 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1142 'use_custom_libcxx%': '<(use_custom_libcxx)',
1143 'use_system_libcxx%': '<(use_system_libcxx)',
1144 'clang_type_profiler%': '<(clang_type_profiler)',
1145 'order_profiling%': '<(order_profiling)',
1146 'order_text_section%': '<(order_text_section)',
1147 'enable_extensions%': '<(enable_extensions)',
1148 'enable_plugin_installation%': '<(enable_plugin_installation)',
1149 'enable_plugins%': '<(enable_plugins)',
1150 'enable_session_service%': '<(enable_session_service)',
1151 'enable_themes%': '<(enable_themes)',
1152 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1153 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1154 'enable_background%': '<(enable_background)',
1155 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1156 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1157 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1158 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1159 'use_canvas_skia%': '<(use_canvas_skia)',
1160 'test_isolation_mode%': '<(test_isolation_mode)',
1161 'test_isolation_outdir%': '<(test_isolation_outdir)',
1162 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1163 'enable_printing%': '<(enable_printing)',
1164 'enable_spellcheck%': '<(enable_spellcheck)',
1165 'enable_google_now%': '<(enable_google_now)',
1166 'cld_version%': '<(cld_version)',
1167 'cld2_table_size%': '<(cld2_table_size)',
1168 'cld2_data_source%': '<(cld2_data_source)',
1169 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1170 'disable_file_support%': '<(disable_file_support)',
1171 'disable_ftp_support%': '<(disable_ftp_support)',
1172 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1173 'enable_task_manager%': '<(enable_task_manager)',
1174 'sas_dll_path%': '<(sas_dll_path)',
1175 'wix_path%': '<(wix_path)',
1176 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1177 'use_system_libjpeg%': '<(use_system_libjpeg)',
1178 'android_webview_build%': '<(android_webview_build)',
1179 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
1180 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1181 'gyp_managed_install%': 0,
1182 'create_standalone_apk%': 1,
1183 'enable_app_list%': '<(enable_app_list)',
1184 'use_default_render_theme%': '<(use_default_render_theme)',
1185 'enable_settings_app%': '<(enable_settings_app)',
1186 'google_api_key%': '<(google_api_key)',
1187 'google_default_client_id%': '<(google_default_client_id)',
1188 'google_default_client_secret%': '<(google_default_client_secret)',
1189 'enable_managed_users%': '<(enable_managed_users)',
1190 'native_discardable_memory%': '<(native_discardable_memory)',
1191 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1192 'data_reduction_fallback_host%': '<(data_reduction_fallback_host)',
1193 'data_reduction_dev_host%': '<(data_reduction_dev_host)',
1194 'data_reduction_dev_fallback_host%': '<(data_reduction_dev_fallback_host)',
1195 'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)',
1196 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1197 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1198 'data_reduction_proxy_probe_url%': '<(data_reduction_proxy_probe_url)',
1199 'data_reduction_proxy_warmup_url%': '<(data_reduction_proxy_warmup_url)',
1200 'data_reduction_proxy_ssl_origin%' : '<(data_reduction_proxy_ssl_origin)',
1201 'data_reduction_proxy_alt_origin%' : '<(data_reduction_proxy_alt_origin)',
1202 'data_reduction_proxy_alt_fallback_origin%' : '<(data_reduction_proxy_alt_fallback_origin)',
1203 'enable_mdns%' : '<(enable_mdns)',
1204 'enable_service_discovery%' : '<(enable_service_discovery)',
1205 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1206 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1207 'v8_optimized_debug%': '<(v8_optimized_debug)',
1208 'proprietary_codecs%': '<(proprietary_codecs)',
1209 'use_goma%': '<(use_goma)',
1210 'gomadir%': '<(gomadir)',
1211 'video_hole%': '<(video_hole)',
1212 'enable_load_completion_hacks%': '<(enable_load_completion_hacks)',
1214 # Whether or not we are building the Athena shell.
1217 # Use system protobuf instead of bundled one.
1218 'use_system_protobuf%': 0,
1220 # Use system yasm instead of bundled one.
1221 'use_system_yasm%': 0,
1223 # Use system ICU instead of bundled one.
1224 'use_system_icu%' : 0,
1226 # Default to enabled PIE; this is important for ASLR but we may need to be
1227 # able to turn it off for various reasons.
1228 'linux_disable_pie%': 0,
1230 # The release channel that this build targets. This is used to restrict
1231 # channel-specific build options, like which installer packages to create.
1232 # The default is 'all', which does no channel-specific filtering.
1235 # Override chromium_mac_pch and set it to 0 to suppress the use of
1236 # precompiled headers on the Mac. Prefix header injection may still be
1237 # used, but prefix headers will not be precompiled. This is useful when
1238 # using distcc to distribute a build to compile slaves that don't
1239 # share the same compiler executable as the system driving the compilation,
1240 # because precompiled headers rely on pointers into a specific compiler
1241 # executable's image. Setting this to 0 is needed to use an experimental
1242 # Linux-Mac cross compiler distcc farm.
1243 'chromium_mac_pch%': 1,
1245 # The default value for mac_strip in target_defaults. This cannot be
1246 # set there, per the comment about variable% in a target_defaults.
1247 'mac_strip_release%': 0,
1249 # Set to 1 to enable java code coverage. Instruments classes during build
1250 # to produce .ec files during runtime.
1251 'emma_coverage%': 0,
1253 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1254 # separated with whitespace and/or comma. Only has effect if
1255 # 'emma_coverage=1'.
1258 # Set to 1 to enable running Android lint on java/class files.
1261 # Although base/allocator lets you select a heap library via an
1262 # environment variable, the libcmt shim it uses sometimes gets in
1263 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1264 # 'win_use_allocator_shim': 0,
1265 # 'win_release_RuntimeLibrary': 2
1266 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1267 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1269 # TODO(bradnelson): eliminate this when possible.
1270 # To allow local gyp files to prevent release.vsprops from being included.
1271 # Yes(1) means include release.vsprops.
1272 # Once all vsprops settings are migrated into gyp, this can go away.
1273 'msvs_use_common_release%': 1,
1275 # TODO(bradnelson): eliminate this when possible.
1276 # To allow local gyp files to override additional linker options for msvs.
1277 # Yes(1) means set use the common linker options.
1278 'msvs_use_common_linker_extras%': 1,
1280 # TODO(sgk): eliminate this if possible.
1281 # It would be nicer to support this via a setting in 'target_defaults'
1282 # in chrome/app/locales/locales.gypi overriding the setting in the
1283 # 'Debug' configuration in the 'target_defaults' dict below,
1284 # but that doesn't work as we'd like.
1285 'msvs_debug_link_incremental%': '2',
1287 # Needed for some of the largest modules.
1288 'msvs_debug_link_nonincremental%': '1',
1290 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1291 # to get incremental linking to be faster in debug builds.
1292 'incremental_chrome_dll%': '0',
1294 # Experimental setting to break chrome.dll into multiple pieces based on
1296 'chrome_multiple_dll%': '0',
1298 # Experimental setting to optimize Chrome's DLLs with PGO.
1299 'chrome_pgo_phase%': '0',
1302 'clang%': '<(clang)',
1303 'host_clang%': '<(host_clang)',
1304 'make_clang_dir%': '<(make_clang_dir)',
1306 # Control which version of clang to use when building for iOS. If set to
1307 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1308 # the version of clang that ships with the Chromium source. This variable
1309 # is automatically set to '1' when using the Xcode generator.
1312 # These two variables can be set in GYP_DEFINES while running
1313 # |gclient runhooks| to let clang run a plugin in every compilation.
1314 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1316 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1319 'clang_add_plugin%': '',
1321 # Tell ld64 to write map files describing binary layout. Useful
1322 # for looking at what contributes to binary size, e.g. with
1323 # https://github.com/nico/bloat
1324 'mac_write_linker_maps%': 0,
1326 # The default type of gtest.
1327 'gtest_target_type%': 'executable',
1329 # Enable sampling based profiler.
1330 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1332 # Profile without optimizing out stack frames when profiling==1.
1333 'profiling_full_stack_frames%': '0',
1335 # And if we want to dump symbols for Breakpad-enabled builds.
1336 'linux_dump_symbols%': 0,
1337 # And if we want to strip the binary after dumping symbols.
1338 'linux_strip_binary%': 0,
1339 # If we want stack unwind support for backtrace().
1340 'debug_unwind_tables%': 1,
1341 'release_unwind_tables%': 1,
1343 # Override where to find binutils
1344 'binutils_version%': 0,
1345 'binutils_dir%': '',
1348 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1349 'use_allocator%': 'tcmalloc',
1351 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1352 'linux_link_gnome_keyring%': 0,
1353 # Set to 1 to link against gsettings APIs instead of using dlopen().
1354 'linux_link_gsettings%': 0,
1356 # Enable use of OpenMAX DL FFT routines.
1357 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1359 # Enable new NPDevice API.
1360 'enable_new_npdevice_api%': 0,
1362 # Enable EGLImage support in OpenMAX
1363 'enable_eglimage%': 1,
1365 # .gyp files or targets should set chromium_code to 1 if they build
1366 # Chromium-specific code, as opposed to external code. This variable is
1367 # used to control such things as the set of warnings to enable, and
1368 # whether warnings are treated as errors.
1369 'chromium_code%': 0,
1371 # Disable fatal linker warnings, similarly to how we make it possible
1372 # to disable -Werror (e.g. for different toolchain versions).
1373 'disable_fatal_linker_warnings%': 0,
1375 'release_valgrind_build%': 0,
1377 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1378 'enable_wexit_time_destructors%': 0,
1380 # Build libpeerconnection as a static library by default.
1381 'libpeer_target_type%': 'static_library',
1383 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1384 'internal_gles2_conform_tests%': 0,
1386 # Set to 1 to compile the filter fuzzer.
1387 'internal_filter_fuzzer%': 0,
1389 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1390 # so Cocoa is happy (http://crbug.com/20441).
1392 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1393 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1394 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1395 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1396 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1397 'vi', 'zh-CN', 'zh-TW',
1400 # Pseudo locales are special locales which are used for testing and
1401 # debugging. They don't get copied to the final app. For more info,
1402 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1409 # If debug_devtools is set to 1, JavaScript files for DevTools are
1410 # stored as is and loaded from disk. Otherwise, a concatenated file
1411 # is stored in resources.pak. It is still possible to load JS files
1412 # from disk by passing --debug-devtools cmdline switch.
1413 'debug_devtools%': 0,
1415 # The Java Bridge is not compiled in by default.
1418 # Code signing for iOS binaries. The bots need to be able to disable this.
1419 'chromium_ios_signing%': 1,
1421 # This flag is only used when disable_nacl==0 and disables all those
1422 # subcomponents which would require the installation of a native_client
1423 # untrusted toolchain.
1424 'disable_nacl_untrusted%': 0,
1426 # Disable Dart by default.
1429 # Copy out the setting of disable_nacl.
1430 'disable_nacl%': '<(disable_nacl)',
1432 # Portable Native Client is enabled by default.
1433 'disable_pnacl%': 0,
1435 # Whether to build full debug version for Debug configuration on Android.
1436 # Compared to full debug version, the default Debug configuration on Android
1437 # has no full v8 debug, has size optimization and linker gc section, so that
1438 # we can build a debug version with acceptable size and performance.
1439 'android_full_debug%': 0,
1441 # Sets the default version name and code for Android app, by default we
1442 # do a developer build.
1443 'android_app_version_name%': 'Developer Build',
1444 'android_app_version_code%': 0,
1446 # Contains data about the attached devices for gyp_managed_install.
1447 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1449 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1450 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1452 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1453 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1455 # Whether we are using the rlz library or not. Platforms like Android send
1456 # rlz codes for searches but do not use the library.
1459 # Turns on the i18n support in V8.
1460 'v8_enable_i18n_support': 1,
1462 # Compile d8 for the host toolset.
1463 'v8_toolset_for_d8': 'host',
1465 # Use the chromium skia by default.
1466 'use_system_skia%': '0',
1468 # Use brlapi from brltty for braille display support.
1471 # Relative path to icu.gyp from this file.
1472 'icu_gyp_path': '../third_party/icu/icu.gyp',
1474 # IPC fuzzer is disabled by default.
1475 'enable_ipc_fuzzer%': 0,
1478 # Force disable libstdc++ debug mode.
1479 'disable_glibcxx_debug%': 0,
1481 # Set to 1 to compile with MSE support for MPEG2 TS
1482 'enable_mpeg2ts_stream_parser%': 0,
1484 # Support ChromeOS touchpad gestures with ozone.
1485 'use_evdev_gestures%': 0,
1487 # Default ozone platform (if no --ozone-platform flag).
1488 'ozone_platform%': "",
1490 # Ozone platforms to include in the build.
1491 'ozone_platform_caca%': 0,
1492 'ozone_platform_dri%': 0,
1493 'ozone_platform_egltest%': 0,
1494 'ozone_platform_gbm%': 0,
1495 'ozone_platform_ozonex%': 0,
1496 'ozone_platform_test%': 0,
1498 # Chrome OS: whether to build ChromeVox from sources in the Chromium
1499 # repository rather than using precompiled JavaScript in
1500 # chrome/third_party/chromevox. This is still experimental.
1501 'use_migrated_chromevox%': 1,
1503 # Chrome OS: whether to also build the upcoming version of
1504 # ChromeVox, which can then be enabled via a command-line switch.
1505 'use_chromevox_next%': 0,
1508 # The version of clang shipped upstream does not find C++ headers when
1509 # using -stdlib=libc++ so we instead need to use the version of clang
1510 # coming with Xcode.
1511 ['OS=="ios" and use_system_libcxx==1', {
1514 # Enable the Syzygy optimization step for the official builds.
1515 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1516 'syzygy_optimize%': 1,
1518 'syzygy_optimize%': 0,
1520 # Get binutils version so we can enable debug fission if we can.
1521 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1523 # compiler_version doesn't work with clang
1524 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1525 # compiler_version works with clang.
1526 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1527 # that it takes effect here.
1528 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1529 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1531 # On Android we know the binutils version in the toolchain.
1533 'binutils_version%': 222,
1535 ['host_arch=="x64"', {
1536 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1538 ['host_arch=="ia32"', {
1539 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1541 # Our version of binutils in third_party/binutils
1542 ['linux_use_bundled_binutils==1', {
1543 'binutils_version%': 224,
1547 'binutils_version%': 0,
1549 # The version of GCC in use, set later in platforms that use GCC and have
1550 # not explicitly chosen to build with clang. Currently, this means all
1551 # platforms except Windows, Mac and iOS.
1552 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1553 # it takes effect here.
1554 ['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', {
1556 ['OS=="android" and android_webview_build==0', {
1557 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1558 # We directly set the gcc version since we know what we use.
1561 ['OS=="android" and android_webview_build==1', {
1562 # Android WebView uses a hermetic clang toolchain for host builds.
1563 'host_gcc_version%': 0,
1564 # Android WebView uses the GCC toolchain from the Android build.
1568 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1569 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1573 'host_gcc_version%': 0,
1576 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1577 'windows_sdk_path%': '<(windows_sdk_default_path)',
1579 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
1581 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1582 'directx_sdk_path%': '<(directx_sdk_default_path)',
1584 'directx_sdk_path%': '$(DXSDK_DIR)',
1587 'windows_driver_kit_path%': '$(WDK_DIR)',
1589 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1591 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1594 'nacl_untrusted_build%': 0,
1595 'use_allocator%': 'none',
1597 ['OS=="linux" and target_arch=="mipsel"', {
1598 'sysroot%': '<(sysroot)',
1601 # All Chrome builds have breakpad symbols, but only process the
1602 # symbols from official builds.
1603 ['(branding=="Chrome" and buildtype=="Official")', {
1604 'linux_dump_symbols%': 1,
1606 # Omit unwind support in official release builds to save space. We
1607 # can use breakpad for these builds.
1608 'release_unwind_tables%': 0,
1611 # For official builds, use a 64-bit linker to avoid running out
1612 # of address space. The buildbots should have a 64-bit kernel
1613 # and a 64-bit libc installed.
1614 ['host_arch=="ia32" and target_arch=="ia32"', {
1615 'linux_use_bundled_gold%': '1',
1616 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1621 }], # os_posix==1 and OS!="mac" and OS!="ios"
1624 'enable_background%': 0,
1625 'icu_use_data_file_flag%': 1,
1626 'enable_web_speech%': 0,
1627 'use_system_libxml%': 1,
1628 'use_system_sqlite%': 1,
1630 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1631 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1632 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1633 'uk', 'vi', 'zh-CN', 'zh-TW',
1636 # The Mac SDK is set for iOS builds and passed through to Mac
1637 # sub-builds. This allows the Mac sub-build SDK in an iOS build to be
1638 # overridden from the command line the same way it is for a Mac build.
1639 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py 10.6)',
1641 # iOS SDK and deployment target support. The |ios_sdk| value is left
1642 # blank so that when it is set in the project files it will be the
1643 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1644 # causes Xcode to spit out a warning for every single project file for
1645 # not using the "current" SDK.
1647 'ios_sdk_path%': '',
1648 'ios_deployment_target%': '7.0',
1651 # ios_product_name is set to the name of the .app bundle as it should
1653 ['branding=="Chrome"', {
1654 'ios_product_name%': 'Chrome',
1655 }, { # else: branding!="Chrome"
1656 'ios_product_name%': 'Chromium',
1658 ['branding=="Chrome" and buildtype=="Official"', {
1660 }, { # else: branding!="Chrome" or buildtype!="Official"
1666 # Location of Android NDK.
1669 # Unfortunately we have to use absolute paths to the SDK/NDK because
1670 # they're passed to ant which uses a different relative path from
1672 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1673 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1674 'android_host_arch%': '<!(uname -m)',
1675 # Android API-level of the SDK used for compilation.
1676 'android_sdk_version%': '20',
1677 'android_sdk_build_tools_version%': '20.0.0',
1678 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1680 # Copy conditionally-set variables out one scope.
1681 'android_ndk_root%': '<(android_ndk_root)',
1682 'android_sdk_root%': '<(android_sdk_root)',
1683 'android_sdk_version%': '<(android_sdk_version)',
1684 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1685 'host_os%': '<(host_os)',
1687 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1688 # Android SDK build tools (e.g. dx, aapt, aidl)
1689 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1691 # Android API level 14 is ICS (Android 4.0) which is the minimum
1692 # platform requirement for Chrome on Android, we use it for native
1695 ['target_arch == "ia32"', {
1696 'android_app_abi%': 'x86',
1697 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1698 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1699 'android_ndk_lib_dir%': 'usr/lib',
1700 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1702 ['target_arch == "x64"', {
1703 'android_app_abi%': 'x86_64',
1704 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1705 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-x86_64',
1706 'android_ndk_lib_dir%': 'usr/lib64',
1707 'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1709 ['target_arch=="arm"', {
1712 'android_app_abi%': 'armeabi',
1714 'android_app_abi%': 'armeabi-v7a',
1717 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1718 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1719 'android_ndk_lib_dir%': 'usr/lib',
1720 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1722 ['target_arch == "arm64"', {
1723 'android_app_abi%': 'arm64-v8a',
1724 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1725 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-arm64',
1726 'android_ndk_lib_dir%': 'usr/lib',
1727 'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1729 ['target_arch == "mipsel"', {
1730 'android_app_abi%': 'mips',
1731 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1732 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1733 'android_ndk_lib_dir%': 'usr/lib',
1734 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1736 ['target_arch == "mips64el"', {
1737 'android_app_abi%': 'mips64',
1738 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1739 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-mips64',
1740 'android_ndk_lib_dir%': 'usr/lib64',
1741 'android_toolchain%': '<(android_ndk_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1746 # Copy conditionally-set variables out one scope.
1747 'android_app_abi%': '<(android_app_abi)',
1748 'android_gdbserver%': '<(android_gdbserver)',
1749 'android_ndk_root%': '<(android_ndk_root)',
1750 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1751 'android_sdk_root%': '<(android_sdk_root)',
1752 'android_sdk_version%': '<(android_sdk_version)',
1753 'android_toolchain%': '<(android_toolchain)',
1755 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1756 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1757 'android_sdk_tools%': '<(android_sdk_tools)',
1758 'android_sdk%': '<(android_sdk)',
1759 'android_sdk_jar%': '<(android_sdk)/android.jar',
1761 'android_stlport_root': '<(android_stlport_root)',
1762 'android_stlport_include': '<(android_stlport_root)/stlport',
1763 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1764 'host_os%': '<(host_os)',
1766 # Location of the "objcopy" binary, used by both gyp and scripts.
1767 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1769 # Location of the "strip" binary, used by both gyp and scripts.
1770 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1772 # Location of the "readelf" binary.
1773 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1775 # Determines whether we should optimize JNI generation at the cost of
1776 # breaking assumptions in the build system that when inputs have changed
1777 # the outputs should always change as well. This is meant purely for
1778 # developer builds, to avoid spurious re-linking of native files.
1779 'optimize_jni_generation%': '<(optimize_jni_generation)',
1781 # Always uses openssl.
1783 'use_openssl_certs%': 1,
1785 'proprietary_codecs%': '<(proprietary_codecs)',
1786 'safe_browsing%': 1,
1787 'enable_web_speech%': 0,
1789 'build_ffmpegsumo%': 0,
1790 'use_allocator%': 'none',
1792 # Disable Native Client.
1795 # Android does not support background apps.
1796 'enable_background%': 0,
1798 # Sessions are store separately in the Java side.
1799 'enable_session_service%': 0,
1803 'gtest_target_type%': 'shared_library',
1805 # Uses system APIs for decoding audio and video.
1806 'use_libffmpeg%': '0',
1808 # When building as part of the Android system, use system libraries
1809 # where possible to reduce ROM size.
1810 'use_system_icu%': '<(android_webview_build)',
1811 'use_system_stlport%': '<(android_webview_build)',
1813 # Copy it out one scope.
1814 'android_webview_build%': '<(android_webview_build)',
1816 # Default android linker script for shared library exports.
1817 'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_exports.lst',
1820 'use_system_fontconfig%': 0,
1822 'use_system_fontconfig%': 1,
1825 'enable_mpeg2ts_stream_parser%': 1,
1826 'ffmpeg_branding%': 'Chrome',
1827 'ozone_platform_ozonex%': 1,
1828 'use_playready%': 0,
1830 ['target_arch=="arm"', {
1832 'arm_tune%': 'cortex-a9',
1838 ['android_webview_build==1', {
1839 # When building the WebView in the Android tree, jarjar will remap all
1840 # the class names, so the JNI generator needs to know this.
1841 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1843 ['OS=="linux" and target_arch!="mipsel"', {
1844 # TODO(thakis): This is here to measure perf for a while.
1849 # All Chrome builds have breakpad symbols, but only process the
1850 # symbols from official builds.
1851 ['(branding=="Chrome" and buildtype=="Official")', {
1852 'mac_strip_release%': 1,
1856 ['OS=="mac" or OS=="ios"', {
1860 # Mac OS X SDK and deployment target support. The SDK identifies
1861 # the version of the system headers that will be used, and
1862 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1863 # macro. "Maximum allowed" refers to the operating system version
1864 # whose APIs are available in the headers. The deployment target
1865 # identifies the minimum system version that the built products are
1866 # expected to function on. It corresponds to the
1867 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1868 # macros are available, #include <AvailabilityMacros.h>. Additional
1869 # documentation on these macros is available at
1870 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1871 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1872 # deployment target to 10.6. Other projects, such as O3D, may
1873 # override these defaults.
1875 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1876 # about that is at least the specified version. In official builds,
1877 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1878 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1879 # path to the SDK; when set to a non-empty string, SDK detection
1880 # based on mac_sdk_min will be bypassed entirely.
1881 'mac_sdk_min%': '10.6',
1882 'mac_sdk_path%': '',
1884 'mac_deployment_target%': '10.6',
1887 'mac_sdk_min': '<(mac_sdk_min)',
1888 'mac_sdk_path': '<(mac_sdk_path)',
1889 'mac_deployment_target': '<(mac_deployment_target)',
1891 # Compile in Breakpad support by default so that it can be
1892 # tested, even if it is not enabled by default at runtime.
1893 'mac_breakpad_compiled_in%': 1,
1895 # mac_product_name is set to the name of the .app bundle as it should
1896 # appear on disk. This duplicates data from
1897 # chrome/app/theme/chromium/BRANDING and
1898 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1899 # these names into the build system.
1900 ['branding=="Chrome"', {
1901 'mac_product_name%': 'Google Chrome',
1902 }, { # else: branding!="Chrome"
1903 'mac_product_name%': 'Chromium',
1906 ['branding=="Chrome" and buildtype=="Official"', {
1907 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1908 # Enable uploading crash dumps.
1909 'mac_breakpad_uploads%': 1,
1910 # Enable dumping symbols at build time for use by Mac Breakpad.
1912 # Enable Keystone auto-update support.
1914 }, { # else: branding!="Chrome" or buildtype!="Official"
1915 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1916 'mac_breakpad_uploads%': 0,
1921 }], # OS=="mac" or OS=="ios"
1924 # This is the architecture convention used in WinSDK paths.
1925 ['target_arch=="ia32"', {
1926 'winsdk_arch%': 'x86',
1928 'winsdk_arch%': '<(target_arch)',
1930 ['component=="shared_library"', {
1931 'win_use_allocator_shim%': 0,
1933 # Turn on multiple dll by default on Windows when in static_library.
1934 'chrome_multiple_dll%': 1,
1937 'win_use_allocator_shim%': 0,
1939 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1940 # Only enabled by default for ninja because it's buggy in VS.
1941 # Not enabled for component=static_library because some targets
1942 # are too large and the toolchain fails due to the size of the
1944 'incremental_chrome_dll%': 1,
1946 # Don't do incremental linking for large modules on 32-bit or when
1947 # component=static_library as the toolchain fails due to the size of
1949 ['MSVS_OS_BITS==32 or component=="static_library"', {
1950 'msvs_large_module_debug_link_mode%': '1', # No
1952 'msvs_large_module_debug_link_mode%': '2', # Yes
1954 ['MSVS_VERSION=="2013e"', {
1962 'nacl_win64_defines': [
1963 # This flag is used to minimize dependencies when building
1964 # Native Client loader for 64-bit Windows.
1969 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1975 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1976 'enable_pepper_cdms%': 1,
1978 'enable_pepper_cdms%': 0,
1982 'enable_browser_cdms%': 1,
1984 'enable_browser_cdms%': 0,
1987 # Native Client glibc toolchain is enabled
1988 # by default except on arm, mips and mips64.
1989 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
1990 'disable_glibc%': 1,
1992 'disable_glibc%': 0,
1995 # Set the relative path from this file to the GYP file of the JPEG
1996 # library used by Chromium.
1997 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1998 # Configuration for using the system libjeg is here.
1999 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
2001 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
2004 # Options controlling the use of GConf (the classic GNOME configuration
2005 # system) and GIO, which contains GSettings (the new GNOME config system).
2006 ['chromeos==1 or embedded==1', {
2014 # Set up -D and -E flags passed into grit.
2015 ['branding=="Chrome"', {
2016 # TODO(mmoss) The .grd files look for _google_chrome, but for
2017 # consistency they should look for google_chrome_build like C++.
2018 'grit_defines': ['-D', '_google_chrome',
2019 '-E', 'CHROMIUM_BUILD=google_chrome'],
2021 'grit_defines': ['-D', '_chromium',
2022 '-E', 'CHROMIUM_BUILD=chromium'],
2025 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2027 ['desktop_linux==1', {
2028 'grit_defines': ['-D', 'desktop_linux'],
2030 ['toolkit_views==1', {
2031 'grit_defines': ['-D', 'toolkit_views'],
2034 'grit_defines': ['-D', 'use_aura'],
2037 'grit_defines': ['-D', 'use_ash'],
2040 'grit_defines': ['-D', 'use_nss'],
2043 'grit_defines': ['-D', 'use_ozone'],
2045 ['image_loader_extension==1', {
2046 'grit_defines': ['-D', 'image_loader_extension'],
2049 'grit_defines': ['-D', 'remoting'],
2051 ['use_titlecase_in_grd==1', {
2052 'grit_defines': ['-D', 'use_titlecase'],
2054 ['use_third_party_translations==1', {
2055 'grit_defines': ['-D', 'use_third_party_translations'],
2057 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2058 'ka', 'ku', 'kw', 'ms', 'ug'
2062 'grit_defines': ['-t', 'android',
2063 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true'],
2065 ['OS=="mac" or OS=="ios"', {
2066 'grit_defines': ['-D', 'scale_factors=2x'],
2071 # iOS uses a whitelist to filter resources.
2072 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
2075 # Enable host builds when generating with ninja-ios.
2077 ['"<(GENERATOR)"=="ninja"', {
2081 # TODO(sdefresne): Remove the target_subarch check once Apple has
2082 # upstreamed the support for "arm64". http://crbug.com/341453
2083 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
2088 ['enable_extensions==1', {
2089 'grit_defines': ['-D', 'enable_extensions'],
2091 ['enable_plugins!=0', {
2092 'grit_defines': ['-D', 'enable_plugins'],
2094 ['enable_printing!=0', {
2095 'grit_defines': ['-D', 'enable_printing'],
2097 ['enable_printing==1', {
2098 'grit_defines': ['-D', 'enable_full_printing'],
2100 ['enable_themes==1', {
2101 'grit_defines': ['-D', 'enable_themes'],
2103 ['enable_app_list==1', {
2104 'grit_defines': ['-D', 'enable_app_list'],
2106 ['enable_settings_app==1', {
2107 'grit_defines': ['-D', 'enable_settings_app'],
2109 ['enable_google_now==1', {
2110 'grit_defines': ['-D', 'enable_google_now'],
2112 ['use_concatenated_impulse_responses==1', {
2113 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2115 ['enable_webrtc==1', {
2116 'grit_defines': ['-D', 'enable_webrtc'],
2118 ['enable_hangout_services_extension==1', {
2119 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2121 ['enable_task_manager==1', {
2122 'grit_defines': ['-D', 'enable_task_manager'],
2124 ['notifications==1', {
2125 'grit_defines': ['-D', 'enable_notifications'],
2127 ['enable_wifi_bootstrapping==1', {
2128 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2130 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2131 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2133 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2134 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2136 ['enable_mdns==1 or OS=="mac"', {
2137 'grit_defines': ['-D', 'enable_service_discovery'],
2138 'enable_service_discovery%': 1
2140 ['clang_use_chrome_plugins==1 and OS!="win"', {
2141 'clang_chrome_plugins_flags': [
2142 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
2145 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2147 'use_allocator%': 'none',
2149 ['asan==1 and OS=="linux" and chromeos==0', {
2150 'use_custom_libcxx%': 1,
2158 ['asan==1 and OS=="mac"', {
2159 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
2160 # runtime is fully adopted. See http://crbug.com/242503.
2161 'mac_strip_release': 0,
2164 'use_custom_libcxx%': 1,
2167 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2168 # libstdc++. This is required to avoid false positive reports whenever
2169 # the C++ standard library is used.
2170 'use_custom_libcxx%': 1,
2171 # Running the V8-generated code on an ARM simulator is a powerful hack
2172 # that allows the tool to see the memory accesses from JITted code.
2173 # Without this flag, JS code causes false positive reports from MSan.
2174 'v8_target_arch': 'arm64',
2177 ['OS=="linux" and clang_type_profiler==1', {
2179 'clang_use_chrome_plugins%': 0,
2181 ['host_arch=="x64"', {
2182 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2184 ['host_arch=="ia32"', {
2185 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2186 # Clang in this directory at your own risk if needed for some
2187 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2188 # usage). Any failure by this compiler should not close the tree.
2189 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2195 # The Clang plugins don't currently work on Windows.
2196 # TODO(hans): One day, this will work. (crbug.com/82385)
2197 'clang_use_chrome_plugins%': 0,
2200 # On valgrind bots, override the optimizer settings so we don't inline too
2201 # much and make the stacks harder to figure out.
2203 # TODO(rnk): Kill off variables that no one else uses and just implement
2204 # them under a build_for_tool== condition.
2205 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2207 'mac_debug_optimization': '1',
2208 'mac_release_optimization': '1',
2209 'release_optimize': '1',
2210 'no_gc_sections': 1,
2211 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2212 '-fno-builtin -fno-optimize-sibling-calls',
2213 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2214 '-fno-builtin -fno-optimize-sibling-calls',
2216 # MSVS flags for TSan on Pin and Windows.
2217 'win_debug_RuntimeChecks': '0',
2218 'win_debug_disable_iterator_debugging': '1',
2219 'win_debug_Optimization': '1',
2220 'win_debug_InlineFunctionExpansion': '0',
2221 'win_release_InlineFunctionExpansion': '0',
2222 'win_release_OmitFramePointers': '0',
2224 'use_allocator': 'tcmalloc',
2225 'release_valgrind_build': 1,
2227 'component': 'static_library',
2228 'use_system_zlib': 0,
2231 # Build tweaks for DrMemory.
2232 # TODO(rnk): Combine with tsan config to share the builder.
2233 # http://crbug.com/108155
2234 ['build_for_tool=="drmemory"', {
2235 # These runtime checks force initialization of stack vars which blocks
2236 # DrMemory's uninit detection.
2237 'win_debug_RuntimeChecks': '0',
2238 # Iterator debugging is slow.
2239 'win_debug_disable_iterator_debugging': '1',
2240 # Try to disable optimizations that mess up stacks in a release build.
2241 # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054)
2242 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2243 # compiler bug, so we use /Ob1 instead.
2244 'win_release_InlineFunctionExpansion': '1',
2245 'win_release_OmitFramePointers': '0',
2246 # Ditto for debug, to support bumping win_debug_Optimization.
2247 'win_debug_InlineFunctionExpansion': 0,
2248 'win_debug_OmitFramePointers': 0,
2249 # Keep the code under #ifndef NVALGRIND.
2250 'release_valgrind_build': 1,
2253 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2254 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2258 # Set default compiler flags depending on ARM version.
2259 ['arm_version==6 and android_webview_build==0', {
2260 'arm_arch%': 'armv6',
2263 'arm_float_abi%': 'softfp',
2266 ['arm_version==7 and android_webview_build==0', {
2267 'arm_arch%': 'armv7-a',
2268 'arm_tune%': 'generic-armv7-a',
2273 'arm_fpu%': 'vfpv3-d16',
2276 # Change the default to hard once the armhf transition is complete.
2277 'arm_float_abi%': 'softfp',
2281 ['android_webview_build==1', {
2282 # The WebView build gets its cpu-specific flags from the Android build system.
2286 'arm_float_abi%': '',
2290 # Enable brlapi by default for chromeos.
2295 ['use_ozone==1 and ozone_auto_platforms==1', {
2296 # Use test as the default platform.
2297 'ozone_platform%': 'test',
2299 # Build all platforms whose deps are in install-build-deps.sh.
2300 # Only these platforms will be compile tested by buildbots.
2301 'ozone_platform_dri%': 1,
2302 'ozone_platform_test%': 1,
2303 'ozone_platform_egltest%': 1,
2306 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2307 'use_clipboard_aurax11%': 1,
2310 ['OS=="win" and use_goma==1', {
2311 # goma doesn't support pch yet.
2312 'chromium_win_pch': 0,
2313 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2315 ['win_z7==0 and fastbuild==0', {
2321 ['OS=="win" and (clang==1 or asan==1)', {
2322 'chromium_win_pch': 0,
2326 'host_cc': '<(make_clang_dir)/bin/clang',
2327 'host_cxx': '<(make_clang_dir)/bin/clang++',
2329 'host_cc': '<!(which gcc)',
2330 'host_cxx': '<!(which g++)',
2333 # The seccomp-bpf sandbox is only supported on five architectures
2335 # Do not disable seccomp_bpf anywhere without talking to
2336 # security@chromium.org!
2337 ['((OS=="linux" or OS=="android") and '
2338 '(target_arch=="ia32" or target_arch=="x64" or '
2339 'target_arch=="arm" or target_arch=="mipsel" or '
2340 'target_arch=="arm64"))', {
2341 'use_seccomp_bpf%': 1,
2343 'use_seccomp_bpf%': 0,
2347 # The path to the ANGLE library.
2348 'angle_path': '<(DEPTH)/third_party/angle',
2350 # List of default apps to install in new profiles. The first list contains
2351 # the source files as found in svn. The second list, used only for linux,
2352 # contains the destination location for each of the files. When a crx
2353 # is added or removed from the list, the chrome/browser/resources/
2354 # default_apps/external_extensions.json file must also be updated.
2355 'default_apps_list': [
2356 'browser/resources/default_apps/external_extensions.json',
2357 'browser/resources/default_apps/gmail.crx',
2358 'browser/resources/default_apps/search.crx',
2359 'browser/resources/default_apps/youtube.crx',
2360 'browser/resources/default_apps/drive.crx',
2361 'browser/resources/default_apps/docs.crx',
2363 'default_apps_list_linux_dest': [
2364 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2365 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2366 '<(PRODUCT_DIR)/default_apps/search.crx',
2367 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2368 '<(PRODUCT_DIR)/default_apps/drive.crx',
2369 '<(PRODUCT_DIR)/default_apps/docs.crx',
2372 # Whether to allow building of the GPU-related isolates.
2373 'archive_gpu_tests%': 0,
2375 'target_defaults': {
2377 # The condition that operates on chromium_code is in a target_conditions
2378 # section, and will not have access to the default fallback value of
2379 # chromium_code at the top of this file, or to the chromium_code
2380 # variable placed at the root variables scope of .gyp files, because
2381 # those variables are not set at target scope. As a workaround,
2382 # if chromium_code is not set at target scope, define it in target scope
2383 # to contain whatever value it has during early variable expansion.
2384 # That's enough to make it available during target conditional
2386 'chromium_code%': '<(chromium_code)',
2388 'component%': '<(component)',
2390 'chromecast%': '<(chromecast)',
2392 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2393 'win_release_Optimization%': '2', # 2 = /Os
2394 'win_debug_Optimization%': '0', # 0 = /Od
2396 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2397 # Tri-state: blank is default, 1 on, 0 off
2398 'win_release_OmitFramePointers%': '0',
2399 # Tri-state: blank is default, 1 on, 0 off
2400 'win_debug_OmitFramePointers%': '',
2402 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2403 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2405 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2406 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2407 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2409 # VS inserts quite a lot of extra checks to algorithms like
2410 # std::partial_sort in Debug build which make them O(N^2)
2411 # instead of O(N*logN). This is particularly slow under memory
2412 # tools like ThreadSanitizer so we want it to be disablable.
2413 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2414 'win_debug_disable_iterator_debugging%': '0',
2416 # An application manifest fragment to declare compatibility settings for
2417 # 'executable' targets. Ignored in other target type.
2418 'win_exe_compatibility_manifest%':
2419 '<(DEPTH)\\build\\win\\compatibility.manifest',
2421 'release_extra_cflags%': '',
2422 'debug_extra_cflags%': '',
2424 'release_valgrind_build%': '<(release_valgrind_build)',
2426 # the non-qualified versions are widely assumed to be *nix-only
2427 'win_release_extra_cflags%': '',
2428 'win_debug_extra_cflags%': '',
2430 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2431 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2433 # Only used by Windows build for now. Can be used to build into a
2434 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2435 # output files in src/build/VS2010_{Debug,Release}.
2436 'build_dir_prefix%': '',
2438 # Targets are by default not nacl untrusted code.
2439 'nacl_untrusted_build%': 0,
2441 'pnacl_compile_flags': [
2442 # pnacl uses the clang compiler so we need to suppress all the
2443 # same warnings as we do for clang.
2444 # TODO(sbc): Remove these if/when they are removed from the clang
2446 '-Wno-unused-function',
2447 '-Wno-char-subscripts',
2448 '-Wno-c++11-extensions',
2449 '-Wno-unnamed-type-template-args',
2453 ['OS=="win" and component=="shared_library"', {
2454 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2455 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2456 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2458 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2459 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2460 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2463 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2464 'mac_release_optimization%': 's', # Use -Os unless overridden
2465 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2467 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2468 'mac_release_optimization%': '3', # Use -O3 unless overridden
2469 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2472 'host_os%': '<(host_os)', # See comment above chromium_code.
2475 'clang_warning_flags': [
2478 # Don't die on dtoa code that uses a char as an array index.
2479 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2480 '-Wno-char-subscripts',
2482 # TODO(thakis): This used to be implied by -Wno-unused-function,
2483 # which we no longer use. Check if it makes sense to remove
2484 # this as well. http://crbug.com/316352
2485 '-Wno-unneeded-internal-declaration',
2487 # Warns on switches on enums that cover all enum values but
2488 # also contain a default: branch. Chrome is full of that.
2489 '-Wno-covered-switch-default',
2491 # Warns when a const char[] is converted to bool.
2492 '-Wstring-conversion',
2494 # C++11-related flags:
2496 # This warns on using ints as initializers for floats in
2497 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2498 # which happens in several places in chrome code. Not sure if
2499 # this is worth fixing.
2500 '-Wno-c++11-narrowing',
2502 # Clang considers the `register` keyword as deprecated, but e.g.
2503 # code generated by flex (used in angle) contains that keyword.
2504 # http://crbug.com/255186
2505 '-Wno-deprecated-register',
2508 'includes': [ 'set_clang_warning_flags.gypi', ],
2510 # Don't use deprecated V8 APIs anywhere.
2511 'V8_DEPRECATION_WARNINGS',
2514 '<(SHARED_INTERMEDIATE_DIR)',
2517 ['(OS=="mac" or OS=="ios") and asan==1', {
2519 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2522 ['OS=="win" and asan==1 and component=="shared_library"', {
2524 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2527 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2528 'cflags_cc!': ['-fno-rtti'],
2531 '-gline-tables-only',
2532 '-fintercept-allocation-functions',
2534 'defines': ['TYPE_PROFILING'],
2536 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2539 ['branding=="Chrome"', {
2540 'defines': ['GOOGLE_CHROME_BUILD'],
2541 }, { # else: branding!="Chrome"
2542 'defines': ['CHROMIUM_BUILD'],
2544 ['OS=="mac" and component=="shared_library"', {
2546 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2547 'LD_RUNPATH_SEARCH_PATHS': [
2548 # For unbundled binaries.
2550 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2551 '@loader_path/../../..',
2555 ['clang==1 and OS!="win"', {
2556 # This is here so that all files get recompiled after a clang roll and
2557 # when turning clang on or off.
2558 # (defines are passed via the command line, and build systems rebuild
2559 # things when their commandline changes). Nothing should ever read this
2561 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2564 'defines': ['ENABLE_RLZ'],
2566 ['component=="shared_library"', {
2567 'defines': ['COMPONENT_BUILD'],
2569 ['toolkit_views==1', {
2570 'defines': ['TOOLKIT_VIEWS=1'],
2572 ['ui_compositor_image_transport==1', {
2573 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2576 'defines': ['USE_AURA=1'],
2579 'defines': ['USE_ASH=1'],
2582 'defines': ['USE_PANGO=1'],
2585 'defines': ['USE_CAIRO=1'],
2588 'defines': ['USE_CRAS=1'],
2591 'defines': ['USE_GLIB=1'],
2594 'defines': ['USE_OZONE=1'],
2596 ['use_default_render_theme==1', {
2597 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2599 ['use_libjpeg_turbo==1', {
2600 'defines': ['USE_LIBJPEG_TURBO=1'],
2603 'defines': ['USE_X11=1'],
2605 ['use_clipboard_aurax11==1', {
2606 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2608 ['enable_one_click_signin==1', {
2609 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2611 ['enable_pre_sync_backup==1', {
2612 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2614 ['use_xi2_mt!=0 and use_x11==1', {
2615 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2617 ['image_loader_extension==1', {
2618 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2621 'defines': ['ENABLE_PROFILING=1'],
2624 'defines': ['ENABLE_REMOTING=1'],
2626 ['enable_webrtc==1', {
2627 'defines': ['ENABLE_WEBRTC=1'],
2629 ['proprietary_codecs==1', {
2630 'defines': ['USE_PROPRIETARY_CODECS'],
2632 ['enable_mpeg2ts_stream_parser==1', {
2633 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2637 ['enable_viewport==1', {
2638 'defines': ['ENABLE_VIEWPORT'],
2640 ['enable_pepper_cdms==1', {
2641 'defines': ['ENABLE_PEPPER_CDMS'],
2643 ['enable_browser_cdms==1', {
2644 'defines': ['ENABLE_BROWSER_CDMS'],
2646 ['configuration_policy==1', {
2647 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2649 ['notifications==1', {
2650 'defines': ['ENABLE_NOTIFICATIONS'],
2652 ['enable_hidpi==1', {
2653 'defines': ['ENABLE_HIDPI=1'],
2655 ['native_discardable_memory==1', {
2656 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2658 ['native_memory_pressure_signals==1', {
2659 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2662 'defines': ['USE_UDEV'],
2666 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2669 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2670 # Clang creates chubby debug information, which makes linking very
2671 # slow. For now, don't create debug information with clang. See
2672 # http://crbug.com/70000
2676 'debug_extra_cflags': '-g0',
2679 # Android builds symbols on release by default, disable them.
2682 'debug_extra_cflags': '-g0',
2683 'release_extra_cflags': '-g0',
2687 }, { # else clang!=1
2689 ['OS=="win" and fastbuild==2', {
2690 # Completely disable debug information.
2693 'GenerateDebugInformation': 'false',
2695 'VCCLCompilerTool': {
2696 'DebugInformationFormat': '0',
2700 ['OS=="win" and fastbuild==1', {
2703 # This tells the linker to generate .pdbs, so that
2704 # we can get meaningful stack traces.
2705 'GenerateDebugInformation': 'true',
2707 'VCCLCompilerTool': {
2708 # No debug info to be generated by compiler.
2709 'DebugInformationFormat': '0',
2713 ['OS=="linux" and fastbuild==2', {
2715 'debug_extra_cflags': '-g0',
2718 ['OS=="linux" and fastbuild==1', {
2720 'debug_extra_cflags': '-g1',
2723 ['OS=="android" and fastbuild==2', {
2725 'debug_extra_cflags': '-g0',
2726 'release_extra_cflags': '-g0',
2729 ['OS=="android" and fastbuild==1', {
2731 'debug_extra_cflags': '-g1',
2732 'release_extra_cflags': '-g1',
2739 ['dont_embed_build_metadata==1', {
2741 'DONT_EMBED_BUILD_METADATA',
2743 }], # dont_embed_build_metadata==1
2744 ['dcheck_always_on!=0', {
2745 'defines': ['DCHECK_ALWAYS_ON=1'],
2746 }], # dcheck_always_on!=0
2747 ['tracing_like_official_build!=0', {
2748 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2749 }], # tracing_like_official_build!=0
2750 ['win_use_allocator_shim==0', {
2753 'defines': ['NO_TCMALLOC'],
2757 ['enable_eglimage==1', {
2759 'ENABLE_EGLIMAGE=1',
2764 'ADDRESS_SANITIZER',
2765 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2766 'MEMORY_SANITIZER_INITIAL_SIZE',
2770 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2778 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2779 'MEMORY_SANITIZER_INITIAL_SIZE',
2785 '_CRT_SECURE_NO_DEPRECATE',
2786 '_SCL_SECURE_NO_DEPRECATE',
2787 # This define is required to pull in the new Win8 interfaces from
2788 # system headers like ShObjIdl.h.
2789 'NTDDI_VERSION=0x06020000',
2790 # This is required for ATL to use XP-safe versions of its functions.
2791 '_USING_V110_SDK71_',
2794 '<(DEPTH)/third_party/wtl/include',
2799 # Generates debug info when win_z7=1
2800 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2802 'GenerateDebugInformation': 'true',
2804 'VCCLCompilerTool': {
2805 'DebugInformationFormat': '1',
2816 ['target_arch=="arm"', {
2818 # TODO(lcwu): Work around an error when building Chromium
2819 # with gcc-4.5.3 (e.g. v8/src/platform-linux.cc). Remove
2820 # this define once the toolchain is updated.
2821 # See crbug.com/388933.
2825 ['use_playready==1', {
2827 'PLAYREADY_CDM_AVAILABLE',
2832 ['enable_task_manager==1', {
2834 'ENABLE_TASK_MANAGER=1',
2837 ['enable_extensions==1', {
2839 'ENABLE_EXTENSIONS=1',
2842 ['OS=="win" and branding=="Chrome"', {
2843 'defines': ['ENABLE_SWIFTSHADER'],
2845 ['enable_dart==1', {
2846 'defines': ['WEBKIT_USING_DART=1'],
2848 ['enable_plugin_installation==1', {
2849 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2851 ['enable_plugins==1', {
2852 'defines': ['ENABLE_PLUGINS=1'],
2854 ['enable_session_service==1', {
2855 'defines': ['ENABLE_SESSION_SERVICE=1'],
2857 ['enable_themes==1', {
2858 'defines': ['ENABLE_THEMES=1'],
2860 ['enable_autofill_dialog==1', {
2861 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2863 ['enable_prod_wallet_service==1', {
2864 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2866 ['enable_background==1', {
2867 'defines': ['ENABLE_BACKGROUND=1'],
2869 ['enable_google_now==1', {
2870 'defines': ['ENABLE_GOOGLE_NOW=1'],
2872 ['cld_version!=0', {
2873 'defines': ['CLD_VERSION=<(cld_version)'],
2875 ['cld_version==2', {
2876 # This is used to populate the "CLD Data Source" field in:
2877 # chrome://translate-internals
2878 'defines': ['CLD2_DATA_SOURCE=<(cld2_data_source)'],
2880 ['enable_printing==1', {
2881 'defines': ['ENABLE_FULL_PRINTING=1', 'ENABLE_PRINTING=1'],
2883 ['enable_printing==1 and OS=="win"', {
2884 'defines': ['DISABLE_BASIC_PRINTING=1'],
2886 ['enable_printing==2', {
2887 'defines': ['ENABLE_PRINTING=1'],
2889 ['enable_spellcheck==1', {
2890 'defines': ['ENABLE_SPELLCHECK=1'],
2892 ['enable_captive_portal_detection==1', {
2893 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2895 ['enable_app_list==1', {
2896 'defines': ['ENABLE_APP_LIST=1'],
2898 ['enable_settings_app==1', {
2899 'defines': ['ENABLE_SETTINGS_APP=1'],
2901 ['disable_file_support==1', {
2902 'defines': ['DISABLE_FILE_SUPPORT=1'],
2904 ['disable_ftp_support==1', {
2905 'defines': ['DISABLE_FTP_SUPPORT=1'],
2907 ['use_icu_alternatives_on_android==1', {
2908 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2910 ['enable_managed_users==1', {
2911 'defines': ['ENABLE_MANAGED_USERS=1'],
2913 ['data_reduction_fallback_host != ""', {
2915 'DATA_REDUCTION_FALLBACK_HOST="<(data_reduction_fallback_host)"'],
2917 ['data_reduction_dev_host != ""', {
2919 'DATA_REDUCTION_DEV_HOST="<(data_reduction_dev_host)"'],
2921 ['data_reduction_dev_fallback_host != ""', {
2923 'DATA_REDUCTION_DEV_FALLBACK_HOST="<(data_reduction_dev_fallback_host)"'],
2925 ['spdy_proxy_auth_origin != ""', {
2926 'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'],
2928 ['spdy_proxy_auth_property != ""', {
2929 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2931 ['spdy_proxy_auth_value != ""', {
2932 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2934 ['data_reduction_proxy_probe_url != ""', {
2936 'DATA_REDUCTION_PROXY_PROBE_URL="<(data_reduction_proxy_probe_url)"'],
2938 ['data_reduction_proxy_warmup_url != ""', {
2940 'DATA_REDUCTION_PROXY_WARMUP_URL="<(data_reduction_proxy_warmup_url)"'],
2942 ['data_reduction_proxy_ssl_origin != ""', {
2944 'DATA_REDUCTION_PROXY_SSL_ORIGIN="<(data_reduction_proxy_ssl_origin)"'],
2946 ['data_reduction_proxy_alt_origin != ""', {
2948 'DATA_REDUCTION_PROXY_ALT_ORIGIN="<(data_reduction_proxy_alt_origin)"'],
2950 ['data_reduction_proxy_alt_fallback_origin != ""', {
2952 'DATA_REDUCTION_PROXY_ALT_FALLBACK_ORIGIN="<(data_reduction_proxy_alt_fallback_origin)"'],
2954 ['enable_mdns==1', {
2955 'defines': ['ENABLE_MDNS=1'],
2957 ['enable_service_discovery==1', {
2958 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2960 ['enable_wifi_bootstrapping==1', {
2961 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2963 ['enable_hangout_services_extension==1', {
2964 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2966 ['enable_ipc_fuzzer==1', {
2967 'defines': ['ENABLE_IPC_FUZZER=1'],
2970 'defines': ['VIDEO_HOLE=1'],
2972 ['enable_load_completion_hacks==1', {
2973 'defines': ['ENABLE_LOAD_COMPLETION_HACKS=1'],
2975 ], # conditions for 'target_defaults'
2976 'target_conditions': [
2977 ['<(use_openssl)==1', {
2978 'defines': ['USE_OPENSSL=1'],
2980 ['<(use_openssl_certs)==1', {
2981 'defines': ['USE_OPENSSL_CERTS=1'],
2983 ['>(nacl_untrusted_build)==1', {
2986 'USE_OPENSSL_CERTS=1',
2989 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
2990 'defines': ['USE_NSS=1'],
2992 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
2993 'defines': ['OS_CHROMEOS=1'],
2995 ['enable_wexit_time_destructors==1 and OS!="win"', {
2996 # TODO: Enable on Windows too, http://crbug.com/404525
2997 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
2999 ['chromium_code==0', {
3001 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3002 # We don't want to get warnings from third-party code,
3003 # so remove any existing warning-enabling flags like -Wall.
3009 # Don't warn about hash_map in third-party code.
3013 # Don't warn about printf format problems.
3014 # This is off by default in gcc but on in Ubuntu's gcc(!).
3018 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3022 # TODO: Fix all warnings on chromeos too.
3023 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3028 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3030 # Don't warn about ignoring the return value from e.g. close().
3031 # This is off by default in some gccs but on by default in others.
3032 # BSD systems do not support this option, since they are usually
3033 # using gcc 4.2.1, which does not have this flag yet.
3034 '-Wno-unused-result',
3039 '_CRT_SECURE_NO_DEPRECATE',
3040 '_CRT_NONSTDC_NO_WARNINGS',
3041 '_CRT_NONSTDC_NO_DEPRECATE',
3042 '_SCL_SECURE_NO_DEPRECATE',
3044 'msvs_disabled_warnings': [4800],
3046 'VCCLCompilerTool': {
3047 'WarningLevel': '3',
3048 'WarnAsError': 'true',
3049 'Detect64BitPortabilityProblems': 'false',
3053 ['buildtype=="Official"', {
3055 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3060 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3065 # TODO(darin): Unfortunately, some third_party code depends on base.
3066 [ 'OS=="win" and component=="shared_library"', {
3067 'msvs_disabled_warnings': [
3068 4251, # class 'std::xx' needs to have dll-interface.
3071 [ 'OS=="mac" or OS=="ios"', {
3073 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3076 ['buildtype=="Official"', {
3078 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3085 # TODO(ios): Fix remaining warnings in third-party code, then
3086 # remove this; the Mac cleanup didn't get everything that's
3087 # flagged in an iOS build.
3088 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3089 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3090 # Several internal ios directories generate numerous warnings for
3091 # -Wobjc-missing-property-synthesis.
3092 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3098 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3099 'filename_rules.gypi',
3101 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3102 # C99 macros on Mac and Linux.
3104 '__STDC_CONSTANT_MACROS',
3105 '__STDC_FORMAT_MACROS',
3109 # turn on warnings for signed/unsigned mismatch on chromium code.
3111 'VCCLCompilerTool': {
3112 'AdditionalOptions': ['/we4389'],
3116 ['OS=="win" and component=="shared_library"', {
3117 'msvs_disabled_warnings': [
3118 4251, # class 'std::xx' needs to have dll-interface.
3123 ], # target_conditions for 'target_defaults'
3124 'default_configuration': 'Debug',
3126 # VCLinkerTool LinkIncremental values below:
3128 # 1 == /INCREMENTAL:NO
3130 # Debug links incremental, Release does not.
3132 # Abstract base configurations to cover common attributes.
3136 'msvs_configuration_attributes': {
3137 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3138 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3139 'CharacterSet': '1',
3141 # Add the default import libs.
3144 'AdditionalDependencies': [
3168 'MinimumRequiredVersion': '5.01', # XP.
3169 'TargetMachine': '1',
3171 'VCLibrarianTool': {
3172 'TargetMachine': '1',
3175 'msvs_configuration_platform': 'Win32',
3179 'msvs_configuration_platform': 'x64',
3182 # Make sure to understand http://crbug.com/361720 if you want to
3184 'MinimumRequiredVersion': '5.02', # Server 2003.
3185 'TargetMachine': '17', # x86 - 64
3186 'AdditionalLibraryDirectories!':
3187 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3188 'AdditionalLibraryDirectories':
3189 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3190 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3191 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3193 'VCLibrarianTool': {
3194 'AdditionalLibraryDirectories!':
3195 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3196 'AdditionalLibraryDirectories':
3197 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3198 'TargetMachine': '17', # x64
3205 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3206 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3209 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3211 '<@(debug_extra_cflags)',
3215 'VCCLCompilerTool': {
3216 'Optimization': '<(win_debug_Optimization)',
3217 'PreprocessorDefinitions': ['_DEBUG'],
3218 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3219 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3221 # According to MSVS, InlineFunctionExpansion=0 means
3222 # "default inlining", not "/Ob0".
3223 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3224 ['win_debug_InlineFunctionExpansion==0', {
3225 'AdditionalOptions': ['/Ob0'],
3227 ['win_debug_InlineFunctionExpansion!=""', {
3228 'InlineFunctionExpansion':
3229 '<(win_debug_InlineFunctionExpansion)',
3231 ['win_debug_disable_iterator_debugging==1', {
3232 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3235 # if win_debug_OmitFramePointers is blank, leave as default
3236 ['win_debug_OmitFramePointers==1', {
3237 'OmitFramePointers': 'true',
3239 ['win_debug_OmitFramePointers==0', {
3240 'OmitFramePointers': 'false',
3241 # The above is not sufficient (http://crbug.com/106711): it
3242 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3243 # perform FPO regardless, so we must explicitly disable.
3244 # We still want the false setting above to avoid having
3245 # "/Oy /Oy-" and warnings about overriding.
3246 'AdditionalOptions': ['/Oy-'],
3249 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3252 'LinkIncremental': '<(msvs_debug_link_incremental)',
3253 # ASLR makes debugging with windbg difficult because Chrome.exe and
3254 # Chrome.dll share the same base name. As result, windbg will
3255 # name the Chrome.dll module like chrome_<base address>, where
3256 # <base address> typically changes with each launch. This in turn
3257 # means that breakpoints in Chrome.dll don't stick from one launch
3258 # to the next. For this reason, we turn ASLR off in debug builds.
3259 # Note that this is a three-way bool, where 0 means to pick up
3260 # the default setting, 1 is off and 2 is on.
3261 'RandomizedBaseAddress': 1,
3263 'VCResourceCompilerTool': {
3264 'PreprocessorDefinitions': ['_DEBUG'],
3268 ['OS=="linux" or OS=="android"', {
3269 'target_conditions': [
3270 ['_toolset=="target"', {
3272 '<@(debug_extra_cflags)',
3277 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3278 # Enable libstdc++ debugging facilities to help catch problems
3279 # early, see http://crbug.com/65151 .
3280 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3281 'defines': ['_GLIBCXX_DEBUG=1',],
3283 ['release_valgrind_build==0', {
3286 '-fstack-protector-all', # Implies -fstack-protector
3292 # Allow comparing the address of references and 'this' against 0
3293 # in debug builds. Technically, these can never be null in
3294 # well-defined C/C++ and Clang can optimize such checks away in
3295 # release builds, but they may be used in asserts in debug builds.
3296 '-Wno-undefined-bool-conversion',
3297 '-Wno-tautological-undefined-compare',
3301 '-Wno-undefined-bool-conversion',
3302 '-Wno-tautological-undefined-compare',
3306 'VCCLCompilerTool': {
3307 'AdditionalOptions': [
3308 '-Wno-undefined-bool-conversion',
3309 '-Wno-tautological-undefined-compare',
3322 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3323 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3324 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3327 'VCCLCompilerTool': {
3328 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3330 # In official builds, each target will self-select
3331 # an optimization level.
3332 ['buildtype!="Official"', {
3333 'Optimization': '<(win_release_Optimization)',
3336 # According to MSVS, InlineFunctionExpansion=0 means
3337 # "default inlining", not "/Ob0".
3338 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3339 ['win_release_InlineFunctionExpansion==0', {
3340 'AdditionalOptions': ['/Ob0'],
3342 ['win_release_InlineFunctionExpansion!=""', {
3343 'InlineFunctionExpansion':
3344 '<(win_release_InlineFunctionExpansion)',
3347 # if win_release_OmitFramePointers is blank, leave as default
3348 ['win_release_OmitFramePointers==1', {
3349 'OmitFramePointers': 'true',
3351 ['win_release_OmitFramePointers==0', {
3352 'OmitFramePointers': 'false',
3353 # The above is not sufficient (http://crbug.com/106711): it
3354 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3355 # perform FPO regardless, so we must explicitly disable.
3356 # We still want the false setting above to avoid having
3357 # "/Oy /Oy-" and warnings about overriding.
3358 'AdditionalOptions': ['/Oy-'],
3361 'AdditionalOptions': [
3362 '/d2Zi+', # Improve debugging of Release builds.
3363 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3364 '<@(win_release_extra_cflags)',
3368 # LinkIncremental is a tri-state boolean, where 0 means default
3369 # (i.e., inherit from parent solution), 1 means false, and
3371 'LinkIncremental': '1',
3372 # This corresponds to the /PROFILE flag which ensures the PDB
3373 # file contains FIXUP information (growing the PDB file by about
3374 # 5%) but does not otherwise alter the output binary. This
3375 # information is used by the Syzygy optimization tool when
3376 # decomposing the release image.
3381 ['msvs_use_common_release', {
3382 'includes': ['release.gypi'],
3384 ['release_valgrind_build==0 and tsan==0', {
3387 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3391 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3392 'MEMORY_SANITIZER_INITIAL_SIZE',
3393 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3394 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3397 ['win_use_allocator_shim==0', {
3398 'defines': ['NO_TCMALLOC'],
3400 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3401 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3402 # It seems to work fine with Ubuntu 12 headers though, so use it
3403 # in official builds.
3404 ['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")', {
3405 'target_conditions': [
3406 ['chromium_code==1', {
3407 # Non-chromium code is not guaranteed to compile cleanly
3408 # with _FORTIFY_SOURCE. Also, fortified build may fail
3409 # when optimizations are disabled, so only do that for Release
3412 '_FORTIFY_SOURCE=2',
3417 ['OS=="linux" or OS=="android"', {
3418 'target_conditions': [
3419 ['_toolset=="target"', {
3421 '<@(release_extra_cflags)',
3424 ['enable_resource_whitelist_generation==1', {
3426 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3435 'NS_BLOCK_ASSERTIONS=1',
3441 # Concrete configurations
3444 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3447 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3452 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3453 'target_conditions': [
3454 [ '_type=="executable"', {
3455 # To get a real .dSYM bundle produced by dsymutil, set the
3456 # debug information format to dwarf-with-dsym. Since
3457 # strip_from_xcode will not be used, set Xcode to do the
3458 # stripping as well.
3460 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3461 'DEPLOYMENT_POSTPROCESSING': 'YES',
3462 'STRIP_INSTALLED_PRODUCT': 'YES',
3469 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3471 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3474 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3482 'target_defaults': {
3489 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3490 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3491 'target_defaults': {
3493 '-Wl,--fatal-warnings',
3497 ['os_posix==1 and chromeos==0', {
3498 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3499 # and we want to avoid overriding this, so stack-protector is only
3500 # enabled when not building on Chrome OS.
3501 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3503 'target_defaults': {
3505 '-fstack-protector',
3506 '--param=ssp-buffer-size=4',
3510 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3511 'target_defaults': {
3512 # Enable -Werror by default, but put it in a variable so it can
3513 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3515 'werror%': '-Werror',
3516 'libraries_for_target%': '',
3519 '_FILE_OFFSET_BITS=64',
3522 '<(werror)', # See note above about the werror variable.
3524 '-fno-strict-aliasing', # See http://crbug.com/32204
3526 # TODO(evan): turn this back on once all the builds work.
3528 # Don't warn about unused function params. We use those everywhere.
3529 '-Wno-unused-parameter',
3530 # Don't warn about the "struct foo f = {0};" initialization pattern.
3531 '-Wno-missing-field-initializers',
3532 # Don't export any symbols (for example, to plugins we dlopen()).
3533 # Note: this is *required* to make some plugins work.
3534 '-fvisibility=hidden',
3540 '-fno-threadsafe-statics',
3541 # Make inline functions have hidden visiblity by default.
3542 # Surprisingly, not covered by -fvisibility=hidden.
3543 '-fvisibility-inlines-hidden',
3544 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3545 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3549 '-pthread', '-Wl,-z,noexecstack',
3552 '<(libraries_for_target)',
3557 'debug_optimize%': '0',
3563 '-O>(debug_optimize)',
3569 # Warn in case of text relocations.
3570 '-Wl,--warn-shared-textrel',
3573 ['OS=="android" and android_full_debug==0', {
3574 # Some configurations are copied from Release_Base to reduce
3577 'debug_optimize%': 's',
3581 '-ffunction-sections',
3588 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3589 # We don't omit frame pointers on arm64 since they are required
3590 # to correctly unwind stackframes which contain system library
3591 # function frames (crbug.com/391706).
3593 '-fomit-frame-pointer',
3596 ['OS=="linux" and target_arch=="ia32"', {
3598 '-Wl,--no-as-needed',
3601 ['debug_unwind_tables==1', {
3602 'cflags': ['-funwind-tables'],
3604 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3606 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3607 # definitions in to the right scope to use them when setting
3608 # linux_use_debug_fission, so it can be used here alone.
3609 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3610 'cflags': ['-gsplit-dwarf'],
3616 'release_optimize%': '2',
3617 # Binaries become big and gold is unable to perform GC
3618 # and remove unused sections for some of test targets
3619 # on 32 bit platform.
3620 # (This is currently observed only in chromeos valgrind bots)
3621 # The following flag is to disable --gc-sections linker
3622 # option for these bots.
3623 'no_gc_sections%': 0,
3625 # TODO(bradnelson): reexamine how this is done if we change the
3626 # expansion of configurations
3627 'release_valgrind_build%': 0,
3630 '-O<(release_optimize)',
3631 # Don't emit the GCC version ident directives, they just end up
3632 # in the .comment section taking up binary size.
3634 # Put data and code in their own sections, so that unused symbols
3635 # can be removed at link time with --gc-sections.
3637 '-ffunction-sections',
3640 # Specifically tell the linker to perform optimizations.
3641 # See http://lwn.net/Articles/192624/ .
3646 ['no_gc_sections==0', {
3648 '-Wl,--gc-sections',
3651 ['OS=="android" and target_arch!="arm64"', {
3652 # We don't omit frame pointers on arm64 since they are required
3653 # to correctly unwind stackframes which contain system library
3654 # function frames (crbug.com/391706).
3656 '-fomit-frame-pointer',
3661 'release_optimize%': 's',
3664 # Warn in case of text relocations.
3665 '-Wl,--warn-shared-textrel',
3669 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed
3670 # and the fix is in chromium.
3671 'cflags': [ '-fno-slp-vectorize', ],
3675 '-fno-omit-frame-pointer',
3679 ['profiling_full_stack_frames==1', {
3682 '-fno-optimize-sibling-calls',
3687 ['release_unwind_tables==1', {
3688 'cflags': ['-funwind-tables'],
3690 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3696 ['target_arch=="ia32"', {
3697 'target_conditions': [
3698 ['_toolset=="target"', {
3700 # Needed so that libs with .s files (e.g. libicudata.a)
3701 # are compatible with the general 32-bit-ness.
3704 # All floating-point computations on x87 happens in 80-bit
3705 # precision. Because the C and C++ language standards allow
3706 # the compiler to keep the floating-point values in higher
3707 # precision than what's specified in the source and doing so
3708 # is more efficient than constantly rounding up to 64-bit or
3709 # 32-bit precision as specified in the source, the compiler,
3710 # especially in the optimized mode, tries very hard to keep
3711 # values in x87 floating-point stack (in 80-bit precision)
3712 # as long as possible. This has important side effects, that
3713 # the real value used in computation may change depending on
3714 # how the compiler did the optimization - that is, the value
3715 # kept in 80-bit is different than the value rounded down to
3716 # 64-bit or 32-bit. There are possible compiler options to
3717 # make this behavior consistent (e.g. -ffloat-store would keep
3718 # all floating-values in the memory, thus force them to be
3719 # rounded to its original precision) but they have significant
3720 # runtime performance penalty.
3722 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3723 # which keep floating-point values in SSE registers in its
3724 # native precision (32-bit for single precision, and 64-bit
3725 # for double precision values). This means the floating-point
3726 # value used during computation does not change depending on
3727 # how the compiler optimized the code, since the value is
3728 # always kept in its specified precision.
3730 # Refer to http://crbug.com/348761 for rationale behind SSE2
3731 # being a minimum requirement for 32-bit Linux builds and
3732 # http://crbug.com/313032 for an example where this has "bit"
3737 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3744 # Use gold linker for Android ia32 target.
3750 # Install packages have started cropping up with
3751 # different headers between the 32-bit and 64-bit
3752 # versions, so we have to shadow those differences off
3753 # and make sure a 32-bit-on-64-bit build picks up the
3755 # For android build, use NDK headers instead of host headers
3756 ['host_arch!="ia32" and OS!="android"', {
3765 ['target_arch=="x64"', {
3766 'target_conditions': [
3767 ['_toolset=="target"', {
3769 # Use gold linker for Android x64 target.
3786 ['target_arch=="arm"', {
3787 'target_conditions': [
3788 ['_toolset=="target"', {
3792 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3793 # has changed whenever it encounters a varargs function. This
3794 # silences those warnings, as they are not helpful and
3795 # clutter legitimate warnings.
3799 ['clang==1 and arm_arch!="" and OS!="android"', {
3801 '-target arm-linux-gnueabihf',
3804 '-target arm-linux-gnueabihf',
3809 '-march=<(arm_arch)',
3812 ['clang==1 and OS!="android"', {
3814 # We need to disable clang's builtin assembler as it can't
3815 # handle several asm files, crbug.com/124610
3816 '-no-integrated-as',
3821 '-mtune=<(arm_tune)',
3829 ['arm_float_abi!=""', {
3831 '-mfloat-abi=<(arm_float_abi)',
3840 # Most of the following flags are derived from what Android
3841 # uses by default when building for arm, reference for which
3842 # can be found in the following file in the Android NDK:
3843 # toolchains/arm-linux-androideabi-4.9/setup.mk
3845 # The tree-sra optimization (scalar replacement for
3846 # aggregates enabling subsequent optimizations) leads to
3847 # invalid code generation when using the Android NDK's
3848 # compiler (r5-r7). This can be verified using
3849 # webkit_unit_tests' WTF.Checked_int8_t test.
3851 # The following option is disabled to improve binary
3852 # size and performance in gcc 4.9.
3853 '-fno-caller-saves',
3856 # Android now supports .relro sections properly.
3857 # NOTE: While these flags enable the generation of .relro
3858 # sections, the generated libraries can still be loaded on
3859 # older Android platform versions.
3866 ['gcc_version==48 and clang==0', {
3868 # The following 5 options are disabled to save on
3869 # binary size in GCC 4.8.
3870 '-fno-partial-inlining',
3871 '-fno-early-inlining',
3872 '-fno-tree-copy-prop',
3873 '-fno-tree-loop-optimize',
3874 '-fno-move-loop-invariants',
3878 'cflags': [ '-mthumb-interwork' ],
3882 # Thumb code with frame pointer makes chrome crash
3885 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3886 # The perf report sometimes incorrectly attributes
3887 # code from tail calls.
3888 '-fno-optimize-sibling-calls',
3891 '-fomit-frame-pointer',
3896 # Clang does not support the following options.
3897 '-mthumb-interwork',
3898 '-finline-limit=64',
3900 '-fno-caller-saves',
3904 # TODO(hans) Enable integrated-as (crbug.com/124610).
3905 '-no-integrated-as',
3906 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3909 # Let clang find the ld.gold in the NDK.
3910 '--gcc-toolchain=<(android_toolchain)/..',
3915 '-marm', # Required for frame pointer based stack traces.
3922 # We set arm_arch to "" so that -march compiler option
3923 # is not set. Otherwise a gcc bug that would complain
3924 # about it conflicting with '-mcpu=cortex-a9'. The flag
3925 # '-march=armv7-a' is actually redundant anyway because
3926 # it is enabled by default when we built the toolchain.
3927 # And using '-mcpu=cortex-a9' should be sufficient.
3930 # Breakpad requires symbols with debugging information
3934 # We want to statically link libstdc++/libgcc_s.
3935 '-static-libstdc++',
3939 # Some components in Chromium (e.g. v8, skia, ffmpeg)
3940 # define their own cflags for arm builds that could
3941 # conflict with the flags we set here (e.g.
3942 # '-mcpu=cortex-a9'). Remove these flags explicitly.
3951 ['target_arch=="arm64"', {
3952 'target_conditions': [
3953 ['_toolset=="target"', {
3957 '-fstack-protector', # stack protector is always enabled on arm64.
3964 ['target_arch=="mipsel"', {
3965 'target_conditions': [
3966 ['_toolset=="target"', {
3968 ['android_webview_build==0 and mips_arch_variant=="r6"', {
3969 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
3972 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
3976 ['android_webview_build==0 and mips_arch_variant=="r2"', {
3977 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
3979 ['android_webview_build==0 and mips_arch_variant=="r1"', {
3980 'cflags': ['-mips32', '-Wa,-mips32'],
3984 '-Wl,--no-keep-memory'
3987 '-Wno-uninitialized',
3992 ['target_arch=="mips64el"', {
3993 'target_conditions': [
3994 ['_toolset=="target"', {
3996 ['android_webview_build==0 and mips_arch_variant=="r6"', {
3997 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
3998 'ldflags': [ '-mips64r6' ],
4000 ['android_webview_build==0 and mips_arch_variant=="r2"', {
4001 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4002 'ldflags': [ '-mips64r2' ],
4006 '-Wno-uninitialized',
4020 'target_conditions': [
4021 ['_toolset=="target"', {
4023 '--sysroot=<(sysroot)',
4026 '--sysroot=<(sysroot)',
4027 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4033 # TODO(thakis): Remove, http://crbug.com/263960
4034 '-Wno-reserved-user-defined-literal',
4037 # See the comment in the Mac section for what it takes to move
4038 # this to -std=c++11.
4042 ['clang==0 and host_clang==1', {
4043 'target_conditions': [
4044 ['_toolset=="host"', {
4045 'cflags_cc': [ '-std=gnu++11', ],
4049 ['clang==1 and clang_use_chrome_plugins==1', {
4051 '<@(clang_chrome_plugins_flags)',
4054 ['clang==1 and clang_load!=""', {
4056 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4059 ['clang==1 and clang_add_plugin!=""', {
4061 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4064 ['clang==1 and target_arch=="ia32"', {
4066 # Else building libyuv gives clang's register allocator issues,
4067 # see llvm.org/PR15798 / crbug.com/233709
4068 '-momit-leaf-frame-pointer',
4071 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4073 # See http://crbug.com/110262
4074 '-fcolor-diagnostics',
4077 # Common options for AddressSanitizer, LeakSanitizer,
4078 # ThreadSanitizer and MemorySanitizer.
4079 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4080 'target_conditions': [
4081 ['_toolset=="target"', {
4083 '-fno-omit-frame-pointer',
4084 '-gline-tables-only',
4087 '-fomit-frame-pointer',
4092 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4093 'target_conditions': [
4094 ['_toolset=="target"', {
4096 # Functions interposed by the sanitizers can make ld think
4097 # that some libraries aren't needed when they actually are,
4098 # http://crbug.com/234010. As workaround, disable --as-needed.
4102 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4103 'MEMORY_SANITIZER_INITIAL_SIZE',
4107 # TODO(glider): enable the default options on other systems.
4109 ['use_sanitizer_options==1 and OS=="linux" and (chromeos==0 or target_arch!="ia32")', {
4111 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
4117 'target_conditions': [
4118 ['_toolset=="target"', {
4120 '-fsanitize=address',
4123 '-fsanitize=address',
4130 '-mllvm -asan-globals=0', # http://crbug.com/352073
4136 'target_conditions': [
4137 ['_toolset=="target"', {
4139 '-fsanitize=undefined',
4140 # -fsanitize=vptr is incompatible with -fno-rtti.
4141 '-fno-sanitize=vptr',
4144 '-fsanitize=undefined',
4145 # -fsanitize=vptr is incompatible with -fno-rtti.
4146 '-fno-sanitize=vptr',
4152 'target_conditions': [
4153 ['_toolset=="target"', {
4156 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4168 'UNDEFINED_SANITIZER',
4173 ['asan_coverage!=0', {
4174 'target_conditions': [
4175 ['_toolset=="target"', {
4177 '-mllvm -asan-coverage=<(asan_coverage)',
4183 'target_conditions': [
4184 ['_toolset=="target"', {
4193 'WTF_USE_LEAK_SANITIZER=1',
4199 'target_conditions': [
4200 ['_toolset=="target"', {
4202 '-fsanitize=thread',
4204 '-fsanitize-blacklist=<(tsan_blacklist)',
4207 '-fsanitize=thread',
4211 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4212 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4214 'target_conditions': [
4215 ['_type=="executable"', {
4225 'target_conditions': [
4226 ['_toolset=="target"', {
4228 '-fsanitize=memory',
4229 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4231 '-fsanitize-blacklist=<(msan_blacklist)',
4234 '-fsanitize=memory',
4239 'target_conditions': [
4240 ['_type=="executable"', {
4249 ['use_instrumented_libraries==1', {
4251 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4254 ['use_custom_libcxx==1', {
4256 '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4259 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4260 'target_conditions' : [
4261 # crazy_linker has an upstream gyp file we can't edit, and we
4262 # don't want to instrument it.
4263 ['_toolset=="target" and _target_name!="crazy_linker"', {
4265 '-finstrument-functions',
4266 # Allow mmx intrinsics to inline, so that the
4267 #0 compiler can expand the intrinsics.
4268 '-finstrument-functions-exclude-file-list=mmintrin.h',
4271 ['_toolset=="target" and OS=="android"', {
4273 # Avoids errors with current NDK:
4274 # "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"
4275 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4280 ['linux_dump_symbols==1', {
4283 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4284 'target_conditions': [
4285 ['_toolset=="target"', {
4287 # Attempt to use less memory to prevent the linker from
4288 # running out of address space. Considering installing a
4289 # 64-bit kernel and switching to a 64-bit linker.
4290 '-Wl,--no-keep-memory',
4297 ['use_allocator!="tcmalloc"', {
4298 'defines': ['NO_TCMALLOC'],
4300 ['linux_use_gold_flags==1', {
4301 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4303 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4304 'ldflags': [ '-fuse-ld=gold', ],
4306 'target_conditions': [
4307 ['_toolset=="target"', {
4309 # Experimentation found that using four linking threads
4310 # saved ~20% of link time.
4311 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4312 # Only apply this to the target linker, since the host
4313 # linker might not be gold, but isn't used much anyway.
4314 # TODO(raymes): Disable threading because gold is frequently
4315 # crashing on the bots: crbug.com/161942.
4317 # '-Wl,--thread-count=4',
4322 ['release_valgrind_build==0', {
4323 'target_conditions': [
4324 ['_toolset=="target"', {
4326 # There seems to be a conflict of --icf and -pie
4327 # in gold which can generate crashy binaries. As
4328 # a security measure, -pie takes precedence for
4338 ['linux_use_bundled_binutils==1', {
4340 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4343 ['linux_use_bundled_gold==1', {
4344 # Put our binutils, which contains gold in the search path. We pass
4345 # the path to gold to the compiler. gyp leaves unspecified what the
4346 # cwd is when running the compiler, so the normal gyp path-munging
4347 # fails us. This hack gets the right path.
4349 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4352 # Some binutils 2.23 releases may or may not have new dtags enabled,
4353 # but they are all compatible with --disable-new-dtags,
4354 # because the new dynamic tags are not created by default.
4355 ['binutils_version>=223', {
4356 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4357 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4358 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4359 # inside this file to allow usage of --no-as-needed and removal of
4362 '-Wl,--disable-new-dtags',
4365 ['gcc_version>=47 and clang==0', {
4366 'target_conditions': [
4367 ['_toolset=="target"', {
4370 # See comment for -Wno-c++11-narrowing.
4372 # TODO(thakis): Remove, http://crbug.com/263960
4373 '-Wno-literal-suffix',
4378 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4379 'target_conditions': [
4380 ['_toolset=="host"', {
4383 # See comment for -Wno-c++11-narrowing.
4385 # TODO(thakis): Remove, http://crbug.com/263960
4386 '-Wno-literal-suffix',
4394 # FreeBSD-specific options; note that most FreeBSD options are set above,
4397 'target_defaults': {
4399 '-Wl,--no-keep-memory',
4403 # Android-specific options; note that most are set above with Linux.
4406 # This is a unique identifier for a given build. It's used for
4407 # identifying various build artifacts corresponding to a particular
4408 # build of chrome (e.g. where to find archived symbols).
4409 'chrome_build_id%': '',
4411 # Use shared stlport library when system one used.
4412 # Figure this out early since it needs symbols from libgcc.a, so it
4413 # has to be before that in the set of libraries.
4414 ['use_system_stlport==1', {
4415 'android_stlport_library': 'stlport',
4418 ['component=="shared_library"', {
4419 'android_stlport_library': 'stlport_shared',
4421 'android_stlport_library': 'stlport_static',
4427 # Placing this variable here prevents from forking libvpx, used
4428 # by remoting. Remoting is off, so it needn't built,
4429 # so forking it's deps seems like overkill.
4430 # But this variable need defined to properly run gyp.
4431 # A proper solution is to have an OS==android conditional
4432 # in third_party/libvpx/libvpx.gyp to define it.
4433 'libvpx_path': 'lib/linux/arm',
4435 'target_defaults': {
4437 'release_extra_cflags%': '',
4439 # If we're using the components build, append "cr" to all shared
4440 # libraries to avoid naming collisions with android system library
4441 # versions with the same name (e.g. skia, icu).
4442 ['component=="shared_library"', {
4443 'android_product_extension': 'cr.so',
4445 'android_product_extension': 'so',
4449 'target_conditions': [
4450 ['_type=="shared_library"', {
4451 'product_extension': '<(android_product_extension)',
4454 # Settings for building device targets using Android's toolchain.
4455 # These are based on the setup.mk file from the Android NDK.
4457 # The NDK Android executable link step looks as follows:
4459 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4460 # $(PRIVATE_OBJECTS) <-- The .o that we built
4461 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4462 # $(TARGET_LIBGCC) <-- libgcc.a
4463 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4464 # $(PRIVATE_LDLIBS) <-- System .so
4465 # $(TARGET_CRTEND_O) <-- crtend.o
4467 # For now the above are approximated for executables by adding
4468 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4471 # The NDK Android shared library link step looks as follows:
4473 # $(PRIVATE_OBJECTS) <-- The .o that we built
4474 # -l,--whole-archive
4475 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4476 # -l,--no-whole-archive
4477 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4478 # $(TARGET_LIBGCC) <-- libgcc.a
4479 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4480 # $(PRIVATE_LDLIBS) <-- System .so
4482 # For now, assume that whole static libraries are not needed.
4484 # For both executables and shared libraries, add the proper
4485 # libgcc.a to the start of libraries which puts it in the
4486 # proper spot after .o and .a files get linked in.
4488 # TODO: The proper thing to do longer-tem would be proper gyp
4489 # support for a custom link command line.
4490 ['_toolset=="target"', {
4492 '-pthread', # Not supported by Android toolchain.
4495 '-ffunction-sections',
4498 '-fstack-protector',
4500 '-finline-limit=64',
4501 '-Wa,--noexecstack',
4502 '<@(release_extra_cflags)',
4506 '__GNU_SOURCE=1', # Necessary for clone()
4508 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4509 'CHROME_BUILD_ID="<(chrome_build_id)"',
4512 '-pthread', # Not supported by Android toolchain.
4516 '-Wl,--no-undefined',
4519 '-l<(android_stlport_library)',
4520 # Manually link the libgcc.a that the cross compiler uses.
4521 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4527 ['component=="static_library"', {
4529 '-Wl,--exclude-libs=ALL',
4534 # Work around incompatibilities between bionic and clang
4536 '-D__compiler_offsetof=__builtin_offsetof',
4537 '-Dnan=__builtin_nan',
4540 ['target_arch=="arm"', {
4542 '-target arm-linux-androideabi',
4545 '-target arm-linux-androideabi',
4548 ['target_arch=="ia32"', {
4550 '-target x86-linux-androideabi',
4553 '-target x86-linux-androideabi',
4556 # Place holder for x64 support, not tested.
4557 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4558 ['target_arch=="x64"', {
4560 '-target x86_64-linux-androideabi',
4563 '-target x86_64-linux-androideabi',
4570 # Android build relies on -Wl,--gc-sections removing
4571 # unreachable code. ASan instrumentation for globals inhibits
4572 # this and results in a library with unresolvable relocations.
4573 # TODO(eugenis): find a way to reenable this.
4574 '-mllvm -asan-globals=0',
4577 ['android_webview_build==0', {
4579 # The NDK has these things, but doesn't define the constants
4580 # to say that it does. Define them here instead.
4584 '--sysroot=<(android_ndk_sysroot)',
4587 '--sysroot=<(android_ndk_sysroot)',
4590 ['android_webview_build==1', {
4592 # OpenAL headers from the Android tree.
4593 '<(android_src)/frameworks/wilhelm/include',
4596 # Android predefines this as 1; undefine it here so Chromium
4597 # can redefine it later to be 2 for chromium code and unset
4598 # for third party code. This works because cflags are added
4600 '-U_FORTIFY_SOURCE',
4601 # Disable any additional warnings enabled by the Android build system but which
4602 # chromium does not build cleanly with (when treating warning as errors).
4603 # Things that are part of -Wextra:
4604 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4605 '-Wno-ignored-qualifiers',
4607 '-Wno-unused-but-set-variable',
4610 # Other things unrelated to -Wextra:
4611 '-Wno-non-virtual-dtor',
4615 ['android_webview_build==1', {
4616 'target_conditions': [
4617 ['chromium_code==0', {
4619 # There is a class of warning which:
4620 # 1) Android always enables and also treats as errors
4621 # 2) Chromium ignores in third party code
4622 # So we re-enable those warnings when building Android.
4624 '-Wno-format-security',
4626 '-Wno-sequence-point',
4629 '-Wno-non-virtual-dtor',
4634 ['target_arch == "arm"', {
4636 # Enable identical code folding to reduce size.
4640 # NOTE: The stlport header include paths below are specified in
4641 # cflags rather than include_dirs because they need to come
4642 # after include_dirs. Think of them like system headers, but
4643 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4644 # toolchain (circa Gingerbread) will exhibit strange errors.
4645 # The include ordering here is important; change with caution.
4646 ['use_system_stlport==1', {
4648 # For libstdc++/include, which is used by stlport.
4649 '-I<(android_src)/bionic',
4650 '-I<(android_src)/external/stlport/stlport',
4652 }, { # else: use_system_stlport!=1
4654 '-isystem<(android_stlport_include)',
4657 '-L<(android_stlport_libs_dir)',
4660 ['target_arch=="ia32"', {
4661 # The x86 toolchain currently has problems with stack-protector.
4663 '-fstack-protector',
4666 '-fno-stack-protector',
4670 'target_conditions': [
4671 ['_type=="executable"', {
4672 # Force android tools to export the "main" symbol so they can be
4673 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4674 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4675 # when ICS support will be dropped.
4678 '-fvisibility=default',
4682 '-Wl,--gc-sections',
4683 '-Wl,-z,nocopyreloc',
4686 # crtbegin_dynamic.o should be the last item in ldflags.
4687 '<(android_ndk_lib)/crtbegin_dynamic.o',
4690 # crtend_android.o needs to be the last item in libraries.
4691 # Do not add any libraries after this!
4692 '<(android_ndk_lib)/crtend_android.o',
4695 ['_type=="shared_library" or _type=="loadable_module"', {
4697 '-Wl,--exclude-libs=ALL',
4700 '-Wl,-shared,-Bsymbolic',
4703 ['android_webview_build==0', {
4705 # crtbegin_so.o should be the last item in ldflags.
4706 '<(android_ndk_lib)/crtbegin_so.o',
4709 # crtend_so.o needs to be the last item in libraries.
4710 # Do not add any libraries after this!
4711 '<(android_ndk_lib)/crtend_so.o',
4718 # Settings for building host targets using the system toolchain.
4719 ['_toolset=="host"', {
4721 # Due to issues in Clang build system, using ASan on 32-bit
4722 # binaries on x86_64 host is problematic.
4723 # TODO(eugenis): re-enable.
4724 '-fsanitize=address',
4727 '-fsanitize=address',
4728 '-Wl,-z,noexecstack',
4729 '-Wl,--gc-sections',
4732 '-Wl,--warn-shared-textrel',
4733 '-Wl,--fatal-warnings',
4736 # Settings for building host targets on mac.
4737 ['_toolset=="host" and host_os=="mac"', {
4747 'cflags!': ['-fvisibility=hidden'],
4748 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4750 ['OS=="mac" or OS=="ios"', {
4751 'target_defaults': {
4754 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4755 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4756 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4757 'COPY_PHASE_STRIP': 'NO',
4758 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4759 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4760 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4761 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4762 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4763 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4764 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4765 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4766 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4767 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4768 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4769 'GCC_VERSION': '4.2',
4770 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4771 'USE_HEADERMAP': 'NO',
4776 # Don't warn about unused function parameters.
4777 '-Wno-unused-parameter',
4778 # Don't warn about the "struct foo f = {0};" initialization
4780 '-Wno-missing-field-initializers',
4783 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4784 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4786 # Note that the prebuilt Clang binaries should not be used for iOS
4787 # development except for ASan builds.
4789 # gnu++11 instead of c++11 is needed because some code uses
4790 # typeof() (a GNU extension).
4791 # TODO(thakis): Eventually switch this to c++11 instead of
4792 # gnu++11 (once typeof can be removed, which is blocked on c++11
4793 # being available everywhere).
4794 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', # -std=gnu++11
4795 # Warn if automatic synthesis is triggered with
4796 # the -Wobjc-missing-property-synthesis flag.
4797 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4798 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4800 # This warns on selectors from Cocoa headers (-length, -set).
4801 # cfe-dev is currently discussing the merits of this warning.
4802 # TODO(thakis): Reevaluate what to do with this, based one
4803 # cfe-dev discussion.
4804 '-Wno-selector-type-mismatch',
4807 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed
4808 # and the fix is in chromium.
4809 '-fno-slp-vectorize',
4813 ['clang_xcode==0', {
4814 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4815 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4819 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4821 '<@(clang_chrome_plugins_flags)',
4824 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4826 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4829 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4831 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4834 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4836 # See http://crbug.com/110262
4837 '-fcolor-diagnostics',
4840 ['OS=="ios" and target_subarch!="arm32" and \
4841 "<(GENERATOR)"=="xcode"', {
4843 # TODO(ios): when building Chrome for iOS on 64-bit platform
4844 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4845 # enabled. This cause failures when compiling protobuf code,
4846 # so disable the warning. http://crbug.com/359107
4847 '-Wno-shorten-64-to-32',
4855 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4861 '-fsanitize=address',
4862 '-mllvm -asan-globals=0', # http://crbug.com/352073
4863 '-gline-tables-only',
4867 ['asan_coverage!=0', {
4868 'target_conditions': [
4869 ['_toolset=="target"', {
4871 '-mllvm -asan-coverage=<(asan_coverage)',
4877 'target_conditions': [
4878 ['_type!="static_library"', {
4879 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4884 '-fsanitize=address',
4888 ['mac_write_linker_maps==1', {
4891 '-Wl,-map,>(_target_name).map',
4898 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4899 'target_conditions': [
4900 ['_type=="executable"', {
4906 # Define copy_asan_dylib_path in a variable ending in
4907 # _path so that gyp understands it's a path and
4908 # performs proper relativization during dict merging.
4909 'copy_asan_dylib_path':
4910 'mac/copy_asan_runtime_dylib.sh',
4912 'postbuild_name': 'Copy ASan runtime dylib',
4914 '<(copy_asan_dylib_path)',
4923 ], # target_conditions
4924 }, # target_defaults
4925 }], # OS=="mac" or OS=="ios"
4927 'target_defaults': {
4929 # Prevent Mac OS X AssertMacros.h from defining macros that collide
4930 # with common names, like 'check', 'require', and 'verify'.
4931 # (Included by system header. Also exists on iOS but not included.)
4932 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
4933 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
4936 # These should end with %, but there seems to be a bug with % in
4937 # variables that are intended to be set to different values in
4938 # different targets, like these.
4939 'mac_pie': 1, # Most executables can be position-independent.
4940 # Strip debugging symbols from the target.
4941 'mac_strip': '<(mac_strip_release)',
4945 ['mac_want_real_dsym=="default"', {
4948 'mac_real_dsym': '<(mac_want_real_dsym)'
4953 ['mac_want_real_dsym=="default"', {
4954 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
4956 'mac_real_dsym': '<(mac_want_real_dsym)'
4963 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
4964 # (Equivalent to -fPIC)
4965 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
4966 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4967 # Keep pch files below xcodebuild/.
4968 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
4970 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
4971 # xcode_setting, but not until all downstream projects' mac bots are
4972 # using xcode >= 4.6, because that's when the default value of the
4973 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
4974 # setting is a no-op as far as xcode is concerned, but the compiler
4975 # behaves differently based on whether -fno-strict-aliasing is
4977 '-fno-strict-aliasing', # See http://crbug.com/32204.
4980 'target_conditions': [
4981 ['_type=="executable"', {
4984 # Arranges for data (heap) pages to be protected against
4985 # code execution when running on Mac OS X 10.7 ("Lion"), and
4986 # ensures that the position-independent executable (PIE) bit
4987 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
4989 # Define change_mach_o_flags in a variable ending in _path
4990 # so that GYP understands it's a path and performs proper
4991 # relativization during dict merging.
4992 'change_mach_o_flags_path':
4993 'mac/change_mach_o_flags_from_xcode.sh',
4994 'change_mach_o_flags_options%': [
4996 'target_conditions': [
4997 ['mac_pie==0 or release_valgrind_build==1', {
4998 # Don't enable PIE if it's unwanted. It's unwanted if
4999 # the target specifies mac_pie=0 or if building for
5000 # Valgrind, because Valgrind doesn't understand slide.
5001 # See the similar mac_pie/release_valgrind_build check
5003 'change_mach_o_flags_options': [
5009 'postbuild_name': 'Change Mach-O Flags',
5011 '<(change_mach_o_flags_path)',
5012 '>@(change_mach_o_flags_options)',
5019 'asan_saves_file': 'asan.saves',
5022 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
5026 'target_conditions': [
5027 ['mac_pie==1 and release_valgrind_build==0', {
5028 # Turn on position-independence (ASLR) for executables. When
5029 # PIE is on for the Chrome executables, the framework will
5030 # also be subject to ASLR.
5031 # Don't do this when building for Valgrind, because Valgrind
5032 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5033 # understand slide, and get rid of the Valgrind check.
5036 '-Wl,-pie', # Position-independent executable (MH_PIE)
5042 ['(_type=="executable" or _type=="shared_library" or \
5043 _type=="loadable_module") and mac_strip!=0', {
5044 'target_conditions': [
5045 ['mac_real_dsym == 1', {
5046 # To get a real .dSYM bundle produced by dsymutil, set the
5047 # debug information format to dwarf-with-dsym. Since
5048 # strip_from_xcode will not be used, set Xcode to do the
5049 # stripping as well.
5053 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5054 'DEPLOYMENT_POSTPROCESSING': 'YES',
5055 'STRIP_INSTALLED_PRODUCT': 'YES',
5056 'target_conditions': [
5057 ['_type=="shared_library" or _type=="loadable_module"', {
5058 # The Xcode default is to strip debugging symbols
5059 # only (-S). Local symbols should be stripped as
5060 # well, which will be handled by -x. Xcode will
5061 # continue to insert -S when stripping even when
5062 # additional flags are added with STRIPFLAGS.
5064 }], # _type=="shared_library" or _type=="loadable_module"
5065 ['_type=="executable"', {
5068 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
5071 }], # _type=="executable" and asan==1
5072 ], # target_conditions
5074 }, # configuration "Release"
5076 }, { # mac_real_dsym != 1
5077 # To get a fast fake .dSYM bundle, use a post-build step to
5078 # produce the .dSYM and strip the executable. strip_from_xcode
5079 # only operates in the Release configuration.
5083 # Define strip_from_xcode in a variable ending in _path
5084 # so that gyp understands it's a path and performs proper
5085 # relativization during dict merging.
5086 'strip_from_xcode_path': 'mac/strip_from_xcode',
5088 'postbuild_name': 'Strip If Needed',
5089 'action': ['<(strip_from_xcode_path)'],
5093 ], # target_conditions
5094 }], # (_type=="executable" or _type=="shared_library" or
5095 # _type=="loadable_module") and mac_strip!=0
5096 ], # target_conditions
5097 }, # target_defaults
5100 'target_defaults': {
5101 'xcode_settings' : {
5102 # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang
5104 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',
5107 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5108 # additional flag to suppress the "unknown compiler option" error.
5109 # Restrict this flag to builds that are either compiling with Xcode
5110 # or compiling with Xcode's Clang. This will allow Ninja builds to
5111 # continue failing on unknown compiler options.
5112 # TODO(rohitrao): This flag is temporary and should be removed as
5113 # soon as the iOS bots are updated to use Xcode 5.1.
5114 ['clang_xcode==1', {
5116 '-Wno-unknown-warning-option',
5120 # Limit the valid architectures depending on "target_subarch".
5121 # This need to include the "arm" architectures but also the "x86"
5122 # ones (they are used when building for the simulator).
5123 ['target_subarch=="arm32"', {
5124 'VALID_ARCHS': ['armv7', 'i386'],
5126 ['target_subarch=="arm64"', {
5127 'VALID_ARCHS': ['arm64', 'x86_64'],
5129 ['target_subarch=="both"', {
5130 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5132 ['use_system_libcxx==1', {
5133 'target_conditions': [
5134 # Only use libc++ when building target for iOS not when building
5135 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5136 # does not support libc++.
5137 ['_toolset=="target"', {
5138 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5142 # The default for deployment target of 7.0+ is libc++, so force
5143 # the old behavior unless libc++ is enabled.
5144 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5148 'target_conditions': [
5149 ['_toolset=="host"', {
5151 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5152 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5161 ['_toolset=="target"', {
5163 # This section should be for overriding host settings. But,
5164 # since we can't negate the iphone deployment target above, we
5165 # instead set it here for target only.
5166 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5167 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5170 ['_type=="executable"', {
5174 'DEPLOYMENT_POSTPROCESSING': 'YES',
5175 'STRIP_INSTALLED_PRODUCT': 'YES',
5180 # Remove dSYM to reduce build time.
5181 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5187 ['chromium_ios_signing', {
5188 # iOS SDK wants everything for device signed.
5189 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5191 'CODE_SIGNING_REQUIRED': 'NO',
5192 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5197 ], # target_conditions
5198 }, # target_defaults
5201 'target_defaults': {
5203 '_WIN32_WINNT=0x0602',
5210 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5211 'WIN32_LEAN_AND_MEAN',
5213 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5214 '_HAS_EXCEPTIONS=0',
5217 ['buildtype=="Official"', {
5218 # In official builds, targets can self-select an optimization
5219 # level by defining a variable named 'optimize', and setting it
5221 # - "size", optimizes for minimal code size - the default.
5222 # - "speed", optimizes for speed over code size.
5223 # - "max", whole program optimization and link-time code
5224 # generation. This is very expensive and should be used
5227 'optimize%': 'size',
5231 # Set /LTCG for the official builds.
5232 'LinkTimeCodeGeneration': '1',
5235 'target_conditions': [
5236 ['optimize=="size"', {
5238 'VCCLCompilerTool': {
5239 # 1, optimizeMinSpace, Minimize Size (/O1)
5240 'Optimization': '1',
5241 # 2, favorSize - Favor small code (/Os)
5242 'FavorSizeOrSpeed': '2',
5247 ['optimize=="speed"', {
5249 'VCCLCompilerTool': {
5250 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5251 'Optimization': '2',
5252 # 1, favorSpeed - Favor fast code (/Ot)
5253 'FavorSizeOrSpeed': '1',
5258 ['optimize=="max"', {
5259 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5260 # builds. Probably anything that this would catch that
5261 # wouldn't be caught in a normal build isn't going to
5262 # actually be a bug, so the incremental value of C4702 for
5263 # PGO builds is likely very small.
5264 'msvs_disabled_warnings': [
5268 'VCCLCompilerTool': {
5269 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5270 'Optimization': '2',
5271 # 1, favorSpeed - Favor fast code (/Ot)
5272 'FavorSizeOrSpeed': '1',
5273 # This implies link time code generation.
5274 'WholeProgramOptimization': 'true',
5292 'AdditionalLibraryDirectories':
5293 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5295 'VCLibrarianTool': {
5296 'AdditionalLibraryDirectories':
5297 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5303 'VCLibrarianTool': {
5304 'AdditionalLibraryDirectories':
5305 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5308 'AdditionalLibraryDirectories':
5309 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5314 # https://code.google.com/p/chromium/issues/detail?id=372451#c20
5315 # Warning 4702 ("Unreachable code") should be re-enabled once
5316 # Express users are updated to VS2013 Update 2.
5317 'msvs_disabled_warnings': [
5321 'VCCLCompilerTool': {
5322 'AdditionalOptions!': [
5323 '/Zc:inline', # Not supported on non-updated Express.
5327 # Explicitly required when using the ATL with express
5328 'AdditionalDependencies': ['atlthunk.lib'],
5330 # ATL 8.0 included in WDK 7.1 makes the linker to generate
5331 # almost eight hundred LNK4254 and LNK4078 warnings:
5332 # - warning LNK4254: section 'ATL' (50000040) merged into
5333 # '.rdata' (40000040) with different attributes
5334 # - warning LNK4078: multiple 'ATL' sections found with
5335 # different attributes
5336 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
5339 'msvs_system_include_dirs': [
5340 '<(windows_driver_kit_path)/inc/atl71',
5341 '<(windows_driver_kit_path)/inc/mfc42',
5345 'msvs_system_include_dirs': [
5346 '<(windows_sdk_path)/Include/shared',
5347 '<(windows_sdk_path)/Include/um',
5348 '<(windows_sdk_path)/Include/winrt',
5349 '$(VSInstallDir)/VC/atlmfc/include',
5351 'msvs_cygwin_shell': 0,
5352 'msvs_disabled_warnings': [
5353 # C4127: conditional expression is constant
5354 # This warning can in theory catch dead code and other problems, but
5355 # triggers in far too many desirable cases where the conditional
5356 # expression is either set by macros or corresponds some legitimate
5357 # compile-time constant expression (due to constant template args,
5358 # conditionals comparing the sizes of different types, etc.). Some of
5359 # these can be worked around, but it's not worth it.
5362 # C4351: new behavior: elements of array 'array' will be default
5364 # This is a silly "warning" that basically just alerts you that the
5365 # compiler is going to actually follow the language spec like it's
5366 # supposed to, instead of not following it like old buggy versions
5367 # did. There's absolutely no reason to turn this on.
5370 # C4355: 'this': used in base member initializer list
5371 # It's commonly useful to pass |this| to objects in a class'
5372 # initializer list. While this warning can catch real bugs, most of
5373 # the time the constructors in question don't attempt to call methods
5374 # on the passed-in pointer (until later), and annotating every legit
5375 # usage of this is simply more hassle than the warning is worth.
5378 # C4503: 'identifier': decorated name length exceeded, name was
5380 # This only means that some long error messages might have truncated
5381 # identifiers in the presence of lots of templates. It has no effect
5382 # on program correctness and there's no real reason to waste time
5383 # trying to prevent it.
5386 # C4611: interaction between 'function' and C++ object destruction is
5388 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5389 # suggests using exceptions instead of setjmp/longjmp for C++, but
5390 # Chromium code compiles without exception support. We therefore have
5391 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5392 # means we have to turn off this warning (and be careful about how
5393 # object destruction happens in such cases).
5396 # TODO(maruel): These warnings are level 4. They will be slowly
5397 # removed as code is fixed.
5398 4100, # Unreferenced formal parameter
5399 4121, # Alignment of a member was sensitive to packing
5400 4189, # Local variable is initialized but not referenced
5401 4244, # Conversion from 'type1' to 'type2', possible loss of data
5402 4481, # Nonstandard extension used: override specifier 'keyword'
5403 4505, # Unreferenced local function has been removed
5404 4510, # Default constructor could not be generated
5405 4512, # Assignment operator could not be generated
5406 4610, # Object can never be instantiated
5409 'VCCLCompilerTool': {
5410 'AdditionalOptions': ['/MP'],
5411 'MinimalRebuild': 'false',
5412 'BufferSecurityCheck': 'true',
5413 'EnableFunctionLevelLinking': 'true',
5414 'RuntimeTypeInfo': 'false',
5415 'WarningLevel': '4',
5416 'WarnAsError': 'true',
5417 'DebugInformationFormat': '3',
5418 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5419 'ExceptionHandling': '0',
5421 'VCLibrarianTool': {
5422 'AdditionalOptions': ['/ignore:4221'],
5423 'AdditionalLibraryDirectories': [
5424 '<(windows_sdk_path)/Lib/win8/um/x86',
5428 'AdditionalDependencies': [
5440 'AdditionalLibraryDirectories': [
5441 '<(windows_sdk_path)/Lib/win8/um/x86',
5443 'GenerateDebugInformation': 'true',
5444 'MapFileName': '$(OutDir)\\$(TargetName).map',
5445 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5446 'FixedBaseAddress': '1',
5449 # 1 == /SUBSYSTEM:CONSOLE
5450 # 2 == /SUBSYSTEM:WINDOWS
5451 # Most of the executables we'll ever create are tests
5452 # and utilities with console output.
5456 'GenerateStublessProxies': 'true',
5457 'TypeLibraryName': '$(InputName).tlb',
5458 'OutputDirectory': '$(IntDir)',
5459 'HeaderFileName': '$(InputName).h',
5460 'DLLDataFileName': '$(InputName).dlldata.c',
5461 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5462 'ProxyFileName': '$(InputName)_p.c',
5464 'VCResourceCompilerTool': {
5466 'AdditionalIncludeDirectories': [
5468 '<(SHARED_INTERMEDIATE_DIR)',
5471 'target_conditions': [
5472 ['_type=="executable"', {
5474 'EmbedManifest': 'true',
5477 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5479 'AdditionalManifestFiles': [
5480 '>(win_exe_compatibility_manifest)',
5487 # Building with Clang on Windows is a work in progress and very
5488 # experimental. See crbug.com/82385.
5489 'VCCLCompilerTool': {
5490 'WarnAsError': 'false',
5491 'RuntimeTypeInfo': 'false',
5492 'AdditionalOptions': [
5493 '-fmsc-version=1800',
5496 # Many files use intrinsics without including this header.
5497 # TODO(hans): Fix those files, or move this to sub-GYPs.
5500 # TODO(hans): Make this list shorter eventually.
5501 '-Qunused-arguments',
5502 '-Wno-c++11-compat-deprecated-writable-strings',
5503 '-Wno-deprecated-declarations',
5505 '-Wno-enum-conversion',
5506 '-Wno-extra-tokens',
5507 '-Wno-ignored-attributes',
5508 '-Wno-incompatible-pointer-types',
5509 '-Wno-int-to-void-pointer-cast',
5510 '-Wno-invalid-noreturn',
5511 '-Wno-logical-op-parentheses',
5513 '-Wno-missing-braces',
5514 '-Wno-missing-declarations',
5515 '-Wno-msvc-include',
5516 '-Wno-null-dereference',
5517 '-Wno-overloaded-virtual',
5519 '-Wno-pointer-sign',
5521 '-Wno-return-type-c-linkage',
5523 '-Wno-sometimes-uninitialized',
5525 '-Wno-tautological-compare',
5526 '-Wno-unknown-pragmas',
5528 '-Wno-unused-function',
5529 '-Wno-unused-private-field',
5530 '-Wno-unused-value',
5531 '-Wno-unused-variable',
5532 '-Wno-unused-local-typedef', # http://crbug.com/411648
5537 # ASan on Windows is a work in progress and very experimental.
5538 # See crbug.com/345874.
5539 'VCCLCompilerTool': {
5540 'AdditionalOptions': [
5541 '-fsanitize=address',
5543 'AdditionalIncludeDirectories': [
5544 # MSVC needs to be able to find the sanitizer headers when
5545 # invoked via /fallback. This is critical for using macros
5546 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5548 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/include_sanitizer',
5552 'AdditionalLibraryDirectories': [
5553 # TODO(hans): If make_clang_dir is absolute, this breaks.
5554 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/lib/windows',
5557 'target_conditions': [
5558 ['component=="shared_library"', {
5560 'AdditionalDependencies': [
5561 'clang_rt.asan_dynamic-i386.lib',
5562 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5566 ['_type=="executable" and component=="static_library"', {
5568 'AdditionalDependencies': [
5569 'clang_rt.asan-i386.lib',
5573 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5575 'AdditionalDependencies': [
5576 'clang_rt.asan_dll_thunk-i386.lib',
5586 ['disable_nacl==1', {
5587 'target_defaults': {
5593 ['OS=="win" and msvs_use_common_linker_extras', {
5594 'target_defaults': {
5609 'AdditionalOptions': [
5618 'AdditionalOptions': ['/largeaddressaware'],
5627 'AdditionalOptions': [
5628 # safeseh is not compatible with x64
5640 ['enable_new_npdevice_api==1', {
5641 'target_defaults': {
5643 'ENABLE_NEW_NPDEVICE_API',
5647 # Don't warn about the "typedef 'foo' locally defined but not used"
5648 # for gcc 4.8 and higher.
5649 # TODO: remove this flag once all builds work. See crbug.com/227506
5650 ['gcc_version>=48 and clang==0', {
5651 'target_defaults': {
5653 '-Wno-unused-local-typedefs',
5657 ['gcc_version>=48 and clang==0 and host_clang==1', {
5658 'target_defaults': {
5659 'target_conditions': [
5660 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5664 # We need a special case to handle the android webview build on mac because
5665 # the host gcc there doesn't accept this flag, but the target gcc may
5667 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5668 'target_defaults': {
5669 'target_conditions': [
5670 ['_toolset=="host"', {
5672 '-Wno-unused-local-typedefs',
5678 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5680 'make_global_settings': [
5681 ['CC', '<(make_clang_dir)/bin/clang'],
5682 ['CXX', '<(make_clang_dir)/bin/clang++'],
5683 ['CC.host', '$(CC)'],
5684 ['CXX.host', '$(CXX)'],
5687 ['clang==1 and OS=="win"', {
5688 'make_global_settings': [
5689 # On Windows, gyp's ninja generator only looks at CC.
5690 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5693 ['OS=="android" and clang==0', {
5694 # Hardcode the compiler names in the Makefile so that
5695 # it won't depend on the environment at make time.
5696 'make_global_settings': [
5697 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5698 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5699 ['CC.host', '<(host_cc)'],
5700 ['CXX.host', '<(host_cxx)'],
5703 ['OS=="linux" and target_arch=="mipsel"', {
5704 'make_global_settings': [
5705 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5706 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5707 ['CC.host', '<(host_cc)'],
5708 ['CXX.host', '<(host_cxx)'],
5711 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5712 # Set default ARM cross compiling on linux. These can be overridden
5713 # using CC/CXX/etc environment variables.
5714 'make_global_settings': [
5715 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5716 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5717 ['CC.host', '<(host_cc)'],
5718 ['CXX.host', '<(host_cxx)'],
5722 # TODO(yyanagisawa): supports GENERATOR==make
5723 # make generator doesn't support CC_wrapper without CC
5724 # in make_global_settings yet.
5725 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5726 'make_global_settings': [
5727 ['CC_wrapper', '<(gomadir)/gomacc'],
5728 ['CXX_wrapper', '<(gomadir)/gomacc'],
5729 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5730 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5735 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5736 # This block adds *project-wide* configuration settings to each project
5737 # file. It's almost always wrong to put things here. Specify your
5738 # custom xcode_settings in target_defaults to add them to targets instead.
5741 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5742 # setting sets the SDK on a project-wide basis. In order to get the
5743 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5744 # here at the project level.
5747 ['mac_sdk_path==""', {
5748 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5750 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5756 ['ios_sdk_path==""', {
5758 # TODO(justincohen): Ninja only supports simulator for now.
5759 ['"<(GENERATOR)"=="xcode"', {
5760 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5762 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5766 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5771 # Target both iPhone and iPad.
5772 'TARGETED_DEVICE_FAMILY': '1,2',
5775 ['target_arch=="x64"', {
5780 ['target_arch=="ia32"', {
5789 # The Xcode generator will look for an xcode_settings section at the root
5790 # of each dict and use it to apply settings on a file-wide basis. Most
5791 # settings should not be here, they should be in target-specific
5792 # xcode_settings sections, or better yet, should use non-Xcode-specific
5793 # settings in target dicts. SYMROOT is a special case, because many other
5794 # Xcode variables depend on it, including variables such as
5795 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5796 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5797 # files to appear (when present) in the UI as actual files and not red
5798 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5799 # and therefore SYMROOT, needs to be set at the project level.
5800 'SYMROOT': '<(DEPTH)/xcodebuild',