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 # Configure the build for small devices. See crbug.com/318413
39 # Copy conditionally-set variables out one scope.
40 'chromeos%': '<(chromeos)',
41 'use_aura%': '<(use_aura)',
42 'use_ash%': '<(use_ash)',
43 'use_cras%': '<(use_cras)',
44 'use_ozone%': '<(use_ozone)',
45 'embedded%': '<(embedded)',
47 # Whether we are using Views Toolkit
50 # Use OpenSSL instead of NSS. Under development: see http://crbug.com/62803
53 # Disable viewport meta tag by default.
54 'enable_viewport%': 0,
56 # Enable HiDPI support.
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"', {
84 # ToT Linux should be aura.
86 # TODO(erg): Merge this into the previous block once compiling with
87 # aura safely implies including ash capabilities.
92 # Whether we're a traditional desktop unix.
93 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
99 # Compute the architecture that we're building on.
100 ['OS=="win" or OS=="mac" or OS=="ios"', {
101 'host_arch%': 'ia32',
103 'host_arch%': '<!(python <(DEPTH)/build/linux/detect_host_arch.py)',
106 # Embedded implies ozone.
112 'use_system_fontconfig%': 0,
114 'use_system_fontconfig%': 1,
118 # Copy conditionally-set variables out one scope.
119 'chromeos%': '<(chromeos)',
120 'desktop_linux%': '<(desktop_linux)',
121 'use_aura%': '<(use_aura)',
122 'use_ash%': '<(use_ash)',
123 'use_cras%': '<(use_cras)',
124 'use_ozone%': '<(use_ozone)',
125 'embedded%': '<(embedded)',
126 'use_openssl%': '<(use_openssl)',
127 'use_system_fontconfig%': '<(use_system_fontconfig)',
128 'enable_viewport%': '<(enable_viewport)',
129 'enable_hidpi%': '<(enable_hidpi)',
130 'buildtype%': '<(buildtype)',
131 'branding%': '<(branding)',
132 'host_arch%': '<(host_arch)',
134 'target_subarch%': '',
136 # This is set when building the Android WebView inside the Android
137 # build system, using the 'android' gyp backend. The WebView code is
138 # still built when this is unset, but builds using the normal chromium
140 'android_webview_build%': 0,
142 # Set ARM architecture version.
145 # Use aurax11 for clipboard implementation. This is true on linux_aura.
146 'use_clipboard_aurax11%': 0,
150 # If no gomadir is set, it uses the default gomadir.
160 # Set default value of toolkit_views based on OS.
161 ['OS=="win" or chromeos==1 or use_aura==1', {
167 # Embedded builds use aura without ash or views.
174 # Set toolkit_uses_gtk for the Chromium browser on Linux.
175 ['desktop_linux==1 and use_aura==0 and use_ozone==0', {
176 'toolkit_uses_gtk%': 1,
178 'toolkit_uses_gtk%': 0,
181 # Enable HiDPI on Mac OS, Chrome OS and Windows.
182 ['OS=="mac" or chromeos==1 or OS=="win"', {
186 # Enable App Launcher on ChromeOS, Windows and OSX.
187 # On Linux, enable App Launcher for the Aura build.
188 ['use_ash==1 or OS=="win" or OS=="mac" or (desktop_linux==1 and use_aura==1)', {
189 'enable_app_list%': 1,
191 'enable_app_list%': 0,
194 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
195 'use_default_render_theme%': 1,
197 'use_default_render_theme%': 0,
201 'use_ozone_evdev%': 1,
203 'use_ozone_evdev%': 0,
206 # Set default gomadir.
208 'gomadir': 'c:\\goma\\goma-win',
210 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
213 # Set the default "target_subarch" on iOS. Valid values are "arm32",
214 # "arm64" and "both" (meaning a fat binary).
216 # TODO(sdefresne): change the default from "arm32" to "both" for
217 # "target_subarch" once http://crbug.com/339477 is fixed.
219 # TODO(sdefresne): set the "target_arch" to "arm" once compilation
220 # of skia has been fixed for simulator. http://crbug.com/342377
222 'target_subarch%': 'arm32',
225 'target_arch%': 'arm',
227 # Default architecture we're building for is the architecture we're
228 # building on, and possibly sub-architecture (for iOS builds).
229 'target_arch%': '<(host_arch)',
234 # Copy conditionally-set variables out one scope.
235 'chromeos%': '<(chromeos)',
236 'host_arch%': '<(host_arch)',
237 'target_arch%': '<(target_arch)',
238 'target_subarch%': '<(target_subarch)',
239 'toolkit_views%': '<(toolkit_views)',
240 'toolkit_uses_gtk%': '<(toolkit_uses_gtk)',
241 'desktop_linux%': '<(desktop_linux)',
242 'use_aura%': '<(use_aura)',
243 'use_ash%': '<(use_ash)',
244 'use_cras%': '<(use_cras)',
245 'use_ozone%': '<(use_ozone)',
246 'use_ozone_evdev%': '<(use_ozone_evdev)',
247 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
248 'embedded%': '<(embedded)',
249 'use_openssl%': '<(use_openssl)',
250 'use_system_fontconfig%': '<(use_system_fontconfig)',
251 'enable_viewport%': '<(enable_viewport)',
252 'enable_hidpi%': '<(enable_hidpi)',
253 'android_webview_build%': '<(android_webview_build)',
254 'use_goma%': '<(use_goma)',
255 'gomadir%': '<(gomadir)',
256 'enable_app_list%': '<(enable_app_list)',
257 'use_default_render_theme%': '<(use_default_render_theme)',
258 'buildtype%': '<(buildtype)',
259 'branding%': '<(branding)',
260 'arm_version%': '<(arm_version)',
262 # Whether content/chrome is using mojo: see http://crbug.com/353602
265 # Set to 1 to enable fast builds. Set to 2 for even faster builds
266 # (it disables debug info for fastest compilation - only for use
267 # on compile-only bots).
270 # Set to 1 to enable dcheck in release.
271 'dcheck_always_on%': 0,
273 # Set to 1 to make a build that disables unshipped tracing events.
274 # Note: this setting is ignored if buildtype=="Official".
275 'tracing_like_official_build%': 0,
277 # Disable image loader component extension by default.
278 'image_loader_extension%': 0,
281 'python_ver%': '2.6',
283 # Set NEON compilation flags.
286 # Detect NEON support at run-time.
287 'arm_neon_optional%': 0,
289 # The system root for cross-compiles. Default: none.
293 # The system libdir used for this ABI.
294 'system_libdir%': 'lib',
296 # Use libjpeg-turbo as the JPEG codec used by Chromium.
297 'use_libjpeg_turbo%': 1,
299 # Use system libjpeg. Note that the system's libjepg will be used even if
300 # use_libjpeg_turbo is set.
301 'use_system_libjpeg%': 0,
303 # By default, component is set to static_library and it can be overriden
304 # by the GYP command line or by ~/.gyp/include.gypi.
305 'component%': 'static_library',
307 # Set to select the Title Case versions of strings in GRD files.
308 'use_titlecase_in_grd_files%': 0,
310 # Use translations provided by volunteers at launchpad.net. This
311 # currently only works on Linux.
312 'use_third_party_translations%': 0,
314 # Remoting compilation is enabled by default. Set to 0 to disable.
317 # Configuration policy is enabled by default. Set to 0 to disable.
318 'configuration_policy%': 1,
320 # Variable safe_browsing is used to control the build time configuration
321 # for safe browsing feature. Safe browsing can be compiled in 3 different
322 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
323 # reporting features without enabling phishing and malware detection. This
324 # is useful to integrate a third party phishing/malware detection to
325 # existing safe browsing logic.
328 # Speech input is compiled in by default. Set to 0 to disable.
331 # Notifications are compiled in by default. Set to 0 to disable.
332 'notifications%' : 1,
334 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
335 # regular builds and 1 for ASan builds.
336 'mac_want_real_dsym%': 'default',
338 # If this is set, the clang plugins used on the buildbot will be used.
339 # Run tools/clang/scripts/update.sh to make sure they are compiled.
340 # This causes 'clang_chrome_plugins_flags' to be set.
341 # Has no effect if 'clang' is not set as well.
342 'clang_use_chrome_plugins%': 1,
344 # Enable building with ASAN (Clang's -fsanitize=address option).
345 # -fsanitize=address only works with clang, but asan=1 implies clang=1
346 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
348 # Enable coverage gathering instrumentation in ASan. This flag also
349 # controls coverage granularity (experimental).
352 # Enable building with SyzyAsan.
353 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
356 # Enable building with LSan (Clang's -fsanitize=leak option).
357 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
358 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
361 # Enable building with TSAN (Clang's -fsanitize=thread option).
362 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
363 # See http://clang.llvm.org/docs/ThreadSanitizer.html
365 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/valgrind/tsan_v2/ignores.txt',
367 # Enable building with MSAN (Clang's -fsanitize=memory option).
368 # MemorySanitizer only works with clang, but msan=1 implies clang=1
369 # See http://clang.llvm.org/docs/MemorySanitizer.html
371 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
373 # Use the dynamic libraries instrumented by one of the sanitizers
374 # instead of the standard system libraries.
375 'use_instrumented_libraries%': 0,
377 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
378 # stdlibc++ as standard library. This is intended to use for instrumented
380 'use_custom_libcxx%': 0,
382 # Use a modified version of Clang to intercept allocated types and sizes
383 # for allocated objects. clang_type_profiler=1 implies clang=1.
384 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
385 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
386 'clang_type_profiler%': 0,
388 # Set to true to instrument the code with function call logger.
389 # See src/third_party/cygprofile/cyg-profile.cc for details.
390 'order_profiling%': 0,
392 # Use the provided profiled order file to link Chrome image with it.
393 # This makes Chrome faster by better using CPU cache when executing code.
394 # This is known as PGO (profile guided optimization).
395 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
396 'order_text_section%' : "",
398 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
399 # libraries on linux x86-64 and arm, plus ASLR.
402 # Whether one-click signin is enabled or not.
403 'enable_one_click_signin%': 0,
405 # Enable Chrome browser extensions
406 'enable_extensions%': 1,
408 # Enable browser automation.
409 'enable_automation%': 1,
412 'enable_google_now%': 1,
414 # Enable printing support and UI. This variable is used to configure
415 # which parts of printing will be built. 0 disables printing completely,
416 # 1 enables it fully, and 2 enables only the codepath to generate a
417 # Metafile (e.g. usually a PDF or EMF) and disables print preview, cloud
419 'enable_printing%': 1,
421 # Set the version of CLD.
422 # 0: Don't specify the version. This option is for the Finch testing.
427 # For CLD2, the size of the tables that should be included in the build
428 # Only evaluated if cld_version == 2.
429 # See third_party/cld_2/cld_2.gyp for more information.
430 # 0: Small tables, lower accuracy
431 # 1: Medium tables, medium accuracy
432 # 2: Large tables, high accuracy
433 'cld2_table_size%': 2,
435 # Enable spell checker.
436 'enable_spellcheck%': 1,
438 # Webrtc compilation is enabled by default. Set to 0 to disable.
441 # Enables use of the session service, which is enabled by default.
442 # Support for disabling depends on the platform.
443 'enable_session_service%': 1,
445 # Enables theme support, which is enabled by default. Support for
446 # disabling depends on the platform.
449 # Enables autofill dialog and associated features; disabled by default.
450 'enable_autofill_dialog%' : 0,
452 # Enables support for background apps.
453 'enable_background%': 1,
455 # Enable the task manager by default.
456 'enable_task_manager%': 1,
458 # Enables used resource whitelist generation; disabled by default.
459 'enable_resource_whitelist_generation%': 0,
461 # Enable FTP support by default.
462 'disable_ftp_support%': 0,
464 # XInput2 multitouch support is enabled by default (use_xi2_mt=2).
465 # Setting to zero value disables XI2 MT. When XI2 MT is enabled,
466 # the input value also defines the required XI2 minor minimum version.
467 # For example, use_xi2_mt=2 means XI2.2 or above version is required.
470 # Use of precompiled headers on Windows.
472 # This variable may be explicitly set to 1 (enabled) or 0
473 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
474 # This setting will override the default.
477 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
479 'chromium_win_pch%': 0,
481 # Set this to true when building with Clang.
482 # See http://code.google.com/p/chromium/wiki/Clang for details.
485 # Enable plug-in installation by default.
486 'enable_plugin_installation%': 1,
488 # Enable PPAPI and NPAPI by default.
489 # TODO(nileshagrawal): Make this flag enable/disable NPAPI as well
490 # as PPAPI; see crbug.com/162667.
491 'enable_plugins%': 1,
493 # Specifies whether to use canvas_skia.cc in place of platform
494 # specific implementations of gfx::Canvas. Affects text drawing in the
496 # TODO(asvitkine): Enable this on all platforms and delete this flag.
497 # http://crbug.com/105550
498 'use_canvas_skia%': 0,
500 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
501 # with one of those tools.
502 'build_for_tool%': '',
504 # If no directory is specified then a temporary directory will be used.
505 'test_isolation_outdir%': '',
506 # True if isolate should fail if the isolate files refer to files
508 'test_isolation_fail_on_missing': 0,
510 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
511 'wix_path%': '<(DEPTH)/third_party/wix',
513 # Managed users are enabled by default.
514 'enable_managed_users%': 1,
516 # Platform natively supports discardable memory.
517 'native_discardable_memory%': 0,
519 # Platform sends memory pressure signals natively.
520 'native_memory_pressure_signals%': 0,
522 'data_reduction_fallback_host%' : '',
523 'data_reduction_dev_host%' : '',
524 'spdy_proxy_auth_origin%' : '',
525 'spdy_proxy_auth_property%' : '',
526 'spdy_proxy_auth_value%' : '',
527 'data_reduction_proxy_probe_url%' : '',
529 'enable_service_discovery%': 0,
530 'enable_hangout_services_extension%': 0,
532 # Enable the Syzygy optimization step.
533 'syzygy_optimize%': 0,
536 # A flag for POSIX platforms
543 # A flag for BSD platforms
544 ['OS=="freebsd" or OS=="openbsd"', {
551 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
557 # libudev usage. This currently only affects the content layer.
558 ['OS=="linux" and embedded==0', {
564 # Flags to use X11 on non-Mac POSIX platforms.
565 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
572 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
578 # Flags to use pango and cairo.
579 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
588 ['OS=="linux" and embedded==0', {
594 # We always use skia text rendering in Aura on Windows, since GDI
595 # doesn't agree with our BackingStore.
596 # TODO(beng): remove once skia text rendering is on by default.
597 ['use_aura==1 and OS=="win"', {
598 'enable_skia_text%': 1,
601 # A flag to enable or disable our compile-time dependency
602 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
603 # support will be available. This option is useful
604 # for Linux distributions and for Aura.
605 ['OS!="linux" or chromeos==1', {
606 'use_gnome_keyring%': 0,
608 'use_gnome_keyring%': 1,
611 ['toolkit_uses_gtk==1 or OS=="mac" or OS=="ios"', {
612 # GTK+, Mac and iOS want Title Case strings
613 'use_titlecase_in_grd_files%': 1,
616 # Enable loader extensions on Chrome OS.
618 'image_loader_extension%': 1,
620 'image_loader_extension%': 0,
623 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
624 'enable_one_click_signin%': 1,
628 'enable_automation%': 0,
629 'enable_extensions%': 0,
630 'enable_google_now%': 0,
632 'enable_spellcheck%': 0,
636 'arm_neon_optional%': 1,
637 'native_discardable_memory%': 1,
638 'native_memory_pressure_signals%': 1,
639 'enable_printing%': 2,
640 'enable_task_manager%':0,
641 # Set to 1 once we have a notification system for Android.
642 # http://crbug.com/115320
646 # Android OS includes support for proprietary codecs regardless of
647 # building Chromium or Google Chrome. We also ship Google Chrome with
648 # proprietary codecs.
649 ['OS=="android" or branding=="Chrome"', {
650 'proprietary_codecs%': 1,
652 'proprietary_codecs%': 0,
655 ['OS=="mac" or OS=="ios"', {
656 'native_discardable_memory%': 1,
657 'native_memory_pressure_signals%': 1,
660 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
661 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
662 'enable_autofill_dialog%': 1
665 ['OS=="android" and android_webview_build==0', {
669 # Disable WebRTC for building WebView as part of Android system.
670 # TODO(boliu): Decide if we want WebRTC, and if so, also merge
671 # the necessary third_party repositories.
672 ['OS=="android" and android_webview_build==1', {
677 'disable_ftp_support%': 1,
678 'enable_automation%': 0,
679 'enable_extensions%': 0,
680 'enable_google_now%': 0,
682 'enable_printing%': 0,
683 'enable_session_service%': 0,
689 'enable_managed_users%': 0,
690 'enable_task_manager%': 0,
693 # Use GPU accelerated cross process image transport by default
694 # on linux builds with the Aura window manager
695 ['use_aura==1 and OS=="linux"', {
696 'ui_compositor_image_transport%': 1,
698 'ui_compositor_image_transport%': 0,
701 # Turn precompiled headers on by default.
702 ['OS=="win" and buildtype!="Official"', {
703 'chromium_win_pch%': 1
706 ['chromeos==1 or OS=="android" or OS=="ios"', {
707 'enable_plugin_installation%': 0,
709 'enable_plugin_installation%': 1,
712 ['OS=="android" or OS=="ios" or embedded==1', {
713 'enable_plugins%': 0,
715 'enable_plugins%': 1,
718 # linux_use_gold_binary: whether to use the binary checked into
719 # third_party/gold. Gold is not used for 32-bit linux builds
720 # as it runs out of address space.
721 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
722 'linux_use_gold_binary%': 1,
724 'linux_use_gold_binary%': 0,
727 # linux_use_gold_flags: whether to use build flags that rely on gold.
728 # On by default for x64 Linux. Temporarily off for ChromeOS as
729 # it failed on a buildbot.
730 ['OS=="linux" and target_arch=="x64" and chromeos==0', {
731 'linux_use_gold_flags%': 1,
733 'linux_use_gold_flags%': 0,
736 ['OS=="android" or OS=="ios"', {
737 'enable_captive_portal_detection%': 0,
739 'enable_captive_portal_detection%': 1,
742 # Enable Skia UI text drawing incrementally on different platforms.
743 # http://crbug.com/105550
745 # On Aura, this allows per-tile painting to be used in the browser
748 'use_canvas_skia%': 1,
752 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
753 'use_libjpeg_turbo%': 0,
757 # When building as part of the Android system, use system libraries
758 # where possible to reduce ROM size.
759 'use_system_libjpeg%': '<(android_webview_build)',
762 # Do not enable the Settings App on ChromeOS.
763 ['enable_app_list==1 and chromeos==0', {
764 'enable_settings_app%': 1,
766 'enable_settings_app%': 0,
769 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
770 # Set some defaults for arm/linux chrome builds
771 # TODO(dmikurube): Change the default of use_allocator to "none".
772 # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
773 'linux_use_tcmalloc%': 0,
774 'use_allocator%': 'see_use_tcmalloc',
775 # sysroot needs to be an absolute path otherwise it generates
776 # incorrect results when passed to pkg-config
777 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot',
778 }], # OS=="linux" and target_arch=="arm" and chromeos==0
780 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
782 ['target_arch=="x64"', {
783 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
785 ['target_arch=="ia32"', {
786 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
789 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
791 ['OS=="linux" and target_arch=="mipsel"', {
792 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
793 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
796 # Whether tests targets should be run, archived or just have the
797 # dependencies verified. All the tests targets have the '_run' suffix,
798 # e.g. base_unittests_run runs the target base_unittests. The test
799 # target always calls tools/swarming_client/isolate.py. See the script's
800 # --help for more information and the valid --mode values. Meant to be
801 # overriden with GYP_DEFINES.
802 # TODO(maruel): Remove the conditions as more configurations are
804 # NOTE: The check for disable_nacl==0 and component=="static_library"
805 # can't be used here because these variables are not defined yet, but it
806 # is still not supported.
807 ['OS!="ios" and OS!="android" and chromeos==0', {
808 'test_isolation_mode%': 'check',
810 'test_isolation_mode%': 'noop',
812 # Whether Android ARM or x86 build uses OpenMAX DL FFT.
813 ['OS=="android" and ((target_arch=="arm" and arm_version >= 7) or target_arch=="ia32" or target_arch=="x64") and android_webview_build==0', {
814 # Currently only supported on Android ARMv7+, ia32 or x64
815 # without webview. When enabled, this will also enable
816 # WebAudio support on Android ARM, ia32 and x64. Default is
817 # enabled. Whether WebAudio is actually available depends
818 # on runtime settings and flags.
819 'use_openmax_dl_fft%': 1,
821 'use_openmax_dl_fft%': 0,
823 ['OS=="win" or OS=="linux"', {
827 # Turns on compiler optimizations in V8 in Debug build, except
828 # on android_clang, where we're hitting a weird linker error.
829 # TODO(dpranke): http://crbug.com/266155 .
831 'v8_optimized_debug%': 1,
833 'v8_optimized_debug%': 2,
836 # Disable various features by default on embedded.
839 'enable_printing%': 0,
842 ['OS=="win" or (OS=="linux" and chromeos==0)', {
846 # By default, use ICU data file (icudtl.dat) on all platforms
847 # except when building Android WebView.
848 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
849 ['android_webview_build==0', {
850 'icu_use_data_file_flag%' : 1,
852 'icu_use_data_file_flag%' : 0,
856 # Set this to 1 to enable use of concatenated impulse responses
857 # for the HRTF panner in WebAudio.
858 'use_concatenated_impulse_responses': 1,
860 # You can set the variable 'use_official_google_api_keys' to 1
861 # to use the Google-internal file containing official API keys
862 # for Google Chrome even in a developer build. Setting this
863 # variable explicitly to 1 will cause your build to fail if the
864 # internal file is missing.
866 # The variable is documented here, but not handled in this file;
867 # see //google_apis/determine_use_official_keys.gypi for the
870 # Set the variable to 0 to not use the internal file, even when
871 # it exists in your checkout.
873 # Leave it unset in your include.gypi to have the variable
874 # implicitly set to 1 if you have
875 # src/google_apis/internal/google_chrome_api_keys.h in your
876 # checkout, and implicitly set to 0 if not.
878 # Note that official builds always behave as if the variable
879 # was explicitly set to 1, i.e. they always use official keys,
880 # and will fail to build if the internal file is missing.
882 # NOTE: You MUST NOT explicitly set the variable to 2 in your
883 # include.gypi or by other means. Due to subtleties of GYP, this
884 # is not the same as leaving the variable unset, even though its
886 # //google_apis/determine_use_official_keys.gypi is 2.
888 # Set these to bake the specified API keys and OAuth client
889 # IDs/secrets into your build.
891 # If you create a build without values baked in, you can instead
892 # set environment variables to provide the keys at runtime (see
893 # src/google_apis/google_api_keys.h for details). Features that
894 # require server-side APIs may fail to work if no keys are
897 # Note that if you are building an official build or if
898 # use_official_google_api_keys has been set to 1 (explicitly or
899 # implicitly), these values will be ignored and the official
900 # keys will be used instead.
901 'google_api_key%': '',
902 'google_default_client_id%': '',
903 'google_default_client_secret%': '',
906 # Copy conditionally-set variables out one scope.
907 'branding%': '<(branding)',
908 'buildtype%': '<(buildtype)',
909 'target_arch%': '<(target_arch)',
910 'target_subarch%': '<(target_subarch)',
911 'host_arch%': '<(host_arch)',
912 'toolkit_views%': '<(toolkit_views)',
913 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
914 'use_aura%': '<(use_aura)',
915 'use_ash%': '<(use_ash)',
916 'use_cras%': '<(use_cras)',
917 'use_mojo%': '<(use_mojo)',
918 'use_openssl%': '<(use_openssl)',
919 'use_nss%': '<(use_nss)',
920 'use_udev%': '<(use_udev)',
921 'os_bsd%': '<(os_bsd)',
922 'os_posix%': '<(os_posix)',
923 'use_dbus%': '<(use_dbus)',
924 'use_glib%': '<(use_glib)',
925 'use_pango%': '<(use_pango)',
926 'use_cairo%': '<(use_cairo)',
927 'use_ozone%': '<(use_ozone)',
928 'use_ozone_evdev%': '<(use_ozone_evdev)',
929 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
930 'use_system_fontconfig%': '<(use_system_fontconfig)',
931 'toolkit_uses_gtk%': '<(toolkit_uses_gtk)',
932 'desktop_linux%': '<(desktop_linux)',
933 'use_x11%': '<(use_x11)',
934 'use_gnome_keyring%': '<(use_gnome_keyring)',
935 'linux_fpic%': '<(linux_fpic)',
936 'chromeos%': '<(chromeos)',
937 'enable_viewport%': '<(enable_viewport)',
938 'enable_hidpi%': '<(enable_hidpi)',
939 'use_xi2_mt%':'<(use_xi2_mt)',
940 'image_loader_extension%': '<(image_loader_extension)',
941 'fastbuild%': '<(fastbuild)',
942 'dcheck_always_on%': '<(dcheck_always_on)',
943 'tracing_like_official_build%': '<(tracing_like_official_build)',
944 'python_ver%': '<(python_ver)',
945 'arm_version%': '<(arm_version)',
946 'arm_neon%': '<(arm_neon)',
947 'arm_neon_optional%': '<(arm_neon_optional)',
948 'sysroot%': '<(sysroot)',
949 'chroot_cmd%': '<(chroot_cmd)',
950 'system_libdir%': '<(system_libdir)',
951 'component%': '<(component)',
952 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
953 'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
954 'use_third_party_translations%': '<(use_third_party_translations)',
955 'remoting%': '<(remoting)',
956 'enable_one_click_signin%': '<(enable_one_click_signin)',
957 'enable_webrtc%': '<(enable_webrtc)',
958 'chromium_win_pch%': '<(chromium_win_pch)',
959 'configuration_policy%': '<(configuration_policy)',
960 'safe_browsing%': '<(safe_browsing)',
961 'input_speech%': '<(input_speech)',
962 'notifications%': '<(notifications)',
963 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
964 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
966 'asan_coverage%': '<(asan_coverage)',
967 'syzyasan%': '<(syzyasan)',
968 'syzygy_optimize%': '<(syzygy_optimize)',
971 'msan_blacklist%': '<(msan_blacklist)',
973 'tsan_blacklist%': '<(tsan_blacklist)',
974 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
975 'use_custom_libcxx%': '<(use_custom_libcxx)',
976 'clang_type_profiler%': '<(clang_type_profiler)',
977 'order_profiling%': '<(order_profiling)',
978 'order_text_section%': '<(order_text_section)',
979 'enable_extensions%': '<(enable_extensions)',
980 'enable_plugin_installation%': '<(enable_plugin_installation)',
981 'enable_plugins%': '<(enable_plugins)',
982 'enable_session_service%': '<(enable_session_service)',
983 'enable_themes%': '<(enable_themes)',
984 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
985 'enable_background%': '<(enable_background)',
986 'linux_use_gold_binary%': '<(linux_use_gold_binary)',
987 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
988 'use_canvas_skia%': '<(use_canvas_skia)',
989 'test_isolation_mode%': '<(test_isolation_mode)',
990 'test_isolation_outdir%': '<(test_isolation_outdir)',
991 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
992 'enable_automation%': '<(enable_automation)',
993 'enable_printing%': '<(enable_printing)',
994 'enable_spellcheck%': '<(enable_spellcheck)',
995 'enable_google_now%': '<(enable_google_now)',
996 'cld_version%': '<(cld_version)',
997 'cld2_table_size%': '<(cld2_table_size)',
998 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
999 'disable_ftp_support%': '<(disable_ftp_support)',
1000 'enable_task_manager%': '<(enable_task_manager)',
1001 'sas_dll_path%': '<(sas_dll_path)',
1002 'wix_path%': '<(wix_path)',
1003 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1004 'use_system_libjpeg%': '<(use_system_libjpeg)',
1005 'android_webview_build%': '<(android_webview_build)',
1006 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1007 'gyp_managed_install%': 0,
1008 'create_standalone_apk%': 1,
1009 'enable_app_list%': '<(enable_app_list)',
1010 'use_default_render_theme%': '<(use_default_render_theme)',
1011 'enable_settings_app%': '<(enable_settings_app)',
1012 'google_api_key%': '<(google_api_key)',
1013 'google_default_client_id%': '<(google_default_client_id)',
1014 'google_default_client_secret%': '<(google_default_client_secret)',
1015 'enable_managed_users%': '<(enable_managed_users)',
1016 'native_discardable_memory%': '<(native_discardable_memory)',
1017 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1018 'data_reduction_fallback_host%': '<(data_reduction_fallback_host)',
1019 'data_reduction_dev_host%': '<(data_reduction_dev_host)',
1020 'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)',
1021 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1022 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1023 'data_reduction_proxy_probe_url%': '<(data_reduction_proxy_probe_url)',
1024 'enable_mdns%' : '<(enable_mdns)',
1025 'enable_service_discovery%' : '<(enable_service_discovery)',
1026 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1027 'v8_optimized_debug%': '<(v8_optimized_debug)',
1028 'proprietary_codecs%': '<(proprietary_codecs)',
1029 'use_goma%': '<(use_goma)',
1030 'gomadir%': '<(gomadir)',
1032 # Use system protobuf instead of bundled one.
1033 'use_system_protobuf%': 0,
1035 # Use system yasm instead of bundled one.
1036 'use_system_yasm%': 0,
1038 # Use system ICU instead of bundled one.
1039 'use_system_icu%' : 0,
1041 # Default to enabled PIE; this is important for ASLR but we may need to be
1042 # able to turn it off for various reasons.
1043 'linux_disable_pie%': 0,
1045 # The release channel that this build targets. This is used to restrict
1046 # channel-specific build options, like which installer packages to create.
1047 # The default is 'all', which does no channel-specific filtering.
1050 # Override chromium_mac_pch and set it to 0 to suppress the use of
1051 # precompiled headers on the Mac. Prefix header injection may still be
1052 # used, but prefix headers will not be precompiled. This is useful when
1053 # using distcc to distribute a build to compile slaves that don't
1054 # share the same compiler executable as the system driving the compilation,
1055 # because precompiled headers rely on pointers into a specific compiler
1056 # executable's image. Setting this to 0 is needed to use an experimental
1057 # Linux-Mac cross compiler distcc farm.
1058 'chromium_mac_pch%': 1,
1060 # The default value for mac_strip in target_defaults. This cannot be
1061 # set there, per the comment about variable% in a target_defaults.
1062 'mac_strip_release%': 0,
1064 # Set to 1 to enable java code coverage. Instruments classes during build
1065 # to produce .ec files during runtime.
1066 'emma_coverage%': 0,
1068 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1069 # separated with whitespace and/or comma. Only has effect if
1070 # 'emma_coverage=1'.
1073 # Set to 1 to enable running Android lint on java/class files.
1076 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
1077 # This is useful for parallel compilation tools which can't support /Zi.
1078 # Only used on Windows.
1081 # Although base/allocator lets you select a heap library via an
1082 # environment variable, the libcmt shim it uses sometimes gets in
1083 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1084 # 'win_use_allocator_shim': 0,
1085 # 'win_release_RuntimeLibrary': 2
1086 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1087 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1089 # TODO(bradnelson): eliminate this when possible.
1090 # To allow local gyp files to prevent release.vsprops from being included.
1091 # Yes(1) means include release.vsprops.
1092 # Once all vsprops settings are migrated into gyp, this can go away.
1093 'msvs_use_common_release%': 1,
1095 # TODO(bradnelson): eliminate this when possible.
1096 # To allow local gyp files to override additional linker options for msvs.
1097 # Yes(1) means set use the common linker options.
1098 'msvs_use_common_linker_extras%': 1,
1100 # TODO(sgk): eliminate this if possible.
1101 # It would be nicer to support this via a setting in 'target_defaults'
1102 # in chrome/app/locales/locales.gypi overriding the setting in the
1103 # 'Debug' configuration in the 'target_defaults' dict below,
1104 # but that doesn't work as we'd like.
1105 'msvs_debug_link_incremental%': '2',
1107 # Needed for some of the largest modules.
1108 'msvs_debug_link_nonincremental%': '1',
1110 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1111 # to get incremental linking to be faster in debug builds.
1112 'incremental_chrome_dll%': '0',
1114 # Experimental setting to break chrome.dll into multiple pieces based on
1116 'chrome_multiple_dll%': '0',
1118 # Experimental setting to optimize Chrome's DLLs with PGO.
1119 'chrome_pgo_phase%': '0',
1121 # The default settings for third party code for treating
1122 # warnings-as-errors. Ideally, this would not be required, however there
1123 # is some third party code that takes a long time to fix/roll. So, this
1124 # flag allows us to have warnings as errors in general to prevent
1125 # regressions in most modules, while working on the bits that are
1127 'win_third_party_warn_as_error%': 'true',
1130 'clang%': '<(clang)',
1131 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
1133 # Control which version of clang to use when building for iOS. If set to
1134 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1135 # the version of clang that ships with the Chromium source. This variable
1136 # is automatically set to '1' when using the Xcode generator.
1139 # These two variables can be set in GYP_DEFINES while running
1140 # |gclient runhooks| to let clang run a plugin in every compilation.
1141 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1143 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1146 'clang_add_plugin%': '',
1148 # Tell ld64 to write map files describing binary layout. Useful
1149 # for looking at what contributes to binary size, e.g. with
1150 # https://github.com/nico/bloat
1151 'mac_write_linker_maps%': 0,
1153 # The default type of gtest.
1154 'gtest_target_type%': 'executable',
1156 # Enable sampling based profiler.
1157 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1159 # Profile without optimizing out stack frames when profiling==1.
1160 'profiling_full_stack_frames%': '0',
1162 # And if we want to dump symbols for Breakpad-enabled builds.
1163 'linux_dump_symbols%': 0,
1164 # And if we want to strip the binary after dumping symbols.
1165 'linux_strip_binary%': 0,
1166 # Strip the test binaries needed for Linux reliability tests.
1167 'linux_strip_reliability_tests%': 0,
1168 # If we want stack unwind support for backtrace().
1169 'debug_unwind_tables%': 1,
1170 'release_unwind_tables%': 1,
1173 # TODO(dmikurube): Change the default of use_allocator to "tcmalloc".
1174 # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
1175 # {linux|android}_use_tcmalloc are to be replaced with use_allocator.
1176 # They are now used only if use_allocator=="see_use_tcmalloc" (default).
1177 # TODO(dmikurube): Assert when linux_use_tcmalloc is explicitly specified.
1178 'linux_use_tcmalloc%': 1,
1179 'android_use_tcmalloc%': 0,
1180 'use_allocator%': 'see_use_tcmalloc',
1182 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1183 'linux_link_gnome_keyring%': 0,
1184 # Set to 1 to link against gsettings APIs instead of using dlopen().
1185 'linux_link_gsettings%': 0,
1187 # Default arch variant for MIPS.
1188 'mips_arch_variant%': 'mips32r1',
1190 # Enable use of OpenMAX DL FFT routines.
1191 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1193 # Enable new NPDevice API.
1194 'enable_new_npdevice_api%': 0,
1196 # Enable EGLImage support in OpenMAX
1197 'enable_eglimage%': 1,
1199 # .gyp files or targets should set chromium_code to 1 if they build
1200 # Chromium-specific code, as opposed to external code. This variable is
1201 # used to control such things as the set of warnings to enable, and
1202 # whether warnings are treated as errors.
1203 'chromium_code%': 0,
1205 'release_valgrind_build%': 0,
1207 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1208 'enable_wexit_time_destructors%': 0,
1210 # Build libpeerconnection as a static library by default.
1211 'libpeer_target_type%': 'static_library',
1213 # Set to 1 to compile with the built in pdf viewer.
1216 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1217 'internal_gles2_conform_tests%': 0,
1219 # Set to 1 to compile the filter fuzzer.
1220 'internal_filter_fuzzer%': 0,
1222 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1223 # so Cocoa is happy (http://crbug.com/20441).
1225 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1226 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1227 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1228 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1229 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1230 'vi', 'zh-CN', 'zh-TW',
1233 # Pseudo locales are special locales which are used for testing and
1234 # debugging. They don't get copied to the final app. For more info,
1235 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1242 # If debug_devtools is set to 1, JavaScript files for DevTools are
1243 # stored as is and loaded from disk. Otherwise, a concatenated file
1244 # is stored in resources.pak. It is still possible to load JS files
1245 # from disk by passing --debug-devtools cmdline switch.
1246 'debug_devtools%': 0,
1248 # The Java Bridge is not compiled in by default.
1251 # Code signing for iOS binaries. The bots need to be able to disable this.
1252 'chromium_ios_signing%': 1,
1254 # This flag is only used when disable_nacl==0 and disables all those
1255 # subcomponents which would require the installation of a native_client
1256 # untrusted toolchain.
1257 'disable_nacl_untrusted%': 0,
1259 # Disable Dart by default.
1262 # Native Client is enabled by default.
1265 # Portable Native Client is enabled by default.
1266 'disable_pnacl%': 0,
1268 # Whether to build full debug version for Debug configuration on Android.
1269 # Compared to full debug version, the default Debug configuration on Android
1270 # has no full v8 debug, has size optimization and linker gc section, so that
1271 # we can build a debug version with acceptable size and performance.
1272 'android_full_debug%': 0,
1274 # Sets the default version name and code for Android app, by default we
1275 # do a developer build.
1276 'android_app_version_name%': 'Developer Build',
1277 'android_app_version_code%': 0,
1279 # Contains data about the attached devices for gyp_managed_install.
1280 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1282 'sas_dll_exists': '<!(python <(DEPTH)/build/dir_exists.py "<(sas_dll_path)")',
1283 'wix_exists': '<!(python <(DEPTH)/build/dir_exists.py "<(wix_path)")',
1285 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1286 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1288 # Whether we are using the rlz library or not. Platforms like Android send
1289 # rlz codes for searches but do not use the library.
1292 # Turns on the i18n support in V8.
1293 'v8_enable_i18n_support': 1,
1295 # Compile d8 for the host toolset.
1296 'v8_toolset_for_d8': 'host',
1298 # Use the chromium skia by default.
1299 'use_system_skia%': '0',
1301 # Use brlapi from brltty for braille display support.
1304 # Relative path to icu.gyp from this file.
1305 'icu_gyp_path': '../third_party/icu/icu.gyp',
1307 # IPC fuzzer is disabled by default.
1308 'enable_ipc_fuzzer%': 0,
1311 # Force disable libstdc++ debug mode.
1312 'disable_glibcxx_debug%': 0,
1314 # Set to 1 to compile with the hole punching for the protected video.
1318 # Enable the Syzygy optimization step for the official builds.
1319 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1320 'syzygy_optimize%': 1,
1322 'syzygy_optimize%': 0,
1325 # The version of GCC in use, set later in platforms that use GCC and have
1326 # not explicitly chosen to build with clang. Currently, this means all
1327 # platforms except Windows, Mac and iOS.
1328 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1329 # it takes effect here.
1330 ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0', {
1333 # We directly set the gcc_version since we know what we use.
1335 ['target_arch=="x64" or target_arch=="arm64"', {
1341 'binutils_version%': 222,
1343 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
1344 'binutils_version%': '<!(python <(DEPTH)/build/compiler_version.py assembler)',
1349 'binutils_version%': 0,
1351 ['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(windows_sdk_default_path))"=="True"', {
1352 'windows_sdk_path%': '<(windows_sdk_default_path)',
1354 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
1356 ['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(directx_sdk_default_path))"=="True"', {
1357 'directx_sdk_path%': '<(directx_sdk_default_path)',
1359 'directx_sdk_path%': '$(DXSDK_DIR)',
1362 'windows_driver_kit_path%': '$(WDK_DIR)',
1364 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1366 ['target_arch=="mipsel"', {
1369 'nacl_untrusted_build%': 0,
1370 # TODO(dmikurube): Change the default of use_allocator to "none".
1371 # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
1372 'linux_use_tcmalloc%': 0,
1373 'use_allocator%': 'see_use_tcmalloc',
1375 ['OS=="linux" and target_arch=="mipsel"', {
1376 'sysroot%': '<(sysroot)',
1379 # All Chrome builds have breakpad symbols, but only process the
1380 # symbols from official builds.
1381 ['(branding=="Chrome" and buildtype=="Official")', {
1382 'linux_dump_symbols%': 1,
1384 # Omit unwind support in official release builds to save space. We
1385 # can use breakpad for these builds.
1386 'release_unwind_tables%': 0,
1389 }], # os_posix==1 and OS!="mac" and OS!="ios"
1392 'enable_background%': 0,
1393 'icu_use_data_file_flag%': 1,
1395 'use_system_libxml%': 1,
1396 'use_system_sqlite%': 1,
1398 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1399 'fi', 'fr', 'he', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms', 'nb',
1400 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr', 'uk',
1401 'vi', 'zh-CN', 'zh-TW',
1404 # The Mac SDK is set for iOS builds and passed through to Mac
1405 # sub-builds. This allows the Mac sub-build SDK in an iOS build to be
1406 # overridden from the command line the same way it is for a Mac build.
1407 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py 10.6)',
1409 # iOS SDK and deployment target support. The |ios_sdk| value is left
1410 # blank so that when it is set in the project files it will be the
1411 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1412 # causes Xcode to spit out a warning for every single project file for
1413 # not using the "current" SDK.
1415 'ios_sdk_path%': '',
1416 'ios_deployment_target%': '6.0',
1419 # ios_product_name is set to the name of the .app bundle as it should
1421 ['branding=="Chrome"', {
1422 'ios_product_name%': 'Chrome',
1423 }, { # else: branding!="Chrome"
1424 'ios_product_name%': 'Chromium',
1426 ['branding=="Chrome" and buildtype=="Official"', {
1428 }, { # else: branding!="Chrome" or buildtype!="Official"
1434 # Location of Android NDK.
1437 # Unfortunately we have to use absolute paths to the SDK/NDK because
1438 # they're passed to ant which uses a different relative path from
1440 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1441 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1442 'android_host_arch%': '<!(uname -m)',
1443 # Android API-level of the SDK used for compilation.
1444 'android_sdk_version%': '19',
1445 'android_sdk_build_tools_version%': '19.0.0',
1446 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1448 # Copy conditionally-set variables out one scope.
1449 'android_ndk_root%': '<(android_ndk_root)',
1450 'android_sdk_root%': '<(android_sdk_root)',
1451 'android_sdk_version%': '<(android_sdk_version)',
1452 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1453 'host_os%': '<(host_os)',
1455 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1456 # Android SDK build tools (e.g. dx, aapt, aidl)
1457 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1459 # Android API level 14 is ICS (Android 4.0) which is the minimum
1460 # platform requirement for Chrome on Android, we use it for native
1463 ['target_arch == "ia32"', {
1464 'android_app_abi%': 'x86',
1465 'android_gdbserver_executable%': 'gdbserver',
1466 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1467 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1468 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.6/prebuilt/<(host_os)-<(android_host_arch)/bin',
1470 ['target_arch == "x64"', {
1471 'android_app_abi%': 'x86_64',
1472 'android_gdbserver_executable%': 'gdbserver64',
1473 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86_64/gdbserver/gdbserver64',
1474 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-19/arch-x86_64',
1475 'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1477 ['target_arch=="arm"', {
1480 'android_app_abi%': 'armeabi',
1482 'android_app_abi%': 'armeabi-v7a',
1485 'android_gdbserver_executable%': 'gdbserver',
1486 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1487 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1488 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.6/prebuilt/<(host_os)-<(android_host_arch)/bin',
1490 ['target_arch == "arm64"', {
1491 'android_app_abi%': 'arm64',
1492 'android_gdbserver_executable%': 'gdbserver64',
1493 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm64/gdbserver64/gdbserver64',
1494 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-19/arch-arm64',
1495 'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1497 ['target_arch == "mipsel"', {
1498 'android_app_abi%': 'mips',
1499 'android_gdbserver_executable%': 'gdbserver',
1500 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1501 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1502 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.6/prebuilt/<(host_os)-<(android_host_arch)/bin',
1506 # Copy conditionally-set variables out one scope.
1507 'android_app_abi%': '<(android_app_abi)',
1508 'android_gdbserver_executable': '<(android_gdbserver_executable)',
1509 'android_gdbserver%': '<(android_gdbserver)',
1510 'android_ndk_root%': '<(android_ndk_root)',
1511 'android_ndk_sysroot': '<(android_ndk_sysroot)',
1512 'android_sdk_root%': '<(android_sdk_root)',
1513 'android_sdk_version%': '<(android_sdk_version)',
1514 'android_toolchain%': '<(android_toolchain)',
1516 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1517 'android_ndk_lib': '<(android_ndk_sysroot)/usr/lib',
1518 'android_sdk_tools%': '<(android_sdk_tools)',
1519 'android_sdk%': '<(android_sdk)',
1520 'android_sdk_jar%': '<(android_sdk)/android.jar',
1522 'android_stlport_root': '<(android_stlport_root)',
1523 'android_stlport_include': '<(android_stlport_root)/stlport',
1524 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1525 'host_os%': '<(host_os)',
1527 # Location of the "strip" binary, used by both gyp and scripts.
1528 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1530 # Location of the "readelf" binary.
1531 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1533 # Determines whether we should optimize JNI generation at the cost of
1534 # breaking assumptions in the build system that when inputs have changed
1535 # the outputs should always change as well. This is meant purely for
1536 # developer builds, to avoid spurious re-linking of native files.
1537 'optimize_jni_generation%': 0,
1539 # Always uses openssl.
1542 'proprietary_codecs%': '<(proprietary_codecs)',
1543 'safe_browsing%': 2,
1545 'enable_automation%': 0,
1547 'build_ffmpegsumo%': 0,
1548 # TODO(dmikurube): Change the default of use_allocator to "none".
1549 # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
1550 'linux_use_tcmalloc%': 0,
1551 'use_allocator%': 'see_use_tcmalloc',
1553 # Disable Native Client.
1556 # Android does not support background apps.
1557 'enable_background%': 0,
1559 # Sessions are store separately in the Java side.
1560 'enable_session_service%': 0,
1564 'gtest_target_type%': 'shared_library',
1566 # Uses system APIs for decoding audio and video.
1567 'use_libffmpeg%': '0',
1569 # When building as part of the Android system, use system libraries
1570 # where possible to reduce ROM size.
1571 # TODO(steveblock): Investigate using the system version of sqlite.
1572 'use_system_sqlite%': 0, # '<(android_webview_build)',
1573 'use_system_expat%': '<(android_webview_build)',
1574 'use_system_icu%': '<(android_webview_build)',
1575 'use_system_stlport%': '<(android_webview_build)',
1577 # Copy it out one scope.
1578 'android_webview_build%': '<(android_webview_build)',
1580 ['android_webview_build==1', {
1581 # When building the WebView in the Android tree, jarjar will remap all
1582 # the class names, so the JNI generator needs to know this.
1583 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1587 # All Chrome builds have breakpad symbols, but only process the
1588 # symbols from official builds.
1589 ['(branding=="Chrome" and buildtype=="Official")', {
1590 'mac_strip_release%': 1,
1594 ['OS=="mac" or OS=="ios"', {
1598 # Mac OS X SDK and deployment target support. The SDK identifies
1599 # the version of the system headers that will be used, and
1600 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1601 # macro. "Maximum allowed" refers to the operating system version
1602 # whose APIs are available in the headers. The deployment target
1603 # identifies the minimum system version that the built products are
1604 # expected to function on. It corresponds to the
1605 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1606 # macros are available, #include <AvailabilityMacros.h>. Additional
1607 # documentation on these macros is available at
1608 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1609 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1610 # deployment target to 10.6. Other projects, such as O3D, may
1611 # override these defaults.
1613 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1614 # about that is at least the specified version. In official builds,
1615 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1616 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1617 # path to the SDK; when set to a non-empty string, SDK detection
1618 # based on mac_sdk_min will be bypassed entirely.
1619 'mac_sdk_min%': '10.6',
1620 'mac_sdk_path%': '',
1622 'mac_deployment_target%': '10.6',
1625 'mac_sdk_min': '<(mac_sdk_min)',
1626 'mac_sdk_path': '<(mac_sdk_path)',
1627 'mac_deployment_target': '<(mac_deployment_target)',
1629 # Compile in Breakpad support by default so that it can be
1630 # tested, even if it is not enabled by default at runtime.
1631 'mac_breakpad_compiled_in%': 1,
1633 # mac_product_name is set to the name of the .app bundle as it should
1634 # appear on disk. This duplicates data from
1635 # chrome/app/theme/chromium/BRANDING and
1636 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1637 # these names into the build system.
1638 ['branding=="Chrome"', {
1639 'mac_product_name%': 'Google Chrome',
1640 }, { # else: branding!="Chrome"
1641 'mac_product_name%': 'Chromium',
1644 ['branding=="Chrome" and buildtype=="Official"', {
1645 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1646 # Enable uploading crash dumps.
1647 'mac_breakpad_uploads%': 1,
1648 # Enable dumping symbols at build time for use by Mac Breakpad.
1650 # Enable Keystone auto-update support.
1652 }, { # else: branding!="Chrome" or buildtype!="Official"
1653 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1654 'mac_breakpad_uploads%': 0,
1659 }], # OS=="mac" or OS=="ios"
1662 # This is the architecture convention used in WinSDK paths.
1663 ['target_arch=="ia32"', {
1664 'winsdk_arch%': 'x86',
1666 'winsdk_arch%': '<(target_arch)',
1668 ['component=="shared_library"', {
1669 'win_use_allocator_shim%': 0,
1671 # Turn on multiple dll by default on Windows when in static_library.
1672 'chrome_multiple_dll%': 1,
1675 'win_use_allocator_shim%': 0,
1677 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1678 # Only enabled by default for ninja because it's buggy in VS.
1679 # Not enabled for component=static_library because some targets
1680 # are too large and the toolchain fails due to the size of the
1682 'incremental_chrome_dll%': 1,
1684 # Don't do incremental linking for large modules on 32-bit or when
1685 # component=static_library as the toolchain fails due to the size of
1687 ['MSVS_OS_BITS==32 or component=="static_library"', {
1688 'msvs_large_module_debug_link_mode%': '1', # No
1690 'msvs_large_module_debug_link_mode%': '2', # Yes
1692 ['MSVS_VERSION=="2013e" or MSVS_VERSION=="2012e" or MSVS_VERSION=="2010e"', {
1700 'nacl_win64_defines': [
1701 # This flag is used to minimize dependencies when building
1702 # Native Client loader for 64-bit Windows.
1707 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios"', {
1713 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1714 'enable_pepper_cdms%': 1,
1716 'enable_pepper_cdms%': 0,
1719 # Native Client glibc toolchain is enabled
1720 # by default except on arm and mips.
1721 ['target_arch=="arm" or target_arch=="mipsel"', {
1722 'disable_glibc%': 1,
1724 'disable_glibc%': 0,
1727 # Set the relative path from this file to the GYP file of the JPEG
1728 # library used by Chromium.
1729 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1730 # Configuration for using the system libjeg is here.
1731 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1733 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1736 # Options controlling the use of GConf (the classic GNOME configuration
1737 # system) and GIO, which contains GSettings (the new GNOME config system).
1738 ['chromeos==1 or embedded==1', {
1746 # Set up -D and -E flags passed into grit.
1747 ['branding=="Chrome"', {
1748 # TODO(mmoss) The .grd files look for _google_chrome, but for
1749 # consistency they should look for google_chrome_build like C++.
1750 'grit_defines': ['-D', '_google_chrome',
1751 '-E', 'CHROMIUM_BUILD=google_chrome'],
1753 'grit_defines': ['-D', '_chromium',
1754 '-E', 'CHROMIUM_BUILD=chromium'],
1757 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
1759 ['desktop_linux==1', {
1760 'grit_defines': ['-D', 'desktop_linux'],
1762 ['toolkit_views==1', {
1763 'grit_defines': ['-D', 'toolkit_views'],
1765 ['toolkit_uses_gtk==1', {
1766 'grit_defines': ['-D', 'toolkit_uses_gtk'],
1769 'grit_defines': ['-D', 'use_aura'],
1772 'grit_defines': ['-D', 'use_ash'],
1775 'grit_defines': ['-D', 'use_nss'],
1778 'grit_defines': ['-D', 'use_ozone'],
1780 ['image_loader_extension==1', {
1781 'grit_defines': ['-D', 'image_loader_extension'],
1784 'grit_defines': ['-D', 'remoting'],
1786 ['use_titlecase_in_grd_files==1', {
1787 'grit_defines': ['-D', 'use_titlecase'],
1789 ['OS=="android" and (target_arch=="ia32" or target_arch=="x64")', {
1790 # WebAudio on Android/x86 is disabled by default, unlike
1791 # everywhere else, so use appropriate message.
1792 'grit_defines': ['-D', 'use_webaudio_enable_message'],
1794 ['use_third_party_translations==1', {
1795 'grit_defines': ['-D', 'use_third_party_translations'],
1797 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
1798 'ka', 'ku', 'kw', 'ms', 'ug'
1802 'grit_defines': ['-t', 'android',
1803 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true'],
1805 ['OS=="mac" or OS=="ios"', {
1806 'grit_defines': ['-D', 'scale_factors=2x'],
1811 # iOS uses a whitelist to filter resources.
1812 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
1815 # Enable host builds when generating with ninja-ios.
1817 ['"<(GENERATOR)"=="ninja"', {
1821 # TODO(sdefresne): Remove the target_subarch check once Apple has
1822 # upstreamed the support for "arm64". http://crbug.com/341453
1823 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
1828 ['enable_extensions==1', {
1829 'grit_defines': ['-D', 'enable_extensions'],
1831 ['enable_plugins!=0', {
1832 'grit_defines': ['-D', 'enable_plugins'],
1834 ['enable_printing!=0', {
1835 'grit_defines': ['-D', 'enable_printing'],
1837 ['enable_printing==1', {
1838 'grit_defines': ['-D', 'enable_full_printing'],
1840 ['enable_themes==1', {
1841 'grit_defines': ['-D', 'enable_themes'],
1843 ['enable_app_list==1', {
1844 'grit_defines': ['-D', 'enable_app_list'],
1846 ['enable_settings_app==1', {
1847 'grit_defines': ['-D', 'enable_settings_app'],
1849 ['enable_google_now==1', {
1850 'grit_defines': ['-D', 'enable_google_now'],
1852 ['use_concatenated_impulse_responses==1', {
1853 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
1855 ['enable_webrtc==1', {
1856 'grit_defines': ['-D', 'enable_webrtc'],
1858 ['enable_hangout_services_extension==1', {
1859 'grit_defines': ['-D', 'enable_hangout_services_extension'],
1861 ['enable_task_manager==1', {
1862 'grit_defines': ['-D', 'enable_task_manager'],
1864 ['notifications==1', {
1865 'grit_defines': ['-D', 'enable_notifications'],
1867 ['enable_resource_whitelist_generation==1', {
1868 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("{textual_id}") {numeric_id}'],
1870 ['enable_mdns==1 or OS=="mac"', {
1871 'grit_defines': ['-D', 'enable_service_discovery'],
1872 'enable_service_discovery%': 1
1874 ['clang_use_chrome_plugins==1 and OS!="win"', {
1875 'clang_chrome_plugins_flags': [
1876 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
1883 ['asan==1 and OS=="mac"', {
1884 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
1885 # runtime is fully adopted. See http://crbug.com/242503.
1886 'mac_strip_release': 0,
1898 ['OS=="linux" and clang_type_profiler==1', {
1900 'clang_use_chrome_plugins%': 0,
1902 ['host_arch=="x64"', {
1903 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
1905 ['host_arch=="ia32"', {
1906 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
1907 # Clang in this directory at your own risk if needed for some
1908 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
1909 # usage). Any failure by this compiler should not close the tree.
1910 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
1915 # On valgrind bots, override the optimizer settings so we don't inline too
1916 # much and make the stacks harder to figure out.
1918 # TODO(rnk): Kill off variables that no one else uses and just implement
1919 # them under a build_for_tool== condition.
1920 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
1922 'mac_debug_optimization': '1',
1923 'mac_release_optimization': '1',
1924 'release_optimize': '1',
1925 'no_gc_sections': 1,
1926 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
1927 '-fno-builtin -fno-optimize-sibling-calls',
1928 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
1929 '-fno-builtin -fno-optimize-sibling-calls',
1931 # MSVS flags for TSan on Pin and Windows.
1932 'win_debug_RuntimeChecks': '0',
1933 'win_debug_disable_iterator_debugging': '1',
1934 'win_debug_Optimization': '1',
1935 'win_debug_InlineFunctionExpansion': '0',
1936 'win_release_InlineFunctionExpansion': '0',
1937 'win_release_OmitFramePointers': '0',
1939 # TODO(dmikurube): Change the default of use_allocator to "tcmalloc".
1940 # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
1941 'linux_use_tcmalloc%': 1,
1942 'use_allocator': 'see_use_tcmalloc',
1943 'release_valgrind_build': 1,
1945 'component': 'static_library',
1946 'use_system_zlib': 0,
1949 # Build tweaks for DrMemory.
1950 # TODO(rnk): Combine with tsan config to share the builder.
1951 # http://crbug.com/108155
1952 ['build_for_tool=="drmemory"', {
1953 # These runtime checks force initialization of stack vars which blocks
1954 # DrMemory's uninit detection.
1955 'win_debug_RuntimeChecks': '0',
1956 # Iterator debugging is slow.
1957 'win_debug_disable_iterator_debugging': '1',
1958 # Try to disable optimizations that mess up stacks in a release build.
1959 # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054)
1960 # /O2 and /Ob0 (disable inline) cannot be used together because of a
1961 # compiler bug, so we use /Ob1 instead.
1962 'win_release_InlineFunctionExpansion': '1',
1963 'win_release_OmitFramePointers': '0',
1964 # Ditto for debug, to support bumping win_debug_Optimization.
1965 'win_debug_InlineFunctionExpansion': 0,
1966 'win_debug_OmitFramePointers': 0,
1967 # Keep the code under #ifndef NVALGRIND.
1968 'release_valgrind_build': 1,
1971 # Enable RLZ on Win, Mac, iOS and ChromeOS.
1972 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
1976 # Set default compiler flags depending on ARM version.
1977 ['arm_version==6 and android_webview_build==0', {
1978 'arm_arch%': 'armv6',
1981 'arm_float_abi%': 'softfp',
1984 ['arm_version==7 and android_webview_build==0', {
1985 'arm_arch%': 'armv7-a',
1991 'arm_fpu%': 'vfpv3-d16',
1994 # Change the default to hard once the armhf transition is complete.
1995 'arm_float_abi%': 'softfp',
1999 ['android_webview_build==1', {
2000 # The WebView build gets its cpu-specific flags from the Android build system.
2004 'arm_float_abi%': '',
2008 # Enable brlapi by default for chromeos.
2014 # This is the default platform
2015 'ozone_platform%': "test",
2017 # Enable built-in ozone platforms if ozone is enabled.
2018 'ozone_platform_dri%': 1,
2019 'ozone_platform_test%': 1,
2021 'ozone_platform_dri%': 0,
2022 'ozone_platform_test%': 0,
2025 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2026 'use_clipboard_aurax11%': 1,
2029 ['OS=="win" and use_goma==1', {
2030 # goma doesn't support pch yet.
2031 'chromium_win_pch': 0,
2032 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2040 ['OS=="win" and (clang==1 or asan==1)', {
2041 'chromium_win_pch': 0,
2044 # The seccomp-bpf sandbox is only supported on three architectures
2046 # Do not disable seccomp_bpf anywhere without talking to
2047 # security@chromium.org!
2048 ['((OS=="linux" or OS=="android") and '
2049 '(target_arch=="ia32" or target_arch=="x64" or '
2050 'target_arch=="arm"))', {
2051 'use_seccomp_bpf%': 1,
2053 'use_seccomp_bpf%': 0,
2057 # The path to the ANGLE library.
2058 'angle_path': '<(DEPTH)/third_party/angle',
2060 # List of default apps to install in new profiles. The first list contains
2061 # the source files as found in svn. The second list, used only for linux,
2062 # contains the destination location for each of the files. When a crx
2063 # is added or removed from the list, the chrome/browser/resources/
2064 # default_apps/external_extensions.json file must also be updated.
2065 'default_apps_list': [
2066 'browser/resources/default_apps/external_extensions.json',
2067 'browser/resources/default_apps/gmail.crx',
2068 'browser/resources/default_apps/search.crx',
2069 'browser/resources/default_apps/youtube.crx',
2070 'browser/resources/default_apps/drive.crx',
2071 'browser/resources/default_apps/docs.crx',
2073 'default_apps_list_linux_dest': [
2074 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2075 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2076 '<(PRODUCT_DIR)/default_apps/search.crx',
2077 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2078 '<(PRODUCT_DIR)/default_apps/drive.crx',
2079 '<(PRODUCT_DIR)/default_apps/docs.crx',
2082 'target_defaults': {
2084 # The condition that operates on chromium_code is in a target_conditions
2085 # section, and will not have access to the default fallback value of
2086 # chromium_code at the top of this file, or to the chromium_code
2087 # variable placed at the root variables scope of .gyp files, because
2088 # those variables are not set at target scope. As a workaround,
2089 # if chromium_code is not set at target scope, define it in target scope
2090 # to contain whatever value it has during early variable expansion.
2091 # That's enough to make it available during target conditional
2093 'chromium_code%': '<(chromium_code)',
2095 'component%': '<(component)',
2097 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2098 'win_release_Optimization%': '2', # 2 = /Os
2099 'win_debug_Optimization%': '0', # 0 = /Od
2101 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2102 # Tri-state: blank is default, 1 on, 0 off
2103 'win_release_OmitFramePointers%': '0',
2104 # Tri-state: blank is default, 1 on, 0 off
2105 'win_debug_OmitFramePointers%': '',
2107 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2108 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2110 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2111 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2112 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2114 # VS inserts quite a lot of extra checks to algorithms like
2115 # std::partial_sort in Debug build which make them O(N^2)
2116 # instead of O(N*logN). This is particularly slow under memory
2117 # tools like ThreadSanitizer so we want it to be disablable.
2118 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2119 'win_debug_disable_iterator_debugging%': '0',
2121 # An application manifest fragment to declare compatibility settings for
2122 # 'executable' targets. Ignored in other target type.
2123 'win_exe_compatibility_manifest%':
2124 '<(DEPTH)\\build\\win\\compatibility.manifest',
2126 'release_extra_cflags%': '',
2127 'debug_extra_cflags%': '',
2129 'release_valgrind_build%': '<(release_valgrind_build)',
2131 # the non-qualified versions are widely assumed to be *nix-only
2132 'win_release_extra_cflags%': '',
2133 'win_debug_extra_cflags%': '',
2135 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2136 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2138 # Only used by Windows build for now. Can be used to build into a
2139 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2140 # output files in src/build/VS2010_{Debug,Release}.
2141 'build_dir_prefix%': '',
2143 # Targets are by default not nacl untrusted code.
2144 'nacl_untrusted_build%': 0,
2146 'pnacl_compile_flags': [
2147 # pnacl uses the clang compiler so we need to suppress all the
2148 # same warnings as we do for clang.
2149 # TODO(sbc): Remove these if/when they are removed from the clang
2151 '-Wno-unused-function',
2152 '-Wno-char-subscripts',
2153 '-Wno-c++11-extensions',
2154 '-Wno-unnamed-type-template-args',
2158 ['OS=="win" and component=="shared_library"', {
2159 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2160 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2161 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2163 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2164 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2165 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2168 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2169 'mac_release_optimization%': 's', # Use -Os unless overridden
2170 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2172 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2173 'mac_release_optimization%': '3', # Use -O3 unless overridden
2174 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2177 'host_os%': '<(host_os)', # See comment above chromium_code.
2182 # Don't use deprecated V8 APIs anywhere.
2183 'V8_DEPRECATION_WARNINGS',
2184 # Temporary suppression until Blink code can be removed.
2185 'BLINK_SCALE_FILTERS_AT_RECORD_TIME',
2188 ['(OS=="mac" or OS=="ios") and asan==1', {
2190 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2193 # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
2194 ['OS=="linux" and ((use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and linux_use_tcmalloc==1)) and clang_type_profiler==1', {
2195 'cflags_cc!': ['-fno-rtti'],
2198 '-gline-tables-only',
2199 '-fintercept-allocation-functions',
2201 'defines': ['TYPE_PROFILING'],
2203 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2206 ['OS=="linux" and clang==1 and host_arch=="ia32"', {
2207 # TODO(dmikurube): Remove -Wno-sentinel when Clang/LLVM is fixed.
2208 # See http://crbug.com/162818.
2209 'cflags+': ['-Wno-sentinel'],
2211 ['branding=="Chrome"', {
2212 'defines': ['GOOGLE_CHROME_BUILD'],
2213 }, { # else: branding!="Chrome"
2214 'defines': ['CHROMIUM_BUILD'],
2216 ['OS=="mac" and component=="shared_library"', {
2218 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2219 'LD_RUNPATH_SEARCH_PATHS': [
2220 # For unbundled binaries.
2222 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2223 '@loader_path/../../..',
2228 'defines': ['ENABLE_RLZ'],
2230 ['component=="shared_library"', {
2231 'defines': ['COMPONENT_BUILD'],
2233 ['toolkit_views==1', {
2234 'defines': ['TOOLKIT_VIEWS=1'],
2236 ['ui_compositor_image_transport==1', {
2237 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2240 'defines': ['USE_AURA=1'],
2243 'defines': ['USE_ASH=1'],
2246 'defines': ['USE_CAIRO=1'],
2249 'defines': ['USE_CRAS=1'],
2252 'defines': ['USE_GLIB=1'],
2255 'defines': ['USE_OZONE=1'],
2257 ['use_default_render_theme==1', {
2258 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2260 ['use_libjpeg_turbo==1', {
2261 'defines': ['USE_LIBJPEG_TURBO=1'],
2264 'defines': ['USE_MOJO=1'],
2267 'defines': ['USE_X11=1'],
2269 ['use_clipboard_aurax11==1', {
2270 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2272 ['enable_one_click_signin==1', {
2273 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2275 ['toolkit_uses_gtk==1 and toolkit_views==0', {
2276 # TODO(erg): We are progressively sealing up use of deprecated features
2277 # in gtk in preparation for an eventual porting to gtk3.
2278 'defines': ['GTK_DISABLE_SINGLE_INCLUDES=1'],
2281 'defines': ['OS_CHROMEOS=1'],
2283 ['use_xi2_mt!=0 and use_x11==1', {
2284 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2286 ['image_loader_extension==1', {
2287 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2290 'defines': ['ENABLE_PROFILING=1'],
2293 'defines': ['ENABLE_REMOTING=1'],
2295 ['enable_webrtc==1', {
2296 'defines': ['ENABLE_WEBRTC=1'],
2298 ['proprietary_codecs==1', {
2299 'defines': ['USE_PROPRIETARY_CODECS'],
2301 ['enable_viewport==1', {
2302 'defines': ['ENABLE_VIEWPORT'],
2304 ['enable_pepper_cdms==1', {
2305 'defines': ['ENABLE_PEPPER_CDMS'],
2307 ['configuration_policy==1', {
2308 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2310 ['input_speech==1', {
2311 'defines': ['ENABLE_INPUT_SPEECH'],
2313 ['notifications==1', {
2314 'defines': ['ENABLE_NOTIFICATIONS'],
2316 ['enable_hidpi==1', {
2317 'defines': ['ENABLE_HIDPI=1'],
2319 ['native_discardable_memory==1', {
2320 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2322 ['native_memory_pressure_signals==1', {
2323 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2326 'defines': ['USE_UDEV'],
2330 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2334 # Clang creates chubby debug information, which makes linking very
2335 # slow. For now, don't create debug information with clang. See
2336 # http://crbug.com/70000
2340 'debug_extra_cflags': '-g0',
2343 # Android builds symbols on release by default, disable them.
2346 'debug_extra_cflags': '-g0',
2347 'release_extra_cflags': '-g0',
2351 }, { # else clang!=1
2353 ['OS=="win" and fastbuild==2', {
2354 # Completely disable debug information.
2357 'GenerateDebugInformation': 'false',
2359 'VCCLCompilerTool': {
2360 'DebugInformationFormat': '0',
2364 ['OS=="win" and fastbuild==1', {
2367 # This tells the linker to generate .pdbs, so that
2368 # we can get meaningful stack traces.
2369 'GenerateDebugInformation': 'true',
2371 'VCCLCompilerTool': {
2372 # No debug info to be generated by compiler.
2373 'DebugInformationFormat': '0',
2377 ['OS=="linux" and fastbuild==2', {
2379 'debug_extra_cflags': '-g0',
2382 ['OS=="linux" and fastbuild==1', {
2384 'debug_extra_cflags': '-g1',
2387 ['OS=="android" and fastbuild==2', {
2389 'debug_extra_cflags': '-g0',
2390 'release_extra_cflags': '-g0',
2393 ['OS=="android" and fastbuild==1', {
2395 'debug_extra_cflags': '-g1',
2396 'release_extra_cflags': '-g1',
2403 ['dcheck_always_on!=0', {
2404 'defines': ['DCHECK_ALWAYS_ON=1'],
2405 }], # dcheck_always_on!=0
2406 ['tracing_like_official_build!=0', {
2407 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2408 }], # tracing_like_official_build!=0
2409 ['win_use_allocator_shim==0', {
2412 'defines': ['NO_TCMALLOC'],
2416 ['enable_eglimage==1', {
2418 'ENABLE_EGLIMAGE=1',
2422 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2429 'ADDRESS_SANITIZER',
2430 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2436 '_CRT_SECURE_NO_DEPRECATE',
2437 '_SCL_SECURE_NO_DEPRECATE',
2438 # This define is required to pull in the new Win8 interfaces from
2439 # system headers like ShObjIdl.h.
2440 'NTDDI_VERSION=0x06020000',
2441 # This is required for ATL to use XP-safe versions of its functions.
2442 '_USING_V110_SDK71_',
2445 '<(DEPTH)/third_party/wtl/include',
2450 # Generates debug info when win_z7=1
2451 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2453 'GenerateDebugInformation': 'true',
2455 'VCCLCompilerTool': {
2456 'DebugInformationFormat': '1',
2462 ['enable_task_manager==1', {
2464 'ENABLE_TASK_MANAGER=1',
2467 ['enable_extensions==1', {
2469 'ENABLE_EXTENSIONS=1',
2472 ['OS=="win" and branding=="Chrome"', {
2473 'defines': ['ENABLE_SWIFTSHADER'],
2475 ['enable_dart==1', {
2476 'defines': ['WEBKIT_USING_DART=1'],
2478 ['enable_plugin_installation==1', {
2479 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2481 ['enable_plugins==1', {
2482 'defines': ['ENABLE_PLUGINS=1'],
2484 ['enable_session_service==1', {
2485 'defines': ['ENABLE_SESSION_SERVICE=1'],
2487 ['enable_themes==1', {
2488 'defines': ['ENABLE_THEMES=1'],
2490 ['enable_autofill_dialog==1', {
2491 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2493 ['enable_background==1', {
2494 'defines': ['ENABLE_BACKGROUND=1'],
2496 ['enable_automation==1', {
2497 'defines': ['ENABLE_AUTOMATION=1'],
2499 ['enable_google_now==1', {
2500 'defines': ['ENABLE_GOOGLE_NOW=1'],
2502 ['cld_version!=0', {
2503 'defines': ['CLD_VERSION=<(cld_version)'],
2505 ['enable_printing==1', {
2506 'defines': ['ENABLE_FULL_PRINTING=1', 'ENABLE_PRINTING=1'],
2508 ['enable_printing==2', {
2509 'defines': ['ENABLE_PRINTING=1'],
2511 ['enable_spellcheck==1', {
2512 'defines': ['ENABLE_SPELLCHECK=1'],
2514 ['enable_captive_portal_detection==1', {
2515 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2517 ['enable_app_list==1', {
2518 'defines': ['ENABLE_APP_LIST=1'],
2520 ['enable_settings_app==1', {
2521 'defines': ['ENABLE_SETTINGS_APP=1'],
2523 ['disable_ftp_support==1', {
2524 'defines': ['DISABLE_FTP_SUPPORT=1'],
2526 ['enable_managed_users==1', {
2527 'defines': ['ENABLE_MANAGED_USERS=1'],
2529 ['data_reduction_fallback_host != ""', {
2531 'DATA_REDUCTION_FALLBACK_HOST="<(data_reduction_fallback_host)"'],
2533 ['data_reduction_dev_host != ""', {
2535 'DATA_REDUCTION_DEV_HOST="<(data_reduction_dev_host)"'],
2537 ['spdy_proxy_auth_origin != ""', {
2538 'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'],
2540 ['spdy_proxy_auth_property != ""', {
2541 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2543 ['spdy_proxy_auth_value != ""', {
2544 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2546 ['data_reduction_proxy_probe_url != ""', {
2548 'DATA_REDUCTION_PROXY_PROBE_URL="<(data_reduction_proxy_probe_url)"'],
2550 ['enable_mdns==1', {
2551 'defines': ['ENABLE_MDNS=1'],
2553 ['enable_service_discovery==1', {
2554 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2556 ['enable_hangout_services_extension==1', {
2557 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2559 ['enable_ipc_fuzzer==1', {
2560 'defines': ['ENABLE_IPC_FUZZER=1'],
2563 'defines': ['VIDEO_HOLE=1'],
2565 ], # conditions for 'target_defaults'
2566 'target_conditions': [
2567 ['<(use_openssl)==1 or >(nacl_untrusted_build)==1', {
2568 'defines': ['USE_OPENSSL=1'],
2570 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
2571 'defines': ['USE_NSS=1'],
2573 ['enable_wexit_time_destructors==1', {
2577 '-Wexit-time-destructors',
2581 '-Wexit-time-destructors',
2587 ['chromium_code==0', {
2589 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
2590 # We don't want to get warnings from third-party code,
2591 # so remove any existing warning-enabling flags like -Wall.
2597 # Don't warn about hash_map in third-party code.
2601 # Don't warn about printf format problems.
2602 # This is off by default in gcc but on in Ubuntu's gcc(!).
2606 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
2610 # TODO: Fix all warnings on chromeos too.
2611 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
2616 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
2618 # Don't warn about ignoring the return value from e.g. close().
2619 # This is off by default in some gccs but on by default in others.
2620 # BSD systems do not support this option, since they are usually
2621 # using gcc 4.2.1, which does not have this flag yet.
2622 '-Wno-unused-result',
2627 '_CRT_SECURE_NO_DEPRECATE',
2628 '_CRT_NONSTDC_NO_WARNINGS',
2629 '_CRT_NONSTDC_NO_DEPRECATE',
2630 '_SCL_SECURE_NO_DEPRECATE',
2632 'msvs_disabled_warnings': [4800],
2634 'VCCLCompilerTool': {
2635 'WarningLevel': '3',
2636 'WarnAsError': '<(win_third_party_warn_as_error)',
2637 'Detect64BitPortabilityProblems': 'false',
2641 ['buildtype=="Official"', {
2643 'VCCLCompilerTool': { 'WarnAsError': 'false' },
2648 'VCCLCompilerTool': { 'WarnAsError': 'false' },
2653 # TODO(darin): Unfortunately, some third_party code depends on base.
2654 [ 'OS=="win" and component=="shared_library"', {
2655 'msvs_disabled_warnings': [
2656 4251, # class 'std::xx' needs to have dll-interface.
2659 [ 'OS=="mac" or OS=="ios"', {
2661 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
2664 ['buildtype=="Official"', {
2666 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
2673 # TODO(ios): Fix remaining warnings in third-party code, then
2674 # remove this; the Mac cleanup didn't get everything that's
2675 # flagged in an iOS build.
2676 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
2677 'RUN_CLANG_STATIC_ANALYZER': 'NO',
2678 # Several internal ios directories generate numerous warnings for
2679 # -Wobjc-missing-property-synthesis.
2680 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
2686 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
2687 'filename_rules.gypi',
2689 # In Chromium code, we define __STDC_foo_MACROS in order to get the
2690 # C99 macros on Mac and Linux.
2692 '__STDC_CONSTANT_MACROS',
2693 '__STDC_FORMAT_MACROS',
2697 # turn on warnings for signed/unsigned mismatch on chromium code.
2699 'VCCLCompilerTool': {
2700 'AdditionalOptions': ['/we4389'],
2704 ['OS=="win" and component=="shared_library"', {
2705 'msvs_disabled_warnings': [
2706 4251, # class 'std::xx' needs to have dll-interface.
2711 ], # target_conditions for 'target_defaults'
2712 'default_configuration': 'Debug',
2714 # VCLinkerTool LinkIncremental values below:
2716 # 1 == /INCREMENTAL:NO
2718 # Debug links incremental, Release does not.
2720 # Abstract base configurations to cover common attributes.
2724 'msvs_configuration_attributes': {
2725 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
2726 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
2727 'CharacterSet': '1',
2729 # Add the default import libs.
2732 'AdditionalDependencies': [
2756 'MinimumRequiredVersion': '5.01', # XP.
2757 'TargetMachine': '1',
2759 'VCLibrarianTool': {
2760 'TargetMachine': '1',
2763 'msvs_configuration_platform': 'Win32',
2767 'msvs_configuration_platform': 'x64',
2770 'TargetMachine': '17', # x86 - 64
2771 'AdditionalLibraryDirectories!':
2772 ['<(windows_sdk_path)/Lib/win8/um/x86'],
2773 'AdditionalLibraryDirectories':
2774 ['<(windows_sdk_path)/Lib/win8/um/x64'],
2775 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
2776 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
2778 'VCLibrarianTool': {
2779 'AdditionalLibraryDirectories!':
2780 ['<(windows_sdk_path)/Lib/win8/um/x86'],
2781 'AdditionalLibraryDirectories':
2782 ['<(windows_sdk_path)/Lib/win8/um/x64'],
2783 'TargetMachine': '17', # x64
2790 'DYNAMIC_ANNOTATIONS_ENABLED=1',
2791 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
2794 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
2796 '<@(debug_extra_cflags)',
2800 'VCCLCompilerTool': {
2801 'Optimization': '<(win_debug_Optimization)',
2802 'PreprocessorDefinitions': ['_DEBUG'],
2803 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
2804 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
2806 # According to MSVS, InlineFunctionExpansion=0 means
2807 # "default inlining", not "/Ob0".
2808 # Thus, we have to handle InlineFunctionExpansion==0 separately.
2809 ['win_debug_InlineFunctionExpansion==0', {
2810 'AdditionalOptions': ['/Ob0'],
2812 ['win_debug_InlineFunctionExpansion!=""', {
2813 'InlineFunctionExpansion':
2814 '<(win_debug_InlineFunctionExpansion)',
2816 ['win_debug_disable_iterator_debugging==1', {
2817 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
2820 # if win_debug_OmitFramePointers is blank, leave as default
2821 ['win_debug_OmitFramePointers==1', {
2822 'OmitFramePointers': 'true',
2824 ['win_debug_OmitFramePointers==0', {
2825 'OmitFramePointers': 'false',
2826 # The above is not sufficient (http://crbug.com/106711): it
2827 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
2828 # perform FPO regardless, so we must explicitly disable.
2829 # We still want the false setting above to avoid having
2830 # "/Oy /Oy-" and warnings about overriding.
2831 'AdditionalOptions': ['/Oy-'],
2834 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
2837 'LinkIncremental': '<(msvs_debug_link_incremental)',
2838 # ASLR makes debugging with windbg difficult because Chrome.exe and
2839 # Chrome.dll share the same base name. As result, windbg will
2840 # name the Chrome.dll module like chrome_<base address>, where
2841 # <base address> typically changes with each launch. This in turn
2842 # means that breakpoints in Chrome.dll don't stick from one launch
2843 # to the next. For this reason, we turn ASLR off in debug builds.
2844 # Note that this is a three-way bool, where 0 means to pick up
2845 # the default setting, 1 is off and 2 is on.
2846 'RandomizedBaseAddress': 1,
2848 'VCResourceCompilerTool': {
2849 'PreprocessorDefinitions': ['_DEBUG'],
2853 ['OS=="linux" or OS=="android"', {
2854 'target_conditions': [
2855 ['_toolset=="target"', {
2857 '<@(debug_extra_cflags)',
2862 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
2863 # Enable libstdc++ debugging facilities to help catch problems
2864 # early, see http://crbug.com/65151 .
2865 # TODO(phajdan.jr): Should we enable this for all of POSIX?
2866 'defines': ['_GLIBCXX_DEBUG=1',],
2868 ['release_valgrind_build==0', {
2871 '-fstack-protector-all', # Implies -fstack-protector
2883 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
2884 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
2885 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
2888 'VCCLCompilerTool': {
2889 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
2891 # In official builds, each target will self-select
2892 # an optimization level.
2893 ['buildtype!="Official"', {
2894 'Optimization': '<(win_release_Optimization)',
2897 # According to MSVS, InlineFunctionExpansion=0 means
2898 # "default inlining", not "/Ob0".
2899 # Thus, we have to handle InlineFunctionExpansion==0 separately.
2900 ['win_release_InlineFunctionExpansion==0', {
2901 'AdditionalOptions': ['/Ob0'],
2903 ['win_release_InlineFunctionExpansion!=""', {
2904 'InlineFunctionExpansion':
2905 '<(win_release_InlineFunctionExpansion)',
2908 # if win_release_OmitFramePointers is blank, leave as default
2909 ['win_release_OmitFramePointers==1', {
2910 'OmitFramePointers': 'true',
2912 ['win_release_OmitFramePointers==0', {
2913 'OmitFramePointers': 'false',
2914 # The above is not sufficient (http://crbug.com/106711): it
2915 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
2916 # perform FPO regardless, so we must explicitly disable.
2917 # We still want the false setting above to avoid having
2918 # "/Oy /Oy-" and warnings about overriding.
2919 'AdditionalOptions': ['/Oy-'],
2922 'AdditionalOptions': [ '<@(win_release_extra_cflags)', ],
2925 # LinkIncremental is a tri-state boolean, where 0 means default
2926 # (i.e., inherit from parent solution), 1 means false, and
2928 'LinkIncremental': '1',
2929 # This corresponds to the /PROFILE flag which ensures the PDB
2930 # file contains FIXUP information (growing the PDB file by about
2931 # 5%) but does not otherwise alter the output binary. This
2932 # information is used by the Syzygy optimization tool when
2933 # decomposing the release image.
2938 ['msvs_use_common_release', {
2939 'includes': ['release.gypi'],
2941 ['release_valgrind_build==0 and tsan==0', {
2944 'DYNAMIC_ANNOTATIONS_ENABLED=0',
2948 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2949 'DYNAMIC_ANNOTATIONS_ENABLED=1',
2950 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
2953 ['win_use_allocator_shim==0', {
2954 'defines': ['NO_TCMALLOC'],
2956 # _FORTIFY_SOURCE isn't really supported by Clang now, see
2957 # http://llvm.org/bugs/show_bug.cgi?id=16821.
2958 # TODO(glider): once the bug is fixed, disable source fortification
2959 # under the sanitizer tools only.
2960 ['os_posix==1 and (OS!="linux" or clang!=1)', {
2961 'target_conditions': [
2962 ['chromium_code==1', {
2963 # Non-chromium code is not guaranteed to compile cleanly
2964 # with _FORTIFY_SOURCE. Also, fortified build may fail
2965 # when optimizations are disabled, so only do that for Release
2968 '_FORTIFY_SOURCE=2',
2973 ['OS=="linux" or OS=="android"', {
2974 'target_conditions': [
2975 ['_toolset=="target"', {
2977 '<@(release_extra_cflags)',
2984 'NS_BLOCK_ASSERTIONS=1',
2990 # Concrete configurations
2993 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
2996 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3001 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3002 'target_conditions': [
3003 [ '_type=="executable"', {
3004 # To get a real .dSYM bundle produced by dsymutil, set the
3005 # debug information format to dwarf-with-dsym. Since
3006 # strip_from_xcode will not be used, set Xcode to do the
3007 # stripping as well.
3009 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3010 'DEPLOYMENT_POSTPROCESSING': 'YES',
3011 'STRIP_INSTALLED_PRODUCT': 'YES',
3018 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3020 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3023 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3030 # TODO(jochen): Enable this on chromeos. http://crbug.com/353127
3031 ['os_posix==1 and chromeos==0', {
3032 'target_defaults': {
3034 '-Wl,--fatal-warnings',
3040 ['os_posix==1 and chromeos==0', {
3041 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3042 # and we want to avoid overriding this, so stack-protector is only
3043 # enabled when not building on Chrome OS.
3044 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3046 'target_defaults': {
3048 '-fstack-protector',
3049 '--param=ssp-buffer-size=4',
3053 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3054 'target_defaults': {
3055 # Enable -Werror by default, but put it in a variable so it can
3056 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3058 'werror%': '-Werror',
3059 'libraries_for_target%': '',
3062 '_FILE_OFFSET_BITS=64',
3065 '<(werror)', # See note above about the werror variable.
3068 '-fno-strict-aliasing', # See http://crbug.com/32204
3070 # TODO(evan): turn this back on once all the builds work.
3072 # Don't warn about unused function params. We use those everywhere.
3073 '-Wno-unused-parameter',
3074 # Don't warn about the "struct foo f = {0};" initialization pattern.
3075 '-Wno-missing-field-initializers',
3076 # Don't export any symbols (for example, to plugins we dlopen()).
3077 # Note: this is *required* to make some plugins work.
3078 '-fvisibility=hidden',
3083 '-fno-threadsafe-statics',
3084 # Make inline functions have hidden visiblity by default.
3085 # Surprisingly, not covered by -fvisibility=hidden.
3086 '-fvisibility-inlines-hidden',
3087 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3088 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3092 '-pthread', '-Wl,-z,noexecstack',
3095 '<(libraries_for_target)',
3100 'debug_optimize%': '0',
3106 '-O>(debug_optimize)',
3112 # Only link with needed input sections. This is to avoid
3113 # getting undefined reference to __cxa_bad_typeid in the CDU
3115 '-Wl,--gc-sections',
3116 # Warn in case of text relocations.
3117 '-Wl,--warn-shared-textrel',
3120 ['OS=="android" and android_full_debug==0', {
3121 # Some configurations are copied from Release_Base to reduce
3124 'debug_optimize%': 's',
3127 '-fomit-frame-pointer',
3129 '-ffunction-sections',
3136 ['OS=="linux" and target_arch=="ia32"', {
3138 '-Wl,--no-as-needed',
3141 ['debug_unwind_tables==1', {
3142 'cflags': ['-funwind-tables'],
3144 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3146 # http://gcc.gnu.org/wiki/DebugFission
3147 # Requires gold and gcc >= 4.8 or clang.
3148 ['linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3149 'cflags': ['-gsplit-dwarf'],
3150 'ldflags': ['-Wl,--gdb-index'],
3156 'release_optimize%': '2',
3157 # Binaries become big and gold is unable to perform GC
3158 # and remove unused sections for some of test targets
3159 # on 32 bit platform.
3160 # (This is currently observed only in chromeos valgrind bots)
3161 # The following flag is to disable --gc-sections linker
3162 # option for these bots.
3163 'no_gc_sections%': 0,
3165 # TODO(bradnelson): reexamine how this is done if we change the
3166 # expansion of configurations
3167 'release_valgrind_build%': 0,
3170 '-O<(release_optimize)',
3171 # Don't emit the GCC version ident directives, they just end up
3172 # in the .comment section taking up binary size.
3174 # Put data and code in their own sections, so that unused symbols
3175 # can be removed at link time with --gc-sections.
3177 '-ffunction-sections',
3180 # Specifically tell the linker to perform optimizations.
3181 # See http://lwn.net/Articles/192624/ .
3186 ['no_gc_sections==0', {
3188 '-Wl,--gc-sections',
3193 'release_optimize%': 's',
3196 '-fomit-frame-pointer',
3199 # Warn in case of text relocations.
3200 '-Wl,--warn-shared-textrel',
3210 '-fno-omit-frame-pointer',
3214 ['profiling_full_stack_frames==1', {
3217 '-fno-optimize-sibling-calls',
3222 ['release_unwind_tables==1', {
3223 'cflags': ['-funwind-tables'],
3225 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3231 ['target_arch=="ia32"', {
3232 'target_conditions': [
3233 ['_toolset=="target"', {
3235 # Needed so that libs with .s files (e.g. libicudata.a)
3236 # are compatible with the general 32-bit-ness.
3239 # All floating-point computations on x87 happens in 80-bit
3240 # precision. Because the C and C++ language standards allow
3241 # the compiler to keep the floating-point values in higher
3242 # precision than what's specified in the source and doing so
3243 # is more efficient than constantly rounding up to 64-bit or
3244 # 32-bit precision as specified in the source, the compiler,
3245 # especially in the optimized mode, tries very hard to keep
3246 # values in x87 floating-point stack (in 80-bit precision)
3247 # as long as possible. This has important side effects, that
3248 # the real value used in computation may change depending on
3249 # how the compiler did the optimization - that is, the value
3250 # kept in 80-bit is different than the value rounded down to
3251 # 64-bit or 32-bit. There are possible compiler options to
3252 # make this behavior consistent (e.g. -ffloat-store would keep
3253 # all floating-values in the memory, thus force them to be
3254 # rounded to its original precision) but they have significant
3255 # runtime performance penalty.
3257 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3258 # which keep floating-point values in SSE registers in its
3259 # native precision (32-bit for single precision, and 64-bit
3260 # for double precision values). This means the floating-point
3261 # value used during computation does not change depending on
3262 # how the compiler optimized the code, since the value is
3263 # always kept in its specified precision.
3265 # Refer to http://crbug.com/348761 for rationale behind SSE2
3266 # being a minimum requirement for 32-bit Linux builds and
3267 # http://crbug.com/313032 for an example where this has "bit"
3272 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3279 # Use gold linker for Android ia32 target.
3288 # Install packages have started cropping up with
3289 # different headers between the 32-bit and 64-bit
3290 # versions, so we have to shadow those differences off
3291 # and make sure a 32-bit-on-64-bit build picks up the
3293 # For android build, use NDK headers instead of host headers
3294 ['host_arch!="ia32" and OS!="android"', {
3303 ['target_arch=="x64"', {
3304 'target_conditions': [
3305 ['_toolset=="target"', {
3307 # Use gold linker for Android x64 target.
3327 ['target_arch=="arm"', {
3328 'target_conditions': [
3329 ['_toolset=="target"', {
3331 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3332 # has changed whenever it encounters a varargs function. This
3333 # silences those warnings, as they are not helpful and
3334 # clutter legitimate warnings.
3340 '-march=<(arm_arch)',
3345 '-mtune=<(arm_tune)',
3353 ['arm_float_abi!=""', {
3355 '-mfloat-abi=<(arm_float_abi)',
3364 # Most of the following flags are derived from what Android
3365 # uses by default when building for arm, reference for which
3366 # can be found in the following file in the Android NDK:
3367 # toolchains/arm-linux-androideabi-4.4.3/setup.mk
3369 # The tree-sra optimization (scalar replacement for
3370 # aggregates enabling subsequent optimizations) leads to
3371 # invalid code generation when using the Android NDK's
3372 # compiler (r5-r7). This can be verified using
3373 # webkit_unit_tests' WTF.Checked_int8_t test.
3378 # Android now supports .relro sections properly.
3379 # NOTE: While these flags enable the generation of .relro
3380 # sections, the generated libraries can still be loaded on
3381 # older Android platform versions.
3389 'cflags': [ '-mthumb-interwork' ],
3393 '-marm', # Probably reduntant, but recommend by "perf" docs.
3394 '-mapcs-frame', # Seems required by -fno-omit-frame-pointer.
3399 # Clang does not support the following options.
3400 '-mthumb-interwork',
3401 '-finline-limit=64',
3407 # TODO(hans) Enable integrated-as (crbug.com/124610).
3408 '-no-integrated-as',
3409 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3413 # Clang does not support the following options.
3417 # As long as -fuse-ld=gold doesn't work, add a dummy directory
3418 # with an 'ld' that redirects to gold, so that clang uses gold.
3419 '-B<(PRODUCT_DIR)/../../build/android/arm-linux-androideabi-gold',
3424 '-marm', # Required for frame pointer based stack traces.
3433 ['target_arch=="arm64"', {
3434 'target_conditions': [
3435 ['_toolset=="target"', {
3439 '-fstack-protector', # stack protector is always enabled on arm64.
3446 ['target_arch=="mipsel"', {
3447 'target_conditions': [
3448 ['_toolset=="target"', {
3450 ['android_webview_build==0 and mips_arch_variant=="mips32r2"', {
3451 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
3453 ['android_webview_build==0 and mips_arch_variant!="mips32r2"', {
3454 'cflags': ['-mips32', '-Wa,-mips32'],
3463 '-Wl,--no-keep-memory'
3466 '-Wno-uninitialized',
3480 'target_conditions': [
3481 ['_toolset=="target"', {
3483 '--sysroot=<(sysroot)',
3486 '--sysroot=<(sysroot)',
3487 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
3495 # Don't die on dtoa code that uses a char as an array index.
3496 '-Wno-char-subscripts',
3498 # TODO(thakis): This used to be implied by -Wno-unused-function,
3499 # which we no longer use. Check if it makes sense to remove
3500 # this as well. http://crbug.com/316352
3501 '-Wno-unneeded-internal-declaration',
3503 # Warns on switches on enums that cover all enum values but
3504 # also contain a default: branch. Chrome is full of that.
3505 '-Wno-covered-switch-default',
3507 # Warns when a const char[] is converted to bool.
3508 '-Wstring-conversion',
3510 # C++11-related flags:
3512 # This warns on using ints as initializers for floats in
3513 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
3514 # which happens in several places in chrome code. Not sure if
3515 # this is worth fixing.
3516 '-Wno-c++11-narrowing',
3518 # TODO(thakis): Remove, http://crbug.com/263960
3519 '-Wno-reserved-user-defined-literal',
3521 # Clang considers the `register` keyword as deprecated, but e.g.
3522 # code generated by flex (used in angle) contains that keyword.
3523 # http://crbug.com/255186
3524 '-Wno-deprecated-register',
3527 # Clang doesn't seem to know know this flag.
3531 # See the comment in the Mac section for what it takes to move
3532 # this to -std=c++11.
3536 ['clang==1 and OS=="android"', {
3537 # Android uses stlport, whose include/new defines
3538 # `void operator delete[](void* ptr) throw();`, which
3539 # clang's -Wimplicit-exception-spec-mismatch warns about for some
3540 # reason -- http://llvm.org/PR16638. TODO(thakis): Include stlport
3541 # via -isystem instead.
3543 '-Wno-implicit-exception-spec-mismatch',
3546 ['clang==1 and clang_use_chrome_plugins==1', {
3548 '<@(clang_chrome_plugins_flags)',
3551 ['clang==1 and clang_load!=""', {
3553 '-Xclang', '-load', '-Xclang', '<(clang_load)',
3556 ['clang==1 and clang_add_plugin!=""', {
3558 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
3561 ['clang==1 and target_arch=="ia32"', {
3563 # Else building libyuv gives clang's register allocator issues,
3564 # see llvm.org/PR15798 / crbug.com/233709
3565 '-momit-leaf-frame-pointer',
3568 ['clang==1 and "<(GENERATOR)"=="ninja"', {
3570 # See http://crbug.com/110262
3571 '-fcolor-diagnostics',
3574 # Common options for AddressSanitizer, LeakSanitizer,
3575 # ThreadSanitizer and MemorySanitizer.
3576 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
3577 'target_conditions': [
3578 ['_toolset=="target"', {
3580 '-fno-omit-frame-pointer',
3581 '-gline-tables-only',
3584 '-fomit-frame-pointer',
3587 # Functions interposed by the sanitizers can make ld think
3588 # that some libraries aren't needed when they actually are,
3589 # http://crbug.com/234010. As workaround, disable --as-needed.
3593 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3599 'target_conditions': [
3600 ['_toolset=="target"', {
3602 '-fsanitize=address',
3603 '-w', # http://crbug.com/162783
3606 '-fsanitize=address',
3609 'ADDRESS_SANITIZER',
3616 '-mllvm -asan-globals=0', # http://crbug.com/352073
3621 ['asan_coverage!=0', {
3622 'target_conditions': [
3623 ['_toolset=="target"', {
3625 '-mllvm -asan-coverage=<(asan_coverage)',
3631 'target_conditions': [
3632 ['_toolset=="target"', {
3641 'WTF_USE_LEAK_SANITIZER=1',
3647 'target_conditions': [
3648 ['_toolset=="target"', {
3650 '-fsanitize=thread',
3652 '-mllvm', '-tsan-blacklist=<(tsan_blacklist)',
3655 '-fsanitize=thread',
3659 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
3660 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
3662 'target_conditions': [
3663 ['_type=="executable"', {
3673 'target_conditions': [
3674 ['_toolset=="target"', {
3676 '-fsanitize=memory',
3677 '-fsanitize-memory-track-origins',
3679 '-fsanitize-blacklist=<(msan_blacklist)',
3682 '-fsanitize=memory',
3687 'target_conditions': [
3688 ['_type=="executable"', {
3697 ['use_instrumented_libraries==1', {
3699 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
3703 'target_conditions': [
3704 ['_toolset=="target"', {
3706 # Add RPATH to result binary to make it linking instrumented libraries ($ORIGIN means relative RPATH)
3707 '-Wl,-R,\$$ORIGIN/instrumented_libraries/asan/lib/:\$$ORIGIN/instrumented_libraries/asan/usr/lib/x86_64-linux-gnu/',
3714 'target_conditions': [
3715 ['_toolset=="target"', {
3717 '-Wl,-R,\$$ORIGIN/instrumented_libraries/msan/lib/:\$$ORIGIN/instrumented_libraries/msan/usr/lib/x86_64-linux-gnu/',
3724 'target_conditions': [
3725 ['_toolset=="target"', {
3727 # Add RPATH to result binary to make it linking instrumented libraries ($ORIGIN means relative RPATH)
3728 '-Wl,-R,\$$ORIGIN/instrumented_libraries/tsan/lib/:\$$ORIGIN/instrumented_libraries/tsan/usr/lib/x86_64-linux-gnu/',
3736 ['use_custom_libcxx==1', {
3738 '<(DEPTH)/third_party/libc++/libc++.gyp:libc++',
3739 '<(DEPTH)/third_party/libc++abi/libc++abi.gyp:libc++abi',
3742 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
3743 'target_conditions' : [
3744 ['_toolset=="target"', {
3746 '-finstrument-functions',
3747 # Allow mmx intrinsics to inline, so that the
3748 #0 compiler can expand the intrinsics.
3749 '-finstrument-functions-exclude-file-list=mmintrin.h',
3752 ['_toolset=="target" and OS=="android"', {
3754 # Avoids errors with current NDK:
3755 # "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"
3756 '-finstrument-functions-exclude-file-list=arm_neon.h',
3761 ['linux_dump_symbols==1', {
3764 ['target_arch=="ia32" and OS!="android"', {
3765 'target_conditions': [
3766 ['_toolset=="target"', {
3768 # Workaround for linker OOM.
3769 '-Wl,--no-keep-memory',
3776 # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
3777 ['(use_allocator!="tcmalloc" and (use_allocator!="see_use_tcmalloc" or linux_use_tcmalloc==0)) and android_use_tcmalloc==0', {
3778 'defines': ['NO_TCMALLOC'],
3780 ['linux_use_gold_flags==1', {
3781 'target_conditions': [
3782 ['_toolset=="target"', {
3784 # Experimentation found that using four linking threads
3785 # saved ~20% of link time.
3786 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
3787 # Only apply this to the target linker, since the host
3788 # linker might not be gold, but isn't used much anyway.
3789 # TODO(raymes): Disable threading because gold is frequently
3790 # crashing on the bots: crbug.com/161942.
3792 # '-Wl,--thread-count=4',
3797 ['release_valgrind_build==0', {
3798 'target_conditions': [
3799 ['_toolset=="target"', {
3801 # There seems to be a conflict of --icf and -pie
3802 # in gold which can generate crashy binaries. As
3803 # a security measure, -pie takes precendence for
3813 ['linux_use_gold_binary==1', {
3815 # Put our gold binary in the search path for the linker.
3816 # We pass the path to gold to the compiler. gyp leaves
3817 # unspecified what the cwd is when running the compiler,
3818 # so the normal gyp path-munging fails us. This hack
3819 # gets the right path.
3820 '-B<!(cd <(DEPTH) && pwd -P)/third_party/gold',
3826 # FreeBSD-specific options; note that most FreeBSD options are set above,
3829 'target_defaults': {
3831 '-Wl,--no-keep-memory',
3835 # Android-specific options; note that most are set above with Linux.
3838 # This is a unique identifier for a given build. It's used for
3839 # identifying various build artifacts corresponding to a particular
3840 # build of chrome (e.g. where to find archived symbols).
3841 'chrome_build_id%': '',
3843 # Use shared stlport library when system one used.
3844 # Figure this out early since it needs symbols from libgcc.a, so it
3845 # has to be before that in the set of libraries.
3846 ['use_system_stlport==1', {
3847 'android_stlport_library': 'stlport',
3850 ['component=="shared_library"', {
3851 'android_stlport_library': 'stlport_shared',
3853 'android_stlport_library': 'stlport_static',
3859 # Placing this variable here prevents from forking libvpx, used
3860 # by remoting. Remoting is off, so it needn't built,
3861 # so forking it's deps seems like overkill.
3862 # But this variable need defined to properly run gyp.
3863 # A proper solution is to have an OS==android conditional
3864 # in third_party/libvpx/libvpx.gyp to define it.
3865 'libvpx_path': 'lib/linux/arm',
3867 'target_defaults': {
3869 'release_extra_cflags%': '',
3871 # If we're using the components build, append "cr" to all shared
3872 # libraries to avoid naming collisions with android system library
3873 # versions with the same name (e.g. skia, icu).
3874 ['component=="shared_library"', {
3875 'android_product_extension': 'cr.so',
3877 'android_product_extension': 'so',
3881 'target_conditions': [
3882 ['_type=="shared_library"', {
3883 'product_extension': '<(android_product_extension)',
3886 # Settings for building device targets using Android's toolchain.
3887 # These are based on the setup.mk file from the Android NDK.
3889 # The NDK Android executable link step looks as follows:
3891 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
3892 # $(PRIVATE_OBJECTS) <-- The .o that we built
3893 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
3894 # $(TARGET_LIBGCC) <-- libgcc.a
3895 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
3896 # $(PRIVATE_LDLIBS) <-- System .so
3897 # $(TARGET_CRTEND_O) <-- crtend.o
3899 # For now the above are approximated for executables by adding
3900 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
3903 # The NDK Android shared library link step looks as follows:
3905 # $(PRIVATE_OBJECTS) <-- The .o that we built
3906 # -l,--whole-archive
3907 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
3908 # -l,--no-whole-archive
3909 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
3910 # $(TARGET_LIBGCC) <-- libgcc.a
3911 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
3912 # $(PRIVATE_LDLIBS) <-- System .so
3914 # For now, assume that whole static libraries are not needed.
3916 # For both executables and shared libraries, add the proper
3917 # libgcc.a to the start of libraries which puts it in the
3918 # proper spot after .o and .a files get linked in.
3920 # TODO: The proper thing to do longer-tem would be proper gyp
3921 # support for a custom link command line.
3922 ['_toolset=="target"', {
3924 '-pthread', # Not supported by Android toolchain.
3927 '-ffunction-sections',
3930 '-fstack-protector',
3932 '-finline-limit=64',
3933 '-Wa,--noexecstack',
3934 '<@(release_extra_cflags)',
3938 '__GNU_SOURCE=1', # Necessary for clone()
3940 '_STLP_USE_PTR_SPECIALIZATIONS=1',
3941 'CHROME_BUILD_ID="<(chrome_build_id)"',
3944 '-pthread', # Not supported by Android toolchain.
3948 '-Wl,--no-undefined',
3949 # Don't export symbols from statically linked libraries.
3950 '-Wl,--exclude-libs=ALL',
3953 '-l<(android_stlport_library)',
3954 # Manually link the libgcc.a that the cross compiler uses.
3955 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
3961 ['component=="shared_library"', {
3963 '-Wl,--exclude-libs=ALL',
3968 # Work around incompatibilities between bionic and clang
3970 '-D__compiler_offsetof=__builtin_offsetof',
3971 '-Dnan=__builtin_nan',
3974 ['target_arch=="arm"', {
3976 '-target arm-linux-androideabi',
3977 '-mllvm -arm-enable-ehabi',
3980 '-target arm-linux-androideabi',
3983 ['target_arch=="ia32"', {
3985 '-target x86-linux-androideabi',
3988 '-target x86-linux-androideabi',
3991 # Place holder for x64 support, not tested.
3992 # TODO: Enable clang support for Android x64. http://crbug.com/346626
3993 ['target_arch=="x64"', {
3995 '-target x86_64-linux-androideabi',
3998 '-target x86_64-linux-androideabi',
4005 # Android build relies on -Wl,--gc-sections removing
4006 # unreachable code. ASan instrumentation for globals inhibits
4007 # this and results in a library with unresolvable relocations.
4008 # TODO(eugenis): find a way to reenable this.
4009 '-mllvm -asan-globals=0',
4012 ['enable_resource_whitelist_generation==1', {
4014 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
4017 ['android_webview_build==0', {
4019 # The NDK has these things, but doesn't define the constants
4020 # to say that it does. Define them here instead.
4024 '--sysroot=<(android_ndk_sysroot)',
4027 '--sysroot=<(android_ndk_sysroot)',
4030 ['android_webview_build==1', {
4032 # OpenAL headers from the Android tree.
4033 '<(android_src)/frameworks/wilhelm/include',
4036 # Android predefines this as 1; undefine it here so Chromium
4037 # can redefine it later to be 2 for chromium code and unset
4038 # for third party code. This works because cflags are added
4040 '-U_FORTIFY_SOURCE',
4041 # Disable any additional warnings enabled by the Android build system but which
4042 # chromium does not build cleanly with (when treating warning as errors).
4043 # Things that are part of -Wextra:
4044 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4045 '-Wno-ignored-qualifiers',
4047 '-Wno-unused-but-set-variable',
4050 # Other things unrelated to -Wextra:
4051 '-Wno-non-virtual-dtor',
4055 ['android_webview_build==1', {
4056 'target_conditions': [
4057 ['chromium_code==0', {
4059 # There is a class of warning which:
4060 # 1) Android always enables and also treats as errors
4061 # 2) Chromium ignores in third party code
4062 # So we re-enable those warnings when building Android.
4064 '-Wno-format-security',
4066 '-Wno-sequence-point',
4069 '-Wno-non-virtual-dtor',
4074 ['target_arch == "arm"', {
4076 # Enable identical code folding to reduce size.
4080 # NOTE: The stlport header include paths below are specified in
4081 # cflags rather than include_dirs because they need to come
4082 # after include_dirs. Think of them like system headers, but
4083 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4084 # toolchain (circa Gingerbread) will exhibit strange errors.
4085 # The include ordering here is important; change with caution.
4086 ['use_system_stlport==1', {
4088 # For libstdc++/include, which is used by stlport.
4089 '-I<(android_src)/bionic',
4090 '-I<(android_src)/external/stlport/stlport',
4092 }, { # else: use_system_stlport!=1
4094 '-I<(android_stlport_include)',
4097 '-L<(android_stlport_libs_dir)',
4100 ['target_arch=="ia32"', {
4101 # The x86 toolchain currently has problems with stack-protector.
4103 '-fstack-protector',
4106 '-fno-stack-protector',
4110 'target_conditions': [
4111 ['_type=="executable"', {
4114 '-Wl,--gc-sections',
4115 '-Wl,-z,nocopyreloc',
4116 # crtbegin_dynamic.o should be the last item in ldflags.
4117 '<(android_ndk_lib)/crtbegin_dynamic.o',
4120 # crtend_android.o needs to be the last item in libraries.
4121 # Do not add any libraries after this!
4122 '<(android_ndk_lib)/crtend_android.o',
4135 ['_type=="shared_library" or _type=="loadable_module"', {
4137 '-Wl,-shared,-Bsymbolic',
4140 ['android_webview_build==0', {
4142 # crtbegin_so.o should be the last item in ldflags.
4143 '<(android_ndk_lib)/crtbegin_so.o',
4146 # crtend_so.o needs to be the last item in libraries.
4147 # Do not add any libraries after this!
4148 '<(android_ndk_lib)/crtend_so.o',
4155 # Settings for building host targets using the system toolchain.
4156 ['_toolset=="host"', {
4158 # Due to issues in Clang build system, using ASan on 32-bit
4159 # binaries on x86_64 host is problematic.
4160 # TODO(eugenis): re-enable.
4161 '-fsanitize=address',
4162 '-w', # http://crbug.com/162783
4165 '-fsanitize=address',
4166 '-Wl,-z,noexecstack',
4167 '-Wl,--gc-sections',
4170 '-Wl,--warn-shared-textrel',
4171 '-Wl,--fatal-warnings',
4174 # Settings for building host targets on mac.
4175 ['_toolset=="host" and host_os=="mac"', {
4185 'cflags!': ['-fvisibility=hidden'],
4186 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4188 ['OS=="mac" or OS=="ios"', {
4189 'target_defaults': {
4192 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4193 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4194 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4195 'COPY_PHASE_STRIP': 'NO',
4196 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4197 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4198 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4199 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4200 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4201 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4202 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4203 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4204 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4205 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4206 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4207 'GCC_VERSION': '4.2',
4208 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4209 'USE_HEADERMAP': 'NO',
4214 # Don't warn about unused function parameters.
4215 '-Wno-unused-parameter',
4216 # Don't warn about the "struct foo f = {0};" initialization
4218 '-Wno-missing-field-initializers',
4221 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4222 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4224 # Note that the prebuilt Clang binaries should not be used for iOS
4225 # development except for ASan builds.
4227 # gnu++11 instead of c++11 is needed because some code uses
4228 # typeof() (a GNU extension).
4229 # TODO(thakis): Eventually switch this to c++11 instead of
4230 # gnu++11 (once typeof can be removed, which is blocked on c++11
4231 # being available everywhere).
4232 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', # -std=gnu++11
4233 # Warn if automatic synthesis is triggered with
4234 # the -Wobjc-missing-property-synthesis flag.
4235 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4236 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4240 # This warns on using ints as initializers for floats in
4241 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
4242 # which happens in several places in chrome code. Not sure if
4243 # this is worth fixing.
4244 '-Wno-c++11-narrowing',
4246 # Don't die on dtoa code that uses a char as an array index.
4247 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
4248 '-Wno-char-subscripts',
4250 # TODO(thakis): This used to be implied by -Wno-unused-function,
4251 # which we no longer use. Check if it makes sense to remove
4252 # this as well. http://crbug.com/316352
4253 '-Wno-unneeded-internal-declaration',
4255 # Warns on switches on enums that cover all enum values but
4256 # also contain a default: branch. Chrome is full of that.
4257 '-Wno-covered-switch-default',
4259 # Warns when a const char[] is converted to bool.
4260 '-Wstring-conversion',
4262 # Clang considers the `register` keyword as deprecated, but
4263 # e.g. code generated by flex (used in angle) contains that
4264 # keyword. http://crbug.com/255186
4265 '-Wno-deprecated-register',
4269 ['clang_xcode==0', {
4270 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4271 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4275 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4277 '<@(clang_chrome_plugins_flags)',
4280 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4282 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4285 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4287 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4290 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4292 # See http://crbug.com/110262
4293 '-fcolor-diagnostics',
4301 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4307 '-fsanitize=address',
4308 '-mllvm -asan-globals=0', # http://crbug.com/352073
4309 '-w', # http://crbug.com/162783
4313 'ADDRESS_SANITIZER',
4314 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4317 ['asan_coverage!=0', {
4318 'target_conditions': [
4319 ['_toolset=="target"', {
4321 '-mllvm -asan-coverage=<(asan_coverage)',
4327 'target_conditions': [
4328 ['_type!="static_library"', {
4329 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4334 '-fsanitize=address',
4338 ['mac_write_linker_maps==1', {
4341 '-Wl,-map,>(_target_name).map',
4348 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4349 'target_conditions': [
4350 ['_type=="executable"', {
4356 # Define copy_asan_dylib_path in a variable ending in
4357 # _path so that gyp understands it's a path and
4358 # performs proper relativization during dict merging.
4359 'copy_asan_dylib_path':
4360 'mac/copy_asan_runtime_dylib.sh',
4362 'postbuild_name': 'Copy ASan runtime dylib',
4364 '<(copy_asan_dylib_path)',
4373 ], # target_conditions
4374 }, # target_defaults
4375 }], # OS=="mac" or OS=="ios"
4377 'target_defaults': {
4379 # These should end with %, but there seems to be a bug with % in
4380 # variables that are intended to be set to different values in
4381 # different targets, like these.
4382 'mac_pie': 1, # Most executables can be position-independent.
4383 # Strip debugging symbols from the target.
4384 'mac_strip': '<(mac_strip_release)',
4388 ['mac_want_real_dsym=="default"', {
4391 'mac_real_dsym': '<(mac_want_real_dsym)'
4396 ['mac_want_real_dsym=="default"', {
4397 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
4399 'mac_real_dsym': '<(mac_want_real_dsym)'
4406 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
4407 # (Equivalent to -fPIC)
4408 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
4409 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4410 # Keep pch files below xcodebuild/.
4411 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
4413 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
4414 # xcode_setting, but not until all downstream projects' mac bots are
4415 # using xcode >= 4.6, because that's when the default value of the
4416 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
4417 # setting is a no-op as far as xcode is concerned, but the compiler
4418 # behaves differently based on whether -fno-strict-aliasing is
4420 '-fno-strict-aliasing', # See http://crbug.com/32204.
4423 'target_conditions': [
4424 ['_type=="executable"', {
4427 # Arranges for data (heap) pages to be protected against
4428 # code execution when running on Mac OS X 10.7 ("Lion"), and
4429 # ensures that the position-independent executable (PIE) bit
4430 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
4432 # Define change_mach_o_flags in a variable ending in _path
4433 # so that GYP understands it's a path and performs proper
4434 # relativization during dict merging.
4435 'change_mach_o_flags_path':
4436 'mac/change_mach_o_flags_from_xcode.sh',
4437 'change_mach_o_flags_options%': [
4439 'target_conditions': [
4440 ['mac_pie==0 or release_valgrind_build==1', {
4441 # Don't enable PIE if it's unwanted. It's unwanted if
4442 # the target specifies mac_pie=0 or if building for
4443 # Valgrind, because Valgrind doesn't understand slide.
4444 # See the similar mac_pie/release_valgrind_build check
4446 'change_mach_o_flags_options': [
4452 'postbuild_name': 'Change Mach-O Flags',
4454 '<(change_mach_o_flags_path)',
4455 '>@(change_mach_o_flags_options)',
4462 'asan_saves_file': 'asan.saves',
4465 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
4469 'target_conditions': [
4470 ['mac_pie==1 and release_valgrind_build==0', {
4471 # Turn on position-independence (ASLR) for executables. When
4472 # PIE is on for the Chrome executables, the framework will
4473 # also be subject to ASLR.
4474 # Don't do this when building for Valgrind, because Valgrind
4475 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
4476 # understand slide, and get rid of the Valgrind check.
4479 '-Wl,-pie', # Position-independent executable (MH_PIE)
4485 ['(_type=="executable" or _type=="shared_library" or \
4486 _type=="loadable_module") and mac_strip!=0', {
4487 'target_conditions': [
4488 ['mac_real_dsym == 1', {
4489 # To get a real .dSYM bundle produced by dsymutil, set the
4490 # debug information format to dwarf-with-dsym. Since
4491 # strip_from_xcode will not be used, set Xcode to do the
4492 # stripping as well.
4496 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
4497 'DEPLOYMENT_POSTPROCESSING': 'YES',
4498 'STRIP_INSTALLED_PRODUCT': 'YES',
4499 'target_conditions': [
4500 ['_type=="shared_library" or _type=="loadable_module"', {
4501 # The Xcode default is to strip debugging symbols
4502 # only (-S). Local symbols should be stripped as
4503 # well, which will be handled by -x. Xcode will
4504 # continue to insert -S when stripping even when
4505 # additional flags are added with STRIPFLAGS.
4507 }], # _type=="shared_library" or _type=="loadable_module"
4508 ['_type=="executable"', {
4511 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
4514 }], # _type=="executable" and asan==1
4515 ], # target_conditions
4517 }, # configuration "Release"
4519 }, { # mac_real_dsym != 1
4520 # To get a fast fake .dSYM bundle, use a post-build step to
4521 # produce the .dSYM and strip the executable. strip_from_xcode
4522 # only operates in the Release configuration.
4526 # Define strip_from_xcode in a variable ending in _path
4527 # so that gyp understands it's a path and performs proper
4528 # relativization during dict merging.
4529 'strip_from_xcode_path': 'mac/strip_from_xcode',
4531 'postbuild_name': 'Strip If Needed',
4532 'action': ['<(strip_from_xcode_path)'],
4536 ], # target_conditions
4537 }], # (_type=="executable" or _type=="shared_library" or
4538 # _type=="loadable_module") and mac_strip!=0
4539 ], # target_conditions
4540 }, # target_defaults
4543 'target_defaults': {
4544 'xcode_settings' : {
4545 # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang
4547 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',
4550 # Older Xcodes do not support -Wno-deprecated-register, so pass an
4551 # additional flag to suppress the "unknown compiler option" error.
4552 # Restrict this flag to builds that are either compiling with Xcode
4553 # or compiling with Xcode's Clang. This will allow Ninja builds to
4554 # continue failing on unknown compiler options.
4555 # TODO(rohitrao): This flag is temporary and should be removed as
4556 # soon as the iOS bots are updated to use Xcode 5.1.
4557 ['clang_xcode==1', {
4559 '-Wno-unknown-warning-option',
4563 # Limit the valid architectures depending on "target_subarch".
4564 # This need to include the "arm" architectures but also the "x86"
4565 # ones (they are used when building for the simulator).
4566 ['target_subarch=="arm32"', {
4567 'VALID_ARCHS': ['armv7', 'i386'],
4569 ['target_subarch=="arm64"', {
4570 'VALID_ARCHS': ['arm64', 'x86_64'],
4572 ['target_subarch=="both"', {
4573 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
4577 'target_conditions': [
4578 ['_toolset=="host"', {
4580 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
4581 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4590 ['_toolset=="target"', {
4592 # This section should be for overriding host settings. But,
4593 # since we can't negate the iphone deployment target above, we
4594 # instead set it here for target only.
4595 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
4596 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
4599 ['_type=="executable"', {
4603 'DEPLOYMENT_POSTPROCESSING': 'YES',
4604 'STRIP_INSTALLED_PRODUCT': 'YES',
4609 # Remove dSYM to reduce build time.
4610 'DEBUG_INFORMATION_FORMAT': 'dwarf',
4616 ['chromium_ios_signing', {
4617 # iOS SDK wants everything for device signed.
4618 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
4620 'CODE_SIGNING_REQUIRED': 'NO',
4621 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
4626 ], # target_conditions
4627 }, # target_defaults
4630 'target_defaults': {
4632 '_WIN32_WINNT=0x0602',
4639 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
4640 'WIN32_LEAN_AND_MEAN',
4644 ['buildtype=="Official"', {
4645 # In official builds, targets can self-select an optimization
4646 # level by defining a variable named 'optimize', and setting it
4648 # - "size", optimizes for minimal code size - the default.
4649 # - "speed", optimizes for speed over code size.
4650 # - "max", whole program optimization and link-time code
4651 # generation. This is very expensive and should be used
4654 'optimize%': 'size',
4658 # Set /LTCG for the official builds.
4659 'LinkTimeCodeGeneration': '1',
4662 'target_conditions': [
4663 ['optimize=="size"', {
4665 'VCCLCompilerTool': {
4666 # 1, optimizeMinSpace, Minimize Size (/O1)
4667 'Optimization': '1',
4668 # 2, favorSize - Favor small code (/Os)
4669 'FavorSizeOrSpeed': '2',
4674 ['optimize=="speed"', {
4676 'VCCLCompilerTool': {
4677 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
4678 'Optimization': '2',
4679 # 1, favorSpeed - Favor fast code (/Ot)
4680 'FavorSizeOrSpeed': '1',
4685 ['optimize=="max"', {
4687 'VCCLCompilerTool': {
4688 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
4689 'Optimization': '2',
4690 # 1, favorSpeed - Favor fast code (/Ot)
4691 'FavorSizeOrSpeed': '1',
4692 # This implies link time code generation.
4693 'WholeProgramOptimization': 'true',
4701 ['component=="static_library"', {
4703 '_HAS_EXCEPTIONS=0',
4716 'AdditionalLibraryDirectories':
4717 ['<(windows_driver_kit_path)/lib/ATL/i386'],
4719 'VCLibrarianTool': {
4720 'AdditionalLibraryDirectories':
4721 ['<(windows_driver_kit_path)/lib/ATL/i386'],
4727 'VCLibrarianTool': {
4728 'AdditionalLibraryDirectories':
4729 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
4732 'AdditionalLibraryDirectories':
4733 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
4740 # Explicitly required when using the ATL with express
4741 'AdditionalDependencies': ['atlthunk.lib'],
4743 # ATL 8.0 included in WDK 7.1 makes the linker to generate
4744 # almost eight hundred LNK4254 and LNK4078 warnings:
4745 # - warning LNK4254: section 'ATL' (50000040) merged into
4746 # '.rdata' (40000040) with different attributes
4747 # - warning LNK4078: multiple 'ATL' sections found with
4748 # different attributes
4749 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
4752 'msvs_system_include_dirs': [
4753 '<(windows_driver_kit_path)/inc/atl71',
4754 '<(windows_driver_kit_path)/inc/mfc42',
4756 'target_conditions': [
4757 ['chromium_code and MSVS_VERSION=="2010e"', {
4758 # Workaround for intsafe in 2010 Express + WDK.
4759 # ATL code uses intsafe.h and both intsafe.h and stdint.h
4760 # define INT8_MIN et al.
4761 # We can't use this workaround in third_party code because
4762 # it has various levels of intolerance for including stdint.h.
4763 # This is not necessary in 2013e, and should be removed once
4764 # mainline is switched: http://crbug.com/340358.
4765 'msvs_system_include_dirs': [
4769 'VCCLCompilerTool': {
4770 'ForcedIncludeFiles': [ 'intsafe_workaround.h', ],
4777 'msvs_system_include_dirs': [
4778 '<(windows_sdk_path)/Include/shared',
4779 '<(windows_sdk_path)/Include/um',
4780 '<(windows_sdk_path)/Include/winrt',
4781 '$(VSInstallDir)/VC/atlmfc/include',
4783 'msvs_cygwin_shell': 0,
4784 'msvs_disabled_warnings': [4351, 4355, 4396, 4503, 4819,
4785 # TODO(maruel): These warnings are level 4. They will be slowly
4786 # removed as code is fixed.
4787 4100, 4121, 4125, 4127, 4130, 4131, 4189, 4201, 4238, 4244, 4245,
4788 4310, 4428, 4481, 4505, 4510, 4512, 4530, 4610, 4611, 4701, 4702,
4792 'VCCLCompilerTool': {
4793 'AdditionalOptions': ['/MP'],
4794 'MinimalRebuild': 'false',
4795 'BufferSecurityCheck': 'true',
4796 'EnableFunctionLevelLinking': 'true',
4797 'RuntimeTypeInfo': 'false',
4798 'WarningLevel': '4',
4799 'WarnAsError': 'true',
4800 'DebugInformationFormat': '3',
4802 ['component=="shared_library"', {
4803 'ExceptionHandling': '1', # /EHsc
4805 'ExceptionHandling': '0',
4809 'VCLibrarianTool': {
4810 'AdditionalOptions': ['/ignore:4221'],
4811 'AdditionalLibraryDirectories': [
4812 '<(windows_sdk_path)/Lib/win8/um/x86',
4816 'AdditionalDependencies': [
4828 'AdditionalLibraryDirectories': [
4829 '<(windows_sdk_path)/Lib/win8/um/x86',
4831 'GenerateDebugInformation': 'true',
4832 'MapFileName': '$(OutDir)\\$(TargetName).map',
4833 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
4834 'FixedBaseAddress': '1',
4837 # 1 == /SUBSYSTEM:CONSOLE
4838 # 2 == /SUBSYSTEM:WINDOWS
4839 # Most of the executables we'll ever create are tests
4840 # and utilities with console output.
4844 'GenerateStublessProxies': 'true',
4845 'TypeLibraryName': '$(InputName).tlb',
4846 'OutputDirectory': '$(IntDir)',
4847 'HeaderFileName': '$(InputName).h',
4848 'DLLDataFileName': '$(InputName).dlldata.c',
4849 'InterfaceIdentifierFileName': '$(InputName)_i.c',
4850 'ProxyFileName': '$(InputName)_p.c',
4852 'VCResourceCompilerTool': {
4854 'AdditionalIncludeDirectories': [
4856 '<(SHARED_INTERMEDIATE_DIR)',
4859 'target_conditions': [
4860 ['_type=="executable"', {
4862 'EmbedManifest': 'true',
4865 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
4867 'AdditionalManifestFiles': [
4868 '>(win_exe_compatibility_manifest)',
4875 # Building with Clang on Windows is a work in progress and very
4876 # experimental. See crbug.com/82385.
4877 'VCCLCompilerTool': {
4878 'WarnAsError': 'false',
4879 'RuntimeTypeInfo': 'false',
4880 'AdditionalOptions': [
4883 # Many files use intrinsics without including this header.
4884 # TODO(hans): Fix those files, or move this to sub-GYPs.
4887 # TODO(hans): Make this list shorter eventually.
4888 '-Qunused-arguments',
4889 '-Wno-c++11-compat-deprecated-writable-strings',
4890 '-Wno-char-subscripts',
4891 '-Wno-deprecated-declarations',
4892 '-Wno-deprecated-register',
4894 '-Wno-enum-conversion',
4895 '-Wno-extra-tokens',
4896 '-Wno-ignored-attributes',
4897 '-Wno-incompatible-pointer-types',
4898 '-Wno-int-to-void-pointer-cast',
4899 '-Wno-invalid-noreturn',
4900 '-Wno-logical-op-parentheses',
4902 '-Wno-missing-braces',
4903 '-Wno-missing-declarations',
4904 '-Wno-msvc-include',
4905 '-Wno-null-dereference',
4906 '-Wno-overloaded-virtual',
4908 '-Wno-pointer-sign',
4910 '-Wno-return-type-c-linkage',
4912 '-Wno-sometimes-uninitialized',
4914 '-Wno-tautological-compare',
4915 '-Wno-unknown-pragmas',
4917 '-Wno-unused-function',
4918 '-Wno-unused-private-field',
4919 '-Wno-unused-value',
4920 '-Wno-unused-variable',
4925 ['MSVS_VERSION=="2013" or MSVS_VERSION=="2013e"', {
4926 'VCCLCompilerTool': {
4927 'AdditionalOptions': [
4928 '-fmsc-version=1800',
4932 ['MSVS_VERSION=="2010" or MSVS_VERSION=="2010e"', {
4933 'VCCLCompilerTool': {
4934 'AdditionalOptions': [
4935 '-fmsc-version=1600',
4942 # ASan on Windows is a work in progress and very experimental.
4943 # See crbug.com/345874.
4944 'VCCLCompilerTool': {
4945 'AdditionalOptions': [
4946 '-fsanitize=address',
4950 'AdditionalLibraryDirectories': [
4951 # TODO(hans): If make_clang_dir is absolute, this breaks.
4952 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.5/lib/windows',
4955 'target_conditions': [
4956 ['_type=="executable"', {
4958 'AdditionalDependencies': [
4959 'clang_rt.asan-i386.lib',
4963 ['_type=="shared_library" or _type=="loadable_module"', {
4965 'AdditionalDependencies': [
4966 'clang_rt.asan_dll_thunk-i386.lib',
4976 ['disable_nacl==1', {
4977 'target_defaults': {
4983 ['OS=="win" and msvs_use_common_linker_extras', {
4984 'target_defaults': {
4999 'AdditionalOptions': [
5008 'AdditionalOptions': ['/largeaddressaware'],
5017 'AdditionalOptions': [
5018 # safeseh is not compatible with x64
5030 ['enable_new_npdevice_api==1', {
5031 'target_defaults': {
5033 'ENABLE_NEW_NPDEVICE_API',
5037 # Don't warn about the "typedef 'foo' locally defined but not used"
5039 # TODO: remove this flag once all builds work. See crbug.com/227506
5040 ['gcc_version>=48', {
5041 'target_defaults': {
5043 '-Wno-unused-local-typedefs',
5047 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5049 'make_global_settings': [
5050 ['CC', '<(make_clang_dir)/bin/clang'],
5051 ['CXX', '<(make_clang_dir)/bin/clang++'],
5052 ['CC.host', '$(CC)'],
5053 ['CXX.host', '$(CXX)'],
5056 ['clang==1 and OS=="win"', {
5057 'make_global_settings': [
5058 # On Windows, gyp's ninja generator only looks at CC.
5059 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5062 ['OS=="android" and clang==0', {
5063 # Hardcode the compiler names in the Makefile so that
5064 # it won't depend on the environment at make time.
5065 'make_global_settings': [
5066 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5067 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5068 ['CC.host', '<!(which gcc)'],
5069 ['CXX.host', '<!(which g++)'],
5072 ['OS=="linux" and target_arch=="mipsel"', {
5073 'make_global_settings': [
5074 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5075 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5076 ['CC.host', '<!(which gcc)'],
5077 ['CXX.host', '<!(which g++)'],
5081 # TODO(yyanagisawa): supports GENERATOR==make
5082 # make generator doesn't support CC_wrapper without CC
5083 # in make_global_settings yet.
5084 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5085 'make_global_settings': [
5086 ['CC_wrapper', '<(gomadir)/gomacc'],
5087 ['CXX_wrapper', '<(gomadir)/gomacc'],
5088 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5089 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5094 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5095 # This block adds *project-wide* configuration settings to each project
5096 # file. It's almost always wrong to put things here. Specify your
5097 # custom xcode_settings in target_defaults to add them to targets instead.
5100 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5101 # setting sets the SDK on a project-wide basis. In order to get the
5102 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5103 # here at the project level.
5106 ['mac_sdk_path==""', {
5107 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5109 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5115 ['ios_sdk_path==""', {
5117 # TODO(justincohen): Ninja only supports simulator for now.
5118 ['"<(GENERATOR)"=="xcode"', {
5119 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5121 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5125 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5130 # Target both iPhone and iPad.
5131 'TARGETED_DEVICE_FAMILY': '1,2',
5134 ['target_arch=="x64"', {
5139 ['target_arch=="ia32"', {
5148 # The Xcode generator will look for an xcode_settings section at the root
5149 # of each dict and use it to apply settings on a file-wide basis. Most
5150 # settings should not be here, they should be in target-specific
5151 # xcode_settings sections, or better yet, should use non-Xcode-specific
5152 # settings in target dicts. SYMROOT is a special case, because many other
5153 # Xcode variables depend on it, including variables such as
5154 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5155 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5156 # files to appear (when present) in the UI as actual files and not red
5157 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5158 # and therefore SYMROOT, needs to be set at the project level.
5159 'SYMROOT': '<(DEPTH)/xcodebuild',