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.
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.
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.
21 # Whether we're building a ChromeOS build.
24 # Whether or not we are using the Aura windowing framework.
27 # Whether or not we are building the Ash shell.
30 # Whether or not we are using CRAS, the ChromeOS Audio Server.
33 # Use a raw surface abstraction.
36 # Copy conditionally-set variables out one scope.
37 'chromeos%': '<(chromeos)',
38 'use_aura%': '<(use_aura)',
39 'use_ash%': '<(use_ash)',
40 'use_cras%': '<(use_cras)',
41 'use_ozone%': '<(use_ozone)',
42 'use_ozone_evdev%': '<(use_ozone)',
44 # Whether we are using Views Toolkit
47 # Use OpenSSL instead of NSS. Under development: see http://crbug.com/62803
50 # Disable viewport meta tag by default.
51 'enable_viewport%': 0,
53 # Enable HiDPI support.
56 # Enable touch optimized art assets and metrics.
57 'enable_touch_ui%': 0,
59 # Override buildtype to select the desired build flavor.
60 # Dev - everyday build for development/testing
61 # Official - release build (generally implies additional processing)
62 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
63 # conversion is done), some of the things which are now controlled by
64 # 'branding', such as symbol generation, will need to be refactored
65 # based on 'buildtype' (i.e. we don't care about saving symbols for
66 # non-Official # builds).
69 # Override branding to select the desired branding flavor.
70 'branding%': 'Chromium',
73 # ChromeOS and Windows use Aura and Ash.
74 ['chromeos==1 or OS=="win"', {
79 # Whether we're a traditional desktop unix.
80 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
86 # Compute the architecture that we're building on.
87 ['OS=="win" or OS=="mac" or OS=="ios"', {
90 # This handles the Unix platforms for which there is some support.
91 # Anything else gets passed through, which probably won't work
92 # very well; such hosts should pass an explicit target_arch to
95 '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/")',
99 # Copy conditionally-set variables out one scope.
100 'chromeos%': '<(chromeos)',
101 'desktop_linux%': '<(desktop_linux)',
102 'use_aura%': '<(use_aura)',
103 'use_ash%': '<(use_ash)',
104 'use_cras%': '<(use_cras)',
105 'use_ozone%': '<(use_ozone)',
106 'use_ozone_evdev%': '<(use_ozone_evdev)',
107 'use_openssl%': '<(use_openssl)',
108 'enable_viewport%': '<(enable_viewport)',
109 'enable_hidpi%': '<(enable_hidpi)',
110 'enable_touch_ui%': '<(enable_touch_ui)',
111 'buildtype%': '<(buildtype)',
112 'branding%': '<(branding)',
113 'host_arch%': '<(host_arch)',
115 # Default architecture we're building for is the architecture we're
117 'target_arch%': '<(host_arch)',
119 # This is set when building the Android WebView inside the Android
120 # build system, using the 'android' gyp backend. The WebView code is
121 # still built when this is unset, but builds using the normal chromium
123 'android_webview_build%': 0,
125 # Sets whether chrome is built for google tv device.
128 # Set ARM architecture version.
137 # Set default value of toolkit_views based on OS.
138 ['OS=="win" or chromeos==1 or use_aura==1', {
144 # Set toolkit_uses_gtk for the Chromium browser on Linux.
145 ['desktop_linux==1 and use_aura==0 and use_ozone==0', {
146 'toolkit_uses_gtk%': 1,
148 'toolkit_uses_gtk%': 0,
151 # Enable HiDPI on Mac OS and Chrome OS.
152 ['OS=="mac" or chromeos==1', {
156 # Enable touch UI on Metro.
158 'enable_touch_ui%': 1,
161 # Enable App Launcher on ChromeOS, Windows and OSX.
162 # On Linux, enable App Launcher for the Aura build.
163 ['use_ash==1 or OS=="win" or OS=="mac" or (desktop_linux==1 and use_aura==1)', {
164 'enable_app_list%': 1,
166 'enable_app_list%': 0,
169 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
170 'use_default_render_theme%': 1,
172 'use_default_render_theme%': 0,
177 # Copy conditionally-set variables out one scope.
178 'chromeos%': '<(chromeos)',
179 'host_arch%': '<(host_arch)',
180 'target_arch%': '<(target_arch)',
181 'toolkit_views%': '<(toolkit_views)',
182 'toolkit_uses_gtk%': '<(toolkit_uses_gtk)',
183 'desktop_linux%': '<(desktop_linux)',
184 'use_aura%': '<(use_aura)',
185 'use_ash%': '<(use_ash)',
186 'use_cras%': '<(use_cras)',
187 'use_ozone%': '<(use_ozone)',
188 'use_ozone_evdev%': '<(use_ozone_evdev)',
189 'use_openssl%': '<(use_openssl)',
190 'enable_viewport%': '<(enable_viewport)',
191 'enable_hidpi%': '<(enable_hidpi)',
192 'enable_touch_ui%': '<(enable_touch_ui)',
193 'android_webview_build%': '<(android_webview_build)',
194 'google_tv%': '<(google_tv)',
195 'enable_app_list%': '<(enable_app_list)',
196 'use_default_render_theme%': '<(use_default_render_theme)',
197 'buildtype%': '<(buildtype)',
198 'branding%': '<(branding)',
199 'arm_version%': '<(arm_version)',
201 # Set to 1 to enable fast builds. Set to 2 for even faster builds
202 # (it disables debug info for fastest compilation - only for use
203 # on compile-only bots).
206 # Set to 1 to enable dcheck in release without having to use the flag.
207 'dcheck_always_on%': 0,
209 # Set to 1 to make a build that logs like an official build, but is not
210 # necessarily an official build, ie DCHECK and DLOG are disabled and
211 # removed completely in release builds, to minimize binary footprint.
212 # Note: this setting is ignored if buildtype=="Official".
213 'logging_like_official_build%': 0,
215 # Set to 1 to make a build that disables unshipped tracing events.
216 # Note: this setting is ignored if buildtype=="Official".
217 'tracing_like_official_build%': 0,
219 # Disable file manager component extension by default.
220 'file_manager_extension%': 0,
222 # Disable image loader component extension by default.
223 'image_loader_extension%': 0,
226 'python_ver%': '2.6',
228 # Set NEON compilation flags.
231 # Detect NEON support at run-time.
232 'arm_neon_optional%': 0,
234 # The system root for cross-compiles. Default: none.
237 # The system libdir used for this ABI.
238 'system_libdir%': 'lib',
240 # On Linux, we build with sse2 for Chromium builds.
243 # Use libjpeg-turbo as the JPEG codec used by Chromium.
244 'use_libjpeg_turbo%': 1,
246 # Use system libjpeg. Note that the system's libjepg will be used even if
247 # use_libjpeg_turbo is set.
248 'use_system_libjpeg%': 0,
250 # By default, component is set to static_library and it can be overriden
251 # by the GYP command line or by ~/.gyp/include.gypi.
252 'component%': 'static_library',
254 # Set to select the Title Case versions of strings in GRD files.
255 'use_titlecase_in_grd_files%': 0,
257 # Use translations provided by volunteers at launchpad.net. This
258 # currently only works on Linux.
259 'use_third_party_translations%': 0,
261 # Remoting compilation is enabled by default. Set to 0 to disable.
264 # Configuration policy is enabled by default. Set to 0 to disable.
265 'configuration_policy%': 1,
267 # Variable safe_browsing is used to control the build time configuration
268 # for safe browsing feature. Safe browsing can be compiled in 3 different
269 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
270 # reporting features without enabling phishing and malware detection. This
271 # is useful to integrate a third party phishing/malware detection to
272 # existing safe browsing logic.
275 # Speech input is compiled in by default. Set to 0 to disable.
278 # Notifications are compiled in by default. Set to 0 to disable.
279 'notifications%' : 1,
281 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
282 # regular builds and 1 for ASan builds.
283 'mac_want_real_dsym%': 'default',
285 # If this is set, the clang plugins used on the buildbot will be used.
286 # Run tools/clang/scripts/update.sh to make sure they are compiled.
287 # This causes 'clang_chrome_plugins_flags' to be set.
288 # Has no effect if 'clang' is not set as well.
289 'clang_use_chrome_plugins%': 1,
291 # Enable building with ASAN (Clang's -fsanitize=address option).
292 # -fsanitize=address only works with clang, but asan=1 implies clang=1
293 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
296 # Enable building with LSan (Clang's -fsanitize=leak option).
297 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
298 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
301 # Enable building with TSAN (Clang's -fsanitize=thread option).
302 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
303 # See http://clang.llvm.org/docs/ThreadSanitizer.html
305 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/valgrind/tsan_v2/ignores.txt',
307 # Enable building with MSAN (Clang's -fsanitize=memory option).
308 # MemorySanitizer only works with clang, but msan=1 implies clang=1
309 # See http://clang.llvm.org/docs/MemorySanitizer.html
312 # Use a modified version of Clang to intercept allocated types and sizes
313 # for allocated objects. clang_type_profiler=1 implies clang=1.
314 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
315 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
316 'clang_type_profiler%': 0,
318 # Set to true to instrument the code with function call logger.
319 # See src/third_party/cygprofile/cyg-profile.cc for details.
320 'order_profiling%': 0,
322 # Use the provided profiled order file to link Chrome image with it.
323 # This makes Chrome faster by better using CPU cache when executing code.
324 # This is known as PGO (profile guided optimization).
325 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
326 'order_text_section%' : "",
328 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
329 # libraries on linux x86-64 and arm, plus ASLR.
332 # Whether one-click signin is enabled or not.
333 'enable_one_click_signin%': 0,
335 # Enable Chrome browser extensions
336 'enable_extensions%': 1,
338 # Enable browser automation.
339 'enable_automation%': 1,
342 'enable_google_now%': 1,
344 # Enable printing support and UI. This variable is used to configure
345 # which parts of printing will be built. 0 disables printing completely,
346 # 1 enables it fully, and 2 enables only the codepath to generate a
347 # Metafile (e.g. usually a PDF or EMF) and disables print preview, cloud
349 'enable_printing%': 1,
351 # Set the version of CLD.
352 # 0: Don't specify the version. This option is for the Finch testing.
357 # Enable spell checker.
358 'enable_spellcheck%': 1,
360 # Webrtc compilation is enabled by default. Set to 0 to disable.
363 # Enables use of the session service, which is enabled by default.
364 # Support for disabling depends on the platform.
365 'enable_session_service%': 1,
367 # Enables theme support, which is enabled by default. Support for
368 # disabling depends on the platform.
371 # Enables autofill dialog and associated features; disabled by default.
372 'enable_autofill_dialog%' : 0,
374 # Enables support for background apps.
375 'enable_background%': 1,
377 # Enable the task manager by default.
378 'enable_task_manager%': 1,
380 # Enable FTP support by default.
381 'disable_ftp_support%': 0,
383 # XInput2 multitouch support is enabled by default (use_xi2_mt=2).
384 # Setting to zero value disables XI2 MT. When XI2 MT is enabled,
385 # the input value also defines the required XI2 minor minimum version.
386 # For example, use_xi2_mt=2 means XI2.2 or above version is required.
389 # Use of precompiled headers on Windows.
391 # This variable may be explicitly set to 1 (enabled) or 0
392 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
393 # This setting will override the default.
396 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
398 'chromium_win_pch%': 0,
400 # Set this to true when building with Clang.
401 # See http://code.google.com/p/chromium/wiki/Clang for details.
404 # Enable plug-in installation by default.
405 'enable_plugin_installation%': 1,
407 # Enable PPAPI and NPAPI by default.
408 # TODO(nileshagrawal): Make this flag enable/disable NPAPI as well
409 # as PPAPI; see crbug.com/162667.
410 'enable_plugins%': 1,
412 # Specifies whether to use canvas_skia.cc in place of platform
413 # specific implementations of gfx::Canvas. Affects text drawing in the
415 # TODO(asvitkine): Enable this on all platforms and delete this flag.
416 # http://crbug.com/105550
417 'use_canvas_skia%': 0,
419 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
420 # with one of those tools.
421 'build_for_tool%': '',
423 # If no directory is specified then a temporary directory will be used.
424 'test_isolation_outdir%': '',
425 # True if isolate should fail if the isolate files refer to files
427 'test_isolation_fail_on_missing': 0,
429 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
430 'wix_path%': '<(DEPTH)/third_party/wix',
432 # Managed users are enabled by default.
433 'enable_managed_users%': 1,
435 # Platform natively supports discardable memory.
436 'native_discardable_memory%': 0,
438 # Platform sends memory pressure signals natively.
439 'native_memory_pressure_signals%': 0,
441 'spdy_proxy_auth_origin%' : '',
442 'spdy_proxy_auth_property%' : '',
443 'spdy_proxy_auth_value%' : '',
444 'data_reduction_proxy_probe_url%' : '',
446 'enable_enhanced_bookmarks%': 0,
449 # A flag for POSIX platforms
456 # A flag for BSD platforms
457 ['OS=="freebsd" or OS=="openbsd"', {
463 # Set armv7 for backward compatibility.
471 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
477 # Flags to use X11 on non-Mac POSIX platforms.
478 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
484 # Flags to use pango and glib on non-Mac POSIX platforms.
485 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android"', {
493 # We always use skia text rendering in Aura on Windows, since GDI
494 # doesn't agree with our BackingStore.
495 # TODO(beng): remove once skia text rendering is on by default.
496 ['use_aura==1 and OS=="win"', {
497 'enable_skia_text%': 1,
500 # A flag to enable or disable our compile-time dependency
501 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
502 # support will be available. This option is useful
503 # for Linux distributions and for Aura.
504 ['chromeos==1 or use_aura==1', {
505 'use_gnome_keyring%': 0,
507 'use_gnome_keyring%': 1,
510 ['toolkit_uses_gtk==1 or OS=="mac" or OS=="ios"', {
511 # GTK+, Mac and iOS want Title Case strings
512 'use_titlecase_in_grd_files%': 1,
515 # Enable file manager and image loader extensions on Chrome OS.
517 'file_manager_extension%': 1,
518 'image_loader_extension%': 1,
520 'file_manager_extension%': 0,
521 'image_loader_extension%': 0,
524 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
525 'enable_one_click_signin%': 1,
529 'enable_automation%': 0,
530 'enable_extensions%': 0,
531 'enable_google_now%': 0,
533 'enable_spellcheck%': 0,
537 'arm_neon_optional%': 1,
538 'native_discardable_memory%': 1,
539 'native_memory_pressure_signals%': 1,
542 # Enable basic printing for Chrome for Android but disable printing
543 # completely for WebView.
544 ['OS=="android" and android_webview_build==0', {
545 'enable_printing%': 2,
547 ['OS=="android" and android_webview_build==1', {
548 'enable_printing%': 0,
551 # Android OS includes support for proprietary codecs regardless of
552 # building Chromium or Google Chrome. We also ship Google Chrome with
553 # proprietary codecs.
554 ['OS=="android" or branding=="Chrome"', {
555 'proprietary_codecs%': 1,
557 'proprietary_codecs%': 0,
560 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
561 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
562 'enable_autofill_dialog%': 1
565 ['OS=="android" and android_webview_build==0', {
569 # Disable WebRTC for building WebView as part of Android system.
570 # TODO(boliu): Decide if we want WebRTC, and if so, also merge
571 # the necessary third_party repositories.
572 ['OS=="android" and android_webview_build==1', {
577 'configuration_policy%': 0,
578 'disable_ftp_support%': 1,
579 'enable_automation%': 0,
580 'enable_extensions%': 0,
581 'enable_google_now%': 0,
583 'enable_printing%': 0,
584 'enable_session_service%': 0,
590 'enable_managed_users%': 0,
593 # Use GPU accelerated cross process image transport by default
594 # on linux builds with the Aura window manager
595 ['use_aura==1 and OS=="linux"', {
596 'ui_compositor_image_transport%': 1,
598 'ui_compositor_image_transport%': 0,
601 # Turn precompiled headers on by default.
602 ['OS=="win" and buildtype!="Official"', {
603 'chromium_win_pch%': 1
606 ['chromeos==1 or OS=="android" or OS=="ios"', {
607 'enable_plugin_installation%': 0,
609 'enable_plugin_installation%': 1,
612 ['(OS=="android" and google_tv!=1) or OS=="ios"', {
613 'enable_plugins%': 0,
615 'enable_plugins%': 1,
618 # linux_use_gold_binary: whether to use the binary checked into
619 # third_party/gold. Gold is not used for 32-bit linux builds
620 # as it runs out of address space.
621 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
622 'linux_use_gold_binary%': 1,
624 'linux_use_gold_binary%': 0,
627 # linux_use_gold_flags: whether to use build flags that rely on gold.
628 # On by default for x64 Linux. Temporarily off for ChromeOS as
629 # it failed on a buildbot.
630 ['OS=="linux" and target_arch=="x64" and chromeos==0', {
631 'linux_use_gold_flags%': 1,
633 'linux_use_gold_flags%': 0,
636 ['OS=="android" or OS=="ios"', {
637 'enable_captive_portal_detection%': 0,
639 'enable_captive_portal_detection%': 1,
642 # Enable Skia UI text drawing incrementally on different platforms.
643 # http://crbug.com/105550
645 # On Aura, this allows per-tile painting to be used in the browser
648 'use_canvas_skia%': 1,
652 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
653 'use_libjpeg_turbo%': 0,
657 # When building as part of the Android system, use system libraries
658 # where possible to reduce ROM size.
659 'use_system_libjpeg%': '<(android_webview_build)',
662 # Do not enable the Settings App on ChromeOS.
663 ['enable_app_list==1 and chromeos==0', {
664 'enable_settings_app%': 1,
666 'enable_settings_app%': 0,
669 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
670 # Set some defaults for arm/linux chrome builds
671 'linux_use_tcmalloc%': 0,
672 # sysroot needs to be an absolute path otherwise it generates
673 # incorrect results when passed to pkg-config
674 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot',
675 }], # OS=="linux" and target_arch=="arm" and chromeos==0
677 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
679 ['target_arch=="x64"', {
680 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
682 ['target_arch=="ia32"', {
683 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
686 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
688 ['OS=="linux" and target_arch=="mipsel"', {
689 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
690 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
693 # Whether tests targets should be run, archived or just have the
694 # dependencies verified. All the tests targets have the '_run' suffix,
695 # e.g. base_unittests_run runs the target base_unittests. The test
696 # target always calls tools/swarm_client/isolate.py. See the script's
697 # --help for more information and the valid --mode values. Meant to be
698 # overriden with GYP_DEFINES.
699 # TODO(maruel): Remove the conditions as more configurations are
701 # TODO(csharp): Remove OS!="mac" once xcode can run the isolate code
703 # NOTE: The check for disable_nacl==0 and component=="static_library"
704 # can't be used here because these variables are not defined yet, but it
705 # is still not supported.
706 ['OS!="mac" and OS!="ios" and OS!="android" and chromeos==0', {
707 'test_isolation_mode%': 'check',
709 'test_isolation_mode%': 'noop',
711 # Whether Android ARM build uses OpenMAX DL FFT.
712 ['OS=="android" and target_arch=="arm" and android_webview_build==0', {
713 # Currently only supported on Android ARM, without webview.
714 # When enabled, this will also enable WebAudio on Android
715 # ARM. Default is enabled.
716 'use_openmax_dl_fft%': 1,
718 'use_openmax_dl_fft%': 0,
720 ['OS=="win" or OS=="linux"', {
724 # Turns on compiler optimizations in V8 in Debug build, except
725 # on android_clang, where we're hitting a weird linker error.
726 # TODO(dpranke): http://crbug.com/266155 .
728 'v8_optimized_debug%': 1,
730 'v8_optimized_debug%': 2,
734 # Set this to 1 to enable use of concatenated impulse responses
735 # for the HRTF panner in WebAudio.
736 'use_concatenated_impulse_responses': 1,
738 # You can set the variable 'use_official_google_api_keys' to 1
739 # to use the Google-internal file containing official API keys
740 # for Google Chrome even in a developer build. Setting this
741 # variable explicitly to 1 will cause your build to fail if the
742 # internal file is missing.
744 # The variable is documented here, but not handled in this file;
745 # see //google_apis/determine_use_official_keys.gypi for the
748 # Set the variable to 0 to not use the internal file, even when
749 # it exists in your checkout.
751 # Leave it unset in your include.gypi to have the variable
752 # implicitly set to 1 if you have
753 # src/google_apis/internal/google_chrome_api_keys.h in your
754 # checkout, and implicitly set to 0 if not.
756 # Note that official builds always behave as if the variable
757 # was explicitly set to 1, i.e. they always use official keys,
758 # and will fail to build if the internal file is missing.
760 # NOTE: You MUST NOT explicitly set the variable to 2 in your
761 # include.gypi or by other means. Due to subtleties of GYP, this
762 # is not the same as leaving the variable unset, even though its
764 # //google_apis/determine_use_official_keys.gypi is 2.
766 # Set these to bake the specified API keys and OAuth client
767 # IDs/secrets into your build.
769 # If you create a build without values baked in, you can instead
770 # set environment variables to provide the keys at runtime (see
771 # src/google_apis/google_api_keys.h for details). Features that
772 # require server-side APIs may fail to work if no keys are
775 # Note that if you are building an official build or if
776 # use_official_google_api_keys has been set to 1 (explicitly or
777 # implicitly), these values will be ignored and the official
778 # keys will be used instead.
779 'google_api_key%': '',
780 'google_default_client_id%': '',
781 'google_default_client_secret%': '',
784 # Copy conditionally-set variables out one scope.
785 'branding%': '<(branding)',
786 'buildtype%': '<(buildtype)',
787 'target_arch%': '<(target_arch)',
788 'host_arch%': '<(host_arch)',
789 'toolkit_views%': '<(toolkit_views)',
790 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
791 'use_aura%': '<(use_aura)',
792 'use_ash%': '<(use_ash)',
793 'use_cras%': '<(use_cras)',
794 'use_openssl%': '<(use_openssl)',
795 'use_nss%': '<(use_nss)',
796 'os_bsd%': '<(os_bsd)',
797 'os_posix%': '<(os_posix)',
798 'use_glib%': '<(use_glib)',
799 'use_pango%': '<(use_pango)',
800 'use_ozone%': '<(use_ozone)',
801 'use_ozone_evdev%': '<(use_ozone_evdev)',
802 'toolkit_uses_gtk%': '<(toolkit_uses_gtk)',
803 'desktop_linux%': '<(desktop_linux)',
804 'use_x11%': '<(use_x11)',
805 'use_gnome_keyring%': '<(use_gnome_keyring)',
806 'linux_fpic%': '<(linux_fpic)',
807 'chromeos%': '<(chromeos)',
808 'enable_viewport%': '<(enable_viewport)',
809 'enable_hidpi%': '<(enable_hidpi)',
810 'enable_touch_ui%': '<(enable_touch_ui)',
811 'use_xi2_mt%':'<(use_xi2_mt)',
812 'file_manager_extension%': '<(file_manager_extension)',
813 'image_loader_extension%': '<(image_loader_extension)',
814 'fastbuild%': '<(fastbuild)',
815 'dcheck_always_on%': '<(dcheck_always_on)',
816 'logging_like_official_build%': '<(logging_like_official_build)',
817 'tracing_like_official_build%': '<(tracing_like_official_build)',
818 'python_ver%': '<(python_ver)',
819 'arm_version%': '<(arm_version)',
820 'armv7%': '<(armv7)',
821 'arm_neon%': '<(arm_neon)',
822 'arm_neon_optional%': '<(arm_neon_optional)',
823 'sysroot%': '<(sysroot)',
824 'system_libdir%': '<(system_libdir)',
825 'component%': '<(component)',
826 'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
827 'use_third_party_translations%': '<(use_third_party_translations)',
828 'remoting%': '<(remoting)',
829 'enable_one_click_signin%': '<(enable_one_click_signin)',
830 'enable_webrtc%': '<(enable_webrtc)',
831 'chromium_win_pch%': '<(chromium_win_pch)',
832 'configuration_policy%': '<(configuration_policy)',
833 'safe_browsing%': '<(safe_browsing)',
834 'input_speech%': '<(input_speech)',
835 'notifications%': '<(notifications)',
836 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
837 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
842 'tsan_blacklist%': '<(tsan_blacklist)',
843 'clang_type_profiler%': '<(clang_type_profiler)',
844 'order_profiling%': '<(order_profiling)',
845 'order_text_section%': '<(order_text_section)',
846 'enable_extensions%': '<(enable_extensions)',
847 'enable_plugin_installation%': '<(enable_plugin_installation)',
848 'enable_plugins%': '<(enable_plugins)',
849 'enable_session_service%': '<(enable_session_service)',
850 'enable_themes%': '<(enable_themes)',
851 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
852 'enable_background%': '<(enable_background)',
853 'linux_use_gold_binary%': '<(linux_use_gold_binary)',
854 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
855 'use_canvas_skia%': '<(use_canvas_skia)',
856 'test_isolation_mode%': '<(test_isolation_mode)',
857 'test_isolation_outdir%': '<(test_isolation_outdir)',
858 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
859 'enable_automation%': '<(enable_automation)',
860 'enable_printing%': '<(enable_printing)',
861 'enable_spellcheck%': '<(enable_spellcheck)',
862 'enable_google_now%': '<(enable_google_now)',
863 'cld_version%': '<(cld_version)',
864 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
865 'disable_ftp_support%': '<(disable_ftp_support)',
866 'enable_task_manager%': '<(enable_task_manager)',
867 'sas_dll_path%': '<(sas_dll_path)',
868 'wix_path%': '<(wix_path)',
869 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
870 'use_system_libjpeg%': '<(use_system_libjpeg)',
871 'android_webview_build%': '<(android_webview_build)',
872 'gyp_managed_install%': 0,
873 'create_standalone_apk%': 1,
874 'google_tv%': '<(google_tv)',
875 'enable_app_list%': '<(enable_app_list)',
876 'use_default_render_theme%': '<(use_default_render_theme)',
877 'enable_settings_app%': '<(enable_settings_app)',
878 'google_api_key%': '<(google_api_key)',
879 'google_default_client_id%': '<(google_default_client_id)',
880 'google_default_client_secret%': '<(google_default_client_secret)',
881 'enable_managed_users%': '<(enable_managed_users)',
882 'native_discardable_memory%': '<(native_discardable_memory)',
883 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
884 'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)',
885 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
886 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
887 'data_reduction_proxy_probe_url%': '<(data_reduction_proxy_probe_url)',
888 'enable_mdns%' : '<(enable_mdns)',
889 'enable_enhanced_bookmarks%' : '<(enable_enhanced_bookmarks)',
890 'v8_optimized_debug%': '<(v8_optimized_debug)',
891 'proprietary_codecs%': '<(proprietary_codecs)',
893 # Use system nspr instead of the bundled one.
894 'use_system_nspr%': 0,
896 # Use system protobuf instead of bundled one.
897 'use_system_protobuf%': 0,
899 # Use system yasm instead of bundled one.
900 'use_system_yasm%': 0,
902 # Use system ICU instead of bundled one.
903 'use_system_icu%' : 0,
905 # Default to enabled PIE; this is important for ASLR but we may need to be
906 # able to turn it off for various reasons.
907 'linux_disable_pie%': 0,
909 # The release channel that this build targets. This is used to restrict
910 # channel-specific build options, like which installer packages to create.
911 # The default is 'all', which does no channel-specific filtering.
914 # Override chromium_mac_pch and set it to 0 to suppress the use of
915 # precompiled headers on the Mac. Prefix header injection may still be
916 # used, but prefix headers will not be precompiled. This is useful when
917 # using distcc to distribute a build to compile slaves that don't
918 # share the same compiler executable as the system driving the compilation,
919 # because precompiled headers rely on pointers into a specific compiler
920 # executable's image. Setting this to 0 is needed to use an experimental
921 # Linux-Mac cross compiler distcc farm.
922 'chromium_mac_pch%': 1,
924 # The default value for mac_strip in target_defaults. This cannot be
925 # set there, per the comment about variable% in a target_defaults.
926 'mac_strip_release%': 1,
928 # Set to 1 to enable code coverage. In addition to build changes
929 # (e.g. extra CFLAGS), also creates a new target in the src/chrome
930 # project file called "coverage".
931 # Currently ignored on Windows.
934 # Set to 1 to enable java code coverage. Instruments classes during build
935 # to produce .ec files during runtime.
938 # EMMA filter string consisting of a list of inclusion/exclusion patterns
939 # separated with whitespace and/or comma. Only has effect if
943 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
944 # This is useful for parallel compilation tools which can't support /Zi.
945 # Only used on Windows.
948 # Although base/allocator lets you select a heap library via an
949 # environment variable, the libcmt shim it uses sometimes gets in
950 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
951 # 'win_use_allocator_shim': 0,
952 # 'win_release_RuntimeLibrary': 2
953 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
954 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
956 # TODO(bradnelson): eliminate this when possible.
957 # To allow local gyp files to prevent release.vsprops from being included.
958 # Yes(1) means include release.vsprops.
959 # Once all vsprops settings are migrated into gyp, this can go away.
960 'msvs_use_common_release%': 1,
962 # TODO(bradnelson): eliminate this when possible.
963 # To allow local gyp files to override additional linker options for msvs.
964 # Yes(1) means set use the common linker options.
965 'msvs_use_common_linker_extras%': 1,
967 # TODO(sgk): eliminate this if possible.
968 # It would be nicer to support this via a setting in 'target_defaults'
969 # in chrome/app/locales/locales.gypi overriding the setting in the
970 # 'Debug' configuration in the 'target_defaults' dict below,
971 # but that doesn't work as we'd like.
972 'msvs_debug_link_incremental%': '2',
974 # Needed for some of the largest modules.
975 'msvs_debug_link_nonincremental%': '1',
977 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
978 # to get incremental linking to be faster in debug builds.
979 'incremental_chrome_dll%': '0',
981 # Experimental setting to break chrome.dll into multiple pieces based on
983 'chrome_multiple_dll%': '0',
985 # The default settings for third party code for treating
986 # warnings-as-errors. Ideally, this would not be required, however there
987 # is some third party code that takes a long time to fix/roll. So, this
988 # flag allows us to have warnings as errors in general to prevent
989 # regressions in most modules, while working on the bits that are
991 'win_third_party_warn_as_error%': 'true',
994 'clang%': '<(clang)',
995 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
997 # These two variables can be set in GYP_DEFINES while running
998 # |gclient runhooks| to let clang run a plugin in every compilation.
999 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1001 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1004 'clang_add_plugin%': '',
1006 # The default type of gtest.
1007 'gtest_target_type%': 'executable',
1009 # Enable sampling based profiler.
1010 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1012 # Profile without optimizing out stack frames when profiling==1.
1013 'profiling_full_stack_frames%': '0',
1015 # Enable strict glibc debug mode.
1016 'glibcxx_debug%': 0,
1017 # And if we want to dump symbols for Breakpad-enabled builds.
1018 'linux_dump_symbols%': 0,
1019 # And if we want to strip the binary after dumping symbols.
1020 'linux_strip_binary%': 0,
1021 # Strip the test binaries needed for Linux reliability tests.
1022 'linux_strip_reliability_tests%': 0,
1025 'linux_use_tcmalloc%': 1,
1026 'android_use_tcmalloc%': 0,
1028 # Disable TCMalloc's heapchecker.
1029 'linux_use_heapchecker%': 0,
1031 # Disable shadow stack keeping used by heapcheck to unwind the stacks
1033 'linux_keep_shadow_stacks%': 0,
1035 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1036 'linux_link_gnome_keyring%': 0,
1037 # Set to 1 to link against gsettings APIs instead of using dlopen().
1038 'linux_link_gsettings%': 0,
1040 # Default arch variant for MIPS.
1041 'mips_arch_variant%': 'mips32r2',
1043 # Enable use of OpenMAX DL FFT routines.
1044 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1046 # Enable new NPDevice API.
1047 'enable_new_npdevice_api%': 0,
1049 # Enable EGLImage support in OpenMAX
1050 'enable_eglimage%': 1,
1052 # .gyp files or targets should set chromium_code to 1 if they build
1053 # Chromium-specific code, as opposed to external code. This variable is
1054 # used to control such things as the set of warnings to enable, and
1055 # whether warnings are treated as errors.
1056 'chromium_code%': 0,
1058 'release_valgrind_build%': 0,
1060 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1061 'enable_wexit_time_destructors%': 0,
1063 # Set to 1 to compile with the built in pdf viewer.
1066 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1067 'internal_gles2_conform_tests%': 0,
1069 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1070 # so Cocoa is happy (http://crbug.com/20441).
1072 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1073 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1074 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1075 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1076 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1077 'vi', 'zh-CN', 'zh-TW',
1080 # Pseudo locales are special locales which are used for testing and
1081 # debugging. They don't get copied to the final app. For more info,
1082 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1089 # If debug_devtools is set to 1, JavaScript files for DevTools are
1090 # stored as is and loaded from disk. Otherwise, a concatenated file
1091 # is stored in resources.pak. It is still possible to load JS files
1092 # from disk by passing --debug-devtools cmdline switch.
1093 'debug_devtools%': 0,
1095 # The Java Bridge is not compiled in by default.
1098 # Code signing for iOS binaries. The bots need to be able to disable this.
1099 'chromium_ios_signing%': 1,
1101 # This flag is only used when disable_nacl==0 and disables all those
1102 # subcomponents which would require the installation of a native_client
1103 # untrusted toolchain.
1104 'disable_nacl_untrusted%': 0,
1106 # Disable Dart by default.
1109 # The desired version of Windows SDK can be set in ~/.gyp/include.gypi.
1110 'msbuild_toolset%': '',
1112 # Native Client is enabled by default.
1115 # Portable Native Client is enabled by default.
1116 'disable_pnacl%': 0,
1118 # Whether to build full debug version for Debug configuration on Android.
1119 # Compared to full debug version, the default Debug configuration on Android
1120 # has no full v8 debug, has size optimization and linker gc section, so that
1121 # we can build a debug version with acceptable size and performance.
1122 'android_full_debug%': 0,
1124 # Sets the default version name and code for Android app, by default we
1125 # do a developer build.
1126 'android_app_version_name%': 'Developer Build',
1127 'android_app_version_code%': 0,
1129 # Contains data about the attached devices for gyp_managed_install.
1130 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1132 'sas_dll_exists': '<!(python <(DEPTH)/build/dir_exists.py "<(sas_dll_path)")',
1133 'wix_exists': '<!(python <(DEPTH)/build/dir_exists.py "<(wix_path)")',
1135 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1136 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1138 # Whether we are using the rlz library or not. Platforms like Android send
1139 # rlz codes for searches but do not use the library.
1142 # Turns on the i18n support in V8.
1143 'v8_enable_i18n_support': 1,
1145 # Use the chromium skia by default.
1146 'use_system_skia%': '0',
1148 # Use brlapi from brltty for braille display support.
1151 # Relative path to icu.gyp from this file.
1152 'icu_gyp_path': '../third_party/icu/icu.gyp',
1155 # The version of GCC in use, set later in platforms that use GCC and have
1156 # not explicitly chosen to build with clang. Currently, this means all
1157 # platforms except Windows, Mac and iOS.
1158 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1159 # it takes effect here.
1160 ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0', {
1161 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
1165 ['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(windows_sdk_default_path))"=="True"', {
1166 'windows_sdk_path%': '<(windows_sdk_default_path)',
1168 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
1170 ['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(directx_sdk_default_path))"=="True"', {
1171 'directx_sdk_path%': '<(directx_sdk_default_path)',
1173 'directx_sdk_path%': '$(DXSDK_DIR)',
1176 'windows_driver_kit_path%': '$(WDK_DIR)',
1177 # Set the python arch to prevent conflicts with pyauto on Win64 build.
1178 # TODO(jschuh): crbug.com/177664 Investigate Win64 pyauto build.
1179 'python_arch%': 'ia32',
1181 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1182 # Figure out the python architecture to decide if we build pyauto.
1183 'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/<(system_libdir)/libpython<(python_ver).so.1.0)',
1185 ['target_arch=="mipsel"', {
1188 'nacl_untrusted_build%': 0,
1189 'linux_use_tcmalloc%': 0,
1191 ['OS=="linux" and target_arch=="mipsel"', {
1192 'sysroot%': '<(sysroot)',
1195 # All Chrome builds have breakpad symbols, but only process the
1196 # symbols from official builds.
1197 ['(branding=="Chrome" and buildtype=="Official")', {
1198 'linux_dump_symbols%': 1,
1201 }], # os_posix==1 and OS!="mac" and OS!="ios"
1204 'enable_background%': 0,
1205 'enable_task_manager%': 0,
1206 'icu_use_data_file_flag%': 1,
1207 'use_system_libxml%': 1,
1208 'use_system_sqlite%': 1,
1210 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1211 'fi', 'fr', 'he', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms', 'nb',
1212 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr', 'uk',
1213 'vi', 'zh-CN', 'zh-TW',
1216 # The Mac SDK is set for iOS builds and passed through to Mac
1217 # sub-builds. This allows the Mac sub-build SDK in an iOS build to be
1218 # overridden from the command line the same way it is for a Mac build.
1219 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py 10.6)',
1221 # iOS SDK and deployment target support. The |ios_sdk| value is left
1222 # blank so that when it is set in the project files it will be the
1223 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1224 # causes Xcode to spit out a warning for every single project file for
1225 # not using the "current" SDK.
1227 'ios_sdk_path%': '',
1228 'ios_deployment_target%': '6.0',
1231 # ios_product_name is set to the name of the .app bundle as it should
1233 ['branding=="Chrome"', {
1234 'ios_product_name%': 'Chrome',
1235 }, { # else: branding!="Chrome"
1236 'ios_product_name%': 'Chromium',
1238 ['branding=="Chrome" and buildtype=="Official"', {
1240 }, { # else: branding!="Chrome" or buildtype!="Official"
1246 # Location of Android NDK.
1249 # Unfortuantely we have to use absolute paths to the SDK/NDK beause
1250 # they're passed to ant which uses a different relative path from
1252 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1253 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1254 'android_host_arch%': '<!(uname -m)',
1255 # Android API-level of the SDK used for compilation.
1256 'android_sdk_version%': '<!(/bin/echo -n ${ANDROID_SDK_VERSION})',
1257 # Android SDK build tools (e.g. dx, aapt, aidl)
1258 'android_sdk_tools%': '<!(/bin/echo -n ${ANDROID_SDK_TOOLS})',
1260 # Copy conditionally-set variables out one scope.
1261 'android_ndk_root%': '<(android_ndk_root)',
1262 'android_sdk_root%': '<(android_sdk_root)',
1263 'android_sdk_version%': '<(android_sdk_version)',
1264 'android_sdk_tools%': '<(android_sdk_tools)',
1265 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1267 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1269 # Android API level 14 is ICS (Android 4.0) which is the minimum
1270 # platform requirement for Chrome on Android, we use it for native
1273 ['target_arch == "ia32"', {
1274 'android_app_abi%': 'x86',
1275 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1276 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1277 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.6/prebuilt/<(host_os)-<(android_host_arch)/bin',
1279 ['target_arch=="arm"', {
1282 'android_app_abi%': 'armeabi',
1284 'android_app_abi%': 'armeabi-v7a',
1287 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1288 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1289 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.6/prebuilt/<(host_os)-<(android_host_arch)/bin',
1291 ['target_arch == "mipsel"', {
1292 'android_app_abi%': 'mips',
1293 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1294 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1295 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.6/prebuilt/<(host_os)-<(android_host_arch)/bin',
1299 # Copy conditionally-set variables out one scope.
1300 'android_app_abi%': '<(android_app_abi)',
1301 'android_gdbserver%': '<(android_gdbserver)',
1302 'android_ndk_root%': '<(android_ndk_root)',
1303 'android_ndk_sysroot': '<(android_ndk_sysroot)',
1304 'android_sdk_root%': '<(android_sdk_root)',
1305 'android_sdk_version%': '<(android_sdk_version)',
1306 'android_toolchain%': '<(android_toolchain)',
1308 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1309 'android_ndk_lib': '<(android_ndk_sysroot)/usr/lib',
1310 'android_sdk_tools%': '<(android_sdk_tools)',
1311 'android_sdk%': '<(android_sdk)',
1312 'android_sdk_jar%': '<(android_sdk)/android.jar',
1314 'android_stlport_root': '<(android_stlport_root)',
1315 'android_stlport_include': '<(android_stlport_root)/stlport',
1316 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1318 # Location of the "strip" binary, used by both gyp and scripts.
1319 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1321 # Location of the "readelf" binary.
1322 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1324 # Provides an absolute path to PRODUCT_DIR (e.g. out/Release). Used
1325 # to specify the output directory for Ant in the Android build.
1326 'ant_build_out': '`cd <(PRODUCT_DIR) && pwd -P`',
1328 # Determines whether we should optimize JNI generation at the cost of
1329 # breaking assumptions in the build system that when inputs have changed
1330 # the outputs should always change as well. This is meant purely for
1331 # developer builds, to avoid spurious re-linking of native files.
1332 'optimize_jni_generation%': 0,
1334 # Always uses openssl.
1337 'proprietary_codecs%': '<(proprietary_codecs)',
1338 'enable_task_manager%': 0,
1339 'safe_browsing%': 2,
1341 'enable_automation%': 0,
1343 'build_ffmpegsumo%': 0,
1344 'linux_use_tcmalloc%': 0,
1346 # Disable Native Client.
1349 # Android does not support background apps.
1350 'enable_background%': 0,
1352 # Sessions are store separately in the Java side.
1353 'enable_session_service%': 0,
1355 # Set to 1 once we have a notification system for Android.
1356 # http://crbug.com/115320
1357 'notifications%': 0,
1361 'gtest_target_type%': 'shared_library',
1363 # Uses system APIs for decoding audio and video.
1364 'use_libffmpeg%': '0',
1366 # When building as part of the Android system, use system libraries
1367 # where possible to reduce ROM size.
1368 # TODO(steveblock): Investigate using the system version of sqlite.
1369 'use_system_sqlite%': 0, # '<(android_webview_build)',
1370 'use_system_expat%': '<(android_webview_build)',
1371 'use_system_icu%': '<(android_webview_build)',
1372 'use_system_stlport%': '<(android_webview_build)',
1374 'enable_managed_users%': 0,
1376 # Copy it out one scope.
1377 'android_webview_build%': '<(android_webview_build)',
1379 ['android_webview_build==1', {
1380 # When building the WebView in the Android tree, jarjar will remap all
1381 # the class names, so the JNI generator needs to know this.
1382 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1385 # Enable clang on mac by default!
1388 ['OS=="mac" or OS=="ios"', {
1390 # Mac OS X SDK and deployment target support. The SDK identifies
1391 # the version of the system headers that will be used, and
1392 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1393 # macro. "Maximum allowed" refers to the operating system version
1394 # whose APIs are available in the headers. The deployment target
1395 # identifies the minimum system version that the built products are
1396 # expected to function on. It corresponds to the
1397 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1398 # macros are available, #include <AvailabilityMacros.h>. Additional
1399 # documentation on these macros is available at
1400 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1401 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1402 # deployment target to 10.6. Other projects, such as O3D, may
1403 # override these defaults.
1405 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1406 # about that is at least the specified version. In official builds,
1407 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1408 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1409 # path to the SDK; when set to a non-empty string, SDK detection
1410 # based on mac_sdk_min will be bypassed entirely.
1411 'mac_sdk_min%': '10.6',
1412 'mac_sdk_path%': '',
1414 'mac_deployment_target%': '10.6',
1417 'mac_sdk_min': '<(mac_sdk_min)',
1418 'mac_sdk_path': '<(mac_sdk_path)',
1419 'mac_deployment_target': '<(mac_deployment_target)',
1421 # Compile in Breakpad support by default so that it can be
1422 # tested, even if it is not enabled by default at runtime.
1423 'mac_breakpad_compiled_in%': 1,
1425 # mac_product_name is set to the name of the .app bundle as it should
1426 # appear on disk. This duplicates data from
1427 # chrome/app/theme/chromium/BRANDING and
1428 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1429 # these names into the build system.
1430 ['branding=="Chrome"', {
1431 'mac_product_name%': 'Google Chrome',
1432 }, { # else: branding!="Chrome"
1433 'mac_product_name%': 'Chromium',
1436 ['branding=="Chrome" and buildtype=="Official"', {
1437 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1438 # Enable uploading crash dumps.
1439 'mac_breakpad_uploads%': 1,
1440 # Enable dumping symbols at build time for use by Mac Breakpad.
1442 # Enable Keystone auto-update support.
1444 }, { # else: branding!="Chrome" or buildtype!="Official"
1445 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1446 'mac_breakpad_uploads%': 0,
1451 }], # OS=="mac" or OS=="ios"
1454 # This is the architecture convention used in WinSDK paths.
1455 ['target_arch=="ia32"', {
1456 'winsdk_arch%': 'x86',
1458 'winsdk_arch%': '<(target_arch)',
1460 ['component=="shared_library"', {
1461 'win_use_allocator_shim%': 0,
1463 # Turn on multiple dll by default on Windows when in static_library.
1464 'chrome_multiple_dll%': 1,
1466 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1467 # Only enabled by default for ninja because it's buggy in VS.
1468 # Not enabled for component=static_library because some targets
1469 # are too large and the toolchain fails due to the size of the
1471 'incremental_chrome_dll%': 1,
1473 # Don't do incremental linking for large modules on 32-bit.
1474 ['MSVS_OS_BITS==32', {
1475 'msvs_large_module_debug_link_mode%': '1', # No
1477 'msvs_large_module_debug_link_mode%': '2', # Yes
1479 ['MSVS_VERSION=="2012e" or MSVS_VERSION=="2010e"', {
1487 'nacl_win64_defines': [
1488 # This flag is used to minimize dependencies when building
1489 # Native Client loader for 64-bit Windows.
1494 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios"', {
1500 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win" or google_tv==1)', {
1501 'enable_pepper_cdms%': 1,
1503 'enable_pepper_cdms%': 0,
1506 # Native Client glibc toolchain is enabled
1507 # by default except on arm and mips.
1508 ['target_arch=="arm" or target_arch=="mipsel"', {
1509 'disable_glibc%': 1,
1511 'disable_glibc%': 0,
1514 # Disable SSE2 when building for ARM or MIPS.
1515 ['target_arch=="arm" or target_arch=="mipsel"', {
1518 'disable_sse2%': '<(disable_sse2)',
1521 # Set the relative path from this file to the GYP file of the JPEG
1522 # library used by Chromium.
1523 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1524 # Configuration for using the system libjeg is here.
1525 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1527 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1530 # Options controlling the use of GConf (the classic GNOME configuration
1531 # system) and GIO, which contains GSettings (the new GNOME config system).
1540 # Set up -D and -E flags passed into grit.
1541 ['branding=="Chrome"', {
1542 # TODO(mmoss) The .grd files look for _google_chrome, but for
1543 # consistency they should look for google_chrome_build like C++.
1544 'grit_defines': ['-D', '_google_chrome',
1545 '-E', 'CHROMIUM_BUILD=google_chrome'],
1547 'grit_defines': ['-D', '_chromium',
1548 '-E', 'CHROMIUM_BUILD=chromium'],
1551 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
1553 ['desktop_linux==1', {
1554 'grit_defines': ['-D', 'desktop_linux'],
1556 ['toolkit_views==1', {
1557 'grit_defines': ['-D', 'toolkit_views'],
1560 'grit_defines': ['-D', 'use_aura'],
1563 'grit_defines': ['-D', 'use_ash'],
1566 'grit_defines': ['-D', 'use_nss'],
1569 'grit_defines': ['-D', 'use_ozone'],
1571 ['file_manager_extension==1', {
1572 'grit_defines': ['-D', 'file_manager_extension'],
1574 ['image_loader_extension==1', {
1575 'grit_defines': ['-D', 'image_loader_extension'],
1578 'grit_defines': ['-D', 'remoting'],
1580 ['use_titlecase_in_grd_files==1', {
1581 'grit_defines': ['-D', 'use_titlecase'],
1583 ['use_third_party_translations==1', {
1584 'grit_defines': ['-D', 'use_third_party_translations'],
1586 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
1587 'ka', 'ku', 'kw', 'ms', 'ug'
1591 'grit_defines': ['-t', 'android',
1592 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true'],
1595 'grit_defines': ['-D', 'google_tv'],
1599 ['OS=="mac" or OS=="ios"', {
1600 'grit_defines': ['-D', 'scale_factors=2x'],
1605 # iOS uses a whitelist to filter resources.
1606 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
1609 # Enable clang and host builds when generating with ninja-ios.
1611 ['"<(GENERATOR)"=="ninja"', {
1617 ['enable_extensions==1', {
1618 'grit_defines': ['-D', 'enable_extensions'],
1620 ['enable_printing!=0', {
1621 'grit_defines': ['-D', 'enable_printing'],
1623 ['enable_themes==1', {
1624 'grit_defines': ['-D', 'enable_themes'],
1626 ['enable_app_list==1', {
1627 'grit_defines': ['-D', 'enable_app_list'],
1629 ['enable_settings_app==1', {
1630 'grit_defines': ['-D', 'enable_settings_app'],
1632 ['enable_google_now==1', {
1633 'grit_defines': ['-D', 'enable_google_now'],
1635 ['use_concatenated_impulse_responses==1', {
1636 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
1638 ['enable_webrtc==1', {
1639 'grit_defines': ['-D', 'enable_webrtc'],
1641 ['enable_mdns==1', {
1642 'grit_defines': ['-D', 'enable_mdns'],
1644 ['enable_enhanced_bookmarks==1', {
1645 'grit_defines': ['-D', 'enable_enhanced_bookmarks'],
1647 ['clang_use_chrome_plugins==1 and OS!="win"', {
1648 'clang_chrome_plugins_flags': [
1649 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
1653 ['asan==1 and OS!="win"', {
1656 ['asan==1 and OS=="mac"', {
1657 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
1658 # runtime is fully adopted. See http://crbug.com/242503.
1659 'mac_strip_release': 0,
1671 ['OS=="linux" and clang_type_profiler==1', {
1673 'clang_use_chrome_plugins%': 0,
1675 ['host_arch=="x64"', {
1676 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
1678 ['host_arch=="ia32"', {
1679 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
1680 # Clang in this directory at your own risk if needed for some
1681 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
1682 # usage). Any failure by this compiler should not close the tree.
1683 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
1688 # On valgrind bots, override the optimizer settings so we don't inline too
1689 # much and make the stacks harder to figure out.
1691 # TODO(rnk): Kill off variables that no one else uses and just implement
1692 # them under a build_for_tool== condition.
1693 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
1695 'mac_debug_optimization': '1',
1696 'mac_release_optimization': '1',
1697 'release_optimize': '1',
1698 'no_gc_sections': 1,
1699 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
1700 '-fno-builtin -fno-optimize-sibling-calls',
1701 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
1702 '-fno-builtin -fno-optimize-sibling-calls',
1704 # MSVS flags for TSan on Pin and Windows.
1705 'win_debug_RuntimeChecks': '0',
1706 'win_debug_disable_iterator_debugging': '1',
1707 'win_debug_Optimization': '1',
1708 'win_debug_InlineFunctionExpansion': '0',
1709 'win_release_InlineFunctionExpansion': '0',
1710 'win_release_OmitFramePointers': '0',
1712 'linux_use_tcmalloc': 1,
1713 'release_valgrind_build': 1,
1715 'component': 'static_library',
1716 'use_system_zlib': 0,
1719 # Build tweaks for DrMemory.
1720 # TODO(rnk): Combine with tsan config to share the builder.
1721 # http://crbug.com/108155
1722 ['build_for_tool=="drmemory"', {
1723 # These runtime checks force initialization of stack vars which blocks
1724 # DrMemory's uninit detection.
1725 'win_debug_RuntimeChecks': '0',
1726 # Iterator debugging is slow.
1727 'win_debug_disable_iterator_debugging': '1',
1728 # Try to disable optimizations that mess up stacks in a release build.
1729 # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054)
1730 # /O2 and /Ob0 (disable inline) cannot be used together because of a
1731 # compiler bug, so we use /Ob1 instead.
1732 'win_release_InlineFunctionExpansion': '1',
1733 'win_release_OmitFramePointers': '0',
1734 # Ditto for debug, to support bumping win_debug_Optimization.
1735 'win_debug_InlineFunctionExpansion': 0,
1736 'win_debug_OmitFramePointers': 0,
1737 # Keep the code under #ifndef NVALGRIND.
1738 'release_valgrind_build': 1,
1741 # Enable RLZ on Win, Mac and ChromeOS.
1742 ['branding=="Chrome" and (OS=="win" or OS=="mac" or chromeos==1)', {
1746 # Set default compiler flags depending on ARM version.
1747 ['arm_version==5 and android_webview_build==0', {
1748 # Flags suitable for Android emulator
1749 'arm_arch%': 'armv5te',
1750 'arm_tune%': 'xscale',
1752 'arm_float_abi%': 'soft',
1755 ['arm_version==6 and android_webview_build==0', {
1756 'arm_arch%': 'armv6',
1759 'arm_float_abi%': 'soft',
1762 ['arm_version==7 and android_webview_build==0', {
1763 'arm_arch%': 'armv7-a',
1764 'arm_tune%': 'cortex-a8',
1769 'arm_fpu%': 'vfpv3-d16',
1772 # Change the default to hard once the armhf transition is complete.
1773 'arm_float_abi%': 'softfp',
1777 ['android_webview_build==1', {
1778 # The WebView build gets its cpu-specific flags from the Android build system.
1782 'arm_float_abi%': '',
1786 # Enable brlapi by default for chromeos.
1793 # The path to the ANGLE library. TODO(apatrick): This is to help
1794 # transition to a new version of ANGLE at a new location. After the
1795 # transition is complete, this can be removed.
1796 'angle_path': '<(DEPTH)/third_party/angle_dx11',
1798 # List of default apps to install in new profiles. The first list contains
1799 # the source files as found in svn. The second list, used only for linux,
1800 # contains the destination location for each of the files. When a crx
1801 # is added or removed from the list, the chrome/browser/resources/
1802 # default_apps/external_extensions.json file must also be updated.
1803 'default_apps_list': [
1804 'browser/resources/default_apps/external_extensions.json',
1805 'browser/resources/default_apps/gmail.crx',
1806 'browser/resources/default_apps/search.crx',
1807 'browser/resources/default_apps/youtube.crx',
1808 'browser/resources/default_apps/drive.crx',
1809 'browser/resources/default_apps/docs.crx',
1811 'default_apps_list_linux_dest': [
1812 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
1813 '<(PRODUCT_DIR)/default_apps/gmail.crx',
1814 '<(PRODUCT_DIR)/default_apps/search.crx',
1815 '<(PRODUCT_DIR)/default_apps/youtube.crx',
1816 '<(PRODUCT_DIR)/default_apps/drive.crx',
1817 '<(PRODUCT_DIR)/default_apps/docs.crx',
1820 'target_defaults': {
1822 # The condition that operates on chromium_code is in a target_conditions
1823 # section, and will not have access to the default fallback value of
1824 # chromium_code at the top of this file, or to the chromium_code
1825 # variable placed at the root variables scope of .gyp files, because
1826 # those variables are not set at target scope. As a workaround,
1827 # if chromium_code is not set at target scope, define it in target scope
1828 # to contain whatever value it has during early variable expansion.
1829 # That's enough to make it available during target conditional
1831 'chromium_code%': '<(chromium_code)',
1833 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
1834 'win_release_Optimization%': '2', # 2 = /Os
1835 'win_debug_Optimization%': '0', # 0 = /Od
1837 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
1838 # Tri-state: blank is default, 1 on, 0 off
1839 'win_release_OmitFramePointers%': '0',
1840 # Tri-state: blank is default, 1 on, 0 off
1841 'win_debug_OmitFramePointers%': '',
1843 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
1844 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
1846 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
1847 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
1848 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
1850 # VS inserts quite a lot of extra checks to algorithms like
1851 # std::partial_sort in Debug build which make them O(N^2)
1852 # instead of O(N*logN). This is particularly slow under memory
1853 # tools like ThreadSanitizer so we want it to be disablable.
1854 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
1855 'win_debug_disable_iterator_debugging%': '0',
1857 # An application manifest fragment to declare compatibility settings for
1858 # 'executable' targets. Ignored in other target type.
1859 'win_exe_compatibility_manifest%':
1860 '<(DEPTH)\\build\\win\\compatibility.manifest',
1862 # Set to 1 to generate external manifest instead of embedding it for
1863 # 'executable' target. Does nothing for other target type. This flag is
1864 # used to make mini_installer compatible with the component build.
1865 # See http://crbug.com/127233
1866 'win_use_external_manifest%': 0,
1868 'release_extra_cflags%': '',
1869 'debug_extra_cflags%': '',
1871 'release_valgrind_build%': '<(release_valgrind_build)',
1873 # the non-qualified versions are widely assumed to be *nix-only
1874 'win_release_extra_cflags%': '',
1875 'win_debug_extra_cflags%': '',
1877 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1878 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
1880 # Only used by Windows build for now. Can be used to build into a
1881 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
1882 # output files in src/build/VS2010_{Debug,Release}.
1883 'build_dir_prefix%': '',
1885 # Targets are by default not nacl untrusted code.
1886 'nacl_untrusted_build%': 0,
1888 'pnacl_compile_flags': [
1889 # pnacl uses the clang compiler so we need to supress all the
1890 # same warnings as we do for clang.
1891 # TODO(sbc): Remove these if/when they are removed from the clang
1893 '-Wno-unused-function',
1894 '-Wno-char-subscripts',
1895 '-Wno-c++11-extensions',
1896 '-Wno-unnamed-type-template-args',
1900 ['OS=="win" and component=="shared_library"', {
1901 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
1902 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
1903 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
1905 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
1906 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
1907 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
1910 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
1911 'mac_release_optimization%': 's', # Use -Os unless overridden
1912 'mac_debug_optimization%': '0', # Use -O0 unless overridden
1914 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
1915 'mac_release_optimization%': '3', # Use -O3 unless overridden
1916 'mac_debug_optimization%': '0', # Use -O0 unless overridden
1921 # Set this to use the new DX11 version of ANGLE.
1922 # TODO(apatrick): Remove this when the transition is complete.
1926 ['(OS=="mac" or OS=="ios") and asan==1', {
1928 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
1931 ['OS=="linux" and linux_use_tcmalloc==1 and clang_type_profiler==1', {
1932 'cflags_cc!': ['-fno-rtti'],
1935 '-gline-tables-only',
1936 '-fintercept-allocation-functions',
1938 'defines': ['TYPE_PROFILING'],
1940 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
1943 ['OS=="linux" and clang==1 and host_arch=="ia32"', {
1944 # TODO(dmikurube): Remove -Wno-sentinel when Clang/LLVM is fixed.
1945 # See http://crbug.com/162818.
1946 'cflags+': ['-Wno-sentinel'],
1948 ['OS=="win" and "<(msbuild_toolset)"!=""', {
1949 'msbuild_toolset': '<(msbuild_toolset)',
1951 ['branding=="Chrome"', {
1952 'defines': ['GOOGLE_CHROME_BUILD'],
1953 }, { # else: branding!="Chrome"
1954 'defines': ['CHROMIUM_BUILD'],
1956 ['OS=="mac" and component=="shared_library"', {
1958 'DYLIB_INSTALL_NAME_BASE': '@rpath',
1959 'LD_RUNPATH_SEARCH_PATHS': [
1960 # For unbundled binaries.
1962 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
1963 '@loader_path/../../..',
1968 'defines': ['ENABLE_RLZ'],
1970 ['component=="shared_library"', {
1971 'defines': ['COMPONENT_BUILD'],
1973 ['toolkit_views==1', {
1974 'defines': ['TOOLKIT_VIEWS=1'],
1976 ['ui_compositor_image_transport==1', {
1977 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
1980 'defines': ['USE_AURA=1'],
1983 'defines': ['USE_ASH=1'],
1986 'defines': ['USE_CRAS=1'],
1989 'defines': ['USE_OZONE=1'],
1991 ['use_default_render_theme==1', {
1992 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
1994 ['use_libjpeg_turbo==1', {
1995 'defines': ['USE_LIBJPEG_TURBO=1'],
1998 'defines': ['USE_NSS=1'],
2001 'defines': ['USE_X11=1'],
2003 ['enable_one_click_signin==1', {
2004 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2006 ['toolkit_uses_gtk==1 and toolkit_views==0', {
2007 # TODO(erg): We are progressively sealing up use of deprecated features
2008 # in gtk in preparation for an eventual porting to gtk3.
2009 'defines': ['GTK_DISABLE_SINGLE_INCLUDES=1'],
2012 'defines': ['OS_CHROMEOS=1'],
2015 'defines': ['GOOGLE_TV=1'],
2017 ['use_xi2_mt!=0 and use_x11==1', {
2018 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2020 ['file_manager_extension==1', {
2021 'defines': ['FILE_MANAGER_EXTENSION=1'],
2023 ['image_loader_extension==1', {
2024 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2027 'defines': ['ENABLE_PROFILING=1'],
2029 ['OS=="linux" and glibcxx_debug==1', {
2030 'defines': ['_GLIBCXX_DEBUG=1',],
2031 'cflags_cc+': ['-g'],
2034 'defines': ['ENABLE_REMOTING=1'],
2036 ['enable_webrtc==1', {
2037 'defines': ['ENABLE_WEBRTC=1'],
2039 ['proprietary_codecs==1', {
2040 'defines': ['USE_PROPRIETARY_CODECS'],
2042 ['enable_viewport==1', {
2043 'defines': ['ENABLE_VIEWPORT'],
2045 ['enable_pepper_cdms==1', {
2046 'defines': ['ENABLE_PEPPER_CDMS'],
2048 ['configuration_policy==1', {
2049 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2051 ['input_speech==1', {
2052 'defines': ['ENABLE_INPUT_SPEECH'],
2054 ['notifications==1', {
2055 'defines': ['ENABLE_NOTIFICATIONS'],
2057 ['enable_hidpi==1', {
2058 'defines': ['ENABLE_HIDPI=1'],
2062 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2066 # Clang creates chubby debug information, which makes linking very
2067 # slow. For now, don't create debug information with clang. See
2068 # http://crbug.com/70000
2072 'debug_extra_cflags': '-g0',
2075 # Android builds symbols on release by default, disable them.
2078 'debug_extra_cflags': '-g0',
2079 'release_extra_cflags': '-g0',
2083 }, { # else clang!=1
2085 ['OS=="win" and fastbuild==2', {
2086 # Completely disable debug information.
2089 'GenerateDebugInformation': 'false',
2091 'VCCLCompilerTool': {
2092 'DebugInformationFormat': '0',
2096 ['OS=="win" and fastbuild==1', {
2099 # This tells the linker to generate .pdbs, so that
2100 # we can get meaningful stack traces.
2101 'GenerateDebugInformation': 'true',
2103 'VCCLCompilerTool': {
2104 # No debug info to be generated by compiler.
2105 'DebugInformationFormat': '0',
2109 ['OS=="linux" and fastbuild==2', {
2111 'debug_extra_cflags': '-g0',
2114 ['OS=="linux" and fastbuild==1', {
2116 'debug_extra_cflags': '-g1',
2119 ['OS=="android" and fastbuild==2', {
2121 'debug_extra_cflags': '-g0',
2122 'release_extra_cflags': '-g0',
2125 ['OS=="android" and fastbuild==1', {
2127 'debug_extra_cflags': '-g1',
2128 'release_extra_cflags': '-g1',
2135 ['dcheck_always_on!=0', {
2136 'defines': ['DCHECK_ALWAYS_ON=1'],
2137 }], # dcheck_always_on!=0
2138 ['logging_like_official_build!=0', {
2139 'defines': ['LOGGING_IS_OFFICIAL_BUILD=1'],
2140 }], # logging_like_official_build!=0
2141 ['tracing_like_official_build!=0', {
2142 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2143 }], # tracing_like_official_build!=0
2144 ['win_use_allocator_shim==0', {
2147 'defines': ['NO_TCMALLOC'],
2151 ['use_openssl==1', {
2156 ['enable_eglimage==1', {
2158 'ENABLE_EGLIMAGE=1',
2161 ['asan==1 and OS=="win"', {
2162 # Since asan on windows uses Syzygy, we need /PROFILE turned on to
2163 # produce appropriate pdbs.
2170 'ADDRESS_SANITIZER',
2171 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2173 }], # asan==1 and OS=="win"
2176 ['OS=="mac" or OS=="ios"', {
2178 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
2179 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
2183 # Add -lgcov for types executable, shared_library, and
2184 # loadable_module; not for static_library.
2185 # This is a delayed conditional.
2186 'target_conditions': [
2187 ['_type!="static_library"', {
2188 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
2192 ['OS=="linux" or OS=="android"', {
2193 'cflags': [ '-ftest-coverage',
2195 'link_settings': { 'libraries': [ '-lgcov' ] },
2199 # Disable incremental linking for all modules.
2200 # 0: inherit, 1: disabled, 2: enabled.
2201 'msvs_debug_link_incremental': '1',
2202 'msvs_large_module_debug_link_mode': '1',
2203 # Disable RTC. Syzygy explicitly doesn't support RTC instrumented
2205 'win_debug_RuntimeChecks': '0',
2208 # Disable iterator debugging (huge speed boost without any
2209 # change in coverage results).
2210 '_HAS_ITERATOR_DEBUGGING=0',
2214 # Enable profile information (necessary for coverage
2215 # instrumentation). This is incompatible with incremental
2221 ], # conditions for coverage
2226 '_CRT_SECURE_NO_DEPRECATE',
2227 '_SCL_SECURE_NO_DEPRECATE',
2228 # This define is required to pull in the new Win8 interfaces from
2229 # system headers like ShObjIdl.h.
2230 'NTDDI_VERSION=0x06020000',
2233 '<(DEPTH)/third_party/wtl/include',
2238 # Generates debug info when win_z7=1
2239 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2241 'GenerateDebugInformation': 'true',
2243 'VCCLCompilerTool': {
2244 'DebugInformationFormat': '1',
2248 ['"<(GENERATOR)"=="msvs"', {
2251 # Make the pdb name sane. Otherwise foo.exe and foo.dll both
2252 # have foo.pdb. The ninja generator already defaults to this and
2253 # can't handle the $(TargetPath) macro.
2254 'ProgramDatabaseFile': '$(TargetPath).pdb',
2260 ['enable_task_manager==1', {
2262 'ENABLE_TASK_MANAGER=1',
2265 ['enable_extensions==1', {
2267 'ENABLE_EXTENSIONS=1',
2270 ['OS=="win" and branding=="Chrome"', {
2271 'defines': ['ENABLE_SWIFTSHADER'],
2273 ['enable_dart==1', {
2274 'defines': ['WEBKIT_USING_DART=1'],
2276 ['enable_plugin_installation==1', {
2277 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2279 ['enable_plugins==1', {
2280 'defines': ['ENABLE_PLUGINS=1'],
2282 ['enable_session_service==1', {
2283 'defines': ['ENABLE_SESSION_SERVICE=1'],
2285 ['enable_themes==1', {
2286 'defines': ['ENABLE_THEMES=1'],
2288 ['enable_autofill_dialog==1', {
2289 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2291 ['enable_background==1', {
2292 'defines': ['ENABLE_BACKGROUND=1'],
2294 ['enable_automation==1', {
2295 'defines': ['ENABLE_AUTOMATION=1'],
2297 ['enable_google_now==1', {
2298 'defines': ['ENABLE_GOOGLE_NOW=1'],
2300 ['cld_version!=0', {
2301 'defines': ['CLD_VERSION=<(cld_version)'],
2303 ['enable_printing==1', {
2304 'defines': ['ENABLE_FULL_PRINTING=1', 'ENABLE_PRINTING=1'],
2306 ['enable_printing==2', {
2307 'defines': ['ENABLE_PRINTING=1'],
2309 ['enable_spellcheck==1', {
2310 'defines': ['ENABLE_SPELLCHECK=1'],
2312 ['enable_captive_portal_detection==1', {
2313 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2315 ['enable_app_list==1', {
2316 'defines': ['ENABLE_APP_LIST=1'],
2318 ['enable_settings_app==1', {
2319 'defines': ['ENABLE_SETTINGS_APP=1'],
2321 ['disable_ftp_support==1', {
2322 'defines': ['DISABLE_FTP_SUPPORT=1'],
2324 ['enable_managed_users==1', {
2325 'defines': ['ENABLE_MANAGED_USERS=1'],
2327 ['spdy_proxy_auth_origin != ""', {
2328 'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'],
2330 ['spdy_proxy_auth_property != ""', {
2331 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2333 ['spdy_proxy_auth_value != ""', {
2334 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2336 ['data_reduction_proxy_probe_url != ""', {
2338 'DATA_REDUCTION_PROXY_PROBE_URL="<(data_reduction_proxy_probe_url)"'],
2340 ['enable_mdns==1', {
2341 'defines': ['ENABLE_MDNS=1'],
2343 ['enable_enhanced_bookmarks==1', {
2344 'defines': ['ENABLE_ENHANCED_BOOKMARKS=1'],
2346 ], # conditions for 'target_defaults'
2347 'target_conditions': [
2348 ['enable_wexit_time_destructors==1', {
2352 '-Wexit-time-destructors',
2356 '-Wexit-time-destructors',
2362 ['chromium_code==0', {
2364 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
2365 # We don't want to get warnings from third-party code,
2366 # so remove any existing warning-enabling flags like -Wall.
2372 # Don't warn about hash_map in third-party code.
2376 # Don't warn about printf format problems.
2377 # This is off by default in gcc but on in Ubuntu's gcc(!).
2381 # TODO(fischman): remove this.
2382 # http://code.google.com/p/chromium/issues/detail?id=90453
2386 # TODO: Fix all warnings on chromeos too.
2387 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
2392 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
2394 # Don't warn about ignoring the return value from e.g. close().
2395 # This is off by default in some gccs but on by default in others.
2396 # BSD systems do not support this option, since they are usually
2397 # using gcc 4.2.1, which does not have this flag yet.
2398 '-Wno-unused-result',
2403 '_CRT_SECURE_NO_DEPRECATE',
2404 '_CRT_NONSTDC_NO_WARNINGS',
2405 '_CRT_NONSTDC_NO_DEPRECATE',
2406 '_SCL_SECURE_NO_DEPRECATE',
2408 'msvs_disabled_warnings': [4800],
2410 'VCCLCompilerTool': {
2411 'WarningLevel': '3',
2412 'WarnAsError': '<(win_third_party_warn_as_error)',
2413 'Detect64BitPortabilityProblems': 'false',
2417 ['buildtype=="Official"', {
2419 'VCCLCompilerTool': { 'WarnAsError': 'false' },
2424 # TODO(darin): Unfortunately, some third_party code depends on base.
2425 [ 'OS=="win" and component=="shared_library"', {
2426 'msvs_disabled_warnings': [
2427 4251, # class 'std::xx' needs to have dll-interface.
2430 [ 'OS=="mac" or OS=="ios"', {
2432 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
2435 ['buildtype=="Official"', {
2437 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
2444 # TODO(ios): Fix remaining warnings in third-party code, then
2445 # remove this; the Mac cleanup didn't get everything that's
2446 # flagged in an iOS build.
2447 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
2448 'RUN_CLANG_STATIC_ANALYZER': 'NO',
2454 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
2455 'filename_rules.gypi',
2457 # In Chromium code, we define __STDC_foo_MACROS in order to get the
2458 # C99 macros on Mac and Linux.
2460 '__STDC_CONSTANT_MACROS',
2461 '__STDC_FORMAT_MACROS',
2465 # turn on warnings for signed/unsigned mismatch on chromium code.
2467 'VCCLCompilerTool': {
2468 'AdditionalOptions': ['/we4389'],
2472 ['OS=="win" and component=="shared_library"', {
2473 'msvs_disabled_warnings': [
2474 4251, # class 'std::xx' needs to have dll-interface.
2479 ], # target_conditions for 'target_defaults'
2480 'default_configuration': 'Debug',
2482 # VCLinkerTool LinkIncremental values below:
2484 # 1 == /INCREMENTAL:NO
2486 # Debug links incremental, Release does not.
2488 # Abstract base configurations to cover common attributes.
2492 'msvs_configuration_attributes': {
2493 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
2494 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
2495 'CharacterSet': '1',
2497 # Add the default import libs.
2500 'AdditionalDependencies': [
2522 'TargetMachine': '1',
2525 'msvs_configuration_platform': 'Win32',
2529 'msvs_configuration_platform': 'x64',
2532 'TargetMachine': '17', # x86 - 64
2533 'AdditionalLibraryDirectories!':
2534 ['<(windows_sdk_path)/Lib/win8/um/x86'],
2535 'AdditionalLibraryDirectories':
2536 ['<(windows_sdk_path)/Lib/win8/um/x64'],
2537 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
2538 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
2540 'VCLibrarianTool': {
2541 'AdditionalLibraryDirectories!':
2542 ['<(windows_sdk_path)/Lib/win8/um/x86'],
2543 'AdditionalLibraryDirectories':
2544 ['<(windows_sdk_path)/Lib/win8/um/x64'],
2551 'DYNAMIC_ANNOTATIONS_ENABLED=1',
2552 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
2555 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
2557 '<@(debug_extra_cflags)',
2561 'VCCLCompilerTool': {
2562 'Optimization': '<(win_debug_Optimization)',
2563 'PreprocessorDefinitions': ['_DEBUG'],
2564 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
2565 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
2567 # According to MSVS, InlineFunctionExpansion=0 means
2568 # "default inlining", not "/Ob0".
2569 # Thus, we have to handle InlineFunctionExpansion==0 separately.
2570 ['win_debug_InlineFunctionExpansion==0', {
2571 'AdditionalOptions': ['/Ob0'],
2573 ['win_debug_InlineFunctionExpansion!=""', {
2574 'InlineFunctionExpansion':
2575 '<(win_debug_InlineFunctionExpansion)',
2577 ['win_debug_disable_iterator_debugging==1', {
2578 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
2581 # if win_debug_OmitFramePointers is blank, leave as default
2582 ['win_debug_OmitFramePointers==1', {
2583 'OmitFramePointers': 'true',
2585 ['win_debug_OmitFramePointers==0', {
2586 'OmitFramePointers': 'false',
2587 # The above is not sufficient (http://crbug.com/106711): it
2588 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
2589 # perform FPO regardless, so we must explicitly disable.
2590 # We still want the false setting above to avoid having
2591 # "/Oy /Oy-" and warnings about overriding.
2592 'AdditionalOptions': ['/Oy-'],
2595 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
2598 'LinkIncremental': '<(msvs_debug_link_incremental)',
2599 # ASLR makes debugging with windbg difficult because Chrome.exe and
2600 # Chrome.dll share the same base name. As result, windbg will
2601 # name the Chrome.dll module like chrome_<base address>, where
2602 # <base address> typically changes with each launch. This in turn
2603 # means that breakpoints in Chrome.dll don't stick from one launch
2604 # to the next. For this reason, we turn ASLR off in debug builds.
2605 # Note that this is a three-way bool, where 0 means to pick up
2606 # the default setting, 1 is off and 2 is on.
2607 'RandomizedBaseAddress': 1,
2609 'VCResourceCompilerTool': {
2610 'PreprocessorDefinitions': ['_DEBUG'],
2614 ['OS=="linux" or OS=="android"', {
2615 'target_conditions': [
2616 ['_toolset=="target"', {
2618 '<@(debug_extra_cflags)',
2623 # Disabled on iOS because it was causing a crash on startup.
2624 # TODO(michelea): investigate, create a reduced test and possibly
2626 ['release_valgrind_build==0 and OS!="ios"', {
2629 '-fstack-protector-all', # Implies -fstack-protector
2641 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
2642 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
2643 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
2646 'VCCLCompilerTool': {
2647 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
2649 # In official builds, each target will self-select
2650 # an optimization level.
2651 ['buildtype!="Official"', {
2652 'Optimization': '<(win_release_Optimization)',
2655 # According to MSVS, InlineFunctionExpansion=0 means
2656 # "default inlining", not "/Ob0".
2657 # Thus, we have to handle InlineFunctionExpansion==0 separately.
2658 ['win_release_InlineFunctionExpansion==0', {
2659 'AdditionalOptions': ['/Ob0'],
2661 ['win_release_InlineFunctionExpansion!=""', {
2662 'InlineFunctionExpansion':
2663 '<(win_release_InlineFunctionExpansion)',
2666 # if win_release_OmitFramePointers is blank, leave as default
2667 ['win_release_OmitFramePointers==1', {
2668 'OmitFramePointers': 'true',
2670 ['win_release_OmitFramePointers==0', {
2671 'OmitFramePointers': 'false',
2672 # The above is not sufficient (http://crbug.com/106711): it
2673 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
2674 # perform FPO regardless, so we must explicitly disable.
2675 # We still want the false setting above to avoid having
2676 # "/Oy /Oy-" and warnings about overriding.
2677 'AdditionalOptions': ['/Oy-'],
2680 'AdditionalOptions': [ '<@(win_release_extra_cflags)', ],
2683 # LinkIncremental is a tri-state boolean, where 0 means default
2684 # (i.e., inherit from parent solution), 1 means false, and
2686 'LinkIncremental': '1',
2687 # This corresponds to the /PROFILE flag which ensures the PDB
2688 # file contains FIXUP information (growing the PDB file by about
2689 # 5%) but does not otherwise alter the output binary. This
2690 # information is used by the Syzygy optimization tool when
2691 # decomposing the release image.
2696 ['msvs_use_common_release', {
2697 'includes': ['release.gypi'],
2699 ['release_valgrind_build==0 and tsan==0', {
2702 'DYNAMIC_ANNOTATIONS_ENABLED=0',
2706 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2707 'DYNAMIC_ANNOTATIONS_ENABLED=1',
2708 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
2711 ['win_use_allocator_shim==0', {
2712 'defines': ['NO_TCMALLOC'],
2714 ['os_posix==1 and chromium_code==1', {
2715 # Non-chromium code is not guaranteed to compile cleanly
2716 # with _FORTIFY_SOURCE. Also, fortified build may fail
2717 # when optimizations are disabled, so only do that for Release
2720 '_FORTIFY_SOURCE=2',
2723 ['OS=="linux" or OS=="android"', {
2724 'target_conditions': [
2725 ['_toolset=="target"', {
2727 '<@(release_extra_cflags)',
2734 'NS_BLOCK_ASSERTIONS=1',
2740 # Concrete configurations
2743 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
2746 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
2750 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
2752 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
2755 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
2763 'target_defaults': {
2770 ['os_posix==1 and chromeos==0', {
2771 # Chrome OS enables -fstack-protector-strong via its build wrapper,
2772 # and we want to avoid overriding this, so stack-protector is only
2773 # enabled when not building on Chrome OS.
2774 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
2776 'target_defaults': {
2778 '-fstack-protector',
2779 '--param=ssp-buffer-size=4',
2783 ['os_posix==1 and OS!="mac" and OS!="ios"', {
2784 'target_defaults': {
2785 # Enable -Werror by default, but put it in a variable so it can
2786 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
2788 'werror%': '-Werror',
2789 'libraries_for_target%': '',
2792 '_FILE_OFFSET_BITS=64',
2795 '<(werror)', # See note above about the werror variable.
2798 '-fno-strict-aliasing', # See http://crbug.com/32204
2800 # TODO(evan): turn this back on once all the builds work.
2802 # Don't warn about unused function params. We use those everywhere.
2803 '-Wno-unused-parameter',
2804 # Don't warn about the "struct foo f = {0};" initialization pattern.
2805 '-Wno-missing-field-initializers',
2806 # Don't export any symbols (for example, to plugins we dlopen()).
2807 # Note: this is *required* to make some plugins work.
2808 '-fvisibility=hidden',
2813 '-fno-threadsafe-statics',
2814 # Make inline functions have hidden visiblity by default.
2815 # Surprisingly, not covered by -fvisibility=hidden.
2816 '-fvisibility-inlines-hidden',
2817 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
2818 # so we specify it explicitly.
2819 # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it.
2820 # http://code.google.com/p/chromium/issues/detail?id=90453
2824 '-pthread', '-Wl,-z,noexecstack',
2827 '<(libraries_for_target)',
2832 'debug_optimize%': '0',
2838 '-O>(debug_optimize)',
2844 '-Wl,--fatal-warnings',
2845 # Only link with needed input sections. This is to avoid
2846 # getting undefined reference to __cxa_bad_typeid in the CDU
2848 '-Wl,--gc-sections',
2849 # Warn in case of text relocations.
2850 '-Wl,--warn-shared-textrel',
2853 ['OS=="android" and android_full_debug==0', {
2854 # Some configurations are copied from Release_Base to reduce
2857 'debug_optimize%': 's',
2860 '-fomit-frame-pointer',
2862 '-ffunction-sections',
2869 ['OS=="linux" and target_arch=="ia32"', {
2871 '-Wl,--no-as-needed',
2878 'release_optimize%': '2',
2879 # Binaries become big and gold is unable to perform GC
2880 # and remove unused sections for some of test targets
2881 # on 32 bit platform.
2882 # (This is currently observed only in chromeos valgrind bots)
2883 # The following flag is to disable --gc-sections linker
2884 # option for these bots.
2885 'no_gc_sections%': 0,
2887 # TODO(bradnelson): reexamine how this is done if we change the
2888 # expansion of configurations
2889 'release_valgrind_build%': 0,
2892 '-O<(release_optimize)',
2893 # Don't emit the GCC version ident directives, they just end up
2894 # in the .comment section taking up binary size.
2896 # Put data and code in their own sections, so that unused symbols
2897 # can be removed at link time with --gc-sections.
2899 '-ffunction-sections',
2902 # Specifically tell the linker to perform optimizations.
2903 # See http://lwn.net/Articles/192624/ .
2908 ['no_gc_sections==0', {
2910 '-Wl,--gc-sections',
2915 'release_optimize%': 's',
2918 '-fomit-frame-pointer',
2921 '-Wl,--fatal-warnings',
2922 # Warn in case of text relocations.
2923 '-Wl,--warn-shared-textrel',
2933 '-fno-omit-frame-pointer',
2937 ['profiling_full_stack_frames==1', {
2940 '-fno-optimize-sibling-calls',
2945 # Can be omitted to reduce output size. Does not seem to affect
2947 ['target_arch=="ia32"', {
2949 '-fno-unwind-tables',
2950 '-fno-asynchronous-unwind-tables',
2957 ['target_arch=="ia32"', {
2958 'target_conditions': [
2959 ['_toolset=="target"', {
2961 # Needed so that libs with .s files (e.g. libicudata.a)
2962 # are compatible with the general 32-bit-ness.
2965 # All floating-point computations on x87 happens in 80-bit
2966 # precision. Because the C and C++ language standards allow
2967 # the compiler to keep the floating-point values in higher
2968 # precision than what's specified in the source and doing so
2969 # is more efficient than constantly rounding up to 64-bit or
2970 # 32-bit precision as specified in the source, the compiler,
2971 # especially in the optimized mode, tries very hard to keep
2972 # values in x87 floating-point stack (in 80-bit precision)
2973 # as long as possible. This has important side effects, that
2974 # the real value used in computation may change depending on
2975 # how the compiler did the optimization - that is, the value
2976 # kept in 80-bit is different than the value rounded down to
2977 # 64-bit or 32-bit. There are possible compiler options to
2978 # make this behavior consistent (e.g. -ffloat-store would keep
2979 # all floating-values in the memory, thus force them to be
2980 # rounded to its original precision) but they have significant
2981 # runtime performance penalty.
2983 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
2984 # which keep floating-point values in SSE registers in its
2985 # native precision (32-bit for single precision, and 64-bit
2986 # for double precision values). This means the floating-point
2987 # value used during computation does not change depending on
2988 # how the compiler optimized the code, since the value is
2989 # always kept in its specified precision.
2991 ['branding=="Chromium" and disable_sse2==0', {
2998 # ChromeOS targets Pinetrail, which is sse3, but most of the
2999 # benefit comes from sse2 so this setting allows ChromeOS
3000 # to build on other CPUs. In the future -march=atom would
3001 # help but requires a newer compiler.
3002 ['chromeos==1 and disable_sse2==0', {
3008 # Use gold linker for Android ia32 target.
3017 # Install packages have started cropping up with
3018 # different headers between the 32-bit and 64-bit
3019 # versions, so we have to shadow those differences off
3020 # and make sure a 32-bit-on-64-bit build picks up the
3022 # For android build, use NDK headers instead of host headers
3023 ['host_arch!="ia32" and OS!="android"', {
3029 # -mmmx allows mmintrin.h to be used for mmx intrinsics.
3030 # video playback is mmx and sse2 optimized.
3041 ['target_arch=="arm"', {
3042 'target_conditions': [
3043 ['_toolset=="target"', {
3045 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3046 # has changed whenever it encounters a varargs function. This
3047 # silences those warnings, as they are not helpful and
3048 # clutter legitimate warnings.
3054 '-march=<(arm_arch)',
3059 '-mtune=<(arm_tune)',
3067 ['arm_float_abi!=""', {
3069 '-mfloat-abi=<(arm_float_abi)',
3078 # Most of the following flags are derived from what Android
3079 # uses by default when building for arm, reference for which
3080 # can be found in the following file in the Android NDK:
3081 # toolchains/arm-linux-androideabi-4.4.3/setup.mk
3083 # The tree-sra optimization (scalar replacement for
3084 # aggregates enabling subsequent optimizations) leads to
3085 # invalid code generation when using the Android NDK's
3086 # compiler (r5-r7). This can be verified using
3087 # webkit_unit_tests' WTF.Checked_int8_t test.
3092 # Android now supports .relro sections properly.
3093 # NOTE: While these flags enable the generation of .relro
3094 # sections, the generated libraries can still be loaded on
3095 # older Android platform versions.
3103 'cflags': [ '-mthumb-interwork' ],
3107 '-marm', # Probably reduntant, but recommend by "perf" docs.
3108 '-mapcs-frame', # Seems required by -fno-omit-frame-pointer.
3113 # Clang does not support the following options.
3114 '-mthumb-interwork',
3115 '-finline-limit=64',
3121 # Clang does not support the following options.
3131 ['target_arch=="mipsel"', {
3132 'target_conditions': [
3133 ['_toolset=="target"', {
3135 ['android_webview_build==0 and mips_arch_variant=="mips32r2"', {
3136 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
3138 ['android_webview_build==0 and mips_arch_variant!="mips32r2"', {
3139 'cflags': ['-mips32', '-Wa,-mips32'],
3148 '-Wl,--no-keep-memory'
3151 '-Wno-uninitialized',
3165 'target_conditions': [
3166 ['_toolset=="target"', {
3168 '--sysroot=<(sysroot)',
3171 '--sysroot=<(sysroot)',
3172 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
3180 # Don't die on dtoa code that uses a char as an array index.
3181 '-Wno-char-subscripts',
3183 # Clang spots more unused functions.
3184 '-Wno-unused-function',
3186 # Warns on switches on enums that cover all enum values but
3187 # also contain a default: branch. Chrome is full of that.
3188 '-Wno-covered-switch-default',
3190 # Warns when a const char[] is converted to bool.
3191 '-Wstring-conversion',
3193 # C++11-related flags:
3195 # This warns on using ints as initializers for floats in
3196 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
3197 # which happens in several places in chrome code. Not sure if
3198 # this is worth fixing.
3199 '-Wno-c++11-narrowing',
3201 # TODO(thakis): Remove, http://crbug.com/263960
3202 '-Wno-reserved-user-defined-literal',
3204 # Clang considers the `register` keyword as deprecated, but e.g.
3205 # code generated by flex (used in angle) contains that keyword.
3206 # http://crbug.com/255186
3207 '-Wno-deprecated-register',
3209 # This warns about auto_ptr<>, used in third-party code.
3210 '-Wno-deprecated-declarations',
3213 # Clang doesn't seem to know know this flag.
3217 # See the comment in the Mac section for what it takes to move
3218 # this to -std=c++11.
3222 ['clang==1 and OS=="android"', {
3223 # Android uses stlport, whose include/new defines
3224 # `void operator delete[](void* ptr) throw();`, which
3225 # clang's -Wimplicit-exception-spec-mismatch warns about for some
3226 # reason -- http://llvm.org/PR16638. TODO(thakis): Include stlport
3227 # via -isystem instead.
3229 '-Wno-implicit-exception-spec-mismatch',
3232 ['clang==1 and clang_use_chrome_plugins==1', {
3234 '<@(clang_chrome_plugins_flags)',
3237 ['clang==1 and clang_load!=""', {
3239 '-Xclang', '-load', '-Xclang', '<(clang_load)',
3242 ['clang==1 and clang_add_plugin!=""', {
3244 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
3247 ['clang==1 and target_arch=="ia32"', {
3249 # Else building libyuv gives clang's register allocator issues,
3250 # see llvm.org/PR15798 / crbug.com/233709
3251 '-momit-leaf-frame-pointer',
3254 ['clang==1 and "<(GENERATOR)"=="ninja"', {
3256 # See http://crbug.com/110262
3257 '-fcolor-diagnostics',
3260 # Common options for AddressSanitizer, LeakSanitizer,
3261 # ThreadSanitizer and MemorySanitizer.
3262 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
3263 'target_conditions': [
3264 ['_toolset=="target"', {
3266 '-fno-omit-frame-pointer',
3267 '-gline-tables-only',
3270 # Functions interposed by the sanitizers can make ld think
3271 # that some libraries aren't needed when they actually are,
3272 # http://crbug.com/234010. As workaround, disable --as-needed.
3276 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3279 ['_toolset=="target" and OS=="linux"', {
3281 # http://crbug.com/234010.
3288 'target_conditions': [
3289 ['_toolset=="target"', {
3291 '-fsanitize=address',
3292 '-w', # http://crbug.com/162783
3295 '-fsanitize=address',
3298 'ADDRESS_SANITIZER',
3304 'target_conditions': [
3305 ['_toolset=="target"', {
3314 'WTF_USE_LEAK_SANITIZER=1',
3320 'target_conditions': [
3321 ['_toolset=="target"', {
3323 '-fsanitize=thread',
3325 '-mllvm', '-tsan-blacklist=<(tsan_blacklist)',
3328 '-fsanitize=thread',
3332 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
3333 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
3335 'target_conditions': [
3336 ['_type=="executable"', {
3346 'target_conditions': [
3347 ['_toolset=="target"', {
3349 '-fsanitize=memory',
3350 '-fsanitize-memory-track-origins',
3354 '-fsanitize=memory',
3359 'target_conditions': [
3360 ['_type=="executable"', {
3369 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
3370 'target_conditions' : [
3371 ['_toolset=="target"', {
3373 '-finstrument-functions',
3374 # Allow mmx intrinsics to inline, so that the
3375 #0 compiler can expand the intrinsics.
3376 '-finstrument-functions-exclude-file-list=mmintrin.h',
3379 ['_toolset=="target" and OS=="android"', {
3381 # Avoids errors with current NDK:
3382 # "third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/include/arm_neon.h:3426:3: error: argument must be a constant"
3383 '-finstrument-functions-exclude-file-list=arm_neon.h',
3388 ['linux_dump_symbols==1', {
3391 ['target_arch=="ia32" and OS!="android"', {
3392 'target_conditions': [
3393 ['_toolset=="target"', {
3395 # Workaround for linker OOM.
3396 '-Wl,--no-keep-memory',
3403 ['linux_use_heapchecker==1', {
3404 'variables': {'linux_use_tcmalloc%': 1},
3407 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3410 ['component=="shared_library"', {
3411 # See crbug.com/112389
3412 # TODO(glider): replace with --dynamic-list or something
3413 'ldflags': ['-rdynamic'],
3417 ['linux_use_tcmalloc==0 and android_use_tcmalloc==0', {
3418 'defines': ['NO_TCMALLOC'],
3420 ['linux_keep_shadow_stacks==1', {
3421 'defines': ['KEEP_SHADOW_STACKS'],
3423 '-finstrument-functions',
3424 # Allow mmx intrinsics to inline, so that the compiler can expand
3426 '-finstrument-functions-exclude-file-list=mmintrin.h',
3429 ['linux_use_gold_flags==1', {
3430 'target_conditions': [
3431 ['_toolset=="target"', {
3433 # Experimentation found that using four linking threads
3434 # saved ~20% of link time.
3435 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
3436 # Only apply this to the target linker, since the host
3437 # linker might not be gold, but isn't used much anyway.
3439 '-Wl,--thread-count=4',
3444 ['release_valgrind_build==0', {
3445 'target_conditions': [
3446 ['_toolset=="target"', {
3448 # There seems to be a conflict of --icf and -pie
3449 # in gold which can generate crashy binaries. As
3450 # a security measure, -pie takes precendence for
3460 ['linux_use_gold_binary==1', {
3462 # Put our gold binary in the search path for the linker.
3463 # We pass the path to gold to the compiler. gyp leaves
3464 # unspecified what the cwd is when running the compiler,
3465 # so the normal gyp path-munging fails us. This hack
3466 # gets the right path.
3467 '-B<(PRODUCT_DIR)/../../third_party/gold',
3470 ['native_discardable_memory', {
3471 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
3473 ['native_memory_pressure_signals', {
3474 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
3479 # FreeBSD-specific options; note that most FreeBSD options are set above,
3482 'target_defaults': {
3484 '-Wl,--no-keep-memory',
3488 # Android-specific options; note that most are set above with Linux.
3491 # This is a unique identifier for a given build. It's used for
3492 # identifying various build artifacts corresponding to a particular
3493 # build of chrome (e.g. where to find archived symbols).
3494 'chrome_build_id%': '',
3496 # Use shared stlport library when system one used.
3497 # Figure this out early since it needs symbols from libgcc.a, so it
3498 # has to be before that in the set of libraries.
3499 ['use_system_stlport==1', {
3500 'android_stlport_library': 'stlport',
3503 ['component=="shared_library"', {
3504 'android_stlport_library': 'stlport_shared',
3506 'android_stlport_library': 'stlport_static',
3512 # Placing this variable here prevents from forking libvpx, used
3513 # by remoting. Remoting is off, so it needn't built,
3514 # so forking it's deps seems like overkill.
3515 # But this variable need defined to properly run gyp.
3516 # A proper solution is to have an OS==android conditional
3517 # in third_party/libvpx/libvpx.gyp to define it.
3518 'libvpx_path': 'lib/linux/arm',
3520 'target_defaults': {
3522 'release_extra_cflags%': '',
3524 # If we're using the components build, append "cr" to all shared
3525 # libraries to avoid naming collisions with android system library
3526 # versions with the same name (e.g. skia, icu).
3527 ['component=="shared_library"', {
3528 'android_product_extension': 'cr.so',
3530 'android_product_extension': 'so',
3534 'target_conditions': [
3535 ['_type=="shared_library"', {
3536 'product_extension': '<(android_product_extension)',
3539 # Settings for building device targets using Android's toolchain.
3540 # These are based on the setup.mk file from the Android NDK.
3542 # The NDK Android executable link step looks as follows:
3544 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
3545 # $(PRIVATE_OBJECTS) <-- The .o that we built
3546 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
3547 # $(TARGET_LIBGCC) <-- libgcc.a
3548 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
3549 # $(PRIVATE_LDLIBS) <-- System .so
3550 # $(TARGET_CRTEND_O) <-- crtend.o
3552 # For now the above are approximated for executables by adding
3553 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
3556 # The NDK Android shared library link step looks as follows:
3558 # $(PRIVATE_OBJECTS) <-- The .o that we built
3559 # -l,--whole-archive
3560 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
3561 # -l,--no-whole-archive
3562 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
3563 # $(TARGET_LIBGCC) <-- libgcc.a
3564 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
3565 # $(PRIVATE_LDLIBS) <-- System .so
3567 # For now, assume that whole static libraries are not needed.
3569 # For both executables and shared libraries, add the proper
3570 # libgcc.a to the start of libraries which puts it in the
3571 # proper spot after .o and .a files get linked in.
3573 # TODO: The proper thing to do longer-tem would be proper gyp
3574 # support for a custom link command line.
3575 ['_toolset=="target"', {
3577 '-pthread', # Not supported by Android toolchain.
3580 '-ffunction-sections',
3583 '-fstack-protector',
3585 '-finline-limit=64',
3586 '-Wa,--noexecstack',
3587 '<@(release_extra_cflags)',
3591 '__GNU_SOURCE=1', # Necessary for clone()
3593 '_STLP_USE_PTR_SPECIALIZATIONS=1',
3594 'CHROME_BUILD_ID="<(chrome_build_id)"',
3597 '-pthread', # Not supported by Android toolchain.
3601 '-Wl,--no-undefined',
3602 # Don't export symbols from statically linked libraries.
3603 '-Wl,--exclude-libs=ALL',
3606 '-l<(android_stlport_library)',
3607 # Manually link the libgcc.a that the cross compiler uses.
3608 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
3614 ['component=="shared_library"', {
3616 '-Wl,--exclude-libs=ALL',
3621 # Work around incompatibilities between bionic and clang
3623 '-D__compiler_offsetof=__builtin_offsetof',
3624 '-Dnan=__builtin_nan',
3627 ['target_arch=="arm"', {
3629 '-target arm-linux-androideabi',
3630 '-mllvm -arm-enable-ehabi',
3633 '-target arm-linux-androideabi',
3636 ['target_arch=="ia32"', {
3638 '-target x86-linux-androideabi',
3641 '-target x86-linux-androideabi',
3648 # Android build relies on -Wl,--gc-sections removing
3649 # unreachable code. ASan instrumentation for globals inhibits
3650 # this and results in a library with unresolvable relocations.
3651 # TODO(eugenis): find a way to reenable this.
3652 '-mllvm -asan-globals=0',
3655 ['android_webview_build==0', {
3657 # The NDK has these things, but doesn't define the constants
3658 # to say that it does. Define them here instead.
3662 '--sysroot=<(android_ndk_sysroot)',
3665 '--sysroot=<(android_ndk_sysroot)',
3668 ['android_webview_build==1', {
3670 # OpenAL headers from the Android tree.
3671 '<(android_src)/frameworks/wilhelm/include',
3674 # Android predefines this as 1; undefine it here so Chromium
3675 # can redefine it later to be 2 for chromium code and unset
3676 # for third party code. This works because cflags are added
3678 '-U_FORTIFY_SOURCE',
3679 # Disable any additional warnings enabled by the Android build system but which
3680 # chromium does not build cleanly with (when treating warning as errors).
3681 # Things that are part of -Wextra:
3682 '-Wno-extra', # Enabled by -Wextra, but no specific flag
3683 '-Wno-ignored-qualifiers',
3687 # Disabling c++0x-compat should be handled in WebKit, but
3688 # this currently doesn't work because gcc_version is not set
3689 # correctly when building with the Android build system.
3690 # TODO(torne): Fix this in WebKit.
3691 '-Wno-error=c++0x-compat',
3692 # Other things unrelated to -Wextra:
3693 '-Wno-non-virtual-dtor',
3697 ['android_webview_build==1 and chromium_code==0', {
3699 # There is a class of warning which:
3700 # 1) Android always enables and also treats as errors
3701 # 2) Chromium ignores in third party code
3702 # So we re-enable those warnings when building Android.
3704 '-Wno-format-security',
3706 '-Wno-sequence-point',
3709 '-Wno-non-virtual-dtor',
3712 ['target_arch == "arm"', {
3714 # Enable identical code folding to reduce size.
3718 # NOTE: The stlport header include paths below are specified in
3719 # cflags rather than include_dirs because they need to come
3720 # after include_dirs. Think of them like system headers, but
3721 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
3722 # toolchain (circa Gingerbread) will exhibit strange errors.
3723 # The include ordering here is important; change with caution.
3724 ['use_system_stlport==1', {
3726 # For libstdc++/include, which is used by stlport.
3727 '-I<(android_src)/bionic',
3728 '-I<(android_src)/external/stlport/stlport',
3730 }, { # else: use_system_stlport!=1
3732 '-I<(android_stlport_include)',
3735 '-L<(android_stlport_libs_dir)',
3738 ['target_arch=="ia32"', {
3739 # The x86 toolchain currently has problems with stack-protector.
3741 '-fstack-protector',
3744 '-fno-stack-protector',
3748 'target_conditions': [
3749 ['_type=="executable"', {
3752 '-Wl,-dynamic-linker,/system/bin/linker',
3753 '-Wl,--gc-sections',
3754 '-Wl,-z,nocopyreloc',
3755 # crtbegin_dynamic.o should be the last item in ldflags.
3756 '<(android_ndk_lib)/crtbegin_dynamic.o',
3759 # crtend_android.o needs to be the last item in libraries.
3760 # Do not add any libraries after this!
3761 '<(android_ndk_lib)/crtend_android.o',
3774 ['_type=="shared_library" or _type=="loadable_module"', {
3776 '-Wl,-shared,-Bsymbolic',
3779 ['android_webview_build==0', {
3781 # crtbegin_so.o should be the last item in ldflags.
3782 '<(android_ndk_lib)/crtbegin_so.o',
3785 # crtend_so.o needs to be the last item in libraries.
3786 # Do not add any libraries after this!
3787 '<(android_ndk_lib)/crtend_so.o',
3792 # ndk-build copies .a's around the filesystem, breaking
3793 # relative paths in thin archives. Disable using thin
3794 # archives to avoid problems until one of these is fixed:
3795 # http://code.google.com/p/android/issues/detail?id=40302
3796 # http://code.google.com/p/android/issues/detail?id=40303
3797 ['_type=="static_library"', {
3798 'standalone_static_library': 1,
3802 # Settings for building host targets using the system toolchain.
3803 ['_toolset=="host"', {
3805 # Due to issues in Clang build system, using ASan on 32-bit
3806 # binaries on x86_64 host is problematic.
3807 # TODO(eugenis): re-enable.
3808 '-fsanitize=address',
3809 '-w', # http://crbug.com/162783
3812 '-fsanitize=address',
3813 '-Wl,-z,noexecstack',
3814 '-Wl,--gc-sections',
3817 '-Wl,--warn-shared-textrel',
3818 '-Wl,--fatal-warnings',
3821 # Settings for building host targets on mac.
3822 ['_toolset=="host" and host_os=="mac"', {
3832 'cflags!': ['-fvisibility=hidden'],
3833 'cflags_cc!': ['-fvisibility-inlines-hidden'],
3835 ['OS=="mac" or OS=="ios"', {
3836 'target_defaults': {
3839 'ALWAYS_SEARCH_USER_PATHS': 'NO',
3840 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
3841 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
3842 'COPY_PHASE_STRIP': 'NO',
3843 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
3844 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
3845 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
3846 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
3847 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
3848 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
3849 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
3850 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
3851 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
3852 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
3853 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
3854 'GCC_VERSION': '4.2',
3855 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
3856 'USE_HEADERMAP': 'NO',
3861 # Don't warn about unused function parameters.
3862 '-Wno-unused-parameter',
3863 # Don't warn about the "struct foo f = {0};" initialization
3865 '-Wno-missing-field-initializers',
3868 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
3869 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
3871 # Note that the prebuilt Clang binaries should not be used for iOS
3872 # development except for ASan builds.
3874 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
3875 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
3877 # gnu++11 instead of c++11 is needed because some code uses
3878 # typeof() (a GNU extension).
3879 # TODO(thakis): Eventually switch this to c++11 instead of
3880 # gnu++11 (once typeof can be removed, which is blocked on c++11
3881 # being available everywhere).
3882 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', # -std=gnu++11
3883 # Warn if automatic synthesis is triggered with
3884 # the -Wobjc-missing-property-synthesis flag.
3885 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
3886 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
3890 # This warns on using ints as initializers for floats in
3891 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
3892 # which happens in several places in chrome code. Not sure if
3893 # this is worth fixing.
3894 '-Wno-c++11-narrowing',
3896 # Don't die on dtoa code that uses a char as an array index.
3897 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
3898 '-Wno-char-subscripts',
3900 # Clang spots more unused functions.
3901 '-Wno-unused-function',
3903 # Warns on switches on enums that cover all enum values but
3904 # also contain a default: branch. Chrome is full of that.
3905 '-Wno-covered-switch-default',
3907 # Warns when a const char[] is converted to bool.
3908 '-Wstring-conversion',
3910 # Clang considers the `register` keyword as deprecated, but e.g.
3911 # code generated by flex (used in angle) contains that keyword.
3912 # http://crbug.com/255186
3913 '-Wno-deprecated-register',
3915 # This warns about auto_ptr<>, used in third-party code.
3916 '-Wno-deprecated-declarations',
3919 ['clang==1 and clang_use_chrome_plugins==1', {
3921 '<@(clang_chrome_plugins_flags)',
3924 ['clang==1 and clang_load!=""', {
3926 '-Xclang', '-load', '-Xclang', '<(clang_load)',
3929 ['clang==1 and clang_add_plugin!=""', {
3931 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
3934 ['clang==1 and "<(GENERATOR)"=="ninja"', {
3936 # See http://crbug.com/110262
3937 '-fcolor-diagnostics',
3945 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
3951 '-fsanitize=address',
3952 '-w', # http://crbug.com/162783
3956 'ADDRESS_SANITIZER',
3957 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3961 'target_conditions': [
3962 ['_type!="static_library"', {
3963 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
3968 '-fsanitize=address',
3975 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
3976 'target_conditions': [
3977 ['_type=="executable"', {
3983 # Define copy_asan_dylib_path in a variable ending in
3984 # _path so that gyp understands it's a path and
3985 # performs proper relativization during dict merging.
3986 'copy_asan_dylib_path':
3987 'mac/copy_asan_runtime_dylib.sh',
3989 'postbuild_name': 'Copy ASan runtime dylib',
3991 '<(copy_asan_dylib_path)',
4000 ], # target_conditions
4001 }, # target_defaults
4002 }], # OS=="mac" or OS=="ios"
4004 'target_defaults': {
4006 # These should end with %, but there seems to be a bug with % in
4007 # variables that are intended to be set to different values in
4008 # different targets, like these.
4009 'mac_pie': 1, # Most executables can be position-independent.
4010 # Strip debugging symbols from the target.
4011 'mac_strip': '<(mac_strip_release)',
4015 ['mac_want_real_dsym=="default"', {
4018 'mac_real_dsym': '<(mac_want_real_dsym)'
4023 ['mac_want_real_dsym=="default"', {
4024 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
4026 'mac_real_dsym': '<(mac_want_real_dsym)'
4033 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
4034 # (Equivalent to -fPIC)
4035 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
4036 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4037 # Keep pch files below xcodebuild/.
4038 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
4040 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
4041 # xcode_setting, but not until all downstream projects' mac bots are
4042 # using xcode >= 4.6, because that's when the default value of the
4043 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
4044 # setting is a no-op as far as xcode is concerned, but the compiler
4045 # behaves differently based on whether -fno-strict-aliasing is
4047 '-fno-strict-aliasing', # See http://crbug.com/32204.
4050 'target_conditions': [
4051 ['_type=="executable"', {
4054 # Arranges for data (heap) pages to be protected against
4055 # code execution when running on Mac OS X 10.7 ("Lion"), and
4056 # ensures that the position-independent executable (PIE) bit
4057 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
4059 # Define change_mach_o_flags in a variable ending in _path
4060 # so that GYP understands it's a path and performs proper
4061 # relativization during dict merging.
4062 'change_mach_o_flags_path':
4063 'mac/change_mach_o_flags_from_xcode.sh',
4064 'change_mach_o_flags_options%': [
4066 'target_conditions': [
4067 ['mac_pie==0 or release_valgrind_build==1', {
4068 # Don't enable PIE if it's unwanted. It's unwanted if
4069 # the target specifies mac_pie=0 or if building for
4070 # Valgrind, because Valgrind doesn't understand slide.
4071 # See the similar mac_pie/release_valgrind_build check
4073 'change_mach_o_flags_options': [
4079 'postbuild_name': 'Change Mach-O Flags',
4081 '<(change_mach_o_flags_path)',
4082 '>@(change_mach_o_flags_options)',
4089 'asan_saves_file': 'asan.saves',
4092 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
4096 'target_conditions': [
4097 ['mac_pie==1 and release_valgrind_build==0', {
4098 # Turn on position-independence (ASLR) for executables. When
4099 # PIE is on for the Chrome executables, the framework will
4100 # also be subject to ASLR.
4101 # Don't do this when building for Valgrind, because Valgrind
4102 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
4103 # understand slide, and get rid of the Valgrind check.
4106 '-Wl,-pie', # Position-independent executable (MH_PIE)
4112 ['(_type=="executable" or _type=="shared_library" or \
4113 _type=="loadable_module") and mac_strip!=0', {
4114 'target_conditions': [
4115 ['mac_real_dsym == 1', {
4116 # To get a real .dSYM bundle produced by dsymutil, set the
4117 # debug information format to dwarf-with-dsym. Since
4118 # strip_from_xcode will not be used, set Xcode to do the
4119 # stripping as well.
4123 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
4124 'DEPLOYMENT_POSTPROCESSING': 'YES',
4125 'STRIP_INSTALLED_PRODUCT': 'YES',
4126 'target_conditions': [
4127 ['_type=="shared_library" or _type=="loadable_module"', {
4128 # The Xcode default is to strip debugging symbols
4129 # only (-S). Local symbols should be stripped as
4130 # well, which will be handled by -x. Xcode will
4131 # continue to insert -S when stripping even when
4132 # additional flags are added with STRIPFLAGS.
4134 }], # _type=="shared_library" or _type=="loadable_module"
4135 ['_type=="executable"', {
4138 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
4141 }], # _type=="executable" and asan==1
4142 ], # target_conditions
4144 }, # configuration "Release"
4146 }, { # mac_real_dsym != 1
4147 # To get a fast fake .dSYM bundle, use a post-build step to
4148 # produce the .dSYM and strip the executable. strip_from_xcode
4149 # only operates in the Release configuration.
4153 # Define strip_from_xcode in a variable ending in _path
4154 # so that gyp understands it's a path and performs proper
4155 # relativization during dict merging.
4156 'strip_from_xcode_path': 'mac/strip_from_xcode',
4158 'postbuild_name': 'Strip If Needed',
4159 'action': ['<(strip_from_xcode_path)'],
4163 ], # target_conditions
4164 }], # (_type=="executable" or _type=="shared_library" or
4165 # _type=="loadable_module") and mac_strip!=0
4166 ], # target_conditions
4167 }, # target_defaults
4170 'target_defaults': {
4171 'xcode_settings' : {
4172 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4174 # This next block is mostly common with the 'mac' section above,
4175 # but keying off (or setting) 'clang' isn't valid for iOS as it
4176 # also means using Chromium's build of clang.
4178 # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang
4180 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',
4181 # Warn if automatic synthesis is triggered with
4182 # the -Wobjc-missing-property-synthesis flag.
4183 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4186 # Don't die on dtoa code that uses a char as an array index.
4187 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
4188 '-Wno-char-subscripts',
4189 # Clang spots more unused functions.
4190 '-Wno-unused-function',
4191 # See comments on this flag higher up in this file.
4192 '-Wno-unnamed-type-template-args',
4193 # Match OS X clang C++11 warning settings.
4194 '-Wno-c++11-narrowing',
4197 'target_conditions': [
4198 ['_toolset=="host"', {
4200 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
4201 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4207 ['_toolset=="target"', {
4209 # This section should be for overriding host settings. But,
4210 # since we can't negate the iphone deployment target above, we
4211 # instead set it here for target only.
4212 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
4215 ['_type=="executable"', {
4219 'DEPLOYMENT_POSTPROCESSING': 'YES',
4220 'STRIP_INSTALLED_PRODUCT': 'YES',
4225 # Remove dSYM to reduce build time.
4226 'DEBUG_INFORMATION_FORMAT': 'dwarf',
4232 ['chromium_ios_signing', {
4233 # iOS SDK wants everything for device signed.
4234 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
4236 'CODE_SIGNING_REQUIRED': 'NO',
4237 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
4242 ], # target_conditions
4243 }, # target_defaults
4246 'target_defaults': {
4248 '_WIN32_WINNT=0x0602',
4255 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
4256 'WIN32_LEAN_AND_MEAN',
4260 ['buildtype=="Official"', {
4261 # In official builds, targets can self-select an optimization
4262 # level by defining a variable named 'optimize', and setting it
4264 # - "size", optimizes for minimal code size - the default.
4265 # - "speed", optimizes for speed over code size.
4266 # - "max", whole program optimization and link-time code
4267 # generation. This is very expensive and should be used
4270 'optimize%': 'size',
4272 'target_conditions': [
4273 ['optimize=="size"', {
4275 'VCCLCompilerTool': {
4276 # 1, optimizeMinSpace, Minimize Size (/O1)
4277 'Optimization': '1',
4278 # 2, favorSize - Favor small code (/Os)
4279 'FavorSizeOrSpeed': '2',
4284 ['optimize=="speed"', {
4286 'VCCLCompilerTool': {
4287 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
4288 'Optimization': '2',
4289 # 1, favorSpeed - Favor fast code (/Ot)
4290 'FavorSizeOrSpeed': '1',
4295 ['optimize=="max"', {
4297 'VCCLCompilerTool': {
4298 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
4299 'Optimization': '2',
4300 # 1, favorSpeed - Favor fast code (/Ot)
4301 'FavorSizeOrSpeed': '1',
4302 # This implies link time code generation.
4303 'WholeProgramOptimization': 'true',
4311 ['component=="static_library"', {
4313 '_HAS_EXCEPTIONS=0',
4326 'AdditionalLibraryDirectories':
4327 ['<(windows_driver_kit_path)/lib/ATL/i386'],
4329 'VCLibrarianTool': {
4330 'AdditionalLibraryDirectories':
4331 ['<(windows_driver_kit_path)/lib/ATL/i386'],
4337 'VCLibrarianTool': {
4338 'AdditionalLibraryDirectories':
4339 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
4342 'AdditionalLibraryDirectories':
4343 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
4350 # Explicitly required when using the ATL with express
4351 'AdditionalDependencies': ['atlthunk.lib'],
4353 # ATL 8.0 included in WDK 7.1 makes the linker to generate
4354 # almost eight hundred LNK4254 and LNK4078 warnings:
4355 # - warning LNK4254: section 'ATL' (50000040) merged into
4356 # '.rdata' (40000040) with different attributes
4357 # - warning LNK4078: multiple 'ATL' sections found with
4358 # different attributes
4359 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
4362 'msvs_system_include_dirs': [
4363 '<(windows_driver_kit_path)/inc/atl71',
4364 '<(windows_driver_kit_path)/inc/mfc42',
4367 # Workaround for intsafe in 2010 Express + WDK. ATL code uses
4368 # intsafe.h and both intsafe.h and stdint.h define INT8_MIN et al.
4369 # We can't use this workaround in third_party code because it has
4370 # various levels of intolerance for including stdint.h.
4371 ['msvs_express and chromium_code', {
4372 'msvs_system_include_dirs': [
4376 'VCCLCompilerTool': {
4377 'ForcedIncludeFiles': [ 'intsafe_workaround.h', ],
4382 'msvs_system_include_dirs': [
4383 '<(windows_sdk_path)/Include/shared',
4384 '<(windows_sdk_path)/Include/um',
4385 '<(windows_sdk_path)/Include/winrt',
4386 '$(VSInstallDir)/VC/atlmfc/include',
4388 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
4389 'msvs_disabled_warnings': [4351, 4355, 4396, 4503, 4819,
4390 # TODO(maruel): These warnings are level 4. They will be slowly
4391 # removed as code is fixed.
4392 4100, 4121, 4125, 4127, 4130, 4131, 4189, 4201, 4238, 4244, 4245,
4393 4310, 4428, 4481, 4505, 4510, 4512, 4530, 4610, 4611, 4701, 4702,
4397 'VCCLCompilerTool': {
4398 'AdditionalOptions': ['/MP'],
4399 'MinimalRebuild': 'false',
4400 'BufferSecurityCheck': 'true',
4401 'EnableFunctionLevelLinking': 'true',
4402 'RuntimeTypeInfo': 'false',
4403 'WarningLevel': '4',
4404 'WarnAsError': 'true',
4405 'DebugInformationFormat': '3',
4407 ['component=="shared_library"', {
4408 'ExceptionHandling': '1', # /EHsc
4410 'ExceptionHandling': '0',
4414 'VCLibrarianTool': {
4415 'AdditionalOptions': ['/ignore:4221'],
4416 'AdditionalLibraryDirectories': [
4417 '<(windows_sdk_path)/Lib/win8/um/x86',
4421 'AdditionalDependencies': [
4433 'AdditionalLibraryDirectories': [
4434 '<(windows_sdk_path)/Lib/win8/um/x86',
4436 'GenerateDebugInformation': 'true',
4437 'MapFileName': '$(OutDir)\\$(TargetName).map',
4438 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
4439 'FixedBaseAddress': '1',
4442 # 1 == /SUBSYSTEM:CONSOLE
4443 # 2 == /SUBSYSTEM:WINDOWS
4444 # Most of the executables we'll ever create are tests
4445 # and utilities with console output.
4449 'GenerateStublessProxies': 'true',
4450 'TypeLibraryName': '$(InputName).tlb',
4451 'OutputDirectory': '$(IntDir)',
4452 'HeaderFileName': '$(InputName).h',
4453 'DLLDataFileName': '$(InputName).dlldata.c',
4454 'InterfaceIdentifierFileName': '$(InputName)_i.c',
4455 'ProxyFileName': '$(InputName)_p.c',
4457 'VCResourceCompilerTool': {
4459 'AdditionalIncludeDirectories': [
4461 '<(SHARED_INTERMEDIATE_DIR)',
4464 'target_conditions': [
4465 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
4467 'AdditionalManifestFiles': [
4468 '>(win_exe_compatibility_manifest)',
4472 ['_type=="executable" and >(win_use_external_manifest)==0', {
4474 'EmbedManifest': 'true',
4477 ['_type=="executable" and >(win_use_external_manifest)==1', {
4479 'EmbedManifest': 'false',
4486 ['disable_nacl==1', {
4487 'target_defaults': {
4493 ['OS=="win" and msvs_use_common_linker_extras', {
4494 'target_defaults': {
4509 'AdditionalOptions': [
4518 'AdditionalOptions': ['/largeaddressaware'],
4527 'AdditionalOptions': [
4528 # safeseh is not compatible with x64
4540 ['enable_new_npdevice_api==1', {
4541 'target_defaults': {
4543 'ENABLE_NEW_NPDEVICE_API',
4547 # Don't warn about the "typedef 'foo' locally defined but not used"
4549 # TODO: remove this flag once all builds work. See crbug.com/227506
4550 ['gcc_version>=48', {
4551 'target_defaults': {
4553 '-Wno-unused-local-typedefs',
4560 # Android could use the goma with clang.
4561 'make_global_settings': [
4562 ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang)'],
4563 ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang++)'],
4564 ['CC.host', '$(CC)'],
4565 ['CXX.host', '$(CXX)'],
4568 'make_global_settings': [
4569 ['CC', '<(make_clang_dir)/bin/clang'],
4570 ['CXX', '<(make_clang_dir)/bin/clang++'],
4571 ['CC.host', '$(CC)'],
4572 ['CXX.host', '$(CXX)'],
4577 ['OS=="android" and clang==0', {
4578 # Hardcode the compiler names in the Makefile so that
4579 # it won't depend on the environment at make time.
4580 'make_global_settings': [
4581 ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)'],
4582 ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-g++)'],
4583 ['CC.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which gcc))'],
4584 ['CXX.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which g++))'],
4587 ['OS=="linux" and target_arch=="mipsel"', {
4588 'make_global_settings': [
4589 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
4590 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
4591 ['CC.host', '<!(which gcc)'],
4592 ['CXX.host', '<!(which g++)'],
4597 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
4598 # This block adds *project-wide* configuration settings to each project
4599 # file. It's almost always wrong to put things here. Specify your
4600 # custom xcode_settings in target_defaults to add them to targets instead.
4603 # In an Xcode Project Info window, the "Base SDK for All Configurations"
4604 # setting sets the SDK on a project-wide basis. In order to get the
4605 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
4606 # here at the project level.
4609 ['mac_sdk_path==""', {
4610 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
4612 'SDKROOT': '<(mac_sdk_path)', # -isysroot
4618 ['ios_sdk_path==""', {
4620 # TODO(justincohen): Ninja only supports simulator for now.
4621 ['"<(GENERATOR)"=="xcode"', {
4622 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
4624 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
4628 'SDKROOT': '<(ios_sdk_path)', # -isysroot
4633 # Target both iPhone and iPad.
4634 'TARGETED_DEVICE_FAMILY': '1,2',
4635 'VALID_ARCHS': 'armv7 i386',
4637 ['target_arch=="x64"', {
4644 # The Xcode generator will look for an xcode_settings section at the root
4645 # of each dict and use it to apply settings on a file-wide basis. Most
4646 # settings should not be here, they should be in target-specific
4647 # xcode_settings sections, or better yet, should use non-Xcode-specific
4648 # settings in target dicts. SYMROOT is a special case, because many other
4649 # Xcode variables depend on it, including variables such as
4650 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
4651 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
4652 # files to appear (when present) in the UI as actual files and not red
4653 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
4654 # and therefore SYMROOT, needs to be set at the project level.
4655 'SYMROOT': '<(DEPTH)/xcodebuild',