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