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%': '<!pymod_do_main(detect_host_arch)',
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" or OS=="linux"', {
100 # Whether we're a traditional desktop unix.
101 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
107 # Embedded implies ozone.
113 'use_system_fontconfig%': 0,
115 'use_system_fontconfig%': 1,
119 'target_arch%': 'arm',
121 # Default architecture we're building for is the architecture we're
122 # building on, and possibly sub-architecture (for iOS builds).
123 'target_arch%': '<(host_arch)',
127 # Copy conditionally-set variables out one scope.
128 'chromeos%': '<(chromeos)',
129 'desktop_linux%': '<(desktop_linux)',
130 'use_aura%': '<(use_aura)',
131 'use_ash%': '<(use_ash)',
132 'use_cras%': '<(use_cras)',
133 'use_ozone%': '<(use_ozone)',
134 'embedded%': '<(embedded)',
135 'use_openssl%': '<(use_openssl)',
136 'use_openssl_certs%': '<(use_openssl_certs)',
137 'use_system_fontconfig%': '<(use_system_fontconfig)',
138 'enable_viewport%': '<(enable_viewport)',
139 'enable_hidpi%': '<(enable_hidpi)',
140 'buildtype%': '<(buildtype)',
141 'branding%': '<(branding)',
142 'host_arch%': '<(host_arch)',
143 'target_arch%': '<(target_arch)',
145 'target_subarch%': '',
147 # This is set when building the Android WebView inside the Android
148 # build system, using the 'android' gyp backend. The WebView code is
149 # still built when this is unset, but builds using the normal chromium
151 'android_webview_build%': 0,
153 # Set ARM architecture version.
156 # Use aurax11 for clipboard implementation. This is true on linux_aura.
157 'use_clipboard_aurax11%': 0,
161 # If no gomadir is set, it uses the default gomadir.
165 # The system root for cross-compiles. Default: none.
169 # The system libdir used for this ABI.
170 'system_libdir%': 'lib',
178 # Set default value of toolkit_views based on OS.
179 ['OS=="win" or chromeos==1 or use_aura==1', {
185 # Embedded builds use aura without ash or views.
192 # Enable HiDPI on Mac OS, Chrome OS and Windows.
193 ['OS=="mac" or chromeos==1 or OS=="win"', {
197 # Enable App Launcher on ChromeOS, Windows and OSX.
198 # On Linux, enable App Launcher for the Aura build.
199 ['use_ash==1 or OS=="win" or OS=="mac" or (desktop_linux==1 and use_aura==1)', {
200 'enable_app_list%': 1,
202 'enable_app_list%': 0,
205 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
206 'use_default_render_theme%': 1,
208 'use_default_render_theme%': 0,
212 'use_ozone_evdev%': 1,
214 'use_ozone_evdev%': 0,
217 # Set default gomadir.
219 'gomadir': 'c:\\goma\\goma-win',
221 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
224 # Set the default "target_subarch" on iOS. Valid values are "arm32",
225 # "arm64" and "both" (meaning a fat binary).
227 # TODO(sdefresne): change the default from "arm32" to "both" for
228 # "target_subarch" once http://crbug.com/339477 is fixed.
230 # TODO(sdefresne): set the "target_arch" to "arm" once compilation
231 # of skia has been fixed for simulator. http://crbug.com/342377
233 'target_subarch%': 'arm32',
238 # Copy conditionally-set variables out one scope.
239 'chromeos%': '<(chromeos)',
240 'host_arch%': '<(host_arch)',
241 'target_arch%': '<(target_arch)',
242 'target_subarch%': '<(target_subarch)',
243 'toolkit_views%': '<(toolkit_views)',
244 'desktop_linux%': '<(desktop_linux)',
245 'use_aura%': '<(use_aura)',
246 'use_ash%': '<(use_ash)',
247 'use_cras%': '<(use_cras)',
248 'use_ozone%': '<(use_ozone)',
249 'use_ozone_evdev%': '<(use_ozone_evdev)',
250 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
251 'embedded%': '<(embedded)',
252 'use_openssl%': '<(use_openssl)',
253 'use_openssl_certs%': '<(use_openssl_certs)',
254 'use_system_fontconfig%': '<(use_system_fontconfig)',
255 'enable_viewport%': '<(enable_viewport)',
256 'enable_hidpi%': '<(enable_hidpi)',
257 'android_webview_build%': '<(android_webview_build)',
258 'use_goma%': '<(use_goma)',
259 'gomadir%': '<(gomadir)',
260 'enable_app_list%': '<(enable_app_list)',
261 'use_default_render_theme%': '<(use_default_render_theme)',
262 'buildtype%': '<(buildtype)',
263 'branding%': '<(branding)',
264 'arm_version%': '<(arm_version)',
265 'sysroot%': '<(sysroot)',
266 'chroot_cmd%': '<(chroot_cmd)',
267 'system_libdir%': '<(system_libdir)',
269 # Set to 1 to enable fast builds. Set to 2 for even faster builds
270 # (it disables debug info for fastest compilation - only for use
271 # on compile-only bots).
274 # Set to 1 to not store any build metadata (this isn't working yet but
275 # this flag will help us to get there). See http://crbug.com/314403.
276 # TODO(sebmarchand): Update this comment once this flag guarantee that
277 # there's no build metadata in the build artifacts.
278 'dont_embed_build_metadata%': 0,
280 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
281 # This is useful for parallel compilation tools which can't support /Zi.
282 # Only used on Windows.
285 # Set to 1 to enable dcheck in release.
286 'dcheck_always_on%': 0,
288 # Set to 1 to make a build that disables unshipped tracing events.
289 # Note: this setting is ignored if buildtype=="Official".
290 'tracing_like_official_build%': 0,
292 # Disable image loader component extension by default.
293 'image_loader_extension%': 0,
295 # Set NEON compilation flags.
298 # Detect NEON support at run-time.
299 'arm_neon_optional%': 0,
301 # Use libjpeg-turbo as the JPEG codec used by Chromium.
302 'use_libjpeg_turbo%': 1,
304 # Use system libjpeg. Note that the system's libjepg will be used even if
305 # use_libjpeg_turbo is set.
306 'use_system_libjpeg%': 0,
308 # By default, component is set to static_library and it can be overriden
309 # by the GYP command line or by ~/.gyp/include.gypi.
310 'component%': 'static_library',
312 # Set to select the Title Case versions of strings in GRD files.
313 'use_titlecase_in_grd_files%': 0,
315 # Use translations provided by volunteers at launchpad.net. This
316 # currently only works on Linux.
317 'use_third_party_translations%': 0,
319 # Remoting compilation is enabled by default. Set to 0 to disable.
322 # Configuration policy is enabled by default. Set to 0 to disable.
323 'configuration_policy%': 1,
325 # Variable safe_browsing is used to control the build time configuration
326 # for safe browsing feature. Safe browsing can be compiled in 3 different
327 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
328 # reporting features without enabling phishing and malware detection. This
329 # is useful to integrate a third party phishing/malware detection to
330 # existing safe browsing logic.
333 # Speech input is compiled in by default. Set to 0 to disable.
334 # TODO(tommyw): Speech Input doesn't exist anymore. Clarify the scope
335 # of this flag (and probably rename it).
338 # Notifications are compiled in by default. Set to 0 to disable.
339 'notifications%' : 1,
341 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
342 # regular builds and 1 for ASan builds.
343 'mac_want_real_dsym%': 'default',
345 # If this is set, the clang plugins used on the buildbot will be used.
346 # Run tools/clang/scripts/update.sh to make sure they are compiled.
347 # This causes 'clang_chrome_plugins_flags' to be set.
348 # Has no effect if 'clang' is not set as well.
349 'clang_use_chrome_plugins%': 1,
351 # Enable building with ASAN (Clang's -fsanitize=address option).
352 # -fsanitize=address only works with clang, but asan=1 implies clang=1
353 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
355 # Enable coverage gathering instrumentation in ASan. This flag also
356 # controls coverage granularity (1 for function-level coverage, 2 for
357 # block-level coverage).
360 # Enable Chromium overrides of the default configurations for various
361 # dynamic tools (like ASan).
362 'use_sanitizer_options%': 1,
364 # Enable building with SyzyAsan.
365 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
368 # Enable building with LSan (Clang's -fsanitize=leak option).
369 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
370 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
373 # Enable building with TSan (Clang's -fsanitize=thread option).
374 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
375 # See http://clang.llvm.org/docs/ThreadSanitizer.html
377 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/valgrind/tsan_v2/ignores.txt',
379 # Enable building with MSan (Clang's -fsanitize=memory option).
380 # MemorySanitizer only works with clang, but msan=1 implies clang=1
381 # See http://clang.llvm.org/docs/MemorySanitizer.html
383 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
384 # Track where uninitialized memory originates from. From fastest to
385 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
386 # - track the chain of stores leading from allocation site to use site.
387 'msan_track_origins%': 1,
389 # Enable building with UBSan (Clang's -fsanitize=undefined option).
390 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
391 # See http://clang.llvm.org/docs/UsersManual.html
394 # Use the dynamic libraries instrumented by one of the sanitizers
395 # instead of the standard system libraries.
396 'use_instrumented_libraries%': 0,
398 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
399 # stdlibc++ as standard library. This is intended to use for instrumented
401 'use_custom_libcxx%': 0,
403 # Use a modified version of Clang to intercept allocated types and sizes
404 # for allocated objects. clang_type_profiler=1 implies clang=1.
405 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
406 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
407 'clang_type_profiler%': 0,
409 # Set to true to instrument the code with function call logger.
410 # See src/third_party/cygprofile/cyg-profile.cc for details.
411 'order_profiling%': 0,
413 # Use the provided profiled order file to link Chrome image with it.
414 # This makes Chrome faster by better using CPU cache when executing code.
415 # This is known as PGO (profile guided optimization).
416 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
417 'order_text_section%' : "",
419 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
420 # libraries on linux x86-64 and arm, plus ASLR.
423 # Whether one-click signin is enabled or not.
424 'enable_one_click_signin%': 0,
426 # Whether to back up data before sync.
427 'enable_pre_sync_backup%': 0,
429 # Enable Chrome browser extensions
430 'enable_extensions%': 1,
433 'enable_google_now%': 1,
435 # Enable printing support and UI. This variable is used to configure
436 # which parts of printing will be built. 0 disables printing completely,
437 # 1 enables it fully, and 2 enables only the codepath to generate a
438 # Metafile (e.g. usually a PDF or EMF) and disables print preview, cloud
440 'enable_printing%': 1,
442 # Windows prints using a PDF as the metafile from the renderer.
443 'win_pdf_metafile_for_printing%': 1,
445 # Set the version of CLD.
446 # 0: Don't specify the version. This option is for the Finch testing.
451 # For CLD2, the size of the tables that should be included in the build
452 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
454 # See third_party/cld_2/cld_2.gyp for more information.
455 # 0: Small tables, lower accuracy
456 # 1: Medium tables, medium accuracy
457 # 2: Large tables, high accuracy
458 'cld2_table_size%': 2,
460 # The data acquisition mode for CLD2. Possible values are:
461 # static: CLD2 data is statically linked to the executable.
462 # standalone: CLD2 data is provided in a standalone file that is
463 # bundled with the executable.
464 # component: CLD2 data is provided as a Chrome "component" and is
465 # downloaded via the component updater.
466 'cld2_data_source': 'static',
468 # Enable spell checker.
469 'enable_spellcheck%': 1,
471 # Webrtc compilation is enabled by default. Set to 0 to disable.
474 # Enables use of the session service, which is enabled by default.
475 # Support for disabling depends on the platform.
476 'enable_session_service%': 1,
478 # Enables theme support, which is enabled by default. Support for
479 # disabling depends on the platform.
482 # Enables autofill dialog and associated features; disabled by default.
483 'enable_autofill_dialog%' : 0,
485 # Defaults Wallet integration in Autofill dialog to use production
486 # servers. Unofficial builds won't have the proper API keys.
487 'enable_prod_wallet_service%': 0,
489 # Enables support for background apps.
490 'enable_background%': 1,
492 # Enable the task manager by default.
493 'enable_task_manager%': 1,
495 # Enables used resource whitelist generation; disabled by default.
496 'enable_resource_whitelist_generation%': 0,
498 # Enable FILE support by default.
499 'disable_file_support%': 0,
501 # Enable FTP support by default.
502 'disable_ftp_support%': 0,
504 # Use native android functions in place of ICU. Not supported by most
506 'use_icu_alternatives_on_android%': 0,
508 # XInput2 multitouch support is enabled by default (use_xi2_mt=2).
509 # Setting to zero value disables XI2 MT. When XI2 MT is enabled,
510 # the input value also defines the required XI2 minor minimum version.
511 # For example, use_xi2_mt=2 means XI2.2 or above version is required.
514 # Use of precompiled headers on Windows.
516 # This variable may be explicitly set to 1 (enabled) or 0
517 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
518 # This setting will override the default.
521 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
523 'chromium_win_pch%': 0,
525 # Set this to true when building with Clang.
526 # See http://code.google.com/p/chromium/wiki/Clang for details.
529 # Enable plug-in installation by default.
530 'enable_plugin_installation%': 1,
532 # Specifies whether to use canvas_skia.cc in place of platform
533 # specific implementations of gfx::Canvas. Affects text drawing in the
535 # TODO(asvitkine): Enable this on all platforms and delete this flag.
536 # http://crbug.com/105550
537 'use_canvas_skia%': 0,
539 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
540 # with one of those tools.
541 'build_for_tool%': '',
543 # If no directory is specified then a temporary directory will be used.
544 'test_isolation_outdir%': '',
545 # True if isolate should fail if the isolate files refer to files
547 'test_isolation_fail_on_missing': 0,
549 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
550 'wix_path%': '<(DEPTH)/third_party/wix',
552 # Managed users are enabled by default.
553 'enable_managed_users%': 1,
555 # Platform natively supports discardable memory.
556 'native_discardable_memory%': 0,
558 # Platform sends memory pressure signals natively.
559 'native_memory_pressure_signals%': 0,
561 'data_reduction_fallback_host%' : '',
562 'data_reduction_dev_host%' : '',
563 'spdy_proxy_auth_origin%' : '',
564 'spdy_proxy_auth_property%' : '',
565 'spdy_proxy_auth_value%' : '',
566 'data_reduction_proxy_probe_url%' : '',
567 'data_reduction_proxy_warmup_url%' : '',
568 'data_reduction_proxy_ssl_origin%' : '',
569 'data_reduction_proxy_alt_origin%' : '',
570 'data_reduction_proxy_alt_fallback_origin%' : '',
572 'enable_service_discovery%': 0,
573 'enable_wifi_bootstrapping%': 0,
574 'enable_hangout_services_extension%': 0,
576 # Enable the Syzygy optimization step.
577 'syzygy_optimize%': 0,
579 # Enable hole punching for the protected video.
582 # Automatically select platforms under ozone. Turn this off to
583 # build only explicitly selected platforms.
584 'ozone_auto_platforms%': 1,
587 # A flag for POSIX platforms
594 # A flag for BSD platforms
595 ['OS=="freebsd" or OS=="openbsd"', {
602 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
608 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
609 # OpenSSL's certificate definition.
610 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
611 'use_openssl_certs%': 1,
613 'use_openssl_certs%': 0,
616 # libudev usage. This currently only affects the content layer.
617 ['OS=="linux" and embedded==0', {
623 # Flags to use X11 on non-Mac POSIX platforms.
624 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
631 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
637 # Flags to use pango and cairo.
638 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
647 ['OS=="linux" and embedded==0', {
653 # We always use skia text rendering in Aura on Windows, since GDI
654 # doesn't agree with our BackingStore.
655 # TODO(beng): remove once skia text rendering is on by default.
656 ['use_aura==1 and OS=="win"', {
657 'enable_skia_text%': 1,
660 # A flag to enable or disable our compile-time dependency
661 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
662 # support will be available. This option is useful
663 # for Linux distributions and for Aura.
664 ['OS!="linux" or chromeos==1', {
665 'use_gnome_keyring%': 0,
667 'use_gnome_keyring%': 1,
670 ['OS=="mac" or OS=="ios"', {
671 # Mac and iOS want Title Case strings
672 'use_titlecase_in_grd_files%': 1,
675 # Enable loader extensions on Chrome OS.
677 'image_loader_extension%': 1,
679 'image_loader_extension%': 0,
682 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
683 'enable_one_click_signin%': 1,
684 'enable_pre_sync_backup%': 1,
688 'enable_extensions%': 0,
689 'enable_google_now%': 0,
691 'enable_spellcheck%': 0,
695 'arm_neon_optional%': 1,
696 'native_discardable_memory%': 1,
697 'native_memory_pressure_signals%': 1,
698 'enable_printing%': 2,
699 'enable_task_manager%':0,
700 # Set to 1 once we have a notification system for Android.
701 # http://crbug.com/115320
706 # Android OS includes support for proprietary codecs regardless of
707 # building Chromium or Google Chrome. We also ship Google Chrome with
708 # proprietary codecs.
709 ['OS=="android" or branding=="Chrome"', {
710 'proprietary_codecs%': 1,
712 'proprietary_codecs%': 0,
715 ['OS=="mac" or OS=="ios"', {
716 'native_discardable_memory%': 1,
717 'native_memory_pressure_signals%': 1,
720 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
721 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
722 'enable_autofill_dialog%': 1,
725 ['buildtype=="Official"', {
726 'enable_prod_wallet_service%': 1,
736 'disable_ftp_support%': 1,
737 'enable_extensions%': 0,
738 'enable_google_now%': 0,
740 'enable_printing%': 0,
741 'enable_session_service%': 0,
747 'enable_managed_users%': 0,
748 'enable_task_manager%': 0,
751 # Use GPU accelerated cross process image transport by default
752 # on linux builds with the Aura window manager
753 ['use_aura==1 and OS=="linux"', {
754 'ui_compositor_image_transport%': 1,
756 'ui_compositor_image_transport%': 0,
759 # Turn precompiled headers on by default.
760 ['OS=="win" and buildtype!="Official"', {
761 'chromium_win_pch%': 1
764 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
765 'enable_plugin_installation%': 0,
767 'enable_plugin_installation%': 1,
770 # Whether PPAPI is enabled.
771 ['OS=="android" or OS=="ios" or embedded==1', {
772 'enable_plugins%': 0,
774 'enable_plugins%': 1,
777 # linux_use_bundled_gold: whether to use the gold linker binary checked
778 # into third_party/binutils. Force this off via GYP_DEFINES when you
779 # are using a custom toolchain and need to control -B in ldflags.
780 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
781 # for component=static_library builds.
782 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
783 'linux_use_bundled_gold%': 1,
785 'linux_use_bundled_gold%': 0,
788 # linux_use_bundled_binutils: whether to use the binary binutils
789 # checked into third_party/binutils. These are not multi-arch so cannot
790 # be used except on x86 and x86-64 (the only two architectures which
791 # are currently checke in). Force this off via GYP_DEFINES when you
792 # are using a custom toolchain and need to control -B in cflags.
793 ['OS=="linux" and (target_arch=="x64")', {
794 'linux_use_bundled_binutils%': 1,
796 'linux_use_bundled_binutils%': 0,
799 # linux_use_gold_flags: whether to use build flags that rely on gold.
800 # On by default for x64 Linux.
801 ['OS=="linux" and target_arch=="x64"', {
802 'linux_use_gold_flags%': 1,
804 'linux_use_gold_flags%': 0,
807 # linux_use_debug_fission: whether to use split DWARF debug info
808 # files. This can reduce link time significantly, but is incompatible
809 # with some utilities such as icecc and ccache. Requires gold and
810 # gcc >= 4.8 or clang.
811 # http://gcc.gnu.org/wiki/DebugFission
812 ['OS=="linux" and target_arch=="x64"', {
813 'linux_use_debug_fission%': 1,
815 'linux_use_debug_fission%': 0,
818 ['OS=="android" or OS=="ios"', {
819 'enable_captive_portal_detection%': 0,
821 'enable_captive_portal_detection%': 1,
824 # Enable Skia UI text drawing incrementally on different platforms.
825 # http://crbug.com/105550
827 # On Aura, this allows per-tile painting to be used in the browser
830 'use_canvas_skia%': 1,
834 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
835 'use_libjpeg_turbo%': 0,
839 # When building as part of the Android system, use system libraries
840 # where possible to reduce ROM size.
841 'use_system_libjpeg%': '<(android_webview_build)',
844 # Do not enable the Settings App on ChromeOS.
845 ['enable_app_list==1 and chromeos==0', {
846 'enable_settings_app%': 1,
848 'enable_settings_app%': 0,
851 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
852 # Set some defaults for arm/linux chrome builds
853 'use_allocator%': 'none',
854 # sysroot needs to be an absolute path otherwise it generates
855 # incorrect results when passed to pkg-config
856 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot',
857 }], # OS=="linux" and target_arch=="arm" and chromeos==0
859 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
861 ['target_arch=="x64"', {
862 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
864 ['target_arch=="ia32"', {
865 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
868 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
870 ['OS=="linux" and target_arch=="mipsel"', {
871 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
872 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
875 # Whether tests targets should be run, archived or just have the
876 # dependencies verified. All the tests targets have the '_run' suffix,
877 # e.g. base_unittests_run runs the target base_unittests. The test
878 # target always calls tools/swarming_client/isolate.py. See the script's
879 # --help for more information and the valid --mode values. Meant to be
880 # overriden with GYP_DEFINES.
881 # TODO(maruel): Remove the conditions as more configurations are
883 # NOTE: The check for disable_nacl==0 and component=="static_library"
884 # can't be used here because these variables are not defined yet, but it
885 # is still not supported.
886 ['OS!="ios" and OS!="android" and chromeos==0', {
887 'test_isolation_mode%': 'check',
889 'test_isolation_mode%': 'noop',
891 # Whether Android build uses OpenMAX DL FFT.
892 ['OS=="android" and ((target_arch=="arm" and arm_version >= 7) or target_arch=="ia32" or target_arch=="x64" or target_arch=="arm64" or target_arch=="mipsel")', {
893 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
894 # When enabled, this will also enable WebAudio support on
895 # Android for these architectures. Default is enabled. Whether
896 # WebAudio is actually available depends on runtime settings
898 'use_openmax_dl_fft%': 1,
900 'use_openmax_dl_fft%': 0,
902 ['OS=="win" or OS=="linux"', {
906 # Turns on compiler optimizations in V8 in Debug build, except
907 # on android_clang, where we're hitting a weird linker error.
908 # TODO(dpranke): http://crbug.com/266155 .
910 'v8_optimized_debug%': 1,
912 'v8_optimized_debug%': 2,
915 # Disable various features by default on embedded.
918 'enable_printing%': 0,
921 # By default, use ICU data file (icudtl.dat) on all platforms
922 # except when building Android WebView.
923 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
924 # Set the data reduction proxy origin for Android Webview.
925 ['android_webview_build==0', {
926 'icu_use_data_file_flag%' : 1,
927 'spdy_proxy_auth_origin%': '',
928 'data_reduction_proxy_probe_url%': '',
929 'data_reduction_proxy_warmup_url%': '',
930 'data_reduction_dev_host%': '',
931 'data_reduction_fallback_host%': '',
933 'icu_use_data_file_flag%' : 0,
934 'spdy_proxy_auth_origin%': 'https://proxy.googlezip.net:443/',
935 'data_reduction_proxy_probe_url%': 'http://check.googlezip.net/connect',
936 'data_reduction_proxy_warmup_url%': 'http://www.gstatic.com/generate_204',
937 'data_reduction_dev_host%': 'http://proxy-dev.googlezip.net:80/',
938 'data_reduction_fallback_host%': 'http://compress.googlezip.net:80/',
940 ['OS=="win" or OS=="mac"', {
941 'enable_wifi_bootstrapping%' : 1,
945 # Set this to 1 to enable use of concatenated impulse responses
946 # for the HRTF panner in WebAudio.
947 'use_concatenated_impulse_responses': 1,
949 # You can set the variable 'use_official_google_api_keys' to 1
950 # to use the Google-internal file containing official API keys
951 # for Google Chrome even in a developer build. Setting this
952 # variable explicitly to 1 will cause your build to fail if the
953 # internal file is missing.
955 # The variable is documented here, but not handled in this file;
956 # see //google_apis/determine_use_official_keys.gypi for the
959 # Set the variable to 0 to not use the internal file, even when
960 # it exists in your checkout.
962 # Leave it unset in your include.gypi to have the variable
963 # implicitly set to 1 if you have
964 # src/google_apis/internal/google_chrome_api_keys.h in your
965 # checkout, and implicitly set to 0 if not.
967 # Note that official builds always behave as if the variable
968 # was explicitly set to 1, i.e. they always use official keys,
969 # and will fail to build if the internal file is missing.
971 # NOTE: You MUST NOT explicitly set the variable to 2 in your
972 # include.gypi or by other means. Due to subtleties of GYP, this
973 # is not the same as leaving the variable unset, even though its
975 # //google_apis/determine_use_official_keys.gypi is 2.
977 # Set these to bake the specified API keys and OAuth client
978 # IDs/secrets into your build.
980 # If you create a build without values baked in, you can instead
981 # set environment variables to provide the keys at runtime (see
982 # src/google_apis/google_api_keys.h for details). Features that
983 # require server-side APIs may fail to work if no keys are
986 # Note that if you are building an official build or if
987 # use_official_google_api_keys has been set to 1 (explicitly or
988 # implicitly), these values will be ignored and the official
989 # keys will be used instead.
990 'google_api_key%': '',
991 'google_default_client_id%': '',
992 'google_default_client_secret%': '',
993 # Native Client is enabled by default.
994 'disable_nacl%': '0',
997 # Copy conditionally-set variables out one scope.
998 'branding%': '<(branding)',
999 'buildtype%': '<(buildtype)',
1000 'target_arch%': '<(target_arch)',
1001 'target_subarch%': '<(target_subarch)',
1002 'host_arch%': '<(host_arch)',
1003 'toolkit_views%': '<(toolkit_views)',
1004 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1005 'use_aura%': '<(use_aura)',
1006 'use_ash%': '<(use_ash)',
1007 'use_cras%': '<(use_cras)',
1008 'use_openssl%': '<(use_openssl)',
1009 'use_openssl_certs%': '<(use_openssl_certs)',
1010 'use_nss%': '<(use_nss)',
1011 'use_udev%': '<(use_udev)',
1012 'os_bsd%': '<(os_bsd)',
1013 'os_posix%': '<(os_posix)',
1014 'use_dbus%': '<(use_dbus)',
1015 'use_glib%': '<(use_glib)',
1016 'use_pango%': '<(use_pango)',
1017 'use_cairo%': '<(use_cairo)',
1018 'use_ozone%': '<(use_ozone)',
1019 'use_ozone_evdev%': '<(use_ozone_evdev)',
1020 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1021 'use_system_fontconfig%': '<(use_system_fontconfig)',
1022 'desktop_linux%': '<(desktop_linux)',
1023 'use_x11%': '<(use_x11)',
1024 'use_gnome_keyring%': '<(use_gnome_keyring)',
1025 'linux_fpic%': '<(linux_fpic)',
1026 'chromeos%': '<(chromeos)',
1027 'enable_viewport%': '<(enable_viewport)',
1028 'enable_hidpi%': '<(enable_hidpi)',
1029 'use_xi2_mt%':'<(use_xi2_mt)',
1030 'image_loader_extension%': '<(image_loader_extension)',
1031 'fastbuild%': '<(fastbuild)',
1032 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1033 'win_z7%': '<(win_z7)',
1034 'dcheck_always_on%': '<(dcheck_always_on)',
1035 'tracing_like_official_build%': '<(tracing_like_official_build)',
1036 'arm_version%': '<(arm_version)',
1037 'arm_neon%': '<(arm_neon)',
1038 'arm_neon_optional%': '<(arm_neon_optional)',
1039 'sysroot%': '<(sysroot)',
1040 'chroot_cmd%': '<(chroot_cmd)',
1041 'system_libdir%': '<(system_libdir)',
1042 'component%': '<(component)',
1043 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1044 'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
1045 'use_third_party_translations%': '<(use_third_party_translations)',
1046 'remoting%': '<(remoting)',
1047 'enable_one_click_signin%': '<(enable_one_click_signin)',
1048 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1049 'enable_webrtc%': '<(enable_webrtc)',
1050 'chromium_win_pch%': '<(chromium_win_pch)',
1051 'configuration_policy%': '<(configuration_policy)',
1052 'safe_browsing%': '<(safe_browsing)',
1053 'input_speech%': '<(input_speech)',
1054 'notifications%': '<(notifications)',
1055 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1056 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1058 'asan_coverage%': '<(asan_coverage)',
1059 'use_sanitizer_options%': '<(use_sanitizer_options)',
1060 'syzyasan%': '<(syzyasan)',
1061 'syzygy_optimize%': '<(syzygy_optimize)',
1064 'msan_blacklist%': '<(msan_blacklist)',
1065 'msan_track_origins%': '<(msan_track_origins)',
1067 'tsan_blacklist%': '<(tsan_blacklist)',
1068 'ubsan%': '<(ubsan)',
1069 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1070 'use_custom_libcxx%': '<(use_custom_libcxx)',
1071 'clang_type_profiler%': '<(clang_type_profiler)',
1072 'order_profiling%': '<(order_profiling)',
1073 'order_text_section%': '<(order_text_section)',
1074 'enable_extensions%': '<(enable_extensions)',
1075 'enable_plugin_installation%': '<(enable_plugin_installation)',
1076 'enable_plugins%': '<(enable_plugins)',
1077 'enable_session_service%': '<(enable_session_service)',
1078 'enable_themes%': '<(enable_themes)',
1079 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1080 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1081 'enable_background%': '<(enable_background)',
1082 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1083 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1084 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1085 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1086 'use_canvas_skia%': '<(use_canvas_skia)',
1087 'test_isolation_mode%': '<(test_isolation_mode)',
1088 'test_isolation_outdir%': '<(test_isolation_outdir)',
1089 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1090 'enable_printing%': '<(enable_printing)',
1091 'win_pdf_metafile_for_printing%': '<(win_pdf_metafile_for_printing)',
1092 'enable_spellcheck%': '<(enable_spellcheck)',
1093 'enable_google_now%': '<(enable_google_now)',
1094 'cld_version%': '<(cld_version)',
1095 'cld2_table_size%': '<(cld2_table_size)',
1096 'cld2_data_source%': '<(cld2_data_source)',
1097 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1098 'disable_file_support%': '<(disable_file_support)',
1099 'disable_ftp_support%': '<(disable_ftp_support)',
1100 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1101 'enable_task_manager%': '<(enable_task_manager)',
1102 'sas_dll_path%': '<(sas_dll_path)',
1103 'wix_path%': '<(wix_path)',
1104 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1105 'use_system_libjpeg%': '<(use_system_libjpeg)',
1106 'android_webview_build%': '<(android_webview_build)',
1107 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1108 'gyp_managed_install%': 0,
1109 'create_standalone_apk%': 1,
1110 'enable_app_list%': '<(enable_app_list)',
1111 'use_default_render_theme%': '<(use_default_render_theme)',
1112 'enable_settings_app%': '<(enable_settings_app)',
1113 'google_api_key%': '<(google_api_key)',
1114 'google_default_client_id%': '<(google_default_client_id)',
1115 'google_default_client_secret%': '<(google_default_client_secret)',
1116 'enable_managed_users%': '<(enable_managed_users)',
1117 'native_discardable_memory%': '<(native_discardable_memory)',
1118 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1119 'data_reduction_fallback_host%': '<(data_reduction_fallback_host)',
1120 'data_reduction_dev_host%': '<(data_reduction_dev_host)',
1121 'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)',
1122 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1123 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1124 'data_reduction_proxy_probe_url%': '<(data_reduction_proxy_probe_url)',
1125 'data_reduction_proxy_warmup_url%': '<(data_reduction_proxy_warmup_url)',
1126 'data_reduction_proxy_ssl_origin%' : '<(data_reduction_proxy_ssl_origin)',
1127 'data_reduction_proxy_alt_origin%' : '<(data_reduction_proxy_alt_origin)',
1128 'data_reduction_proxy_alt_fallback_origin%' : '<(data_reduction_proxy_alt_fallback_origin)',
1129 'enable_mdns%' : '<(enable_mdns)',
1130 'enable_service_discovery%' : '<(enable_service_discovery)',
1131 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1132 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1133 'v8_optimized_debug%': '<(v8_optimized_debug)',
1134 'proprietary_codecs%': '<(proprietary_codecs)',
1135 'use_goma%': '<(use_goma)',
1136 'gomadir%': '<(gomadir)',
1137 'video_hole%': '<(video_hole)',
1139 # Use system protobuf instead of bundled one.
1140 'use_system_protobuf%': 0,
1142 # Use system yasm instead of bundled one.
1143 'use_system_yasm%': 0,
1145 # Use system ICU instead of bundled one.
1146 'use_system_icu%' : 0,
1148 # Default to enabled PIE; this is important for ASLR but we may need to be
1149 # able to turn it off for various reasons.
1150 'linux_disable_pie%': 0,
1152 # The release channel that this build targets. This is used to restrict
1153 # channel-specific build options, like which installer packages to create.
1154 # The default is 'all', which does no channel-specific filtering.
1157 # Override chromium_mac_pch and set it to 0 to suppress the use of
1158 # precompiled headers on the Mac. Prefix header injection may still be
1159 # used, but prefix headers will not be precompiled. This is useful when
1160 # using distcc to distribute a build to compile slaves that don't
1161 # share the same compiler executable as the system driving the compilation,
1162 # because precompiled headers rely on pointers into a specific compiler
1163 # executable's image. Setting this to 0 is needed to use an experimental
1164 # Linux-Mac cross compiler distcc farm.
1165 'chromium_mac_pch%': 1,
1167 # The default value for mac_strip in target_defaults. This cannot be
1168 # set there, per the comment about variable% in a target_defaults.
1169 'mac_strip_release%': 0,
1171 # Set to 1 to enable java code coverage. Instruments classes during build
1172 # to produce .ec files during runtime.
1173 'emma_coverage%': 0,
1175 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1176 # separated with whitespace and/or comma. Only has effect if
1177 # 'emma_coverage=1'.
1180 # Set to 1 to enable running Android lint on java/class files.
1183 # Although base/allocator lets you select a heap library via an
1184 # environment variable, the libcmt shim it uses sometimes gets in
1185 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1186 # 'win_use_allocator_shim': 0,
1187 # 'win_release_RuntimeLibrary': 2
1188 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1189 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1191 # TODO(bradnelson): eliminate this when possible.
1192 # To allow local gyp files to prevent release.vsprops from being included.
1193 # Yes(1) means include release.vsprops.
1194 # Once all vsprops settings are migrated into gyp, this can go away.
1195 'msvs_use_common_release%': 1,
1197 # TODO(bradnelson): eliminate this when possible.
1198 # To allow local gyp files to override additional linker options for msvs.
1199 # Yes(1) means set use the common linker options.
1200 'msvs_use_common_linker_extras%': 1,
1202 # TODO(sgk): eliminate this if possible.
1203 # It would be nicer to support this via a setting in 'target_defaults'
1204 # in chrome/app/locales/locales.gypi overriding the setting in the
1205 # 'Debug' configuration in the 'target_defaults' dict below,
1206 # but that doesn't work as we'd like.
1207 'msvs_debug_link_incremental%': '2',
1209 # Needed for some of the largest modules.
1210 'msvs_debug_link_nonincremental%': '1',
1212 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1213 # to get incremental linking to be faster in debug builds.
1214 'incremental_chrome_dll%': '0',
1216 # Experimental setting to break chrome.dll into multiple pieces based on
1218 'chrome_multiple_dll%': '0',
1220 # Experimental setting to optimize Chrome's DLLs with PGO.
1221 'chrome_pgo_phase%': '0',
1223 # The default settings for third party code for treating
1224 # warnings-as-errors. Ideally, this would not be required, however there
1225 # is some third party code that takes a long time to fix/roll. So, this
1226 # flag allows us to have warnings as errors in general to prevent
1227 # regressions in most modules, while working on the bits that are
1229 'win_third_party_warn_as_error%': 'true',
1232 'clang%': '<(clang)',
1233 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
1235 # Control which version of clang to use when building for iOS. If set to
1236 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1237 # the version of clang that ships with the Chromium source. This variable
1238 # is automatically set to '1' when using the Xcode generator.
1241 # These two variables can be set in GYP_DEFINES while running
1242 # |gclient runhooks| to let clang run a plugin in every compilation.
1243 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1245 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1248 'clang_add_plugin%': '',
1250 # Tell ld64 to write map files describing binary layout. Useful
1251 # for looking at what contributes to binary size, e.g. with
1252 # https://github.com/nico/bloat
1253 'mac_write_linker_maps%': 0,
1255 # The default type of gtest.
1256 'gtest_target_type%': 'executable',
1258 # Enable sampling based profiler.
1259 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1261 # Profile without optimizing out stack frames when profiling==1.
1262 'profiling_full_stack_frames%': '0',
1264 # And if we want to dump symbols for Breakpad-enabled builds.
1265 'linux_dump_symbols%': 0,
1266 # And if we want to strip the binary after dumping symbols.
1267 'linux_strip_binary%': 0,
1268 # Strip the test binaries needed for Linux reliability tests.
1269 'linux_strip_reliability_tests%': 0,
1270 # If we want stack unwind support for backtrace().
1271 'debug_unwind_tables%': 1,
1272 'release_unwind_tables%': 1,
1274 # Override where to find binutils
1275 'binutils_version%': 0,
1276 'binutils_dir%': '',
1279 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1280 'use_allocator%': 'tcmalloc',
1282 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1283 'linux_link_gnome_keyring%': 0,
1284 # Set to 1 to link against gsettings APIs instead of using dlopen().
1285 'linux_link_gsettings%': 0,
1287 # Default arch variant for MIPS.
1288 'mips_arch_variant%': 'mips32r1',
1290 # Enable use of OpenMAX DL FFT routines.
1291 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1293 # Enable new NPDevice API.
1294 'enable_new_npdevice_api%': 0,
1296 # Enable EGLImage support in OpenMAX
1297 'enable_eglimage%': 1,
1299 # .gyp files or targets should set chromium_code to 1 if they build
1300 # Chromium-specific code, as opposed to external code. This variable is
1301 # used to control such things as the set of warnings to enable, and
1302 # whether warnings are treated as errors.
1303 'chromium_code%': 0,
1305 # Disable fatal linker warnings, similarly to how we make it possible
1306 # to disable -Werror (e.g. for different toolchain versions).
1307 'disable_fatal_linker_warnings%': 0,
1309 'release_valgrind_build%': 0,
1311 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1312 'enable_wexit_time_destructors%': 0,
1314 # Build libpeerconnection as a static library by default.
1315 'libpeer_target_type%': 'static_library',
1317 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1318 'internal_gles2_conform_tests%': 0,
1320 # Set to 1 to compile the filter fuzzer.
1321 'internal_filter_fuzzer%': 0,
1323 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1324 # so Cocoa is happy (http://crbug.com/20441).
1326 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1327 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1328 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1329 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1330 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1331 'vi', 'zh-CN', 'zh-TW',
1334 # Pseudo locales are special locales which are used for testing and
1335 # debugging. They don't get copied to the final app. For more info,
1336 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1343 # If debug_devtools is set to 1, JavaScript files for DevTools are
1344 # stored as is and loaded from disk. Otherwise, a concatenated file
1345 # is stored in resources.pak. It is still possible to load JS files
1346 # from disk by passing --debug-devtools cmdline switch.
1347 'debug_devtools%': 0,
1349 # The Java Bridge is not compiled in by default.
1352 # Code signing for iOS binaries. The bots need to be able to disable this.
1353 'chromium_ios_signing%': 1,
1355 # This flag is only used when disable_nacl==0 and disables all those
1356 # subcomponents which would require the installation of a native_client
1357 # untrusted toolchain.
1358 'disable_nacl_untrusted%': 0,
1360 # Disable Dart by default.
1363 # Copy out the setting of disable_nacl.
1364 'disable_nacl%': '<(disable_nacl)',
1366 # Portable Native Client is enabled by default.
1367 'disable_pnacl%': 0,
1369 # Whether to build full debug version for Debug configuration on Android.
1370 # Compared to full debug version, the default Debug configuration on Android
1371 # has no full v8 debug, has size optimization and linker gc section, so that
1372 # we can build a debug version with acceptable size and performance.
1373 'android_full_debug%': 0,
1375 # Sets the default version name and code for Android app, by default we
1376 # do a developer build.
1377 'android_app_version_name%': 'Developer Build',
1378 'android_app_version_code%': 0,
1380 # Contains data about the attached devices for gyp_managed_install.
1381 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1383 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1384 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1386 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1387 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1389 # Whether we are using the rlz library or not. Platforms like Android send
1390 # rlz codes for searches but do not use the library.
1393 # Turns on the i18n support in V8.
1394 'v8_enable_i18n_support': 1,
1396 # Compile d8 for the host toolset.
1397 'v8_toolset_for_d8': 'host',
1399 # Compiles v8 without its platform library.
1400 'v8_use_default_platform': 0,
1402 # Use the chromium skia by default.
1403 'use_system_skia%': '0',
1405 # Use brlapi from brltty for braille display support.
1408 # Relative path to icu.gyp from this file.
1409 'icu_gyp_path': '../third_party/icu/icu.gyp',
1411 # IPC fuzzer is disabled by default.
1412 'enable_ipc_fuzzer%': 0,
1415 # Force disable libstdc++ debug mode.
1416 'disable_glibcxx_debug%': 0,
1418 # Set to 1 to compile with MSE support for MPEG2 TS
1419 'enable_mpeg2ts_stream_parser%': 0,
1421 # Support ChromeOS touchpad gestures with ozone.
1422 'use_evdev_gestures%': 0,
1424 # Default ozone platform (if no --ozone-platform flag).
1425 'ozone_platform%': "",
1427 # Ozone platforms to include in the build.
1428 'ozone_platform_caca%': 0,
1429 'ozone_platform_dri%': 0,
1430 'ozone_platform_egltest%': 0,
1431 'ozone_platform_gbm%': 0,
1432 'ozone_platform_ozonex%': 0,
1433 'ozone_platform_test%': 0,
1435 # Chrome OS: whether to build ChromeVox from sources in the Chromium
1436 # repository rather than using precompiled JavaScript in
1437 # chrome/third_party/chromevox. This is still experimental.
1438 'use_migrated_chromevox%': 0,
1440 # Chrome OS: whether to also build the upcoming version of
1441 # ChromeVox, which can then be enabled via a command-line switch.
1442 'use_chromevox_next%': 0,
1445 # Enable the Syzygy optimization step for the official builds.
1446 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1447 'syzygy_optimize%': 1,
1449 'syzygy_optimize%': 0,
1451 # Get binutils version so we can enable debug fission if we can.
1452 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1454 # compiler_version doesn't work with clang
1455 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1456 # compiler_version works with clang.
1457 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1458 # that it takes effect here.
1459 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0', {
1460 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1462 # On Android we know the binutils version in the toolchain.
1464 'binutils_version%': 222,
1466 ['host_arch=="x64"', {
1467 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1469 ['host_arch=="ia32"', {
1470 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1472 # Our version of binutils in third_party/binutils
1473 ['linux_use_bundled_binutils==1', {
1474 'binutils_version%': 224,
1478 'binutils_version%': 0,
1480 # The version of GCC in use, set later in platforms that use GCC and have
1481 # not explicitly chosen to build with clang. Currently, this means all
1482 # platforms except Windows, Mac and iOS.
1483 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1484 # it takes effect here.
1485 ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0', {
1488 # We directly set the gcc versions since we know what we use.
1491 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1493 ['android_webview_build==1', {
1494 # Android WebView uses a hermetic toolchain even for host, so set it
1497 ['host_os=="mac"', {
1498 'host_gcc_version%': 42,
1500 'host_gcc_version%': 46,
1503 }, { # android_webview_build!=1
1504 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1508 'host_gcc_version%': 0,
1511 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1512 'windows_sdk_path%': '<(windows_sdk_default_path)',
1514 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
1516 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1517 'directx_sdk_path%': '<(directx_sdk_default_path)',
1519 'directx_sdk_path%': '$(DXSDK_DIR)',
1522 'windows_driver_kit_path%': '$(WDK_DIR)',
1524 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1526 ['target_arch=="mipsel"', {
1529 'nacl_untrusted_build%': 0,
1530 'use_allocator%': 'none',
1532 ['OS=="linux" and target_arch=="mipsel"', {
1533 'sysroot%': '<(sysroot)',
1536 # All Chrome builds have breakpad symbols, but only process the
1537 # symbols from official builds.
1538 ['(branding=="Chrome" and buildtype=="Official")', {
1539 'linux_dump_symbols%': 1,
1541 # Omit unwind support in official release builds to save space. We
1542 # can use breakpad for these builds.
1543 'release_unwind_tables%': 0,
1546 # For official builds, use a 64-bit linker to avoid running out
1547 # of address space. The buildbots should have a 64-bit kernel
1548 # and a 64-bit libc installed.
1549 ['host_arch=="ia32" and target_arch=="ia32"', {
1550 'linux_use_bundled_gold%': '1',
1551 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1556 }], # os_posix==1 and OS!="mac" and OS!="ios"
1559 'enable_background%': 0,
1560 'icu_use_data_file_flag%': 1,
1562 'use_system_libxml%': 1,
1563 'use_system_sqlite%': 1,
1565 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1566 'fi', 'fr', 'he', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms', 'nb',
1567 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr', 'uk',
1568 'vi', 'zh-CN', 'zh-TW',
1571 # The Mac SDK is set for iOS builds and passed through to Mac
1572 # sub-builds. This allows the Mac sub-build SDK in an iOS build to be
1573 # overridden from the command line the same way it is for a Mac build.
1574 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py 10.6)',
1576 # iOS SDK and deployment target support. The |ios_sdk| value is left
1577 # blank so that when it is set in the project files it will be the
1578 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1579 # causes Xcode to spit out a warning for every single project file for
1580 # not using the "current" SDK.
1582 'ios_sdk_path%': '',
1583 'ios_deployment_target%': '6.0',
1586 # ios_product_name is set to the name of the .app bundle as it should
1588 ['branding=="Chrome"', {
1589 'ios_product_name%': 'Chrome',
1590 }, { # else: branding!="Chrome"
1591 'ios_product_name%': 'Chromium',
1593 ['branding=="Chrome" and buildtype=="Official"', {
1595 }, { # else: branding!="Chrome" or buildtype!="Official"
1601 # Location of Android NDK.
1604 # Unfortunately we have to use absolute paths to the SDK/NDK because
1605 # they're passed to ant which uses a different relative path from
1607 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1608 'android_ndk_experimental_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk_experimental/',
1609 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1610 'android_host_arch%': '<!(uname -m)',
1611 # Android API-level of the SDK used for compilation.
1612 'android_sdk_version%': '19',
1613 'android_sdk_build_tools_version%': '19.0.0',
1614 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1616 # Copy conditionally-set variables out one scope.
1617 'android_ndk_root%': '<(android_ndk_root)',
1618 'android_sdk_root%': '<(android_sdk_root)',
1619 'android_sdk_version%': '<(android_sdk_version)',
1620 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1621 'host_os%': '<(host_os)',
1623 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1624 # Android SDK build tools (e.g. dx, aapt, aidl)
1625 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1627 # Android API level 14 is ICS (Android 4.0) which is the minimum
1628 # platform requirement for Chrome on Android, we use it for native
1631 ['target_arch == "ia32"', {
1632 'android_app_abi%': 'x86',
1633 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1634 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1635 'android_ndk_lib_dir%': 'usr/lib',
1636 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1638 ['target_arch == "x64"', {
1639 'android_app_abi%': 'x86_64',
1640 'android_gdbserver%': '<(android_ndk_experimental_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1641 'android_ndk_sysroot%': '<(android_ndk_experimental_root)/platforms/android-20/arch-x86_64',
1642 'android_ndk_lib_dir%': 'usr/lib64',
1643 'android_toolchain%': '<(android_ndk_experimental_root)/toolchains/x86_64-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1644 'android_stlport_root': '<(android_ndk_experimental_root)/sources/cxx-stl/stlport',
1646 ['target_arch=="arm"', {
1649 'android_app_abi%': 'armeabi',
1651 'android_app_abi%': 'armeabi-v7a',
1654 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1655 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1656 'android_ndk_lib_dir%': 'usr/lib',
1657 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1659 ['target_arch == "arm64"', {
1660 'android_app_abi%': 'arm64-v8a',
1661 'android_gdbserver%': '<(android_ndk_experimental_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1662 'android_ndk_sysroot%': '<(android_ndk_experimental_root)/platforms/android-20/arch-arm64',
1663 'android_ndk_lib_dir%': 'usr/lib',
1664 'android_toolchain%': '<(android_ndk_experimental_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1665 'android_stlport_root': '<(android_ndk_experimental_root)/sources/cxx-stl/stlport',
1667 ['target_arch == "mipsel"', {
1668 'android_app_abi%': 'mips',
1669 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1670 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1671 'android_ndk_lib_dir%': 'usr/lib',
1672 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1676 # Copy conditionally-set variables out one scope.
1677 'android_app_abi%': '<(android_app_abi)',
1678 'android_gdbserver%': '<(android_gdbserver)',
1679 'android_ndk_root%': '<(android_ndk_root)',
1680 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1681 'android_sdk_root%': '<(android_sdk_root)',
1682 'android_sdk_version%': '<(android_sdk_version)',
1683 'android_toolchain%': '<(android_toolchain)',
1685 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1686 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1687 'android_sdk_tools%': '<(android_sdk_tools)',
1688 'android_sdk%': '<(android_sdk)',
1689 'android_sdk_jar%': '<(android_sdk)/android.jar',
1691 'android_stlport_root': '<(android_stlport_root)',
1692 'android_stlport_include': '<(android_stlport_root)/stlport',
1693 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1694 'host_os%': '<(host_os)',
1696 # Location of the "strip" binary, used by both gyp and scripts.
1697 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1699 # Location of the "readelf" binary.
1700 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1702 # Determines whether we should optimize JNI generation at the cost of
1703 # breaking assumptions in the build system that when inputs have changed
1704 # the outputs should always change as well. This is meant purely for
1705 # developer builds, to avoid spurious re-linking of native files.
1706 'optimize_jni_generation%': 0,
1708 # Always uses openssl.
1710 'use_openssl_certs%': 1,
1712 'proprietary_codecs%': '<(proprietary_codecs)',
1713 'safe_browsing%': 2,
1716 'build_ffmpegsumo%': 0,
1717 'use_allocator%': 'none',
1719 # Disable Native Client.
1722 # Android does not support background apps.
1723 'enable_background%': 0,
1725 # Sessions are store separately in the Java side.
1726 'enable_session_service%': 0,
1730 'gtest_target_type%': 'shared_library',
1732 # Uses system APIs for decoding audio and video.
1733 'use_libffmpeg%': '0',
1735 # When building as part of the Android system, use system libraries
1736 # where possible to reduce ROM size.
1737 # TODO(steveblock): Investigate using the system version of sqlite.
1738 'use_system_sqlite%': 0, # '<(android_webview_build)',
1739 'use_system_expat%': '<(android_webview_build)',
1740 'use_system_icu%': '<(android_webview_build)',
1741 'use_system_stlport%': '<(android_webview_build)',
1743 # Copy it out one scope.
1744 'android_webview_build%': '<(android_webview_build)',
1746 ['android_webview_build==1', {
1747 # When building the WebView in the Android tree, jarjar will remap all
1748 # the class names, so the JNI generator needs to know this.
1749 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1753 # All Chrome builds have breakpad symbols, but only process the
1754 # symbols from official builds.
1755 ['(branding=="Chrome" and buildtype=="Official")', {
1756 'mac_strip_release%': 1,
1760 ['OS=="mac" or OS=="ios"', {
1764 # Mac OS X SDK and deployment target support. The SDK identifies
1765 # the version of the system headers that will be used, and
1766 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1767 # macro. "Maximum allowed" refers to the operating system version
1768 # whose APIs are available in the headers. The deployment target
1769 # identifies the minimum system version that the built products are
1770 # expected to function on. It corresponds to the
1771 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1772 # macros are available, #include <AvailabilityMacros.h>. Additional
1773 # documentation on these macros is available at
1774 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1775 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1776 # deployment target to 10.6. Other projects, such as O3D, may
1777 # override these defaults.
1779 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1780 # about that is at least the specified version. In official builds,
1781 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1782 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1783 # path to the SDK; when set to a non-empty string, SDK detection
1784 # based on mac_sdk_min will be bypassed entirely.
1785 'mac_sdk_min%': '10.6',
1786 'mac_sdk_path%': '',
1788 'mac_deployment_target%': '10.6',
1791 'mac_sdk_min': '<(mac_sdk_min)',
1792 'mac_sdk_path': '<(mac_sdk_path)',
1793 'mac_deployment_target': '<(mac_deployment_target)',
1795 # Compile in Breakpad support by default so that it can be
1796 # tested, even if it is not enabled by default at runtime.
1797 'mac_breakpad_compiled_in%': 1,
1799 # mac_product_name is set to the name of the .app bundle as it should
1800 # appear on disk. This duplicates data from
1801 # chrome/app/theme/chromium/BRANDING and
1802 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1803 # these names into the build system.
1804 ['branding=="Chrome"', {
1805 'mac_product_name%': 'Google Chrome',
1806 }, { # else: branding!="Chrome"
1807 'mac_product_name%': 'Chromium',
1810 ['branding=="Chrome" and buildtype=="Official"', {
1811 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1812 # Enable uploading crash dumps.
1813 'mac_breakpad_uploads%': 1,
1814 # Enable dumping symbols at build time for use by Mac Breakpad.
1816 # Enable Keystone auto-update support.
1818 }, { # else: branding!="Chrome" or buildtype!="Official"
1819 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1820 'mac_breakpad_uploads%': 0,
1825 }], # OS=="mac" or OS=="ios"
1828 # This is the architecture convention used in WinSDK paths.
1829 ['target_arch=="ia32"', {
1830 'winsdk_arch%': 'x86',
1832 'winsdk_arch%': '<(target_arch)',
1834 ['component=="shared_library"', {
1835 'win_use_allocator_shim%': 0,
1837 # Turn on multiple dll by default on Windows when in static_library.
1838 'chrome_multiple_dll%': 1,
1841 'win_use_allocator_shim%': 0,
1843 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1844 # Only enabled by default for ninja because it's buggy in VS.
1845 # Not enabled for component=static_library because some targets
1846 # are too large and the toolchain fails due to the size of the
1848 'incremental_chrome_dll%': 1,
1850 # Don't do incremental linking for large modules on 32-bit or when
1851 # component=static_library as the toolchain fails due to the size of
1853 ['MSVS_OS_BITS==32 or component=="static_library"', {
1854 'msvs_large_module_debug_link_mode%': '1', # No
1856 'msvs_large_module_debug_link_mode%': '2', # Yes
1858 ['MSVS_VERSION=="2013e"', {
1866 'nacl_win64_defines': [
1867 # This flag is used to minimize dependencies when building
1868 # Native Client loader for 64-bit Windows.
1873 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios"', {
1879 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1880 'enable_pepper_cdms%': 1,
1882 'enable_pepper_cdms%': 0,
1886 'enable_browser_cdms%': 1,
1888 'enable_browser_cdms%': 0,
1891 # Native Client glibc toolchain is enabled
1892 # by default except on arm and mips.
1893 ['target_arch=="arm" or target_arch=="mipsel"', {
1894 'disable_glibc%': 1,
1896 'disable_glibc%': 0,
1899 # Set the relative path from this file to the GYP file of the JPEG
1900 # library used by Chromium.
1901 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1902 # Configuration for using the system libjeg is here.
1903 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1905 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1908 # Options controlling the use of GConf (the classic GNOME configuration
1909 # system) and GIO, which contains GSettings (the new GNOME config system).
1910 ['chromeos==1 or embedded==1', {
1918 # Set up -D and -E flags passed into grit.
1919 ['branding=="Chrome"', {
1920 # TODO(mmoss) The .grd files look for _google_chrome, but for
1921 # consistency they should look for google_chrome_build like C++.
1922 'grit_defines': ['-D', '_google_chrome',
1923 '-E', 'CHROMIUM_BUILD=google_chrome'],
1925 'grit_defines': ['-D', '_chromium',
1926 '-E', 'CHROMIUM_BUILD=chromium'],
1929 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
1931 ['desktop_linux==1', {
1932 'grit_defines': ['-D', 'desktop_linux'],
1934 ['toolkit_views==1', {
1935 'grit_defines': ['-D', 'toolkit_views'],
1938 'grit_defines': ['-D', 'use_aura'],
1941 'grit_defines': ['-D', 'use_ash'],
1944 'grit_defines': ['-D', 'use_nss'],
1947 'grit_defines': ['-D', 'use_ozone'],
1949 ['image_loader_extension==1', {
1950 'grit_defines': ['-D', 'image_loader_extension'],
1953 'grit_defines': ['-D', 'remoting'],
1955 ['use_titlecase_in_grd_files==1', {
1956 'grit_defines': ['-D', 'use_titlecase'],
1958 ['use_third_party_translations==1', {
1959 'grit_defines': ['-D', 'use_third_party_translations'],
1961 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
1962 'ka', 'ku', 'kw', 'ms', 'ug'
1966 'grit_defines': ['-t', 'android',
1967 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true'],
1969 ['OS=="mac" or OS=="ios"', {
1970 'grit_defines': ['-D', 'scale_factors=2x'],
1975 # iOS uses a whitelist to filter resources.
1976 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
1979 # Enable host builds when generating with ninja-ios.
1981 ['"<(GENERATOR)"=="ninja"', {
1985 # TODO(sdefresne): Remove the target_subarch check once Apple has
1986 # upstreamed the support for "arm64". http://crbug.com/341453
1987 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
1992 ['enable_extensions==1', {
1993 'grit_defines': ['-D', 'enable_extensions'],
1995 ['enable_plugins!=0', {
1996 'grit_defines': ['-D', 'enable_plugins'],
1998 ['enable_printing!=0', {
1999 'grit_defines': ['-D', 'enable_printing'],
2001 ['enable_printing==1', {
2002 'grit_defines': ['-D', 'enable_full_printing'],
2004 ['enable_themes==1', {
2005 'grit_defines': ['-D', 'enable_themes'],
2007 ['enable_app_list==1', {
2008 'grit_defines': ['-D', 'enable_app_list'],
2010 ['enable_settings_app==1', {
2011 'grit_defines': ['-D', 'enable_settings_app'],
2013 ['enable_google_now==1', {
2014 'grit_defines': ['-D', 'enable_google_now'],
2016 ['use_concatenated_impulse_responses==1', {
2017 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2019 ['enable_webrtc==1', {
2020 'grit_defines': ['-D', 'enable_webrtc'],
2022 ['enable_hangout_services_extension==1', {
2023 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2025 ['enable_task_manager==1', {
2026 'grit_defines': ['-D', 'enable_task_manager'],
2028 ['notifications==1', {
2029 'grit_defines': ['-D', 'enable_notifications'],
2031 ['enable_wifi_bootstrapping==1', {
2032 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2034 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2035 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2037 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2038 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2040 ['enable_mdns==1 or OS=="mac"', {
2041 'grit_defines': ['-D', 'enable_service_discovery'],
2042 'enable_service_discovery%': 1
2044 ['clang_use_chrome_plugins==1 and OS!="win"', {
2045 'clang_chrome_plugins_flags': [
2046 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
2050 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2052 'use_allocator%': 'none',
2057 ['asan==1 and OS=="mac"', {
2058 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
2059 # runtime is fully adopted. See http://crbug.com/242503.
2060 'mac_strip_release': 0,
2063 'use_custom_libcxx%': 1,
2066 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2067 # libstdc++. This is required to avoid false positive reports whenever
2068 # the C++ standard library is used.
2069 'use_custom_libcxx%': 1,
2070 # Running the V8-generated code on an ARM simulator is a powerful hack
2071 # that allows the tool to see the memory accesses from JITted code.
2072 # Without this flag, JS code causes false positive reports from MSan.
2073 'v8_target_arch': 'arm64',
2076 ['OS=="linux" and clang_type_profiler==1', {
2078 'clang_use_chrome_plugins%': 0,
2080 ['host_arch=="x64"', {
2081 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2083 ['host_arch=="ia32"', {
2084 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2085 # Clang in this directory at your own risk if needed for some
2086 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2087 # usage). Any failure by this compiler should not close the tree.
2088 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2094 # The Clang plugins don't currently work on Windows.
2095 # TODO(hans): One day, this will work. (crbug.com/82385)
2096 'clang_use_chrome_plugins%': 0,
2099 # On valgrind bots, override the optimizer settings so we don't inline too
2100 # much and make the stacks harder to figure out.
2102 # TODO(rnk): Kill off variables that no one else uses and just implement
2103 # them under a build_for_tool== condition.
2104 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2106 'mac_debug_optimization': '1',
2107 'mac_release_optimization': '1',
2108 'release_optimize': '1',
2109 'no_gc_sections': 1,
2110 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2111 '-fno-builtin -fno-optimize-sibling-calls',
2112 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2113 '-fno-builtin -fno-optimize-sibling-calls',
2115 # MSVS flags for TSan on Pin and Windows.
2116 'win_debug_RuntimeChecks': '0',
2117 'win_debug_disable_iterator_debugging': '1',
2118 'win_debug_Optimization': '1',
2119 'win_debug_InlineFunctionExpansion': '0',
2120 'win_release_InlineFunctionExpansion': '0',
2121 'win_release_OmitFramePointers': '0',
2123 'use_allocator': 'tcmalloc',
2124 'release_valgrind_build': 1,
2126 'component': 'static_library',
2127 'use_system_zlib': 0,
2130 # Build tweaks for DrMemory.
2131 # TODO(rnk): Combine with tsan config to share the builder.
2132 # http://crbug.com/108155
2133 ['build_for_tool=="drmemory"', {
2134 # These runtime checks force initialization of stack vars which blocks
2135 # DrMemory's uninit detection.
2136 'win_debug_RuntimeChecks': '0',
2137 # Iterator debugging is slow.
2138 'win_debug_disable_iterator_debugging': '1',
2139 # Try to disable optimizations that mess up stacks in a release build.
2140 # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054)
2141 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2142 # compiler bug, so we use /Ob1 instead.
2143 'win_release_InlineFunctionExpansion': '1',
2144 'win_release_OmitFramePointers': '0',
2145 # Ditto for debug, to support bumping win_debug_Optimization.
2146 'win_debug_InlineFunctionExpansion': 0,
2147 'win_debug_OmitFramePointers': 0,
2148 # Keep the code under #ifndef NVALGRIND.
2149 'release_valgrind_build': 1,
2152 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2153 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2157 # Set default compiler flags depending on ARM version.
2158 ['arm_version==6 and android_webview_build==0', {
2159 'arm_arch%': 'armv6',
2162 'arm_float_abi%': 'softfp',
2165 ['arm_version==7 and android_webview_build==0', {
2166 'arm_arch%': 'armv7-a',
2167 'arm_tune%': 'generic-armv7-a',
2172 'arm_fpu%': 'vfpv3-d16',
2175 # Change the default to hard once the armhf transition is complete.
2176 'arm_float_abi%': 'softfp',
2180 ['android_webview_build==1', {
2181 # The WebView build gets its cpu-specific flags from the Android build system.
2185 'arm_float_abi%': '',
2189 # Enable brlapi by default for chromeos.
2194 ['use_ozone==1 and ozone_auto_platforms==1', {
2195 # Use test as the default platform.
2196 'ozone_platform%': 'test',
2198 # Build all platforms whose deps are in install-build-deps.sh.
2199 # Only these platforms will be compile tested by buildbots.
2200 'ozone_platform_dri%': 1,
2201 'ozone_platform_test%': 1,
2202 'ozone_platform_egltest%': 1,
2205 ['use_ozone==1 and ozone_auto_platforms==1 and chromeos==1', {
2206 # Use dri as the default platform.
2207 'ozone_platform%': 'dri',
2210 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2211 'use_clipboard_aurax11%': 1,
2214 ['OS=="win" and use_goma==1', {
2215 # goma doesn't support pch yet.
2216 'chromium_win_pch': 0,
2217 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2225 ['OS=="win" and (clang==1 or asan==1)', {
2226 'chromium_win_pch': 0,
2229 # The seccomp-bpf sandbox is only supported on three architectures
2231 # Do not disable seccomp_bpf anywhere without talking to
2232 # security@chromium.org!
2233 ['((OS=="linux" or OS=="android") and '
2234 '(target_arch=="ia32" or target_arch=="x64" or '
2235 'target_arch=="arm"))', {
2236 'use_seccomp_bpf%': 1,
2238 'use_seccomp_bpf%': 0,
2242 # The path to the ANGLE library.
2243 'angle_path': '<(DEPTH)/third_party/angle',
2245 # List of default apps to install in new profiles. The first list contains
2246 # the source files as found in svn. The second list, used only for linux,
2247 # contains the destination location for each of the files. When a crx
2248 # is added or removed from the list, the chrome/browser/resources/
2249 # default_apps/external_extensions.json file must also be updated.
2250 'default_apps_list': [
2251 'browser/resources/default_apps/external_extensions.json',
2252 'browser/resources/default_apps/gmail.crx',
2253 'browser/resources/default_apps/search.crx',
2254 'browser/resources/default_apps/youtube.crx',
2255 'browser/resources/default_apps/drive.crx',
2256 'browser/resources/default_apps/docs.crx',
2258 'default_apps_list_linux_dest': [
2259 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2260 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2261 '<(PRODUCT_DIR)/default_apps/search.crx',
2262 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2263 '<(PRODUCT_DIR)/default_apps/drive.crx',
2264 '<(PRODUCT_DIR)/default_apps/docs.crx',
2267 'target_defaults': {
2269 # The condition that operates on chromium_code is in a target_conditions
2270 # section, and will not have access to the default fallback value of
2271 # chromium_code at the top of this file, or to the chromium_code
2272 # variable placed at the root variables scope of .gyp files, because
2273 # those variables are not set at target scope. As a workaround,
2274 # if chromium_code is not set at target scope, define it in target scope
2275 # to contain whatever value it has during early variable expansion.
2276 # That's enough to make it available during target conditional
2278 'chromium_code%': '<(chromium_code)',
2280 'component%': '<(component)',
2282 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2283 'win_release_Optimization%': '2', # 2 = /Os
2284 'win_debug_Optimization%': '0', # 0 = /Od
2286 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2287 # Tri-state: blank is default, 1 on, 0 off
2288 'win_release_OmitFramePointers%': '0',
2289 # Tri-state: blank is default, 1 on, 0 off
2290 'win_debug_OmitFramePointers%': '',
2292 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2293 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2295 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2296 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2297 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2299 # VS inserts quite a lot of extra checks to algorithms like
2300 # std::partial_sort in Debug build which make them O(N^2)
2301 # instead of O(N*logN). This is particularly slow under memory
2302 # tools like ThreadSanitizer so we want it to be disablable.
2303 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2304 'win_debug_disable_iterator_debugging%': '0',
2306 # An application manifest fragment to declare compatibility settings for
2307 # 'executable' targets. Ignored in other target type.
2308 'win_exe_compatibility_manifest%':
2309 '<(DEPTH)\\build\\win\\compatibility.manifest',
2311 'release_extra_cflags%': '',
2312 'debug_extra_cflags%': '',
2314 'release_valgrind_build%': '<(release_valgrind_build)',
2316 # the non-qualified versions are widely assumed to be *nix-only
2317 'win_release_extra_cflags%': '',
2318 'win_debug_extra_cflags%': '',
2320 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2321 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2323 # Only used by Windows build for now. Can be used to build into a
2324 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2325 # output files in src/build/VS2010_{Debug,Release}.
2326 'build_dir_prefix%': '',
2328 # Targets are by default not nacl untrusted code.
2329 'nacl_untrusted_build%': 0,
2331 'pnacl_compile_flags': [
2332 # pnacl uses the clang compiler so we need to suppress all the
2333 # same warnings as we do for clang.
2334 # TODO(sbc): Remove these if/when they are removed from the clang
2336 '-Wno-unused-function',
2337 '-Wno-char-subscripts',
2338 '-Wno-c++11-extensions',
2339 '-Wno-unnamed-type-template-args',
2343 ['OS=="win" and component=="shared_library"', {
2344 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2345 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2346 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2348 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2349 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2350 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2353 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2354 'mac_release_optimization%': 's', # Use -Os unless overridden
2355 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2357 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2358 'mac_release_optimization%': '3', # Use -O3 unless overridden
2359 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2362 'host_os%': '<(host_os)', # See comment above chromium_code.
2367 # Don't use deprecated V8 APIs anywhere.
2368 'V8_DEPRECATION_WARNINGS',
2369 # Temporary suppression until Blink code can be removed.
2370 'BLINK_SCALE_FILTERS_AT_RECORD_TIME',
2373 '<(SHARED_INTERMEDIATE_DIR)',
2376 ['(OS=="mac" or OS=="ios") and asan==1', {
2378 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2381 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2382 'cflags_cc!': ['-fno-rtti'],
2385 '-gline-tables-only',
2386 '-fintercept-allocation-functions',
2388 'defines': ['TYPE_PROFILING'],
2390 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2393 ['OS=="linux" and clang==1 and host_arch=="ia32"', {
2394 # TODO(dmikurube): Remove -Wno-sentinel when Clang/LLVM is fixed.
2395 # See http://crbug.com/162818.
2396 'cflags+': ['-Wno-sentinel'],
2398 ['branding=="Chrome"', {
2399 'defines': ['GOOGLE_CHROME_BUILD'],
2400 }, { # else: branding!="Chrome"
2401 'defines': ['CHROMIUM_BUILD'],
2403 ['OS=="mac" and component=="shared_library"', {
2405 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2406 'LD_RUNPATH_SEARCH_PATHS': [
2407 # For unbundled binaries.
2409 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2410 '@loader_path/../../..',
2414 ['clang==1 and OS!="win"', {
2415 # This is here so that all files get recompiled after a clang roll and
2416 # when turning clang on or off.
2417 # (defines are passed via the command line, and build systems rebuild
2418 # things when their commandline changes). Nothing should ever read this
2420 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2423 'defines': ['ENABLE_RLZ'],
2425 ['component=="shared_library"', {
2426 'defines': ['COMPONENT_BUILD'],
2428 ['toolkit_views==1', {
2429 'defines': ['TOOLKIT_VIEWS=1'],
2431 ['ui_compositor_image_transport==1', {
2432 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2435 'defines': ['USE_AURA=1'],
2438 'defines': ['USE_ASH=1'],
2441 'defines': ['USE_CAIRO=1'],
2444 'defines': ['USE_CRAS=1'],
2447 'defines': ['USE_GLIB=1'],
2450 'defines': ['USE_OZONE=1'],
2452 ['use_default_render_theme==1', {
2453 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2455 ['use_libjpeg_turbo==1', {
2456 'defines': ['USE_LIBJPEG_TURBO=1'],
2459 'defines': ['USE_X11=1'],
2461 ['use_clipboard_aurax11==1', {
2462 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2464 ['enable_one_click_signin==1', {
2465 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2467 ['enable_pre_sync_backup==1', {
2468 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2470 ['use_xi2_mt!=0 and use_x11==1', {
2471 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2473 ['image_loader_extension==1', {
2474 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2477 'defines': ['ENABLE_PROFILING=1'],
2480 'defines': ['ENABLE_REMOTING=1'],
2482 ['enable_webrtc==1', {
2483 'defines': ['ENABLE_WEBRTC=1'],
2485 ['proprietary_codecs==1', {
2486 'defines': ['USE_PROPRIETARY_CODECS'],
2488 ['enable_viewport==1', {
2489 'defines': ['ENABLE_VIEWPORT'],
2491 ['enable_pepper_cdms==1', {
2492 'defines': ['ENABLE_PEPPER_CDMS'],
2494 ['enable_browser_cdms==1', {
2495 'defines': ['ENABLE_BROWSER_CDMS'],
2497 ['configuration_policy==1', {
2498 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2500 ['notifications==1', {
2501 'defines': ['ENABLE_NOTIFICATIONS'],
2503 ['enable_hidpi==1', {
2504 'defines': ['ENABLE_HIDPI=1'],
2506 ['native_discardable_memory==1', {
2507 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2509 ['native_memory_pressure_signals==1', {
2510 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2513 'defines': ['USE_UDEV'],
2517 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2520 ['clang==1 and asan==0 and msan==0 and tsan==0', {
2521 # Clang creates chubby debug information, which makes linking very
2522 # slow. For now, don't create debug information with clang. See
2523 # http://crbug.com/70000
2527 'debug_extra_cflags': '-g0',
2530 # Android builds symbols on release by default, disable them.
2533 'debug_extra_cflags': '-g0',
2534 'release_extra_cflags': '-g0',
2538 }, { # else clang!=1
2540 ['OS=="win" and fastbuild==2', {
2541 # Completely disable debug information.
2544 'GenerateDebugInformation': 'false',
2546 'VCCLCompilerTool': {
2547 'DebugInformationFormat': '0',
2551 ['OS=="win" and fastbuild==1', {
2554 # This tells the linker to generate .pdbs, so that
2555 # we can get meaningful stack traces.
2556 'GenerateDebugInformation': 'true',
2558 'VCCLCompilerTool': {
2559 # No debug info to be generated by compiler.
2560 'DebugInformationFormat': '0',
2564 ['OS=="linux" and fastbuild==2', {
2566 'debug_extra_cflags': '-g0',
2569 ['OS=="linux" and fastbuild==1', {
2571 'debug_extra_cflags': '-g1',
2574 ['OS=="android" and fastbuild==2', {
2576 'debug_extra_cflags': '-g0',
2577 'release_extra_cflags': '-g0',
2580 ['OS=="android" and fastbuild==1', {
2582 'debug_extra_cflags': '-g1',
2583 'release_extra_cflags': '-g1',
2590 ['dont_embed_build_metadata==1', {
2592 'DONT_EMBED_BUILD_METADATA',
2594 }], # dont_embed_build_metadata==1
2595 ['dcheck_always_on!=0', {
2596 'defines': ['DCHECK_ALWAYS_ON=1'],
2597 }], # dcheck_always_on!=0
2598 ['tracing_like_official_build!=0', {
2599 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2600 }], # tracing_like_official_build!=0
2601 ['win_use_allocator_shim==0', {
2604 'defines': ['NO_TCMALLOC'],
2608 ['enable_eglimage==1', {
2610 'ENABLE_EGLIMAGE=1',
2615 'ADDRESS_SANITIZER',
2616 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2620 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2628 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2634 '_CRT_SECURE_NO_DEPRECATE',
2635 '_SCL_SECURE_NO_DEPRECATE',
2636 # This define is required to pull in the new Win8 interfaces from
2637 # system headers like ShObjIdl.h.
2638 'NTDDI_VERSION=0x06020000',
2639 # This is required for ATL to use XP-safe versions of its functions.
2640 '_USING_V110_SDK71_',
2643 '<(DEPTH)/third_party/wtl/include',
2648 # Generates debug info when win_z7=1
2649 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2651 'GenerateDebugInformation': 'true',
2653 'VCCLCompilerTool': {
2654 'DebugInformationFormat': '1',
2660 ['enable_task_manager==1', {
2662 'ENABLE_TASK_MANAGER=1',
2665 ['enable_extensions==1', {
2667 'ENABLE_EXTENSIONS=1',
2670 ['OS=="win" and branding=="Chrome"', {
2671 'defines': ['ENABLE_SWIFTSHADER'],
2673 ['enable_dart==1', {
2674 'defines': ['WEBKIT_USING_DART=1'],
2676 ['enable_plugin_installation==1', {
2677 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2679 ['enable_plugins==1', {
2680 'defines': ['ENABLE_PLUGINS=1'],
2682 ['enable_session_service==1', {
2683 'defines': ['ENABLE_SESSION_SERVICE=1'],
2685 ['enable_themes==1', {
2686 'defines': ['ENABLE_THEMES=1'],
2688 ['enable_autofill_dialog==1', {
2689 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2691 ['enable_prod_wallet_service==1', {
2692 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2694 ['enable_background==1', {
2695 'defines': ['ENABLE_BACKGROUND=1'],
2697 ['enable_google_now==1', {
2698 'defines': ['ENABLE_GOOGLE_NOW=1'],
2700 ['cld_version!=0', {
2701 'defines': ['CLD_VERSION=<(cld_version)'],
2703 ['cld2_data_source=="static"', {
2704 'defines': ['CLD_DATA_FROM_STATIC'],
2706 # CLD2 headers use this #define to control the visibility of dynamic
2707 # mode functions. We use these functions, so we must define here for
2708 # our #includes to work right.
2709 'defines': ['CLD2_DYNAMIC_MODE'],
2711 ['cld2_data_source=="standalone"', {
2712 'defines': ['CLD_DATA_FROM_STANDALONE'],
2714 ['cld2_data_source=="component"', {
2715 'defines': ['CLD_DATA_FROM_COMPONENT'],
2717 ['enable_printing==1', {
2718 'defines': ['ENABLE_FULL_PRINTING=1', 'ENABLE_PRINTING=1'],
2720 ['enable_printing==2', {
2721 'defines': ['ENABLE_PRINTING=1'],
2723 ['OS=="win" and win_pdf_metafile_for_printing==1', {
2724 'defines': ['WIN_PDF_METAFILE_FOR_PRINTING=1'],
2726 ['enable_spellcheck==1', {
2727 'defines': ['ENABLE_SPELLCHECK=1'],
2729 ['enable_captive_portal_detection==1', {
2730 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2732 ['enable_app_list==1', {
2733 'defines': ['ENABLE_APP_LIST=1'],
2735 ['enable_settings_app==1', {
2736 'defines': ['ENABLE_SETTINGS_APP=1'],
2738 ['disable_file_support==1', {
2739 'defines': ['DISABLE_FILE_SUPPORT=1'],
2741 ['disable_ftp_support==1', {
2742 'defines': ['DISABLE_FTP_SUPPORT=1'],
2744 ['use_icu_alternatives_on_android==1', {
2745 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2747 ['enable_managed_users==1', {
2748 'defines': ['ENABLE_MANAGED_USERS=1'],
2750 ['data_reduction_fallback_host != ""', {
2752 'DATA_REDUCTION_FALLBACK_HOST="<(data_reduction_fallback_host)"'],
2754 ['data_reduction_dev_host != ""', {
2756 'DATA_REDUCTION_DEV_HOST="<(data_reduction_dev_host)"'],
2758 ['spdy_proxy_auth_origin != ""', {
2759 'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'],
2761 ['spdy_proxy_auth_property != ""', {
2762 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2764 ['spdy_proxy_auth_value != ""', {
2765 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2767 ['data_reduction_proxy_probe_url != ""', {
2769 'DATA_REDUCTION_PROXY_PROBE_URL="<(data_reduction_proxy_probe_url)"'],
2771 ['data_reduction_proxy_warmup_url != ""', {
2773 'DATA_REDUCTION_PROXY_WARMUP_URL="<(data_reduction_proxy_warmup_url)"'],
2775 ['data_reduction_proxy_ssl_origin != ""', {
2777 'DATA_REDUCTION_PROXY_SSL_ORIGIN="<(data_reduction_proxy_ssl_origin)"'],
2779 ['data_reduction_proxy_alt_origin != ""', {
2781 'DATA_REDUCTION_PROXY_ALT_ORIGIN="<(data_reduction_proxy_alt_origin)"'],
2783 ['data_reduction_proxy_alt_fallback_origin != ""', {
2785 'DATA_REDUCTION_PROXY_ALT_FALLBACK_ORIGIN="<(data_reduction_proxy_alt_fallback_origin)"'],
2787 ['enable_mdns==1', {
2788 'defines': ['ENABLE_MDNS=1'],
2790 ['enable_service_discovery==1', {
2791 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2793 ['enable_wifi_bootstrapping==1', {
2794 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2796 ['enable_hangout_services_extension==1', {
2797 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2799 ['enable_ipc_fuzzer==1', {
2800 'defines': ['ENABLE_IPC_FUZZER=1'],
2803 'defines': ['VIDEO_HOLE=1'],
2805 ], # conditions for 'target_defaults'
2806 'target_conditions': [
2807 ['<(use_openssl)==1', {
2808 'defines': ['USE_OPENSSL=1'],
2810 ['<(use_openssl_certs)==1', {
2811 'defines': ['USE_OPENSSL_CERTS=1'],
2813 ['>(nacl_untrusted_build)==1', {
2816 'USE_OPENSSL_CERTS=1',
2819 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
2820 'defines': ['USE_NSS=1'],
2822 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
2823 'defines': ['OS_CHROMEOS=1'],
2825 ['enable_wexit_time_destructors==1', {
2829 '-Wexit-time-destructors',
2833 '-Wexit-time-destructors',
2839 ['chromium_code==0', {
2841 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
2842 # We don't want to get warnings from third-party code,
2843 # so remove any existing warning-enabling flags like -Wall.
2849 # Don't warn about hash_map in third-party code.
2853 # Don't warn about printf format problems.
2854 # This is off by default in gcc but on in Ubuntu's gcc(!).
2858 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
2862 # TODO: Fix all warnings on chromeos too.
2863 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
2868 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
2870 # Don't warn about ignoring the return value from e.g. close().
2871 # This is off by default in some gccs but on by default in others.
2872 # BSD systems do not support this option, since they are usually
2873 # using gcc 4.2.1, which does not have this flag yet.
2874 '-Wno-unused-result',
2879 '_CRT_SECURE_NO_DEPRECATE',
2880 '_CRT_NONSTDC_NO_WARNINGS',
2881 '_CRT_NONSTDC_NO_DEPRECATE',
2882 '_SCL_SECURE_NO_DEPRECATE',
2884 'msvs_disabled_warnings': [4800],
2886 'VCCLCompilerTool': {
2887 'WarningLevel': '3',
2888 'WarnAsError': '<(win_third_party_warn_as_error)',
2889 'Detect64BitPortabilityProblems': 'false',
2893 ['buildtype=="Official"', {
2895 'VCCLCompilerTool': { 'WarnAsError': 'false' },
2900 'VCCLCompilerTool': { 'WarnAsError': 'false' },
2905 # TODO(darin): Unfortunately, some third_party code depends on base.
2906 [ 'OS=="win" and component=="shared_library"', {
2907 'msvs_disabled_warnings': [
2908 4251, # class 'std::xx' needs to have dll-interface.
2911 [ 'OS=="mac" or OS=="ios"', {
2913 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
2916 ['buildtype=="Official"', {
2918 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
2925 # TODO(ios): Fix remaining warnings in third-party code, then
2926 # remove this; the Mac cleanup didn't get everything that's
2927 # flagged in an iOS build.
2928 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
2929 'RUN_CLANG_STATIC_ANALYZER': 'NO',
2930 # Several internal ios directories generate numerous warnings for
2931 # -Wobjc-missing-property-synthesis.
2932 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
2938 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
2939 'filename_rules.gypi',
2941 # In Chromium code, we define __STDC_foo_MACROS in order to get the
2942 # C99 macros on Mac and Linux.
2944 '__STDC_CONSTANT_MACROS',
2945 '__STDC_FORMAT_MACROS',
2949 # turn on warnings for signed/unsigned mismatch on chromium code.
2951 'VCCLCompilerTool': {
2952 'AdditionalOptions': ['/we4389'],
2956 ['OS=="win" and component=="shared_library"', {
2957 'msvs_disabled_warnings': [
2958 4251, # class 'std::xx' needs to have dll-interface.
2963 ], # target_conditions for 'target_defaults'
2964 'default_configuration': 'Debug',
2966 # VCLinkerTool LinkIncremental values below:
2968 # 1 == /INCREMENTAL:NO
2970 # Debug links incremental, Release does not.
2972 # Abstract base configurations to cover common attributes.
2976 'msvs_configuration_attributes': {
2977 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
2978 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
2979 'CharacterSet': '1',
2981 # Add the default import libs.
2984 'AdditionalDependencies': [
3008 'MinimumRequiredVersion': '5.01', # XP.
3009 'TargetMachine': '1',
3011 'VCLibrarianTool': {
3012 'TargetMachine': '1',
3015 'msvs_configuration_platform': 'Win32',
3019 'msvs_configuration_platform': 'x64',
3022 # Make sure to understand http://crbug.com/361720 if you want to
3024 'MinimumRequiredVersion': '5.02', # Server 2003.
3025 'TargetMachine': '17', # x86 - 64
3026 'AdditionalLibraryDirectories!':
3027 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3028 'AdditionalLibraryDirectories':
3029 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3030 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3031 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3033 'VCLibrarianTool': {
3034 'AdditionalLibraryDirectories!':
3035 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3036 'AdditionalLibraryDirectories':
3037 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3038 'TargetMachine': '17', # x64
3045 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3046 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3049 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3051 '<@(debug_extra_cflags)',
3055 'VCCLCompilerTool': {
3056 'Optimization': '<(win_debug_Optimization)',
3057 'PreprocessorDefinitions': ['_DEBUG'],
3058 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3059 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3061 # According to MSVS, InlineFunctionExpansion=0 means
3062 # "default inlining", not "/Ob0".
3063 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3064 ['win_debug_InlineFunctionExpansion==0', {
3065 'AdditionalOptions': ['/Ob0'],
3067 ['win_debug_InlineFunctionExpansion!=""', {
3068 'InlineFunctionExpansion':
3069 '<(win_debug_InlineFunctionExpansion)',
3071 ['win_debug_disable_iterator_debugging==1', {
3072 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3075 # if win_debug_OmitFramePointers is blank, leave as default
3076 ['win_debug_OmitFramePointers==1', {
3077 'OmitFramePointers': 'true',
3079 ['win_debug_OmitFramePointers==0', {
3080 'OmitFramePointers': 'false',
3081 # The above is not sufficient (http://crbug.com/106711): it
3082 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3083 # perform FPO regardless, so we must explicitly disable.
3084 # We still want the false setting above to avoid having
3085 # "/Oy /Oy-" and warnings about overriding.
3086 'AdditionalOptions': ['/Oy-'],
3089 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3092 'LinkIncremental': '<(msvs_debug_link_incremental)',
3093 # ASLR makes debugging with windbg difficult because Chrome.exe and
3094 # Chrome.dll share the same base name. As result, windbg will
3095 # name the Chrome.dll module like chrome_<base address>, where
3096 # <base address> typically changes with each launch. This in turn
3097 # means that breakpoints in Chrome.dll don't stick from one launch
3098 # to the next. For this reason, we turn ASLR off in debug builds.
3099 # Note that this is a three-way bool, where 0 means to pick up
3100 # the default setting, 1 is off and 2 is on.
3101 'RandomizedBaseAddress': 1,
3103 'VCResourceCompilerTool': {
3104 'PreprocessorDefinitions': ['_DEBUG'],
3108 ['OS=="linux" or OS=="android"', {
3109 'target_conditions': [
3110 ['_toolset=="target"', {
3112 '<@(debug_extra_cflags)',
3117 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3118 # Enable libstdc++ debugging facilities to help catch problems
3119 # early, see http://crbug.com/65151 .
3120 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3121 'defines': ['_GLIBCXX_DEBUG=1',],
3123 ['release_valgrind_build==0', {
3126 '-fstack-protector-all', # Implies -fstack-protector
3138 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3139 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3140 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3143 'VCCLCompilerTool': {
3144 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3146 # In official builds, each target will self-select
3147 # an optimization level.
3148 ['buildtype!="Official"', {
3149 'Optimization': '<(win_release_Optimization)',
3152 # According to MSVS, InlineFunctionExpansion=0 means
3153 # "default inlining", not "/Ob0".
3154 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3155 ['win_release_InlineFunctionExpansion==0', {
3156 'AdditionalOptions': ['/Ob0'],
3158 ['win_release_InlineFunctionExpansion!=""', {
3159 'InlineFunctionExpansion':
3160 '<(win_release_InlineFunctionExpansion)',
3163 # if win_release_OmitFramePointers is blank, leave as default
3164 ['win_release_OmitFramePointers==1', {
3165 'OmitFramePointers': 'true',
3167 ['win_release_OmitFramePointers==0', {
3168 'OmitFramePointers': 'false',
3169 # The above is not sufficient (http://crbug.com/106711): it
3170 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3171 # perform FPO regardless, so we must explicitly disable.
3172 # We still want the false setting above to avoid having
3173 # "/Oy /Oy-" and warnings about overriding.
3174 'AdditionalOptions': ['/Oy-'],
3177 'AdditionalOptions': [ '<@(win_release_extra_cflags)', ],
3180 # LinkIncremental is a tri-state boolean, where 0 means default
3181 # (i.e., inherit from parent solution), 1 means false, and
3183 'LinkIncremental': '1',
3184 # This corresponds to the /PROFILE flag which ensures the PDB
3185 # file contains FIXUP information (growing the PDB file by about
3186 # 5%) but does not otherwise alter the output binary. This
3187 # information is used by the Syzygy optimization tool when
3188 # decomposing the release image.
3193 ['msvs_use_common_release', {
3194 'includes': ['release.gypi'],
3196 ['release_valgrind_build==0 and tsan==0', {
3199 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3203 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3204 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3205 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3208 ['win_use_allocator_shim==0', {
3209 'defines': ['NO_TCMALLOC'],
3211 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3212 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3213 # TODO(glider): once the bug is fixed, disable source fortification
3214 # under the sanitizer tools only.
3215 ['os_posix==1 and (OS!="linux" or clang!=1)', {
3216 'target_conditions': [
3217 ['chromium_code==1', {
3218 # Non-chromium code is not guaranteed to compile cleanly
3219 # with _FORTIFY_SOURCE. Also, fortified build may fail
3220 # when optimizations are disabled, so only do that for Release
3223 '_FORTIFY_SOURCE=2',
3228 ['OS=="linux" or OS=="android"', {
3229 'target_conditions': [
3230 ['_toolset=="target"', {
3232 '<@(release_extra_cflags)',
3235 ['enable_resource_whitelist_generation==1', {
3237 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3246 'NS_BLOCK_ASSERTIONS=1',
3252 # Concrete configurations
3255 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3258 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3263 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3264 'target_conditions': [
3265 [ '_type=="executable"', {
3266 # To get a real .dSYM bundle produced by dsymutil, set the
3267 # debug information format to dwarf-with-dsym. Since
3268 # strip_from_xcode will not be used, set Xcode to do the
3269 # stripping as well.
3271 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3272 'DEPLOYMENT_POSTPROCESSING': 'YES',
3273 'STRIP_INSTALLED_PRODUCT': 'YES',
3280 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3282 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3285 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3293 'target_defaults': {
3300 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3301 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3302 'target_defaults': {
3304 '-Wl,--fatal-warnings',
3308 ['os_posix==1 and chromeos==0', {
3309 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3310 # and we want to avoid overriding this, so stack-protector is only
3311 # enabled when not building on Chrome OS.
3312 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3314 'target_defaults': {
3316 '-fstack-protector',
3317 '--param=ssp-buffer-size=4',
3321 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3322 'target_defaults': {
3323 # Enable -Werror by default, but put it in a variable so it can
3324 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3326 'werror%': '-Werror',
3327 'libraries_for_target%': '',
3330 '_FILE_OFFSET_BITS=64',
3333 '<(werror)', # See note above about the werror variable.
3336 '-fno-strict-aliasing', # See http://crbug.com/32204
3338 # TODO(evan): turn this back on once all the builds work.
3340 # Don't warn about unused function params. We use those everywhere.
3341 '-Wno-unused-parameter',
3342 # Don't warn about the "struct foo f = {0};" initialization pattern.
3343 '-Wno-missing-field-initializers',
3344 # Don't export any symbols (for example, to plugins we dlopen()).
3345 # Note: this is *required* to make some plugins work.
3346 '-fvisibility=hidden',
3351 '-fno-threadsafe-statics',
3352 # Make inline functions have hidden visiblity by default.
3353 # Surprisingly, not covered by -fvisibility=hidden.
3354 '-fvisibility-inlines-hidden',
3355 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3356 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3360 '-pthread', '-Wl,-z,noexecstack',
3363 '<(libraries_for_target)',
3368 'debug_optimize%': '0',
3374 '-O>(debug_optimize)',
3380 # Warn in case of text relocations.
3381 '-Wl,--warn-shared-textrel',
3384 ['OS=="android" and android_full_debug==0', {
3385 # Some configurations are copied from Release_Base to reduce
3388 'debug_optimize%': 's',
3391 '-fomit-frame-pointer',
3393 '-ffunction-sections',
3400 ['OS=="linux" and target_arch=="ia32"', {
3402 '-Wl,--no-as-needed',
3405 ['debug_unwind_tables==1', {
3406 'cflags': ['-funwind-tables'],
3408 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3410 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3411 # definitions in to the right scope to use them when setting
3412 # linux_use_debug_fission, so it can be used here alone.
3413 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3414 'cflags': ['-gsplit-dwarf'],
3420 'release_optimize%': '2',
3421 # Binaries become big and gold is unable to perform GC
3422 # and remove unused sections for some of test targets
3423 # on 32 bit platform.
3424 # (This is currently observed only in chromeos valgrind bots)
3425 # The following flag is to disable --gc-sections linker
3426 # option for these bots.
3427 'no_gc_sections%': 0,
3429 # TODO(bradnelson): reexamine how this is done if we change the
3430 # expansion of configurations
3431 'release_valgrind_build%': 0,
3434 '-O<(release_optimize)',
3435 # Don't emit the GCC version ident directives, they just end up
3436 # in the .comment section taking up binary size.
3438 # Put data and code in their own sections, so that unused symbols
3439 # can be removed at link time with --gc-sections.
3441 '-ffunction-sections',
3444 # Specifically tell the linker to perform optimizations.
3445 # See http://lwn.net/Articles/192624/ .
3450 ['no_gc_sections==0', {
3452 '-Wl,--gc-sections',
3457 'release_optimize%': 's',
3460 '-fomit-frame-pointer',
3463 # Warn in case of text relocations.
3464 '-Wl,--warn-shared-textrel',
3474 '-fno-omit-frame-pointer',
3478 ['profiling_full_stack_frames==1', {
3481 '-fno-optimize-sibling-calls',
3486 ['release_unwind_tables==1', {
3487 'cflags': ['-funwind-tables'],
3489 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3495 ['target_arch=="ia32"', {
3496 'target_conditions': [
3497 ['_toolset=="target"', {
3499 # Needed so that libs with .s files (e.g. libicudata.a)
3500 # are compatible with the general 32-bit-ness.
3503 # All floating-point computations on x87 happens in 80-bit
3504 # precision. Because the C and C++ language standards allow
3505 # the compiler to keep the floating-point values in higher
3506 # precision than what's specified in the source and doing so
3507 # is more efficient than constantly rounding up to 64-bit or
3508 # 32-bit precision as specified in the source, the compiler,
3509 # especially in the optimized mode, tries very hard to keep
3510 # values in x87 floating-point stack (in 80-bit precision)
3511 # as long as possible. This has important side effects, that
3512 # the real value used in computation may change depending on
3513 # how the compiler did the optimization - that is, the value
3514 # kept in 80-bit is different than the value rounded down to
3515 # 64-bit or 32-bit. There are possible compiler options to
3516 # make this behavior consistent (e.g. -ffloat-store would keep
3517 # all floating-values in the memory, thus force them to be
3518 # rounded to its original precision) but they have significant
3519 # runtime performance penalty.
3521 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3522 # which keep floating-point values in SSE registers in its
3523 # native precision (32-bit for single precision, and 64-bit
3524 # for double precision values). This means the floating-point
3525 # value used during computation does not change depending on
3526 # how the compiler optimized the code, since the value is
3527 # always kept in its specified precision.
3529 # Refer to http://crbug.com/348761 for rationale behind SSE2
3530 # being a minimum requirement for 32-bit Linux builds and
3531 # http://crbug.com/313032 for an example where this has "bit"
3536 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3543 # Use gold linker for Android ia32 target.
3549 # Install packages have started cropping up with
3550 # different headers between the 32-bit and 64-bit
3551 # versions, so we have to shadow those differences off
3552 # and make sure a 32-bit-on-64-bit build picks up the
3554 # For android build, use NDK headers instead of host headers
3555 ['host_arch!="ia32" and OS!="android"', {
3564 ['target_arch=="x64"', {
3565 'target_conditions': [
3566 ['_toolset=="target"', {
3568 # Use gold linker for Android x64 target.
3585 ['target_arch=="arm"', {
3586 'target_conditions': [
3587 ['_toolset=="target"', {
3589 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3590 # has changed whenever it encounters a varargs function. This
3591 # silences those warnings, as they are not helpful and
3592 # clutter legitimate warnings.
3598 '-march=<(arm_arch)',
3603 '-mtune=<(arm_tune)',
3611 ['arm_float_abi!=""', {
3613 '-mfloat-abi=<(arm_float_abi)',
3622 # Most of the following flags are derived from what Android
3623 # uses by default when building for arm, reference for which
3624 # can be found in the following file in the Android NDK:
3625 # toolchains/arm-linux-androideabi-4.8/setup.mk
3627 # The tree-sra optimization (scalar replacement for
3628 # aggregates enabling subsequent optimizations) leads to
3629 # invalid code generation when using the Android NDK's
3630 # compiler (r5-r7). This can be verified using
3631 # webkit_unit_tests' WTF.Checked_int8_t test.
3633 # The following 6 options are disabled to save on
3634 # binary size in gcc 4.8.
3635 # TODO(fdegans) Reevaluate when we upgrade GCC.
3636 '-fno-partial-inlining',
3637 '-fno-early-inlining',
3638 '-fno-tree-copy-prop',
3639 '-fno-tree-loop-optimize',
3640 '-fno-move-loop-invariants',
3641 '-fno-caller-saves',
3644 # Android now supports .relro sections properly.
3645 # NOTE: While these flags enable the generation of .relro
3646 # sections, the generated libraries can still be loaded on
3647 # older Android platform versions.
3655 'cflags': [ '-mthumb-interwork' ],
3659 # Thumb code with frame pointer makes chrome crash
3662 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3663 # The perf report sometimes incorrectly attributes
3664 # code from tail calls.
3665 '-fno-optimize-sibling-calls',
3668 '-fomit-frame-pointer',
3673 # Clang does not support the following options.
3674 '-mthumb-interwork',
3675 '-finline-limit=64',
3677 '-fno-partial-inlining',
3678 '-fno-early-inlining',
3679 '-fno-tree-copy-prop',
3680 '-fno-tree-loop-optimize',
3681 '-fno-move-loop-invariants',
3682 '-fno-caller-saves',
3686 # TODO(hans) Enable integrated-as (crbug.com/124610).
3687 '-no-integrated-as',
3688 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3692 # Clang does not support the following options.
3696 # As long as -fuse-ld=gold doesn't work, add a dummy directory
3697 # with an 'ld' that redirects to gold, so that clang uses gold.
3698 '-B<!(cd <(DEPTH) && pwd -P)/build/android/arm-linux-androideabi-gold',
3703 '-marm', # Required for frame pointer based stack traces.
3712 ['target_arch=="arm64"', {
3713 'target_conditions': [
3714 ['_toolset=="target"', {
3718 '-fstack-protector', # stack protector is always enabled on arm64.
3725 ['target_arch=="mipsel"', {
3726 'target_conditions': [
3727 ['_toolset=="target"', {
3729 ['android_webview_build==0 and mips_arch_variant=="mips32r2"', {
3730 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
3732 ['android_webview_build==0 and mips_arch_variant!="mips32r2"', {
3733 'cflags': ['-mips32', '-Wa,-mips32'],
3742 '-Wl,--no-keep-memory'
3745 '-Wno-uninitialized',
3759 'target_conditions': [
3760 ['_toolset=="target"', {
3762 '--sysroot=<(sysroot)',
3765 '--sysroot=<(sysroot)',
3766 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
3774 # Don't die on dtoa code that uses a char as an array index.
3775 '-Wno-char-subscripts',
3777 # TODO(thakis): This used to be implied by -Wno-unused-function,
3778 # which we no longer use. Check if it makes sense to remove
3779 # this as well. http://crbug.com/316352
3780 '-Wno-unneeded-internal-declaration',
3782 # Warns on switches on enums that cover all enum values but
3783 # also contain a default: branch. Chrome is full of that.
3784 '-Wno-covered-switch-default',
3786 # Warns when a const char[] is converted to bool.
3787 '-Wstring-conversion',
3789 # C++11-related flags:
3791 # This warns on using ints as initializers for floats in
3792 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
3793 # which happens in several places in chrome code. Not sure if
3794 # this is worth fixing.
3795 '-Wno-c++11-narrowing',
3797 # TODO(thakis): Remove, http://crbug.com/263960
3798 '-Wno-reserved-user-defined-literal',
3800 # Clang considers the `register` keyword as deprecated, but e.g.
3801 # code generated by flex (used in angle) contains that keyword.
3802 # http://crbug.com/255186
3803 '-Wno-deprecated-register',
3806 # Clang doesn't seem to know know this flag.
3810 # See the comment in the Mac section for what it takes to move
3811 # this to -std=c++11.
3815 ['clang==1 and OS=="android"', {
3816 # Android uses stlport, whose include/new defines
3817 # `void operator delete[](void* ptr) throw();`, which
3818 # clang's -Wimplicit-exception-spec-mismatch warns about for some
3819 # reason -- http://llvm.org/PR16638. TODO(thakis): Include stlport
3820 # via -isystem instead.
3822 '-Wno-implicit-exception-spec-mismatch',
3825 ['clang==1 and clang_use_chrome_plugins==1', {
3827 '<@(clang_chrome_plugins_flags)',
3830 ['clang==1 and clang_load!=""', {
3832 '-Xclang', '-load', '-Xclang', '<(clang_load)',
3835 ['clang==1 and clang_add_plugin!=""', {
3837 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
3840 ['clang==1 and target_arch=="ia32"', {
3842 # Else building libyuv gives clang's register allocator issues,
3843 # see llvm.org/PR15798 / crbug.com/233709
3844 '-momit-leaf-frame-pointer',
3847 ['clang==1 and "<(GENERATOR)"=="ninja"', {
3849 # See http://crbug.com/110262
3850 '-fcolor-diagnostics',
3853 # Common options for AddressSanitizer, LeakSanitizer,
3854 # ThreadSanitizer and MemorySanitizer.
3855 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1', {
3856 'target_conditions': [
3857 ['_toolset=="target"', {
3859 '-fno-omit-frame-pointer',
3860 '-gline-tables-only',
3863 '-fomit-frame-pointer',
3868 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
3869 'target_conditions': [
3870 ['_toolset=="target"', {
3872 # Functions interposed by the sanitizers can make ld think
3873 # that some libraries aren't needed when they actually are,
3874 # http://crbug.com/234010. As workaround, disable --as-needed.
3878 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3882 # TODO(glider): enable the default options on other systems.
3884 ['use_sanitizer_options==1 and OS=="linux" and (chromeos==0 or target_arch!="ia32")', {
3886 '<(DEPTH)/base/base.gyp:sanitizer_options',
3892 'target_conditions': [
3893 ['_toolset=="target"', {
3895 '-fsanitize=address',
3896 '-w', # http://crbug.com/162783
3899 '-fsanitize=address',
3906 '-mllvm -asan-globals=0', # http://crbug.com/352073
3912 'target_conditions': [
3913 ['_toolset=="target"', {
3915 '-fsanitize=undefined',
3916 # -fsanitize=vptr is incompatible with -fno-rtti.
3917 '-fno-sanitize=vptr',
3918 '-w', # http://crbug.com/162783
3921 '-fsanitize=undefined',
3922 # -fsanitize=vptr is incompatible with -fno-rtti.
3923 '-fno-sanitize=vptr',
3928 ['asan_coverage!=0', {
3929 'target_conditions': [
3930 ['_toolset=="target"', {
3932 '-mllvm -asan-coverage=<(asan_coverage)',
3938 'target_conditions': [
3939 ['_toolset=="target"', {
3948 'WTF_USE_LEAK_SANITIZER=1',
3954 'target_conditions': [
3955 ['_toolset=="target"', {
3957 '-fsanitize=thread',
3959 '-fsanitize-blacklist=<(tsan_blacklist)',
3962 '-fsanitize=thread',
3966 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
3967 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
3969 'target_conditions': [
3970 ['_type=="executable"', {
3980 'target_conditions': [
3981 ['_toolset=="target"', {
3983 '-fsanitize=memory',
3984 '-fsanitize-memory-track-origins=<(msan_track_origins)',
3986 '-fsanitize-blacklist=<(msan_blacklist)',
3989 '-fsanitize=memory',
3994 'target_conditions': [
3995 ['_type=="executable"', {
4004 ['use_instrumented_libraries==1', {
4006 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4009 ['use_custom_libcxx==1', {
4011 '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4014 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4015 'target_conditions' : [
4016 # crazy_linker has an upstream gyp file we can't edit, and we
4017 # don't want to instrument it.
4018 ['_toolset=="target" and _target_name!="crazy_linker"', {
4020 '-finstrument-functions',
4021 # Allow mmx intrinsics to inline, so that the
4022 #0 compiler can expand the intrinsics.
4023 '-finstrument-functions-exclude-file-list=mmintrin.h',
4026 ['_toolset=="target" and OS=="android"', {
4028 # Avoids errors with current NDK:
4029 # "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"
4030 '-finstrument-functions-exclude-file-list=arm_neon.h',
4035 ['linux_dump_symbols==1', {
4038 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4039 'target_conditions': [
4040 ['_toolset=="target"', {
4042 # Attempt to use less memory to prevent the linker from
4043 # running out of address space. Considering installing a
4044 # 64-bit kernel and switching to a 64-bit linker.
4045 '-Wl,--no-keep-memory',
4052 ['use_allocator!="tcmalloc"', {
4053 'defines': ['NO_TCMALLOC'],
4055 ['linux_use_gold_flags==1', {
4056 'target_conditions': [
4057 ['_toolset=="target"', {
4059 # Experimentation found that using four linking threads
4060 # saved ~20% of link time.
4061 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4062 # Only apply this to the target linker, since the host
4063 # linker might not be gold, but isn't used much anyway.
4064 # TODO(raymes): Disable threading because gold is frequently
4065 # crashing on the bots: crbug.com/161942.
4067 # '-Wl,--thread-count=4',
4072 ['release_valgrind_build==0', {
4073 'target_conditions': [
4074 ['_toolset=="target"', {
4076 # There seems to be a conflict of --icf and -pie
4077 # in gold which can generate crashy binaries. As
4078 # a security measure, -pie takes precedence for
4086 # Newer gcc's support -fuse-ld, use the flag to force gold
4088 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4089 # TODO(mithro): Watch for clang support at following thread:
4090 # http://clang-developers.42468.n3.nabble.com/Adding-fuse-ld-support-to-clang-td4032180.html
4091 ['gcc_version>=48', {
4092 'target_conditions': [
4093 ['_toolset=="target"', {
4100 ['host_gcc_version>=48', {
4101 'target_conditions': [
4102 ['_toolset=="host"', {
4111 ['linux_use_bundled_binutils==1', {
4113 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4116 ['linux_use_bundled_gold==1', {
4117 # Put our binutils, which contains gold in the search path. We pass
4118 # the path to gold to the compiler. gyp leaves unspecified what the
4119 # cwd is when running the compiler, so the normal gyp path-munging
4120 # fails us. This hack gets the right path.
4122 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4125 # Some binutils 2.23 releases may or may not have new dtags enabled,
4126 # but they are all compatible with --disable-new-dtags,
4127 # because the new dynamic tags are not created by default.
4128 ['binutils_version>=223', {
4129 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4130 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4131 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4132 # inside this file to allow usage of --no-as-needed and removal of
4135 '-Wl,--disable-new-dtags',
4138 ['gcc_version>=48', {
4139 'target_conditions': [
4140 ['_toolset=="target"', {
4143 # See comment for -Wno-c++11-narrowing.
4145 # TODO(thakis): Remove, http://crbug.com/263960
4146 '-Wno-literal-suffix',
4151 ['host_gcc_version>=48', {
4152 'target_conditions': [
4153 ['_toolset=="host"', {
4156 # See comment for -Wno-c++11-narrowing.
4158 # TODO(thakis): Remove, http://crbug.com/263960
4159 '-Wno-literal-suffix',
4167 # FreeBSD-specific options; note that most FreeBSD options are set above,
4170 'target_defaults': {
4172 '-Wl,--no-keep-memory',
4176 # Android-specific options; note that most are set above with Linux.
4179 # This is a unique identifier for a given build. It's used for
4180 # identifying various build artifacts corresponding to a particular
4181 # build of chrome (e.g. where to find archived symbols).
4182 'chrome_build_id%': '',
4184 # Use shared stlport library when system one used.
4185 # Figure this out early since it needs symbols from libgcc.a, so it
4186 # has to be before that in the set of libraries.
4187 ['use_system_stlport==1', {
4188 'android_stlport_library': 'stlport',
4191 ['component=="shared_library"', {
4192 'android_stlport_library': 'stlport_shared',
4194 'android_stlport_library': 'stlport_static',
4200 # Placing this variable here prevents from forking libvpx, used
4201 # by remoting. Remoting is off, so it needn't built,
4202 # so forking it's deps seems like overkill.
4203 # But this variable need defined to properly run gyp.
4204 # A proper solution is to have an OS==android conditional
4205 # in third_party/libvpx/libvpx.gyp to define it.
4206 'libvpx_path': 'lib/linux/arm',
4208 'target_defaults': {
4210 'release_extra_cflags%': '',
4212 # If we're using the components build, append "cr" to all shared
4213 # libraries to avoid naming collisions with android system library
4214 # versions with the same name (e.g. skia, icu).
4215 ['component=="shared_library"', {
4216 'android_product_extension': 'cr.so',
4218 'android_product_extension': 'so',
4222 'target_conditions': [
4223 ['_type=="shared_library"', {
4224 'product_extension': '<(android_product_extension)',
4227 # Settings for building device targets using Android's toolchain.
4228 # These are based on the setup.mk file from the Android NDK.
4230 # The NDK Android executable link step looks as follows:
4232 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4233 # $(PRIVATE_OBJECTS) <-- The .o that we built
4234 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4235 # $(TARGET_LIBGCC) <-- libgcc.a
4236 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4237 # $(PRIVATE_LDLIBS) <-- System .so
4238 # $(TARGET_CRTEND_O) <-- crtend.o
4240 # For now the above are approximated for executables by adding
4241 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4244 # The NDK Android shared library link step looks as follows:
4246 # $(PRIVATE_OBJECTS) <-- The .o that we built
4247 # -l,--whole-archive
4248 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4249 # -l,--no-whole-archive
4250 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4251 # $(TARGET_LIBGCC) <-- libgcc.a
4252 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4253 # $(PRIVATE_LDLIBS) <-- System .so
4255 # For now, assume that whole static libraries are not needed.
4257 # For both executables and shared libraries, add the proper
4258 # libgcc.a to the start of libraries which puts it in the
4259 # proper spot after .o and .a files get linked in.
4261 # TODO: The proper thing to do longer-tem would be proper gyp
4262 # support for a custom link command line.
4263 ['_toolset=="target"', {
4265 '-pthread', # Not supported by Android toolchain.
4268 '-ffunction-sections',
4271 '-fstack-protector',
4273 '-finline-limit=64',
4274 '-Wa,--noexecstack',
4275 '<@(release_extra_cflags)',
4279 '__GNU_SOURCE=1', # Necessary for clone()
4281 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4282 'CHROME_BUILD_ID="<(chrome_build_id)"',
4285 '-pthread', # Not supported by Android toolchain.
4289 '-Wl,--no-undefined',
4290 # Don't export symbols from statically linked libraries.
4291 '-Wl,--exclude-libs=ALL',
4294 '-l<(android_stlport_library)',
4295 # Manually link the libgcc.a that the cross compiler uses.
4296 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4302 ['component=="shared_library"', {
4304 '-Wl,--exclude-libs=ALL',
4309 # Work around incompatibilities between bionic and clang
4311 '-D__compiler_offsetof=__builtin_offsetof',
4312 '-Dnan=__builtin_nan',
4315 ['target_arch=="arm"', {
4317 '-target arm-linux-androideabi',
4320 '-target arm-linux-androideabi',
4323 ['target_arch=="ia32"', {
4325 '-target x86-linux-androideabi',
4328 '-target x86-linux-androideabi',
4331 # Place holder for x64 support, not tested.
4332 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4333 ['target_arch=="x64"', {
4335 '-target x86_64-linux-androideabi',
4338 '-target x86_64-linux-androideabi',
4345 # Android build relies on -Wl,--gc-sections removing
4346 # unreachable code. ASan instrumentation for globals inhibits
4347 # this and results in a library with unresolvable relocations.
4348 # TODO(eugenis): find a way to reenable this.
4349 '-mllvm -asan-globals=0',
4352 ['android_webview_build==0', {
4354 # The NDK has these things, but doesn't define the constants
4355 # to say that it does. Define them here instead.
4359 '--sysroot=<(android_ndk_sysroot)',
4362 '--sysroot=<(android_ndk_sysroot)',
4365 ['android_webview_build==1', {
4367 # OpenAL headers from the Android tree.
4368 '<(android_src)/frameworks/wilhelm/include',
4371 # Android predefines this as 1; undefine it here so Chromium
4372 # can redefine it later to be 2 for chromium code and unset
4373 # for third party code. This works because cflags are added
4375 '-U_FORTIFY_SOURCE',
4376 # Disable any additional warnings enabled by the Android build system but which
4377 # chromium does not build cleanly with (when treating warning as errors).
4378 # Things that are part of -Wextra:
4379 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4380 '-Wno-ignored-qualifiers',
4382 '-Wno-unused-but-set-variable',
4385 # Other things unrelated to -Wextra:
4386 '-Wno-non-virtual-dtor',
4390 ['android_webview_build==1', {
4391 'target_conditions': [
4392 ['chromium_code==0', {
4394 # There is a class of warning which:
4395 # 1) Android always enables and also treats as errors
4396 # 2) Chromium ignores in third party code
4397 # So we re-enable those warnings when building Android.
4399 '-Wno-format-security',
4401 '-Wno-sequence-point',
4404 '-Wno-non-virtual-dtor',
4409 ['target_arch == "arm"', {
4411 # Enable identical code folding to reduce size.
4415 # NOTE: The stlport header include paths below are specified in
4416 # cflags rather than include_dirs because they need to come
4417 # after include_dirs. Think of them like system headers, but
4418 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4419 # toolchain (circa Gingerbread) will exhibit strange errors.
4420 # The include ordering here is important; change with caution.
4421 ['use_system_stlport==1', {
4423 # For libstdc++/include, which is used by stlport.
4424 '-I<(android_src)/bionic',
4425 '-I<(android_src)/external/stlport/stlport',
4427 }, { # else: use_system_stlport!=1
4429 '-I<(android_stlport_include)',
4432 '-L<(android_stlport_libs_dir)',
4435 ['target_arch=="ia32"', {
4436 # The x86 toolchain currently has problems with stack-protector.
4438 '-fstack-protector',
4441 '-fno-stack-protector',
4445 'target_conditions': [
4446 ['_type=="executable"', {
4447 # Force android tools to export the "main" symbol so they can be
4448 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4449 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4450 # when ICS support will be dropped.
4453 '-fvisibility=default',
4457 '-Wl,--gc-sections',
4458 '-Wl,-z,nocopyreloc',
4461 # crtbegin_dynamic.o should be the last item in ldflags.
4462 '<(android_ndk_lib)/crtbegin_dynamic.o',
4465 # crtend_android.o needs to be the last item in libraries.
4466 # Do not add any libraries after this!
4467 '<(android_ndk_lib)/crtend_android.o',
4470 ['_type=="shared_library" or _type=="loadable_module"', {
4472 '-Wl,--exclude-libs=ALL',
4475 '-Wl,-shared,-Bsymbolic',
4478 ['android_webview_build==0', {
4480 # crtbegin_so.o should be the last item in ldflags.
4481 '<(android_ndk_lib)/crtbegin_so.o',
4484 # crtend_so.o needs to be the last item in libraries.
4485 # Do not add any libraries after this!
4486 '<(android_ndk_lib)/crtend_so.o',
4493 # Settings for building host targets using the system toolchain.
4494 ['_toolset=="host"', {
4496 # Due to issues in Clang build system, using ASan on 32-bit
4497 # binaries on x86_64 host is problematic.
4498 # TODO(eugenis): re-enable.
4499 '-fsanitize=address',
4500 '-w', # http://crbug.com/162783
4503 '-fsanitize=address',
4504 '-Wl,-z,noexecstack',
4505 '-Wl,--gc-sections',
4508 '-Wl,--warn-shared-textrel',
4509 '-Wl,--fatal-warnings',
4512 # Settings for building host targets on mac.
4513 ['_toolset=="host" and host_os=="mac"', {
4523 'cflags!': ['-fvisibility=hidden'],
4524 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4526 ['OS=="mac" or OS=="ios"', {
4527 'target_defaults': {
4530 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4531 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4532 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4533 'COPY_PHASE_STRIP': 'NO',
4534 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4535 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4536 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4537 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4538 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4539 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4540 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4541 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4542 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4543 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4544 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4545 'GCC_VERSION': '4.2',
4546 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4547 'USE_HEADERMAP': 'NO',
4552 # Don't warn about unused function parameters.
4553 '-Wno-unused-parameter',
4554 # Don't warn about the "struct foo f = {0};" initialization
4556 '-Wno-missing-field-initializers',
4559 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4560 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4562 # Note that the prebuilt Clang binaries should not be used for iOS
4563 # development except for ASan builds.
4565 # gnu++11 instead of c++11 is needed because some code uses
4566 # typeof() (a GNU extension).
4567 # TODO(thakis): Eventually switch this to c++11 instead of
4568 # gnu++11 (once typeof can be removed, which is blocked on c++11
4569 # being available everywhere).
4570 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', # -std=gnu++11
4571 # Warn if automatic synthesis is triggered with
4572 # the -Wobjc-missing-property-synthesis flag.
4573 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4574 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4578 # This warns on using ints as initializers for floats in
4579 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
4580 # which happens in several places in chrome code. Not sure if
4581 # this is worth fixing.
4582 '-Wno-c++11-narrowing',
4584 # Don't die on dtoa code that uses a char as an array index.
4585 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
4586 '-Wno-char-subscripts',
4588 # TODO(thakis): This used to be implied by -Wno-unused-function,
4589 # which we no longer use. Check if it makes sense to remove
4590 # this as well. http://crbug.com/316352
4591 '-Wno-unneeded-internal-declaration',
4593 # Warns on switches on enums that cover all enum values but
4594 # also contain a default: branch. Chrome is full of that.
4595 '-Wno-covered-switch-default',
4597 # Warns when a const char[] is converted to bool.
4598 '-Wstring-conversion',
4600 # Clang considers the `register` keyword as deprecated, but
4601 # e.g. code generated by flex (used in angle) contains that
4602 # keyword. http://crbug.com/255186
4603 '-Wno-deprecated-register',
4605 # This warns on selectors from Cocoa headers (-length, -set).
4606 # cfe-dev is currently discussing the merits of this warning.
4607 # TODO(thakis): Reevaluate what to do with this, based one
4608 # cfe-dev discussion.
4609 '-Wno-selector-type-mismatch',
4613 ['clang_xcode==0', {
4614 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4615 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4619 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4621 '<@(clang_chrome_plugins_flags)',
4624 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4626 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4629 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4631 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4634 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4636 # See http://crbug.com/110262
4637 '-fcolor-diagnostics',
4640 ['OS=="ios" and target_subarch!="arm32" and \
4641 "<(GENERATOR)"=="xcode"', {
4643 # TODO(ios): when building Chrome for iOS on 64-bit platform
4644 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4645 # enabled. This cause failures when compiling protobuf code,
4646 # so disable the warning. http://crbug.com/359107
4647 '-Wno-shorten-64-to-32',
4655 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4661 '-fsanitize=address',
4662 '-mllvm -asan-globals=0', # http://crbug.com/352073
4663 '-w', # http://crbug.com/162783
4664 '-gline-tables-only',
4668 ['asan_coverage!=0', {
4669 'target_conditions': [
4670 ['_toolset=="target"', {
4672 '-mllvm -asan-coverage=<(asan_coverage)',
4678 'target_conditions': [
4679 ['_type!="static_library"', {
4680 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4685 '-fsanitize=address',
4689 ['mac_write_linker_maps==1', {
4692 '-Wl,-map,>(_target_name).map',
4699 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4700 'target_conditions': [
4701 ['_type=="executable"', {
4707 # Define copy_asan_dylib_path in a variable ending in
4708 # _path so that gyp understands it's a path and
4709 # performs proper relativization during dict merging.
4710 'copy_asan_dylib_path':
4711 'mac/copy_asan_runtime_dylib.sh',
4713 'postbuild_name': 'Copy ASan runtime dylib',
4715 '<(copy_asan_dylib_path)',
4724 ], # target_conditions
4725 }, # target_defaults
4726 }], # OS=="mac" or OS=="ios"
4728 'target_defaults': {
4730 # Prevent Mac OS X AssertMacros.h from defining macros that collide
4731 # with common names, like 'check', 'require', and 'verify'.
4732 # (Included by system header. Also exists on iOS but not included.)
4733 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
4734 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
4737 # These should end with %, but there seems to be a bug with % in
4738 # variables that are intended to be set to different values in
4739 # different targets, like these.
4740 'mac_pie': 1, # Most executables can be position-independent.
4741 # Strip debugging symbols from the target.
4742 'mac_strip': '<(mac_strip_release)',
4746 ['mac_want_real_dsym=="default"', {
4749 'mac_real_dsym': '<(mac_want_real_dsym)'
4754 ['mac_want_real_dsym=="default"', {
4755 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
4757 'mac_real_dsym': '<(mac_want_real_dsym)'
4764 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
4765 # (Equivalent to -fPIC)
4766 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
4767 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4768 # Keep pch files below xcodebuild/.
4769 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
4771 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
4772 # xcode_setting, but not until all downstream projects' mac bots are
4773 # using xcode >= 4.6, because that's when the default value of the
4774 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
4775 # setting is a no-op as far as xcode is concerned, but the compiler
4776 # behaves differently based on whether -fno-strict-aliasing is
4778 '-fno-strict-aliasing', # See http://crbug.com/32204.
4781 'target_conditions': [
4782 ['_type=="executable"', {
4785 # Arranges for data (heap) pages to be protected against
4786 # code execution when running on Mac OS X 10.7 ("Lion"), and
4787 # ensures that the position-independent executable (PIE) bit
4788 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
4790 # Define change_mach_o_flags in a variable ending in _path
4791 # so that GYP understands it's a path and performs proper
4792 # relativization during dict merging.
4793 'change_mach_o_flags_path':
4794 'mac/change_mach_o_flags_from_xcode.sh',
4795 'change_mach_o_flags_options%': [
4797 'target_conditions': [
4798 ['mac_pie==0 or release_valgrind_build==1', {
4799 # Don't enable PIE if it's unwanted. It's unwanted if
4800 # the target specifies mac_pie=0 or if building for
4801 # Valgrind, because Valgrind doesn't understand slide.
4802 # See the similar mac_pie/release_valgrind_build check
4804 'change_mach_o_flags_options': [
4810 'postbuild_name': 'Change Mach-O Flags',
4812 '<(change_mach_o_flags_path)',
4813 '>@(change_mach_o_flags_options)',
4820 'asan_saves_file': 'asan.saves',
4823 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
4827 'target_conditions': [
4828 ['mac_pie==1 and release_valgrind_build==0', {
4829 # Turn on position-independence (ASLR) for executables. When
4830 # PIE is on for the Chrome executables, the framework will
4831 # also be subject to ASLR.
4832 # Don't do this when building for Valgrind, because Valgrind
4833 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
4834 # understand slide, and get rid of the Valgrind check.
4837 '-Wl,-pie', # Position-independent executable (MH_PIE)
4843 ['(_type=="executable" or _type=="shared_library" or \
4844 _type=="loadable_module") and mac_strip!=0', {
4845 'target_conditions': [
4846 ['mac_real_dsym == 1', {
4847 # To get a real .dSYM bundle produced by dsymutil, set the
4848 # debug information format to dwarf-with-dsym. Since
4849 # strip_from_xcode will not be used, set Xcode to do the
4850 # stripping as well.
4854 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
4855 'DEPLOYMENT_POSTPROCESSING': 'YES',
4856 'STRIP_INSTALLED_PRODUCT': 'YES',
4857 'target_conditions': [
4858 ['_type=="shared_library" or _type=="loadable_module"', {
4859 # The Xcode default is to strip debugging symbols
4860 # only (-S). Local symbols should be stripped as
4861 # well, which will be handled by -x. Xcode will
4862 # continue to insert -S when stripping even when
4863 # additional flags are added with STRIPFLAGS.
4865 }], # _type=="shared_library" or _type=="loadable_module"
4866 ['_type=="executable"', {
4869 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
4872 }], # _type=="executable" and asan==1
4873 ], # target_conditions
4875 }, # configuration "Release"
4877 }, { # mac_real_dsym != 1
4878 # To get a fast fake .dSYM bundle, use a post-build step to
4879 # produce the .dSYM and strip the executable. strip_from_xcode
4880 # only operates in the Release configuration.
4884 # Define strip_from_xcode in a variable ending in _path
4885 # so that gyp understands it's a path and performs proper
4886 # relativization during dict merging.
4887 'strip_from_xcode_path': 'mac/strip_from_xcode',
4889 'postbuild_name': 'Strip If Needed',
4890 'action': ['<(strip_from_xcode_path)'],
4894 ], # target_conditions
4895 }], # (_type=="executable" or _type=="shared_library" or
4896 # _type=="loadable_module") and mac_strip!=0
4897 ], # target_conditions
4898 }, # target_defaults
4901 'target_defaults': {
4902 'xcode_settings' : {
4903 # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang
4905 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',
4908 # Older Xcodes do not support -Wno-deprecated-register, so pass an
4909 # additional flag to suppress the "unknown compiler option" error.
4910 # Restrict this flag to builds that are either compiling with Xcode
4911 # or compiling with Xcode's Clang. This will allow Ninja builds to
4912 # continue failing on unknown compiler options.
4913 # TODO(rohitrao): This flag is temporary and should be removed as
4914 # soon as the iOS bots are updated to use Xcode 5.1.
4915 ['clang_xcode==1', {
4917 '-Wno-unknown-warning-option',
4921 # Limit the valid architectures depending on "target_subarch".
4922 # This need to include the "arm" architectures but also the "x86"
4923 # ones (they are used when building for the simulator).
4924 ['target_subarch=="arm32"', {
4925 'VALID_ARCHS': ['armv7', 'i386'],
4927 ['target_subarch=="arm64"', {
4928 'VALID_ARCHS': ['arm64', 'x86_64'],
4930 ['target_subarch=="both"', {
4931 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
4935 'target_conditions': [
4936 ['_toolset=="host"', {
4938 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
4939 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4948 ['_toolset=="target"', {
4950 # This section should be for overriding host settings. But,
4951 # since we can't negate the iphone deployment target above, we
4952 # instead set it here for target only.
4953 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
4954 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
4957 ['_type=="executable"', {
4961 'DEPLOYMENT_POSTPROCESSING': 'YES',
4962 'STRIP_INSTALLED_PRODUCT': 'YES',
4967 # Remove dSYM to reduce build time.
4968 'DEBUG_INFORMATION_FORMAT': 'dwarf',
4974 ['chromium_ios_signing', {
4975 # iOS SDK wants everything for device signed.
4976 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
4978 'CODE_SIGNING_REQUIRED': 'NO',
4979 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
4984 ], # target_conditions
4985 }, # target_defaults
4988 'target_defaults': {
4990 '_WIN32_WINNT=0x0602',
4997 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
4998 'WIN32_LEAN_AND_MEAN',
5002 ['buildtype=="Official"', {
5003 # In official builds, targets can self-select an optimization
5004 # level by defining a variable named 'optimize', and setting it
5006 # - "size", optimizes for minimal code size - the default.
5007 # - "speed", optimizes for speed over code size.
5008 # - "max", whole program optimization and link-time code
5009 # generation. This is very expensive and should be used
5012 'optimize%': 'size',
5016 # Set /LTCG for the official builds.
5017 'LinkTimeCodeGeneration': '1',
5020 'target_conditions': [
5021 ['optimize=="size"', {
5023 'VCCLCompilerTool': {
5024 # 1, optimizeMinSpace, Minimize Size (/O1)
5025 'Optimization': '1',
5026 # 2, favorSize - Favor small code (/Os)
5027 'FavorSizeOrSpeed': '2',
5032 ['optimize=="speed"', {
5034 'VCCLCompilerTool': {
5035 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5036 'Optimization': '2',
5037 # 1, favorSpeed - Favor fast code (/Ot)
5038 'FavorSizeOrSpeed': '1',
5043 ['optimize=="max"', {
5044 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5045 # builds. Probably anything that this would catch that
5046 # wouldn't be caught in a normal build isn't going to
5047 # actually be a bug, so the incremental value of C4702 for
5048 # PGO builds is likely very small.
5049 'msvs_disabled_warnings': [
5053 'VCCLCompilerTool': {
5054 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5055 'Optimization': '2',
5056 # 1, favorSpeed - Favor fast code (/Ot)
5057 'FavorSizeOrSpeed': '1',
5058 # This implies link time code generation.
5059 'WholeProgramOptimization': 'true',
5067 ['component=="static_library"', {
5069 '_HAS_EXCEPTIONS=0',
5082 'AdditionalLibraryDirectories':
5083 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5085 'VCLibrarianTool': {
5086 'AdditionalLibraryDirectories':
5087 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5093 'VCLibrarianTool': {
5094 'AdditionalLibraryDirectories':
5095 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5098 'AdditionalLibraryDirectories':
5099 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5104 # https://code.google.com/p/chromium/issues/detail?id=372451#c20
5105 # Warning 4702 ("Unreachable code") should be re-enabled once
5106 # Express users are updated to VS2013 Update 2.
5107 'msvs_disabled_warnings': [
5112 # Explicitly required when using the ATL with express
5113 'AdditionalDependencies': ['atlthunk.lib'],
5115 # ATL 8.0 included in WDK 7.1 makes the linker to generate
5116 # almost eight hundred LNK4254 and LNK4078 warnings:
5117 # - warning LNK4254: section 'ATL' (50000040) merged into
5118 # '.rdata' (40000040) with different attributes
5119 # - warning LNK4078: multiple 'ATL' sections found with
5120 # different attributes
5121 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
5124 'msvs_system_include_dirs': [
5125 '<(windows_driver_kit_path)/inc/atl71',
5126 '<(windows_driver_kit_path)/inc/mfc42',
5130 'msvs_system_include_dirs': [
5131 '<(windows_sdk_path)/Include/shared',
5132 '<(windows_sdk_path)/Include/um',
5133 '<(windows_sdk_path)/Include/winrt',
5134 '$(VSInstallDir)/VC/atlmfc/include',
5136 'msvs_cygwin_shell': 0,
5137 'msvs_disabled_warnings': [
5138 4351, 4355, 4396, 4503, 4819,
5139 # TODO(maruel): These warnings are level 4. They will be slowly
5140 # removed as code is fixed.
5141 4100, 4121, 4125, 4127, 4130, 4131, 4189, 4201, 4238, 4244, 4245,
5142 4310, 4428, 4481, 4505, 4510, 4512, 4530, 4610, 4611, 4701, 4706,
5145 'VCCLCompilerTool': {
5146 'AdditionalOptions': ['/MP'],
5147 'MinimalRebuild': 'false',
5148 'BufferSecurityCheck': 'true',
5149 'EnableFunctionLevelLinking': 'true',
5150 'RuntimeTypeInfo': 'false',
5151 'WarningLevel': '4',
5152 'WarnAsError': 'true',
5153 'DebugInformationFormat': '3',
5155 ['component=="shared_library"', {
5156 'ExceptionHandling': '1', # /EHsc
5158 'ExceptionHandling': '0',
5162 'VCLibrarianTool': {
5163 'AdditionalOptions': ['/ignore:4221'],
5164 'AdditionalLibraryDirectories': [
5165 '<(windows_sdk_path)/Lib/win8/um/x86',
5169 'AdditionalDependencies': [
5181 'AdditionalLibraryDirectories': [
5182 '<(windows_sdk_path)/Lib/win8/um/x86',
5184 'GenerateDebugInformation': 'true',
5185 'MapFileName': '$(OutDir)\\$(TargetName).map',
5186 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5187 'FixedBaseAddress': '1',
5190 # 1 == /SUBSYSTEM:CONSOLE
5191 # 2 == /SUBSYSTEM:WINDOWS
5192 # Most of the executables we'll ever create are tests
5193 # and utilities with console output.
5197 'GenerateStublessProxies': 'true',
5198 'TypeLibraryName': '$(InputName).tlb',
5199 'OutputDirectory': '$(IntDir)',
5200 'HeaderFileName': '$(InputName).h',
5201 'DLLDataFileName': '$(InputName).dlldata.c',
5202 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5203 'ProxyFileName': '$(InputName)_p.c',
5205 'VCResourceCompilerTool': {
5207 'AdditionalIncludeDirectories': [
5209 '<(SHARED_INTERMEDIATE_DIR)',
5212 'target_conditions': [
5213 ['_type=="executable"', {
5215 'EmbedManifest': 'true',
5218 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5220 'AdditionalManifestFiles': [
5221 '>(win_exe_compatibility_manifest)',
5228 # Building with Clang on Windows is a work in progress and very
5229 # experimental. See crbug.com/82385.
5230 'VCCLCompilerTool': {
5231 'WarnAsError': 'false',
5232 'RuntimeTypeInfo': 'false',
5233 'AdditionalOptions': [
5234 '-fmsc-version=1800',
5237 # Many files use intrinsics without including this header.
5238 # TODO(hans): Fix those files, or move this to sub-GYPs.
5241 # TODO(hans): Make this list shorter eventually.
5242 '-Qunused-arguments',
5243 '-Wno-c++11-compat-deprecated-writable-strings',
5244 '-Wno-char-subscripts',
5245 '-Wno-deprecated-declarations',
5246 '-Wno-deprecated-register',
5248 '-Wno-enum-conversion',
5249 '-Wno-extra-tokens',
5250 '-Wno-ignored-attributes',
5251 '-Wno-incompatible-pointer-types',
5252 '-Wno-int-to-void-pointer-cast',
5253 '-Wno-invalid-noreturn',
5254 '-Wno-logical-op-parentheses',
5256 '-Wno-missing-braces',
5257 '-Wno-missing-declarations',
5258 '-Wno-msvc-include',
5259 '-Wno-null-dereference',
5260 '-Wno-overloaded-virtual',
5262 '-Wno-pointer-sign',
5264 '-Wno-return-type-c-linkage',
5266 '-Wno-sometimes-uninitialized',
5268 '-Wno-tautological-compare',
5269 '-Wno-unknown-pragmas',
5271 '-Wno-unused-function',
5272 '-Wno-unused-private-field',
5273 '-Wno-unused-value',
5274 '-Wno-unused-variable',
5280 # ASan on Windows is a work in progress and very experimental.
5281 # See crbug.com/345874.
5282 'VCCLCompilerTool': {
5283 'AdditionalOptions': [
5284 '-fsanitize=address',
5286 'AdditionalIncludeDirectories': [
5287 # MSVC needs to be able to find the sanitizer headers when
5288 # invoked via /fallback. This is critical for using macros
5289 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5291 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.5.0/include_sanitizer',
5295 'AdditionalLibraryDirectories': [
5296 # TODO(hans): If make_clang_dir is absolute, this breaks.
5297 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.5.0/lib/windows',
5300 'target_conditions': [
5301 ['_type=="executable"', {
5303 'AdditionalDependencies': [
5304 'clang_rt.asan-i386.lib',
5308 ['_type=="shared_library" or _type=="loadable_module"', {
5310 'AdditionalDependencies': [
5311 'clang_rt.asan_dll_thunk-i386.lib',
5321 ['disable_nacl==1', {
5322 'target_defaults': {
5328 ['OS=="win" and msvs_use_common_linker_extras', {
5329 'target_defaults': {
5344 'AdditionalOptions': [
5353 'AdditionalOptions': ['/largeaddressaware'],
5362 'AdditionalOptions': [
5363 # safeseh is not compatible with x64
5375 ['enable_new_npdevice_api==1', {
5376 'target_defaults': {
5378 'ENABLE_NEW_NPDEVICE_API',
5382 # Don't warn about the "typedef 'foo' locally defined but not used"
5384 # TODO: remove this flag once all builds work. See crbug.com/227506
5385 ['gcc_version>=48', {
5386 'target_defaults': {
5388 '-Wno-unused-local-typedefs',
5392 # We need a special case to handle the android webview build on mac because
5393 # the host gcc there doesn't accept this flag, but the target gcc may
5395 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5396 'target_defaults': {
5397 'target_conditions': [
5398 ['_toolset=="host"', {
5400 '-Wno-unused-local-typedefs',
5406 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5408 'make_global_settings': [
5409 ['CC', '<(make_clang_dir)/bin/clang'],
5410 ['CXX', '<(make_clang_dir)/bin/clang++'],
5411 ['CC.host', '$(CC)'],
5412 ['CXX.host', '$(CXX)'],
5415 ['clang==1 and OS=="win"', {
5416 'make_global_settings': [
5417 # On Windows, gyp's ninja generator only looks at CC.
5418 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5421 ['OS=="android" and clang==0', {
5422 # Hardcode the compiler names in the Makefile so that
5423 # it won't depend on the environment at make time.
5424 'make_global_settings': [
5425 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5426 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5427 ['CC.host', '<!(which gcc)'],
5428 ['CXX.host', '<!(which g++)'],
5431 ['OS=="linux" and target_arch=="mipsel"', {
5432 'make_global_settings': [
5433 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5434 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5435 ['CC.host', '<!(which gcc)'],
5436 ['CXX.host', '<!(which g++)'],
5440 # TODO(yyanagisawa): supports GENERATOR==make
5441 # make generator doesn't support CC_wrapper without CC
5442 # in make_global_settings yet.
5443 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5444 'make_global_settings': [
5445 ['CC_wrapper', '<(gomadir)/gomacc'],
5446 ['CXX_wrapper', '<(gomadir)/gomacc'],
5447 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5448 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5453 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5454 # This block adds *project-wide* configuration settings to each project
5455 # file. It's almost always wrong to put things here. Specify your
5456 # custom xcode_settings in target_defaults to add them to targets instead.
5459 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5460 # setting sets the SDK on a project-wide basis. In order to get the
5461 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5462 # here at the project level.
5465 ['mac_sdk_path==""', {
5466 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5468 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5474 ['ios_sdk_path==""', {
5476 # TODO(justincohen): Ninja only supports simulator for now.
5477 ['"<(GENERATOR)"=="xcode"', {
5478 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5480 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5484 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5489 # Target both iPhone and iPad.
5490 'TARGETED_DEVICE_FAMILY': '1,2',
5493 ['target_arch=="x64"', {
5498 ['target_arch=="ia32"', {
5507 # The Xcode generator will look for an xcode_settings section at the root
5508 # of each dict and use it to apply settings on a file-wide basis. Most
5509 # settings should not be here, they should be in target-specific
5510 # xcode_settings sections, or better yet, should use non-Xcode-specific
5511 # settings in target dicts. SYMROOT is a special case, because many other
5512 # Xcode variables depend on it, including variables such as
5513 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5514 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5515 # files to appear (when present) in the UI as actual files and not red
5516 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5517 # and therefore SYMROOT, needs to be set at the project level.
5518 'SYMROOT': '<(DEPTH)/xcodebuild',