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