Fixes option-right in textfields when VoiceOver is set to read to the right of the...
[chromium-blink-merge.git] / build / common.gypi
blobb2a7693325d5aeebca6bcfe1d138fed3021ee108
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           # Whether we're building a ChromeOS build.
21           'chromeos%': 0,
23           # Whether we are using Views Toolkit
24           'toolkit_views%': 0,
26           # Whether or not we are using the Aura windowing framework.
27           'use_aura%': 0,
29           # Whether or not we are building the Ash shell.
30           'use_ash%': 0,
32           # Use OpenSSL instead of NSS. Under development: see http://crbug.com/62803
33           'use_openssl%': 0,
35           'use_ibus%': 0,
37           # Disable viewport meta tag by default.
38           'enable_viewport%': 0,
40           # Enable HiDPI support.
41           'enable_hidpi%': 0,
43           # Enable touch optimized art assets and metrics.
44           'enable_touch_ui%': 0,
46           # Is this change part of the android upstream bringup?
47           # Allows us to *temporarily* disable certain things for
48           # staging.  Only set to 1 in a GYP_DEFINES.
49           'android_upstream_bringup%': 0,
51           # Override buildtype to select the desired build flavor.
52           # Dev - everyday build for development/testing
53           # Official - release build (generally implies additional processing)
54           # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
55           # conversion is done), some of the things which are now controlled by
56           # 'branding', such as symbol generation, will need to be refactored
57           # based on 'buildtype' (i.e. we don't care about saving symbols for
58           # non-Official # builds).
59           'buildtype%': 'Dev',
60         },
61         # Copy conditionally-set variables out one scope.
62         'chromeos%': '<(chromeos)',
63         'use_aura%': '<(use_aura)',
64         'use_ash%': '<(use_ash)',
65         'use_openssl%': '<(use_openssl)',
66         'use_ibus%': '<(use_ibus)',
67         'enable_viewport%': '<(enable_viewport)',
68         'enable_hidpi%': '<(enable_hidpi)',
69         'enable_touch_ui%': '<(enable_touch_ui)',
70         'android_upstream_bringup%': '<(android_upstream_bringup)',
71         'buildtype%': '<(buildtype)',
73         # Compute the architecture that we're building on.
74         'conditions': [
75           [ 'OS=="win" or OS=="mac"', {
76             'host_arch%': 'ia32',
77           }, {
78             # This handles the Unix platforms for which there is some support.
79             # Anything else gets passed through, which probably won't work very
80             # well; such hosts should pass an explicit target_arch to gyp.
81             'host_arch%':
82               '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/")',
83           }],
85           # Chromeos implies ash.
86           ['chromeos==1', {
87             'use_ash%': 1,
88             'use_aura%': 1,
89           }],
91           # For now, Windows *AND* Linux builds that |use_aura| should also
92           # imply using ash. This rule should be removed for the future when
93           # both Linux and Windows are using the aura windows without the ash
94           # interface.
95           ['use_aura==1 and OS=="win"', {
96             'use_ash%': 1,
97           }],
98           ['use_ash==1', {
99             'use_aura%': 1,
100           }],
102           # Set default value of toolkit_views based on OS.
103           ['OS=="win" or chromeos==1 or use_aura==1', {
104             'toolkit_views%': 1,
105           }, {
106             'toolkit_views%': 0,
107           }],
109           # Enable HiDPI on Mac OS.
110           ['OS=="mac"', {
111             'enable_hidpi%': 1,
112           }],
114           # Enable touch UI on Metro and Chrome OS.
115           ['OS=="win" or chromeos==1', {
116             'enable_touch_ui%': 1,
117           }],
118         ],
119       },
121       # Copy conditionally-set variables out one scope.
122       'chromeos%': '<(chromeos)',
123       'host_arch%': '<(host_arch)',
124       'toolkit_views%': '<(toolkit_views)',
125       'use_aura%': '<(use_aura)',
126       'use_ash%': '<(use_ash)',
127       'use_openssl%': '<(use_openssl)',
128       'use_ibus%': '<(use_ibus)',
129       'enable_viewport%': '<(enable_viewport)',
130       'enable_hidpi%': '<(enable_hidpi)',
131       'enable_touch_ui%': '<(enable_touch_ui)',
132       'android_upstream_bringup%': '<(android_upstream_bringup)',
134       # We used to provide a variable for changing how libraries were built.
135       # This variable remains until we can clean up all the users.
136       # This needs to be one nested variables dict in so that dependent
137       # gyp files can make use of it in their outer variables.  (Yikes!)
138       # http://code.google.com/p/chromium/issues/detail?id=83308
139       'library%': 'static_library',
141       # Override branding to select the desired branding flavor.
142       'branding%': 'Chromium',
144       'buildtype%': '<(buildtype)',
146       # Default architecture we're building for is the architecture we're
147       # building on.
148       'target_arch%': '<(host_arch)',
150       # This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are
151       # are built under a chromium full build (1) or a webkit.org chromium
152       # build (0).
153       'inside_chromium_build%': 1,
155       # Set to 1 to enable fast builds. It disables debug info for fastest
156       # compilation.
157       'fastbuild%': 0,
159       # Set to 1 to enable dcheck in release without having to use the flag.
160       'dcheck_always_on%': 0,
162       # Disable file manager component extension by default.
163       'file_manager_extension%': 0,
165       # Python version.
166       'python_ver%': '2.6',
168       # Set ARM-v7 compilation flags
169       'armv7%': 0,
171       # Set Neon compilation flags (only meaningful if armv7==1).
172       'arm_neon%': 1,
174       # The system root for cross-compiles. Default: none.
175       'sysroot%': '',
177       # The system libdir used for this ABI.
178       'system_libdir%': 'lib',
180       # On Linux, we build with sse2 for Chromium builds.
181       'disable_sse2%': 0,
183       # Use libjpeg-turbo as the JPEG codec used by Chromium.
184       'use_libjpeg_turbo%': 1,
186       # Variable 'component' is for cases where we would like to build some
187       # components as dynamic shared libraries but still need variable
188       # 'library' for static libraries.
189       # By default, component is set to whatever library is set to and
190       # it can be overriden by the GYP command line or by ~/.gyp/include.gypi.
191       'component%': 'static_library',
193       # Set to select the Title Case versions of strings in GRD files.
194       'use_titlecase_in_grd_files%': 0,
196       # Use translations provided by volunteers at launchpad.net.  This
197       # currently only works on Linux.
198       'use_third_party_translations%': 0,
200       # Remoting compilation is enabled by default. Set to 0 to disable.
201       'remoting%': 1,
203       # Configuration policy is enabled by default. Set to 0 to disable.
204       'configuration_policy%': 1,
206       # Safe browsing is compiled in by default. Set to 0 to disable.
207       'safe_browsing%': 1,
209       # Speech input is compiled in by default. Set to 0 to disable.
210       'input_speech%': 1,
212       # Notifications are compiled in by default. Set to 0 to disable.
213       'notifications%' : 1,
215       # If this is set, the clang plugins used on the buildbot will be used.
216       # Run tools/clang/scripts/update.sh to make sure they are compiled.
217       # This causes 'clang_chrome_plugins_flags' to be set.
218       # Has no effect if 'clang' is not set as well.
219       'clang_use_chrome_plugins%': 1,
221       # Enable building with ASAN (Clang's -faddress-sanitizer option).
222       # -faddress-sanitizer only works with clang, but asan=1 implies clang=1
223       # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
224       'asan%': 0,
226       # Set to true to instrument the code with function call logger.
227       # See src/third_party/cygprofile/cyg-profile.cc for details.
228       'order_profiling%': 0,
230       # Use the provided profiled order file to link Chrome image with it.
231       # This makes Chrome faster by better using CPU cache when executing code.
232       # This is known as PGO (profile guided optimization).
233       # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
234       'order_text_section%' : "",
236       # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
237       # libraries on linux x86-64 and arm, plus ASLR.
238       'linux_fpic%': 1,
240       # Whether one-click signin is enabled or not.
241       'enable_one_click_signin%': 0,
243       # Enable Web Intents support in WebKit.
244       'enable_web_intents%': 1,
246       # Enable Chrome browser extensions
247       'enable_extensions%': 1,
249       # Enable Web Intents web content registration via HTML element
250       # and WebUI managing such registrations.
251       'enable_web_intents_tag%': 0,
253       # Webrtc compilation is enabled by default. Set to 0 to disable.
254       'enable_webrtc%': 1,
256       # PPAPI by default does not support plugins making calls off the main
257       # thread. Set to 1 to turn on experimental support for out-of-process
258       # plugins to make call of the main thread.
259       'enable_pepper_threading%': 0,
261       # Include the PPAPI IPC proxy for NaCl. This is a work-in-progress; this
262       # allows us to build this feature locally without it affecting others
263       # working in affected subsystems like base and ipc.
264       'build_ppapi_ipc_proxy_untrusted%': 0,
266       # Enables use of the session service, which is enabled by default.
267       # Support for disabling depends on the platform.
268       'enable_session_service%': 1,
270       # Enables theme support, which is enabled by default.  Support for
271       # disabling depends on the platform.
272       'enable_themes%': 1,
274       # Enables support for background apps.
275       'enable_background%': 1,
277       # Enable the task manager by default.
278       'enable_task_manager%': 1,
280       # Enables support for promo resource service.
281       'enable_promo_resource_service%': 1,
283       # XInput2 multitouch support is disabled by default (use_xi2_mt=0).
284       # Setting to non-zero value enables XI2 MT. When XI2 MT is enabled,
285       # the input value also defines the required XI2 minor minimum version.
286       # For example, use_xi2_mt=2 means XI2.2 or above version is required.
287       'use_xi2_mt%': 0,
289       # Use of precompiled headers on Windows.
290       #
291       # This is on by default in VS 2010, but off by default for VS
292       # 2008 because of complications that it can cause with our
293       # trybots etc.
294       #
295       # This variable may be explicitly set to 1 (enabled) or 0
296       # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
297       # This setting will override the default.
298       #
299       # Note that a setting of 1 is probably suitable for most or all
300       # Windows developers using VS 2008, since precompiled headers
301       # provide a build speedup of 20-25%.  There are a couple of
302       # small workarounds you may need to use when using VS 2008 (but
303       # not 2010), see
304       # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
305       # for details.
306       'chromium_win_pch%': 0,
308       # Set this to true when building with Clang.
309       # See http://code.google.com/p/chromium/wiki/Clang for details.
310       'clang%': 0,
312       # Enable plug-in installation by default.
313       'enable_plugin_installation%': 1,
315       # Enable protector service by default.
316       'enable_protector_service%': 1,
318       # Specifies whether to use canvas_skia.cc in place of platform
319       # specific implementations of gfx::Canvas. Affects text drawing in the
320       # Chrome UI.
321       # TODO(asvitkine): Enable this on all platforms and delete this flag.
322       #                  http://crbug.com/105550
323       'use_canvas_skia%': 0,
325       # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
326       # with one of those tools.
327       'build_for_tool%': '',
329       # Whether tests targets should be run, archived or just have the
330       # dependencies verified. All the tests targets have the '_run' suffix,
331       # e.g. base_unittests_run runs the target base_unittests. The test target
332       # always calls tools/isolate/isolate.py. See the script's --help for more
333       # information and the valid --mode values. Meant to be overriden with
334       # GYP_DEFINES.
335       # TODO(maruel): Converted the default from 'check' to 'noop' so work can
336       # be done while the builders are being reconfigured to check out test data
337       # files.
338       'test_isolation_mode%': 'noop',
339       # It must not be '<(PRODUCT_DIR)' alone, the '/' is necessary otherwise
340       # gyp will remove duplicate flags, causing isolate.py to be confused.
341       'test_isolation_outdir%': '<(PRODUCT_DIR)/isolate',
343        # Force rlz to use chrome's networking stack.
344       'force_rlz_use_chrome_net%': 1,
346       'platformsdk_path%': '<(DEPTH)/third_party/platformsdk_win7/files',
347       'wix_path%': '<(DEPTH)/third_party/wix',
349       'conditions': [
350         # TODO(epoger): Figure out how to set use_skia=1 for Mac outside of
351         # the 'conditions' clause.  Initial attempts resulted in chromium and
352         # webkit disagreeing on its setting.
353         ['OS=="mac"', {
354           'use_skia%': 1,
355         }, {
356           'use_skia%': 1,
357         }],
359         # A flag for POSIX platforms
360         ['OS=="win"', {
361           'os_posix%': 0,
362         }, {
363           'os_posix%': 1,
364         }],
366         # A flag for BSD platforms
367         ['OS=="freebsd" or OS=="openbsd"', {
368           'os_bsd%': 1,
369         }, {
370           'os_bsd%': 0,
371         }],
373         # NSS usage.
374         ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
375           'use_nss%': 1,
376         }, {
377           'use_nss%': 0,
378         }],
380         # Flags to use X11 on non-Mac POSIX platforms
381         ['OS=="win" or OS=="mac" or OS=="android"', {
382           'use_glib%': 0,
383           'use_x11%': 0,
384         }, {
385           'use_glib%': 1,
386           'use_x11%': 1,
387         }],
389         # Set toolkit_uses_gtk for the Chromium browser on Linux.
390         ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_aura==0', {
391           'toolkit_uses_gtk%': 1,
392         }, {
393           'toolkit_uses_gtk%': 0,
394         }],
396         # We always use skia text rendering in Aura on Windows, since GDI
397         # doesn't agree with our BackingStore.
398         # TODO(beng): remove once skia text rendering is on by default.
399         ['use_aura==1 and OS=="win"', {
400           'enable_skia_text%': 1,
401         }],
403         # A flag to enable or disable our compile-time dependency
404         # on gnome-keyring. If that dependency is disabled, no gnome-keyring
405         # support will be available. This option is useful
406         # for Linux distributions and for Aura.
407         ['chromeos==1 or use_aura==1', {
408           'use_gnome_keyring%': 0,
409         }, {
410           'use_gnome_keyring%': 1,
411         }],
413         ['toolkit_views==0 or OS=="mac"', {
414           # GTK+ and Mac wants Title Case strings
415           'use_titlecase_in_grd_files%': 1,
416         }],
418         # Enable file manager extension on Chrome OS.
419         ['chromeos==1', {
420           'file_manager_extension%': 1,
421         }, {
422           'file_manager_extension%': 0,
423         }],
425         ['OS=="win" or OS=="mac" or (OS=="linux" and use_aura==0)', {   
426           'enable_one_click_signin%': 1,        
427         }],
429         ['OS=="android"', {
430           'proprietary_codecs%': 1,
431           'enable_webrtc%': 0,
432         }],
434         # Use GPU accelerated cross process image transport by default
435         # on linux builds with the Aura window manager
436         ['use_aura==1 and OS=="linux"', {
437           'ui_compositor_image_transport%': 1,
438         }, {
439           'ui_compositor_image_transport%': 0,
440         }],
442         # Turn precompiled headers on by default for VS 2010.
443         ['OS=="win" and MSVS_VERSION=="2010" and buildtype!="Official"', {
444           'chromium_win_pch%': 1
445         }],
447         ['use_aura==1 or chromeos==1 or OS=="android"', {
448           'enable_plugin_installation%': 0,
449         }, {
450           'enable_plugin_installation%': 1,
451         }],
453         ['OS=="android"', {
454           'enable_protector_service%': 0,
455         }, {
456           'enable_protector_service%': 1,
457         }],
459         # linux_use_gold_binary: whether to use the binary checked into
460         # third_party/gold.
461         ['OS=="linux"', {
462           'linux_use_gold_binary%': 1,
463         }, {
464           'linux_use_gold_binary%': 0,
465         }],
467         # linux_use_gold_flags: whether to use build flags that rely on gold.
468         # On by default for x64 Linux.  Temporarily off for ChromeOS as
469         # it failed on a buildbot.
470         ['OS=="linux" and chromeos==0', {
471           'linux_use_gold_flags%': 1,
472         }, {
473           'linux_use_gold_flags%': 0,
474         }],
476         # Enable automation on platforms other than Android.
477         ['OS=="android"', {
478           'enable_automation%': 0,
479         }, {
480           'enable_automation%': 1,
481         }],
483         # Enable Skia UI text drawing incrementally on different platforms.
484         # http://crbug.com/105550
485         #
486         # On Aura, this allows per-tile painting to be used in the browser
487         # compositor.
488         ['OS!="mac" and OS!="android"', {
489           'use_canvas_skia%': 1,
490         }],
491       ],
492     },
494     # Copy conditionally-set variables out one scope.
495     'branding%': '<(branding)',
496     'buildtype%': '<(buildtype)',
497     'target_arch%': '<(target_arch)',
498     'host_arch%': '<(host_arch)',
499     'library%': 'static_library',
500     'toolkit_views%': '<(toolkit_views)',
501     'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
502     'use_aura%': '<(use_aura)',
503     'use_ash%': '<(use_ash)',
504     'use_openssl%': '<(use_openssl)',
505     'use_ibus%': '<(use_ibus)',
506     'use_nss%': '<(use_nss)',
507     'os_bsd%': '<(os_bsd)',
508     'os_posix%': '<(os_posix)',
509     'use_glib%': '<(use_glib)',
510     'toolkit_uses_gtk%': '<(toolkit_uses_gtk)',
511     'use_skia%': '<(use_skia)',
512     'use_x11%': '<(use_x11)',
513     'use_gnome_keyring%': '<(use_gnome_keyring)',
514     'linux_fpic%': '<(linux_fpic)',
515     'enable_pepper_threading%': '<(enable_pepper_threading)',
516     'build_ppapi_ipc_proxy_untrusted%': '<(build_ppapi_ipc_proxy_untrusted)',
517     'chromeos%': '<(chromeos)',
518     'enable_viewport%': '<(enable_viewport)',
519     'enable_hidpi%': '<(enable_hidpi)',
520     'enable_touch_ui%': '<(enable_touch_ui)',
521     'use_xi2_mt%':'<(use_xi2_mt)',
522     'file_manager_extension%': '<(file_manager_extension)',
523     'inside_chromium_build%': '<(inside_chromium_build)',
524     'fastbuild%': '<(fastbuild)',
525     'dcheck_always_on%': '<(dcheck_always_on)',
526     'python_ver%': '<(python_ver)',
527     'armv7%': '<(armv7)',
528     'arm_neon%': '<(arm_neon)',
529     'sysroot%': '<(sysroot)',
530     'system_libdir%': '<(system_libdir)',
531     'disable_sse2%': '<(disable_sse2)',
532     'component%': '<(component)',
533     'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
534     'use_third_party_translations%': '<(use_third_party_translations)',
535     'remoting%': '<(remoting)',
536     'enable_one_click_signin%': '<(enable_one_click_signin)',
537     'enable_webrtc%': '<(enable_webrtc)',
538     'chromium_win_pch%': '<(chromium_win_pch)',
539     'configuration_policy%': '<(configuration_policy)',
540     'safe_browsing%': '<(safe_browsing)',
541     'input_speech%': '<(input_speech)',
542     'notifications%': '<(notifications)',
543     'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
544     'asan%': '<(asan)',
545     'order_profiling%': '<(order_profiling)',
546     'order_text_section%': '<(order_text_section)',
547     'enable_extensions%': '<(enable_extensions)',
548     'enable_web_intents%': '<(enable_web_intents)',
549     'enable_web_intents_tag%': '<(enable_web_intents_tag)',
550     'enable_plugin_installation%': '<(enable_plugin_installation)',
551     'enable_protector_service%': '<(enable_protector_service)',
552     'enable_session_service%': '<(enable_session_service)',
553     'enable_themes%': '<(enable_themes)',
554     'enable_background%': '<(enable_background)',
555     'enable_promo_resource_service%': '<(enable_promo_resource_service)',
556     'linux_use_gold_binary%': '<(linux_use_gold_binary)',
557     'linux_use_gold_flags%': '<(linux_use_gold_flags)',
558     'use_canvas_skia%': '<(use_canvas_skia)',
559     'test_isolation_mode%': '<(test_isolation_mode)',
560     'test_isolation_outdir%': '<(test_isolation_outdir)',
561     'enable_automation%': '<(enable_automation)',
562     'force_rlz_use_chrome_net%': '<(force_rlz_use_chrome_net)',
563     'enable_task_manager%': '<(enable_task_manager)',
564     'platformsdk_path%': '<(platformsdk_path)',
565     'wix_path%': '<(wix_path)',
566     'android_upstream_bringup%': '<(android_upstream_bringup)',
568     # Use system yasm instead of bundled one.
569     'use_system_yasm%': 0,
571     # Default to enabled PIE; this is important for ASLR but we may need to be
572     # able to turn it off for various reasons.
573     'linux_disable_pie%': 0,
575     # The release channel that this build targets. This is used to restrict
576     # channel-specific build options, like which installer packages to create.
577     # The default is 'all', which does no channel-specific filtering.
578     'channel%': 'all',
580     # Override chromium_mac_pch and set it to 0 to suppress the use of
581     # precompiled headers on the Mac.  Prefix header injection may still be
582     # used, but prefix headers will not be precompiled.  This is useful when
583     # using distcc to distribute a build to compile slaves that don't
584     # share the same compiler executable as the system driving the compilation,
585     # because precompiled headers rely on pointers into a specific compiler
586     # executable's image.  Setting this to 0 is needed to use an experimental
587     # Linux-Mac cross compiler distcc farm.
588     'chromium_mac_pch%': 1,
590     # Mac OS X SDK and deployment target support.
591     # The SDK identifies the version of the system headers that will be used,
592     # and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro.
593     # "Maximum allowed" refers to the operating system version whose APIs are
594     # available in the headers.
595     # The deployment target identifies the minimum system version that the
596     # built products are expected to function on.  It corresponds to the
597     # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.
598     # To ensure these macros are available, #include <AvailabilityMacros.h>.
599     # Additional documentation on these macros is available at
600     # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
601     # Chrome normally builds with the Mac OS X 10.5 SDK and sets the
602     # deployment target to 10.5.  Other projects, such as O3D, may override
603     # these defaults.
604     'mac_sdk%': '10.5',
605     'mac_deployment_target%': '10.5',
607     # The default value for mac_strip in target_defaults. This cannot be
608     # set there, per the comment about variable% in a target_defaults.
609     'mac_strip_release%': 1,
611     # Set to 1 to enable code coverage.  In addition to build changes
612     # (e.g. extra CFLAGS), also creates a new target in the src/chrome
613     # project file called "coverage".
614     # Currently ignored on Windows.
615     'coverage%': 0,
617     # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
618     # This is useful for parallel compilation tools which can't support /Zi.
619     # Only used on Windows.
620     'win_z7%' : 0,
622     # Although base/allocator lets you select a heap library via an
623     # environment variable, the libcmt shim it uses sometimes gets in
624     # the way.  To disable it entirely, and switch to normal msvcrt, do e.g.
625     #  'win_use_allocator_shim': 0,
626     #  'win_release_RuntimeLibrary': 2
627     # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
628     'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
630     # Whether usage of OpenMAX is enabled.
631     'enable_openmax%': 0,
633     # Whether proprietary audio/video codecs are assumed to be included with
634     # this build (only meaningful if branding!=Chrome).
635     'proprietary_codecs%': 0,
637     # TODO(bradnelson): eliminate this when possible.
638     # To allow local gyp files to prevent release.vsprops from being included.
639     # Yes(1) means include release.vsprops.
640     # Once all vsprops settings are migrated into gyp, this can go away.
641     'msvs_use_common_release%': 1,
643     # TODO(bradnelson): eliminate this when possible.
644     # To allow local gyp files to override additional linker options for msvs.
645     # Yes(1) means set use the common linker options.
646     'msvs_use_common_linker_extras%': 1,
648     # TODO(sgk): eliminate this if possible.
649     # It would be nicer to support this via a setting in 'target_defaults'
650     # in chrome/app/locales/locales.gypi overriding the setting in the
651     # 'Debug' configuration in the 'target_defaults' dict below,
652     # but that doesn't work as we'd like.
653     'msvs_debug_link_incremental%': '2',
655     # Needed for some of the largest modules.
656     'msvs_debug_link_nonincremental%': '1',
658     # Turn on Use Library Dependency Inputs for linking chrome.dll on Windows
659     # to get incremental linking to be faster in debug builds.
660     'incremental_chrome_dll%': '<!(python <(DEPTH)/tools/win/supalink/check_installed.py)',
662     # This is the location of the sandbox binary. Chrome looks for this before
663     # running the zygote process. If found, and SUID, it will be used to
664     # sandbox the zygote process and, thus, all renderer processes.
665     'linux_sandbox_path%': '',
667     # Set this to true to enable SELinux support.
668     'selinux%': 0,
670     # Clang stuff.
671     'clang%': '<(clang)',
672     'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
674     # These two variables can be set in GYP_DEFINES while running
675     # |gclient runhooks| to let clang run a plugin in every compilation.
676     # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
677     # Example:
678     #     GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
680     'clang_load%': '',
681     'clang_add_plugin%': '',
683     # The default type of gtest.
684     'gtest_target_type%': 'executable',
686     # Enable sampling based profiler.
687     # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
688     'profiling%': '0',
690     # Enable strict glibc debug mode.
691     'glibcxx_debug%': 0,
693     # Override whether we should use Breakpad on Linux. I.e. for Chrome bot.
694     'linux_breakpad%': 0,
695     # And if we want to dump symbols for Breakpad-enabled builds.
696     'linux_dump_symbols%': 0,
697     # And if we want to strip the binary after dumping symbols.
698     'linux_strip_binary%': 0,
699     # Strip the test binaries needed for Linux reliability tests.
700     'linux_strip_reliability_tests%': 0,
702     # Enable TCMalloc.
703     'linux_use_tcmalloc%': 1,
705     # Disable TCMalloc's debugallocation.
706     'linux_use_debugallocation%': 0,
708     # Disable TCMalloc's heapchecker.
709     'linux_use_heapchecker%': 0,
711     # Disable shadow stack keeping used by heapcheck to unwind the stacks
712     # better.
713     'linux_keep_shadow_stacks%': 0,
715     # Set to 1 to link against libgnome-keyring instead of using dlopen().
716     'linux_link_gnome_keyring%': 0,
717     # Set to 1 to link against gsettings APIs instead of using dlopen().
718     'linux_link_gsettings%': 0,
720     # Set Thumb compilation flags.
721     'arm_thumb%': 0,
723     # Set ARM fpu compilation flags (only meaningful if armv7==1 and
724     # arm_neon==0).
725     'arm_fpu%': 'vfpv3',
727     # Set ARM float abi compilation flag.
728     'arm_float_abi%': 'softfp',
730     # Enable new NPDevice API.
731     'enable_new_npdevice_api%': 0,
733     # Enable EGLImage support in OpenMAX
734     'enable_eglimage%': 1,
736     # Enable a variable used elsewhere throughout the GYP files to determine
737     # whether to compile in the sources for the GPU plugin / process.
738     'enable_gpu%': 1,
740     # .gyp files or targets should set chromium_code to 1 if they build
741     # Chromium-specific code, as opposed to external code.  This variable is
742     # used to control such things as the set of warnings to enable, and
743     # whether warnings are treated as errors.
744     'chromium_code%': 0,
746     'release_valgrind_build%': 0,
748     # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
749     'enable_wexit_time_destructors%': 0,
751     # Set to 1 to compile with the built in pdf viewer.
752     'internal_pdf%': 0,
754     # This allows to use libcros from the current system, ie. /usr/lib/
755     # The cros_api will be pulled in as a static library, and all headers
756     # from the system include dirs.
757     'system_libcros%': 0,
759     # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
760     # so Cocoa is happy (http://crbug.com/20441).
761     'locales': [
762       'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
763       'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
764       'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
765       'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
766       'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
767       'vi', 'zh-CN', 'zh-TW',
768     ],
770     # Pseudo locales are special locales which are used for testing and
771     # debugging. They don't get copied to the final app. For more info,
772     # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
773     'pseudo_locales': [
774       'fake-bidi',
775     ],
777     'grit_defines': [],
779     # If debug_devtools is set to 1, JavaScript files for DevTools are
780     # stored as is and loaded from disk. Otherwise, a concatenated file
781     # is stored in resources.pak. It is still possible to load JS files
782     # from disk by passing --debug-devtools cmdline switch.
783     'debug_devtools%': 0,
785     # The Java Bridge is not compiled in by default.
786     'java_bridge%': 0,
788     # This flag is only used when disable_nacl==0 and disables all those
789     # subcomponents which would require the installation of a native_client
790     # untrusted toolchain.
791     'disable_nacl_untrusted%': 0,
793     # Disable Dart by default.
794     'enable_dart%': 0,
796     # The desired version of Windows SDK can be set in ~/.gyp/include.gypi.
797     'msbuild_toolset%': '',
799     # Native Client is enabled by default.
800     'disable_nacl%': 0,
802     'platformsdk_exists': '<!(python <(DEPTH)/build/dir_exists.py <(platformsdk_path))',
803     'wix_exists': '<!(python <(DEPTH)/build/dir_exists.py <(wix_path))',
805     'conditions': [
806       ['os_posix==1 and OS!="mac" and OS!="android"', {
807         # This will set gcc_version to XY if you are running gcc X.Y.*.
808         # This is used to tweak build flags for gcc 4.4.
809         'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
810         # Figure out the python architecture to decide if we build pyauto.
811         'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/<(system_libdir)/libpython<(python_ver).so.1.0)',
812         'conditions': [
813           ['branding=="Chrome"', {
814             'linux_breakpad%': 1,
815           }],
816           # All Chrome builds have breakpad symbols, but only process the
817           # symbols from official builds.
818           ['(branding=="Chrome" and buildtype=="Official")', {
819             'linux_dump_symbols%': 1,
820           }],
821         ],
822       }],  # os_posix==1 and OS!="mac" and OS!="android"
823       ['OS=="android"', {
824         # Location of Android NDK.
825         'variables': {
826           'variables': {
827             'android_ndk_root%': '<!(/bin/echo -n $ANDROID_NDK_ROOT)',
828             # Android uses x86 instead of ia32 for their target_arch
829             # designation.
830             # TODO(wistoch): Adjust the target_arch naming scheme to avoid
831             # confusion.
832             # http://crbug.com/125329
833             'conditions': [
834               ['target_arch == "ia32"', {
835                 'target_arch': 'x86',
836                 'android_app_abi%': 'x86',
837               }],
838               ['target_arch=="arm" and armv7==0', {
839                 'android_app_abi%': 'armeabi',
840               }],
841               ['target_arch=="arm" and armv7==1', {
842                 'android_app_abi%': 'armeabi-v7a',
843               }],
844             ],
846             # Switch between different build types, currently only '0' is
847             # supported.
848             'android_build_type%': 0,
849           },
850           'android_ndk_root%': '<(android_ndk_root)',
851           'android_ndk_sysroot': '<(android_ndk_root)/platforms/android-9/arch-<(target_arch)',
852           'android_build_type%': '<(android_build_type)',
853           'android_app_abi%': '<(android_app_abi)',
854         },
855         'android_ndk_root%': '<(android_ndk_root)',
856         'android_ndk_sysroot': '<(android_ndk_sysroot)',
857         'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
858         'android_ndk_lib': '<(android_ndk_sysroot)/usr/lib',
859         'android_app_abi%': '<(android_app_abi)',
861         # Provides an absolute path to PRODUCT_DIR (e.g. out/Release). Used
862         # to specify the output directory for Ant in the Android build.
863         'ant_build_out': '`cd <(PRODUCT_DIR) && pwd -P`',
865         # Uses Android's crash report system
866         'linux_breakpad%': 0,
868         # Always uses openssl.
869         'use_openssl%': 1,
871         'proprietary_codecs%': '<(proprietary_codecs)',
872         'enable_task_manager%': 0,
873         'safe_browsing%': 0,
874         'configuration_policy%': 0,
875         'input_speech%': 0,
876         'enable_web_intents%': 0,
877         'enable_extensions%': 0,
878         'java_bridge%': 1,
879         # Android does not support themes.
880         'enable_themes%': 0,
882         # Android does not support background apps.
883         'enable_background%': 0,
885         # Android does not support promo resources service.
886         'enable_promo_resource_service%': 0,
888         # Sessions are store separately in the Java side.
889         'enable_session_service%': 0,
891         # Set to 1 once we have a notification system for Android.
892         # http://crbug.com/115320
893         'notifications%': 0,
895         'gtest_target_type%': '<(gtest_target_type)',
896         # TODO(jrg): when 'gtest_target_type'=='shared_library' and
897         # OS==android, make all gtest_targets depend on
898         # testing/android/native_test.gyp:native_test_apk.
899         ### 'gtest_target_type': 'shared_libary',
901         # Uses system APIs for decoding audio and video.
902         'use_libffmpeg%': '0',
904         # Always use the chromium skia. The use_system_harfbuzz needs to
905         # match use_system_skia.
906         'use_system_skia%': '0',
907         'use_system_harfbuzz%': '0',
909         # Use the system icu.
910         'use_system_icu%': 0,
912         # TODO(yfriedman): Remove once unit_tests can link for Android.
913         # To override it specify:
914         # GYP_DEFINES="$GYP_DEFINES android_unit_test_target_type=executable"
915         #     android_gyp
916         'android_unit_test_target_type%': 'static_library',
918         # Choose static link by build type.
919         'conditions': [
920           ['android_build_type==0', {
921             'static_link_system_icu%': 1,
922           }, {
923             'static_link_system_icu%': 0,
924           }],
925         ],
926         # Enable to use system sqlite.
927         'use_system_sqlite%': '<(android_build_type)',
928         # Enable to use system libjpeg.
929         'use_system_libjpeg%': '<(android_build_type)',
930         # Enable to use the system libexpat.
931         'use_system_libexpat%': '<(android_build_type)',
932         # Enable to use the system stlport, otherwise statically
933         # link the NDK one?
934         'use_system_stlport%': '<(android_build_type)',
935         # Copy it out one scope.
936         'android_build_type%': '<(android_build_type)',
937       }],  # OS=="android"
938       ['OS=="mac"', {
939         # Enable clang on mac by default!
940         'clang%': 1,
941         # Compile in Breakpad support by default so that it can be
942         # tested, even if it is not enabled by default at runtime.
943         'mac_breakpad_compiled_in%': 1,
944         'conditions': [
945           # mac_product_name is set to the name of the .app bundle as it should
946           # appear on disk.  This duplicates data from
947           # chrome/app/theme/chromium/BRANDING and
948           # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
949           # these names into the build system.
950           ['branding=="Chrome"', {
951             'mac_product_name%': 'Google Chrome',
952           }, { # else: branding!="Chrome"
953             'mac_product_name%': 'Chromium',
954           }],
956           ['branding=="Chrome" and buildtype=="Official"', {
957             # Enable uploading crash dumps.
958             'mac_breakpad_uploads%': 1,
959             # Enable dumping symbols at build time for use by Mac Breakpad.
960             'mac_breakpad%': 1,
961             # Enable Keystone auto-update support.
962             'mac_keystone%': 1,
963           }, { # else: branding!="Chrome" or buildtype!="Official"
964             'mac_breakpad_uploads%': 0,
965             'mac_breakpad%': 0,
966             'mac_keystone%': 0,
967           }],
968         ],
969       }],  # OS=="mac"
971       ['OS=="win"', {
972         'conditions': [
973           ['component=="shared_library"', {
974             'win_use_allocator_shim%': 0,
975           }],
976           # Whether to use multiple cores to compile with visual studio. This is
977           # optional because it sometimes causes corruption on VS 2005.
978           # It is on by default on VS 2008 and off on VS 2005.
979           ['MSVS_VERSION=="2005"', {
980             'msvs_multi_core_compile%': 0,
981           },{
982             'msvs_multi_core_compile%': 1,
983           }],
984           # Don't do incremental linking for large modules on 32-bit.
985           ['MSVS_OS_BITS==32', {
986             'msvs_large_module_debug_link_mode%': '1',  # No
987           },{
988             'msvs_large_module_debug_link_mode%': '2',  # Yes
989           }],
990           ['MSVS_VERSION=="2010e" or MSVS_VERSION=="2008e" or MSVS_VERSION=="2005e"', {
991             'msvs_express%': 1,
992             'secure_atl%': 0,
993           },{
994             'msvs_express%': 0,
995             'secure_atl%': 1,
996           }],
997         ],
998         'nacl_win64_defines': [
999           # This flag is used to minimize dependencies when building
1000           # Native Client loader for 64-bit Windows.
1001           'NACL_WIN64',
1002         ],
1003       }],
1005       ['os_posix==1 and chromeos==0 and OS!="android"', {
1006         'use_cups%': 1,
1007       }, {
1008         'use_cups%': 0,
1009       }],
1011       # Set the relative path from this file to the GYP file of the JPEG
1012       # library used by Chromium.
1013       ['use_libjpeg_turbo==1', {
1014         'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1015       }, {
1016         'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1017       }],  # use_libjpeg_turbo==1
1019       # Options controlling the use of GConf (the classic GNOME configuration
1020       # system) and GIO, which contains GSettings (the new GNOME config system).
1021       ['chromeos==1', {
1022         'use_gconf%': 0,
1023         'use_gio%': 0,
1024       }, {
1025         'use_gconf%': 1,
1026         'use_gio%': 1,
1027       }],
1029       # Set up -D and -E flags passed into grit.
1030       ['branding=="Chrome"', {
1031         # TODO(mmoss) The .grd files look for _google_chrome, but for
1032         # consistency they should look for google_chrome_build like C++.
1033         'grit_defines': ['-D', '_google_chrome',
1034                          '-E', 'CHROMIUM_BUILD=google_chrome'],
1035       }, {
1036         'grit_defines': ['-D', '_chromium',
1037                          '-E', 'CHROMIUM_BUILD=chromium'],
1038       }],
1039       ['chromeos==1', {
1040         'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
1041       }],
1042       ['toolkit_views==1', {
1043         'grit_defines': ['-D', 'toolkit_views'],
1044       }],
1045       ['use_aura==1', {
1046         'grit_defines': ['-D', 'use_aura'],
1047       }],
1048       ['use_ash==1', {
1049         'grit_defines': ['-D', 'use_ash'],
1050       }],
1051       ['use_nss==1', {
1052         'grit_defines': ['-D', 'use_nss'],
1053       }],
1054       ['file_manager_extension==1', {
1055         'grit_defines': ['-D', 'file_manager_extension'],
1056       }],
1057       ['remoting==1', {
1058         'grit_defines': ['-D', 'remoting'],
1059       }],
1060       ['use_titlecase_in_grd_files==1', {
1061         'grit_defines': ['-D', 'use_titlecase'],
1062       }],
1063       ['use_third_party_translations==1', {
1064         'grit_defines': ['-D', 'use_third_party_translations'],
1065         'locales': [
1066           'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
1067           'ka', 'ku', 'kw', 'ms', 'ug'
1068         ],
1069       }],
1070       ['OS=="android"', {
1071         'grit_defines': ['-D', 'android'],
1072       }],
1073       ['enable_extensions==1', {
1074         'grit_defines': ['-D', 'enable_extensions'],
1075       }],
1076       ['clang_use_chrome_plugins==1 and OS!="win"', {
1077         'variables': {
1078           'clang_chrome_plugins_flags': [
1079             '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
1080           ],
1081         },
1082         'conditions': [
1083           ['chromeos==1', {
1084             # TODO(rsleevi): http://crbug.com/123295 - Disabled on ChromeOS
1085             # for now.
1086             'clang_chrome_plugins_flags': [
1087               '<@(clang_chrome_plugins_flags)',
1088               '-Xclang',
1089               '-plugin-arg-find-bad-constructs',
1090               '-Xclang',
1091               'skip-refcounted-dtors'
1092             ],
1093           }, {
1094             'clang_chrome_plugins_flags': [
1095               '<@(clang_chrome_plugins_flags)',
1096             ],
1097           }],
1098         ],
1099       }],
1101       ['enable_web_intents_tag==1', {
1102         'grit_defines': ['-D', 'enable_web_intents_tag'],
1103       }],
1105       ['asan==1', {
1106         'clang%': 1,
1107         # Do not use Chrome plugins for Clang. The Clang version in
1108         # third_party/asan may be different from the default one.
1109         'clang_use_chrome_plugins%': 0,
1110       }],
1112       # On valgrind bots, override the optimizer settings so we don't inline too
1113       # much and make the stacks harder to figure out.
1114       #
1115       # TODO(rnk): Kill off variables that no one else uses and just implement
1116       # them under a build_for_tool== condition.
1117       ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
1118         # gcc flags
1119         'mac_debug_optimization': '1',
1120         'mac_release_optimization': '1',
1121         'release_optimize': '1',
1122         'no_gc_sections': 1,
1123         'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
1124                               '-fno-builtin -fno-optimize-sibling-calls',
1125         'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
1126                                 '-fno-builtin -fno-optimize-sibling-calls',
1128         # MSVS flags for TSan on Pin and Windows.
1129         'win_debug_RuntimeChecks': '0',
1130         'win_debug_disable_iterator_debugging': '1',
1131         'win_debug_Optimization': '1',
1132         'win_debug_InlineFunctionExpansion': '0',
1133         'win_release_InlineFunctionExpansion': '0',
1134         'win_release_OmitFramePointers': '0',
1136         'linux_use_tcmalloc': 1,
1137         'release_valgrind_build': 1,
1138         'werror': '',
1139         'component': 'static_library',
1140         'use_system_zlib': 0,
1141       }],
1143       # Build tweaks for DrMemory.
1144       # TODO(rnk): Combine with tsan config to share the builder.
1145       # http://crbug.com/108155
1146       ['build_for_tool=="drmemory"', {
1147         # DrMemory can't handle the debug CRT dll, so build static.
1148         'component': 'static_library',
1149         # These runtime checks force initialization of stack vars which blocks
1150         # DrMemory's uninit detection.
1151         'win_debug_RuntimeChecks': '0',
1152         # Iterator debugging is slow.
1153         'win_debug_disable_iterator_debugging': '1',
1154         # Try to disable optimizations that mess up stacks in a release build.
1155         'win_release_InlineFunctionExpansion': '0',
1156         'win_release_OmitFramePointers': '0',
1157         # Keep the code under #ifndef NVALGRIND.
1158         'release_valgrind_build': 1,
1159       }],
1160     ],
1162     # List of default apps to install in new profiles.  The first list contains
1163     # the source files as found in svn.  The second list, used only for linux,
1164     # contains the destination location for each of the files.  When a crx
1165     # is added or removed from the list, the chrome/browser/resources/
1166     # default_apps/external_extensions.json file must also be updated.
1167     'default_apps_list': [
1168       'browser/resources/default_apps/external_extensions.json',
1169       'browser/resources/default_apps/gmail.crx',
1170       'browser/resources/default_apps/search.crx',
1171       'browser/resources/default_apps/youtube.crx',
1172     ],
1173     'default_apps_list_linux_dest': [
1174       '<(PRODUCT_DIR)/default_apps/external_extensions.json',
1175       '<(PRODUCT_DIR)/default_apps/gmail.crx',
1176       '<(PRODUCT_DIR)/default_apps/search.crx',
1177       '<(PRODUCT_DIR)/default_apps/youtube.crx',
1178     ],
1179   },
1180   'target_defaults': {
1181     'variables': {
1182       # The condition that operates on chromium_code is in a target_conditions
1183       # section, and will not have access to the default fallback value of
1184       # chromium_code at the top of this file, or to the chromium_code
1185       # variable placed at the root variables scope of .gyp files, because
1186       # those variables are not set at target scope.  As a workaround,
1187       # if chromium_code is not set at target scope, define it in target scope
1188       # to contain whatever value it has during early variable expansion.
1189       # That's enough to make it available during target conditional
1190       # processing.
1191       'chromium_code%': '<(chromium_code)',
1193       # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
1194       'mac_release_optimization%': '3', # Use -O3 unless overridden
1195       'mac_debug_optimization%': '0',   # Use -O0 unless overridden
1197       # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
1198       'win_release_Optimization%': '2', # 2 = /Os
1199       'win_debug_Optimization%': '0',   # 0 = /Od
1201       # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
1202       # Tri-state: blank is default, 1 on, 0 off
1203       'win_release_OmitFramePointers%': '0',
1204       # Tri-state: blank is default, 1 on, 0 off
1205       'win_debug_OmitFramePointers%': '',
1207       # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
1208       'win_debug_RuntimeChecks%': '3',    # 3 = all checks enabled, 0 = off
1210       # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
1211       'win_debug_InlineFunctionExpansion%': '',    # empty = default, 0 = off,
1212       'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
1214       # VS inserts quite a lot of extra checks to algorithms like
1215       # std::partial_sort in Debug build which make them O(N^2)
1216       # instead of O(N*logN). This is particularly slow under memory
1217       # tools like ThreadSanitizer so we want it to be disablable.
1218       # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
1219       'win_debug_disable_iterator_debugging%': '0',
1221       'release_extra_cflags%': '',
1222       'debug_extra_cflags%': '',
1224       'release_valgrind_build%': '<(release_valgrind_build)',
1226       # the non-qualified versions are widely assumed to be *nix-only
1227       'win_release_extra_cflags%': '',
1228       'win_debug_extra_cflags%': '',
1230       # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1231       'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
1233       # Only used by Windows build for now.  Can be used to build into a
1234       # differet output directory, e.g., a build_dir_prefix of VS2010_ would
1235       # output files in src/build/VS2010_{Debug,Release}.
1236       'build_dir_prefix%': '',
1238       'conditions': [
1239         ['OS=="win" and component=="shared_library"', {
1240           # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
1241           'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
1242           'win_debug_RuntimeLibrary%': '3',   # 3 = /MDd (debug DLL)
1243         }, {
1244           # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
1245           'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
1246           'win_debug_RuntimeLibrary%': '1',   # 1 = /MTd (debug static)
1247         }],
1248       ],
1249     },
1250     'conditions': [
1251       ['OS=="win" and "<(msbuild_toolset)"!=""', {
1252         'msbuild_toolset': '<(msbuild_toolset)',
1253       }],
1254       ['branding=="Chrome"', {
1255         'defines': ['GOOGLE_CHROME_BUILD'],
1256       }, {  # else: branding!="Chrome"
1257         'defines': ['CHROMIUM_BUILD'],
1258       }],
1259       ['OS=="mac" and component=="shared_library"', {
1260         'xcode_settings': {
1261           'DYLIB_INSTALL_NAME_BASE': '@rpath',
1262           'LD_RUNPATH_SEARCH_PATHS': [
1263             # For unbundled binaries.
1264             '@loader_path/.',
1265             # For bundled binaries, to get back from Binary.app/Contents/MacOS.
1266             '@loader_path/../../..',
1267           ],
1268         },
1269       }],
1270       ['branding=="Chrome" and (OS=="win" or OS=="mac")', {
1271         'defines': ['ENABLE_RLZ'],
1272       }],
1273       ['component=="shared_library"', {
1274         'defines': ['COMPONENT_BUILD'],
1275       }],
1276       ['toolkit_views==1', {
1277         'defines': ['TOOLKIT_VIEWS=1'],
1278       }],
1279       ['ui_compositor_image_transport==1', {
1280         'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
1281       }],
1282       ['use_aura==1', {
1283         'defines': ['USE_AURA=1'],
1284       }],
1285       ['use_ash==1', {
1286         'defines': ['USE_ASH=1'],
1287       }],
1288       ['use_nss==1', {
1289         'defines': ['USE_NSS=1'],
1290       }],
1291       ['enable_one_click_signin==1', {
1292         'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
1293       }],
1294       ['toolkit_uses_gtk==1 and toolkit_views==0', {
1295         # TODO(erg): We are progressively sealing up use of deprecated features
1296         # in gtk in preparation for an eventual porting to gtk3.
1297         'defines': ['GTK_DISABLE_SINGLE_INCLUDES=1'],
1298       }],
1299       ['chromeos==1', {
1300         'defines': ['OS_CHROMEOS=1'],
1301       }],
1302       ['use_xi2_mt!=0', {
1303         'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
1304       }],
1305       ['file_manager_extension==1', {
1306         'defines': ['FILE_MANAGER_EXTENSION=1'],
1307       }],
1308       ['profiling==1', {
1309         'defines': ['ENABLE_PROFILING=1'],
1310       }],
1311       ['OS=="linux" and glibcxx_debug==1', {
1312         'defines': ['_GLIBCXX_DEBUG=1',],
1313         'cflags_cc!': ['-fno-rtti'],
1314         'cflags_cc+': ['-frtti', '-g'],
1315       }],
1316       ['remoting==1', {
1317         'defines': ['ENABLE_REMOTING=1'],
1318       }],
1319       ['enable_webrtc==1', {
1320         'defines': ['ENABLE_WEBRTC=1'],
1321       }],
1322       ['proprietary_codecs==1', {
1323         'defines': ['USE_PROPRIETARY_CODECS'],
1324       }],
1325       ['enable_pepper_threading==1', {
1326         'defines': ['ENABLE_PEPPER_THREADING'],
1327       }],
1328       ['enable_viewport==1', {
1329         'defines': ['ENABLE_VIEWPORT'],
1330       }],
1331       ['configuration_policy==1', {
1332         'defines': ['ENABLE_CONFIGURATION_POLICY'],
1333       }],
1334       ['input_speech==1', {
1335         'defines': ['ENABLE_INPUT_SPEECH'],
1336       }],
1337       ['notifications==1', {
1338         'defines': ['ENABLE_NOTIFICATIONS'],
1339       }],
1340       ['enable_hidpi==1', {
1341         'defines': ['ENABLE_HIDPI=1'],
1342       }],
1343       ['OS=="android" and gtest_target_type=="shared_library"', {
1344         'defines': ['ANDROID_APK_TEST_TARGET=1'],
1345       }],
1346       ['fastbuild!=0', {
1348         'conditions': [
1349           # For Windows and Mac, we don't genererate debug information.
1350           ['OS=="win" or OS=="mac"', {
1351             'msvs_settings': {
1352               'VCLinkerTool': {
1353                 'GenerateDebugInformation': 'false',
1354               },
1355               'VCCLCompilerTool': {
1356                 'DebugInformationFormat': '0',
1357               }
1358             },
1359             'xcode_settings': {
1360               'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
1361             },
1362           }, { # else: OS != "win", generate less debug information.
1363             'variables': {
1364               'debug_extra_cflags': '-g1',
1365             },
1366           }],
1367           # Clang creates chubby debug information, which makes linking very
1368           # slow. For now, don't create debug information with clang.  See
1369           # http://crbug.com/70000
1370           ['OS=="linux" and clang==1', {
1371             'variables': {
1372               'debug_extra_cflags': '-g0',
1373             },
1374           }],
1375         ],  # conditions for fastbuild.
1376       }],  # fastbuild!=0
1377       ['dcheck_always_on!=0', {
1378         'defines': ['DCHECK_ALWAYS_ON=1'],
1379       }],  # dcheck_always_on!=0
1380       ['selinux==1', {
1381         'defines': ['CHROMIUM_SELINUX=1'],
1382       }],
1383       ['win_use_allocator_shim==0', {
1384         'conditions': [
1385           ['OS=="win"', {
1386             'defines': ['NO_TCMALLOC'],
1387           }],
1388         ],
1389       }],
1390       ['enable_gpu==1', {
1391         'defines': [
1392           'ENABLE_GPU=1',
1393         ],
1394       }],
1395       ['use_openssl==1', {
1396         'defines': [
1397           'USE_OPENSSL=1',
1398         ],
1399       }],
1400       ['enable_eglimage==1', {
1401         'defines': [
1402           'ENABLE_EGLIMAGE=1',
1403         ],
1404       }],
1405       ['use_skia==1', {
1406         'defines': [
1407           'USE_SKIA=1',
1408         ],
1409       }],
1410       ['coverage!=0', {
1411         'conditions': [
1412           ['OS=="mac"', {
1413             'xcode_settings': {
1414               'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES',  # -fprofile-arcs
1415               'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES',  # -ftest-coverage
1416             },
1417             # Add -lgcov for types executable, shared_library, and
1418             # loadable_module; not for static_library.
1419             # This is a delayed conditional.
1420             'target_conditions': [
1421               ['_type!="static_library"', {
1422                 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
1423               }],
1424             ],
1425           }],
1426           ['OS=="linux" or OS=="android"', {
1427             'cflags': [ '-ftest-coverage',
1428                         '-fprofile-arcs' ],
1429             'link_settings': { 'libraries': [ '-lgcov' ] },
1430           }],
1431           # Finally, for Windows, we simply turn on profiling.
1432           ['OS=="win"', {
1433             'msvs_settings': {
1434               'VCLinkerTool': {
1435                 'Profile': 'true',
1436               },
1437               'VCCLCompilerTool': {
1438                 # /Z7, not /Zi, so coverage is happyb
1439                 'DebugInformationFormat': '1',
1440                 'AdditionalOptions': ['/Yd'],
1441               }
1442             }
1443          }],  # OS==win
1444         ],  # conditions for coverage
1445       }],  # coverage!=0
1446       ['OS=="win"', {
1447         'defines': [
1448           '__STD_C',
1449           '_CRT_SECURE_NO_DEPRECATE',
1450           '_SCL_SECURE_NO_DEPRECATE',
1451         ],
1452         'include_dirs': [
1453           '<(DEPTH)/third_party/wtl/include',
1454         ],
1455         'conditions': [
1456           ['win_z7!=0', {
1457             'msvs_settings': {
1458               'VCCLCompilerTool': {
1459                 'DebugInformationFormat': '1',
1460               }
1461             }
1462           }],
1463         ],  # win_z7!=0
1464       }],  # OS==win
1465       ['enable_task_manager==1', {
1466         'defines': [
1467           'ENABLE_TASK_MANAGER=1',
1468         ],
1469       }],
1470       ['enable_web_intents==1', {
1471         'defines': [
1472           'ENABLE_WEB_INTENTS=1',
1473         ],
1474       }],
1475       ['enable_extensions==1', {
1476         'defines': [
1477           'ENABLE_EXTENSIONS=1',
1478         ],
1479       }],
1480       ['OS=="win" and branding=="Chrome"', {
1481         'defines': ['ENABLE_SWIFTSHADER'],
1482       }],
1483       ['enable_dart==1', {
1484         'defines': ['WEBKIT_USING_DART=1'],
1485       }],
1486       ['enable_plugin_installation==1', {
1487         'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
1488       }],
1489       ['enable_protector_service==1', {
1490         'defines': ['ENABLE_PROTECTOR_SERVICE=1'],
1491       }],
1492       ['enable_session_service==1', {
1493         'defines': ['ENABLE_SESSION_SERVICE=1'],
1494       }],
1495       ['enable_themes==1', {
1496         'defines': ['ENABLE_THEMES=1'],
1497       }],
1498       ['enable_background==1', {
1499         'defines': ['ENABLE_BACKGROUND=1'],
1500       }],
1501       ['enable_promo_resource_service==1', {
1502         'defines': ['ENABLE_PROMO_RESOURCE_SERVICE=1'],
1503       }],
1504       ['enable_automation==1', {
1505         'defines': ['ENABLE_AUTOMATION=1'],
1506       }],
1507     ],  # conditions for 'target_defaults'
1508     'target_conditions': [
1509       ['enable_wexit_time_destructors==1', {
1510         'conditions': [
1511           [ 'clang==1', {
1512             'cflags': [
1513               '-Wexit-time-destructors',
1514             ],
1515             'xcode_settings': {
1516               'WARNING_CFLAGS': [
1517                 '-Wexit-time-destructors',
1518               ],
1519             },
1520           }],
1521         ],
1522       }],
1523       ['chromium_code==0', {
1524         'conditions': [
1525           [ 'os_posix==1 and OS!="mac"', {
1526             # We don't want to get warnings from third-party code,
1527             # so remove any existing warning-enabling flags like -Wall.
1528             'cflags!': [
1529               '-Wall',
1530               '-Wextra',
1531               '-Werror',
1532             ],
1533             'cflags_cc': [
1534               # Don't warn about hash_map in third-party code.
1535               '-Wno-deprecated',
1536             ],
1537             'cflags': [
1538               # Don't warn about printf format problems.
1539               # This is off by default in gcc but on in Ubuntu's gcc(!).
1540               '-Wno-format',
1541             ],
1542             'cflags_cc!': [
1543               # TODO(fischman): remove this.
1544               # http://code.google.com/p/chromium/issues/detail?id=90453
1545               '-Wsign-compare',
1546             ]
1547           }],
1548           [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
1549             'cflags': [
1550               # Don't warn about ignoring the return value from e.g. close().
1551               # This is off by default in some gccs but on by default in others.
1552               # BSD systems do not support this option, since they are usually
1553               # using gcc 4.2.1, which does not have this flag yet.
1554               '-Wno-unused-result',
1555             ],
1556           }],
1557           [ 'OS=="win"', {
1558             'defines': [
1559               '_CRT_SECURE_NO_DEPRECATE',
1560               '_CRT_NONSTDC_NO_WARNINGS',
1561               '_CRT_NONSTDC_NO_DEPRECATE',
1562               '_SCL_SECURE_NO_DEPRECATE',
1563             ],
1564             'msvs_disabled_warnings': [4800],
1565             'msvs_settings': {
1566               'VCCLCompilerTool': {
1567                 'WarningLevel': '3',
1568                 'WarnAsError': 'false', # TODO(maruel): Enable it.
1569                 'Detect64BitPortabilityProblems': 'false',
1570               },
1571             },
1572           }],
1573           # TODO(darin): Unfortunately, some third_party code depends on base/
1574           [ 'OS=="win" and component=="shared_library"', {
1575             'msvs_disabled_warnings': [
1576               4251,  # class 'std::xx' needs to have dll-interface.
1577             ],
1578           }],
1579           [ 'OS=="mac"', {
1580             'xcode_settings': {
1581               'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
1582             },
1583             'conditions': [
1584               ['buildtype=="Official"', {
1585                 'xcode_settings': {
1586                   'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',    # -Werror
1587                 },
1588               }],
1589             ],
1590           }],
1591         ],
1592       }, {
1593         'includes': [
1594            # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
1595           'filename_rules.gypi',
1596         ],
1597         # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
1598         # C99 macros on Mac and Linux.
1599         'defines': [
1600           '__STDC_FORMAT_MACROS',
1601         ],
1602         'conditions': [
1603           ['OS=="win"', {
1604             # turn on warnings for signed/unsigned mismatch on chromium code.
1605             'msvs_settings': {
1606               'VCCLCompilerTool': {
1607                 'AdditionalOptions': ['/we4389'],
1608               },
1609             },
1610           }],
1611           ['OS=="win" and component=="shared_library"', {
1612             'msvs_disabled_warnings': [
1613               4251,  # class 'std::xx' needs to have dll-interface.
1614             ],
1615           }],
1616         ],
1617       }],
1618     ],  # target_conditions for 'target_defaults'
1619     'default_configuration': 'Debug',
1620     'configurations': {
1621       # VCLinkerTool LinkIncremental values below:
1622       #   0 == default
1623       #   1 == /INCREMENTAL:NO
1624       #   2 == /INCREMENTAL
1625       # Debug links incremental, Release does not.
1626       #
1627       # Abstract base configurations to cover common attributes.
1628       #
1629       'Common_Base': {
1630         'abstract': 1,
1631         'msvs_configuration_attributes': {
1632           'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
1633           'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
1634           'CharacterSet': '1',
1635         },
1636       },
1637       'x86_Base': {
1638         'abstract': 1,
1639         'msvs_settings': {
1640           'VCLinkerTool': {
1641             'TargetMachine': '1',
1642           },
1643         },
1644         'msvs_configuration_platform': 'Win32',
1645       },
1646       'x64_Base': {
1647         'abstract': 1,
1648         'msvs_configuration_platform': 'x64',
1649         'msvs_settings': {
1650           'VCLinkerTool': {
1651             'TargetMachine': '17', # x86 - 64
1652             'AdditionalLibraryDirectories!':
1653               ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
1654             'AdditionalLibraryDirectories':
1655               ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
1656           },
1657           'VCLibrarianTool': {
1658             'AdditionalLibraryDirectories!':
1659               ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
1660             'AdditionalLibraryDirectories':
1661               ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
1662           },
1663         },
1664         'defines': [
1665           # Not sure if tcmalloc works on 64-bit Windows.
1666           'NO_TCMALLOC',
1667         ],
1668       },
1669       'Debug_Base': {
1670         'abstract': 1,
1671         'defines': [
1672           'DYNAMIC_ANNOTATIONS_ENABLED=1',
1673           'WTF_USE_DYNAMIC_ANNOTATIONS=1',
1674         ],
1675         'xcode_settings': {
1676           'COPY_PHASE_STRIP': 'NO',
1677           'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
1678           'OTHER_CFLAGS': [
1679             '<@(debug_extra_cflags)',
1680           ],
1681         },
1682         'msvs_settings': {
1683           'VCCLCompilerTool': {
1684             'Optimization': '<(win_debug_Optimization)',
1685             'PreprocessorDefinitions': ['_DEBUG'],
1686             'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
1687             'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
1688             'conditions': [
1689               # According to MSVS, InlineFunctionExpansion=0 means
1690               # "default inlining", not "/Ob0".
1691               # Thus, we have to handle InlineFunctionExpansion==0 separately.
1692               ['win_debug_InlineFunctionExpansion==0', {
1693                 'AdditionalOptions': ['/Ob0'],
1694               }],
1695               ['win_debug_InlineFunctionExpansion!=""', {
1696                 'InlineFunctionExpansion':
1697                   '<(win_debug_InlineFunctionExpansion)',
1698               }],
1699               ['win_debug_disable_iterator_debugging==1', {
1700                 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
1701               }],
1703               # if win_debug_OmitFramePointers is blank, leave as default
1704               ['win_debug_OmitFramePointers==1', {
1705                 'OmitFramePointers': 'true',
1706               }],
1707               ['win_debug_OmitFramePointers==0', {
1708                 'OmitFramePointers': 'false',
1709                 # The above is not sufficient (http://crbug.com/106711): it
1710                 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
1711                 # perform FPO regardless, so we must explicitly disable.
1712                 # We still want the false setting above to avoid having
1713                 # "/Oy /Oy-" and warnings about overriding.
1714                 'AdditionalOptions': ['/Oy-'],
1715               }],
1716             ],
1717             'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
1718           },
1719           'VCLinkerTool': {
1720             'LinkIncremental': '<(msvs_debug_link_incremental)',
1721             # ASLR makes debugging with windbg difficult because Chrome.exe and
1722             # Chrome.dll share the same base name. As result, windbg will
1723             # name the Chrome.dll module like chrome_<base address>, where
1724             # <base address> typically changes with each launch. This in turn
1725             # means that breakpoints in Chrome.dll don't stick from one launch
1726             # to the next. For this reason, we turn ASLR off in debug builds.
1727             # Note that this is a three-way bool, where 0 means to pick up
1728             # the default setting, 1 is off and 2 is on.
1729             'RandomizedBaseAddress': 1,
1730           },
1731           'VCResourceCompilerTool': {
1732             'PreprocessorDefinitions': ['_DEBUG'],
1733           },
1734         },
1735         'conditions': [
1736           ['OS=="linux"', {
1737             'target_conditions': [
1738               ['_toolset=="target"', {
1739                 'cflags': [
1740                   '<@(debug_extra_cflags)',
1741                 ],
1742               }],
1743             ],
1744           }],
1745           ['release_valgrind_build==0', {
1746             'xcode_settings': {
1747               'OTHER_CFLAGS': [
1748                 '-fstack-protector-all',  # Implies -fstack-protector
1749               ],
1750             },
1751           }],
1752         ],
1753       },
1754       'Release_Base': {
1755         'abstract': 1,
1756         'defines': [
1757           'NDEBUG',
1758         ],
1759         'xcode_settings': {
1760           'DEAD_CODE_STRIPPING': 'YES',  # -Wl,-dead_strip
1761           'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
1762           'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
1763         },
1764         'msvs_settings': {
1765           'VCCLCompilerTool': {
1766             'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
1767             'conditions': [
1768               # In official builds, each target will self-select
1769               # an optimization level.
1770               ['buildtype!="Official"', {
1771                   'Optimization': '<(win_release_Optimization)',
1772                 },
1773               ],
1774               # According to MSVS, InlineFunctionExpansion=0 means
1775               # "default inlining", not "/Ob0".
1776               # Thus, we have to handle InlineFunctionExpansion==0 separately.
1777               ['win_release_InlineFunctionExpansion==0', {
1778                 'AdditionalOptions': ['/Ob0'],
1779               }],
1780               ['win_release_InlineFunctionExpansion!=""', {
1781                 'InlineFunctionExpansion':
1782                   '<(win_release_InlineFunctionExpansion)',
1783               }],
1785               # if win_release_OmitFramePointers is blank, leave as default
1786               ['win_release_OmitFramePointers==1', {
1787                 'OmitFramePointers': 'true',
1788               }],
1789               ['win_release_OmitFramePointers==0', {
1790                 'OmitFramePointers': 'false',
1791                 # The above is not sufficient (http://crbug.com/106711): it
1792                 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
1793                 # perform FPO regardless, so we must explicitly disable.
1794                 # We still want the false setting above to avoid having
1795                 # "/Oy /Oy-" and warnings about overriding.
1796                 'AdditionalOptions': ['/Oy-'],
1797               }],
1798             ],
1799             'AdditionalOptions': [ '<@(win_release_extra_cflags)', ],
1800           },
1801           'VCLinkerTool': {
1802             # LinkIncremental is a tri-state boolean, where 0 means default
1803             # (i.e., inherit from parent solution), 1 means false, and
1804             # 2 means true.
1805             'LinkIncremental': '1',
1806             # This corresponds to the /PROFILE flag which ensures the PDB
1807             # file contains FIXUP information (growing the PDB file by about
1808             # 5%) but does not otherwise alter the output binary. This
1809             # information is used by the Syzygy optimization tool when
1810             # decomposing the release image.
1811             'Profile': 'true',
1812           },
1813         },
1814         'conditions': [
1815           ['msvs_use_common_release', {
1816             'includes': ['release.gypi'],
1817           }],
1818           ['release_valgrind_build==0', {
1819             'defines': [
1820               'NVALGRIND',
1821               'DYNAMIC_ANNOTATIONS_ENABLED=0',
1822             ],
1823           }, {
1824             'defines': [
1825               'DYNAMIC_ANNOTATIONS_ENABLED=1',
1826               'WTF_USE_DYNAMIC_ANNOTATIONS=1',
1827             ],
1828           }],
1829           ['win_use_allocator_shim==0', {
1830             'defines': ['NO_TCMALLOC'],
1831           }],
1832           ['OS=="linux"', {
1833             'target_conditions': [
1834               ['_toolset=="target"', {
1835                 'cflags': [
1836                   '<@(release_extra_cflags)',
1837                 ],
1838               }],
1839             ],
1840           }],
1841         ],
1842       },
1843       #
1844       # Concrete configurations
1845       #
1846       'Debug': {
1847         'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
1848       },
1849       'Release': {
1850         'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
1851       },
1852       'conditions': [
1853         [ 'OS=="win"', {
1854           # TODO(bradnelson): add a gyp mechanism to make this more graceful.
1855           'Debug_x64': {
1856             'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
1857           },
1858           'Release_x64': {
1859             'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
1860           },
1861         }],
1862       ],
1863     },
1864   },
1865   'conditions': [
1866     ['os_posix==1 and OS!="mac"', {
1867       'target_defaults': {
1868         # Enable -Werror by default, but put it in a variable so it can
1869         # be disabled in ~/.gyp/include.gypi on the valgrind builders.
1870         'variables': {
1871           'werror%': '-Werror',
1872           'libraries_for_target%': '',
1873         },
1874         'defines': [
1875           '_FILE_OFFSET_BITS=64',
1876         ],
1877         'cflags': [
1878           '<(werror)',  # See note above about the werror variable.
1879           '-pthread',
1880           '-fno-exceptions',
1881           '-fno-strict-aliasing',  # See http://crbug.com/32204
1882           '-Wall',
1883           # TODO(evan): turn this back on once all the builds work.
1884           # '-Wextra',
1885           # Don't warn about unused function params.  We use those everywhere.
1886           '-Wno-unused-parameter',
1887           # Don't warn about the "struct foo f = {0};" initialization pattern.
1888           '-Wno-missing-field-initializers',
1889           # Don't export any symbols (for example, to plugins we dlopen()).
1890           # Note: this is *required* to make some plugins work.
1891           '-fvisibility=hidden',
1892           '-pipe',
1893         ],
1894         'cflags_cc': [
1895           '-fno-rtti',
1896           '-fno-threadsafe-statics',
1897           # Make inline functions have hidden visiblity by default.
1898           # Surprisingly, not covered by -fvisibility=hidden.
1899           '-fvisibility-inlines-hidden',
1900           # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
1901           # so we specify it explicitly.
1902           # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it.
1903           # http://code.google.com/p/chromium/issues/detail?id=90453
1904           '-Wsign-compare',
1905         ],
1906         'ldflags': [
1907           '-pthread', '-Wl,-z,noexecstack',
1908         ],
1909         'libraries' : [
1910           '<(libraries_for_target)',
1911         ],
1912         'configurations': {
1913           'Debug_Base': {
1914             'variables': {
1915               'debug_optimize%': '0',
1916             },
1917             'defines': [
1918               '_DEBUG',
1919             ],
1920             'cflags': [
1921               '-O>(debug_optimize)',
1922               '-g',
1923             ],
1924             'conditions' : [
1925               ['OS=="android"', {
1926                 'cflags': [
1927                   '-fno-omit-frame-pointer',
1928                 ],
1929               }],
1930             ],
1931             'target_conditions' : [
1932               ['_toolset=="target"', {
1933                 'conditions': [
1934                   ['OS=="android" and debug_optimize==0 and target_arch=="arm"', {
1935                     'cflags': [
1936                       '-mlong-calls',  # Needed when compiling with -O0
1937                     ],
1938                   }],
1939                   ['arm_thumb==1', {
1940                     'cflags': [
1941                       '-marm',
1942                     ],
1943                   }],
1944                  ],
1945               }],
1946             ],
1947           },
1948           'Release_Base': {
1949             'variables': {
1950               'release_optimize%': '2',
1951               # Binaries become big and gold is unable to perform GC
1952               # and remove unused sections for some of test targets
1953               # on 32 bit platform.
1954               # (This is currently observed only in chromeos valgrind bots)
1955               # The following flag is to disable --gc-sections linker
1956               # option for these bots.
1957               'no_gc_sections%': 0,
1959               # TODO(bradnelson): reexamine how this is done if we change the
1960               # expansion of configurations
1961               'release_valgrind_build%': 0,
1962             },
1963             'cflags': [
1964               '-O>(release_optimize)',
1965               # Don't emit the GCC version ident directives, they just end up
1966               # in the .comment section taking up binary size.
1967               '-fno-ident',
1968               # Put data and code in their own sections, so that unused symbols
1969               # can be removed at link time with --gc-sections.
1970               '-fdata-sections',
1971               '-ffunction-sections',
1972             ],
1973             'ldflags': [
1974               # Specifically tell the linker to perform optimizations.
1975               # See http://lwn.net/Articles/192624/ .
1976               '-Wl,-O1',
1977               '-Wl,--as-needed',
1978             ],
1979             'conditions' : [
1980               ['no_gc_sections==0', {
1981                 'ldflags': [
1982                   '-Wl,--gc-sections',
1983                 ],
1984               }],
1985               ['OS=="android"', {
1986                 'cflags': [
1987                   '-fomit-frame-pointer',
1988                 ],
1989               }],
1990               ['clang==1', {
1991                 'cflags!': [
1992                   '-fno-ident',
1993                 ],
1994               }],
1995               ['profiling==1', {
1996                 'cflags': [
1997                   '-fno-omit-frame-pointer',
1998                   '-g',
1999                 ],
2000               }],
2001             ],
2002           },
2003         },
2004         'variants': {
2005           'coverage': {
2006             'cflags': ['-fprofile-arcs', '-ftest-coverage'],
2007             'ldflags': ['-fprofile-arcs'],
2008           },
2009           'profile': {
2010             'cflags': ['-pg', '-g'],
2011             'ldflags': ['-pg'],
2012           },
2013           'symbols': {
2014             'cflags': ['-g'],
2015           },
2016         },
2017         'conditions': [
2018           ['target_arch=="ia32"', {
2019             'target_conditions': [
2020               ['_toolset=="target"', {
2021                 'asflags': [
2022                   # Needed so that libs with .s files (e.g. libicudata.a)
2023                   # are compatible with the general 32-bit-ness.
2024                   '-32',
2025                 ],
2026                 # All floating-point computations on x87 happens in 80-bit
2027                 # precision.  Because the C and C++ language standards allow
2028                 # the compiler to keep the floating-point values in higher
2029                 # precision than what's specified in the source and doing so
2030                 # is more efficient than constantly rounding up to 64-bit or
2031                 # 32-bit precision as specified in the source, the compiler,
2032                 # especially in the optimized mode, tries very hard to keep
2033                 # values in x87 floating-point stack (in 80-bit precision)
2034                 # as long as possible. This has important side effects, that
2035                 # the real value used in computation may change depending on
2036                 # how the compiler did the optimization - that is, the value
2037                 # kept in 80-bit is different than the value rounded down to
2038                 # 64-bit or 32-bit. There are possible compiler options to
2039                 # make this behavior consistent (e.g. -ffloat-store would keep
2040                 # all floating-values in the memory, thus force them to be
2041                 # rounded to its original precision) but they have significant
2042                 # runtime performance penalty.
2043                 #
2044                 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
2045                 # which keep floating-point values in SSE registers in its
2046                 # native precision (32-bit for single precision, and 64-bit
2047                 # for double precision values). This means the floating-point
2048                 # value used during computation does not change depending on
2049                 # how the compiler optimized the code, since the value is
2050                 # always kept in its specified precision.
2051                 'conditions': [
2052                   ['branding=="Chromium" and disable_sse2==0', {
2053                     'cflags': [
2054                       '-march=pentium4',
2055                       '-msse2',
2056                       '-mfpmath=sse',
2057                     ],
2058                   }],
2059                   # ChromeOS targets Pinetrail, which is sse3, but most of the
2060                   # benefit comes from sse2 so this setting allows ChromeOS
2061                   # to build on other CPUs.  In the future -march=atom would
2062                   # help but requires a newer compiler.
2063                   ['chromeos==1 and disable_sse2==0', {
2064                     'cflags': [
2065                       '-msse2',
2066                     ],
2067                   }],
2068                   # Install packages have started cropping up with
2069                   # different headers between the 32-bit and 64-bit
2070                   # versions, so we have to shadow those differences off
2071                   # and make sure a 32-bit-on-64-bit build picks up the
2072                   # right files.
2073                   # For android build, use NDK headers instead of host headers
2074                   ['host_arch!="ia32" and OS!="android"', {
2075                     'include_dirs+': [
2076                       '/usr/include32',
2077                     ],
2078                   }],
2079                 ],
2080                 # -mmmx allows mmintrin.h to be used for mmx intrinsics.
2081                 # video playback is mmx and sse2 optimized.
2082                 'cflags': [
2083                   '-m32',
2084                   '-mmmx',
2085                 ],
2086                 'ldflags': [
2087                   '-m32',
2088                 ],
2089               }],
2090             ],
2091           }],
2092           ['target_arch=="arm"', {
2093             'target_conditions': [
2094               ['_toolset=="target"', {
2095                 'cflags_cc': [
2096                   # The codesourcery arm-2009q3 toolchain warns at that the ABI
2097                   # has changed whenever it encounters a varargs function. This
2098                   # silences those warnings, as they are not helpful and
2099                   # clutter legitimate warnings.
2100                   '-Wno-abi',
2101                 ],
2102                 'conditions': [
2103                   ['arm_thumb==1', {
2104                     'cflags': [
2105                     '-mthumb',
2106                     ]
2107                   }],
2108                   ['armv7==1', {
2109                     'cflags': [
2110                       '-march=armv7-a',
2111                       '-mtune=cortex-a8',
2112                       '-mfloat-abi=<(arm_float_abi)',
2113                     ],
2114                     'conditions': [
2115                       ['arm_neon==1', {
2116                         'cflags': [ '-mfpu=neon', ],
2117                       }, {
2118                         'cflags': [ '-mfpu=<(arm_fpu)', ],
2119                       }]
2120                     ],
2121                   }],
2122                   ['OS=="android"', {
2123                     # Most of the following flags are derived from what Android
2124                     # uses by default when building for arm, reference for which
2125                     # can be found in the following file in the Android NDK:
2126                     # toolchains/arm-linux-androideabi-4.4.3/setup.mk
2127                     'cflags': [
2128                       # The tree-sra optimization (scalar replacement for
2129                       # aggregates enabling subsequent optimizations) leads to
2130                       # invalid code generation when using the Android NDK's
2131                       # compiler (r5-r7). This can be verified using
2132                       # TestWebKitAPI's WTF.Checked_int8_t test.
2133                       '-fno-tree-sra',
2134                       '-Wno-psabi',
2135                     ],
2136                     'conditions': [
2137                       ['arm_thumb == 1', {
2138                         # Android toolchain doesn't support -mimplicit-it=thumb
2139                         'cflags!': [ '-Wa,-mimplicit-it=thumb', ],
2140                         'cflags': [ '-mthumb-interwork', ],
2141                       }],
2142                       ['armv7==0', {
2143                         # Flags suitable for Android emulator
2144                         'cflags': [
2145                           '-march=armv5te',
2146                           '-mtune=xscale',
2147                           '-msoft-float',
2148                         ],
2149                         'defines': [
2150                           '__ARM_ARCH_5__',
2151                           '__ARM_ARCH_5T__',
2152                           '__ARM_ARCH_5E__',
2153                           '__ARM_ARCH_5TE__',
2154                         ],
2155                       }],
2156                     ],
2157                   }],
2158                 ],
2159               }],
2160             ],
2161           }],
2162           ['linux_fpic==1', {
2163             'cflags': [
2164               '-fPIC',
2165             ],
2166             'ldflags': [
2167               '-fPIC',
2168             ],
2169           }],
2170           ['sysroot!=""', {
2171             'target_conditions': [
2172               ['_toolset=="target"', {
2173                 'cflags': [
2174                   '--sysroot=<(sysroot)',
2175                 ],
2176                 'ldflags': [
2177                   '--sysroot=<(sysroot)',
2178                 ],
2179               }]]
2180           }],
2181           ['clang==1', {
2182             'cflags': [
2183               '-Wheader-hygiene',
2184               # Clang spots more unused functions.
2185               '-Wno-unused-function',
2186               # Don't die on dtoa code that uses a char as an array index.
2187               '-Wno-char-subscripts',
2188               # Especially needed for gtest macros using enum values from Mac
2189               # system headers.
2190               # TODO(pkasting): In C++11 this is legal, so this should be
2191               # removed when we change to that.  (This is also why we don't
2192               # bother fixing all these cases today.)
2193               '-Wno-unnamed-type-template-args',
2194               # This (rightyfully) complains about 'override', which we use
2195               # heavily.
2196               '-Wno-c++11-extensions',
2198               # Warns on switches on enums that cover all enum values but
2199               # also contain a default: branch. Chrome is full of that.
2200               '-Wno-covered-switch-default',
2201             ],
2202             'cflags!': [
2203               # Clang doesn't seem to know know this flag.
2204               '-mfpmath=sse',
2205             ],
2206           }],
2207           ['clang==1 and clang_use_chrome_plugins==1', {
2208             'cflags': [
2209               '<@(clang_chrome_plugins_flags)',
2210             ],
2211           }],
2212           ['clang==1 and clang_load!=""', {
2213             'cflags': [
2214               '-Xclang', '-load', '-Xclang', '<(clang_load)',
2215             ],
2216           }],
2217           ['clang==1 and clang_add_plugin!=""', {
2218             'cflags': [
2219               '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
2220             ],
2221           }],
2222           ['clang==1 and "<(GENERATOR)"=="ninja"', {
2223             'cflags': [
2224               # See http://crbug.com/110262
2225               '-fcolor-diagnostics',
2226             ],
2227           }],
2228           ['asan==1', {
2229             'target_conditions': [
2230               ['_toolset=="target"', {
2231                   'cflags': [
2232                       '-faddress-sanitizer',
2233                       '-fno-omit-frame-pointer',
2234                       '-w',
2235                   ],
2236                   'ldflags': [
2237                       '-faddress-sanitizer',
2238                   ],
2239                   'defines': [
2240                       'ADDRESS_SANITIZER',
2241                   ],
2242               }],
2243             ],
2244           }],
2245           ['order_profiling!=0 and (chromeos==1 or OS=="linux")', {
2246             'target_conditions' : [
2247               ['_toolset=="target"', {
2248                 'cflags': [
2249                   '-finstrument-functions',
2250                 ],
2251               }],
2252             ],
2253           }],
2254           ['linux_breakpad==1', {
2255             'cflags': [ '-g' ],
2256             'defines': ['USE_LINUX_BREAKPAD'],
2257           }],
2258           ['linux_use_heapchecker==1', {
2259             'variables': {'linux_use_tcmalloc%': 1},
2260             'defines': ['USE_HEAPCHECKER'],
2261           }],
2262           ['linux_use_tcmalloc==0', {
2263             'defines': ['NO_TCMALLOC'],
2264           }],
2265           ['linux_keep_shadow_stacks==1', {
2266             'defines': ['KEEP_SHADOW_STACKS'],
2267             'cflags': [
2268               '-finstrument-functions',
2269               # Allow mmx intrinsics to inline, so that the compiler can expand
2270               # the intrinsics.
2271               '-finstrument-functions-exclude-file-list=mmintrin.h',
2272             ],
2273           }],
2274           ['linux_use_gold_flags==1', {
2275             'ldflags': [
2276               # Experimentation found that using four linking threads
2277               # saved ~20% of link time.
2278               # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
2279               '-Wl,--threads',
2280               '-Wl,--thread-count=4',
2281             ],
2282             'conditions': [
2283               ['release_valgrind_build==0', {
2284                 'target_conditions': [
2285                   ['_toolset=="target"', {
2286                     'ldflags': [
2287                       # There seems to be a conflict of --icf and -pie
2288                       # in gold which can generate crashy binaries. As
2289                       # a security measure, -pie takes precendence for
2290                       # now.
2291                       #'-Wl,--icf=safe',
2292                       '-Wl,--icf=none',
2293                     ],
2294                   }],
2295                 ],
2296               }],
2297             ],
2298           }],
2299           ['linux_use_gold_binary==1', {
2300             'variables': {
2301               'conditions': [
2302                 ['inside_chromium_build==1', {
2303                   # We pass the path to gold to the compiler.  gyp leaves
2304                   # unspecified what the cwd is when running the compiler,
2305                   # so the normal gyp path-munging fails us.  This hack
2306                   # gets the right path.
2307                   'gold_path': '<(PRODUCT_DIR)/../../third_party/gold',
2308                 }, {
2309                   'gold_path': '<(PRODUCT_DIR)/../../Source/WebKit/chromium/third_party/gold',
2310                 }]
2311               ]
2312             },
2313             'ldflags': [
2314               # Put our gold binary in the search path for the linker.
2315               '-B<(gold_path)',
2316             ],
2317           }],
2318         ],
2319       },
2320     }],
2321     # FreeBSD-specific options; note that most FreeBSD options are set above,
2322     # with Linux.
2323     ['OS=="freebsd"', {
2324       'target_defaults': {
2325         'ldflags': [
2326           '-Wl,--no-keep-memory',
2327         ],
2328       },
2329     }],
2330     # Android-specific options; note that most are set above with Linux.
2331     ['OS=="android"', {
2332       'variables': {
2333         'target_arch%': 'arm',  # target_arch in android terms.
2334         'conditions': [
2335           # Android uses x86 instead of ia32 for their target_arch designation.
2336           ['target_arch=="ia32"', {
2337             'target_arch%': 'x86',
2338           }],
2339           # Use shared stlport library when system one used.
2340           # Figure this out early since it needs symbols from libgcc.a, so it
2341           # has to be before that in the set of libraries.
2342           ['use_system_stlport==1', {
2343             'android_stlport_library': 'stlport',
2344           }, {
2345             'android_stlport_library': 'stlport_static',
2346           }],
2347         ],
2349         # Placing this variable here prevents from forking libvpx, used
2350         # by remoting.  Remoting is off, so it needn't built,
2351         # so forking it's deps seems like overkill.
2352         # But this variable need defined to properly run gyp.
2353         # A proper solution is to have an OS==android conditional
2354         # in third_party/libvpx/libvpx.gyp to define it.
2355         'libvpx_path': 'lib/linux/arm',
2356       },
2357       'target_defaults': {
2358         # Build a Release build by default to match Android build behavior.
2359         # This is typical with Android because Debug builds tend to be much
2360         # larger and run very slowly on constrained devices. It is still
2361         # possible to do a Debug build by specifying BUILDTYPE=Debug on the
2362         # 'make' command line.
2363         'default_configuration': 'Release',
2365         'variables': {
2366           'release_extra_cflags%': '',
2367          },
2369         'target_conditions': [
2370           # Settings for building device targets using Android's toolchain.
2371           # These are based on the setup.mk file from the Android NDK.
2372           #
2373           # The NDK Android executable link step looks as follows:
2374           #  $LDFLAGS
2375           #  $(TARGET_CRTBEGIN_DYNAMIC_O)  <-- crtbegin.o
2376           #  $(PRIVATE_OBJECTS)            <-- The .o that we built
2377           #  $(PRIVATE_STATIC_LIBRARIES)   <-- The .a that we built
2378           #  $(TARGET_LIBGCC)              <-- libgcc.a
2379           #  $(PRIVATE_SHARED_LIBRARIES)   <-- The .so that we built
2380           #  $(PRIVATE_LDLIBS)             <-- System .so
2381           #  $(TARGET_CRTEND_O)            <-- crtend.o
2382           #
2383           # For now the above are approximated for executables by adding
2384           # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
2385           # of 'libraries'.
2386           #
2387           # The NDK Android shared library link step looks as follows:
2388           #  $LDFLAGS
2389           #  $(PRIVATE_OBJECTS)            <-- The .o that we built
2390           #  -l,--whole-archive
2391           #  $(PRIVATE_WHOLE_STATIC_LIBRARIES)
2392           #  -l,--no-whole-archive
2393           #  $(PRIVATE_STATIC_LIBRARIES)   <-- The .a that we built
2394           #  $(TARGET_LIBGCC)              <-- libgcc.a
2395           #  $(PRIVATE_SHARED_LIBRARIES)   <-- The .so that we built
2396           #  $(PRIVATE_LDLIBS)             <-- System .so
2397           #
2398           # For now, assume not need any whole static libs.
2399           #
2400           # For both executables and shared libraries, add the proper
2401           # libgcc.a to the start of libraries which puts it in the
2402           # proper spot after .o and .a files get linked in.
2403           #
2404           # TODO: The proper thing to do longer-tem would be proper gyp
2405           # support for a custom link command line.
2406           ['_toolset=="target"', {
2407             'cflags!': [
2408               '-pthread',  # Not supported by Android toolchain.
2409             ],
2410             'cflags': [
2411               '-U__linux__',  # Don't allow toolchain to claim -D__linux__
2412               '-ffunction-sections',
2413               '-funwind-tables',
2414               '-g',
2415               '-fstack-protector',
2416               '-fno-short-enums',
2417               '-finline-limit=64',
2418               '-Wa,--noexecstack',
2419               '-Wno-error=non-virtual-dtor',  # TODO(michaelbai): Fix warnings.
2420               '<@(release_extra_cflags)',
2421               # Note: This include is in cflags to ensure that it comes after
2422               # all of the includes.
2423               '-I<(android_ndk_include)',
2424             ],
2425             'defines': [
2426               'ANDROID',
2427               '__GNU_SOURCE=1',  # Necessary for clone()
2428               'USE_STLPORT=1',
2429               '_STLP_USE_PTR_SPECIALIZATIONS=1',
2430               'HAVE_OFF64_T',
2431               'HAVE_SYS_UIO_H',
2432               'ANDROID_BINSIZE_HACK', # Enable temporary hacks to reduce binsize.
2433             ],
2434             'ldflags!': [
2435               '-pthread',  # Not supported by Android toolchain.
2436             ],
2437             'ldflags': [
2438               '-nostdlib',
2439               '-Wl,--no-undefined',
2440               # Don't export symbols from statically linked libraries.
2441               '-Wl,--exclude-libs=ALL',
2442             ],
2443             'libraries': [
2444               '-l<(android_stlport_library)',
2445               # Manually link the libgcc.a that the cross compiler uses.
2446               '<!(${ANDROID_TOOLCHAIN}/*-gcc -print-libgcc-file-name)',
2447               '-lc',
2448               '-ldl',
2449               '-lstdc++',
2450               '-lm',
2451             ],
2452             'conditions': [
2453               ['android_upstream_bringup==1', {
2454                 'defines': ['ANDROID_UPSTREAM_BRINGUP=1',],
2455               }],
2456               ['android_build_type==0', {
2457                 'ldflags': [
2458                   '--sysroot=<(android_ndk_sysroot)',
2459                 ],
2460               }],
2461               ['target_arch == "arm"', {
2462                 'ldflags': [
2463                   # Enable identical code folding to reduce size.
2464                   '-Wl,--icf=safe',
2465                 ],
2466               }],
2467               # NOTE: The stlport header include paths below are specified in
2468               # cflags rather than include_dirs because they need to come
2469               # after include_dirs. Think of them like system headers, but
2470               # don't use '-isystem' because the arm-linux-androideabi-4.4.3
2471               # toolchain (circa Gingerbread) will exhibit strange errors.
2472               # The include ordering here is important; change with caution.
2473               ['use_system_stlport==0', {
2474                 'cflags': [
2475                   '-I<(android_ndk_root)/sources/cxx-stl/stlport/stlport',
2476                 ],
2477                 'conditions': [
2478                   ['target_arch=="arm" and armv7==1', {
2479                     'ldflags': [
2480                       '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/armeabi-v7a',
2481                     ],
2482                   }],
2483                   ['target_arch=="arm" and armv7==0', {
2484                     'ldflags': [
2485                       '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/armeabi',
2486                     ],
2487                   }],
2488                   ['target_arch=="ia32"', {
2489                     'ldflags': [
2490                       '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/x86',
2491                     ],
2492                   }],
2493                 ],
2494               }],
2495               ['target_arch=="ia32"', {
2496                 # The x86 toolchain currently has problems with stack-protector.
2497                 'cflags!': [
2498                   '-fstack-protector',
2499                 ],
2500                 'cflags': [
2501                   '-fno-stack-protector',
2502                 ],
2503               }],
2504             ],
2505             'target_conditions': [
2506               ['_type=="executable"', {
2507                 'ldflags': [
2508                   '-Bdynamic',
2509                   '-Wl,-dynamic-linker,/system/bin/linker',
2510                   '-Wl,--gc-sections',
2511                   '-Wl,-z,nocopyreloc',
2512                   # crtbegin_dynamic.o should be the last item in ldflags.
2513                   '<(android_ndk_lib)/crtbegin_dynamic.o',
2514                 ],
2515                 'libraries': [
2516                   # crtend_android.o needs to be the last item in libraries.
2517                   # Do not add any libraries after this!
2518                   '<(android_ndk_lib)/crtend_android.o',
2519                 ],
2520               }],
2521               ['_type=="shared_library"', {
2522                 'ldflags': [
2523                   '-Wl,-shared,-Bsymbolic',
2524                   # crtbegin_so.o should be the last item in ldflags.
2525                   '<(android_ndk_lib)/crtbegin_so.o',
2526                 ],
2527                 'libraries': [
2528                   # crtend_so.o needs to be the last item in libraries.
2529                   # Do not add any libraries after this!
2530                   '<(android_ndk_lib)/crtend_so.o',
2531                 ],
2532               }],
2533             ],
2534           }],
2535           # Settings for building host targets using the system toolchain.
2536           ['_toolset=="host"', {
2537             'cflags!': [
2538               # Due to issues in Clang build system, using ASan on 32-bit
2539               # binaries on x86_64 host is problematic.
2540               # TODO(eugenis): re-enable.
2541               '-faddress-sanitizer',
2542             ],
2543             'ldflags!': [
2544               '-faddress-sanitizer',
2545               '-Wl,-z,noexecstack',
2546               '-Wl,--gc-sections',
2547               '-Wl,-O1',
2548               '-Wl,--as-needed',
2549             ],
2550             'sources/': [
2551               ['exclude', '_android(_unittest)?\\.cc$'],
2552               ['exclude', '(^|/)android/']
2553             ],
2554           }],
2555         ],
2556       },
2557     }],
2558     ['OS=="solaris"', {
2559       'cflags!': ['-fvisibility=hidden'],
2560       'cflags_cc!': ['-fvisibility-inlines-hidden'],
2561     }],
2562     ['OS=="mac"', {
2563       'target_defaults': {
2564         'variables': {
2565           # These should end with %, but there seems to be a bug with % in
2566           # variables that are intended to be set to different values in
2567           # different targets, like these.
2568           'mac_pie': 1,        # Most executables can be position-independent.
2569           'mac_real_dsym': 0,  # Fake .dSYMs are fine in most cases.
2570           # Strip debugging symbols from the target.
2571           'mac_strip': '<(mac_strip_release)',
2572         },
2573         'mac_bundle': 0,
2574         'xcode_settings': {
2575           'ALWAYS_SEARCH_USER_PATHS': 'NO',
2576           'GCC_C_LANGUAGE_STANDARD': 'c99',         # -std=c99
2577           'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
2578           'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
2579                                                     # (Equivalent to -fPIC)
2580           'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
2581           'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
2582           'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
2583           # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
2584           'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
2585           'GCC_OBJC_CALL_CXX_CDTORS': 'YES',        # -fobjc-call-cxx-cdtors
2586           'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden
2587           'GCC_THREADSAFE_STATICS': 'NO',           # -fno-threadsafe-statics
2588           'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',    # -Werror
2589           'GCC_VERSION': '4.2',
2590           'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',  # -Wnewline-eof
2591           # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
2592           'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
2593           # Keep pch files below xcodebuild/.
2594           'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
2595           'USE_HEADERMAP': 'NO',
2596           'OTHER_CFLAGS': [
2597             '-fno-strict-aliasing',  # See http://crbug.com/32204
2598           ],
2599           'WARNING_CFLAGS': [
2600             '-Wall',
2601             '-Wendif-labels',
2602             '-Wextra',
2603             # Don't warn about unused function parameters.
2604             '-Wno-unused-parameter',
2605             # Don't warn about the "struct foo f = {0};" initialization
2606             # pattern.
2607             '-Wno-missing-field-initializers',
2608           ],
2609           'conditions': [
2610             ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
2611                                  {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
2612             ],
2613             ['clang==1', {
2614               'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
2615               'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
2617               # Don't use -Wc++0x-extensions, which Xcode 4 enables by default
2618               # when buliding with clang. This warning is triggered when the
2619               # override keyword is used via the OVERRIDE macro from
2620               # base/compiler_specific.h.
2621               'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
2623               'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
2624               'WARNING_CFLAGS': [
2625                 '-Wheader-hygiene',
2626                 # Don't die on dtoa code that uses a char as an array index.
2627                 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2628                 '-Wno-char-subscripts',
2629                 # Clang spots more unused functions.
2630                 '-Wno-unused-function',
2631                 # See comments on this flag higher up in this file.
2632                 '-Wno-unnamed-type-template-args',
2633                 # This (rightyfully) complains about 'override', which we use
2634                 # heavily.
2635                 '-Wno-c++11-extensions',
2637                 # Warns on switches on enums that cover all enum values but
2638                 # also contain a default: branch. Chrome is full of that.
2639                 '-Wno-covered-switch-default',
2640               ],
2641             }],
2642             ['clang==1 and clang_use_chrome_plugins==1', {
2643               'OTHER_CFLAGS': [
2644                 '<@(clang_chrome_plugins_flags)',
2645               ],
2646             }],
2647             ['clang==1 and clang_load!=""', {
2648               'OTHER_CFLAGS': [
2649                 '-Xclang', '-load', '-Xclang', '<(clang_load)',
2650               ],
2651             }],
2652             ['clang==1 and clang_add_plugin!=""', {
2653               'OTHER_CFLAGS': [
2654                 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
2655               ],
2656             }],
2657             ['clang==1 and "<(GENERATOR)"=="ninja"', {
2658               'OTHER_CFLAGS': [
2659                 # See http://crbug.com/110262
2660                 '-fcolor-diagnostics',
2661               ],
2662             }],
2663           ],
2664         },
2665         'conditions': [
2666           ['clang==1', {
2667             'variables': {
2668               'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
2669             },
2670           }],
2671           ['asan==1', {
2672             'xcode_settings': {
2673               'OTHER_CFLAGS': [
2674                 '-faddress-sanitizer',
2675                 '-w',
2676               ],
2677               'OTHER_LDFLAGS': [
2678                 '-faddress-sanitizer',
2679                 # The symbols below are referenced in the ASan runtime
2680                 # library (compiled on OS X 10.6), but may be unavailable
2681                 # on the prior OS X versions. Because Chromium is currently
2682                 # targeting 10.5.0, we need to explicitly mark these
2683                 # symbols as dynamic_lookup.
2684                 '-Wl,-U,_malloc_default_purgeable_zone',
2685                 '-Wl,-U,_malloc_zone_memalign',
2686                 '-Wl,-U,_dispatch_sync_f',
2687                 '-Wl,-U,_dispatch_async_f',
2688                 '-Wl,-U,_dispatch_barrier_async_f',
2689                 '-Wl,-U,_dispatch_group_async_f',
2690                 '-Wl,-U,_dispatch_after_f',
2691               ],
2692             },
2693             'defines': [
2694               'ADDRESS_SANITIZER',
2695             ],
2696           }],
2697         ],
2698         'target_conditions': [
2699           ['_type!="static_library"', {
2700             'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
2701           }],
2702           ['_mac_bundle', {
2703             'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
2704           }],
2705           ['_type=="executable"', {
2706             'postbuilds': [
2707               {
2708                 # Arranges for data (heap) pages to be protected against
2709                 # code execution when running on Mac OS X 10.7 ("Lion"), and
2710                 # ensures that the position-independent executable (PIE) bit
2711                 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
2712                 'variables': {
2713                   # Define change_mach_o_flags in a variable ending in _path
2714                   # so that GYP understands it's a path and performs proper
2715                   # relativization during dict merging.
2716                   'change_mach_o_flags_path':
2717                       'mac/change_mach_o_flags_from_xcode.sh',
2718                   'change_mach_o_flags_options%': [
2719                   ],
2720                   'target_conditions': [
2721                     ['mac_pie==0 or release_valgrind_build==1', {
2722                       # Don't enable PIE if it's unwanted. It's unwanted if
2723                       # the target specifies mac_pie=0 or if building for
2724                       # Valgrind, because Valgrind doesn't understand slide.
2725                       # See the similar mac_pie/release_valgrind_build check
2726                       # below.
2727                       'change_mach_o_flags_options': [
2728                         '--no-pie',
2729                       ],
2730                     }],
2731                   ],
2732                 },
2733                 'postbuild_name': 'Change Mach-O Flags',
2734                 'action': [
2735                   '<(change_mach_o_flags_path)',
2736                   '>@(change_mach_o_flags_options)',
2737                 ],
2738               },
2739             ],
2740             'conditions': [
2741               ['asan==1', {
2742                 'variables': {
2743                  'asan_saves_file': 'asan.saves',
2744                 },
2745                 'xcode_settings': {
2746                   'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
2747                 },
2748               }],
2749             ],
2750             'target_conditions': [
2751               ['mac_pie==1 and release_valgrind_build==0', {
2752                 # Turn on position-independence (ASLR) for executables. When
2753                 # PIE is on for the Chrome executables, the framework will
2754                 # also be subject to ASLR.
2755                 # Don't do this when building for Valgrind, because Valgrind
2756                 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
2757                 # understand slide, and get rid of the Valgrind check.
2758                 'xcode_settings': {
2759                   'OTHER_LDFLAGS': [
2760                     '-Wl,-pie',  # Position-independent executable (MH_PIE)
2761                   ],
2762                 },
2763               }],
2764             ],
2765           }],
2766           ['(_type=="executable" or _type=="shared_library" or \
2767              _type=="loadable_module") and mac_strip!=0', {
2768             'target_conditions': [
2769               ['mac_real_dsym == 1', {
2770                 # To get a real .dSYM bundle produced by dsymutil, set the
2771                 # debug information format to dwarf-with-dsym.  Since
2772                 # strip_from_xcode will not be used, set Xcode to do the
2773                 # stripping as well.
2774                 'configurations': {
2775                   'Release_Base': {
2776                     'xcode_settings': {
2777                       'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
2778                       'DEPLOYMENT_POSTPROCESSING': 'YES',
2779                       'STRIP_INSTALLED_PRODUCT': 'YES',
2780                       'target_conditions': [
2781                         ['_type=="shared_library" or _type=="loadable_module"', {
2782                           # The Xcode default is to strip debugging symbols
2783                           # only (-S).  Local symbols should be stripped as
2784                           # well, which will be handled by -x.  Xcode will
2785                           # continue to insert -S when stripping even when
2786                           # additional flags are added with STRIPFLAGS.
2787                           'STRIPFLAGS': '-x',
2788                         }],  # _type=="shared_library" or _type=="loadable_module"'
2789                       ],  # target_conditions
2790                     },  # xcode_settings
2791                   },  # configuration "Release"
2792                 },  # configurations
2793               }, {  # mac_real_dsym != 1
2794                 # To get a fast fake .dSYM bundle, use a post-build step to
2795                 # produce the .dSYM and strip the executable.  strip_from_xcode
2796                 # only operates in the Release configuration.
2797                 'postbuilds': [
2798                   {
2799                     'variables': {
2800                       # Define strip_from_xcode in a variable ending in _path
2801                       # so that gyp understands it's a path and performs proper
2802                       # relativization during dict merging.
2803                       'strip_from_xcode_path': 'mac/strip_from_xcode',
2804                     },
2805                     'postbuild_name': 'Strip If Needed',
2806                     'action': ['<(strip_from_xcode_path)'],
2807                   },
2808                 ],  # postbuilds
2809               }],  # mac_real_dsym
2810             ],  # target_conditions
2811           }],  # (_type=="executable" or _type=="shared_library" or
2812                #  _type=="loadable_module") and mac_strip!=0
2813         ],  # target_conditions
2814       },  # target_defaults
2815     }],  # OS=="mac"
2816     ['OS=="win"', {
2817       'target_defaults': {
2818         'defines': [
2819           '_WIN32_WINNT=0x0601',
2820           'WINVER=0x0601',
2821           'WIN32',
2822           '_WINDOWS',
2823           'NOMINMAX',
2824           'PSAPI_VERSION=1',
2825           '_CRT_RAND_S',
2826           'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
2827           'WIN32_LEAN_AND_MEAN',
2828           '_ATL_NO_OPENGL',
2829         ],
2830         'conditions': [
2831           ['buildtype=="Official"', {
2832               # In official builds, targets can self-select an optimization
2833               # level by defining a variable named 'optimize', and setting it
2834               # to one of
2835               # - "size", optimizes for minimal code size - the default.
2836               # - "speed", optimizes for speed over code size.
2837               # - "max", whole program optimization and link-time code
2838               #   generation. This is very expensive and should be used
2839               #   sparingly.
2840               'variables': {
2841                 'optimize%': 'size',
2842               },
2843               'target_conditions': [
2844                 ['optimize=="size"', {
2845                     'msvs_settings': {
2846                       'VCCLCompilerTool': {
2847                         # 1, optimizeMinSpace, Minimize Size (/O1)
2848                         'Optimization': '1',
2849                         # 2, favorSize - Favor small code (/Os)
2850                         'FavorSizeOrSpeed': '2',
2851                       },
2852                     },
2853                   },
2854                 ],
2855                 ['optimize=="speed"', {
2856                     'msvs_settings': {
2857                       'VCCLCompilerTool': {
2858                         # 2, optimizeMaxSpeed, Maximize Speed (/O2)
2859                         'Optimization': '2',
2860                         # 1, favorSpeed - Favor fast code (/Ot)
2861                         'FavorSizeOrSpeed': '1',
2862                       },
2863                     },
2864                   },
2865                 ],
2866                 ['optimize=="max"', {
2867                     'msvs_settings': {
2868                       'VCCLCompilerTool': {
2869                         # 2, optimizeMaxSpeed, Maximize Speed (/O2)
2870                         'Optimization': '2',
2871                         # 1, favorSpeed - Favor fast code (/Ot)
2872                         'FavorSizeOrSpeed': '1',
2873                         # This implies link time code generation.
2874                         'WholeProgramOptimization': 'true',
2875                       },
2876                     },
2877                   },
2878                 ],
2879               ],
2880             },
2881           ],
2882           ['component=="static_library"', {
2883             'defines': [
2884               '_HAS_EXCEPTIONS=0',
2885             ],
2886           }],
2887           ['MSVS_VERSION=="2008"', {
2888             'defines': [
2889               '_HAS_TR1=0',
2890             ],
2891           }],
2892           ['secure_atl', {
2893             'defines': [
2894               '_SECURE_ATL',
2895             ],
2896           }],
2897         ],
2898         'msvs_system_include_dirs': [
2899           '<(DEPTH)/third_party/directxsdk/files/Include',
2900           '<(DEPTH)/third_party/platformsdk_win7/files/Include',
2901           '$(VSInstallDir)/VC/atlmfc/include',
2902         ],
2903         'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
2904         'msvs_disabled_warnings': [4351, 4396, 4503, 4819,
2905           # TODO(maruel): These warnings are level 4. They will be slowly
2906           # removed as code is fixed.
2907           4100, 4121, 4125, 4127, 4130, 4131, 4189, 4201, 4238, 4244, 4245,
2908           4310, 4355, 4428, 4481, 4505, 4510, 4512, 4530, 4610, 4611, 4701,
2909           4702, 4706,
2910         ],
2911         'msvs_settings': {
2912           'VCCLCompilerTool': {
2913             'MinimalRebuild': 'false',
2914             'BufferSecurityCheck': 'true',
2915             'EnableFunctionLevelLinking': 'true',
2916             'RuntimeTypeInfo': 'false',
2917             'WarningLevel': '4',
2918             'WarnAsError': 'true',
2919             'DebugInformationFormat': '3',
2920             'conditions': [
2921               ['msvs_multi_core_compile', {
2922                 'AdditionalOptions': ['/MP'],
2923               }],
2924               ['MSVS_VERSION=="2005e"', {
2925                 'AdditionalOptions': ['/w44068'], # Unknown pragma to 4 (ATL)
2926               }],
2927               ['component=="shared_library"', {
2928                 'ExceptionHandling': '1',  # /EHsc
2929               }, {
2930                 'ExceptionHandling': '0',
2931               }],
2932             ],
2933           },
2934           'VCLibrarianTool': {
2935             'AdditionalOptions': ['/ignore:4221'],
2936             'AdditionalLibraryDirectories': [
2937               '<(DEPTH)/third_party/directxsdk/files/Lib/x86',
2938               '<(DEPTH)/third_party/platformsdk_win7/files/Lib',
2939             ],
2940           },
2941           'VCLinkerTool': {
2942             'AdditionalDependencies': [
2943               'wininet.lib',
2944               'dnsapi.lib',
2945               'version.lib',
2946               'msimg32.lib',
2947               'ws2_32.lib',
2948               'usp10.lib',
2949               'psapi.lib',
2950               'dbghelp.lib',
2951               'winmm.lib',
2952               'shlwapi.lib',
2953             ],
2955             'conditions': [
2956               ['msvs_express', {
2957                 # Explicitly required when using the ATL with express
2958                 'AdditionalDependencies': [
2959                   'atlthunk.lib',
2960                 ],
2962                 # ATL 8.0 included in WDK 7.1 makes the linker to generate
2963                 # almost eight hundred LNK4254 and LNK4078 warnings:
2964                 #   - warning LNK4254: section 'ATL' (50000040) merged into
2965                 #     '.rdata' (40000040) with different attributes
2966                 #   - warning LNK4078: multiple 'ATL' sections found with
2967                 #     different attributes
2968                 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
2969               }],
2970               ['MSVS_VERSION=="2005e"', {
2971                 # Non-express versions link automatically to these
2972                 'AdditionalDependencies': [
2973                   'advapi32.lib',
2974                   'comdlg32.lib',
2975                   'ole32.lib',
2976                   'shell32.lib',
2977                   'user32.lib',
2978                   'winspool.lib',
2979                 ],
2980               }],
2981             ],
2982             'AdditionalLibraryDirectories': [
2983               '<(DEPTH)/third_party/directxsdk/files/Lib/x86',
2984               '<(DEPTH)/third_party/platformsdk_win7/files/Lib',
2985             ],
2986             'GenerateDebugInformation': 'true',
2987             'MapFileName': '$(OutDir)\\$(TargetName).map',
2988             'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
2989             'FixedBaseAddress': '1',
2990             # SubSystem values:
2991             #   0 == not set
2992             #   1 == /SUBSYSTEM:CONSOLE
2993             #   2 == /SUBSYSTEM:WINDOWS
2994             # Most of the executables we'll ever create are tests
2995             # and utilities with console output.
2996             'SubSystem': '1',
2997           },
2998           'VCMIDLTool': {
2999             'GenerateStublessProxies': 'true',
3000             'TypeLibraryName': '$(InputName).tlb',
3001             'OutputDirectory': '$(IntDir)',
3002             'HeaderFileName': '$(InputName).h',
3003             'DLLDataFileName': '$(InputName).dlldata.c',
3004             'InterfaceIdentifierFileName': '$(InputName)_i.c',
3005             'ProxyFileName': '$(InputName)_p.c',
3006           },
3007           'VCResourceCompilerTool': {
3008             'Culture' : '1033',
3009             'AdditionalIncludeDirectories': [
3010               '<(DEPTH)',
3011               '<(SHARED_INTERMEDIATE_DIR)',
3012             ],
3013           },
3014         },
3015       },
3016     }],
3017     ['disable_nacl==1', {
3018       'target_defaults': {
3019         'defines': [
3020           'DISABLE_NACL',
3021         ],
3022       },
3023     }],
3024     ['OS=="win" and msvs_use_common_linker_extras', {
3025       'target_defaults': {
3026         'msvs_settings': {
3027           'VCLinkerTool': {
3028             'DelayLoadDLLs': [
3029               'dbghelp.dll',
3030               'dwmapi.dll',
3031               'shell32.dll',
3032               'uxtheme.dll',
3033             ],
3034           },
3035         },
3036         'configurations': {
3037           'x86_Base': {
3038             'msvs_settings': {
3039               'VCLinkerTool': {
3040                 'AdditionalOptions': [
3041                   '/safeseh',
3042                   '/dynamicbase',
3043                   '/ignore:4199',
3044                   '/ignore:4221',
3045                   '/nxcompat',
3046                 ],
3047               },
3048             },
3049           },
3050           'x64_Base': {
3051             'msvs_settings': {
3052               'VCLinkerTool': {
3053                 'AdditionalOptions': [
3054                   # safeseh is not compatible with x64
3055                   '/dynamicbase',
3056                   '/ignore:4199',
3057                   '/ignore:4221',
3058                   '/nxcompat',
3059                 ],
3060               },
3061             },
3062           },
3063         },
3064       },
3065     }],
3066     ['enable_new_npdevice_api==1', {
3067       'target_defaults': {
3068         'defines': [
3069           'ENABLE_NEW_NPDEVICE_API',
3070         ],
3071       },
3072     }],
3073     ['clang==1 and OS!="android"', {
3074       'make_global_settings': [
3075         ['CC', '<(make_clang_dir)/bin/clang'],
3076         ['CXX', '<(make_clang_dir)/bin/clang++'],
3077         ['LINK', '$(CXX)'],
3078         ['CC.host', '$(CC)'],
3079         ['CXX.host', '$(CXX)'],
3080         ['LINK.host', '$(LINK)'],
3081       ],
3082     }],
3083     ['OS=="android" and "<(GENERATOR)"!="ninja"', {
3084       # Hardcode the compiler names in the Makefile so that
3085       # it won't depend on the environment at make time.
3086       'make_global_settings': [
3087         ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN}/*-gcc)'],
3088         ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN}/*-g++)'],
3089         ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN}/*-gcc)'],
3090         ['CC.host', '<!(which gcc)'],
3091         ['CXX.host', '<!(which g++)'],
3092         ['LINK.host', '<!(which g++)'],
3093       ],
3094     }],
3095   ],
3096   'xcode_settings': {
3097     # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
3098     # This block adds *project-wide* configuration settings to each project
3099     # file.  It's almost always wrong to put things here.  Specify your
3100     # custom xcode_settings in target_defaults to add them to targets instead.
3102     # In an Xcode Project Info window, the "Base SDK for All Configurations"
3103     # setting sets the SDK on a project-wide basis.  In order to get the
3104     # configured SDK to show properly in the Xcode UI, SDKROOT must be set
3105     # here at the project level.
3106     'SDKROOT': 'macosx<(mac_sdk)',  # -isysroot
3108     # The Xcode generator will look for an xcode_settings section at the root
3109     # of each dict and use it to apply settings on a file-wide basis.  Most
3110     # settings should not be here, they should be in target-specific
3111     # xcode_settings sections, or better yet, should use non-Xcode-specific
3112     # settings in target dicts.  SYMROOT is a special case, because many other
3113     # Xcode variables depend on it, including variables such as
3114     # PROJECT_DERIVED_FILE_DIR.  When a source group corresponding to something
3115     # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
3116     # files to appear (when present) in the UI as actual files and not red
3117     # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
3118     # and therefore SYMROOT, needs to be set at the project level.
3119     'SYMROOT': '<(DEPTH)/xcodebuild',
3120   },