Bug 1569017 [wpt PR 18089] - [ElementTiming] Set startTime, a=testonly
[gecko.git] / build / gyp_includes / common.gypi
blobb75d54d047efe4c569632da80ad9ccf87ac1fe71
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 # IMPORTANT:
6 # Please don't directly include this file if you are building via gyp_chromium,
7 # since gyp_chromium is automatically forcing its inclusion.
9   # Variables expected to be overriden on the GYP command line (-D) or by
10   # ~/.gyp/include.gypi.
11   'variables': {
12     # Putting a variables dict inside another variables dict looks kind of
13     # weird.  This is done so that 'host_arch', 'chromeos', etc are defined as
14     # variables within the outer variables dict here.  This is necessary
15     # to get these variables defined for the conditions within this variables
16     # dict that operate on these variables.
17     'variables': {
18       'variables': {
19         'variables': {
20           'variables': {
21             # Whether we're building a ChromeOS build.
22             'chromeos%': 0,
24             # Whether or not we are using the Aura windowing framework.
25             'use_aura%': 0,
27             # Whether or not we are building the Ash shell.
28             'use_ash%': 0,
29           },
30           # Copy conditionally-set variables out one scope.
31           'chromeos%': '<(chromeos)',
32           'use_aura%': '<(use_aura)',
33           'use_ash%': '<(use_ash)',
35           # Whether we are using Views Toolkit
36           'toolkit_views%': 0,
38           # Use OpenSSL instead of NSS. Under development: see http://crbug.com/62803
39           'use_openssl%': 0,
41           'use_ibus%': 0,
43           # Disable viewport meta tag by default.
44           'enable_viewport%': 0,
46           # Enable HiDPI support.
47           'enable_hidpi%': 0,
49           # Enable touch optimized art assets and metrics.
50           'enable_touch_ui%': 0,
52           # Is this change part of the android upstream bringup?
53           # Allows us to *temporarily* disable certain things for
54           # staging.  Only set to 1 in a GYP_DEFINES.
55           'android_upstream_bringup%': 0,
57           # Override buildtype to select the desired build flavor.
58           # Dev - everyday build for development/testing
59           # Official - release build (generally implies additional processing)
60           # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
61           # conversion is done), some of the things which are now controlled by
62           # 'branding', such as symbol generation, will need to be refactored
63           # based on 'buildtype' (i.e. we don't care about saving symbols for
64           # non-Official # builds).
65           'buildtype%': 'Dev',
67           'conditions': [
68             # ChromeOS implies ash.
69             ['chromeos==1', {
70               'use_ash%': 1,
71               'use_aura%': 1,
72             }],
74             # For now, Windows builds that |use_aura| should also imply using
75             # ash. This rule should be removed for the future when Windows is
76             # using the aura windows without the ash interface.
77             ['use_aura==1 and OS=="win"', {
78               'use_ash%': 1,
79             }],
80             ['use_ash==1', {
81               'use_aura%': 1,
82             }],
84             # A flag for BSD platforms
85             ['OS=="dragonfly" or OS=="freebsd" or OS=="netbsd" or \
86               OS=="openbsd"', {
87               'os_bsd%': 1,
88             }, {
89               'os_bsd%': 0,
90             }],
91           ],
92         },
93         # Copy conditionally-set variables out one scope.
94         'chromeos%': '<(chromeos)',
95         'use_aura%': '<(use_aura)',
96         'use_ash%': '<(use_ash)',
97         'os_bsd%': '<(os_bsd)',
98         'use_openssl%': '<(use_openssl)',
99         'use_ibus%': '<(use_ibus)',
100         'enable_viewport%': '<(enable_viewport)',
101         'enable_hidpi%': '<(enable_hidpi)',
102         'enable_touch_ui%': '<(enable_touch_ui)',
103         'android_upstream_bringup%': '<(android_upstream_bringup)',
104         'buildtype%': '<(buildtype)',
106         # Sets whether we're building with the Android SDK/NDK (and hence with
107         # Ant, value 0), or as part of the Android system (and hence with the
108         # Android build system, value 1).
109         'android_build_type%': 0,
111         # Compute the architecture that we're building on.
112         'conditions': [
113           ['OS=="win" or OS=="ios"', {
114             'host_arch%': 'ia32',
115           }, {
116             # This handles the Unix platforms for which there is some support.
117             # Anything else gets passed through, which probably won't work very
118             # well; such hosts should pass an explicit target_arch to gyp.
119             'host_arch%':
120               '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/")',
121           }],
123           # Set default value of toolkit_views based on OS.
124           ['OS=="win" or chromeos==1 or use_aura==1', {
125             'toolkit_views%': 1,
126           }, {
127             'toolkit_views%': 0,
128           }],
130           # Set toolkit_uses_gtk for the Chromium browser on Linux.
131           ['(OS=="linux" or OS=="solaris" or os_bsd==1) and use_aura==0', {
132             'toolkit_uses_gtk%': 1,
133           }, {
134             'toolkit_uses_gtk%': 0,
135           }],
137           # Enable HiDPI on Mac OS and Chrome OS.
138           ['OS=="mac" or chromeos==1', {
139             'enable_hidpi%': 1,
140           }],
142           # Enable touch UI on Metro.
143           ['OS=="win"', {
144             'enable_touch_ui%': 1,
145           }],
146         ],
147       },
149       # Copy conditionally-set variables out one scope.
150       'chromeos%': '<(chromeos)',
151       'host_arch%': '<(host_arch)',
152       'toolkit_views%': '<(toolkit_views)',
153       'toolkit_uses_gtk%': '<(toolkit_uses_gtk)',
154       'use_aura%': '<(use_aura)',
155       'use_ash%': '<(use_ash)',
156       'os_bsd%': '<(os_bsd)',
157       'use_openssl%': '<(use_openssl)',
158       'use_ibus%': '<(use_ibus)',
159       'enable_viewport%': '<(enable_viewport)',
160       'enable_hidpi%': '<(enable_hidpi)',
161       'enable_touch_ui%': '<(enable_touch_ui)',
162       'android_upstream_bringup%': '<(android_upstream_bringup)',
163       'android_build_type%': '<(android_build_type)',
165       # We used to provide a variable for changing how libraries were built.
166       # This variable remains until we can clean up all the users.
167       # This needs to be one nested variables dict in so that dependent
168       # gyp files can make use of it in their outer variables.  (Yikes!)
169       # http://code.google.com/p/chromium/issues/detail?id=83308
170       'library%': 'static_library',
172       # Override branding to select the desired branding flavor.
173       'branding%': 'Chromium',
175       'buildtype%': '<(buildtype)',
177       # Default architecture we're building for is the architecture we're
178       # building on.
179       'target_arch%': '<(host_arch)',
181       # This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are
182       # are built under a chromium full build (1) or a webkit.org chromium
183       # build (0).
184       'inside_chromium_build%': 1,
186       # Set to 1 to enable fast builds. It disables debug info for fastest
187       # compilation.
188       'fastbuild%': 0,
190       # Set to 1 to enable dcheck in release without having to use the flag.
191       'dcheck_always_on%': 0,
193       # Disable file manager component extension by default.
194       'file_manager_extension%': 0,
196       # Python version.
197       'python_ver%': '2.6',
199       # Set ARM version (for libyuv)
200       'arm_version%': 6,
202       # Set ARM-v7 compilation flags
203       'armv7%': 0,
205       # Set Neon compilation flags (only meaningful if armv7==1).
206       'arm_neon%': 1,
207       'arm_neon_optional%': 0,
209       # The system root for cross-compiles. Default: none.
210       'sysroot%': '',
212       # The system libdir used for this ABI.
213       'system_libdir%': 'lib',
215       # On Linux, we build with sse2 for Chromium builds.
216       'disable_sse2%': 0,
218       # Use libjpeg-turbo as the JPEG codec used by Chromium.
219       'use_libjpeg_turbo%': 1,
221       # Use system libjpeg. Note that the system's libjepg will be used even if
222       # use_libjpeg_turbo is set.
223       'use_system_libjpeg%': 0,
225       # Use system libvpx
226       'use_system_libvpx%': 0,
228       # Variable 'component' is for cases where we would like to build some
229       # components as dynamic shared libraries but still need variable
230       # 'library' for static libraries.
231       # By default, component is set to whatever library is set to and
232       # it can be overriden by the GYP command line or by ~/.gyp/include.gypi.
233       'component%': 'static_library',
235       # Set to select the Title Case versions of strings in GRD files.
236       'use_titlecase_in_grd_files%': 0,
238       # Use translations provided by volunteers at launchpad.net.  This
239       # currently only works on Linux.
240       'use_third_party_translations%': 0,
242       # Remoting compilation is enabled by default. Set to 0 to disable.
243       'remoting%': 1,
245       # Configuration policy is enabled by default. Set to 0 to disable.
246       'configuration_policy%': 1,
248       # Safe browsing is compiled in by default. Set to 0 to disable.
249       'safe_browsing%': 1,
251       # Speech input is compiled in by default. Set to 0 to disable.
252       'input_speech%': 1,
254       # Notifications are compiled in by default. Set to 0 to disable.
255       'notifications%' : 1,
257       # If this is set, the clang plugins used on the buildbot will be used.
258       # Run tools/clang/scripts/update.sh to make sure they are compiled.
259       # This causes 'clang_chrome_plugins_flags' to be set.
260       # Has no effect if 'clang' is not set as well.
261       'clang_use_chrome_plugins%': 1,
263       # Enable building with ASAN (Clang's -faddress-sanitizer option).
264       # -faddress-sanitizer only works with clang, but asan=1 implies clang=1
265       # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
266       'asan%': 0,
268       # Enable building with TSAN (Clang's -fthread-sanitizer option).
269       # -fthread-sanitizer only works with clang, but tsan=1 implies clang=1
270       # See http://clang.llvm.org/docs/ThreadSanitizer.html
271       'tsan%': 0,
273       # Use a modified version of Clang to intercept allocated types and sizes
274       # for allocated objects. clang_type_profiler=1 implies clang=1.
275       # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
276       # TODO(dmikurube): Support mac.  See http://crbug.com/123758#c11
277       'clang_type_profiler%': 0,
279       # Set to true to instrument the code with function call logger.
280       # See src/third_party/cygprofile/cyg-profile.cc for details.
281       'order_profiling%': 0,
283       # Use the provided profiled order file to link Chrome image with it.
284       # This makes Chrome faster by better using CPU cache when executing code.
285       # This is known as PGO (profile guided optimization).
286       # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
287       'order_text_section%' : "",
289       # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
290       # libraries on linux x86-64 and arm, plus ASLR.
291       'linux_fpic%': 1,
293       # Whether one-click signin is enabled or not.
294       'enable_one_click_signin%': 0,
296       # Enable Web Intents support in WebKit.
297       'enable_web_intents%': 1,
299       # Enable Chrome browser extensions
300       'enable_extensions%': 1,
302       # Enable browser automation.
303       'enable_automation%': 1,
305       # Enable printing support and UI.
306       'enable_printing%': 1,
308       # Enable Web Intents web content registration via HTML element
309       # and WebUI managing such registrations.
310       'enable_web_intents_tag%': 0,
312       # Webrtc compilation is enabled by default. Set to 0 to disable.
313       'enable_webrtc%': 1,
315       # PPAPI by default does not support plugins making calls off the main
316       # thread. Set to 1 to turn on experimental support for out-of-process
317       # plugins to make call of the main thread.
318       'enable_pepper_threading%': 0,
320       # Enables use of the session service, which is enabled by default.
321       # Support for disabling depends on the platform.
322       'enable_session_service%': 1,
324       # Enables theme support, which is enabled by default.  Support for
325       # disabling depends on the platform.
326       'enable_themes%': 1,
328       # Uses OEM-specific wallpaper resources on Chrome OS.
329       'use_oem_wallpaper%': 0,
331       # Enables support for background apps.
332       'enable_background%': 1,
334       # Enable the task manager by default.
335       'enable_task_manager%': 1,
337       # Enable FTP support by default.
338       'disable_ftp_support%': 0,
340       # XInput2 multitouch support is disabled by default (use_xi2_mt=0).
341       # Setting to non-zero value enables XI2 MT. When XI2 MT is enabled,
342       # the input value also defines the required XI2 minor minimum version.
343       # For example, use_xi2_mt=2 means XI2.2 or above version is required.
344       'use_xi2_mt%': 0,
346       # Use of precompiled headers on Windows.
347       #
348       # This is on by default in VS 2010, but off by default for VS
349       # 2008 because of complications that it can cause with our
350       # trybots etc.
351       #
352       # This variable may be explicitly set to 1 (enabled) or 0
353       # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
354       # This setting will override the default.
355       #
356       # Note that a setting of 1 is probably suitable for most or all
357       # Windows developers using VS 2008, since precompiled headers
358       # provide a build speedup of 20-25%.  There are a couple of
359       # small workarounds you may need to use when using VS 2008 (but
360       # not 2010), see
361       # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
362       # for details.
363       'chromium_win_pch%': 0,
365       # Set this to true when building with Clang.
366       # See http://code.google.com/p/chromium/wiki/Clang for details.
367       'clang%': 0,
369       # Enable plug-in installation by default.
370       'enable_plugin_installation%': 1,
372       # Enable protector service by default.
373       'enable_protector_service%': 1,
375       # Specifies whether to use canvas_skia.cc in place of platform
376       # specific implementations of gfx::Canvas. Affects text drawing in the
377       # Chrome UI.
378       # TODO(asvitkine): Enable this on all platforms and delete this flag.
379       #                  http://crbug.com/105550
380       'use_canvas_skia%': 0,
382       # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
383       # with one of those tools.
384       'build_for_tool%': '',
386       # Whether tests targets should be run, archived or just have the
387       # dependencies verified. All the tests targets have the '_run' suffix,
388       # e.g. base_unittests_run runs the target base_unittests. The test target
389       # always calls tools/swarm_client/isolate.py. See the script's --help for
390       # more information and the valid --mode values. Meant to be overriden with
391       # GYP_DEFINES.
392       # TODO(maruel): Converted the default from 'check' to 'noop' so work can
393       # be done while the builders are being reconfigured to check out test data
394       # files.
395       'test_isolation_mode%': 'noop',
396       # It must not be '<(PRODUCT_DIR)' alone, the '/' is necessary otherwise
397       # gyp will remove duplicate flags, causing isolate.py to be confused.
398       'test_isolation_outdir%': '<(PRODUCT_DIR)/isolate',
400        # Force rlz to use chrome's networking stack.
401       'force_rlz_use_chrome_net%': 1,
403       'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
404       'wix_path%': '<(DEPTH)/third_party/wix',
406       'conditions': [
407         # TODO(epoger): Figure out how to set use_skia=1 for Mac outside of
408         # the 'conditions' clause.  Initial attempts resulted in chromium and
409         # webkit disagreeing on its setting.
410         ['OS=="mac"', {
411           'use_skia%': 1,
412         }, {
413           'use_skia%': 1,
414         }],
416         # A flag for POSIX platforms
417         ['OS=="win"', {
418           'os_posix%': 0,
419         }, {
420           'os_posix%': 1,
421         }],
423         # NSS usage.
424         ['(OS=="linux" or OS=="solaris" or os_bsd==1) and use_openssl==0', {
425           'use_nss%': 1,
426         }, {
427           'use_nss%': 0,
428         }],
430         # Flags to use X11 on non-Mac POSIX platforms
431         ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android"', {
432           'use_glib%': 0,
433           'use_x11%': 0,
434         }, {
435           'use_glib%': 1,
436           'use_x11%': 1,
437         }],
439         # We always use skia text rendering in Aura on Windows, since GDI
440         # doesn't agree with our BackingStore.
441         # TODO(beng): remove once skia text rendering is on by default.
442         ['use_aura==1 and OS=="win"', {
443           'enable_skia_text%': 1,
444         }],
446         # A flag to enable or disable our compile-time dependency
447         # on gnome-keyring. If that dependency is disabled, no gnome-keyring
448         # support will be available. This option is useful
449         # for Linux distributions and for Aura.
450         ['chromeos==1 or use_aura==1', {
451           'use_gnome_keyring%': 0,
452         }, {
453           'use_gnome_keyring%': 1,
454         }],
456         ['toolkit_uses_gtk==1 or OS=="mac" or OS=="ios"', {
457           # GTK+, Mac and iOS want Title Case strings
458           'use_titlecase_in_grd_files%': 1,
459         }],
461         # Enable file manager extension on Chrome OS.
462         ['chromeos==1', {
463           'file_manager_extension%': 1,
464         }, {
465           'file_manager_extension%': 0,
466         }],
468         ['OS=="win" or OS=="mac" or (OS=="linux" and use_aura==0)', {
469           'enable_one_click_signin%': 1,
470         }],
472         ['OS=="android"', {
473           'enable_extensions%': 0,
474           'enable_printing%': 0,
475           'enable_themes%': 0,
476           'enable_webrtc%': 0,
477           'proprietary_codecs%': 1,
478           'remoting%': 0,
479         }],
481         ['OS=="ios"', {
482           'configuration_policy%': 0,
483           'disable_ftp_support%': 1,
484           'enable_automation%': 0,
485           'enable_extensions%': 0,
486           'enable_printing%': 0,
487           'enable_themes%': 0,
488           'enable_webrtc%': 0,
489           'notifications%': 0,
490           'remoting%': 0,
491         }],
493         # Use GPU accelerated cross process image transport by default
494         # on linux builds with the Aura window manager
495         ['use_aura==1 and OS=="linux"', {
496           'ui_compositor_image_transport%': 1,
497         }, {
498           'ui_compositor_image_transport%': 0,
499         }],
501         # Turn precompiled headers on by default for VS 2010.
502         ['OS=="win" and MSVS_VERSION=="2010" and buildtype!="Official"', {
503           'chromium_win_pch%': 1
504         }],
506         ['use_aura==1 or chromeos==1 or OS=="android"', {
507           'enable_plugin_installation%': 0,
508         }, {
509           'enable_plugin_installation%': 1,
510         }],
512         ['OS=="android" or OS=="ios"', {
513           'enable_protector_service%': 0,
514         }, {
515           'enable_protector_service%': 1,
516         }],
518         # linux_use_gold_binary: whether to use the binary checked into
519         # third_party/gold.
520         ['OS=="linux"', {
521           'linux_use_gold_binary%': 1,
522         }, {
523           'linux_use_gold_binary%': 0,
524         }],
526         # linux_use_gold_flags: whether to use build flags that rely on gold.
527         # On by default for x64 Linux.  Temporarily off for ChromeOS as
528         # it failed on a buildbot.
529         ['OS=="linux" and chromeos==0', {
530           'linux_use_gold_flags%': 1,
531         }, {
532           'linux_use_gold_flags%': 0,
533         }],
535         ['OS=="android"', {
536           'enable_captive_portal_detection%': 0,
537         }, {
538           'enable_captive_portal_detection%': 1,
539         }],
541         # Enable Skia UI text drawing incrementally on different platforms.
542         # http://crbug.com/105550
543         #
544         # On Aura, this allows per-tile painting to be used in the browser
545         # compositor.
546         ['OS!="mac" and OS!="android"', {
547           'use_canvas_skia%': 1,
548         }],
550         ['chromeos==1', {
551           # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
552           'use_libjpeg_turbo%': 0,
553         }],
555         ['OS=="android"', {
556           # When building as part of the Android system, use system libraries
557           # where possible to reduce ROM size.
558           'use_system_libjpeg%': '<(android_build_type)',
559         }],
560       ],
562       # Set this to 1 to use the Google-internal file containing
563       # official API keys for Google Chrome even in a developer build.
564       # Setting this variable explicitly to 1 will cause your build to
565       # fail if the internal file is missing.
566       #
567       # Set this to 0 to not use the internal file, even when it
568       # exists in your checkout.
569       #
570       # Leave set to 2 to have this variable implicitly set to 1 if
571       # you have src/google_apis/internal/google_chrome_api_keys.h in
572       # your checkout, and implicitly set to 0 if not.
573       #
574       # Note that official builds always behave as if this variable
575       # was explicitly set to 1, i.e. they always use official keys,
576       # and will fail to build if the internal file is missing.
577       'use_official_google_api_keys%': 2,
579       # Set these to bake the specified API keys and OAuth client
580       # IDs/secrets into your build.
581       #
582       # If you create a build without values baked in, you can instead
583       # set environment variables to provide the keys at runtime (see
584       # src/google_apis/google_api_keys.h for details).  Features that
585       # require server-side APIs may fail to work if no keys are
586       # provided.
587       #
588       # Note that if you are building an official build or if
589       # use_official_google_api_keys has been set to 1 (explicitly or
590       # implicitly), these values will be ignored and the official
591       # keys will be used instead.
592       'google_api_key%': '',
593       'google_default_client_id%': '',
594       'google_default_client_secret%': '',
595     },
597     # Copy conditionally-set variables out one scope.
598     'branding%': '<(branding)',
599     'buildtype%': '<(buildtype)',
600     'target_arch%': '<(target_arch)',
601     'host_arch%': '<(host_arch)',
602     'library%': 'static_library',
603     'toolkit_views%': '<(toolkit_views)',
604     'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
605     'use_aura%': '<(use_aura)',
606     'use_ash%': '<(use_ash)',
607     'use_openssl%': '<(use_openssl)',
608     'use_ibus%': '<(use_ibus)',
609     'use_nss%': '<(use_nss)',
610     'os_bsd%': '<(os_bsd)',
611     'os_posix%': '<(os_posix)',
612     'use_glib%': '<(use_glib)',
613     'toolkit_uses_gtk%': '<(toolkit_uses_gtk)',
614     'use_skia%': '<(use_skia)',
615     'use_x11%': '<(use_x11)',
616     'use_gnome_keyring%': '<(use_gnome_keyring)',
617     'linux_fpic%': '<(linux_fpic)',
618     'enable_pepper_threading%': '<(enable_pepper_threading)',
619     'chromeos%': '<(chromeos)',
620     'enable_viewport%': '<(enable_viewport)',
621     'enable_hidpi%': '<(enable_hidpi)',
622     'enable_touch_ui%': '<(enable_touch_ui)',
623     'use_xi2_mt%':'<(use_xi2_mt)',
624     'file_manager_extension%': '<(file_manager_extension)',
625     'inside_chromium_build%': '<(inside_chromium_build)',
626     'fastbuild%': '<(fastbuild)',
627     'dcheck_always_on%': '<(dcheck_always_on)',
628     'python_ver%': '<(python_ver)',
629     'arm_version%': '<(arm_version)',
630     'armv7%': '<(armv7)',
631     'arm_neon%': '<(arm_neon)',
632     'arm_neon_optional%': '<(arm_neon_optional)',
633     'sysroot%': '<(sysroot)',
634     'system_libdir%': '<(system_libdir)',
635     'component%': '<(component)',
636     'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
637     'use_third_party_translations%': '<(use_third_party_translations)',
638     'remoting%': '<(remoting)',
639     'enable_one_click_signin%': '<(enable_one_click_signin)',
640     'enable_webrtc%': '<(enable_webrtc)',
641     'chromium_win_pch%': '<(chromium_win_pch)',
642     'configuration_policy%': '<(configuration_policy)',
643     'safe_browsing%': '<(safe_browsing)',
644     'input_speech%': '<(input_speech)',
645     'notifications%': '<(notifications)',
646     'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
647     'asan%': '<(asan)',
648     'tsan%': '<(tsan)',
649     'clang_type_profiler%': '<(clang_type_profiler)',
650     'order_profiling%': '<(order_profiling)',
651     'order_text_section%': '<(order_text_section)',
652     'enable_extensions%': '<(enable_extensions)',
653     'enable_web_intents%': '<(enable_web_intents)',
654     'enable_web_intents_tag%': '<(enable_web_intents_tag)',
655     'enable_plugin_installation%': '<(enable_plugin_installation)',
656     'enable_protector_service%': '<(enable_protector_service)',
657     'enable_session_service%': '<(enable_session_service)',
658     'enable_themes%': '<(enable_themes)',
659     'use_oem_wallpaper%': '<(use_oem_wallpaper)',
660     'enable_background%': '<(enable_background)',
661     'linux_use_gold_binary%': '<(linux_use_gold_binary)',
662     'linux_use_gold_flags%': '<(linux_use_gold_flags)',
663     'use_canvas_skia%': '<(use_canvas_skia)',
664     'test_isolation_mode%': '<(test_isolation_mode)',
665     'test_isolation_outdir%': '<(test_isolation_outdir)',
666     'enable_automation%': '<(enable_automation)',
667     'enable_printing%': '<(enable_printing)',
668     'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
669     'disable_ftp_support%': '<(disable_ftp_support)',
670     'force_rlz_use_chrome_net%': '<(force_rlz_use_chrome_net)',
671     'enable_task_manager%': '<(enable_task_manager)',
672     'sas_dll_path%': '<(sas_dll_path)',
673     'wix_path%': '<(wix_path)',
674     'android_upstream_bringup%': '<(android_upstream_bringup)',
675     'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
676     'use_system_libjpeg%': '<(use_system_libjpeg)',
677     'android_build_type%': '<(android_build_type)',
678     'use_official_google_api_keys%': '<(use_official_google_api_keys)',
679     'google_api_key%': '<(google_api_key)',
680     'google_default_client_id%': '<(google_default_client_id)',
681     'google_default_client_secret%': '<(google_default_client_secret)',
683     # Use system yasm instead of bundled one.
684     'use_system_yasm%': 0,
686     # Default to enabled PIE; this is important for ASLR but we may need to be
687     # able to turn it off for various reasons.
688     'linux_disable_pie%': 0,
690     # The release channel that this build targets. This is used to restrict
691     # channel-specific build options, like which installer packages to create.
692     # The default is 'all', which does no channel-specific filtering.
693     'channel%': 'all',
695     # Override chromium_mac_pch and set it to 0 to suppress the use of
696     # precompiled headers on the Mac.  Prefix header injection may still be
697     # used, but prefix headers will not be precompiled.  This is useful when
698     # using distcc to distribute a build to compile slaves that don't
699     # share the same compiler executable as the system driving the compilation,
700     # because precompiled headers rely on pointers into a specific compiler
701     # executable's image.  Setting this to 0 is needed to use an experimental
702     # Linux-Mac cross compiler distcc farm.
703     'chromium_mac_pch%': 1,
705     # The default value for mac_strip in target_defaults. This cannot be
706     # set there, per the comment about variable% in a target_defaults.
707     'mac_strip_release%': 1,
709     # Set to 1 to enable code coverage.  In addition to build changes
710     # (e.g. extra CFLAGS), also creates a new target in the src/chrome
711     # project file called "coverage".
712     # Currently ignored on Windows.
713     'coverage%': 0,
715     # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
716     # This is useful for parallel compilation tools which can't support /Zi.
717     # Only used on Windows.
718     'win_z7%' : 0,
720     # Although base/allocator lets you select a heap library via an
721     # environment variable, the libcmt shim it uses sometimes gets in
722     # the way.  To disable it entirely, and switch to normal msvcrt, do e.g.
723     #  'win_use_allocator_shim': 0,
724     #  'win_release_RuntimeLibrary': 2
725     # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
726     'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
728     # Whether usage of OpenMAX is enabled.
729     'enable_openmax%': 0,
731     # Whether proprietary audio/video codecs are assumed to be included with
732     # this build (only meaningful if branding!=Chrome).
733     'proprietary_codecs%': 0,
735     # TODO(bradnelson): eliminate this when possible.
736     # To allow local gyp files to prevent release.vsprops from being included.
737     # Yes(1) means include release.vsprops.
738     # Once all vsprops settings are migrated into gyp, this can go away.
739     'msvs_use_common_release%': 1,
741     # TODO(bradnelson): eliminate this when possible.
742     # To allow local gyp files to override additional linker options for msvs.
743     # Yes(1) means set use the common linker options.
744     'msvs_use_common_linker_extras%': 1,
746     # TODO(sgk): eliminate this if possible.
747     # It would be nicer to support this via a setting in 'target_defaults'
748     # in chrome/app/locales/locales.gypi overriding the setting in the
749     # 'Debug' configuration in the 'target_defaults' dict below,
750     # but that doesn't work as we'd like.
751     'msvs_debug_link_incremental%': '2',
753     # Needed for some of the largest modules.
754     'msvs_debug_link_nonincremental%': '1',
756     # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
757     # to get incremental linking to be faster in debug builds.
758     'incremental_chrome_dll%': '0',
760     # The default settings for third party code for treating
761     # warnings-as-errors. Ideally, this would not be required, however there
762     # is some third party code that takes a long time to fix/roll. So, this
763     # flag allows us to have warnings as errors in general to prevent
764     # regressions in most modules, while working on the bits that are
765     # remaining.
766     'win_third_party_warn_as_error%': 'true',
768     # This is the location of the sandbox binary. Chrome looks for this before
769     # running the zygote process. If found, and SUID, it will be used to
770     # sandbox the zygote process and, thus, all renderer processes.
771     'linux_sandbox_path%': '',
773     # Set this to true to enable SELinux support.
774     'selinux%': 0,
776     # Clang stuff.
777     'clang%': '<(clang)',
778     'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
780     # These two variables can be set in GYP_DEFINES while running
781     # |gclient runhooks| to let clang run a plugin in every compilation.
782     # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
783     # Example:
784     #     GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
786     'clang_load%': '',
787     'clang_add_plugin%': '',
789     # The default type of gtest.
790     'gtest_target_type%': 'executable',
792     # Enable sampling based profiler.
793     # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
794     'profiling%': '0',
796     # Enable strict glibc debug mode.
797     'glibcxx_debug%': 0,
799     # Override whether we should use Breakpad on Linux. I.e. for Chrome bot.
800     'linux_breakpad%': 0,
801     # And if we want to dump symbols for Breakpad-enabled builds.
802     'linux_dump_symbols%': 0,
803     # And if we want to strip the binary after dumping symbols.
804     'linux_strip_binary%': 0,
805     # Strip the test binaries needed for Linux reliability tests.
806     'linux_strip_reliability_tests%': 0,
808     # Enable TCMalloc.
809     'linux_use_tcmalloc%': 1,
811     # Disable TCMalloc's debugallocation.
812     'linux_use_debugallocation%': 0,
814     # Disable TCMalloc's heapchecker.
815     'linux_use_heapchecker%': 0,
817     # Disable shadow stack keeping used by heapcheck to unwind the stacks
818     # better.
819     'linux_keep_shadow_stacks%': 0,
821     # Set to 1 to link against libgnome-keyring instead of using dlopen().
822     'linux_link_gnome_keyring%': 0,
823     # Set to 1 to link against gsettings APIs instead of using dlopen().
824     'linux_link_gsettings%': 0,
826     # Set Thumb compilation flags.
827     'arm_thumb%': 0,
829     # Set ARM fpu compilation flags (only meaningful if armv7==1 and
830     # arm_neon==0).
831     'arm_fpu%': 'vfpv3',
833     # Set ARM float abi compilation flag.
834     'arm_float_abi%': 'softfp',
836     # Enable new NPDevice API.
837     'enable_new_npdevice_api%': 0,
839     # Enable EGLImage support in OpenMAX
840     'enable_eglimage%': 1,
842     # Enable a variable used elsewhere throughout the GYP files to determine
843     # whether to compile in the sources for the GPU plugin / process.
844     'enable_gpu%': 1,
846     # .gyp files or targets should set chromium_code to 1 if they build
847     # Chromium-specific code, as opposed to external code.  This variable is
848     # used to control such things as the set of warnings to enable, and
849     # whether warnings are treated as errors.
850     'chromium_code%': 0,
852     'release_valgrind_build%': 0,
854     # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
855     'enable_wexit_time_destructors%': 0,
857     # Set to 1 to compile with the built in pdf viewer.
858     'internal_pdf%': 0,
860     # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
861     'internal_gles2_conform_tests%': 0,
863     # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
864     # so Cocoa is happy (http://crbug.com/20441).
865     'locales': [
866       'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
867       'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
868       'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
869       'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
870       'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
871       'vi', 'zh-CN', 'zh-TW',
872     ],
874     # Pseudo locales are special locales which are used for testing and
875     # debugging. They don't get copied to the final app. For more info,
876     # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
877     'pseudo_locales': [
878       'fake-bidi',
879     ],
881     'grit_defines': [],
883     # If debug_devtools is set to 1, JavaScript files for DevTools are
884     # stored as is and loaded from disk. Otherwise, a concatenated file
885     # is stored in resources.pak. It is still possible to load JS files
886     # from disk by passing --debug-devtools cmdline switch.
887     'debug_devtools%': 0,
889     # The Java Bridge is not compiled in by default.
890     'java_bridge%': 0,
892     # Code signing for iOS binaries.  The bots need to be able to disable this.
893     'chromium_ios_signing%': 1,
895     # This flag is only used when disable_nacl==0 and disables all those
896     # subcomponents which would require the installation of a native_client
897     # untrusted toolchain.
898     'disable_nacl_untrusted%': 0,
900     # Disable Dart by default.
901     'enable_dart%': 0,
903     # The desired version of Windows SDK can be set in ~/.gyp/include.gypi.
904     'msbuild_toolset%': '',
906     # Native Client is enabled by default.
907     'disable_nacl%': 0,
909     # Whether to build full debug version for Debug configuration on Android.
910     # Compared to full debug version, the default Debug configuration on Android
911     # has no full v8 debug, has size optimization and linker gc section, so that
912     # we can build a debug version with acceptable size and performance.
913     'android_full_debug%': 0,
915     # Sets the default version name and code for Android app, by default we
916     # do a developer build.
917     'android_app_version_name%': 'Developer Build',
918     'android_app_version_code%': 0,
920     'sas_dll_exists': 0, # '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(sas_dll_path))',
921     'wix_exists': 0, # '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(wix_path))',
923     'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
924 #    'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
925     'windows_sdk_path%': '<(windows_sdk_default_path)',
927     'conditions': [
928       #['"<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(windows_sdk_default_path))"=="True"', {
929       #  'windows_sdk_path%': '<(windows_sdk_default_path)',
930       #}, {
931       #  'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
932       #}],
933       #['OS=="win" and "<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(directx_sdk_default_path))"=="True"', {
934       #  'directx_sdk_path%': '<(directx_sdk_default_path)',
935       #}, {
936       #  'directx_sdk_path%': '$(DXSDK_DIR)',
937       #}],
938       # If use_official_google_api_keys is already set (to 0 or 1), we
939       # do none of the implicit checking.  If it is set to 1 and the
940       # internal keys file is missing, the build will fail at compile
941       # time.  If it is set to 0 and keys are not provided by other
942       # means, a warning will be printed at compile time.
943       ['use_official_google_api_keys==2', {
944         'use_official_google_api_keys%':
945             '<!(<(PYTHON) <(DEPTH)/google_apis/build/check_internal.py <(DEPTH)/google_apis/internal/google_chrome_api_keys.h)',
946       }],
947       ['os_posix==1 and OS!="mac" and OS!="ios"', {
948         # Figure out the python architecture to decide if we build pyauto.
949         # disabled for mozilla because windows != mac and this runs a shell script
950         #        'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/<(system_libdir)/libpython<(python_ver).so.1.0)',
951         'conditions': [
952           # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
953           # that it takes effect here.
954           # disabled for Mozilla since it doesn't use this, and 'msys' messes $(CXX) up
955           ['build_with_mozilla==0 and clang==0 and asan==0 and tsan==0', {
956             # This will set gcc_version to XY if you are running gcc X.Y.*.
957             'gcc_version%': '<!(<(PYTHON) <(DEPTH)/build/compiler_version.py)',
958           }, {
959             'gcc_version%': 0,
960           }],
961           ['branding=="Chrome"', {
962             'linux_breakpad%': 1,
963           }],
964           # All Chrome builds have breakpad symbols, but only process the
965           # symbols from official builds.
966           ['(branding=="Chrome" and buildtype=="Official")', {
967             'linux_dump_symbols%': 1,
968           }],
969         ],
970       }],  # os_posix==1 and OS!="mac" and OS!="ios"
971       ['OS=="ios"', {
972         'disable_nacl%': 1,
973         'enable_gpu%': 0,
974         'icu_use_data_file_flag%': 1,
975         'use_system_bzip2%': 1,
976         'use_system_libxml%': 1,
977         'use_system_sqlite%': 1,
979         # The Mac SDK is set for iOS builds and passed through to Mac
980         # sub-builds. This allows the Mac sub-build SDK in an iOS build to be
981         # overridden from the command line the same way it is for a Mac build.
982         'mac_sdk%': '<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk.py 10.6)',
984         # iOS SDK and deployment target support.  The iOS 5.0 SDK is actually
985         # what is required, but the value is left blank so when it is set in
986         # the project files it will be the "current" iOS SDK.  Forcing 5.0
987         # even though it is "current" causes Xcode to spit out a warning for
988         # every single project file for not using the "current" SDK.
989         'ios_sdk%': '',
990         'ios_sdk_path%': '',
991         'ios_deployment_target%': '4.3',
993         'conditions': [
994           # ios_product_name is set to the name of the .app bundle as it should
995           # appear on disk.
996           ['branding=="Chrome"', {
997             'ios_product_name%': 'Chrome',
998           }, { # else: branding!="Chrome"
999             'ios_product_name%': 'Chromium',
1000           }],
1001           ['branding=="Chrome" and buildtype=="Official"', {
1002             'ios_breakpad%': 1,
1003           }, { # else: branding!="Chrome" or buildtype!="Official"
1004             'ios_breakpad%': 0,
1005           }],
1006         ],
1007       }],  # OS=="ios"
1008       ['OS=="android"', {
1009         # Location of Android NDK.
1010         'variables': {
1011           'variables': {
1012             'variables': {
1013               'android_ndk_root%': '<!(/bin/echo -n $ANDROID_NDK_ROOT)',
1014             },
1015             'android_ndk_root%': '<(android_ndk_root)',
1016             'conditions': [
1017               ['target_arch == "ia32"', {
1018                 'android_app_abi%': 'x86',
1019                 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-x86',
1020               }],
1021               ['target_arch == "x64"', {
1022                 'android_app_abi%': 'x86_64',
1023                 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1024               }],
1025               ['target_arch=="arm"', {
1026                 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-arm',
1027                 'conditions': [
1028                   ['armv7==0', {
1029                     'android_app_abi%': 'armeabi',
1030                   }, {
1031                     'android_app_abi%': 'armeabi-v7a',
1032                   }],
1033                 ],
1034               }],
1035               ['target_arch=="arm64"', {
1036                 'android_app_abi%': 'arm64-v8a',
1037                 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1038               }],
1039             ],
1040           },
1041           'android_ndk_root%': '<(android_ndk_root)',
1042           'android_app_abi%': '<(android_app_abi)',
1043           'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1044         },
1045         'android_ndk_root%': '<(android_ndk_root)',
1046         'android_ndk_sysroot': '<(android_ndk_sysroot)',
1047         'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1048         'android_ndk_lib': '<(android_ndk_sysroot)/usr/lib',
1049         'android_app_abi%': '<(android_app_abi)',
1051         # Location of the "strip" binary, used by both gyp and scripts.
1052         'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1054         # Provides an absolute path to PRODUCT_DIR (e.g. out/Release). Used
1055         # to specify the output directory for Ant in the Android build.
1056         'ant_build_out': '`cd <(PRODUCT_DIR) && pwd -P`',
1058         # Uses Android's crash report system
1059         'linux_breakpad%': 0,
1061         # Always uses openssl.
1062         'use_openssl%': 1,
1064         'proprietary_codecs%': '<(proprietary_codecs)',
1065         'enable_task_manager%': 0,
1066         'safe_browsing%': 0,
1067         'configuration_policy%': 0,
1068         'input_speech%': 0,
1069         'enable_web_intents%': 0,
1070         'enable_automation%': 0,
1071         'java_bridge%': 1,
1072         'build_ffmpegsumo%': 0,
1073         'linux_use_tcmalloc%': 0,
1075         # Disable Native Client.
1076         'disable_nacl%': 1,
1078         # Android does not support background apps.
1079         'enable_background%': 0,
1081         # Sessions are store separately in the Java side.
1082         'enable_session_service%': 0,
1084         # Set to 1 once we have a notification system for Android.
1085         # http://crbug.com/115320
1086         'notifications%': 0,
1088         'p2p_apis%' : 0,
1090         # TODO(jrg): when 'gtest_target_type'=='shared_library' and
1091         # OS==android, make all gtest_targets depend on
1092         # testing/android/native_test.gyp:native_test_apk.
1093         'gtest_target_type%': 'shared_library',
1095         # Uses system APIs for decoding audio and video.
1096         'use_libffmpeg%': '0',
1098         # Always use the chromium skia. The use_system_harfbuzz needs to
1099         # match use_system_skia.
1100         'use_system_skia%': '0',
1101         'use_system_harfbuzz%': '0',
1103         # Configure crash reporting and build options based on release type.
1104         'conditions': [
1105           ['buildtype=="Official"', {
1106             # Only report crash dumps for Official builds.
1107             'linux_breakpad%': 1,
1108           }, {
1109             'linux_breakpad%': 0,
1110           }],
1111         ],
1113         # When building as part of the Android system, use system libraries
1114         # where possible to reduce ROM size.
1115         # TODO(steveblock): Investigate using the system version of sqlite.
1116         'use_system_sqlite%': 0,  # '<(android_build_type)',
1117         'use_system_expat%': '<(android_build_type)',
1118         'use_system_icu%': '<(android_build_type)',
1119         'use_system_stlport%': '<(android_build_type)',
1121         # Copy it out one scope.
1122         'android_build_type%': '<(android_build_type)',
1123       }],  # OS=="android"
1124       ['OS=="mac"', {
1125         'variables': {
1126           # Mac OS X SDK and deployment target support.  The SDK identifies
1127           # the version of the system headers that will be used, and
1128           # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1129           # macro.  "Maximum allowed" refers to the operating system version
1130           # whose APIs are available in the headers.  The deployment target
1131           # identifies the minimum system version that the built products are
1132           # expected to function on.  It corresponds to the
1133           # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.  To ensure these
1134           # macros are available, #include <AvailabilityMacros.h>.  Additional
1135           # documentation on these macros is available at
1136           # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1137           # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1138           # deployment target to 10.6.  Other projects, such as O3D, may
1139           # override these defaults.
1141           # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1142           # about that is at least the specified version. In official builds,
1143           # the SDK must match mac_sdk_min exactly. If the SDK is installed
1144           # someplace that Xcode doesn't know about, set mac_sdk_path to the
1145           # path to the SDK; when set to a non-empty string, SDK detection
1146           # based on mac_sdk_min will be bypassed entirely.
1147           'mac_sdk_min%': '10.6',
1148           'mac_sdk_path%': '',
1150           'mac_deployment_target%': '10.6',
1151         },
1153         'mac_sdk_min': '<(mac_sdk_min)',
1154         'mac_sdk_path': '<(mac_sdk_path)',
1155         'mac_deployment_target': '<(mac_deployment_target)',
1157         # Enable clang on mac by default!
1158         'clang%': 1,
1160         # Compile in Breakpad support by default so that it can be
1161         # tested, even if it is not enabled by default at runtime.
1162         'mac_breakpad_compiled_in%': 1,
1163         'conditions': [
1164           # mac_product_name is set to the name of the .app bundle as it should
1165           # appear on disk.  This duplicates data from
1166           # chrome/app/theme/chromium/BRANDING and
1167           # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1168           # these names into the build system.
1169           ['branding=="Chrome"', {
1170             'mac_product_name%': 'Google Chrome',
1171           }, { # else: branding!="Chrome"
1172             'mac_product_name%': 'Chromium',
1173           }],
1175           ['branding=="Chrome" and buildtype=="Official"', {
1176             'mac_sdk%': '<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1177             # Enable uploading crash dumps.
1178             'mac_breakpad_uploads%': 1,
1179             # Enable dumping symbols at build time for use by Mac Breakpad.
1180             'mac_breakpad%': 1,
1181             # Enable Keystone auto-update support.
1182             'mac_keystone%': 1,
1183           }, { # else: branding!="Chrome" or buildtype!="Official"
1184             'mac_sdk%': '', #'<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1185             'mac_breakpad_uploads%': 0,
1186             'mac_breakpad%': 0,
1187             'mac_keystone%': 0,
1188           }],
1189         ],
1190       }],  # OS=="mac"
1192       ['OS=="win"', {
1193         'conditions': [
1194           ['component=="shared_library"', {
1195             'win_use_allocator_shim%': 0,
1196           }],
1197           ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1198             # Only enabled by default for ninja because it's buggy in VS.
1199             # Not enabled for component=static_library because some targets
1200             # are too large and the toolchain fails due to the size of the
1201             # .obj files.
1202             'incremental_chrome_dll%': 1,
1203           }],
1204           # Don't do incremental linking for large modules on 32-bit.
1205           ['MSVS_OS_BITS==32', {
1206             'msvs_large_module_debug_link_mode%': '1',  # No
1207           },{
1208             'msvs_large_module_debug_link_mode%': '2',  # Yes
1209           }],
1210           ['MSVS_VERSION=="2010e" or MSVS_VERSION=="2008e" or MSVS_VERSION=="2005e"', {
1211             'msvs_express%': 1,
1212             'secure_atl%': 0,
1213           },{
1214             'msvs_express%': 0,
1215             'secure_atl%': 1,
1216           }],
1217         ],
1218         'nacl_win64_defines': [
1219           # This flag is used to minimize dependencies when building
1220           # Native Client loader for 64-bit Windows.
1221           'NACL_WIN64',
1222         ],
1223       }],
1225       ['os_posix==1 and chromeos==0 and OS!="android"', {
1226         'use_cups%': 1,
1227       }, {
1228         'use_cups%': 0,
1229       }],
1231       # Native Client glibc toolchain is enabled by default except on arm.
1232       ['target_arch=="arm"', {
1233         'disable_glibc%': 1,
1234       }, {
1235         'disable_glibc%': 0,
1236       }],
1238       # Disable SSE2 when building for ARM or MIPS.
1239       ['target_arch=="arm" or target_arch=="mipsel"', {
1240         'disable_sse2%': 1,
1241       }, {
1242         'disable_sse2%': '<(disable_sse2)',
1243       }],
1245       # Set the relative path from this file to the GYP file of the JPEG
1246       # library used by Chromium.
1247       ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1248         # Configuration for using the system libjeg is here.
1249         'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1250       }, {
1251         'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1252       }],
1254       # Options controlling the use of GConf (the classic GNOME configuration
1255       # system) and GIO, which contains GSettings (the new GNOME config system).
1256       ['chromeos==1', {
1257         'use_gconf%': 0,
1258         'use_gio%': 0,
1259       }, {
1260         'use_gconf%': 1,
1261         'use_gio%': 1,
1262       }],
1264       # Set up -D and -E flags passed into grit.
1265       ['branding=="Chrome"', {
1266         # TODO(mmoss) The .grd files look for _google_chrome, but for
1267         # consistency they should look for google_chrome_build like C++.
1268         'grit_defines': ['-D', '_google_chrome',
1269                          '-E', 'CHROMIUM_BUILD=google_chrome'],
1270       }, {
1271         'grit_defines': ['-D', '_chromium',
1272                          '-E', 'CHROMIUM_BUILD=chromium'],
1273       }],
1274       ['chromeos==1', {
1275         'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
1276       }],
1277       ['toolkit_views==1', {
1278         'grit_defines': ['-D', 'toolkit_views'],
1279       }],
1280       ['use_aura==1', {
1281         'grit_defines': ['-D', 'use_aura'],
1282       }],
1283       ['use_ash==1', {
1284         'grit_defines': ['-D', 'use_ash'],
1285       }],
1286       ['use_nss==1', {
1287         'grit_defines': ['-D', 'use_nss'],
1288       }],
1289       ['file_manager_extension==1', {
1290         'grit_defines': ['-D', 'file_manager_extension'],
1291       }],
1292       ['remoting==1', {
1293         'grit_defines': ['-D', 'remoting'],
1294       }],
1295       ['use_titlecase_in_grd_files==1', {
1296         'grit_defines': ['-D', 'use_titlecase'],
1297       }],
1298       ['use_third_party_translations==1', {
1299         'grit_defines': ['-D', 'use_third_party_translations'],
1300         'locales': [
1301           'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
1302           'ka', 'ku', 'kw', 'ms', 'ug'
1303         ],
1304       }],
1305       ['OS=="android"', {
1306         'grit_defines': ['-D', 'android'],
1307       }],
1308       ['OS=="mac"', {
1309         'grit_defines': ['-D', 'scale_factors=2x'],
1310       }],
1311       ['OS == "ios"', {
1312         'grit_defines': [
1313           # define for iOS specific resources.
1314           '-D', 'ios',
1315           # iOS uses a whitelist to filter resources.
1316           '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
1317         ],
1318       }],
1319       ['enable_extensions==1', {
1320         'grit_defines': ['-D', 'enable_extensions'],
1321       }],
1322       ['enable_printing==1', {
1323         'grit_defines': ['-D', 'enable_printing'],
1324       }],
1325       ['enable_themes==1', {
1326         'grit_defines': ['-D', 'enable_themes'],
1327       }],
1328       ['use_oem_wallpaper==1', {
1329         'grit_defines': ['-D', 'use_oem_wallpaper'],
1330       }],
1331       ['clang_use_chrome_plugins==1 and OS!="win"', {
1332         'clang_chrome_plugins_flags': [
1333           '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
1334         ],
1335       }],
1337       ['enable_web_intents_tag==1', {
1338         'grit_defines': ['-D', 'enable_web_intents_tag'],
1339       }],
1341       ['asan==1', {
1342         'clang%': 1,
1343       }],
1344       ['asan==1 and OS=="mac"', {
1345         # See http://crbug.com/145503.
1346         'component': "static_library",
1347       }],
1348       ['tsan==1', {
1349         'clang%': 1,
1350       }],
1352       ['OS=="linux" and clang_type_profiler==1', {
1353         'clang%': 1,
1354         'clang_use_chrome_plugins%': 0,
1355         'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
1356       }],
1358       # On valgrind bots, override the optimizer settings so we don't inline too
1359       # much and make the stacks harder to figure out.
1360       #
1361       # TODO(rnk): Kill off variables that no one else uses and just implement
1362       # them under a build_for_tool== condition.
1363       ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
1364         # gcc flags
1365         'mac_debug_optimization': '1',
1366         'mac_release_optimization': '1',
1367         'release_optimize': '1',
1368         'no_gc_sections': 1,
1369         'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
1370                               '-fno-builtin -fno-optimize-sibling-calls',
1371         'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
1372                                 '-fno-builtin -fno-optimize-sibling-calls',
1374         # MSVS flags for TSan on Pin and Windows.
1375         'win_debug_RuntimeChecks': '0',
1376         'win_debug_disable_iterator_debugging': '1',
1377         'win_debug_Optimization': '1',
1378         'win_debug_InlineFunctionExpansion': '0',
1379         'win_release_InlineFunctionExpansion': '0',
1380         'win_release_OmitFramePointers': '0',
1382         'linux_use_tcmalloc': 1,
1383         'release_valgrind_build': 1,
1384         'werror': '',
1385         'component': 'static_library',
1386         'use_system_zlib': 0,
1387       }],
1389       # Build tweaks for DrMemory.
1390       # TODO(rnk): Combine with tsan config to share the builder.
1391       # http://crbug.com/108155
1392       ['build_for_tool=="drmemory"', {
1393         # These runtime checks force initialization of stack vars which blocks
1394         # DrMemory's uninit detection.
1395         'win_debug_RuntimeChecks': '0',
1396         # Iterator debugging is slow.
1397         'win_debug_disable_iterator_debugging': '1',
1398         # Try to disable optimizations that mess up stacks in a release build.
1399         'win_release_InlineFunctionExpansion': '0',
1400         'win_release_OmitFramePointers': '0',
1401         # Ditto for debug, to support bumping win_debug_Optimization.
1402         'win_debug_InlineFunctionExpansion': 0,
1403         'win_debug_OmitFramePointers': 0,
1404         # Keep the code under #ifndef NVALGRIND.
1405         'release_valgrind_build': 1,
1406       }],
1407     ],
1409     # List of default apps to install in new profiles.  The first list contains
1410     # the source files as found in svn.  The second list, used only for linux,
1411     # contains the destination location for each of the files.  When a crx
1412     # is added or removed from the list, the chrome/browser/resources/
1413     # default_apps/external_extensions.json file must also be updated.
1414     'default_apps_list': [
1415       'browser/resources/default_apps/external_extensions.json',
1416       'browser/resources/default_apps/gmail.crx',
1417       'browser/resources/default_apps/search.crx',
1418       'browser/resources/default_apps/youtube.crx',
1419       'browser/resources/default_apps/drive.crx',
1420       'browser/resources/default_apps/docs.crx',
1421     ],
1422     'default_apps_list_linux_dest': [
1423       '<(PRODUCT_DIR)/default_apps/external_extensions.json',
1424       '<(PRODUCT_DIR)/default_apps/gmail.crx',
1425       '<(PRODUCT_DIR)/default_apps/search.crx',
1426       '<(PRODUCT_DIR)/default_apps/youtube.crx',
1427       '<(PRODUCT_DIR)/default_apps/drive.crx',
1428       '<(PRODUCT_DIR)/default_apps/docs.crx',
1429     ],
1430   },
1431   'target_defaults': {
1432     'variables': {
1433       # The condition that operates on chromium_code is in a target_conditions
1434       # section, and will not have access to the default fallback value of
1435       # chromium_code at the top of this file, or to the chromium_code
1436       # variable placed at the root variables scope of .gyp files, because
1437       # those variables are not set at target scope.  As a workaround,
1438       # if chromium_code is not set at target scope, define it in target scope
1439       # to contain whatever value it has during early variable expansion.
1440       # That's enough to make it available during target conditional
1441       # processing.
1442       'chromium_code%': '<(chromium_code)',
1444       # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
1445       'win_release_Optimization%': '2', # 2 = /Os
1446       'win_debug_Optimization%': '0',   # 0 = /Od
1448       # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
1449       # Tri-state: blank is default, 1 on, 0 off
1450       'win_release_OmitFramePointers%': '0',
1451       # Tri-state: blank is default, 1 on, 0 off
1452       'win_debug_OmitFramePointers%': '',
1454       # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
1455       'win_debug_RuntimeChecks%': '3',    # 3 = all checks enabled, 0 = off
1457       # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
1458       'win_debug_InlineFunctionExpansion%': '',    # empty = default, 0 = off,
1459       'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
1461       # VS inserts quite a lot of extra checks to algorithms like
1462       # std::partial_sort in Debug build which make them O(N^2)
1463       # instead of O(N*logN). This is particularly slow under memory
1464       # tools like ThreadSanitizer so we want it to be disablable.
1465       # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
1466       'win_debug_disable_iterator_debugging%': '0',
1468       'release_extra_cflags%': '',
1469       'debug_extra_cflags%': '',
1471       'release_valgrind_build%': '<(release_valgrind_build)',
1473       # the non-qualified versions are widely assumed to be *nix-only
1474       'win_release_extra_cflags%': '',
1475       'win_debug_extra_cflags%': '',
1477       # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1478       'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
1480       # Only used by Windows build for now.  Can be used to build into a
1481       # differet output directory, e.g., a build_dir_prefix of VS2010_ would
1482       # output files in src/build/VS2010_{Debug,Release}.
1483       'build_dir_prefix%': '',
1485       # Targets are by default not nacl untrusted code.
1486       'nacl_untrusted_build%': 0,
1488       'conditions': [
1489         ['OS=="win" and component=="shared_library"', {
1490           # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
1491           'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
1492           'win_debug_RuntimeLibrary%': '3',   # 3 = /MDd (debug DLL)
1493         }, {
1494           # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
1495           'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
1496           'win_debug_RuntimeLibrary%': '1',   # 1 = /MTd (debug static)
1497         }],
1498         ['OS=="ios"', {
1499           # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
1500           'mac_release_optimization%': 's', # Use -Os unless overridden
1501           'mac_debug_optimization%': '0',   # Use -O0 unless overridden
1502         }, {
1503           # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
1504           'mac_release_optimization%': '3', # Use -O3 unless overridden
1505           'mac_debug_optimization%': '0',   # Use -O0 unless overridden
1506         }],
1507       ],
1508     },
1509     'conditions': [
1510       ['OS=="linux" and linux_use_tcmalloc==1 and clang_type_profiler==1', {
1511         'cflags_cc!': ['-fno-rtti'],
1512         'cflags_cc+': [
1513           '-frtti',
1514           '-gline-tables-only',
1515           '-fintercept-allocation-functions',
1516         ],
1517         'defines': ['TYPE_PROFILING'],
1518         'dependencies': [
1519           '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
1520         ],
1521       }],
1522       ['OS=="win" and "<(msbuild_toolset)"!=""', {
1523         'msbuild_toolset': '<(msbuild_toolset)',
1524       }],
1525       ['branding=="Chrome"', {
1526         'defines': ['GOOGLE_CHROME_BUILD'],
1527       }, {  # else: branding!="Chrome"
1528         'defines': ['CHROMIUM_BUILD'],
1529       }],
1530       ['OS=="mac" and component=="shared_library"', {
1531         'xcode_settings': {
1532           'DYLIB_INSTALL_NAME_BASE': '@rpath',
1533           'LD_RUNPATH_SEARCH_PATHS': [
1534             # For unbundled binaries.
1535             '@loader_path/.',
1536             # For bundled binaries, to get back from Binary.app/Contents/MacOS.
1537             '@loader_path/../../..',
1538           ],
1539         },
1540       }],
1541       ['branding=="Chrome" and (OS=="win" or OS=="mac")', {
1542         'defines': ['ENABLE_RLZ'],
1543       }],
1544       ['component=="shared_library"', {
1545         'defines': ['COMPONENT_BUILD'],
1546       }],
1547       ['toolkit_views==1', {
1548         'defines': ['TOOLKIT_VIEWS=1'],
1549       }],
1550       ['ui_compositor_image_transport==1', {
1551         'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
1552       }],
1553       ['use_aura==1', {
1554         'defines': ['USE_AURA=1'],
1555       }],
1556       ['use_ash==1', {
1557         'defines': ['USE_ASH=1'],
1558       }],
1559       ['use_libjpeg_turbo==1', {
1560         'defines': ['USE_LIBJPEG_TURBO=1'],
1561       }],
1562       ['use_nss==1', {
1563         'defines': ['USE_NSS=1'],
1564       }],
1565       ['enable_one_click_signin==1', {
1566         'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
1567       }],
1568       ['toolkit_uses_gtk==1 and toolkit_views==0', {
1569         # TODO(erg): We are progressively sealing up use of deprecated features
1570         # in gtk in preparation for an eventual porting to gtk3.
1571         'defines': ['GTK_DISABLE_SINGLE_INCLUDES=1'],
1572       }],
1573       ['chromeos==1', {
1574         'defines': ['OS_CHROMEOS=1'],
1575       }],
1576       ['use_xi2_mt!=0', {
1577         'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
1578       }],
1579       ['file_manager_extension==1', {
1580         'defines': ['FILE_MANAGER_EXTENSION=1'],
1581       }],
1582       ['profiling==1', {
1583         'defines': ['ENABLE_PROFILING=1'],
1584       }],
1585       ['OS=="linux" and glibcxx_debug==1', {
1586         'defines': ['_GLIBCXX_DEBUG=1',],
1587         'cflags_cc!': ['-fno-rtti'],
1588         'cflags_cc+': ['-frtti', '-g'],
1589       }],
1590       ['OS=="linux"', {
1591         # we need lrint(), which is ISOC99, and Xcode
1592         # already forces -std=c99 for mac below
1593         'defines': ['_ISOC99_SOURCE=1'],
1594       }],
1595       ['remoting==1', {
1596         'defines': ['ENABLE_REMOTING=1'],
1597       }],
1598       ['enable_webrtc==1', {
1599         'defines': ['ENABLE_WEBRTC=1'],
1600       }],
1601       ['proprietary_codecs==1', {
1602         'defines': ['USE_PROPRIETARY_CODECS'],
1603       }],
1604       ['enable_pepper_threading==1', {
1605         'defines': ['ENABLE_PEPPER_THREADING'],
1606       }],
1607       ['enable_viewport==1', {
1608         'defines': ['ENABLE_VIEWPORT'],
1609       }],
1610       ['configuration_policy==1', {
1611         'defines': ['ENABLE_CONFIGURATION_POLICY'],
1612       }],
1613       ['input_speech==1', {
1614         'defines': ['ENABLE_INPUT_SPEECH'],
1615       }],
1616       ['notifications==1', {
1617         'defines': ['ENABLE_NOTIFICATIONS'],
1618       }],
1619       ['enable_hidpi==1', {
1620         'defines': ['ENABLE_HIDPI=1'],
1621       }],
1622       ['fastbuild!=0', {
1624         'conditions': [
1625           # For Windows and Mac, we don't genererate debug information.
1626           ['OS=="win" or OS=="mac"', {
1627             'msvs_settings': {
1628               'VCLinkerTool': {
1629                 'GenerateDebugInformation': 'false',
1630               },
1631               'VCCLCompilerTool': {
1632                 'DebugInformationFormat': '0',
1633               }
1634             },
1635             'xcode_settings': {
1636               'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
1637             },
1638           }, { # else: OS != "win", generate less debug information.
1639             'variables': {
1640               'debug_extra_cflags': '-g1',
1641             },
1642           }],
1643           # Clang creates chubby debug information, which makes linking very
1644           # slow. For now, don't create debug information with clang.  See
1645           # http://crbug.com/70000
1646           ['(OS=="linux" or OS=="android") and clang==1', {
1647             'variables': {
1648               'debug_extra_cflags': '-g0',
1649             },
1650           }],
1651         ],  # conditions for fastbuild.
1652       }],  # fastbuild!=0
1653       ['dcheck_always_on!=0', {
1654         'defines': ['DCHECK_ALWAYS_ON=1'],
1655       }],  # dcheck_always_on!=0
1656       ['selinux==1', {
1657         'defines': ['CHROMIUM_SELINUX=1'],
1658       }],
1659       ['win_use_allocator_shim==0', {
1660         'conditions': [
1661           ['OS=="win"', {
1662             'defines': ['NO_TCMALLOC'],
1663           }],
1664         ],
1665       }],
1666       ['enable_gpu==1', {
1667         'defines': [
1668           'ENABLE_GPU=1',
1669         ],
1670       }],
1671       ['use_openssl==1', {
1672         'defines': [
1673           'USE_OPENSSL=1',
1674         ],
1675       }],
1676       ['enable_eglimage==1', {
1677         'defines': [
1678           'ENABLE_EGLIMAGE=1',
1679         ],
1680       }],
1681       ['use_skia==1', {
1682         'defines': [
1683           'USE_SKIA=1',
1684         ],
1685       }],
1686       ['coverage!=0', {
1687         'conditions': [
1688           ['OS=="mac" or OS=="ios"', {
1689             'xcode_settings': {
1690               'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES',  # -fprofile-arcs
1691               'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES',  # -ftest-coverage
1692             },
1693           }],
1694           ['OS=="mac"', {
1695             # Add -lgcov for types executable, shared_library, and
1696             # loadable_module; not for static_library.
1697             # This is a delayed conditional.
1698             'target_conditions': [
1699               ['_type!="static_library"', {
1700                 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
1701               }],
1702             ],
1703           }],
1704           ['OS=="linux" or OS=="android"', {
1705             'cflags': [ '-ftest-coverage',
1706                         '-fprofile-arcs' ],
1707             'link_settings': { 'libraries': [ '-lgcov' ] },
1708           }],
1709           # Finally, for Windows, we simply turn on profiling.
1710           ['OS=="win"', {
1711             'msvs_settings': {
1712               'VCLinkerTool': {
1713                 'Profile': 'true',
1714               },
1715               'VCCLCompilerTool': {
1716                 # /Z7, not /Zi, so coverage is happyb
1717                 'DebugInformationFormat': '1',
1718                 'AdditionalOptions': ['/Yd'],
1719               }
1720             }
1721          }],  # OS==win
1722         ],  # conditions for coverage
1723       }],  # coverage!=0
1724       ['OS=="win"', {
1725         'defines': [
1726           '__STD_C',
1727           '_CRT_SECURE_NO_DEPRECATE',
1728           '_SCL_SECURE_NO_DEPRECATE',
1729         ],
1730         'include_dirs': [
1731           '<(DEPTH)/third_party/wtl/include',
1732         ],
1733         'conditions': [
1734           ['win_z7!=0', {
1735             'msvs_settings': {
1736               # Generates debug info when win_z7=1
1737               # even if fastbuild=1 (that makes GenerateDebugInformation false).
1738               'VCLinkerTool': {
1739                 'GenerateDebugInformation': 'true',
1740               },
1741               'VCCLCompilerTool': {
1742                 'DebugInformationFormat': '1',
1743               }
1744             }
1745           }],
1746         ],  # win_z7!=0
1747       }],  # OS==win
1748       ['enable_task_manager==1', {
1749         'defines': [
1750           'ENABLE_TASK_MANAGER=1',
1751         ],
1752       }],
1753       ['enable_web_intents==1', {
1754         'defines': [
1755           'ENABLE_WEB_INTENTS=1',
1756         ],
1757       }],
1758       ['enable_extensions==1', {
1759         'defines': [
1760           'ENABLE_EXTENSIONS=1',
1761         ],
1762       }],
1763       ['OS=="win" and branding=="Chrome"', {
1764         'defines': ['ENABLE_SWIFTSHADER'],
1765       }],
1766       ['enable_dart==1', {
1767         'defines': ['WEBKIT_USING_DART=1'],
1768       }],
1769       ['enable_plugin_installation==1', {
1770         'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
1771       }],
1772       ['enable_protector_service==1', {
1773         'defines': ['ENABLE_PROTECTOR_SERVICE=1'],
1774       }],
1775       ['enable_session_service==1', {
1776         'defines': ['ENABLE_SESSION_SERVICE=1'],
1777       }],
1778       ['enable_themes==1', {
1779         'defines': ['ENABLE_THEMES=1'],
1780       }],
1781       ['enable_background==1', {
1782         'defines': ['ENABLE_BACKGROUND=1'],
1783       }],
1784       ['enable_automation==1', {
1785         'defines': ['ENABLE_AUTOMATION=1'],
1786       }],
1787       ['enable_printing==1', {
1788         'defines': ['ENABLE_PRINTING=1'],
1789       }],
1790       ['enable_captive_portal_detection==1', {
1791         'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
1792       }],
1793       ['disable_ftp_support==1', {
1794         'defines': ['DISABLE_FTP_SUPPORT=1'],
1795       }],
1796     ],  # conditions for 'target_defaults'
1797     'target_conditions': [
1798       ['enable_wexit_time_destructors==1', {
1799         'conditions': [
1800           [ 'clang==1', {
1801             'cflags': [
1802               '-Wexit-time-destructors',
1803             ],
1804             'xcode_settings': {
1805               'WARNING_CFLAGS': [
1806                 '-Wexit-time-destructors',
1807               ],
1808             },
1809           }],
1810         ],
1811       }],
1812       ['chromium_code==0', {
1813         'conditions': [
1814           [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
1815             # We don't want to get warnings from third-party code,
1816             # so remove any existing warning-enabling flags like -Wall.
1817             'cflags!': [
1818               '-Wall',
1819               '-Wextra',
1820             ],
1821             'cflags_cc': [
1822               # Don't warn about hash_map in third-party code.
1823               '-Wno-deprecated',
1824             ],
1825             'cflags': [
1826               # Don't warn about printf format problems.
1827               # This is off by default in gcc but on in Ubuntu's gcc(!).
1828               '-Wno-format',
1829             ],
1830             'cflags_cc!': [
1831               # TODO(fischman): remove this.
1832               # http://code.google.com/p/chromium/issues/detail?id=90453
1833               '-Wsign-compare',
1834             ]
1835           }],
1836           # TODO: Fix all warnings on chromeos too.
1837           [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
1838             'cflags!': [
1839               '-Werror',
1840             ],
1841           }],
1842           [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
1843             'cflags': [
1844               # Don't warn about ignoring the return value from e.g. close().
1845               # This is off by default in some gccs but on by default in others.
1846               # BSD systems do not support this option, since they are usually
1847               # using gcc 4.2.1, which does not have this flag yet.
1848               '-Wno-unused-result',
1849             ],
1850           }],
1851           [ 'OS=="win"', {
1852             'defines': [
1853               '_CRT_SECURE_NO_DEPRECATE',
1854               '_CRT_NONSTDC_NO_WARNINGS',
1855               '_CRT_NONSTDC_NO_DEPRECATE',
1856               '_SCL_SECURE_NO_DEPRECATE',
1857             ],
1858             'msvs_disabled_warnings': [4800],
1859             'msvs_settings': {
1860               'VCCLCompilerTool': {
1861                 'WarningLevel': '3',
1862                 'WarnAsError': '<(win_third_party_warn_as_error)',
1863                 'Detect64BitPortabilityProblems': 'false',
1864               },
1865             },
1866             'conditions': [
1867               ['buildtype=="Official"', {
1868                 'msvs_settings': {
1869                   'VCCLCompilerTool': { 'WarnAsError': 'false' },
1870                 }
1871               }],
1872             ],
1873           }],
1874           # TODO(darin): Unfortunately, some third_party code depends on base/
1875           [ 'OS=="win" and component=="shared_library"', {
1876             'msvs_disabled_warnings': [
1877               4251,  # class 'std::xx' needs to have dll-interface.
1878             ],
1879           }],
1880           [ 'OS=="mac" or OS=="ios"', {
1881             'xcode_settings': {
1882               'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
1883             },
1884             'conditions': [
1885               ['buildtype=="Official"', {
1886                 'xcode_settings': {
1887                   'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',    # -Werror
1888                 },
1889               }],
1890             ],
1891           }],
1892           [ 'OS=="ios"', {
1893             'xcode_settings': {
1894               # TODO(ios): Fix remaining warnings in third-party code, then
1895               # remove this; the Mac cleanup didn't get everything that's
1896               # flagged in an iOS build.
1897               'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
1898               'RUN_CLANG_STATIC_ANALYZER': 'NO',
1899             },
1900           }],
1901         ],
1902       }, {
1903         'includes': [
1904            # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
1905           'filename_rules.gypi',
1906         ],
1907         # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
1908         # C99 macros on Mac and Linux.
1909         'defines': [
1910           '__STDC_FORMAT_MACROS',
1911         ],
1912         'conditions': [
1913           ['OS=="win"', {
1914             # turn on warnings for signed/unsigned mismatch on chromium code.
1915             'msvs_settings': {
1916               'VCCLCompilerTool': {
1917                 'AdditionalOptions': ['/we4389'],
1918               },
1919             },
1920           }],
1921           ['OS=="win" and component=="shared_library"', {
1922             'msvs_disabled_warnings': [
1923               4251,  # class 'std::xx' needs to have dll-interface.
1924             ],
1925           }],
1926         ],
1927       }],
1928     ],  # target_conditions for 'target_defaults'
1929     'default_configuration': 'Debug',
1930     'configurations': {
1931       # VCLinkerTool LinkIncremental values below:
1932       #   0 == default
1933       #   1 == /INCREMENTAL:NO
1934       #   2 == /INCREMENTAL
1935       # Debug links incremental, Release does not.
1936       #
1937       # Abstract base configurations to cover common attributes.
1938       #
1939       'Common_Base': {
1940         'abstract': 1,
1941         'msvs_configuration_attributes': {
1942           'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
1943           'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
1944           'CharacterSet': '1',
1945         },
1946       },
1947       'x86_Base': {
1948         'abstract': 1,
1949         'msvs_settings': {
1950           'VCLinkerTool': {
1951             'TargetMachine': '1',
1952           },
1953         },
1954         'msvs_configuration_platform': 'Win32',
1955       },
1956       'x64_Base': {
1957         'abstract': 1,
1958         'msvs_configuration_platform': 'x64',
1959         'msvs_settings': {
1960           'VCLinkerTool': {
1961             'TargetMachine': '17', # x86 - 64
1962             'AdditionalLibraryDirectories!':
1963               ['<(windows_sdk_path)/Lib/win8/um/x86'],
1964             'AdditionalLibraryDirectories':
1965               ['<(windows_sdk_path)/Lib/win8/um/x64'],
1966           },
1967           'VCLibrarianTool': {
1968             'AdditionalLibraryDirectories!':
1969               ['<(windows_sdk_path)/Lib/win8/um/x86'],
1970             'AdditionalLibraryDirectories':
1971               ['<(windows_sdk_path)/Lib/win8/um/x64'],
1972           },
1973         },
1974         'defines': [
1975           # Not sure if tcmalloc works on 64-bit Windows.
1976           'NO_TCMALLOC',
1977         ],
1978       },
1979       'Debug_Base': {
1980         'abstract': 1,
1981         'defines': [
1982           'DYNAMIC_ANNOTATIONS_ENABLED=1',
1983           'WTF_USE_DYNAMIC_ANNOTATIONS=1',
1984         ],
1985         'xcode_settings': {
1986           'COPY_PHASE_STRIP': 'NO',
1987           'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
1988           'OTHER_CFLAGS': [
1989             '<@(debug_extra_cflags)',
1990           ],
1991         },
1992         'msvs_settings': {
1993           'VCCLCompilerTool': {
1994             'Optimization': '<(win_debug_Optimization)',
1995             'PreprocessorDefinitions': ['_DEBUG'],
1996             'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
1997             'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
1998             'conditions': [
1999               # According to MSVS, InlineFunctionExpansion=0 means
2000               # "default inlining", not "/Ob0".
2001               # Thus, we have to handle InlineFunctionExpansion==0 separately.
2002               ['win_debug_InlineFunctionExpansion==0', {
2003                 'AdditionalOptions': ['/Ob0'],
2004               }],
2005               ['win_debug_InlineFunctionExpansion!=""', {
2006                 'InlineFunctionExpansion':
2007                   '<(win_debug_InlineFunctionExpansion)',
2008               }],
2009               ['win_debug_disable_iterator_debugging==1', {
2010                 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
2011               }],
2013               # if win_debug_OmitFramePointers is blank, leave as default
2014               ['win_debug_OmitFramePointers==1', {
2015                 'OmitFramePointers': 'true',
2016               }],
2017               ['win_debug_OmitFramePointers==0', {
2018                 'OmitFramePointers': 'false',
2019                 # The above is not sufficient (http://crbug.com/106711): it
2020                 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
2021                 # perform FPO regardless, so we must explicitly disable.
2022                 # We still want the false setting above to avoid having
2023                 # "/Oy /Oy-" and warnings about overriding.
2024                 'AdditionalOptions': ['/Oy-'],
2025               }],
2026             ],
2027             'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
2028           },
2029           'VCLinkerTool': {
2030             'LinkIncremental': '<(msvs_debug_link_incremental)',
2031             # ASLR makes debugging with windbg difficult because Chrome.exe and
2032             # Chrome.dll share the same base name. As result, windbg will
2033             # name the Chrome.dll module like chrome_<base address>, where
2034             # <base address> typically changes with each launch. This in turn
2035             # means that breakpoints in Chrome.dll don't stick from one launch
2036             # to the next. For this reason, we turn ASLR off in debug builds.
2037             # Note that this is a three-way bool, where 0 means to pick up
2038             # the default setting, 1 is off and 2 is on.
2039             'RandomizedBaseAddress': 1,
2040           },
2041           'VCResourceCompilerTool': {
2042             'PreprocessorDefinitions': ['_DEBUG'],
2043           },
2044         },
2045         'conditions': [
2046           ['OS=="linux" or OS=="android"', {
2047             'target_conditions': [
2048               ['_toolset=="target"', {
2049                 'cflags': [
2050                   '<@(debug_extra_cflags)',
2051                 ],
2052               }],
2053             ],
2054           }],
2055           # Disabled on iOS because it was causing a crash on startup.
2056           # TODO(michelea): investigate, create a reduced test and possibly
2057           # submit a radar.
2058           ['release_valgrind_build==0 and OS!="ios"', {
2059             'xcode_settings': {
2060               'OTHER_CFLAGS': [
2061                 '-fstack-protector-all',  # Implies -fstack-protector
2062               ],
2063             },
2064           }],
2065         ],
2066       },
2067       'Release_Base': {
2068         'abstract': 1,
2069         'defines': [
2070           'NDEBUG',
2071         ],
2072         'xcode_settings': {
2073           'DEAD_CODE_STRIPPING': 'YES',  # -Wl,-dead_strip
2074           'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
2075           'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
2076         },
2077         'msvs_settings': {
2078           'VCCLCompilerTool': {
2079             'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
2080             'conditions': [
2081               # In official builds, each target will self-select
2082               # an optimization level.
2083               ['buildtype!="Official"', {
2084                   'Optimization': '<(win_release_Optimization)',
2085                 },
2086               ],
2087               # According to MSVS, InlineFunctionExpansion=0 means
2088               # "default inlining", not "/Ob0".
2089               # Thus, we have to handle InlineFunctionExpansion==0 separately.
2090               ['win_release_InlineFunctionExpansion==0', {
2091                 'AdditionalOptions': ['/Ob0'],
2092               }],
2093               ['win_release_InlineFunctionExpansion!=""', {
2094                 'InlineFunctionExpansion':
2095                   '<(win_release_InlineFunctionExpansion)',
2096               }],
2098               # if win_release_OmitFramePointers is blank, leave as default
2099               ['win_release_OmitFramePointers==1', {
2100                 'OmitFramePointers': 'true',
2101               }],
2102               ['win_release_OmitFramePointers==0', {
2103                 'OmitFramePointers': 'false',
2104                 # The above is not sufficient (http://crbug.com/106711): it
2105                 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
2106                 # perform FPO regardless, so we must explicitly disable.
2107                 # We still want the false setting above to avoid having
2108                 # "/Oy /Oy-" and warnings about overriding.
2109                 'AdditionalOptions': ['/Oy-'],
2110               }],
2111             ],
2112             'AdditionalOptions': [ '<@(win_release_extra_cflags)', ],
2113           },
2114           'VCLinkerTool': {
2115             # LinkIncremental is a tri-state boolean, where 0 means default
2116             # (i.e., inherit from parent solution), 1 means false, and
2117             # 2 means true.
2118             'LinkIncremental': '1',
2119             # This corresponds to the /PROFILE flag which ensures the PDB
2120             # file contains FIXUP information (growing the PDB file by about
2121             # 5%) but does not otherwise alter the output binary. This
2122             # information is used by the Syzygy optimization tool when
2123             # decomposing the release image.
2124             'Profile': 'true',
2125           },
2126         },
2127         'conditions': [
2128           ['msvs_use_common_release', {
2129             'includes': ['release.gypi'],
2130           }],
2131           ['release_valgrind_build==0', {
2132             'defines': [
2133               'NVALGRIND',
2134               'DYNAMIC_ANNOTATIONS_ENABLED=0',
2135             ],
2136           }, {
2137             'defines': [
2138               'DYNAMIC_ANNOTATIONS_ENABLED=1',
2139               'WTF_USE_DYNAMIC_ANNOTATIONS=1',
2140             ],
2141           }],
2142           ['win_use_allocator_shim==0', {
2143             'defines': ['NO_TCMALLOC'],
2144           }],
2145           ['OS=="linux"', {
2146             'target_conditions': [
2147               ['_toolset=="target"', {
2148                 'cflags': [
2149                   '<@(release_extra_cflags)',
2150                 ],
2151               }],
2152             ],
2153           }],
2154         ],
2155       },
2156       #
2157       # Concrete configurations
2158       #
2159       'Debug': {
2160         'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
2161       },
2162       'Release': {
2163         'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
2164       },
2165       'conditions': [
2166         [ 'OS=="win"', {
2167           # TODO(bradnelson): add a gyp mechanism to make this more graceful.
2168           'Debug_x64': {
2169             'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
2170           },
2171           'Release_x64': {
2172             'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
2173           },
2174         }],
2175       ],
2176     },
2177   },
2178   'conditions': [
2179     ['os_posix==1 and OS!="mac" and OS!="ios"', {
2180       'target_defaults': {
2181         # Enable -Werror by default, but put it in a variable so it can
2182         # be disabled in ~/.gyp/include.gypi on the valgrind builders.
2183         'variables': {
2184           'werror%': '-Werror',
2185           'libraries_for_target%': '',
2186         },
2187         'defines': [
2188           '_FILE_OFFSET_BITS=64',
2189         ],
2190         'cflags': [
2191           '<(werror)',  # See note above about the werror variable.
2192           '-pthread',
2193           '-fno-exceptions',
2194           '-fno-strict-aliasing',  # See http://crbug.com/32204
2195           '-Wall',
2196           # TODO(evan): turn this back on once all the builds work.
2197           # '-Wextra',
2198           # Don't warn about unused function params.  We use those everywhere.
2199           '-Wno-unused-parameter',
2200           # Don't warn about the "struct foo f = {0};" initialization pattern.
2201           '-Wno-missing-field-initializers',
2202           # Don't export any symbols (for example, to plugins we dlopen()).
2203           # Note: this is *required* to make some plugins work.
2204           '-fvisibility=hidden',
2205           '-pipe',
2206         ],
2207         'cflags_cc': [
2208           '-fno-rtti',
2209           '-fno-threadsafe-statics',
2210           # Make inline functions have hidden visiblity by default.
2211           # Surprisingly, not covered by -fvisibility=hidden.
2212           '-fvisibility-inlines-hidden',
2213           # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
2214           # so we specify it explicitly.
2215           # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it.
2216           # http://code.google.com/p/chromium/issues/detail?id=90453
2217           '-Wsign-compare',
2218         ],
2219         'ldflags': [
2220           '-pthread', '-Wl,-z,noexecstack',
2221         ],
2222         'libraries' : [
2223           '<(libraries_for_target)',
2224         ],
2225         'configurations': {
2226           'Debug_Base': {
2227             'variables': {
2228               'debug_optimize%': '0',
2229             },
2230             'defines': [
2231               '_DEBUG',
2232             ],
2233             'cflags': [
2234               '-O>(debug_optimize)',
2235               '-g',
2236             ],
2237             'conditions' : [
2238               ['OS=="android" and android_full_debug==0', {
2239                 # Some configurations are copied from Release_Base to reduce
2240                 # the binary size.
2241                 'variables': {
2242                   'debug_optimize%': 's',
2243                 },
2244                 'cflags': [
2245                   '-fomit-frame-pointer',
2246                   '-fdata-sections',
2247                   '-ffunction-sections',
2248                 ],
2249                 'ldflags': [
2250                   '-Wl,-O1',
2251                   '-Wl,--as-needed',
2252                   '-Wl,--gc-sections',
2253                 ],
2254               }],
2255             ],
2256           },
2257           'Release_Base': {
2258             'variables': {
2259               'release_optimize%': '2',
2260               # Binaries become big and gold is unable to perform GC
2261               # and remove unused sections for some of test targets
2262               # on 32 bit platform.
2263               # (This is currently observed only in chromeos valgrind bots)
2264               # The following flag is to disable --gc-sections linker
2265               # option for these bots.
2266               'no_gc_sections%': 0,
2268               # TODO(bradnelson): reexamine how this is done if we change the
2269               # expansion of configurations
2270               'release_valgrind_build%': 0,
2271             },
2272             'cflags': [
2273               '-O<(release_optimize)',
2274               # Don't emit the GCC version ident directives, they just end up
2275               # in the .comment section taking up binary size.
2276               '-fno-ident',
2277               # Put data and code in their own sections, so that unused symbols
2278               # can be removed at link time with --gc-sections.
2279               '-fdata-sections',
2280               '-ffunction-sections',
2281             ],
2282             'ldflags': [
2283               # Specifically tell the linker to perform optimizations.
2284               # See http://lwn.net/Articles/192624/ .
2285               '-Wl,-O1',
2286               '-Wl,--as-needed',
2287             ],
2288             'conditions' : [
2289               ['no_gc_sections==0', {
2290                 'ldflags': [
2291                   '-Wl,--gc-sections',
2292                 ],
2293               }],
2294               ['OS=="android"', {
2295                 'variables': {
2296                   'release_optimize%': 's',
2297                 },
2298                 'cflags': [
2299                   '-fomit-frame-pointer',
2300                 ],
2301               }],
2302               ['clang==1', {
2303                 'cflags!': [
2304                   '-fno-ident',
2305                 ],
2306               }],
2307               ['profiling==1', {
2308                 'cflags': [
2309                   '-fno-omit-frame-pointer',
2310                   '-g',
2311                 ],
2312               }],
2313             ],
2314           },
2315         },
2316         'variants': {
2317           'coverage': {
2318             'cflags': ['-fprofile-arcs', '-ftest-coverage'],
2319             'ldflags': ['-fprofile-arcs'],
2320           },
2321           'profile': {
2322             'cflags': ['-pg', '-g'],
2323             'ldflags': ['-pg'],
2324           },
2325           'symbols': {
2326             'cflags': ['-g'],
2327           },
2328         },
2329         'conditions': [
2330           ['target_arch=="ia32"', {
2331             'target_conditions': [
2332               ['_toolset=="target"', {
2333                 'asflags': [
2334                   # Needed so that libs with .s files (e.g. libicudata.a)
2335                   # are compatible with the general 32-bit-ness.
2336                   '-32',
2337                 ],
2338                 # All floating-point computations on x87 happens in 80-bit
2339                 # precision.  Because the C and C++ language standards allow
2340                 # the compiler to keep the floating-point values in higher
2341                 # precision than what's specified in the source and doing so
2342                 # is more efficient than constantly rounding up to 64-bit or
2343                 # 32-bit precision as specified in the source, the compiler,
2344                 # especially in the optimized mode, tries very hard to keep
2345                 # values in x87 floating-point stack (in 80-bit precision)
2346                 # as long as possible. This has important side effects, that
2347                 # the real value used in computation may change depending on
2348                 # how the compiler did the optimization - that is, the value
2349                 # kept in 80-bit is different than the value rounded down to
2350                 # 64-bit or 32-bit. There are possible compiler options to
2351                 # make this behavior consistent (e.g. -ffloat-store would keep
2352                 # all floating-values in the memory, thus force them to be
2353                 # rounded to its original precision) but they have significant
2354                 # runtime performance penalty.
2355                 #
2356                 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
2357                 # which keep floating-point values in SSE registers in its
2358                 # native precision (32-bit for single precision, and 64-bit
2359                 # for double precision values). This means the floating-point
2360                 # value used during computation does not change depending on
2361                 # how the compiler optimized the code, since the value is
2362                 # always kept in its specified precision.
2363                 'conditions': [
2364                   ['branding=="Chromium" and disable_sse2==0', {
2365                     'cflags': [
2366                       '-march=pentium4',
2367                       '-msse2',
2368                       '-mfpmath=sse',
2369                     ],
2370                   }],
2371                   # ChromeOS targets Pinetrail, which is sse3, but most of the
2372                   # benefit comes from sse2 so this setting allows ChromeOS
2373                   # to build on other CPUs.  In the future -march=atom would
2374                   # help but requires a newer compiler.
2375                   ['chromeos==1 and disable_sse2==0', {
2376                     'cflags': [
2377                       '-msse2',
2378                     ],
2379                   }],
2380                   # Install packages have started cropping up with
2381                   # different headers between the 32-bit and 64-bit
2382                   # versions, so we have to shadow those differences off
2383                   # and make sure a 32-bit-on-64-bit build picks up the
2384                   # right files.
2385                   # For android build, use NDK headers instead of host headers
2386                   ['host_arch!="ia32" and OS!="android"', {
2387                     'include_dirs+': [
2388                       '/usr/include32',
2389                     ],
2390                   }],
2391                 ],
2392                'target_conditions': [
2393                  ['_toolset=="target" and OS!="android"', {
2394                     # -mmmx allows mmintrin.h to be used for mmx intrinsics.
2395                     # video playback is mmx and sse2 optimized.
2396                     'cflags': [
2397                       '-m32',
2398                       '-mmmx',
2399                     ],
2400                     'ldflags': [
2401                       '-m32',
2402                     ],
2403                     'cflags_mozilla': [
2404                       '-m32',
2405                       '-mmmx',
2406                     ],
2407                   }],
2408                 ],
2409               }],
2410             ],
2411           }],
2412           ['target_arch=="arm"', {
2413             'target_conditions': [
2414               ['_toolset=="target"', {
2415                 'cflags_cc': [
2416                   # The codesourcery arm-2009q3 toolchain warns at that the ABI
2417                   # has changed whenever it encounters a varargs function. This
2418                   # silences those warnings, as they are not helpful and
2419                   # clutter legitimate warnings.
2420                   '-Wno-abi',
2421                 ],
2422                 'conditions': [
2423                   ['arm_thumb==1', {
2424                     'cflags': [
2425                     '-mthumb',
2426                     ]
2427                   }],
2428                   ['armv7==1', {
2429                     'cflags': [
2430                       '-march=armv7-a',
2431                       '-mtune=cortex-a8',
2432                       '-mfloat-abi=<(arm_float_abi)',
2433                     ],
2434                     'conditions': [
2435                       ['arm_neon==1', {
2436                         'cflags': [ '-mfpu=neon', ],
2437                       }, {
2438                         'cflags': [ '-mfpu=<(arm_fpu)', ],
2439                       }],
2440                     ],
2441                   }],
2442                   ['OS=="android"', {
2443                     # Most of the following flags are derived from what Android
2444                     # uses by default when building for arm, reference for which
2445                     # can be found in the following file in the Android NDK:
2446                     # toolchains/arm-linux-androideabi-4.4.3/setup.mk
2447                     'cflags': [
2448                       # The tree-sra optimization (scalar replacement for
2449                       # aggregates enabling subsequent optimizations) leads to
2450                       # invalid code generation when using the Android NDK's
2451                       # compiler (r5-r7). This can be verified using
2452                       # TestWebKitAPI's WTF.Checked_int8_t test.
2453                       '-fno-tree-sra',
2454                       '-fuse-ld=gold',
2455                       '-Wno-psabi',
2456                     ],
2457                     # Android now supports .relro sections properly.
2458                     # NOTE: While these flags enable the generation of .relro
2459                     # sections, the generated libraries can still be loaded on
2460                     # older Android platform versions.
2461                     'ldflags': [
2462                         '-Wl,-z,relro',
2463                         '-Wl,-z,now',
2464                         '-fuse-ld=gold',
2465                     ],
2466                     'conditions': [
2467                       ['arm_thumb == 1', {
2468                         # Android toolchain doesn't support -mimplicit-it=thumb
2469                         'cflags!': [ '-Wa,-mimplicit-it=thumb', ],
2470                         'cflags': [ '-mthumb-interwork', ],
2471                       }],
2472                       ['armv7==0', {
2473                         # Flags suitable for Android emulator
2474                         'cflags': [
2475                           '-march=armv5te',
2476                           '-mtune=xscale',
2477                           '-msoft-float',
2478                         ],
2479                         'defines': [
2480                           '__ARM_ARCH_5__',
2481                           '__ARM_ARCH_5T__',
2482                           '__ARM_ARCH_5E__',
2483                           '__ARM_ARCH_5TE__',
2484                         ],
2485                       }],
2486                       ['clang==1', {
2487                         'cflags!': [
2488                           # Clang does not support the following options.
2489                           '-mthumb-interwork',
2490                           '-finline-limit=64',
2491                           '-fno-tree-sra',
2492                           '-fuse-ld=gold',
2493                           '-Wno-psabi',
2494                         ],
2495                       }],
2496                     ],
2497                   }],
2498                 ],
2499               }],
2500             ],
2501           }],
2502           ['linux_fpic==1', {
2503             'cflags': [
2504               '-fPIC',
2505             ],
2506             'ldflags': [
2507               '-fPIC',
2508             ],
2509           }],
2510           ['sysroot!=""', {
2511             'target_conditions': [
2512               ['_toolset=="target"', {
2513                 'cflags': [
2514                   '--sysroot=<(sysroot)',
2515                 ],
2516                 'ldflags': [
2517                   '--sysroot=<(sysroot)',
2518                 ],
2519               }]]
2520           }],
2521           ['clang==1', {
2522             'cflags': [
2523               '-Wheader-hygiene',
2524               # Clang spots more unused functions.
2525               '-Wno-unused-function',
2526               # Don't die on dtoa code that uses a char as an array index.
2527               '-Wno-char-subscripts',
2528               # Especially needed for gtest macros using enum values from Mac
2529               # system headers.
2530               # TODO(pkasting): In C++11 this is legal, so this should be
2531               # removed when we change to that.  (This is also why we don't
2532               # bother fixing all these cases today.)
2533               '-Wno-unnamed-type-template-args',
2534               # This (rightyfully) complains about 'override', which we use
2535               # heavily.
2536               '-Wno-c++11-extensions',
2538               # Warns on switches on enums that cover all enum values but
2539               # also contain a default: branch. Chrome is full of that.
2540               '-Wno-covered-switch-default',
2542               # TODO(thakis): Remove this.
2543               '-Wno-implicit-conversion-floating-point-to-bool',
2544             ],
2545             'cflags!': [
2546               # Clang doesn't seem to know know this flag.
2547               '-mfpmath=sse',
2548             ],
2549           }],
2550           ['clang==1 and clang_use_chrome_plugins==1', {
2551             'cflags': [
2552               '<@(clang_chrome_plugins_flags)',
2553             ],
2554           }],
2555           ['clang==1 and clang_load!=""', {
2556             'cflags': [
2557               '-Xclang', '-load', '-Xclang', '<(clang_load)',
2558             ],
2559           }],
2560           ['clang==1 and clang_add_plugin!=""', {
2561             'cflags': [
2562               '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
2563             ],
2564           }],
2565           ['clang==1 and "<(GENERATOR)"=="ninja"', {
2566             'cflags': [
2567               # See http://crbug.com/110262
2568               '-fcolor-diagnostics',
2569             ],
2570           }],
2571           ['asan==1', {
2572             'target_conditions': [
2573               ['_toolset=="target"', {
2574                 'cflags': [
2575                   '-faddress-sanitizer',
2576                   '-fno-omit-frame-pointer',
2577                 ],
2578                 'ldflags': [
2579                   '-faddress-sanitizer',
2580                 ],
2581                 'defines': [
2582                   'ADDRESS_SANITIZER',
2583                 ],
2584               }],
2585             ],
2586           }],
2587           ['tsan==1', {
2588             'target_conditions': [
2589               ['_toolset=="target"', {
2590                 'cflags': [
2591                   '-fthread-sanitizer',
2592                   '-fno-omit-frame-pointer',
2593                   '-fPIE',
2594                 ],
2595                 'ldflags': [
2596                   '-fthread-sanitizer',
2597                 ],
2598                 'defines': [
2599                   'THREAD_SANITIZER',
2600                   'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
2601                 ],
2602                 'target_conditions': [
2603                   ['_type=="executable"', {
2604                     'ldflags': [
2605                       '-pie',
2606                     ],
2607                   }],
2608                 ],
2609               }],
2610             ],
2611           }],
2612           ['order_profiling!=0 and (chromeos==1 or OS=="linux")', {
2613             'target_conditions' : [
2614               ['_toolset=="target"', {
2615                 'cflags': [
2616                   '-finstrument-functions',
2617                   # Allow mmx intrinsics to inline, so that the
2618                   # compiler can expand the intrinsics.
2619                   '-finstrument-functions-exclude-file-list=mmintrin.h',
2620                 ],
2621               }],
2622             ],
2623           }],
2624           ['linux_breakpad==1', {
2625             'cflags': [ '-g' ],
2626             'defines': ['USE_LINUX_BREAKPAD'],
2627           }],
2628           ['linux_use_heapchecker==1', {
2629             'variables': {'linux_use_tcmalloc%': 1},
2630             'defines': ['USE_HEAPCHECKER'],
2631           }],
2632           ['linux_use_tcmalloc==0', {
2633             'defines': ['NO_TCMALLOC'],
2634           }],
2635           ['linux_keep_shadow_stacks==1', {
2636             'defines': ['KEEP_SHADOW_STACKS'],
2637             'cflags': [
2638               '-finstrument-functions',
2639               # Allow mmx intrinsics to inline, so that the compiler can expand
2640               # the intrinsics.
2641               '-finstrument-functions-exclude-file-list=mmintrin.h',
2642             ],
2643           }],
2644           ['linux_use_gold_flags==1', {
2645             'ldflags': [
2646               # Experimentation found that using four linking threads
2647               # saved ~20% of link time.
2648               # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
2649               '-Wl,--threads',
2650               '-Wl,--thread-count=4',
2651             ],
2652             'conditions': [
2653               ['release_valgrind_build==0', {
2654                 'target_conditions': [
2655                   ['_toolset=="target"', {
2656                     'ldflags': [
2657                       # There seems to be a conflict of --icf and -pie
2658                       # in gold which can generate crashy binaries. As
2659                       # a security measure, -pie takes precendence for
2660                       # now.
2661                       #'-Wl,--icf=safe',
2662                       '-Wl,--icf=none',
2663                     ],
2664                   }],
2665                 ],
2666               }],
2667             ],
2668           }],
2669           ['linux_use_gold_binary==1', {
2670             'variables': {
2671               'conditions': [
2672                 ['inside_chromium_build==1', {
2673                   # We pass the path to gold to the compiler.  gyp leaves
2674                   # unspecified what the cwd is when running the compiler,
2675                   # so the normal gyp path-munging fails us.  This hack
2676                   # gets the right path.
2677                   'gold_path': '<(PRODUCT_DIR)/../../third_party/gold',
2678                 }, {
2679                   'gold_path': '<(PRODUCT_DIR)/../../Source/WebKit/chromium/third_party/gold',
2680                 }]
2681               ]
2682             },
2683             'ldflags': [
2684               # Put our gold binary in the search path for the linker.
2685               '-B<(gold_path)',
2686             ],
2687           }],
2688         ],
2689       },
2690     }],
2691     # FreeBSD-specific options; note that most FreeBSD options are set above,
2692     # with Linux.
2693     ['OS=="freebsd"', {
2694       'target_defaults': {
2695         'ldflags': [
2696           '-Wl,--no-keep-memory',
2697         ],
2698       },
2699     }],
2700     # Android-specific options; note that most are set above with Linux.
2701     ['OS=="android"', {
2702       'variables': {
2703         # This is the id for the archived chrome symbols. Each build that
2704         # archives symbols is assigned an id which is then added to GYP_DEFINES.
2705         # This is written to the device log on crashes just prior to dropping a
2706         # tombstone. Tools can determine the location of the archived symbols
2707         # from the id.
2708         'chrome_symbols_id%': '',
2709         'conditions': [
2710           # Use shared stlport library when system one used.
2711           # Figure this out early since it needs symbols from libgcc.a, so it
2712           # has to be before that in the set of libraries.
2713           ['use_system_stlport==1', {
2714             'android_stlport_library': 'stlport',
2715           }, {
2716             'android_stlport_library': 'stlport_static',
2717           }],
2718         ],
2720         # Placing this variable here prevents from forking libvpx, used
2721         # by remoting.  Remoting is off, so it needn't built,
2722         # so forking it's deps seems like overkill.
2723         # But this variable need defined to properly run gyp.
2724         # A proper solution is to have an OS==android conditional
2725         # in third_party/libvpx/libvpx.gyp to define it.
2726         'libvpx_path': 'lib/linux/arm',
2727       },
2728       'target_defaults': {
2729         'variables': {
2730           'release_extra_cflags%': '',
2731         },
2733         'target_conditions': [
2734           # Settings for building device targets using Android's toolchain.
2735           # These are based on the setup.mk file from the Android NDK.
2736           #
2737           # The NDK Android executable link step looks as follows:
2738           #  $LDFLAGS
2739           #  $(TARGET_CRTBEGIN_DYNAMIC_O)  <-- crtbegin.o
2740           #  $(PRIVATE_OBJECTS)            <-- The .o that we built
2741           #  $(PRIVATE_STATIC_LIBRARIES)   <-- The .a that we built
2742           #  $(TARGET_LIBGCC)              <-- libgcc.a
2743           #  $(PRIVATE_SHARED_LIBRARIES)   <-- The .so that we built
2744           #  $(PRIVATE_LDLIBS)             <-- System .so
2745           #  $(TARGET_CRTEND_O)            <-- crtend.o
2746           #
2747           # For now the above are approximated for executables by adding
2748           # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
2749           # of 'libraries'.
2750           #
2751           # The NDK Android shared library link step looks as follows:
2752           #  $LDFLAGS
2753           #  $(PRIVATE_OBJECTS)            <-- The .o that we built
2754           #  -l,--whole-archive
2755           #  $(PRIVATE_WHOLE_STATIC_LIBRARIES)
2756           #  -l,--no-whole-archive
2757           #  $(PRIVATE_STATIC_LIBRARIES)   <-- The .a that we built
2758           #  $(TARGET_LIBGCC)              <-- libgcc.a
2759           #  $(PRIVATE_SHARED_LIBRARIES)   <-- The .so that we built
2760           #  $(PRIVATE_LDLIBS)             <-- System .so
2761           #
2762           # For now, assume that whole static libraries are not needed.
2763           #
2764           # For both executables and shared libraries, add the proper
2765           # libgcc.a to the start of libraries which puts it in the
2766           # proper spot after .o and .a files get linked in.
2767           #
2768           # TODO: The proper thing to do longer-tem would be proper gyp
2769           # support for a custom link command line.
2770           ['_toolset=="target"', {
2771            'conditions': [
2772            ['build_with_mozilla==0', {
2773             'cflags!': [
2774               '-pthread',  # Not supported by Android toolchain.
2775             ],
2776             'cflags': [
2777               '-ffunction-sections',
2778               '-funwind-tables',
2779               '-g',
2780               '-fstack-protector',
2781               '-fno-short-enums',
2782               '-finline-limit=64',
2783               '-Wa,--noexecstack',
2784               '<@(release_extra_cflags)',
2785             ],
2786             'ldflags!': [
2787               '-pthread',  # Not supported by Android toolchain.
2788             ],
2789             'ldflags': [
2790               '-nostdlib',
2791               '-Wl,--no-undefined',
2792               # Don't export symbols from statically linked libraries.
2793               '-Wl,--exclude-libs=ALL',
2794             ],
2795             'libraries': [
2796               '-l<(android_stlport_library)',
2797               # Manually link the libgcc.a that the cross compiler uses.
2798               '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
2799               '-lc',
2800               '-ldl',
2801               '-lstdc++',
2802               '-lm',
2803             ],
2804             'conditions': [
2805               ['android_upstream_bringup==1', {
2806                 'defines': ['ANDROID_UPSTREAM_BRINGUP=1',],
2807               }],
2808               ['clang==1', {
2809                 'cflags': [
2810                   # Work around incompatibilities between bionic and clang
2811                   # headers.
2812                   '-D__compiler_offsetof=__builtin_offsetof',
2813                   '-Dnan=__builtin_nan',
2814                 ],
2815                 'conditions': [
2816                   ['target_arch=="arm"', {
2817                     'cflags': [
2818                       '-target arm-linux-androideabi',
2819                       '-mllvm -arm-enable-ehabi',
2820                     ],
2821                     'ldflags': [
2822                       '-target arm-linux-androideabi',
2823                     ],
2824                   }],
2825                   ['target_arch=="ia32"', {
2826                     'cflags': [
2827                       '-target x86-linux-androideabi',
2828                     ],
2829                     'ldflags': [
2830                       '-target x86-linux-androideabi',
2831                     ],
2832                   }],
2833                 ],
2834               }],
2835               ['android_build_type==0', {
2836                 'defines': [
2837                   # The NDK has these things, but doesn't define the constants
2838                   # to say that it does. Define them here instead.
2839                   'HAVE_SYS_UIO_H',
2840                 ],
2841                 'cflags': [
2842                   '--sysroot=<(android_ndk_sysroot)',
2843                 ],
2844                 'ldflags': [
2845                   '--sysroot=<(android_ndk_sysroot)',
2846                 ],
2847               }],
2848               ['android_build_type==1', {
2849                 'include_dirs': [
2850                   # OpenAL headers from the Android tree.
2851                   '<(android_src)/frameworks/wilhelm/include',
2852                 ],
2853                 'cflags': [
2854                   # Chromium builds its own (non-third-party) code with
2855                   # -Werror to make all warnings into errors. However, Android
2856                   # enables warnings that Chromium doesn't, so some of these
2857                   # extra warnings trip and break things.
2858                   # For now, we leave these warnings enabled but prevent them
2859                   # from being treated as errors.
2860                   #
2861                   # Things that are part of -Wextra:
2862                   '-Wno-error=extra', # Enabled by -Wextra, but no specific flag
2863                   '-Wno-error=ignored-qualifiers',
2864                   '-Wno-error=type-limits',
2865                   # Other things unrelated to -Wextra:
2866                   '-Wno-error=non-virtual-dtor',
2867                   '-Wno-error=sign-promo',
2868                 ],
2869                 'cflags_cc': [
2870                   # Disabling c++0x-compat should be handled in WebKit, but
2871                   # this currently doesn't work because gcc_version is not set
2872                   # correctly when building with the Android build system.
2873                   # TODO(torne): Fix this in WebKit.
2874                   '-Wno-error=c++0x-compat',
2875                 ],
2876               }],
2877               ['android_build_type==1 and chromium_code==0', {
2878                 'cflags': [
2879                   # There is a class of warning which:
2880                   #  1) Android always enables and also treats as errors
2881                   #  2) Chromium ignores in third party code
2882                   # For now, I am leaving these warnings enabled but preventing
2883                   # them from being treated as errors here.
2884                   '-Wno-error=address',
2885                   '-Wno-error=format-security',
2886                   '-Wno-error=non-virtual-dtor',
2887                   '-Wno-error=return-type',
2888                   '-Wno-error=sequence-point',
2889                 ],
2890               }],
2891               ['target_arch == "arm"', {
2892                 'ldflags': [
2893                   # Enable identical code folding to reduce size.
2894                   '-Wl,--icf=safe',
2895                 ],
2896               }],
2897               # NOTE: The stlport header include paths below are specified in
2898               # cflags rather than include_dirs because they need to come
2899               # after include_dirs. Think of them like system headers, but
2900               # don't use '-isystem' because the arm-linux-androideabi-4.4.3
2901               # toolchain (circa Gingerbread) will exhibit strange errors.
2902               # The include ordering here is important; change with caution.
2903               ['use_system_stlport==1', {
2904                 'cflags': [
2905                   # For libstdc++/include, which is used by stlport.
2906                   '-I<(android_src)/bionic',
2907                   '-I<(android_src)/external/stlport/stlport',
2908                 ],
2909               }, { # else: use_system_stlport!=1
2910                 'cflags': [
2911                   '-I<(android_ndk_root)/sources/cxx-stl/stlport/stlport',
2912                 ],
2913                 'conditions': [
2914                   ['target_arch=="arm" and armv7==1', {
2915                     'ldflags': [
2916                       '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/armeabi-v7a',
2917                     ],
2918                   }],
2919                   ['target_arch=="arm" and armv7==0', {
2920                     'ldflags': [
2921                       '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/armeabi',
2922                     ],
2923                   }],
2924                   ['target_arch=="ia32"', {
2925                     'ldflags': [
2926                       '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/x86',
2927                     ],
2928                   }],
2929                 ],
2930               }],
2931               ['target_arch=="ia32"', {
2932                 # The x86 toolchain currently has problems with stack-protector.
2933                 'cflags!': [
2934                   '-fstack-protector',
2935                 ],
2936                 'cflags': [
2937                   '-fno-stack-protector',
2938                 ],
2939               }],
2940             ],
2941             'target_conditions': [
2942               ['_type=="executable"', {
2943                 'ldflags': [
2944                   '-Bdynamic',
2945                   '-Wl,-dynamic-linker,/system/bin/linker',
2946                   '-Wl,--gc-sections',
2947                   '-Wl,-z,nocopyreloc',
2948                   # crtbegin_dynamic.o should be the last item in ldflags.
2949                   '<(android_ndk_lib)/crtbegin_dynamic.o',
2950                 ],
2951                 'libraries': [
2952                   # crtend_android.o needs to be the last item in libraries.
2953                   # Do not add any libraries after this!
2954                   '<(android_ndk_lib)/crtend_android.o',
2955                 ],
2956               }],
2957               ['_type=="shared_library" or _type=="loadable_module"', {
2958                 'ldflags': [
2959                   '-Wl,-shared,-Bsymbolic',
2960                   # crtbegin_so.o should be the last item in ldflags.
2961                   '<(android_ndk_lib)/crtbegin_so.o',
2962                 ],
2963                 'libraries': [
2964                   # crtend_so.o needs to be the last item in libraries.
2965                   # Do not add any libraries after this!
2966                   '<(android_ndk_lib)/crtend_so.o',
2967                 ],
2968               }],
2969             ],
2971            }], # build_with_mozilla== 0
2973             ],
2974             'defines': [
2975               'ANDROID',
2976               '__GNU_SOURCE=1',  # Necessary for clone()
2977               'USE_STLPORT=1',
2978               '_STLP_USE_PTR_SPECIALIZATIONS=1',
2979               'CHROME_SYMBOLS_ID="<(chrome_symbols_id)"',
2980             ],
2981            }],
2982           # Settings for building host targets using the system toolchain.
2983           ['_toolset=="host"', {
2984             'cflags!': [
2985               # Due to issues in Clang build system, using ASan on 32-bit
2986               # binaries on x86_64 host is problematic.
2987               # TODO(eugenis): re-enable.
2988               '-faddress-sanitizer',
2989             ],
2990             'ldflags!': [
2991               '-faddress-sanitizer',
2992               '-Wl,-z,noexecstack',
2993               '-Wl,--gc-sections',
2994               '-Wl,-O1',
2995               '-Wl,--as-needed',
2996             ],
2997             'sources/': [
2998               ['exclude', '_android(_unittest)?\\.cc$'],
2999               ['exclude', '(^|/)android/']
3000             ],
3001           }],
3002         ],
3003       },
3004     }],
3005     ['OS=="solaris"', {
3006       'cflags!': ['-fvisibility=hidden'],
3007       'cflags_cc!': ['-fvisibility-inlines-hidden'],
3008     }],
3009     ['OS=="mac" or OS=="ios"', {
3010       'target_defaults': {
3011         'mac_bundle': 0,
3012         'xcode_settings': {
3013           'ALWAYS_SEARCH_USER_PATHS': 'NO',
3014           'GCC_C_LANGUAGE_STANDARD': 'c99',         # -std=c99
3015           'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
3016           'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
3017           'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
3018           'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
3019           # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
3020           'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
3021           'GCC_OBJC_CALL_CXX_CDTORS': 'YES',        # -fobjc-call-cxx-cdtors
3022           'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden
3023           'GCC_THREADSAFE_STATICS': 'NO',           # -fno-threadsafe-statics
3024           'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',    # -Werror
3025           'GCC_VERSION': '4.2',
3026           'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',  # -Wnewline-eof
3027           'USE_HEADERMAP': 'NO',
3028           'WARNING_CFLAGS': [
3029             '-Wall',
3030             '-Wendif-labels',
3031             '-Wextra',
3032             # Don't warn about unused function parameters.
3033             '-Wno-unused-parameter',
3034             # Don't warn about the "struct foo f = {0};" initialization
3035             # pattern.
3036             '-Wno-missing-field-initializers',
3037           ],
3038           'conditions': [
3039             ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
3040                                  {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
3041             ],
3042           ],
3043         },
3044         'target_conditions': [
3045           ['_type!="static_library"', {
3046             'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
3047           }],
3048           ['_mac_bundle', {
3049             'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
3050           }],
3051         ],  # target_conditions
3052       },  # target_defaults
3053     }],  # OS=="mac" or OS=="ios"
3054     ['OS=="mac"', {
3055       'target_defaults': {
3056         'variables': {
3057           # These should end with %, but there seems to be a bug with % in
3058           # variables that are intended to be set to different values in
3059           # different targets, like these.
3060           'mac_pie': 1,        # Most executables can be position-independent.
3061           'mac_real_dsym': 0,  # Fake .dSYMs are fine in most cases.
3062           # Strip debugging symbols from the target.
3063           'mac_strip': '<(mac_strip_release)',
3064         },
3065         'xcode_settings': {
3066           'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
3067                                                     # (Equivalent to -fPIC)
3068           # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
3069           'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
3070           # Keep pch files below xcodebuild/.
3071           'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
3072           'OTHER_CFLAGS': [
3073             '-fno-strict-aliasing',  # See http://crbug.com/32204
3074           ],
3075           'conditions': [
3076             ['clang==1', {
3077               'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
3078               'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
3080               # Don't use -Wc++0x-extensions, which Xcode 4 enables by default
3081               # when buliding with clang. This warning is triggered when the
3082               # override keyword is used via the OVERRIDE macro from
3083               # base/compiler_specific.h.
3084               'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
3086               'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
3087               'WARNING_CFLAGS': [
3088                 '-Wheader-hygiene',
3089                 # Don't die on dtoa code that uses a char as an array index.
3090                 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
3091                 '-Wno-char-subscripts',
3092                 # Clang spots more unused functions.
3093                 '-Wno-unused-function',
3094                 # See comments on this flag higher up in this file.
3095                 '-Wno-unnamed-type-template-args',
3096                 # This (rightyfully) complains about 'override', which we use
3097                 # heavily.
3098                 '-Wno-c++11-extensions',
3100                 # Warns on switches on enums that cover all enum values but
3101                 # also contain a default: branch. Chrome is full of that.
3102                 '-Wno-covered-switch-default',
3104                 # TODO(thakis): Remove this.
3105                 '-Wno-implicit-conversion-floating-point-to-bool',
3106               ],
3107             }],
3108             ['clang==1 and clang_use_chrome_plugins==1', {
3109               'OTHER_CFLAGS': [
3110                 '<@(clang_chrome_plugins_flags)',
3111               ],
3112             }],
3113             ['clang==1 and clang_load!=""', {
3114               'OTHER_CFLAGS': [
3115                 '-Xclang', '-load', '-Xclang', '<(clang_load)',
3116               ],
3117             }],
3118             ['clang==1 and clang_add_plugin!=""', {
3119               'OTHER_CFLAGS': [
3120                 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
3121               ],
3122             }],
3123             ['clang==1 and "<(GENERATOR)"=="ninja"', {
3124               'OTHER_CFLAGS': [
3125                 # See http://crbug.com/110262
3126                 '-fcolor-diagnostics',
3127               ],
3128             }],
3129           ],
3130         },
3131         'conditions': [
3132           ['clang==1', {
3133             'variables': {
3134               'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
3135             },
3136           }],
3137           ['asan==1', {
3138             'xcode_settings': {
3139               'OTHER_CFLAGS': [
3140                 '-faddress-sanitizer',
3141               ],
3142             },
3143             'defines': [
3144               'ADDRESS_SANITIZER',
3145             ],
3146           }],
3147         ],
3148         'target_conditions': [
3149           ['_type!="static_library"', {
3150             'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
3151             'conditions': [
3152               ['asan==1', {
3153                 'xcode_settings': {
3154                   'OTHER_LDFLAGS': [
3155                     '-faddress-sanitizer',
3156                   ],
3157                 },
3158               }],
3159             ],
3160           }],
3161           ['_mac_bundle', {
3162             'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
3163           }],
3164           ['_type=="executable"', {
3165             'postbuilds': [
3166               {
3167                 # Arranges for data (heap) pages to be protected against
3168                 # code execution when running on Mac OS X 10.7 ("Lion"), and
3169                 # ensures that the position-independent executable (PIE) bit
3170                 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
3171                 'variables': {
3172                   # Define change_mach_o_flags in a variable ending in _path
3173                   # so that GYP understands it's a path and performs proper
3174                   # relativization during dict merging.
3175                   'change_mach_o_flags':
3176                       'mac/change_mach_o_flags_from_xcode.sh',
3177                   'change_mach_o_flags_options%': [
3178                   ],
3179                   'target_conditions': [
3180                     ['mac_pie==0 or release_valgrind_build==1', {
3181                       # Don't enable PIE if it's unwanted. It's unwanted if
3182                       # the target specifies mac_pie=0 or if building for
3183                       # Valgrind, because Valgrind doesn't understand slide.
3184                       # See the similar mac_pie/release_valgrind_build check
3185                       # below.
3186                       'change_mach_o_flags_options': [
3187                         '--no-pie',
3188                       ],
3189                     }],
3190                   ],
3191                 },
3192                 'postbuild_name': 'Change Mach-O Flags',
3193                 'action': [
3194                    '$(srcdir)$(os_sep)build$(os_sep)<(change_mach_o_flags)',
3195                   '>@(change_mach_o_flags_options)',
3196                 ],
3197               },
3198             ],
3199             'conditions': [
3200               ['asan==1', {
3201                 'variables': {
3202                  'asan_saves_file': 'asan.saves',
3203                 },
3204                 'xcode_settings': {
3205                   'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
3206                 },
3207               }],
3208             ],
3209             'target_conditions': [
3210               ['mac_pie==1 and release_valgrind_build==0', {
3211                 # Turn on position-independence (ASLR) for executables. When
3212                 # PIE is on for the Chrome executables, the framework will
3213                 # also be subject to ASLR.
3214                 # Don't do this when building for Valgrind, because Valgrind
3215                 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
3216                 # understand slide, and get rid of the Valgrind check.
3217                 'xcode_settings': {
3218                   'OTHER_LDFLAGS': [
3219                     '-Wl,-pie',  # Position-independent executable (MH_PIE)
3220                   ],
3221                 },
3222               }],
3223             ],
3224           }],
3225           ['(_type=="executable" or _type=="shared_library" or \
3226              _type=="loadable_module") and mac_strip!=0', {
3227             'target_conditions': [
3228               ['mac_real_dsym == 1', {
3229                 # To get a real .dSYM bundle produced by dsymutil, set the
3230                 # debug information format to dwarf-with-dsym.  Since
3231                 # strip_from_xcode will not be used, set Xcode to do the
3232                 # stripping as well.
3233                 'configurations': {
3234                   'Release_Base': {
3235                     'xcode_settings': {
3236                       'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3237                       'DEPLOYMENT_POSTPROCESSING': 'YES',
3238                       'STRIP_INSTALLED_PRODUCT': 'YES',
3239                       'target_conditions': [
3240                         ['_type=="shared_library" or _type=="loadable_module"', {
3241                           # The Xcode default is to strip debugging symbols
3242                           # only (-S).  Local symbols should be stripped as
3243                           # well, which will be handled by -x.  Xcode will
3244                           # continue to insert -S when stripping even when
3245                           # additional flags are added with STRIPFLAGS.
3246                           'STRIPFLAGS': '-x',
3247                         }],  # _type=="shared_library" or _type=="loadable_module"'
3248                       ],  # target_conditions
3249                     },  # xcode_settings
3250                   },  # configuration "Release"
3251                 },  # configurations
3252               }, {  # mac_real_dsym != 1
3253                 # To get a fast fake .dSYM bundle, use a post-build step to
3254                 # produce the .dSYM and strip the executable.  strip_from_xcode
3255                 # only operates in the Release configuration.
3256                 'postbuilds': [
3257                   {
3258                     'variables': {
3259                       # Define strip_from_xcode in a variable ending in _path
3260                       # so that gyp understands it's a path and performs proper
3261                       # relativization during dict merging.
3262                       'strip_from_xcode': 'mac/strip_from_xcode',
3263                     },
3264                     'postbuild_name': 'Strip If Needed',
3265                     'action': ['$(srcdir)$(os_sep)build$(os_sep)<(strip_from_xcode)'],
3266                   },
3267                 ],  # postbuilds
3268               }],  # mac_real_dsym
3269             ],  # target_conditions
3270           }],  # (_type=="executable" or _type=="shared_library" or
3271                #  _type=="loadable_module") and mac_strip!=0
3272         ],  # target_conditions
3273       },  # target_defaults
3274     }],  # OS=="mac"
3275     ['OS=="ios"', {
3276       'target_defaults': {
3277         'xcode_settings' : {
3278           'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
3280           # This next block is mostly common with the 'mac' section above,
3281           # but keying off (or setting) 'clang' isn't valid for iOS as it
3282           # also seems to mean using the custom build of clang.
3284           # Don't use -Wc++0x-extensions, which Xcode 4 enables by default
3285           # when buliding with clang. This warning is triggered when the
3286           # override keyword is used via the OVERRIDE macro from
3287           # base/compiler_specific.h.
3288           'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
3289           'WARNING_CFLAGS': [
3290             '-Wheader-hygiene',
3291             # Don't die on dtoa code that uses a char as an array index.
3292             # This is required solely for base/third_party/dmg_fp/dtoa.cc.
3293             '-Wno-char-subscripts',
3294             # Clang spots more unused functions.
3295             '-Wno-unused-function',
3296             # See comments on this flag higher up in this file.
3297             '-Wno-unnamed-type-template-args',
3298             # This (rightyfully) complains about 'override', which we use
3299             # heavily.
3300             '-Wno-c++11-extensions',
3301           ],
3302         },
3303         'target_conditions': [
3304           ['_type=="executable"', {
3305             'configurations': {
3306               'Release_Base': {
3307                 'xcode_settings': {
3308                   'DEPLOYMENT_POSTPROCESSING': 'YES',
3309                   'STRIP_INSTALLED_PRODUCT': 'YES',
3310                 },
3311               },
3312             },
3313             'xcode_settings': {
3314               'conditions': [
3315                 ['chromium_ios_signing', {
3316                   # iOS SDK wants everything for device signed.
3317                   'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
3318                 }, {
3319                   'CODE_SIGNING_REQUIRED': 'NO',
3320                   'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
3321                 }],
3322               ],
3323             },
3324           }],
3325         ],  # target_conditions
3326       },  # target_defaults
3327     }],  # OS=="ios"
3328     ['OS=="win"', {
3329       'target_defaults': {
3330         'defines': [
3331           'WIN32',
3332           '_WINDOWS',
3333           'NOMINMAX',
3334           '_CRT_RAND_S',
3335           'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
3336           'WIN32_LEAN_AND_MEAN',
3337           '_ATL_NO_OPENGL',
3338         ],
3339         'conditions': [
3340           ['build_with_mozilla==0', {
3341               'defines': [
3342                 '_WIN32_WINNT=0x0602',
3343                 'WINVER=0x0602',
3344               ],
3345           }],
3346           ['buildtype=="Official"', {
3347               # In official builds, targets can self-select an optimization
3348               # level by defining a variable named 'optimize', and setting it
3349               # to one of
3350               # - "size", optimizes for minimal code size - the default.
3351               # - "speed", optimizes for speed over code size.
3352               # - "max", whole program optimization and link-time code
3353               #   generation. This is very expensive and should be used
3354               #   sparingly.
3355               'variables': {
3356                 'optimize%': 'size',
3357               },
3358               'target_conditions': [
3359                 ['optimize=="size"', {
3360                     'msvs_settings': {
3361                       'VCCLCompilerTool': {
3362                         # 1, optimizeMinSpace, Minimize Size (/O1)
3363                         'Optimization': '1',
3364                         # 2, favorSize - Favor small code (/Os)
3365                         'FavorSizeOrSpeed': '2',
3366                       },
3367                     },
3368                   },
3369                 ],
3370                 ['optimize=="speed"', {
3371                     'msvs_settings': {
3372                       'VCCLCompilerTool': {
3373                         # 2, optimizeMaxSpeed, Maximize Speed (/O2)
3374                         'Optimization': '2',
3375                         # 1, favorSpeed - Favor fast code (/Ot)
3376                         'FavorSizeOrSpeed': '1',
3377                       },
3378                     },
3379                   },
3380                 ],
3381                 ['optimize=="max"', {
3382                     'msvs_settings': {
3383                       'VCCLCompilerTool': {
3384                         # 2, optimizeMaxSpeed, Maximize Speed (/O2)
3385                         'Optimization': '2',
3386                         # 1, favorSpeed - Favor fast code (/Ot)
3387                         'FavorSizeOrSpeed': '1',
3388                         # This implies link time code generation.
3389                         'WholeProgramOptimization': 'true',
3390                       },
3391                     },
3392                   },
3393                 ],
3394               ],
3395             },
3396           ],
3397           ['component=="static_library"', {
3398             'defines': [
3399               '_HAS_EXCEPTIONS=0',
3400             ],
3401           }],
3402           ['MSVS_VERSION=="2008"', {
3403             'defines': [
3404               '_HAS_TR1=0',
3405             ],
3406           }],
3407           ['secure_atl', {
3408             'defines': [
3409               '_SECURE_ATL',
3410             ],
3411           }],
3412         ],
3413         'msvs_system_include_dirs': [
3414           '<(windows_sdk_path)/Include/shared',
3415           '<(windows_sdk_path)/Include/um',
3416           '<(windows_sdk_path)/Include/winrt',
3417 #          '<(directx_sdk_path)/Include',
3418           '$(VSInstallDir)/VC/atlmfc/include',
3419         ],
3420         'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
3421         'msvs_disabled_warnings': [4351, 4396, 4503, 4819,
3422           # TODO(maruel): These warnings are level 4. They will be slowly
3423           # removed as code is fixed.
3424           4100, 4121, 4125, 4127, 4130, 4131, 4189, 4201, 4238, 4244, 4245,
3425           4310, 4355, 4428, 4481, 4505, 4510, 4512, 4530, 4610, 4611, 4701,
3426           4702, 4706,
3427         ],
3428         'msvs_settings': {
3429           'VCCLCompilerTool': {
3430             'AdditionalOptions': ['/MP'],
3431             'MinimalRebuild': 'false',
3432             'BufferSecurityCheck': 'true',
3433             'EnableFunctionLevelLinking': 'true',
3434             'RuntimeTypeInfo': 'false',
3435             'WarningLevel': '4',
3436             'WarnAsError': 'true',
3437             'DebugInformationFormat': '3',
3438             'conditions': [
3439               ['component=="shared_library"', {
3440                 'ExceptionHandling': '1',  # /EHsc
3441               }, {
3442                 'ExceptionHandling': '0',
3443               }],
3444             ],
3445           },
3446           'VCLibrarianTool': {
3447             'AdditionalOptions': ['/ignore:4221'],
3448             'AdditionalLibraryDirectories': [
3449 #              '<(directx_sdk_path)/Lib/x86',
3450               '<(windows_sdk_path)/Lib/win8/um/x86',
3451             ],
3452           },
3453           'VCLinkerTool': {
3454             'AdditionalDependencies': [
3455               'wininet.lib',
3456               'dnsapi.lib',
3457               'version.lib',
3458               'msimg32.lib',
3459               'ws2_32.lib',
3460               'usp10.lib',
3461               'dbghelp.lib',
3462               'winmm.lib',
3463               'shlwapi.lib',
3464             ],
3466             'conditions': [
3467               ['msvs_express', {
3468                 # Explicitly required when using the ATL with express
3469                 'AdditionalDependencies': [
3470                   'atlthunk.lib',
3471                 ],
3473                 # ATL 8.0 included in WDK 7.1 makes the linker to generate
3474                 # almost eight hundred LNK4254 and LNK4078 warnings:
3475                 #   - warning LNK4254: section 'ATL' (50000040) merged into
3476                 #     '.rdata' (40000040) with different attributes
3477                 #   - warning LNK4078: multiple 'ATL' sections found with
3478                 #     different attributes
3479                 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
3480               }],
3481               ['MSVS_VERSION=="2005e"', {
3482                 # Non-express versions link automatically to these
3483                 'AdditionalDependencies': [
3484                   'advapi32.lib',
3485                   'comdlg32.lib',
3486                   'ole32.lib',
3487                   'shell32.lib',
3488                   'user32.lib',
3489                   'winspool.lib',
3490                 ],
3491               }],
3492             ],
3493             'AdditionalLibraryDirectories': [
3494 #              '<(directx_sdk_path)/Lib/x86', XXXX
3495               '<(windows_sdk_path)/Lib/win8/um/x86',
3496             ],
3497             'GenerateDebugInformation': 'true',
3498             'MapFileName': '$(OutDir)\\$(TargetName).map',
3499             'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
3500             'FixedBaseAddress': '1',
3501             # SubSystem values:
3502             #   0 == not set
3503             #   1 == /SUBSYSTEM:CONSOLE
3504             #   2 == /SUBSYSTEM:WINDOWS
3505             # Most of the executables we'll ever create are tests
3506             # and utilities with console output.
3507             'SubSystem': '1',
3508           },
3509           'VCMIDLTool': {
3510             'GenerateStublessProxies': 'true',
3511             'TypeLibraryName': '$(InputName).tlb',
3512             'OutputDirectory': '$(IntDir)',
3513             'HeaderFileName': '$(InputName).h',
3514             'DLLDataFileName': '$(InputName).dlldata.c',
3515             'InterfaceIdentifierFileName': '$(InputName)_i.c',
3516             'ProxyFileName': '$(InputName)_p.c',
3517           },
3518           'VCResourceCompilerTool': {
3519             'Culture' : '1033',
3520             'AdditionalIncludeDirectories': [
3521               '<(DEPTH)',
3522               '<(SHARED_INTERMEDIATE_DIR)',
3523             ],
3524           },
3525         },
3526       },
3527     }],
3528     ['disable_nacl==1', {
3529       'target_defaults': {
3530         'defines': [
3531           'DISABLE_NACL',
3532         ],
3533       },
3534     }],
3535     ['OS=="win" and msvs_use_common_linker_extras', {
3536       'target_defaults': {
3537         'msvs_settings': {
3538           'VCLinkerTool': {
3539             'DelayLoadDLLs': [
3540               'dbghelp.dll',
3541               'dwmapi.dll',
3542               'shell32.dll',
3543               'uxtheme.dll',
3544             ],
3545           },
3546         },
3547         'configurations': {
3548           'x86_Base': {
3549             'msvs_settings': {
3550               'VCLinkerTool': {
3551                 'AdditionalOptions': [
3552                   '/safeseh',
3553                   '/dynamicbase',
3554                   '/ignore:4199',
3555                   '/ignore:4221',
3556                   '/nxcompat',
3557                 ],
3558               },
3559             },
3560           },
3561           'x64_Base': {
3562             'msvs_settings': {
3563               'VCLinkerTool': {
3564                 'AdditionalOptions': [
3565                   # safeseh is not compatible with x64
3566                   '/dynamicbase',
3567                   '/ignore:4199',
3568                   '/ignore:4221',
3569                   '/nxcompat',
3570                 ],
3571               },
3572             },
3573           },
3574         },
3575       },
3576     }],
3577     ['enable_new_npdevice_api==1', {
3578       'target_defaults': {
3579         'defines': [
3580           'ENABLE_NEW_NPDEVICE_API',
3581         ],
3582       },
3583     }],
3584     ['clang==1', {
3585       'conditions': [
3586         ['OS=="android"', {
3587           # Android could use the goma with clang.
3588           'make_global_settings': [
3589             ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang)'],
3590             ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang++)'],
3591             ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang++)'],
3592             ['CC.host', '$(CC)'],
3593             ['CXX.host', '$(CXX)'],
3594             ['LINK.host', '$(LINK)'],
3595           ],
3596         }, {
3597           'make_global_settings': [
3598             ['CC', '<(make_clang_dir)/bin/clang'],
3599             ['CXX', '<(make_clang_dir)/bin/clang++'],
3600             ['LINK', '$(CXX)'],
3601             ['CC.host', '$(CC)'],
3602             ['CXX.host', '$(CXX)'],
3603             ['LINK.host', '$(LINK)'],
3604           ],
3605         }],
3606       ],
3607     }],
3608     ['OS=="android" and clang==0', {
3609       # Hardcode the compiler names in the Makefile so that
3610       # it won't depend on the environment at make time.
3611       'make_global_settings': [
3612         ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)'],
3613         ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-g++)'],
3614         ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)'],
3615         ['CC.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which gcc))'],
3616         ['CXX.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which g++))'],
3617         ['LINK.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which g++))'],
3618       ],
3619     }],
3620   ],
3621   'xcode_settings': {
3622     # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
3623     # This block adds *project-wide* configuration settings to each project
3624     # file.  It's almost always wrong to put things here.  Specify your
3625     # custom xcode_settings in target_defaults to add them to targets instead.
3627     'conditions': [
3628       # In an Xcode Project Info window, the "Base SDK for All Configurations"
3629       # setting sets the SDK on a project-wide basis. In order to get the
3630       # configured SDK to show properly in the Xcode UI, SDKROOT must be set
3631       # here at the project level.
3632       ['OS=="mac"', {
3633         'conditions': [
3634           ['mac_sdk_path==""', {
3635             'SDKROOT': 'macosx<(mac_sdk)',  # -isysroot
3636           }, {
3637             'SDKROOT': '<(mac_sdk_path)',  # -isysroot
3638           }],
3639         ],
3640       }],
3641       ['OS=="ios"', {
3642         'conditions': [
3643           ['ios_sdk_path==""', {
3644             'SDKROOT': 'iphoneos<(ios_sdk)',  # -isysroot
3645           }, {
3646             'SDKROOT': '<(ios_sdk_path)',  # -isysroot
3647           }],
3648         ],
3649       }],
3650       ['OS=="ios"', {
3651         # Just build armv7 since iOS 4.3+ only supports armv7.
3652         'ARCHS': '$(ARCHS_UNIVERSAL_IPHONE_OS)',
3653         'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
3654         # Target both iPhone and iPad.
3655         'TARGETED_DEVICE_FAMILY': '1,2',
3656       }],
3657     ],
3659     # The Xcode generator will look for an xcode_settings section at the root
3660     # of each dict and use it to apply settings on a file-wide basis.  Most
3661     # settings should not be here, they should be in target-specific
3662     # xcode_settings sections, or better yet, should use non-Xcode-specific
3663     # settings in target dicts.  SYMROOT is a special case, because many other
3664     # Xcode variables depend on it, including variables such as
3665     # PROJECT_DERIVED_FILE_DIR.  When a source group corresponding to something
3666     # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
3667     # files to appear (when present) in the UI as actual files and not red
3668     # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
3669     # and therefore SYMROOT, needs to be set at the project level.
3670     'SYMROOT': '<(DEPTH)/xcodebuild',
3671   },