Fixes compile error
[chromium-blink-merge.git] / build / common.gypi
blob71d96946c23dc04ce226b9944096b741a770b2dc
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.
5 # IMPORTANT:
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.
11   'variables': {
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.
17     'variables': {
18       'variables': {
19         'variables': {
20           'variables': {
21             # Whether we're building a ChromeOS build.
22             'chromeos%': 0,
24             # Whether we're building the cast (chromecast) shell
25             'chromecast%': 0,
27             # Whether or not we are using the Aura windowing framework.
28             'use_aura%': 0,
30             # Whether or not we are building the Ash shell.
31             'use_ash%': 0,
33             # Whether or not we are using CRAS, the ChromeOS Audio Server.
34             'use_cras%': 0,
36             # Use a raw surface abstraction.
37             'use_ozone%': 0,
39             # Configure the build for small devices. See crbug.com/318413
40             'embedded%': 0,
42             'conditions': [
43               # Compute the architecture that we're building on.
44               ['OS=="win" or OS=="mac" or OS=="ios"', {
45                 'host_arch%': 'ia32',
46               }, {
47                 'host_arch%': '<!pymod_do_main(detect_host_arch)',
48               }],
49             ],
50           },
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
62           'toolkit_views%': 0,
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.
68           'use_openssl%': 0,
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.
77           'enable_hidpi%': 0,
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).
87           'buildtype%': 'Dev',
89           # Override branding to select the desired branding flavor.
90           'branding%': 'Chromium',
92           'conditions': [
93             # ChromeOS and Windows use Aura and Ash.
94             ['chromeos==1 or OS=="win" or OS=="linux"', {
95               'use_ash%': 1,
96               'use_aura%': 1,
97             }],
99             ['chromecast==1', {
100               'embedded%': 1,
101               'use_ozone%': 1,
102             }],
104             # Ozone uses Aura.
105             ['use_ozone==1', {
106               'use_aura%': 1,
107             }],
109             # Whether we're a traditional desktop unix.
110             ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
111               'desktop_linux%': 1,
112             }, {
113               'desktop_linux%': 0,
114             }],
116             # Embedded implies ozone.
117             ['embedded==1', {
118               'use_ozone%': 1,
119             }],
121             ['OS=="android"', {
122               'target_arch%': 'arm',
123             }, {
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)',
127             }],
128           ],
129         },
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
153         # build system.
154         'android_webview_build%': 0,
156         # This is set when building the Android WebView in ninja for the
157         # telemetry bot.
158         'android_webview_telemetry_build%': 0,
160         # Set ARM architecture version.
161         'arm_version%': 7,
163         # Use aurax11 for clipboard implementation. This is true on linux_aura.
164         'use_clipboard_aurax11%': 0,
166         # goma settings.
167         # 1 to use goma.
168         # If no gomadir is set, it uses the default gomadir.
169         'use_goma%': 0,
170         'gomadir%': '',
172         # The system root for cross-compiles. Default: none.
173         'sysroot%': '',
174         'chroot_cmd%': '',
176         # The system libdir used for this ABI.
177         'system_libdir%': 'lib',
179         # Default MIPS arch variant. This is set in the conditions block
180         # below for MIPS targets.
181         'mips_arch_variant%': '',
183         'conditions': [
184           # Ash needs Aura.
185           ['use_aura==0', {
186             'use_ash%': 0,
187           }],
189           # Set default value of toolkit_views based on OS.
190           ['OS=="win" or chromeos==1 or use_aura==1', {
191             'toolkit_views%': 1,
192           }, {
193             'toolkit_views%': 0,
194           }],
196           # Embedded builds use aura without ash or views.
197           ['embedded==1', {
198             'use_aura%': 1,
199             'use_ash%': 0,
200             'toolkit_views%': 0,
201           }],
203           # Enable HiDPI on Mac OS, Chrome OS and Windows.
204           ['OS=="mac" or chromeos==1 or OS=="win"', {
205             'enable_hidpi%': 1,
206           }],
208           # Enable App Launcher everywhere but mobile.
209           ['OS!="ios" and OS!="android"', {
210             'enable_app_list%': 1,
211           }, {
212             'enable_app_list%': 0,
213           }],
215           ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
216             'use_default_render_theme%': 1,
217           }, {
218             'use_default_render_theme%': 0,
219           }],
221           ['use_ozone==1', {
222             'use_ozone_evdev%': 1,
223           }, {
224             'use_ozone_evdev%': 0,
225           }],
227           # Set default gomadir.
228           ['OS=="win"', {
229             'gomadir': 'c:\\goma\\goma-win',
230           }, {
231             'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
232           }],
234           # Set the default "target_subarch" on iOS. Valid values are "arm32",
235           # "arm64" and "both" (meaning a fat binary).
236           #
237           # TODO(sdefresne): change the default from "arm32" to "both" for
238           # "target_subarch" once http://crbug.com/339477 is fixed.
239           #
240           # TODO(sdefresne): set the "target_arch" to "arm" once compilation
241           # of skia has been fixed for simulator. http://crbug.com/342377
242           ['OS=="ios"', {
243             'target_subarch%': 'arm32',
244           }],
246           # Set arch variants for MIPS platforms.
247           ['target_arch=="mips64el"', {
248             'conditions': [
249               ['OS=="android"', {
250                 'mips_arch_variant%': 'r6',
251               }, {
252                 'mips_arch_variant%': 'r2',
253               }],
254             ],
255           }],
257           ['target_arch=="mipsel"', {
258             'mips_arch_variant%': 'r1',
259           }],
260         ],
261       },
263       # Copy conditionally-set variables out one scope.
264       'chromeos%': '<(chromeos)',
265       'chromecast%': '<(chromecast)',
266       'host_arch%': '<(host_arch)',
267       'target_arch%': '<(target_arch)',
268       'target_subarch%': '<(target_subarch)',
269       'mips_arch_variant%': '<(mips_arch_variant)',
270       'toolkit_views%': '<(toolkit_views)',
271       'desktop_linux%': '<(desktop_linux)',
272       'use_aura%': '<(use_aura)',
273       'use_ash%': '<(use_ash)',
274       'use_cras%': '<(use_cras)',
275       'use_ozone%': '<(use_ozone)',
276       'use_ozone_evdev%': '<(use_ozone_evdev)',
277       'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
278       'embedded%': '<(embedded)',
279       'use_openssl%': '<(use_openssl)',
280       'use_openssl_certs%': '<(use_openssl_certs)',
281       'enable_viewport%': '<(enable_viewport)',
282       'enable_hidpi%': '<(enable_hidpi)',
283       'android_webview_build%': '<(android_webview_build)',
284       'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
285       'use_goma%': '<(use_goma)',
286       'gomadir%': '<(gomadir)',
287       'enable_app_list%': '<(enable_app_list)',
288       'use_default_render_theme%': '<(use_default_render_theme)',
289       'buildtype%': '<(buildtype)',
290       'branding%': '<(branding)',
291       'arm_version%': '<(arm_version)',
292       'sysroot%': '<(sysroot)',
293       'chroot_cmd%': '<(chroot_cmd)',
294       'system_libdir%': '<(system_libdir)',
296       # Set to 1 to enable fast builds. Set to 2 for even faster builds
297       # (it disables debug info for fastest compilation - only for use
298       # on compile-only bots).
299       'fastbuild%': 0,
301       # Set to 1 to not store any build metadata (this isn't working yet but
302       # this flag will help us to get there). See http://crbug.com/314403.
303       # TODO(sebmarchand): Update this comment once this flag guarantee that
304       #     there's no build metadata in the build artifacts.
305       'dont_embed_build_metadata%': 0,
307       # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
308       # This is useful for parallel compilation tools which can't support /Zi.
309       # Only used on Windows.
310       'win_z7%' : 0,
312       # Set to 1 to enable dcheck in release.
313       'dcheck_always_on%': 0,
315       # Set to 1 to make a build that disables unshipped tracing events.
316       # Note: this setting is ignored if buildtype=="Official".
317       'tracing_like_official_build%': 0,
319       # Disable image loader component extension by default.
320       'image_loader_extension%': 0,
322       # Set NEON compilation flags.
323       'arm_neon%': 1,
325       # Detect NEON support at run-time.
326       'arm_neon_optional%': 0,
328       # Use libjpeg-turbo as the JPEG codec used by Chromium.
329       'use_libjpeg_turbo%': 1,
331       # Use system libjpeg. Note that the system's libjepg will be used even if
332       # use_libjpeg_turbo is set.
333       'use_system_libjpeg%': 0,
335       # By default, component is set to static_library and it can be overriden
336       # by the GYP command line or by ~/.gyp/include.gypi.
337       'component%': 'static_library',
339       # Set to select the Title Case versions of strings in GRD files.
340       'use_titlecase_in_grd_files%': 0,
342       # Use translations provided by volunteers at launchpad.net.  This
343       # currently only works on Linux.
344       'use_third_party_translations%': 0,
346       # Remoting compilation is enabled by default. Set to 0 to disable.
347       'remoting%': 1,
349       # Configuration policy is enabled by default. Set to 0 to disable.
350       'configuration_policy%': 1,
352       # Variable safe_browsing is used to control the build time configuration
353       # for safe browsing feature. Safe browsing can be compiled in 3 different
354       # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
355       # reporting features without enabling phishing and malware detection. This
356       # is useful to integrate a third party phishing/malware detection to
357       # existing safe browsing logic.
358       'safe_browsing%': 1,
360       # Web speech is enabled by default. Set to 0 to disable.
361       'enable_web_speech%': 1,
363       # Notifications are compiled in by default. Set to 0 to disable.
364       'notifications%' : 1,
366       # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
367       # regular builds and 1 for ASan builds.
368       'mac_want_real_dsym%': 'default',
370       # If this is set, the clang plugins used on the buildbot will be used.
371       # Run tools/clang/scripts/update.sh to make sure they are compiled.
372       # This causes 'clang_chrome_plugins_flags' to be set.
373       # Has no effect if 'clang' is not set as well.
374       'clang_use_chrome_plugins%': 1,
376       # Enable building with ASAN (Clang's -fsanitize=address option).
377       # -fsanitize=address only works with clang, but asan=1 implies clang=1
378       # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
379       'asan%': 0,
380       # Enable coverage gathering instrumentation in ASan. This flag also
381       # controls coverage granularity (1 for function-level coverage, 2 for
382       # block-level coverage).
383       'asan_coverage%': 0,
385       # Enable Chromium overrides of the default configurations for various
386       # dynamic tools (like ASan).
387       'use_sanitizer_options%': 1,
389       # Enable building with SyzyAsan.
390       # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
391       'syzyasan%': 0,
393       # Enable building with LSan (Clang's -fsanitize=leak option).
394       # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
395       # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
396       'lsan%': 0,
398       # Enable building with TSan (Clang's -fsanitize=thread option).
399       # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
400       # See http://clang.llvm.org/docs/ThreadSanitizer.html
401       'tsan%': 0,
402       'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
404       # Enable building with MSan (Clang's -fsanitize=memory option).
405       # MemorySanitizer only works with clang, but msan=1 implies clang=1
406       # See http://clang.llvm.org/docs/MemorySanitizer.html
407       'msan%': 0,
408       'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
409       # Track where uninitialized memory originates from. From fastest to
410       # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
411       # - track the chain of stores leading from allocation site to use site.
412       'msan_track_origins%': 1,
414       # Enable building with UBSan (Clang's -fsanitize=undefined option).
415       # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
416       # See http://clang.llvm.org/docs/UsersManual.html
417       'ubsan%': 0,
419       # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
420       # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
421       'ubsan_vptr%': 0,
422       'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan_vptr/blacklist.txt',
424       # Use the dynamic libraries instrumented by one of the sanitizers
425       # instead of the standard system libraries.
426       'use_instrumented_libraries%': 0,
428       # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
429       # stdlibc++ as standard library. This is intended to use for instrumented
430       # builds.
431       'use_custom_libcxx%': 0,
433       # Use system libc++ instead of the default C++ library, usually libstdc++.
434       # This is intended for iOS builds only.
435       'use_system_libcxx%': 0,
437       # Use a modified version of Clang to intercept allocated types and sizes
438       # for allocated objects. clang_type_profiler=1 implies clang=1.
439       # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
440       # TODO(dmikurube): Support mac.  See http://crbug.com/123758#c11
441       'clang_type_profiler%': 0,
443       # Set to true to instrument the code with function call logger.
444       # See src/third_party/cygprofile/cyg-profile.cc for details.
445       'order_profiling%': 0,
447       # Use the provided profiled order file to link Chrome image with it.
448       # This makes Chrome faster by better using CPU cache when executing code.
449       # This is known as PGO (profile guided optimization).
450       # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
451       'order_text_section%' : "",
453       # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
454       # libraries on linux x86-64 and arm, plus ASLR.
455       'linux_fpic%': 1,
457       # Whether one-click signin is enabled or not.
458       'enable_one_click_signin%': 0,
460       # Whether to back up data before sync.
461       'enable_pre_sync_backup%': 0,
463       # Enable Chrome browser extensions
464       'enable_extensions%': 1,
466       # Enable Google Now.
467       'enable_google_now%': 1,
469       # Enable printing support and UI. This variable is used to configure
470       # which parts of printing will be built. 0 disables printing completely,
471       # 1 enables it fully, and 2 enables only the codepath to generate a
472       # Metafile (e.g. usually a PDF or EMF) and disables print preview, cloud
473       # print, UI, etc.
474       'enable_printing%': 1,
476       # Set the version of CLD.
477       #   0: Don't specify the version. This option is for the Finch testing.
478       #   1: Use only CLD1.
479       #   2: Use only CLD2.
480       'cld_version%': 2,
482       # For CLD2, the size of the tables that should be included in the build
483       # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
484       # tool explicitly.
485       # See third_party/cld_2/cld_2.gyp for more information.
486       #   0: Small tables, lower accuracy
487       #   1: Medium tables, medium accuracy
488       #   2: Large tables, high accuracy
489       'cld2_table_size%': 2,
491       # The data acquisition mode for CLD2. Possible values are:
492       #   static:     CLD2 data is statically linked to the executable.
493       #   standalone: CLD2 data is provided in a standalone file that is
494       #               bundled with the executable.
495       #   component:  CLD2 data is provided as a Chrome "component" and is
496       #               downloaded via the component updater.
497       #
498       # For more information on switching the CLD2 data source, see:
499       #   https://sites.google.com/a/chromium.org/dev/developers/how-tos/compact-language-detector-cld-data-source-configuration
500       #
501       # This string will be exposed in chrome://translate-internals under the
502       # heading "CLD Data Source". This allows easy determination of which
503       # data source the browser was built with.
504       'cld2_data_source%': 'static',
506       # Enable spell checker.
507       'enable_spellcheck%': 1,
509       # Webrtc compilation is enabled by default. Set to 0 to disable.
510       'enable_webrtc%': 1,
512       # Enables use of the session service, which is enabled by default.
513       # Support for disabling depends on the platform.
514       'enable_session_service%': 1,
516       # Enables theme support, which is enabled by default.  Support for
517       # disabling depends on the platform.
518       'enable_themes%': 1,
520       # Enables autofill dialog and associated features; disabled by default.
521       'enable_autofill_dialog%' : 0,
523       # Defaults Wallet integration in Autofill dialog to use production
524       # servers. Unofficial builds won't have the proper API keys.
525       'enable_prod_wallet_service%': 0,
527       # Enables support for background apps.
528       'enable_background%': 1,
530       # Enable the task manager by default.
531       'enable_task_manager%': 1,
533       # Enables used resource whitelist generation; disabled by default.
534       'enable_resource_whitelist_generation%': 0,
536       # Enable FILE support by default.
537       'disable_file_support%': 0,
539       # Enable FTP support by default.
540       'disable_ftp_support%': 0,
542       # Use native android functions in place of ICU.  Not supported by most
543       # components.
544       'use_icu_alternatives_on_android%': 0,
546       # XInput2 multitouch support is enabled by default (use_xi2_mt=2).
547       # Setting to zero value disables XI2 MT. When XI2 MT is enabled,
548       # the input value also defines the required XI2 minor minimum version.
549       # For example, use_xi2_mt=2 means XI2.2 or above version is required.
550       'use_xi2_mt%': 2,
552       # Use of precompiled headers on Windows.
553       #
554       # This variable may be explicitly set to 1 (enabled) or 0
555       # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
556       # This setting will override the default.
557       #
558       # See
559       # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
560       # for details.
561       'chromium_win_pch%': 0,
563       # Clang stuff.
564       'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
565       # Set this to true when building with Clang.
566       # See http://code.google.com/p/chromium/wiki/Clang for details.
567       # If this is set, clang is used as both host and target compiler in
568       # cross-compile builds.
569       'clang%': 0,
571       # Enable plug-in installation by default.
572       'enable_plugin_installation%': 1,
574       # Specifies whether to use canvas_skia.cc in place of platform
575       # specific implementations of gfx::Canvas. Affects text drawing in the
576       # Chrome UI.
577       # TODO(asvitkine): Enable this on all platforms and delete this flag.
578       #                  http://crbug.com/105550
579       'use_canvas_skia%': 0,
581       # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
582       # with one of those tools.
583       'build_for_tool%': '',
585       # If no directory is specified then a temporary directory will be used.
586       'test_isolation_outdir%': '',
587       # True if isolate should fail if the isolate files refer to files
588       # that are missing.
589       'test_isolation_fail_on_missing': 0,
591       'wix_path%': '<(DEPTH)/third_party/wix',
593       # Managed users are enabled by default.
594       'enable_managed_users%': 1,
596       # Platform natively supports discardable memory.
597       'native_discardable_memory%': 0,
599       # Platform sends memory pressure signals natively.
600       'native_memory_pressure_signals%': 0,
602       'data_reduction_fallback_host%' : '',
603       'data_reduction_dev_host%' : '',
604       'spdy_proxy_auth_origin%' : '',
605       'spdy_proxy_auth_property%' : '',
606       'spdy_proxy_auth_value%' : '',
607       'data_reduction_proxy_probe_url%' : '',
608       'data_reduction_proxy_warmup_url%' : '',
609       'data_reduction_proxy_ssl_origin%' : '',
610       'data_reduction_proxy_alt_origin%' : '',
611       'data_reduction_proxy_alt_fallback_origin%' : '',
612       'enable_mdns%' : 0,
613       'enable_service_discovery%': 0,
614       'enable_wifi_bootstrapping%': 0,
615       'enable_hangout_services_extension%': 0,
617        # Enable the Syzygy optimization step.
618       'syzygy_optimize%': 0,
620       # Enable hole punching for the protected video.
621       'video_hole%': 0,
623       # Automatically select platforms under ozone. Turn this off to
624       # build only explicitly selected platforms.
625       'ozone_auto_platforms%': 1,
627       # If this is set clang is used as host compiler, but not as target
628       # compiler. Always do this by default.
629       'host_clang%': 1,
631       'conditions': [
632         # A flag for POSIX platforms
633         ['OS=="win"', {
634           'os_posix%': 0,
635         }, {
636           'os_posix%': 1,
637         }],
639         # A flag for BSD platforms
640         ['OS=="freebsd" or OS=="openbsd"', {
641           'os_bsd%': 1,
642         }, {
643           'os_bsd%': 0,
644         }],
646         # NSS usage.
647         ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
648           'use_nss%': 1,
649         }, {
650           'use_nss%': 0,
651         }],
653         # When OpenSSL is used for SSL and crypto on Unix-like systems, use
654         # OpenSSL's certificate definition.
655         ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
656           'use_openssl_certs%': 1,
657         }, {
658           'use_openssl_certs%': 0,
659         }],
661         # libudev usage.  This currently only affects the content layer.
662         ['OS=="linux" and embedded==0', {
663           'use_udev%': 1,
664         }, {
665           'use_udev%': 0,
666         }],
668         # Flags to use X11 on non-Mac POSIX platforms.
669         ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
670           'use_x11%': 0,
671         }, {
672           'use_x11%': 1,
673         }],
675         # Flags to use glib.
676         ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
677           'use_glib%': 0,
678         }, {
679           'use_glib%': 1,
680         }],
682         # Flags to use pango and cairo.
683         ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
684           'use_pango%': 0,
685           'use_cairo%': 0,
686         }, {
687           'use_pango%': 1,
688           'use_cairo%': 1,
689         }],
691         # DBus usage.
692         ['OS=="linux" and embedded==0', {
693           'use_dbus%': 1,
694         }, {
695           'use_dbus%': 0,
696         }],
698         # We always use skia text rendering in Aura on Windows, since GDI
699         # doesn't agree with our BackingStore.
700         # TODO(beng): remove once skia text rendering is on by default.
701         ['use_aura==1 and OS=="win"', {
702           'enable_skia_text%': 1,
703         }],
705         # A flag to enable or disable our compile-time dependency
706         # on gnome-keyring. If that dependency is disabled, no gnome-keyring
707         # support will be available. This option is useful
708         # for Linux distributions and for Aura.
709         ['OS!="linux" or chromeos==1', {
710           'use_gnome_keyring%': 0,
711         }, {
712           'use_gnome_keyring%': 1,
713         }],
715         ['OS=="mac" or OS=="ios"', {
716           # Mac and iOS want Title Case strings
717           'use_titlecase_in_grd_files%': 1,
718         }],
720         # Enable loader extensions on Chrome OS.
721         ['chromeos==1', {
722           'image_loader_extension%': 1,
723         }, {
724           'image_loader_extension%': 0,
725         }],
727         ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
728           'enable_one_click_signin%': 1,
729           'enable_pre_sync_backup%': 1,
730         }],
732         ['OS=="android"', {
733           'enable_extensions%': 0,
734           'enable_google_now%': 0,
735           'cld_version%': 1,
736           'enable_spellcheck%': 0,
737           'enable_themes%': 0,
738           'remoting%': 0,
739           'arm_neon%': 0,
740           'arm_neon_optional%': 1,
741           'native_discardable_memory%': 1,
742           'native_memory_pressure_signals%': 1,
743           'enable_printing%': 2,
744           'enable_task_manager%':0,
745            # Set to 1 once we have a notification system for Android.
746            # http://crbug.com/115320
747           'notifications%': 0,
748           'video_hole%': 1,
749         }],
751         # Android OS includes support for proprietary codecs regardless of
752         # building Chromium or Google Chrome. We also ship Google Chrome and
753         # Chromecast with proprietary codecs.
754         ['OS=="android" or branding=="Chrome" or chromecast==1', {
755           'proprietary_codecs%': 1,
756         }, {
757           'proprietary_codecs%': 0,
758         }],
760         ['OS=="mac" or OS=="ios"', {
761           'native_discardable_memory%': 1,
762           'native_memory_pressure_signals%': 1,
763         }],
765         # Enable autofill dialog for Android, Mac and Views-enabled platforms.
766         ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
767           'enable_autofill_dialog%': 1,
769           'conditions': [
770             ['buildtype=="Official"', {
771               'enable_prod_wallet_service%': 1,
772             }],
773           ]
774         }],
776         ['OS=="android"', {
777           'enable_webrtc%': 1,
778         }],
780         ['OS=="ios"', {
781           'disable_ftp_support%': 1,
782           'enable_extensions%': 0,
783           'enable_google_now%': 0,
784           'cld_version%': 1,
785           'enable_printing%': 0,
786           'enable_session_service%': 0,
787           'enable_themes%': 0,
788           'enable_webrtc%': 0,
789           'notifications%': 0,
790           'remoting%': 0,
791           'safe_browsing%': 0,
792           'enable_managed_users%': 0,
793           'enable_task_manager%': 0,
794         }],
796         # Use GPU accelerated cross process image transport by default
797         # on linux builds with the Aura window manager
798         ['use_aura==1 and OS=="linux"', {
799           'ui_compositor_image_transport%': 1,
800         }, {
801           'ui_compositor_image_transport%': 0,
802         }],
804         # Turn precompiled headers on by default.
805         ['OS=="win" and buildtype!="Official"', {
806           'chromium_win_pch%': 1
807         }],
809         ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
810           'enable_plugin_installation%': 0,
811         }, {
812           'enable_plugin_installation%': 1,
813         }],
815         # Whether PPAPI is enabled.
816         ['OS=="android" or OS=="ios" or embedded==1', {
817           'enable_plugins%': 0,
818         }, {
819           'enable_plugins%': 1,
820         }],
822         # linux_use_bundled_gold: whether to use the gold linker binary checked
823         # into third_party/binutils.  Force this off via GYP_DEFINES when you
824         # are using a custom toolchain and need to control -B in ldflags.
825         # Do not use 32-bit gold on 32-bit hosts as it runs out address space
826         # for component=static_library builds.
827         ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
828           'linux_use_bundled_gold%': 1,
829         }, {
830           'linux_use_bundled_gold%': 0,
831         }],
833         # linux_use_bundled_binutils: whether to use the binary binutils
834         # checked into third_party/binutils.  These are not multi-arch so cannot
835         # be used except on x86 and x86-64 (the only two architectures which
836         # are currently checke in).  Force this off via GYP_DEFINES when you
837         # are using a custom toolchain and need to control -B in cflags.
838         ['OS=="linux" and (target_arch=="x64")', {
839           'linux_use_bundled_binutils%': 1,
840         }, {
841           'linux_use_bundled_binutils%': 0,
842         }],
844         # linux_use_gold_flags: whether to use build flags that rely on gold.
845         # On by default for x64 Linux.
846         ['OS=="linux" and target_arch=="x64"', {
847           'linux_use_gold_flags%': 1,
848         }, {
849           'linux_use_gold_flags%': 0,
850         }],
852         # linux_use_debug_fission: whether to use split DWARF debug info
853         # files. This can reduce link time significantly, but is incompatible
854         # with some utilities such as icecc and ccache. Requires gold and
855         # gcc >= 4.8 or clang.
856         # http://gcc.gnu.org/wiki/DebugFission
857         ['OS=="linux" and target_arch=="x64"', {
858           'linux_use_debug_fission%': 1,
859         }, {
860           'linux_use_debug_fission%': 0,
861         }],
863         ['OS=="android" or OS=="ios"', {
864           'enable_captive_portal_detection%': 0,
865         }, {
866           'enable_captive_portal_detection%': 1,
867         }],
869         # Enable Skia UI text drawing incrementally on different platforms.
870         # http://crbug.com/105550
871         #
872         # On Aura, this allows per-tile painting to be used in the browser
873         # compositor.
874         ['OS!="android"', {
875           'use_canvas_skia%': 1,
876         }],
878         ['chromeos==1', {
879           # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
880           'use_libjpeg_turbo%': 0,
881         }],
883         ['OS=="android"', {
884           # When building as part of the Android system, use system libraries
885           # where possible to reduce ROM size.
886           'use_system_libjpeg%': '<(android_webview_build)',
887         }],
889         # Do not enable the Settings App on ChromeOS.
890         ['enable_app_list==1 and chromeos==0', {
891           'enable_settings_app%': 1,
892         }, {
893           'enable_settings_app%': 0,
894         }],
896         ['OS=="linux" and target_arch=="arm" and chromeos==0', {
897           # Set some defaults for arm/linux chrome builds
898           'use_allocator%': 'none',
899           # sysroot needs to be an absolute path otherwise it generates
900           # incorrect results when passed to pkg-config
901           'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot',
902         }], # OS=="linux" and target_arch=="arm" and chromeos==0
904         ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
905           'conditions': [
906             ['target_arch=="x64"', {
907               'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
908             }],
909             ['target_arch=="ia32"', {
910               'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
911             }],
912         ],
913         }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
915         ['OS=="linux" and target_arch=="mipsel"', {
916           'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
917           'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
918         }],
920         # Whether tests targets should be run, archived or just have the
921         # dependencies verified. All the tests targets have the '_run' suffix,
922         # e.g. base_unittests_run runs the target base_unittests. The test
923         # target always calls tools/swarming_client/isolate.py. See the script's
924         # --help for more information and the valid --mode values. Meant to be
925         # overriden with GYP_DEFINES.
926         # TODO(maruel): Remove the conditions as more configurations are
927         # supported.
928         # NOTE: The check for disable_nacl==0 and component=="static_library"
929         # can't be used here because these variables are not defined yet, but it
930         # is still not supported.
931         ['OS!="ios" and OS!="android" and chromeos==0', {
932           'test_isolation_mode%': 'check',
933         }, {
934           'test_isolation_mode%': 'noop',
935         }],
936         # Whether Android build uses OpenMAX DL FFT.
937         ['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")', {
938           # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
939           # When enabled, this will also enable WebAudio support on
940           # Android for these architectures.  Default is enabled.  Whether
941           # WebAudio is actually available depends on runtime settings
942           # and flags.
943           'use_openmax_dl_fft%': 1,
944         }, {
945           'use_openmax_dl_fft%': 0,
946         }],
947         ['OS=="win" or OS=="linux"', {
948             'enable_mdns%' : 1,
949         }],
951         # Turns on compiler optimizations in V8 in Debug build, except
952         # on android_clang, where we're hitting a weird linker error.
953         # TODO(dpranke): http://crbug.com/266155 .
954         ['OS=="android"', {
955           'v8_optimized_debug%': 1,
956         }, {
957           'v8_optimized_debug%': 2,
958         }],
960         # Disable various features by default on embedded.
961         ['embedded==1', {
962           'remoting%': 0,
963           'enable_printing%': 0,
964         }],
966         # By default, use ICU data file (icudtl.dat) on all platforms
967         # except when building Android WebView or Chromecast.
968         # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
969         # Set the data reduction proxy origin for Android Webview.
970         ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0', {
971           'icu_use_data_file_flag%' : 1,
972           'spdy_proxy_auth_origin%': '',
973           'data_reduction_proxy_probe_url%': '',
974           'data_reduction_proxy_warmup_url%': '',
975           'data_reduction_dev_host%': '',
976           'data_reduction_fallback_host%': '',
977         }, {
978           'icu_use_data_file_flag%' : 0,
979           'spdy_proxy_auth_origin%': 'https://proxy.googlezip.net:443/',
980           'data_reduction_proxy_probe_url%': 'http://check.googlezip.net/connect',
981           'data_reduction_proxy_warmup_url%': 'http://www.gstatic.com/generate_204',
982           'data_reduction_dev_host%': 'http://proxy-dev.googlezip.net:80/',
983           'data_reduction_fallback_host%': 'http://compress.googlezip.net:80/',
984         }],
985         ['OS=="win" or OS=="mac"', {
986             'enable_wifi_bootstrapping%' : 1,
987         }],
989         # Path to sas.dll, which provides the SendSAS function.
990         # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
991         ['target_arch=="x64"', {
992           'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
993         }, {
994           'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
995         }],
997         # Turn on JNI generation optimizations on non-WebView builds.
998         ['OS=="android" and android_webview_build==0', {
999           'optimize_jni_generation%': 1,
1000         }, {
1001           'optimize_jni_generation%': 0,
1002         }],
1003       ],
1005       # Set this to 1 to enable use of concatenated impulse responses
1006       # for the HRTF panner in WebAudio.
1007       'use_concatenated_impulse_responses': 1,
1009       # You can set the variable 'use_official_google_api_keys' to 1
1010       # to use the Google-internal file containing official API keys
1011       # for Google Chrome even in a developer build.  Setting this
1012       # variable explicitly to 1 will cause your build to fail if the
1013       # internal file is missing.
1014       #
1015       # The variable is documented here, but not handled in this file;
1016       # see //google_apis/determine_use_official_keys.gypi for the
1017       # implementation.
1018       #
1019       # Set the variable to 0 to not use the internal file, even when
1020       # it exists in your checkout.
1021       #
1022       # Leave it unset in your include.gypi to have the variable
1023       # implicitly set to 1 if you have
1024       # src/google_apis/internal/google_chrome_api_keys.h in your
1025       # checkout, and implicitly set to 0 if not.
1026       #
1027       # Note that official builds always behave as if the variable
1028       # was explicitly set to 1, i.e. they always use official keys,
1029       # and will fail to build if the internal file is missing.
1030       #
1031       # NOTE: You MUST NOT explicitly set the variable to 2 in your
1032       # include.gypi or by other means. Due to subtleties of GYP, this
1033       # is not the same as leaving the variable unset, even though its
1034       # default value in
1035       # //google_apis/determine_use_official_keys.gypi is 2.
1037       # Set these to bake the specified API keys and OAuth client
1038       # IDs/secrets into your build.
1039       #
1040       # If you create a build without values baked in, you can instead
1041       # set environment variables to provide the keys at runtime (see
1042       # src/google_apis/google_api_keys.h for details).  Features that
1043       # require server-side APIs may fail to work if no keys are
1044       # provided.
1045       #
1046       # Note that if you are building an official build or if
1047       # use_official_google_api_keys has been set to 1 (explicitly or
1048       # implicitly), these values will be ignored and the official
1049       # keys will be used instead.
1050       'google_api_key%': '',
1051       'google_default_client_id%': '',
1052       'google_default_client_secret%': '',
1053       # Native Client is enabled by default.
1054       'disable_nacl%': '0',
1055     },
1057     # Copy conditionally-set variables out one scope.
1058     'branding%': '<(branding)',
1059     'buildtype%': '<(buildtype)',
1060     'target_arch%': '<(target_arch)',
1061     'target_subarch%': '<(target_subarch)',
1062     'mips_arch_variant%': '<(mips_arch_variant)',
1063     'host_arch%': '<(host_arch)',
1064     'toolkit_views%': '<(toolkit_views)',
1065     'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1066     'use_aura%': '<(use_aura)',
1067     'use_ash%': '<(use_ash)',
1068     'use_cras%': '<(use_cras)',
1069     'use_openssl%': '<(use_openssl)',
1070     'use_openssl_certs%': '<(use_openssl_certs)',
1071     'use_nss%': '<(use_nss)',
1072     'use_udev%': '<(use_udev)',
1073     'os_bsd%': '<(os_bsd)',
1074     'os_posix%': '<(os_posix)',
1075     'use_dbus%': '<(use_dbus)',
1076     'use_glib%': '<(use_glib)',
1077     'use_pango%': '<(use_pango)',
1078     'use_cairo%': '<(use_cairo)',
1079     'use_ozone%': '<(use_ozone)',
1080     'use_ozone_evdev%': '<(use_ozone_evdev)',
1081     'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1082     'desktop_linux%': '<(desktop_linux)',
1083     'use_x11%': '<(use_x11)',
1084     'use_gnome_keyring%': '<(use_gnome_keyring)',
1085     'linux_fpic%': '<(linux_fpic)',
1086     'chromeos%': '<(chromeos)',
1087     'chromecast%': '<(chromecast)',
1088     'enable_viewport%': '<(enable_viewport)',
1089     'enable_hidpi%': '<(enable_hidpi)',
1090     'use_xi2_mt%':'<(use_xi2_mt)',
1091     'image_loader_extension%': '<(image_loader_extension)',
1092     'fastbuild%': '<(fastbuild)',
1093     'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1094     'win_z7%': '<(win_z7)',
1095     'dcheck_always_on%': '<(dcheck_always_on)',
1096     'tracing_like_official_build%': '<(tracing_like_official_build)',
1097     'arm_version%': '<(arm_version)',
1098     'arm_neon%': '<(arm_neon)',
1099     'arm_neon_optional%': '<(arm_neon_optional)',
1100     'sysroot%': '<(sysroot)',
1101     'chroot_cmd%': '<(chroot_cmd)',
1102     'system_libdir%': '<(system_libdir)',
1103     'component%': '<(component)',
1104     'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1105     'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
1106     'use_third_party_translations%': '<(use_third_party_translations)',
1107     'remoting%': '<(remoting)',
1108     'enable_one_click_signin%': '<(enable_one_click_signin)',
1109     'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1110     'enable_webrtc%': '<(enable_webrtc)',
1111     'chromium_win_pch%': '<(chromium_win_pch)',
1112     'configuration_policy%': '<(configuration_policy)',
1113     'safe_browsing%': '<(safe_browsing)',
1114     'enable_web_speech%': '<(enable_web_speech)',
1115     'notifications%': '<(notifications)',
1116     'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1117     'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1118     'asan%': '<(asan)',
1119     'asan_coverage%': '<(asan_coverage)',
1120     'use_sanitizer_options%': '<(use_sanitizer_options)',
1121     'syzyasan%': '<(syzyasan)',
1122     'syzygy_optimize%': '<(syzygy_optimize)',
1123     'lsan%': '<(lsan)',
1124     'msan%': '<(msan)',
1125     'msan_blacklist%': '<(msan_blacklist)',
1126     'msan_track_origins%': '<(msan_track_origins)',
1127     'tsan%': '<(tsan)',
1128     'tsan_blacklist%': '<(tsan_blacklist)',
1129     'ubsan%': '<(ubsan)',
1130     'ubsan_vptr%': '<(ubsan_vptr)',
1131     'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1132     'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1133     'use_custom_libcxx%': '<(use_custom_libcxx)',
1134     'use_system_libcxx%': '<(use_system_libcxx)',
1135     'clang_type_profiler%': '<(clang_type_profiler)',
1136     'order_profiling%': '<(order_profiling)',
1137     'order_text_section%': '<(order_text_section)',
1138     'enable_extensions%': '<(enable_extensions)',
1139     'enable_plugin_installation%': '<(enable_plugin_installation)',
1140     'enable_plugins%': '<(enable_plugins)',
1141     'enable_session_service%': '<(enable_session_service)',
1142     'enable_themes%': '<(enable_themes)',
1143     'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1144     'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1145     'enable_background%': '<(enable_background)',
1146     'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1147     'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1148     'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1149     'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1150     'use_canvas_skia%': '<(use_canvas_skia)',
1151     'test_isolation_mode%': '<(test_isolation_mode)',
1152     'test_isolation_outdir%': '<(test_isolation_outdir)',
1153     'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1154     'enable_printing%': '<(enable_printing)',
1155     'enable_spellcheck%': '<(enable_spellcheck)',
1156     'enable_google_now%': '<(enable_google_now)',
1157     'cld_version%': '<(cld_version)',
1158     'cld2_table_size%': '<(cld2_table_size)',
1159     'cld2_data_source%': '<(cld2_data_source)',
1160     'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1161     'disable_file_support%': '<(disable_file_support)',
1162     'disable_ftp_support%': '<(disable_ftp_support)',
1163     'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1164     'enable_task_manager%': '<(enable_task_manager)',
1165     'sas_dll_path%': '<(sas_dll_path)',
1166     'wix_path%': '<(wix_path)',
1167     'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1168     'use_system_libjpeg%': '<(use_system_libjpeg)',
1169     'android_webview_build%': '<(android_webview_build)',
1170     'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
1171     'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1172     'gyp_managed_install%': 0,
1173     'create_standalone_apk%': 1,
1174     'enable_app_list%': '<(enable_app_list)',
1175     'use_default_render_theme%': '<(use_default_render_theme)',
1176     'enable_settings_app%': '<(enable_settings_app)',
1177     'google_api_key%': '<(google_api_key)',
1178     'google_default_client_id%': '<(google_default_client_id)',
1179     'google_default_client_secret%': '<(google_default_client_secret)',
1180     'enable_managed_users%': '<(enable_managed_users)',
1181     'native_discardable_memory%': '<(native_discardable_memory)',
1182     'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1183     'data_reduction_fallback_host%': '<(data_reduction_fallback_host)',
1184     'data_reduction_dev_host%': '<(data_reduction_dev_host)',
1185     'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)',
1186     'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1187     'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1188     'data_reduction_proxy_probe_url%': '<(data_reduction_proxy_probe_url)',
1189     'data_reduction_proxy_warmup_url%': '<(data_reduction_proxy_warmup_url)',
1190     'data_reduction_proxy_ssl_origin%' : '<(data_reduction_proxy_ssl_origin)',
1191     'data_reduction_proxy_alt_origin%' : '<(data_reduction_proxy_alt_origin)',
1192     'data_reduction_proxy_alt_fallback_origin%' : '<(data_reduction_proxy_alt_fallback_origin)',
1193     'enable_mdns%' : '<(enable_mdns)',
1194     'enable_service_discovery%' : '<(enable_service_discovery)',
1195     'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1196     'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1197     'v8_optimized_debug%': '<(v8_optimized_debug)',
1198     'proprietary_codecs%': '<(proprietary_codecs)',
1199     'use_goma%': '<(use_goma)',
1200     'gomadir%': '<(gomadir)',
1201     'video_hole%': '<(video_hole)',
1203     # Use system protobuf instead of bundled one.
1204     'use_system_protobuf%': 0,
1206     # Use system yasm instead of bundled one.
1207     'use_system_yasm%': 0,
1209     # Use system ICU instead of bundled one.
1210     'use_system_icu%' : 0,
1212     # Default to enabled PIE; this is important for ASLR but we may need to be
1213     # able to turn it off for various reasons.
1214     'linux_disable_pie%': 0,
1216     # The release channel that this build targets. This is used to restrict
1217     # channel-specific build options, like which installer packages to create.
1218     # The default is 'all', which does no channel-specific filtering.
1219     'channel%': 'all',
1221     # Override chromium_mac_pch and set it to 0 to suppress the use of
1222     # precompiled headers on the Mac.  Prefix header injection may still be
1223     # used, but prefix headers will not be precompiled.  This is useful when
1224     # using distcc to distribute a build to compile slaves that don't
1225     # share the same compiler executable as the system driving the compilation,
1226     # because precompiled headers rely on pointers into a specific compiler
1227     # executable's image.  Setting this to 0 is needed to use an experimental
1228     # Linux-Mac cross compiler distcc farm.
1229     'chromium_mac_pch%': 1,
1231     # The default value for mac_strip in target_defaults. This cannot be
1232     # set there, per the comment about variable% in a target_defaults.
1233     'mac_strip_release%': 0,
1235     # Set to 1 to enable java code coverage. Instruments classes during build
1236     # to produce .ec files during runtime.
1237     'emma_coverage%': 0,
1239     # EMMA filter string consisting of a list of inclusion/exclusion patterns
1240     # separated with whitespace and/or comma. Only has effect if
1241     # 'emma_coverage=1'.
1242     'emma_filter%': '',
1244     # Set to 1 to enable running Android lint on java/class files.
1245     'android_lint%': 1,
1247     # Although base/allocator lets you select a heap library via an
1248     # environment variable, the libcmt shim it uses sometimes gets in
1249     # the way.  To disable it entirely, and switch to normal msvcrt, do e.g.
1250     #  'win_use_allocator_shim': 0,
1251     #  'win_release_RuntimeLibrary': 2
1252     # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1253     'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1255     # TODO(bradnelson): eliminate this when possible.
1256     # To allow local gyp files to prevent release.vsprops from being included.
1257     # Yes(1) means include release.vsprops.
1258     # Once all vsprops settings are migrated into gyp, this can go away.
1259     'msvs_use_common_release%': 1,
1261     # TODO(bradnelson): eliminate this when possible.
1262     # To allow local gyp files to override additional linker options for msvs.
1263     # Yes(1) means set use the common linker options.
1264     'msvs_use_common_linker_extras%': 1,
1266     # TODO(sgk): eliminate this if possible.
1267     # It would be nicer to support this via a setting in 'target_defaults'
1268     # in chrome/app/locales/locales.gypi overriding the setting in the
1269     # 'Debug' configuration in the 'target_defaults' dict below,
1270     # but that doesn't work as we'd like.
1271     'msvs_debug_link_incremental%': '2',
1273     # Needed for some of the largest modules.
1274     'msvs_debug_link_nonincremental%': '1',
1276     # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1277     # to get incremental linking to be faster in debug builds.
1278     'incremental_chrome_dll%': '0',
1280     # Experimental setting to break chrome.dll into multiple pieces based on
1281     # process type.
1282     'chrome_multiple_dll%': '0',
1284     # Experimental setting to optimize Chrome's DLLs with PGO.
1285     'chrome_pgo_phase%': '0',
1287     # Clang stuff.
1288     'clang%': '<(clang)',
1289     'host_clang%': '<(host_clang)',
1290     'make_clang_dir%': '<(make_clang_dir)',
1292     # Control which version of clang to use when building for iOS.  If set to
1293     # '1', uses the version of clang that ships with Xcode.  If set to '0', uses
1294     # the version of clang that ships with the Chromium source.  This variable
1295     # is automatically set to '1' when using the Xcode generator.
1296     'clang_xcode%': 0,
1298     # These two variables can be set in GYP_DEFINES while running
1299     # |gclient runhooks| to let clang run a plugin in every compilation.
1300     # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1301     # Example:
1302     #     GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1304     'clang_load%': '',
1305     'clang_add_plugin%': '',
1307     # Tell ld64 to write map files describing binary layout. Useful
1308     # for looking at what contributes to binary size, e.g. with
1309     # https://github.com/nico/bloat
1310     'mac_write_linker_maps%': 0,
1312     # The default type of gtest.
1313     'gtest_target_type%': 'executable',
1315     # Enable sampling based profiler.
1316     # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1317     'profiling%': '0',
1318     # Profile without optimizing out stack frames when profiling==1.
1319     'profiling_full_stack_frames%': '0',
1321     # And if we want to dump symbols for Breakpad-enabled builds.
1322     'linux_dump_symbols%': 0,
1323     # And if we want to strip the binary after dumping symbols.
1324     'linux_strip_binary%': 0,
1325     # If we want stack unwind support for backtrace().
1326     'debug_unwind_tables%': 1,
1327     'release_unwind_tables%': 1,
1329     # Override where to find binutils
1330     'binutils_version%': 0,
1331     'binutils_dir%': '',
1333     # Enable TCMalloc.
1334     # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1335     'use_allocator%': 'tcmalloc',
1337     # Set to 1 to link against libgnome-keyring instead of using dlopen().
1338     'linux_link_gnome_keyring%': 0,
1339     # Set to 1 to link against gsettings APIs instead of using dlopen().
1340     'linux_link_gsettings%': 0,
1342     # Enable use of OpenMAX DL FFT routines.
1343     'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1345     # Enable new NPDevice API.
1346     'enable_new_npdevice_api%': 0,
1348     # Enable EGLImage support in OpenMAX
1349     'enable_eglimage%': 1,
1351     # .gyp files or targets should set chromium_code to 1 if they build
1352     # Chromium-specific code, as opposed to external code.  This variable is
1353     # used to control such things as the set of warnings to enable, and
1354     # whether warnings are treated as errors.
1355     'chromium_code%': 0,
1357     # Disable fatal linker warnings, similarly to how we make it possible
1358     # to disable -Werror (e.g. for different toolchain versions).
1359     'disable_fatal_linker_warnings%': 0,
1361     'release_valgrind_build%': 0,
1363     # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1364     'enable_wexit_time_destructors%': 0,
1366     # Build libpeerconnection as a static library by default.
1367     'libpeer_target_type%': 'static_library',
1369     # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1370     'internal_gles2_conform_tests%': 0,
1372     # Set to 1 to compile the filter fuzzer.
1373     'internal_filter_fuzzer%': 0,
1375     # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1376     # so Cocoa is happy (http://crbug.com/20441).
1377     'locales': [
1378       'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1379       'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1380       'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1381       'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1382       'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1383       'vi', 'zh-CN', 'zh-TW',
1384     ],
1386     # Pseudo locales are special locales which are used for testing and
1387     # debugging. They don't get copied to the final app. For more info,
1388     # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1389     'pseudo_locales': [
1390       'fake-bidi',
1391     ],
1393     'grit_defines': [],
1395     # If debug_devtools is set to 1, JavaScript files for DevTools are
1396     # stored as is and loaded from disk. Otherwise, a concatenated file
1397     # is stored in resources.pak. It is still possible to load JS files
1398     # from disk by passing --debug-devtools cmdline switch.
1399     'debug_devtools%': 0,
1401     # The Java Bridge is not compiled in by default.
1402     'java_bridge%': 0,
1404     # Code signing for iOS binaries.  The bots need to be able to disable this.
1405     'chromium_ios_signing%': 1,
1407     # This flag is only used when disable_nacl==0 and disables all those
1408     # subcomponents which would require the installation of a native_client
1409     # untrusted toolchain.
1410     'disable_nacl_untrusted%': 0,
1412     # Disable Dart by default.
1413     'enable_dart%': 0,
1415     # Copy out the setting of disable_nacl.
1416     'disable_nacl%': '<(disable_nacl)',
1418     # Portable Native Client is enabled by default.
1419     'disable_pnacl%': 0,
1421     # Whether to build full debug version for Debug configuration on Android.
1422     # Compared to full debug version, the default Debug configuration on Android
1423     # has no full v8 debug, has size optimization and linker gc section, so that
1424     # we can build a debug version with acceptable size and performance.
1425     'android_full_debug%': 0,
1427     # Sets the default version name and code for Android app, by default we
1428     # do a developer build.
1429     'android_app_version_name%': 'Developer Build',
1430     'android_app_version_code%': 0,
1432     # Contains data about the attached devices for gyp_managed_install.
1433     'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1435     'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1436     'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1438     'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1439     'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1441     # Whether we are using the rlz library or not.  Platforms like Android send
1442     # rlz codes for searches but do not use the library.
1443     'enable_rlz%': 0,
1445     # Turns on the i18n support in V8.
1446     'v8_enable_i18n_support': 1,
1448     # Compile d8 for the host toolset.
1449     'v8_toolset_for_d8': 'host',
1451     # Use the chromium skia by default.
1452     'use_system_skia%': '0',
1454     # Use brlapi from brltty for braille display support.
1455     'use_brlapi%': 0,
1457     # Relative path to icu.gyp from this file.
1458     'icu_gyp_path': '../third_party/icu/icu.gyp',
1460     # IPC fuzzer is disabled by default.
1461     'enable_ipc_fuzzer%': 0,
1464     # Force disable libstdc++ debug mode.
1465     'disable_glibcxx_debug%': 0,
1467     # Set to 1 to compile with MSE support for MPEG2 TS
1468     'enable_mpeg2ts_stream_parser%': 0,
1470     # Support ChromeOS touchpad gestures with ozone.
1471     'use_evdev_gestures%': 0,
1473     # Default ozone platform (if no --ozone-platform flag).
1474     'ozone_platform%': "",
1476     # Ozone platforms to include in the build.
1477     'ozone_platform_caca%': 0,
1478     'ozone_platform_dri%': 0,
1479     'ozone_platform_egltest%': 0,
1480     'ozone_platform_gbm%': 0,
1481     'ozone_platform_ozonex%': 0,
1482     'ozone_platform_test%': 0,
1484     # Chrome OS: whether to build ChromeVox from sources in the Chromium
1485     # repository rather than using precompiled JavaScript in
1486     # chrome/third_party/chromevox.  This is still experimental.
1487     'use_migrated_chromevox%': 1,
1489     # Chrome OS: whether to also build the upcoming version of
1490     # ChromeVox, which can then be enabled via a command-line switch.
1491     'use_chromevox_next%': 0,
1493     'conditions': [
1494       # The version of clang shipped upstream does not find C++ headers when
1495       # using -stdlib=libc++ so we instead need to use the version of clang
1496       # coming with Xcode.
1497       ['OS=="ios" and use_system_libcxx==1', {
1498         'clang_xcode%': 1,
1499       }],
1500       # Enable the Syzygy optimization step for the official builds.
1501       ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1502         'syzygy_optimize%': 1,
1503       }, {
1504         'syzygy_optimize%': 0,
1505       }],
1506       # Get binutils version so we can enable debug fission if we can.
1507       ['os_posix==1 and OS!="mac" and OS!="ios"', {
1508         'conditions': [
1509           # compiler_version doesn't work with clang
1510           # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1511           # compiler_version works with clang.
1512           # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1513           # that it takes effect here.
1514           ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1515             'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1516           }],
1517           # On Android we know the binutils version in the toolchain.
1518           ['OS=="android"', {
1519             'binutils_version%': 222,
1520           }],
1521           ['host_arch=="x64"', {
1522             'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1523           }],
1524           ['host_arch=="ia32"', {
1525             'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1526           }],
1527           # Our version of binutils in third_party/binutils
1528           ['linux_use_bundled_binutils==1', {
1529             'binutils_version%': 224,
1530           }],
1531         ],
1532       }, {
1533         'binutils_version%': 0,
1534       }],
1535       # The version of GCC in use, set later in platforms that use GCC and have
1536       # not explicitly chosen to build with clang. Currently, this means all
1537       # platforms except Windows, Mac and iOS.
1538       # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1539       # it takes effect here.
1540       ['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', {
1541         'conditions': [
1542           ['OS=="android"', {
1543             # We directly set the gcc versions since we know what we use.
1544             'gcc_version%': 48,
1545           }, {
1546             'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1547           }],
1548           ['android_webview_build==1', {
1549             # Android WebView uses a hermetic clang toolchain for host builds.
1550             'host_gcc_version%': 0,
1551           }, {  # android_webview_build!=1
1552             'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1553           }],
1554         ],
1555       }, {
1556         'host_gcc_version%': 0,
1557         'gcc_version%': 0,
1558       }],
1559       ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1560         'windows_sdk_path%': '<(windows_sdk_default_path)',
1561       }, {
1562         'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
1563       }],
1564       ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1565         'directx_sdk_path%': '<(directx_sdk_default_path)',
1566       }, {
1567         'directx_sdk_path%': '$(DXSDK_DIR)',
1568       }],
1569       ['OS=="win"', {
1570         'windows_driver_kit_path%': '$(WDK_DIR)',
1571       }],
1572       ['os_posix==1 and OS!="mac" and OS!="ios"', {
1573         'conditions': [
1574           ['target_arch=="mipsel" or target_arch=="mips64el"', {
1575             'werror%': '',
1576             'disable_nacl%': 1,
1577             'nacl_untrusted_build%': 0,
1578             'use_allocator%': 'none',
1579           }],
1580           ['OS=="linux" and target_arch=="mipsel"', {
1581             'sysroot%': '<(sysroot)',
1582             'CXX%': '<(CXX)',
1583           }],
1584           # All Chrome builds have breakpad symbols, but only process the
1585           # symbols from official builds.
1586           ['(branding=="Chrome" and buildtype=="Official")', {
1587             'linux_dump_symbols%': 1,
1589             # Omit unwind support in official release builds to save space. We
1590             # can use breakpad for these builds.
1591             'release_unwind_tables%': 0,
1593             'conditions': [
1594               # For official builds, use a 64-bit linker to avoid running out
1595               # of address space. The buildbots should have a 64-bit kernel
1596               # and a 64-bit libc installed.
1597               ['host_arch=="ia32" and target_arch=="ia32"', {
1598                 'linux_use_bundled_gold%': '1',
1599                 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1600               }],
1601             ],
1602           }],
1603         ],
1604       }],  # os_posix==1 and OS!="mac" and OS!="ios"
1605       ['OS=="ios"', {
1606         'disable_nacl%': 1,
1607         'enable_background%': 0,
1608         'icu_use_data_file_flag%': 1,
1609         'enable_web_speech%': 0,
1610         'use_system_libxml%': 1,
1611         'use_system_sqlite%': 1,
1612         'locales==': [
1613           'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1614           'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1615           'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1616           'uk', 'vi', 'zh-CN', 'zh-TW',
1617         ],
1619         # The Mac SDK is set for iOS builds and passed through to Mac
1620         # sub-builds. This allows the Mac sub-build SDK in an iOS build to be
1621         # overridden from the command line the same way it is for a Mac build.
1622         'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py 10.6)',
1624         # iOS SDK and deployment target support.  The |ios_sdk| value is left
1625         # blank so that when it is set in the project files it will be the
1626         # "current" iOS SDK.  Forcing a specific SDK even if it is "current"
1627         # causes Xcode to spit out a warning for every single project file for
1628         # not using the "current" SDK.
1629         'ios_sdk%': '',
1630         'ios_sdk_path%': '',
1631         'ios_deployment_target%': '7.0',
1633         'conditions': [
1634           # ios_product_name is set to the name of the .app bundle as it should
1635           # appear on disk.
1636           ['branding=="Chrome"', {
1637             'ios_product_name%': 'Chrome',
1638           }, { # else: branding!="Chrome"
1639             'ios_product_name%': 'Chromium',
1640           }],
1641           ['branding=="Chrome" and buildtype=="Official"', {
1642             'ios_breakpad%': 1,
1643           }, { # else: branding!="Chrome" or buildtype!="Official"
1644             'ios_breakpad%': 0,
1645           }],
1646         ],
1647       }],  # OS=="ios"
1648       ['OS=="android"', {
1649         # Location of Android NDK.
1650         'variables': {
1651           'variables': {
1652             # Unfortunately we have to use absolute paths to the SDK/NDK because
1653             # they're passed to ant which uses a different relative path from
1654             # gyp.
1655             'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1656             'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1657             'android_host_arch%': '<!(uname -m)',
1658             # Android API-level of the SDK used for compilation.
1659             'android_sdk_version%': '20',
1660             'android_sdk_build_tools_version%': '20.0.0',
1661             'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1662           },
1663           # Copy conditionally-set variables out one scope.
1664           'android_ndk_root%': '<(android_ndk_root)',
1665           'android_sdk_root%': '<(android_sdk_root)',
1666           'android_sdk_version%': '<(android_sdk_version)',
1667           'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1668           'host_os%': '<(host_os)',
1670           'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1671           # Android SDK build tools (e.g. dx, aapt, aidl)
1672           'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1674           # Android API level 14 is ICS (Android 4.0) which is the minimum
1675           # platform requirement for Chrome on Android, we use it for native
1676           # code compilation.
1677           'conditions': [
1678             ['target_arch == "ia32"', {
1679               'android_app_abi%': 'x86',
1680               'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1681               'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1682               'android_ndk_lib_dir%': 'usr/lib',
1683               'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1684             }],
1685             ['target_arch == "x64"', {
1686               'android_app_abi%': 'x86_64',
1687               'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1688               'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-x86_64',
1689               'android_ndk_lib_dir%': 'usr/lib64',
1690               'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1691             }],
1692             ['target_arch=="arm"', {
1693               'conditions': [
1694                 ['arm_version<7', {
1695                   'android_app_abi%': 'armeabi',
1696                 }, {
1697                   'android_app_abi%': 'armeabi-v7a',
1698                 }],
1699               ],
1700               'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1701               'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1702               'android_ndk_lib_dir%': 'usr/lib',
1703               'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1704             }],
1705             ['target_arch == "arm64"', {
1706               'android_app_abi%': 'arm64-v8a',
1707               'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1708               'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-arm64',
1709               'android_ndk_lib_dir%': 'usr/lib',
1710               'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1711             }],
1712             ['target_arch == "mipsel"', {
1713               'android_app_abi%': 'mips',
1714               'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1715               'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1716               'android_ndk_lib_dir%': 'usr/lib',
1717               'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1718             }],
1719             ['target_arch == "mips64el"', {
1720               'android_app_abi%': 'mips64',
1721               'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1722               'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-mips64',
1723               'android_ndk_lib_dir%': 'usr/lib64',
1724               'android_toolchain%': '<(android_ndk_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1725               'gcc_version%': 49,
1726             }],
1727           ],
1728         },
1729         # Copy conditionally-set variables out one scope.
1730         'android_app_abi%': '<(android_app_abi)',
1731         'android_gdbserver%': '<(android_gdbserver)',
1732         'android_ndk_root%': '<(android_ndk_root)',
1733         'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1734         'android_sdk_root%': '<(android_sdk_root)',
1735         'android_sdk_version%': '<(android_sdk_version)',
1736         'android_toolchain%': '<(android_toolchain)',
1738         'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1739         'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1740         'android_sdk_tools%': '<(android_sdk_tools)',
1741         'android_sdk%': '<(android_sdk)',
1742         'android_sdk_jar%': '<(android_sdk)/android.jar',
1744         'android_stlport_root': '<(android_stlport_root)',
1745         'android_stlport_include': '<(android_stlport_root)/stlport',
1746         'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1747         'host_os%': '<(host_os)',
1749         # Location of the "objcopy" binary, used by both gyp and scripts.
1750         'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1752         # Location of the "strip" binary, used by both gyp and scripts.
1753         'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1755         # Location of the "readelf" binary.
1756         'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1758         # Determines whether we should optimize JNI generation at the cost of
1759         # breaking assumptions in the build system that when inputs have changed
1760         # the outputs should always change as well.  This is meant purely for
1761         # developer builds, to avoid spurious re-linking of native files.
1762         'optimize_jni_generation%': '<(optimize_jni_generation)',
1764         # Always uses openssl.
1765         'use_openssl%': 1,
1766         'use_openssl_certs%': 1,
1768         'proprietary_codecs%': '<(proprietary_codecs)',
1769         'safe_browsing%': 1,
1770         'enable_web_speech%': 0,
1771         'java_bridge%': 1,
1772         'build_ffmpegsumo%': 0,
1773         'use_allocator%': 'none',
1775         # Disable Native Client.
1776         'disable_nacl%': 1,
1778         # Android does not support background apps.
1779         'enable_background%': 0,
1781         # Sessions are store separately in the Java side.
1782         'enable_session_service%': 0,
1784         'p2p_apis%' : 0,
1786         'gtest_target_type%': 'shared_library',
1788         # Uses system APIs for decoding audio and video.
1789         'use_libffmpeg%': '0',
1791         # When building as part of the Android system, use system libraries
1792         # where possible to reduce ROM size.
1793         # TODO(steveblock): Investigate using the system version of sqlite.
1794         'use_system_sqlite%': 0,  # '<(android_webview_build)',
1795         'use_system_expat%': '<(android_webview_build)',
1796         'use_system_icu%': '<(android_webview_build)',
1797         'use_system_stlport%': '<(android_webview_build)',
1799         # Copy it out one scope.
1800         'android_webview_build%': '<(android_webview_build)',
1802         # Default android linker script for shared library exports.
1803         'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_exports.lst',
1804       }],  # OS=="android"
1805       ['embedded==1', {
1806         'use_system_fontconfig%': 0,
1807       }, {
1808         'use_system_fontconfig%': 1,
1809       }],
1810       ['chromecast==1', {
1811         'enable_mpeg2ts_stream_parser%': 1,
1812         'ffmpeg_branding%': 'Chrome',
1813         'ozone_platform_ozonex%': 1,
1814         'conditions': [
1815           ['target_arch=="arm"', {
1816             'arm_arch%': '',
1817             'arm_tune%': 'cortex-a9',
1818             'arm_thumb%': 1,
1819             'video_hole%': 1,
1820           }],
1821         ],
1822       }],
1823       ['android_webview_build==1 or android_webview_telemetry_build==1', {
1824         # When building the WebView in the Android tree, jarjar will remap all
1825         # the class names, so the JNI generator needs to know this.
1826         'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1827       }],
1828       ['OS=="linux" and target_arch!="mipsel"', {
1829         # TODO(thakis): This is here to measure perf for a while.
1830         'clang%': 1,
1831       }],  # OS=="mac"
1832       ['OS=="mac"', {
1833         'conditions': [
1834           # All Chrome builds have breakpad symbols, but only process the
1835           # symbols from official builds.
1836           ['(branding=="Chrome" and buildtype=="Official")', {
1837             'mac_strip_release%': 1,
1838           }],
1839         ],
1840       }],  # OS=="mac"
1841       ['OS=="mac" or OS=="ios"', {
1842         'clang%': 1,
1844         'variables': {
1845           # Mac OS X SDK and deployment target support.  The SDK identifies
1846           # the version of the system headers that will be used, and
1847           # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1848           # macro.  "Maximum allowed" refers to the operating system version
1849           # whose APIs are available in the headers.  The deployment target
1850           # identifies the minimum system version that the built products are
1851           # expected to function on.  It corresponds to the
1852           # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.  To ensure these
1853           # macros are available, #include <AvailabilityMacros.h>.  Additional
1854           # documentation on these macros is available at
1855           # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1856           # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1857           # deployment target to 10.6.  Other projects, such as O3D, may
1858           # override these defaults.
1860           # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1861           # about that is at least the specified version. In official builds,
1862           # the SDK must match mac_sdk_min exactly. If the SDK is installed
1863           # someplace that Xcode doesn't know about, set mac_sdk_path to the
1864           # path to the SDK; when set to a non-empty string, SDK detection
1865           # based on mac_sdk_min will be bypassed entirely.
1866           'mac_sdk_min%': '10.6',
1867           'mac_sdk_path%': '',
1869           'mac_deployment_target%': '10.6',
1870         },
1872         'mac_sdk_min': '<(mac_sdk_min)',
1873         'mac_sdk_path': '<(mac_sdk_path)',
1874         'mac_deployment_target': '<(mac_deployment_target)',
1876         # Compile in Breakpad support by default so that it can be
1877         # tested, even if it is not enabled by default at runtime.
1878         'mac_breakpad_compiled_in%': 1,
1879         'conditions': [
1880           # mac_product_name is set to the name of the .app bundle as it should
1881           # appear on disk.  This duplicates data from
1882           # chrome/app/theme/chromium/BRANDING and
1883           # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1884           # these names into the build system.
1885           ['branding=="Chrome"', {
1886             'mac_product_name%': 'Google Chrome',
1887           }, { # else: branding!="Chrome"
1888             'mac_product_name%': 'Chromium',
1889           }],
1891           ['branding=="Chrome" and buildtype=="Official"', {
1892             'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1893             # Enable uploading crash dumps.
1894             'mac_breakpad_uploads%': 1,
1895             # Enable dumping symbols at build time for use by Mac Breakpad.
1896             'mac_breakpad%': 1,
1897             # Enable Keystone auto-update support.
1898             'mac_keystone%': 1,
1899           }, { # else: branding!="Chrome" or buildtype!="Official"
1900             'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1901             'mac_breakpad_uploads%': 0,
1902             'mac_breakpad%': 0,
1903             'mac_keystone%': 0,
1904           }],
1905         ],
1906       }],  # OS=="mac" or OS=="ios"
1907       ['OS=="win"', {
1908         'conditions': [
1909           # This is the architecture convention used in WinSDK paths.
1910           ['target_arch=="ia32"', {
1911             'winsdk_arch%': 'x86',
1912           },{
1913             'winsdk_arch%': '<(target_arch)',
1914           }],
1915           ['component=="shared_library"', {
1916             'win_use_allocator_shim%': 0,
1917           },{
1918             # Turn on multiple dll by default on Windows when in static_library.
1919             'chrome_multiple_dll%': 1,
1920           }],
1921           ['asan==1', {
1922             'win_use_allocator_shim%': 0,
1923           }],
1924           ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1925             # Only enabled by default for ninja because it's buggy in VS.
1926             # Not enabled for component=static_library because some targets
1927             # are too large and the toolchain fails due to the size of the
1928             # .obj files.
1929             'incremental_chrome_dll%': 1,
1930           }],
1931           # Don't do incremental linking for large modules on 32-bit or when
1932           # component=static_library as the toolchain fails due to the size of
1933           # the .ilk files.
1934           ['MSVS_OS_BITS==32 or component=="static_library"', {
1935             'msvs_large_module_debug_link_mode%': '1',  # No
1936           },{
1937             'msvs_large_module_debug_link_mode%': '2',  # Yes
1938           }],
1939           ['MSVS_VERSION=="2013e"', {
1940             'msvs_express%': 1,
1941             'secure_atl%': 0,
1942           },{
1943             'msvs_express%': 0,
1944             'secure_atl%': 1,
1945           }],
1946         ],
1947         'nacl_win64_defines': [
1948           # This flag is used to minimize dependencies when building
1949           # Native Client loader for 64-bit Windows.
1950           'NACL_WIN64',
1951         ],
1952       }],
1954       ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1955         'use_cups%': 1,
1956       }, {
1957         'use_cups%': 0,
1958       }],
1960       ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1961         'enable_pepper_cdms%': 1,
1962       }, {
1963         'enable_pepper_cdms%': 0,
1964       }],
1966       ['OS=="android"', {
1967         'enable_browser_cdms%': 1,
1968       }, {
1969         'enable_browser_cdms%': 0,
1970       }],
1972       # Native Client glibc toolchain is enabled
1973       # by default except on arm, mips and mips64.
1974       ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
1975         'disable_glibc%': 1,
1976       }, {
1977         'disable_glibc%': 0,
1978       }],
1980       # Set the relative path from this file to the GYP file of the JPEG
1981       # library used by Chromium.
1982       ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1983         # Configuration for using the system libjeg is here.
1984         'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1985       }, {
1986         'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1987       }],
1989       # Options controlling the use of GConf (the classic GNOME configuration
1990       # system) and GIO, which contains GSettings (the new GNOME config system).
1991       ['chromeos==1 or embedded==1', {
1992         'use_gconf%': 0,
1993         'use_gio%': 0,
1994       }, {
1995         'use_gconf%': 1,
1996         'use_gio%': 1,
1997       }],
1999       # Set up -D and -E flags passed into grit.
2000       ['branding=="Chrome"', {
2001         # TODO(mmoss) The .grd files look for _google_chrome, but for
2002         # consistency they should look for google_chrome_build like C++.
2003         'grit_defines': ['-D', '_google_chrome',
2004                          '-E', 'CHROMIUM_BUILD=google_chrome'],
2005       }, {
2006         'grit_defines': ['-D', '_chromium',
2007                          '-E', 'CHROMIUM_BUILD=chromium'],
2008       }],
2009       ['chromeos==1', {
2010         'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2011       }],
2012       ['desktop_linux==1', {
2013         'grit_defines': ['-D', 'desktop_linux'],
2014       }],
2015       ['toolkit_views==1', {
2016         'grit_defines': ['-D', 'toolkit_views'],
2017       }],
2018       ['use_aura==1', {
2019         'grit_defines': ['-D', 'use_aura'],
2020       }],
2021       ['use_ash==1', {
2022         'grit_defines': ['-D', 'use_ash'],
2023       }],
2024       ['use_nss==1', {
2025         'grit_defines': ['-D', 'use_nss'],
2026       }],
2027       ['use_ozone==1', {
2028         'grit_defines': ['-D', 'use_ozone'],
2029       }],
2030       ['image_loader_extension==1', {
2031         'grit_defines': ['-D', 'image_loader_extension'],
2032       }],
2033       ['remoting==1', {
2034         'grit_defines': ['-D', 'remoting'],
2035       }],
2036       ['use_titlecase_in_grd_files==1', {
2037         'grit_defines': ['-D', 'use_titlecase'],
2038       }],
2039       ['use_third_party_translations==1', {
2040         'grit_defines': ['-D', 'use_third_party_translations'],
2041         'locales': [
2042           'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2043           'ka', 'ku', 'kw', 'ms', 'ug'
2044         ],
2045       }],
2046       ['OS=="android"', {
2047         'grit_defines': ['-t', 'android',
2048                          '-E', 'ANDROID_JAVA_TAGGED_ONLY=true'],
2049       }],
2050       ['OS=="mac" or OS=="ios"', {
2051         'grit_defines': ['-D', 'scale_factors=2x'],
2052       }],
2053       ['OS == "ios"', {
2054         'grit_defines': [
2055           '-t', 'ios',
2056           # iOS uses a whitelist to filter resources.
2057           '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
2058         ],
2060         # Enable host builds when generating with ninja-ios.
2061         'conditions': [
2062           ['"<(GENERATOR)"=="ninja"', {
2063             'host_os%': "mac",
2064           }],
2066           # TODO(sdefresne): Remove the target_subarch check once Apple has
2067           # upstreamed the support for "arm64". http://crbug.com/341453
2068           ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
2069             'clang_xcode%': 1,
2070           }],
2071         ],
2072       }],
2073       ['enable_extensions==1', {
2074         'grit_defines': ['-D', 'enable_extensions'],
2075       }],
2076       ['enable_plugins!=0', {
2077         'grit_defines': ['-D', 'enable_plugins'],
2078       }],
2079       ['enable_printing!=0', {
2080         'grit_defines': ['-D', 'enable_printing'],
2081       }],
2082       ['enable_printing==1', {
2083         'grit_defines': ['-D', 'enable_full_printing'],
2084       }],
2085       ['enable_themes==1', {
2086         'grit_defines': ['-D', 'enable_themes'],
2087       }],
2088       ['enable_app_list==1', {
2089         'grit_defines': ['-D', 'enable_app_list'],
2090       }],
2091       ['enable_settings_app==1', {
2092         'grit_defines': ['-D', 'enable_settings_app'],
2093       }],
2094       ['enable_google_now==1', {
2095         'grit_defines': ['-D', 'enable_google_now'],
2096       }],
2097       ['use_concatenated_impulse_responses==1', {
2098         'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2099       }],
2100       ['enable_webrtc==1', {
2101         'grit_defines': ['-D', 'enable_webrtc'],
2102       }],
2103       ['enable_hangout_services_extension==1', {
2104         'grit_defines': ['-D', 'enable_hangout_services_extension'],
2105       }],
2106       ['enable_task_manager==1', {
2107         'grit_defines': ['-D', 'enable_task_manager'],
2108       }],
2109       ['notifications==1', {
2110         'grit_defines': ['-D', 'enable_notifications'],
2111       }],
2112       ['enable_wifi_bootstrapping==1', {
2113         'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2114       }],
2115       ['enable_resource_whitelist_generation==1 and OS!="win"', {
2116         'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2117       }],
2118       ['enable_resource_whitelist_generation==1 and OS=="win"', {
2119         'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2120       }],
2121       ['enable_mdns==1 or OS=="mac"', {
2122         'grit_defines': ['-D', 'enable_service_discovery'],
2123         'enable_service_discovery%': 1
2124       }],
2125       ['clang_use_chrome_plugins==1 and OS!="win"', {
2126         'clang_chrome_plugins_flags': [
2127           '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
2128         ],
2129       }],
2130       ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2131         'clang%': 1,
2132         'use_allocator%': 'none',
2133       }],
2134       ['asan==1 and OS=="linux" and chromeos==0', {
2135         'use_custom_libcxx%': 1,
2136       }],
2137       ['ubsan==1', {
2138         'clang%': 1,
2139       }],
2140       ['ubsan_vptr==1', {
2141         'clang%': 1,
2142       }],
2143       ['asan==1 and OS=="mac"', {
2144         # TODO(glider): we do not strip ASan binaries until the dynamic ASan
2145         # runtime is fully adopted. See http://crbug.com/242503.
2146         'mac_strip_release': 0,
2147       }],
2148       ['tsan==1', {
2149         'use_custom_libcxx%': 1,
2150       }],
2151       ['msan==1', {
2152         # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2153         # libstdc++. This is required to avoid false positive reports whenever
2154         # the C++ standard library is used.
2155         'use_custom_libcxx%': 1,
2156         # Running the V8-generated code on an ARM simulator is a powerful hack
2157         # that allows the tool to see the memory accesses from JITted code.
2158         # Without this flag, JS code causes false positive reports from MSan.
2159         'v8_target_arch': 'arm64',
2160       }],
2162       ['OS=="linux" and clang_type_profiler==1', {
2163         'clang%': 1,
2164         'clang_use_chrome_plugins%': 0,
2165         'conditions': [
2166           ['host_arch=="x64"', {
2167             'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2168           }],
2169           ['host_arch=="ia32"', {
2170             # 32-bit Clang is unsupported.  It may not build.  Put your 32-bit
2171             # Clang in this directory at your own risk if needed for some
2172             # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2173             # usage).  Any failure by this compiler should not close the tree.
2174             'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2175           }],
2176         ],
2177       }],
2179       ['OS=="win"', {
2180         # The Clang plugins don't currently work on Windows.
2181         # TODO(hans): One day, this will work. (crbug.com/82385)
2182         'clang_use_chrome_plugins%': 0,
2183       }],
2185       # On valgrind bots, override the optimizer settings so we don't inline too
2186       # much and make the stacks harder to figure out.
2187       #
2188       # TODO(rnk): Kill off variables that no one else uses and just implement
2189       # them under a build_for_tool== condition.
2190       ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2191         # gcc flags
2192         'mac_debug_optimization': '1',
2193         'mac_release_optimization': '1',
2194         'release_optimize': '1',
2195         'no_gc_sections': 1,
2196         'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2197                               '-fno-builtin -fno-optimize-sibling-calls',
2198         'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2199                                 '-fno-builtin -fno-optimize-sibling-calls',
2201         # MSVS flags for TSan on Pin and Windows.
2202         'win_debug_RuntimeChecks': '0',
2203         'win_debug_disable_iterator_debugging': '1',
2204         'win_debug_Optimization': '1',
2205         'win_debug_InlineFunctionExpansion': '0',
2206         'win_release_InlineFunctionExpansion': '0',
2207         'win_release_OmitFramePointers': '0',
2209         'use_allocator': 'tcmalloc',
2210         'release_valgrind_build': 1,
2211         'werror': '',
2212         'component': 'static_library',
2213         'use_system_zlib': 0,
2214       }],
2216       # Build tweaks for DrMemory.
2217       # TODO(rnk): Combine with tsan config to share the builder.
2218       # http://crbug.com/108155
2219       ['build_for_tool=="drmemory"', {
2220         # These runtime checks force initialization of stack vars which blocks
2221         # DrMemory's uninit detection.
2222         'win_debug_RuntimeChecks': '0',
2223         # Iterator debugging is slow.
2224         'win_debug_disable_iterator_debugging': '1',
2225         # Try to disable optimizations that mess up stacks in a release build.
2226         # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054)
2227         # /O2 and /Ob0 (disable inline) cannot be used together because of a
2228         # compiler bug, so we use /Ob1 instead.
2229         'win_release_InlineFunctionExpansion': '1',
2230         'win_release_OmitFramePointers': '0',
2231         # Ditto for debug, to support bumping win_debug_Optimization.
2232         'win_debug_InlineFunctionExpansion': 0,
2233         'win_debug_OmitFramePointers': 0,
2234         # Keep the code under #ifndef NVALGRIND.
2235         'release_valgrind_build': 1,
2236       }],
2238       # Enable RLZ on Win, Mac, iOS and ChromeOS.
2239       ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2240         'enable_rlz%': 1,
2241       }],
2243       # Set default compiler flags depending on ARM version.
2244       ['arm_version==6 and android_webview_build==0', {
2245         'arm_arch%': 'armv6',
2246         'arm_tune%': '',
2247         'arm_fpu%': 'vfp',
2248         'arm_float_abi%': 'softfp',
2249         'arm_thumb%': 0,
2250       }],
2251       ['arm_version==7 and android_webview_build==0', {
2252         'arm_arch%': 'armv7-a',
2253         'arm_tune%': 'generic-armv7-a',
2254         'conditions': [
2255           ['arm_neon==1', {
2256             'arm_fpu%': 'neon',
2257           }, {
2258             'arm_fpu%': 'vfpv3-d16',
2259           }],
2260         ],
2261         # Change the default to hard once the armhf transition is complete.
2262         'arm_float_abi%': 'softfp',
2263         'arm_thumb%': 1,
2264       }],
2266       ['android_webview_build==1', {
2267         # The WebView build gets its cpu-specific flags from the Android build system.
2268         'arm_arch%': '',
2269         'arm_tune%': '',
2270         'arm_fpu%': '',
2271         'arm_float_abi%': '',
2272         'arm_thumb%': 0,
2273       }],
2275       # Enable brlapi by default for chromeos.
2276       [ 'chromeos==1', {
2277         'use_brlapi%': 1,
2278       }],
2280       ['use_ozone==1 and ozone_auto_platforms==1', {
2281         # Use test as the default platform.
2282         'ozone_platform%': 'test',
2284         # Build all platforms whose deps are in install-build-deps.sh.
2285         # Only these platforms will be compile tested by buildbots.
2286         'ozone_platform_dri%': 1,
2287         'ozone_platform_test%': 1,
2288         'ozone_platform_egltest%': 1,
2289       }],
2291       ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2292         'use_clipboard_aurax11%': 1,
2293       }],
2295       ['OS=="win" and use_goma==1', {
2296         # goma doesn't support pch yet.
2297         'chromium_win_pch': 0,
2298         # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2299         'conditions': [
2300           ['win_z7==0', {
2301             'fastbuild': 1,
2302           }],
2303         ],
2304       }],
2306       ['OS=="win" and (clang==1 or asan==1)', {
2307         'chromium_win_pch': 0,
2308       }],
2310       ['host_clang==1', {
2311         'host_cc': '<(make_clang_dir)/bin/clang',
2312         'host_cxx': '<(make_clang_dir)/bin/clang++',
2313       }, {
2314         'host_cc': '<!(which gcc)',
2315         'host_cxx': '<!(which g++)',
2316       }],
2318       # The seccomp-bpf sandbox is only supported on five architectures
2319       # currently.
2320       # Do not disable seccomp_bpf anywhere without talking to
2321       # security@chromium.org!
2322       ['((OS=="linux" or OS=="android") and '
2323            '(target_arch=="ia32" or target_arch=="x64" or '
2324              'target_arch=="arm" or target_arch=="mipsel" or '
2325              'target_arch=="arm64"))', {
2326          'use_seccomp_bpf%': 1,
2327       }, {
2328          'use_seccomp_bpf%': 0,
2329       }],
2330     ],
2332     # The path to the ANGLE library.
2333     'angle_path': '<(DEPTH)/third_party/angle',
2335     # List of default apps to install in new profiles.  The first list contains
2336     # the source files as found in svn.  The second list, used only for linux,
2337     # contains the destination location for each of the files.  When a crx
2338     # is added or removed from the list, the chrome/browser/resources/
2339     # default_apps/external_extensions.json file must also be updated.
2340     'default_apps_list': [
2341       'browser/resources/default_apps/external_extensions.json',
2342       'browser/resources/default_apps/gmail.crx',
2343       'browser/resources/default_apps/search.crx',
2344       'browser/resources/default_apps/youtube.crx',
2345       'browser/resources/default_apps/drive.crx',
2346       'browser/resources/default_apps/docs.crx',
2347     ],
2348     'default_apps_list_linux_dest': [
2349       '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2350       '<(PRODUCT_DIR)/default_apps/gmail.crx',
2351       '<(PRODUCT_DIR)/default_apps/search.crx',
2352       '<(PRODUCT_DIR)/default_apps/youtube.crx',
2353       '<(PRODUCT_DIR)/default_apps/drive.crx',
2354       '<(PRODUCT_DIR)/default_apps/docs.crx',
2355     ],
2357     # Whether to allow building of the GPU-related isolates.
2358     'archive_gpu_tests%': 0,
2359   },
2360   'target_defaults': {
2361     'variables': {
2362       # The condition that operates on chromium_code is in a target_conditions
2363       # section, and will not have access to the default fallback value of
2364       # chromium_code at the top of this file, or to the chromium_code
2365       # variable placed at the root variables scope of .gyp files, because
2366       # those variables are not set at target scope.  As a workaround,
2367       # if chromium_code is not set at target scope, define it in target scope
2368       # to contain whatever value it has during early variable expansion.
2369       # That's enough to make it available during target conditional
2370       # processing.
2371       'chromium_code%': '<(chromium_code)',
2373       'component%': '<(component)',
2375       'chromecast%': '<(chromecast)',
2377       # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2378       'win_release_Optimization%': '2', # 2 = /Os
2379       'win_debug_Optimization%': '0',   # 0 = /Od
2381       # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2382       # Tri-state: blank is default, 1 on, 0 off
2383       'win_release_OmitFramePointers%': '0',
2384       # Tri-state: blank is default, 1 on, 0 off
2385       'win_debug_OmitFramePointers%': '',
2387       # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2388       'win_debug_RuntimeChecks%': '3',    # 3 = all checks enabled, 0 = off
2390       # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2391       'win_debug_InlineFunctionExpansion%': '',    # empty = default, 0 = off,
2392       'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2394       # VS inserts quite a lot of extra checks to algorithms like
2395       # std::partial_sort in Debug build which make them O(N^2)
2396       # instead of O(N*logN). This is particularly slow under memory
2397       # tools like ThreadSanitizer so we want it to be disablable.
2398       # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2399       'win_debug_disable_iterator_debugging%': '0',
2401       # An application manifest fragment to declare compatibility settings for
2402       # 'executable' targets. Ignored in other target type.
2403       'win_exe_compatibility_manifest%':
2404           '<(DEPTH)\\build\\win\\compatibility.manifest',
2406       'release_extra_cflags%': '',
2407       'debug_extra_cflags%': '',
2409       'release_valgrind_build%': '<(release_valgrind_build)',
2411       # the non-qualified versions are widely assumed to be *nix-only
2412       'win_release_extra_cflags%': '',
2413       'win_debug_extra_cflags%': '',
2415       # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2416       'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2418       # Only used by Windows build for now.  Can be used to build into a
2419       # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2420       # output files in src/build/VS2010_{Debug,Release}.
2421       'build_dir_prefix%': '',
2423       # Targets are by default not nacl untrusted code.
2424       'nacl_untrusted_build%': 0,
2426       'pnacl_compile_flags': [
2427         # pnacl uses the clang compiler so we need to suppress all the
2428         # same warnings as we do for clang.
2429         # TODO(sbc): Remove these if/when they are removed from the clang
2430         # build.
2431         '-Wno-unused-function',
2432         '-Wno-char-subscripts',
2433         '-Wno-c++11-extensions',
2434         '-Wno-unnamed-type-template-args',
2435       ],
2437       'conditions': [
2438         ['OS=="win" and component=="shared_library"', {
2439           # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2440           'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2441           'win_debug_RuntimeLibrary%': '3',   # 3 = /MDd (debug DLL)
2442         }, {
2443           # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2444           'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2445           'win_debug_RuntimeLibrary%': '1',   # 1 = /MTd (debug static)
2446         }],
2447         ['OS=="ios"', {
2448           # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2449           'mac_release_optimization%': 's', # Use -Os unless overridden
2450           'mac_debug_optimization%': '0',   # Use -O0 unless overridden
2451         }, {
2452           # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2453           'mac_release_optimization%': '3', # Use -O3 unless overridden
2454           'mac_debug_optimization%': '0',   # Use -O0 unless overridden
2455         }],
2456         ['OS=="android"', {
2457           'host_os%': '<(host_os)',  # See comment above chromium_code.
2458         }],
2459       ],
2460       'clang_warning_flags': [
2461         '-Wheader-hygiene',
2463         # Don't die on dtoa code that uses a char as an array index.
2464         # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2465         '-Wno-char-subscripts',
2467         # TODO(thakis): This used to be implied by -Wno-unused-function,
2468         # which we no longer use. Check if it makes sense to remove
2469         # this as well. http://crbug.com/316352
2470         '-Wno-unneeded-internal-declaration',
2472         # Warns on switches on enums that cover all enum values but
2473         # also contain a default: branch. Chrome is full of that.
2474         '-Wno-covered-switch-default',
2476         # Warns when a const char[] is converted to bool.
2477         '-Wstring-conversion',
2479         # C++11-related flags:
2481         # This warns on using ints as initializers for floats in
2482         # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2483         # which happens in several places in chrome code. Not sure if
2484         # this is worth fixing.
2485         '-Wno-c++11-narrowing',
2487         # Clang considers the `register` keyword as deprecated, but e.g.
2488         # code generated by flex (used in angle) contains that keyword.
2489         # http://crbug.com/255186
2490         '-Wno-deprecated-register',
2491       ],
2492     },
2493     'includes': [ 'set_clang_warning_flags.gypi', ],
2494     'defines': [
2495       # Don't use deprecated V8 APIs anywhere.
2496       'V8_DEPRECATION_WARNINGS',
2497     ],
2498     'include_dirs': [
2499       '<(SHARED_INTERMEDIATE_DIR)',
2500     ],
2501     'conditions': [
2502       ['(OS=="mac" or OS=="ios") and asan==1', {
2503         'dependencies': [
2504           '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2505         ],
2506       }],
2507       ['OS=="win" and asan==1 and component=="shared_library"', {
2508         'dependencies': [
2509           '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2510         ],
2511       }],
2512       ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2513         'cflags_cc!': ['-fno-rtti'],
2514         'cflags_cc+': [
2515           '-frtti',
2516           '-gline-tables-only',
2517           '-fintercept-allocation-functions',
2518         ],
2519         'defines': ['TYPE_PROFILING'],
2520         'dependencies': [
2521           '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2522         ],
2523       }],
2524       ['branding=="Chrome"', {
2525         'defines': ['GOOGLE_CHROME_BUILD'],
2526       }, {  # else: branding!="Chrome"
2527         'defines': ['CHROMIUM_BUILD'],
2528       }],
2529       ['OS=="mac" and component=="shared_library"', {
2530         'xcode_settings': {
2531           'DYLIB_INSTALL_NAME_BASE': '@rpath',
2532           'LD_RUNPATH_SEARCH_PATHS': [
2533             # For unbundled binaries.
2534             '@loader_path/.',
2535             # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2536             '@loader_path/../../..',
2537           ],
2538         },
2539       }],
2540       ['clang==1 and OS!="win"', {
2541         # This is here so that all files get recompiled after a clang roll and
2542         # when turning clang on or off.
2543         # (defines are passed via the command line, and build systems rebuild
2544         # things when their commandline changes). Nothing should ever read this
2545         # define.
2546         'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2547       }],
2548       ['enable_rlz==1', {
2549         'defines': ['ENABLE_RLZ'],
2550       }],
2551       ['component=="shared_library"', {
2552         'defines': ['COMPONENT_BUILD'],
2553       }],
2554       ['toolkit_views==1', {
2555         'defines': ['TOOLKIT_VIEWS=1'],
2556       }],
2557       ['ui_compositor_image_transport==1', {
2558         'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2559       }],
2560       ['use_aura==1', {
2561         'defines': ['USE_AURA=1'],
2562       }],
2563       ['use_ash==1', {
2564         'defines': ['USE_ASH=1'],
2565       }],
2566       ['use_pango==1', {
2567         'defines': ['USE_PANGO=1'],
2568       }],
2569       ['use_cairo==1', {
2570         'defines': ['USE_CAIRO=1'],
2571       }],
2572       ['use_cras==1', {
2573         'defines': ['USE_CRAS=1'],
2574       }],
2575       ['use_glib==1', {
2576         'defines': ['USE_GLIB=1'],
2577       }],
2578       ['use_ozone==1', {
2579         'defines': ['USE_OZONE=1'],
2580       }],
2581       ['use_default_render_theme==1', {
2582         'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2583       }],
2584       ['use_libjpeg_turbo==1', {
2585         'defines': ['USE_LIBJPEG_TURBO=1'],
2586       }],
2587       ['use_x11==1', {
2588         'defines': ['USE_X11=1'],
2589       }],
2590       ['use_clipboard_aurax11==1', {
2591         'defines': ['USE_CLIPBOARD_AURAX11=1'],
2592       }],
2593       ['enable_one_click_signin==1', {
2594         'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2595       }],
2596       ['enable_pre_sync_backup==1', {
2597         'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2598       }],
2599       ['use_xi2_mt!=0 and use_x11==1', {
2600         'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2601       }],
2602       ['image_loader_extension==1', {
2603         'defines': ['IMAGE_LOADER_EXTENSION=1'],
2604       }],
2605       ['profiling==1', {
2606         'defines': ['ENABLE_PROFILING=1'],
2607       }],
2608       ['remoting==1', {
2609         'defines': ['ENABLE_REMOTING=1'],
2610       }],
2611       ['enable_webrtc==1', {
2612         'defines': ['ENABLE_WEBRTC=1'],
2613       }],
2614       ['proprietary_codecs==1', {
2615         'defines': ['USE_PROPRIETARY_CODECS'],
2616         'conditions': [
2617           ['enable_mpeg2ts_stream_parser==1', {
2618             'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2619           }],
2620         ],
2621       }],
2622       ['enable_viewport==1', {
2623         'defines': ['ENABLE_VIEWPORT'],
2624       }],
2625       ['enable_pepper_cdms==1', {
2626         'defines': ['ENABLE_PEPPER_CDMS'],
2627       }],
2628       ['enable_browser_cdms==1', {
2629         'defines': ['ENABLE_BROWSER_CDMS'],
2630       }],
2631       ['configuration_policy==1', {
2632         'defines': ['ENABLE_CONFIGURATION_POLICY'],
2633       }],
2634       ['notifications==1', {
2635         'defines': ['ENABLE_NOTIFICATIONS'],
2636       }],
2637       ['enable_hidpi==1', {
2638         'defines': ['ENABLE_HIDPI=1'],
2639       }],
2640       ['native_discardable_memory==1', {
2641         'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2642       }],
2643       ['native_memory_pressure_signals==1', {
2644         'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2645       }],
2646       ['use_udev==1', {
2647         'defines': ['USE_UDEV'],
2648       }],
2649       ['fastbuild!=0', {
2650         'xcode_settings': {
2651           'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2652         },
2653         'conditions': [
2654           ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2655             # Clang creates chubby debug information, which makes linking very
2656             # slow. For now, don't create debug information with clang.  See
2657             # http://crbug.com/70000
2658             'conditions': [
2659               ['OS=="linux"', {
2660                 'variables': {
2661                   'debug_extra_cflags': '-g0',
2662                 },
2663               }],
2664               # Android builds symbols on release by default, disable them.
2665               ['OS=="android"', {
2666                 'variables': {
2667                   'debug_extra_cflags': '-g0',
2668                   'release_extra_cflags': '-g0',
2669                 },
2670               }],
2671             ],
2672           }, { # else clang!=1
2673             'conditions': [
2674               ['OS=="win" and fastbuild==2', {
2675                 # Completely disable debug information.
2676                 'msvs_settings': {
2677                   'VCLinkerTool': {
2678                     'GenerateDebugInformation': 'false',
2679                   },
2680                   'VCCLCompilerTool': {
2681                     'DebugInformationFormat': '0',
2682                   },
2683                 },
2684               }],
2685               ['OS=="win" and fastbuild==1', {
2686                 'msvs_settings': {
2687                   'VCLinkerTool': {
2688                     # This tells the linker to generate .pdbs, so that
2689                     # we can get meaningful stack traces.
2690                     'GenerateDebugInformation': 'true',
2691                   },
2692                   'VCCLCompilerTool': {
2693                     # No debug info to be generated by compiler.
2694                     'DebugInformationFormat': '0',
2695                   },
2696                 },
2697               }],
2698               ['OS=="linux" and fastbuild==2', {
2699                 'variables': {
2700                   'debug_extra_cflags': '-g0',
2701                 },
2702               }],
2703               ['OS=="linux" and fastbuild==1', {
2704                 'variables': {
2705                   'debug_extra_cflags': '-g1',
2706                 },
2707               }],
2708               ['OS=="android" and fastbuild==2', {
2709                 'variables': {
2710                   'debug_extra_cflags': '-g0',
2711                   'release_extra_cflags': '-g0',
2712                 },
2713               }],
2714               ['OS=="android" and fastbuild==1', {
2715                 'variables': {
2716                   'debug_extra_cflags': '-g1',
2717                   'release_extra_cflags': '-g1',
2718                 },
2719               }],
2720             ],
2721           }], # clang!=1
2722         ],
2723       }],  # fastbuild!=0
2724       ['dont_embed_build_metadata==1', {
2725         'defines': [
2726           'DONT_EMBED_BUILD_METADATA',
2727         ],
2728       }],  # dont_embed_build_metadata==1
2729       ['dcheck_always_on!=0', {
2730         'defines': ['DCHECK_ALWAYS_ON=1'],
2731       }],  # dcheck_always_on!=0
2732       ['tracing_like_official_build!=0', {
2733         'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2734       }],  # tracing_like_official_build!=0
2735       ['win_use_allocator_shim==0', {
2736         'conditions': [
2737           ['OS=="win"', {
2738             'defines': ['NO_TCMALLOC'],
2739           }],
2740         ],
2741       }],
2742       ['enable_eglimage==1', {
2743         'defines': [
2744           'ENABLE_EGLIMAGE=1',
2745         ],
2746       }],
2747       ['asan==1', {
2748         'defines': [
2749           'ADDRESS_SANITIZER',
2750           'MEMORY_TOOL_REPLACES_ALLOCATOR',
2751           'MEMORY_SANITIZER_INITIAL_SIZE',
2752         ],
2753       }],
2754       ['syzyasan==1', {
2755         # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2756         'msvs_settings': {
2757           'VCLinkerTool': {
2758             'Profile': 'true',
2759           },
2760         },
2761         'defines': [
2762             'SYZYASAN',
2763             'MEMORY_TOOL_REPLACES_ALLOCATOR',
2764             'MEMORY_SANITIZER_INITIAL_SIZE',
2765         ],
2766       }],
2767       ['OS=="win"', {
2768         'defines': [
2769           '__STD_C',
2770           '_CRT_SECURE_NO_DEPRECATE',
2771           '_SCL_SECURE_NO_DEPRECATE',
2772           # This define is required to pull in the new Win8 interfaces from
2773           # system headers like ShObjIdl.h.
2774           'NTDDI_VERSION=0x06020000',
2775           # This is required for ATL to use XP-safe versions of its functions.
2776           '_USING_V110_SDK71_',
2777         ],
2778         'include_dirs': [
2779           '<(DEPTH)/third_party/wtl/include',
2780         ],
2781         'conditions': [
2782           ['win_z7!=0', {
2783             'msvs_settings': {
2784               # Generates debug info when win_z7=1
2785               # even if fastbuild=1 (that makes GenerateDebugInformation false).
2786               'VCLinkerTool': {
2787                 'GenerateDebugInformation': 'true',
2788               },
2789               'VCCLCompilerTool': {
2790                 'DebugInformationFormat': '1',
2791               }
2792             }
2793           }],
2794         ],  # win_z7!=0
2795       }],  # OS==win
2796       ['chromecast==1', {
2797         'defines': [
2798           'LOG_DISABLED=0',
2799         ],
2800         'conditions': [
2801           ['target_arch=="arm"', {
2802             'defines': [
2803               # TODO(lcwu): Work around an error when building Chromium
2804               # with gcc-4.5.3 (e.g. v8/src/platform-linux.cc). Remove
2805               # this define once the toolchain is updated.
2806               # See crbug.com/388933.
2807               '__SOFTFP',
2808             ],
2809           }],
2810         ],
2811       }],
2812       ['enable_task_manager==1', {
2813         'defines': [
2814           'ENABLE_TASK_MANAGER=1',
2815         ],
2816       }],
2817       ['enable_extensions==1', {
2818         'defines': [
2819           'ENABLE_EXTENSIONS=1',
2820         ],
2821       }],
2822       ['OS=="win" and branding=="Chrome"', {
2823         'defines': ['ENABLE_SWIFTSHADER'],
2824       }],
2825       ['enable_dart==1', {
2826         'defines': ['WEBKIT_USING_DART=1'],
2827       }],
2828       ['enable_plugin_installation==1', {
2829         'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2830       }],
2831       ['enable_plugins==1', {
2832         'defines': ['ENABLE_PLUGINS=1'],
2833       }],
2834       ['enable_session_service==1', {
2835         'defines': ['ENABLE_SESSION_SERVICE=1'],
2836       }],
2837       ['enable_themes==1', {
2838         'defines': ['ENABLE_THEMES=1'],
2839       }],
2840       ['enable_autofill_dialog==1', {
2841         'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2842       }],
2843       ['enable_prod_wallet_service==1', {
2844         'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2845       }],
2846       ['enable_background==1', {
2847         'defines': ['ENABLE_BACKGROUND=1'],
2848       }],
2849       ['enable_google_now==1', {
2850         'defines': ['ENABLE_GOOGLE_NOW=1'],
2851       }],
2852       ['cld_version!=0', {
2853         'defines': ['CLD_VERSION=<(cld_version)'],
2854       }],
2855       ['cld_version==2', {
2856         # This is used to populate the "CLD Data Source" field in:
2857         # chrome://translate-internals
2858         'defines': ['CLD2_DATA_SOURCE=<(cld2_data_source)'],
2859       }],
2860       ['enable_printing==1', {
2861         'defines': ['ENABLE_FULL_PRINTING=1', 'ENABLE_PRINTING=1'],
2862       }],
2863       ['enable_printing==2', {
2864         'defines': ['ENABLE_PRINTING=1'],
2865       }],
2866       ['enable_spellcheck==1', {
2867         'defines': ['ENABLE_SPELLCHECK=1'],
2868       }],
2869       ['enable_captive_portal_detection==1', {
2870         'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2871       }],
2872       ['enable_app_list==1', {
2873         'defines': ['ENABLE_APP_LIST=1'],
2874       }],
2875       ['enable_settings_app==1', {
2876         'defines': ['ENABLE_SETTINGS_APP=1'],
2877       }],
2878       ['disable_file_support==1', {
2879         'defines': ['DISABLE_FILE_SUPPORT=1'],
2880       }],
2881       ['disable_ftp_support==1', {
2882         'defines': ['DISABLE_FTP_SUPPORT=1'],
2883       }],
2884       ['use_icu_alternatives_on_android==1', {
2885         'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2886       }],
2887       ['enable_managed_users==1', {
2888         'defines': ['ENABLE_MANAGED_USERS=1'],
2889       }],
2890       ['data_reduction_fallback_host != ""', {
2891         'defines': [
2892           'DATA_REDUCTION_FALLBACK_HOST="<(data_reduction_fallback_host)"'],
2893       }],
2894       ['data_reduction_dev_host != ""', {
2895         'defines': [
2896           'DATA_REDUCTION_DEV_HOST="<(data_reduction_dev_host)"'],
2897       }],
2898       ['spdy_proxy_auth_origin != ""', {
2899         'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'],
2900       }],
2901       ['spdy_proxy_auth_property != ""', {
2902         'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2903       }],
2904       ['spdy_proxy_auth_value != ""', {
2905         'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2906       }],
2907       ['data_reduction_proxy_probe_url != ""', {
2908         'defines': [
2909           'DATA_REDUCTION_PROXY_PROBE_URL="<(data_reduction_proxy_probe_url)"'],
2910       }],
2911       ['data_reduction_proxy_warmup_url != ""', {
2912         'defines': [
2913           'DATA_REDUCTION_PROXY_WARMUP_URL="<(data_reduction_proxy_warmup_url)"'],
2914       }],
2915       ['data_reduction_proxy_ssl_origin != ""', {
2916         'defines': [
2917           'DATA_REDUCTION_PROXY_SSL_ORIGIN="<(data_reduction_proxy_ssl_origin)"'],
2918       }],
2919       ['data_reduction_proxy_alt_origin != ""', {
2920         'defines': [
2921           'DATA_REDUCTION_PROXY_ALT_ORIGIN="<(data_reduction_proxy_alt_origin)"'],
2922       }],
2923       ['data_reduction_proxy_alt_fallback_origin != ""', {
2924         'defines': [
2925           'DATA_REDUCTION_PROXY_ALT_FALLBACK_ORIGIN="<(data_reduction_proxy_alt_fallback_origin)"'],
2926       }],
2927       ['enable_mdns==1', {
2928         'defines': ['ENABLE_MDNS=1'],
2929       }],
2930       ['enable_service_discovery==1', {
2931         'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2932       }],
2933       ['enable_wifi_bootstrapping==1', {
2934         'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2935       }],
2936       ['enable_hangout_services_extension==1', {
2937         'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2938       }],
2939       ['enable_ipc_fuzzer==1', {
2940         'defines': ['ENABLE_IPC_FUZZER=1'],
2941       }],
2942       ['video_hole==1', {
2943         'defines': ['VIDEO_HOLE=1'],
2944       }],
2945     ],  # conditions for 'target_defaults'
2946     'target_conditions': [
2947       ['<(use_openssl)==1', {
2948         'defines': ['USE_OPENSSL=1'],
2949       }],
2950       ['<(use_openssl_certs)==1', {
2951         'defines': ['USE_OPENSSL_CERTS=1'],
2952       }],
2953       ['>(nacl_untrusted_build)==1', {
2954         'defines': [
2955           'USE_OPENSSL=1',
2956           'USE_OPENSSL_CERTS=1',
2957         ],
2958       }],
2959       ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
2960         'defines': ['USE_NSS=1'],
2961       }],
2962       ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
2963         'defines': ['OS_CHROMEOS=1'],
2964       }],
2965       ['enable_wexit_time_destructors==1 and OS!="win"', {
2966         # TODO: Enable on Windows too, http://crbug.com/404525
2967         'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
2968       }],
2969       ['chromium_code==0', {
2970         'conditions': [
2971           [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
2972             # We don't want to get warnings from third-party code,
2973             # so remove any existing warning-enabling flags like -Wall.
2974             'cflags!': [
2975               '-Wall',
2976               '-Wextra',
2977             ],
2978             'cflags_cc': [
2979               # Don't warn about hash_map in third-party code.
2980               '-Wno-deprecated',
2981             ],
2982             'cflags': [
2983               # Don't warn about printf format problems.
2984               # This is off by default in gcc but on in Ubuntu's gcc(!).
2985               '-Wno-format',
2986             ],
2987             'cflags_cc!': [
2988               # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
2989               '-Wsign-compare',
2990             ]
2991           }],
2992           # TODO: Fix all warnings on chromeos too.
2993           [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
2994             'cflags!': [
2995               '-Werror',
2996             ],
2997           }],
2998           [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
2999             'cflags': [
3000               # Don't warn about ignoring the return value from e.g. close().
3001               # This is off by default in some gccs but on by default in others.
3002               # BSD systems do not support this option, since they are usually
3003               # using gcc 4.2.1, which does not have this flag yet.
3004               '-Wno-unused-result',
3005             ],
3006           }],
3007           [ 'OS=="win"', {
3008             'defines': [
3009               '_CRT_SECURE_NO_DEPRECATE',
3010               '_CRT_NONSTDC_NO_WARNINGS',
3011               '_CRT_NONSTDC_NO_DEPRECATE',
3012               '_SCL_SECURE_NO_DEPRECATE',
3013             ],
3014             'msvs_disabled_warnings': [4800],
3015             'msvs_settings': {
3016               'VCCLCompilerTool': {
3017                 'WarningLevel': '3',
3018                 'WarnAsError': 'true',
3019                 'Detect64BitPortabilityProblems': 'false',
3020               },
3021             },
3022             'conditions': [
3023               ['buildtype=="Official"', {
3024                 'msvs_settings': {
3025                   'VCCLCompilerTool': { 'WarnAsError': 'false' },
3026                 }
3027               }],
3028               ['clang==1', {
3029                 'msvs_settings': {
3030                   'VCCLCompilerTool': { 'WarnAsError': 'false' },
3031                 }
3032               }],
3033             ],
3034           }],
3035           # TODO(darin): Unfortunately, some third_party code depends on base.
3036           [ 'OS=="win" and component=="shared_library"', {
3037             'msvs_disabled_warnings': [
3038               4251,  # class 'std::xx' needs to have dll-interface.
3039             ],
3040           }],
3041           [ 'OS=="mac" or OS=="ios"', {
3042             'xcode_settings': {
3043               'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3044             },
3045             'conditions': [
3046               ['buildtype=="Official"', {
3047                 'xcode_settings': {
3048                   'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',    # -Werror
3049                 },
3050               }],
3051             ],
3052           }],
3053           [ 'OS=="ios"', {
3054             'xcode_settings': {
3055               # TODO(ios): Fix remaining warnings in third-party code, then
3056               # remove this; the Mac cleanup didn't get everything that's
3057               # flagged in an iOS build.
3058               'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3059               'RUN_CLANG_STATIC_ANALYZER': 'NO',
3060               # Several internal ios directories generate numerous warnings for
3061               # -Wobjc-missing-property-synthesis.
3062               'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3063             },
3064           }],
3065         ],
3066       }, {
3067         'includes': [
3068            # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3069           'filename_rules.gypi',
3070         ],
3071         # In Chromium code, we define __STDC_foo_MACROS in order to get the
3072         # C99 macros on Mac and Linux.
3073         'defines': [
3074           '__STDC_CONSTANT_MACROS',
3075           '__STDC_FORMAT_MACROS',
3076         ],
3077         'conditions': [
3078           ['OS=="win"', {
3079             # turn on warnings for signed/unsigned mismatch on chromium code.
3080             'msvs_settings': {
3081               'VCCLCompilerTool': {
3082                 'AdditionalOptions': ['/we4389'],
3083               },
3084             },
3085           }],
3086           ['OS=="win" and component=="shared_library"', {
3087             'msvs_disabled_warnings': [
3088               4251,  # class 'std::xx' needs to have dll-interface.
3089             ],
3090           }],
3091         ],
3092       }],
3093     ],  # target_conditions for 'target_defaults'
3094     'default_configuration': 'Debug',
3095     'configurations': {
3096       # VCLinkerTool LinkIncremental values below:
3097       #   0 == default
3098       #   1 == /INCREMENTAL:NO
3099       #   2 == /INCREMENTAL
3100       # Debug links incremental, Release does not.
3101       #
3102       # Abstract base configurations to cover common attributes.
3103       #
3104       'Common_Base': {
3105         'abstract': 1,
3106         'msvs_configuration_attributes': {
3107           'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3108           'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3109           'CharacterSet': '1',
3110         },
3111         # Add the default import libs.
3112         'msvs_settings':{
3113           'VCLinkerTool': {
3114             'AdditionalDependencies': [
3115               'kernel32.lib',
3116               'gdi32.lib',
3117               'winspool.lib',
3118               'comdlg32.lib',
3119               'advapi32.lib',
3120               'shell32.lib',
3121               'ole32.lib',
3122               'oleaut32.lib',
3123               'user32.lib',
3124               'uuid.lib',
3125               'odbc32.lib',
3126               'odbccp32.lib',
3127               'delayimp.lib',
3128               'credui.lib',
3129               'netapi32.lib',
3130             ],
3131           },
3132         },
3133       },
3134       'x86_Base': {
3135         'abstract': 1,
3136         'msvs_settings': {
3137           'VCLinkerTool': {
3138             'MinimumRequiredVersion': '5.01',  # XP.
3139             'TargetMachine': '1',
3140           },
3141           'VCLibrarianTool': {
3142             'TargetMachine': '1',
3143           },
3144         },
3145         'msvs_configuration_platform': 'Win32',
3146       },
3147       'x64_Base': {
3148         'abstract': 1,
3149         'msvs_configuration_platform': 'x64',
3150         'msvs_settings': {
3151           'VCLinkerTool': {
3152             # Make sure to understand http://crbug.com/361720 if you want to
3153             # increase this.
3154             'MinimumRequiredVersion': '5.02',  # Server 2003.
3155             'TargetMachine': '17', # x86 - 64
3156             'AdditionalLibraryDirectories!':
3157               ['<(windows_sdk_path)/Lib/win8/um/x86'],
3158             'AdditionalLibraryDirectories':
3159               ['<(windows_sdk_path)/Lib/win8/um/x64'],
3160             # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3161             'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3162           },
3163           'VCLibrarianTool': {
3164             'AdditionalLibraryDirectories!':
3165               ['<(windows_sdk_path)/Lib/win8/um/x86'],
3166             'AdditionalLibraryDirectories':
3167               ['<(windows_sdk_path)/Lib/win8/um/x64'],
3168             'TargetMachine': '17', # x64
3169           },
3170         },
3171       },
3172       'Debug_Base': {
3173         'abstract': 1,
3174         'defines': [
3175           'DYNAMIC_ANNOTATIONS_ENABLED=1',
3176           'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3177         ],
3178         'xcode_settings': {
3179           'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3180           'OTHER_CFLAGS': [
3181             '<@(debug_extra_cflags)',
3182           ],
3183         },
3184         'msvs_settings': {
3185           'VCCLCompilerTool': {
3186             'Optimization': '<(win_debug_Optimization)',
3187             'PreprocessorDefinitions': ['_DEBUG'],
3188             'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3189             'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3190             'conditions': [
3191               # According to MSVS, InlineFunctionExpansion=0 means
3192               # "default inlining", not "/Ob0".
3193               # Thus, we have to handle InlineFunctionExpansion==0 separately.
3194               ['win_debug_InlineFunctionExpansion==0', {
3195                 'AdditionalOptions': ['/Ob0'],
3196               }],
3197               ['win_debug_InlineFunctionExpansion!=""', {
3198                 'InlineFunctionExpansion':
3199                   '<(win_debug_InlineFunctionExpansion)',
3200               }],
3201               ['win_debug_disable_iterator_debugging==1', {
3202                 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3203               }],
3205               # if win_debug_OmitFramePointers is blank, leave as default
3206               ['win_debug_OmitFramePointers==1', {
3207                 'OmitFramePointers': 'true',
3208               }],
3209               ['win_debug_OmitFramePointers==0', {
3210                 'OmitFramePointers': 'false',
3211                 # The above is not sufficient (http://crbug.com/106711): it
3212                 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3213                 # perform FPO regardless, so we must explicitly disable.
3214                 # We still want the false setting above to avoid having
3215                 # "/Oy /Oy-" and warnings about overriding.
3216                 'AdditionalOptions': ['/Oy-'],
3217               }],
3218             ],
3219             'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3220           },
3221           'VCLinkerTool': {
3222             'LinkIncremental': '<(msvs_debug_link_incremental)',
3223             # ASLR makes debugging with windbg difficult because Chrome.exe and
3224             # Chrome.dll share the same base name. As result, windbg will
3225             # name the Chrome.dll module like chrome_<base address>, where
3226             # <base address> typically changes with each launch. This in turn
3227             # means that breakpoints in Chrome.dll don't stick from one launch
3228             # to the next. For this reason, we turn ASLR off in debug builds.
3229             # Note that this is a three-way bool, where 0 means to pick up
3230             # the default setting, 1 is off and 2 is on.
3231             'RandomizedBaseAddress': 1,
3232           },
3233           'VCResourceCompilerTool': {
3234             'PreprocessorDefinitions': ['_DEBUG'],
3235           },
3236         },
3237         'conditions': [
3238           ['OS=="linux" or OS=="android"', {
3239             'target_conditions': [
3240               ['_toolset=="target"', {
3241                 'cflags': [
3242                   '<@(debug_extra_cflags)',
3243                 ],
3244               }],
3245             ],
3246           }],
3247           ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3248             # Enable libstdc++ debugging facilities to help catch problems
3249             # early, see http://crbug.com/65151 .
3250             # TODO(phajdan.jr): Should we enable this for all of POSIX?
3251             'defines': ['_GLIBCXX_DEBUG=1',],
3252           }],
3253           ['release_valgrind_build==0', {
3254             'xcode_settings': {
3255               'OTHER_CFLAGS': [
3256                 '-fstack-protector-all',  # Implies -fstack-protector
3257               ],
3258             },
3259           }],
3260           ['clang==1', {
3261             'cflags': [
3262               # Allow comparing the address of references and 'this' against 0
3263               # in debug builds. Technically, these can never be null in
3264               # well-defined C/C++ and Clang can optimize such checks away in
3265               # release builds, but they may be used in asserts in debug builds.
3266               '-Wno-undefined-bool-conversion',
3267               '-Wno-tautological-undefined-compare',
3268             ],
3269             'xcode_settings': {
3270               'OTHER_CFLAGS': [
3271                 '-Wno-undefined-bool-conversion',
3272                 '-Wno-tautological-undefined-compare',
3273               ],
3274             },
3275             'msvs_settings': {
3276               'VCCLCompilerTool': {
3277                 'AdditionalOptions': [
3278                   '-Wno-undefined-bool-conversion',
3279                   '-Wno-tautological-undefined-compare',
3280                 ],
3281               },
3282             },
3283           }],
3284         ],
3285       },
3286       'Release_Base': {
3287         'abstract': 1,
3288         'defines': [
3289           'NDEBUG',
3290         ],
3291         'xcode_settings': {
3292           'DEAD_CODE_STRIPPING': 'YES',  # -Wl,-dead_strip
3293           'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3294           'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3295         },
3296         'msvs_settings': {
3297           'VCCLCompilerTool': {
3298             'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3299             'conditions': [
3300               # In official builds, each target will self-select
3301               # an optimization level.
3302               ['buildtype!="Official"', {
3303                   'Optimization': '<(win_release_Optimization)',
3304                 },
3305               ],
3306               # According to MSVS, InlineFunctionExpansion=0 means
3307               # "default inlining", not "/Ob0".
3308               # Thus, we have to handle InlineFunctionExpansion==0 separately.
3309               ['win_release_InlineFunctionExpansion==0', {
3310                 'AdditionalOptions': ['/Ob0'],
3311               }],
3312               ['win_release_InlineFunctionExpansion!=""', {
3313                 'InlineFunctionExpansion':
3314                   '<(win_release_InlineFunctionExpansion)',
3315               }],
3317               # if win_release_OmitFramePointers is blank, leave as default
3318               ['win_release_OmitFramePointers==1', {
3319                 'OmitFramePointers': 'true',
3320               }],
3321               ['win_release_OmitFramePointers==0', {
3322                 'OmitFramePointers': 'false',
3323                 # The above is not sufficient (http://crbug.com/106711): it
3324                 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3325                 # perform FPO regardless, so we must explicitly disable.
3326                 # We still want the false setting above to avoid having
3327                 # "/Oy /Oy-" and warnings about overriding.
3328                 'AdditionalOptions': ['/Oy-'],
3329               }],
3330             ],
3331             'AdditionalOptions': [
3332                 '/d2Zi+',  # Improve debugging of Release builds.
3333                 '/Zc:inline',  # Remove unreferenced COMDAT (faster links).
3334                 '<@(win_release_extra_cflags)',
3335             ],
3336           },
3337           'VCLinkerTool': {
3338             # LinkIncremental is a tri-state boolean, where 0 means default
3339             # (i.e., inherit from parent solution), 1 means false, and
3340             # 2 means true.
3341             'LinkIncremental': '1',
3342             # This corresponds to the /PROFILE flag which ensures the PDB
3343             # file contains FIXUP information (growing the PDB file by about
3344             # 5%) but does not otherwise alter the output binary. This
3345             # information is used by the Syzygy optimization tool when
3346             # decomposing the release image.
3347             'Profile': 'true',
3348           },
3349         },
3350         'conditions': [
3351           ['msvs_use_common_release', {
3352             'includes': ['release.gypi'],
3353           }],
3354           ['release_valgrind_build==0 and tsan==0', {
3355             'defines': [
3356               'NVALGRIND',
3357               'DYNAMIC_ANNOTATIONS_ENABLED=0',
3358             ],
3359           }, {
3360             'defines': [
3361               'MEMORY_TOOL_REPLACES_ALLOCATOR',
3362               'MEMORY_SANITIZER_INITIAL_SIZE',
3363               'DYNAMIC_ANNOTATIONS_ENABLED=1',
3364               'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3365             ],
3366           }],
3367           ['win_use_allocator_shim==0', {
3368             'defines': ['NO_TCMALLOC'],
3369           }],
3370           # _FORTIFY_SOURCE isn't really supported by Clang now, see
3371           # http://llvm.org/bugs/show_bug.cgi?id=16821.
3372           # It seems to work fine with Ubuntu 12 headers though, so use it
3373           # in official builds.
3374           ['os_posix==1 and (asan!=1 and msan!=1 and tsan!=1 and lsan!=1 and ubsan!=1) and (OS!="linux" or clang!=1 or buildtype=="Official")', {
3375             'target_conditions': [
3376               ['chromium_code==1', {
3377                 # Non-chromium code is not guaranteed to compile cleanly
3378                 # with _FORTIFY_SOURCE. Also, fortified build may fail
3379                 # when optimizations are disabled, so only do that for Release
3380                 # build.
3381                 'defines': [
3382                   '_FORTIFY_SOURCE=2',
3383                 ],
3384               }],
3385             ],
3386           }],
3387           ['OS=="linux" or OS=="android"', {
3388             'target_conditions': [
3389               ['_toolset=="target"', {
3390                 'cflags': [
3391                   '<@(release_extra_cflags)',
3392                 ],
3393                 'conditions': [
3394                   ['enable_resource_whitelist_generation==1', {
3395                     'cflags': [
3396                       '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3397                     ],
3398                   }],
3399                 ],
3400               }],
3401             ],
3402           }],
3403           ['OS=="ios"', {
3404             'defines': [
3405               'NS_BLOCK_ASSERTIONS=1',
3406             ],
3407           }],
3408         ],
3409       },
3410       #
3411       # Concrete configurations
3412       #
3413       'Debug': {
3414         'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3415       },
3416       'Release': {
3417         'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3418       },
3419       'conditions': [
3420         [ 'OS=="ios"', {
3421           'Profile': {
3422             'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3423             'target_conditions': [
3424               [ '_type=="executable"', {
3425                 # To get a real .dSYM bundle produced by dsymutil, set the
3426                 # debug information format to dwarf-with-dsym.  Since
3427                 # strip_from_xcode will not be used, set Xcode to do the
3428                 # stripping as well.
3429                 'xcode_settings': {
3430                   'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3431                   'DEPLOYMENT_POSTPROCESSING': 'YES',
3432                   'STRIP_INSTALLED_PRODUCT': 'YES',
3433                 },
3434               }],
3435             ],
3436           },
3437         }],
3438         [ 'OS=="win"', {
3439           # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3440           'Debug_x64': {
3441             'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3442           },
3443           'Release_x64': {
3444             'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3445           },
3446         }],
3447       ],
3448     },
3449   },
3450   'conditions': [
3451     ['os_posix==1', {
3452       'target_defaults': {
3453         'ldflags': [
3454           '-Wl,-z,now',
3455           '-Wl,-z,relro',
3456         ],
3457       },
3458     }],
3459     # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3460     ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3461       'target_defaults': {
3462         'ldflags': [
3463           '-Wl,--fatal-warnings',
3464         ],
3465       },
3466     }],
3467     ['os_posix==1 and chromeos==0', {
3468       # Chrome OS enables -fstack-protector-strong via its build wrapper,
3469       # and we want to avoid overriding this, so stack-protector is only
3470       # enabled when not building on Chrome OS.
3471       # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3472       # supports it.
3473       'target_defaults': {
3474         'cflags': [
3475           '-fstack-protector',
3476           '--param=ssp-buffer-size=4',
3477         ],
3478       },
3479     }],
3480     ['os_posix==1 and OS!="mac" and OS!="ios"', {
3481       'target_defaults': {
3482         # Enable -Werror by default, but put it in a variable so it can
3483         # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3484         'variables': {
3485           'werror%': '-Werror',
3486           'libraries_for_target%': '',
3487         },
3488         'defines': [
3489           '_FILE_OFFSET_BITS=64',
3490         ],
3491         'cflags': [
3492           '<(werror)',  # See note above about the werror variable.
3493           '-pthread',
3494           '-fno-exceptions',
3495           '-fno-strict-aliasing',  # See http://crbug.com/32204
3496           '-Wall',
3497           # TODO(evan): turn this back on once all the builds work.
3498           # '-Wextra',
3499           # Don't warn about unused function params.  We use those everywhere.
3500           '-Wno-unused-parameter',
3501           # Don't warn about the "struct foo f = {0};" initialization pattern.
3502           '-Wno-missing-field-initializers',
3503           # Don't export any symbols (for example, to plugins we dlopen()).
3504           # Note: this is *required* to make some plugins work.
3505           '-fvisibility=hidden',
3506           '-pipe',
3507         ],
3508         'cflags_cc': [
3509           '-fno-rtti',
3510           '-fno-threadsafe-statics',
3511           # Make inline functions have hidden visiblity by default.
3512           # Surprisingly, not covered by -fvisibility=hidden.
3513           '-fvisibility-inlines-hidden',
3514           # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3515           # so we specify it explicitly.  (llvm.org/PR10448, crbug.com/90453)
3516           '-Wsign-compare',
3517         ],
3518         'ldflags': [
3519           '-pthread', '-Wl,-z,noexecstack',
3520         ],
3521         'libraries' : [
3522           '<(libraries_for_target)',
3523         ],
3524         'configurations': {
3525           'Debug_Base': {
3526             'variables': {
3527               'debug_optimize%': '0',
3528             },
3529             'defines': [
3530               '_DEBUG',
3531             ],
3532             'cflags': [
3533               '-O>(debug_optimize)',
3534               '-g',
3535             ],
3536             'conditions' : [
3537               ['OS=="android"', {
3538                 'ldflags': [
3539                   # Warn in case of text relocations.
3540                   '-Wl,--warn-shared-textrel',
3541                 ],
3542               }],
3543               ['OS=="android" and android_full_debug==0', {
3544                 # Some configurations are copied from Release_Base to reduce
3545                 # the binary size.
3546                 'variables': {
3547                   'debug_optimize%': 's',
3548                 },
3549                 'cflags': [
3550                   '-fdata-sections',
3551                   '-ffunction-sections',
3552                 ],
3553                 'ldflags': [
3554                   '-Wl,-O1',
3555                   '-Wl,--as-needed',
3556                 ],
3557               }],
3558               ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3559                 # We don't omit frame pointers on arm64 since they are required
3560                 # to correctly unwind stackframes which contain system library
3561                 # function frames (crbug.com/391706).
3562                 'cflags': [
3563                   '-fomit-frame-pointer',
3564                 ],
3565               }],
3566               ['OS=="linux" and target_arch=="ia32"', {
3567                 'ldflags': [
3568                   '-Wl,--no-as-needed',
3569                 ],
3570               }],
3571               ['debug_unwind_tables==1', {
3572                 'cflags': ['-funwind-tables'],
3573               }, {
3574                 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3575               }],
3576               # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3577               # definitions in to the right scope to use them when setting
3578               # linux_use_debug_fission, so it can be used here alone.
3579               ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3580                 'cflags': ['-gsplit-dwarf'],
3581               }],
3582             ],
3583           },
3584           'Release_Base': {
3585             'variables': {
3586               'release_optimize%': '2',
3587               # Binaries become big and gold is unable to perform GC
3588               # and remove unused sections for some of test targets
3589               # on 32 bit platform.
3590               # (This is currently observed only in chromeos valgrind bots)
3591               # The following flag is to disable --gc-sections linker
3592               # option for these bots.
3593               'no_gc_sections%': 0,
3595               # TODO(bradnelson): reexamine how this is done if we change the
3596               # expansion of configurations
3597               'release_valgrind_build%': 0,
3598             },
3599             'cflags': [
3600               '-O<(release_optimize)',
3601               # Don't emit the GCC version ident directives, they just end up
3602               # in the .comment section taking up binary size.
3603               '-fno-ident',
3604               # Put data and code in their own sections, so that unused symbols
3605               # can be removed at link time with --gc-sections.
3606               '-fdata-sections',
3607               '-ffunction-sections',
3608             ],
3609             'ldflags': [
3610               # Specifically tell the linker to perform optimizations.
3611               # See http://lwn.net/Articles/192624/ .
3612               '-Wl,-O1',
3613               '-Wl,--as-needed',
3614             ],
3615             'conditions' : [
3616               ['no_gc_sections==0', {
3617                 'ldflags': [
3618                   '-Wl,--gc-sections',
3619                 ],
3620               }],
3621               ['OS=="android" and target_arch!="arm64"', {
3622                 # We don't omit frame pointers on arm64 since they are required
3623                 # to correctly unwind stackframes which contain system library
3624                 # function frames (crbug.com/391706).
3625                 'cflags': [
3626                   '-fomit-frame-pointer',
3627                 ]
3628               }],
3629               ['OS=="android"', {
3630                 'variables': {
3631                   'release_optimize%': 's',
3632                 },
3633                 'ldflags': [
3634                   # Warn in case of text relocations.
3635                   '-Wl,--warn-shared-textrel',
3636                 ],
3637               }],
3638               ['clang==1', {
3639                 'cflags!': [
3640                   '-fno-ident',
3641                 ],
3642                 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed
3643                 # and the fix is in chromium.
3644                 'cflags': [ '-fno-slp-vectorize', ],
3645               }],
3646               ['profiling==1', {
3647                 'cflags': [
3648                   '-fno-omit-frame-pointer',
3649                   '-g',
3650                 ],
3651                 'conditions' : [
3652                   ['profiling_full_stack_frames==1', {
3653                     'cflags': [
3654                       '-fno-inline',
3655                       '-fno-optimize-sibling-calls',
3656                     ],
3657                   }],
3658                 ],
3659               }],
3660               ['release_unwind_tables==1', {
3661                 'cflags': ['-funwind-tables'],
3662               }, {
3663                 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3664               }],
3665             ],
3666           },
3667         },
3668         'conditions': [
3669           ['target_arch=="ia32"', {
3670             'target_conditions': [
3671               ['_toolset=="target"', {
3672                 'asflags': [
3673                   # Needed so that libs with .s files (e.g. libicudata.a)
3674                   # are compatible with the general 32-bit-ness.
3675                   '-32',
3676                 ],
3677                 # All floating-point computations on x87 happens in 80-bit
3678                 # precision.  Because the C and C++ language standards allow
3679                 # the compiler to keep the floating-point values in higher
3680                 # precision than what's specified in the source and doing so
3681                 # is more efficient than constantly rounding up to 64-bit or
3682                 # 32-bit precision as specified in the source, the compiler,
3683                 # especially in the optimized mode, tries very hard to keep
3684                 # values in x87 floating-point stack (in 80-bit precision)
3685                 # as long as possible. This has important side effects, that
3686                 # the real value used in computation may change depending on
3687                 # how the compiler did the optimization - that is, the value
3688                 # kept in 80-bit is different than the value rounded down to
3689                 # 64-bit or 32-bit. There are possible compiler options to
3690                 # make this behavior consistent (e.g. -ffloat-store would keep
3691                 # all floating-values in the memory, thus force them to be
3692                 # rounded to its original precision) but they have significant
3693                 # runtime performance penalty.
3694                 #
3695                 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3696                 # which keep floating-point values in SSE registers in its
3697                 # native precision (32-bit for single precision, and 64-bit
3698                 # for double precision values). This means the floating-point
3699                 # value used during computation does not change depending on
3700                 # how the compiler optimized the code, since the value is
3701                 # always kept in its specified precision.
3702                 #
3703                 # Refer to http://crbug.com/348761 for rationale behind SSE2
3704                 # being a minimum requirement for 32-bit Linux builds and
3705                 # http://crbug.com/313032 for an example where this has "bit"
3706                 # us in the past.
3707                 'cflags': [
3708                   '-msse2',
3709                   '-mfpmath=sse',
3710                   '-mmmx',  # Allows mmintrin.h for MMX intrinsics.
3711                   '-m32',
3712                 ],
3713                 'ldflags': [
3714                   '-m32',
3715                 ],
3716                 'conditions': [
3717                   # Use gold linker for Android ia32 target.
3718                   ['OS=="android"', {
3719                     'ldflags': [
3720                       '-fuse-ld=gold',
3721                     ],
3722                   }],
3723                   # Install packages have started cropping up with
3724                   # different headers between the 32-bit and 64-bit
3725                   # versions, so we have to shadow those differences off
3726                   # and make sure a 32-bit-on-64-bit build picks up the
3727                   # right files.
3728                   # For android build, use NDK headers instead of host headers
3729                   ['host_arch!="ia32" and OS!="android"', {
3730                     'include_dirs+': [
3731                       '/usr/include32',
3732                     ],
3733                   }],
3734                 ],
3735               }],
3736             ],
3737           }],
3738           ['target_arch=="x64"', {
3739             'target_conditions': [
3740               ['_toolset=="target"', {
3741                 'conditions': [
3742                   # Use gold linker for Android x64 target.
3743                   ['OS=="android"', {
3744                     'ldflags': [
3745                       '-fuse-ld=gold',
3746                     ],
3747                   }],
3748                 ],
3749                 'cflags': [
3750                   '-m64',
3751                   '-march=x86-64',
3752                 ],
3753                 'ldflags': [
3754                   '-m64',
3755                 ],
3756               }],
3757             ],
3758           }],
3759           ['target_arch=="arm"', {
3760             'target_conditions': [
3761               ['_toolset=="target"', {
3762                 'conditions': [
3763                   ['clang==0', {
3764                     'cflags_cc': [
3765                       # The codesourcery arm-2009q3 toolchain warns at that the ABI
3766                       # has changed whenever it encounters a varargs function. This
3767                       # silences those warnings, as they are not helpful and
3768                       # clutter legitimate warnings.
3769                       '-Wno-abi',
3770                     ],
3771                   }],
3772                   ['clang==1 and arm_arch!="" and OS!="android"', {
3773                     'cflags': [
3774                       '-target arm-linux-gnueabihf',
3775                     ],
3776                     'ldflags': [
3777                       '-target arm-linux-gnueabihf',
3778                     ],
3779                   }],
3780                   ['arm_arch!=""', {
3781                     'cflags': [
3782                       '-march=<(arm_arch)',
3783                     ],
3784                   }],
3785                   ['clang==1 and OS!="android"', {
3786                     'cflags': [
3787                       # We need to disable clang's builtin assembler as it can't
3788                       # handle several asm files, crbug.com/124610
3789                       '-no-integrated-as',
3790                     ],
3791                   }],
3792                   ['arm_tune!=""', {
3793                     'cflags': [
3794                       '-mtune=<(arm_tune)',
3795                     ],
3796                   }],
3797                   ['arm_fpu!=""', {
3798                     'cflags': [
3799                       '-mfpu=<(arm_fpu)',
3800                     ],
3801                   }],
3802                   ['arm_float_abi!=""', {
3803                     'cflags': [
3804                       '-mfloat-abi=<(arm_float_abi)',
3805                     ],
3806                   }],
3807                   ['arm_thumb==1', {
3808                     'cflags': [
3809                     '-mthumb',
3810                     ]
3811                   }],
3812                   ['OS=="android"', {
3813                     # Most of the following flags are derived from what Android
3814                     # uses by default when building for arm, reference for which
3815                     # can be found in the following file in the Android NDK:
3816                     # toolchains/arm-linux-androideabi-4.8/setup.mk
3817                     'cflags': [
3818                       # The tree-sra optimization (scalar replacement for
3819                       # aggregates enabling subsequent optimizations) leads to
3820                       # invalid code generation when using the Android NDK's
3821                       # compiler (r5-r7). This can be verified using
3822                       # webkit_unit_tests' WTF.Checked_int8_t test.
3823                       '-fno-tree-sra',
3824                       # The following 6 options are disabled to save on
3825                       # binary size in gcc 4.8.
3826                       # TODO(fdegans) Reevaluate when we upgrade GCC.
3827                       '-fno-partial-inlining',
3828                       '-fno-early-inlining',
3829                       '-fno-tree-copy-prop',
3830                       '-fno-tree-loop-optimize',
3831                       '-fno-move-loop-invariants',
3832                       '-fno-caller-saves',
3833                       '-Wno-psabi',
3834                     ],
3835                     # Android now supports .relro sections properly.
3836                     # NOTE: While these flags enable the generation of .relro
3837                     # sections, the generated libraries can still be loaded on
3838                     # older Android platform versions.
3839                     'ldflags': [
3840                         '-Wl,-z,relro',
3841                         '-Wl,-z,now',
3842                         '-fuse-ld=gold',
3843                     ],
3844                     'conditions': [
3845                       ['arm_thumb==1', {
3846                         'cflags': [ '-mthumb-interwork' ],
3847                       }],
3848                       ['profiling==1', {
3849                         'cflags': [
3850                           # Thumb code with frame pointer makes chrome crash
3851                           # early.
3852                           '-marm',
3853                           '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3854                           # The perf report sometimes incorrectly attributes
3855                           # code from tail calls.
3856                           '-fno-optimize-sibling-calls',
3857                         ],
3858                         'cflags!': [
3859                           '-fomit-frame-pointer',
3860                         ],
3861                       }],
3862                       ['clang==1', {
3863                         'cflags!': [
3864                           # Clang does not support the following options.
3865                           '-mthumb-interwork',
3866                           '-finline-limit=64',
3867                           '-fno-tree-sra',
3868                           '-fno-partial-inlining',
3869                           '-fno-early-inlining',
3870                           '-fno-tree-copy-prop',
3871                           '-fno-tree-loop-optimize',
3872                           '-fno-move-loop-invariants',
3873                           '-fno-caller-saves',
3874                           '-Wno-psabi',
3875                         ],
3876                         'cflags': [
3877                           # TODO(hans) Enable integrated-as (crbug.com/124610).
3878                           '-no-integrated-as',
3879                           '-B<(android_toolchain)',  # Else /usr/bin/as gets picked up.
3880                         ],
3881                         'ldflags': [
3882                           # Let clang find the ld.gold in the NDK.
3883                           '--gcc-toolchain=<(android_toolchain)/..',
3884                         ],
3885                       }],
3886                       ['asan==1', {
3887                         'cflags': [
3888                           '-marm', # Required for frame pointer based stack traces.
3889                         ],
3890                       }],
3891                     ],
3892                   }],
3893                   ['chromecast==1', {
3894                     'cflags': [
3895                       # We set arm_arch to "" so that -march compiler option
3896                       # is not set.  Otherwise a gcc bug that would complain
3897                       # about it conflicting with '-mcpu=cortex-a9'. The flag
3898                       # '-march=armv7-a' is actually redundant anyway because
3899                       # it is enabled by default when we built the toolchain.
3900                       # And using '-mcpu=cortex-a9' should be sufficient.
3901                       '-mcpu=cortex-a9',
3902                       '-funwind-tables',
3903                       # Breakpad requires symbols with debugging information
3904                       '-g',
3905                     ],
3906                     'ldflags': [
3907                       # We want to statically link libstdc++/libgcc_s.
3908                       '-static-libstdc++',
3909                       '-static-libgcc',
3910                     ],
3911                     'cflags!': [
3912                       # Some components in Chromium (e.g. v8, skia, ffmpeg)
3913                       # define their own cflags for arm builds that could
3914                       # conflict with the flags we set here (e.g.
3915                       # '-mcpu=cortex-a9'). Remove these flags explicitly.
3916                       '-march=armv7-a',
3917                       '-mtune=cortex-a8',
3918                     ],
3919                   }],
3920                 ],
3921               }],
3922             ],
3923           }],
3924           ['target_arch=="arm64"', {
3925             'target_conditions': [
3926               ['_toolset=="target"', {
3927                 'conditions': [
3928                   ['OS=="android"', {
3929                     'cflags!': [
3930                        '-fstack-protector',  # stack protector is always enabled on arm64.
3931                     ],
3932                   }],
3933                 ],
3934               }],
3935             ],
3936           }],
3937           ['target_arch=="mipsel"', {
3938             'target_conditions': [
3939               ['_toolset=="target"', {
3940                 'conditions': [
3941                   ['android_webview_build==0 and mips_arch_variant=="r6"', {
3942                     'cflags': ['-mips32r6', '-Wa,-mips32r6'],
3943                     'conditions': [
3944                       ['OS=="android"', {
3945                         'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
3946                       }],
3947                     ],
3948                   }],
3949                   ['android_webview_build==0 and mips_arch_variant=="r2"', {
3950                     'cflags': ['-mips32r2', '-Wa,-mips32r2'],
3951                   }],
3952                   ['android_webview_build==0 and mips_arch_variant=="r1"', {
3953                     'cflags': ['-mips32', '-Wa,-mips32'],
3954                   }],
3955                 ],
3956                 'ldflags': [
3957                   '-Wl,--no-keep-memory'
3958                 ],
3959                 'cflags_cc': [
3960                   '-Wno-uninitialized',
3961                 ],
3962               }],
3963             ],
3964           }],
3965           ['target_arch=="mips64el"', {
3966             'target_conditions': [
3967               ['_toolset=="target"', {
3968                 'conditions': [
3969                   ['android_webview_build==0 and mips_arch_variant=="r6"', {
3970                     'cflags': ['-mips64r6', '-Wa,-mips64r6'],
3971                     'ldflags': [ '-mips64r6' ],
3972                   }],
3973                   ['android_webview_build==0 and mips_arch_variant=="r2"', {
3974                     'cflags': ['-mips64r2', '-Wa,-mips64r2'],
3975                     'ldflags': [ '-mips64r2' ],
3976                   }],
3977                 ],
3978                 'cflags_cc': [
3979                   '-Wno-uninitialized',
3980                 ],
3981               }],
3982             ],
3983           }],
3984           ['linux_fpic==1', {
3985             'cflags': [
3986               '-fPIC',
3987             ],
3988             'ldflags': [
3989               '-fPIC',
3990             ],
3991           }],
3992           ['sysroot!=""', {
3993             'target_conditions': [
3994               ['_toolset=="target"', {
3995                 'cflags': [
3996                   '--sysroot=<(sysroot)',
3997                 ],
3998                 'ldflags': [
3999                   '--sysroot=<(sysroot)',
4000                   '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4001                 ],
4002               }]]
4003           }],
4004           ['clang==1', {
4005             'cflags': [
4006               # TODO(thakis): Remove, http://crbug.com/263960
4007               '-Wno-reserved-user-defined-literal',
4008             ],
4009             'cflags_cc': [
4010               # See the comment in the Mac section for what it takes to move
4011               # this to -std=c++11.
4012               '-std=gnu++11',
4013             ],
4014           }],
4015           ['clang==0 and host_clang==1', {
4016             'target_conditions': [
4017               ['_toolset=="host"', {
4018                 'cflags_cc': [ '-std=gnu++11', ],
4019               }],
4020             ],
4021           }],
4022           ['clang==1 and clang_use_chrome_plugins==1', {
4023             'cflags': [
4024               '<@(clang_chrome_plugins_flags)',
4025             ],
4026           }],
4027           ['clang==1 and clang_load!=""', {
4028             'cflags': [
4029               '-Xclang', '-load', '-Xclang', '<(clang_load)',
4030             ],
4031           }],
4032           ['clang==1 and clang_add_plugin!=""', {
4033             'cflags': [
4034               '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4035             ],
4036           }],
4037           ['clang==1 and target_arch=="ia32"', {
4038             'cflags': [
4039               # Else building libyuv gives clang's register allocator issues,
4040               # see llvm.org/PR15798 / crbug.com/233709
4041               '-momit-leaf-frame-pointer',
4042             ],
4043           }],
4044           ['clang==1 and "<(GENERATOR)"=="ninja"', {
4045             'cflags': [
4046               # See http://crbug.com/110262
4047               '-fcolor-diagnostics',
4048             ],
4049           }],
4050           # Common options for AddressSanitizer, LeakSanitizer,
4051           # ThreadSanitizer and MemorySanitizer.
4052           ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4053             'target_conditions': [
4054               ['_toolset=="target"', {
4055                 'cflags': [
4056                   '-fno-omit-frame-pointer',
4057                   '-gline-tables-only',
4058                 ],
4059                 'cflags!': [
4060                   '-fomit-frame-pointer',
4061                 ],
4062               }],
4063             ],
4064           }],
4065           ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4066             'target_conditions': [
4067               ['_toolset=="target"', {
4068                 'ldflags!': [
4069                   # Functions interposed by the sanitizers can make ld think
4070                   # that some libraries aren't needed when they actually are,
4071                   # http://crbug.com/234010. As workaround, disable --as-needed.
4072                   '-Wl,--as-needed',
4073                 ],
4074                 'defines': [
4075                   'MEMORY_TOOL_REPLACES_ALLOCATOR',
4076                   'MEMORY_SANITIZER_INITIAL_SIZE',
4077                 ],
4078               }],
4079             ],
4080             # TODO(glider): enable the default options on other systems.
4081             'conditions': [
4082               ['use_sanitizer_options==1 and OS=="linux" and (chromeos==0 or target_arch!="ia32")', {
4083                 'dependencies': [
4084                   '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
4085                 ],
4086               }],
4087             ],
4088           }],
4089           ['asan==1', {
4090             'target_conditions': [
4091               ['_toolset=="target"', {
4092                 'cflags': [
4093                   '-fsanitize=address',
4094                 ],
4095                 'ldflags': [
4096                   '-fsanitize=address',
4097                 ],
4098               }],
4099             ],
4100             'conditions': [
4101               ['OS=="mac"', {
4102                 'cflags': [
4103                   '-mllvm -asan-globals=0',  # http://crbug.com/352073
4104                 ],
4105               }],
4106             ],
4107           }],
4108           ['ubsan==1', {
4109             'target_conditions': [
4110               ['_toolset=="target"', {
4111                 'cflags': [
4112                   '-fsanitize=undefined',
4113                   # -fsanitize=vptr is incompatible with -fno-rtti.
4114                   '-fno-sanitize=vptr',
4115                 ],
4116                 'ldflags': [
4117                   '-fsanitize=undefined',
4118                   # -fsanitize=vptr is incompatible with -fno-rtti.
4119                   '-fno-sanitize=vptr',
4120                 ],
4121               }],
4122             ],
4123           }],
4124           ['ubsan_vptr==1', {
4125             'target_conditions': [
4126               ['_toolset=="target"', {
4127                 'cflags': [
4128                   '-fsanitize=vptr',
4129                   '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4130                 ],
4131                 'cflags_cc!': [
4132                   '-fno-rtti',
4133                 ],
4134                 'cflags!': [
4135                   '-fno-rtti',
4136                 ],
4137                 'ldflags': [
4138                   '-fsanitize=vptr',
4139                 ],
4140                 'defines': [
4141                   'UNDEFINED_SANITIZER',
4142                 ],
4143               }],
4144             ],
4145           }],
4146           ['asan_coverage!=0', {
4147             'target_conditions': [
4148               ['_toolset=="target"', {
4149                 'cflags': [
4150                   '-mllvm -asan-coverage=<(asan_coverage)',
4151                 ],
4152               }],
4153             ],
4154           }],
4155           ['lsan==1', {
4156             'target_conditions': [
4157               ['_toolset=="target"', {
4158                 'cflags': [
4159                   '-fsanitize=leak',
4160                 ],
4161                 'ldflags': [
4162                   '-fsanitize=leak',
4163                 ],
4164                 'defines': [
4165                   'LEAK_SANITIZER',
4166                   'WTF_USE_LEAK_SANITIZER=1',
4167                 ],
4168               }],
4169             ],
4170           }],
4171           ['tsan==1', {
4172             'target_conditions': [
4173               ['_toolset=="target"', {
4174                 'cflags': [
4175                   '-fsanitize=thread',
4176                   '-fPIC',
4177                   '-fsanitize-blacklist=<(tsan_blacklist)',
4178                 ],
4179                 'ldflags': [
4180                   '-fsanitize=thread',
4181                 ],
4182                 'defines': [
4183                   'THREAD_SANITIZER',
4184                   'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4185                   'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4186                 ],
4187                 'target_conditions': [
4188                   ['_type=="executable"', {
4189                     'ldflags': [
4190                       '-pie',
4191                     ],
4192                   }],
4193                 ],
4194               }],
4195             ],
4196           }],
4197           ['msan==1', {
4198             'target_conditions': [
4199               ['_toolset=="target"', {
4200                 'cflags': [
4201                   '-fsanitize=memory',
4202                   '-fsanitize-memory-track-origins=<(msan_track_origins)',
4203                   '-fPIC',
4204                   '-fsanitize-blacklist=<(msan_blacklist)',
4205                 ],
4206                 'ldflags': [
4207                   '-fsanitize=memory',
4208                 ],
4209                 'defines': [
4210                   'MEMORY_SANITIZER',
4211                 ],
4212                 'target_conditions': [
4213                   ['_type=="executable"', {
4214                     'ldflags': [
4215                       '-pie',
4216                     ],
4217                   }],
4218                 ],
4219               }],
4220             ],
4221           }],
4222           ['use_instrumented_libraries==1', {
4223             'dependencies': [
4224               '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4225             ],
4226           }],
4227           ['use_custom_libcxx==1', {
4228             'dependencies': [
4229               '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4230             ],
4231           }],
4232           ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4233             'target_conditions' : [
4234               # crazy_linker has an upstream gyp file we can't edit, and we
4235               # don't want to instrument it.
4236               ['_toolset=="target" and _target_name!="crazy_linker"', {
4237                 'cflags': [
4238                   '-finstrument-functions',
4239                   # Allow mmx intrinsics to inline, so that the
4240                   #0 compiler can expand the intrinsics.
4241                   '-finstrument-functions-exclude-file-list=mmintrin.h',
4242                 ],
4243               }],
4244               ['_toolset=="target" and OS=="android"', {
4245                 'cflags': [
4246                   # Avoids errors with current NDK:
4247                   # "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"
4248                   '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4249                 ],
4250               }],
4251             ],
4252           }],
4253           ['linux_dump_symbols==1', {
4254             'cflags': [ '-g' ],
4255             'conditions': [
4256               ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4257                 'target_conditions': [
4258                   ['_toolset=="target"', {
4259                     'ldflags': [
4260                       # Attempt to use less memory to prevent the linker from
4261                       # running out of address space. Considering installing a
4262                       # 64-bit kernel and switching to a 64-bit linker.
4263                       '-Wl,--no-keep-memory',
4264                     ],
4265                   }],
4266                 ],
4267               }],
4268             ],
4269           }],
4270           ['use_allocator!="tcmalloc"', {
4271             'defines': ['NO_TCMALLOC'],
4272           }],
4273           ['linux_use_gold_flags==1', {
4274             # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4275             # selection.
4276             # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4277             'ldflags': [ '-fuse-ld=gold', ],
4279             'target_conditions': [
4280               ['_toolset=="target"', {
4281                 'ldflags': [
4282                   # Experimentation found that using four linking threads
4283                   # saved ~20% of link time.
4284                   # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4285                   # Only apply this to the target linker, since the host
4286                   # linker might not be gold, but isn't used much anyway.
4287                   # TODO(raymes): Disable threading because gold is frequently
4288                   # crashing on the bots: crbug.com/161942.
4289                   # '-Wl,--threads',
4290                   # '-Wl,--thread-count=4',
4291                 ],
4292               }],
4293             ],
4294             'conditions': [
4295               ['release_valgrind_build==0', {
4296                 'target_conditions': [
4297                   ['_toolset=="target"', {
4298                     'ldflags': [
4299                       # There seems to be a conflict of --icf and -pie
4300                       # in gold which can generate crashy binaries. As
4301                       # a security measure, -pie takes precedence for
4302                       # now.
4303                       #'-Wl,--icf=safe',
4304                       '-Wl,--icf=none',
4305                     ],
4306                   }],
4307                 ],
4308               }],
4309             ],
4310           }],
4311           ['linux_use_bundled_binutils==1', {
4312             'cflags': [
4313               '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4314             ],
4315           }],
4316           ['linux_use_bundled_gold==1', {
4317             # Put our binutils, which contains gold in the search path. We pass
4318             # the path to gold to the compiler. gyp leaves unspecified what the
4319             # cwd is when running the compiler, so the normal gyp path-munging
4320             # fails us. This hack gets the right path.
4321             'ldflags': [
4322               '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4323             ],
4324           }],
4325           # Some binutils 2.23 releases may or may not have new dtags enabled,
4326           # but they are all compatible with --disable-new-dtags,
4327           # because the new dynamic tags are not created by default.
4328           ['binutils_version>=223', {
4329             # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4330             # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4331             # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4332             # inside this file to allow usage of --no-as-needed and removal of
4333             # this flag.
4334             'ldflags': [
4335               '-Wl,--disable-new-dtags',
4336             ],
4337           }],
4338           ['gcc_version>=47 and clang==0', {
4339             'target_conditions': [
4340               ['_toolset=="target"', {
4341                 'cflags_cc': [
4342                   '-std=gnu++11',
4343                   # See comment for -Wno-c++11-narrowing.
4344                   '-Wno-narrowing',
4345                   # TODO(thakis): Remove, http://crbug.com/263960
4346                   '-Wno-literal-suffix',
4347                 ],
4348               }],
4349             ],
4350           }],
4351           ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4352             'target_conditions': [
4353               ['_toolset=="host"', {
4354                 'cflags_cc': [
4355                   '-std=gnu++11',
4356                   # See comment for -Wno-c++11-narrowing.
4357                   '-Wno-narrowing',
4358                   # TODO(thakis): Remove, http://crbug.com/263960
4359                   '-Wno-literal-suffix',
4360                 ],
4361               }],
4362             ],
4363           }],
4364         ],
4365       },
4366     }],
4367     # FreeBSD-specific options; note that most FreeBSD options are set above,
4368     # with Linux.
4369     ['OS=="freebsd"', {
4370       'target_defaults': {
4371         'ldflags': [
4372           '-Wl,--no-keep-memory',
4373         ],
4374       },
4375     }],
4376     # Android-specific options; note that most are set above with Linux.
4377     ['OS=="android"', {
4378       'variables': {
4379         # This is a unique identifier for a given build. It's used for
4380         # identifying various build artifacts corresponding to a particular
4381         # build of chrome (e.g. where to find archived symbols).
4382         'chrome_build_id%': '',
4383         'conditions': [
4384           # Use shared stlport library when system one used.
4385           # Figure this out early since it needs symbols from libgcc.a, so it
4386           # has to be before that in the set of libraries.
4387           ['use_system_stlport==1', {
4388             'android_stlport_library': 'stlport',
4389           }, {
4390             'conditions': [
4391               ['component=="shared_library"', {
4392                   'android_stlport_library': 'stlport_shared',
4393               }, {
4394                   'android_stlport_library': 'stlport_static',
4395               }],
4396             ],
4397           }],
4398         ],
4400         # Placing this variable here prevents from forking libvpx, used
4401         # by remoting.  Remoting is off, so it needn't built,
4402         # so forking it's deps seems like overkill.
4403         # But this variable need defined to properly run gyp.
4404         # A proper solution is to have an OS==android conditional
4405         # in third_party/libvpx/libvpx.gyp to define it.
4406         'libvpx_path': 'lib/linux/arm',
4407       },
4408       'target_defaults': {
4409         'variables': {
4410           'release_extra_cflags%': '',
4411           'conditions': [
4412             # If we're using the components build, append "cr" to all shared
4413             # libraries to avoid naming collisions with android system library
4414             # versions with the same name (e.g. skia, icu).
4415             ['component=="shared_library"', {
4416               'android_product_extension': 'cr.so',
4417             }, {
4418               'android_product_extension': 'so',
4419             } ],
4420           ],
4421         },
4422         'target_conditions': [
4423           ['_type=="shared_library"', {
4424             'product_extension': '<(android_product_extension)',
4425           }],
4427           # Settings for building device targets using Android's toolchain.
4428           # These are based on the setup.mk file from the Android NDK.
4429           #
4430           # The NDK Android executable link step looks as follows:
4431           #  $LDFLAGS
4432           #  $(TARGET_CRTBEGIN_DYNAMIC_O)  <-- crtbegin.o
4433           #  $(PRIVATE_OBJECTS)            <-- The .o that we built
4434           #  $(PRIVATE_STATIC_LIBRARIES)   <-- The .a that we built
4435           #  $(TARGET_LIBGCC)              <-- libgcc.a
4436           #  $(PRIVATE_SHARED_LIBRARIES)   <-- The .so that we built
4437           #  $(PRIVATE_LDLIBS)             <-- System .so
4438           #  $(TARGET_CRTEND_O)            <-- crtend.o
4439           #
4440           # For now the above are approximated for executables by adding
4441           # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4442           # of 'libraries'.
4443           #
4444           # The NDK Android shared library link step looks as follows:
4445           #  $LDFLAGS
4446           #  $(PRIVATE_OBJECTS)            <-- The .o that we built
4447           #  -l,--whole-archive
4448           #  $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4449           #  -l,--no-whole-archive
4450           #  $(PRIVATE_STATIC_LIBRARIES)   <-- The .a that we built
4451           #  $(TARGET_LIBGCC)              <-- libgcc.a
4452           #  $(PRIVATE_SHARED_LIBRARIES)   <-- The .so that we built
4453           #  $(PRIVATE_LDLIBS)             <-- System .so
4454           #
4455           # For now, assume that whole static libraries are not needed.
4456           #
4457           # For both executables and shared libraries, add the proper
4458           # libgcc.a to the start of libraries which puts it in the
4459           # proper spot after .o and .a files get linked in.
4460           #
4461           # TODO: The proper thing to do longer-tem would be proper gyp
4462           # support for a custom link command line.
4463           ['_toolset=="target"', {
4464             'cflags!': [
4465               '-pthread',  # Not supported by Android toolchain.
4466             ],
4467             'cflags': [
4468               '-ffunction-sections',
4469               '-funwind-tables',
4470               '-g',
4471               '-fstack-protector',
4472               '-fno-short-enums',
4473               '-finline-limit=64',
4474               '-Wa,--noexecstack',
4475               '<@(release_extra_cflags)',
4476             ],
4477             'defines': [
4478               'ANDROID',
4479               '__GNU_SOURCE=1',  # Necessary for clone()
4480               'USE_STLPORT=1',
4481               '_STLP_USE_PTR_SPECIALIZATIONS=1',
4482               'CHROME_BUILD_ID="<(chrome_build_id)"',
4483             ],
4484             'ldflags!': [
4485               '-pthread',  # Not supported by Android toolchain.
4486             ],
4487             'ldflags': [
4488               '-nostdlib',
4489               '-Wl,--no-undefined',
4490             ],
4491             'libraries': [
4492               '-l<(android_stlport_library)',
4493               # Manually link the libgcc.a that the cross compiler uses.
4494               '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4495               '-lc',
4496               '-ldl',
4497               '-lm',
4498             ],
4499             'conditions': [
4500               ['component=="static_library"', {
4501                 'ldflags': [
4502                   '-Wl,--exclude-libs=ALL',
4503                 ],
4504               }],
4505               ['clang==1', {
4506                 'cflags': [
4507                   # Work around incompatibilities between bionic and clang
4508                   # headers.
4509                   '-D__compiler_offsetof=__builtin_offsetof',
4510                   '-Dnan=__builtin_nan',
4511                 ],
4512                 'conditions': [
4513                   ['target_arch=="arm"', {
4514                     'cflags': [
4515                       '-target arm-linux-androideabi',
4516                     ],
4517                     'ldflags': [
4518                       '-target arm-linux-androideabi',
4519                     ],
4520                   }],
4521                   ['target_arch=="ia32"', {
4522                     'cflags': [
4523                       '-target x86-linux-androideabi',
4524                     ],
4525                     'ldflags': [
4526                       '-target x86-linux-androideabi',
4527                     ],
4528                   }],
4529                   # Place holder for x64 support, not tested.
4530                   # TODO: Enable clang support for Android x64. http://crbug.com/346626
4531                   ['target_arch=="x64"', {
4532                     'cflags': [
4533                       '-target x86_64-linux-androideabi',
4534                     ],
4535                     'ldflags': [
4536                       '-target x86_64-linux-androideabi',
4537                     ],
4538                   }],
4539                 ],
4540               }],
4541               ['asan==1', {
4542                 'cflags': [
4543                   # Android build relies on -Wl,--gc-sections removing
4544                   # unreachable code. ASan instrumentation for globals inhibits
4545                   # this and results in a library with unresolvable relocations.
4546                   # TODO(eugenis): find a way to reenable this.
4547                   '-mllvm -asan-globals=0',
4548                 ],
4549               }],
4550               ['android_webview_build==0', {
4551                 'defines': [
4552                   # The NDK has these things, but doesn't define the constants
4553                   # to say that it does. Define them here instead.
4554                   'HAVE_SYS_UIO_H',
4555                 ],
4556                 'cflags': [
4557                   '--sysroot=<(android_ndk_sysroot)',
4558                 ],
4559                 'ldflags': [
4560                   '--sysroot=<(android_ndk_sysroot)',
4561                 ],
4562               }],
4563               ['android_webview_build==1', {
4564                 'include_dirs': [
4565                   # OpenAL headers from the Android tree.
4566                   '<(android_src)/frameworks/wilhelm/include',
4567                 ],
4568                 'cflags': [
4569                   # Android predefines this as 1; undefine it here so Chromium
4570                   # can redefine it later to be 2 for chromium code and unset
4571                   # for third party code. This works because cflags are added
4572                   # before defines.
4573                   '-U_FORTIFY_SOURCE',
4574                   # Disable any additional warnings enabled by the Android build system but which
4575                   # chromium does not build cleanly with (when treating warning as errors).
4576                   # Things that are part of -Wextra:
4577                   '-Wno-extra', # Enabled by -Wextra, but no specific flag
4578                   '-Wno-ignored-qualifiers',
4579                   '-Wno-type-limits',
4580                   '-Wno-unused-but-set-variable',
4581                 ],
4582                 'cflags_cc': [
4583                   # Other things unrelated to -Wextra:
4584                   '-Wno-non-virtual-dtor',
4585                   '-Wno-sign-promo',
4586                 ],
4587               }],
4588               ['android_webview_build==1', {
4589                 'target_conditions': [
4590                   ['chromium_code==0', {
4591                     'cflags': [
4592                       # There is a class of warning which:
4593                       #  1) Android always enables and also treats as errors
4594                       #  2) Chromium ignores in third party code
4595                       # So we re-enable those warnings when building Android.
4596                       '-Wno-address',
4597                       '-Wno-format-security',
4598                       '-Wno-return-type',
4599                       '-Wno-sequence-point',
4600                     ],
4601                     'cflags_cc': [
4602                       '-Wno-non-virtual-dtor',
4603                     ],
4604                   }],
4605                 ],
4606               }],
4607               ['target_arch == "arm"', {
4608                 'ldflags': [
4609                   # Enable identical code folding to reduce size.
4610                   '-Wl,--icf=safe',
4611                 ],
4612               }],
4613               # NOTE: The stlport header include paths below are specified in
4614               # cflags rather than include_dirs because they need to come
4615               # after include_dirs. Think of them like system headers, but
4616               # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4617               # toolchain (circa Gingerbread) will exhibit strange errors.
4618               # The include ordering here is important; change with caution.
4619               ['use_system_stlport==1', {
4620                 'cflags': [
4621                   # For libstdc++/include, which is used by stlport.
4622                   '-I<(android_src)/bionic',
4623                   '-I<(android_src)/external/stlport/stlport',
4624                 ],
4625               }, { # else: use_system_stlport!=1
4626                 'cflags': [
4627                   '-isystem<(android_stlport_include)',
4628                 ],
4629                 'ldflags': [
4630                   '-L<(android_stlport_libs_dir)',
4631                 ],
4632               }],
4633               ['target_arch=="ia32"', {
4634                 # The x86 toolchain currently has problems with stack-protector.
4635                 'cflags!': [
4636                   '-fstack-protector',
4637                 ],
4638                 'cflags': [
4639                   '-fno-stack-protector',
4640                 ],
4641               }],
4642             ],
4643             'target_conditions': [
4644               ['_type=="executable"', {
4645                 # Force android tools to export the "main" symbol so they can be
4646                 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4647                 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4648                 # when ICS support will be dropped.
4649                 'cflags': [
4650                   '-fPIE',
4651                   '-fvisibility=default',
4652                 ],
4653                 'ldflags': [
4654                   '-Bdynamic',
4655                   '-Wl,--gc-sections',
4656                   '-Wl,-z,nocopyreloc',
4657                   '-pie',
4658                   '-rdynamic',
4659                   # crtbegin_dynamic.o should be the last item in ldflags.
4660                   '<(android_ndk_lib)/crtbegin_dynamic.o',
4661                 ],
4662                 'libraries': [
4663                   # crtend_android.o needs to be the last item in libraries.
4664                   # Do not add any libraries after this!
4665                   '<(android_ndk_lib)/crtend_android.o',
4666                 ],
4667               }],
4668               ['_type=="shared_library" or _type=="loadable_module"', {
4669                 'ldflags!': [
4670                   '-Wl,--exclude-libs=ALL',
4671                 ],
4672                 'ldflags': [
4673                   '-Wl,-shared,-Bsymbolic',
4674                 ],
4675                 'conditions': [
4676                   ['android_webview_build==0', {
4677                     'ldflags': [
4678                       # crtbegin_so.o should be the last item in ldflags.
4679                       '<(android_ndk_lib)/crtbegin_so.o',
4680                     ],
4681                     'libraries': [
4682                       # crtend_so.o needs to be the last item in libraries.
4683                       # Do not add any libraries after this!
4684                       '<(android_ndk_lib)/crtend_so.o',
4685                     ],
4686                   }],
4687                 ],
4688               }],
4689             ],
4690           }],
4691           # Settings for building host targets using the system toolchain.
4692           ['_toolset=="host"', {
4693             'cflags!': [
4694               # Due to issues in Clang build system, using ASan on 32-bit
4695               # binaries on x86_64 host is problematic.
4696               # TODO(eugenis): re-enable.
4697               '-fsanitize=address',
4698             ],
4699             'ldflags!': [
4700               '-fsanitize=address',
4701               '-Wl,-z,noexecstack',
4702               '-Wl,--gc-sections',
4703               '-Wl,-O1',
4704               '-Wl,--as-needed',
4705               '-Wl,--warn-shared-textrel',
4706               '-Wl,--fatal-warnings',
4707             ],
4708           }],
4709           # Settings for building host targets on mac.
4710           ['_toolset=="host" and host_os=="mac"', {
4711             'ldflags!': [
4712               '-Wl,-z,now',
4713               '-Wl,-z,relro',
4714             ],
4715           }],
4716         ],
4717       },
4718     }],
4719     ['OS=="solaris"', {
4720       'cflags!': ['-fvisibility=hidden'],
4721       'cflags_cc!': ['-fvisibility-inlines-hidden'],
4722     }],
4723     ['OS=="mac" or OS=="ios"', {
4724       'target_defaults': {
4725         'mac_bundle': 0,
4726         'xcode_settings': {
4727           'ALWAYS_SEARCH_USER_PATHS': 'NO',
4728           # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4729           'CLANG_LINK_OBJC_RUNTIME': 'NO',          # -fno-objc-link-runtime
4730           'COPY_PHASE_STRIP': 'NO',
4731           'GCC_C_LANGUAGE_STANDARD': 'c99',         # -std=c99
4732           'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
4733           'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
4734           'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
4735           'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
4736           # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4737           'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4738           'GCC_OBJC_CALL_CXX_CDTORS': 'YES',        # -fobjc-call-cxx-cdtors
4739           'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden
4740           'GCC_THREADSAFE_STATICS': 'NO',           # -fno-threadsafe-statics
4741           'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',    # -Werror
4742           'GCC_VERSION': '4.2',
4743           'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',  # -Wnewline-eof
4744           'USE_HEADERMAP': 'NO',
4745           'WARNING_CFLAGS': [
4746             '-Wall',
4747             '-Wendif-labels',
4748             '-Wextra',
4749             # Don't warn about unused function parameters.
4750             '-Wno-unused-parameter',
4751             # Don't warn about the "struct foo f = {0};" initialization
4752             # pattern.
4753             '-Wno-missing-field-initializers',
4754           ],
4755           'conditions': [
4756             ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4757                                  {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4758             ],
4759             # Note that the prebuilt Clang binaries should not be used for iOS
4760             # development except for ASan builds.
4761             ['clang==1', {
4762               # gnu++11 instead of c++11 is needed because some code uses
4763               # typeof() (a GNU extension).
4764               # TODO(thakis): Eventually switch this to c++11 instead of
4765               # gnu++11 (once typeof can be removed, which is blocked on c++11
4766               # being available everywhere).
4767               'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11',  # -std=gnu++11
4768               # Warn if automatic synthesis is triggered with
4769               # the -Wobjc-missing-property-synthesis flag.
4770               'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4771               'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4772               'WARNING_CFLAGS': [
4773                 # This warns on selectors from Cocoa headers (-length, -set).
4774                 # cfe-dev is currently discussing the merits of this warning.
4775                 # TODO(thakis): Reevaluate what to do with this, based one
4776                 # cfe-dev discussion.
4777                 '-Wno-selector-type-mismatch',
4778               ],
4779               'OTHER_CFLAGS': [
4780                 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed
4781                 # and the fix is in chromium.
4782                 '-fno-slp-vectorize',
4783               ],
4785               'conditions': [
4786                 ['clang_xcode==0', {
4787                   'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4788                   'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4789                 }],
4790               ],
4791             }],
4792             ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4793               'OTHER_CFLAGS': [
4794                 '<@(clang_chrome_plugins_flags)',
4795               ],
4796             }],
4797             ['clang==1 and clang_xcode==0 and clang_load!=""', {
4798               'OTHER_CFLAGS': [
4799                 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4800               ],
4801             }],
4802             ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4803               'OTHER_CFLAGS': [
4804                 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4805               ],
4806             }],
4807             ['clang==1 and "<(GENERATOR)"=="ninja"', {
4808               'OTHER_CFLAGS': [
4809                 # See http://crbug.com/110262
4810                 '-fcolor-diagnostics',
4811               ],
4812             }],
4813             ['OS=="ios" and target_subarch!="arm32" and \
4814               "<(GENERATOR)"=="xcode"', {
4815               'OTHER_CFLAGS': [
4816                 # TODO(ios): when building Chrome for iOS on 64-bit platform
4817                 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4818                 # enabled. This cause failures when compiling protobuf code,
4819                 # so disable the warning. http://crbug.com/359107
4820                 '-Wno-shorten-64-to-32',
4821               ],
4822             }],
4823           ],
4824         },
4825         'conditions': [
4826           ['clang==1', {
4827             'variables': {
4828               'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4829             },
4830           }],
4831           ['asan==1', {
4832             'xcode_settings': {
4833               'OTHER_CFLAGS': [
4834                 '-fsanitize=address',
4835                 '-mllvm -asan-globals=0',  # http://crbug.com/352073
4836                 '-gline-tables-only',
4837               ],
4838             },
4839           }],
4840           ['asan_coverage!=0', {
4841             'target_conditions': [
4842               ['_toolset=="target"', {
4843                 'cflags': [
4844                   '-mllvm -asan-coverage=<(asan_coverage)',
4845                 ],
4846               }],
4847             ],
4848           }],
4849         ],
4850         'target_conditions': [
4851           ['_type!="static_library"', {
4852             'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4853             'conditions': [
4854               ['asan==1', {
4855                 'xcode_settings': {
4856                   'OTHER_LDFLAGS': [
4857                     '-fsanitize=address',
4858                   ],
4859                 },
4860               }],
4861               ['mac_write_linker_maps==1', {
4862                 'xcode_settings': {
4863                   'OTHER_LDFLAGS': [
4864                     '-Wl,-map,>(_target_name).map',
4865                   ],
4866                 },
4867               }],
4868             ],
4869           }],
4870           ['_mac_bundle', {
4871             'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4872             'target_conditions': [
4873               ['_type=="executable"', {
4874                 'conditions': [
4875                   ['asan==1', {
4876                     'postbuilds': [
4877                       {
4878                         'variables': {
4879                           # Define copy_asan_dylib_path in a variable ending in
4880                           # _path so that gyp understands it's a path and
4881                           # performs proper relativization during dict merging.
4882                           'copy_asan_dylib_path':
4883                             'mac/copy_asan_runtime_dylib.sh',
4884                         },
4885                         'postbuild_name': 'Copy ASan runtime dylib',
4886                         'action': [
4887                           '<(copy_asan_dylib_path)',
4888                         ],
4889                       },
4890                     ],
4891                   }],
4892                 ],
4893               }],
4894             ],
4895           }],
4896         ],  # target_conditions
4897       },  # target_defaults
4898     }],  # OS=="mac" or OS=="ios"
4899     ['OS=="mac"', {
4900       'target_defaults': {
4901         'defines': [
4902           # Prevent Mac OS X AssertMacros.h from defining macros that collide
4903           # with common names, like 'check', 'require', and 'verify'.
4904           # (Included by system header. Also exists on iOS but not included.)
4905           # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
4906           '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
4907         ],
4908         'variables': {
4909           # These should end with %, but there seems to be a bug with % in
4910           # variables that are intended to be set to different values in
4911           # different targets, like these.
4912           'mac_pie': 1,        # Most executables can be position-independent.
4913           # Strip debugging symbols from the target.
4914           'mac_strip': '<(mac_strip_release)',
4915           'conditions': [
4916             ['asan==1', {
4917               'conditions': [
4918                 ['mac_want_real_dsym=="default"', {
4919                   'mac_real_dsym': 1,
4920                 }, {
4921                   'mac_real_dsym': '<(mac_want_real_dsym)'
4922                 }],
4923               ],
4924             }, {
4925               'conditions': [
4926                 ['mac_want_real_dsym=="default"', {
4927                   'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
4928                 }, {
4929                   'mac_real_dsym': '<(mac_want_real_dsym)'
4930                 }],
4931               ],
4932             }],
4933           ],
4934         },
4935         'xcode_settings': {
4936           'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
4937                                                     # (Equivalent to -fPIC)
4938           # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
4939           'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4940           # Keep pch files below xcodebuild/.
4941           'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
4942           'OTHER_CFLAGS': [
4943             # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
4944             # xcode_setting, but not until all downstream projects' mac bots are
4945             # using xcode >= 4.6, because that's when the default value of the
4946             # flag in the compiler switched.  Pre-4.6, the value 'NO' for that
4947             # setting is a no-op as far as xcode is concerned, but the compiler
4948             # behaves differently based on whether -fno-strict-aliasing is
4949             # specified or not.
4950             '-fno-strict-aliasing',  # See http://crbug.com/32204.
4951           ],
4952         },
4953         'target_conditions': [
4954           ['_type=="executable"', {
4955             'postbuilds': [
4956               {
4957                 # Arranges for data (heap) pages to be protected against
4958                 # code execution when running on Mac OS X 10.7 ("Lion"), and
4959                 # ensures that the position-independent executable (PIE) bit
4960                 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
4961                 'variables': {
4962                   # Define change_mach_o_flags in a variable ending in _path
4963                   # so that GYP understands it's a path and performs proper
4964                   # relativization during dict merging.
4965                   'change_mach_o_flags_path':
4966                       'mac/change_mach_o_flags_from_xcode.sh',
4967                   'change_mach_o_flags_options%': [
4968                   ],
4969                   'target_conditions': [
4970                     ['mac_pie==0 or release_valgrind_build==1', {
4971                       # Don't enable PIE if it's unwanted. It's unwanted if
4972                       # the target specifies mac_pie=0 or if building for
4973                       # Valgrind, because Valgrind doesn't understand slide.
4974                       # See the similar mac_pie/release_valgrind_build check
4975                       # below.
4976                       'change_mach_o_flags_options': [
4977                         '--no-pie',
4978                       ],
4979                     }],
4980                   ],
4981                 },
4982                 'postbuild_name': 'Change Mach-O Flags',
4983                 'action': [
4984                   '<(change_mach_o_flags_path)',
4985                   '>@(change_mach_o_flags_options)',
4986                 ],
4987               },
4988             ],
4989             'conditions': [
4990               ['asan==1', {
4991                 'variables': {
4992                  'asan_saves_file': 'asan.saves',
4993                 },
4994                 'xcode_settings': {
4995                   'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
4996                 },
4997               }],
4998             ],
4999             'target_conditions': [
5000               ['mac_pie==1 and release_valgrind_build==0', {
5001                 # Turn on position-independence (ASLR) for executables. When
5002                 # PIE is on for the Chrome executables, the framework will
5003                 # also be subject to ASLR.
5004                 # Don't do this when building for Valgrind, because Valgrind
5005                 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5006                 # understand slide, and get rid of the Valgrind check.
5007                 'xcode_settings': {
5008                   'OTHER_LDFLAGS': [
5009                     '-Wl,-pie',  # Position-independent executable (MH_PIE)
5010                   ],
5011                 },
5012               }],
5013             ],
5014           }],
5015           ['(_type=="executable" or _type=="shared_library" or \
5016              _type=="loadable_module") and mac_strip!=0', {
5017             'target_conditions': [
5018               ['mac_real_dsym == 1', {
5019                 # To get a real .dSYM bundle produced by dsymutil, set the
5020                 # debug information format to dwarf-with-dsym.  Since
5021                 # strip_from_xcode will not be used, set Xcode to do the
5022                 # stripping as well.
5023                 'configurations': {
5024                   'Release_Base': {
5025                     'xcode_settings': {
5026                       'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5027                       'DEPLOYMENT_POSTPROCESSING': 'YES',
5028                       'STRIP_INSTALLED_PRODUCT': 'YES',
5029                       'target_conditions': [
5030                         ['_type=="shared_library" or _type=="loadable_module"', {
5031                           # The Xcode default is to strip debugging symbols
5032                           # only (-S).  Local symbols should be stripped as
5033                           # well, which will be handled by -x.  Xcode will
5034                           # continue to insert -S when stripping even when
5035                           # additional flags are added with STRIPFLAGS.
5036                           'STRIPFLAGS': '-x',
5037                         }],  # _type=="shared_library" or _type=="loadable_module"
5038                         ['_type=="executable"', {
5039                           'conditions': [
5040                             ['asan==1', {
5041                               'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
5042                             }]
5043                           ],
5044                         }],  # _type=="executable" and asan==1
5045                       ],  # target_conditions
5046                     },  # xcode_settings
5047                   },  # configuration "Release"
5048                 },  # configurations
5049               }, {  # mac_real_dsym != 1
5050                 # To get a fast fake .dSYM bundle, use a post-build step to
5051                 # produce the .dSYM and strip the executable.  strip_from_xcode
5052                 # only operates in the Release configuration.
5053                 'postbuilds': [
5054                   {
5055                     'variables': {
5056                       # Define strip_from_xcode in a variable ending in _path
5057                       # so that gyp understands it's a path and performs proper
5058                       # relativization during dict merging.
5059                       'strip_from_xcode_path': 'mac/strip_from_xcode',
5060                     },
5061                     'postbuild_name': 'Strip If Needed',
5062                     'action': ['<(strip_from_xcode_path)'],
5063                   },
5064                 ],  # postbuilds
5065               }],  # mac_real_dsym
5066             ],  # target_conditions
5067           }],  # (_type=="executable" or _type=="shared_library" or
5068                #  _type=="loadable_module") and mac_strip!=0
5069         ],  # target_conditions
5070       },  # target_defaults
5071     }],  # OS=="mac"
5072     ['OS=="ios"', {
5073       'target_defaults': {
5074         'xcode_settings' : {
5075           # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang
5076           # section above).
5077           'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',
5079           'conditions': [
5080             # Older Xcodes do not support -Wno-deprecated-register, so pass an
5081             # additional flag to suppress the "unknown compiler option" error.
5082             # Restrict this flag to builds that are either compiling with Xcode
5083             # or compiling with Xcode's Clang.  This will allow Ninja builds to
5084             # continue failing on unknown compiler options.
5085             # TODO(rohitrao): This flag is temporary and should be removed as
5086             # soon as the iOS bots are updated to use Xcode 5.1.
5087             ['clang_xcode==1', {
5088               'WARNING_CFLAGS': [
5089                 '-Wno-unknown-warning-option',
5090               ],
5091             }],
5093             # Limit the valid architectures depending on "target_subarch".
5094             # This need to include the "arm" architectures but also the "x86"
5095             # ones (they are used when building for the simulator).
5096             ['target_subarch=="arm32"', {
5097               'VALID_ARCHS': ['armv7', 'i386'],
5098             }],
5099             ['target_subarch=="arm64"', {
5100               'VALID_ARCHS': ['arm64', 'x86_64'],
5101             }],
5102             ['target_subarch=="both"', {
5103               'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5104             }],
5105             ['use_system_libcxx==1', {
5106               'target_conditions': [
5107                 # Only use libc++ when building target for iOS not when building
5108                 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5109                 # does not support libc++.
5110                 ['_toolset=="target"', {
5111                   'CLANG_CXX_LIBRARY': 'libc++',  # -stdlib=libc++
5112                 }]
5113               ],
5114             }, {
5115               # The default for deployment target of 7.0+ is libc++, so force
5116               # the old behavior unless libc++ is enabled.
5117               'CLANG_CXX_LIBRARY': 'libstdc++',  # -stdlib=libstdc++
5118             }],
5119           ],
5120         },
5121         'target_conditions': [
5122           ['_toolset=="host"', {
5123             'xcode_settings': {
5124               'SDKROOT': 'macosx<(mac_sdk)',  # -isysroot
5125               'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5126               'VALID_ARCHS': [
5127                 'x86_64',
5128               ],
5129               'ARCHS': [
5130                 'x86_64',
5131               ],
5132             },
5133           }],
5134           ['_toolset=="target"', {
5135             'xcode_settings': {
5136               # This section should be for overriding host settings. But,
5137               # since we can't negate the iphone deployment target above, we
5138               # instead set it here for target only.
5139               'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5140               'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5141             },
5142           }],
5143           ['_type=="executable"', {
5144             'configurations': {
5145               'Release_Base': {
5146                 'xcode_settings': {
5147                   'DEPLOYMENT_POSTPROCESSING': 'YES',
5148                   'STRIP_INSTALLED_PRODUCT': 'YES',
5149                 },
5150               },
5151               'Debug_Base': {
5152                 'xcode_settings': {
5153                   # Remove dSYM to reduce build time.
5154                   'DEBUG_INFORMATION_FORMAT': 'dwarf',
5155                 },
5156               },
5157             },
5158             'xcode_settings': {
5159               'conditions': [
5160                 ['chromium_ios_signing', {
5161                   # iOS SDK wants everything for device signed.
5162                   'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5163                 }, {
5164                   'CODE_SIGNING_REQUIRED': 'NO',
5165                   'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5166                 }],
5167               ],
5168             },
5169           }],
5170         ],  # target_conditions
5171       },  # target_defaults
5172     }],  # OS=="ios"
5173     ['OS=="win"', {
5174       'target_defaults': {
5175         'defines': [
5176           '_WIN32_WINNT=0x0602',
5177           'WINVER=0x0602',
5178           'WIN32',
5179           '_WINDOWS',
5180           'NOMINMAX',
5181           'PSAPI_VERSION=1',
5182           '_CRT_RAND_S',
5183           'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5184           'WIN32_LEAN_AND_MEAN',
5185           '_ATL_NO_OPENGL',
5186           # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5187           '_HAS_EXCEPTIONS=0',
5188         ],
5189         'conditions': [
5190           ['buildtype=="Official"', {
5191               # In official builds, targets can self-select an optimization
5192               # level by defining a variable named 'optimize', and setting it
5193               # to one of
5194               # - "size", optimizes for minimal code size - the default.
5195               # - "speed", optimizes for speed over code size.
5196               # - "max", whole program optimization and link-time code
5197               #   generation. This is very expensive and should be used
5198               #   sparingly.
5199               'variables': {
5200                 'optimize%': 'size',
5201               },
5202               'msvs_settings': {
5203                 'VCLinkerTool': {
5204                   # Set /LTCG for the official builds.
5205                   'LinkTimeCodeGeneration': '1',
5206                 },
5207               },
5208               'target_conditions': [
5209                 ['optimize=="size"', {
5210                     'msvs_settings': {
5211                       'VCCLCompilerTool': {
5212                         # 1, optimizeMinSpace, Minimize Size (/O1)
5213                         'Optimization': '1',
5214                         # 2, favorSize - Favor small code (/Os)
5215                         'FavorSizeOrSpeed': '2',
5216                       },
5217                     },
5218                   },
5219                 ],
5220                 ['optimize=="speed"', {
5221                     'msvs_settings': {
5222                       'VCCLCompilerTool': {
5223                         # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5224                         'Optimization': '2',
5225                         # 1, favorSpeed - Favor fast code (/Ot)
5226                         'FavorSizeOrSpeed': '1',
5227                       },
5228                     },
5229                   },
5230                 ],
5231                 ['optimize=="max"', {
5232                     # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5233                     # builds. Probably anything that this would catch that
5234                     # wouldn't be caught in a normal build isn't going to
5235                     # actually be a bug, so the incremental value of C4702 for
5236                     # PGO builds is likely very small.
5237                     'msvs_disabled_warnings': [
5238                       4702
5239                     ],
5240                     'msvs_settings': {
5241                       'VCCLCompilerTool': {
5242                         # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5243                         'Optimization': '2',
5244                         # 1, favorSpeed - Favor fast code (/Ot)
5245                         'FavorSizeOrSpeed': '1',
5246                         # This implies link time code generation.
5247                         'WholeProgramOptimization': 'true',
5248                       },
5249                     },
5250                   },
5251                 ],
5252               ],
5253             },
5254           ],
5255           ['secure_atl', {
5256             'defines': [
5257               '_SECURE_ATL',
5258             ],
5259           }],
5260           ['msvs_express', {
5261             'configurations': {
5262               'x86_Base': {
5263                 'msvs_settings': {
5264                   'VCLinkerTool': {
5265                     'AdditionalLibraryDirectories':
5266                       ['<(windows_driver_kit_path)/lib/ATL/i386'],
5267                   },
5268                   'VCLibrarianTool': {
5269                     'AdditionalLibraryDirectories':
5270                       ['<(windows_driver_kit_path)/lib/ATL/i386'],
5271                   },
5272                 },
5273               },
5274               'x64_Base': {
5275                 'msvs_settings': {
5276                   'VCLibrarianTool': {
5277                     'AdditionalLibraryDirectories':
5278                       ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5279                   },
5280                   'VCLinkerTool': {
5281                     'AdditionalLibraryDirectories':
5282                       ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5283                   },
5284                 },
5285               },
5286             },
5287             # https://code.google.com/p/chromium/issues/detail?id=372451#c20
5288             # Warning 4702 ("Unreachable code") should be re-enabled once
5289             # Express users are updated to VS2013 Update 2.
5290             'msvs_disabled_warnings': [
5291               4702
5292             ],
5293             'msvs_settings': {
5294               'VCCLCompilerTool': {
5295                 'AdditionalOptions!': [
5296                     '/Zc:inline',  # Not supported on non-updated Express.
5297                 ],
5298               },
5299               'VCLinkerTool': {
5300                 # Explicitly required when using the ATL with express
5301                 'AdditionalDependencies': ['atlthunk.lib'],
5303                 # ATL 8.0 included in WDK 7.1 makes the linker to generate
5304                 # almost eight hundred LNK4254 and LNK4078 warnings:
5305                 #   - warning LNK4254: section 'ATL' (50000040) merged into
5306                 #     '.rdata' (40000040) with different attributes
5307                 #   - warning LNK4078: multiple 'ATL' sections found with
5308                 #     different attributes
5309                 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
5310               },
5311             },
5312             'msvs_system_include_dirs': [
5313               '<(windows_driver_kit_path)/inc/atl71',
5314               '<(windows_driver_kit_path)/inc/mfc42',
5315             ],
5316           }],
5317         ],
5318         'msvs_system_include_dirs': [
5319           '<(windows_sdk_path)/Include/shared',
5320           '<(windows_sdk_path)/Include/um',
5321           '<(windows_sdk_path)/Include/winrt',
5322           '$(VSInstallDir)/VC/atlmfc/include',
5323         ],
5324         'msvs_cygwin_shell': 0,
5325         'msvs_disabled_warnings': [
5326           # C4127: conditional expression is constant
5327           # This warning can in theory catch dead code and other problems, but
5328           # triggers in far too many desirable cases where the conditional
5329           # expression is either set by macros or corresponds some legitimate
5330           # compile-time constant expression (due to constant template args,
5331           # conditionals comparing the sizes of different types, etc.).  Some of
5332           # these can be worked around, but it's not worth it.
5333           4127,
5335           # C4351: new behavior: elements of array 'array' will be default
5336           #        initialized
5337           # This is a silly "warning" that basically just alerts you that the
5338           # compiler is going to actually follow the language spec like it's
5339           # supposed to, instead of not following it like old buggy versions
5340           # did.  There's absolutely no reason to turn this on.
5341           4351,
5343           # C4355: 'this': used in base member initializer list
5344           # It's commonly useful to pass |this| to objects in a class'
5345           # initializer list.  While this warning can catch real bugs, most of
5346           # the time the constructors in question don't attempt to call methods
5347           # on the passed-in pointer (until later), and annotating every legit
5348           # usage of this is simply more hassle than the warning is worth.
5349           4355,
5351           # C4503: 'identifier': decorated name length exceeded, name was
5352           #        truncated
5353           # This only means that some long error messages might have truncated
5354           # identifiers in the presence of lots of templates.  It has no effect
5355           # on program correctness and there's no real reason to waste time
5356           # trying to prevent it.
5357           4503,
5359           # C4611: interaction between 'function' and C++ object destruction is
5360           #        non-portable
5361           # This warning is unavoidable when using e.g. setjmp/longjmp.  MSDN
5362           # suggests using exceptions instead of setjmp/longjmp for C++, but
5363           # Chromium code compiles without exception support.  We therefore have
5364           # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5365           # means we have to turn off this warning (and be careful about how
5366           # object destruction happens in such cases).
5367           4611,
5369           # TODO(maruel): These warnings are level 4. They will be slowly
5370           # removed as code is fixed.
5371           4100, # Unreferenced formal parameter
5372           4121, # Alignment of a member was sensitive to packing
5373           4189, # Local variable is initialized but not referenced
5374           4244, # Conversion from 'type1' to 'type2', possible loss of data
5375           4481, # Nonstandard extension used: override specifier 'keyword'
5376           4505, # Unreferenced local function has been removed
5377           4510, # Default constructor could not be generated
5378           4512, # Assignment operator could not be generated
5379           4610, # Object can never be instantiated
5380         ],
5381         'msvs_settings': {
5382           'VCCLCompilerTool': {
5383             'AdditionalOptions': ['/MP'],
5384             'MinimalRebuild': 'false',
5385             'BufferSecurityCheck': 'true',
5386             'EnableFunctionLevelLinking': 'true',
5387             'RuntimeTypeInfo': 'false',
5388             'WarningLevel': '4',
5389             'WarnAsError': 'true',
5390             'DebugInformationFormat': '3',
5391             # ExceptionHandling must match _HAS_EXCEPTIONS above.
5392             'ExceptionHandling': '0',
5393           },
5394           'VCLibrarianTool': {
5395             'AdditionalOptions': ['/ignore:4221'],
5396             'AdditionalLibraryDirectories': [
5397               '<(windows_sdk_path)/Lib/win8/um/x86',
5398             ],
5399           },
5400           'VCLinkerTool': {
5401             'AdditionalDependencies': [
5402               'wininet.lib',
5403               'dnsapi.lib',
5404               'version.lib',
5405               'msimg32.lib',
5406               'ws2_32.lib',
5407               'usp10.lib',
5408               'psapi.lib',
5409               'dbghelp.lib',
5410               'winmm.lib',
5411               'shlwapi.lib',
5412             ],
5413             'AdditionalLibraryDirectories': [
5414               '<(windows_sdk_path)/Lib/win8/um/x86',
5415             ],
5416             'GenerateDebugInformation': 'true',
5417             'MapFileName': '$(OutDir)\\$(TargetName).map',
5418             'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5419             'FixedBaseAddress': '1',
5420             # SubSystem values:
5421             #   0 == not set
5422             #   1 == /SUBSYSTEM:CONSOLE
5423             #   2 == /SUBSYSTEM:WINDOWS
5424             # Most of the executables we'll ever create are tests
5425             # and utilities with console output.
5426             'SubSystem': '1',
5427           },
5428           'VCMIDLTool': {
5429             'GenerateStublessProxies': 'true',
5430             'TypeLibraryName': '$(InputName).tlb',
5431             'OutputDirectory': '$(IntDir)',
5432             'HeaderFileName': '$(InputName).h',
5433             'DLLDataFileName': '$(InputName).dlldata.c',
5434             'InterfaceIdentifierFileName': '$(InputName)_i.c',
5435             'ProxyFileName': '$(InputName)_p.c',
5436           },
5437           'VCResourceCompilerTool': {
5438             'Culture' : '1033',
5439             'AdditionalIncludeDirectories': [
5440               '<(DEPTH)',
5441               '<(SHARED_INTERMEDIATE_DIR)',
5442             ],
5443           },
5444           'target_conditions': [
5445             ['_type=="executable"', {
5446               'VCManifestTool': {
5447                 'EmbedManifest': 'true',
5448               },
5449             }],
5450             ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5451               'VCManifestTool': {
5452                 'AdditionalManifestFiles': [
5453                   '>(win_exe_compatibility_manifest)',
5454                 ],
5455               },
5456             }],
5457           ],
5458           'conditions': [
5459             ['clang==1', {
5460               # Building with Clang on Windows is a work in progress and very
5461               # experimental. See crbug.com/82385.
5462               'VCCLCompilerTool': {
5463                 'WarnAsError': 'false',
5464                 'RuntimeTypeInfo': 'false',
5465                 'AdditionalOptions': [
5466                   '-fmsc-version=1800',
5467                   '/fallback',
5469                   # Many files use intrinsics without including this header.
5470                   # TODO(hans): Fix those files, or move this to sub-GYPs.
5471                   '/FIIntrin.h',
5473                   # TODO(hans): Make this list shorter eventually.
5474                   '-Qunused-arguments',
5475                   '-Wno-c++11-compat-deprecated-writable-strings',
5476                   '-Wno-deprecated-declarations',
5477                   '-Wno-empty-body',
5478                   '-Wno-enum-conversion',
5479                   '-Wno-extra-tokens',
5480                   '-Wno-ignored-attributes',
5481                   '-Wno-incompatible-pointer-types',
5482                   '-Wno-int-to-void-pointer-cast',
5483                   '-Wno-invalid-noreturn',
5484                   '-Wno-logical-op-parentheses',
5485                   '-Wno-microsoft',
5486                   '-Wno-missing-braces',
5487                   '-Wno-missing-declarations',
5488                   '-Wno-msvc-include',
5489                   '-Wno-null-dereference',
5490                   '-Wno-overloaded-virtual',
5491                   '-Wno-parentheses',
5492                   '-Wno-pointer-sign',
5493                   '-Wno-reorder',
5494                   '-Wno-return-type-c-linkage',
5495                   '-Wno-self-assign',
5496                   '-Wno-sometimes-uninitialized',
5497                   '-Wno-switch',
5498                   '-Wno-tautological-compare',
5499                   '-Wno-unknown-pragmas',
5500                   '-Wno-unsequenced',
5501                   '-Wno-unused-function',
5502                   '-Wno-unused-private-field',
5503                   '-Wno-unused-value',
5504                   '-Wno-unused-variable',
5505                   '-ferror-limit=1',
5506                 ],
5507               },
5508             }],
5509             ['asan==1', {
5510               # ASan on Windows is a work in progress and very experimental.
5511               # See crbug.com/345874.
5512               'VCCLCompilerTool': {
5513                 'AdditionalOptions': [
5514                   '-fsanitize=address',
5515                 ],
5516                 'AdditionalIncludeDirectories': [
5517                   # MSVC needs to be able to find the sanitizer headers when
5518                   # invoked via /fallback. This is critical for using macros
5519                   # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5520                   # back.
5521                   '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/include_sanitizer',
5522                 ],
5523               },
5524               'VCLinkerTool': {
5525                 'AdditionalLibraryDirectories': [
5526                   # TODO(hans): If make_clang_dir is absolute, this breaks.
5527                   '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/lib/windows',
5528                 ],
5529               },
5530               'target_conditions': [
5531                 ['component=="shared_library"', {
5532                   'VCLinkerTool': {
5533                     'AdditionalDependencies': [
5534                        'clang_rt.asan_dynamic-i386.lib',
5535                        'clang_rt.asan_uar_thunk-i386.lib',
5536                     ],
5537                   },
5538                 }],
5539                 ['_type=="executable" and component=="static_library"', {
5540                   'VCLinkerTool': {
5541                     'AdditionalDependencies': [
5542                        'clang_rt.asan-i386.lib',
5543                     ],
5544                   },
5545                 }],
5546                 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5547                   'VCLinkerTool': {
5548                     'AdditionalDependencies': [
5549                        'clang_rt.asan_dll_thunk-i386.lib',
5550                     ],
5551                   },
5552                 }],
5553               ],
5554             }],
5555           ],
5556         },
5557       },
5558     }],
5559     ['disable_nacl==1', {
5560       'target_defaults': {
5561         'defines': [
5562           'DISABLE_NACL',
5563         ],
5564       },
5565     }],
5566     ['OS=="win" and msvs_use_common_linker_extras', {
5567       'target_defaults': {
5568         'msvs_settings': {
5569           'VCLinkerTool': {
5570             'DelayLoadDLLs': [
5571               'dbghelp.dll',
5572               'dwmapi.dll',
5573               'shell32.dll',
5574               'uxtheme.dll',
5575             ],
5576           },
5577         },
5578         'configurations': {
5579           'x86_Base': {
5580             'msvs_settings': {
5581               'VCLinkerTool': {
5582                 'AdditionalOptions': [
5583                   '/safeseh',
5584                   '/dynamicbase',
5585                   '/ignore:4199',
5586                   '/ignore:4221',
5587                   '/nxcompat',
5588                 ],
5589                 'conditions': [
5590                   ['syzyasan==0', {
5591                     'AdditionalOptions': ['/largeaddressaware'],
5592                   }],
5593                 ],
5594               },
5595             },
5596           },
5597           'x64_Base': {
5598             'msvs_settings': {
5599               'VCLinkerTool': {
5600                 'AdditionalOptions': [
5601                   # safeseh is not compatible with x64
5602                   '/dynamicbase',
5603                   '/ignore:4199',
5604                   '/ignore:4221',
5605                   '/nxcompat',
5606                 ],
5607               },
5608             },
5609           },
5610         },
5611       },
5612     }],
5613     ['enable_new_npdevice_api==1', {
5614       'target_defaults': {
5615         'defines': [
5616           'ENABLE_NEW_NPDEVICE_API',
5617         ],
5618       },
5619     }],
5620     # Don't warn about the "typedef 'foo' locally defined but not used"
5621     # for gcc 4.8.
5622     # TODO: remove this flag once all builds work. See crbug.com/227506
5623     ['gcc_version>=48 and clang==0', {
5624       'target_defaults': {
5625         'cflags': [
5626           '-Wno-unused-local-typedefs',
5627         ],
5628       },
5629     }],
5630     ['gcc_version>=48 and clang==0 and host_clang==1', {
5631       'target_defaults': {
5632         'target_conditions': [
5633           ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5634         ],
5635       },
5636     }],
5637     # We need a special case to handle the android webview build on mac because
5638     # the host gcc there doesn't accept this flag, but the target gcc may
5639     # require it.
5640     ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5641       'target_defaults': {
5642         'target_conditions': [
5643           ['_toolset=="host"', {
5644             'cflags!': [
5645               '-Wno-unused-local-typedefs',
5646             ],
5647           }],
5648         ],
5649       },
5650     }],
5651     ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5652         'and OS!="win"', {
5653       'make_global_settings': [
5654         ['CC', '<(make_clang_dir)/bin/clang'],
5655         ['CXX', '<(make_clang_dir)/bin/clang++'],
5656         ['CC.host', '$(CC)'],
5657         ['CXX.host', '$(CXX)'],
5658       ],
5659     }],
5660     ['clang==1 and OS=="win"', {
5661       'make_global_settings': [
5662         # On Windows, gyp's ninja generator only looks at CC.
5663         ['CC', '<(make_clang_dir)/bin/clang-cl'],
5664       ],
5665     }],
5666     ['OS=="android" and clang==0', {
5667       # Hardcode the compiler names in the Makefile so that
5668       # it won't depend on the environment at make time.
5669       'make_global_settings': [
5670         ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5671         ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5672         ['CC.host', '<(host_cc)'],
5673         ['CXX.host', '<(host_cxx)'],
5674       ],
5675     }],
5676     ['OS=="linux" and target_arch=="mipsel"', {
5677       'make_global_settings': [
5678         ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5679         ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5680         ['CC.host', '<(host_cc)'],
5681         ['CXX.host', '<(host_cxx)'],
5682       ],
5683     }],
5684     ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5685       # Set default ARM cross compiling on linux.  These can be overridden
5686       # using CC/CXX/etc environment variables.
5687       'make_global_settings': [
5688         ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5689         ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5690         ['CC.host', '<(host_cc)'],
5691         ['CXX.host', '<(host_cxx)'],
5692       ],
5693     }],
5695     # TODO(yyanagisawa): supports GENERATOR==make
5696     #  make generator doesn't support CC_wrapper without CC
5697     #  in make_global_settings yet.
5698     ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5699       'make_global_settings': [
5700        ['CC_wrapper', '<(gomadir)/gomacc'],
5701        ['CXX_wrapper', '<(gomadir)/gomacc'],
5702        ['CC.host_wrapper', '<(gomadir)/gomacc'],
5703        ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5704       ],
5705     }],
5706   ],
5707   'xcode_settings': {
5708     # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5709     # This block adds *project-wide* configuration settings to each project
5710     # file.  It's almost always wrong to put things here.  Specify your
5711     # custom xcode_settings in target_defaults to add them to targets instead.
5713     'conditions': [
5714       # In an Xcode Project Info window, the "Base SDK for All Configurations"
5715       # setting sets the SDK on a project-wide basis. In order to get the
5716       # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5717       # here at the project level.
5718       ['OS=="mac"', {
5719         'conditions': [
5720           ['mac_sdk_path==""', {
5721             'SDKROOT': 'macosx<(mac_sdk)',  # -isysroot
5722           }, {
5723             'SDKROOT': '<(mac_sdk_path)',  # -isysroot
5724           }],
5725         ],
5726       }],
5727       ['OS=="ios"', {
5728         'conditions': [
5729           ['ios_sdk_path==""', {
5730             'conditions': [
5731               # TODO(justincohen): Ninja only supports simulator for now.
5732               ['"<(GENERATOR)"=="xcode"', {
5733                 'SDKROOT': 'iphoneos<(ios_sdk)',  # -isysroot
5734               }, {
5735                 'SDKROOT': 'iphonesimulator<(ios_sdk)',  # -isysroot
5736               }],
5737             ],
5738           }, {
5739             'SDKROOT': '<(ios_sdk_path)',  # -isysroot
5740           }],
5741         ],
5742       }],
5743       ['OS=="ios"', {
5744         # Target both iPhone and iPad.
5745         'TARGETED_DEVICE_FAMILY': '1,2',
5746       }, {  # OS!="ios"
5747         'conditions': [
5748           ['target_arch=="x64"', {
5749             'ARCHS': [
5750               'x86_64'
5751             ],
5752           }],
5753           ['target_arch=="ia32"', {
5754             'ARCHS': [
5755               'i386'
5756             ],
5757           }],
5758         ],
5759       }],
5760     ],
5762     # The Xcode generator will look for an xcode_settings section at the root
5763     # of each dict and use it to apply settings on a file-wide basis.  Most
5764     # settings should not be here, they should be in target-specific
5765     # xcode_settings sections, or better yet, should use non-Xcode-specific
5766     # settings in target dicts.  SYMROOT is a special case, because many other
5767     # Xcode variables depend on it, including variables such as
5768     # PROJECT_DERIVED_FILE_DIR.  When a source group corresponding to something
5769     # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5770     # files to appear (when present) in the UI as actual files and not red
5771     # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5772     # and therefore SYMROOT, needs to be set at the project level.
5773     'SYMROOT': '<(DEPTH)/xcodebuild',
5774   },