1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6 # Please don't directly include this file if you are building via gyp_chromium,
7 # since gyp_chromium is automatically forcing its inclusion.
9 # Variables expected to be overriden on the GYP command line (-D) or by
10 # ~/.gyp/include.gypi.
12 # Putting a variables dict inside another variables dict looks kind of
13 # weird. This is done so that 'host_arch', 'chromeos', etc are defined as
14 # variables within the outer variables dict here. This is necessary
15 # to get these variables defined for the conditions within this variables
16 # dict that operate on these variables.
21 # Whether we're building a ChromeOS build.
24 # Whether we're building the cast (chromecast) shell
27 # Whether or not we are using the Aura windowing framework.
30 # Whether or not we are building the Ash shell.
33 # Whether or not we are using CRAS, the ChromeOS Audio Server.
36 # Use a raw surface abstraction.
39 # Configure the build for small devices. See crbug.com/318413
43 # Compute the architecture that we're building on.
44 ['OS=="win" or OS=="mac" or OS=="ios"', {
47 'host_arch%': '<!pymod_do_main(detect_host_arch)',
51 # Copy conditionally-set variables out one scope.
52 'chromeos%': '<(chromeos)',
53 'chromecast%': '<(chromecast)',
54 'use_aura%': '<(use_aura)',
55 'use_ash%': '<(use_ash)',
56 'use_cras%': '<(use_cras)',
57 'use_ozone%': '<(use_ozone)',
58 'embedded%': '<(embedded)',
59 'host_arch%': '<(host_arch)',
61 # Whether we are using Views Toolkit
64 # Use OpenSSL instead of NSS as the underlying SSL and crypto
65 # implementation. Certificate verification will in most cases be
66 # handled by the OS. If OpenSSL's struct X509 is used to represent
67 # certificates, use_openssl_certs must be set.
70 # Typedef X509Certificate::OSCertHandle to OpenSSL's struct X509*.
71 'use_openssl_certs%': 0,
73 # Disable viewport meta tag by default.
74 'enable_viewport%': 0,
76 # Enable HiDPI support.
79 # Override buildtype to select the desired build flavor.
80 # Dev - everyday build for development/testing
81 # Official - release build (generally implies additional processing)
82 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
83 # conversion is done), some of the things which are now controlled by
84 # 'branding', such as symbol generation, will need to be refactored
85 # based on 'buildtype' (i.e. we don't care about saving symbols for
86 # non-Official # builds).
89 # Override branding to select the desired branding flavor.
90 'branding%': 'Chromium',
93 # ChromeOS and Windows use Aura and Ash.
94 ['chromeos==1 or OS=="win" or OS=="linux"', {
109 # Whether we're a traditional desktop unix.
110 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
116 # Embedded implies ozone.
122 'target_arch%': 'arm',
124 # Default architecture we're building for is the architecture we're
125 # building on, and possibly sub-architecture (for iOS builds).
126 'target_arch%': '<(host_arch)',
130 # Copy conditionally-set variables out one scope.
131 'chromeos%': '<(chromeos)',
132 'chromecast%': '<(chromecast)',
133 'desktop_linux%': '<(desktop_linux)',
134 'use_aura%': '<(use_aura)',
135 'use_ash%': '<(use_ash)',
136 'use_cras%': '<(use_cras)',
137 'use_ozone%': '<(use_ozone)',
138 'embedded%': '<(embedded)',
139 'use_openssl%': '<(use_openssl)',
140 'use_openssl_certs%': '<(use_openssl_certs)',
141 'enable_viewport%': '<(enable_viewport)',
142 'enable_hidpi%': '<(enable_hidpi)',
143 'buildtype%': '<(buildtype)',
144 'branding%': '<(branding)',
145 'host_arch%': '<(host_arch)',
146 'target_arch%': '<(target_arch)',
148 'target_subarch%': '',
150 # This is set when building the Android WebView inside the Android
151 # build system, using the 'android' gyp backend. The WebView code is
152 # still built when this is unset, but builds using the normal chromium
154 'android_webview_build%': 0,
156 # Set ARM architecture version.
159 # Use aurax11 for clipboard implementation. This is true on linux_aura.
160 'use_clipboard_aurax11%': 0,
164 # If no gomadir is set, it uses the default gomadir.
168 # The system root for cross-compiles. Default: none.
172 # The system libdir used for this ABI.
173 'system_libdir%': 'lib',
181 # Set default value of toolkit_views based on OS.
182 ['OS=="win" or chromeos==1 or use_aura==1', {
188 # Embedded builds use aura without ash or views.
195 # Enable HiDPI on Mac OS, Chrome OS and Windows.
196 ['OS=="mac" or chromeos==1 or OS=="win"', {
200 # Enable App Launcher everywhere but mobile.
201 ['OS!="ios" and OS!="android"', {
202 'enable_app_list%': 1,
204 'enable_app_list%': 0,
207 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
208 'use_default_render_theme%': 1,
210 'use_default_render_theme%': 0,
214 'use_ozone_evdev%': 1,
216 'use_ozone_evdev%': 0,
219 # Set default gomadir.
221 'gomadir': 'c:\\goma\\goma-win',
223 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
226 # Set the default "target_subarch" on iOS. Valid values are "arm32",
227 # "arm64" and "both" (meaning a fat binary).
229 # TODO(sdefresne): change the default from "arm32" to "both" for
230 # "target_subarch" once http://crbug.com/339477 is fixed.
232 # TODO(sdefresne): set the "target_arch" to "arm" once compilation
233 # of skia has been fixed for simulator. http://crbug.com/342377
235 'target_subarch%': 'arm32',
240 # Copy conditionally-set variables out one scope.
241 'chromeos%': '<(chromeos)',
242 'chromecast%': '<(chromecast)',
243 'host_arch%': '<(host_arch)',
244 'target_arch%': '<(target_arch)',
245 'target_subarch%': '<(target_subarch)',
246 'toolkit_views%': '<(toolkit_views)',
247 'desktop_linux%': '<(desktop_linux)',
248 'use_aura%': '<(use_aura)',
249 'use_ash%': '<(use_ash)',
250 'use_cras%': '<(use_cras)',
251 'use_ozone%': '<(use_ozone)',
252 'use_ozone_evdev%': '<(use_ozone_evdev)',
253 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
254 'embedded%': '<(embedded)',
255 'use_openssl%': '<(use_openssl)',
256 'use_openssl_certs%': '<(use_openssl_certs)',
257 'enable_viewport%': '<(enable_viewport)',
258 'enable_hidpi%': '<(enable_hidpi)',
259 'android_webview_build%': '<(android_webview_build)',
260 'use_goma%': '<(use_goma)',
261 'gomadir%': '<(gomadir)',
262 'enable_app_list%': '<(enable_app_list)',
263 'use_default_render_theme%': '<(use_default_render_theme)',
264 'buildtype%': '<(buildtype)',
265 'branding%': '<(branding)',
266 'arm_version%': '<(arm_version)',
267 'sysroot%': '<(sysroot)',
268 'chroot_cmd%': '<(chroot_cmd)',
269 'system_libdir%': '<(system_libdir)',
271 # Set to 1 to enable fast builds. Set to 2 for even faster builds
272 # (it disables debug info for fastest compilation - only for use
273 # on compile-only bots).
276 # Set to 1 to not store any build metadata (this isn't working yet but
277 # this flag will help us to get there). See http://crbug.com/314403.
278 # TODO(sebmarchand): Update this comment once this flag guarantee that
279 # there's no build metadata in the build artifacts.
280 'dont_embed_build_metadata%': 0,
282 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
283 # This is useful for parallel compilation tools which can't support /Zi.
284 # Only used on Windows.
287 # Set to 1 to enable dcheck in release.
288 'dcheck_always_on%': 0,
290 # Set to 1 to make a build that disables unshipped tracing events.
291 # Note: this setting is ignored if buildtype=="Official".
292 'tracing_like_official_build%': 0,
294 # Disable image loader component extension by default.
295 'image_loader_extension%': 0,
297 # Set NEON compilation flags.
300 # Detect NEON support at run-time.
301 'arm_neon_optional%': 0,
303 # Use libjpeg-turbo as the JPEG codec used by Chromium.
304 'use_libjpeg_turbo%': 1,
306 # Use system libjpeg. Note that the system's libjepg will be used even if
307 # use_libjpeg_turbo is set.
308 'use_system_libjpeg%': 0,
310 # By default, component is set to static_library and it can be overriden
311 # by the GYP command line or by ~/.gyp/include.gypi.
312 'component%': 'static_library',
314 # Set to select the Title Case versions of strings in GRD files.
315 'use_titlecase_in_grd_files%': 0,
317 # Use translations provided by volunteers at launchpad.net. This
318 # currently only works on Linux.
319 'use_third_party_translations%': 0,
321 # Remoting compilation is enabled by default. Set to 0 to disable.
324 # Configuration policy is enabled by default. Set to 0 to disable.
325 'configuration_policy%': 1,
327 # Variable safe_browsing is used to control the build time configuration
328 # for safe browsing feature. Safe browsing can be compiled in 3 different
329 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
330 # reporting features without enabling phishing and malware detection. This
331 # is useful to integrate a third party phishing/malware detection to
332 # existing safe browsing logic.
335 # Web speech is enabled by default. Set to 0 to disable.
336 'enable_web_speech%': 1,
338 # Notifications are compiled in by default. Set to 0 to disable.
339 'notifications%' : 1,
341 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
342 # regular builds and 1 for ASan builds.
343 'mac_want_real_dsym%': 'default',
345 # If this is set, the clang plugins used on the buildbot will be used.
346 # Run tools/clang/scripts/update.sh to make sure they are compiled.
347 # This causes 'clang_chrome_plugins_flags' to be set.
348 # Has no effect if 'clang' is not set as well.
349 'clang_use_chrome_plugins%': 1,
351 # Enable building with ASAN (Clang's -fsanitize=address option).
352 # -fsanitize=address only works with clang, but asan=1 implies clang=1
353 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
355 # Enable coverage gathering instrumentation in ASan. This flag also
356 # controls coverage granularity (1 for function-level coverage, 2 for
357 # block-level coverage).
360 # Enable Chromium overrides of the default configurations for various
361 # dynamic tools (like ASan).
362 'use_sanitizer_options%': 1,
364 # Enable building with SyzyAsan.
365 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
368 # Enable building with LSan (Clang's -fsanitize=leak option).
369 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
370 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
373 # Enable building with TSan (Clang's -fsanitize=thread option).
374 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
375 # See http://clang.llvm.org/docs/ThreadSanitizer.html
377 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
379 # Enable building with MSan (Clang's -fsanitize=memory option).
380 # MemorySanitizer only works with clang, but msan=1 implies clang=1
381 # See http://clang.llvm.org/docs/MemorySanitizer.html
383 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
384 # Track where uninitialized memory originates from. From fastest to
385 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
386 # - track the chain of stores leading from allocation site to use site.
387 'msan_track_origins%': 1,
389 # Enable building with UBSan (Clang's -fsanitize=undefined option).
390 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
391 # See http://clang.llvm.org/docs/UsersManual.html
394 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr -fsanitize=null options).
395 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
397 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan_vptr/blacklist.txt',
399 # Use the dynamic libraries instrumented by one of the sanitizers
400 # instead of the standard system libraries.
401 'use_instrumented_libraries%': 0,
403 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
404 # stdlibc++ as standard library. This is intended to use for instrumented
406 'use_custom_libcxx%': 0,
408 # Use a modified version of Clang to intercept allocated types and sizes
409 # for allocated objects. clang_type_profiler=1 implies clang=1.
410 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
411 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
412 'clang_type_profiler%': 0,
414 # Set to true to instrument the code with function call logger.
415 # See src/third_party/cygprofile/cyg-profile.cc for details.
416 'order_profiling%': 0,
418 # Use the provided profiled order file to link Chrome image with it.
419 # This makes Chrome faster by better using CPU cache when executing code.
420 # This is known as PGO (profile guided optimization).
421 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
422 'order_text_section%' : "",
424 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
425 # libraries on linux x86-64 and arm, plus ASLR.
428 # Whether one-click signin is enabled or not.
429 'enable_one_click_signin%': 0,
431 # Whether to back up data before sync.
432 'enable_pre_sync_backup%': 0,
434 # Enable Chrome browser extensions
435 'enable_extensions%': 1,
438 'enable_google_now%': 1,
440 # Enable printing support and UI. This variable is used to configure
441 # which parts of printing will be built. 0 disables printing completely,
442 # 1 enables it fully, and 2 enables only the codepath to generate a
443 # Metafile (e.g. usually a PDF or EMF) and disables print preview, cloud
445 'enable_printing%': 1,
447 # Windows prints using a PDF as the metafile from the renderer.
448 'win_pdf_metafile_for_printing%': 1,
450 # Set the version of CLD.
451 # 0: Don't specify the version. This option is for the Finch testing.
456 # For CLD2, the size of the tables that should be included in the build
457 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
459 # See third_party/cld_2/cld_2.gyp for more information.
460 # 0: Small tables, lower accuracy
461 # 1: Medium tables, medium accuracy
462 # 2: Large tables, high accuracy
463 'cld2_table_size%': 2,
465 # The data acquisition mode for CLD2. Possible values are:
466 # static: CLD2 data is statically linked to the executable.
467 # standalone: CLD2 data is provided in a standalone file that is
468 # bundled with the executable.
469 # component: CLD2 data is provided as a Chrome "component" and is
470 # downloaded via the component updater.
472 # For more information on switching the CLD2 data source, see:
473 # https://sites.google.com/a/chromium.org/dev/developers/how-tos/compact-language-detector-cld-data-source-configuration
474 'cld2_data_source%': 'static',
476 # Enable spell checker.
477 'enable_spellcheck%': 1,
479 # Webrtc compilation is enabled by default. Set to 0 to disable.
482 # Enables use of the session service, which is enabled by default.
483 # Support for disabling depends on the platform.
484 'enable_session_service%': 1,
486 # Enables theme support, which is enabled by default. Support for
487 # disabling depends on the platform.
490 # Enables autofill dialog and associated features; disabled by default.
491 'enable_autofill_dialog%' : 0,
493 # Defaults Wallet integration in Autofill dialog to use production
494 # servers. Unofficial builds won't have the proper API keys.
495 'enable_prod_wallet_service%': 0,
497 # Enables support for background apps.
498 'enable_background%': 1,
500 # Enable the task manager by default.
501 'enable_task_manager%': 1,
503 # Enables used resource whitelist generation; disabled by default.
504 'enable_resource_whitelist_generation%': 0,
506 # Enable FILE support by default.
507 'disable_file_support%': 0,
509 # Enable FTP support by default.
510 'disable_ftp_support%': 0,
512 # Use native android functions in place of ICU. Not supported by most
514 'use_icu_alternatives_on_android%': 0,
516 # XInput2 multitouch support is enabled by default (use_xi2_mt=2).
517 # Setting to zero value disables XI2 MT. When XI2 MT is enabled,
518 # the input value also defines the required XI2 minor minimum version.
519 # For example, use_xi2_mt=2 means XI2.2 or above version is required.
522 # Use of precompiled headers on Windows.
524 # This variable may be explicitly set to 1 (enabled) or 0
525 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
526 # This setting will override the default.
529 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
531 'chromium_win_pch%': 0,
533 # Set this to true when building with Clang.
534 # See http://code.google.com/p/chromium/wiki/Clang for details.
537 # Enable plug-in installation by default.
538 'enable_plugin_installation%': 1,
540 # Specifies whether to use canvas_skia.cc in place of platform
541 # specific implementations of gfx::Canvas. Affects text drawing in the
543 # TODO(asvitkine): Enable this on all platforms and delete this flag.
544 # http://crbug.com/105550
545 'use_canvas_skia%': 0,
547 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
548 # with one of those tools.
549 'build_for_tool%': '',
551 # If no directory is specified then a temporary directory will be used.
552 'test_isolation_outdir%': '',
553 # True if isolate should fail if the isolate files refer to files
555 'test_isolation_fail_on_missing': 0,
557 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
558 'wix_path%': '<(DEPTH)/third_party/wix',
560 # Managed users are enabled by default.
561 'enable_managed_users%': 1,
563 # Platform natively supports discardable memory.
564 'native_discardable_memory%': 0,
566 # Platform sends memory pressure signals natively.
567 'native_memory_pressure_signals%': 0,
569 'data_reduction_fallback_host%' : '',
570 'data_reduction_dev_host%' : '',
571 'spdy_proxy_auth_origin%' : '',
572 'spdy_proxy_auth_property%' : '',
573 'spdy_proxy_auth_value%' : '',
574 'data_reduction_proxy_probe_url%' : '',
575 'data_reduction_proxy_warmup_url%' : '',
576 'data_reduction_proxy_ssl_origin%' : '',
577 'data_reduction_proxy_alt_origin%' : '',
578 'data_reduction_proxy_alt_fallback_origin%' : '',
580 'enable_service_discovery%': 0,
581 'enable_wifi_bootstrapping%': 0,
582 'enable_hangout_services_extension%': 0,
584 # Enable the Syzygy optimization step.
585 'syzygy_optimize%': 0,
587 # Enable hole punching for the protected video.
590 # Automatically select platforms under ozone. Turn this off to
591 # build only explicitly selected platforms.
592 'ozone_auto_platforms%': 1,
595 # A flag for POSIX platforms
602 # A flag for BSD platforms
603 ['OS=="freebsd" or OS=="openbsd"', {
610 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
616 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
617 # OpenSSL's certificate definition.
618 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
619 'use_openssl_certs%': 1,
621 'use_openssl_certs%': 0,
624 # libudev usage. This currently only affects the content layer.
625 ['OS=="linux" and embedded==0', {
631 # Flags to use X11 on non-Mac POSIX platforms.
632 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
639 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
645 # Flags to use pango and cairo.
646 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
655 ['OS=="linux" and embedded==0', {
661 # We always use skia text rendering in Aura on Windows, since GDI
662 # doesn't agree with our BackingStore.
663 # TODO(beng): remove once skia text rendering is on by default.
664 ['use_aura==1 and OS=="win"', {
665 'enable_skia_text%': 1,
668 # A flag to enable or disable our compile-time dependency
669 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
670 # support will be available. This option is useful
671 # for Linux distributions and for Aura.
672 ['OS!="linux" or chromeos==1', {
673 'use_gnome_keyring%': 0,
675 'use_gnome_keyring%': 1,
678 ['OS=="mac" or OS=="ios"', {
679 # Mac and iOS want Title Case strings
680 'use_titlecase_in_grd_files%': 1,
683 # Enable loader extensions on Chrome OS.
685 'image_loader_extension%': 1,
687 'image_loader_extension%': 0,
690 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
691 'enable_one_click_signin%': 1,
692 'enable_pre_sync_backup%': 1,
696 'enable_extensions%': 0,
697 'enable_google_now%': 0,
699 'enable_spellcheck%': 0,
703 'arm_neon_optional%': 1,
704 'native_discardable_memory%': 1,
705 'native_memory_pressure_signals%': 1,
706 'enable_printing%': 2,
707 'enable_task_manager%':0,
708 # Set to 1 once we have a notification system for Android.
709 # http://crbug.com/115320
714 # Android OS includes support for proprietary codecs regardless of
715 # building Chromium or Google Chrome. We also ship Google Chrome and
716 # Chromecast with proprietary codecs.
717 ['OS=="android" or branding=="Chrome" or chromecast==1', {
718 'proprietary_codecs%': 1,
720 'proprietary_codecs%': 0,
723 ['OS=="mac" or OS=="ios"', {
724 'native_discardable_memory%': 1,
725 'native_memory_pressure_signals%': 1,
728 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
729 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
730 'enable_autofill_dialog%': 1,
733 ['buildtype=="Official"', {
734 'enable_prod_wallet_service%': 1,
744 'disable_ftp_support%': 1,
745 'enable_extensions%': 0,
746 'enable_google_now%': 0,
748 'enable_printing%': 0,
749 'enable_session_service%': 0,
755 'enable_managed_users%': 0,
756 'enable_task_manager%': 0,
759 # Use GPU accelerated cross process image transport by default
760 # on linux builds with the Aura window manager
761 ['use_aura==1 and OS=="linux"', {
762 'ui_compositor_image_transport%': 1,
764 'ui_compositor_image_transport%': 0,
767 # Turn precompiled headers on by default.
768 ['OS=="win" and buildtype!="Official"', {
769 'chromium_win_pch%': 1
772 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
773 'enable_plugin_installation%': 0,
775 'enable_plugin_installation%': 1,
778 # Whether PPAPI is enabled.
779 ['OS=="android" or OS=="ios" or embedded==1', {
780 'enable_plugins%': 0,
782 'enable_plugins%': 1,
785 # linux_use_bundled_gold: whether to use the gold linker binary checked
786 # into third_party/binutils. Force this off via GYP_DEFINES when you
787 # are using a custom toolchain and need to control -B in ldflags.
788 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
789 # for component=static_library builds.
790 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
791 'linux_use_bundled_gold%': 1,
793 'linux_use_bundled_gold%': 0,
796 # linux_use_bundled_binutils: whether to use the binary binutils
797 # checked into third_party/binutils. These are not multi-arch so cannot
798 # be used except on x86 and x86-64 (the only two architectures which
799 # are currently checke in). Force this off via GYP_DEFINES when you
800 # are using a custom toolchain and need to control -B in cflags.
801 ['OS=="linux" and (target_arch=="x64")', {
802 'linux_use_bundled_binutils%': 1,
804 'linux_use_bundled_binutils%': 0,
807 # linux_use_gold_flags: whether to use build flags that rely on gold.
808 # On by default for x64 Linux.
809 ['OS=="linux" and target_arch=="x64"', {
810 'linux_use_gold_flags%': 1,
812 'linux_use_gold_flags%': 0,
815 # linux_use_debug_fission: whether to use split DWARF debug info
816 # files. This can reduce link time significantly, but is incompatible
817 # with some utilities such as icecc and ccache. Requires gold and
818 # gcc >= 4.8 or clang.
819 # http://gcc.gnu.org/wiki/DebugFission
820 ['OS=="linux" and target_arch=="x64"', {
821 'linux_use_debug_fission%': 1,
823 'linux_use_debug_fission%': 0,
826 ['OS=="android" or OS=="ios"', {
827 'enable_captive_portal_detection%': 0,
829 'enable_captive_portal_detection%': 1,
832 # Enable Skia UI text drawing incrementally on different platforms.
833 # http://crbug.com/105550
835 # On Aura, this allows per-tile painting to be used in the browser
838 'use_canvas_skia%': 1,
842 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
843 'use_libjpeg_turbo%': 0,
847 # When building as part of the Android system, use system libraries
848 # where possible to reduce ROM size.
849 'use_system_libjpeg%': '<(android_webview_build)',
852 # Do not enable the Settings App on ChromeOS.
853 ['enable_app_list==1 and chromeos==0', {
854 'enable_settings_app%': 1,
856 'enable_settings_app%': 0,
859 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
860 # Set some defaults for arm/linux chrome builds
861 'use_allocator%': 'none',
862 # sysroot needs to be an absolute path otherwise it generates
863 # incorrect results when passed to pkg-config
864 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot',
865 }], # OS=="linux" and target_arch=="arm" and chromeos==0
867 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
869 ['target_arch=="x64"', {
870 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
872 ['target_arch=="ia32"', {
873 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
876 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
878 ['OS=="linux" and target_arch=="mipsel"', {
879 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
880 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
883 # Whether tests targets should be run, archived or just have the
884 # dependencies verified. All the tests targets have the '_run' suffix,
885 # e.g. base_unittests_run runs the target base_unittests. The test
886 # target always calls tools/swarming_client/isolate.py. See the script's
887 # --help for more information and the valid --mode values. Meant to be
888 # overriden with GYP_DEFINES.
889 # TODO(maruel): Remove the conditions as more configurations are
891 # NOTE: The check for disable_nacl==0 and component=="static_library"
892 # can't be used here because these variables are not defined yet, but it
893 # is still not supported.
894 ['OS!="ios" and OS!="android" and chromeos==0', {
895 'test_isolation_mode%': 'check',
897 'test_isolation_mode%': 'noop',
899 # Whether Android build uses OpenMAX DL FFT.
900 ['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")', {
901 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
902 # When enabled, this will also enable WebAudio support on
903 # Android for these architectures. Default is enabled. Whether
904 # WebAudio is actually available depends on runtime settings
906 'use_openmax_dl_fft%': 1,
908 'use_openmax_dl_fft%': 0,
910 ['OS=="win" or OS=="linux"', {
914 # Turns on compiler optimizations in V8 in Debug build, except
915 # on android_clang, where we're hitting a weird linker error.
916 # TODO(dpranke): http://crbug.com/266155 .
918 'v8_optimized_debug%': 1,
920 'v8_optimized_debug%': 2,
923 # Disable various features by default on embedded.
926 'enable_printing%': 0,
929 # By default, use ICU data file (icudtl.dat) on all platforms
930 # except when building Android WebView or Chromecast.
931 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
932 # Set the data reduction proxy origin for Android Webview.
933 ['android_webview_build==0 and chromecast==0', {
934 'icu_use_data_file_flag%' : 1,
935 'spdy_proxy_auth_origin%': '',
936 'data_reduction_proxy_probe_url%': '',
937 'data_reduction_proxy_warmup_url%': '',
938 'data_reduction_dev_host%': '',
939 'data_reduction_fallback_host%': '',
941 'icu_use_data_file_flag%' : 0,
942 'spdy_proxy_auth_origin%': 'https://proxy.googlezip.net:443/',
943 'data_reduction_proxy_probe_url%': 'http://check.googlezip.net/connect',
944 'data_reduction_proxy_warmup_url%': 'http://www.gstatic.com/generate_204',
945 'data_reduction_dev_host%': 'http://proxy-dev.googlezip.net:80/',
946 'data_reduction_fallback_host%': 'http://compress.googlezip.net:80/',
948 ['OS=="win" or OS=="mac"', {
949 'enable_wifi_bootstrapping%' : 1,
953 # Set this to 1 to enable use of concatenated impulse responses
954 # for the HRTF panner in WebAudio.
955 'use_concatenated_impulse_responses': 1,
957 # You can set the variable 'use_official_google_api_keys' to 1
958 # to use the Google-internal file containing official API keys
959 # for Google Chrome even in a developer build. Setting this
960 # variable explicitly to 1 will cause your build to fail if the
961 # internal file is missing.
963 # The variable is documented here, but not handled in this file;
964 # see //google_apis/determine_use_official_keys.gypi for the
967 # Set the variable to 0 to not use the internal file, even when
968 # it exists in your checkout.
970 # Leave it unset in your include.gypi to have the variable
971 # implicitly set to 1 if you have
972 # src/google_apis/internal/google_chrome_api_keys.h in your
973 # checkout, and implicitly set to 0 if not.
975 # Note that official builds always behave as if the variable
976 # was explicitly set to 1, i.e. they always use official keys,
977 # and will fail to build if the internal file is missing.
979 # NOTE: You MUST NOT explicitly set the variable to 2 in your
980 # include.gypi or by other means. Due to subtleties of GYP, this
981 # is not the same as leaving the variable unset, even though its
983 # //google_apis/determine_use_official_keys.gypi is 2.
985 # Set these to bake the specified API keys and OAuth client
986 # IDs/secrets into your build.
988 # If you create a build without values baked in, you can instead
989 # set environment variables to provide the keys at runtime (see
990 # src/google_apis/google_api_keys.h for details). Features that
991 # require server-side APIs may fail to work if no keys are
994 # Note that if you are building an official build or if
995 # use_official_google_api_keys has been set to 1 (explicitly or
996 # implicitly), these values will be ignored and the official
997 # keys will be used instead.
998 'google_api_key%': '',
999 'google_default_client_id%': '',
1000 'google_default_client_secret%': '',
1001 # Native Client is enabled by default.
1002 'disable_nacl%': '0',
1005 # Copy conditionally-set variables out one scope.
1006 'branding%': '<(branding)',
1007 'buildtype%': '<(buildtype)',
1008 'target_arch%': '<(target_arch)',
1009 'target_subarch%': '<(target_subarch)',
1010 'host_arch%': '<(host_arch)',
1011 'toolkit_views%': '<(toolkit_views)',
1012 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1013 'use_aura%': '<(use_aura)',
1014 'use_ash%': '<(use_ash)',
1015 'use_cras%': '<(use_cras)',
1016 'use_openssl%': '<(use_openssl)',
1017 'use_openssl_certs%': '<(use_openssl_certs)',
1018 'use_nss%': '<(use_nss)',
1019 'use_udev%': '<(use_udev)',
1020 'os_bsd%': '<(os_bsd)',
1021 'os_posix%': '<(os_posix)',
1022 'use_dbus%': '<(use_dbus)',
1023 'use_glib%': '<(use_glib)',
1024 'use_pango%': '<(use_pango)',
1025 'use_cairo%': '<(use_cairo)',
1026 'use_ozone%': '<(use_ozone)',
1027 'use_ozone_evdev%': '<(use_ozone_evdev)',
1028 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1029 'desktop_linux%': '<(desktop_linux)',
1030 'use_x11%': '<(use_x11)',
1031 'use_gnome_keyring%': '<(use_gnome_keyring)',
1032 'linux_fpic%': '<(linux_fpic)',
1033 'chromeos%': '<(chromeos)',
1034 'chromecast%': '<(chromecast)',
1035 'enable_viewport%': '<(enable_viewport)',
1036 'enable_hidpi%': '<(enable_hidpi)',
1037 'use_xi2_mt%':'<(use_xi2_mt)',
1038 'image_loader_extension%': '<(image_loader_extension)',
1039 'fastbuild%': '<(fastbuild)',
1040 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1041 'win_z7%': '<(win_z7)',
1042 'dcheck_always_on%': '<(dcheck_always_on)',
1043 'tracing_like_official_build%': '<(tracing_like_official_build)',
1044 'arm_version%': '<(arm_version)',
1045 'arm_neon%': '<(arm_neon)',
1046 'arm_neon_optional%': '<(arm_neon_optional)',
1047 'sysroot%': '<(sysroot)',
1048 'chroot_cmd%': '<(chroot_cmd)',
1049 'system_libdir%': '<(system_libdir)',
1050 'component%': '<(component)',
1051 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1052 'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
1053 'use_third_party_translations%': '<(use_third_party_translations)',
1054 'remoting%': '<(remoting)',
1055 'enable_one_click_signin%': '<(enable_one_click_signin)',
1056 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1057 'enable_webrtc%': '<(enable_webrtc)',
1058 'chromium_win_pch%': '<(chromium_win_pch)',
1059 'configuration_policy%': '<(configuration_policy)',
1060 'safe_browsing%': '<(safe_browsing)',
1061 'enable_web_speech%': '<(enable_web_speech)',
1062 'notifications%': '<(notifications)',
1063 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1064 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1066 'asan_coverage%': '<(asan_coverage)',
1067 'use_sanitizer_options%': '<(use_sanitizer_options)',
1068 'syzyasan%': '<(syzyasan)',
1069 'syzygy_optimize%': '<(syzygy_optimize)',
1072 'msan_blacklist%': '<(msan_blacklist)',
1073 'msan_track_origins%': '<(msan_track_origins)',
1075 'tsan_blacklist%': '<(tsan_blacklist)',
1076 'ubsan%': '<(ubsan)',
1077 'ubsan_vptr%': '<(ubsan_vptr)',
1078 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1079 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1080 'use_custom_libcxx%': '<(use_custom_libcxx)',
1081 'clang_type_profiler%': '<(clang_type_profiler)',
1082 'order_profiling%': '<(order_profiling)',
1083 'order_text_section%': '<(order_text_section)',
1084 'enable_extensions%': '<(enable_extensions)',
1085 'enable_plugin_installation%': '<(enable_plugin_installation)',
1086 'enable_plugins%': '<(enable_plugins)',
1087 'enable_session_service%': '<(enable_session_service)',
1088 'enable_themes%': '<(enable_themes)',
1089 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1090 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1091 'enable_background%': '<(enable_background)',
1092 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1093 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1094 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1095 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1096 'use_canvas_skia%': '<(use_canvas_skia)',
1097 'test_isolation_mode%': '<(test_isolation_mode)',
1098 'test_isolation_outdir%': '<(test_isolation_outdir)',
1099 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1100 'enable_printing%': '<(enable_printing)',
1101 'win_pdf_metafile_for_printing%': '<(win_pdf_metafile_for_printing)',
1102 'enable_spellcheck%': '<(enable_spellcheck)',
1103 'enable_google_now%': '<(enable_google_now)',
1104 'cld_version%': '<(cld_version)',
1105 'cld2_table_size%': '<(cld2_table_size)',
1106 'cld2_data_source%': '<(cld2_data_source)',
1107 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1108 'disable_file_support%': '<(disable_file_support)',
1109 'disable_ftp_support%': '<(disable_ftp_support)',
1110 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1111 'enable_task_manager%': '<(enable_task_manager)',
1112 'sas_dll_path%': '<(sas_dll_path)',
1113 'wix_path%': '<(wix_path)',
1114 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1115 'use_system_libjpeg%': '<(use_system_libjpeg)',
1116 'android_webview_build%': '<(android_webview_build)',
1117 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1118 'gyp_managed_install%': 0,
1119 'create_standalone_apk%': 1,
1120 'enable_app_list%': '<(enable_app_list)',
1121 'use_default_render_theme%': '<(use_default_render_theme)',
1122 'enable_settings_app%': '<(enable_settings_app)',
1123 'google_api_key%': '<(google_api_key)',
1124 'google_default_client_id%': '<(google_default_client_id)',
1125 'google_default_client_secret%': '<(google_default_client_secret)',
1126 'enable_managed_users%': '<(enable_managed_users)',
1127 'native_discardable_memory%': '<(native_discardable_memory)',
1128 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1129 'data_reduction_fallback_host%': '<(data_reduction_fallback_host)',
1130 'data_reduction_dev_host%': '<(data_reduction_dev_host)',
1131 'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)',
1132 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1133 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1134 'data_reduction_proxy_probe_url%': '<(data_reduction_proxy_probe_url)',
1135 'data_reduction_proxy_warmup_url%': '<(data_reduction_proxy_warmup_url)',
1136 'data_reduction_proxy_ssl_origin%' : '<(data_reduction_proxy_ssl_origin)',
1137 'data_reduction_proxy_alt_origin%' : '<(data_reduction_proxy_alt_origin)',
1138 'data_reduction_proxy_alt_fallback_origin%' : '<(data_reduction_proxy_alt_fallback_origin)',
1139 'enable_mdns%' : '<(enable_mdns)',
1140 'enable_service_discovery%' : '<(enable_service_discovery)',
1141 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1142 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1143 'v8_optimized_debug%': '<(v8_optimized_debug)',
1144 'proprietary_codecs%': '<(proprietary_codecs)',
1145 'use_goma%': '<(use_goma)',
1146 'gomadir%': '<(gomadir)',
1147 'video_hole%': '<(video_hole)',
1149 # Use system protobuf instead of bundled one.
1150 'use_system_protobuf%': 0,
1152 # Use system yasm instead of bundled one.
1153 'use_system_yasm%': 0,
1155 # Use system ICU instead of bundled one.
1156 'use_system_icu%' : 0,
1158 # Default to enabled PIE; this is important for ASLR but we may need to be
1159 # able to turn it off for various reasons.
1160 'linux_disable_pie%': 0,
1162 # The release channel that this build targets. This is used to restrict
1163 # channel-specific build options, like which installer packages to create.
1164 # The default is 'all', which does no channel-specific filtering.
1167 # Override chromium_mac_pch and set it to 0 to suppress the use of
1168 # precompiled headers on the Mac. Prefix header injection may still be
1169 # used, but prefix headers will not be precompiled. This is useful when
1170 # using distcc to distribute a build to compile slaves that don't
1171 # share the same compiler executable as the system driving the compilation,
1172 # because precompiled headers rely on pointers into a specific compiler
1173 # executable's image. Setting this to 0 is needed to use an experimental
1174 # Linux-Mac cross compiler distcc farm.
1175 'chromium_mac_pch%': 1,
1177 # The default value for mac_strip in target_defaults. This cannot be
1178 # set there, per the comment about variable% in a target_defaults.
1179 'mac_strip_release%': 0,
1181 # Set to 1 to enable java code coverage. Instruments classes during build
1182 # to produce .ec files during runtime.
1183 'emma_coverage%': 0,
1185 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1186 # separated with whitespace and/or comma. Only has effect if
1187 # 'emma_coverage=1'.
1190 # Set to 1 to enable running Android lint on java/class files.
1193 # Although base/allocator lets you select a heap library via an
1194 # environment variable, the libcmt shim it uses sometimes gets in
1195 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1196 # 'win_use_allocator_shim': 0,
1197 # 'win_release_RuntimeLibrary': 2
1198 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1199 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1201 # TODO(bradnelson): eliminate this when possible.
1202 # To allow local gyp files to prevent release.vsprops from being included.
1203 # Yes(1) means include release.vsprops.
1204 # Once all vsprops settings are migrated into gyp, this can go away.
1205 'msvs_use_common_release%': 1,
1207 # TODO(bradnelson): eliminate this when possible.
1208 # To allow local gyp files to override additional linker options for msvs.
1209 # Yes(1) means set use the common linker options.
1210 'msvs_use_common_linker_extras%': 1,
1212 # TODO(sgk): eliminate this if possible.
1213 # It would be nicer to support this via a setting in 'target_defaults'
1214 # in chrome/app/locales/locales.gypi overriding the setting in the
1215 # 'Debug' configuration in the 'target_defaults' dict below,
1216 # but that doesn't work as we'd like.
1217 'msvs_debug_link_incremental%': '2',
1219 # Needed for some of the largest modules.
1220 'msvs_debug_link_nonincremental%': '1',
1222 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1223 # to get incremental linking to be faster in debug builds.
1224 'incremental_chrome_dll%': '0',
1226 # Experimental setting to break chrome.dll into multiple pieces based on
1228 'chrome_multiple_dll%': '0',
1230 # Experimental setting to optimize Chrome's DLLs with PGO.
1231 'chrome_pgo_phase%': '0',
1233 # The default settings for third party code for treating
1234 # warnings-as-errors. Ideally, this would not be required, however there
1235 # is some third party code that takes a long time to fix/roll. So, this
1236 # flag allows us to have warnings as errors in general to prevent
1237 # regressions in most modules, while working on the bits that are
1239 'win_third_party_warn_as_error%': 'true',
1242 'clang%': '<(clang)',
1243 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
1245 # Control which version of clang to use when building for iOS. If set to
1246 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1247 # the version of clang that ships with the Chromium source. This variable
1248 # is automatically set to '1' when using the Xcode generator.
1251 # These two variables can be set in GYP_DEFINES while running
1252 # |gclient runhooks| to let clang run a plugin in every compilation.
1253 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1255 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1258 'clang_add_plugin%': '',
1260 # Tell ld64 to write map files describing binary layout. Useful
1261 # for looking at what contributes to binary size, e.g. with
1262 # https://github.com/nico/bloat
1263 'mac_write_linker_maps%': 0,
1265 # The default type of gtest.
1266 'gtest_target_type%': 'executable',
1268 # Enable sampling based profiler.
1269 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1271 # Profile without optimizing out stack frames when profiling==1.
1272 'profiling_full_stack_frames%': '0',
1274 # And if we want to dump symbols for Breakpad-enabled builds.
1275 'linux_dump_symbols%': 0,
1276 # And if we want to strip the binary after dumping symbols.
1277 'linux_strip_binary%': 0,
1278 # Strip the test binaries needed for Linux reliability tests.
1279 'linux_strip_reliability_tests%': 0,
1280 # If we want stack unwind support for backtrace().
1281 'debug_unwind_tables%': 1,
1282 'release_unwind_tables%': 1,
1284 # Override where to find binutils
1285 'binutils_version%': 0,
1286 'binutils_dir%': '',
1289 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1290 'use_allocator%': 'tcmalloc',
1292 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1293 'linux_link_gnome_keyring%': 0,
1294 # Set to 1 to link against gsettings APIs instead of using dlopen().
1295 'linux_link_gsettings%': 0,
1297 # Default arch variant for MIPS.
1298 'mips_arch_variant%': 'mips32r1',
1300 # Enable use of OpenMAX DL FFT routines.
1301 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1303 # Enable new NPDevice API.
1304 'enable_new_npdevice_api%': 0,
1306 # Enable EGLImage support in OpenMAX
1307 'enable_eglimage%': 1,
1309 # .gyp files or targets should set chromium_code to 1 if they build
1310 # Chromium-specific code, as opposed to external code. This variable is
1311 # used to control such things as the set of warnings to enable, and
1312 # whether warnings are treated as errors.
1313 'chromium_code%': 0,
1315 # Disable fatal linker warnings, similarly to how we make it possible
1316 # to disable -Werror (e.g. for different toolchain versions).
1317 'disable_fatal_linker_warnings%': 0,
1319 'release_valgrind_build%': 0,
1321 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1322 'enable_wexit_time_destructors%': 0,
1324 # Build libpeerconnection as a static library by default.
1325 'libpeer_target_type%': 'static_library',
1327 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1328 'internal_gles2_conform_tests%': 0,
1330 # Set to 1 to compile the filter fuzzer.
1331 'internal_filter_fuzzer%': 0,
1333 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1334 # so Cocoa is happy (http://crbug.com/20441).
1336 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1337 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1338 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1339 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1340 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1341 'vi', 'zh-CN', 'zh-TW',
1344 # Pseudo locales are special locales which are used for testing and
1345 # debugging. They don't get copied to the final app. For more info,
1346 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1353 # If debug_devtools is set to 1, JavaScript files for DevTools are
1354 # stored as is and loaded from disk. Otherwise, a concatenated file
1355 # is stored in resources.pak. It is still possible to load JS files
1356 # from disk by passing --debug-devtools cmdline switch.
1357 'debug_devtools%': 0,
1359 # The Java Bridge is not compiled in by default.
1362 # Code signing for iOS binaries. The bots need to be able to disable this.
1363 'chromium_ios_signing%': 1,
1365 # This flag is only used when disable_nacl==0 and disables all those
1366 # subcomponents which would require the installation of a native_client
1367 # untrusted toolchain.
1368 'disable_nacl_untrusted%': 0,
1370 # Disable Dart by default.
1373 # Copy out the setting of disable_nacl.
1374 'disable_nacl%': '<(disable_nacl)',
1376 # Portable Native Client is enabled by default.
1377 'disable_pnacl%': 0,
1379 # Whether to build full debug version for Debug configuration on Android.
1380 # Compared to full debug version, the default Debug configuration on Android
1381 # has no full v8 debug, has size optimization and linker gc section, so that
1382 # we can build a debug version with acceptable size and performance.
1383 'android_full_debug%': 0,
1385 # Sets the default version name and code for Android app, by default we
1386 # do a developer build.
1387 'android_app_version_name%': 'Developer Build',
1388 'android_app_version_code%': 0,
1390 # Contains data about the attached devices for gyp_managed_install.
1391 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1393 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1394 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1396 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1397 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1399 # Whether we are using the rlz library or not. Platforms like Android send
1400 # rlz codes for searches but do not use the library.
1403 # Turns on the i18n support in V8.
1404 'v8_enable_i18n_support': 1,
1406 # Compile d8 for the host toolset.
1407 'v8_toolset_for_d8': 'host',
1409 # Compiles v8 without its platform library.
1410 'v8_use_default_platform': 0,
1412 # Use the chromium skia by default.
1413 'use_system_skia%': '0',
1415 # Use brlapi from brltty for braille display support.
1418 # Relative path to icu.gyp from this file.
1419 'icu_gyp_path': '../third_party/icu/icu.gyp',
1421 # IPC fuzzer is disabled by default.
1422 'enable_ipc_fuzzer%': 0,
1425 # Force disable libstdc++ debug mode.
1426 'disable_glibcxx_debug%': 0,
1428 # Set to 1 to compile with MSE support for MPEG2 TS
1429 'enable_mpeg2ts_stream_parser%': 0,
1431 # Support ChromeOS touchpad gestures with ozone.
1432 'use_evdev_gestures%': 0,
1434 # Default ozone platform (if no --ozone-platform flag).
1435 'ozone_platform%': "",
1437 # Ozone platforms to include in the build.
1438 'ozone_platform_caca%': 0,
1439 'ozone_platform_dri%': 0,
1440 'ozone_platform_egltest%': 0,
1441 'ozone_platform_gbm%': 0,
1442 'ozone_platform_ozonex%': 0,
1443 'ozone_platform_test%': 0,
1445 # Chrome OS: whether to build ChromeVox from sources in the Chromium
1446 # repository rather than using precompiled JavaScript in
1447 # chrome/third_party/chromevox. This is still experimental.
1448 'use_migrated_chromevox%': 1,
1450 # Chrome OS: whether to also build the upcoming version of
1451 # ChromeVox, which can then be enabled via a command-line switch.
1452 'use_chromevox_next%': 0,
1455 # Enable the Syzygy optimization step for the official builds.
1456 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1457 'syzygy_optimize%': 1,
1459 'syzygy_optimize%': 0,
1461 # Get binutils version so we can enable debug fission if we can.
1462 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1464 # compiler_version doesn't work with clang
1465 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1466 # compiler_version works with clang.
1467 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1468 # that it takes effect here.
1469 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1470 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1472 # On Android we know the binutils version in the toolchain.
1474 'binutils_version%': 222,
1476 ['host_arch=="x64"', {
1477 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1479 ['host_arch=="ia32"', {
1480 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1482 # Our version of binutils in third_party/binutils
1483 ['linux_use_bundled_binutils==1', {
1484 'binutils_version%': 224,
1488 'binutils_version%': 0,
1490 # The version of GCC in use, set later in platforms that use GCC and have
1491 # not explicitly chosen to build with clang. Currently, this means all
1492 # platforms except Windows, Mac and iOS.
1493 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1494 # it takes effect here.
1495 ['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', {
1498 # We directly set the gcc versions since we know what we use.
1501 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1503 ['android_webview_build==1', {
1504 # Android WebView uses a hermetic toolchain even for host, so set it
1507 ['host_os=="mac"', {
1508 'host_gcc_version%': 42,
1510 'host_gcc_version%': 46,
1513 }, { # android_webview_build!=1
1514 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1518 'host_gcc_version%': 0,
1521 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1522 'windows_sdk_path%': '<(windows_sdk_default_path)',
1524 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
1526 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1527 'directx_sdk_path%': '<(directx_sdk_default_path)',
1529 'directx_sdk_path%': '$(DXSDK_DIR)',
1532 'windows_driver_kit_path%': '$(WDK_DIR)',
1534 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1536 ['target_arch=="mipsel"', {
1539 'nacl_untrusted_build%': 0,
1540 'use_allocator%': 'none',
1542 ['OS=="linux" and target_arch=="mipsel"', {
1543 'sysroot%': '<(sysroot)',
1546 # All Chrome builds have breakpad symbols, but only process the
1547 # symbols from official builds.
1548 ['(branding=="Chrome" and buildtype=="Official")', {
1549 'linux_dump_symbols%': 1,
1551 # Omit unwind support in official release builds to save space. We
1552 # can use breakpad for these builds.
1553 'release_unwind_tables%': 0,
1556 # For official builds, use a 64-bit linker to avoid running out
1557 # of address space. The buildbots should have a 64-bit kernel
1558 # and a 64-bit libc installed.
1559 ['host_arch=="ia32" and target_arch=="ia32"', {
1560 'linux_use_bundled_gold%': '1',
1561 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1566 }], # os_posix==1 and OS!="mac" and OS!="ios"
1569 'enable_background%': 0,
1570 'icu_use_data_file_flag%': 1,
1571 'enable_web_speech%': 0,
1572 'use_system_libxml%': 1,
1573 'use_system_sqlite%': 1,
1575 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1576 'fi', 'fr', 'he', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms', 'nb',
1577 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr', 'uk',
1578 'vi', 'zh-CN', 'zh-TW',
1581 # The Mac SDK is set for iOS builds and passed through to Mac
1582 # sub-builds. This allows the Mac sub-build SDK in an iOS build to be
1583 # overridden from the command line the same way it is for a Mac build.
1584 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py 10.6)',
1586 # iOS SDK and deployment target support. The |ios_sdk| value is left
1587 # blank so that when it is set in the project files it will be the
1588 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1589 # causes Xcode to spit out a warning for every single project file for
1590 # not using the "current" SDK.
1592 'ios_sdk_path%': '',
1593 'ios_deployment_target%': '6.0',
1596 # ios_product_name is set to the name of the .app bundle as it should
1598 ['branding=="Chrome"', {
1599 'ios_product_name%': 'Chrome',
1600 }, { # else: branding!="Chrome"
1601 'ios_product_name%': 'Chromium',
1603 ['branding=="Chrome" and buildtype=="Official"', {
1605 }, { # else: branding!="Chrome" or buildtype!="Official"
1611 # Location of Android NDK.
1614 # Unfortunately we have to use absolute paths to the SDK/NDK because
1615 # they're passed to ant which uses a different relative path from
1617 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1618 'android_ndk_experimental_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk_experimental/',
1619 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1620 'android_host_arch%': '<!(uname -m)',
1621 # Android API-level of the SDK used for compilation.
1622 'android_sdk_version%': '19',
1623 'android_sdk_build_tools_version%': '19.0.0',
1624 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1626 # Copy conditionally-set variables out one scope.
1627 'android_ndk_root%': '<(android_ndk_root)',
1628 'android_sdk_root%': '<(android_sdk_root)',
1629 'android_sdk_version%': '<(android_sdk_version)',
1630 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1631 'host_os%': '<(host_os)',
1633 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1634 # Android SDK build tools (e.g. dx, aapt, aidl)
1635 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1637 # Android API level 14 is ICS (Android 4.0) which is the minimum
1638 # platform requirement for Chrome on Android, we use it for native
1641 ['target_arch == "ia32"', {
1642 'android_app_abi%': 'x86',
1643 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1644 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1645 'android_ndk_lib_dir%': 'usr/lib',
1646 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1648 ['target_arch == "x64"', {
1649 'android_app_abi%': 'x86_64',
1650 'android_gdbserver%': '<(android_ndk_experimental_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1651 'android_ndk_sysroot%': '<(android_ndk_experimental_root)/platforms/android-L/arch-x86_64',
1652 'android_ndk_lib_dir%': 'usr/lib64',
1653 'android_toolchain%': '<(android_ndk_experimental_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1654 'android_stlport_root': '<(android_ndk_experimental_root)/sources/cxx-stl/stlport',
1656 ['target_arch=="arm"', {
1659 'android_app_abi%': 'armeabi',
1661 'android_app_abi%': 'armeabi-v7a',
1664 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1665 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1666 'android_ndk_lib_dir%': 'usr/lib',
1667 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1669 ['target_arch == "arm64"', {
1670 'android_app_abi%': 'arm64-v8a',
1671 'android_gdbserver%': '<(android_ndk_experimental_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1672 'android_ndk_sysroot%': '<(android_ndk_experimental_root)/platforms/android-L/arch-arm64',
1673 'android_ndk_lib_dir%': 'usr/lib',
1674 'android_toolchain%': '<(android_ndk_experimental_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1675 'android_stlport_root': '<(android_ndk_experimental_root)/sources/cxx-stl/stlport',
1677 ['target_arch == "mipsel"', {
1678 'android_app_abi%': 'mips',
1679 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1680 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1681 'android_ndk_lib_dir%': 'usr/lib',
1682 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1686 # Copy conditionally-set variables out one scope.
1687 'android_app_abi%': '<(android_app_abi)',
1688 'android_gdbserver%': '<(android_gdbserver)',
1689 'android_ndk_root%': '<(android_ndk_root)',
1690 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1691 'android_sdk_root%': '<(android_sdk_root)',
1692 'android_sdk_version%': '<(android_sdk_version)',
1693 'android_toolchain%': '<(android_toolchain)',
1695 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1696 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1697 'android_sdk_tools%': '<(android_sdk_tools)',
1698 'android_sdk%': '<(android_sdk)',
1699 'android_sdk_jar%': '<(android_sdk)/android.jar',
1701 'android_stlport_root': '<(android_stlport_root)',
1702 'android_stlport_include': '<(android_stlport_root)/stlport',
1703 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1704 'host_os%': '<(host_os)',
1706 # Location of the "objcopy" binary, used by both gyp and scripts.
1707 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1709 # Location of the "strip" binary, used by both gyp and scripts.
1710 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1712 # Location of the "readelf" binary.
1713 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1715 # Determines whether we should optimize JNI generation at the cost of
1716 # breaking assumptions in the build system that when inputs have changed
1717 # the outputs should always change as well. This is meant purely for
1718 # developer builds, to avoid spurious re-linking of native files.
1719 'optimize_jni_generation%': 0,
1721 # Always uses openssl.
1723 'use_openssl_certs%': 1,
1725 'proprietary_codecs%': '<(proprietary_codecs)',
1726 'safe_browsing%': 2,
1727 'enable_web_speech%': 0,
1729 'build_ffmpegsumo%': 0,
1730 'use_allocator%': 'none',
1732 # Disable Native Client.
1735 # Android does not support background apps.
1736 'enable_background%': 0,
1738 # Sessions are store separately in the Java side.
1739 'enable_session_service%': 0,
1743 'gtest_target_type%': 'shared_library',
1745 # Uses system APIs for decoding audio and video.
1746 'use_libffmpeg%': '0',
1748 # When building as part of the Android system, use system libraries
1749 # where possible to reduce ROM size.
1750 # TODO(steveblock): Investigate using the system version of sqlite.
1751 'use_system_sqlite%': 0, # '<(android_webview_build)',
1752 'use_system_expat%': '<(android_webview_build)',
1753 'use_system_icu%': '<(android_webview_build)',
1754 'use_system_stlport%': '<(android_webview_build)',
1756 # Copy it out one scope.
1757 'android_webview_build%': '<(android_webview_build)',
1760 'use_system_fontconfig%': 0,
1762 'use_system_fontconfig%': 1,
1765 'ffmpeg_branding%': 'Chrome',
1766 'ozone_platform_ozonex%': 1,
1768 ['target_arch=="arm"', {
1770 'arm_tune%': 'cortex-a9',
1772 'enable_mpeg2ts_stream_parser%': 1,
1777 ['android_webview_build==1', {
1778 # When building the WebView in the Android tree, jarjar will remap all
1779 # the class names, so the JNI generator needs to know this.
1780 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1784 # All Chrome builds have breakpad symbols, but only process the
1785 # symbols from official builds.
1786 ['(branding=="Chrome" and buildtype=="Official")', {
1787 'mac_strip_release%': 1,
1791 ['OS=="mac" or OS=="ios"', {
1795 # Mac OS X SDK and deployment target support. The SDK identifies
1796 # the version of the system headers that will be used, and
1797 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1798 # macro. "Maximum allowed" refers to the operating system version
1799 # whose APIs are available in the headers. The deployment target
1800 # identifies the minimum system version that the built products are
1801 # expected to function on. It corresponds to the
1802 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1803 # macros are available, #include <AvailabilityMacros.h>. Additional
1804 # documentation on these macros is available at
1805 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1806 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1807 # deployment target to 10.6. Other projects, such as O3D, may
1808 # override these defaults.
1810 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1811 # about that is at least the specified version. In official builds,
1812 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1813 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1814 # path to the SDK; when set to a non-empty string, SDK detection
1815 # based on mac_sdk_min will be bypassed entirely.
1816 'mac_sdk_min%': '10.6',
1817 'mac_sdk_path%': '',
1819 'mac_deployment_target%': '10.6',
1822 'mac_sdk_min': '<(mac_sdk_min)',
1823 'mac_sdk_path': '<(mac_sdk_path)',
1824 'mac_deployment_target': '<(mac_deployment_target)',
1826 # Compile in Breakpad support by default so that it can be
1827 # tested, even if it is not enabled by default at runtime.
1828 'mac_breakpad_compiled_in%': 1,
1830 # mac_product_name is set to the name of the .app bundle as it should
1831 # appear on disk. This duplicates data from
1832 # chrome/app/theme/chromium/BRANDING and
1833 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1834 # these names into the build system.
1835 ['branding=="Chrome"', {
1836 'mac_product_name%': 'Google Chrome',
1837 }, { # else: branding!="Chrome"
1838 'mac_product_name%': 'Chromium',
1841 ['branding=="Chrome" and buildtype=="Official"', {
1842 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1843 # Enable uploading crash dumps.
1844 'mac_breakpad_uploads%': 1,
1845 # Enable dumping symbols at build time for use by Mac Breakpad.
1847 # Enable Keystone auto-update support.
1849 }, { # else: branding!="Chrome" or buildtype!="Official"
1850 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1851 'mac_breakpad_uploads%': 0,
1856 }], # OS=="mac" or OS=="ios"
1859 # This is the architecture convention used in WinSDK paths.
1860 ['target_arch=="ia32"', {
1861 'winsdk_arch%': 'x86',
1863 'winsdk_arch%': '<(target_arch)',
1865 ['component=="shared_library"', {
1866 'win_use_allocator_shim%': 0,
1868 # Turn on multiple dll by default on Windows when in static_library.
1869 'chrome_multiple_dll%': 1,
1872 'win_use_allocator_shim%': 0,
1874 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1875 # Only enabled by default for ninja because it's buggy in VS.
1876 # Not enabled for component=static_library because some targets
1877 # are too large and the toolchain fails due to the size of the
1879 'incremental_chrome_dll%': 1,
1881 # Don't do incremental linking for large modules on 32-bit or when
1882 # component=static_library as the toolchain fails due to the size of
1884 ['MSVS_OS_BITS==32 or component=="static_library"', {
1885 'msvs_large_module_debug_link_mode%': '1', # No
1887 'msvs_large_module_debug_link_mode%': '2', # Yes
1889 ['MSVS_VERSION=="2013e"', {
1897 'nacl_win64_defines': [
1898 # This flag is used to minimize dependencies when building
1899 # Native Client loader for 64-bit Windows.
1904 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1910 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1911 'enable_pepper_cdms%': 1,
1913 'enable_pepper_cdms%': 0,
1917 'enable_browser_cdms%': 1,
1919 'enable_browser_cdms%': 0,
1922 # Native Client glibc toolchain is enabled
1923 # by default except on arm and mips.
1924 ['target_arch=="arm" or target_arch=="mipsel"', {
1925 'disable_glibc%': 1,
1927 'disable_glibc%': 0,
1930 # Set the relative path from this file to the GYP file of the JPEG
1931 # library used by Chromium.
1932 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1933 # Configuration for using the system libjeg is here.
1934 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1936 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1939 # Options controlling the use of GConf (the classic GNOME configuration
1940 # system) and GIO, which contains GSettings (the new GNOME config system).
1941 ['chromeos==1 or embedded==1', {
1949 # Set up -D and -E flags passed into grit.
1950 ['branding=="Chrome"', {
1951 # TODO(mmoss) The .grd files look for _google_chrome, but for
1952 # consistency they should look for google_chrome_build like C++.
1953 'grit_defines': ['-D', '_google_chrome',
1954 '-E', 'CHROMIUM_BUILD=google_chrome'],
1956 'grit_defines': ['-D', '_chromium',
1957 '-E', 'CHROMIUM_BUILD=chromium'],
1960 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
1962 ['desktop_linux==1', {
1963 'grit_defines': ['-D', 'desktop_linux'],
1965 ['toolkit_views==1', {
1966 'grit_defines': ['-D', 'toolkit_views'],
1969 'grit_defines': ['-D', 'use_aura'],
1972 'grit_defines': ['-D', 'use_ash'],
1975 'grit_defines': ['-D', 'use_nss'],
1978 'grit_defines': ['-D', 'use_ozone'],
1980 ['image_loader_extension==1', {
1981 'grit_defines': ['-D', 'image_loader_extension'],
1984 'grit_defines': ['-D', 'remoting'],
1986 ['use_titlecase_in_grd_files==1', {
1987 'grit_defines': ['-D', 'use_titlecase'],
1989 ['use_third_party_translations==1', {
1990 'grit_defines': ['-D', 'use_third_party_translations'],
1992 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
1993 'ka', 'ku', 'kw', 'ms', 'ug'
1997 'grit_defines': ['-t', 'android',
1998 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true'],
2000 ['OS=="mac" or OS=="ios"', {
2001 'grit_defines': ['-D', 'scale_factors=2x'],
2006 # iOS uses a whitelist to filter resources.
2007 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
2010 # Enable host builds when generating with ninja-ios.
2012 ['"<(GENERATOR)"=="ninja"', {
2016 # TODO(sdefresne): Remove the target_subarch check once Apple has
2017 # upstreamed the support for "arm64". http://crbug.com/341453
2018 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
2023 ['enable_extensions==1', {
2024 'grit_defines': ['-D', 'enable_extensions'],
2026 ['enable_plugins!=0', {
2027 'grit_defines': ['-D', 'enable_plugins'],
2029 ['enable_printing!=0', {
2030 'grit_defines': ['-D', 'enable_printing'],
2032 ['enable_printing==1', {
2033 'grit_defines': ['-D', 'enable_full_printing'],
2035 ['enable_themes==1', {
2036 'grit_defines': ['-D', 'enable_themes'],
2038 ['enable_app_list==1', {
2039 'grit_defines': ['-D', 'enable_app_list'],
2041 ['enable_settings_app==1', {
2042 'grit_defines': ['-D', 'enable_settings_app'],
2044 ['enable_google_now==1', {
2045 'grit_defines': ['-D', 'enable_google_now'],
2047 ['use_concatenated_impulse_responses==1', {
2048 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2050 ['enable_webrtc==1', {
2051 'grit_defines': ['-D', 'enable_webrtc'],
2053 ['enable_hangout_services_extension==1', {
2054 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2056 ['enable_task_manager==1', {
2057 'grit_defines': ['-D', 'enable_task_manager'],
2059 ['notifications==1', {
2060 'grit_defines': ['-D', 'enable_notifications'],
2062 ['enable_wifi_bootstrapping==1', {
2063 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2065 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2066 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2068 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2069 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2071 ['enable_mdns==1 or OS=="mac"', {
2072 'grit_defines': ['-D', 'enable_service_discovery'],
2073 'enable_service_discovery%': 1
2075 ['clang_use_chrome_plugins==1 and OS!="win"', {
2076 'clang_chrome_plugins_flags': [
2077 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
2080 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2082 'use_allocator%': 'none',
2090 ['asan==1 and OS=="mac"', {
2091 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
2092 # runtime is fully adopted. See http://crbug.com/242503.
2093 'mac_strip_release': 0,
2096 'use_custom_libcxx%': 1,
2099 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2100 # libstdc++. This is required to avoid false positive reports whenever
2101 # the C++ standard library is used.
2102 'use_custom_libcxx%': 1,
2103 # Running the V8-generated code on an ARM simulator is a powerful hack
2104 # that allows the tool to see the memory accesses from JITted code.
2105 # Without this flag, JS code causes false positive reports from MSan.
2106 'v8_target_arch': 'arm64',
2109 ['OS=="linux" and clang_type_profiler==1', {
2111 'clang_use_chrome_plugins%': 0,
2113 ['host_arch=="x64"', {
2114 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2116 ['host_arch=="ia32"', {
2117 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2118 # Clang in this directory at your own risk if needed for some
2119 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2120 # usage). Any failure by this compiler should not close the tree.
2121 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2127 # The Clang plugins don't currently work on Windows.
2128 # TODO(hans): One day, this will work. (crbug.com/82385)
2129 'clang_use_chrome_plugins%': 0,
2132 # On valgrind bots, override the optimizer settings so we don't inline too
2133 # much and make the stacks harder to figure out.
2135 # TODO(rnk): Kill off variables that no one else uses and just implement
2136 # them under a build_for_tool== condition.
2137 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2139 'mac_debug_optimization': '1',
2140 'mac_release_optimization': '1',
2141 'release_optimize': '1',
2142 'no_gc_sections': 1,
2143 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2144 '-fno-builtin -fno-optimize-sibling-calls',
2145 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2146 '-fno-builtin -fno-optimize-sibling-calls',
2148 # MSVS flags for TSan on Pin and Windows.
2149 'win_debug_RuntimeChecks': '0',
2150 'win_debug_disable_iterator_debugging': '1',
2151 'win_debug_Optimization': '1',
2152 'win_debug_InlineFunctionExpansion': '0',
2153 'win_release_InlineFunctionExpansion': '0',
2154 'win_release_OmitFramePointers': '0',
2156 'use_allocator': 'tcmalloc',
2157 'release_valgrind_build': 1,
2159 'component': 'static_library',
2160 'use_system_zlib': 0,
2163 # Build tweaks for DrMemory.
2164 # TODO(rnk): Combine with tsan config to share the builder.
2165 # http://crbug.com/108155
2166 ['build_for_tool=="drmemory"', {
2167 # These runtime checks force initialization of stack vars which blocks
2168 # DrMemory's uninit detection.
2169 'win_debug_RuntimeChecks': '0',
2170 # Iterator debugging is slow.
2171 'win_debug_disable_iterator_debugging': '1',
2172 # Try to disable optimizations that mess up stacks in a release build.
2173 # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054)
2174 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2175 # compiler bug, so we use /Ob1 instead.
2176 'win_release_InlineFunctionExpansion': '1',
2177 'win_release_OmitFramePointers': '0',
2178 # Ditto for debug, to support bumping win_debug_Optimization.
2179 'win_debug_InlineFunctionExpansion': 0,
2180 'win_debug_OmitFramePointers': 0,
2181 # Keep the code under #ifndef NVALGRIND.
2182 'release_valgrind_build': 1,
2185 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2186 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2190 # Set default compiler flags depending on ARM version.
2191 ['arm_version==6 and android_webview_build==0', {
2192 'arm_arch%': 'armv6',
2195 'arm_float_abi%': 'softfp',
2198 ['arm_version==7 and android_webview_build==0', {
2199 'arm_arch%': 'armv7-a',
2200 'arm_tune%': 'generic-armv7-a',
2205 'arm_fpu%': 'vfpv3-d16',
2208 # Change the default to hard once the armhf transition is complete.
2209 'arm_float_abi%': 'softfp',
2213 ['android_webview_build==1', {
2214 # The WebView build gets its cpu-specific flags from the Android build system.
2218 'arm_float_abi%': '',
2222 # Enable brlapi by default for chromeos.
2227 ['use_ozone==1 and ozone_auto_platforms==1', {
2228 # Use test as the default platform.
2229 'ozone_platform%': 'test',
2231 # Build all platforms whose deps are in install-build-deps.sh.
2232 # Only these platforms will be compile tested by buildbots.
2233 'ozone_platform_dri%': 1,
2234 'ozone_platform_test%': 1,
2235 'ozone_platform_egltest%': 1,
2238 ['use_ozone==1 and ozone_auto_platforms==1 and chromeos==1', {
2239 # Use dri as the default platform.
2240 'ozone_platform%': 'dri',
2243 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2244 'use_clipboard_aurax11%': 1,
2247 ['OS=="win" and use_goma==1', {
2248 # goma doesn't support pch yet.
2249 'chromium_win_pch': 0,
2250 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2258 ['OS=="win" and (clang==1 or asan==1)', {
2259 'chromium_win_pch': 0,
2262 # The seccomp-bpf sandbox is only supported on three architectures
2264 # Do not disable seccomp_bpf anywhere without talking to
2265 # security@chromium.org!
2266 ['((OS=="linux" or OS=="android") and '
2267 '(target_arch=="ia32" or target_arch=="x64" or '
2268 'target_arch=="arm"))', {
2269 'use_seccomp_bpf%': 1,
2271 'use_seccomp_bpf%': 0,
2275 # The path to the ANGLE library.
2276 'angle_path': '<(DEPTH)/third_party/angle',
2278 # List of default apps to install in new profiles. The first list contains
2279 # the source files as found in svn. The second list, used only for linux,
2280 # contains the destination location for each of the files. When a crx
2281 # is added or removed from the list, the chrome/browser/resources/
2282 # default_apps/external_extensions.json file must also be updated.
2283 'default_apps_list': [
2284 'browser/resources/default_apps/external_extensions.json',
2285 'browser/resources/default_apps/gmail.crx',
2286 'browser/resources/default_apps/search.crx',
2287 'browser/resources/default_apps/youtube.crx',
2288 'browser/resources/default_apps/drive.crx',
2289 'browser/resources/default_apps/docs.crx',
2291 'default_apps_list_linux_dest': [
2292 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2293 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2294 '<(PRODUCT_DIR)/default_apps/search.crx',
2295 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2296 '<(PRODUCT_DIR)/default_apps/drive.crx',
2297 '<(PRODUCT_DIR)/default_apps/docs.crx',
2300 'target_defaults': {
2302 # The condition that operates on chromium_code is in a target_conditions
2303 # section, and will not have access to the default fallback value of
2304 # chromium_code at the top of this file, or to the chromium_code
2305 # variable placed at the root variables scope of .gyp files, because
2306 # those variables are not set at target scope. As a workaround,
2307 # if chromium_code is not set at target scope, define it in target scope
2308 # to contain whatever value it has during early variable expansion.
2309 # That's enough to make it available during target conditional
2311 'chromium_code%': '<(chromium_code)',
2313 'component%': '<(component)',
2315 'chromecast%': '<(chromecast)',
2317 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2318 'win_release_Optimization%': '2', # 2 = /Os
2319 'win_debug_Optimization%': '0', # 0 = /Od
2321 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2322 # Tri-state: blank is default, 1 on, 0 off
2323 'win_release_OmitFramePointers%': '0',
2324 # Tri-state: blank is default, 1 on, 0 off
2325 'win_debug_OmitFramePointers%': '',
2327 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2328 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2330 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2331 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2332 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2334 # VS inserts quite a lot of extra checks to algorithms like
2335 # std::partial_sort in Debug build which make them O(N^2)
2336 # instead of O(N*logN). This is particularly slow under memory
2337 # tools like ThreadSanitizer so we want it to be disablable.
2338 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2339 'win_debug_disable_iterator_debugging%': '0',
2341 # An application manifest fragment to declare compatibility settings for
2342 # 'executable' targets. Ignored in other target type.
2343 'win_exe_compatibility_manifest%':
2344 '<(DEPTH)\\build\\win\\compatibility.manifest',
2346 'release_extra_cflags%': '',
2347 'debug_extra_cflags%': '',
2349 'release_valgrind_build%': '<(release_valgrind_build)',
2351 # the non-qualified versions are widely assumed to be *nix-only
2352 'win_release_extra_cflags%': '',
2353 'win_debug_extra_cflags%': '',
2355 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2356 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2358 # Only used by Windows build for now. Can be used to build into a
2359 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2360 # output files in src/build/VS2010_{Debug,Release}.
2361 'build_dir_prefix%': '',
2363 # Targets are by default not nacl untrusted code.
2364 'nacl_untrusted_build%': 0,
2366 'pnacl_compile_flags': [
2367 # pnacl uses the clang compiler so we need to suppress all the
2368 # same warnings as we do for clang.
2369 # TODO(sbc): Remove these if/when they are removed from the clang
2371 '-Wno-unused-function',
2372 '-Wno-char-subscripts',
2373 '-Wno-c++11-extensions',
2374 '-Wno-unnamed-type-template-args',
2378 ['OS=="win" and component=="shared_library"', {
2379 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2380 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2381 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2383 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2384 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2385 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2388 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2389 'mac_release_optimization%': 's', # Use -Os unless overridden
2390 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2392 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2393 'mac_release_optimization%': '3', # Use -O3 unless overridden
2394 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2397 'host_os%': '<(host_os)', # See comment above chromium_code.
2402 # Don't use deprecated V8 APIs anywhere.
2403 'V8_DEPRECATION_WARNINGS',
2404 # Temporary suppression until Blink code can be removed.
2405 'BLINK_SCALE_FILTERS_AT_RECORD_TIME',
2408 '<(SHARED_INTERMEDIATE_DIR)',
2411 ['(OS=="mac" or OS=="ios") and asan==1', {
2413 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2416 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2417 'cflags_cc!': ['-fno-rtti'],
2420 '-gline-tables-only',
2421 '-fintercept-allocation-functions',
2423 'defines': ['TYPE_PROFILING'],
2425 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2428 ['OS=="linux" and clang==1 and host_arch=="ia32"', {
2429 # TODO(dmikurube): Remove -Wno-sentinel when Clang/LLVM is fixed.
2430 # See http://crbug.com/162818.
2431 'cflags+': ['-Wno-sentinel'],
2433 ['branding=="Chrome"', {
2434 'defines': ['GOOGLE_CHROME_BUILD'],
2435 }, { # else: branding!="Chrome"
2436 'defines': ['CHROMIUM_BUILD'],
2438 ['OS=="mac" and component=="shared_library"', {
2440 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2441 'LD_RUNPATH_SEARCH_PATHS': [
2442 # For unbundled binaries.
2444 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2445 '@loader_path/../../..',
2449 ['clang==1 and OS!="win"', {
2450 # This is here so that all files get recompiled after a clang roll and
2451 # when turning clang on or off.
2452 # (defines are passed via the command line, and build systems rebuild
2453 # things when their commandline changes). Nothing should ever read this
2455 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2458 'defines': ['ENABLE_RLZ'],
2460 ['component=="shared_library"', {
2461 'defines': ['COMPONENT_BUILD'],
2463 ['toolkit_views==1', {
2464 'defines': ['TOOLKIT_VIEWS=1'],
2466 ['ui_compositor_image_transport==1', {
2467 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2470 'defines': ['USE_AURA=1'],
2473 'defines': ['USE_ASH=1'],
2476 'defines': ['USE_CAIRO=1'],
2479 'defines': ['USE_CRAS=1'],
2482 'defines': ['USE_GLIB=1'],
2485 'defines': ['USE_OZONE=1'],
2487 ['use_default_render_theme==1', {
2488 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2490 ['use_libjpeg_turbo==1', {
2491 'defines': ['USE_LIBJPEG_TURBO=1'],
2494 'defines': ['USE_X11=1'],
2496 ['use_clipboard_aurax11==1', {
2497 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2499 ['enable_one_click_signin==1', {
2500 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2502 ['enable_pre_sync_backup==1', {
2503 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2505 ['use_xi2_mt!=0 and use_x11==1', {
2506 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2508 ['image_loader_extension==1', {
2509 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2512 'defines': ['ENABLE_PROFILING=1'],
2515 'defines': ['ENABLE_REMOTING=1'],
2517 ['enable_webrtc==1', {
2518 'defines': ['ENABLE_WEBRTC=1'],
2520 ['proprietary_codecs==1', {
2521 'defines': ['USE_PROPRIETARY_CODECS'],
2523 ['enable_viewport==1', {
2524 'defines': ['ENABLE_VIEWPORT'],
2526 ['enable_pepper_cdms==1', {
2527 'defines': ['ENABLE_PEPPER_CDMS'],
2529 ['enable_browser_cdms==1', {
2530 'defines': ['ENABLE_BROWSER_CDMS'],
2532 ['configuration_policy==1', {
2533 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2535 ['notifications==1', {
2536 'defines': ['ENABLE_NOTIFICATIONS'],
2538 ['enable_hidpi==1', {
2539 'defines': ['ENABLE_HIDPI=1'],
2541 ['native_discardable_memory==1', {
2542 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2544 ['native_memory_pressure_signals==1', {
2545 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2548 'defines': ['USE_UDEV'],
2552 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2555 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2556 # Clang creates chubby debug information, which makes linking very
2557 # slow. For now, don't create debug information with clang. See
2558 # http://crbug.com/70000
2562 'debug_extra_cflags': '-g0',
2565 # Android builds symbols on release by default, disable them.
2568 'debug_extra_cflags': '-g0',
2569 'release_extra_cflags': '-g0',
2573 }, { # else clang!=1
2575 ['OS=="win" and fastbuild==2', {
2576 # Completely disable debug information.
2579 'GenerateDebugInformation': 'false',
2581 'VCCLCompilerTool': {
2582 'DebugInformationFormat': '0',
2586 ['OS=="win" and fastbuild==1', {
2589 # This tells the linker to generate .pdbs, so that
2590 # we can get meaningful stack traces.
2591 'GenerateDebugInformation': 'true',
2593 'VCCLCompilerTool': {
2594 # No debug info to be generated by compiler.
2595 'DebugInformationFormat': '0',
2599 ['OS=="linux" and fastbuild==2', {
2601 'debug_extra_cflags': '-g0',
2604 ['OS=="linux" and fastbuild==1', {
2606 'debug_extra_cflags': '-g1',
2609 ['OS=="android" and fastbuild==2', {
2611 'debug_extra_cflags': '-g0',
2612 'release_extra_cflags': '-g0',
2615 ['OS=="android" and fastbuild==1', {
2617 'debug_extra_cflags': '-g1',
2618 'release_extra_cflags': '-g1',
2625 ['dont_embed_build_metadata==1', {
2627 'DONT_EMBED_BUILD_METADATA',
2629 }], # dont_embed_build_metadata==1
2630 ['dcheck_always_on!=0', {
2631 'defines': ['DCHECK_ALWAYS_ON=1'],
2632 }], # dcheck_always_on!=0
2633 ['tracing_like_official_build!=0', {
2634 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2635 }], # tracing_like_official_build!=0
2636 ['win_use_allocator_shim==0', {
2639 'defines': ['NO_TCMALLOC'],
2643 ['enable_eglimage==1', {
2645 'ENABLE_EGLIMAGE=1',
2650 'ADDRESS_SANITIZER',
2651 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2652 'MEMORY_SANITIZER_INITIAL_SIZE',
2656 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2664 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2665 'MEMORY_SANITIZER_INITIAL_SIZE',
2671 '_CRT_SECURE_NO_DEPRECATE',
2672 '_SCL_SECURE_NO_DEPRECATE',
2673 # This define is required to pull in the new Win8 interfaces from
2674 # system headers like ShObjIdl.h.
2675 'NTDDI_VERSION=0x06020000',
2676 # This is required for ATL to use XP-safe versions of its functions.
2677 '_USING_V110_SDK71_',
2680 '<(DEPTH)/third_party/wtl/include',
2685 # Generates debug info when win_z7=1
2686 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2688 'GenerateDebugInformation': 'true',
2690 'VCCLCompilerTool': {
2691 'DebugInformationFormat': '1',
2702 ['target_arch=="arm"', {
2704 # TODO(lcwu): Work around an error when building Chromium
2705 # with gcc-4.5.3 (e.g. v8/src/platform-linux.cc). Remove
2706 # this define once the toolchain is updated.
2707 # See crbug.com/388933.
2713 ['enable_task_manager==1', {
2715 'ENABLE_TASK_MANAGER=1',
2718 ['enable_extensions==1', {
2720 'ENABLE_EXTENSIONS=1',
2723 ['OS=="win" and branding=="Chrome"', {
2724 'defines': ['ENABLE_SWIFTSHADER'],
2726 ['enable_dart==1', {
2727 'defines': ['WEBKIT_USING_DART=1'],
2729 ['enable_plugin_installation==1', {
2730 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2732 ['enable_plugins==1', {
2733 'defines': ['ENABLE_PLUGINS=1'],
2735 ['enable_session_service==1', {
2736 'defines': ['ENABLE_SESSION_SERVICE=1'],
2738 ['enable_themes==1', {
2739 'defines': ['ENABLE_THEMES=1'],
2741 ['enable_autofill_dialog==1', {
2742 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2744 ['enable_prod_wallet_service==1', {
2745 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2747 ['enable_background==1', {
2748 'defines': ['ENABLE_BACKGROUND=1'],
2750 ['enable_google_now==1', {
2751 'defines': ['ENABLE_GOOGLE_NOW=1'],
2753 ['cld_version!=0', {
2754 'defines': ['CLD_VERSION=<(cld_version)'],
2756 ['cld2_data_source=="static"', {
2757 'defines': ['CLD_DATA_FROM_STATIC'],
2759 # CLD2 headers use this #define to control the visibility of dynamic
2760 # mode functions. We use these functions, so we must define here for
2761 # our #includes to work right.
2762 'defines': ['CLD2_DYNAMIC_MODE'],
2764 ['cld2_data_source=="standalone"', {
2765 'defines': ['CLD_DATA_FROM_STANDALONE'],
2767 ['cld2_data_source=="component"', {
2768 'defines': ['CLD_DATA_FROM_COMPONENT'],
2770 ['enable_printing==1', {
2771 'defines': ['ENABLE_FULL_PRINTING=1', 'ENABLE_PRINTING=1'],
2773 ['enable_printing==2', {
2774 'defines': ['ENABLE_PRINTING=1'],
2776 ['OS=="win" and win_pdf_metafile_for_printing==1', {
2777 'defines': ['WIN_PDF_METAFILE_FOR_PRINTING=1'],
2779 ['enable_spellcheck==1', {
2780 'defines': ['ENABLE_SPELLCHECK=1'],
2782 ['enable_captive_portal_detection==1', {
2783 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2785 ['enable_app_list==1', {
2786 'defines': ['ENABLE_APP_LIST=1'],
2788 ['enable_settings_app==1', {
2789 'defines': ['ENABLE_SETTINGS_APP=1'],
2791 ['disable_file_support==1', {
2792 'defines': ['DISABLE_FILE_SUPPORT=1'],
2794 ['disable_ftp_support==1', {
2795 'defines': ['DISABLE_FTP_SUPPORT=1'],
2797 ['use_icu_alternatives_on_android==1', {
2798 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2800 ['enable_managed_users==1', {
2801 'defines': ['ENABLE_MANAGED_USERS=1'],
2803 ['data_reduction_fallback_host != ""', {
2805 'DATA_REDUCTION_FALLBACK_HOST="<(data_reduction_fallback_host)"'],
2807 ['data_reduction_dev_host != ""', {
2809 'DATA_REDUCTION_DEV_HOST="<(data_reduction_dev_host)"'],
2811 ['spdy_proxy_auth_origin != ""', {
2812 'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'],
2814 ['spdy_proxy_auth_property != ""', {
2815 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2817 ['spdy_proxy_auth_value != ""', {
2818 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2820 ['data_reduction_proxy_probe_url != ""', {
2822 'DATA_REDUCTION_PROXY_PROBE_URL="<(data_reduction_proxy_probe_url)"'],
2824 ['data_reduction_proxy_warmup_url != ""', {
2826 'DATA_REDUCTION_PROXY_WARMUP_URL="<(data_reduction_proxy_warmup_url)"'],
2828 ['data_reduction_proxy_ssl_origin != ""', {
2830 'DATA_REDUCTION_PROXY_SSL_ORIGIN="<(data_reduction_proxy_ssl_origin)"'],
2832 ['data_reduction_proxy_alt_origin != ""', {
2834 'DATA_REDUCTION_PROXY_ALT_ORIGIN="<(data_reduction_proxy_alt_origin)"'],
2836 ['data_reduction_proxy_alt_fallback_origin != ""', {
2838 'DATA_REDUCTION_PROXY_ALT_FALLBACK_ORIGIN="<(data_reduction_proxy_alt_fallback_origin)"'],
2840 ['enable_mdns==1', {
2841 'defines': ['ENABLE_MDNS=1'],
2843 ['enable_service_discovery==1', {
2844 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2846 ['enable_wifi_bootstrapping==1', {
2847 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2849 ['enable_hangout_services_extension==1', {
2850 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2852 ['enable_ipc_fuzzer==1', {
2853 'defines': ['ENABLE_IPC_FUZZER=1'],
2856 'defines': ['VIDEO_HOLE=1'],
2858 ], # conditions for 'target_defaults'
2859 'target_conditions': [
2860 ['<(use_openssl)==1', {
2861 'defines': ['USE_OPENSSL=1'],
2863 ['<(use_openssl_certs)==1', {
2864 'defines': ['USE_OPENSSL_CERTS=1'],
2866 ['>(nacl_untrusted_build)==1', {
2869 'USE_OPENSSL_CERTS=1',
2872 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
2873 'defines': ['USE_NSS=1'],
2875 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
2876 'defines': ['OS_CHROMEOS=1'],
2878 ['enable_wexit_time_destructors==1', {
2882 '-Wexit-time-destructors',
2886 '-Wexit-time-destructors',
2892 ['chromium_code==0', {
2894 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
2895 # We don't want to get warnings from third-party code,
2896 # so remove any existing warning-enabling flags like -Wall.
2902 # Don't warn about hash_map in third-party code.
2906 # Don't warn about printf format problems.
2907 # This is off by default in gcc but on in Ubuntu's gcc(!).
2911 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
2915 # TODO: Fix all warnings on chromeos too.
2916 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
2921 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
2923 # Don't warn about ignoring the return value from e.g. close().
2924 # This is off by default in some gccs but on by default in others.
2925 # BSD systems do not support this option, since they are usually
2926 # using gcc 4.2.1, which does not have this flag yet.
2927 '-Wno-unused-result',
2932 '_CRT_SECURE_NO_DEPRECATE',
2933 '_CRT_NONSTDC_NO_WARNINGS',
2934 '_CRT_NONSTDC_NO_DEPRECATE',
2935 '_SCL_SECURE_NO_DEPRECATE',
2937 'msvs_disabled_warnings': [4800],
2939 'VCCLCompilerTool': {
2940 'WarningLevel': '3',
2941 'WarnAsError': '<(win_third_party_warn_as_error)',
2942 'Detect64BitPortabilityProblems': 'false',
2946 ['buildtype=="Official"', {
2948 'VCCLCompilerTool': { 'WarnAsError': 'false' },
2953 'VCCLCompilerTool': { 'WarnAsError': 'false' },
2958 # TODO(darin): Unfortunately, some third_party code depends on base.
2959 [ 'OS=="win" and component=="shared_library"', {
2960 'msvs_disabled_warnings': [
2961 4251, # class 'std::xx' needs to have dll-interface.
2964 [ 'OS=="mac" or OS=="ios"', {
2966 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
2969 ['buildtype=="Official"', {
2971 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
2978 # TODO(ios): Fix remaining warnings in third-party code, then
2979 # remove this; the Mac cleanup didn't get everything that's
2980 # flagged in an iOS build.
2981 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
2982 'RUN_CLANG_STATIC_ANALYZER': 'NO',
2983 # Several internal ios directories generate numerous warnings for
2984 # -Wobjc-missing-property-synthesis.
2985 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
2991 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
2992 'filename_rules.gypi',
2994 # In Chromium code, we define __STDC_foo_MACROS in order to get the
2995 # C99 macros on Mac and Linux.
2997 '__STDC_CONSTANT_MACROS',
2998 '__STDC_FORMAT_MACROS',
3002 # turn on warnings for signed/unsigned mismatch on chromium code.
3004 'VCCLCompilerTool': {
3005 'AdditionalOptions': ['/we4389'],
3009 ['OS=="win" and component=="shared_library"', {
3010 'msvs_disabled_warnings': [
3011 4251, # class 'std::xx' needs to have dll-interface.
3016 ], # target_conditions for 'target_defaults'
3017 'default_configuration': 'Debug',
3019 # VCLinkerTool LinkIncremental values below:
3021 # 1 == /INCREMENTAL:NO
3023 # Debug links incremental, Release does not.
3025 # Abstract base configurations to cover common attributes.
3029 'msvs_configuration_attributes': {
3030 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3031 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3032 'CharacterSet': '1',
3034 # Add the default import libs.
3037 'AdditionalDependencies': [
3061 'MinimumRequiredVersion': '5.01', # XP.
3062 'TargetMachine': '1',
3064 'VCLibrarianTool': {
3065 'TargetMachine': '1',
3068 'msvs_configuration_platform': 'Win32',
3072 'msvs_configuration_platform': 'x64',
3075 # Make sure to understand http://crbug.com/361720 if you want to
3077 'MinimumRequiredVersion': '5.02', # Server 2003.
3078 'TargetMachine': '17', # x86 - 64
3079 'AdditionalLibraryDirectories!':
3080 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3081 'AdditionalLibraryDirectories':
3082 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3083 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3084 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3086 'VCLibrarianTool': {
3087 'AdditionalLibraryDirectories!':
3088 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3089 'AdditionalLibraryDirectories':
3090 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3091 'TargetMachine': '17', # x64
3098 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3099 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3102 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3104 '<@(debug_extra_cflags)',
3108 'VCCLCompilerTool': {
3109 'Optimization': '<(win_debug_Optimization)',
3110 'PreprocessorDefinitions': ['_DEBUG'],
3111 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3112 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3114 # According to MSVS, InlineFunctionExpansion=0 means
3115 # "default inlining", not "/Ob0".
3116 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3117 ['win_debug_InlineFunctionExpansion==0', {
3118 'AdditionalOptions': ['/Ob0'],
3120 ['win_debug_InlineFunctionExpansion!=""', {
3121 'InlineFunctionExpansion':
3122 '<(win_debug_InlineFunctionExpansion)',
3124 ['win_debug_disable_iterator_debugging==1', {
3125 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3128 # if win_debug_OmitFramePointers is blank, leave as default
3129 ['win_debug_OmitFramePointers==1', {
3130 'OmitFramePointers': 'true',
3132 ['win_debug_OmitFramePointers==0', {
3133 'OmitFramePointers': 'false',
3134 # The above is not sufficient (http://crbug.com/106711): it
3135 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3136 # perform FPO regardless, so we must explicitly disable.
3137 # We still want the false setting above to avoid having
3138 # "/Oy /Oy-" and warnings about overriding.
3139 'AdditionalOptions': ['/Oy-'],
3142 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3145 'LinkIncremental': '<(msvs_debug_link_incremental)',
3146 # ASLR makes debugging with windbg difficult because Chrome.exe and
3147 # Chrome.dll share the same base name. As result, windbg will
3148 # name the Chrome.dll module like chrome_<base address>, where
3149 # <base address> typically changes with each launch. This in turn
3150 # means that breakpoints in Chrome.dll don't stick from one launch
3151 # to the next. For this reason, we turn ASLR off in debug builds.
3152 # Note that this is a three-way bool, where 0 means to pick up
3153 # the default setting, 1 is off and 2 is on.
3154 'RandomizedBaseAddress': 1,
3156 'VCResourceCompilerTool': {
3157 'PreprocessorDefinitions': ['_DEBUG'],
3161 ['OS=="linux" or OS=="android"', {
3162 'target_conditions': [
3163 ['_toolset=="target"', {
3165 '<@(debug_extra_cflags)',
3170 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3171 # Enable libstdc++ debugging facilities to help catch problems
3172 # early, see http://crbug.com/65151 .
3173 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3174 'defines': ['_GLIBCXX_DEBUG=1',],
3176 ['release_valgrind_build==0', {
3179 '-fstack-protector-all', # Implies -fstack-protector
3191 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3192 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3193 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3196 'VCCLCompilerTool': {
3197 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3199 # In official builds, each target will self-select
3200 # an optimization level.
3201 ['buildtype!="Official"', {
3202 'Optimization': '<(win_release_Optimization)',
3205 # According to MSVS, InlineFunctionExpansion=0 means
3206 # "default inlining", not "/Ob0".
3207 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3208 ['win_release_InlineFunctionExpansion==0', {
3209 'AdditionalOptions': ['/Ob0'],
3211 ['win_release_InlineFunctionExpansion!=""', {
3212 'InlineFunctionExpansion':
3213 '<(win_release_InlineFunctionExpansion)',
3216 # if win_release_OmitFramePointers is blank, leave as default
3217 ['win_release_OmitFramePointers==1', {
3218 'OmitFramePointers': 'true',
3220 ['win_release_OmitFramePointers==0', {
3221 'OmitFramePointers': 'false',
3222 # The above is not sufficient (http://crbug.com/106711): it
3223 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3224 # perform FPO regardless, so we must explicitly disable.
3225 # We still want the false setting above to avoid having
3226 # "/Oy /Oy-" and warnings about overriding.
3227 'AdditionalOptions': ['/Oy-'],
3230 'AdditionalOptions': [ '<@(win_release_extra_cflags)', ],
3233 # LinkIncremental is a tri-state boolean, where 0 means default
3234 # (i.e., inherit from parent solution), 1 means false, and
3236 'LinkIncremental': '1',
3237 # This corresponds to the /PROFILE flag which ensures the PDB
3238 # file contains FIXUP information (growing the PDB file by about
3239 # 5%) but does not otherwise alter the output binary. This
3240 # information is used by the Syzygy optimization tool when
3241 # decomposing the release image.
3246 ['msvs_use_common_release', {
3247 'includes': ['release.gypi'],
3249 ['release_valgrind_build==0 and tsan==0', {
3252 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3256 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3257 'MEMORY_SANITIZER_INITIAL_SIZE',
3258 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3259 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3262 ['win_use_allocator_shim==0', {
3263 'defines': ['NO_TCMALLOC'],
3265 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3266 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3267 # TODO(glider): once the bug is fixed, disable source fortification
3268 # under the sanitizer tools only.
3269 ['os_posix==1 and (OS!="linux" or clang!=1)', {
3270 'target_conditions': [
3271 ['chromium_code==1', {
3272 # Non-chromium code is not guaranteed to compile cleanly
3273 # with _FORTIFY_SOURCE. Also, fortified build may fail
3274 # when optimizations are disabled, so only do that for Release
3277 '_FORTIFY_SOURCE=2',
3282 ['OS=="linux" or OS=="android"', {
3283 'target_conditions': [
3284 ['_toolset=="target"', {
3286 '<@(release_extra_cflags)',
3289 ['enable_resource_whitelist_generation==1', {
3291 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3300 'NS_BLOCK_ASSERTIONS=1',
3306 # Concrete configurations
3309 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3312 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3317 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3318 'target_conditions': [
3319 [ '_type=="executable"', {
3320 # To get a real .dSYM bundle produced by dsymutil, set the
3321 # debug information format to dwarf-with-dsym. Since
3322 # strip_from_xcode will not be used, set Xcode to do the
3323 # stripping as well.
3325 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3326 'DEPLOYMENT_POSTPROCESSING': 'YES',
3327 'STRIP_INSTALLED_PRODUCT': 'YES',
3334 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3336 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3339 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3347 'target_defaults': {
3354 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3355 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3356 'target_defaults': {
3358 '-Wl,--fatal-warnings',
3362 ['os_posix==1 and chromeos==0', {
3363 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3364 # and we want to avoid overriding this, so stack-protector is only
3365 # enabled when not building on Chrome OS.
3366 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3368 'target_defaults': {
3370 '-fstack-protector',
3371 '--param=ssp-buffer-size=4',
3375 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3376 'target_defaults': {
3377 # Enable -Werror by default, but put it in a variable so it can
3378 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3380 'werror%': '-Werror',
3381 'libraries_for_target%': '',
3384 '_FILE_OFFSET_BITS=64',
3387 '<(werror)', # See note above about the werror variable.
3390 '-fno-strict-aliasing', # See http://crbug.com/32204
3392 # TODO(evan): turn this back on once all the builds work.
3394 # Don't warn about unused function params. We use those everywhere.
3395 '-Wno-unused-parameter',
3396 # Don't warn about the "struct foo f = {0};" initialization pattern.
3397 '-Wno-missing-field-initializers',
3398 # Don't export any symbols (for example, to plugins we dlopen()).
3399 # Note: this is *required* to make some plugins work.
3400 '-fvisibility=hidden',
3405 '-fno-threadsafe-statics',
3406 # Make inline functions have hidden visiblity by default.
3407 # Surprisingly, not covered by -fvisibility=hidden.
3408 '-fvisibility-inlines-hidden',
3409 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3410 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3414 '-pthread', '-Wl,-z,noexecstack',
3417 '<(libraries_for_target)',
3422 'debug_optimize%': '0',
3428 '-O>(debug_optimize)',
3434 # Warn in case of text relocations.
3435 '-Wl,--warn-shared-textrel',
3438 ['OS=="android" and android_full_debug==0', {
3439 # Some configurations are copied from Release_Base to reduce
3442 'debug_optimize%': 's',
3445 '-fomit-frame-pointer',
3447 '-ffunction-sections',
3454 ['OS=="linux" and target_arch=="ia32"', {
3456 '-Wl,--no-as-needed',
3459 ['debug_unwind_tables==1', {
3460 'cflags': ['-funwind-tables'],
3462 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3464 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3465 # definitions in to the right scope to use them when setting
3466 # linux_use_debug_fission, so it can be used here alone.
3467 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3468 'cflags': ['-gsplit-dwarf'],
3474 'release_optimize%': '2',
3475 # Binaries become big and gold is unable to perform GC
3476 # and remove unused sections for some of test targets
3477 # on 32 bit platform.
3478 # (This is currently observed only in chromeos valgrind bots)
3479 # The following flag is to disable --gc-sections linker
3480 # option for these bots.
3481 'no_gc_sections%': 0,
3483 # TODO(bradnelson): reexamine how this is done if we change the
3484 # expansion of configurations
3485 'release_valgrind_build%': 0,
3488 '-O<(release_optimize)',
3489 # Don't emit the GCC version ident directives, they just end up
3490 # in the .comment section taking up binary size.
3492 # Put data and code in their own sections, so that unused symbols
3493 # can be removed at link time with --gc-sections.
3495 '-ffunction-sections',
3498 # Specifically tell the linker to perform optimizations.
3499 # See http://lwn.net/Articles/192624/ .
3504 ['no_gc_sections==0', {
3506 '-Wl,--gc-sections',
3511 'release_optimize%': 's',
3514 '-fomit-frame-pointer',
3517 # Warn in case of text relocations.
3518 '-Wl,--warn-shared-textrel',
3528 '-fno-omit-frame-pointer',
3532 ['profiling_full_stack_frames==1', {
3535 '-fno-optimize-sibling-calls',
3540 ['release_unwind_tables==1', {
3541 'cflags': ['-funwind-tables'],
3543 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3549 ['target_arch=="ia32"', {
3550 'target_conditions': [
3551 ['_toolset=="target"', {
3553 # Needed so that libs with .s files (e.g. libicudata.a)
3554 # are compatible with the general 32-bit-ness.
3557 # All floating-point computations on x87 happens in 80-bit
3558 # precision. Because the C and C++ language standards allow
3559 # the compiler to keep the floating-point values in higher
3560 # precision than what's specified in the source and doing so
3561 # is more efficient than constantly rounding up to 64-bit or
3562 # 32-bit precision as specified in the source, the compiler,
3563 # especially in the optimized mode, tries very hard to keep
3564 # values in x87 floating-point stack (in 80-bit precision)
3565 # as long as possible. This has important side effects, that
3566 # the real value used in computation may change depending on
3567 # how the compiler did the optimization - that is, the value
3568 # kept in 80-bit is different than the value rounded down to
3569 # 64-bit or 32-bit. There are possible compiler options to
3570 # make this behavior consistent (e.g. -ffloat-store would keep
3571 # all floating-values in the memory, thus force them to be
3572 # rounded to its original precision) but they have significant
3573 # runtime performance penalty.
3575 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3576 # which keep floating-point values in SSE registers in its
3577 # native precision (32-bit for single precision, and 64-bit
3578 # for double precision values). This means the floating-point
3579 # value used during computation does not change depending on
3580 # how the compiler optimized the code, since the value is
3581 # always kept in its specified precision.
3583 # Refer to http://crbug.com/348761 for rationale behind SSE2
3584 # being a minimum requirement for 32-bit Linux builds and
3585 # http://crbug.com/313032 for an example where this has "bit"
3590 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3597 # Use gold linker for Android ia32 target.
3603 # Install packages have started cropping up with
3604 # different headers between the 32-bit and 64-bit
3605 # versions, so we have to shadow those differences off
3606 # and make sure a 32-bit-on-64-bit build picks up the
3608 # For android build, use NDK headers instead of host headers
3609 ['host_arch!="ia32" and OS!="android"', {
3618 ['target_arch=="x64"', {
3619 'target_conditions': [
3620 ['_toolset=="target"', {
3622 # Use gold linker for Android x64 target.
3639 ['target_arch=="arm"', {
3640 'target_conditions': [
3641 ['_toolset=="target"', {
3643 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3644 # has changed whenever it encounters a varargs function. This
3645 # silences those warnings, as they are not helpful and
3646 # clutter legitimate warnings.
3652 '-march=<(arm_arch)',
3657 '-mtune=<(arm_tune)',
3665 ['arm_float_abi!=""', {
3667 '-mfloat-abi=<(arm_float_abi)',
3676 # Most of the following flags are derived from what Android
3677 # uses by default when building for arm, reference for which
3678 # can be found in the following file in the Android NDK:
3679 # toolchains/arm-linux-androideabi-4.8/setup.mk
3681 # The tree-sra optimization (scalar replacement for
3682 # aggregates enabling subsequent optimizations) leads to
3683 # invalid code generation when using the Android NDK's
3684 # compiler (r5-r7). This can be verified using
3685 # webkit_unit_tests' WTF.Checked_int8_t test.
3687 # The following 6 options are disabled to save on
3688 # binary size in gcc 4.8.
3689 # TODO(fdegans) Reevaluate when we upgrade GCC.
3690 '-fno-partial-inlining',
3691 '-fno-early-inlining',
3692 '-fno-tree-copy-prop',
3693 '-fno-tree-loop-optimize',
3694 '-fno-move-loop-invariants',
3695 '-fno-caller-saves',
3698 # Android now supports .relro sections properly.
3699 # NOTE: While these flags enable the generation of .relro
3700 # sections, the generated libraries can still be loaded on
3701 # older Android platform versions.
3709 'cflags': [ '-mthumb-interwork' ],
3713 # Thumb code with frame pointer makes chrome crash
3716 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3717 # The perf report sometimes incorrectly attributes
3718 # code from tail calls.
3719 '-fno-optimize-sibling-calls',
3722 '-fomit-frame-pointer',
3727 # Clang does not support the following options.
3728 '-mthumb-interwork',
3729 '-finline-limit=64',
3731 '-fno-partial-inlining',
3732 '-fno-early-inlining',
3733 '-fno-tree-copy-prop',
3734 '-fno-tree-loop-optimize',
3735 '-fno-move-loop-invariants',
3736 '-fno-caller-saves',
3740 # TODO(hans) Enable integrated-as (crbug.com/124610).
3741 '-no-integrated-as',
3742 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3746 # Clang does not support the following options.
3750 # As long as -fuse-ld=gold doesn't work, add a dummy directory
3751 # with an 'ld' that redirects to gold, so that clang uses gold.
3752 '-B<!(cd <(DEPTH) && pwd -P)/build/android/arm-linux-androideabi-gold',
3757 '-marm', # Required for frame pointer based stack traces.
3764 # We set arm_arch to "" so that -march compiler option
3765 # is not set. Otherwise a gcc bug that would complain
3766 # about it conflicting with '-mcpu=cortex-a9'. The flag
3767 # '-march=armv7-a' is actually redundant anyway because
3768 # it is enabled by default when we built the toolchain.
3769 # And using '-mcpu=cortex-a9' should be sufficient.
3772 # Breakpad requires symbols with debugging information
3776 # We want to statically link libstdc++/libgcc_s.
3777 '-static-libstdc++',
3781 # Some components in Chromium (e.g. v8, skia, ffmpeg)
3782 # define their own cflags for arm builds that could
3783 # conflict with the flags we set here (e.g.
3784 # '-mcpu=cortex-a9'). Remove these flags explicitly.
3793 ['target_arch=="arm64"', {
3794 'target_conditions': [
3795 ['_toolset=="target"', {
3799 '-fstack-protector', # stack protector is always enabled on arm64.
3806 ['target_arch=="mipsel"', {
3807 'target_conditions': [
3808 ['_toolset=="target"', {
3810 ['android_webview_build==0 and mips_arch_variant=="mips32r2"', {
3811 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
3813 ['android_webview_build==0 and mips_arch_variant!="mips32r2"', {
3814 'cflags': ['-mips32', '-Wa,-mips32'],
3823 '-Wl,--no-keep-memory'
3826 '-Wno-uninitialized',
3840 'target_conditions': [
3841 ['_toolset=="target"', {
3843 '--sysroot=<(sysroot)',
3846 '--sysroot=<(sysroot)',
3847 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
3855 # Don't die on dtoa code that uses a char as an array index.
3856 '-Wno-char-subscripts',
3858 # TODO(thakis): This used to be implied by -Wno-unused-function,
3859 # which we no longer use. Check if it makes sense to remove
3860 # this as well. http://crbug.com/316352
3861 '-Wno-unneeded-internal-declaration',
3863 # Warns on switches on enums that cover all enum values but
3864 # also contain a default: branch. Chrome is full of that.
3865 '-Wno-covered-switch-default',
3867 # Warns when a const char[] is converted to bool.
3868 '-Wstring-conversion',
3870 # C++11-related flags:
3872 # This warns on using ints as initializers for floats in
3873 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
3874 # which happens in several places in chrome code. Not sure if
3875 # this is worth fixing.
3876 '-Wno-c++11-narrowing',
3878 # TODO(thakis): Remove, http://crbug.com/263960
3879 '-Wno-reserved-user-defined-literal',
3881 # Clang considers the `register` keyword as deprecated, but e.g.
3882 # code generated by flex (used in angle) contains that keyword.
3883 # http://crbug.com/255186
3884 '-Wno-deprecated-register',
3887 # Clang doesn't seem to know know this flag.
3891 # See the comment in the Mac section for what it takes to move
3892 # this to -std=c++11.
3896 ['clang==1 and OS=="android"', {
3897 # Android uses stlport, whose include/new defines
3898 # `void operator delete[](void* ptr) throw();`, which
3899 # clang's -Wimplicit-exception-spec-mismatch warns about for some
3900 # reason -- http://llvm.org/PR16638. TODO(thakis): Include stlport
3901 # via -isystem instead.
3903 '-Wno-implicit-exception-spec-mismatch',
3906 ['clang==1 and clang_use_chrome_plugins==1', {
3908 '<@(clang_chrome_plugins_flags)',
3911 ['clang==1 and clang_load!=""', {
3913 '-Xclang', '-load', '-Xclang', '<(clang_load)',
3916 ['clang==1 and clang_add_plugin!=""', {
3918 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
3921 ['clang==1 and target_arch=="ia32"', {
3923 # Else building libyuv gives clang's register allocator issues,
3924 # see llvm.org/PR15798 / crbug.com/233709
3925 '-momit-leaf-frame-pointer',
3928 ['clang==1 and "<(GENERATOR)"=="ninja"', {
3930 # See http://crbug.com/110262
3931 '-fcolor-diagnostics',
3934 # Common options for AddressSanitizer, LeakSanitizer,
3935 # ThreadSanitizer and MemorySanitizer.
3936 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
3937 'target_conditions': [
3938 ['_toolset=="target"', {
3940 '-fno-omit-frame-pointer',
3941 '-gline-tables-only',
3944 '-fomit-frame-pointer',
3949 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
3950 'target_conditions': [
3951 ['_toolset=="target"', {
3953 # Functions interposed by the sanitizers can make ld think
3954 # that some libraries aren't needed when they actually are,
3955 # http://crbug.com/234010. As workaround, disable --as-needed.
3959 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3960 'MEMORY_SANITIZER_INITIAL_SIZE',
3964 # TODO(glider): enable the default options on other systems.
3966 ['use_sanitizer_options==1 and OS=="linux" and (chromeos==0 or target_arch!="ia32")', {
3968 '<(DEPTH)/base/base.gyp:sanitizer_options',
3974 'target_conditions': [
3975 ['_toolset=="target"', {
3977 '-fsanitize=address',
3978 '-w', # http://crbug.com/162783
3981 '-fsanitize=address',
3988 '-mllvm -asan-globals=0', # http://crbug.com/352073
3994 'target_conditions': [
3995 ['_toolset=="target"', {
3997 '-fsanitize=undefined',
3998 # -fsanitize=vptr is incompatible with -fno-rtti.
3999 '-fno-sanitize=vptr',
4000 '-w', # http://crbug.com/162783
4003 '-fsanitize=undefined',
4004 # -fsanitize=vptr is incompatible with -fno-rtti.
4005 '-fno-sanitize=vptr',
4011 'target_conditions': [
4012 ['_toolset=="target"', {
4015 '-fsanitize=null', # Avoid dereferences on null pointer objects.
4016 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4017 '-w', # http://crbug.com/162783
4026 '-fsanitize=vptr', # -fsanitize=null is not necessary.
4029 'UNDEFINED_SANITIZER',
4034 ['asan_coverage!=0', {
4035 'target_conditions': [
4036 ['_toolset=="target"', {
4038 '-mllvm -asan-coverage=<(asan_coverage)',
4044 'target_conditions': [
4045 ['_toolset=="target"', {
4054 'WTF_USE_LEAK_SANITIZER=1',
4060 'target_conditions': [
4061 ['_toolset=="target"', {
4063 '-fsanitize=thread',
4065 '-fsanitize-blacklist=<(tsan_blacklist)',
4068 '-fsanitize=thread',
4072 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4073 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4075 'target_conditions': [
4076 ['_type=="executable"', {
4086 'target_conditions': [
4087 ['_toolset=="target"', {
4089 '-fsanitize=memory',
4090 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4092 '-fsanitize-blacklist=<(msan_blacklist)',
4095 '-fsanitize=memory',
4100 'target_conditions': [
4101 ['_type=="executable"', {
4110 ['use_instrumented_libraries==1', {
4112 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4115 ['use_custom_libcxx==1', {
4117 '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4120 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4121 'target_conditions' : [
4122 # crazy_linker has an upstream gyp file we can't edit, and we
4123 # don't want to instrument it.
4124 ['_toolset=="target" and _target_name!="crazy_linker"', {
4126 '-finstrument-functions',
4127 # Allow mmx intrinsics to inline, so that the
4128 #0 compiler can expand the intrinsics.
4129 '-finstrument-functions-exclude-file-list=mmintrin.h',
4132 ['_toolset=="target" and OS=="android"', {
4134 # Avoids errors with current NDK:
4135 # "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"
4136 '-finstrument-functions-exclude-file-list=arm_neon.h',
4141 ['linux_dump_symbols==1', {
4144 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4145 'target_conditions': [
4146 ['_toolset=="target"', {
4148 # Attempt to use less memory to prevent the linker from
4149 # running out of address space. Considering installing a
4150 # 64-bit kernel and switching to a 64-bit linker.
4151 '-Wl,--no-keep-memory',
4158 ['use_allocator!="tcmalloc"', {
4159 'defines': ['NO_TCMALLOC'],
4161 ['linux_use_gold_flags==1', {
4162 'target_conditions': [
4163 ['_toolset=="target"', {
4165 # Experimentation found that using four linking threads
4166 # saved ~20% of link time.
4167 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4168 # Only apply this to the target linker, since the host
4169 # linker might not be gold, but isn't used much anyway.
4170 # TODO(raymes): Disable threading because gold is frequently
4171 # crashing on the bots: crbug.com/161942.
4173 # '-Wl,--thread-count=4',
4178 ['release_valgrind_build==0', {
4179 'target_conditions': [
4180 ['_toolset=="target"', {
4182 # There seems to be a conflict of --icf and -pie
4183 # in gold which can generate crashy binaries. As
4184 # a security measure, -pie takes precedence for
4192 # Newer gcc's support -fuse-ld, use the flag to force gold
4194 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4195 # TODO(mithro): Watch for clang support at following thread:
4196 # http://clang-developers.42468.n3.nabble.com/Adding-fuse-ld-support-to-clang-td4032180.html
4197 ['gcc_version>=48', {
4198 'target_conditions': [
4199 ['_toolset=="target"', {
4206 ['host_gcc_version>=48', {
4207 'target_conditions': [
4208 ['_toolset=="host"', {
4217 ['linux_use_bundled_binutils==1', {
4219 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4222 ['linux_use_bundled_gold==1', {
4223 # Put our binutils, which contains gold in the search path. We pass
4224 # the path to gold to the compiler. gyp leaves unspecified what the
4225 # cwd is when running the compiler, so the normal gyp path-munging
4226 # fails us. This hack gets the right path.
4228 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4231 # Some binutils 2.23 releases may or may not have new dtags enabled,
4232 # but they are all compatible with --disable-new-dtags,
4233 # because the new dynamic tags are not created by default.
4234 ['binutils_version>=223', {
4235 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4236 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4237 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4238 # inside this file to allow usage of --no-as-needed and removal of
4241 '-Wl,--disable-new-dtags',
4244 ['gcc_version>=48', {
4245 'target_conditions': [
4246 ['_toolset=="target"', {
4249 # See comment for -Wno-c++11-narrowing.
4251 # TODO(thakis): Remove, http://crbug.com/263960
4252 '-Wno-literal-suffix',
4257 ['host_gcc_version>=48', {
4258 'target_conditions': [
4259 ['_toolset=="host"', {
4262 # See comment for -Wno-c++11-narrowing.
4264 # TODO(thakis): Remove, http://crbug.com/263960
4265 '-Wno-literal-suffix',
4273 # FreeBSD-specific options; note that most FreeBSD options are set above,
4276 'target_defaults': {
4278 '-Wl,--no-keep-memory',
4282 # Android-specific options; note that most are set above with Linux.
4285 # This is a unique identifier for a given build. It's used for
4286 # identifying various build artifacts corresponding to a particular
4287 # build of chrome (e.g. where to find archived symbols).
4288 'chrome_build_id%': '',
4290 # Use shared stlport library when system one used.
4291 # Figure this out early since it needs symbols from libgcc.a, so it
4292 # has to be before that in the set of libraries.
4293 ['use_system_stlport==1', {
4294 'android_stlport_library': 'stlport',
4297 ['component=="shared_library"', {
4298 'android_stlport_library': 'stlport_shared',
4300 'android_stlport_library': 'stlport_static',
4306 # Placing this variable here prevents from forking libvpx, used
4307 # by remoting. Remoting is off, so it needn't built,
4308 # so forking it's deps seems like overkill.
4309 # But this variable need defined to properly run gyp.
4310 # A proper solution is to have an OS==android conditional
4311 # in third_party/libvpx/libvpx.gyp to define it.
4312 'libvpx_path': 'lib/linux/arm',
4314 'target_defaults': {
4316 'release_extra_cflags%': '',
4318 # If we're using the components build, append "cr" to all shared
4319 # libraries to avoid naming collisions with android system library
4320 # versions with the same name (e.g. skia, icu).
4321 ['component=="shared_library"', {
4322 'android_product_extension': 'cr.so',
4324 'android_product_extension': 'so',
4328 'target_conditions': [
4329 ['_type=="shared_library"', {
4330 'product_extension': '<(android_product_extension)',
4333 # Settings for building device targets using Android's toolchain.
4334 # These are based on the setup.mk file from the Android NDK.
4336 # The NDK Android executable link step looks as follows:
4338 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4339 # $(PRIVATE_OBJECTS) <-- The .o that we built
4340 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4341 # $(TARGET_LIBGCC) <-- libgcc.a
4342 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4343 # $(PRIVATE_LDLIBS) <-- System .so
4344 # $(TARGET_CRTEND_O) <-- crtend.o
4346 # For now the above are approximated for executables by adding
4347 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4350 # The NDK Android shared library link step looks as follows:
4352 # $(PRIVATE_OBJECTS) <-- The .o that we built
4353 # -l,--whole-archive
4354 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4355 # -l,--no-whole-archive
4356 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4357 # $(TARGET_LIBGCC) <-- libgcc.a
4358 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4359 # $(PRIVATE_LDLIBS) <-- System .so
4361 # For now, assume that whole static libraries are not needed.
4363 # For both executables and shared libraries, add the proper
4364 # libgcc.a to the start of libraries which puts it in the
4365 # proper spot after .o and .a files get linked in.
4367 # TODO: The proper thing to do longer-tem would be proper gyp
4368 # support for a custom link command line.
4369 ['_toolset=="target"', {
4371 '-pthread', # Not supported by Android toolchain.
4374 '-ffunction-sections',
4377 '-fstack-protector',
4379 '-finline-limit=64',
4380 '-Wa,--noexecstack',
4381 '<@(release_extra_cflags)',
4385 '__GNU_SOURCE=1', # Necessary for clone()
4387 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4388 'CHROME_BUILD_ID="<(chrome_build_id)"',
4391 '-pthread', # Not supported by Android toolchain.
4395 '-Wl,--no-undefined',
4396 # Don't export symbols from statically linked libraries.
4397 '-Wl,--exclude-libs=ALL',
4400 '-l<(android_stlport_library)',
4401 # Manually link the libgcc.a that the cross compiler uses.
4402 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4408 ['component=="shared_library"', {
4410 '-Wl,--exclude-libs=ALL',
4415 # Work around incompatibilities between bionic and clang
4417 '-D__compiler_offsetof=__builtin_offsetof',
4418 '-Dnan=__builtin_nan',
4421 ['target_arch=="arm"', {
4423 '-target arm-linux-androideabi',
4426 '-target arm-linux-androideabi',
4429 ['target_arch=="ia32"', {
4431 '-target x86-linux-androideabi',
4434 '-target x86-linux-androideabi',
4437 # Place holder for x64 support, not tested.
4438 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4439 ['target_arch=="x64"', {
4441 '-target x86_64-linux-androideabi',
4444 '-target x86_64-linux-androideabi',
4451 # Android build relies on -Wl,--gc-sections removing
4452 # unreachable code. ASan instrumentation for globals inhibits
4453 # this and results in a library with unresolvable relocations.
4454 # TODO(eugenis): find a way to reenable this.
4455 '-mllvm -asan-globals=0',
4458 ['android_webview_build==0', {
4460 # The NDK has these things, but doesn't define the constants
4461 # to say that it does. Define them here instead.
4465 '--sysroot=<(android_ndk_sysroot)',
4468 '--sysroot=<(android_ndk_sysroot)',
4471 ['android_webview_build==1', {
4473 # OpenAL headers from the Android tree.
4474 '<(android_src)/frameworks/wilhelm/include',
4477 # Android predefines this as 1; undefine it here so Chromium
4478 # can redefine it later to be 2 for chromium code and unset
4479 # for third party code. This works because cflags are added
4481 '-U_FORTIFY_SOURCE',
4482 # Disable any additional warnings enabled by the Android build system but which
4483 # chromium does not build cleanly with (when treating warning as errors).
4484 # Things that are part of -Wextra:
4485 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4486 '-Wno-ignored-qualifiers',
4488 '-Wno-unused-but-set-variable',
4491 # Other things unrelated to -Wextra:
4492 '-Wno-non-virtual-dtor',
4496 ['android_webview_build==1', {
4497 'target_conditions': [
4498 ['chromium_code==0', {
4500 # There is a class of warning which:
4501 # 1) Android always enables and also treats as errors
4502 # 2) Chromium ignores in third party code
4503 # So we re-enable those warnings when building Android.
4505 '-Wno-format-security',
4507 '-Wno-sequence-point',
4510 '-Wno-non-virtual-dtor',
4515 ['target_arch == "arm"', {
4517 # Enable identical code folding to reduce size.
4521 # NOTE: The stlport header include paths below are specified in
4522 # cflags rather than include_dirs because they need to come
4523 # after include_dirs. Think of them like system headers, but
4524 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4525 # toolchain (circa Gingerbread) will exhibit strange errors.
4526 # The include ordering here is important; change with caution.
4527 ['use_system_stlport==1', {
4529 # For libstdc++/include, which is used by stlport.
4530 '-I<(android_src)/bionic',
4531 '-I<(android_src)/external/stlport/stlport',
4533 }, { # else: use_system_stlport!=1
4535 '-I<(android_stlport_include)',
4538 '-L<(android_stlport_libs_dir)',
4541 ['target_arch=="ia32"', {
4542 # The x86 toolchain currently has problems with stack-protector.
4544 '-fstack-protector',
4547 '-fno-stack-protector',
4551 'target_conditions': [
4552 ['_type=="executable"', {
4553 # Force android tools to export the "main" symbol so they can be
4554 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4555 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4556 # when ICS support will be dropped.
4559 '-fvisibility=default',
4563 '-Wl,--gc-sections',
4564 '-Wl,-z,nocopyreloc',
4567 # crtbegin_dynamic.o should be the last item in ldflags.
4568 '<(android_ndk_lib)/crtbegin_dynamic.o',
4571 # crtend_android.o needs to be the last item in libraries.
4572 # Do not add any libraries after this!
4573 '<(android_ndk_lib)/crtend_android.o',
4576 ['_type=="shared_library" or _type=="loadable_module"', {
4578 '-Wl,--exclude-libs=ALL',
4581 '-Wl,-shared,-Bsymbolic',
4584 ['android_webview_build==0', {
4586 # crtbegin_so.o should be the last item in ldflags.
4587 '<(android_ndk_lib)/crtbegin_so.o',
4590 # crtend_so.o needs to be the last item in libraries.
4591 # Do not add any libraries after this!
4592 '<(android_ndk_lib)/crtend_so.o',
4599 # Settings for building host targets using the system toolchain.
4600 ['_toolset=="host"', {
4602 # Due to issues in Clang build system, using ASan on 32-bit
4603 # binaries on x86_64 host is problematic.
4604 # TODO(eugenis): re-enable.
4605 '-fsanitize=address',
4606 '-w', # http://crbug.com/162783
4609 '-fsanitize=address',
4610 '-Wl,-z,noexecstack',
4611 '-Wl,--gc-sections',
4614 '-Wl,--warn-shared-textrel',
4615 '-Wl,--fatal-warnings',
4618 # Settings for building host targets on mac.
4619 ['_toolset=="host" and host_os=="mac"', {
4629 'cflags!': ['-fvisibility=hidden'],
4630 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4632 ['OS=="mac" or OS=="ios"', {
4633 'target_defaults': {
4636 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4637 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4638 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4639 'COPY_PHASE_STRIP': 'NO',
4640 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4641 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4642 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4643 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4644 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4645 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4646 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4647 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4648 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4649 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4650 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4651 'GCC_VERSION': '4.2',
4652 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4653 'USE_HEADERMAP': 'NO',
4658 # Don't warn about unused function parameters.
4659 '-Wno-unused-parameter',
4660 # Don't warn about the "struct foo f = {0};" initialization
4662 '-Wno-missing-field-initializers',
4665 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4666 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4668 # Note that the prebuilt Clang binaries should not be used for iOS
4669 # development except for ASan builds.
4671 # gnu++11 instead of c++11 is needed because some code uses
4672 # typeof() (a GNU extension).
4673 # TODO(thakis): Eventually switch this to c++11 instead of
4674 # gnu++11 (once typeof can be removed, which is blocked on c++11
4675 # being available everywhere).
4676 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', # -std=gnu++11
4677 # Warn if automatic synthesis is triggered with
4678 # the -Wobjc-missing-property-synthesis flag.
4679 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4680 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4684 # This warns on using ints as initializers for floats in
4685 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
4686 # which happens in several places in chrome code. Not sure if
4687 # this is worth fixing.
4688 '-Wno-c++11-narrowing',
4690 # Don't die on dtoa code that uses a char as an array index.
4691 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
4692 '-Wno-char-subscripts',
4694 # TODO(thakis): This used to be implied by -Wno-unused-function,
4695 # which we no longer use. Check if it makes sense to remove
4696 # this as well. http://crbug.com/316352
4697 '-Wno-unneeded-internal-declaration',
4699 # Warns on switches on enums that cover all enum values but
4700 # also contain a default: branch. Chrome is full of that.
4701 '-Wno-covered-switch-default',
4703 # Warns when a const char[] is converted to bool.
4704 '-Wstring-conversion',
4706 # Clang considers the `register` keyword as deprecated, but
4707 # e.g. code generated by flex (used in angle) contains that
4708 # keyword. http://crbug.com/255186
4709 '-Wno-deprecated-register',
4711 # This warns on selectors from Cocoa headers (-length, -set).
4712 # cfe-dev is currently discussing the merits of this warning.
4713 # TODO(thakis): Reevaluate what to do with this, based one
4714 # cfe-dev discussion.
4715 '-Wno-selector-type-mismatch',
4719 ['clang_xcode==0', {
4720 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4721 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4725 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4727 '<@(clang_chrome_plugins_flags)',
4730 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4732 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4735 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4737 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4740 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4742 # See http://crbug.com/110262
4743 '-fcolor-diagnostics',
4746 ['OS=="ios" and target_subarch!="arm32" and \
4747 "<(GENERATOR)"=="xcode"', {
4749 # TODO(ios): when building Chrome for iOS on 64-bit platform
4750 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4751 # enabled. This cause failures when compiling protobuf code,
4752 # so disable the warning. http://crbug.com/359107
4753 '-Wno-shorten-64-to-32',
4761 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4767 '-fsanitize=address',
4768 '-mllvm -asan-globals=0', # http://crbug.com/352073
4769 '-w', # http://crbug.com/162783
4770 '-gline-tables-only',
4774 ['asan_coverage!=0', {
4775 'target_conditions': [
4776 ['_toolset=="target"', {
4778 '-mllvm -asan-coverage=<(asan_coverage)',
4784 'target_conditions': [
4785 ['_type!="static_library"', {
4786 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4791 '-fsanitize=address',
4795 ['mac_write_linker_maps==1', {
4798 '-Wl,-map,>(_target_name).map',
4805 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4806 'target_conditions': [
4807 ['_type=="executable"', {
4813 # Define copy_asan_dylib_path in a variable ending in
4814 # _path so that gyp understands it's a path and
4815 # performs proper relativization during dict merging.
4816 'copy_asan_dylib_path':
4817 'mac/copy_asan_runtime_dylib.sh',
4819 'postbuild_name': 'Copy ASan runtime dylib',
4821 '<(copy_asan_dylib_path)',
4830 ], # target_conditions
4831 }, # target_defaults
4832 }], # OS=="mac" or OS=="ios"
4834 'target_defaults': {
4836 # Prevent Mac OS X AssertMacros.h from defining macros that collide
4837 # with common names, like 'check', 'require', and 'verify'.
4838 # (Included by system header. Also exists on iOS but not included.)
4839 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
4840 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
4843 # These should end with %, but there seems to be a bug with % in
4844 # variables that are intended to be set to different values in
4845 # different targets, like these.
4846 'mac_pie': 1, # Most executables can be position-independent.
4847 # Strip debugging symbols from the target.
4848 'mac_strip': '<(mac_strip_release)',
4852 ['mac_want_real_dsym=="default"', {
4855 'mac_real_dsym': '<(mac_want_real_dsym)'
4860 ['mac_want_real_dsym=="default"', {
4861 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
4863 'mac_real_dsym': '<(mac_want_real_dsym)'
4870 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
4871 # (Equivalent to -fPIC)
4872 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
4873 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4874 # Keep pch files below xcodebuild/.
4875 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
4877 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
4878 # xcode_setting, but not until all downstream projects' mac bots are
4879 # using xcode >= 4.6, because that's when the default value of the
4880 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
4881 # setting is a no-op as far as xcode is concerned, but the compiler
4882 # behaves differently based on whether -fno-strict-aliasing is
4884 '-fno-strict-aliasing', # See http://crbug.com/32204.
4887 'target_conditions': [
4888 ['_type=="executable"', {
4891 # Arranges for data (heap) pages to be protected against
4892 # code execution when running on Mac OS X 10.7 ("Lion"), and
4893 # ensures that the position-independent executable (PIE) bit
4894 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
4896 # Define change_mach_o_flags in a variable ending in _path
4897 # so that GYP understands it's a path and performs proper
4898 # relativization during dict merging.
4899 'change_mach_o_flags_path':
4900 'mac/change_mach_o_flags_from_xcode.sh',
4901 'change_mach_o_flags_options%': [
4903 'target_conditions': [
4904 ['mac_pie==0 or release_valgrind_build==1', {
4905 # Don't enable PIE if it's unwanted. It's unwanted if
4906 # the target specifies mac_pie=0 or if building for
4907 # Valgrind, because Valgrind doesn't understand slide.
4908 # See the similar mac_pie/release_valgrind_build check
4910 'change_mach_o_flags_options': [
4916 'postbuild_name': 'Change Mach-O Flags',
4918 '<(change_mach_o_flags_path)',
4919 '>@(change_mach_o_flags_options)',
4926 'asan_saves_file': 'asan.saves',
4929 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
4933 'target_conditions': [
4934 ['mac_pie==1 and release_valgrind_build==0', {
4935 # Turn on position-independence (ASLR) for executables. When
4936 # PIE is on for the Chrome executables, the framework will
4937 # also be subject to ASLR.
4938 # Don't do this when building for Valgrind, because Valgrind
4939 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
4940 # understand slide, and get rid of the Valgrind check.
4943 '-Wl,-pie', # Position-independent executable (MH_PIE)
4949 ['(_type=="executable" or _type=="shared_library" or \
4950 _type=="loadable_module") and mac_strip!=0', {
4951 'target_conditions': [
4952 ['mac_real_dsym == 1', {
4953 # To get a real .dSYM bundle produced by dsymutil, set the
4954 # debug information format to dwarf-with-dsym. Since
4955 # strip_from_xcode will not be used, set Xcode to do the
4956 # stripping as well.
4960 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
4961 'DEPLOYMENT_POSTPROCESSING': 'YES',
4962 'STRIP_INSTALLED_PRODUCT': 'YES',
4963 'target_conditions': [
4964 ['_type=="shared_library" or _type=="loadable_module"', {
4965 # The Xcode default is to strip debugging symbols
4966 # only (-S). Local symbols should be stripped as
4967 # well, which will be handled by -x. Xcode will
4968 # continue to insert -S when stripping even when
4969 # additional flags are added with STRIPFLAGS.
4971 }], # _type=="shared_library" or _type=="loadable_module"
4972 ['_type=="executable"', {
4975 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
4978 }], # _type=="executable" and asan==1
4979 ], # target_conditions
4981 }, # configuration "Release"
4983 }, { # mac_real_dsym != 1
4984 # To get a fast fake .dSYM bundle, use a post-build step to
4985 # produce the .dSYM and strip the executable. strip_from_xcode
4986 # only operates in the Release configuration.
4990 # Define strip_from_xcode in a variable ending in _path
4991 # so that gyp understands it's a path and performs proper
4992 # relativization during dict merging.
4993 'strip_from_xcode_path': 'mac/strip_from_xcode',
4995 'postbuild_name': 'Strip If Needed',
4996 'action': ['<(strip_from_xcode_path)'],
5000 ], # target_conditions
5001 }], # (_type=="executable" or _type=="shared_library" or
5002 # _type=="loadable_module") and mac_strip!=0
5003 ], # target_conditions
5004 }, # target_defaults
5007 'target_defaults': {
5008 'xcode_settings' : {
5009 # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang
5011 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',
5014 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5015 # additional flag to suppress the "unknown compiler option" error.
5016 # Restrict this flag to builds that are either compiling with Xcode
5017 # or compiling with Xcode's Clang. This will allow Ninja builds to
5018 # continue failing on unknown compiler options.
5019 # TODO(rohitrao): This flag is temporary and should be removed as
5020 # soon as the iOS bots are updated to use Xcode 5.1.
5021 ['clang_xcode==1', {
5023 '-Wno-unknown-warning-option',
5027 # Limit the valid architectures depending on "target_subarch".
5028 # This need to include the "arm" architectures but also the "x86"
5029 # ones (they are used when building for the simulator).
5030 ['target_subarch=="arm32"', {
5031 'VALID_ARCHS': ['armv7', 'i386'],
5033 ['target_subarch=="arm64"', {
5034 'VALID_ARCHS': ['arm64', 'x86_64'],
5036 ['target_subarch=="both"', {
5037 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5041 'target_conditions': [
5042 ['_toolset=="host"', {
5044 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5045 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5054 ['_toolset=="target"', {
5056 # This section should be for overriding host settings. But,
5057 # since we can't negate the iphone deployment target above, we
5058 # instead set it here for target only.
5059 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5060 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5063 ['_type=="executable"', {
5067 'DEPLOYMENT_POSTPROCESSING': 'YES',
5068 'STRIP_INSTALLED_PRODUCT': 'YES',
5073 # Remove dSYM to reduce build time.
5074 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5080 ['chromium_ios_signing', {
5081 # iOS SDK wants everything for device signed.
5082 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5084 'CODE_SIGNING_REQUIRED': 'NO',
5085 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5090 ], # target_conditions
5091 }, # target_defaults
5094 'target_defaults': {
5096 '_WIN32_WINNT=0x0602',
5103 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5104 'WIN32_LEAN_AND_MEAN',
5108 ['buildtype=="Official"', {
5109 # In official builds, targets can self-select an optimization
5110 # level by defining a variable named 'optimize', and setting it
5112 # - "size", optimizes for minimal code size - the default.
5113 # - "speed", optimizes for speed over code size.
5114 # - "max", whole program optimization and link-time code
5115 # generation. This is very expensive and should be used
5118 'optimize%': 'size',
5122 # Set /LTCG for the official builds.
5123 'LinkTimeCodeGeneration': '1',
5126 'target_conditions': [
5127 ['optimize=="size"', {
5129 'VCCLCompilerTool': {
5130 # 1, optimizeMinSpace, Minimize Size (/O1)
5131 'Optimization': '1',
5132 # 2, favorSize - Favor small code (/Os)
5133 'FavorSizeOrSpeed': '2',
5138 ['optimize=="speed"', {
5140 'VCCLCompilerTool': {
5141 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5142 'Optimization': '2',
5143 # 1, favorSpeed - Favor fast code (/Ot)
5144 'FavorSizeOrSpeed': '1',
5149 ['optimize=="max"', {
5150 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5151 # builds. Probably anything that this would catch that
5152 # wouldn't be caught in a normal build isn't going to
5153 # actually be a bug, so the incremental value of C4702 for
5154 # PGO builds is likely very small.
5155 'msvs_disabled_warnings': [
5159 'VCCLCompilerTool': {
5160 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5161 'Optimization': '2',
5162 # 1, favorSpeed - Favor fast code (/Ot)
5163 'FavorSizeOrSpeed': '1',
5164 # This implies link time code generation.
5165 'WholeProgramOptimization': 'true',
5173 ['component=="static_library"', {
5175 '_HAS_EXCEPTIONS=0',
5188 'AdditionalLibraryDirectories':
5189 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5191 'VCLibrarianTool': {
5192 'AdditionalLibraryDirectories':
5193 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5199 'VCLibrarianTool': {
5200 'AdditionalLibraryDirectories':
5201 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5204 'AdditionalLibraryDirectories':
5205 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5210 # https://code.google.com/p/chromium/issues/detail?id=372451#c20
5211 # Warning 4702 ("Unreachable code") should be re-enabled once
5212 # Express users are updated to VS2013 Update 2.
5213 'msvs_disabled_warnings': [
5218 # Explicitly required when using the ATL with express
5219 'AdditionalDependencies': ['atlthunk.lib'],
5221 # ATL 8.0 included in WDK 7.1 makes the linker to generate
5222 # almost eight hundred LNK4254 and LNK4078 warnings:
5223 # - warning LNK4254: section 'ATL' (50000040) merged into
5224 # '.rdata' (40000040) with different attributes
5225 # - warning LNK4078: multiple 'ATL' sections found with
5226 # different attributes
5227 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
5230 'msvs_system_include_dirs': [
5231 '<(windows_driver_kit_path)/inc/atl71',
5232 '<(windows_driver_kit_path)/inc/mfc42',
5236 'msvs_system_include_dirs': [
5237 '<(windows_sdk_path)/Include/shared',
5238 '<(windows_sdk_path)/Include/um',
5239 '<(windows_sdk_path)/Include/winrt',
5240 '$(VSInstallDir)/VC/atlmfc/include',
5242 'msvs_cygwin_shell': 0,
5243 'msvs_disabled_warnings': [
5244 4351, 4355, 4396, 4503, 4819,
5245 # TODO(maruel): These warnings are level 4. They will be slowly
5246 # removed as code is fixed.
5247 4100, 4121, 4125, 4127, 4130, 4131, 4189, 4201, 4238, 4244, 4245,
5248 4310, 4428, 4481, 4505, 4510, 4512, 4530, 4610, 4611, 4701, 4706,
5251 'VCCLCompilerTool': {
5252 'AdditionalOptions': ['/MP'],
5253 'MinimalRebuild': 'false',
5254 'BufferSecurityCheck': 'true',
5255 'EnableFunctionLevelLinking': 'true',
5256 'RuntimeTypeInfo': 'false',
5257 'WarningLevel': '4',
5258 'WarnAsError': 'true',
5259 'DebugInformationFormat': '3',
5261 ['component=="shared_library"', {
5262 'ExceptionHandling': '1', # /EHsc
5264 'ExceptionHandling': '0',
5268 'VCLibrarianTool': {
5269 'AdditionalOptions': ['/ignore:4221'],
5270 'AdditionalLibraryDirectories': [
5271 '<(windows_sdk_path)/Lib/win8/um/x86',
5275 'AdditionalDependencies': [
5287 'AdditionalLibraryDirectories': [
5288 '<(windows_sdk_path)/Lib/win8/um/x86',
5290 'GenerateDebugInformation': 'true',
5291 'MapFileName': '$(OutDir)\\$(TargetName).map',
5292 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5293 'FixedBaseAddress': '1',
5296 # 1 == /SUBSYSTEM:CONSOLE
5297 # 2 == /SUBSYSTEM:WINDOWS
5298 # Most of the executables we'll ever create are tests
5299 # and utilities with console output.
5303 'GenerateStublessProxies': 'true',
5304 'TypeLibraryName': '$(InputName).tlb',
5305 'OutputDirectory': '$(IntDir)',
5306 'HeaderFileName': '$(InputName).h',
5307 'DLLDataFileName': '$(InputName).dlldata.c',
5308 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5309 'ProxyFileName': '$(InputName)_p.c',
5311 'VCResourceCompilerTool': {
5313 'AdditionalIncludeDirectories': [
5315 '<(SHARED_INTERMEDIATE_DIR)',
5318 'target_conditions': [
5319 ['_type=="executable"', {
5321 'EmbedManifest': 'true',
5324 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5326 'AdditionalManifestFiles': [
5327 '>(win_exe_compatibility_manifest)',
5334 # Building with Clang on Windows is a work in progress and very
5335 # experimental. See crbug.com/82385.
5336 'VCCLCompilerTool': {
5337 'WarnAsError': 'false',
5338 'RuntimeTypeInfo': 'false',
5339 'AdditionalOptions': [
5340 '-fmsc-version=1800',
5343 # Many files use intrinsics without including this header.
5344 # TODO(hans): Fix those files, or move this to sub-GYPs.
5347 # TODO(hans): Make this list shorter eventually.
5348 '-Qunused-arguments',
5349 '-Wno-c++11-compat-deprecated-writable-strings',
5350 '-Wno-char-subscripts',
5351 '-Wno-deprecated-declarations',
5352 '-Wno-deprecated-register',
5354 '-Wno-enum-conversion',
5355 '-Wno-extra-tokens',
5356 '-Wno-ignored-attributes',
5357 '-Wno-incompatible-pointer-types',
5358 '-Wno-int-to-void-pointer-cast',
5359 '-Wno-invalid-noreturn',
5360 '-Wno-logical-op-parentheses',
5362 '-Wno-missing-braces',
5363 '-Wno-missing-declarations',
5364 '-Wno-msvc-include',
5365 '-Wno-null-dereference',
5366 '-Wno-overloaded-virtual',
5368 '-Wno-pointer-sign',
5370 '-Wno-return-type-c-linkage',
5372 '-Wno-sometimes-uninitialized',
5374 '-Wno-tautological-compare',
5375 '-Wno-unknown-pragmas',
5377 '-Wno-unused-function',
5378 '-Wno-unused-private-field',
5379 '-Wno-unused-value',
5380 '-Wno-unused-variable',
5386 # ASan on Windows is a work in progress and very experimental.
5387 # See crbug.com/345874.
5388 'VCCLCompilerTool': {
5389 'AdditionalOptions': [
5390 '-fsanitize=address',
5392 'AdditionalIncludeDirectories': [
5393 # MSVC needs to be able to find the sanitizer headers when
5394 # invoked via /fallback. This is critical for using macros
5395 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5397 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.5.0/include_sanitizer',
5401 'AdditionalLibraryDirectories': [
5402 # TODO(hans): If make_clang_dir is absolute, this breaks.
5403 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.5.0/lib/windows',
5406 'target_conditions': [
5407 ['_type=="executable"', {
5409 'AdditionalDependencies': [
5410 'clang_rt.asan-i386.lib',
5414 ['_type=="shared_library" or _type=="loadable_module"', {
5416 'AdditionalDependencies': [
5417 'clang_rt.asan_dll_thunk-i386.lib',
5427 ['disable_nacl==1', {
5428 'target_defaults': {
5434 ['OS=="win" and msvs_use_common_linker_extras', {
5435 'target_defaults': {
5450 'AdditionalOptions': [
5459 'AdditionalOptions': ['/largeaddressaware'],
5468 'AdditionalOptions': [
5469 # safeseh is not compatible with x64
5481 ['enable_new_npdevice_api==1', {
5482 'target_defaults': {
5484 'ENABLE_NEW_NPDEVICE_API',
5488 # Don't warn about the "typedef 'foo' locally defined but not used"
5490 # TODO: remove this flag once all builds work. See crbug.com/227506
5491 ['gcc_version>=48', {
5492 'target_defaults': {
5494 '-Wno-unused-local-typedefs',
5498 # We need a special case to handle the android webview build on mac because
5499 # the host gcc there doesn't accept this flag, but the target gcc may
5501 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5502 'target_defaults': {
5503 'target_conditions': [
5504 ['_toolset=="host"', {
5506 '-Wno-unused-local-typedefs',
5512 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5514 'make_global_settings': [
5515 ['CC', '<(make_clang_dir)/bin/clang'],
5516 ['CXX', '<(make_clang_dir)/bin/clang++'],
5517 ['CC.host', '$(CC)'],
5518 ['CXX.host', '$(CXX)'],
5521 ['clang==1 and OS=="win"', {
5522 'make_global_settings': [
5523 # On Windows, gyp's ninja generator only looks at CC.
5524 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5527 ['OS=="android" and clang==0', {
5528 # Hardcode the compiler names in the Makefile so that
5529 # it won't depend on the environment at make time.
5530 'make_global_settings': [
5531 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5532 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5533 ['CC.host', '<!(which gcc)'],
5534 ['CXX.host', '<!(which g++)'],
5537 ['OS=="linux" and target_arch=="mipsel"', {
5538 'make_global_settings': [
5539 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5540 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5541 ['CC.host', '<!(which gcc)'],
5542 ['CXX.host', '<!(which g++)'],
5546 # TODO(yyanagisawa): supports GENERATOR==make
5547 # make generator doesn't support CC_wrapper without CC
5548 # in make_global_settings yet.
5549 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5550 'make_global_settings': [
5551 ['CC_wrapper', '<(gomadir)/gomacc'],
5552 ['CXX_wrapper', '<(gomadir)/gomacc'],
5553 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5554 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5559 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5560 # This block adds *project-wide* configuration settings to each project
5561 # file. It's almost always wrong to put things here. Specify your
5562 # custom xcode_settings in target_defaults to add them to targets instead.
5565 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5566 # setting sets the SDK on a project-wide basis. In order to get the
5567 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5568 # here at the project level.
5571 ['mac_sdk_path==""', {
5572 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5574 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5580 ['ios_sdk_path==""', {
5582 # TODO(justincohen): Ninja only supports simulator for now.
5583 ['"<(GENERATOR)"=="xcode"', {
5584 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5586 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5590 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5595 # Target both iPhone and iPad.
5596 'TARGETED_DEVICE_FAMILY': '1,2',
5599 ['target_arch=="x64"', {
5604 ['target_arch=="ia32"', {
5613 # The Xcode generator will look for an xcode_settings section at the root
5614 # of each dict and use it to apply settings on a file-wide basis. Most
5615 # settings should not be here, they should be in target-specific
5616 # xcode_settings sections, or better yet, should use non-Xcode-specific
5617 # settings in target dicts. SYMROOT is a special case, because many other
5618 # Xcode variables depend on it, including variables such as
5619 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5620 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5621 # files to appear (when present) in the UI as actual files and not red
5622 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5623 # and therefore SYMROOT, needs to be set at the project level.
5624 'SYMROOT': '<(DEPTH)/xcodebuild',