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.
20 # Whether we're building a ChromeOS build.
23 # Whether we are using Views Toolkit
26 # Whether or not we are using the Aura windowing framework.
29 # Whether or not we are building the Ash shell.
32 # Use OpenSSL instead of NSS. Under development: see http://crbug.com/62803
37 # Disable viewport meta tag by default.
38 'enable_viewport%': 0,
40 # Enable HiDPI support.
43 # Enable touch optimized art assets and metrics.
44 'enable_touch_ui%': 0,
46 # Is this change part of the android upstream bringup?
47 # Allows us to *temporarily* disable certain things for
48 # staging. Only set to 1 in a GYP_DEFINES.
49 'android_upstream_bringup%': 0,
51 # Override buildtype to select the desired build flavor.
52 # Dev - everyday build for development/testing
53 # Official - release build (generally implies additional processing)
54 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
55 # conversion is done), some of the things which are now controlled by
56 # 'branding', such as symbol generation, will need to be refactored
57 # based on 'buildtype' (i.e. we don't care about saving symbols for
58 # non-Official # builds).
61 # Copy conditionally-set variables out one scope.
62 'chromeos%': '<(chromeos)',
63 'use_aura%': '<(use_aura)',
64 'use_ash%': '<(use_ash)',
65 'use_openssl%': '<(use_openssl)',
66 'use_ibus%': '<(use_ibus)',
67 'enable_viewport%': '<(enable_viewport)',
68 'enable_hidpi%': '<(enable_hidpi)',
69 'enable_touch_ui%': '<(enable_touch_ui)',
70 'android_upstream_bringup%': '<(android_upstream_bringup)',
71 'buildtype%': '<(buildtype)',
73 # Compute the architecture that we're building on.
75 [ 'OS=="win" or OS=="mac"', {
78 # This handles the Unix platforms for which there is some support.
79 # Anything else gets passed through, which probably won't work very
80 # well; such hosts should pass an explicit target_arch to gyp.
82 '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/")',
85 # Chromeos implies ash.
91 # For now, Windows *AND* Linux builds that |use_aura| should also
92 # imply using ash. This rule should be removed for the future when
93 # both Linux and Windows are using the aura windows without the ash
95 ['use_aura==1 and OS=="win"', {
102 # Set default value of toolkit_views based on OS.
103 ['OS=="win" or chromeos==1 or use_aura==1', {
109 # Enable HiDPI on Mac OS.
114 # Enable touch UI on Metro and Chrome OS.
115 ['OS=="win" or chromeos==1', {
116 'enable_touch_ui%': 1,
121 # Copy conditionally-set variables out one scope.
122 'chromeos%': '<(chromeos)',
123 'host_arch%': '<(host_arch)',
124 'toolkit_views%': '<(toolkit_views)',
125 'use_aura%': '<(use_aura)',
126 'use_ash%': '<(use_ash)',
127 'use_openssl%': '<(use_openssl)',
128 'use_ibus%': '<(use_ibus)',
129 'enable_viewport%': '<(enable_viewport)',
130 'enable_hidpi%': '<(enable_hidpi)',
131 'enable_touch_ui%': '<(enable_touch_ui)',
132 'android_upstream_bringup%': '<(android_upstream_bringup)',
134 # We used to provide a variable for changing how libraries were built.
135 # This variable remains until we can clean up all the users.
136 # This needs to be one nested variables dict in so that dependent
137 # gyp files can make use of it in their outer variables. (Yikes!)
138 # http://code.google.com/p/chromium/issues/detail?id=83308
139 'library%': 'static_library',
141 # Override branding to select the desired branding flavor.
142 'branding%': 'Chromium',
144 'buildtype%': '<(buildtype)',
146 # Default architecture we're building for is the architecture we're
148 'target_arch%': '<(host_arch)',
150 # This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are
151 # are built under a chromium full build (1) or a webkit.org chromium
153 'inside_chromium_build%': 1,
155 # Set to 1 to enable fast builds. It disables debug info for fastest
159 # Set to 1 to enable dcheck in release without having to use the flag.
160 'dcheck_always_on%': 0,
162 # Disable file manager component extension by default.
163 'file_manager_extension%': 0,
166 'python_ver%': '2.6',
168 # Set ARM-v7 compilation flags
171 # Set Neon compilation flags (only meaningful if armv7==1).
174 # The system root for cross-compiles. Default: none.
177 # The system libdir used for this ABI.
178 'system_libdir%': 'lib',
180 # On Linux, we build with sse2 for Chromium builds.
183 # Use libjpeg-turbo as the JPEG codec used by Chromium.
184 'use_libjpeg_turbo%': 1,
186 # Variable 'component' is for cases where we would like to build some
187 # components as dynamic shared libraries but still need variable
188 # 'library' for static libraries.
189 # By default, component is set to whatever library is set to and
190 # it can be overriden by the GYP command line or by ~/.gyp/include.gypi.
191 'component%': 'static_library',
193 # Set to select the Title Case versions of strings in GRD files.
194 'use_titlecase_in_grd_files%': 0,
196 # Use translations provided by volunteers at launchpad.net. This
197 # currently only works on Linux.
198 'use_third_party_translations%': 0,
200 # Remoting compilation is enabled by default. Set to 0 to disable.
203 # Configuration policy is enabled by default. Set to 0 to disable.
204 'configuration_policy%': 1,
206 # Safe browsing is compiled in by default. Set to 0 to disable.
209 # Speech input is compiled in by default. Set to 0 to disable.
212 # Notifications are compiled in by default. Set to 0 to disable.
213 'notifications%' : 1,
215 # If this is set, the clang plugins used on the buildbot will be used.
216 # Run tools/clang/scripts/update.sh to make sure they are compiled.
217 # This causes 'clang_chrome_plugins_flags' to be set.
218 # Has no effect if 'clang' is not set as well.
219 'clang_use_chrome_plugins%': 1,
221 # Enable building with ASAN (Clang's -faddress-sanitizer option).
222 # -faddress-sanitizer only works with clang, but asan=1 implies clang=1
223 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
226 # Set to true to instrument the code with function call logger.
227 # See src/third_party/cygprofile/cyg-profile.cc for details.
228 'order_profiling%': 0,
230 # Use the provided profiled order file to link Chrome image with it.
231 # This makes Chrome faster by better using CPU cache when executing code.
232 # This is known as PGO (profile guided optimization).
233 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
234 'order_text_section%' : "",
236 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
237 # libraries on linux x86-64 and arm, plus ASLR.
240 # Whether one-click signin is enabled or not.
241 'enable_one_click_signin%': 0,
243 # Enable Web Intents support in WebKit.
244 'enable_web_intents%': 1,
246 # Enable Chrome browser extensions
247 'enable_extensions%': 1,
249 # Enable browser automation.
250 'enable_automation%': 1,
252 # Enable printing support and UI.
253 'enable_printing%': 1,
255 # Enable Web Intents web content registration via HTML element
256 # and WebUI managing such registrations.
257 'enable_web_intents_tag%': 0,
259 # Webrtc compilation is enabled by default. Set to 0 to disable.
262 # PPAPI by default does not support plugins making calls off the main
263 # thread. Set to 1 to turn on experimental support for out-of-process
264 # plugins to make call of the main thread.
265 'enable_pepper_threading%': 0,
267 # Include the PPAPI IPC proxy for NaCl. This is a work-in-progress; this
268 # allows us to build this feature locally without it affecting others
269 # working in affected subsystems like base and ipc.
270 'build_ppapi_ipc_proxy_untrusted%': 0,
272 # Enables use of the session service, which is enabled by default.
273 # Support for disabling depends on the platform.
274 'enable_session_service%': 1,
276 # Enables theme support, which is enabled by default. Support for
277 # disabling depends on the platform.
280 # Enables support for background apps.
281 'enable_background%': 1,
283 # Enable the task manager by default.
284 'enable_task_manager%': 1,
286 # Enables support for promo resource service.
287 'enable_promo_resource_service%': 1,
289 # XInput2 multitouch support is disabled by default (use_xi2_mt=0).
290 # Setting to non-zero value enables XI2 MT. When XI2 MT is enabled,
291 # the input value also defines the required XI2 minor minimum version.
292 # For example, use_xi2_mt=2 means XI2.2 or above version is required.
295 # Use of precompiled headers on Windows.
297 # This is on by default in VS 2010, but off by default for VS
298 # 2008 because of complications that it can cause with our
301 # This variable may be explicitly set to 1 (enabled) or 0
302 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
303 # This setting will override the default.
305 # Note that a setting of 1 is probably suitable for most or all
306 # Windows developers using VS 2008, since precompiled headers
307 # provide a build speedup of 20-25%. There are a couple of
308 # small workarounds you may need to use when using VS 2008 (but
310 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
312 'chromium_win_pch%': 0,
314 # Set this to true when building with Clang.
315 # See http://code.google.com/p/chromium/wiki/Clang for details.
318 # Enable plug-in installation by default.
319 'enable_plugin_installation%': 1,
321 # Enable protector service by default.
322 'enable_protector_service%': 1,
324 # Specifies whether to use canvas_skia.cc in place of platform
325 # specific implementations of gfx::Canvas. Affects text drawing in the
327 # TODO(asvitkine): Enable this on all platforms and delete this flag.
328 # http://crbug.com/105550
329 'use_canvas_skia%': 0,
331 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
332 # with one of those tools.
333 'build_for_tool%': '',
335 # Whether tests targets should be run, archived or just have the
336 # dependencies verified. All the tests targets have the '_run' suffix,
337 # e.g. base_unittests_run runs the target base_unittests. The test target
338 # always calls tools/isolate/isolate.py. See the script's --help for more
339 # information and the valid --mode values. Meant to be overriden with
341 # TODO(maruel): Converted the default from 'check' to 'noop' so work can
342 # be done while the builders are being reconfigured to check out test data
344 'test_isolation_mode%': 'noop',
345 # It must not be '<(PRODUCT_DIR)' alone, the '/' is necessary otherwise
346 # gyp will remove duplicate flags, causing isolate.py to be confused.
347 'test_isolation_outdir%': '<(PRODUCT_DIR)/isolate',
349 # Force rlz to use chrome's networking stack.
350 'force_rlz_use_chrome_net%': 1,
352 'platformsdk_path%': '<(DEPTH)/third_party/platformsdk_win7/files',
353 'wix_path%': '<(DEPTH)/third_party/wix',
356 # TODO(epoger): Figure out how to set use_skia=1 for Mac outside of
357 # the 'conditions' clause. Initial attempts resulted in chromium and
358 # webkit disagreeing on its setting.
365 # A flag for POSIX platforms
372 # A flag for BSD platforms
373 ['OS=="freebsd" or OS=="openbsd"', {
380 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
386 # Flags to use X11 on non-Mac POSIX platforms
387 ['OS=="win" or OS=="mac" or OS=="android"', {
395 # Set toolkit_uses_gtk for the Chromium browser on Linux.
396 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_aura==0', {
397 'toolkit_uses_gtk%': 1,
399 'toolkit_uses_gtk%': 0,
402 # We always use skia text rendering in Aura on Windows, since GDI
403 # doesn't agree with our BackingStore.
404 # TODO(beng): remove once skia text rendering is on by default.
405 ['use_aura==1 and OS=="win"', {
406 'enable_skia_text%': 1,
409 # A flag to enable or disable our compile-time dependency
410 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
411 # support will be available. This option is useful
412 # for Linux distributions and for Aura.
413 ['chromeos==1 or use_aura==1', {
414 'use_gnome_keyring%': 0,
416 'use_gnome_keyring%': 1,
419 ['toolkit_views==0 or OS=="mac"', {
420 # GTK+ and Mac wants Title Case strings
421 'use_titlecase_in_grd_files%': 1,
424 # Enable file manager extension on Chrome OS.
426 'file_manager_extension%': 1,
428 'file_manager_extension%': 0,
431 ['OS=="win" or OS=="mac" or (OS=="linux" and use_aura==0)', {
432 'enable_one_click_signin%': 1,
436 'proprietary_codecs%': 1,
440 # Use GPU accelerated cross process image transport by default
441 # on linux builds with the Aura window manager
442 ['use_aura==1 and OS=="linux"', {
443 'ui_compositor_image_transport%': 1,
445 'ui_compositor_image_transport%': 0,
448 # Turn precompiled headers on by default for VS 2010.
449 ['OS=="win" and MSVS_VERSION=="2010" and buildtype!="Official"', {
450 'chromium_win_pch%': 1
453 ['use_aura==1 or chromeos==1 or OS=="android"', {
454 'enable_plugin_installation%': 0,
456 'enable_plugin_installation%': 1,
460 'enable_protector_service%': 0,
462 'enable_protector_service%': 1,
465 # linux_use_gold_binary: whether to use the binary checked into
468 'linux_use_gold_binary%': 1,
470 'linux_use_gold_binary%': 0,
473 # linux_use_gold_flags: whether to use build flags that rely on gold.
474 # On by default for x64 Linux. Temporarily off for ChromeOS as
475 # it failed on a buildbot.
476 ['OS=="linux" and chromeos==0', {
477 'linux_use_gold_flags%': 1,
479 'linux_use_gold_flags%': 0,
483 'enable_captive_portal_detection%': 0,
485 'enable_captive_portal_detection%': 1,
488 # Enable Skia UI text drawing incrementally on different platforms.
489 # http://crbug.com/105550
491 # On Aura, this allows per-tile painting to be used in the browser
493 ['OS!="mac" and OS!="android"', {
494 'use_canvas_skia%': 1,
499 # Copy conditionally-set variables out one scope.
500 'branding%': '<(branding)',
501 'buildtype%': '<(buildtype)',
502 'target_arch%': '<(target_arch)',
503 'host_arch%': '<(host_arch)',
504 'library%': 'static_library',
505 'toolkit_views%': '<(toolkit_views)',
506 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
507 'use_aura%': '<(use_aura)',
508 'use_ash%': '<(use_ash)',
509 'use_openssl%': '<(use_openssl)',
510 'use_ibus%': '<(use_ibus)',
511 'use_nss%': '<(use_nss)',
512 'os_bsd%': '<(os_bsd)',
513 'os_posix%': '<(os_posix)',
514 'use_glib%': '<(use_glib)',
515 'toolkit_uses_gtk%': '<(toolkit_uses_gtk)',
516 'use_skia%': '<(use_skia)',
517 'use_x11%': '<(use_x11)',
518 'use_gnome_keyring%': '<(use_gnome_keyring)',
519 'linux_fpic%': '<(linux_fpic)',
520 'enable_pepper_threading%': '<(enable_pepper_threading)',
521 'build_ppapi_ipc_proxy_untrusted%': '<(build_ppapi_ipc_proxy_untrusted)',
522 'chromeos%': '<(chromeos)',
523 'enable_viewport%': '<(enable_viewport)',
524 'enable_hidpi%': '<(enable_hidpi)',
525 'enable_touch_ui%': '<(enable_touch_ui)',
526 'use_xi2_mt%':'<(use_xi2_mt)',
527 'file_manager_extension%': '<(file_manager_extension)',
528 'inside_chromium_build%': '<(inside_chromium_build)',
529 'fastbuild%': '<(fastbuild)',
530 'dcheck_always_on%': '<(dcheck_always_on)',
531 'python_ver%': '<(python_ver)',
532 'armv7%': '<(armv7)',
533 'arm_neon%': '<(arm_neon)',
534 'sysroot%': '<(sysroot)',
535 'system_libdir%': '<(system_libdir)',
536 'disable_sse2%': '<(disable_sse2)',
537 'component%': '<(component)',
538 'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
539 'use_third_party_translations%': '<(use_third_party_translations)',
540 'remoting%': '<(remoting)',
541 'enable_one_click_signin%': '<(enable_one_click_signin)',
542 'enable_webrtc%': '<(enable_webrtc)',
543 'chromium_win_pch%': '<(chromium_win_pch)',
544 'configuration_policy%': '<(configuration_policy)',
545 'safe_browsing%': '<(safe_browsing)',
546 'input_speech%': '<(input_speech)',
547 'notifications%': '<(notifications)',
548 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
550 'order_profiling%': '<(order_profiling)',
551 'order_text_section%': '<(order_text_section)',
552 'enable_extensions%': '<(enable_extensions)',
553 'enable_web_intents%': '<(enable_web_intents)',
554 'enable_web_intents_tag%': '<(enable_web_intents_tag)',
555 'enable_plugin_installation%': '<(enable_plugin_installation)',
556 'enable_protector_service%': '<(enable_protector_service)',
557 'enable_session_service%': '<(enable_session_service)',
558 'enable_themes%': '<(enable_themes)',
559 'enable_background%': '<(enable_background)',
560 'enable_promo_resource_service%': '<(enable_promo_resource_service)',
561 'linux_use_gold_binary%': '<(linux_use_gold_binary)',
562 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
563 'use_canvas_skia%': '<(use_canvas_skia)',
564 'test_isolation_mode%': '<(test_isolation_mode)',
565 'test_isolation_outdir%': '<(test_isolation_outdir)',
566 'enable_automation%': '<(enable_automation)',
567 'enable_printing%': '<(enable_printing)',
568 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
569 'force_rlz_use_chrome_net%': '<(force_rlz_use_chrome_net)',
570 'enable_task_manager%': '<(enable_task_manager)',
571 'platformsdk_path%': '<(platformsdk_path)',
572 'wix_path%': '<(wix_path)',
573 'android_upstream_bringup%': '<(android_upstream_bringup)',
575 # Use system yasm instead of bundled one.
576 'use_system_yasm%': 0,
578 # Default to enabled PIE; this is important for ASLR but we may need to be
579 # able to turn it off for various reasons.
580 'linux_disable_pie%': 0,
582 # The release channel that this build targets. This is used to restrict
583 # channel-specific build options, like which installer packages to create.
584 # The default is 'all', which does no channel-specific filtering.
587 # Override chromium_mac_pch and set it to 0 to suppress the use of
588 # precompiled headers on the Mac. Prefix header injection may still be
589 # used, but prefix headers will not be precompiled. This is useful when
590 # using distcc to distribute a build to compile slaves that don't
591 # share the same compiler executable as the system driving the compilation,
592 # because precompiled headers rely on pointers into a specific compiler
593 # executable's image. Setting this to 0 is needed to use an experimental
594 # Linux-Mac cross compiler distcc farm.
595 'chromium_mac_pch%': 1,
597 # Mac OS X SDK and deployment target support.
598 # The SDK identifies the version of the system headers that will be used,
599 # and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro.
600 # "Maximum allowed" refers to the operating system version whose APIs are
601 # available in the headers.
602 # The deployment target identifies the minimum system version that the
603 # built products are expected to function on. It corresponds to the
604 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.
605 # To ensure these macros are available, #include <AvailabilityMacros.h>.
606 # Additional documentation on these macros is available at
607 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
608 # Chrome normally builds with the Mac OS X 10.5 SDK and sets the
609 # deployment target to 10.5. Other projects, such as O3D, may override
612 'mac_deployment_target%': '10.5',
614 # The default value for mac_strip in target_defaults. This cannot be
615 # set there, per the comment about variable% in a target_defaults.
616 'mac_strip_release%': 1,
618 # Set to 1 to enable code coverage. In addition to build changes
619 # (e.g. extra CFLAGS), also creates a new target in the src/chrome
620 # project file called "coverage".
621 # Currently ignored on Windows.
624 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
625 # This is useful for parallel compilation tools which can't support /Zi.
626 # Only used on Windows.
629 # Although base/allocator lets you select a heap library via an
630 # environment variable, the libcmt shim it uses sometimes gets in
631 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
632 # 'win_use_allocator_shim': 0,
633 # 'win_release_RuntimeLibrary': 2
634 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
635 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
637 # Whether usage of OpenMAX is enabled.
638 'enable_openmax%': 0,
640 # Whether proprietary audio/video codecs are assumed to be included with
641 # this build (only meaningful if branding!=Chrome).
642 'proprietary_codecs%': 0,
644 # TODO(bradnelson): eliminate this when possible.
645 # To allow local gyp files to prevent release.vsprops from being included.
646 # Yes(1) means include release.vsprops.
647 # Once all vsprops settings are migrated into gyp, this can go away.
648 'msvs_use_common_release%': 1,
650 # TODO(bradnelson): eliminate this when possible.
651 # To allow local gyp files to override additional linker options for msvs.
652 # Yes(1) means set use the common linker options.
653 'msvs_use_common_linker_extras%': 1,
655 # TODO(sgk): eliminate this if possible.
656 # It would be nicer to support this via a setting in 'target_defaults'
657 # in chrome/app/locales/locales.gypi overriding the setting in the
658 # 'Debug' configuration in the 'target_defaults' dict below,
659 # but that doesn't work as we'd like.
660 'msvs_debug_link_incremental%': '2',
662 # Needed for some of the largest modules.
663 'msvs_debug_link_nonincremental%': '1',
665 # Turn on Use Library Dependency Inputs for linking chrome.dll on Windows
666 # to get incremental linking to be faster in debug builds.
667 'incremental_chrome_dll%': '<!(python <(DEPTH)/tools/win/supalink/check_installed.py)',
669 # This is the location of the sandbox binary. Chrome looks for this before
670 # running the zygote process. If found, and SUID, it will be used to
671 # sandbox the zygote process and, thus, all renderer processes.
672 'linux_sandbox_path%': '',
674 # Set this to true to enable SELinux support.
678 'clang%': '<(clang)',
679 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
681 # These two variables can be set in GYP_DEFINES while running
682 # |gclient runhooks| to let clang run a plugin in every compilation.
683 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
685 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
688 'clang_add_plugin%': '',
690 # The default type of gtest.
691 'gtest_target_type%': 'executable',
693 # Enable sampling based profiler.
694 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
697 # Enable strict glibc debug mode.
700 # Override whether we should use Breakpad on Linux. I.e. for Chrome bot.
701 'linux_breakpad%': 0,
702 # And if we want to dump symbols for Breakpad-enabled builds.
703 'linux_dump_symbols%': 0,
704 # And if we want to strip the binary after dumping symbols.
705 'linux_strip_binary%': 0,
706 # Strip the test binaries needed for Linux reliability tests.
707 'linux_strip_reliability_tests%': 0,
710 'linux_use_tcmalloc%': 1,
712 # Disable TCMalloc's debugallocation.
713 'linux_use_debugallocation%': 0,
715 # Disable TCMalloc's heapchecker.
716 'linux_use_heapchecker%': 0,
718 # Disable shadow stack keeping used by heapcheck to unwind the stacks
720 'linux_keep_shadow_stacks%': 0,
722 # Set to 1 to link against libgnome-keyring instead of using dlopen().
723 'linux_link_gnome_keyring%': 0,
724 # Set to 1 to link against gsettings APIs instead of using dlopen().
725 'linux_link_gsettings%': 0,
727 # Set Thumb compilation flags.
730 # Set ARM fpu compilation flags (only meaningful if armv7==1 and
734 # Set ARM float abi compilation flag.
735 'arm_float_abi%': 'softfp',
737 # Enable new NPDevice API.
738 'enable_new_npdevice_api%': 0,
740 # Enable EGLImage support in OpenMAX
741 'enable_eglimage%': 1,
743 # Enable a variable used elsewhere throughout the GYP files to determine
744 # whether to compile in the sources for the GPU plugin / process.
747 # .gyp files or targets should set chromium_code to 1 if they build
748 # Chromium-specific code, as opposed to external code. This variable is
749 # used to control such things as the set of warnings to enable, and
750 # whether warnings are treated as errors.
753 'release_valgrind_build%': 0,
755 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
756 'enable_wexit_time_destructors%': 0,
758 # Set to 1 to compile with the built in pdf viewer.
761 # This allows to use libcros from the current system, ie. /usr/lib/
762 # The cros_api will be pulled in as a static library, and all headers
763 # from the system include dirs.
764 'system_libcros%': 0,
766 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
767 # so Cocoa is happy (http://crbug.com/20441).
769 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
770 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
771 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
772 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
773 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
774 'vi', 'zh-CN', 'zh-TW',
777 # Pseudo locales are special locales which are used for testing and
778 # debugging. They don't get copied to the final app. For more info,
779 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
786 # If debug_devtools is set to 1, JavaScript files for DevTools are
787 # stored as is and loaded from disk. Otherwise, a concatenated file
788 # is stored in resources.pak. It is still possible to load JS files
789 # from disk by passing --debug-devtools cmdline switch.
790 'debug_devtools%': 0,
792 # The Java Bridge is not compiled in by default.
795 # This flag is only used when disable_nacl==0 and disables all those
796 # subcomponents which would require the installation of a native_client
797 # untrusted toolchain.
798 'disable_nacl_untrusted%': 0,
800 # Disable Dart by default.
803 # The desired version of Windows SDK can be set in ~/.gyp/include.gypi.
804 'msbuild_toolset%': '',
806 # Native Client is enabled by default.
809 'platformsdk_exists': '<!(python <(DEPTH)/build/dir_exists.py <(platformsdk_path))',
810 'wix_exists': '<!(python <(DEPTH)/build/dir_exists.py <(wix_path))',
813 ['os_posix==1 and OS!="mac"', {
814 # This will set gcc_version to XY if you are running gcc X.Y.*.
815 # This is used to tweak build flags for gcc 4.4.
816 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
817 # Figure out the python architecture to decide if we build pyauto.
818 'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/<(system_libdir)/libpython<(python_ver).so.1.0)',
820 ['branding=="Chrome"', {
821 'linux_breakpad%': 1,
823 # All Chrome builds have breakpad symbols, but only process the
824 # symbols from official builds.
825 ['(branding=="Chrome" and buildtype=="Official")', {
826 'linux_dump_symbols%': 1,
831 # Location of Android NDK.
834 'android_ndk_root%': '<!(/bin/echo -n $ANDROID_NDK_ROOT)',
835 # Android uses x86 instead of ia32 for their target_arch
837 # TODO(wistoch): Adjust the target_arch naming scheme to avoid
839 # http://crbug.com/125329
841 ['target_arch == "ia32"', {
842 'target_arch': 'x86',
843 'android_app_abi%': 'x86',
845 ['target_arch=="arm" and armv7==0', {
846 'android_app_abi%': 'armeabi',
848 ['target_arch=="arm" and armv7==1', {
849 'android_app_abi%': 'armeabi-v7a',
853 # Switch between different build types, currently only '0' is
855 'android_build_type%': 0,
857 'android_ndk_root%': '<(android_ndk_root)',
858 'android_ndk_sysroot': '<(android_ndk_root)/platforms/android-9/arch-<(target_arch)',
859 'android_build_type%': '<(android_build_type)',
860 'android_app_abi%': '<(android_app_abi)',
862 'android_ndk_root%': '<(android_ndk_root)',
863 'android_ndk_sysroot': '<(android_ndk_sysroot)',
864 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
865 'android_ndk_lib': '<(android_ndk_sysroot)/usr/lib',
866 'android_app_abi%': '<(android_app_abi)',
868 # Provides an absolute path to PRODUCT_DIR (e.g. out/Release). Used
869 # to specify the output directory for Ant in the Android build.
870 'ant_build_out': '`cd <(PRODUCT_DIR) && pwd -P`',
872 # Uses Android's crash report system
873 'linux_breakpad%': 0,
875 # Always uses openssl.
878 'proprietary_codecs%': '<(proprietary_codecs)',
879 'enable_task_manager%': 0,
881 'configuration_policy%': 0,
883 'enable_web_intents%': 0,
884 'enable_extensions%': 0,
885 'enable_automation%': 0,
886 'enable_printing%': 0,
889 # Android does not support themes.
892 # Android does not support background apps.
893 'enable_background%': 0,
895 # Android does not support promo resources service.
896 'enable_promo_resource_service%': 0,
898 # Sessions are store separately in the Java side.
899 'enable_session_service%': 0,
901 # Set to 1 once we have a notification system for Android.
902 # http://crbug.com/115320
905 'gtest_target_type%': '<(gtest_target_type)',
906 # TODO(jrg): when 'gtest_target_type'=='shared_library' and
907 # OS==android, make all gtest_targets depend on
908 # testing/android/native_test.gyp:native_test_apk.
909 ### 'gtest_target_type': 'shared_libary',
911 # Uses system APIs for decoding audio and video.
912 'use_libffmpeg%': '0',
914 # Always use the chromium skia. The use_system_harfbuzz needs to
915 # match use_system_skia.
916 'use_system_skia%': '0',
917 'use_system_harfbuzz%': '0',
919 # Use the system icu.
920 'use_system_icu%': 0,
922 # TODO(yfriedman): Remove once unit_tests can link for Android.
923 # To override it specify:
924 # GYP_DEFINES="$GYP_DEFINES android_unit_test_target_type=executable"
926 'android_unit_test_target_type%': 'static_library',
928 # Choose static link by build type.
930 ['android_build_type==0', {
931 'static_link_system_icu%': 1,
933 'static_link_system_icu%': 0,
936 # Enable to use system sqlite.
937 'use_system_sqlite%': '<(android_build_type)',
938 # Enable to use system libjpeg.
939 'use_system_libjpeg%': '<(android_build_type)',
940 # Enable to use the system libexpat.
941 'use_system_libexpat%': '<(android_build_type)',
942 # Enable to use the system stlport, otherwise statically
944 'use_system_stlport%': '<(android_build_type)',
945 # Copy it out one scope.
946 'android_build_type%': '<(android_build_type)',
949 # Enable clang on mac by default!
951 # Compile in Breakpad support by default so that it can be
952 # tested, even if it is not enabled by default at runtime.
953 'mac_breakpad_compiled_in%': 1,
955 # mac_product_name is set to the name of the .app bundle as it should
956 # appear on disk. This duplicates data from
957 # chrome/app/theme/chromium/BRANDING and
958 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
959 # these names into the build system.
960 ['branding=="Chrome"', {
961 'mac_product_name%': 'Google Chrome',
962 }, { # else: branding!="Chrome"
963 'mac_product_name%': 'Chromium',
966 ['branding=="Chrome" and buildtype=="Official"', {
967 # Enable uploading crash dumps.
968 'mac_breakpad_uploads%': 1,
969 # Enable dumping symbols at build time for use by Mac Breakpad.
971 # Enable Keystone auto-update support.
973 }, { # else: branding!="Chrome" or buildtype!="Official"
974 'mac_breakpad_uploads%': 0,
983 ['component=="shared_library"', {
984 'win_use_allocator_shim%': 0,
986 # Whether to use multiple cores to compile with visual studio. This is
987 # optional because it sometimes causes corruption on VS 2005.
988 # It is on by default on VS 2008 and off on VS 2005.
989 ['MSVS_VERSION=="2005"', {
990 'msvs_multi_core_compile%': 0,
992 'msvs_multi_core_compile%': 1,
994 # Don't do incremental linking for large modules on 32-bit.
995 ['MSVS_OS_BITS==32', {
996 'msvs_large_module_debug_link_mode%': '1', # No
998 'msvs_large_module_debug_link_mode%': '2', # Yes
1000 ['MSVS_VERSION=="2010e" or MSVS_VERSION=="2008e" or MSVS_VERSION=="2005e"', {
1008 'nacl_win64_defines': [
1009 # This flag is used to minimize dependencies when building
1010 # Native Client loader for 64-bit Windows.
1015 ['os_posix==1 and chromeos==0 and OS!="android"', {
1021 # Native Client glibc toolchain is enabled by default except on arm.
1022 ['target_arch=="arm"', {
1023 'disable_glibc%': 1,
1025 'disable_glibc%': 0,
1028 # Set the relative path from this file to the GYP file of the JPEG
1029 # library used by Chromium.
1030 ['use_libjpeg_turbo==1', {
1031 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1033 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1034 }], # use_libjpeg_turbo==1
1036 # Options controlling the use of GConf (the classic GNOME configuration
1037 # system) and GIO, which contains GSettings (the new GNOME config system).
1046 # Set up -D and -E flags passed into grit.
1047 ['branding=="Chrome"', {
1048 # TODO(mmoss) The .grd files look for _google_chrome, but for
1049 # consistency they should look for google_chrome_build like C++.
1050 'grit_defines': ['-D', '_google_chrome',
1051 '-E', 'CHROMIUM_BUILD=google_chrome'],
1053 'grit_defines': ['-D', '_chromium',
1054 '-E', 'CHROMIUM_BUILD=chromium'],
1057 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
1059 ['toolkit_views==1', {
1060 'grit_defines': ['-D', 'toolkit_views'],
1063 'grit_defines': ['-D', 'use_aura'],
1066 'grit_defines': ['-D', 'use_ash'],
1069 'grit_defines': ['-D', 'use_nss'],
1071 ['file_manager_extension==1', {
1072 'grit_defines': ['-D', 'file_manager_extension'],
1075 'grit_defines': ['-D', 'remoting'],
1077 ['use_titlecase_in_grd_files==1', {
1078 'grit_defines': ['-D', 'use_titlecase'],
1080 ['use_third_party_translations==1', {
1081 'grit_defines': ['-D', 'use_third_party_translations'],
1083 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
1084 'ka', 'ku', 'kw', 'ms', 'ug'
1088 'grit_defines': ['-D', 'android'],
1090 ['enable_extensions==1', {
1091 'grit_defines': ['-D', 'enable_extensions'],
1093 ['enable_printing==1', {
1094 'grit_defines': ['-D', 'enable_printing'],
1096 ['clang_use_chrome_plugins==1 and OS!="win"', {
1098 'clang_chrome_plugins_flags': [
1099 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
1104 # TODO(rsleevi): http://crbug.com/123295 - Disabled on ChromeOS
1106 'clang_chrome_plugins_flags': [
1107 '<@(clang_chrome_plugins_flags)',
1109 '-plugin-arg-find-bad-constructs',
1111 'skip-refcounted-dtors'
1114 'clang_chrome_plugins_flags': [
1115 '<@(clang_chrome_plugins_flags)',
1121 ['enable_web_intents_tag==1', {
1122 'grit_defines': ['-D', 'enable_web_intents_tag'],
1127 # Do not use Chrome plugins for Clang. The Clang version in
1128 # third_party/asan may be different from the default one.
1129 'clang_use_chrome_plugins%': 0,
1132 # On valgrind bots, override the optimizer settings so we don't inline too
1133 # much and make the stacks harder to figure out.
1135 # TODO(rnk): Kill off variables that no one else uses and just implement
1136 # them under a build_for_tool== condition.
1137 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
1139 'mac_debug_optimization': '1',
1140 'mac_release_optimization': '1',
1141 'release_optimize': '1',
1142 'no_gc_sections': 1,
1143 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
1144 '-fno-builtin -fno-optimize-sibling-calls',
1145 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
1146 '-fno-builtin -fno-optimize-sibling-calls',
1148 # MSVS flags for TSan on Pin and Windows.
1149 'win_debug_RuntimeChecks': '0',
1150 'win_debug_disable_iterator_debugging': '1',
1151 'win_debug_Optimization': '1',
1152 'win_debug_InlineFunctionExpansion': '0',
1153 'win_release_InlineFunctionExpansion': '0',
1154 'win_release_OmitFramePointers': '0',
1156 'linux_use_tcmalloc': 1,
1157 'release_valgrind_build': 1,
1159 'component': 'static_library',
1160 'use_system_zlib': 0,
1163 # Build tweaks for DrMemory.
1164 # TODO(rnk): Combine with tsan config to share the builder.
1165 # http://crbug.com/108155
1166 ['build_for_tool=="drmemory"', {
1167 # DrMemory can't handle the debug CRT dll, so build static.
1168 'component': 'static_library',
1169 # These runtime checks force initialization of stack vars which blocks
1170 # DrMemory's uninit detection.
1171 'win_debug_RuntimeChecks': '0',
1172 # Iterator debugging is slow.
1173 'win_debug_disable_iterator_debugging': '1',
1174 # Try to disable optimizations that mess up stacks in a release build.
1175 'win_release_InlineFunctionExpansion': '0',
1176 'win_release_OmitFramePointers': '0',
1177 # Keep the code under #ifndef NVALGRIND.
1178 'release_valgrind_build': 1,
1182 # List of default apps to install in new profiles. The first list contains
1183 # the source files as found in svn. The second list, used only for linux,
1184 # contains the destination location for each of the files. When a crx
1185 # is added or removed from the list, the chrome/browser/resources/
1186 # default_apps/external_extensions.json file must also be updated.
1187 'default_apps_list': [
1188 'browser/resources/default_apps/docs.crx',
1189 'browser/resources/default_apps/external_extensions.json',
1190 'browser/resources/default_apps/gmail.crx',
1191 'browser/resources/default_apps/search.crx',
1192 'browser/resources/default_apps/youtube.crx',
1194 'default_apps_list_linux_dest': [
1195 '<(PRODUCT_DIR)/default_apps/docs.crx',
1196 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
1197 '<(PRODUCT_DIR)/default_apps/gmail.crx',
1198 '<(PRODUCT_DIR)/default_apps/search.crx',
1199 '<(PRODUCT_DIR)/default_apps/youtube.crx',
1202 'target_defaults': {
1204 # The condition that operates on chromium_code is in a target_conditions
1205 # section, and will not have access to the default fallback value of
1206 # chromium_code at the top of this file, or to the chromium_code
1207 # variable placed at the root variables scope of .gyp files, because
1208 # those variables are not set at target scope. As a workaround,
1209 # if chromium_code is not set at target scope, define it in target scope
1210 # to contain whatever value it has during early variable expansion.
1211 # That's enough to make it available during target conditional
1213 'chromium_code%': '<(chromium_code)',
1215 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
1216 'mac_release_optimization%': '3', # Use -O3 unless overridden
1217 'mac_debug_optimization%': '0', # Use -O0 unless overridden
1219 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
1220 'win_release_Optimization%': '2', # 2 = /Os
1221 'win_debug_Optimization%': '0', # 0 = /Od
1223 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
1224 # Tri-state: blank is default, 1 on, 0 off
1225 'win_release_OmitFramePointers%': '0',
1226 # Tri-state: blank is default, 1 on, 0 off
1227 'win_debug_OmitFramePointers%': '',
1229 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
1230 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
1232 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
1233 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
1234 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
1236 # VS inserts quite a lot of extra checks to algorithms like
1237 # std::partial_sort in Debug build which make them O(N^2)
1238 # instead of O(N*logN). This is particularly slow under memory
1239 # tools like ThreadSanitizer so we want it to be disablable.
1240 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
1241 'win_debug_disable_iterator_debugging%': '0',
1243 'release_extra_cflags%': '',
1244 'debug_extra_cflags%': '',
1246 'release_valgrind_build%': '<(release_valgrind_build)',
1248 # the non-qualified versions are widely assumed to be *nix-only
1249 'win_release_extra_cflags%': '',
1250 'win_debug_extra_cflags%': '',
1252 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1253 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
1255 # Only used by Windows build for now. Can be used to build into a
1256 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
1257 # output files in src/build/VS2010_{Debug,Release}.
1258 'build_dir_prefix%': '',
1260 # Targets are by default not nacl untrusted code.
1261 'nacl_untrusted_build%': 0,
1264 ['OS=="win" and component=="shared_library"', {
1265 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
1266 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
1267 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
1269 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
1270 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
1271 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
1276 ['OS=="win" and "<(msbuild_toolset)"!=""', {
1277 'msbuild_toolset': '<(msbuild_toolset)',
1279 ['branding=="Chrome"', {
1280 'defines': ['GOOGLE_CHROME_BUILD'],
1281 }, { # else: branding!="Chrome"
1282 'defines': ['CHROMIUM_BUILD'],
1284 ['OS=="mac" and component=="shared_library"', {
1286 'DYLIB_INSTALL_NAME_BASE': '@rpath',
1287 'LD_RUNPATH_SEARCH_PATHS': [
1288 # For unbundled binaries.
1290 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
1291 '@loader_path/../../..',
1295 ['branding=="Chrome" and (OS=="win" or OS=="mac")', {
1296 'defines': ['ENABLE_RLZ'],
1298 ['component=="shared_library"', {
1299 'defines': ['COMPONENT_BUILD'],
1301 ['toolkit_views==1', {
1302 'defines': ['TOOLKIT_VIEWS=1'],
1304 ['ui_compositor_image_transport==1', {
1305 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
1308 'defines': ['USE_AURA=1'],
1311 'defines': ['USE_ASH=1'],
1314 'defines': ['USE_NSS=1'],
1316 ['enable_one_click_signin==1', {
1317 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
1319 ['toolkit_uses_gtk==1 and toolkit_views==0', {
1320 # TODO(erg): We are progressively sealing up use of deprecated features
1321 # in gtk in preparation for an eventual porting to gtk3.
1322 'defines': ['GTK_DISABLE_SINGLE_INCLUDES=1'],
1325 'defines': ['OS_CHROMEOS=1'],
1328 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
1330 ['file_manager_extension==1', {
1331 'defines': ['FILE_MANAGER_EXTENSION=1'],
1334 'defines': ['ENABLE_PROFILING=1'],
1336 ['OS=="linux" and glibcxx_debug==1', {
1337 'defines': ['_GLIBCXX_DEBUG=1',],
1338 'cflags_cc!': ['-fno-rtti'],
1339 'cflags_cc+': ['-frtti', '-g'],
1342 'defines': ['ENABLE_REMOTING=1'],
1344 ['enable_webrtc==1', {
1345 'defines': ['ENABLE_WEBRTC=1'],
1347 ['proprietary_codecs==1', {
1348 'defines': ['USE_PROPRIETARY_CODECS'],
1350 ['enable_pepper_threading==1', {
1351 'defines': ['ENABLE_PEPPER_THREADING'],
1353 ['enable_viewport==1', {
1354 'defines': ['ENABLE_VIEWPORT'],
1356 ['configuration_policy==1', {
1357 'defines': ['ENABLE_CONFIGURATION_POLICY'],
1359 ['input_speech==1', {
1360 'defines': ['ENABLE_INPUT_SPEECH'],
1362 ['notifications==1', {
1363 'defines': ['ENABLE_NOTIFICATIONS'],
1365 ['enable_hidpi==1', {
1366 'defines': ['ENABLE_HIDPI=1'],
1368 ['OS=="android" and gtest_target_type=="shared_library"', {
1369 'defines': ['ANDROID_APK_TEST_TARGET=1'],
1374 # For Windows and Mac, we don't genererate debug information.
1375 ['OS=="win" or OS=="mac"', {
1378 'GenerateDebugInformation': 'false',
1380 'VCCLCompilerTool': {
1381 'DebugInformationFormat': '0',
1385 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
1387 }, { # else: OS != "win", generate less debug information.
1389 'debug_extra_cflags': '-g1',
1392 # Clang creates chubby debug information, which makes linking very
1393 # slow. For now, don't create debug information with clang. See
1394 # http://crbug.com/70000
1395 ['OS=="linux" and clang==1', {
1397 'debug_extra_cflags': '-g0',
1400 ], # conditions for fastbuild.
1402 ['dcheck_always_on!=0', {
1403 'defines': ['DCHECK_ALWAYS_ON=1'],
1404 }], # dcheck_always_on!=0
1406 'defines': ['CHROMIUM_SELINUX=1'],
1408 ['win_use_allocator_shim==0', {
1411 'defines': ['NO_TCMALLOC'],
1420 ['use_openssl==1', {
1425 ['enable_eglimage==1', {
1427 'ENABLE_EGLIMAGE=1',
1439 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
1440 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
1442 # Add -lgcov for types executable, shared_library, and
1443 # loadable_module; not for static_library.
1444 # This is a delayed conditional.
1445 'target_conditions': [
1446 ['_type!="static_library"', {
1447 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
1451 ['OS=="linux" or OS=="android"', {
1452 'cflags': [ '-ftest-coverage',
1454 'link_settings': { 'libraries': [ '-lgcov' ] },
1456 # Finally, for Windows, we simply turn on profiling.
1462 'VCCLCompilerTool': {
1463 # /Z7, not /Zi, so coverage is happyb
1464 'DebugInformationFormat': '1',
1465 'AdditionalOptions': ['/Yd'],
1469 ], # conditions for coverage
1474 '_CRT_SECURE_NO_DEPRECATE',
1475 '_SCL_SECURE_NO_DEPRECATE',
1478 '<(DEPTH)/third_party/wtl/include',
1483 'VCCLCompilerTool': {
1484 'DebugInformationFormat': '1',
1490 ['enable_task_manager==1', {
1492 'ENABLE_TASK_MANAGER=1',
1495 ['enable_web_intents==1', {
1497 'ENABLE_WEB_INTENTS=1',
1500 ['enable_extensions==1', {
1502 'ENABLE_EXTENSIONS=1',
1505 ['OS=="win" and branding=="Chrome"', {
1506 'defines': ['ENABLE_SWIFTSHADER'],
1508 ['enable_dart==1', {
1509 'defines': ['WEBKIT_USING_DART=1'],
1511 ['enable_plugin_installation==1', {
1512 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
1514 ['enable_protector_service==1', {
1515 'defines': ['ENABLE_PROTECTOR_SERVICE=1'],
1517 ['enable_session_service==1', {
1518 'defines': ['ENABLE_SESSION_SERVICE=1'],
1520 ['enable_themes==1', {
1521 'defines': ['ENABLE_THEMES=1'],
1523 ['enable_background==1', {
1524 'defines': ['ENABLE_BACKGROUND=1'],
1526 ['enable_promo_resource_service==1', {
1527 'defines': ['ENABLE_PROMO_RESOURCE_SERVICE=1'],
1529 ['enable_automation==1', {
1530 'defines': ['ENABLE_AUTOMATION=1'],
1532 ['enable_printing==1', {
1533 'defines': ['ENABLE_PRINTING=1'],
1535 ['enable_captive_portal_detection==1', {
1536 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
1538 ], # conditions for 'target_defaults'
1539 'target_conditions': [
1540 ['enable_wexit_time_destructors==1', {
1544 '-Wexit-time-destructors',
1548 '-Wexit-time-destructors',
1554 ['chromium_code==0', {
1556 [ 'os_posix==1 and OS!="mac"', {
1557 # We don't want to get warnings from third-party code,
1558 # so remove any existing warning-enabling flags like -Wall.
1565 # Don't warn about hash_map in third-party code.
1569 # Don't warn about printf format problems.
1570 # This is off by default in gcc but on in Ubuntu's gcc(!).
1574 # TODO(fischman): remove this.
1575 # http://code.google.com/p/chromium/issues/detail?id=90453
1579 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
1581 # Don't warn about ignoring the return value from e.g. close().
1582 # This is off by default in some gccs but on by default in others.
1583 # BSD systems do not support this option, since they are usually
1584 # using gcc 4.2.1, which does not have this flag yet.
1585 '-Wno-unused-result',
1590 '_CRT_SECURE_NO_DEPRECATE',
1591 '_CRT_NONSTDC_NO_WARNINGS',
1592 '_CRT_NONSTDC_NO_DEPRECATE',
1593 '_SCL_SECURE_NO_DEPRECATE',
1595 'msvs_disabled_warnings': [4800],
1597 'VCCLCompilerTool': {
1598 'WarningLevel': '3',
1599 'WarnAsError': 'false', # TODO(maruel): Enable it.
1600 'Detect64BitPortabilityProblems': 'false',
1604 # TODO(darin): Unfortunately, some third_party code depends on base/
1605 [ 'OS=="win" and component=="shared_library"', {
1606 'msvs_disabled_warnings': [
1607 4251, # class 'std::xx' needs to have dll-interface.
1612 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
1615 ['buildtype=="Official"', {
1617 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
1625 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
1626 'filename_rules.gypi',
1628 # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
1629 # C99 macros on Mac and Linux.
1631 '__STDC_FORMAT_MACROS',
1635 # turn on warnings for signed/unsigned mismatch on chromium code.
1637 'VCCLCompilerTool': {
1638 'AdditionalOptions': ['/we4389'],
1642 ['OS=="win" and component=="shared_library"', {
1643 'msvs_disabled_warnings': [
1644 4251, # class 'std::xx' needs to have dll-interface.
1649 ], # target_conditions for 'target_defaults'
1650 'default_configuration': 'Debug',
1652 # VCLinkerTool LinkIncremental values below:
1654 # 1 == /INCREMENTAL:NO
1656 # Debug links incremental, Release does not.
1658 # Abstract base configurations to cover common attributes.
1662 'msvs_configuration_attributes': {
1663 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
1664 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
1665 'CharacterSet': '1',
1672 'TargetMachine': '1',
1675 'msvs_configuration_platform': 'Win32',
1679 'msvs_configuration_platform': 'x64',
1682 'TargetMachine': '17', # x86 - 64
1683 'AdditionalLibraryDirectories!':
1684 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
1685 'AdditionalLibraryDirectories':
1686 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
1688 'VCLibrarianTool': {
1689 'AdditionalLibraryDirectories!':
1690 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
1691 'AdditionalLibraryDirectories':
1692 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
1696 # Not sure if tcmalloc works on 64-bit Windows.
1703 'DYNAMIC_ANNOTATIONS_ENABLED=1',
1704 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
1707 'COPY_PHASE_STRIP': 'NO',
1708 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
1710 '<@(debug_extra_cflags)',
1714 'VCCLCompilerTool': {
1715 'Optimization': '<(win_debug_Optimization)',
1716 'PreprocessorDefinitions': ['_DEBUG'],
1717 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
1718 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
1720 # According to MSVS, InlineFunctionExpansion=0 means
1721 # "default inlining", not "/Ob0".
1722 # Thus, we have to handle InlineFunctionExpansion==0 separately.
1723 ['win_debug_InlineFunctionExpansion==0', {
1724 'AdditionalOptions': ['/Ob0'],
1726 ['win_debug_InlineFunctionExpansion!=""', {
1727 'InlineFunctionExpansion':
1728 '<(win_debug_InlineFunctionExpansion)',
1730 ['win_debug_disable_iterator_debugging==1', {
1731 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
1734 # if win_debug_OmitFramePointers is blank, leave as default
1735 ['win_debug_OmitFramePointers==1', {
1736 'OmitFramePointers': 'true',
1738 ['win_debug_OmitFramePointers==0', {
1739 'OmitFramePointers': 'false',
1740 # The above is not sufficient (http://crbug.com/106711): it
1741 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
1742 # perform FPO regardless, so we must explicitly disable.
1743 # We still want the false setting above to avoid having
1744 # "/Oy /Oy-" and warnings about overriding.
1745 'AdditionalOptions': ['/Oy-'],
1748 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
1751 'LinkIncremental': '<(msvs_debug_link_incremental)',
1752 # ASLR makes debugging with windbg difficult because Chrome.exe and
1753 # Chrome.dll share the same base name. As result, windbg will
1754 # name the Chrome.dll module like chrome_<base address>, where
1755 # <base address> typically changes with each launch. This in turn
1756 # means that breakpoints in Chrome.dll don't stick from one launch
1757 # to the next. For this reason, we turn ASLR off in debug builds.
1758 # Note that this is a three-way bool, where 0 means to pick up
1759 # the default setting, 1 is off and 2 is on.
1760 'RandomizedBaseAddress': 1,
1762 'VCResourceCompilerTool': {
1763 'PreprocessorDefinitions': ['_DEBUG'],
1768 'target_conditions': [
1769 ['_toolset=="target"', {
1771 '<@(debug_extra_cflags)',
1776 ['release_valgrind_build==0', {
1779 '-fstack-protector-all', # Implies -fstack-protector
1791 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
1792 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
1793 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
1796 'VCCLCompilerTool': {
1797 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
1799 # In official builds, each target will self-select
1800 # an optimization level.
1801 ['buildtype!="Official"', {
1802 'Optimization': '<(win_release_Optimization)',
1805 # According to MSVS, InlineFunctionExpansion=0 means
1806 # "default inlining", not "/Ob0".
1807 # Thus, we have to handle InlineFunctionExpansion==0 separately.
1808 ['win_release_InlineFunctionExpansion==0', {
1809 'AdditionalOptions': ['/Ob0'],
1811 ['win_release_InlineFunctionExpansion!=""', {
1812 'InlineFunctionExpansion':
1813 '<(win_release_InlineFunctionExpansion)',
1816 # if win_release_OmitFramePointers is blank, leave as default
1817 ['win_release_OmitFramePointers==1', {
1818 'OmitFramePointers': 'true',
1820 ['win_release_OmitFramePointers==0', {
1821 'OmitFramePointers': 'false',
1822 # The above is not sufficient (http://crbug.com/106711): it
1823 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
1824 # perform FPO regardless, so we must explicitly disable.
1825 # We still want the false setting above to avoid having
1826 # "/Oy /Oy-" and warnings about overriding.
1827 'AdditionalOptions': ['/Oy-'],
1830 'AdditionalOptions': [ '<@(win_release_extra_cflags)', ],
1833 # LinkIncremental is a tri-state boolean, where 0 means default
1834 # (i.e., inherit from parent solution), 1 means false, and
1836 'LinkIncremental': '1',
1837 # This corresponds to the /PROFILE flag which ensures the PDB
1838 # file contains FIXUP information (growing the PDB file by about
1839 # 5%) but does not otherwise alter the output binary. This
1840 # information is used by the Syzygy optimization tool when
1841 # decomposing the release image.
1846 ['msvs_use_common_release', {
1847 'includes': ['release.gypi'],
1849 ['release_valgrind_build==0', {
1852 'DYNAMIC_ANNOTATIONS_ENABLED=0',
1856 'DYNAMIC_ANNOTATIONS_ENABLED=1',
1857 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
1860 ['win_use_allocator_shim==0', {
1861 'defines': ['NO_TCMALLOC'],
1864 'target_conditions': [
1865 ['_toolset=="target"', {
1867 '<@(release_extra_cflags)',
1875 # Concrete configurations
1878 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
1881 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
1885 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
1887 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
1890 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
1897 ['os_posix==1 and OS!="mac"', {
1898 'target_defaults': {
1899 # Enable -Werror by default, but put it in a variable so it can
1900 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
1902 'werror%': '-Werror',
1903 'libraries_for_target%': '',
1906 '_FILE_OFFSET_BITS=64',
1909 '<(werror)', # See note above about the werror variable.
1912 '-fno-strict-aliasing', # See http://crbug.com/32204
1914 # TODO(evan): turn this back on once all the builds work.
1916 # Don't warn about unused function params. We use those everywhere.
1917 '-Wno-unused-parameter',
1918 # Don't warn about the "struct foo f = {0};" initialization pattern.
1919 '-Wno-missing-field-initializers',
1920 # Don't export any symbols (for example, to plugins we dlopen()).
1921 # Note: this is *required* to make some plugins work.
1922 '-fvisibility=hidden',
1927 '-fno-threadsafe-statics',
1928 # Make inline functions have hidden visiblity by default.
1929 # Surprisingly, not covered by -fvisibility=hidden.
1930 '-fvisibility-inlines-hidden',
1931 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
1932 # so we specify it explicitly.
1933 # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it.
1934 # http://code.google.com/p/chromium/issues/detail?id=90453
1938 '-pthread', '-Wl,-z,noexecstack',
1941 '<(libraries_for_target)',
1946 'debug_optimize%': '0',
1952 '-O>(debug_optimize)',
1958 '-fno-omit-frame-pointer',
1962 'target_conditions' : [
1963 ['_toolset=="target"', {
1965 ['OS=="android" and debug_optimize==0 and target_arch=="arm"', {
1967 '-mlong-calls', # Needed when compiling with -O0
1981 'release_optimize%': '2',
1982 # Binaries become big and gold is unable to perform GC
1983 # and remove unused sections for some of test targets
1984 # on 32 bit platform.
1985 # (This is currently observed only in chromeos valgrind bots)
1986 # The following flag is to disable --gc-sections linker
1987 # option for these bots.
1988 'no_gc_sections%': 0,
1990 # TODO(bradnelson): reexamine how this is done if we change the
1991 # expansion of configurations
1992 'release_valgrind_build%': 0,
1995 '-O>(release_optimize)',
1996 # Don't emit the GCC version ident directives, they just end up
1997 # in the .comment section taking up binary size.
1999 # Put data and code in their own sections, so that unused symbols
2000 # can be removed at link time with --gc-sections.
2002 '-ffunction-sections',
2005 # Specifically tell the linker to perform optimizations.
2006 # See http://lwn.net/Articles/192624/ .
2011 ['no_gc_sections==0', {
2013 '-Wl,--gc-sections',
2018 '-fomit-frame-pointer',
2028 '-fno-omit-frame-pointer',
2037 'cflags': ['-fprofile-arcs', '-ftest-coverage'],
2038 'ldflags': ['-fprofile-arcs'],
2041 'cflags': ['-pg', '-g'],
2049 ['target_arch=="ia32"', {
2050 'target_conditions': [
2051 ['_toolset=="target"', {
2053 # Needed so that libs with .s files (e.g. libicudata.a)
2054 # are compatible with the general 32-bit-ness.
2057 # All floating-point computations on x87 happens in 80-bit
2058 # precision. Because the C and C++ language standards allow
2059 # the compiler to keep the floating-point values in higher
2060 # precision than what's specified in the source and doing so
2061 # is more efficient than constantly rounding up to 64-bit or
2062 # 32-bit precision as specified in the source, the compiler,
2063 # especially in the optimized mode, tries very hard to keep
2064 # values in x87 floating-point stack (in 80-bit precision)
2065 # as long as possible. This has important side effects, that
2066 # the real value used in computation may change depending on
2067 # how the compiler did the optimization - that is, the value
2068 # kept in 80-bit is different than the value rounded down to
2069 # 64-bit or 32-bit. There are possible compiler options to
2070 # make this behavior consistent (e.g. -ffloat-store would keep
2071 # all floating-values in the memory, thus force them to be
2072 # rounded to its original precision) but they have significant
2073 # runtime performance penalty.
2075 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
2076 # which keep floating-point values in SSE registers in its
2077 # native precision (32-bit for single precision, and 64-bit
2078 # for double precision values). This means the floating-point
2079 # value used during computation does not change depending on
2080 # how the compiler optimized the code, since the value is
2081 # always kept in its specified precision.
2083 ['branding=="Chromium" and disable_sse2==0', {
2090 # ChromeOS targets Pinetrail, which is sse3, but most of the
2091 # benefit comes from sse2 so this setting allows ChromeOS
2092 # to build on other CPUs. In the future -march=atom would
2093 # help but requires a newer compiler.
2094 ['chromeos==1 and disable_sse2==0', {
2099 # Install packages have started cropping up with
2100 # different headers between the 32-bit and 64-bit
2101 # versions, so we have to shadow those differences off
2102 # and make sure a 32-bit-on-64-bit build picks up the
2104 # For android build, use NDK headers instead of host headers
2105 ['host_arch!="ia32" and OS!="android"', {
2111 # -mmmx allows mmintrin.h to be used for mmx intrinsics.
2112 # video playback is mmx and sse2 optimized.
2123 ['target_arch=="arm"', {
2124 'target_conditions': [
2125 ['_toolset=="target"', {
2127 # The codesourcery arm-2009q3 toolchain warns at that the ABI
2128 # has changed whenever it encounters a varargs function. This
2129 # silences those warnings, as they are not helpful and
2130 # clutter legitimate warnings.
2143 '-mfloat-abi=<(arm_float_abi)',
2147 'cflags': [ '-mfpu=neon', ],
2149 'cflags': [ '-mfpu=<(arm_fpu)', ],
2154 # Most of the following flags are derived from what Android
2155 # uses by default when building for arm, reference for which
2156 # can be found in the following file in the Android NDK:
2157 # toolchains/arm-linux-androideabi-4.4.3/setup.mk
2159 # The tree-sra optimization (scalar replacement for
2160 # aggregates enabling subsequent optimizations) leads to
2161 # invalid code generation when using the Android NDK's
2162 # compiler (r5-r7). This can be verified using
2163 # TestWebKitAPI's WTF.Checked_int8_t test.
2168 ['arm_thumb == 1', {
2169 # Android toolchain doesn't support -mimplicit-it=thumb
2170 'cflags!': [ '-Wa,-mimplicit-it=thumb', ],
2171 'cflags': [ '-mthumb-interwork', ],
2174 # Flags suitable for Android emulator
2202 'target_conditions': [
2203 ['_toolset=="target"', {
2205 '--sysroot=<(sysroot)',
2208 '--sysroot=<(sysroot)',
2215 # Clang spots more unused functions.
2216 '-Wno-unused-function',
2217 # Don't die on dtoa code that uses a char as an array index.
2218 '-Wno-char-subscripts',
2219 # Especially needed for gtest macros using enum values from Mac
2221 # TODO(pkasting): In C++11 this is legal, so this should be
2222 # removed when we change to that. (This is also why we don't
2223 # bother fixing all these cases today.)
2224 '-Wno-unnamed-type-template-args',
2225 # This (rightyfully) complains about 'override', which we use
2227 '-Wno-c++11-extensions',
2229 # Warns on switches on enums that cover all enum values but
2230 # also contain a default: branch. Chrome is full of that.
2231 '-Wno-covered-switch-default',
2234 # Clang doesn't seem to know know this flag.
2238 ['clang==1 and clang_use_chrome_plugins==1', {
2240 '<@(clang_chrome_plugins_flags)',
2243 ['clang==1 and clang_load!=""', {
2245 '-Xclang', '-load', '-Xclang', '<(clang_load)',
2248 ['clang==1 and clang_add_plugin!=""', {
2250 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
2253 ['clang==1 and "<(GENERATOR)"=="ninja"', {
2255 # See http://crbug.com/110262
2256 '-fcolor-diagnostics',
2260 'target_conditions': [
2261 ['_toolset=="target"', {
2263 '-faddress-sanitizer',
2264 '-fno-omit-frame-pointer',
2267 '-faddress-sanitizer',
2270 'ADDRESS_SANITIZER',
2275 ['order_profiling!=0 and (chromeos==1 or OS=="linux")', {
2276 'target_conditions' : [
2277 ['_toolset=="target"', {
2279 '-finstrument-functions',
2284 ['linux_breakpad==1', {
2286 'defines': ['USE_LINUX_BREAKPAD'],
2288 ['linux_use_heapchecker==1', {
2289 'variables': {'linux_use_tcmalloc%': 1},
2290 'defines': ['USE_HEAPCHECKER'],
2292 ['linux_use_tcmalloc==0', {
2293 'defines': ['NO_TCMALLOC'],
2295 ['linux_keep_shadow_stacks==1', {
2296 'defines': ['KEEP_SHADOW_STACKS'],
2298 '-finstrument-functions',
2299 # Allow mmx intrinsics to inline, so that the compiler can expand
2301 '-finstrument-functions-exclude-file-list=mmintrin.h',
2304 ['linux_use_gold_flags==1', {
2306 # Experimentation found that using four linking threads
2307 # saved ~20% of link time.
2308 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
2310 '-Wl,--thread-count=4',
2313 ['release_valgrind_build==0', {
2314 'target_conditions': [
2315 ['_toolset=="target"', {
2317 # There seems to be a conflict of --icf and -pie
2318 # in gold which can generate crashy binaries. As
2319 # a security measure, -pie takes precendence for
2329 ['linux_use_gold_binary==1', {
2332 ['inside_chromium_build==1', {
2333 # We pass the path to gold to the compiler. gyp leaves
2334 # unspecified what the cwd is when running the compiler,
2335 # so the normal gyp path-munging fails us. This hack
2336 # gets the right path.
2337 'gold_path': '<(PRODUCT_DIR)/../../third_party/gold',
2339 'gold_path': '<(PRODUCT_DIR)/../../Source/WebKit/chromium/third_party/gold',
2344 # Put our gold binary in the search path for the linker.
2351 # FreeBSD-specific options; note that most FreeBSD options are set above,
2354 'target_defaults': {
2356 '-Wl,--no-keep-memory',
2360 # Android-specific options; note that most are set above with Linux.
2363 'target_arch%': 'arm', # target_arch in android terms.
2365 # Android uses x86 instead of ia32 for their target_arch designation.
2366 ['target_arch=="ia32"', {
2367 'target_arch%': 'x86',
2369 # Use shared stlport library when system one used.
2370 # Figure this out early since it needs symbols from libgcc.a, so it
2371 # has to be before that in the set of libraries.
2372 ['use_system_stlport==1', {
2373 'android_stlport_library': 'stlport',
2375 'android_stlport_library': 'stlport_static',
2379 # Placing this variable here prevents from forking libvpx, used
2380 # by remoting. Remoting is off, so it needn't built,
2381 # so forking it's deps seems like overkill.
2382 # But this variable need defined to properly run gyp.
2383 # A proper solution is to have an OS==android conditional
2384 # in third_party/libvpx/libvpx.gyp to define it.
2385 'libvpx_path': 'lib/linux/arm',
2387 'target_defaults': {
2388 # Build a Release build by default to match Android build behavior.
2389 # This is typical with Android because Debug builds tend to be much
2390 # larger and run very slowly on constrained devices. It is still
2391 # possible to do a Debug build by specifying BUILDTYPE=Debug on the
2392 # 'make' command line.
2393 'default_configuration': 'Release',
2396 'release_extra_cflags%': '',
2399 'target_conditions': [
2400 # Settings for building device targets using Android's toolchain.
2401 # These are based on the setup.mk file from the Android NDK.
2403 # The NDK Android executable link step looks as follows:
2405 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
2406 # $(PRIVATE_OBJECTS) <-- The .o that we built
2407 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
2408 # $(TARGET_LIBGCC) <-- libgcc.a
2409 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
2410 # $(PRIVATE_LDLIBS) <-- System .so
2411 # $(TARGET_CRTEND_O) <-- crtend.o
2413 # For now the above are approximated for executables by adding
2414 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
2417 # The NDK Android shared library link step looks as follows:
2419 # $(PRIVATE_OBJECTS) <-- The .o that we built
2420 # -l,--whole-archive
2421 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
2422 # -l,--no-whole-archive
2423 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
2424 # $(TARGET_LIBGCC) <-- libgcc.a
2425 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
2426 # $(PRIVATE_LDLIBS) <-- System .so
2428 # For now, assume not need any whole static libs.
2430 # For both executables and shared libraries, add the proper
2431 # libgcc.a to the start of libraries which puts it in the
2432 # proper spot after .o and .a files get linked in.
2434 # TODO: The proper thing to do longer-tem would be proper gyp
2435 # support for a custom link command line.
2436 ['_toolset=="target"', {
2438 '-pthread', # Not supported by Android toolchain.
2441 '-U__linux__', # Don't allow toolchain to claim -D__linux__
2442 '-ffunction-sections',
2445 '-fstack-protector',
2447 '-finline-limit=64',
2448 '-Wa,--noexecstack',
2449 '-Wno-error=non-virtual-dtor', # TODO(michaelbai): Fix warnings.
2450 '<@(release_extra_cflags)',
2451 # Note: This include is in cflags to ensure that it comes after
2452 # all of the includes.
2453 '-I<(android_ndk_include)',
2457 '__GNU_SOURCE=1', # Necessary for clone()
2459 '_STLP_USE_PTR_SPECIALIZATIONS=1',
2462 'ANDROID_BINSIZE_HACK', # Enable temporary hacks to reduce binsize.
2465 '-pthread', # Not supported by Android toolchain.
2469 '-Wl,--no-undefined',
2470 # Don't export symbols from statically linked libraries.
2471 '-Wl,--exclude-libs=ALL',
2474 '-l<(android_stlport_library)',
2475 # Manually link the libgcc.a that the cross compiler uses.
2476 '<!(${ANDROID_TOOLCHAIN}/*-gcc -print-libgcc-file-name)',
2483 ['android_upstream_bringup==1', {
2484 'defines': ['ANDROID_UPSTREAM_BRINGUP=1',],
2486 ['android_build_type==0', {
2488 '--sysroot=<(android_ndk_sysroot)',
2491 ['target_arch == "arm"', {
2493 # Enable identical code folding to reduce size.
2497 # NOTE: The stlport header include paths below are specified in
2498 # cflags rather than include_dirs because they need to come
2499 # after include_dirs. Think of them like system headers, but
2500 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
2501 # toolchain (circa Gingerbread) will exhibit strange errors.
2502 # The include ordering here is important; change with caution.
2503 ['use_system_stlport==0', {
2505 '-I<(android_ndk_root)/sources/cxx-stl/stlport/stlport',
2508 ['target_arch=="arm" and armv7==1', {
2510 '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/armeabi-v7a',
2513 ['target_arch=="arm" and armv7==0', {
2515 '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/armeabi',
2518 ['target_arch=="ia32"', {
2520 '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/x86',
2525 ['target_arch=="ia32"', {
2526 # The x86 toolchain currently has problems with stack-protector.
2528 '-fstack-protector',
2531 '-fno-stack-protector',
2535 'target_conditions': [
2536 ['_type=="executable"', {
2539 '-Wl,-dynamic-linker,/system/bin/linker',
2540 '-Wl,--gc-sections',
2541 '-Wl,-z,nocopyreloc',
2542 # crtbegin_dynamic.o should be the last item in ldflags.
2543 '<(android_ndk_lib)/crtbegin_dynamic.o',
2546 # crtend_android.o needs to be the last item in libraries.
2547 # Do not add any libraries after this!
2548 '<(android_ndk_lib)/crtend_android.o',
2551 ['_type=="shared_library"', {
2553 '-Wl,-shared,-Bsymbolic',
2554 # crtbegin_so.o should be the last item in ldflags.
2555 '<(android_ndk_lib)/crtbegin_so.o',
2558 # crtend_so.o needs to be the last item in libraries.
2559 # Do not add any libraries after this!
2560 '<(android_ndk_lib)/crtend_so.o',
2565 # Settings for building host targets using the system toolchain.
2566 ['_toolset=="host"', {
2568 # Due to issues in Clang build system, using ASan on 32-bit
2569 # binaries on x86_64 host is problematic.
2570 # TODO(eugenis): re-enable.
2571 '-faddress-sanitizer',
2574 '-faddress-sanitizer',
2575 '-Wl,-z,noexecstack',
2576 '-Wl,--gc-sections',
2581 ['exclude', '_android(_unittest)?\\.cc$'],
2582 ['exclude', '(^|/)android/']
2589 'cflags!': ['-fvisibility=hidden'],
2590 'cflags_cc!': ['-fvisibility-inlines-hidden'],
2593 'target_defaults': {
2595 # These should end with %, but there seems to be a bug with % in
2596 # variables that are intended to be set to different values in
2597 # different targets, like these.
2598 'mac_pie': 1, # Most executables can be position-independent.
2599 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
2600 # Strip debugging symbols from the target.
2601 'mac_strip': '<(mac_strip_release)',
2605 'ALWAYS_SEARCH_USER_PATHS': 'NO',
2606 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
2607 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
2608 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
2609 # (Equivalent to -fPIC)
2610 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
2611 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
2612 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
2613 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
2614 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
2615 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
2616 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
2617 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
2618 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
2619 'GCC_VERSION': '4.2',
2620 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
2621 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
2622 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
2623 # Keep pch files below xcodebuild/.
2624 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
2625 'USE_HEADERMAP': 'NO',
2627 '-fno-strict-aliasing', # See http://crbug.com/32204
2633 # Don't warn about unused function parameters.
2634 '-Wno-unused-parameter',
2635 # Don't warn about the "struct foo f = {0};" initialization
2637 '-Wno-missing-field-initializers',
2640 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
2641 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
2644 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
2645 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
2647 # Don't use -Wc++0x-extensions, which Xcode 4 enables by default
2648 # when buliding with clang. This warning is triggered when the
2649 # override keyword is used via the OVERRIDE macro from
2650 # base/compiler_specific.h.
2651 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
2653 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
2656 # Don't die on dtoa code that uses a char as an array index.
2657 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2658 '-Wno-char-subscripts',
2659 # Clang spots more unused functions.
2660 '-Wno-unused-function',
2661 # See comments on this flag higher up in this file.
2662 '-Wno-unnamed-type-template-args',
2663 # This (rightyfully) complains about 'override', which we use
2665 '-Wno-c++11-extensions',
2667 # Warns on switches on enums that cover all enum values but
2668 # also contain a default: branch. Chrome is full of that.
2669 '-Wno-covered-switch-default',
2672 ['clang==1 and clang_use_chrome_plugins==1', {
2674 '<@(clang_chrome_plugins_flags)',
2677 ['clang==1 and clang_load!=""', {
2679 '-Xclang', '-load', '-Xclang', '<(clang_load)',
2682 ['clang==1 and clang_add_plugin!=""', {
2684 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
2687 ['clang==1 and "<(GENERATOR)"=="ninja"', {
2689 # See http://crbug.com/110262
2690 '-fcolor-diagnostics',
2698 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
2704 '-faddress-sanitizer',
2707 '-faddress-sanitizer',
2708 # The symbols below are referenced in the ASan runtime
2709 # library (compiled on OS X 10.6), but may be unavailable
2710 # on the prior OS X versions. Because Chromium is currently
2711 # targeting 10.5.0, we need to explicitly mark these
2712 # symbols as dynamic_lookup.
2713 '-Wl,-U,_malloc_default_purgeable_zone',
2714 '-Wl,-U,_malloc_zone_memalign',
2715 '-Wl,-U,_dispatch_sync_f',
2716 '-Wl,-U,_dispatch_async_f',
2717 '-Wl,-U,_dispatch_barrier_async_f',
2718 '-Wl,-U,_dispatch_group_async_f',
2719 '-Wl,-U,_dispatch_after_f',
2723 'ADDRESS_SANITIZER',
2727 'target_conditions': [
2728 ['_type!="static_library"', {
2729 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
2732 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
2734 ['_type=="executable"', {
2737 # Arranges for data (heap) pages to be protected against
2738 # code execution when running on Mac OS X 10.7 ("Lion"), and
2739 # ensures that the position-independent executable (PIE) bit
2740 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
2742 # Define change_mach_o_flags in a variable ending in _path
2743 # so that GYP understands it's a path and performs proper
2744 # relativization during dict merging.
2745 'change_mach_o_flags_path':
2746 'mac/change_mach_o_flags_from_xcode.sh',
2747 'change_mach_o_flags_options%': [
2749 'target_conditions': [
2750 ['mac_pie==0 or release_valgrind_build==1', {
2751 # Don't enable PIE if it's unwanted. It's unwanted if
2752 # the target specifies mac_pie=0 or if building for
2753 # Valgrind, because Valgrind doesn't understand slide.
2754 # See the similar mac_pie/release_valgrind_build check
2756 'change_mach_o_flags_options': [
2762 'postbuild_name': 'Change Mach-O Flags',
2764 '<(change_mach_o_flags_path)',
2765 '>@(change_mach_o_flags_options)',
2772 'asan_saves_file': 'asan.saves',
2775 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
2779 'target_conditions': [
2780 ['mac_pie==1 and release_valgrind_build==0', {
2781 # Turn on position-independence (ASLR) for executables. When
2782 # PIE is on for the Chrome executables, the framework will
2783 # also be subject to ASLR.
2784 # Don't do this when building for Valgrind, because Valgrind
2785 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
2786 # understand slide, and get rid of the Valgrind check.
2789 '-Wl,-pie', # Position-independent executable (MH_PIE)
2795 ['(_type=="executable" or _type=="shared_library" or \
2796 _type=="loadable_module") and mac_strip!=0', {
2797 'target_conditions': [
2798 ['mac_real_dsym == 1', {
2799 # To get a real .dSYM bundle produced by dsymutil, set the
2800 # debug information format to dwarf-with-dsym. Since
2801 # strip_from_xcode will not be used, set Xcode to do the
2802 # stripping as well.
2806 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
2807 'DEPLOYMENT_POSTPROCESSING': 'YES',
2808 'STRIP_INSTALLED_PRODUCT': 'YES',
2809 'target_conditions': [
2810 ['_type=="shared_library" or _type=="loadable_module"', {
2811 # The Xcode default is to strip debugging symbols
2812 # only (-S). Local symbols should be stripped as
2813 # well, which will be handled by -x. Xcode will
2814 # continue to insert -S when stripping even when
2815 # additional flags are added with STRIPFLAGS.
2817 }], # _type=="shared_library" or _type=="loadable_module"'
2818 ], # target_conditions
2820 }, # configuration "Release"
2822 }, { # mac_real_dsym != 1
2823 # To get a fast fake .dSYM bundle, use a post-build step to
2824 # produce the .dSYM and strip the executable. strip_from_xcode
2825 # only operates in the Release configuration.
2829 # Define strip_from_xcode in a variable ending in _path
2830 # so that gyp understands it's a path and performs proper
2831 # relativization during dict merging.
2832 'strip_from_xcode_path': 'mac/strip_from_xcode',
2834 'postbuild_name': 'Strip If Needed',
2835 'action': ['<(strip_from_xcode_path)'],
2839 ], # target_conditions
2840 }], # (_type=="executable" or _type=="shared_library" or
2841 # _type=="loadable_module") and mac_strip!=0
2842 ], # target_conditions
2843 }, # target_defaults
2846 'target_defaults': {
2848 '_WIN32_WINNT=0x0601',
2855 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
2856 'WIN32_LEAN_AND_MEAN',
2860 ['buildtype=="Official"', {
2861 # In official builds, targets can self-select an optimization
2862 # level by defining a variable named 'optimize', and setting it
2864 # - "size", optimizes for minimal code size - the default.
2865 # - "speed", optimizes for speed over code size.
2866 # - "max", whole program optimization and link-time code
2867 # generation. This is very expensive and should be used
2870 'optimize%': 'size',
2872 'target_conditions': [
2873 ['optimize=="size"', {
2875 'VCCLCompilerTool': {
2876 # 1, optimizeMinSpace, Minimize Size (/O1)
2877 'Optimization': '1',
2878 # 2, favorSize - Favor small code (/Os)
2879 'FavorSizeOrSpeed': '2',
2884 ['optimize=="speed"', {
2886 'VCCLCompilerTool': {
2887 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
2888 'Optimization': '2',
2889 # 1, favorSpeed - Favor fast code (/Ot)
2890 'FavorSizeOrSpeed': '1',
2895 ['optimize=="max"', {
2897 'VCCLCompilerTool': {
2898 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
2899 'Optimization': '2',
2900 # 1, favorSpeed - Favor fast code (/Ot)
2901 'FavorSizeOrSpeed': '1',
2902 # This implies link time code generation.
2903 'WholeProgramOptimization': 'true',
2911 ['component=="static_library"', {
2913 '_HAS_EXCEPTIONS=0',
2916 ['MSVS_VERSION=="2008"', {
2927 'msvs_system_include_dirs': [
2928 '<(DEPTH)/third_party/directxsdk/files/Include',
2929 '<(DEPTH)/third_party/platformsdk_win7/files/Include',
2930 '$(VSInstallDir)/VC/atlmfc/include',
2932 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
2933 'msvs_disabled_warnings': [4351, 4396, 4503, 4819,
2934 # TODO(maruel): These warnings are level 4. They will be slowly
2935 # removed as code is fixed.
2936 4100, 4121, 4125, 4127, 4130, 4131, 4189, 4201, 4238, 4244, 4245,
2937 4310, 4355, 4428, 4481, 4505, 4510, 4512, 4530, 4610, 4611, 4701,
2941 'VCCLCompilerTool': {
2942 'MinimalRebuild': 'false',
2943 'BufferSecurityCheck': 'true',
2944 'EnableFunctionLevelLinking': 'true',
2945 'RuntimeTypeInfo': 'false',
2946 'WarningLevel': '4',
2947 'WarnAsError': 'true',
2948 'DebugInformationFormat': '3',
2950 ['msvs_multi_core_compile', {
2951 'AdditionalOptions': ['/MP'],
2953 ['MSVS_VERSION=="2005e"', {
2954 'AdditionalOptions': ['/w44068'], # Unknown pragma to 4 (ATL)
2956 ['component=="shared_library"', {
2957 'ExceptionHandling': '1', # /EHsc
2959 'ExceptionHandling': '0',
2963 'VCLibrarianTool': {
2964 'AdditionalOptions': ['/ignore:4221'],
2965 'AdditionalLibraryDirectories': [
2966 '<(DEPTH)/third_party/directxsdk/files/Lib/x86',
2967 '<(DEPTH)/third_party/platformsdk_win7/files/Lib',
2971 'AdditionalDependencies': [
2986 # Explicitly required when using the ATL with express
2987 'AdditionalDependencies': [
2991 # ATL 8.0 included in WDK 7.1 makes the linker to generate
2992 # almost eight hundred LNK4254 and LNK4078 warnings:
2993 # - warning LNK4254: section 'ATL' (50000040) merged into
2994 # '.rdata' (40000040) with different attributes
2995 # - warning LNK4078: multiple 'ATL' sections found with
2996 # different attributes
2997 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
2999 ['MSVS_VERSION=="2005e"', {
3000 # Non-express versions link automatically to these
3001 'AdditionalDependencies': [
3011 'AdditionalLibraryDirectories': [
3012 '<(DEPTH)/third_party/directxsdk/files/Lib/x86',
3013 '<(DEPTH)/third_party/platformsdk_win7/files/Lib',
3015 'GenerateDebugInformation': 'true',
3016 'MapFileName': '$(OutDir)\\$(TargetName).map',
3017 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
3018 'FixedBaseAddress': '1',
3021 # 1 == /SUBSYSTEM:CONSOLE
3022 # 2 == /SUBSYSTEM:WINDOWS
3023 # Most of the executables we'll ever create are tests
3024 # and utilities with console output.
3028 'GenerateStublessProxies': 'true',
3029 'TypeLibraryName': '$(InputName).tlb',
3030 'OutputDirectory': '$(IntDir)',
3031 'HeaderFileName': '$(InputName).h',
3032 'DLLDataFileName': '$(InputName).dlldata.c',
3033 'InterfaceIdentifierFileName': '$(InputName)_i.c',
3034 'ProxyFileName': '$(InputName)_p.c',
3036 'VCResourceCompilerTool': {
3038 'AdditionalIncludeDirectories': [
3040 '<(SHARED_INTERMEDIATE_DIR)',
3046 ['disable_nacl==1', {
3047 'target_defaults': {
3053 ['OS=="win" and msvs_use_common_linker_extras', {
3054 'target_defaults': {
3069 'AdditionalOptions': [
3082 'AdditionalOptions': [
3083 # safeseh is not compatible with x64
3095 ['enable_new_npdevice_api==1', {
3096 'target_defaults': {
3098 'ENABLE_NEW_NPDEVICE_API',
3102 ['clang==1 and OS!="android"', {
3103 'make_global_settings': [
3104 ['CC', '<(make_clang_dir)/bin/clang'],
3105 ['CXX', '<(make_clang_dir)/bin/clang++'],
3107 ['CC.host', '$(CC)'],
3108 ['CXX.host', '$(CXX)'],
3109 ['LINK.host', '$(LINK)'],
3112 ['OS=="android" and "<(GENERATOR)"!="ninja"', {
3113 # Hardcode the compiler names in the Makefile so that
3114 # it won't depend on the environment at make time.
3115 'make_global_settings': [
3116 ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN}/*-gcc)'],
3117 ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN}/*-g++)'],
3118 ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN}/*-gcc)'],
3119 ['CC.host', '<!(which gcc)'],
3120 ['CXX.host', '<!(which g++)'],
3121 ['LINK.host', '<!(which g++)'],
3126 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
3127 # This block adds *project-wide* configuration settings to each project
3128 # file. It's almost always wrong to put things here. Specify your
3129 # custom xcode_settings in target_defaults to add them to targets instead.
3131 # In an Xcode Project Info window, the "Base SDK for All Configurations"
3132 # setting sets the SDK on a project-wide basis. In order to get the
3133 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
3134 # here at the project level.
3135 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
3137 # The Xcode generator will look for an xcode_settings section at the root
3138 # of each dict and use it to apply settings on a file-wide basis. Most
3139 # settings should not be here, they should be in target-specific
3140 # xcode_settings sections, or better yet, should use non-Xcode-specific
3141 # settings in target dicts. SYMROOT is a special case, because many other
3142 # Xcode variables depend on it, including variables such as
3143 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
3144 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
3145 # files to appear (when present) in the UI as actual files and not red
3146 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
3147 # and therefore SYMROOT, needs to be set at the project level.
3148 'SYMROOT': '<(DEPTH)/xcodebuild',