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 we're building the cast (chromecast) shell
27 # Whether or not we are using the Aura windowing framework.
30 # Whether or not we are building the Ash shell.
33 # Whether or not we are using CRAS, the ChromeOS Audio Server.
36 # Use a raw surface abstraction.
39 # Configure the build for small devices. See crbug.com/318413
43 # Compute the architecture that we're building on.
44 ['OS=="win" or OS=="ios"', {
47 'host_arch%': '<!pymod_do_main(detect_host_arch)',
51 # Copy conditionally-set variables out one scope.
52 'chromeos%': '<(chromeos)',
53 'chromecast%': '<(chromecast)',
54 'use_aura%': '<(use_aura)',
55 'use_ash%': '<(use_ash)',
56 'use_cras%': '<(use_cras)',
57 'use_ozone%': '<(use_ozone)',
58 'embedded%': '<(embedded)',
59 'host_arch%': '<(host_arch)',
61 # Whether we are using Views Toolkit
64 # Use the PCI lib to collect GPU information.
67 # Use OpenSSL instead of NSS as the underlying SSL and crypto
68 # implementation. Certificate verification will in most cases be
69 # handled by the OS. If OpenSSL's struct X509 is used to represent
70 # certificates, use_openssl_certs must be set.
73 # Typedef X509Certificate::OSCertHandle to OpenSSL's struct X509*.
74 'use_openssl_certs%': 0,
76 # Disable viewport meta tag by default.
77 'enable_viewport%': 0,
79 # Enable HiDPI support.
82 # Override buildtype to select the desired build flavor.
83 # Dev - everyday build for development/testing
84 # Official - release build (generally implies additional processing)
85 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
86 # conversion is done), some of the things which are now controlled by
87 # 'branding', such as symbol generation, will need to be refactored
88 # based on 'buildtype' (i.e. we don't care about saving symbols for
89 # non-Official # builds).
92 # Override branding to select the desired branding flavor.
93 'branding%': 'Chromium',
96 # ChromeOS and Windows use Aura and Ash.
97 ['chromeos==1 or OS=="win" or OS=="linux"', {
102 ['chromecast==1 and OS!="android"', {
112 # Whether we're a traditional desktop unix.
113 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
119 # Embedded implies ozone.
125 'target_arch%': 'arm',
127 # Default architecture we're building for is the architecture we're
128 # building on, and possibly sub-architecture (for iOS builds).
129 'target_arch%': '<(host_arch)',
133 # Copy conditionally-set variables out one scope.
134 'chromeos%': '<(chromeos)',
135 'chromecast%': '<(chromecast)',
136 'desktop_linux%': '<(desktop_linux)',
137 'use_aura%': '<(use_aura)',
138 'use_ash%': '<(use_ash)',
139 'use_cras%': '<(use_cras)',
140 'use_ozone%': '<(use_ozone)',
141 'embedded%': '<(embedded)',
142 'use_libpci%': '<(use_libpci)',
143 'use_openssl%': '<(use_openssl)',
144 'use_openssl_certs%': '<(use_openssl_certs)',
145 'enable_viewport%': '<(enable_viewport)',
146 'enable_hidpi%': '<(enable_hidpi)',
147 'buildtype%': '<(buildtype)',
148 'branding%': '<(branding)',
149 'host_arch%': '<(host_arch)',
150 'target_arch%': '<(target_arch)',
152 'target_subarch%': '',
154 # The channel to build on Android: stable, beta, dev, canary, or
155 # default. "default" should be used on non-official builds.
156 'android_channel%': 'default',
158 # WebView now builds in a normal android build; don't use this.
159 # TODO(torne): remove this. http://crbug.com/440793
160 'android_webview_build%': 0,
162 # Set ARM architecture version.
165 # Use aurax11 for clipboard implementation. This is true on linux_aura.
166 'use_clipboard_aurax11%': 0,
170 # If no gomadir is set, it uses the default gomadir.
174 # The system root for cross-compiles. Default: none.
178 # The system libdir used for this ABI.
179 'system_libdir%': 'lib',
181 # Default MIPS arch variant. This is set in the conditions block
182 # below for MIPS targets.
183 'mips_arch_variant%': '',
185 # MIPS DSP ASE revision. Possible values are:
197 # Set default value of toolkit_views based on OS.
198 ['OS=="mac" or OS=="win" or chromeos==1 or use_aura==1', {
204 # Embedded builds use aura without ash or views.
211 # Enable HiDPI on Mac OS, Chrome OS, Windows and Linux.
212 ['OS=="mac" or chromeos==1 or OS=="win" or OS=="linux"', {
216 # Enable the OpenSSL backend on Mac OS and Windows.
217 ['OS=="mac" or OS=="win"', {
221 # Enable App Launcher everywhere but mobile.
222 ['OS!="ios" and OS!="android"', {
223 'enable_app_list%': 1,
225 'enable_app_list%': 0,
228 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
229 'use_default_render_theme%': 1,
231 'use_default_render_theme%': 0,
235 'use_ozone_evdev%': 1,
237 'use_ozone_evdev%': 0,
240 # Set default gomadir.
242 'gomadir': 'c:\\goma\\goma-win',
244 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
247 # Set the default "target_subarch" on iOS. Valid values are "arm32",
248 # "arm64" and "both" (meaning a fat binary).
250 'target_subarch%': 'arm64',
253 # Set arch variants for MIPS platforms.
254 ['target_arch=="mips64el"', {
257 'mips_arch_variant%': 'r6',
259 'mips_arch_variant%': 'r2',
264 ['target_arch=="mipsel"', {
265 'mips_arch_variant%': 'r1',
270 # Copy conditionally-set variables out one scope.
271 'chromeos%': '<(chromeos)',
272 'chromecast%': '<(chromecast)',
273 'host_arch%': '<(host_arch)',
274 'target_arch%': '<(target_arch)',
275 'target_subarch%': '<(target_subarch)',
276 'mips_arch_variant%': '<(mips_arch_variant)',
277 'mips_dsp_rev%': '<(mips_dsp_rev)',
278 'toolkit_views%': '<(toolkit_views)',
279 'desktop_linux%': '<(desktop_linux)',
280 'use_aura%': '<(use_aura)',
281 'use_ash%': '<(use_ash)',
282 'use_cras%': '<(use_cras)',
283 'use_libpci%': '<(use_libpci)',
284 'use_ozone%': '<(use_ozone)',
285 'use_ozone_evdev%': '<(use_ozone_evdev)',
286 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
287 'embedded%': '<(embedded)',
288 'use_openssl%': '<(use_openssl)',
289 'use_openssl_certs%': '<(use_openssl_certs)',
290 'enable_viewport%': '<(enable_viewport)',
291 'enable_hidpi%': '<(enable_hidpi)',
292 'android_channel%': '<(android_channel)',
293 'android_webview_build%': '<(android_webview_build)',
294 'use_goma%': '<(use_goma)',
295 'gomadir%': '<(gomadir)',
296 'enable_app_list%': '<(enable_app_list)',
297 'use_default_render_theme%': '<(use_default_render_theme)',
298 'buildtype%': '<(buildtype)',
299 'branding%': '<(branding)',
300 'arm_version%': '<(arm_version)',
301 'sysroot%': '<(sysroot)',
302 'chroot_cmd%': '<(chroot_cmd)',
303 'system_libdir%': '<(system_libdir)',
305 # Set to 1 to enable fast builds. Set to 2 for even faster builds
306 # (it disables debug info for fastest compilation - only for use
307 # on compile-only bots).
310 # Set to 1 to not store any build metadata, e.g. ifdef out all __DATE__
311 # and __TIME__. Set to 0 to reenable the use of these macros in the code
312 # base. See http://crbug.com/314403.
313 'dont_embed_build_metadata%': 1,
315 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
316 # This is useful for parallel compilation tools which can't support /Zi.
317 # Only used on Windows.
320 # Set to 1 to enable dcheck in Release build.
321 'dcheck_always_on%': 0,
323 # Set to 1 to make a build that disables unshipped tracing events.
324 # Note: this setting is ignored if buildtype=="Official".
325 'tracing_like_official_build%': 0,
327 # Disable image loader component extension by default.
328 'image_loader_extension%': 0,
330 # Set NEON compilation flags.
333 # Detect NEON support at run-time.
334 'arm_neon_optional%': 0,
336 # Use libjpeg-turbo as the JPEG codec used by Chromium.
337 'use_libjpeg_turbo%': 1,
339 # Use system libjpeg. Note that the system's libjepg will be used even if
340 # use_libjpeg_turbo is set.
341 'use_system_libjpeg%': 0,
343 # By default, component is set to static_library and it can be overriden
344 # by the GYP command line or by ~/.gyp/include.gypi.
345 'component%': 'static_library',
347 # /analyze is off by default on Windows because it is very slow and noisy.
348 # Enable with GYP_DEFINES=win_analyze=1
351 # Set to select the Title Case versions of strings in GRD files.
352 'use_titlecase_in_grd%': 0,
354 # Use translations provided by volunteers at launchpad.net. This
355 # currently only works on Linux.
356 'use_third_party_translations%': 0,
358 # Remoting compilation is enabled by default. Set to 0 to disable.
361 # Configuration policy is enabled by default. Set to 0 to disable.
362 'configuration_policy%': 1,
364 # Variable safe_browsing is used to control the build time configuration
365 # for safe browsing feature. Safe browsing can be compiled in 3 different
366 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
367 # reporting features without enabling phishing and malware detection. This
368 # is useful to integrate a third party phishing/malware detection to
369 # existing safe browsing logic.
372 # Web speech is enabled by default. Set to 0 to disable.
373 'enable_web_speech%': 1,
375 # Notifications are compiled in by default. Set to 0 to disable.
376 'notifications%' : 1,
378 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
379 # regular builds and 1 for ASan builds.
380 'mac_want_real_dsym%': 'default',
382 # If this is set, the clang plugins used on the buildbot will be used.
383 # Run tools/clang/scripts/update.sh to make sure they are compiled.
384 # This causes 'clang_chrome_plugins_flags' to be set.
385 # Has no effect if 'clang' is not set as well.
386 'clang_use_chrome_plugins%': 1,
388 # Enable building with ASAN (Clang's -fsanitize=address option).
389 # -fsanitize=address only works with clang, but asan=1 implies clang=1
390 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
392 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
393 # Enable coverage gathering instrumentation in sanitizer tools. This flag
394 # also controls coverage granularity (1 for function-level coverage, 2
395 # for block-level coverage).
396 'sanitizer_coverage%': 0,
397 # Deprecated, only works if |sanitizer_coverage| isn't set.
398 # TODO(glider): remove this flag.
400 # Enable intra-object-overflow detection in ASan (experimental).
401 'asan_field_padding%': 0,
403 # Enable Chromium overrides of the default configurations for various
404 # dynamic tools (like ASan).
405 'use_sanitizer_options%': 0,
407 # Enable building with SyzyAsan.
408 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
411 # Enable crash reporting via Kasko.
414 # Enable building with LSan (Clang's -fsanitize=leak option).
415 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
416 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
419 # Enable building with TSan (Clang's -fsanitize=thread option).
420 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
421 # See http://clang.llvm.org/docs/ThreadSanitizer.html
423 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
425 # Enable building with MSan (Clang's -fsanitize=memory option).
426 # MemorySanitizer only works with clang, but msan=1 implies clang=1
427 # See http://clang.llvm.org/docs/MemorySanitizer.html
429 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
430 # Track where uninitialized memory originates from. From fastest to
431 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
432 # - track the chain of stores leading from allocation site to use site.
433 'msan_track_origins%': 2,
435 # Enable building with UBSan (Clang's -fsanitize=undefined option).
436 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
437 # See http://clang.llvm.org/docs/UsersManual.html
439 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
441 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
442 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
445 # Use dynamic libraries instrumented by one of the sanitizers
446 # instead of the standard system libraries. Set this flag to build the
447 # libraries from source.
448 'use_instrumented_libraries%': 0,
450 # Use dynamic libraries instrumented by one of the sanitizers
451 # instead of the standard system libraries. Set this flag to download
452 # prebuilt binaries from GCS.
453 'use_prebuilt_instrumented_libraries%': 0,
455 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
456 # stdlibc++ as standard library. This is intended to use for instrumented
458 'use_custom_libcxx%': 0,
460 # Use system libc++ instead of the default C++ library, usually libstdc++.
461 # This is intended for iOS builds only.
462 'use_system_libcxx%': 0,
464 # Use a modified version of Clang to intercept allocated types and sizes
465 # for allocated objects. clang_type_profiler=1 implies clang=1.
466 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
467 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
468 'clang_type_profiler%': 0,
470 # Set to true to instrument the code with function call logger.
471 # See src/third_party/cygprofile/cyg-profile.cc for details.
472 'order_profiling%': 0,
474 # Use the provided profiled order file to link Chrome image with it.
475 # This makes Chrome faster by better using CPU cache when executing code.
476 # This is known as PGO (profile guided optimization).
477 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
478 'order_text_section%' : "",
480 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
481 # libraries on linux x86-64 and arm, plus ASLR.
484 # Whether one-click signin is enabled or not.
485 'enable_one_click_signin%': 0,
487 # Whether to back up data before sync.
488 'enable_pre_sync_backup%': 0,
490 # Enable Chrome browser extensions
491 'enable_extensions%': 1,
494 'enable_google_now%': 1,
496 # Enable basic printing support and UI.
497 'enable_basic_printing%': 1,
499 # Enable printing with print preview. It does not imply
500 # enable_basic_printing. It's possible to build Chrome with preview only.
501 'enable_print_preview%': 1,
503 # Set the version of CLD.
504 # 0: Don't specify the version. This option is for the Finch testing.
509 # For CLD2, the size of the tables that should be included in the build
510 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
512 # See third_party/cld_2/cld_2.gyp for more information.
513 # 0: Small tables, lower accuracy
514 # 2: Large tables, high accuracy
515 'cld2_table_size%': 2,
517 # Enable spell checker.
518 'enable_spellcheck%': 1,
520 # Webrtc compilation is enabled by default. Set to 0 to disable.
523 # Media router support is enabled by default. Set to 0 to disable.
524 'enable_media_router%': 1,
526 # Enables use of the session service, which is enabled by default.
527 # Support for disabling depends on the platform.
528 'enable_session_service%': 1,
530 # Enables theme support, which is enabled by default. Support for
531 # disabling depends on the platform.
534 # Enables autofill dialog and associated features; disabled by default.
535 'enable_autofill_dialog%' : 0,
537 # Defaults Wallet integration in Autofill dialog to use production
538 # servers. Unofficial builds won't have the proper API keys.
539 'enable_prod_wallet_service%': 0,
541 # Enables support for background apps.
542 'enable_background%': 1,
544 # Enable the task manager by default.
545 'enable_task_manager%': 1,
547 # Enables used resource whitelist generation; disabled by default.
548 'enable_resource_whitelist_generation%': 0,
550 # Enable FILE support by default.
551 'disable_file_support%': 0,
553 # Enable FTP support by default.
554 'disable_ftp_support%': 0,
556 # Use native android functions in place of ICU. Not supported by most
558 'use_icu_alternatives_on_android%': 0,
560 # Use of precompiled headers on Windows.
562 # This variable may be explicitly set to 1 (enabled) or 0
563 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
564 # This setting will override the default.
567 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
569 'chromium_win_pch%': 0,
572 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
573 # Set this to true when building with Clang.
574 # See http://code.google.com/p/chromium/wiki/Clang for details.
575 # If this is set, clang is used as both host and target compiler in
576 # cross-compile builds.
579 # Use experimental lld linker instead of the platform's default linker.
582 # Enable plugin installation by default.
583 'enable_plugin_installation%': 1,
585 # Specifies whether to use canvas_skia.cc in place of platform
586 # specific implementations of gfx::Canvas. Affects text drawing in the
588 # TODO(asvitkine): Enable this on all platforms and delete this flag.
589 # http://crbug.com/105550
590 'use_canvas_skia%': 0,
592 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
593 # with one of those tools.
594 'build_for_tool%': '',
596 # If no directory is specified then a temporary directory will be used.
597 'test_isolation_outdir%': '',
599 'wix_path%': '<(DEPTH)/third_party/wix',
601 # Supervised users are enabled by default.
602 'enable_supervised_users%': 1,
604 # Platform sends memory pressure signals natively.
605 'native_memory_pressure_signals%': 0,
607 'spdy_proxy_auth_property%' : '',
608 'spdy_proxy_auth_value%' : '',
610 'enable_service_discovery%': 0,
611 'enable_wifi_bootstrapping%': 0,
612 'enable_hangout_services_extension%': 0,
614 # Enable the Syzygy optimization step.
615 'syzygy_optimize%': 0,
617 # Enable hole punching for the protected video.
620 # Automatically select platforms under ozone. Turn this off to
621 # build only explicitly selected platforms.
622 'ozone_auto_platforms%': 1,
624 # If this is set clang is used as host compiler, but not as target
625 # compiler. Always do this by default.
628 # Variables to control Link-Time Optimizations (LTO).
629 # Note: the variables must *not* be enabled at the same time.
630 # In this case LTO would 'merge' the optimization flags
631 # at link-time which would lead to all code be optimized with -O2.
632 # Enable LTO on the code compiled with -Os.
633 # See crbug.com/407544
635 # Enable LTO on code compiled with -O2.
638 # Allowed level of identical code folding in the gold linker.
639 'gold_icf_level%': 'safe',
641 # Libxkbcommon usage.
644 # Control Flow Integrity for virtual calls.
645 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
648 # Control Flow Integrity for casts.
649 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
650 'cfi_derived_cast%': 0,
651 'cfi_unrelated_cast%': 0,
653 'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
655 # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
656 'mac_views_browser%': 0,
659 # A flag for POSIX platforms
666 # A flag for BSD platforms
667 ['OS=="freebsd" or OS=="openbsd"', {
674 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
680 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
681 # OpenSSL's certificate definition.
682 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
683 'use_openssl_certs%': 1,
685 'use_openssl_certs%': 0,
688 # libudev usage. This currently only affects the content layer.
689 ['OS=="linux" and embedded==0', {
695 # Flags to use X11 on non-Mac POSIX platforms.
696 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
703 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
709 # Flags to use pango and cairo.
710 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
719 ['OS=="linux" and embedded==0', {
725 # We always use skia text rendering in Aura on Windows, since GDI
726 # doesn't agree with our BackingStore.
727 # TODO(beng): remove once skia text rendering is on by default.
728 ['use_aura==1 and OS=="win"', {
729 'enable_skia_text%': 1,
732 # A flag to enable or disable our compile-time dependency
733 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
734 # support will be available. This option is useful
735 # for Linux distributions and for Aura.
736 ['OS!="linux" or chromeos==1', {
737 'use_gnome_keyring%': 0,
739 'use_gnome_keyring%': 1,
742 ['OS=="mac" or OS=="ios"', {
743 # Mac and iOS want Title Case strings
744 'use_titlecase_in_grd%': 1,
747 # Enable loader extensions on Chrome OS.
749 'image_loader_extension%': 1,
751 'image_loader_extension%': 0,
754 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
755 'enable_one_click_signin%': 1,
756 'enable_pre_sync_backup%': 1,
760 'enable_extensions%': 0,
761 'enable_google_now%': 0,
763 'enable_spellcheck%': 0,
767 'arm_neon_optional%': 1,
768 'native_memory_pressure_signals%': 1,
769 'enable_basic_printing%': 1,
770 'enable_print_preview%': 0,
771 'enable_task_manager%':0,
775 # Android OS includes support for proprietary codecs regardless of
776 # building Chromium or Google Chrome. We also ship Google Chrome and
777 # Chromecast with proprietary codecs.
778 ['OS=="android" or branding=="Chrome" or chromecast==1', {
779 'proprietary_codecs%': 1,
781 'proprietary_codecs%': 0,
784 ['OS=="mac" or OS=="ios"', {
785 'native_memory_pressure_signals%': 1,
788 # Enable autofill dialog when not on iOS.
790 'enable_autofill_dialog%': 1,
793 ['buildtype=="Official"', {
794 'enable_prod_wallet_service%': 1,
804 'disable_ftp_support%': 1,
805 'enable_extensions%': 0,
806 'enable_google_now%': 0,
808 'cld2_table_size%': 0,
809 'enable_basic_printing%': 0,
810 'enable_print_preview%': 0,
811 'enable_session_service%': 0,
812 'enable_spellcheck%': 0,
818 'enable_supervised_users%': 0,
819 'enable_task_manager%': 0,
820 'use_system_libcxx%': 1,
823 # Use GPU accelerated cross process image transport by default
824 # on linux builds with the Aura window manager
825 ['use_aura==1 and OS=="linux"', {
826 'ui_compositor_image_transport%': 1,
828 'ui_compositor_image_transport%': 0,
831 # Turn precompiled headers on by default.
832 ['OS=="win" and buildtype!="Official"', {
833 'chromium_win_pch%': 1
836 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
837 'enable_plugin_installation%': 0,
839 'enable_plugin_installation%': 1,
842 # Whether PPAPI is enabled.
843 ['OS=="android" or OS=="ios" or embedded==1', {
844 'enable_plugins%': 0,
846 'enable_plugins%': 1,
849 # linux_use_bundled_gold: whether to use the gold linker binary checked
850 # into third_party/binutils. Force this off via GYP_DEFINES when you
851 # are using a custom toolchain and need to control -B in ldflags.
852 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
853 # for component=static_library builds.
854 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
855 'linux_use_bundled_gold%': 1,
857 'linux_use_bundled_gold%': 0,
860 # linux_use_bundled_binutils: whether to use the binary binutils
861 # checked into third_party/binutils. These are not multi-arch so cannot
862 # be used except on x86 and x86-64 (the only two architectures which
863 # are currently checke in). Force this off via GYP_DEFINES when you
864 # are using a custom toolchain and need to control -B in cflags.
865 ['OS=="linux" and (target_arch=="x64")', {
866 'linux_use_bundled_binutils%': 1,
868 'linux_use_bundled_binutils%': 0,
871 # linux_use_gold_flags: whether to use build flags that rely on gold.
872 # On by default for x64 Linux.
873 ['OS=="linux" and target_arch=="x64"', {
874 'linux_use_gold_flags%': 1,
876 'linux_use_gold_flags%': 0,
879 # linux_use_debug_fission: whether to use split DWARF debug info
880 # files. This can reduce link time significantly, but is incompatible
881 # with some utilities such as icecc and ccache. Requires gold and
882 # gcc >= 4.8 or clang.
883 # http://gcc.gnu.org/wiki/DebugFission
884 ['OS=="linux" and target_arch=="x64"', {
885 'linux_use_debug_fission%': 1,
887 'linux_use_debug_fission%': 0,
890 ['OS=="android" or OS=="ios"', {
891 'enable_captive_portal_detection%': 0,
892 'enable_media_router%': 0,
894 'enable_captive_portal_detection%': 1,
895 'enable_media_router%': 1,
898 # Enable Skia UI text drawing incrementally on different platforms.
899 # http://crbug.com/105550
901 # On Aura, this allows per-tile painting to be used in the browser
903 ['OS!="android" and OS!="ios"', {
904 'use_canvas_skia%': 1,
908 'enable_basic_printing%': 0,
909 'enable_print_preview%': 1,
910 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
911 'use_libjpeg_turbo%': 0,
914 # Do not enable the Settings App on ChromeOS.
915 ['enable_app_list==1 and chromeos==0', {
916 'enable_settings_app%': 1,
918 'enable_settings_app%': 0,
921 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
922 # Set some defaults for arm/linux chrome builds
923 'use_allocator%': 'none',
924 # sysroot needs to be an absolute path otherwise it generates
925 # incorrect results when passed to pkg-config
926 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot',
927 }], # OS=="linux" and target_arch=="arm" and chromeos==0
929 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
931 ['target_arch=="x64"', {
932 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
934 ['target_arch=="ia32"', {
935 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
938 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
940 ['OS=="linux" and target_arch=="mipsel"', {
941 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
942 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
945 # Whether tests targets should be run, archived or just have the
946 # dependencies verified. All the tests targets have the '_run' suffix,
947 # e.g. base_unittests_run runs the target base_unittests. The test
948 # target always calls tools/swarming_client/isolate.py. See the script's
949 # --help for more information. Meant to be overriden with GYP_DEFINES.
950 # TODO(maruel): Remove the conditions as more configurations are
952 ['OS!="ios" and OS!="android" and chromeos==0', {
953 'test_isolation_mode%': 'check',
955 'test_isolation_mode%': 'noop',
957 # Whether Android build uses OpenMAX DL FFT.
958 ['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")', {
959 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
960 # When enabled, this will also enable WebAudio support on
961 # Android for these architectures. Default is enabled. Whether
962 # WebAudio is actually available depends on runtime settings
964 'use_openmax_dl_fft%': 1,
966 'use_openmax_dl_fft%': 0,
968 ['OS=="win" or OS=="linux"', {
972 # Turns on compiler optimizations in V8 in Debug build, except
973 # on android_clang, where we're hitting a weird linker error.
974 # TODO(dpranke): http://crbug.com/266155 .
976 'v8_optimized_debug%': 1,
978 'v8_optimized_debug%': 2,
981 # Disable various features by default on embedded.
984 'enable_basic_printing%': 0,
985 'enable_print_preview%': 0,
988 # By default, use ICU data file (icudtl.dat) on all platforms
989 # except when building Android WebView.
990 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
991 # Set the data reduction proxy origin for Android Webview.
992 ['android_webview_build==0', {
993 'icu_use_data_file_flag%' : 1,
995 'icu_use_data_file_flag%' : 0,
997 ['OS=="win" or OS=="mac"', {
998 'enable_wifi_bootstrapping%' : 1,
1001 # Path to sas.dll, which provides the SendSAS function.
1002 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1003 ['target_arch=="x64"', {
1004 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1006 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1009 # Turn on JNI generation optimizations on non-WebView builds.
1010 ['OS=="android" and android_webview_build==0', {
1011 'optimize_jni_generation%': 1,
1013 'optimize_jni_generation%': 0,
1016 # TODO(rmcilroy): Enable v8_use_external_startup_data on ChromeOS
1017 # http://crbug.com/421063
1018 ['chromecast==0 and chromeos==0 and OS!="ios"', {
1019 'v8_use_external_startup_data%': 1,
1021 'v8_use_external_startup_data%': 0,
1025 # Set this to 1 to enable use of concatenated impulse responses
1026 # for the HRTF panner in WebAudio.
1027 'use_concatenated_impulse_responses': 1,
1029 # You can set the variable 'use_official_google_api_keys' to 1
1030 # to use the Google-internal file containing official API keys
1031 # for Google Chrome even in a developer build. Setting this
1032 # variable explicitly to 1 will cause your build to fail if the
1033 # internal file is missing.
1035 # The variable is documented here, but not handled in this file;
1036 # see //google_apis/determine_use_official_keys.gypi for the
1039 # Set the variable to 0 to not use the internal file, even when
1040 # it exists in your checkout.
1042 # Leave it unset in your include.gypi to have the variable
1043 # implicitly set to 1 if you have
1044 # src/google_apis/internal/google_chrome_api_keys.h in your
1045 # checkout, and implicitly set to 0 if not.
1047 # Note that official builds always behave as if the variable
1048 # was explicitly set to 1, i.e. they always use official keys,
1049 # and will fail to build if the internal file is missing.
1051 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1052 # include.gypi or by other means. Due to subtleties of GYP, this
1053 # is not the same as leaving the variable unset, even though its
1055 # //google_apis/determine_use_official_keys.gypi is 2.
1057 # Set these to bake the specified API keys and OAuth client
1058 # IDs/secrets into your build.
1060 # If you create a build without values baked in, you can instead
1061 # set environment variables to provide the keys at runtime (see
1062 # src/google_apis/google_api_keys.h for details). Features that
1063 # require server-side APIs may fail to work if no keys are
1066 # Note that if you are building an official build or if
1067 # use_official_google_api_keys has been set to 1 (explicitly or
1068 # implicitly), these values will be ignored and the official
1069 # keys will be used instead.
1070 'google_api_key%': '',
1071 'google_default_client_id%': '',
1072 'google_default_client_secret%': '',
1073 # Native Client is enabled by default.
1074 'disable_nacl%': '0',
1077 # Copy conditionally-set variables out one scope.
1078 'branding%': '<(branding)',
1079 'buildtype%': '<(buildtype)',
1080 'target_arch%': '<(target_arch)',
1081 'target_subarch%': '<(target_subarch)',
1082 'mips_arch_variant%': '<(mips_arch_variant)',
1083 'mips_dsp_rev%': '<(mips_dsp_rev)',
1084 'host_arch%': '<(host_arch)',
1085 'toolkit_views%': '<(toolkit_views)',
1086 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1087 'use_aura%': '<(use_aura)',
1088 'use_ash%': '<(use_ash)',
1089 'use_cras%': '<(use_cras)',
1090 'use_libpci%': '<(use_libpci)',
1091 'use_openssl%': '<(use_openssl)',
1092 'use_openssl_certs%': '<(use_openssl_certs)',
1093 'use_nss%': '<(use_nss)',
1094 'use_udev%': '<(use_udev)',
1095 'os_bsd%': '<(os_bsd)',
1096 'os_posix%': '<(os_posix)',
1097 'use_dbus%': '<(use_dbus)',
1098 'use_glib%': '<(use_glib)',
1099 'use_pango%': '<(use_pango)',
1100 'use_cairo%': '<(use_cairo)',
1101 'use_ozone%': '<(use_ozone)',
1102 'use_ozone_evdev%': '<(use_ozone_evdev)',
1103 'use_xkbcommon%': '<(use_xkbcommon)',
1104 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1105 'desktop_linux%': '<(desktop_linux)',
1106 'use_x11%': '<(use_x11)',
1107 'use_gnome_keyring%': '<(use_gnome_keyring)',
1108 'linux_fpic%': '<(linux_fpic)',
1109 'chromeos%': '<(chromeos)',
1110 'chromecast%': '<(chromecast)',
1111 'enable_viewport%': '<(enable_viewport)',
1112 'enable_hidpi%': '<(enable_hidpi)',
1113 'image_loader_extension%': '<(image_loader_extension)',
1114 'fastbuild%': '<(fastbuild)',
1115 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1116 'win_z7%': '<(win_z7)',
1117 'dcheck_always_on%': '<(dcheck_always_on)',
1118 'tracing_like_official_build%': '<(tracing_like_official_build)',
1119 'arm_version%': '<(arm_version)',
1120 'arm_neon%': '<(arm_neon)',
1121 'arm_neon_optional%': '<(arm_neon_optional)',
1122 'sysroot%': '<(sysroot)',
1123 'chroot_cmd%': '<(chroot_cmd)',
1124 'system_libdir%': '<(system_libdir)',
1125 'component%': '<(component)',
1126 'win_analyze%': '<(win_analyze)',
1127 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1128 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1129 'use_third_party_translations%': '<(use_third_party_translations)',
1130 'remoting%': '<(remoting)',
1131 'enable_one_click_signin%': '<(enable_one_click_signin)',
1132 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1133 'enable_media_router%': '<(enable_media_router)',
1134 'enable_webrtc%': '<(enable_webrtc)',
1135 'chromium_win_pch%': '<(chromium_win_pch)',
1136 'configuration_policy%': '<(configuration_policy)',
1137 'safe_browsing%': '<(safe_browsing)',
1138 'enable_web_speech%': '<(enable_web_speech)',
1139 'notifications%': '<(notifications)',
1140 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1141 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1143 'asan_blacklist%': '<(asan_blacklist)',
1144 'asan_coverage%': '<(asan_coverage)',
1145 'sanitizer_coverage%': '<(sanitizer_coverage)',
1146 'asan_field_padding%': '<(asan_field_padding)',
1147 'use_sanitizer_options%': '<(use_sanitizer_options)',
1148 'syzyasan%': '<(syzyasan)',
1149 'kasko%': '<(kasko)',
1150 'syzygy_optimize%': '<(syzygy_optimize)',
1153 'msan_blacklist%': '<(msan_blacklist)',
1154 'msan_track_origins%': '<(msan_track_origins)',
1156 'tsan_blacklist%': '<(tsan_blacklist)',
1157 'ubsan%': '<(ubsan)',
1158 'ubsan_blacklist%': '<(ubsan_blacklist)',
1159 'ubsan_vptr%': '<(ubsan_vptr)',
1160 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1161 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
1162 'use_custom_libcxx%': '<(use_custom_libcxx)',
1163 'use_system_libcxx%': '<(use_system_libcxx)',
1164 'clang_type_profiler%': '<(clang_type_profiler)',
1165 'order_profiling%': '<(order_profiling)',
1166 'order_text_section%': '<(order_text_section)',
1167 'enable_extensions%': '<(enable_extensions)',
1168 'enable_plugin_installation%': '<(enable_plugin_installation)',
1169 'enable_plugins%': '<(enable_plugins)',
1170 'enable_session_service%': '<(enable_session_service)',
1171 'enable_themes%': '<(enable_themes)',
1172 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1173 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1174 'enable_background%': '<(enable_background)',
1175 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1176 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1177 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1178 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1179 'use_canvas_skia%': '<(use_canvas_skia)',
1180 'test_isolation_mode%': '<(test_isolation_mode)',
1181 'test_isolation_outdir%': '<(test_isolation_outdir)',
1182 'enable_basic_printing%': '<(enable_basic_printing)',
1183 'enable_print_preview%': '<(enable_print_preview)',
1184 'enable_spellcheck%': '<(enable_spellcheck)',
1185 'enable_google_now%': '<(enable_google_now)',
1186 'cld_version%': '<(cld_version)',
1187 'cld2_table_size%': '<(cld2_table_size)',
1188 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1189 'disable_file_support%': '<(disable_file_support)',
1190 'disable_ftp_support%': '<(disable_ftp_support)',
1191 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1192 'enable_task_manager%': '<(enable_task_manager)',
1193 'sas_dll_path%': '<(sas_dll_path)',
1194 'wix_path%': '<(wix_path)',
1195 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1196 'use_system_libjpeg%': '<(use_system_libjpeg)',
1197 'android_channel%': '<(android_channel)',
1198 'android_webview_build%': '<(android_webview_build)',
1199 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1200 'gyp_managed_install%': 0,
1201 'create_standalone_apk%': 1,
1202 'enable_app_list%': '<(enable_app_list)',
1203 'use_default_render_theme%': '<(use_default_render_theme)',
1204 'enable_settings_app%': '<(enable_settings_app)',
1205 'google_api_key%': '<(google_api_key)',
1206 'google_default_client_id%': '<(google_default_client_id)',
1207 'google_default_client_secret%': '<(google_default_client_secret)',
1208 'enable_supervised_users%': '<(enable_supervised_users)',
1209 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1210 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1211 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1212 'enable_mdns%' : '<(enable_mdns)',
1213 'enable_service_discovery%' : '<(enable_service_discovery)',
1214 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1215 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1216 'v8_optimized_debug%': '<(v8_optimized_debug)',
1217 'proprietary_codecs%': '<(proprietary_codecs)',
1218 'use_goma%': '<(use_goma)',
1219 'gomadir%': '<(gomadir)',
1220 'use_lto%': '<(use_lto)',
1221 'use_lto_o2%': '<(use_lto_o2)',
1222 'gold_icf_level%': '<(gold_icf_level)',
1223 'video_hole%': '<(video_hole)',
1224 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1225 'cfi_vptr%': '<(cfi_vptr)',
1226 'cfi_derived_cast%': '<(cfi_derived_cast)',
1227 'cfi_unrelated_cast%': '<(cfi_unrelated_cast)',
1228 'cfi_blacklist%': '<(cfi_blacklist)',
1229 'mac_views_browser%': '<(mac_views_browser)',
1231 # Use system protobuf instead of bundled one.
1232 'use_system_protobuf%': 0,
1234 # Use system yasm instead of bundled one.
1235 'use_system_yasm%': 0,
1237 # Use system ICU instead of bundled one.
1238 'use_system_icu%' : 0,
1240 # Default to enabled PIE; this is important for ASLR but we may need to be
1241 # able to turn it off for various reasons.
1242 'linux_disable_pie%': 0,
1244 # The release channel that this build targets. This is used to restrict
1245 # channel-specific build options, like which installer packages to create.
1246 # The default is 'all', which does no channel-specific filtering.
1249 # Override chromium_mac_pch and set it to 0 to suppress the use of
1250 # precompiled headers on the Mac. Prefix header injection may still be
1251 # used, but prefix headers will not be precompiled. This is useful when
1252 # using distcc to distribute a build to compile slaves that don't
1253 # share the same compiler executable as the system driving the compilation,
1254 # because precompiled headers rely on pointers into a specific compiler
1255 # executable's image. Setting this to 0 is needed to use an experimental
1256 # Linux-Mac cross compiler distcc farm.
1257 'chromium_mac_pch%': 1,
1259 # The default value for mac_strip in target_defaults. This cannot be
1260 # set there, per the comment about variable% in a target_defaults.
1261 'mac_strip_release%': 0,
1263 # Set to 1 to enable java code coverage. Instruments classes during build
1264 # to produce .ec files during runtime.
1265 'emma_coverage%': 0,
1267 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1268 # separated with whitespace and/or comma. Only has effect if
1269 # 'emma_coverage=1'.
1272 # Set to 1 to enable running Android lint on java/class files.
1275 # Although base/allocator lets you select a heap library via an
1276 # environment variable, the libcmt shim it uses sometimes gets in
1277 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1278 # 'win_use_allocator_shim': 0,
1279 # 'win_release_RuntimeLibrary': 2
1280 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1281 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1283 # TODO(bradnelson): eliminate this when possible.
1284 # To allow local gyp files to prevent release.vsprops from being included.
1285 # Yes(1) means include release.vsprops.
1286 # Once all vsprops settings are migrated into gyp, this can go away.
1287 'msvs_use_common_release%': 1,
1289 # TODO(bradnelson): eliminate this when possible.
1290 # To allow local gyp files to override additional linker options for msvs.
1291 # Yes(1) means set use the common linker options.
1292 'msvs_use_common_linker_extras%': 1,
1294 # TODO(sgk): eliminate this if possible.
1295 # It would be nicer to support this via a setting in 'target_defaults'
1296 # in chrome/app/locales/locales.gypi overriding the setting in the
1297 # 'Debug' configuration in the 'target_defaults' dict below,
1298 # but that doesn't work as we'd like.
1299 'msvs_debug_link_incremental%': '2',
1301 # Needed for some of the largest modules.
1302 'msvs_debug_link_nonincremental%': '1',
1304 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1305 # to get incremental linking to be faster in debug builds.
1306 'incremental_chrome_dll%': '0',
1308 # Experimental setting to break chrome.dll into multiple pieces based on
1310 'chrome_multiple_dll%': '0',
1312 # Experimental setting to optimize Chrome's DLLs with PGO.
1313 'chrome_pgo_phase%': '0',
1315 # Whether the VS xtree header has been patched to disable warning 4702. If
1316 # it has, then we don't need to disable 4702 (unreachable code warning).
1317 # The patch is preapplied to the internal toolchain and hence all bots.
1318 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1321 'clang%': '<(clang)',
1322 'host_clang%': '<(host_clang)',
1323 'make_clang_dir%': '<(make_clang_dir)',
1324 'use_lld%': '<(use_lld)',
1326 # Control which version of clang to use when building for iOS. If set to
1327 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1328 # the version of clang that ships with the Chromium source. This variable
1329 # is automatically set to '1' when using the Xcode generator.
1332 # These two variables can be set in GYP_DEFINES while running
1333 # |gclient runhooks| to let clang run a plugin in every compilation.
1334 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1336 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1339 'clang_add_plugin%': '',
1341 # Tell ld64 to write map files describing binary layout. Useful
1342 # for looking at what contributes to binary size, e.g. with
1343 # https://github.com/nico/bloat
1344 'mac_write_linker_maps%': 0,
1346 # The default type of gtest.
1347 'gtest_target_type%': 'executable',
1349 # Enable sampling based profiler.
1350 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1352 # Profile without optimizing out stack frames when profiling==1.
1353 'profiling_full_stack_frames%': '0',
1355 # And if we want to dump symbols for Breakpad-enabled builds.
1356 'linux_dump_symbols%': 0,
1357 # And if we want to strip the binary after dumping symbols.
1358 'linux_strip_binary%': 0,
1359 # If we want stack unwind support for backtrace().
1360 'debug_unwind_tables%': 1,
1361 'release_unwind_tables%': 1,
1363 # Override where to find binutils
1364 'binutils_version%': 0,
1365 'binutils_dir%': '',
1368 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1369 'use_allocator%': 'tcmalloc',
1371 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1372 'linux_link_gnome_keyring%': 0,
1373 # Set to 1 to link against gsettings APIs instead of using dlopen().
1374 'linux_link_gsettings%': 0,
1376 # Enable use of OpenMAX DL FFT routines.
1377 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1379 # Enable new NPDevice API.
1380 'enable_new_npdevice_api%': 0,
1382 # .gyp files or targets should set chromium_code to 1 if they build
1383 # Chromium-specific code, as opposed to external code. This variable is
1384 # used to control such things as the set of warnings to enable, and
1385 # whether warnings are treated as errors.
1386 'chromium_code%': 0,
1388 # Disable fatal linker warnings, similarly to how we make it possible
1389 # to disable -Werror (e.g. for different toolchain versions).
1390 'disable_fatal_linker_warnings%': 0,
1392 'release_valgrind_build%': 0,
1394 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1395 'enable_wexit_time_destructors%': 0,
1397 # Build libpeerconnection as a static library by default.
1398 'libpeer_target_type%': 'static_library',
1400 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1401 'internal_gles2_conform_tests%': 0,
1403 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1404 'internal_khronos_glcts_tests%': 0,
1406 # Set to 1 to compile the filter fuzzer.
1407 'internal_filter_fuzzer%': 0,
1409 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1410 # so Cocoa is happy (http://crbug.com/20441).
1412 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1413 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1414 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1415 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1416 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1417 'vi', 'zh-CN', 'zh-TW',
1420 # Pseudo locales are special locales which are used for testing and
1421 # debugging. They don't get copied to the final app. For more info,
1422 # check out https://www.chromium.org/developers/testing/fake-bidi
1429 # If debug_devtools is set to 1, JavaScript files for DevTools are
1430 # stored as is and loaded from disk. Otherwise, a concatenated file
1431 # is stored in resources.pak. It is still possible to load JS files
1432 # from disk by passing --debug-devtools cmdline switch.
1433 'debug_devtools%': 0,
1435 # The Java Bridge is not compiled in by default.
1438 # Code signing for iOS binaries. The bots need to be able to disable this.
1439 'chromium_ios_signing%': 1,
1441 # This flag is only used when disable_nacl==0 and disables all those
1442 # subcomponents which would require the installation of a native_client
1443 # untrusted toolchain.
1444 'disable_nacl_untrusted%': 0,
1446 # Disable Dart by default.
1449 # Copy out the setting of disable_nacl.
1450 'disable_nacl%': '<(disable_nacl)',
1452 # Portable Native Client is enabled by default.
1453 'disable_pnacl%': 0,
1455 # Whether to build full debug version for Debug configuration on Android.
1456 # Compared to full debug version, the default Debug configuration on Android
1457 # has no full v8 debug, has size optimization and linker gc section, so that
1458 # we can build a debug version with acceptable size and performance.
1459 'android_full_debug%': 0,
1461 # Sets the default version name and code for Android app, by default we
1462 # do a developer build.
1463 'android_app_version_name%': 'Developer Build',
1464 'android_app_version_code%': 1,
1466 # Contains data about the attached devices for gyp_managed_install.
1467 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1469 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1470 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1472 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1473 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1475 # Whether we are using the rlz library or not. Platforms like Android send
1476 # rlz codes for searches but do not use the library.
1479 # Turns on the i18n support in V8.
1480 'v8_enable_i18n_support': 1,
1482 # Compile d8 for the host toolset.
1483 'v8_toolset_for_d8': 'host',
1485 # Use brlapi from brltty for braille display support.
1488 # Relative path to icu.gyp from this file.
1489 'icu_gyp_path': '../third_party/icu/icu.gyp',
1491 # IPC fuzzer is disabled by default.
1492 'enable_ipc_fuzzer%': 0,
1494 # Force disable libstdc++ debug mode.
1495 'disable_glibcxx_debug%': 0,
1497 # Set to 1 to compile with MSE support for MPEG2 TS
1498 'enable_mpeg2ts_stream_parser%': 0,
1500 # Support ChromeOS touchpad gestures with ozone.
1501 'use_evdev_gestures%': 0,
1503 # Default ozone platform (if no --ozone-platform flag).
1504 'ozone_platform%': "",
1506 # Ozone platforms to include in the build.
1507 'ozone_platform_caca%': 0,
1508 'ozone_platform_dri%': 0,
1509 'ozone_platform_drm%': 0,
1510 'ozone_platform_egltest%': 0,
1511 'ozone_platform_gbm%': 0,
1512 'ozone_platform_ozonex%': 0,
1513 'ozone_platform_test%': 0,
1515 # Experiment: http://crbug.com/426914
1519 ['buildtype=="Official"', {
1520 # Continue to embed build meta data in Official builds, basically the
1521 # time it was built.
1522 # TODO(maruel): This decision should be revisited because having an
1523 # official deterministic build has high value too but MSVC toolset can't
1524 # generate anything deterministic with WPO enabled AFAIK.
1525 'dont_embed_build_metadata%': 0,
1527 # Enable the Syzygy optimization step for the official builds.
1528 ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
1529 'syzygy_optimize%': 1,
1531 'syzygy_optimize%': 0,
1533 # Get binutils version so we can enable debug fission if we can.
1534 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1536 # compiler_version doesn't work with clang
1537 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1538 # compiler_version works with clang.
1539 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1540 # that it takes effect here.
1541 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1542 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1544 # On Android we know the binutils version in the toolchain.
1546 'binutils_version%': 222,
1548 ['host_arch=="x64"', {
1549 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1551 ['host_arch=="ia32"', {
1552 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1554 # Our version of binutils in third_party/binutils
1555 ['linux_use_bundled_binutils==1', {
1556 'binutils_version%': 224,
1560 'binutils_version%': 0,
1562 # The version of GCC in use, set later in platforms that use GCC and have
1563 # not explicitly chosen to build with clang. Currently, this means all
1564 # platforms except Windows, Mac and iOS.
1565 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1566 # it takes effect here.
1567 ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan_vptr==0', {
1570 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1571 # We directly set the gcc version since we know what we use.
1574 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1575 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1579 'host_gcc_version%': 0,
1582 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1583 'windows_sdk_path%': '<(windows_sdk_default_path)',
1585 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1587 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1588 'directx_sdk_path%': '<(directx_sdk_default_path)',
1590 'directx_sdk_path%': '$(DXSDK_DIR)',
1593 'windows_driver_kit_path%': '$(WDK_DIR)',
1595 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1597 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1600 'nacl_untrusted_build%': 0,
1601 'use_allocator%': 'none',
1603 ['OS=="linux" and target_arch=="mipsel"', {
1604 'sysroot%': '<(sysroot)',
1607 # Use a 64-bit linker to avoid running out of address space. The
1608 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1609 ['host_arch=="ia32" and target_arch=="ia32"', {
1610 # TODO(thestig) This is a horrible way to force the desired
1611 # configuration. Our gyp variable scoping is likely wrong and
1612 # needs to be cleaned up. The GN configuration should be changed
1614 'binutils_version%': 224,
1615 'linux_use_bundled_binutils%': '1',
1616 'linux_use_bundled_gold%': '1',
1617 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1619 # All Chrome builds have breakpad symbols, but only process the
1620 # symbols from official builds.
1621 ['(branding=="Chrome" and buildtype=="Official")', {
1622 'linux_dump_symbols%': 1,
1624 # Omit unwind support in official release builds to save space. We
1625 # can use breakpad for these builds.
1626 'release_unwind_tables%': 0,
1629 }], # os_posix==1 and OS!="mac" and OS!="ios"
1632 'enable_background%': 0,
1633 'icu_use_data_file_flag%': 1,
1634 'enable_web_speech%': 0,
1635 'use_system_libxml%': 1,
1636 'use_system_sqlite%': 1,
1638 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1639 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1640 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1641 'uk', 'vi', 'zh-CN', 'zh-TW',
1644 # iOS SDK and deployment target support. The |ios_sdk| value is left
1645 # blank so that when it is set in the project files it will be the
1646 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1647 # causes Xcode to spit out a warning for every single project file for
1648 # not using the "current" SDK.
1650 'ios_sdk_path%': '',
1651 'ios_deployment_target%': '7.0',
1654 # ios_product_name is set to the name of the .app bundle as it should
1656 ['branding=="Chrome"', {
1657 'ios_product_name%': 'Chrome',
1658 }, { # else: branding!="Chrome"
1659 'ios_product_name%': 'Chromium',
1661 ['branding=="Chrome" and buildtype=="Official"', {
1663 }, { # else: branding!="Chrome" or buildtype!="Official"
1669 # Location of Android NDK.
1672 # Standard libraries can use the relative path to the NDK.
1673 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1674 # Unfortunately, it is required to use the absolute path to the SDK
1675 # because it us passed to ant which uses a different relative path
1677 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1678 # Similarly, gdbserver and the Android toolchain need to use the
1679 # absolute path to the NDK because they are used at different levels
1681 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1682 'android_host_arch%': '<!(uname -m)',
1683 # Android API-level of the SDK used for compilation.
1684 'android_sdk_version%': '22',
1685 'android_sdk_build_tools_version%': '22.0.0',
1686 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1688 # Copy conditionally-set variables out one scope.
1689 'android_ndk_root%': '<(android_ndk_root)',
1690 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1691 'android_sdk_root%': '<(android_sdk_root)',
1692 'android_sdk_version%': '<(android_sdk_version)',
1693 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1694 'host_os%': '<(host_os)',
1696 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1697 # Android SDK build tools (e.g. dx, aapt, aidl)
1698 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1700 # Android API level 14 is ICS (Android 4.0) which is the minimum
1701 # platform requirement for Chrome on Android, we use it for native
1704 ['target_arch == "ia32"', {
1705 'android_app_abi%': 'x86',
1706 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
1707 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1708 'android_ndk_lib_dir%': 'usr/lib',
1709 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1711 ['target_arch == "x64"', {
1712 'android_app_abi%': 'x86_64',
1713 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1714 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1715 'android_ndk_lib_dir%': 'usr/lib64',
1716 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1718 ['target_arch=="arm"', {
1721 'android_app_abi%': 'armeabi',
1723 'android_app_abi%': 'armeabi-v7a',
1726 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
1727 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1728 'android_ndk_lib_dir%': 'usr/lib',
1729 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1731 ['target_arch == "arm64"', {
1732 'android_app_abi%': 'arm64-v8a',
1733 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1734 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1735 'android_ndk_lib_dir%': 'usr/lib',
1736 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1738 ['target_arch == "mipsel"', {
1739 'android_app_abi%': 'mips',
1740 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
1741 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1742 'android_ndk_lib_dir%': 'usr/lib',
1743 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1745 ['target_arch == "mips64el"', {
1746 'android_app_abi%': 'mips64',
1747 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1748 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1749 'android_ndk_lib_dir%': 'usr/lib64',
1750 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1754 # Copy conditionally-set variables out one scope.
1755 'android_app_abi%': '<(android_app_abi)',
1756 'android_gdbserver%': '<(android_gdbserver)',
1757 'android_ndk_root%': '<(android_ndk_root)',
1758 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1759 'android_sdk_root%': '<(android_sdk_root)',
1760 'android_sdk_version%': '<(android_sdk_version)',
1761 'android_toolchain%': '<(android_toolchain)',
1763 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1764 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1765 'android_sdk_tools%': '<(android_sdk_tools)',
1766 'android_sdk%': '<(android_sdk)',
1767 'android_sdk_jar%': '<(android_sdk)/android.jar',
1769 'android_stlport_root': '<(android_stlport_root)',
1770 'android_stlport_include': '<(android_stlport_root)/stlport',
1771 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1772 'host_os%': '<(host_os)',
1774 # Location of the "objcopy" binary, used by both gyp and scripts.
1775 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1777 # Location of the "strip" binary, used by both gyp and scripts.
1778 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1780 # Location of the "readelf" binary.
1781 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1783 # Determines whether we should optimize JNI generation at the cost of
1784 # breaking assumptions in the build system that when inputs have changed
1785 # the outputs should always change as well. This is meant purely for
1786 # developer builds, to avoid spurious re-linking of native files.
1787 'optimize_jni_generation%': '<(optimize_jni_generation)',
1789 # Always uses openssl.
1791 'use_openssl_certs%': 1,
1793 'proprietary_codecs%': '<(proprietary_codecs)',
1794 'safe_browsing%': 2,
1795 'enable_web_speech%': 0,
1797 'build_ffmpegsumo%': 0,
1798 'use_allocator%': 'none',
1800 # Disable Native Client.
1803 # Android does not support background apps.
1804 'enable_background%': 0,
1806 # Sessions are store separately in the Java side.
1807 'enable_session_service%': 0,
1811 'gtest_target_type%': 'shared_library',
1813 # Uses system APIs for decoding audio and video.
1814 'use_libffmpeg%': '0',
1816 # TODO(torne): Remove this unsupported option once all the places that
1817 # test it have been updated.
1818 'use_system_stlport%': 0,
1820 # Copy it out one scope.
1821 'android_webview_build%': '<(android_webview_build)',
1824 'use_system_fontconfig%': 0,
1826 'use_system_fontconfig%': 1,
1829 'enable_mpeg2ts_stream_parser%': 1,
1830 'ffmpeg_branding%': 'ChromeOS',
1831 'ozone_platform_ozonex%': 1,
1832 'use_playready%': 0,
1834 ['target_arch=="arm"', {
1836 'arm_tune%': 'cortex-a9',
1842 ['OS=="linux" and target_arch!="mipsel"', {
1847 # All Chrome builds have breakpad symbols, but only process the
1848 # symbols from official builds.
1849 ['(branding=="Chrome" and buildtype=="Official")', {
1850 'mac_strip_release%': 1,
1854 ['OS=="mac" or OS=="ios"', {
1858 # Mac OS X SDK and deployment target support. The SDK identifies
1859 # the version of the system headers that will be used, and
1860 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1861 # macro. "Maximum allowed" refers to the operating system version
1862 # whose APIs are available in the headers. The deployment target
1863 # identifies the minimum system version that the built products are
1864 # expected to function on. It corresponds to the
1865 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1866 # macros are available, #include <AvailabilityMacros.h>. Additional
1867 # documentation on these macros is available at
1868 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1869 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1870 # deployment target to 10.6. Other projects, such as O3D, may
1871 # override these defaults.
1873 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1874 # about that is at least the specified version. In official builds,
1875 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1876 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1877 # path to the SDK; when set to a non-empty string, SDK detection
1878 # based on mac_sdk_min will be bypassed entirely.
1881 'mac_sdk_min%': '10.8',
1882 }, { # else OS!="ios"
1883 'mac_sdk_min%': '10.6',
1886 'mac_sdk_path%': '',
1888 'mac_deployment_target%': '10.6',
1891 'mac_sdk_min': '<(mac_sdk_min)',
1892 'mac_sdk_path': '<(mac_sdk_path)',
1893 'mac_deployment_target': '<(mac_deployment_target)',
1895 # Compile in Breakpad support by default so that it can be
1896 # tested, even if it is not enabled by default at runtime.
1897 'mac_breakpad_compiled_in%': 1,
1899 # mac_product_name is set to the name of the .app bundle as it should
1900 # appear on disk. This duplicates data from
1901 # chrome/app/theme/chromium/BRANDING and
1902 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1903 # these names into the build system.
1904 ['branding=="Chrome"', {
1905 'mac_product_name%': 'Google Chrome',
1906 }, { # else: branding!="Chrome"
1907 'mac_product_name%': 'Chromium',
1909 # Official mac builds require a specific OS X SDK, but iOS and
1910 # non-official mac builds do not.
1911 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1912 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1914 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1916 ['branding=="Chrome" and buildtype=="Official"', {
1917 # Enable uploading crash dumps.
1918 'mac_breakpad_uploads%': 1,
1919 # Enable dumping symbols at build time for use by Mac Breakpad.
1921 # Enable Keystone auto-update support.
1923 }, { # else: branding!="Chrome" or buildtype!="Official"
1924 'mac_breakpad_uploads%': 0,
1929 }], # OS=="mac" or OS=="ios"
1932 # This is the architecture convention used in WinSDK paths.
1933 ['target_arch=="ia32"', {
1934 'winsdk_arch%': 'x86',
1936 'winsdk_arch%': '<(target_arch)',
1938 ['component=="shared_library"', {
1939 'win_use_allocator_shim%': 0,
1941 # Turn on multiple dll by default on Windows when in static_library.
1942 'chrome_multiple_dll%': 1,
1944 ['asan==1 or syzyasan==1', {
1945 'win_use_allocator_shim%': 0,
1950 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1951 # Only enabled by default for ninja because it's buggy in VS.
1952 # Not enabled for component=static_library because some targets
1953 # are too large and the toolchain fails due to the size of the
1955 'incremental_chrome_dll%': 1,
1957 # Don't do incremental linking for large modules on 32-bit or when
1958 # component=static_library as the toolchain fails due to the size of
1960 ['MSVS_OS_BITS==32 or component=="static_library"', {
1961 'msvs_large_module_debug_link_mode%': '1', # No
1963 'msvs_large_module_debug_link_mode%': '2', # Yes
1966 'nacl_win64_defines': [
1967 # This flag is used to minimize dependencies when building
1968 # Native Client loader for 64-bit Windows.
1971 # Need to include allocator target, but exclude tcmalloc files.
1972 'use_allocator%': 'winheap',
1975 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1981 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1982 'enable_pepper_cdms%': 1,
1984 'enable_pepper_cdms%': 0,
1987 ['OS=="android" or chromecast==1', {
1988 'enable_browser_cdms%': 1,
1990 'enable_browser_cdms%': 0,
1993 # Native Client glibc toolchain is enabled
1994 # by default except on arm, mips and mips64.
1995 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
1996 'disable_glibc%': 1,
1998 'disable_glibc%': 0,
2001 # Set the relative path from this file to the GYP file of the JPEG
2002 # library used by Chromium.
2003 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2004 # Configuration for using the system libjeg is here.
2005 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
2007 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
2010 # Options controlling the use of GConf (the classic GNOME configuration
2011 # system) and GIO, which contains GSettings (the new GNOME config system).
2012 ['chromeos==1 or embedded==1', {
2020 # Set up -D and -E flags passed into grit.
2021 ['branding=="Chrome"', {
2022 # TODO(mmoss) The .grd files look for _google_chrome, but for
2023 # consistency they should look for google_chrome_build like C++.
2024 'grit_defines': ['-D', '_google_chrome',
2025 '-E', 'CHROMIUM_BUILD=google_chrome'],
2027 'grit_defines': ['-D', '_chromium',
2028 '-E', 'CHROMIUM_BUILD=chromium'],
2031 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2033 ['desktop_linux==1', {
2034 'grit_defines': ['-D', 'desktop_linux'],
2036 ['toolkit_views==1', {
2037 'grit_defines': ['-D', 'toolkit_views'],
2040 'grit_defines': ['-D', 'use_aura'],
2043 'grit_defines': ['-D', 'use_ash'],
2046 'grit_defines': ['-D', 'use_nss'],
2049 'grit_defines': ['-D', 'use_ozone'],
2051 ['image_loader_extension==1', {
2052 'grit_defines': ['-D', 'image_loader_extension'],
2055 'grit_defines': ['-D', 'remoting'],
2057 ['use_titlecase_in_grd==1', {
2058 'grit_defines': ['-D', 'use_titlecase'],
2060 ['use_third_party_translations==1', {
2061 'grit_defines': ['-D', 'use_third_party_translations'],
2063 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2064 'ka', 'ku', 'kw', 'ms', 'ug'
2070 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2071 '--no-output-all-resource-defines',
2074 ['OS=="mac" or OS=="ios"', {
2075 'grit_defines': ['-D', 'scale_factors=2x'],
2079 'enable_coverage%': 0,
2083 '--no-output-all-resource-defines',
2085 # iOS uses a whitelist to filter resources.
2086 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2088 # Enable host builds when generating with ninja-ios.
2090 ['"<(GENERATOR)"=="ninja"', {
2094 # Use the version of clang shipped with Xcode when building official
2095 # version of Chrome for iOS.
2097 # TODO(eugenebut): Remove enable_coverage check once
2098 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2099 # http://crbug.com/450379
2100 ['buildtype=="Official" or enable_coverage', {
2105 ['enable_extensions==1', {
2106 'grit_defines': ['-D', 'enable_extensions'],
2108 ['enable_plugins!=0', {
2109 'grit_defines': ['-D', 'enable_plugins'],
2111 ['enable_basic_printing==1 or enable_print_preview==1', {
2112 'grit_defines': ['-D', 'enable_printing'],
2114 ['enable_print_preview==1', {
2115 'grit_defines': ['-D', 'enable_print_preview'],
2117 ['enable_themes==1', {
2118 'grit_defines': ['-D', 'enable_themes'],
2120 ['enable_app_list==1', {
2121 'grit_defines': ['-D', 'enable_app_list'],
2123 ['enable_settings_app==1', {
2124 'grit_defines': ['-D', 'enable_settings_app'],
2126 ['enable_google_now==1', {
2127 'grit_defines': ['-D', 'enable_google_now'],
2129 ['use_concatenated_impulse_responses==1', {
2130 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2132 ['enable_media_router==1', {
2133 'grit_defines': ['-D', 'enable_media_router'],
2135 ['enable_webrtc==1', {
2136 'grit_defines': ['-D', 'enable_webrtc'],
2138 ['enable_hangout_services_extension==1', {
2139 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2141 ['enable_task_manager==1', {
2142 'grit_defines': ['-D', 'enable_task_manager'],
2144 ['notifications==1', {
2145 'grit_defines': ['-D', 'enable_notifications'],
2147 ['enable_wifi_bootstrapping==1', {
2148 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2150 ['mac_views_browser==1', {
2151 'grit_defines': ['-D', 'mac_views_browser'],
2153 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2154 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2156 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2157 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2159 ['enable_mdns==1 or OS=="mac"', {
2160 'grit_defines': ['-D', 'enable_service_discovery'],
2161 'enable_service_discovery%': 1
2163 ['clang_use_chrome_plugins==1 and OS!="win"', {
2166 ['OS=="mac" or OS=="ios"', {
2167 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2168 }, { # OS != "mac" or OS != "ios"
2169 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
2173 # If you change these, also change build/config/clang/BUILD.gn.
2174 'clang_chrome_plugins_flags%':
2175 '-Xclang -load -Xclang <(clang_lib_path)'
2176 ' -Xclang -add-plugin -Xclang find-bad-constructs',
2178 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2180 'use_allocator%': 'none',
2181 'use_sanitizer_options%': 1,
2182 # Disable ICF in the linker to avoid debug info loss.
2183 'gold_icf_level%': 'none',
2185 ['asan==1 and OS=="linux" and chromeos==0', {
2186 'use_custom_libcxx%': 1,
2194 ['asan==1 and OS=="mac"', {
2195 'mac_strip_release': 1,
2198 'use_custom_libcxx%': 1,
2201 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2202 # libstdc++. This is required to avoid false positive reports whenever
2203 # the C++ standard library is used.
2204 'use_custom_libcxx%': 1,
2205 # Running the V8-generated code on an ARM simulator is a powerful hack
2206 # that allows the tool to see the memory accesses from JITted code.
2207 # Without this flag, JS code causes false positive reports from MSan.
2208 'v8_target_arch': 'arm64',
2211 ['OS=="linux" and clang_type_profiler==1', {
2213 'clang_use_chrome_plugins%': 0,
2215 ['host_arch=="x64"', {
2216 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2218 ['host_arch=="ia32"', {
2219 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2220 # Clang in this directory at your own risk if needed for some
2221 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2222 # usage). Any failure by this compiler should not close the tree.
2223 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2229 # The Clang plugins don't currently work on Windows.
2230 # TODO(hans): One day, this will work. (crbug.com/82385)
2231 'clang_use_chrome_plugins%': 0,
2234 # On valgrind bots, override the optimizer settings so we don't inline too
2235 # much and make the stacks harder to figure out.
2237 # TODO(rnk): Kill off variables that no one else uses and just implement
2238 # them under a build_for_tool== condition.
2239 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2241 'mac_debug_optimization': '1',
2242 'mac_release_optimization': '1',
2243 'release_optimize': '1',
2244 'no_gc_sections': 1,
2245 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2246 '-fno-builtin -fno-optimize-sibling-calls',
2247 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2248 '-fno-builtin -fno-optimize-sibling-calls',
2250 # MSVS flags for TSan on Pin and Windows.
2251 'win_debug_RuntimeChecks': '0',
2252 'win_debug_disable_iterator_debugging': '1',
2253 'win_debug_Optimization': '1',
2254 'win_debug_InlineFunctionExpansion': '0',
2255 'win_release_InlineFunctionExpansion': '0',
2256 'win_release_OmitFramePointers': '0',
2258 'use_allocator': 'tcmalloc',
2259 'release_valgrind_build': 1,
2261 'component': 'static_library',
2262 'use_system_zlib': 0,
2265 # Build tweaks for DrMemory.
2266 # TODO(rnk): Combine with tsan config to share the builder.
2267 # http://crbug.com/108155
2268 ['build_for_tool=="drmemory"', {
2269 # These runtime checks force initialization of stack vars which blocks
2270 # DrMemory's uninit detection.
2271 'win_debug_RuntimeChecks': '0',
2272 # Iterator debugging is slow.
2273 'win_debug_disable_iterator_debugging': '1',
2274 # Try to disable optimizations that mess up stacks in a release build.
2275 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2276 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2277 # compiler bug, so we use /Ob1 instead.
2278 'win_release_InlineFunctionExpansion': '1',
2279 'win_release_OmitFramePointers': '0',
2280 # Ditto for debug, to support bumping win_debug_Optimization.
2281 'win_debug_InlineFunctionExpansion': 0,
2282 'win_debug_OmitFramePointers': 0,
2283 # Keep the code under #ifndef NVALGRIND.
2284 'release_valgrind_build': 1,
2287 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2288 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2292 # Set default compiler flags depending on ARM version.
2293 ['arm_version==6', {
2294 'arm_arch%': 'armv6',
2297 'arm_float_abi%': 'softfp',
2300 ['arm_version==7', {
2301 'arm_arch%': 'armv7-a',
2302 'arm_tune%': 'generic-armv7-a',
2307 'arm_fpu%': 'vfpv3-d16',
2310 # Change the default to hard once the armhf transition is complete.
2311 'arm_float_abi%': 'softfp',
2315 # Set default compiler flags for MIPS floating-point support.
2316 ['target_arch=="mipsel"', {
2317 'mips_float_abi%': 'hard',
2319 ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
2320 'mips_fpu_mode%': 'fp32',
2323 # Enable brlapi by default for chromeos.
2328 ['use_ozone==1 and ozone_auto_platforms==1', {
2329 # Use test as the default platform.
2330 'ozone_platform%': 'test',
2332 # Build all platforms whose deps are in install-build-deps.sh.
2333 # Only these platforms will be compile tested by buildbots.
2334 'ozone_platform_dri%': 1,
2335 'ozone_platform_drm%': 1,
2336 'ozone_platform_test%': 1,
2337 'ozone_platform_egltest%': 1,
2340 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2341 'use_clipboard_aurax11%': 1,
2344 ['OS=="win" and use_goma==1', {
2345 # goma doesn't support pch yet.
2346 'chromium_win_pch': 0,
2347 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2349 ['win_z7==0 and fastbuild==0', {
2355 ['OS=="win" and (clang==1 or asan==1)', {
2356 'chromium_win_pch': 0,
2360 'host_cc': '<(make_clang_dir)/bin/clang',
2361 'host_cxx': '<(make_clang_dir)/bin/clang++',
2363 'host_cc': '<!(which gcc)',
2364 'host_cxx': '<!(which g++)',
2367 # The seccomp-bpf sandbox is only supported on five architectures
2369 # Do not disable seccomp_bpf anywhere without talking to
2370 # security@chromium.org!
2371 ['((OS=="linux" or OS=="android") and '
2372 '(target_arch=="ia32" or target_arch=="x64" or '
2373 'target_arch=="arm" or target_arch=="mipsel" or '
2374 'target_arch=="arm64"))', {
2375 'use_seccomp_bpf%': 1,
2377 'use_seccomp_bpf%': 0,
2380 ['cfi_vptr==1 or cfi_derived_cast==1 or cfi_unrelated_cast==1', {
2385 # The path to the ANGLE library.
2386 'angle_path': '<(DEPTH)/third_party/angle',
2388 # List of default apps to install in new profiles. The first list contains
2389 # the source files as found in svn. The second list, used only for linux,
2390 # contains the destination location for each of the files. When a crx
2391 # is added or removed from the list, the chrome/browser/resources/
2392 # default_apps/external_extensions.json file must also be updated.
2394 # README: GN version of these is in the target //chrome:default_apps
2395 # (there's no global variable like in GYP). Be sure to update that target
2396 # if you change these lists!
2397 'default_apps_list': [
2398 'browser/resources/default_apps/external_extensions.json',
2399 'browser/resources/default_apps/gmail.crx',
2400 'browser/resources/default_apps/search.crx',
2401 'browser/resources/default_apps/youtube.crx',
2402 'browser/resources/default_apps/drive.crx',
2403 'browser/resources/default_apps/docs.crx',
2405 'default_apps_list_linux_dest': [
2406 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2407 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2408 '<(PRODUCT_DIR)/default_apps/search.crx',
2409 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2410 '<(PRODUCT_DIR)/default_apps/drive.crx',
2411 '<(PRODUCT_DIR)/default_apps/docs.crx',
2414 # Whether to allow building of the GPU-related isolates.
2415 'archive_gpu_tests%': 0,
2417 # Whether to allow building of chromoting related isolates.
2418 'archive_chromoting_tests%': 0,
2420 'target_defaults': {
2422 # The condition that operates on chromium_code is in a target_conditions
2423 # section, and will not have access to the default fallback value of
2424 # chromium_code at the top of this file, or to the chromium_code
2425 # variable placed at the root variables scope of .gyp files, because
2426 # those variables are not set at target scope. As a workaround,
2427 # if chromium_code is not set at target scope, define it in target scope
2428 # to contain whatever value it has during early variable expansion.
2429 # That's enough to make it available during target conditional
2431 'chromium_code%': '<(chromium_code)',
2433 'component%': '<(component)',
2435 'chromecast%': '<(chromecast)',
2437 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2438 'win_release_Optimization%': '2', # 2 = /O2
2439 'win_debug_Optimization%': '0', # 0 = /Od
2441 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2442 # Tri-state: blank is default, 1 on, 0 off
2443 'win_release_OmitFramePointers%': '0',
2444 # Tri-state: blank is default, 1 on, 0 off
2445 'win_debug_OmitFramePointers%': '',
2447 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2448 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2450 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2451 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2452 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2454 # VS inserts quite a lot of extra checks to algorithms like
2455 # std::partial_sort in Debug build which make them O(N^2)
2456 # instead of O(N*logN). This is particularly slow under memory
2457 # tools like ThreadSanitizer so we want it to be disablable.
2458 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2459 'win_debug_disable_iterator_debugging%': '0',
2461 # An application manifest fragment to declare compatibility settings for
2462 # 'executable' targets. Ignored in other target type.
2463 'win_exe_compatibility_manifest%':
2464 '<(DEPTH)\\build\\win\\compatibility.manifest',
2466 'release_extra_cflags%': '',
2467 'debug_extra_cflags%': '',
2469 'release_valgrind_build%': '<(release_valgrind_build)',
2471 # the non-qualified versions are widely assumed to be *nix-only
2472 'win_release_extra_cflags%': '',
2473 'win_debug_extra_cflags%': '',
2475 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2476 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2478 # Only used by Windows build for now. Can be used to build into a
2479 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2480 # output files in src/build/VS2010_{Debug,Release}.
2481 'build_dir_prefix%': '',
2483 # Targets are by default not nacl untrusted code.
2484 'nacl_untrusted_build%': 0,
2486 'pnacl_compile_flags': [
2487 # pnacl uses the clang compiler so we need to suppress all the
2488 # same warnings as we do for clang.
2489 # TODO(sbc): Remove these if/when they are removed from the clang
2491 '-Wno-unused-function',
2492 '-Wno-char-subscripts',
2493 '-Wno-c++11-extensions',
2494 '-Wno-unnamed-type-template-args',
2497 # By default, Android targets have their exported JNI symbols stripped,
2498 # so we test the manual JNI registration code paths that are required
2499 # when using the crazy linker. To allow use of native JNI exports (lazily
2500 # resolved by the JVM), targets can enable this variable, which will stop
2501 # the stripping from happening. Only targets which do not need to be
2502 # compatible with the crazy linker are permitted to set this.
2503 'use_native_jni_exports%': 0,
2506 ['OS=="win" and component=="shared_library"', {
2507 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2508 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2509 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2511 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2512 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2513 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2516 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2517 'mac_release_optimization%': 's', # Use -Os unless overridden
2518 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2520 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2521 'mac_release_optimization%': '2', # Use -O2 unless overridden
2522 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2525 'host_os%': '<(host_os)', # See comment above chromium_code.
2528 'clang_warning_flags': [
2531 # Don't die on dtoa code that uses a char as an array index.
2532 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2533 '-Wno-char-subscripts',
2535 # TODO(thakis): This used to be implied by -Wno-unused-function,
2536 # which we no longer use. Check if it makes sense to remove
2537 # this as well. http://crbug.com/316352
2538 '-Wno-unneeded-internal-declaration',
2540 # Warns on switches on enums that cover all enum values but
2541 # also contain a default: branch. Chrome is full of that.
2542 '-Wno-covered-switch-default',
2544 # Warns when a const char[] is converted to bool.
2545 '-Wstring-conversion',
2547 # C++11-related flags:
2549 # This warns on using ints as initializers for floats in
2550 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2551 # which happens in several places in chrome code. Not sure if
2552 # this is worth fixing.
2553 '-Wno-c++11-narrowing',
2555 # Clang considers the `register` keyword as deprecated, but e.g.
2556 # code generated by flex (used in angle) contains that keyword.
2557 # http://crbug.com/255186
2558 '-Wno-deprecated-register',
2560 # TODO(hans): Get this cleaned up.
2561 '-Wno-inconsistent-missing-override',
2564 'includes': [ 'set_clang_warning_flags.gypi', ],
2566 # Don't use deprecated V8 APIs anywhere.
2567 'V8_DEPRECATION_WARNINGS',
2570 '<(SHARED_INTERMEDIATE_DIR)',
2573 ['(OS=="mac" or OS=="ios") and asan==1', {
2575 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2578 ['OS=="win" and asan==1 and component=="shared_library"', {
2580 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2583 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2584 'cflags_cc!': ['-fno-rtti'],
2587 '-gline-tables-only',
2588 '-fintercept-allocation-functions',
2590 'defines': ['TYPE_PROFILING'],
2592 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2595 ['branding=="Chrome"', {
2596 'defines': ['GOOGLE_CHROME_BUILD'],
2597 }, { # else: branding!="Chrome"
2598 'defines': ['CHROMIUM_BUILD'],
2600 ['OS=="mac" and component=="shared_library"', {
2602 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2603 'LD_RUNPATH_SEARCH_PATHS': [
2604 # For unbundled binaries.
2606 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2607 '@loader_path/../../..',
2611 ['(clang==1 or host_clang==1) and OS!="win"', {
2612 # This is here so that all files get recompiled after a clang roll and
2613 # when turning clang on or off.
2614 # (defines are passed via the command line, and build systems rebuild
2615 # things when their commandline changes). Nothing should ever read this
2617 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2620 'defines': ['ENABLE_RLZ'],
2622 ['component=="shared_library"', {
2623 'defines': ['COMPONENT_BUILD'],
2625 ['toolkit_views==1', {
2626 'defines': ['TOOLKIT_VIEWS=1'],
2628 ['ui_compositor_image_transport==1', {
2629 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2632 'defines': ['USE_AURA=1'],
2635 'defines': ['USE_ASH=1'],
2638 'defines': ['USE_PANGO=1'],
2641 'defines': ['USE_CAIRO=1'],
2644 'defines': ['USE_CRAS=1'],
2647 'defines': ['USE_OZONE=1'],
2649 ['use_default_render_theme==1', {
2650 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2652 ['use_libjpeg_turbo==1', {
2653 'defines': ['USE_LIBJPEG_TURBO=1'],
2656 'defines': ['USE_X11=1'],
2658 ['use_clipboard_aurax11==1', {
2659 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2661 ['enable_one_click_signin==1', {
2662 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2664 ['enable_pre_sync_backup==1', {
2665 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2667 ['image_loader_extension==1', {
2668 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2671 'defines': ['ENABLE_PROFILING=1'],
2674 'defines': ['ENABLE_REMOTING=1'],
2676 ['enable_webrtc==1', {
2677 'defines': ['ENABLE_WEBRTC=1'],
2679 ['proprietary_codecs==1', {
2680 'defines': ['USE_PROPRIETARY_CODECS'],
2682 ['enable_mpeg2ts_stream_parser==1', {
2683 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2687 ['enable_viewport==1', {
2688 'defines': ['ENABLE_VIEWPORT'],
2690 ['enable_pepper_cdms==1', {
2691 'defines': ['ENABLE_PEPPER_CDMS'],
2693 ['enable_browser_cdms==1', {
2694 'defines': ['ENABLE_BROWSER_CDMS'],
2696 ['configuration_policy==1', {
2697 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2699 ['notifications==1', {
2700 'defines': ['ENABLE_NOTIFICATIONS'],
2702 ['enable_hidpi==1', {
2703 'defines': ['ENABLE_HIDPI=1'],
2705 ['native_memory_pressure_signals==1', {
2706 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2709 'defines': ['USE_UDEV'],
2713 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2716 ['OS=="win" and fastbuild==2', {
2717 # Completely disable debug information.
2720 'GenerateDebugInformation': 'false',
2722 'VCCLCompilerTool': {
2723 'DebugInformationFormat': '0',
2727 ['OS=="win" and fastbuild==1', {
2730 # This tells the linker to generate .pdbs, so that
2731 # we can get meaningful stack traces.
2732 'GenerateDebugInformation': 'true',
2734 'VCCLCompilerTool': {
2735 # No debug info to be generated by compiler.
2736 'DebugInformationFormat': '0',
2740 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2741 'variables': { 'debug_extra_cflags': '-g0', },
2743 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2744 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2746 'variables': { 'debug_extra_cflags': '-g0', },
2748 # Android builds symbols on release by default, disable them.
2749 ['OS=="android" and fastbuild==2', {
2750 'variables': { 'release_extra_cflags': '-g0', },
2752 ['OS=="android" and fastbuild==1', {
2753 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2755 'variables': { 'release_extra_cflags': '-g0', },
2759 ['dont_embed_build_metadata==1', {
2761 'DONT_EMBED_BUILD_METADATA',
2763 }], # dont_embed_build_metadata==1
2764 ['dcheck_always_on!=0', {
2765 'defines': ['DCHECK_ALWAYS_ON=1'],
2766 }], # dcheck_always_on!=0
2767 ['tracing_like_official_build!=0', {
2768 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2769 }], # tracing_like_official_build!=0
2771 'defines': ['NO_TCMALLOC'],
2773 ['win_use_allocator_shim==1', {
2774 'defines': ['ALLOCATOR_SHIM'],
2780 'ADDRESS_SANITIZER',
2781 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2782 'MEMORY_SANITIZER_INITIAL_SIZE',
2786 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2794 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2795 'MEMORY_SANITIZER_INITIAL_SIZE',
2803 '<(DEPTH)/third_party/kasko/include',
2809 '_CRT_SECURE_NO_DEPRECATE',
2810 '_SCL_SECURE_NO_DEPRECATE',
2811 # This define is required to pull in the new Win8 interfaces from
2812 # system headers like ShObjIdl.h.
2813 'NTDDI_VERSION=0x06030000',
2814 # This is required for ATL to use XP-safe versions of its functions.
2815 '_USING_V110_SDK71_',
2818 '<(DEPTH)/third_party/wtl/include',
2823 # Generates debug info when win_z7=1
2824 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2826 'GenerateDebugInformation': 'true',
2828 'VCCLCompilerTool': {
2829 'DebugInformationFormat': '1',
2835 # This is prohibited when running /analyze.
2836 '_USING_V110_SDK71_',
2839 'VCCLCompilerTool': {
2840 # Set WarnAsError to false to disable this setting for most
2841 # projects so that compilation continues.
2842 'WarnAsError': 'false',
2843 # When win_analyze is specified add the /analyze switch.
2844 # Also add /WX- to force-disable WarnAsError for projects that
2845 # override WarnAsError.
2846 # Also, disable various noisy warnings that have low value.
2847 'AdditionalOptions': [
2850 '/wd6011', # Dereferencing NULL pointer
2851 '/wd6312', # Possible infinite loop: use of the constant
2852 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2853 '/wd6326', # Potential comparison of constant with constant
2854 '/wd28159', # Consider using 'GetTickCount64'
2855 '/wd28204', # Inconsistent SAL annotations
2856 '/wd28251', # Inconsistent SAL annotations
2857 '/wd28252', # Inconsistent SAL annotations
2858 '/wd28253', # Inconsistent SAL annotations
2859 '/wd28196', # The precondition is not satisfied
2860 '/wd28301', # Inconsistent SAL annotations
2861 '/wd6340', # Sign mismatch in function parameter
2862 '/wd28182', # Dereferencing NULL pointer
2863 # C6285 is ~16% of raw warnings and has low value
2864 '/wd6285', # non-zero constant || non-zero constant
2865 # C6334 is ~80% of raw warnings and has low value
2866 '/wd6334', # sizeof applied to an expression with an operator
2878 ['use_playready==1', {
2880 'PLAYREADY_CDM_AVAILABLE',
2885 ['enable_task_manager==1', {
2887 'ENABLE_TASK_MANAGER=1',
2890 ['enable_extensions==1', {
2892 'ENABLE_EXTENSIONS=1',
2895 ['OS=="win" and branding=="Chrome"', {
2896 'defines': ['ENABLE_SWIFTSHADER'],
2898 ['enable_dart==1', {
2899 'defines': ['WEBKIT_USING_DART=1'],
2901 ['enable_plugin_installation==1', {
2902 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2904 ['enable_plugins==1', {
2905 'defines': ['ENABLE_PLUGINS=1'],
2907 ['enable_session_service==1', {
2908 'defines': ['ENABLE_SESSION_SERVICE=1'],
2910 ['enable_themes==1', {
2911 'defines': ['ENABLE_THEMES=1'],
2913 ['enable_autofill_dialog==1', {
2914 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2916 ['enable_prod_wallet_service==1', {
2917 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2919 ['enable_background==1', {
2920 'defines': ['ENABLE_BACKGROUND=1'],
2922 ['enable_google_now==1', {
2923 'defines': ['ENABLE_GOOGLE_NOW=1'],
2925 ['cld_version!=0', {
2926 'defines': ['CLD_VERSION=<(cld_version)'],
2928 ['enable_basic_printing==1 or enable_print_preview==1', {
2929 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2930 'defines': ['ENABLE_PRINTING=1'],
2932 ['enable_basic_printing==1', {
2933 # Enable basic printing support and UI.
2934 'defines': ['ENABLE_BASIC_PRINTING=1'],
2936 ['enable_print_preview==1', {
2937 # Enable printing with print preview.
2938 # Can be defined without ENABLE_BASIC_PRINTING.
2939 'defines': ['ENABLE_PRINT_PREVIEW=1'],
2941 ['enable_spellcheck==1', {
2942 'defines': ['ENABLE_SPELLCHECK=1'],
2944 ['enable_captive_portal_detection==1', {
2945 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2947 ['enable_app_list==1', {
2948 'defines': ['ENABLE_APP_LIST=1'],
2950 ['enable_settings_app==1', {
2951 'defines': ['ENABLE_SETTINGS_APP=1'],
2953 ['disable_file_support==1', {
2954 'defines': ['DISABLE_FILE_SUPPORT=1'],
2956 ['disable_ftp_support==1', {
2957 'defines': ['DISABLE_FTP_SUPPORT=1'],
2959 ['enable_supervised_users==1', {
2960 'defines': ['ENABLE_SUPERVISED_USERS=1'],
2962 ['spdy_proxy_auth_property != ""', {
2963 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2965 ['spdy_proxy_auth_value != ""', {
2966 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2968 ['enable_mdns==1', {
2969 'defines': ['ENABLE_MDNS=1'],
2971 ['enable_service_discovery==1', {
2972 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2974 ['enable_wifi_bootstrapping==1', {
2975 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2977 ['enable_hangout_services_extension==1', {
2978 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2980 ['enable_ipc_fuzzer==1', {
2981 'defines': ['ENABLE_IPC_FUZZER=1'],
2984 'defines': ['VIDEO_HOLE=1'],
2986 ['v8_use_external_startup_data==1', {
2987 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
2989 ], # conditions for 'target_defaults'
2990 'target_conditions': [
2991 ['<(use_libpci)==1', {
2992 'defines': ['USE_LIBPCI=1'],
2994 ['<(use_openssl)==1', {
2995 'defines': ['USE_OPENSSL=1'],
2997 ['<(use_openssl_certs)==1', {
2998 'defines': ['USE_OPENSSL_CERTS=1'],
3000 ['>(nacl_untrusted_build)==1', {
3003 'USE_OPENSSL_CERTS=1',
3006 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3007 'defines': ['USE_GLIB=1'],
3009 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
3010 'defines': ['USE_NSS=1'],
3012 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3013 'defines': ['OS_CHROMEOS=1'],
3015 ['enable_wexit_time_destructors==1 and OS!="win"', {
3016 # TODO: Enable on Windows too, http://crbug.com/404525
3017 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3019 ['chromium_code==0', {
3021 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3022 # We don't want to get warnings from third-party code,
3023 # so remove any existing warning-enabling flags like -Wall.
3029 # Don't warn about hash_map in third-party code.
3033 # Don't warn about printf format problems.
3034 # This is off by default in gcc but on in Ubuntu's gcc(!).
3038 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3042 # TODO: Fix all warnings on chromeos too.
3043 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3048 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3050 # Don't warn about ignoring the return value from e.g. close().
3051 # This is off by default in some gccs but on by default in others.
3052 # BSD systems do not support this option, since they are usually
3053 # using gcc 4.2.1, which does not have this flag yet.
3054 '-Wno-unused-result',
3059 '_CRT_SECURE_NO_DEPRECATE',
3060 '_CRT_NONSTDC_NO_WARNINGS',
3061 '_CRT_NONSTDC_NO_DEPRECATE',
3062 '_SCL_SECURE_NO_DEPRECATE',
3064 'msvs_disabled_warnings': [
3065 # These are variable shadowing warnings that are new in VS2015.
3066 # We should probably work through these at some point for
3067 # non-chromium code, but for now, focus on chromium_code==1 code.
3068 4456, 4457, 4458, 4459,
3073 'VCCLCompilerTool': {
3074 'WarningLevel': '3',
3075 'WarnAsError': 'true',
3076 'Detect64BitPortabilityProblems': 'false',
3080 ['buildtype=="Official"', {
3082 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3085 [ 'component=="shared_library"', {
3086 # TODO(darin): Unfortunately, some third_party code depends on base.
3087 'msvs_disabled_warnings': [
3088 4251, # class 'std::xx' needs to have dll-interface.
3094 [ 'OS=="mac" or OS=="ios"', {
3096 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3099 ['buildtype=="Official"', {
3101 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3108 # TODO(ios): Fix remaining warnings in third-party code, then
3109 # remove this; the Mac cleanup didn't get everything that's
3110 # flagged in an iOS build.
3111 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3112 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3113 # Several internal ios directories generate numerous warnings for
3114 # -Wobjc-missing-property-synthesis.
3115 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3121 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3122 'filename_rules.gypi',
3124 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3125 # C99 macros on Mac and Linux.
3127 '__STDC_CONSTANT_MACROS',
3128 '__STDC_FORMAT_MACROS',
3132 # turn on warnings for signed/unsigned mismatch on chromium code.
3134 'VCCLCompilerTool': {
3135 'AdditionalOptions': ['/we4389'],
3139 ['OS=="win" and component=="shared_library"', {
3140 'msvs_disabled_warnings': [
3141 4251, # class 'std::xx' needs to have dll-interface.
3146 ], # target_conditions for 'target_defaults'
3147 'default_configuration': 'Debug',
3149 # VCLinkerTool LinkIncremental values below:
3151 # 1 == /INCREMENTAL:NO
3153 # Debug links incremental, Release does not.
3155 # Abstract base configurations to cover common attributes.
3159 'msvs_configuration_attributes': {
3160 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3161 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3162 'CharacterSet': '1',
3164 # Add the default import libs.
3167 'AdditionalDependencies': [
3184 'AdditionalOptions': [
3185 # Suggested by Microsoft Devrel to avoid
3186 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3187 # which started happening more regularly after VS2013 Update 4.
3188 # Needs to be a bit lower for VS2015, or else errors out.
3189 '/maxilksize:0x7ff00000',
3198 'MinimumRequiredVersion': '5.01', # XP.
3199 'TargetMachine': '1',
3201 'VCLibrarianTool': {
3202 'TargetMachine': '1',
3205 'msvs_configuration_platform': 'Win32',
3209 'msvs_configuration_platform': 'x64',
3212 # Make sure to understand http://crbug.com/361720 if you want to
3214 'MinimumRequiredVersion': '5.02', # Server 2003.
3215 'TargetMachine': '17', # x86 - 64
3216 'AdditionalLibraryDirectories!':
3217 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3218 'AdditionalLibraryDirectories':
3219 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3220 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3221 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3223 'VCLibrarianTool': {
3224 'AdditionalLibraryDirectories!':
3225 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3226 'AdditionalLibraryDirectories':
3227 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3228 'TargetMachine': '17', # x64
3235 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3236 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3239 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3241 '<@(debug_extra_cflags)',
3245 'VCCLCompilerTool': {
3246 'Optimization': '<(win_debug_Optimization)',
3247 'PreprocessorDefinitions': ['_DEBUG'],
3248 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3249 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3251 # According to MSVS, InlineFunctionExpansion=0 means
3252 # "default inlining", not "/Ob0".
3253 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3254 ['win_debug_InlineFunctionExpansion==0', {
3255 'AdditionalOptions': ['/Ob0'],
3257 ['win_debug_InlineFunctionExpansion!=""', {
3258 'InlineFunctionExpansion':
3259 '<(win_debug_InlineFunctionExpansion)',
3261 ['win_debug_disable_iterator_debugging==1', {
3262 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3265 # if win_debug_OmitFramePointers is blank, leave as default
3266 ['win_debug_OmitFramePointers==1', {
3267 'OmitFramePointers': 'true',
3269 ['win_debug_OmitFramePointers==0', {
3270 'OmitFramePointers': 'false',
3271 # The above is not sufficient (http://crbug.com/106711): it
3272 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3273 # perform FPO regardless, so we must explicitly disable.
3274 # We still want the false setting above to avoid having
3275 # "/Oy /Oy-" and warnings about overriding.
3276 'AdditionalOptions': ['/Oy-'],
3279 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3282 'LinkIncremental': '<(msvs_debug_link_incremental)',
3283 # ASLR makes debugging with windbg difficult because Chrome.exe and
3284 # Chrome.dll share the same base name. As result, windbg will
3285 # name the Chrome.dll module like chrome_<base address>, where
3286 # <base address> typically changes with each launch. This in turn
3287 # means that breakpoints in Chrome.dll don't stick from one launch
3288 # to the next. For this reason, we turn ASLR off in debug builds.
3289 # Note that this is a three-way bool, where 0 means to pick up
3290 # the default setting, 1 is off and 2 is on.
3291 'RandomizedBaseAddress': 1,
3293 'VCResourceCompilerTool': {
3294 'PreprocessorDefinitions': ['_DEBUG'],
3298 ['OS=="linux" or OS=="android"', {
3299 'target_conditions': [
3300 ['_toolset=="target"', {
3302 '<@(debug_extra_cflags)',
3307 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3308 # Enable libstdc++ debugging facilities to help catch problems
3309 # early, see http://crbug.com/65151 .
3310 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3311 'defines': ['_GLIBCXX_DEBUG=1',],
3313 ['release_valgrind_build==0', {
3316 '-fstack-protector-all', # Implies -fstack-protector
3322 # Allow comparing the address of references and 'this' against 0
3323 # in debug builds. Technically, these can never be null in
3324 # well-defined C/C++ and Clang can optimize such checks away in
3325 # release builds, but they may be used in asserts in debug builds.
3326 '-Wno-undefined-bool-conversion',
3327 '-Wno-tautological-undefined-compare',
3331 '-Wno-undefined-bool-conversion',
3332 '-Wno-tautological-undefined-compare',
3336 'VCCLCompilerTool': {
3337 'AdditionalOptions': [
3338 '-Wno-undefined-bool-conversion',
3339 '-Wno-tautological-undefined-compare',
3352 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3353 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3354 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3357 'VCCLCompilerTool': {
3358 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3360 # In official builds, each target will self-select
3361 # an optimization level.
3362 ['buildtype!="Official"', {
3363 'Optimization': '<(win_release_Optimization)',
3366 # According to MSVS, InlineFunctionExpansion=0 means
3367 # "default inlining", not "/Ob0".
3368 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3369 ['win_release_InlineFunctionExpansion==0', {
3370 'AdditionalOptions': ['/Ob0'],
3372 ['win_release_InlineFunctionExpansion!=""', {
3373 'InlineFunctionExpansion':
3374 '<(win_release_InlineFunctionExpansion)',
3377 # if win_release_OmitFramePointers is blank, leave as default
3378 ['win_release_OmitFramePointers==1', {
3379 'OmitFramePointers': 'true',
3381 ['win_release_OmitFramePointers==0', {
3382 'OmitFramePointers': 'false',
3383 # The above is not sufficient (http://crbug.com/106711): it
3384 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3385 # perform FPO regardless, so we must explicitly disable.
3386 # We still want the false setting above to avoid having
3387 # "/Oy /Oy-" and warnings about overriding.
3388 'AdditionalOptions': ['/Oy-'],
3391 # Put data in separate COMDATs. This allows the linker
3392 # to put bit-identical constants at the same address even if
3393 # they're unrelated constants, which saves binary size.
3394 # This optimization can't be used when ASan is enabled because
3395 # it is not compatible with the ASan ODR checker.
3396 'AdditionalOptions': ['/Gw'],
3399 'AdditionalOptions': [
3400 '/d2Zi+', # Improve debugging of Release builds.
3401 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3402 '<@(win_release_extra_cflags)',
3406 # LinkIncremental is a tri-state boolean, where 0 means default
3407 # (i.e., inherit from parent solution), 1 means false, and
3409 'LinkIncremental': '1',
3410 # This corresponds to the /PROFILE flag which ensures the PDB
3411 # file contains FIXUP information (growing the PDB file by about
3412 # 5%) but does not otherwise alter the output binary. This
3413 # information is used by the Syzygy optimization tool when
3414 # decomposing the release image.
3419 ['msvs_use_common_release', {
3420 'includes': ['release.gypi'],
3422 ['release_valgrind_build==0 and tsan==0', {
3425 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3429 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3430 'MEMORY_SANITIZER_INITIAL_SIZE',
3431 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3432 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3436 'defines': ['NO_TCMALLOC'],
3438 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3439 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3440 # It seems to work fine with Ubuntu 12 headers though, so use it
3441 # in official builds.
3442 ['os_posix==1 and (asan!=1 and msan!=1 and tsan!=1 and lsan!=1 and ubsan!=1) and (OS!="linux" or clang!=1 or buildtype=="Official")', {
3443 'target_conditions': [
3444 ['chromium_code==1', {
3445 # Non-chromium code is not guaranteed to compile cleanly
3446 # with _FORTIFY_SOURCE. Also, fortified build may fail
3447 # when optimizations are disabled, so only do that for Release
3450 '_FORTIFY_SOURCE=2',
3455 ['OS=="linux" or OS=="android"', {
3456 'target_conditions': [
3457 ['_toolset=="target"', {
3459 '<@(release_extra_cflags)',
3462 ['enable_resource_whitelist_generation==1', {
3464 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3473 'NS_BLOCK_ASSERTIONS=1',
3479 # Concrete configurations
3482 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3485 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3490 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3491 'target_conditions': [
3492 [ '_type=="executable"', {
3493 # To get a real .dSYM bundle produced by dsymutil, set the
3494 # debug information format to dwarf-with-dsym. Since
3495 # strip_from_xcode will not be used, set Xcode to do the
3496 # stripping as well.
3498 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3499 'DEPLOYMENT_POSTPROCESSING': 'YES',
3500 'STRIP_INSTALLED_PRODUCT': 'YES',
3507 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3509 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3512 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3520 'target_defaults': {
3525 # TODO(glider): enable the default options on other systems.
3527 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3529 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3535 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3536 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3537 'target_defaults': {
3539 '-Wl,--fatal-warnings',
3543 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3544 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
3545 'target_defaults': {
3551 ['os_posix==1 and chromeos==0', {
3552 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3553 # and we want to avoid overriding this, so stack-protector is only
3554 # enabled when not building on Chrome OS.
3555 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3557 'target_defaults': {
3559 '-fstack-protector',
3560 '--param=ssp-buffer-size=4',
3564 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3565 'target_defaults': {
3566 # Enable -Werror by default, but put it in a variable so it can
3567 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3569 'werror%': '-Werror',
3570 'libraries_for_target%': '',
3573 '_FILE_OFFSET_BITS=64',
3576 '<(werror)', # See note above about the werror variable.
3578 '-fno-strict-aliasing', # See http://crbug.com/32204
3580 # Don't warn about unused function params. We use those everywhere.
3581 '-Wno-unused-parameter',
3582 # Don't warn about the "struct foo f = {0};" initialization pattern.
3583 '-Wno-missing-field-initializers',
3584 # Don't export any symbols (for example, to plugins we dlopen()).
3585 # Note: this is *required* to make some plugins work.
3586 '-fvisibility=hidden',
3592 '-fno-threadsafe-statics',
3593 # Make inline functions have hidden visiblity by default.
3594 # Surprisingly, not covered by -fvisibility=hidden.
3595 '-fvisibility-inlines-hidden',
3596 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3597 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3601 '-pthread', '-Wl,-z,noexecstack',
3604 '<(libraries_for_target)',
3609 'debug_optimize%': '0',
3615 '-O>(debug_optimize)',
3620 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3621 # TODO(jdduke) Re-enable on mips after resolving linking
3622 # issues with libc++ (crbug.com/456380).
3624 # Warn in case of text relocations.
3625 '-Wl,--warn-shared-textrel',
3628 ['OS=="android" and android_full_debug==0', {
3629 # Some configurations are copied from Release_Base to reduce
3632 'debug_optimize%': 's',
3636 '-ffunction-sections',
3643 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3644 # We don't omit frame pointers on arm64 since they are required
3645 # to correctly unwind stackframes which contain system library
3646 # function frames (crbug.com/391706).
3648 '-fomit-frame-pointer',
3651 ['OS=="linux" and target_arch=="ia32"', {
3653 '-Wl,--no-as-needed',
3656 ['debug_unwind_tables==1', {
3657 'cflags': ['-funwind-tables'],
3659 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3660 'defines': ['NO_UNWIND_TABLES'],
3662 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3663 # definitions in to the right scope to use them when setting
3664 # linux_use_debug_fission, so it can be used here alone.
3665 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3666 'cflags': ['-gsplit-dwarf'],
3672 'release_optimize%': '2',
3673 # Binaries become big and gold is unable to perform GC
3674 # and remove unused sections for some of test targets
3675 # on 32 bit platform.
3676 # (This is currently observed only in chromeos valgrind bots)
3677 # The following flag is to disable --gc-sections linker
3678 # option for these bots.
3679 'no_gc_sections%': 0,
3681 # TODO(bradnelson): reexamine how this is done if we change the
3682 # expansion of configurations
3683 'release_valgrind_build%': 0,
3686 '-O<(release_optimize)',
3687 # Don't emit the GCC version ident directives, they just end up
3688 # in the .comment section taking up binary size.
3690 # Put data and code in their own sections, so that unused symbols
3691 # can be removed at link time with --gc-sections.
3693 '-ffunction-sections',
3696 # Specifically tell the linker to perform optimizations.
3697 # See http://lwn.net/Articles/192624/ .
3702 ['no_gc_sections==0', {
3704 '-Wl,--gc-sections',
3707 ['OS=="android" and target_arch!="arm64"', {
3708 # We don't omit frame pointers on arm64 since they are required
3709 # to correctly unwind stackframes which contain system library
3710 # function frames (crbug.com/391706).
3712 '-fomit-frame-pointer',
3715 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3716 # TODO(jdduke) Re-enable on mips after resolving linking
3717 # issues with libc++ (crbug.com/456380).
3719 # Warn in case of text relocations.
3720 '-Wl,--warn-shared-textrel',
3725 'release_optimize%': 's',
3730 '-fno-omit-frame-pointer',
3734 ['profiling_full_stack_frames==1', {
3737 '-fno-optimize-sibling-calls',
3742 ['release_unwind_tables==1', {
3743 'cflags': ['-funwind-tables'],
3745 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3746 'defines': ['NO_UNWIND_TABLES'],
3752 ['target_arch=="ia32"', {
3753 'target_conditions': [
3754 ['_toolset=="target"', {
3756 # Needed so that libs with .s files (e.g. libicudata.a)
3757 # are compatible with the general 32-bit-ness.
3760 # All floating-point computations on x87 happens in 80-bit
3761 # precision. Because the C and C++ language standards allow
3762 # the compiler to keep the floating-point values in higher
3763 # precision than what's specified in the source and doing so
3764 # is more efficient than constantly rounding up to 64-bit or
3765 # 32-bit precision as specified in the source, the compiler,
3766 # especially in the optimized mode, tries very hard to keep
3767 # values in x87 floating-point stack (in 80-bit precision)
3768 # as long as possible. This has important side effects, that
3769 # the real value used in computation may change depending on
3770 # how the compiler did the optimization - that is, the value
3771 # kept in 80-bit is different than the value rounded down to
3772 # 64-bit or 32-bit. There are possible compiler options to
3773 # make this behavior consistent (e.g. -ffloat-store would keep
3774 # all floating-values in the memory, thus force them to be
3775 # rounded to its original precision) but they have significant
3776 # runtime performance penalty.
3778 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3779 # which keep floating-point values in SSE registers in its
3780 # native precision (32-bit for single precision, and 64-bit
3781 # for double precision values). This means the floating-point
3782 # value used during computation does not change depending on
3783 # how the compiler optimized the code, since the value is
3784 # always kept in its specified precision.
3786 # Refer to http://crbug.com/348761 for rationale behind SSE2
3787 # being a minimum requirement for 32-bit Linux builds and
3788 # http://crbug.com/313032 for an example where this has "bit"
3793 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3800 # Use gold linker for Android ia32 target.
3806 # Install packages have started cropping up with
3807 # different headers between the 32-bit and 64-bit
3808 # versions, so we have to shadow those differences off
3809 # and make sure a 32-bit-on-64-bit build picks up the
3811 # For android build, use NDK headers instead of host headers
3812 ['host_arch!="ia32" and OS!="android"', {
3821 ['target_arch=="x64"', {
3822 'target_conditions': [
3823 ['_toolset=="target"', {
3825 # Use gold linker for Android x64 target.
3842 ['target_arch=="arm"', {
3843 'target_conditions': [
3844 ['_toolset=="target"', {
3848 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3849 # has changed whenever it encounters a varargs function. This
3850 # silences those warnings, as they are not helpful and
3851 # clutter legitimate warnings.
3855 ['clang==1 and arm_arch!="" and OS!="android"', {
3857 '-target arm-linux-gnueabihf',
3860 '-target arm-linux-gnueabihf',
3865 '-march=<(arm_arch)',
3868 ['use_lto==1 or use_lto_o2==1', {
3870 '-march=<(arm_arch)',
3875 ['clang==1 and OS!="android"', {
3877 # We need to disable clang's builtin assembler as it can't
3878 # handle several asm files, crbug.com/124610
3879 '-no-integrated-as',
3884 '-mtune=<(arm_tune)',
3887 ['use_lto==1 or use_lto_o2==1', {
3889 '-mtune=<(arm_tune)',
3899 ['use_lto==1 or use_lto_o2==1', {
3906 ['arm_float_abi!=""', {
3908 '-mfloat-abi=<(arm_float_abi)',
3911 ['use_lto==1 or use_lto_o2==1', {
3913 '-mfloat-abi=<(arm_float_abi)',
3923 ['use_lto==1 or use_lto_o2==1', {
3931 # Most of the following flags are derived from what Android
3932 # uses by default when building for arm, reference for which
3933 # can be found in the following file in the Android NDK:
3934 # toolchains/arm-linux-androideabi-4.9/setup.mk
3936 # The tree-sra optimization (scalar replacement for
3937 # aggregates enabling subsequent optimizations) leads to
3938 # invalid code generation when using the Android NDK's
3939 # compiler (r5-r7). This can be verified using
3940 # webkit_unit_tests' WTF.Checked_int8_t test.
3942 # The following option is disabled to improve binary
3943 # size and performance in gcc 4.9.
3944 '-fno-caller-saves',
3947 # Android now supports .relro sections properly.
3948 # NOTE: While these flags enable the generation of .relro
3949 # sections, the generated libraries can still be loaded on
3950 # older Android platform versions.
3957 ['gcc_version==48 and clang==0', {
3959 # The following 5 options are disabled to save on
3960 # binary size in GCC 4.8.
3961 '-fno-partial-inlining',
3962 '-fno-early-inlining',
3963 '-fno-tree-copy-prop',
3964 '-fno-tree-loop-optimize',
3965 '-fno-move-loop-invariants',
3969 'cflags': [ '-mthumb-interwork' ],
3973 # Thumb code with frame pointer makes chrome crash
3976 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3977 # The perf report sometimes incorrectly attributes
3978 # code from tail calls.
3979 '-fno-optimize-sibling-calls',
3982 '-fomit-frame-pointer',
3987 # Clang does not support the following options.
3989 '-mthumb-interwork',
3990 '-finline-limit=64',
3992 '-fno-caller-saves',
3996 # TODO(hans) Enable integrated-as (crbug.com/124610).
3997 '-no-integrated-as',
3998 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4001 # Let clang find the ld.gold in the NDK.
4002 '--gcc-toolchain=<(android_toolchain)/..',
4007 '-marm', # Required for frame pointer based stack traces.
4014 # We set arm_arch to "" so that -march compiler option
4015 # is not set. Otherwise a gcc bug that would complain
4016 # about it conflicting with '-mcpu=cortex-a9'. The flag
4017 # '-march=armv7-a' is actually redundant anyway because
4018 # it is enabled by default when we built the toolchain.
4019 # And using '-mcpu=cortex-a9' should be sufficient.
4022 # Breakpad requires symbols with debugging information
4026 # We want to statically link libstdc++/libgcc_s.
4027 '-static-libstdc++',
4031 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4032 # define their own cflags for arm builds that could
4033 # conflict with the flags we set here (e.g.
4034 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4043 ['target_arch=="arm64"', {
4044 'target_conditions': [
4045 ['_toolset=="target"', {
4049 '-fstack-protector', # stack protector is always enabled on arm64.
4059 ['target_arch=="mipsel"', {
4060 'target_conditions': [
4061 ['_toolset=="target"', {
4063 ['mips_arch_variant=="r6"', {
4066 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ],
4067 'ldflags': [ '-target mipsel-linux-gnu', ],
4069 'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
4071 ['clang==0 and OS=="android"', {
4072 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4076 ['mips_arch_variant=="r2"', {
4078 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4079 'cflags': ['-m<(mips_fpu_mode)'],
4084 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
4085 'ldflags': [ '-target mipsel-linux-android', ],
4089 'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
4093 ['mips_arch_variant=="r1"', {
4098 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
4099 'ldflags': [ '-target mipsel-linux-android', ],
4103 'cflags': ['-mips32', '-Wa,-mips32', ],
4109 # Clang does not support the following options.
4110 '-finline-limit=64',
4113 # TODO(gordanac) Enable integrated-as.
4114 '-no-integrated-as',
4115 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4118 # Let clang find the ld in the NDK.
4119 '--gcc-toolchain=<(android_toolchain)/..',
4122 ['mips_dsp_rev==1', {
4123 'cflags': ['-mdsp'],
4125 ['mips_dsp_rev==2', {
4126 'cflags': ['-mdspr2'],
4130 '-m<(mips_float_abi)-float'
4133 '-Wl,--no-keep-memory'
4136 '-Wno-uninitialized',
4141 ['target_arch=="mips64el"', {
4142 'target_conditions': [
4143 ['_toolset=="target"', {
4145 ['mips_arch_variant=="r6"', {
4146 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4147 'ldflags': ['-mips64r6'],
4149 ['mips_arch_variant=="r2"', {
4150 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4151 'ldflags': ['-mips64r2'],
4155 '-Wno-uninitialized',
4169 'target_conditions': [
4170 ['_toolset=="target"', {
4172 '--sysroot=<(sysroot)',
4175 '--sysroot=<(sysroot)',
4176 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4182 # TODO(thakis): Remove, http://crbug.com/263960
4183 '-Wno-reserved-user-defined-literal',
4186 # gnu++11 instead of c++11 is needed because some code uses
4187 # typeof() (a GNU extension).
4188 # TODO(thakis): Eventually switch this to c++11 instead,
4189 # http://crbug.com/427584
4193 ['clang==0 and host_clang==1', {
4194 'target_conditions': [
4195 ['_toolset=="host"', {
4196 'cflags_cc': [ '-std=gnu++11', ],
4200 ['clang==1 and clang_use_chrome_plugins==1', {
4202 '<@(clang_chrome_plugins_flags)',
4205 ['clang==1 and clang_load!=""', {
4207 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4210 ['clang==1 and clang_add_plugin!=""', {
4212 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4215 ['clang==1 and target_arch=="ia32"', {
4217 # Else building libyuv gives clang's register allocator issues,
4218 # see llvm.org/PR15798 / crbug.com/233709
4219 '-momit-leaf-frame-pointer',
4220 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4221 '-mstack-alignment=16',
4225 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4227 # See http://crbug.com/110262
4228 '-fcolor-diagnostics',
4231 # Common options for AddressSanitizer, LeakSanitizer,
4232 # ThreadSanitizer and MemorySanitizer.
4233 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4234 'target_conditions': [
4235 ['_toolset=="target"', {
4237 '-fno-omit-frame-pointer',
4238 '-gline-tables-only',
4241 '-fomit-frame-pointer',
4246 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4247 'target_conditions': [
4248 ['_toolset=="target"', {
4250 # Functions interposed by the sanitizers can make ld think
4251 # that some libraries aren't needed when they actually are,
4252 # http://crbug.com/234010. As workaround, disable --as-needed.
4256 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4257 'MEMORY_SANITIZER_INITIAL_SIZE',
4263 'target_conditions': [
4264 ['_toolset=="target"', {
4266 '-fsanitize=address',
4267 # TODO(earthdok): Re-enable. http://crbug.com/427202
4268 #'-fsanitize-blacklist=<(asan_blacklist)',
4271 '-fsanitize=address',
4278 '-mllvm -asan-globals=0', # http://crbug.com/352073
4284 'target_conditions': [
4285 ['_toolset=="target"', {
4287 '-fsanitize=undefined',
4288 '-fsanitize-blacklist=<(ubsan_blacklist)',
4289 # Employ the experimental PBQP register allocator to avoid
4290 # slow compilation on files with too many basic blocks.
4291 # See http://crbug.com/426271.
4292 '-mllvm -regalloc=pbqp',
4293 # Speculatively use coalescing to slightly improve the code
4294 # generated by PBQP regallocator. May increase compile time.
4295 '-mllvm -pbqp-coalescing',
4304 '-fsanitize=undefined',
4307 'UNDEFINED_SANITIZER',
4313 'target_conditions': [
4314 ['_toolset=="target"', {
4317 '-fsanitize-blacklist=<(ubsan_blacklist)',
4329 'UNDEFINED_SANITIZER',
4334 ['asan_coverage!=0 and sanitizer_coverage==0', {
4335 'target_conditions': [
4336 ['_toolset=="target"', {
4338 '-fsanitize-coverage=<(asan_coverage)',
4341 'SANITIZER_COVERAGE',
4346 ['sanitizer_coverage!=0', {
4347 'target_conditions': [
4348 ['_toolset=="target"', {
4350 '-fsanitize-coverage=<(sanitizer_coverage)',
4353 'SANITIZER_COVERAGE',
4358 ['asan_field_padding!=0', {
4359 'target_conditions': [
4360 ['_toolset=="target"', {
4362 '-fsanitize-address-field-padding=<(asan_field_padding)',
4368 'target_conditions': [
4369 ['_toolset=="target"', {
4378 'WTF_USE_LEAK_SANITIZER=1',
4384 'target_conditions': [
4385 ['_toolset=="target"', {
4387 '-fsanitize=thread',
4388 '-fsanitize-blacklist=<(tsan_blacklist)',
4391 '-fsanitize=thread',
4395 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4396 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4402 'target_conditions': [
4403 ['_toolset=="target"', {
4405 '-fsanitize=memory',
4406 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4407 '-fsanitize-blacklist=<(msan_blacklist)',
4410 '-fsanitize=memory',
4418 ['use_instrumented_libraries==1', {
4420 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4423 ['use_prebuilt_instrumented_libraries==1', {
4425 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
4428 ['use_custom_libcxx==1', {
4430 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4433 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4434 'target_conditions' : [
4435 # crazy_linker has an upstream gyp file we can't edit, and we
4436 # don't want to instrument it.
4437 ['_toolset=="target" and _target_name!="crazy_linker"', {
4439 '-finstrument-functions',
4440 # Allow mmx intrinsics to inline, so that the
4441 #0 compiler can expand the intrinsics.
4442 '-finstrument-functions-exclude-file-list=mmintrin.h',
4445 ['_toolset=="target" and OS=="android"', {
4447 # Avoids errors with current NDK:
4448 # "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"
4449 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4454 ['linux_dump_symbols==1', {
4457 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4458 'target_conditions': [
4459 ['_toolset=="target"', {
4461 # Attempt to use less memory to prevent the linker from
4462 # running out of address space. Considering installing a
4463 # 64-bit kernel and switching to a 64-bit linker.
4464 '-Wl,--no-keep-memory',
4471 ['use_allocator!="tcmalloc"', {
4472 'defines': ['NO_TCMALLOC'],
4474 ['linux_use_gold_flags==1', {
4475 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4477 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4478 'ldflags': [ '-fuse-ld=gold', ],
4480 'target_conditions': [
4481 ['_toolset=="target"', {
4483 # Experimentation found that using four linking threads
4484 # saved ~20% of link time.
4485 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4486 # Only apply this to the target linker, since the host
4487 # linker might not be gold, but isn't used much anyway.
4488 # TODO(raymes): Disable threading because gold is frequently
4489 # crashing on the bots: crbug.com/161942.
4491 # '-Wl,--thread-count=4',
4494 # TODO(thestig): Enable this for disabled cases.
4495 [ 'buildtype!="Official" and chromeos==0 and release_valgrind_build==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
4497 '-Wl,--detect-odr-violations',
4504 ['release_valgrind_build==0 and order_profiling==0', {
4505 'target_conditions': [
4506 ['_toolset=="target"', {
4508 '-Wl,--icf=<(gold_icf_level)',
4515 ['linux_use_bundled_binutils==1', {
4517 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4520 ['linux_use_bundled_gold==1', {
4521 # Put our binutils, which contains gold in the search path. We pass
4522 # the path to gold to the compiler. gyp leaves unspecified what the
4523 # cwd is when running the compiler, so the normal gyp path-munging
4524 # fails us. This hack gets the right path.
4526 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4529 # Some binutils 2.23 releases may or may not have new dtags enabled,
4530 # but they are all compatible with --disable-new-dtags,
4531 # because the new dynamic tags are not created by default.
4532 ['binutils_version>=223', {
4533 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4534 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4535 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4536 # inside this file to allow usage of --no-as-needed and removal of
4539 '-Wl,--disable-new-dtags',
4542 ['gcc_version>=47 and clang==0', {
4543 'target_conditions': [
4544 ['_toolset=="target"', {
4547 # See comment for -Wno-c++11-narrowing.
4549 # TODO(thakis): Remove, http://crbug.com/263960
4550 '-Wno-literal-suffix',
4555 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4556 'target_conditions': [
4557 ['_toolset=="host"', {
4560 # See comment for -Wno-c++11-narrowing.
4562 # TODO(thakis): Remove, http://crbug.com/263960
4563 '-Wno-literal-suffix',
4571 # FreeBSD-specific options; note that most FreeBSD options are set above,
4574 'target_defaults': {
4576 '-Wl,--no-keep-memory',
4580 # Android-specific options; note that most are set above with Linux.
4583 # This is a unique identifier for a given build. It's used for
4584 # identifying various build artifacts corresponding to a particular
4585 # build of chrome (e.g. where to find archived symbols).
4586 'chrome_build_id%': '',
4588 # Figure this out early since it needs symbols from libgcc.a, so it
4589 # has to be before that in the set of libraries.
4590 ['component=="shared_library"', {
4591 'android_stlport_library': 'stlport_shared',
4593 'android_stlport_library': 'stlport_static',
4597 # Placing this variable here prevents from forking libvpx, used
4598 # by remoting. Remoting is off, so it needn't built,
4599 # so forking it's deps seems like overkill.
4600 # But this variable need defined to properly run gyp.
4601 # A proper solution is to have an OS==android conditional
4602 # in third_party/libvpx/libvpx.gyp to define it.
4603 'libvpx_path': 'lib/linux/arm',
4605 'target_defaults': {
4607 'release_extra_cflags%': '',
4609 # If we're using the components build, append "cr" to all shared
4610 # libraries to avoid naming collisions with android system library
4611 # versions with the same name (e.g. skia, icu).
4612 ['component=="shared_library"', {
4613 'android_product_extension': 'cr.so',
4615 'android_product_extension': 'so',
4619 'target_conditions': [
4620 ['_type=="shared_library"', {
4621 'product_extension': '<(android_product_extension)',
4624 # Settings for building device targets using Android's toolchain.
4625 # These are based on the setup.mk file from the Android NDK.
4627 # The NDK Android executable link step looks as follows:
4629 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4630 # $(PRIVATE_OBJECTS) <-- The .o that we built
4631 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4632 # $(TARGET_LIBGCC) <-- libgcc.a
4633 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4634 # $(PRIVATE_LDLIBS) <-- System .so
4635 # $(TARGET_CRTEND_O) <-- crtend.o
4637 # For now the above are approximated for executables by adding
4638 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4641 # The NDK Android shared library link step looks as follows:
4643 # $(PRIVATE_OBJECTS) <-- The .o that we built
4644 # -l,--whole-archive
4645 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4646 # -l,--no-whole-archive
4647 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4648 # $(TARGET_LIBGCC) <-- libgcc.a
4649 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4650 # $(PRIVATE_LDLIBS) <-- System .so
4652 # For now, assume that whole static libraries are not needed.
4654 # For both executables and shared libraries, add the proper
4655 # libgcc.a to the start of libraries which puts it in the
4656 # proper spot after .o and .a files get linked in.
4658 # TODO: The proper thing to do longer-tem would be proper gyp
4659 # support for a custom link command line.
4660 ['_toolset=="target"', {
4662 '-pthread', # Not supported by Android toolchain.
4665 '-ffunction-sections',
4668 '-fstack-protector',
4670 '-finline-limit=64',
4671 '-Wa,--noexecstack',
4672 '<@(release_extra_cflags)',
4673 '--sysroot=<(android_ndk_sysroot)',
4674 # NOTE: The stlport header include paths below are specified in
4675 # cflags rather than include_dirs because they need to come
4676 # after include_dirs.
4677 # The include ordering here is important; change with caution.
4678 '-isystem<(android_stlport_include)',
4682 '__GNU_SOURCE=1', # Necessary for clone()
4684 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4685 'CHROME_BUILD_ID="<(chrome_build_id)"',
4686 # The NDK has these things, but doesn't define the constants
4687 # to say that it does. Define them here instead.
4691 '-pthread', # Not supported by Android toolchain.
4694 '-Wl,--no-undefined',
4695 '--sysroot=<(android_ndk_sysroot)',
4697 '-L<(android_stlport_libs_dir)',
4698 # Don't allow visible symbols from libgcc or stlport to be
4700 '-Wl,--exclude-libs=libgcc.a',
4701 '-Wl,--exclude-libs=libstlport_static.a',
4702 # Don't allow visible symbols from libraries that contain
4703 # assembly code with symbols that aren't hidden properly.
4704 # http://crbug.com/448386
4705 '-Wl,--exclude-libs=libcommon_audio.a',
4706 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4707 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4708 '-Wl,--exclude-libs=libiSACFix.a',
4709 '-Wl,--exclude-libs=libisac_neon.a',
4710 '-Wl,--exclude-libs=libopus.a',
4711 '-Wl,--exclude-libs=libvpx.a',
4714 '-l<(android_stlport_library)',
4715 # Manually link the libgcc.a that the cross compiler uses.
4716 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4722 ['component=="static_library"', {
4723 'target_conditions': [
4724 ['use_native_jni_exports==0', {
4725 # Use a linker version script to strip JNI exports from
4726 # binaries which have not specifically asked to use them.
4728 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4735 # Work around incompatibilities between bionic and clang
4737 '-D__compiler_offsetof=__builtin_offsetof',
4738 '-Dnan=__builtin_nan',
4741 ['target_arch=="arm"', {
4743 '-target arm-linux-androideabi',
4746 '-target arm-linux-androideabi',
4749 ['target_arch=="ia32"', {
4751 '-target x86-linux-androideabi',
4754 '-target x86-linux-androideabi',
4757 # Place holder for x64 support, not tested.
4758 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4759 ['target_arch=="x64"', {
4761 '-target x86_64-linux-androideabi',
4764 '-target x86_64-linux-androideabi',
4771 # Android build relies on -Wl,--gc-sections removing
4772 # unreachable code. ASan instrumentation for globals inhibits
4773 # this and results in a library with unresolvable relocations.
4774 # TODO(eugenis): find a way to reenable this.
4775 '-mllvm -asan-globals=0',
4778 ['target_arch == "arm" and order_profiling==0', {
4780 # Enable identical code folding to reduce size.
4781 '-Wl,--icf=<(gold_icf_level)',
4784 ['target_arch=="ia32"', {
4785 # The x86 toolchain currently has problems with stack-protector.
4787 '-fstack-protector',
4790 '-fno-stack-protector',
4794 'target_conditions': [
4795 ['_type=="executable"', {
4796 # Force android tools to export the "main" symbol so they can be
4797 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4798 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4799 # when ICS support will be dropped.
4802 '-fvisibility=default',
4806 '-Wl,--gc-sections',
4807 '-Wl,-z,nocopyreloc',
4810 # crtbegin_dynamic.o should be the last item in ldflags.
4811 '<(android_ndk_lib)/crtbegin_dynamic.o',
4814 # crtend_android.o needs to be the last item in libraries.
4815 # Do not add any libraries after this!
4816 '<(android_ndk_lib)/crtend_android.o',
4819 ['_type=="shared_library" or _type=="loadable_module"', {
4821 '-Wl,-shared,-Bsymbolic',
4822 # crtbegin_so.o should be the last item in ldflags.
4823 '<(android_ndk_lib)/crtbegin_so.o',
4826 # crtend_so.o needs to be the last item in libraries.
4827 # Do not add any libraries after this!
4828 '<(android_ndk_lib)/crtend_so.o',
4833 # Settings for building host targets using the system toolchain.
4834 ['_toolset=="host"', {
4836 # Due to issues in Clang build system, using ASan on 32-bit
4837 # binaries on x86_64 host is problematic.
4838 # TODO(eugenis): re-enable.
4839 '-fsanitize=address',
4842 '-fsanitize=address',
4843 '-Wl,-z,noexecstack',
4844 '-Wl,--gc-sections',
4847 '-Wl,--warn-shared-textrel',
4848 '-Wl,--fatal-warnings',
4851 # Settings for building host targets on mac.
4852 ['_toolset=="host" and host_os=="mac"', {
4862 'cflags!': ['-fvisibility=hidden'],
4863 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4865 ['OS=="mac" or OS=="ios"', {
4866 'target_defaults': {
4869 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4870 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4871 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4872 'COPY_PHASE_STRIP': 'NO',
4873 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4874 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4875 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4876 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4877 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4878 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4879 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4880 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4881 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4882 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4883 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4884 'GCC_VERSION': '4.2',
4885 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4886 'USE_HEADERMAP': 'NO',
4891 # Don't warn about unused function parameters.
4892 '-Wno-unused-parameter',
4893 # Don't warn about the "struct foo f = {0};" initialization
4895 '-Wno-missing-field-initializers',
4898 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4899 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4901 # Note that the prebuilt Clang binaries should not be used for iOS
4902 # development except for ASan builds.
4904 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
4905 # Warn if automatic synthesis is triggered with
4906 # the -Wobjc-missing-property-synthesis flag.
4907 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4908 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4910 # This warns on selectors from Cocoa headers (-length, -set).
4911 # cfe-dev is currently discussing the merits of this warning.
4912 # TODO(thakis): Reevaluate what to do with this, based one
4913 # cfe-dev discussion.
4914 '-Wno-selector-type-mismatch',
4917 ['clang_xcode==0', {
4918 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4919 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4923 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4925 '<@(clang_chrome_plugins_flags)',
4928 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4930 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4933 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4935 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4938 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4940 # See http://crbug.com/110262
4941 '-fcolor-diagnostics',
4944 ['OS=="ios" and target_subarch!="arm32" and \
4945 "<(GENERATOR)"=="xcode"', {
4947 # TODO(ios): when building Chrome for iOS on 64-bit platform
4948 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4949 # enabled. This cause failures when compiling protobuf code,
4950 # so disable the warning. http://crbug.com/359107
4951 '-Wno-shorten-64-to-32',
4959 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4965 '-fsanitize=address',
4966 '-mllvm -asan-globals=0', # http://crbug.com/352073
4967 '-gline-tables-only',
4971 ['asan_coverage!=0 and sanitizer_coverage==0', {
4972 'target_conditions': [
4973 ['_toolset=="target"', {
4975 '-fsanitize-coverage=<(asan_coverage)',
4978 'SANITIZER_COVERAGE',
4983 ['sanitizer_coverage!=0', {
4984 'target_conditions': [
4985 ['_toolset=="target"', {
4987 '-fsanitize-coverage=<(sanitizer_coverage)',
4990 'SANITIZER_COVERAGE',
4996 'target_conditions': [
4997 ['_type!="static_library"', {
4998 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5003 '-fsanitize=address',
5007 ['mac_write_linker_maps==1', {
5010 '-Wl,-map,>(_target_name).map',
5017 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5018 'target_conditions': [
5019 ['_type=="executable"', {
5025 # Define copy_asan_dylib_path in a variable ending in
5026 # _path so that gyp understands it's a path and
5027 # performs proper relativization during dict merging.
5028 'copy_asan_dylib_path':
5029 'mac/copy_asan_runtime_dylib.sh',
5031 'postbuild_name': 'Copy ASan runtime dylib',
5033 '<(copy_asan_dylib_path)',
5042 ], # target_conditions
5043 }, # target_defaults
5044 }], # OS=="mac" or OS=="ios"
5046 'target_defaults': {
5048 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5049 # with common names, like 'check', 'require', and 'verify'.
5050 # (Included by system header. Also exists on iOS but not included.)
5051 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5052 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5055 # These should end with %, but there seems to be a bug with % in
5056 # variables that are intended to be set to different values in
5057 # different targets, like these.
5058 'mac_pie': 1, # Most executables can be position-independent.
5059 # Strip debugging symbols from the target.
5060 'mac_strip': '<(mac_strip_release)',
5064 ['mac_want_real_dsym=="default"', {
5067 'mac_real_dsym': '<(mac_want_real_dsym)'
5072 ['mac_want_real_dsym=="default"', {
5073 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5075 'mac_real_dsym': '<(mac_want_real_dsym)'
5082 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5083 # (Equivalent to -fPIC)
5084 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5085 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5086 # Keep pch files below xcodebuild/.
5087 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5089 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5090 # xcode_setting, but not until all downstream projects' mac bots are
5091 # using xcode >= 4.6, because that's when the default value of the
5092 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5093 # setting is a no-op as far as xcode is concerned, but the compiler
5094 # behaves differently based on whether -fno-strict-aliasing is
5096 '-fno-strict-aliasing', # See http://crbug.com/32204.
5099 'target_conditions': [
5100 ['_type=="executable"', {
5103 # Arranges for data (heap) pages to be protected against
5104 # code execution when running on Mac OS X 10.7 ("Lion"), and
5105 # ensures that the position-independent executable (PIE) bit
5106 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5108 # Define change_mach_o_flags in a variable ending in _path
5109 # so that GYP understands it's a path and performs proper
5110 # relativization during dict merging.
5111 'change_mach_o_flags_path':
5112 'mac/change_mach_o_flags_from_xcode.sh',
5113 'change_mach_o_flags_options%': [
5115 'target_conditions': [
5116 ['mac_pie==0 or release_valgrind_build==1', {
5117 # Don't enable PIE if it's unwanted. It's unwanted if
5118 # the target specifies mac_pie=0 or if building for
5119 # Valgrind, because Valgrind doesn't understand slide.
5120 # See the similar mac_pie/release_valgrind_build check
5122 'change_mach_o_flags_options': [
5128 'postbuild_name': 'Change Mach-O Flags',
5130 '<(change_mach_o_flags_path)',
5131 '>@(change_mach_o_flags_options)',
5135 'target_conditions': [
5136 ['mac_pie==1 and release_valgrind_build==0', {
5137 # Turn on position-independence (ASLR) for executables. When
5138 # PIE is on for the Chrome executables, the framework will
5139 # also be subject to ASLR.
5140 # Don't do this when building for Valgrind, because Valgrind
5141 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5142 # understand slide, and get rid of the Valgrind check.
5145 '-Wl,-pie', # Position-independent executable (MH_PIE)
5151 ['(_type=="executable" or _type=="shared_library" or \
5152 _type=="loadable_module") and mac_strip!=0', {
5153 'target_conditions': [
5154 ['mac_real_dsym == 1', {
5155 # To get a real .dSYM bundle produced by dsymutil, set the
5156 # debug information format to dwarf-with-dsym. Since
5157 # strip_from_xcode will not be used, set Xcode to do the
5158 # stripping as well.
5162 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5163 'DEPLOYMENT_POSTPROCESSING': 'YES',
5164 'STRIP_INSTALLED_PRODUCT': 'YES',
5166 # Only strip non-ASan builds.
5168 'target_conditions': [
5169 ['_type=="shared_library" or _type=="loadable_module"', {
5170 # The Xcode default is to strip debugging symbols
5171 # only (-S). Local symbols should be stripped as
5172 # well, which will be handled by -x. Xcode will
5173 # continue to insert -S when stripping even when
5174 # additional flags are added with STRIPFLAGS.
5176 }], # _type=="shared_library" or _type=="loadable_module"
5177 ], # target_conditions
5183 }, # configuration "Release"
5185 }, { # mac_real_dsym != 1
5186 # To get a fast fake .dSYM bundle, use a post-build step to
5187 # produce the .dSYM and strip the executable. strip_from_xcode
5188 # only operates in the Release configuration.
5192 # Define strip_from_xcode in a variable ending in _path
5193 # so that gyp understands it's a path and performs proper
5194 # relativization during dict merging.
5195 'strip_from_xcode_path': 'mac/strip_from_xcode',
5197 'postbuild_name': 'Strip If Needed',
5198 'action': ['<(strip_from_xcode_path)'],
5202 ], # target_conditions
5203 }], # (_type=="executable" or _type=="shared_library" or
5204 # _type=="loadable_module") and mac_strip!=0
5205 ], # target_conditions
5206 }, # target_defaults
5210 'ios/coverage.gypi',
5212 'target_defaults': {
5213 'xcode_settings' : {
5214 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5217 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5218 # additional flag to suppress the "unknown compiler option" error.
5219 # Restrict this flag to builds that are either compiling with Xcode
5220 # or compiling with Xcode's Clang. This will allow Ninja builds to
5221 # continue failing on unknown compiler options.
5222 # TODO(rohitrao): This flag is temporary and should be removed as
5223 # soon as the iOS bots are updated to use Xcode 5.1.
5224 ['clang_xcode==1', {
5226 '-Wno-unknown-warning-option',
5230 # Limit the valid architectures depending on "target_subarch".
5231 # This need to include the "arm" architectures but also the "x86"
5232 # ones (they are used when building for the simulator).
5233 ['target_subarch=="arm32"', {
5234 'VALID_ARCHS': ['armv7', 'i386'],
5236 ['target_subarch=="arm64"', {
5237 'VALID_ARCHS': ['arm64', 'x86_64'],
5239 ['target_subarch=="both"', {
5240 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5242 ['use_system_libcxx==1', {
5243 'target_conditions': [
5244 # Only use libc++ when building target for iOS not when building
5245 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5246 # does not support libc++.
5247 ['_toolset=="target"', {
5248 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5252 # The default for deployment target of 7.0+ is libc++, so force
5253 # the old behavior unless libc++ is enabled.
5254 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5258 'target_conditions': [
5259 ['_toolset=="host"', {
5261 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5262 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5271 ['_toolset=="target"', {
5273 # This section should be for overriding host settings. But,
5274 # since we can't negate the iphone deployment target above, we
5275 # instead set it here for target only.
5276 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5277 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5280 ['_type=="executable"', {
5284 'DEPLOYMENT_POSTPROCESSING': 'YES',
5285 'STRIP_INSTALLED_PRODUCT': 'YES',
5290 # Remove dSYM to reduce build time.
5291 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5297 ['chromium_ios_signing', {
5298 # iOS SDK wants everything for device signed.
5299 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5301 'CODE_SIGNING_REQUIRED': 'NO',
5302 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5307 ], # target_conditions
5308 }, # target_defaults
5311 'target_defaults': {
5313 '_WIN32_WINNT=0x0603',
5320 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5321 'WIN32_LEAN_AND_MEAN',
5324 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5325 '_HAS_EXCEPTIONS=0',
5326 # Silence some warnings; we can't switch the the 'recommended'
5327 # versions as they're not available on old OSs.
5328 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5331 ['buildtype=="Official"', {
5332 # In official builds, targets can self-select an optimization
5333 # level by defining a variable named 'optimize', and setting it
5335 # - "size", optimizes for minimal code size - the default.
5336 # - "speed", optimizes for speed over code size.
5337 # - "max", whole program optimization and link-time code
5338 # generation. This is very expensive and should be used
5341 'optimize%': 'size',
5345 # Set /LTCG for the official builds.
5346 'LinkTimeCodeGeneration': '1',
5347 'AdditionalOptions': [
5348 # Set the number of LTCG code-gen threads to eight.
5349 # The default is four. This gives a 5-10% link speedup.
5354 'target_conditions': [
5355 ['optimize=="size"', {
5357 'VCCLCompilerTool': {
5358 # 1, optimizeMinSpace, Minimize Size (/O1)
5359 'Optimization': '1',
5360 # 2, favorSize - Favor small code (/Os)
5361 'FavorSizeOrSpeed': '2',
5366 ['optimize=="speed"', {
5368 'VCCLCompilerTool': {
5369 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5370 'Optimization': '2',
5371 # 1, favorSpeed - Favor fast code (/Ot)
5372 'FavorSizeOrSpeed': '1',
5377 ['optimize=="max"', {
5378 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5379 # builds. Probably anything that this would catch that
5380 # wouldn't be caught in a normal build isn't going to
5381 # actually be a bug, so the incremental value of C4702 for
5382 # PGO builds is likely very small.
5383 'msvs_disabled_warnings': [
5387 'VCCLCompilerTool': {
5388 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5389 'Optimization': '2',
5390 # 1, favorSpeed - Favor fast code (/Ot)
5391 'FavorSizeOrSpeed': '1',
5392 # This implies link time code generation.
5393 'WholeProgramOptimization': 'true',
5401 ['msvs_xtree_patched!=1', {
5402 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5403 # it's enabled. This will generally only be true for system-level
5404 # installed Express users.
5405 'msvs_disabled_warnings': [
5410 'msvs_system_include_dirs': [
5411 '<(windows_sdk_path)/Include/shared',
5412 '<(windows_sdk_path)/Include/um',
5413 '<(windows_sdk_path)/Include/winrt',
5414 '$(VSInstallDir)/VC/atlmfc/include',
5416 'msvs_cygwin_shell': 0,
5417 'msvs_disabled_warnings': [
5418 # C4091: 'typedef ': ignored on left of 'X' when no variable is
5420 # This happens in a number of Windows headers. Dumb.
5423 # C4127: conditional expression is constant
5424 # This warning can in theory catch dead code and other problems, but
5425 # triggers in far too many desirable cases where the conditional
5426 # expression is either set by macros or corresponds some legitimate
5427 # compile-time constant expression (due to constant template args,
5428 # conditionals comparing the sizes of different types, etc.). Some of
5429 # these can be worked around, but it's not worth it.
5432 # C4351: new behavior: elements of array 'array' will be default
5434 # This is a silly "warning" that basically just alerts you that the
5435 # compiler is going to actually follow the language spec like it's
5436 # supposed to, instead of not following it like old buggy versions
5437 # did. There's absolutely no reason to turn this on.
5440 # C4355: 'this': used in base member initializer list
5441 # It's commonly useful to pass |this| to objects in a class'
5442 # initializer list. While this warning can catch real bugs, most of
5443 # the time the constructors in question don't attempt to call methods
5444 # on the passed-in pointer (until later), and annotating every legit
5445 # usage of this is simply more hassle than the warning is worth.
5448 # C4503: 'identifier': decorated name length exceeded, name was
5450 # This only means that some long error messages might have truncated
5451 # identifiers in the presence of lots of templates. It has no effect
5452 # on program correctness and there's no real reason to waste time
5453 # trying to prevent it.
5456 # C4611: interaction between 'function' and C++ object destruction is
5458 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5459 # suggests using exceptions instead of setjmp/longjmp for C++, but
5460 # Chromium code compiles without exception support. We therefore have
5461 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5462 # means we have to turn off this warning (and be careful about how
5463 # object destruction happens in such cases).
5466 # TODO(maruel): These warnings are level 4. They will be slowly
5467 # removed as code is fixed.
5468 4100, # Unreferenced formal parameter
5469 4121, # Alignment of a member was sensitive to packing
5470 4244, # Conversion from 'type1' to 'type2', possible loss of data
5471 4481, # Nonstandard extension used: override specifier 'keyword'
5472 4505, # Unreferenced local function has been removed
5473 4510, # Default constructor could not be generated
5474 4512, # Assignment operator could not be generated
5475 4610, # Object can never be instantiated
5476 4996, # 'X': was declared deprecated (for GetVersionEx).
5479 'VCCLCompilerTool': {
5480 'AdditionalOptions': ['/MP'],
5481 'MinimalRebuild': 'false',
5482 'BufferSecurityCheck': 'true',
5483 'EnableFunctionLevelLinking': 'true',
5484 'RuntimeTypeInfo': 'false',
5485 'WarningLevel': '4',
5486 'WarnAsError': 'true',
5487 'DebugInformationFormat': '3',
5488 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5489 'ExceptionHandling': '0',
5491 'VCLibrarianTool': {
5492 'AdditionalOptions': ['/ignore:4221'],
5493 'AdditionalLibraryDirectories': [
5494 '<(windows_sdk_path)/Lib/win8/um/x86',
5498 'AdditionalDependencies': [
5510 'AdditionalLibraryDirectories': [
5511 '<(windows_sdk_path)/Lib/win8/um/x86',
5513 'GenerateDebugInformation': 'true',
5514 'MapFileName': '$(OutDir)\\$(TargetName).map',
5515 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5516 'FixedBaseAddress': '1',
5519 # 1 == /SUBSYSTEM:CONSOLE
5520 # 2 == /SUBSYSTEM:WINDOWS
5521 # Most of the executables we'll ever create are tests
5522 # and utilities with console output.
5526 'GenerateStublessProxies': 'true',
5527 'TypeLibraryName': '$(InputName).tlb',
5528 'OutputDirectory': '$(IntDir)',
5529 'HeaderFileName': '$(InputName).h',
5530 'DLLDataFileName': '$(InputName).dlldata.c',
5531 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5532 'ProxyFileName': '$(InputName)_p.c',
5534 'VCResourceCompilerTool': {
5536 'AdditionalIncludeDirectories': [
5538 '<(SHARED_INTERMEDIATE_DIR)',
5541 'target_conditions': [
5542 ['_type=="executable"', {
5544 'EmbedManifest': 'true',
5547 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5549 'AdditionalManifestFiles': [
5550 '>(win_exe_compatibility_manifest)',
5556 # Building with Clang on Windows is a work in progress and very
5557 # experimental. See crbug.com/82385.
5559 'VCCLCompilerTool': {
5560 'AdditionalOptions': [
5561 '-fmsc-version=1800',
5563 # Many files use intrinsics without including this header.
5564 # TODO(hans): Fix those files, or move this to sub-GYPs.
5567 # TODO(hans): Make this list shorter eventually.
5568 '-Qunused-arguments',
5569 '-Wno-c++11-compat-deprecated-writable-strings',
5570 '-Wno-deprecated-declarations',
5572 '-Wno-enum-conversion',
5573 '-Wno-extra-tokens',
5574 '-Wno-ignored-attributes',
5575 '-Wno-incompatible-pointer-types',
5576 '-Wno-int-to-void-pointer-cast',
5577 '-Wno-invalid-noreturn',
5578 '-Wno-logical-op-parentheses',
5580 '-Wno-missing-braces',
5581 '-Wno-missing-declarations',
5582 '-Wno-msvc-include',
5583 '-Wno-null-dereference',
5584 '-Wno-overloaded-virtual',
5586 '-Wno-pointer-sign',
5588 '-Wno-return-type-c-linkage',
5590 '-Wno-sometimes-uninitialized',
5592 '-Wno-tautological-compare',
5593 '-Wno-unknown-pragmas',
5595 '-Wno-unused-function',
5596 '-Wno-unused-private-field',
5597 '-Wno-unused-value',
5598 '-Wno-unused-variable',
5599 '-Wno-unused-local-typedef', # http://crbug.com/411648
5600 '-Wno-inconsistent-missing-override', #http://crbug.com/428099
5604 ['clang==1 and target_arch=="ia32"', {
5605 'VCCLCompilerTool': {
5606 'WarnAsError': 'false',
5607 'AdditionalOptions': [
5616 ['disable_nacl==1', {
5617 'target_defaults': {
5623 ['OS=="win" and msvs_use_common_linker_extras', {
5624 'target_defaults': {
5639 'AdditionalOptions': [
5650 'AdditionalOptions': ['/largeaddressaware'],
5654 # TODO(asan/win): Move this down into the general
5655 # win-target_defaults section once the 64-bit asan runtime
5656 # exists. See crbug.com/345874.
5657 'VCCLCompilerTool': {
5658 'AdditionalOptions': [
5659 '-fsanitize=address',
5660 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5662 'AdditionalIncludeDirectories': [
5663 # MSVC needs to be able to find the sanitizer headers when
5664 # invoked via /fallback. This is critical for using macros
5665 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5667 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/include_sanitizer',
5671 'AdditionalLibraryDirectories': [
5672 # TODO(hans): If make_clang_dir is absolute, this breaks.
5673 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/lib/windows',
5676 'target_conditions': [
5677 ['component=="shared_library"', {
5679 'AdditionalDependencies': [
5680 'clang_rt.asan_dynamic-i386.lib',
5681 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5685 ['_type=="executable" and component=="static_library"', {
5687 'AdditionalDependencies': [
5688 'clang_rt.asan-i386.lib',
5692 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5694 'AdditionalDependencies': [
5695 'clang_rt.asan_dll_thunk-i386.lib',
5707 'AdditionalOptions': [
5708 # safeseh is not compatible with x64
5720 ['enable_new_npdevice_api==1', {
5721 'target_defaults': {
5723 'ENABLE_NEW_NPDEVICE_API',
5727 # Don't warn about the "typedef 'foo' locally defined but not used"
5728 # for gcc 4.8 and higher.
5729 # TODO: remove this flag once all builds work. See crbug.com/227506
5730 ['gcc_version>=48 and clang==0', {
5731 'target_defaults': {
5733 '-Wno-unused-local-typedefs',
5737 ['gcc_version>=48 and clang==0 and host_clang==1', {
5738 'target_defaults': {
5739 'target_conditions': [
5740 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5744 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5746 'make_global_settings': [
5747 ['CC', '<(make_clang_dir)/bin/clang'],
5748 ['CXX', '<(make_clang_dir)/bin/clang++'],
5749 ['CC.host', '$(CC)'],
5750 ['CXX.host', '$(CXX)'],
5753 ['clang==1 and OS=="win"', {
5754 'make_global_settings': [
5755 # On Windows, gyp's ninja generator only looks at CC.
5756 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5759 ['use_lld==1 and OS=="win"', {
5760 'make_global_settings': [
5761 # Limited to Windows because lld-link is the driver that is compatible
5763 ['LD', '<(make_clang_dir)/bin/lld-link'],
5766 ['OS=="android" and clang==0', {
5767 # Hardcode the compiler names in the Makefile so that
5768 # it won't depend on the environment at make time.
5769 'make_global_settings': [
5770 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5771 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5772 ['CC.host', '<(host_cc)'],
5773 ['CXX.host', '<(host_cxx)'],
5776 ['OS=="linux" and target_arch=="mipsel"', {
5777 'make_global_settings': [
5778 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5779 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5780 ['CC.host', '<(host_cc)'],
5781 ['CXX.host', '<(host_cxx)'],
5784 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5785 # Set default ARM cross compiling on linux. These can be overridden
5786 # using CC/CXX/etc environment variables.
5787 'make_global_settings': [
5788 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5789 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5790 ['CC.host', '<(host_cc)'],
5791 ['CXX.host', '<(host_cxx)'],
5795 # TODO(yyanagisawa): supports GENERATOR==make
5796 # make generator doesn't support CC_wrapper without CC
5797 # in make_global_settings yet.
5798 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5799 'make_global_settings': [
5800 ['CC_wrapper', '<(gomadir)/gomacc'],
5801 ['CXX_wrapper', '<(gomadir)/gomacc'],
5802 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5803 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5807 'target_defaults': {
5808 'target_conditions': [
5809 ['_toolset=="target"', {
5817 ['use_lto==1 and clang==0', {
5818 'target_defaults': {
5819 'target_conditions': [
5820 ['_toolset=="target"', {
5822 '-ffat-lto-objects',
5828 ['use_lto==1 and clang==1', {
5829 'target_defaults': {
5830 'target_conditions': [
5831 ['_toolset=="target"', {
5833 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
5839 # Apply a lower LTO optimization level in non-official builds.
5840 ['use_lto==1 and clang==1 and buildtype!="Official"', {
5841 'target_defaults': {
5842 'target_conditions': [
5843 ['_toolset=="target"', {
5845 '-Wl,--plugin-opt,O1',
5848 ['_toolset=="target" and _type!="static_library"', {
5858 ['use_lto==1 and clang==1 and (target_arch=="ia32" or target_arch=="x64")', {
5859 'target_defaults': {
5860 'target_conditions': [
5861 # Required for third_party/zlib/crc_folding.c and various other code
5862 # that uses SSE. TODO(pcc): Remove this once we properly support
5863 # subtarget specific code generation in LLVM.
5864 ['_toolset=="target"', {
5866 '-Wl,-plugin-opt,mcpu=corei7-avx',
5869 ['_toolset=="target" and _type!="static_library"', {
5872 '-Wl,-mcpu,corei7-avx',
5879 ['use_lto==1 and clang==1 and target_arch=="arm"', {
5880 'target_defaults': {
5881 'target_conditions': [
5882 ['_toolset=="target"', {
5883 # Without this flag, LTO produces a .text section that is larger
5884 # than the maximum call displacement, preventing the linker from
5885 # relocating calls (http://llvm.org/PR22999).
5887 '-Wl,-plugin-opt,-function-sections',
5893 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
5894 'target_defaults': {
5895 'target_conditions': [
5896 ['_toolset=="target"', {
5904 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
5905 'target_defaults': {
5906 'target_conditions': [
5907 ['_toolset=="target"', {
5916 'target_defaults': {
5917 'target_conditions': [
5918 ['_toolset=="target"', {
5920 '-fsanitize=cfi-vptr',
5923 '-fsanitize=cfi-vptr',
5927 '-fsanitize=cfi-vptr',
5931 ['_toolset=="target" and _type!="static_library"', {
5934 '-fsanitize=cfi-vptr',
5941 ['cfi_derived_cast==1', {
5942 'target_defaults': {
5943 'target_conditions': [
5944 ['_toolset=="target"', {
5946 '-fsanitize=cfi-derived-cast',
5949 '-fsanitize=cfi-derived-cast',
5953 '-fsanitize=cfi-derived-cast',
5957 ['_toolset=="target" and _type!="static_library"', {
5960 '-fsanitize=cfi-derived-cast',
5967 ['cfi_unrelated_cast==1', {
5968 'target_defaults': {
5969 'target_conditions': [
5970 ['_toolset=="target"', {
5972 '-fsanitize=cfi-unrelated-cast',
5975 '-fsanitize=cfi-unrelated-cast',
5979 '-fsanitize=cfi-unrelated-cast',
5983 ['_toolset=="target" and _type!="static_library"', {
5986 '-fsanitize=cfi-unrelated-cast',
5993 ['cfi_vptr==1 or cfi_derived_cast==1 or cfi_unrelated_cast==1', {
5994 'target_defaults': {
5995 'target_conditions': [
5996 ['_toolset=="target"', {
5998 '-fsanitize-blacklist=<(cfi_blacklist)',
6002 '-fsanitize-blacklist=<(cfi_blacklist)',
6011 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
6012 # This block adds *project-wide* configuration settings to each project
6013 # file. It's almost always wrong to put things here. Specify your
6014 # custom xcode_settings in target_defaults to add them to targets instead.
6017 # In an Xcode Project Info window, the "Base SDK for All Configurations"
6018 # setting sets the SDK on a project-wide basis. In order to get the
6019 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
6020 # here at the project level.
6023 ['mac_sdk_path==""', {
6024 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
6026 'SDKROOT': '<(mac_sdk_path)', # -isysroot
6032 ['ios_sdk_path==""', {
6034 # TODO(justincohen): Ninja only supports simulator for now.
6035 ['"<(GENERATOR)"=="xcode"', {
6036 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6038 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
6042 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6047 # Target both iPhone and iPad.
6048 'TARGETED_DEVICE_FAMILY': '1,2',
6051 ['target_arch=="x64"', {
6056 ['target_arch=="ia32"', {
6065 # The Xcode generator will look for an xcode_settings section at the root
6066 # of each dict and use it to apply settings on a file-wide basis. Most
6067 # settings should not be here, they should be in target-specific
6068 # xcode_settings sections, or better yet, should use non-Xcode-specific
6069 # settings in target dicts. SYMROOT is a special case, because many other
6070 # Xcode variables depend on it, including variables such as
6071 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6072 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6073 # files to appear (when present) in the UI as actual files and not red
6074 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6075 # and therefore SYMROOT, needs to be set at the project level.
6076 'SYMROOT': '<(DEPTH)/xcodebuild',