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
40 # Compute the architecture that we're building on.
41 ['OS=="win" or OS=="mac" or OS=="ios"', {
44 'host_arch%': '<!(python <(DEPTH)/build/linux/detect_host_arch.py)',
48 # Copy conditionally-set variables out one scope.
49 'chromeos%': '<(chromeos)',
50 'use_aura%': '<(use_aura)',
51 'use_ash%': '<(use_ash)',
52 'use_cras%': '<(use_cras)',
53 'use_ozone%': '<(use_ozone)',
54 'embedded%': '<(embedded)',
55 'host_arch%': '<(host_arch)',
57 # Whether we are using Views Toolkit
60 # Use OpenSSL instead of NSS as the underlying SSL and crypto
61 # implementation. Certificate verification will in most cases be
62 # handled by the OS. If OpenSSL's struct X509 is used to represent
63 # certificates, use_openssl_certs must be set.
66 # Typedef X509Certificate::OSCertHandle to OpenSSL's struct X509*.
67 'use_openssl_certs%': 0,
69 # Disable viewport meta tag by default.
70 'enable_viewport%': 0,
72 # Enable HiDPI support.
75 # Override buildtype to select the desired build flavor.
76 # Dev - everyday build for development/testing
77 # Official - release build (generally implies additional processing)
78 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
79 # conversion is done), some of the things which are now controlled by
80 # 'branding', such as symbol generation, will need to be refactored
81 # based on 'buildtype' (i.e. we don't care about saving symbols for
82 # non-Official # builds).
85 # Override branding to select the desired branding flavor.
86 'branding%': 'Chromium',
89 # ChromeOS and Windows use Aura and Ash.
90 ['chromeos==1 or OS=="win"', {
100 # ToT Linux should be aura.
102 # TODO(erg): Merge this into the previous block once compiling with
103 # aura safely implies including ash capabilities.
108 # Whether we're a traditional desktop unix.
109 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
115 # Embedded implies ozone.
121 'use_system_fontconfig%': 0,
123 'use_system_fontconfig%': 1,
127 'target_arch%': 'arm',
129 # Default architecture we're building for is the architecture we're
130 # building on, and possibly sub-architecture (for iOS builds).
131 'target_arch%': '<(host_arch)',
135 # Copy conditionally-set variables out one scope.
136 'chromeos%': '<(chromeos)',
137 'desktop_linux%': '<(desktop_linux)',
138 'use_aura%': '<(use_aura)',
139 'use_ash%': '<(use_ash)',
140 'use_cras%': '<(use_cras)',
141 'use_ozone%': '<(use_ozone)',
142 'embedded%': '<(embedded)',
143 'use_openssl%': '<(use_openssl)',
144 'use_openssl_certs%': '<(use_openssl_certs)',
145 'use_system_fontconfig%': '<(use_system_fontconfig)',
146 'enable_viewport%': '<(enable_viewport)',
147 'enable_hidpi%': '<(enable_hidpi)',
148 'buildtype%': '<(buildtype)',
149 'branding%': '<(branding)',
150 'host_arch%': '<(host_arch)',
151 'target_arch%': '<(target_arch)',
153 'target_subarch%': '',
155 # This is set when building the Android WebView inside the Android
156 # build system, using the 'android' gyp backend. The WebView code is
157 # still built when this is unset, but builds using the normal chromium
159 'android_webview_build%': 0,
161 # Set ARM architecture version.
164 # Use aurax11 for clipboard implementation. This is true on linux_aura.
165 'use_clipboard_aurax11%': 0,
169 # If no gomadir is set, it uses the default gomadir.
173 # The system root for cross-compiles. Default: none.
183 # Set default value of toolkit_views based on OS.
184 ['OS=="win" or chromeos==1 or use_aura==1', {
190 # Embedded builds use aura without ash or views.
197 # Enable HiDPI on Mac OS, Chrome OS and Windows.
198 ['OS=="mac" or chromeos==1 or OS=="win"', {
202 # Enable App Launcher on ChromeOS, Windows and OSX.
203 # On Linux, enable App Launcher for the Aura build.
204 ['use_ash==1 or OS=="win" or OS=="mac" or (desktop_linux==1 and use_aura==1)', {
205 'enable_app_list%': 1,
207 'enable_app_list%': 0,
210 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
211 'use_default_render_theme%': 1,
213 'use_default_render_theme%': 0,
217 'use_ozone_evdev%': 1,
219 'use_ozone_evdev%': 0,
222 # Set default gomadir.
224 'gomadir': 'c:\\goma\\goma-win',
226 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
229 # Set the default "target_subarch" on iOS. Valid values are "arm32",
230 # "arm64" and "both" (meaning a fat binary).
232 # TODO(sdefresne): change the default from "arm32" to "both" for
233 # "target_subarch" once http://crbug.com/339477 is fixed.
235 # TODO(sdefresne): set the "target_arch" to "arm" once compilation
236 # of skia has been fixed for simulator. http://crbug.com/342377
238 'target_subarch%': 'arm32',
243 # Copy conditionally-set variables out one scope.
244 'chromeos%': '<(chromeos)',
245 'host_arch%': '<(host_arch)',
246 'target_arch%': '<(target_arch)',
247 'target_subarch%': '<(target_subarch)',
248 'toolkit_views%': '<(toolkit_views)',
249 'desktop_linux%': '<(desktop_linux)',
250 'use_aura%': '<(use_aura)',
251 'use_ash%': '<(use_ash)',
252 'use_cras%': '<(use_cras)',
253 'use_ozone%': '<(use_ozone)',
254 'use_ozone_evdev%': '<(use_ozone_evdev)',
255 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
256 'embedded%': '<(embedded)',
257 'use_openssl%': '<(use_openssl)',
258 'use_openssl_certs%': '<(use_openssl_certs)',
259 'use_system_fontconfig%': '<(use_system_fontconfig)',
260 'enable_viewport%': '<(enable_viewport)',
261 'enable_hidpi%': '<(enable_hidpi)',
262 'android_webview_build%': '<(android_webview_build)',
263 'use_goma%': '<(use_goma)',
264 'gomadir%': '<(gomadir)',
265 'enable_app_list%': '<(enable_app_list)',
266 'use_default_render_theme%': '<(use_default_render_theme)',
267 'buildtype%': '<(buildtype)',
268 'branding%': '<(branding)',
269 'arm_version%': '<(arm_version)',
270 'sysroot%': '<(sysroot)',
271 'chroot_cmd%': '<(chroot_cmd)',
273 # Set to 1 to enable fast builds. Set to 2 for even faster builds
274 # (it disables debug info for fastest compilation - only for use
275 # on compile-only bots).
278 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
279 # This is useful for parallel compilation tools which can't support /Zi.
280 # Only used on Windows.
283 # Set to 1 to enable dcheck in release.
284 'dcheck_always_on%': 0,
286 # Set to 1 to make a build that disables unshipped tracing events.
287 # Note: this setting is ignored if buildtype=="Official".
288 'tracing_like_official_build%': 0,
290 # Disable image loader component extension by default.
291 'image_loader_extension%': 0,
293 # Set NEON compilation flags.
296 # Detect NEON support at run-time.
297 'arm_neon_optional%': 0,
299 # The system libdir used for this ABI.
300 'system_libdir%': 'lib',
302 # Use libjpeg-turbo as the JPEG codec used by Chromium.
303 'use_libjpeg_turbo%': 1,
305 # Use system libjpeg. Note that the system's libjepg will be used even if
306 # use_libjpeg_turbo is set.
307 'use_system_libjpeg%': 0,
309 # By default, component is set to static_library and it can be overriden
310 # by the GYP command line or by ~/.gyp/include.gypi.
311 'component%': 'static_library',
313 # Set to select the Title Case versions of strings in GRD files.
314 'use_titlecase_in_grd_files%': 0,
316 # Use translations provided by volunteers at launchpad.net. This
317 # currently only works on Linux.
318 'use_third_party_translations%': 0,
320 # Remoting compilation is enabled by default. Set to 0 to disable.
323 # Configuration policy is enabled by default. Set to 0 to disable.
324 'configuration_policy%': 1,
326 # Variable safe_browsing is used to control the build time configuration
327 # for safe browsing feature. Safe browsing can be compiled in 3 different
328 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
329 # reporting features without enabling phishing and malware detection. This
330 # is useful to integrate a third party phishing/malware detection to
331 # existing safe browsing logic.
334 # Speech input is compiled in by default. Set to 0 to disable.
337 # Notifications are compiled in by default. Set to 0 to disable.
338 'notifications%' : 1,
340 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
341 # regular builds and 1 for ASan builds.
342 'mac_want_real_dsym%': 'default',
344 # If this is set, the clang plugins used on the buildbot will be used.
345 # Run tools/clang/scripts/update.sh to make sure they are compiled.
346 # This causes 'clang_chrome_plugins_flags' to be set.
347 # Has no effect if 'clang' is not set as well.
348 'clang_use_chrome_plugins%': 1,
350 # Enable building with ASAN (Clang's -fsanitize=address option).
351 # -fsanitize=address only works with clang, but asan=1 implies clang=1
352 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
354 # Enable coverage gathering instrumentation in ASan. This flag also
355 # controls coverage granularity (experimental).
358 # Enable building with SyzyAsan.
359 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
362 # Enable building with LSan (Clang's -fsanitize=leak option).
363 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
364 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
367 # Enable building with TSAN (Clang's -fsanitize=thread option).
368 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
369 # See http://clang.llvm.org/docs/ThreadSanitizer.html
371 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/valgrind/tsan_v2/ignores.txt',
373 # Enable building with MSAN (Clang's -fsanitize=memory option).
374 # MemorySanitizer only works with clang, but msan=1 implies clang=1
375 # See http://clang.llvm.org/docs/MemorySanitizer.html
377 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
379 # Use the dynamic libraries instrumented by one of the sanitizers
380 # instead of the standard system libraries.
381 'use_instrumented_libraries%': 0,
383 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
384 # stdlibc++ as standard library. This is intended to use for instrumented
386 'use_custom_libcxx%': 0,
388 # Use a modified version of Clang to intercept allocated types and sizes
389 # for allocated objects. clang_type_profiler=1 implies clang=1.
390 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
391 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
392 'clang_type_profiler%': 0,
394 # Set to true to instrument the code with function call logger.
395 # See src/third_party/cygprofile/cyg-profile.cc for details.
396 'order_profiling%': 0,
398 # Use the provided profiled order file to link Chrome image with it.
399 # This makes Chrome faster by better using CPU cache when executing code.
400 # This is known as PGO (profile guided optimization).
401 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
402 'order_text_section%' : "",
404 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
405 # libraries on linux x86-64 and arm, plus ASLR.
408 # Whether one-click signin is enabled or not.
409 'enable_one_click_signin%': 0,
411 # Enable Chrome browser extensions
412 'enable_extensions%': 1,
415 'enable_google_now%': 1,
417 # Enable printing support and UI. This variable is used to configure
418 # which parts of printing will be built. 0 disables printing completely,
419 # 1 enables it fully, and 2 enables only the codepath to generate a
420 # Metafile (e.g. usually a PDF or EMF) and disables print preview, cloud
422 'enable_printing%': 1,
424 # Set the version of CLD.
425 # 0: Don't specify the version. This option is for the Finch testing.
430 # For CLD2, the size of the tables that should be included in the build
431 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
433 # See third_party/cld_2/cld_2.gyp for more information.
434 # 0: Small tables, lower accuracy
435 # 1: Medium tables, medium accuracy
436 # 2: Large tables, high accuracy
437 'cld2_table_size%': 2,
439 # Set the way CLD is compiled. Only evaluated if cld_version == 2.
440 # 0: static, language scoring tables compiled into the binary
441 # 1: dynamic, language scoring tables live in a data file that must
442 # be loaded at runtime.
445 # Enable spell checker.
446 'enable_spellcheck%': 1,
448 # Webrtc compilation is enabled by default. Set to 0 to disable.
451 # Enables use of the session service, which is enabled by default.
452 # Support for disabling depends on the platform.
453 'enable_session_service%': 1,
455 # Enables theme support, which is enabled by default. Support for
456 # disabling depends on the platform.
459 # Enables autofill dialog and associated features; disabled by default.
460 'enable_autofill_dialog%' : 0,
462 # Enables support for background apps.
463 'enable_background%': 1,
465 # Enable the task manager by default.
466 'enable_task_manager%': 1,
468 # Enables used resource whitelist generation; disabled by default.
469 'enable_resource_whitelist_generation%': 0,
471 # Enable FTP support by default.
472 'disable_ftp_support%': 0,
474 # XInput2 multitouch support is enabled by default (use_xi2_mt=2).
475 # Setting to zero value disables XI2 MT. When XI2 MT is enabled,
476 # the input value also defines the required XI2 minor minimum version.
477 # For example, use_xi2_mt=2 means XI2.2 or above version is required.
480 # Use of precompiled headers on Windows.
482 # This variable may be explicitly set to 1 (enabled) or 0
483 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
484 # This setting will override the default.
487 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
489 'chromium_win_pch%': 0,
491 # Set this to true when building with Clang.
492 # See http://code.google.com/p/chromium/wiki/Clang for details.
495 # Enable plug-in installation by default.
496 'enable_plugin_installation%': 1,
498 # Enable PPAPI and NPAPI by default.
499 # TODO(nileshagrawal): Make this flag enable/disable NPAPI as well
500 # as PPAPI; see crbug.com/162667.
501 'enable_plugins%': 1,
503 # Specifies whether to use canvas_skia.cc in place of platform
504 # specific implementations of gfx::Canvas. Affects text drawing in the
506 # TODO(asvitkine): Enable this on all platforms and delete this flag.
507 # http://crbug.com/105550
508 'use_canvas_skia%': 0,
510 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
511 # with one of those tools.
512 'build_for_tool%': '',
514 # If no directory is specified then a temporary directory will be used.
515 'test_isolation_outdir%': '',
516 # True if isolate should fail if the isolate files refer to files
518 'test_isolation_fail_on_missing': 0,
520 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
521 'wix_path%': '<(DEPTH)/third_party/wix',
523 # Managed users are enabled by default.
524 'enable_managed_users%': 1,
526 # Platform natively supports discardable memory.
527 'native_discardable_memory%': 0,
529 # Platform sends memory pressure signals natively.
530 'native_memory_pressure_signals%': 0,
532 'data_reduction_fallback_host%' : '',
533 'data_reduction_dev_host%' : '',
534 'spdy_proxy_auth_origin%' : '',
535 'spdy_proxy_auth_property%' : '',
536 'spdy_proxy_auth_value%' : '',
537 'data_reduction_proxy_probe_url%' : '',
539 'enable_service_discovery%': 0,
540 'enable_hangout_services_extension%': 0,
542 # Enable the Syzygy optimization step.
543 'syzygy_optimize%': 0,
546 # A flag for POSIX platforms
553 # A flag for BSD platforms
554 ['OS=="freebsd" or OS=="openbsd"', {
561 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
567 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
568 # OpenSSL's certificate definition.
569 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
570 'use_openssl_certs%': 1,
572 'use_openssl_certs%': 0,
575 # libudev usage. This currently only affects the content layer.
576 ['OS=="linux" and embedded==0', {
582 # Flags to use X11 on non-Mac POSIX platforms.
583 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
590 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
596 # Flags to use pango and cairo.
597 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
606 ['OS=="linux" and embedded==0', {
612 # We always use skia text rendering in Aura on Windows, since GDI
613 # doesn't agree with our BackingStore.
614 # TODO(beng): remove once skia text rendering is on by default.
615 ['use_aura==1 and OS=="win"', {
616 'enable_skia_text%': 1,
619 # A flag to enable or disable our compile-time dependency
620 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
621 # support will be available. This option is useful
622 # for Linux distributions and for Aura.
623 ['OS!="linux" or chromeos==1', {
624 'use_gnome_keyring%': 0,
626 'use_gnome_keyring%': 1,
629 ['OS=="mac" or OS=="ios"', {
630 # Mac and iOS want Title Case strings
631 'use_titlecase_in_grd_files%': 1,
634 # Enable loader extensions on Chrome OS.
636 'image_loader_extension%': 1,
638 'image_loader_extension%': 0,
641 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
642 'enable_one_click_signin%': 1,
646 'enable_extensions%': 0,
647 'enable_google_now%': 0,
650 'enable_spellcheck%': 0,
654 'arm_neon_optional%': 1,
655 'native_discardable_memory%': 1,
656 'native_memory_pressure_signals%': 1,
657 'enable_printing%': 2,
658 'enable_task_manager%':0,
659 # Set to 1 once we have a notification system for Android.
660 # http://crbug.com/115320
664 # Android OS includes support for proprietary codecs regardless of
665 # building Chromium or Google Chrome. We also ship Google Chrome with
666 # proprietary codecs.
667 ['OS=="android" or branding=="Chrome"', {
668 'proprietary_codecs%': 1,
670 'proprietary_codecs%': 0,
673 ['OS=="mac" or OS=="ios"', {
674 'native_discardable_memory%': 1,
675 'native_memory_pressure_signals%': 1,
678 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
679 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
680 'enable_autofill_dialog%': 1
688 'disable_ftp_support%': 1,
689 'enable_extensions%': 0,
690 'enable_google_now%': 0,
693 'enable_printing%': 0,
694 'enable_session_service%': 0,
700 'enable_managed_users%': 0,
701 'enable_task_manager%': 0,
704 # Use GPU accelerated cross process image transport by default
705 # on linux builds with the Aura window manager
706 ['use_aura==1 and OS=="linux"', {
707 'ui_compositor_image_transport%': 1,
709 'ui_compositor_image_transport%': 0,
712 # Turn precompiled headers on by default.
713 ['OS=="win" and buildtype!="Official"', {
714 'chromium_win_pch%': 1
717 ['chromeos==1 or OS=="android" or OS=="ios"', {
718 'enable_plugin_installation%': 0,
720 'enable_plugin_installation%': 1,
723 ['OS=="android" or OS=="ios" or embedded==1', {
724 'enable_plugins%': 0,
726 'enable_plugins%': 1,
729 # linux_use_bundled_gold: whether to use the gold linker binary checked
730 # into third_party/binutils. Force this off via GYP_DEFINES when you
731 # are using a custom toolchain and need to control -B in ldflags.
732 # Gold is not used for 32-bit linux builds as it runs out of address
734 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
735 'linux_use_bundled_gold%': 1,
737 'linux_use_bundled_gold%': 0,
740 # linux_use_bundled_binutils: whether to use the binary binutils
741 # checked into third_party/binutils. These are not multi-arch so cannot
742 # be used except on x86 and x86-64 (the only two architectures which
743 # are currently checke in). Force this off via GYP_DEFINES when you
744 # are using a custom toolchain and need to control -B in cflags.
745 ['OS=="linux" and (target_arch=="x64")', {
746 'linux_use_bundled_binutils%': 1,
748 'linux_use_bundled_binutils%': 0,
751 # linux_use_gold_flags: whether to use build flags that rely on gold.
752 # On by default for x64 Linux. Temporarily off for ChromeOS as
753 # it failed on a buildbot.
754 ['OS=="linux" and target_arch=="x64" and chromeos==0', {
755 'linux_use_gold_flags%': 1,
757 'linux_use_gold_flags%': 0,
760 ['OS=="android" or OS=="ios"', {
761 'enable_captive_portal_detection%': 0,
763 'enable_captive_portal_detection%': 1,
766 # Enable Skia UI text drawing incrementally on different platforms.
767 # http://crbug.com/105550
769 # On Aura, this allows per-tile painting to be used in the browser
772 'use_canvas_skia%': 1,
776 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
777 'use_libjpeg_turbo%': 0,
781 # When building as part of the Android system, use system libraries
782 # where possible to reduce ROM size.
783 'use_system_libjpeg%': '<(android_webview_build)',
786 # Do not enable the Settings App on ChromeOS.
787 ['enable_app_list==1 and chromeos==0', {
788 'enable_settings_app%': 1,
790 'enable_settings_app%': 0,
793 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
794 # Set some defaults for arm/linux chrome builds
795 # TODO(dmikurube): Change the default of use_allocator to "none".
796 # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
797 'linux_use_tcmalloc%': 0,
798 'use_allocator%': 'see_use_tcmalloc',
799 # sysroot needs to be an absolute path otherwise it generates
800 # incorrect results when passed to pkg-config
801 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot',
802 }], # OS=="linux" and target_arch=="arm" and chromeos==0
804 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
806 ['target_arch=="x64"', {
807 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
809 ['target_arch=="ia32"', {
810 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
813 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
815 ['OS=="linux" and target_arch=="mipsel"', {
816 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
817 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
820 # Whether tests targets should be run, archived or just have the
821 # dependencies verified. All the tests targets have the '_run' suffix,
822 # e.g. base_unittests_run runs the target base_unittests. The test
823 # target always calls tools/swarming_client/isolate.py. See the script's
824 # --help for more information and the valid --mode values. Meant to be
825 # overriden with GYP_DEFINES.
826 # TODO(maruel): Remove the conditions as more configurations are
828 # NOTE: The check for disable_nacl==0 and component=="static_library"
829 # can't be used here because these variables are not defined yet, but it
830 # is still not supported.
831 ['OS!="ios" and OS!="android" and chromeos==0', {
832 'test_isolation_mode%': 'check',
834 'test_isolation_mode%': 'noop',
836 # Whether Android ARM or x86 build uses OpenMAX DL FFT.
837 ['OS=="android" and ((target_arch=="arm" and arm_version >= 7) or target_arch=="ia32" or target_arch=="x64") and android_webview_build==0', {
838 # Currently only supported on Android ARMv7+, ia32 or x64
839 # without webview. When enabled, this will also enable
840 # WebAudio support on Android ARM, ia32 and x64. Default is
841 # enabled. Whether WebAudio is actually available depends
842 # on runtime settings and flags.
843 'use_openmax_dl_fft%': 1,
845 'use_openmax_dl_fft%': 0,
847 ['OS=="win" or OS=="linux"', {
851 # Turns on compiler optimizations in V8 in Debug build, except
852 # on android_clang, where we're hitting a weird linker error.
853 # TODO(dpranke): http://crbug.com/266155 .
855 'v8_optimized_debug%': 1,
857 'v8_optimized_debug%': 2,
860 # Disable various features by default on embedded.
863 'enable_printing%': 0,
866 # By default, use ICU data file (icudtl.dat) on all platforms
867 # except when building Android WebView.
868 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
869 ['android_webview_build==0', {
870 'icu_use_data_file_flag%' : 1,
872 'icu_use_data_file_flag%' : 0,
876 # Set this to 1 to enable use of concatenated impulse responses
877 # for the HRTF panner in WebAudio.
878 'use_concatenated_impulse_responses': 1,
880 # You can set the variable 'use_official_google_api_keys' to 1
881 # to use the Google-internal file containing official API keys
882 # for Google Chrome even in a developer build. Setting this
883 # variable explicitly to 1 will cause your build to fail if the
884 # internal file is missing.
886 # The variable is documented here, but not handled in this file;
887 # see //google_apis/determine_use_official_keys.gypi for the
890 # Set the variable to 0 to not use the internal file, even when
891 # it exists in your checkout.
893 # Leave it unset in your include.gypi to have the variable
894 # implicitly set to 1 if you have
895 # src/google_apis/internal/google_chrome_api_keys.h in your
896 # checkout, and implicitly set to 0 if not.
898 # Note that official builds always behave as if the variable
899 # was explicitly set to 1, i.e. they always use official keys,
900 # and will fail to build if the internal file is missing.
902 # NOTE: You MUST NOT explicitly set the variable to 2 in your
903 # include.gypi or by other means. Due to subtleties of GYP, this
904 # is not the same as leaving the variable unset, even though its
906 # //google_apis/determine_use_official_keys.gypi is 2.
908 # Set these to bake the specified API keys and OAuth client
909 # IDs/secrets into your build.
911 # If you create a build without values baked in, you can instead
912 # set environment variables to provide the keys at runtime (see
913 # src/google_apis/google_api_keys.h for details). Features that
914 # require server-side APIs may fail to work if no keys are
917 # Note that if you are building an official build or if
918 # use_official_google_api_keys has been set to 1 (explicitly or
919 # implicitly), these values will be ignored and the official
920 # keys will be used instead.
921 'google_api_key%': '',
922 'google_default_client_id%': '',
923 'google_default_client_secret%': '',
926 # Copy conditionally-set variables out one scope.
927 'branding%': '<(branding)',
928 'buildtype%': '<(buildtype)',
929 'target_arch%': '<(target_arch)',
930 'target_subarch%': '<(target_subarch)',
931 'host_arch%': '<(host_arch)',
932 'toolkit_views%': '<(toolkit_views)',
933 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
934 'use_aura%': '<(use_aura)',
935 'use_ash%': '<(use_ash)',
936 'use_cras%': '<(use_cras)',
937 'use_openssl%': '<(use_openssl)',
938 'use_openssl_certs%': '<(use_openssl_certs)',
939 'use_nss%': '<(use_nss)',
940 'use_udev%': '<(use_udev)',
941 'os_bsd%': '<(os_bsd)',
942 'os_posix%': '<(os_posix)',
943 'use_dbus%': '<(use_dbus)',
944 'use_glib%': '<(use_glib)',
945 'use_pango%': '<(use_pango)',
946 'use_cairo%': '<(use_cairo)',
947 'use_ozone%': '<(use_ozone)',
948 'use_ozone_evdev%': '<(use_ozone_evdev)',
949 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
950 'use_system_fontconfig%': '<(use_system_fontconfig)',
951 'desktop_linux%': '<(desktop_linux)',
952 'use_x11%': '<(use_x11)',
953 'use_gnome_keyring%': '<(use_gnome_keyring)',
954 'linux_fpic%': '<(linux_fpic)',
955 'chromeos%': '<(chromeos)',
956 'enable_viewport%': '<(enable_viewport)',
957 'enable_hidpi%': '<(enable_hidpi)',
958 'use_xi2_mt%':'<(use_xi2_mt)',
959 'image_loader_extension%': '<(image_loader_extension)',
960 'fastbuild%': '<(fastbuild)',
961 'win_z7%': '<(win_z7)',
962 'dcheck_always_on%': '<(dcheck_always_on)',
963 'tracing_like_official_build%': '<(tracing_like_official_build)',
964 'arm_version%': '<(arm_version)',
965 'arm_neon%': '<(arm_neon)',
966 'arm_neon_optional%': '<(arm_neon_optional)',
967 'sysroot%': '<(sysroot)',
968 'chroot_cmd%': '<(chroot_cmd)',
969 'system_libdir%': '<(system_libdir)',
970 'component%': '<(component)',
971 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
972 'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
973 'use_third_party_translations%': '<(use_third_party_translations)',
974 'remoting%': '<(remoting)',
975 'enable_one_click_signin%': '<(enable_one_click_signin)',
976 'enable_webrtc%': '<(enable_webrtc)',
977 'chromium_win_pch%': '<(chromium_win_pch)',
978 'configuration_policy%': '<(configuration_policy)',
979 'safe_browsing%': '<(safe_browsing)',
980 'input_speech%': '<(input_speech)',
981 'notifications%': '<(notifications)',
982 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
983 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
985 'asan_coverage%': '<(asan_coverage)',
986 'syzyasan%': '<(syzyasan)',
987 'syzygy_optimize%': '<(syzygy_optimize)',
990 'msan_blacklist%': '<(msan_blacklist)',
992 'tsan_blacklist%': '<(tsan_blacklist)',
993 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
994 'use_custom_libcxx%': '<(use_custom_libcxx)',
995 'clang_type_profiler%': '<(clang_type_profiler)',
996 'order_profiling%': '<(order_profiling)',
997 'order_text_section%': '<(order_text_section)',
998 'enable_extensions%': '<(enable_extensions)',
999 'enable_plugin_installation%': '<(enable_plugin_installation)',
1000 'enable_plugins%': '<(enable_plugins)',
1001 'enable_session_service%': '<(enable_session_service)',
1002 'enable_themes%': '<(enable_themes)',
1003 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1004 'enable_background%': '<(enable_background)',
1005 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1006 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1007 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1008 'use_canvas_skia%': '<(use_canvas_skia)',
1009 'test_isolation_mode%': '<(test_isolation_mode)',
1010 'test_isolation_outdir%': '<(test_isolation_outdir)',
1011 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1012 'enable_printing%': '<(enable_printing)',
1013 'enable_spellcheck%': '<(enable_spellcheck)',
1014 'enable_google_now%': '<(enable_google_now)',
1015 'cld_version%': '<(cld_version)',
1016 'cld2_table_size%': '<(cld2_table_size)',
1017 'cld2_dynamic%': '<(cld2_dynamic)',
1018 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1019 'disable_ftp_support%': '<(disable_ftp_support)',
1020 'enable_task_manager%': '<(enable_task_manager)',
1021 'sas_dll_path%': '<(sas_dll_path)',
1022 'wix_path%': '<(wix_path)',
1023 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1024 'use_system_libjpeg%': '<(use_system_libjpeg)',
1025 'android_webview_build%': '<(android_webview_build)',
1026 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1027 'gyp_managed_install%': 0,
1028 'create_standalone_apk%': 1,
1029 'enable_app_list%': '<(enable_app_list)',
1030 'use_default_render_theme%': '<(use_default_render_theme)',
1031 'enable_settings_app%': '<(enable_settings_app)',
1032 'google_api_key%': '<(google_api_key)',
1033 'google_default_client_id%': '<(google_default_client_id)',
1034 'google_default_client_secret%': '<(google_default_client_secret)',
1035 'enable_managed_users%': '<(enable_managed_users)',
1036 'native_discardable_memory%': '<(native_discardable_memory)',
1037 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1038 'data_reduction_fallback_host%': '<(data_reduction_fallback_host)',
1039 'data_reduction_dev_host%': '<(data_reduction_dev_host)',
1040 'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)',
1041 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1042 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1043 'data_reduction_proxy_probe_url%': '<(data_reduction_proxy_probe_url)',
1044 'enable_mdns%' : '<(enable_mdns)',
1045 'enable_service_discovery%' : '<(enable_service_discovery)',
1046 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1047 'v8_optimized_debug%': '<(v8_optimized_debug)',
1048 'proprietary_codecs%': '<(proprietary_codecs)',
1049 'use_goma%': '<(use_goma)',
1050 'gomadir%': '<(gomadir)',
1052 # Use system protobuf instead of bundled one.
1053 'use_system_protobuf%': 0,
1055 # Use system yasm instead of bundled one.
1056 'use_system_yasm%': 0,
1058 # Use system ICU instead of bundled one.
1059 'use_system_icu%' : 0,
1061 # Default to enabled PIE; this is important for ASLR but we may need to be
1062 # able to turn it off for various reasons.
1063 'linux_disable_pie%': 0,
1065 # The release channel that this build targets. This is used to restrict
1066 # channel-specific build options, like which installer packages to create.
1067 # The default is 'all', which does no channel-specific filtering.
1070 # Override chromium_mac_pch and set it to 0 to suppress the use of
1071 # precompiled headers on the Mac. Prefix header injection may still be
1072 # used, but prefix headers will not be precompiled. This is useful when
1073 # using distcc to distribute a build to compile slaves that don't
1074 # share the same compiler executable as the system driving the compilation,
1075 # because precompiled headers rely on pointers into a specific compiler
1076 # executable's image. Setting this to 0 is needed to use an experimental
1077 # Linux-Mac cross compiler distcc farm.
1078 'chromium_mac_pch%': 1,
1080 # The default value for mac_strip in target_defaults. This cannot be
1081 # set there, per the comment about variable% in a target_defaults.
1082 'mac_strip_release%': 0,
1084 # Set to 1 to enable java code coverage. Instruments classes during build
1085 # to produce .ec files during runtime.
1086 'emma_coverage%': 0,
1088 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1089 # separated with whitespace and/or comma. Only has effect if
1090 # 'emma_coverage=1'.
1093 # Set to 1 to enable running Android lint on java/class files.
1096 # Although base/allocator lets you select a heap library via an
1097 # environment variable, the libcmt shim it uses sometimes gets in
1098 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1099 # 'win_use_allocator_shim': 0,
1100 # 'win_release_RuntimeLibrary': 2
1101 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1102 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1104 # TODO(bradnelson): eliminate this when possible.
1105 # To allow local gyp files to prevent release.vsprops from being included.
1106 # Yes(1) means include release.vsprops.
1107 # Once all vsprops settings are migrated into gyp, this can go away.
1108 'msvs_use_common_release%': 1,
1110 # TODO(bradnelson): eliminate this when possible.
1111 # To allow local gyp files to override additional linker options for msvs.
1112 # Yes(1) means set use the common linker options.
1113 'msvs_use_common_linker_extras%': 1,
1115 # TODO(sgk): eliminate this if possible.
1116 # It would be nicer to support this via a setting in 'target_defaults'
1117 # in chrome/app/locales/locales.gypi overriding the setting in the
1118 # 'Debug' configuration in the 'target_defaults' dict below,
1119 # but that doesn't work as we'd like.
1120 'msvs_debug_link_incremental%': '2',
1122 # Needed for some of the largest modules.
1123 'msvs_debug_link_nonincremental%': '1',
1125 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1126 # to get incremental linking to be faster in debug builds.
1127 'incremental_chrome_dll%': '0',
1129 # Experimental setting to break chrome.dll into multiple pieces based on
1131 'chrome_multiple_dll%': '0',
1133 # Experimental setting to optimize Chrome's DLLs with PGO.
1134 'chrome_pgo_phase%': '0',
1136 # The default settings for third party code for treating
1137 # warnings-as-errors. Ideally, this would not be required, however there
1138 # is some third party code that takes a long time to fix/roll. So, this
1139 # flag allows us to have warnings as errors in general to prevent
1140 # regressions in most modules, while working on the bits that are
1142 'win_third_party_warn_as_error%': 'true',
1145 'clang%': '<(clang)',
1146 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
1148 # Control which version of clang to use when building for iOS. If set to
1149 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1150 # the version of clang that ships with the Chromium source. This variable
1151 # is automatically set to '1' when using the Xcode generator.
1154 # These two variables can be set in GYP_DEFINES while running
1155 # |gclient runhooks| to let clang run a plugin in every compilation.
1156 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1158 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1161 'clang_add_plugin%': '',
1163 # Tell ld64 to write map files describing binary layout. Useful
1164 # for looking at what contributes to binary size, e.g. with
1165 # https://github.com/nico/bloat
1166 'mac_write_linker_maps%': 0,
1168 # The default type of gtest.
1169 'gtest_target_type%': 'executable',
1171 # Enable sampling based profiler.
1172 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1174 # Profile without optimizing out stack frames when profiling==1.
1175 'profiling_full_stack_frames%': '0',
1177 # And if we want to dump symbols for Breakpad-enabled builds.
1178 'linux_dump_symbols%': 0,
1179 # And if we want to strip the binary after dumping symbols.
1180 'linux_strip_binary%': 0,
1181 # Strip the test binaries needed for Linux reliability tests.
1182 'linux_strip_reliability_tests%': 0,
1183 # If we want stack unwind support for backtrace().
1184 'debug_unwind_tables%': 1,
1185 'release_unwind_tables%': 1,
1187 # Override where to find binutils
1188 'binutils_version%': 0,
1189 'binutils_dir%': '',
1192 # TODO(dmikurube): Change Linux default of use_allocator to "tcmalloc".
1193 # TODO(dmikurube): Change Android default of use_allocator to "none".
1194 # TODO(dmikurube): Kill {linux|android}_use_tcmalloc. http://crbug.com/345554
1195 # {linux|android}_use_tcmalloc are to be replaced with use_allocator.
1196 # They are now used only if use_allocator=="see_use_tcmalloc" (default).
1197 # TODO(dmikurube): Assert when {linux|android}_use_tcmalloc is explicitly specified.
1198 'linux_use_tcmalloc%': 1,
1199 'android_use_tcmalloc%': 0,
1200 'use_allocator%': 'see_use_tcmalloc',
1202 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1203 'linux_link_gnome_keyring%': 0,
1204 # Set to 1 to link against gsettings APIs instead of using dlopen().
1205 'linux_link_gsettings%': 0,
1207 # Default arch variant for MIPS.
1208 'mips_arch_variant%': 'mips32r1',
1210 # Enable use of OpenMAX DL FFT routines.
1211 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1213 # Enable new NPDevice API.
1214 'enable_new_npdevice_api%': 0,
1216 # Enable EGLImage support in OpenMAX
1217 'enable_eglimage%': 1,
1219 # .gyp files or targets should set chromium_code to 1 if they build
1220 # Chromium-specific code, as opposed to external code. This variable is
1221 # used to control such things as the set of warnings to enable, and
1222 # whether warnings are treated as errors.
1223 'chromium_code%': 0,
1225 # Disable fatal linker warnings, similarly to how we make it possible
1226 # to disable -Werror (e.g. for different toolchain versions).
1227 'disable_fatal_linker_warnings%': 0,
1229 'release_valgrind_build%': 0,
1231 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1232 'enable_wexit_time_destructors%': 0,
1234 # Build libpeerconnection as a static library by default.
1235 'libpeer_target_type%': 'static_library',
1237 # Set to 1 to compile with the built in pdf viewer.
1240 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1241 'internal_gles2_conform_tests%': 0,
1243 # Set to 1 to compile the filter fuzzer.
1244 'internal_filter_fuzzer%': 0,
1246 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1247 # so Cocoa is happy (http://crbug.com/20441).
1249 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1250 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1251 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1252 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1253 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1254 'vi', 'zh-CN', 'zh-TW',
1257 # Pseudo locales are special locales which are used for testing and
1258 # debugging. They don't get copied to the final app. For more info,
1259 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1266 # If debug_devtools is set to 1, JavaScript files for DevTools are
1267 # stored as is and loaded from disk. Otherwise, a concatenated file
1268 # is stored in resources.pak. It is still possible to load JS files
1269 # from disk by passing --debug-devtools cmdline switch.
1270 'debug_devtools%': 0,
1272 # The Java Bridge is not compiled in by default.
1275 # Code signing for iOS binaries. The bots need to be able to disable this.
1276 'chromium_ios_signing%': 1,
1278 # This flag is only used when disable_nacl==0 and disables all those
1279 # subcomponents which would require the installation of a native_client
1280 # untrusted toolchain.
1281 'disable_nacl_untrusted%': 0,
1283 # Disable Dart by default.
1286 # Native Client is enabled by default.
1289 # Portable Native Client is enabled by default.
1290 'disable_pnacl%': 0,
1292 # Whether to build full debug version for Debug configuration on Android.
1293 # Compared to full debug version, the default Debug configuration on Android
1294 # has no full v8 debug, has size optimization and linker gc section, so that
1295 # we can build a debug version with acceptable size and performance.
1296 'android_full_debug%': 0,
1298 # Sets the default version name and code for Android app, by default we
1299 # do a developer build.
1300 'android_app_version_name%': 'Developer Build',
1301 'android_app_version_code%': 0,
1303 # Contains data about the attached devices for gyp_managed_install.
1304 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1306 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1307 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1309 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1310 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1312 # Whether we are using the rlz library or not. Platforms like Android send
1313 # rlz codes for searches but do not use the library.
1316 # Turns on the i18n support in V8.
1317 'v8_enable_i18n_support': 1,
1319 # Compile d8 for the host toolset.
1320 'v8_toolset_for_d8': 'host',
1322 # Compiles v8 without its platform library.
1323 'v8_use_default_platform': 0,
1325 # Use the chromium skia by default.
1326 'use_system_skia%': '0',
1328 # Use brlapi from brltty for braille display support.
1331 # Relative path to icu.gyp from this file.
1332 'icu_gyp_path': '../third_party/icu/icu.gyp',
1334 # IPC fuzzer is disabled by default.
1335 'enable_ipc_fuzzer%': 0,
1338 # Force disable libstdc++ debug mode.
1339 'disable_glibcxx_debug%': 0,
1341 # Set to 1 to compile with the hole punching for the protected video.
1344 # Set to 1 to compile with MSE support for MPEG2 TS
1345 'enable_mpeg2ts_stream_parser%': 0,
1347 # Support ChromeOS touchpad gestures with ozone.
1348 'use_evdev_gestures%': 0,
1351 # Enable the Syzygy optimization step for the official builds.
1352 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1353 'syzygy_optimize%': 1,
1355 'syzygy_optimize%': 0,
1357 # Get binutils version so we can enable debug fission if we can.
1358 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1360 # compiler_version doesn't work with clang
1361 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1362 # compiler_version works with clang.
1363 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1364 # that it takes effect here.
1365 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0', {
1366 'binutils_version%': '<!pymod_do_main(compiler_version assembler)',
1368 # On Android we know the binutils version in the toolchain.
1370 'binutils_version%': 222,
1372 ['host_arch=="x64"', {
1373 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1375 ['host_arch=="ia32"', {
1376 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1378 # Our version of binutils in third_party/binutils
1379 ['linux_use_bundled_binutils==1', {
1380 'binutils_version%': 224,
1384 'binutils_version%': 0,
1386 # The version of GCC in use, set later in platforms that use GCC and have
1387 # not explicitly chosen to build with clang. Currently, this means all
1388 # platforms except Windows, Mac and iOS.
1389 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1390 # it takes effect here.
1391 ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0', {
1394 # We directly set the gcc_version since we know what we use.
1396 ['target_arch=="x64" or target_arch=="arm64"', {
1403 'gcc_version%': '<!pymod_do_main(compiler_version)',
1409 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1410 'windows_sdk_path%': '<(windows_sdk_default_path)',
1412 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
1414 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1415 'directx_sdk_path%': '<(directx_sdk_default_path)',
1417 'directx_sdk_path%': '$(DXSDK_DIR)',
1420 'windows_driver_kit_path%': '$(WDK_DIR)',
1422 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1424 ['target_arch=="mipsel"', {
1427 'nacl_untrusted_build%': 0,
1428 # TODO(dmikurube): Change the default of use_allocator to "none".
1429 # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
1430 'linux_use_tcmalloc%': 0,
1431 'use_allocator%': 'see_use_tcmalloc',
1433 ['OS=="linux" and target_arch=="mipsel"', {
1434 'sysroot%': '<(sysroot)',
1437 # All Chrome builds have breakpad symbols, but only process the
1438 # symbols from official builds.
1439 ['(branding=="Chrome" and buildtype=="Official")', {
1440 'linux_dump_symbols%': 1,
1442 # Omit unwind support in official release builds to save space. We
1443 # can use breakpad for these builds.
1444 'release_unwind_tables%': 0,
1447 }], # os_posix==1 and OS!="mac" and OS!="ios"
1450 'enable_background%': 0,
1451 'icu_use_data_file_flag%': 1,
1453 'use_system_libxml%': 1,
1454 'use_system_sqlite%': 1,
1456 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1457 'fi', 'fr', 'he', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms', 'nb',
1458 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr', 'uk',
1459 'vi', 'zh-CN', 'zh-TW',
1462 # The Mac SDK is set for iOS builds and passed through to Mac
1463 # sub-builds. This allows the Mac sub-build SDK in an iOS build to be
1464 # overridden from the command line the same way it is for a Mac build.
1465 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py 10.6)',
1467 # iOS SDK and deployment target support. The |ios_sdk| value is left
1468 # blank so that when it is set in the project files it will be the
1469 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1470 # causes Xcode to spit out a warning for every single project file for
1471 # not using the "current" SDK.
1473 'ios_sdk_path%': '',
1474 'ios_deployment_target%': '6.0',
1477 # ios_product_name is set to the name of the .app bundle as it should
1479 ['branding=="Chrome"', {
1480 'ios_product_name%': 'Chrome',
1481 }, { # else: branding!="Chrome"
1482 'ios_product_name%': 'Chromium',
1484 ['branding=="Chrome" and buildtype=="Official"', {
1486 }, { # else: branding!="Chrome" or buildtype!="Official"
1492 # Location of Android NDK.
1495 # Unfortunately we have to use absolute paths to the SDK/NDK because
1496 # they're passed to ant which uses a different relative path from
1498 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1499 'android_ndk_experimental_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk_experimental/',
1500 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1501 'android_host_arch%': '<!(uname -m)',
1502 # Android API-level of the SDK used for compilation.
1503 'android_sdk_version%': '19',
1504 'android_sdk_build_tools_version%': '19.0.0',
1505 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1507 # Copy conditionally-set variables out one scope.
1508 'android_ndk_root%': '<(android_ndk_root)',
1509 'android_sdk_root%': '<(android_sdk_root)',
1510 'android_sdk_version%': '<(android_sdk_version)',
1511 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1512 'host_os%': '<(host_os)',
1514 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1515 # Android SDK build tools (e.g. dx, aapt, aidl)
1516 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1518 # Android API level 14 is ICS (Android 4.0) which is the minimum
1519 # platform requirement for Chrome on Android, we use it for native
1522 ['target_arch == "ia32"', {
1523 'android_app_abi%': 'x86',
1524 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1525 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1526 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.6/prebuilt/<(host_os)-<(android_host_arch)/bin',
1528 ['target_arch == "x64"', {
1529 'android_app_abi%': 'x86_64',
1530 'android_gdbserver%': '<(android_ndk_experimental_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1531 'android_ndk_sysroot%': '<(android_ndk_experimental_root)/platforms/android-20/arch-x86_64',
1532 'android_toolchain%': '<(android_ndk_experimental_root)/toolchains/x86_64-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1533 'android_stlport_root': '<(android_ndk_experimental_root)/sources/cxx-stl/stlport',
1535 ['target_arch=="arm"', {
1538 'android_app_abi%': 'armeabi',
1540 'android_app_abi%': 'armeabi-v7a',
1543 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1544 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1545 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.6/prebuilt/<(host_os)-<(android_host_arch)/bin',
1547 ['target_arch == "arm64"', {
1548 'android_app_abi%': 'arm64-v8a',
1549 'android_gdbserver%': '<(android_ndk_experimental_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1550 'android_ndk_sysroot%': '<(android_ndk_experimental_root)/platforms/android-20/arch-arm64',
1551 'android_toolchain%': '<(android_ndk_experimental_root)/toolchains/aarch64-linux-android-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1552 'android_stlport_root': '<(android_ndk_experimental_root)/sources/cxx-stl/stlport',
1554 ['target_arch == "mipsel"', {
1555 'android_app_abi%': 'mips',
1556 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1557 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1558 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.6/prebuilt/<(host_os)-<(android_host_arch)/bin',
1562 # Copy conditionally-set variables out one scope.
1563 'android_app_abi%': '<(android_app_abi)',
1564 'android_gdbserver%': '<(android_gdbserver)',
1565 'android_ndk_root%': '<(android_ndk_root)',
1566 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1567 'android_sdk_root%': '<(android_sdk_root)',
1568 'android_sdk_version%': '<(android_sdk_version)',
1569 'android_toolchain%': '<(android_toolchain)',
1571 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1572 'android_ndk_lib': '<(android_ndk_sysroot)/usr/lib',
1573 'android_sdk_tools%': '<(android_sdk_tools)',
1574 'android_sdk%': '<(android_sdk)',
1575 'android_sdk_jar%': '<(android_sdk)/android.jar',
1577 'android_stlport_root': '<(android_stlport_root)',
1578 'android_stlport_include': '<(android_stlport_root)/stlport',
1579 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1580 'host_os%': '<(host_os)',
1582 # Location of the "strip" binary, used by both gyp and scripts.
1583 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1585 # Location of the "readelf" binary.
1586 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1588 # Determines whether we should optimize JNI generation at the cost of
1589 # breaking assumptions in the build system that when inputs have changed
1590 # the outputs should always change as well. This is meant purely for
1591 # developer builds, to avoid spurious re-linking of native files.
1592 'optimize_jni_generation%': 0,
1594 # Always uses openssl.
1596 'use_openssl_certs%': 1,
1598 'proprietary_codecs%': '<(proprietary_codecs)',
1599 'safe_browsing%': 2,
1602 'build_ffmpegsumo%': 0,
1603 # TODO(dmikurube): Change the default of use_allocator to "none".
1604 # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
1605 'linux_use_tcmalloc%': 0,
1606 'use_allocator%': 'see_use_tcmalloc',
1608 # Disable Native Client.
1611 # Android does not support background apps.
1612 'enable_background%': 0,
1614 # Sessions are store separately in the Java side.
1615 'enable_session_service%': 0,
1619 'gtest_target_type%': 'shared_library',
1621 # Uses system APIs for decoding audio and video.
1622 'use_libffmpeg%': '0',
1624 # When building as part of the Android system, use system libraries
1625 # where possible to reduce ROM size.
1626 # TODO(steveblock): Investigate using the system version of sqlite.
1627 'use_system_sqlite%': 0, # '<(android_webview_build)',
1628 'use_system_expat%': '<(android_webview_build)',
1629 'use_system_icu%': '<(android_webview_build)',
1630 'use_system_stlport%': '<(android_webview_build)',
1632 # Copy it out one scope.
1633 'android_webview_build%': '<(android_webview_build)',
1635 ['android_webview_build==1', {
1636 # When building the WebView in the Android tree, jarjar will remap all
1637 # the class names, so the JNI generator needs to know this.
1638 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1642 # All Chrome builds have breakpad symbols, but only process the
1643 # symbols from official builds.
1644 ['(branding=="Chrome" and buildtype=="Official")', {
1645 'mac_strip_release%': 1,
1649 ['OS=="mac" or OS=="ios"', {
1653 # Mac OS X SDK and deployment target support. The SDK identifies
1654 # the version of the system headers that will be used, and
1655 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1656 # macro. "Maximum allowed" refers to the operating system version
1657 # whose APIs are available in the headers. The deployment target
1658 # identifies the minimum system version that the built products are
1659 # expected to function on. It corresponds to the
1660 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1661 # macros are available, #include <AvailabilityMacros.h>. Additional
1662 # documentation on these macros is available at
1663 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1664 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1665 # deployment target to 10.6. Other projects, such as O3D, may
1666 # override these defaults.
1668 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1669 # about that is at least the specified version. In official builds,
1670 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1671 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1672 # path to the SDK; when set to a non-empty string, SDK detection
1673 # based on mac_sdk_min will be bypassed entirely.
1674 'mac_sdk_min%': '10.6',
1675 'mac_sdk_path%': '',
1677 'mac_deployment_target%': '10.6',
1680 'mac_sdk_min': '<(mac_sdk_min)',
1681 'mac_sdk_path': '<(mac_sdk_path)',
1682 'mac_deployment_target': '<(mac_deployment_target)',
1684 # Compile in Breakpad support by default so that it can be
1685 # tested, even if it is not enabled by default at runtime.
1686 'mac_breakpad_compiled_in%': 1,
1688 # mac_product_name is set to the name of the .app bundle as it should
1689 # appear on disk. This duplicates data from
1690 # chrome/app/theme/chromium/BRANDING and
1691 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1692 # these names into the build system.
1693 ['branding=="Chrome"', {
1694 'mac_product_name%': 'Google Chrome',
1695 }, { # else: branding!="Chrome"
1696 'mac_product_name%': 'Chromium',
1699 ['branding=="Chrome" and buildtype=="Official"', {
1700 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1701 # Enable uploading crash dumps.
1702 'mac_breakpad_uploads%': 1,
1703 # Enable dumping symbols at build time for use by Mac Breakpad.
1705 # Enable Keystone auto-update support.
1707 }, { # else: branding!="Chrome" or buildtype!="Official"
1708 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1709 'mac_breakpad_uploads%': 0,
1714 }], # OS=="mac" or OS=="ios"
1717 # This is the architecture convention used in WinSDK paths.
1718 ['target_arch=="ia32"', {
1719 'winsdk_arch%': 'x86',
1721 'winsdk_arch%': '<(target_arch)',
1723 ['component=="shared_library"', {
1724 'win_use_allocator_shim%': 0,
1726 # Turn on multiple dll by default on Windows when in static_library.
1727 'chrome_multiple_dll%': 1,
1730 'win_use_allocator_shim%': 0,
1732 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1733 # Only enabled by default for ninja because it's buggy in VS.
1734 # Not enabled for component=static_library because some targets
1735 # are too large and the toolchain fails due to the size of the
1737 'incremental_chrome_dll%': 1,
1739 # Don't do incremental linking for large modules on 32-bit or when
1740 # component=static_library as the toolchain fails due to the size of
1742 ['MSVS_OS_BITS==32 or component=="static_library"', {
1743 'msvs_large_module_debug_link_mode%': '1', # No
1745 'msvs_large_module_debug_link_mode%': '2', # Yes
1747 ['MSVS_VERSION=="2013e"', {
1755 'nacl_win64_defines': [
1756 # This flag is used to minimize dependencies when building
1757 # Native Client loader for 64-bit Windows.
1762 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios"', {
1768 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1769 'enable_pepper_cdms%': 1,
1771 'enable_pepper_cdms%': 0,
1774 # Native Client glibc toolchain is enabled
1775 # by default except on arm and mips.
1776 ['target_arch=="arm" or target_arch=="mipsel"', {
1777 'disable_glibc%': 1,
1779 'disable_glibc%': 0,
1782 # Set the relative path from this file to the GYP file of the JPEG
1783 # library used by Chromium.
1784 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1785 # Configuration for using the system libjeg is here.
1786 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1788 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1791 # Options controlling the use of GConf (the classic GNOME configuration
1792 # system) and GIO, which contains GSettings (the new GNOME config system).
1793 ['chromeos==1 or embedded==1', {
1801 # Set up -D and -E flags passed into grit.
1802 ['branding=="Chrome"', {
1803 # TODO(mmoss) The .grd files look for _google_chrome, but for
1804 # consistency they should look for google_chrome_build like C++.
1805 'grit_defines': ['-D', '_google_chrome',
1806 '-E', 'CHROMIUM_BUILD=google_chrome'],
1808 'grit_defines': ['-D', '_chromium',
1809 '-E', 'CHROMIUM_BUILD=chromium'],
1812 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
1814 ['desktop_linux==1', {
1815 'grit_defines': ['-D', 'desktop_linux'],
1817 ['toolkit_views==1', {
1818 'grit_defines': ['-D', 'toolkit_views'],
1821 'grit_defines': ['-D', 'use_aura'],
1824 'grit_defines': ['-D', 'use_ash'],
1827 'grit_defines': ['-D', 'use_nss'],
1830 'grit_defines': ['-D', 'use_ozone'],
1832 ['image_loader_extension==1', {
1833 'grit_defines': ['-D', 'image_loader_extension'],
1836 'grit_defines': ['-D', 'remoting'],
1838 ['use_titlecase_in_grd_files==1', {
1839 'grit_defines': ['-D', 'use_titlecase'],
1841 ['use_third_party_translations==1', {
1842 'grit_defines': ['-D', 'use_third_party_translations'],
1844 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
1845 'ka', 'ku', 'kw', 'ms', 'ug'
1849 'grit_defines': ['-t', 'android',
1850 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true'],
1852 ['OS=="mac" or OS=="ios"', {
1853 'grit_defines': ['-D', 'scale_factors=2x'],
1858 # iOS uses a whitelist to filter resources.
1859 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
1862 # Enable host builds when generating with ninja-ios.
1864 ['"<(GENERATOR)"=="ninja"', {
1868 # TODO(sdefresne): Remove the target_subarch check once Apple has
1869 # upstreamed the support for "arm64". http://crbug.com/341453
1870 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
1875 ['enable_extensions==1', {
1876 'grit_defines': ['-D', 'enable_extensions'],
1878 ['enable_plugins!=0', {
1879 'grit_defines': ['-D', 'enable_plugins'],
1881 ['enable_printing!=0', {
1882 'grit_defines': ['-D', 'enable_printing'],
1884 ['enable_printing==1', {
1885 'grit_defines': ['-D', 'enable_full_printing'],
1887 ['enable_themes==1', {
1888 'grit_defines': ['-D', 'enable_themes'],
1890 ['enable_app_list==1', {
1891 'grit_defines': ['-D', 'enable_app_list'],
1893 ['enable_settings_app==1', {
1894 'grit_defines': ['-D', 'enable_settings_app'],
1896 ['enable_google_now==1', {
1897 'grit_defines': ['-D', 'enable_google_now'],
1899 ['use_concatenated_impulse_responses==1', {
1900 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
1902 ['enable_webrtc==1', {
1903 'grit_defines': ['-D', 'enable_webrtc'],
1905 ['enable_hangout_services_extension==1', {
1906 'grit_defines': ['-D', 'enable_hangout_services_extension'],
1908 ['enable_task_manager==1', {
1909 'grit_defines': ['-D', 'enable_task_manager'],
1911 ['notifications==1', {
1912 'grit_defines': ['-D', 'enable_notifications'],
1914 ['enable_resource_whitelist_generation==1 and OS!="win"', {
1915 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
1917 ['enable_resource_whitelist_generation==1 and OS=="win"', {
1918 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
1920 ['enable_mdns==1 or OS=="mac"', {
1921 'grit_defines': ['-D', 'enable_service_discovery'],
1922 'enable_service_discovery%': 1
1924 ['clang_use_chrome_plugins==1 and OS!="win"', {
1925 'clang_chrome_plugins_flags': [
1926 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
1933 ['asan==1 and OS=="mac"', {
1934 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
1935 # runtime is fully adopted. See http://crbug.com/242503.
1936 'mac_strip_release': 0,
1943 'use_custom_libcxx%': 1,
1949 ['OS=="linux" and clang_type_profiler==1', {
1951 'clang_use_chrome_plugins%': 0,
1953 ['host_arch=="x64"', {
1954 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
1956 ['host_arch=="ia32"', {
1957 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
1958 # Clang in this directory at your own risk if needed for some
1959 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
1960 # usage). Any failure by this compiler should not close the tree.
1961 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
1966 # On valgrind bots, override the optimizer settings so we don't inline too
1967 # much and make the stacks harder to figure out.
1969 # TODO(rnk): Kill off variables that no one else uses and just implement
1970 # them under a build_for_tool== condition.
1971 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
1973 'mac_debug_optimization': '1',
1974 'mac_release_optimization': '1',
1975 'release_optimize': '1',
1976 'no_gc_sections': 1,
1977 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
1978 '-fno-builtin -fno-optimize-sibling-calls',
1979 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
1980 '-fno-builtin -fno-optimize-sibling-calls',
1982 # MSVS flags for TSan on Pin and Windows.
1983 'win_debug_RuntimeChecks': '0',
1984 'win_debug_disable_iterator_debugging': '1',
1985 'win_debug_Optimization': '1',
1986 'win_debug_InlineFunctionExpansion': '0',
1987 'win_release_InlineFunctionExpansion': '0',
1988 'win_release_OmitFramePointers': '0',
1990 # TODO(dmikurube): Change the default of use_allocator to "tcmalloc".
1991 # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
1992 'linux_use_tcmalloc%': 1,
1993 'use_allocator': 'see_use_tcmalloc',
1994 'release_valgrind_build': 1,
1996 'component': 'static_library',
1997 'use_system_zlib': 0,
2000 # Build tweaks for DrMemory.
2001 # TODO(rnk): Combine with tsan config to share the builder.
2002 # http://crbug.com/108155
2003 ['build_for_tool=="drmemory"', {
2004 # These runtime checks force initialization of stack vars which blocks
2005 # DrMemory's uninit detection.
2006 'win_debug_RuntimeChecks': '0',
2007 # Iterator debugging is slow.
2008 'win_debug_disable_iterator_debugging': '1',
2009 # Try to disable optimizations that mess up stacks in a release build.
2010 # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054)
2011 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2012 # compiler bug, so we use /Ob1 instead.
2013 'win_release_InlineFunctionExpansion': '1',
2014 'win_release_OmitFramePointers': '0',
2015 # Ditto for debug, to support bumping win_debug_Optimization.
2016 'win_debug_InlineFunctionExpansion': 0,
2017 'win_debug_OmitFramePointers': 0,
2018 # Keep the code under #ifndef NVALGRIND.
2019 'release_valgrind_build': 1,
2022 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2023 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2027 # Set default compiler flags depending on ARM version.
2028 ['arm_version==6 and android_webview_build==0', {
2029 'arm_arch%': 'armv6',
2032 'arm_float_abi%': 'softfp',
2035 ['arm_version==7 and android_webview_build==0', {
2036 'arm_arch%': 'armv7-a',
2042 'arm_fpu%': 'vfpv3-d16',
2045 # Change the default to hard once the armhf transition is complete.
2046 'arm_float_abi%': 'softfp',
2050 ['android_webview_build==1', {
2051 # The WebView build gets its cpu-specific flags from the Android build system.
2055 'arm_float_abi%': '',
2059 # Enable brlapi by default for chromeos.
2065 # This is the default platform
2066 'ozone_platform%': "test",
2068 # Enable built-in ozone platforms if ozone is enabled.
2069 'ozone_platform_dri%': 1,
2070 'ozone_platform_test%': 1,
2072 'ozone_platform_dri%': 0,
2073 'ozone_platform_test%': 0,
2076 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2077 'use_clipboard_aurax11%': 1,
2080 ['OS=="win" and use_goma==1', {
2081 # goma doesn't support pch yet.
2082 'chromium_win_pch': 0,
2083 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2091 ['OS=="win" and (clang==1 or asan==1)', {
2092 'chromium_win_pch': 0,
2095 # The seccomp-bpf sandbox is only supported on three architectures
2097 # Do not disable seccomp_bpf anywhere without talking to
2098 # security@chromium.org!
2099 ['((OS=="linux" or OS=="android") and '
2100 '(target_arch=="ia32" or target_arch=="x64" or '
2101 'target_arch=="arm"))', {
2102 'use_seccomp_bpf%': 1,
2104 'use_seccomp_bpf%': 0,
2108 # The path to the ANGLE library.
2109 'angle_path': '<(DEPTH)/third_party/angle',
2111 # List of default apps to install in new profiles. The first list contains
2112 # the source files as found in svn. The second list, used only for linux,
2113 # contains the destination location for each of the files. When a crx
2114 # is added or removed from the list, the chrome/browser/resources/
2115 # default_apps/external_extensions.json file must also be updated.
2116 'default_apps_list': [
2117 'browser/resources/default_apps/external_extensions.json',
2118 'browser/resources/default_apps/gmail.crx',
2119 'browser/resources/default_apps/search.crx',
2120 'browser/resources/default_apps/youtube.crx',
2121 'browser/resources/default_apps/drive.crx',
2122 'browser/resources/default_apps/docs.crx',
2124 'default_apps_list_linux_dest': [
2125 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2126 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2127 '<(PRODUCT_DIR)/default_apps/search.crx',
2128 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2129 '<(PRODUCT_DIR)/default_apps/drive.crx',
2130 '<(PRODUCT_DIR)/default_apps/docs.crx',
2133 'target_defaults': {
2135 # The condition that operates on chromium_code is in a target_conditions
2136 # section, and will not have access to the default fallback value of
2137 # chromium_code at the top of this file, or to the chromium_code
2138 # variable placed at the root variables scope of .gyp files, because
2139 # those variables are not set at target scope. As a workaround,
2140 # if chromium_code is not set at target scope, define it in target scope
2141 # to contain whatever value it has during early variable expansion.
2142 # That's enough to make it available during target conditional
2144 'chromium_code%': '<(chromium_code)',
2146 'component%': '<(component)',
2148 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2149 'win_release_Optimization%': '2', # 2 = /Os
2150 'win_debug_Optimization%': '0', # 0 = /Od
2152 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2153 # Tri-state: blank is default, 1 on, 0 off
2154 'win_release_OmitFramePointers%': '0',
2155 # Tri-state: blank is default, 1 on, 0 off
2156 'win_debug_OmitFramePointers%': '',
2158 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2159 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2161 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2162 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2163 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2165 # VS inserts quite a lot of extra checks to algorithms like
2166 # std::partial_sort in Debug build which make them O(N^2)
2167 # instead of O(N*logN). This is particularly slow under memory
2168 # tools like ThreadSanitizer so we want it to be disablable.
2169 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2170 'win_debug_disable_iterator_debugging%': '0',
2172 # An application manifest fragment to declare compatibility settings for
2173 # 'executable' targets. Ignored in other target type.
2174 'win_exe_compatibility_manifest%':
2175 '<(DEPTH)\\build\\win\\compatibility.manifest',
2177 'release_extra_cflags%': '',
2178 'debug_extra_cflags%': '',
2180 'release_valgrind_build%': '<(release_valgrind_build)',
2182 # the non-qualified versions are widely assumed to be *nix-only
2183 'win_release_extra_cflags%': '',
2184 'win_debug_extra_cflags%': '',
2186 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2187 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2189 # Only used by Windows build for now. Can be used to build into a
2190 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2191 # output files in src/build/VS2010_{Debug,Release}.
2192 'build_dir_prefix%': '',
2194 # Targets are by default not nacl untrusted code.
2195 'nacl_untrusted_build%': 0,
2197 'pnacl_compile_flags': [
2198 # pnacl uses the clang compiler so we need to suppress all the
2199 # same warnings as we do for clang.
2200 # TODO(sbc): Remove these if/when they are removed from the clang
2202 '-Wno-unused-function',
2203 '-Wno-char-subscripts',
2204 '-Wno-c++11-extensions',
2205 '-Wno-unnamed-type-template-args',
2209 ['OS=="win" and component=="shared_library"', {
2210 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2211 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2212 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2214 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2215 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2216 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2219 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2220 'mac_release_optimization%': 's', # Use -Os unless overridden
2221 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2223 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2224 'mac_release_optimization%': '3', # Use -O3 unless overridden
2225 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2228 'host_os%': '<(host_os)', # See comment above chromium_code.
2233 # Don't use deprecated V8 APIs anywhere.
2234 'V8_DEPRECATION_WARNINGS',
2235 # Temporary suppression until Blink code can be removed.
2236 'BLINK_SCALE_FILTERS_AT_RECORD_TIME',
2239 ['(OS=="mac" or OS=="ios") and asan==1', {
2241 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2244 # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
2245 ['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', {
2246 'cflags_cc!': ['-fno-rtti'],
2249 '-gline-tables-only',
2250 '-fintercept-allocation-functions',
2252 'defines': ['TYPE_PROFILING'],
2254 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2257 ['OS=="linux" and clang==1 and host_arch=="ia32"', {
2258 # TODO(dmikurube): Remove -Wno-sentinel when Clang/LLVM is fixed.
2259 # See http://crbug.com/162818.
2260 'cflags+': ['-Wno-sentinel'],
2262 ['branding=="Chrome"', {
2263 'defines': ['GOOGLE_CHROME_BUILD'],
2264 }, { # else: branding!="Chrome"
2265 'defines': ['CHROMIUM_BUILD'],
2267 ['OS=="mac" and component=="shared_library"', {
2269 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2270 'LD_RUNPATH_SEARCH_PATHS': [
2271 # For unbundled binaries.
2273 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2274 '@loader_path/../../..',
2279 'defines': ['ENABLE_RLZ'],
2281 ['component=="shared_library"', {
2282 'defines': ['COMPONENT_BUILD'],
2284 ['toolkit_views==1', {
2285 'defines': ['TOOLKIT_VIEWS=1'],
2287 ['ui_compositor_image_transport==1', {
2288 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2291 'defines': ['USE_AURA=1'],
2294 'defines': ['USE_ASH=1'],
2297 'defines': ['USE_CAIRO=1'],
2300 'defines': ['USE_CRAS=1'],
2303 'defines': ['USE_GLIB=1'],
2306 'defines': ['USE_OZONE=1'],
2308 ['use_default_render_theme==1', {
2309 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2311 ['use_libjpeg_turbo==1', {
2312 'defines': ['USE_LIBJPEG_TURBO=1'],
2315 'defines': ['USE_X11=1'],
2317 ['use_clipboard_aurax11==1', {
2318 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2320 ['enable_one_click_signin==1', {
2321 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2324 'defines': ['OS_CHROMEOS=1'],
2326 ['use_xi2_mt!=0 and use_x11==1', {
2327 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2329 ['image_loader_extension==1', {
2330 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2333 'defines': ['ENABLE_PROFILING=1'],
2336 'defines': ['ENABLE_REMOTING=1'],
2338 ['enable_webrtc==1', {
2339 'defines': ['ENABLE_WEBRTC=1'],
2341 ['proprietary_codecs==1', {
2342 'defines': ['USE_PROPRIETARY_CODECS'],
2344 ['enable_viewport==1', {
2345 'defines': ['ENABLE_VIEWPORT'],
2347 ['enable_pepper_cdms==1', {
2348 'defines': ['ENABLE_PEPPER_CDMS'],
2350 ['configuration_policy==1', {
2351 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2353 ['input_speech==1', {
2354 'defines': ['ENABLE_INPUT_SPEECH'],
2356 ['notifications==1', {
2357 'defines': ['ENABLE_NOTIFICATIONS'],
2359 ['enable_hidpi==1', {
2360 'defines': ['ENABLE_HIDPI=1'],
2362 ['native_discardable_memory==1', {
2363 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2365 ['native_memory_pressure_signals==1', {
2366 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2369 'defines': ['USE_UDEV'],
2373 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2376 ['clang==1 and asan==0 and msan==0 and tsan==0', {
2377 # Clang creates chubby debug information, which makes linking very
2378 # slow. For now, don't create debug information with clang. See
2379 # http://crbug.com/70000
2383 'debug_extra_cflags': '-g0',
2386 # Android builds symbols on release by default, disable them.
2389 'debug_extra_cflags': '-g0',
2390 'release_extra_cflags': '-g0',
2394 }, { # else clang!=1
2396 ['OS=="win" and fastbuild==2', {
2397 # Completely disable debug information.
2400 'GenerateDebugInformation': 'false',
2402 'VCCLCompilerTool': {
2403 'DebugInformationFormat': '0',
2407 ['OS=="win" and fastbuild==1', {
2410 # This tells the linker to generate .pdbs, so that
2411 # we can get meaningful stack traces.
2412 'GenerateDebugInformation': 'true',
2414 'VCCLCompilerTool': {
2415 # No debug info to be generated by compiler.
2416 'DebugInformationFormat': '0',
2420 ['OS=="linux" and fastbuild==2', {
2422 'debug_extra_cflags': '-g0',
2425 ['OS=="linux" and fastbuild==1', {
2427 'debug_extra_cflags': '-g1',
2430 ['OS=="android" and fastbuild==2', {
2432 'debug_extra_cflags': '-g0',
2433 'release_extra_cflags': '-g0',
2436 ['OS=="android" and fastbuild==1', {
2438 'debug_extra_cflags': '-g1',
2439 'release_extra_cflags': '-g1',
2446 ['dcheck_always_on!=0', {
2447 'defines': ['DCHECK_ALWAYS_ON=1'],
2448 }], # dcheck_always_on!=0
2449 ['tracing_like_official_build!=0', {
2450 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2451 }], # tracing_like_official_build!=0
2452 ['win_use_allocator_shim==0', {
2455 'defines': ['NO_TCMALLOC'],
2459 ['enable_eglimage==1', {
2461 'ENABLE_EGLIMAGE=1',
2465 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2473 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2479 '_CRT_SECURE_NO_DEPRECATE',
2480 '_SCL_SECURE_NO_DEPRECATE',
2481 # This define is required to pull in the new Win8 interfaces from
2482 # system headers like ShObjIdl.h.
2483 'NTDDI_VERSION=0x06020000',
2484 # This is required for ATL to use XP-safe versions of its functions.
2485 '_USING_V110_SDK71_',
2488 '<(DEPTH)/third_party/wtl/include',
2493 # Generates debug info when win_z7=1
2494 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2496 'GenerateDebugInformation': 'true',
2498 'VCCLCompilerTool': {
2499 'DebugInformationFormat': '1',
2505 ['enable_task_manager==1', {
2507 'ENABLE_TASK_MANAGER=1',
2510 ['enable_extensions==1', {
2512 'ENABLE_EXTENSIONS=1',
2515 ['OS=="win" and branding=="Chrome"', {
2516 'defines': ['ENABLE_SWIFTSHADER'],
2518 ['enable_dart==1', {
2519 'defines': ['WEBKIT_USING_DART=1'],
2521 ['enable_plugin_installation==1', {
2522 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2524 ['enable_plugins==1', {
2525 'defines': ['ENABLE_PLUGINS=1'],
2527 ['enable_session_service==1', {
2528 'defines': ['ENABLE_SESSION_SERVICE=1'],
2530 ['enable_themes==1', {
2531 'defines': ['ENABLE_THEMES=1'],
2533 ['enable_autofill_dialog==1', {
2534 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2536 ['enable_background==1', {
2537 'defines': ['ENABLE_BACKGROUND=1'],
2539 ['enable_google_now==1', {
2540 'defines': ['ENABLE_GOOGLE_NOW=1'],
2542 ['cld_version!=0', {
2543 'defines': ['CLD_VERSION=<(cld_version)'],
2545 ['cld2_dynamic!=0', {
2546 'defines': ['CLD2_DYNAMIC_MODE=1'],
2548 ['enable_printing==1', {
2549 'defines': ['ENABLE_FULL_PRINTING=1', 'ENABLE_PRINTING=1'],
2551 ['enable_printing==2', {
2552 'defines': ['ENABLE_PRINTING=1'],
2554 ['enable_spellcheck==1', {
2555 'defines': ['ENABLE_SPELLCHECK=1'],
2557 ['enable_captive_portal_detection==1', {
2558 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2560 ['enable_app_list==1', {
2561 'defines': ['ENABLE_APP_LIST=1'],
2563 ['enable_settings_app==1', {
2564 'defines': ['ENABLE_SETTINGS_APP=1'],
2566 ['disable_ftp_support==1', {
2567 'defines': ['DISABLE_FTP_SUPPORT=1'],
2569 ['enable_managed_users==1', {
2570 'defines': ['ENABLE_MANAGED_USERS=1'],
2572 ['data_reduction_fallback_host != ""', {
2574 'DATA_REDUCTION_FALLBACK_HOST="<(data_reduction_fallback_host)"'],
2576 ['data_reduction_dev_host != ""', {
2578 'DATA_REDUCTION_DEV_HOST="<(data_reduction_dev_host)"'],
2580 ['spdy_proxy_auth_origin != ""', {
2581 'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'],
2583 ['spdy_proxy_auth_property != ""', {
2584 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2586 ['spdy_proxy_auth_value != ""', {
2587 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2589 ['data_reduction_proxy_probe_url != ""', {
2591 'DATA_REDUCTION_PROXY_PROBE_URL="<(data_reduction_proxy_probe_url)"'],
2593 ['enable_mdns==1', {
2594 'defines': ['ENABLE_MDNS=1'],
2596 ['enable_service_discovery==1', {
2597 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2599 ['enable_hangout_services_extension==1', {
2600 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2602 ['enable_ipc_fuzzer==1', {
2603 'defines': ['ENABLE_IPC_FUZZER=1'],
2606 'defines': ['VIDEO_HOLE=1'],
2608 ], # conditions for 'target_defaults'
2609 'target_conditions': [
2610 ['<(use_openssl)==1', {
2611 'defines': ['USE_OPENSSL=1'],
2613 ['<(use_openssl_certs)==1', {
2614 'defines': ['USE_OPENSSL_CERTS=1'],
2616 ['>(nacl_untrusted_build)==1', {
2619 'USE_OPENSSL_CERTS=1',
2622 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
2623 'defines': ['USE_NSS=1'],
2625 ['enable_wexit_time_destructors==1', {
2629 '-Wexit-time-destructors',
2633 '-Wexit-time-destructors',
2639 ['chromium_code==0', {
2641 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
2642 # We don't want to get warnings from third-party code,
2643 # so remove any existing warning-enabling flags like -Wall.
2649 # Don't warn about hash_map in third-party code.
2653 # Don't warn about printf format problems.
2654 # This is off by default in gcc but on in Ubuntu's gcc(!).
2658 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
2662 # TODO: Fix all warnings on chromeos too.
2663 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
2668 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
2670 # Don't warn about ignoring the return value from e.g. close().
2671 # This is off by default in some gccs but on by default in others.
2672 # BSD systems do not support this option, since they are usually
2673 # using gcc 4.2.1, which does not have this flag yet.
2674 '-Wno-unused-result',
2679 '_CRT_SECURE_NO_DEPRECATE',
2680 '_CRT_NONSTDC_NO_WARNINGS',
2681 '_CRT_NONSTDC_NO_DEPRECATE',
2682 '_SCL_SECURE_NO_DEPRECATE',
2684 'msvs_disabled_warnings': [4800],
2686 'VCCLCompilerTool': {
2687 'WarningLevel': '3',
2688 'WarnAsError': '<(win_third_party_warn_as_error)',
2689 'Detect64BitPortabilityProblems': 'false',
2693 ['buildtype=="Official"', {
2695 'VCCLCompilerTool': { 'WarnAsError': 'false' },
2700 'VCCLCompilerTool': { 'WarnAsError': 'false' },
2705 # TODO(darin): Unfortunately, some third_party code depends on base.
2706 [ 'OS=="win" and component=="shared_library"', {
2707 'msvs_disabled_warnings': [
2708 4251, # class 'std::xx' needs to have dll-interface.
2711 [ 'OS=="mac" or OS=="ios"', {
2713 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
2716 ['buildtype=="Official"', {
2718 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
2725 # TODO(ios): Fix remaining warnings in third-party code, then
2726 # remove this; the Mac cleanup didn't get everything that's
2727 # flagged in an iOS build.
2728 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
2729 'RUN_CLANG_STATIC_ANALYZER': 'NO',
2730 # Several internal ios directories generate numerous warnings for
2731 # -Wobjc-missing-property-synthesis.
2732 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
2738 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
2739 'filename_rules.gypi',
2741 # In Chromium code, we define __STDC_foo_MACROS in order to get the
2742 # C99 macros on Mac and Linux.
2744 '__STDC_CONSTANT_MACROS',
2745 '__STDC_FORMAT_MACROS',
2749 # turn on warnings for signed/unsigned mismatch on chromium code.
2751 'VCCLCompilerTool': {
2752 'AdditionalOptions': ['/we4389'],
2756 ['OS=="win" and component=="shared_library"', {
2757 'msvs_disabled_warnings': [
2758 4251, # class 'std::xx' needs to have dll-interface.
2763 ], # target_conditions for 'target_defaults'
2764 'default_configuration': 'Debug',
2766 # VCLinkerTool LinkIncremental values below:
2768 # 1 == /INCREMENTAL:NO
2770 # Debug links incremental, Release does not.
2772 # Abstract base configurations to cover common attributes.
2776 'msvs_configuration_attributes': {
2777 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
2778 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
2779 'CharacterSet': '1',
2781 # Add the default import libs.
2784 'AdditionalDependencies': [
2808 'MinimumRequiredVersion': '5.01', # XP.
2809 'TargetMachine': '1',
2811 'VCLibrarianTool': {
2812 'TargetMachine': '1',
2815 'msvs_configuration_platform': 'Win32',
2819 'msvs_configuration_platform': 'x64',
2822 'TargetMachine': '17', # x86 - 64
2823 'AdditionalLibraryDirectories!':
2824 ['<(windows_sdk_path)/Lib/win8/um/x86'],
2825 'AdditionalLibraryDirectories':
2826 ['<(windows_sdk_path)/Lib/win8/um/x64'],
2827 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
2828 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
2830 'VCLibrarianTool': {
2831 'AdditionalLibraryDirectories!':
2832 ['<(windows_sdk_path)/Lib/win8/um/x86'],
2833 'AdditionalLibraryDirectories':
2834 ['<(windows_sdk_path)/Lib/win8/um/x64'],
2835 'TargetMachine': '17', # x64
2842 'DYNAMIC_ANNOTATIONS_ENABLED=1',
2843 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
2846 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
2848 '<@(debug_extra_cflags)',
2852 'VCCLCompilerTool': {
2853 'Optimization': '<(win_debug_Optimization)',
2854 'PreprocessorDefinitions': ['_DEBUG'],
2855 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
2856 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
2858 # According to MSVS, InlineFunctionExpansion=0 means
2859 # "default inlining", not "/Ob0".
2860 # Thus, we have to handle InlineFunctionExpansion==0 separately.
2861 ['win_debug_InlineFunctionExpansion==0', {
2862 'AdditionalOptions': ['/Ob0'],
2864 ['win_debug_InlineFunctionExpansion!=""', {
2865 'InlineFunctionExpansion':
2866 '<(win_debug_InlineFunctionExpansion)',
2868 ['win_debug_disable_iterator_debugging==1', {
2869 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
2872 # if win_debug_OmitFramePointers is blank, leave as default
2873 ['win_debug_OmitFramePointers==1', {
2874 'OmitFramePointers': 'true',
2876 ['win_debug_OmitFramePointers==0', {
2877 'OmitFramePointers': 'false',
2878 # The above is not sufficient (http://crbug.com/106711): it
2879 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
2880 # perform FPO regardless, so we must explicitly disable.
2881 # We still want the false setting above to avoid having
2882 # "/Oy /Oy-" and warnings about overriding.
2883 'AdditionalOptions': ['/Oy-'],
2886 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
2889 'LinkIncremental': '<(msvs_debug_link_incremental)',
2890 # ASLR makes debugging with windbg difficult because Chrome.exe and
2891 # Chrome.dll share the same base name. As result, windbg will
2892 # name the Chrome.dll module like chrome_<base address>, where
2893 # <base address> typically changes with each launch. This in turn
2894 # means that breakpoints in Chrome.dll don't stick from one launch
2895 # to the next. For this reason, we turn ASLR off in debug builds.
2896 # Note that this is a three-way bool, where 0 means to pick up
2897 # the default setting, 1 is off and 2 is on.
2898 'RandomizedBaseAddress': 1,
2900 'VCResourceCompilerTool': {
2901 'PreprocessorDefinitions': ['_DEBUG'],
2905 ['OS=="linux" or OS=="android"', {
2906 'target_conditions': [
2907 ['_toolset=="target"', {
2909 '<@(debug_extra_cflags)',
2914 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
2915 # Enable libstdc++ debugging facilities to help catch problems
2916 # early, see http://crbug.com/65151 .
2917 # TODO(phajdan.jr): Should we enable this for all of POSIX?
2918 'defines': ['_GLIBCXX_DEBUG=1',],
2920 ['release_valgrind_build==0', {
2923 '-fstack-protector-all', # Implies -fstack-protector
2935 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
2936 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
2937 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
2940 'VCCLCompilerTool': {
2941 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
2943 # In official builds, each target will self-select
2944 # an optimization level.
2945 ['buildtype!="Official"', {
2946 'Optimization': '<(win_release_Optimization)',
2949 # According to MSVS, InlineFunctionExpansion=0 means
2950 # "default inlining", not "/Ob0".
2951 # Thus, we have to handle InlineFunctionExpansion==0 separately.
2952 ['win_release_InlineFunctionExpansion==0', {
2953 'AdditionalOptions': ['/Ob0'],
2955 ['win_release_InlineFunctionExpansion!=""', {
2956 'InlineFunctionExpansion':
2957 '<(win_release_InlineFunctionExpansion)',
2960 # if win_release_OmitFramePointers is blank, leave as default
2961 ['win_release_OmitFramePointers==1', {
2962 'OmitFramePointers': 'true',
2964 ['win_release_OmitFramePointers==0', {
2965 'OmitFramePointers': 'false',
2966 # The above is not sufficient (http://crbug.com/106711): it
2967 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
2968 # perform FPO regardless, so we must explicitly disable.
2969 # We still want the false setting above to avoid having
2970 # "/Oy /Oy-" and warnings about overriding.
2971 'AdditionalOptions': ['/Oy-'],
2974 'AdditionalOptions': [ '<@(win_release_extra_cflags)', ],
2977 # LinkIncremental is a tri-state boolean, where 0 means default
2978 # (i.e., inherit from parent solution), 1 means false, and
2980 'LinkIncremental': '1',
2981 # This corresponds to the /PROFILE flag which ensures the PDB
2982 # file contains FIXUP information (growing the PDB file by about
2983 # 5%) but does not otherwise alter the output binary. This
2984 # information is used by the Syzygy optimization tool when
2985 # decomposing the release image.
2990 ['msvs_use_common_release', {
2991 'includes': ['release.gypi'],
2993 ['release_valgrind_build==0 and tsan==0', {
2996 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3000 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3001 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3002 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3005 ['win_use_allocator_shim==0', {
3006 'defines': ['NO_TCMALLOC'],
3008 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3009 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3010 # TODO(glider): once the bug is fixed, disable source fortification
3011 # under the sanitizer tools only.
3012 ['os_posix==1 and (OS!="linux" or clang!=1)', {
3013 'target_conditions': [
3014 ['chromium_code==1', {
3015 # Non-chromium code is not guaranteed to compile cleanly
3016 # with _FORTIFY_SOURCE. Also, fortified build may fail
3017 # when optimizations are disabled, so only do that for Release
3020 '_FORTIFY_SOURCE=2',
3025 ['OS=="linux" or OS=="android"', {
3026 'target_conditions': [
3027 ['_toolset=="target"', {
3029 '<@(release_extra_cflags)',
3036 'NS_BLOCK_ASSERTIONS=1',
3042 # Concrete configurations
3045 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3048 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3053 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3054 'target_conditions': [
3055 [ '_type=="executable"', {
3056 # To get a real .dSYM bundle produced by dsymutil, set the
3057 # debug information format to dwarf-with-dsym. Since
3058 # strip_from_xcode will not be used, set Xcode to do the
3059 # stripping as well.
3061 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3062 'DEPLOYMENT_POSTPROCESSING': 'YES',
3063 'STRIP_INSTALLED_PRODUCT': 'YES',
3070 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3072 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3075 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3083 'target_defaults': {
3090 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3091 ['os_posix==1 and disable_fatal_linker_warnings==0 and (chromeos==0 or target_arch!="arm")', {
3092 'target_defaults': {
3094 '-Wl,--fatal-warnings',
3098 ['os_posix==1 and chromeos==0', {
3099 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3100 # and we want to avoid overriding this, so stack-protector is only
3101 # enabled when not building on Chrome OS.
3102 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3104 'target_defaults': {
3106 '-fstack-protector',
3107 '--param=ssp-buffer-size=4',
3111 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3112 'target_defaults': {
3113 # Enable -Werror by default, but put it in a variable so it can
3114 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3116 'werror%': '-Werror',
3117 'libraries_for_target%': '',
3120 '_FILE_OFFSET_BITS=64',
3123 '<(werror)', # See note above about the werror variable.
3126 '-fno-strict-aliasing', # See http://crbug.com/32204
3128 # TODO(evan): turn this back on once all the builds work.
3130 # Don't warn about unused function params. We use those everywhere.
3131 '-Wno-unused-parameter',
3132 # Don't warn about the "struct foo f = {0};" initialization pattern.
3133 '-Wno-missing-field-initializers',
3134 # Don't export any symbols (for example, to plugins we dlopen()).
3135 # Note: this is *required* to make some plugins work.
3136 '-fvisibility=hidden',
3141 '-fno-threadsafe-statics',
3142 # Make inline functions have hidden visiblity by default.
3143 # Surprisingly, not covered by -fvisibility=hidden.
3144 '-fvisibility-inlines-hidden',
3145 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3146 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3150 '-pthread', '-Wl,-z,noexecstack',
3153 '<(libraries_for_target)',
3158 'debug_optimize%': '0',
3164 '-O>(debug_optimize)',
3170 # Only link with needed input sections. This is to avoid
3171 # getting undefined reference to __cxa_bad_typeid in the CDU
3173 '-Wl,--gc-sections',
3174 # Warn in case of text relocations.
3175 '-Wl,--warn-shared-textrel',
3178 ['OS=="android" and android_full_debug==0', {
3179 # Some configurations are copied from Release_Base to reduce
3182 'debug_optimize%': 's',
3185 '-fomit-frame-pointer',
3187 '-ffunction-sections',
3194 ['OS=="linux" and target_arch=="ia32"', {
3196 '-Wl,--no-as-needed',
3199 ['debug_unwind_tables==1', {
3200 'cflags': ['-funwind-tables'],
3202 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3204 # http://gcc.gnu.org/wiki/DebugFission
3205 # Requires gold and gcc >= 4.8 or clang.
3206 ['linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3207 'cflags': ['-gsplit-dwarf'],
3208 'ldflags': ['-Wl,--gdb-index'],
3214 'release_optimize%': '2',
3215 # Binaries become big and gold is unable to perform GC
3216 # and remove unused sections for some of test targets
3217 # on 32 bit platform.
3218 # (This is currently observed only in chromeos valgrind bots)
3219 # The following flag is to disable --gc-sections linker
3220 # option for these bots.
3221 'no_gc_sections%': 0,
3223 # TODO(bradnelson): reexamine how this is done if we change the
3224 # expansion of configurations
3225 'release_valgrind_build%': 0,
3228 '-O<(release_optimize)',
3229 # Don't emit the GCC version ident directives, they just end up
3230 # in the .comment section taking up binary size.
3232 # Put data and code in their own sections, so that unused symbols
3233 # can be removed at link time with --gc-sections.
3235 '-ffunction-sections',
3238 # Specifically tell the linker to perform optimizations.
3239 # See http://lwn.net/Articles/192624/ .
3244 ['no_gc_sections==0', {
3246 '-Wl,--gc-sections',
3251 'release_optimize%': 's',
3254 '-fomit-frame-pointer',
3257 # Warn in case of text relocations.
3258 '-Wl,--warn-shared-textrel',
3268 '-fno-omit-frame-pointer',
3272 ['profiling_full_stack_frames==1', {
3275 '-fno-optimize-sibling-calls',
3280 ['release_unwind_tables==1', {
3281 'cflags': ['-funwind-tables'],
3283 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3289 ['target_arch=="ia32"', {
3290 'target_conditions': [
3291 ['_toolset=="target"', {
3293 # Needed so that libs with .s files (e.g. libicudata.a)
3294 # are compatible with the general 32-bit-ness.
3297 # All floating-point computations on x87 happens in 80-bit
3298 # precision. Because the C and C++ language standards allow
3299 # the compiler to keep the floating-point values in higher
3300 # precision than what's specified in the source and doing so
3301 # is more efficient than constantly rounding up to 64-bit or
3302 # 32-bit precision as specified in the source, the compiler,
3303 # especially in the optimized mode, tries very hard to keep
3304 # values in x87 floating-point stack (in 80-bit precision)
3305 # as long as possible. This has important side effects, that
3306 # the real value used in computation may change depending on
3307 # how the compiler did the optimization - that is, the value
3308 # kept in 80-bit is different than the value rounded down to
3309 # 64-bit or 32-bit. There are possible compiler options to
3310 # make this behavior consistent (e.g. -ffloat-store would keep
3311 # all floating-values in the memory, thus force them to be
3312 # rounded to its original precision) but they have significant
3313 # runtime performance penalty.
3315 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3316 # which keep floating-point values in SSE registers in its
3317 # native precision (32-bit for single precision, and 64-bit
3318 # for double precision values). This means the floating-point
3319 # value used during computation does not change depending on
3320 # how the compiler optimized the code, since the value is
3321 # always kept in its specified precision.
3323 # Refer to http://crbug.com/348761 for rationale behind SSE2
3324 # being a minimum requirement for 32-bit Linux builds and
3325 # http://crbug.com/313032 for an example where this has "bit"
3330 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3337 # Use gold linker for Android ia32 target.
3346 # Install packages have started cropping up with
3347 # different headers between the 32-bit and 64-bit
3348 # versions, so we have to shadow those differences off
3349 # and make sure a 32-bit-on-64-bit build picks up the
3351 # For android build, use NDK headers instead of host headers
3352 ['host_arch!="ia32" and OS!="android"', {
3361 ['target_arch=="x64"', {
3362 'target_conditions': [
3363 ['_toolset=="target"', {
3365 # Use gold linker for Android x64 target.
3385 ['target_arch=="arm"', {
3386 'target_conditions': [
3387 ['_toolset=="target"', {
3389 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3390 # has changed whenever it encounters a varargs function. This
3391 # silences those warnings, as they are not helpful and
3392 # clutter legitimate warnings.
3398 '-march=<(arm_arch)',
3403 '-mtune=<(arm_tune)',
3411 ['arm_float_abi!=""', {
3413 '-mfloat-abi=<(arm_float_abi)',
3422 # Most of the following flags are derived from what Android
3423 # uses by default when building for arm, reference for which
3424 # can be found in the following file in the Android NDK:
3425 # toolchains/arm-linux-androideabi-4.4.3/setup.mk
3427 # The tree-sra optimization (scalar replacement for
3428 # aggregates enabling subsequent optimizations) leads to
3429 # invalid code generation when using the Android NDK's
3430 # compiler (r5-r7). This can be verified using
3431 # webkit_unit_tests' WTF.Checked_int8_t test.
3436 # Android now supports .relro sections properly.
3437 # NOTE: While these flags enable the generation of .relro
3438 # sections, the generated libraries can still be loaded on
3439 # older Android platform versions.
3447 'cflags': [ '-mthumb-interwork' ],
3451 '-marm', # Probably reduntant, but recommend by "perf" docs.
3452 '-mapcs-frame', # Seems required by -fno-omit-frame-pointer.
3457 # Clang does not support the following options.
3458 '-mthumb-interwork',
3459 '-finline-limit=64',
3465 # TODO(hans) Enable integrated-as (crbug.com/124610).
3466 '-no-integrated-as',
3467 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3471 # Clang does not support the following options.
3475 # As long as -fuse-ld=gold doesn't work, add a dummy directory
3476 # with an 'ld' that redirects to gold, so that clang uses gold.
3477 '-B<(PRODUCT_DIR)/../../build/android/arm-linux-androideabi-gold',
3482 '-marm', # Required for frame pointer based stack traces.
3491 ['target_arch=="arm64"', {
3492 'target_conditions': [
3493 ['_toolset=="target"', {
3497 '-fstack-protector', # stack protector is always enabled on arm64.
3504 ['target_arch=="mipsel"', {
3505 'target_conditions': [
3506 ['_toolset=="target"', {
3508 ['android_webview_build==0 and mips_arch_variant=="mips32r2"', {
3509 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
3511 ['android_webview_build==0 and mips_arch_variant!="mips32r2"', {
3512 'cflags': ['-mips32', '-Wa,-mips32'],
3521 '-Wl,--no-keep-memory'
3524 '-Wno-uninitialized',
3538 'target_conditions': [
3539 ['_toolset=="target"', {
3541 '--sysroot=<(sysroot)',
3544 '--sysroot=<(sysroot)',
3545 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
3553 # Don't die on dtoa code that uses a char as an array index.
3554 '-Wno-char-subscripts',
3556 # TODO(thakis): This used to be implied by -Wno-unused-function,
3557 # which we no longer use. Check if it makes sense to remove
3558 # this as well. http://crbug.com/316352
3559 '-Wno-unneeded-internal-declaration',
3561 # Warns on switches on enums that cover all enum values but
3562 # also contain a default: branch. Chrome is full of that.
3563 '-Wno-covered-switch-default',
3565 # Warns when a const char[] is converted to bool.
3566 '-Wstring-conversion',
3568 # C++11-related flags:
3570 # This warns on using ints as initializers for floats in
3571 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
3572 # which happens in several places in chrome code. Not sure if
3573 # this is worth fixing.
3574 '-Wno-c++11-narrowing',
3576 # TODO(thakis): Remove, http://crbug.com/263960
3577 '-Wno-reserved-user-defined-literal',
3579 # Clang considers the `register` keyword as deprecated, but e.g.
3580 # code generated by flex (used in angle) contains that keyword.
3581 # http://crbug.com/255186
3582 '-Wno-deprecated-register',
3584 # TODO(thakis): Remove, http://crbug.com/341352
3585 '-Wno-absolute-value',
3588 # Clang doesn't seem to know know this flag.
3592 # See the comment in the Mac section for what it takes to move
3593 # this to -std=c++11.
3597 ['clang==1 and OS=="android"', {
3598 # Android uses stlport, whose include/new defines
3599 # `void operator delete[](void* ptr) throw();`, which
3600 # clang's -Wimplicit-exception-spec-mismatch warns about for some
3601 # reason -- http://llvm.org/PR16638. TODO(thakis): Include stlport
3602 # via -isystem instead.
3604 '-Wno-implicit-exception-spec-mismatch',
3607 ['clang==1 and clang_use_chrome_plugins==1', {
3609 '<@(clang_chrome_plugins_flags)',
3612 ['clang==1 and clang_load!=""', {
3614 '-Xclang', '-load', '-Xclang', '<(clang_load)',
3617 ['clang==1 and clang_add_plugin!=""', {
3619 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
3622 ['clang==1 and target_arch=="ia32"', {
3624 # Else building libyuv gives clang's register allocator issues,
3625 # see llvm.org/PR15798 / crbug.com/233709
3626 '-momit-leaf-frame-pointer',
3629 ['clang==1 and "<(GENERATOR)"=="ninja"', {
3631 # See http://crbug.com/110262
3632 '-fcolor-diagnostics',
3635 # Common options for AddressSanitizer, LeakSanitizer,
3636 # ThreadSanitizer and MemorySanitizer.
3637 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
3638 'target_conditions': [
3639 ['_toolset=="target"', {
3641 '-fno-omit-frame-pointer',
3642 '-gline-tables-only',
3645 '-fomit-frame-pointer',
3648 # Functions interposed by the sanitizers can make ld think
3649 # that some libraries aren't needed when they actually are,
3650 # http://crbug.com/234010. As workaround, disable --as-needed.
3654 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3658 # TODO(glider): enable the default options on other systems.
3660 ['OS=="linux" and (chromeos==0 or target_arch!="ia32")', {
3662 '<(DEPTH)/base/base.gyp:sanitizer_options',
3668 'target_conditions': [
3669 ['_toolset=="target"', {
3671 '-fsanitize=address',
3672 '-w', # http://crbug.com/162783
3675 '-fsanitize=address',
3678 'ADDRESS_SANITIZER',
3685 '-mllvm -asan-globals=0', # http://crbug.com/352073
3690 ['asan_coverage!=0', {
3691 'target_conditions': [
3692 ['_toolset=="target"', {
3694 '-mllvm -asan-coverage=<(asan_coverage)',
3700 'target_conditions': [
3701 ['_toolset=="target"', {
3710 'WTF_USE_LEAK_SANITIZER=1',
3716 'target_conditions': [
3717 ['_toolset=="target"', {
3719 '-fsanitize=thread',
3721 '-mllvm', '-tsan-blacklist=<(tsan_blacklist)',
3724 '-fsanitize=thread',
3728 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
3729 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
3731 'target_conditions': [
3732 ['_type=="executable"', {
3742 'target_conditions': [
3743 ['_toolset=="target"', {
3745 '-fsanitize=memory',
3746 '-fsanitize-memory-track-origins',
3748 '-fsanitize-blacklist=<(msan_blacklist)',
3751 '-fsanitize=memory',
3756 'target_conditions': [
3757 ['_type=="executable"', {
3766 ['use_instrumented_libraries==1', {
3768 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
3771 ['use_custom_libcxx==1', {
3773 '<(DEPTH)/third_party/libc++/libc++.gyp:libc++',
3774 '<(DEPTH)/third_party/libc++abi/libc++abi.gyp:libc++abi',
3777 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
3778 'target_conditions' : [
3779 ['_toolset=="target"', {
3781 '-finstrument-functions',
3782 # Allow mmx intrinsics to inline, so that the
3783 #0 compiler can expand the intrinsics.
3784 '-finstrument-functions-exclude-file-list=mmintrin.h',
3787 ['_toolset=="target" and OS=="android"', {
3789 # Avoids errors with current NDK:
3790 # "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"
3791 '-finstrument-functions-exclude-file-list=arm_neon.h',
3796 ['linux_dump_symbols==1', {
3799 # TODO(thestig) We should not need to specify chromeos==0 here,
3800 # but somehow ChromeOS uses gold despite linux_use_bundled_gold==0.
3801 # http://crbug.com./360082
3802 ['linux_use_bundled_gold==0 and chromeos==0 and OS!="android"', {
3803 'target_conditions': [
3804 ['_toolset=="target"', {
3806 # Workarounds for linker OOM.
3807 '-Wl,--no-keep-memory',
3808 '-Wl,--reduce-memory-overheads',
3815 # TODO(dmikurube): Kill {linux|android}_use_tcmalloc. http://crbug.com/345554
3816 ['use_allocator!="tcmalloc" and (use_allocator!="see_use_tcmalloc" or ((OS=="linux" and linux_use_tcmalloc==0) or (OS=="android" and android_use_tcmalloc==0)))', {
3817 'defines': ['NO_TCMALLOC'],
3819 ['linux_use_gold_flags==1', {
3820 'target_conditions': [
3821 ['_toolset=="target"', {
3823 # Experimentation found that using four linking threads
3824 # saved ~20% of link time.
3825 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
3826 # Only apply this to the target linker, since the host
3827 # linker might not be gold, but isn't used much anyway.
3828 # TODO(raymes): Disable threading because gold is frequently
3829 # crashing on the bots: crbug.com/161942.
3831 # '-Wl,--thread-count=4',
3836 ['release_valgrind_build==0', {
3837 'target_conditions': [
3838 ['_toolset=="target"', {
3840 # There seems to be a conflict of --icf and -pie
3841 # in gold which can generate crashy binaries. As
3842 # a security measure, -pie takes precendence for
3850 # Newer gcc's support -fuse-ld, use the flag to force gold
3852 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
3853 # TODO(mithro): Watch for clang support at following thread:
3854 # http://clang-developers.42468.n3.nabble.com/Adding-fuse-ld-support-to-clang-td4032180.html
3855 ['gcc_version>=48', {
3865 ['linux_use_bundled_binutils==1', {
3867 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
3870 ['linux_use_bundled_gold==1', {
3871 # Put our binutils, which contains gold in the search path. We pass
3872 # the path to gold to the compiler. gyp leaves unspecified what the
3873 # cwd is when running the compiler, so the normal gyp path-munging
3874 # fails us. This hack gets the right path.
3876 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
3879 ['binutils_version>=224', {
3880 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
3881 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
3882 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
3883 # inside this file to allow usage of --no-as-needed and removal of
3886 '-Wl,--disable-new-dtags',
3892 # FreeBSD-specific options; note that most FreeBSD options are set above,
3895 'target_defaults': {
3897 '-Wl,--no-keep-memory',
3901 # Android-specific options; note that most are set above with Linux.
3904 # This is a unique identifier for a given build. It's used for
3905 # identifying various build artifacts corresponding to a particular
3906 # build of chrome (e.g. where to find archived symbols).
3907 'chrome_build_id%': '',
3909 # Use shared stlport library when system one used.
3910 # Figure this out early since it needs symbols from libgcc.a, so it
3911 # has to be before that in the set of libraries.
3912 ['use_system_stlport==1', {
3913 'android_stlport_library': 'stlport',
3916 ['component=="shared_library"', {
3917 'android_stlport_library': 'stlport_shared',
3919 'android_stlport_library': 'stlport_static',
3925 # Placing this variable here prevents from forking libvpx, used
3926 # by remoting. Remoting is off, so it needn't built,
3927 # so forking it's deps seems like overkill.
3928 # But this variable need defined to properly run gyp.
3929 # A proper solution is to have an OS==android conditional
3930 # in third_party/libvpx/libvpx.gyp to define it.
3931 'libvpx_path': 'lib/linux/arm',
3933 'target_defaults': {
3935 'release_extra_cflags%': '',
3937 # If we're using the components build, append "cr" to all shared
3938 # libraries to avoid naming collisions with android system library
3939 # versions with the same name (e.g. skia, icu).
3940 ['component=="shared_library"', {
3941 'android_product_extension': 'cr.so',
3943 'android_product_extension': 'so',
3947 'target_conditions': [
3948 ['_type=="shared_library"', {
3949 'product_extension': '<(android_product_extension)',
3952 # Settings for building device targets using Android's toolchain.
3953 # These are based on the setup.mk file from the Android NDK.
3955 # The NDK Android executable link step looks as follows:
3957 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
3958 # $(PRIVATE_OBJECTS) <-- The .o that we built
3959 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
3960 # $(TARGET_LIBGCC) <-- libgcc.a
3961 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
3962 # $(PRIVATE_LDLIBS) <-- System .so
3963 # $(TARGET_CRTEND_O) <-- crtend.o
3965 # For now the above are approximated for executables by adding
3966 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
3969 # The NDK Android shared library link step looks as follows:
3971 # $(PRIVATE_OBJECTS) <-- The .o that we built
3972 # -l,--whole-archive
3973 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
3974 # -l,--no-whole-archive
3975 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
3976 # $(TARGET_LIBGCC) <-- libgcc.a
3977 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
3978 # $(PRIVATE_LDLIBS) <-- System .so
3980 # For now, assume that whole static libraries are not needed.
3982 # For both executables and shared libraries, add the proper
3983 # libgcc.a to the start of libraries which puts it in the
3984 # proper spot after .o and .a files get linked in.
3986 # TODO: The proper thing to do longer-tem would be proper gyp
3987 # support for a custom link command line.
3988 ['_toolset=="target"', {
3990 '-pthread', # Not supported by Android toolchain.
3993 '-ffunction-sections',
3996 '-fstack-protector',
3998 '-finline-limit=64',
3999 '-Wa,--noexecstack',
4000 '<@(release_extra_cflags)',
4004 '__GNU_SOURCE=1', # Necessary for clone()
4006 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4007 'CHROME_BUILD_ID="<(chrome_build_id)"',
4010 '-pthread', # Not supported by Android toolchain.
4014 '-Wl,--no-undefined',
4015 # Don't export symbols from statically linked libraries.
4016 '-Wl,--exclude-libs=ALL',
4019 '-l<(android_stlport_library)',
4020 # Manually link the libgcc.a that the cross compiler uses.
4021 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4027 ['component=="shared_library"', {
4029 '-Wl,--exclude-libs=ALL',
4034 # Work around incompatibilities between bionic and clang
4036 '-D__compiler_offsetof=__builtin_offsetof',
4037 '-Dnan=__builtin_nan',
4040 ['target_arch=="arm"', {
4042 '-target arm-linux-androideabi',
4045 '-target arm-linux-androideabi',
4048 ['target_arch=="ia32"', {
4050 '-target x86-linux-androideabi',
4053 '-target x86-linux-androideabi',
4056 # Place holder for x64 support, not tested.
4057 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4058 ['target_arch=="x64"', {
4060 '-target x86_64-linux-androideabi',
4063 '-target x86_64-linux-androideabi',
4070 # Android build relies on -Wl,--gc-sections removing
4071 # unreachable code. ASan instrumentation for globals inhibits
4072 # this and results in a library with unresolvable relocations.
4073 # TODO(eugenis): find a way to reenable this.
4074 '-mllvm -asan-globals=0',
4077 ['enable_resource_whitelist_generation==1', {
4079 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
4082 ['android_webview_build==0', {
4084 # The NDK has these things, but doesn't define the constants
4085 # to say that it does. Define them here instead.
4089 '--sysroot=<(android_ndk_sysroot)',
4092 '--sysroot=<(android_ndk_sysroot)',
4095 ['android_webview_build==1', {
4097 # OpenAL headers from the Android tree.
4098 '<(android_src)/frameworks/wilhelm/include',
4101 # Android predefines this as 1; undefine it here so Chromium
4102 # can redefine it later to be 2 for chromium code and unset
4103 # for third party code. This works because cflags are added
4105 '-U_FORTIFY_SOURCE',
4106 # Disable any additional warnings enabled by the Android build system but which
4107 # chromium does not build cleanly with (when treating warning as errors).
4108 # Things that are part of -Wextra:
4109 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4110 '-Wno-ignored-qualifiers',
4112 '-Wno-unused-but-set-variable',
4115 # Other things unrelated to -Wextra:
4116 '-Wno-non-virtual-dtor',
4120 ['android_webview_build==1', {
4121 'target_conditions': [
4122 ['chromium_code==0', {
4124 # There is a class of warning which:
4125 # 1) Android always enables and also treats as errors
4126 # 2) Chromium ignores in third party code
4127 # So we re-enable those warnings when building Android.
4129 '-Wno-format-security',
4131 '-Wno-sequence-point',
4134 '-Wno-non-virtual-dtor',
4139 ['target_arch == "arm"', {
4141 # Enable identical code folding to reduce size.
4145 # NOTE: The stlport header include paths below are specified in
4146 # cflags rather than include_dirs because they need to come
4147 # after include_dirs. Think of them like system headers, but
4148 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4149 # toolchain (circa Gingerbread) will exhibit strange errors.
4150 # The include ordering here is important; change with caution.
4151 ['use_system_stlport==1', {
4153 # For libstdc++/include, which is used by stlport.
4154 '-I<(android_src)/bionic',
4155 '-I<(android_src)/external/stlport/stlport',
4157 }, { # else: use_system_stlport!=1
4159 '-I<(android_stlport_include)',
4162 '-L<(android_stlport_libs_dir)',
4165 ['target_arch=="ia32"', {
4166 # The x86 toolchain currently has problems with stack-protector.
4168 '-fstack-protector',
4171 '-fno-stack-protector',
4175 'target_conditions': [
4176 ['_type=="executable"', {
4179 '-Wl,--gc-sections',
4180 '-Wl,-z,nocopyreloc',
4181 # crtbegin_dynamic.o should be the last item in ldflags.
4182 '<(android_ndk_lib)/crtbegin_dynamic.o',
4185 # crtend_android.o needs to be the last item in libraries.
4186 # Do not add any libraries after this!
4187 '<(android_ndk_lib)/crtend_android.o',
4200 ['_type=="shared_library" or _type=="loadable_module"', {
4202 '-Wl,-shared,-Bsymbolic',
4205 ['android_webview_build==0', {
4207 # crtbegin_so.o should be the last item in ldflags.
4208 '<(android_ndk_lib)/crtbegin_so.o',
4211 # crtend_so.o needs to be the last item in libraries.
4212 # Do not add any libraries after this!
4213 '<(android_ndk_lib)/crtend_so.o',
4220 # Settings for building host targets using the system toolchain.
4221 ['_toolset=="host"', {
4223 # Due to issues in Clang build system, using ASan on 32-bit
4224 # binaries on x86_64 host is problematic.
4225 # TODO(eugenis): re-enable.
4226 '-fsanitize=address',
4227 '-w', # http://crbug.com/162783
4230 '-fsanitize=address',
4231 '-Wl,-z,noexecstack',
4232 '-Wl,--gc-sections',
4235 '-Wl,--warn-shared-textrel',
4236 '-Wl,--fatal-warnings',
4239 # Settings for building host targets on mac.
4240 ['_toolset=="host" and host_os=="mac"', {
4250 'cflags!': ['-fvisibility=hidden'],
4251 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4253 ['OS=="mac" or OS=="ios"', {
4254 'target_defaults': {
4257 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4258 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4259 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4260 'COPY_PHASE_STRIP': 'NO',
4261 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4262 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4263 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4264 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4265 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4266 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4267 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4268 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4269 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4270 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4271 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4272 'GCC_VERSION': '4.2',
4273 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4274 'USE_HEADERMAP': 'NO',
4279 # Don't warn about unused function parameters.
4280 '-Wno-unused-parameter',
4281 # Don't warn about the "struct foo f = {0};" initialization
4283 '-Wno-missing-field-initializers',
4286 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4287 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4289 # Note that the prebuilt Clang binaries should not be used for iOS
4290 # development except for ASan builds.
4292 # gnu++11 instead of c++11 is needed because some code uses
4293 # typeof() (a GNU extension).
4294 # TODO(thakis): Eventually switch this to c++11 instead of
4295 # gnu++11 (once typeof can be removed, which is blocked on c++11
4296 # being available everywhere).
4297 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', # -std=gnu++11
4298 # Warn if automatic synthesis is triggered with
4299 # the -Wobjc-missing-property-synthesis flag.
4300 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4301 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4305 # This warns on using ints as initializers for floats in
4306 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
4307 # which happens in several places in chrome code. Not sure if
4308 # this is worth fixing.
4309 '-Wno-c++11-narrowing',
4311 # Don't die on dtoa code that uses a char as an array index.
4312 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
4313 '-Wno-char-subscripts',
4315 # TODO(thakis): This used to be implied by -Wno-unused-function,
4316 # which we no longer use. Check if it makes sense to remove
4317 # this as well. http://crbug.com/316352
4318 '-Wno-unneeded-internal-declaration',
4320 # Warns on switches on enums that cover all enum values but
4321 # also contain a default: branch. Chrome is full of that.
4322 '-Wno-covered-switch-default',
4324 # Warns when a const char[] is converted to bool.
4325 '-Wstring-conversion',
4327 # Clang considers the `register` keyword as deprecated, but
4328 # e.g. code generated by flex (used in angle) contains that
4329 # keyword. http://crbug.com/255186
4330 '-Wno-deprecated-register',
4332 # TODO(thakis): Remove, http://crbug.com/341352
4333 '-Wno-absolute-value',
4335 # This warns on selectors from Cocoa headers (-length, -set).
4336 # cfe-dev is currently discussing the merits of this warning.
4337 # TODO(thakis): Reevaluate what to do with this, based one
4338 # cfe-dev discussion.
4339 '-Wno-selector-type-mismatch',
4343 ['clang_xcode==0', {
4344 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4345 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4349 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4351 '<@(clang_chrome_plugins_flags)',
4354 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4356 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4359 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4361 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4364 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4366 # See http://crbug.com/110262
4367 '-fcolor-diagnostics',
4370 ['OS=="ios" and target_subarch!="arm32" and \
4371 "<(GENERATOR)"=="xcode"', {
4373 # TODO(ios): when building Chrome for iOS on 64-bit platform
4374 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4375 # enabled. This cause failures when compiling protobuf code,
4376 # so disable the warning. http://crbug.com/359107
4377 '-Wno-shorten-64-to-32',
4385 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4391 '-fsanitize=address',
4392 '-mllvm -asan-globals=0', # http://crbug.com/352073
4393 '-w', # http://crbug.com/162783
4397 'ADDRESS_SANITIZER',
4398 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4401 ['asan_coverage!=0', {
4402 'target_conditions': [
4403 ['_toolset=="target"', {
4405 '-mllvm -asan-coverage=<(asan_coverage)',
4411 'target_conditions': [
4412 ['_type!="static_library"', {
4413 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4418 '-fsanitize=address',
4422 ['mac_write_linker_maps==1', {
4425 '-Wl,-map,>(_target_name).map',
4432 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4433 'target_conditions': [
4434 ['_type=="executable"', {
4440 # Define copy_asan_dylib_path in a variable ending in
4441 # _path so that gyp understands it's a path and
4442 # performs proper relativization during dict merging.
4443 'copy_asan_dylib_path':
4444 'mac/copy_asan_runtime_dylib.sh',
4446 'postbuild_name': 'Copy ASan runtime dylib',
4448 '<(copy_asan_dylib_path)',
4457 ], # target_conditions
4458 }, # target_defaults
4459 }], # OS=="mac" or OS=="ios"
4461 'target_defaults': {
4463 # These should end with %, but there seems to be a bug with % in
4464 # variables that are intended to be set to different values in
4465 # different targets, like these.
4466 'mac_pie': 1, # Most executables can be position-independent.
4467 # Strip debugging symbols from the target.
4468 'mac_strip': '<(mac_strip_release)',
4472 ['mac_want_real_dsym=="default"', {
4475 'mac_real_dsym': '<(mac_want_real_dsym)'
4480 ['mac_want_real_dsym=="default"', {
4481 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
4483 'mac_real_dsym': '<(mac_want_real_dsym)'
4490 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
4491 # (Equivalent to -fPIC)
4492 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
4493 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4494 # Keep pch files below xcodebuild/.
4495 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
4497 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
4498 # xcode_setting, but not until all downstream projects' mac bots are
4499 # using xcode >= 4.6, because that's when the default value of the
4500 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
4501 # setting is a no-op as far as xcode is concerned, but the compiler
4502 # behaves differently based on whether -fno-strict-aliasing is
4504 '-fno-strict-aliasing', # See http://crbug.com/32204.
4507 'target_conditions': [
4508 ['_type=="executable"', {
4511 # Arranges for data (heap) pages to be protected against
4512 # code execution when running on Mac OS X 10.7 ("Lion"), and
4513 # ensures that the position-independent executable (PIE) bit
4514 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
4516 # Define change_mach_o_flags in a variable ending in _path
4517 # so that GYP understands it's a path and performs proper
4518 # relativization during dict merging.
4519 'change_mach_o_flags_path':
4520 'mac/change_mach_o_flags_from_xcode.sh',
4521 'change_mach_o_flags_options%': [
4523 'target_conditions': [
4524 ['mac_pie==0 or release_valgrind_build==1', {
4525 # Don't enable PIE if it's unwanted. It's unwanted if
4526 # the target specifies mac_pie=0 or if building for
4527 # Valgrind, because Valgrind doesn't understand slide.
4528 # See the similar mac_pie/release_valgrind_build check
4530 'change_mach_o_flags_options': [
4536 'postbuild_name': 'Change Mach-O Flags',
4538 '<(change_mach_o_flags_path)',
4539 '>@(change_mach_o_flags_options)',
4546 'asan_saves_file': 'asan.saves',
4549 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
4553 'target_conditions': [
4554 ['mac_pie==1 and release_valgrind_build==0', {
4555 # Turn on position-independence (ASLR) for executables. When
4556 # PIE is on for the Chrome executables, the framework will
4557 # also be subject to ASLR.
4558 # Don't do this when building for Valgrind, because Valgrind
4559 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
4560 # understand slide, and get rid of the Valgrind check.
4563 '-Wl,-pie', # Position-independent executable (MH_PIE)
4569 ['(_type=="executable" or _type=="shared_library" or \
4570 _type=="loadable_module") and mac_strip!=0', {
4571 'target_conditions': [
4572 ['mac_real_dsym == 1', {
4573 # To get a real .dSYM bundle produced by dsymutil, set the
4574 # debug information format to dwarf-with-dsym. Since
4575 # strip_from_xcode will not be used, set Xcode to do the
4576 # stripping as well.
4580 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
4581 'DEPLOYMENT_POSTPROCESSING': 'YES',
4582 'STRIP_INSTALLED_PRODUCT': 'YES',
4583 'target_conditions': [
4584 ['_type=="shared_library" or _type=="loadable_module"', {
4585 # The Xcode default is to strip debugging symbols
4586 # only (-S). Local symbols should be stripped as
4587 # well, which will be handled by -x. Xcode will
4588 # continue to insert -S when stripping even when
4589 # additional flags are added with STRIPFLAGS.
4591 }], # _type=="shared_library" or _type=="loadable_module"
4592 ['_type=="executable"', {
4595 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
4598 }], # _type=="executable" and asan==1
4599 ], # target_conditions
4601 }, # configuration "Release"
4603 }, { # mac_real_dsym != 1
4604 # To get a fast fake .dSYM bundle, use a post-build step to
4605 # produce the .dSYM and strip the executable. strip_from_xcode
4606 # only operates in the Release configuration.
4610 # Define strip_from_xcode in a variable ending in _path
4611 # so that gyp understands it's a path and performs proper
4612 # relativization during dict merging.
4613 'strip_from_xcode_path': 'mac/strip_from_xcode',
4615 'postbuild_name': 'Strip If Needed',
4616 'action': ['<(strip_from_xcode_path)'],
4620 ], # target_conditions
4621 }], # (_type=="executable" or _type=="shared_library" or
4622 # _type=="loadable_module") and mac_strip!=0
4623 ], # target_conditions
4624 }, # target_defaults
4627 'target_defaults': {
4628 'xcode_settings' : {
4629 # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang
4631 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',
4634 # Older Xcodes do not support -Wno-deprecated-register, so pass an
4635 # additional flag to suppress the "unknown compiler option" error.
4636 # Restrict this flag to builds that are either compiling with Xcode
4637 # or compiling with Xcode's Clang. This will allow Ninja builds to
4638 # continue failing on unknown compiler options.
4639 # TODO(rohitrao): This flag is temporary and should be removed as
4640 # soon as the iOS bots are updated to use Xcode 5.1.
4641 ['clang_xcode==1', {
4643 '-Wno-unknown-warning-option',
4647 # Limit the valid architectures depending on "target_subarch".
4648 # This need to include the "arm" architectures but also the "x86"
4649 # ones (they are used when building for the simulator).
4650 ['target_subarch=="arm32"', {
4651 'VALID_ARCHS': ['armv7', 'i386'],
4653 ['target_subarch=="arm64"', {
4654 'VALID_ARCHS': ['arm64', 'x86_64'],
4656 ['target_subarch=="both"', {
4657 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
4661 'target_conditions': [
4662 ['_toolset=="host"', {
4664 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
4665 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4674 ['_toolset=="target"', {
4676 # This section should be for overriding host settings. But,
4677 # since we can't negate the iphone deployment target above, we
4678 # instead set it here for target only.
4679 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
4680 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
4683 ['_type=="executable"', {
4687 'DEPLOYMENT_POSTPROCESSING': 'YES',
4688 'STRIP_INSTALLED_PRODUCT': 'YES',
4693 # Remove dSYM to reduce build time.
4694 'DEBUG_INFORMATION_FORMAT': 'dwarf',
4700 ['chromium_ios_signing', {
4701 # iOS SDK wants everything for device signed.
4702 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
4704 'CODE_SIGNING_REQUIRED': 'NO',
4705 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
4710 ], # target_conditions
4711 }, # target_defaults
4714 'target_defaults': {
4716 '_WIN32_WINNT=0x0602',
4723 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
4724 'WIN32_LEAN_AND_MEAN',
4728 ['buildtype=="Official"', {
4729 # In official builds, targets can self-select an optimization
4730 # level by defining a variable named 'optimize', and setting it
4732 # - "size", optimizes for minimal code size - the default.
4733 # - "speed", optimizes for speed over code size.
4734 # - "max", whole program optimization and link-time code
4735 # generation. This is very expensive and should be used
4738 'optimize%': 'size',
4742 # Set /LTCG for the official builds.
4743 'LinkTimeCodeGeneration': '1',
4746 'target_conditions': [
4747 ['optimize=="size"', {
4749 'VCCLCompilerTool': {
4750 # 1, optimizeMinSpace, Minimize Size (/O1)
4751 'Optimization': '1',
4752 # 2, favorSize - Favor small code (/Os)
4753 'FavorSizeOrSpeed': '2',
4758 ['optimize=="speed"', {
4760 'VCCLCompilerTool': {
4761 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
4762 'Optimization': '2',
4763 # 1, favorSpeed - Favor fast code (/Ot)
4764 'FavorSizeOrSpeed': '1',
4769 ['optimize=="max"', {
4771 'VCCLCompilerTool': {
4772 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
4773 'Optimization': '2',
4774 # 1, favorSpeed - Favor fast code (/Ot)
4775 'FavorSizeOrSpeed': '1',
4776 # This implies link time code generation.
4777 'WholeProgramOptimization': 'true',
4785 ['component=="static_library"', {
4787 '_HAS_EXCEPTIONS=0',
4800 'AdditionalLibraryDirectories':
4801 ['<(windows_driver_kit_path)/lib/ATL/i386'],
4803 'VCLibrarianTool': {
4804 'AdditionalLibraryDirectories':
4805 ['<(windows_driver_kit_path)/lib/ATL/i386'],
4811 'VCLibrarianTool': {
4812 'AdditionalLibraryDirectories':
4813 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
4816 'AdditionalLibraryDirectories':
4817 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
4824 # Explicitly required when using the ATL with express
4825 'AdditionalDependencies': ['atlthunk.lib'],
4827 # ATL 8.0 included in WDK 7.1 makes the linker to generate
4828 # almost eight hundred LNK4254 and LNK4078 warnings:
4829 # - warning LNK4254: section 'ATL' (50000040) merged into
4830 # '.rdata' (40000040) with different attributes
4831 # - warning LNK4078: multiple 'ATL' sections found with
4832 # different attributes
4833 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
4836 'msvs_system_include_dirs': [
4837 '<(windows_driver_kit_path)/inc/atl71',
4838 '<(windows_driver_kit_path)/inc/mfc42',
4842 'msvs_system_include_dirs': [
4843 '<(windows_sdk_path)/Include/shared',
4844 '<(windows_sdk_path)/Include/um',
4845 '<(windows_sdk_path)/Include/winrt',
4846 '$(VSInstallDir)/VC/atlmfc/include',
4848 'msvs_cygwin_shell': 0,
4849 'msvs_disabled_warnings': [4351, 4355, 4396, 4503, 4819,
4850 # TODO(maruel): These warnings are level 4. They will be slowly
4851 # removed as code is fixed.
4852 4100, 4121, 4125, 4127, 4130, 4131, 4189, 4201, 4238, 4244, 4245,
4853 4310, 4428, 4481, 4505, 4510, 4512, 4530, 4610, 4611, 4701, 4702,
4857 'VCCLCompilerTool': {
4858 'AdditionalOptions': ['/MP'],
4859 'MinimalRebuild': 'false',
4860 'BufferSecurityCheck': 'true',
4861 'EnableFunctionLevelLinking': 'true',
4862 'RuntimeTypeInfo': 'false',
4863 'WarningLevel': '4',
4864 'WarnAsError': 'true',
4865 'DebugInformationFormat': '3',
4867 ['component=="shared_library"', {
4868 'ExceptionHandling': '1', # /EHsc
4870 'ExceptionHandling': '0',
4874 'VCLibrarianTool': {
4875 'AdditionalOptions': ['/ignore:4221'],
4876 'AdditionalLibraryDirectories': [
4877 '<(windows_sdk_path)/Lib/win8/um/x86',
4881 'AdditionalDependencies': [
4893 'AdditionalLibraryDirectories': [
4894 '<(windows_sdk_path)/Lib/win8/um/x86',
4896 'GenerateDebugInformation': 'true',
4897 'MapFileName': '$(OutDir)\\$(TargetName).map',
4898 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
4899 'FixedBaseAddress': '1',
4902 # 1 == /SUBSYSTEM:CONSOLE
4903 # 2 == /SUBSYSTEM:WINDOWS
4904 # Most of the executables we'll ever create are tests
4905 # and utilities with console output.
4909 'GenerateStublessProxies': 'true',
4910 'TypeLibraryName': '$(InputName).tlb',
4911 'OutputDirectory': '$(IntDir)',
4912 'HeaderFileName': '$(InputName).h',
4913 'DLLDataFileName': '$(InputName).dlldata.c',
4914 'InterfaceIdentifierFileName': '$(InputName)_i.c',
4915 'ProxyFileName': '$(InputName)_p.c',
4917 'VCResourceCompilerTool': {
4919 'AdditionalIncludeDirectories': [
4921 '<(SHARED_INTERMEDIATE_DIR)',
4924 'target_conditions': [
4925 ['_type=="executable"', {
4927 'EmbedManifest': 'true',
4930 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
4932 'AdditionalManifestFiles': [
4933 '>(win_exe_compatibility_manifest)',
4940 # Building with Clang on Windows is a work in progress and very
4941 # experimental. See crbug.com/82385.
4942 'VCCLCompilerTool': {
4943 'WarnAsError': 'false',
4944 'RuntimeTypeInfo': 'false',
4945 'AdditionalOptions': [
4946 '-fmsc-version=1800',
4949 # Many files use intrinsics without including this header.
4950 # TODO(hans): Fix those files, or move this to sub-GYPs.
4953 # TODO(hans): Make this list shorter eventually.
4954 '-Qunused-arguments',
4955 '-Wno-c++11-compat-deprecated-writable-strings',
4956 '-Wno-char-subscripts',
4957 '-Wno-deprecated-declarations',
4958 '-Wno-deprecated-register',
4960 '-Wno-enum-conversion',
4961 '-Wno-extra-tokens',
4962 '-Wno-ignored-attributes',
4963 '-Wno-incompatible-pointer-types',
4964 '-Wno-int-to-void-pointer-cast',
4965 '-Wno-invalid-noreturn',
4966 '-Wno-logical-op-parentheses',
4968 '-Wno-missing-braces',
4969 '-Wno-missing-declarations',
4970 '-Wno-msvc-include',
4971 '-Wno-absolute-value',
4972 '-Wno-null-dereference',
4973 '-Wno-overloaded-virtual',
4975 '-Wno-pointer-sign',
4977 '-Wno-return-type-c-linkage',
4979 '-Wno-sometimes-uninitialized',
4981 '-Wno-tautological-compare',
4982 '-Wno-unknown-pragmas',
4984 '-Wno-unused-function',
4985 '-Wno-unused-private-field',
4986 '-Wno-unused-value',
4987 '-Wno-unused-variable',
4993 # ASan on Windows is a work in progress and very experimental.
4994 # See crbug.com/345874.
4995 'VCCLCompilerTool': {
4996 'AdditionalOptions': [
4997 '-fsanitize=address',
5001 'AdditionalLibraryDirectories': [
5002 # TODO(hans): If make_clang_dir is absolute, this breaks.
5003 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.5/lib/windows',
5006 'target_conditions': [
5007 ['_type=="executable"', {
5009 'AdditionalDependencies': [
5010 'clang_rt.asan-i386.lib',
5014 ['_type=="shared_library" or _type=="loadable_module"', {
5016 'AdditionalDependencies': [
5017 'clang_rt.asan_dll_thunk-i386.lib',
5027 ['disable_nacl==1', {
5028 'target_defaults': {
5034 ['OS=="win" and msvs_use_common_linker_extras', {
5035 'target_defaults': {
5050 'AdditionalOptions': [
5059 'AdditionalOptions': ['/largeaddressaware'],
5068 'AdditionalOptions': [
5069 # safeseh is not compatible with x64
5081 ['enable_new_npdevice_api==1', {
5082 'target_defaults': {
5084 'ENABLE_NEW_NPDEVICE_API',
5088 # Don't warn about the "typedef 'foo' locally defined but not used"
5090 # TODO: remove this flag once all builds work. See crbug.com/227506
5091 ['gcc_version>=48', {
5092 'target_defaults': {
5094 '-Wno-unused-local-typedefs',
5098 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5100 'make_global_settings': [
5101 ['CC', '<(make_clang_dir)/bin/clang'],
5102 ['CXX', '<(make_clang_dir)/bin/clang++'],
5103 ['CC.host', '$(CC)'],
5104 ['CXX.host', '$(CXX)'],
5107 ['clang==1 and OS=="win"', {
5108 'make_global_settings': [
5109 # On Windows, gyp's ninja generator only looks at CC.
5110 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5113 ['OS=="android" and clang==0', {
5114 # Hardcode the compiler names in the Makefile so that
5115 # it won't depend on the environment at make time.
5116 'make_global_settings': [
5117 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5118 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5119 ['CC.host', '<!(which gcc)'],
5120 ['CXX.host', '<!(which g++)'],
5123 ['OS=="linux" and target_arch=="mipsel"', {
5124 'make_global_settings': [
5125 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5126 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5127 ['CC.host', '<!(which gcc)'],
5128 ['CXX.host', '<!(which g++)'],
5132 # TODO(yyanagisawa): supports GENERATOR==make
5133 # make generator doesn't support CC_wrapper without CC
5134 # in make_global_settings yet.
5135 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5136 'make_global_settings': [
5137 ['CC_wrapper', '<(gomadir)/gomacc'],
5138 ['CXX_wrapper', '<(gomadir)/gomacc'],
5139 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5140 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5145 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5146 # This block adds *project-wide* configuration settings to each project
5147 # file. It's almost always wrong to put things here. Specify your
5148 # custom xcode_settings in target_defaults to add them to targets instead.
5151 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5152 # setting sets the SDK on a project-wide basis. In order to get the
5153 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5154 # here at the project level.
5157 ['mac_sdk_path==""', {
5158 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5160 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5166 ['ios_sdk_path==""', {
5168 # TODO(justincohen): Ninja only supports simulator for now.
5169 ['"<(GENERATOR)"=="xcode"', {
5170 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5172 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5176 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5181 # Target both iPhone and iPad.
5182 'TARGETED_DEVICE_FAMILY': '1,2',
5185 ['target_arch=="x64"', {
5190 ['target_arch=="ia32"', {
5199 # The Xcode generator will look for an xcode_settings section at the root
5200 # of each dict and use it to apply settings on a file-wide basis. Most
5201 # settings should not be here, they should be in target-specific
5202 # xcode_settings sections, or better yet, should use non-Xcode-specific
5203 # settings in target dicts. SYMROOT is a special case, because many other
5204 # Xcode variables depend on it, including variables such as
5205 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5206 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5207 # files to appear (when present) in the UI as actual files and not red
5208 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5209 # and therefore SYMROOT, needs to be set at the project level.
5210 'SYMROOT': '<(DEPTH)/xcodebuild',