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 # This is set when building the Android WebView inside the Android
159 # build system, using the 'android' gyp backend. The WebView code is
160 # still built when this is unset, but builds using the normal chromium
162 'android_webview_build%': 0,
164 # Set ARM architecture version.
167 # Use aurax11 for clipboard implementation. This is true on linux_aura.
168 'use_clipboard_aurax11%': 0,
172 # If no gomadir is set, it uses the default gomadir.
176 # The system root for cross-compiles. Default: none.
180 # The system libdir used for this ABI.
181 'system_libdir%': 'lib',
183 # Default MIPS arch variant. This is set in the conditions block
184 # below for MIPS targets.
185 'mips_arch_variant%': '',
187 # MIPS DSP ASE revision. Possible values are:
199 # Set default value of toolkit_views based on OS.
200 ['OS=="win" or chromeos==1 or use_aura==1', {
206 # Embedded builds use aura without ash or views.
213 # Enable HiDPI on Mac OS, Chrome OS and Windows.
214 ['OS=="mac" or chromeos==1 or OS=="win"', {
218 # Enable the OpenSSL backend on Mac OS and Windows.
219 ['OS=="mac" or OS=="win"', {
223 # Enable App Launcher everywhere but mobile.
224 ['OS!="ios" and OS!="android"', {
225 'enable_app_list%': 1,
227 'enable_app_list%': 0,
230 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
231 'use_default_render_theme%': 1,
233 'use_default_render_theme%': 0,
237 'use_ozone_evdev%': 1,
239 'use_ozone_evdev%': 0,
242 # Set default gomadir.
244 'gomadir': 'c:\\goma\\goma-win',
246 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
249 # Set the default "target_subarch" on iOS. Valid values are "arm32",
250 # "arm64" and "both" (meaning a fat binary).
252 # TODO(sdefresne): change the default from "arm32" to "both" for
253 # "target_subarch" once http://crbug.com/339477 is fixed.
255 # TODO(sdefresne): set the "target_arch" to "arm" once compilation
256 # of skia has been fixed for simulator. http://crbug.com/342377
258 'target_subarch%': 'arm32',
261 # Set arch variants for MIPS platforms.
262 ['target_arch=="mips64el"', {
265 'mips_arch_variant%': 'r6',
267 'mips_arch_variant%': 'r2',
272 ['target_arch=="mipsel"', {
273 'mips_arch_variant%': 'r1',
278 # Copy conditionally-set variables out one scope.
279 'chromeos%': '<(chromeos)',
280 'chromecast%': '<(chromecast)',
281 'host_arch%': '<(host_arch)',
282 'target_arch%': '<(target_arch)',
283 'target_subarch%': '<(target_subarch)',
284 'mips_arch_variant%': '<(mips_arch_variant)',
285 'mips_dsp_rev%': '<(mips_dsp_rev)',
286 'toolkit_views%': '<(toolkit_views)',
287 'desktop_linux%': '<(desktop_linux)',
288 'use_aura%': '<(use_aura)',
289 'use_ash%': '<(use_ash)',
290 'use_cras%': '<(use_cras)',
291 'use_libpci%': '<(use_libpci)',
292 'use_ozone%': '<(use_ozone)',
293 'use_ozone_evdev%': '<(use_ozone_evdev)',
294 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
295 'embedded%': '<(embedded)',
296 'use_openssl%': '<(use_openssl)',
297 'use_openssl_certs%': '<(use_openssl_certs)',
298 'enable_viewport%': '<(enable_viewport)',
299 'enable_hidpi%': '<(enable_hidpi)',
300 'android_channel%': '<(android_channel)',
301 'android_webview_build%': '<(android_webview_build)',
302 'use_goma%': '<(use_goma)',
303 'gomadir%': '<(gomadir)',
304 'enable_app_list%': '<(enable_app_list)',
305 'use_default_render_theme%': '<(use_default_render_theme)',
306 'buildtype%': '<(buildtype)',
307 'branding%': '<(branding)',
308 'arm_version%': '<(arm_version)',
309 'sysroot%': '<(sysroot)',
310 'chroot_cmd%': '<(chroot_cmd)',
311 'system_libdir%': '<(system_libdir)',
313 # Set to 1 to enable fast builds. Set to 2 for even faster builds
314 # (it disables debug info for fastest compilation - only for use
315 # on compile-only bots).
318 # Set to 1 to not store any build metadata, e.g. ifdef out all __DATE__
319 # and __TIME__. Set to 0 to reenable the use of these macros in the code
320 # base. See http://crbug.com/314403.
321 'dont_embed_build_metadata%': 1,
323 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
324 # This is useful for parallel compilation tools which can't support /Zi.
325 # Only used on Windows.
328 # Set to 1 to enable dcheck in Release build.
329 'dcheck_always_on%': 0,
331 # Set to 1 to make a build that disables unshipped tracing events.
332 # Note: this setting is ignored if buildtype=="Official".
333 'tracing_like_official_build%': 0,
335 # Disable image loader component extension by default.
336 'image_loader_extension%': 0,
338 # Set NEON compilation flags.
341 # Detect NEON support at run-time.
342 'arm_neon_optional%': 0,
344 # Use libjpeg-turbo as the JPEG codec used by Chromium.
345 'use_libjpeg_turbo%': 1,
347 # Use system libjpeg. Note that the system's libjepg will be used even if
348 # use_libjpeg_turbo is set.
349 'use_system_libjpeg%': 0,
351 # By default, component is set to static_library and it can be overriden
352 # by the GYP command line or by ~/.gyp/include.gypi.
353 'component%': 'static_library',
355 # /analyze is off by default on Windows because it is very slow and noisy.
356 # Enable with GYP_DEFINES=win_analyze=1
359 # Set to select the Title Case versions of strings in GRD files.
360 'use_titlecase_in_grd%': 0,
362 # Use translations provided by volunteers at launchpad.net. This
363 # currently only works on Linux.
364 'use_third_party_translations%': 0,
366 # Remoting compilation is enabled by default. Set to 0 to disable.
369 # Configuration policy is enabled by default. Set to 0 to disable.
370 'configuration_policy%': 1,
372 # Variable safe_browsing is used to control the build time configuration
373 # for safe browsing feature. Safe browsing can be compiled in 3 different
374 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
375 # reporting features without enabling phishing and malware detection. This
376 # is useful to integrate a third party phishing/malware detection to
377 # existing safe browsing logic.
380 # Web speech is enabled by default. Set to 0 to disable.
381 'enable_web_speech%': 1,
383 # Notifications are compiled in by default. Set to 0 to disable.
384 'notifications%' : 1,
386 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
387 # regular builds and 1 for ASan builds.
388 'mac_want_real_dsym%': 'default',
390 # If this is set, the clang plugins used on the buildbot will be used.
391 # Run tools/clang/scripts/update.sh to make sure they are compiled.
392 # This causes 'clang_chrome_plugins_flags' to be set.
393 # Has no effect if 'clang' is not set as well.
394 'clang_use_chrome_plugins%': 1,
396 # Enable building with ASAN (Clang's -fsanitize=address option).
397 # -fsanitize=address only works with clang, but asan=1 implies clang=1
398 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
400 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
401 # Enable coverage gathering instrumentation in sanitizer tools. This flag
402 # also controls coverage granularity (1 for function-level coverage, 2
403 # for block-level coverage).
404 'sanitizer_coverage%': 0,
405 # Deprecated, only works if |sanitizer_coverage| isn't set.
406 # TODO(glider): remove this flag.
408 # Enable intra-object-overflow detection in ASan (experimental).
409 'asan_field_padding%': 0,
411 # Enable Chromium overrides of the default configurations for various
412 # dynamic tools (like ASan).
413 'use_sanitizer_options%': 0,
415 # Enable building with SyzyAsan.
416 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
419 # Enable building with LSan (Clang's -fsanitize=leak option).
420 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
421 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
424 # Enable building with TSan (Clang's -fsanitize=thread option).
425 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
426 # See http://clang.llvm.org/docs/ThreadSanitizer.html
428 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
430 # Enable building with MSan (Clang's -fsanitize=memory option).
431 # MemorySanitizer only works with clang, but msan=1 implies clang=1
432 # See http://clang.llvm.org/docs/MemorySanitizer.html
434 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
435 # Track where uninitialized memory originates from. From fastest to
436 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
437 # - track the chain of stores leading from allocation site to use site.
438 'msan_track_origins%': 1,
440 # Enable building with UBSan (Clang's -fsanitize=undefined option).
441 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
442 # See http://clang.llvm.org/docs/UsersManual.html
444 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
446 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
447 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
450 # Use the dynamic libraries instrumented by one of the sanitizers
451 # instead of the standard system libraries.
452 'use_instrumented_libraries%': 0,
454 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
455 # stdlibc++ as standard library. This is intended to use for instrumented
457 'use_custom_libcxx%': 0,
459 # Use system libc++ instead of the default C++ library, usually libstdc++.
460 # This is intended for iOS builds only.
461 'use_system_libcxx%': 0,
463 # Use a modified version of Clang to intercept allocated types and sizes
464 # for allocated objects. clang_type_profiler=1 implies clang=1.
465 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
466 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
467 'clang_type_profiler%': 0,
469 # Set to true to instrument the code with function call logger.
470 # See src/third_party/cygprofile/cyg-profile.cc for details.
471 'order_profiling%': 0,
473 # Use the provided profiled order file to link Chrome image with it.
474 # This makes Chrome faster by better using CPU cache when executing code.
475 # This is known as PGO (profile guided optimization).
476 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
477 'order_text_section%' : "",
479 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
480 # libraries on linux x86-64 and arm, plus ASLR.
483 # Whether one-click signin is enabled or not.
484 'enable_one_click_signin%': 0,
486 # Whether to back up data before sync.
487 'enable_pre_sync_backup%': 0,
489 # Enable Chrome browser extensions
490 'enable_extensions%': 1,
493 'enable_google_now%': 1,
495 # Enable basic printing support and UI.
496 'enable_basic_printing%': 1,
498 # Enable printing with print preview. It does not imply
499 # enable_basic_printing. It's possible to build Chrome with preview only.
500 'enable_print_preview%': 1,
502 # Set the version of CLD.
503 # 0: Don't specify the version. This option is for the Finch testing.
508 # For CLD2, the size of the tables that should be included in the build
509 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
511 # See third_party/cld_2/cld_2.gyp for more information.
512 # 0: Small tables, lower accuracy
513 # 2: Large tables, high accuracy
514 'cld2_table_size%': 2,
516 # Enable spell checker.
517 'enable_spellcheck%': 1,
519 # Webrtc compilation is enabled by default. Set to 0 to disable.
522 # Media router support is enabled by default. Set to 0 to disable.
523 'enable_media_router%': 1,
525 # Enables use of the session service, which is enabled by default.
526 # Support for disabling depends on the platform.
527 'enable_session_service%': 1,
529 # Enables theme support, which is enabled by default. Support for
530 # disabling depends on the platform.
533 # Enables autofill dialog and associated features; disabled by default.
534 'enable_autofill_dialog%' : 0,
536 # Defaults Wallet integration in Autofill dialog to use production
537 # servers. Unofficial builds won't have the proper API keys.
538 'enable_prod_wallet_service%': 0,
540 # Enables support for background apps.
541 'enable_background%': 1,
543 # Enable the task manager by default.
544 'enable_task_manager%': 1,
546 # Enables used resource whitelist generation; disabled by default.
547 'enable_resource_whitelist_generation%': 0,
549 # Enable FILE support by default.
550 'disable_file_support%': 0,
552 # Enable FTP support by default.
553 'disable_ftp_support%': 0,
555 # Use native android functions in place of ICU. Not supported by most
557 'use_icu_alternatives_on_android%': 0,
559 # Use of precompiled headers on Windows.
561 # This variable may be explicitly set to 1 (enabled) or 0
562 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
563 # This setting will override the default.
566 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
568 'chromium_win_pch%': 0,
571 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
572 # Set this to true when building with Clang.
573 # See http://code.google.com/p/chromium/wiki/Clang for details.
574 # If this is set, clang is used as both host and target compiler in
575 # cross-compile builds.
578 # Use experimental lld linker instead of the platform's default linker.
581 # Enable plug-in installation by default.
582 'enable_plugin_installation%': 1,
584 # Specifies whether to use canvas_skia.cc in place of platform
585 # specific implementations of gfx::Canvas. Affects text drawing in the
587 # TODO(asvitkine): Enable this on all platforms and delete this flag.
588 # http://crbug.com/105550
589 'use_canvas_skia%': 0,
591 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
592 # with one of those tools.
593 'build_for_tool%': '',
595 # If no directory is specified then a temporary directory will be used.
596 'test_isolation_outdir%': '',
598 'wix_path%': '<(DEPTH)/third_party/wix',
600 # Supervised users are enabled by default.
601 'enable_supervised_users%': 1,
603 # Platform natively supports discardable memory.
604 'native_discardable_memory%': 0,
606 # Platform sends memory pressure signals natively.
607 'native_memory_pressure_signals%': 0,
609 'spdy_proxy_auth_property%' : '',
610 'spdy_proxy_auth_value%' : '',
612 'enable_service_discovery%': 0,
613 'enable_wifi_bootstrapping%': 0,
614 'enable_hangout_services_extension%': 0,
616 # Enable the Syzygy optimization step.
617 'syzygy_optimize%': 0,
619 # Enable hole punching for the protected video.
622 # Automatically select platforms under ozone. Turn this off to
623 # build only explicitly selected platforms.
624 'ozone_auto_platforms%': 1,
626 # If this is set clang is used as host compiler, but not as target
627 # compiler. Always do this by default.
630 # Variables to control Link-Time Optimizations (LTO).
631 # Note: the variables must *not* be enabled at the same time.
632 # In this case LTO would 'merge' the optimization flags
633 # at link-time which would lead to all code be optimized with -O2.
634 # Enable LTO on the code compiled with -Os.
635 # See crbug.com/407544
637 # Enable LTO on code compiled with -O2.
640 # Allowed level of identical code folding in the gold linker.
641 'gold_icf_level%': 'safe',
643 # Libxkbcommon usage.
647 # A flag for POSIX platforms
654 # A flag for BSD platforms
655 ['OS=="freebsd" or OS=="openbsd"', {
662 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
668 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
669 # OpenSSL's certificate definition.
670 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
671 'use_openssl_certs%': 1,
673 'use_openssl_certs%': 0,
676 # libudev usage. This currently only affects the content layer.
677 ['OS=="linux" and embedded==0', {
683 # Flags to use X11 on non-Mac POSIX platforms.
684 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
691 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
697 # Flags to use pango and cairo.
698 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
707 ['OS=="linux" and embedded==0', {
713 # We always use skia text rendering in Aura on Windows, since GDI
714 # doesn't agree with our BackingStore.
715 # TODO(beng): remove once skia text rendering is on by default.
716 ['use_aura==1 and OS=="win"', {
717 'enable_skia_text%': 1,
720 # A flag to enable or disable our compile-time dependency
721 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
722 # support will be available. This option is useful
723 # for Linux distributions and for Aura.
724 ['OS!="linux" or chromeos==1', {
725 'use_gnome_keyring%': 0,
727 'use_gnome_keyring%': 1,
730 ['OS=="mac" or OS=="ios"', {
731 # Mac and iOS want Title Case strings
732 'use_titlecase_in_grd%': 1,
735 # Enable loader extensions on Chrome OS.
737 'image_loader_extension%': 1,
739 'image_loader_extension%': 0,
742 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
743 'enable_one_click_signin%': 1,
744 'enable_pre_sync_backup%': 1,
748 'enable_extensions%': 0,
749 'enable_google_now%': 0,
751 'enable_spellcheck%': 0,
755 'arm_neon_optional%': 1,
756 'native_discardable_memory%': 1,
757 'native_memory_pressure_signals%': 1,
758 'enable_basic_printing%': 1,
759 'enable_print_preview%': 0,
760 'enable_task_manager%':0,
764 # Android OS includes support for proprietary codecs regardless of
765 # building Chromium or Google Chrome. We also ship Google Chrome and
766 # Chromecast with proprietary codecs.
767 ['OS=="android" or branding=="Chrome" or chromecast==1', {
768 'proprietary_codecs%': 1,
770 'proprietary_codecs%': 0,
773 ['OS=="mac" or OS=="ios"', {
774 'native_discardable_memory%': 1,
775 'native_memory_pressure_signals%': 1,
778 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
779 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
780 'enable_autofill_dialog%': 1,
783 ['buildtype=="Official"', {
784 'enable_prod_wallet_service%': 1,
794 'disable_ftp_support%': 1,
795 'enable_extensions%': 0,
796 'enable_google_now%': 0,
798 'cld2_table_size%': 0,
799 'enable_basic_printing%': 0,
800 'enable_print_preview%': 0,
801 'enable_session_service%': 0,
802 'enable_spellcheck%': 0,
808 'enable_supervised_users%': 0,
809 'enable_task_manager%': 0,
810 'use_system_libcxx%': 1,
811 'support_pre_M6_history_database%': 0,
814 # Use GPU accelerated cross process image transport by default
815 # on linux builds with the Aura window manager
816 ['use_aura==1 and OS=="linux"', {
817 'ui_compositor_image_transport%': 1,
819 'ui_compositor_image_transport%': 0,
822 # Turn precompiled headers on by default.
823 ['OS=="win" and buildtype!="Official"', {
824 'chromium_win_pch%': 1
827 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
828 'enable_plugin_installation%': 0,
830 'enable_plugin_installation%': 1,
833 # Whether PPAPI is enabled.
834 ['OS=="android" or OS=="ios" or embedded==1', {
835 'enable_plugins%': 0,
837 'enable_plugins%': 1,
840 # linux_use_bundled_gold: whether to use the gold linker binary checked
841 # into third_party/binutils. Force this off via GYP_DEFINES when you
842 # are using a custom toolchain and need to control -B in ldflags.
843 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
844 # for component=static_library builds.
845 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
846 'linux_use_bundled_gold%': 1,
848 'linux_use_bundled_gold%': 0,
851 # linux_use_bundled_binutils: whether to use the binary binutils
852 # checked into third_party/binutils. These are not multi-arch so cannot
853 # be used except on x86 and x86-64 (the only two architectures which
854 # are currently checke in). Force this off via GYP_DEFINES when you
855 # are using a custom toolchain and need to control -B in cflags.
856 ['OS=="linux" and (target_arch=="x64")', {
857 'linux_use_bundled_binutils%': 1,
859 'linux_use_bundled_binutils%': 0,
862 # linux_use_gold_flags: whether to use build flags that rely on gold.
863 # On by default for x64 Linux.
864 ['OS=="linux" and target_arch=="x64"', {
865 'linux_use_gold_flags%': 1,
867 'linux_use_gold_flags%': 0,
870 # linux_use_debug_fission: whether to use split DWARF debug info
871 # files. This can reduce link time significantly, but is incompatible
872 # with some utilities such as icecc and ccache. Requires gold and
873 # gcc >= 4.8 or clang.
874 # http://gcc.gnu.org/wiki/DebugFission
875 ['OS=="linux" and target_arch=="x64"', {
876 'linux_use_debug_fission%': 1,
878 'linux_use_debug_fission%': 0,
881 ['OS=="android" or OS=="ios"', {
882 'enable_captive_portal_detection%': 0,
883 'enable_media_router%': 0,
885 'enable_captive_portal_detection%': 1,
886 'enable_media_router%': 1,
889 # Enable Skia UI text drawing incrementally on different platforms.
890 # http://crbug.com/105550
892 # On Aura, this allows per-tile painting to be used in the browser
895 'use_canvas_skia%': 1,
899 'enable_basic_printing%': 0,
900 'enable_print_preview%': 1,
901 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
902 'use_libjpeg_turbo%': 0,
905 # Do not enable the Settings App on ChromeOS.
906 ['enable_app_list==1 and chromeos==0', {
907 'enable_settings_app%': 1,
909 'enable_settings_app%': 0,
912 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
913 # Set some defaults for arm/linux chrome builds
914 'use_allocator%': 'none',
915 # sysroot needs to be an absolute path otherwise it generates
916 # incorrect results when passed to pkg-config
917 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot',
918 }], # OS=="linux" and target_arch=="arm" and chromeos==0
920 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
922 ['target_arch=="x64"', {
923 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
925 ['target_arch=="ia32"', {
926 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
929 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
931 ['OS=="linux" and target_arch=="mipsel"', {
932 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
933 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
936 # Whether tests targets should be run, archived or just have the
937 # dependencies verified. All the tests targets have the '_run' suffix,
938 # e.g. base_unittests_run runs the target base_unittests. The test
939 # target always calls tools/swarming_client/isolate.py. See the script's
940 # --help for more information. Meant to be overriden with GYP_DEFINES.
941 # TODO(maruel): Remove the conditions as more configurations are
943 ['OS!="ios" and OS!="android" and chromeos==0', {
944 'test_isolation_mode%': 'check',
946 'test_isolation_mode%': 'noop',
948 # Whether Android build uses OpenMAX DL FFT.
949 ['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")', {
950 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
951 # When enabled, this will also enable WebAudio support on
952 # Android for these architectures. Default is enabled. Whether
953 # WebAudio is actually available depends on runtime settings
955 'use_openmax_dl_fft%': 1,
957 'use_openmax_dl_fft%': 0,
959 ['OS=="win" or OS=="linux"', {
963 # Turns on compiler optimizations in V8 in Debug build, except
964 # on android_clang, where we're hitting a weird linker error.
965 # TODO(dpranke): http://crbug.com/266155 .
967 'v8_optimized_debug%': 1,
969 'v8_optimized_debug%': 2,
972 # Disable various features by default on embedded.
975 'enable_basic_printing%': 0,
976 'enable_print_preview%': 0,
979 # By default, use ICU data file (icudtl.dat) on all platforms
980 # except when building Android WebView.
981 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
982 # Set the data reduction proxy origin for Android Webview.
983 ['android_webview_build==0', {
984 'icu_use_data_file_flag%' : 1,
986 'icu_use_data_file_flag%' : 0,
988 ['OS=="win" or OS=="mac"', {
989 'enable_wifi_bootstrapping%' : 1,
992 # Path to sas.dll, which provides the SendSAS function.
993 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
994 ['target_arch=="x64"', {
995 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
997 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1000 # Turn on JNI generation optimizations on non-WebView builds.
1001 ['OS=="android" and android_webview_build==0', {
1002 'optimize_jni_generation%': 1,
1004 'optimize_jni_generation%': 0,
1007 # TODO(rmcilroy): Enable v8_use_external_startup_data on ChromeOS
1008 # http://crbug.com/421063
1009 ['android_webview_build==0 and chromecast==0 and chromeos==0 and OS!="ios"', {
1010 'v8_use_external_startup_data%': 1,
1012 'v8_use_external_startup_data%': 0,
1016 # Set this to 1 to enable use of concatenated impulse responses
1017 # for the HRTF panner in WebAudio.
1018 'use_concatenated_impulse_responses': 1,
1020 # You can set the variable 'use_official_google_api_keys' to 1
1021 # to use the Google-internal file containing official API keys
1022 # for Google Chrome even in a developer build. Setting this
1023 # variable explicitly to 1 will cause your build to fail if the
1024 # internal file is missing.
1026 # The variable is documented here, but not handled in this file;
1027 # see //google_apis/determine_use_official_keys.gypi for the
1030 # Set the variable to 0 to not use the internal file, even when
1031 # it exists in your checkout.
1033 # Leave it unset in your include.gypi to have the variable
1034 # implicitly set to 1 if you have
1035 # src/google_apis/internal/google_chrome_api_keys.h in your
1036 # checkout, and implicitly set to 0 if not.
1038 # Note that official builds always behave as if the variable
1039 # was explicitly set to 1, i.e. they always use official keys,
1040 # and will fail to build if the internal file is missing.
1042 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1043 # include.gypi or by other means. Due to subtleties of GYP, this
1044 # is not the same as leaving the variable unset, even though its
1046 # //google_apis/determine_use_official_keys.gypi is 2.
1048 # Set these to bake the specified API keys and OAuth client
1049 # IDs/secrets into your build.
1051 # If you create a build without values baked in, you can instead
1052 # set environment variables to provide the keys at runtime (see
1053 # src/google_apis/google_api_keys.h for details). Features that
1054 # require server-side APIs may fail to work if no keys are
1057 # Note that if you are building an official build or if
1058 # use_official_google_api_keys has been set to 1 (explicitly or
1059 # implicitly), these values will be ignored and the official
1060 # keys will be used instead.
1061 'google_api_key%': '',
1062 'google_default_client_id%': '',
1063 'google_default_client_secret%': '',
1064 # Native Client is enabled by default.
1065 'disable_nacl%': '0',
1067 # Set to 1 to support old history files
1068 'support_pre_M6_history_database%': '1',
1071 # Copy conditionally-set variables out one scope.
1072 'branding%': '<(branding)',
1073 'buildtype%': '<(buildtype)',
1074 'target_arch%': '<(target_arch)',
1075 'target_subarch%': '<(target_subarch)',
1076 'mips_arch_variant%': '<(mips_arch_variant)',
1077 'mips_dsp_rev%': '<(mips_dsp_rev)',
1078 'host_arch%': '<(host_arch)',
1079 'toolkit_views%': '<(toolkit_views)',
1080 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1081 'use_aura%': '<(use_aura)',
1082 'use_ash%': '<(use_ash)',
1083 'use_cras%': '<(use_cras)',
1084 'use_libpci%': '<(use_libpci)',
1085 'use_openssl%': '<(use_openssl)',
1086 'use_openssl_certs%': '<(use_openssl_certs)',
1087 'use_nss%': '<(use_nss)',
1088 'use_udev%': '<(use_udev)',
1089 'os_bsd%': '<(os_bsd)',
1090 'os_posix%': '<(os_posix)',
1091 'use_dbus%': '<(use_dbus)',
1092 'use_glib%': '<(use_glib)',
1093 'use_pango%': '<(use_pango)',
1094 'use_cairo%': '<(use_cairo)',
1095 'use_ozone%': '<(use_ozone)',
1096 'use_ozone_evdev%': '<(use_ozone_evdev)',
1097 'use_xkbcommon%': '<(use_xkbcommon)',
1098 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1099 'desktop_linux%': '<(desktop_linux)',
1100 'use_x11%': '<(use_x11)',
1101 'use_gnome_keyring%': '<(use_gnome_keyring)',
1102 'linux_fpic%': '<(linux_fpic)',
1103 'chromeos%': '<(chromeos)',
1104 'chromecast%': '<(chromecast)',
1105 'enable_viewport%': '<(enable_viewport)',
1106 'enable_hidpi%': '<(enable_hidpi)',
1107 'image_loader_extension%': '<(image_loader_extension)',
1108 'fastbuild%': '<(fastbuild)',
1109 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1110 'win_z7%': '<(win_z7)',
1111 'dcheck_always_on%': '<(dcheck_always_on)',
1112 'tracing_like_official_build%': '<(tracing_like_official_build)',
1113 'arm_version%': '<(arm_version)',
1114 'arm_neon%': '<(arm_neon)',
1115 'arm_neon_optional%': '<(arm_neon_optional)',
1116 'sysroot%': '<(sysroot)',
1117 'chroot_cmd%': '<(chroot_cmd)',
1118 'system_libdir%': '<(system_libdir)',
1119 'component%': '<(component)',
1120 'win_analyze%': '<(win_analyze)',
1121 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1122 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1123 'use_third_party_translations%': '<(use_third_party_translations)',
1124 'remoting%': '<(remoting)',
1125 'enable_one_click_signin%': '<(enable_one_click_signin)',
1126 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1127 'enable_media_router%': '<(enable_media_router)',
1128 'enable_webrtc%': '<(enable_webrtc)',
1129 'chromium_win_pch%': '<(chromium_win_pch)',
1130 'configuration_policy%': '<(configuration_policy)',
1131 'safe_browsing%': '<(safe_browsing)',
1132 'enable_web_speech%': '<(enable_web_speech)',
1133 'notifications%': '<(notifications)',
1134 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1135 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1137 'asan_blacklist%': '<(asan_blacklist)',
1138 'asan_coverage%': '<(asan_coverage)',
1139 'sanitizer_coverage%': '<(sanitizer_coverage)',
1140 'asan_field_padding%': '<(asan_field_padding)',
1141 'use_sanitizer_options%': '<(use_sanitizer_options)',
1142 'syzyasan%': '<(syzyasan)',
1143 'syzygy_optimize%': '<(syzygy_optimize)',
1146 'msan_blacklist%': '<(msan_blacklist)',
1147 'msan_track_origins%': '<(msan_track_origins)',
1149 'tsan_blacklist%': '<(tsan_blacklist)',
1150 'ubsan%': '<(ubsan)',
1151 'ubsan_blacklist%': '<(ubsan_blacklist)',
1152 'ubsan_vptr%': '<(ubsan_vptr)',
1153 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1154 'use_custom_libcxx%': '<(use_custom_libcxx)',
1155 'use_system_libcxx%': '<(use_system_libcxx)',
1156 'clang_type_profiler%': '<(clang_type_profiler)',
1157 'order_profiling%': '<(order_profiling)',
1158 'order_text_section%': '<(order_text_section)',
1159 'enable_extensions%': '<(enable_extensions)',
1160 'enable_plugin_installation%': '<(enable_plugin_installation)',
1161 'enable_plugins%': '<(enable_plugins)',
1162 'enable_session_service%': '<(enable_session_service)',
1163 'enable_themes%': '<(enable_themes)',
1164 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1165 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1166 'enable_background%': '<(enable_background)',
1167 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1168 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1169 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1170 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1171 'use_canvas_skia%': '<(use_canvas_skia)',
1172 'test_isolation_mode%': '<(test_isolation_mode)',
1173 'test_isolation_outdir%': '<(test_isolation_outdir)',
1174 'enable_basic_printing%': '<(enable_basic_printing)',
1175 'enable_print_preview%': '<(enable_print_preview)',
1176 'enable_spellcheck%': '<(enable_spellcheck)',
1177 'enable_google_now%': '<(enable_google_now)',
1178 'cld_version%': '<(cld_version)',
1179 'cld2_table_size%': '<(cld2_table_size)',
1180 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1181 'disable_file_support%': '<(disable_file_support)',
1182 'disable_ftp_support%': '<(disable_ftp_support)',
1183 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1184 'enable_task_manager%': '<(enable_task_manager)',
1185 'sas_dll_path%': '<(sas_dll_path)',
1186 'wix_path%': '<(wix_path)',
1187 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1188 'use_system_libjpeg%': '<(use_system_libjpeg)',
1189 'android_channel%': '<(android_channel)',
1190 'android_webview_build%': '<(android_webview_build)',
1191 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1192 'gyp_managed_install%': 0,
1193 'create_standalone_apk%': 1,
1194 'enable_app_list%': '<(enable_app_list)',
1195 'use_default_render_theme%': '<(use_default_render_theme)',
1196 'enable_settings_app%': '<(enable_settings_app)',
1197 'google_api_key%': '<(google_api_key)',
1198 'google_default_client_id%': '<(google_default_client_id)',
1199 'google_default_client_secret%': '<(google_default_client_secret)',
1200 'enable_supervised_users%': '<(enable_supervised_users)',
1201 'native_discardable_memory%': '<(native_discardable_memory)',
1202 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1203 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1204 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1205 'enable_mdns%' : '<(enable_mdns)',
1206 'enable_service_discovery%' : '<(enable_service_discovery)',
1207 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1208 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1209 'v8_optimized_debug%': '<(v8_optimized_debug)',
1210 'proprietary_codecs%': '<(proprietary_codecs)',
1211 'use_goma%': '<(use_goma)',
1212 'gomadir%': '<(gomadir)',
1213 'use_lto%': '<(use_lto)',
1214 'use_lto_o2%': '<(use_lto_o2)',
1215 'gold_icf_level%': '<(gold_icf_level)',
1216 'video_hole%': '<(video_hole)',
1217 'support_pre_M6_history_database%': '<(support_pre_M6_history_database)',
1218 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1220 # Use system protobuf instead of bundled one.
1221 'use_system_protobuf%': 0,
1223 # Use system yasm instead of bundled one.
1224 'use_system_yasm%': 0,
1226 # Use system ICU instead of bundled one.
1227 'use_system_icu%' : 0,
1229 # Default to enabled PIE; this is important for ASLR but we may need to be
1230 # able to turn it off for various reasons.
1231 'linux_disable_pie%': 0,
1233 # The release channel that this build targets. This is used to restrict
1234 # channel-specific build options, like which installer packages to create.
1235 # The default is 'all', which does no channel-specific filtering.
1238 # Override chromium_mac_pch and set it to 0 to suppress the use of
1239 # precompiled headers on the Mac. Prefix header injection may still be
1240 # used, but prefix headers will not be precompiled. This is useful when
1241 # using distcc to distribute a build to compile slaves that don't
1242 # share the same compiler executable as the system driving the compilation,
1243 # because precompiled headers rely on pointers into a specific compiler
1244 # executable's image. Setting this to 0 is needed to use an experimental
1245 # Linux-Mac cross compiler distcc farm.
1246 'chromium_mac_pch%': 1,
1248 # The default value for mac_strip in target_defaults. This cannot be
1249 # set there, per the comment about variable% in a target_defaults.
1250 'mac_strip_release%': 0,
1252 # Set to 1 to enable java code coverage. Instruments classes during build
1253 # to produce .ec files during runtime.
1254 'emma_coverage%': 0,
1256 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1257 # separated with whitespace and/or comma. Only has effect if
1258 # 'emma_coverage=1'.
1261 # Set to 1 to enable running Android lint on java/class files.
1264 # Although base/allocator lets you select a heap library via an
1265 # environment variable, the libcmt shim it uses sometimes gets in
1266 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1267 # 'win_use_allocator_shim': 0,
1268 # 'win_release_RuntimeLibrary': 2
1269 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1270 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1272 # TODO(bradnelson): eliminate this when possible.
1273 # To allow local gyp files to prevent release.vsprops from being included.
1274 # Yes(1) means include release.vsprops.
1275 # Once all vsprops settings are migrated into gyp, this can go away.
1276 'msvs_use_common_release%': 1,
1278 # TODO(bradnelson): eliminate this when possible.
1279 # To allow local gyp files to override additional linker options for msvs.
1280 # Yes(1) means set use the common linker options.
1281 'msvs_use_common_linker_extras%': 1,
1283 # TODO(sgk): eliminate this if possible.
1284 # It would be nicer to support this via a setting in 'target_defaults'
1285 # in chrome/app/locales/locales.gypi overriding the setting in the
1286 # 'Debug' configuration in the 'target_defaults' dict below,
1287 # but that doesn't work as we'd like.
1288 'msvs_debug_link_incremental%': '2',
1290 # Needed for some of the largest modules.
1291 'msvs_debug_link_nonincremental%': '1',
1293 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1294 # to get incremental linking to be faster in debug builds.
1295 'incremental_chrome_dll%': '0',
1297 # Experimental setting to break chrome.dll into multiple pieces based on
1299 'chrome_multiple_dll%': '0',
1301 # Experimental setting to optimize Chrome's DLLs with PGO.
1302 'chrome_pgo_phase%': '0',
1304 # Whether the VS xtree header has been patched to disable warning 4702. If
1305 # it has, then we don't need to disable 4702 (unreachable code warning).
1306 # The patch is preapplied to the internal toolchain and hence all bots.
1307 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1310 'clang%': '<(clang)',
1311 'host_clang%': '<(host_clang)',
1312 'make_clang_dir%': '<(make_clang_dir)',
1313 'use_lld%': '<(use_lld)',
1315 # Control which version of clang to use when building for iOS. If set to
1316 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1317 # the version of clang that ships with the Chromium source. This variable
1318 # is automatically set to '1' when using the Xcode generator.
1321 # These two variables can be set in GYP_DEFINES while running
1322 # |gclient runhooks| to let clang run a plugin in every compilation.
1323 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1325 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1328 'clang_add_plugin%': '',
1330 # Tell ld64 to write map files describing binary layout. Useful
1331 # for looking at what contributes to binary size, e.g. with
1332 # https://github.com/nico/bloat
1333 'mac_write_linker_maps%': 0,
1335 # The default type of gtest.
1336 'gtest_target_type%': 'executable',
1338 # Enable sampling based profiler.
1339 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1341 # Profile without optimizing out stack frames when profiling==1.
1342 'profiling_full_stack_frames%': '0',
1344 # And if we want to dump symbols for Breakpad-enabled builds.
1345 'linux_dump_symbols%': 0,
1346 # And if we want to strip the binary after dumping symbols.
1347 'linux_strip_binary%': 0,
1348 # If we want stack unwind support for backtrace().
1349 'debug_unwind_tables%': 1,
1350 'release_unwind_tables%': 1,
1352 # Override where to find binutils
1353 'binutils_version%': 0,
1354 'binutils_dir%': '',
1357 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1358 'use_allocator%': 'tcmalloc',
1360 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1361 'linux_link_gnome_keyring%': 0,
1362 # Set to 1 to link against gsettings APIs instead of using dlopen().
1363 'linux_link_gsettings%': 0,
1365 # Enable use of OpenMAX DL FFT routines.
1366 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1368 # Enable new NPDevice API.
1369 'enable_new_npdevice_api%': 0,
1371 # .gyp files or targets should set chromium_code to 1 if they build
1372 # Chromium-specific code, as opposed to external code. This variable is
1373 # used to control such things as the set of warnings to enable, and
1374 # whether warnings are treated as errors.
1375 'chromium_code%': 0,
1377 # Disable fatal linker warnings, similarly to how we make it possible
1378 # to disable -Werror (e.g. for different toolchain versions).
1379 'disable_fatal_linker_warnings%': 0,
1381 'release_valgrind_build%': 0,
1383 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1384 'enable_wexit_time_destructors%': 0,
1386 # Build libpeerconnection as a static library by default.
1387 'libpeer_target_type%': 'static_library',
1389 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1390 'internal_gles2_conform_tests%': 0,
1392 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1393 'internal_khronos_glcts_tests%': 0,
1395 # Set to 1 to compile the filter fuzzer.
1396 'internal_filter_fuzzer%': 0,
1398 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1399 # so Cocoa is happy (http://crbug.com/20441).
1401 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1402 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1403 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1404 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1405 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1406 'vi', 'zh-CN', 'zh-TW',
1409 # Pseudo locales are special locales which are used for testing and
1410 # debugging. They don't get copied to the final app. For more info,
1411 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1418 # If debug_devtools is set to 1, JavaScript files for DevTools are
1419 # stored as is and loaded from disk. Otherwise, a concatenated file
1420 # is stored in resources.pak. It is still possible to load JS files
1421 # from disk by passing --debug-devtools cmdline switch.
1422 'debug_devtools%': 0,
1424 # The Java Bridge is not compiled in by default.
1427 # Code signing for iOS binaries. The bots need to be able to disable this.
1428 'chromium_ios_signing%': 1,
1430 # This flag is only used when disable_nacl==0 and disables all those
1431 # subcomponents which would require the installation of a native_client
1432 # untrusted toolchain.
1433 'disable_nacl_untrusted%': 0,
1435 # Disable Dart by default.
1438 # Copy out the setting of disable_nacl.
1439 'disable_nacl%': '<(disable_nacl)',
1441 # Portable Native Client is enabled by default.
1442 'disable_pnacl%': 0,
1444 # Whether to build full debug version for Debug configuration on Android.
1445 # Compared to full debug version, the default Debug configuration on Android
1446 # has no full v8 debug, has size optimization and linker gc section, so that
1447 # we can build a debug version with acceptable size and performance.
1448 'android_full_debug%': 0,
1450 # Sets the default version name and code for Android app, by default we
1451 # do a developer build.
1452 'android_app_version_name%': 'Developer Build',
1453 'android_app_version_code%': 1,
1455 # Contains data about the attached devices for gyp_managed_install.
1456 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1458 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1459 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1461 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1462 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1464 # Whether we are using the rlz library or not. Platforms like Android send
1465 # rlz codes for searches but do not use the library.
1468 # Turns on the i18n support in V8.
1469 'v8_enable_i18n_support': 1,
1471 # Compile d8 for the host toolset.
1472 'v8_toolset_for_d8': 'host',
1474 # Enable the V8 heap verification code. The verification itself is enabled
1475 # via a command line option.
1476 'v8_enable_verify_heap%': 1,
1478 # Use brlapi from brltty for braille display support.
1481 # Relative path to icu.gyp from this file.
1482 'icu_gyp_path': '../third_party/icu/icu.gyp',
1484 # IPC fuzzer is disabled by default.
1485 'enable_ipc_fuzzer%': 0,
1487 # Force disable libstdc++ debug mode.
1488 'disable_glibcxx_debug%': 0,
1490 # Set to 1 to compile with MSE support for MPEG2 TS
1491 'enable_mpeg2ts_stream_parser%': 0,
1493 # Support ChromeOS touchpad gestures with ozone.
1494 'use_evdev_gestures%': 0,
1496 # Default ozone platform (if no --ozone-platform flag).
1497 'ozone_platform%': "",
1499 # Ozone platforms to include in the build.
1500 'ozone_platform_caca%': 0,
1501 'ozone_platform_dri%': 0,
1502 'ozone_platform_egltest%': 0,
1503 'ozone_platform_gbm%': 0,
1504 'ozone_platform_ozonex%': 0,
1505 'ozone_platform_test%': 0,
1507 # Whether the browser is non-native (using Views Toolkit) on Mac.
1508 'mac_views_browser%': 0,
1510 # Experiment: http://crbug.com/426914
1514 ['buildtype=="Official"', {
1515 # Continue to embed build meta data in Official builds, basically the
1516 # time it was built.
1517 # TODO(maruel): This decision should be revisited because having an
1518 # official deterministic build has high value too but MSVC toolset can't
1519 # generate anything deterministic with WPO enabled AFAIK.
1520 'dont_embed_build_metadata%': 0,
1522 # Enable the Syzygy optimization step for the official builds.
1523 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1524 'syzygy_optimize%': 1,
1526 'syzygy_optimize%': 0,
1528 # Get binutils version so we can enable debug fission if we can.
1529 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1531 # compiler_version doesn't work with clang
1532 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1533 # compiler_version works with clang.
1534 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1535 # that it takes effect here.
1536 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1537 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1539 # On Android we know the binutils version in the toolchain.
1541 'binutils_version%': 222,
1543 ['host_arch=="x64"', {
1544 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1546 ['host_arch=="ia32"', {
1547 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1549 # Our version of binutils in third_party/binutils
1550 ['linux_use_bundled_binutils==1', {
1551 'binutils_version%': 224,
1555 'binutils_version%': 0,
1557 # The version of GCC in use, set later in platforms that use GCC and have
1558 # not explicitly chosen to build with clang. Currently, this means all
1559 # platforms except Windows, Mac and iOS.
1560 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1561 # it takes effect here.
1562 ['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', {
1564 ['OS=="android" and android_webview_build==0', {
1565 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1566 # We directly set the gcc version since we know what we use.
1569 ['OS=="android" and android_webview_build==1', {
1570 # Android WebView uses a hermetic clang toolchain for host builds.
1571 'host_gcc_version%': 0,
1572 # Android WebView uses the GCC toolchain from the Android build.
1576 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1577 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1581 'host_gcc_version%': 0,
1584 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1585 'windows_sdk_path%': '<(windows_sdk_default_path)',
1587 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1589 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1590 'directx_sdk_path%': '<(directx_sdk_default_path)',
1592 'directx_sdk_path%': '$(DXSDK_DIR)',
1595 'windows_driver_kit_path%': '$(WDK_DIR)',
1597 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1599 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1602 'nacl_untrusted_build%': 0,
1603 'use_allocator%': 'none',
1605 ['OS=="linux" and target_arch=="mipsel"', {
1606 'sysroot%': '<(sysroot)',
1609 # Use a 64-bit linker to avoid running out of address space. The
1610 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1611 ['host_arch=="ia32" and target_arch=="ia32"', {
1612 # TODO(thestig) This is a horrible way to force the desired
1613 # configuration. Our gyp variable scoping is likely wrong and
1614 # needs to be cleaned up. The GN configuration should be changed
1616 'binutils_version%': 224,
1617 'linux_use_bundled_binutils%': '1',
1618 'linux_use_bundled_gold%': '1',
1619 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1621 # All Chrome builds have breakpad symbols, but only process the
1622 # symbols from official builds.
1623 ['(branding=="Chrome" and buildtype=="Official")', {
1624 'linux_dump_symbols%': 1,
1626 # Omit unwind support in official release builds to save space. We
1627 # can use breakpad for these builds.
1628 'release_unwind_tables%': 0,
1631 }], # os_posix==1 and OS!="mac" and OS!="ios"
1634 'enable_background%': 0,
1635 'icu_use_data_file_flag%': 1,
1636 'enable_web_speech%': 0,
1637 'use_system_libxml%': 1,
1638 'use_system_sqlite%': 1,
1640 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1641 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1642 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1643 'uk', 'vi', 'zh-CN', 'zh-TW',
1646 # iOS SDK and deployment target support. The |ios_sdk| value is left
1647 # blank so that when it is set in the project files it will be the
1648 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1649 # causes Xcode to spit out a warning for every single project file for
1650 # not using the "current" SDK.
1652 'ios_sdk_path%': '',
1653 'ios_deployment_target%': '7.0',
1656 # ios_product_name is set to the name of the .app bundle as it should
1658 ['branding=="Chrome"', {
1659 'ios_product_name%': 'Chrome',
1660 }, { # else: branding!="Chrome"
1661 'ios_product_name%': 'Chromium',
1663 ['branding=="Chrome" and buildtype=="Official"', {
1665 }, { # else: branding!="Chrome" or buildtype!="Official"
1671 # Location of Android NDK.
1674 # Standard libraries can use the relative path to the NDK.
1675 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1676 # Unfortunately, it is required to use the absolute path to the SDK
1677 # because it us passed to ant which uses a different relative path
1679 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1680 # Similarly, gdbserver and the Android toolchain need to use the
1681 # absolute path to the NDK because they are used at different levels
1683 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1684 'android_host_arch%': '<!(uname -m)',
1685 # Android API-level of the SDK used for compilation.
1686 'android_sdk_version%': '21',
1687 'android_sdk_build_tools_version%': '21.0.1',
1688 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1690 # Copy conditionally-set variables out one scope.
1691 'android_ndk_root%': '<(android_ndk_root)',
1692 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1693 'android_sdk_root%': '<(android_sdk_root)',
1694 'android_sdk_version%': '<(android_sdk_version)',
1695 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1696 'host_os%': '<(host_os)',
1698 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1699 # Android SDK build tools (e.g. dx, aapt, aidl)
1700 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1702 # Android API level 14 is ICS (Android 4.0) which is the minimum
1703 # platform requirement for Chrome on Android, we use it for native
1706 ['target_arch == "ia32"', {
1707 'android_app_abi%': 'x86',
1708 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
1709 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1710 'android_ndk_lib_dir%': 'usr/lib',
1711 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1713 ['target_arch == "x64"', {
1714 'android_app_abi%': 'x86_64',
1715 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1716 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1717 'android_ndk_lib_dir%': 'usr/lib64',
1718 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1720 ['target_arch=="arm"', {
1723 'android_app_abi%': 'armeabi',
1725 'android_app_abi%': 'armeabi-v7a',
1728 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
1729 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1730 'android_ndk_lib_dir%': 'usr/lib',
1731 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1733 ['target_arch == "arm64"', {
1734 'android_app_abi%': 'arm64-v8a',
1735 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1736 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1737 'android_ndk_lib_dir%': 'usr/lib',
1738 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1740 ['target_arch == "mipsel"', {
1741 'android_app_abi%': 'mips',
1742 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
1743 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1744 'android_ndk_lib_dir%': 'usr/lib',
1745 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1747 ['target_arch == "mips64el"', {
1748 'android_app_abi%': 'mips64',
1749 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1750 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1751 'android_ndk_lib_dir%': 'usr/lib64',
1752 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1756 # Copy conditionally-set variables out one scope.
1757 'android_app_abi%': '<(android_app_abi)',
1758 'android_gdbserver%': '<(android_gdbserver)',
1759 'android_ndk_root%': '<(android_ndk_root)',
1760 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1761 'android_sdk_root%': '<(android_sdk_root)',
1762 'android_sdk_version%': '<(android_sdk_version)',
1763 'android_toolchain%': '<(android_toolchain)',
1765 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1766 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1767 'android_sdk_tools%': '<(android_sdk_tools)',
1768 'android_sdk%': '<(android_sdk)',
1769 'android_sdk_jar%': '<(android_sdk)/android.jar',
1771 'android_stlport_root': '<(android_stlport_root)',
1772 'android_stlport_include': '<(android_stlport_root)/stlport',
1773 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1774 'host_os%': '<(host_os)',
1776 # Location of the "objcopy" binary, used by both gyp and scripts.
1777 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1779 # Location of the "strip" binary, used by both gyp and scripts.
1780 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1782 # Location of the "readelf" binary.
1783 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1785 # Determines whether we should optimize JNI generation at the cost of
1786 # breaking assumptions in the build system that when inputs have changed
1787 # the outputs should always change as well. This is meant purely for
1788 # developer builds, to avoid spurious re-linking of native files.
1789 'optimize_jni_generation%': '<(optimize_jni_generation)',
1791 # Always uses openssl.
1793 'use_openssl_certs%': 1,
1795 'proprietary_codecs%': '<(proprietary_codecs)',
1796 'safe_browsing%': 2,
1797 'enable_web_speech%': 0,
1799 'build_ffmpegsumo%': 0,
1800 'use_allocator%': 'none',
1802 # Disable Native Client.
1805 # Android does not support background apps.
1806 'enable_background%': 0,
1808 # Sessions are store separately in the Java side.
1809 'enable_session_service%': 0,
1813 'gtest_target_type%': 'shared_library',
1815 # Uses system APIs for decoding audio and video.
1816 'use_libffmpeg%': '0',
1818 # TODO(torne): Remove this unsupported option once all the places that
1819 # test it have been updated.
1820 'use_system_stlport%': 0,
1822 # Copy it out one scope.
1823 'android_webview_build%': '<(android_webview_build)',
1826 'use_system_fontconfig%': 0,
1828 'use_system_fontconfig%': 1,
1831 'enable_mpeg2ts_stream_parser%': 1,
1832 'ffmpeg_branding%': 'ChromeOS',
1833 'ozone_platform_ozonex%': 1,
1834 'use_playready%': 0,
1836 ['target_arch=="arm"', {
1838 'arm_tune%': 'cortex-a9',
1844 ['android_webview_build==1', {
1845 # When building the WebView in the Android tree, jarjar will remap all
1846 # the class names, so the JNI generator needs to know this.
1847 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1849 ['OS=="linux" and target_arch!="mipsel"', {
1854 # All Chrome builds have breakpad symbols, but only process the
1855 # symbols from official builds.
1856 ['(branding=="Chrome" and buildtype=="Official")', {
1857 'mac_strip_release%': 1,
1861 ['OS=="mac" or OS=="ios"', {
1865 # Mac OS X SDK and deployment target support. The SDK identifies
1866 # the version of the system headers that will be used, and
1867 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1868 # macro. "Maximum allowed" refers to the operating system version
1869 # whose APIs are available in the headers. The deployment target
1870 # identifies the minimum system version that the built products are
1871 # expected to function on. It corresponds to the
1872 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1873 # macros are available, #include <AvailabilityMacros.h>. Additional
1874 # documentation on these macros is available at
1875 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1876 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1877 # deployment target to 10.6. Other projects, such as O3D, may
1878 # override these defaults.
1880 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1881 # about that is at least the specified version. In official builds,
1882 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1883 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1884 # path to the SDK; when set to a non-empty string, SDK detection
1885 # based on mac_sdk_min will be bypassed entirely.
1888 'mac_sdk_min%': '10.8',
1889 }, { # else OS!="ios"
1890 'mac_sdk_min%': '10.6',
1893 'mac_sdk_path%': '',
1895 'mac_deployment_target%': '10.6',
1898 'mac_sdk_min': '<(mac_sdk_min)',
1899 'mac_sdk_path': '<(mac_sdk_path)',
1900 'mac_deployment_target': '<(mac_deployment_target)',
1902 # Compile in Breakpad support by default so that it can be
1903 # tested, even if it is not enabled by default at runtime.
1904 'mac_breakpad_compiled_in%': 1,
1906 # mac_product_name is set to the name of the .app bundle as it should
1907 # appear on disk. This duplicates data from
1908 # chrome/app/theme/chromium/BRANDING and
1909 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1910 # these names into the build system.
1911 ['branding=="Chrome"', {
1912 'mac_product_name%': 'Google Chrome',
1913 }, { # else: branding!="Chrome"
1914 'mac_product_name%': 'Chromium',
1916 # Official mac builds require a specific OS X SDK, but iOS and
1917 # non-official mac builds do not.
1918 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1919 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1921 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1923 ['branding=="Chrome" and buildtype=="Official"', {
1924 # Enable uploading crash dumps.
1925 'mac_breakpad_uploads%': 1,
1926 # Enable dumping symbols at build time for use by Mac Breakpad.
1928 # Enable Keystone auto-update support.
1930 }, { # else: branding!="Chrome" or buildtype!="Official"
1931 'mac_breakpad_uploads%': 0,
1936 }], # OS=="mac" or OS=="ios"
1939 # This is the architecture convention used in WinSDK paths.
1940 ['target_arch=="ia32"', {
1941 'winsdk_arch%': 'x86',
1943 'winsdk_arch%': '<(target_arch)',
1945 ['component=="shared_library"', {
1946 'win_use_allocator_shim%': 0,
1948 # Turn on multiple dll by default on Windows when in static_library.
1949 'chrome_multiple_dll%': 1,
1951 ['asan==1 or syzyasan==1', {
1952 'win_use_allocator_shim%': 0,
1954 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1955 # Only enabled by default for ninja because it's buggy in VS.
1956 # Not enabled for component=static_library because some targets
1957 # are too large and the toolchain fails due to the size of the
1959 'incremental_chrome_dll%': 1,
1961 # Don't do incremental linking for large modules on 32-bit or when
1962 # component=static_library as the toolchain fails due to the size of
1964 ['MSVS_OS_BITS==32 or component=="static_library"', {
1965 'msvs_large_module_debug_link_mode%': '1', # No
1967 'msvs_large_module_debug_link_mode%': '2', # Yes
1970 'nacl_win64_defines': [
1971 # This flag is used to minimize dependencies when building
1972 # Native Client loader for 64-bit Windows.
1975 # Need to include allocator target, but exclude tcmalloc files.
1976 'use_allocator%': 'winheap',
1979 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1985 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1986 'enable_pepper_cdms%': 1,
1988 'enable_pepper_cdms%': 0,
1991 ['OS=="android" or chromecast==1', {
1992 'enable_browser_cdms%': 1,
1994 'enable_browser_cdms%': 0,
1997 # Native Client glibc toolchain is enabled
1998 # by default except on arm, mips and mips64.
1999 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
2000 'disable_glibc%': 1,
2002 'disable_glibc%': 0,
2005 # Set the relative path from this file to the GYP file of the JPEG
2006 # library used by Chromium.
2007 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2008 # Configuration for using the system libjeg is here.
2009 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
2011 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
2014 # Options controlling the use of GConf (the classic GNOME configuration
2015 # system) and GIO, which contains GSettings (the new GNOME config system).
2016 ['chromeos==1 or embedded==1', {
2024 # Set up -D and -E flags passed into grit.
2025 ['branding=="Chrome"', {
2026 # TODO(mmoss) The .grd files look for _google_chrome, but for
2027 # consistency they should look for google_chrome_build like C++.
2028 'grit_defines': ['-D', '_google_chrome',
2029 '-E', 'CHROMIUM_BUILD=google_chrome'],
2031 'grit_defines': ['-D', '_chromium',
2032 '-E', 'CHROMIUM_BUILD=chromium'],
2035 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2037 ['desktop_linux==1', {
2038 'grit_defines': ['-D', 'desktop_linux'],
2040 ['toolkit_views==1', {
2041 'grit_defines': ['-D', 'toolkit_views'],
2044 'grit_defines': ['-D', 'use_aura'],
2047 'grit_defines': ['-D', 'use_ash'],
2050 'grit_defines': ['-D', 'use_nss'],
2053 'grit_defines': ['-D', 'use_ozone'],
2055 ['image_loader_extension==1', {
2056 'grit_defines': ['-D', 'image_loader_extension'],
2059 'grit_defines': ['-D', 'remoting'],
2061 ['use_titlecase_in_grd==1', {
2062 'grit_defines': ['-D', 'use_titlecase'],
2064 ['use_third_party_translations==1', {
2065 'grit_defines': ['-D', 'use_third_party_translations'],
2067 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2068 'ka', 'ku', 'kw', 'ms', 'ug'
2074 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2075 '--no-output-all-resource-defines',
2078 ['OS=="mac" or OS=="ios"', {
2079 'grit_defines': ['-D', 'scale_factors=2x'],
2083 'enable_coverage%': 0,
2087 '--no-output-all-resource-defines',
2089 # iOS uses a whitelist to filter resources.
2090 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2092 # Enable host builds when generating with ninja-ios.
2094 ['"<(GENERATOR)"=="ninja"', {
2098 # Use the version of clang shipped with Xcode when building official
2099 # version of Chrome for iOS.
2101 # TODO(eugenebut): Remove enable_coverage check once
2102 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2103 # http://crbug.com/450379
2104 ['buildtype=="Official" or enable_coverage', {
2109 ['enable_extensions==1', {
2110 'grit_defines': ['-D', 'enable_extensions'],
2112 ['enable_plugins!=0', {
2113 'grit_defines': ['-D', 'enable_plugins'],
2115 ['enable_basic_printing==1 or enable_print_preview==1', {
2116 'grit_defines': ['-D', 'enable_printing'],
2118 ['enable_print_preview==1', {
2119 'grit_defines': ['-D', 'enable_print_preview'],
2121 ['enable_themes==1', {
2122 'grit_defines': ['-D', 'enable_themes'],
2124 ['enable_app_list==1', {
2125 'grit_defines': ['-D', 'enable_app_list'],
2127 ['enable_settings_app==1', {
2128 'grit_defines': ['-D', 'enable_settings_app'],
2130 ['enable_google_now==1', {
2131 'grit_defines': ['-D', 'enable_google_now'],
2133 ['use_concatenated_impulse_responses==1', {
2134 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2136 ['enable_media_router==1', {
2137 'grit_defines': ['-D', 'enable_media_router'],
2139 ['enable_webrtc==1', {
2140 'grit_defines': ['-D', 'enable_webrtc'],
2142 ['enable_hangout_services_extension==1', {
2143 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2145 ['enable_task_manager==1', {
2146 'grit_defines': ['-D', 'enable_task_manager'],
2148 ['notifications==1', {
2149 'grit_defines': ['-D', 'enable_notifications'],
2151 ['enable_wifi_bootstrapping==1', {
2152 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2154 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2155 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2157 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2158 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2160 ['enable_mdns==1 or OS=="mac"', {
2161 'grit_defines': ['-D', 'enable_service_discovery'],
2162 'enable_service_discovery%': 1
2164 ['clang_use_chrome_plugins==1 and OS!="win"', {
2165 'clang_chrome_plugins_flags%':
2166 '<!(python <(DEPTH)/tools/clang/scripts/plugin_flags.py)',
2168 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2170 'use_allocator%': 'none',
2171 'use_sanitizer_options%': 1,
2172 # Disable ICF in the linker to avoid debug info loss.
2173 'gold_icf_level%': 'none',
2175 ['asan==1 and OS=="linux" and chromeos==0', {
2176 'use_custom_libcxx%': 1,
2184 ['asan==1 and OS=="mac"', {
2185 'mac_strip_release': 1,
2188 'use_custom_libcxx%': 1,
2191 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2192 # libstdc++. This is required to avoid false positive reports whenever
2193 # the C++ standard library is used.
2194 'use_custom_libcxx%': 1,
2195 # Running the V8-generated code on an ARM simulator is a powerful hack
2196 # that allows the tool to see the memory accesses from JITted code.
2197 # Without this flag, JS code causes false positive reports from MSan.
2198 'v8_target_arch': 'arm64',
2201 ['OS=="linux" and clang_type_profiler==1', {
2203 'clang_use_chrome_plugins%': 0,
2205 ['host_arch=="x64"', {
2206 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2208 ['host_arch=="ia32"', {
2209 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2210 # Clang in this directory at your own risk if needed for some
2211 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2212 # usage). Any failure by this compiler should not close the tree.
2213 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2219 # The Clang plugins don't currently work on Windows.
2220 # TODO(hans): One day, this will work. (crbug.com/82385)
2221 'clang_use_chrome_plugins%': 0,
2224 # On valgrind bots, override the optimizer settings so we don't inline too
2225 # much and make the stacks harder to figure out.
2227 # TODO(rnk): Kill off variables that no one else uses and just implement
2228 # them under a build_for_tool== condition.
2229 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2231 'mac_debug_optimization': '1',
2232 'mac_release_optimization': '1',
2233 'release_optimize': '1',
2234 'no_gc_sections': 1,
2235 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2236 '-fno-builtin -fno-optimize-sibling-calls',
2237 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2238 '-fno-builtin -fno-optimize-sibling-calls',
2240 # MSVS flags for TSan on Pin and Windows.
2241 'win_debug_RuntimeChecks': '0',
2242 'win_debug_disable_iterator_debugging': '1',
2243 'win_debug_Optimization': '1',
2244 'win_debug_InlineFunctionExpansion': '0',
2245 'win_release_InlineFunctionExpansion': '0',
2246 'win_release_OmitFramePointers': '0',
2248 'use_allocator': 'tcmalloc',
2249 'release_valgrind_build': 1,
2251 'component': 'static_library',
2252 'use_system_zlib': 0,
2255 # Build tweaks for DrMemory.
2256 # TODO(rnk): Combine with tsan config to share the builder.
2257 # http://crbug.com/108155
2258 ['build_for_tool=="drmemory"', {
2259 # These runtime checks force initialization of stack vars which blocks
2260 # DrMemory's uninit detection.
2261 'win_debug_RuntimeChecks': '0',
2262 # Iterator debugging is slow.
2263 'win_debug_disable_iterator_debugging': '1',
2264 # Try to disable optimizations that mess up stacks in a release build.
2265 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2266 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2267 # compiler bug, so we use /Ob1 instead.
2268 'win_release_InlineFunctionExpansion': '1',
2269 'win_release_OmitFramePointers': '0',
2270 # Ditto for debug, to support bumping win_debug_Optimization.
2271 'win_debug_InlineFunctionExpansion': 0,
2272 'win_debug_OmitFramePointers': 0,
2273 # Keep the code under #ifndef NVALGRIND.
2274 'release_valgrind_build': 1,
2277 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2278 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2282 # Set default compiler flags depending on ARM version.
2283 ['arm_version==6 and android_webview_build==0', {
2284 'arm_arch%': 'armv6',
2287 'arm_float_abi%': 'softfp',
2290 ['arm_version==7 and android_webview_build==0', {
2291 'arm_arch%': 'armv7-a',
2292 'arm_tune%': 'generic-armv7-a',
2297 'arm_fpu%': 'vfpv3-d16',
2300 # Change the default to hard once the armhf transition is complete.
2301 'arm_float_abi%': 'softfp',
2305 # Set default compiler flags depending on MIPS architecture variant.
2306 ['target_arch=="mipsel" and mips_arch_variant=="r2" and android_webview_build==0', {
2307 'mips_fpu_mode%': 'fp32',
2309 ['target_arch=="mipsel" and android_webview_build==0', {
2310 'mips_float_abi%': 'hard',
2313 ['android_webview_build==1', {
2314 # The WebView build gets its cpu-specific flags from the Android build system.
2318 'arm_float_abi%': '',
2320 'mips_fpu_mode%': '',
2321 'mips_float_abi%': '',
2324 # Enable brlapi by default for chromeos.
2329 ['use_ozone==1 and ozone_auto_platforms==1', {
2330 # Use test as the default platform.
2331 'ozone_platform%': 'test',
2333 # Build all platforms whose deps are in install-build-deps.sh.
2334 # Only these platforms will be compile tested by buildbots.
2335 'ozone_platform_dri%': 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,
2381 # older history files use fts2 instead of fts3
2382 'sqlite_enable_fts2%': '<(support_pre_M6_history_database)',
2384 # The path to the ANGLE library.
2385 'angle_path': '<(DEPTH)/third_party/angle',
2387 # List of default apps to install in new profiles. The first list contains
2388 # the source files as found in svn. The second list, used only for linux,
2389 # contains the destination location for each of the files. When a crx
2390 # is added or removed from the list, the chrome/browser/resources/
2391 # default_apps/external_extensions.json file must also be updated.
2393 # README: GN version of these is in the target //chrome:default_apps
2394 # (there's no global variable like in GYP). Be sure to update that target
2395 # if you change these lists!
2396 'default_apps_list': [
2397 'browser/resources/default_apps/external_extensions.json',
2398 'browser/resources/default_apps/gmail.crx',
2399 'browser/resources/default_apps/search.crx',
2400 'browser/resources/default_apps/youtube.crx',
2401 'browser/resources/default_apps/drive.crx',
2402 'browser/resources/default_apps/docs.crx',
2404 'default_apps_list_linux_dest': [
2405 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2406 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2407 '<(PRODUCT_DIR)/default_apps/search.crx',
2408 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2409 '<(PRODUCT_DIR)/default_apps/drive.crx',
2410 '<(PRODUCT_DIR)/default_apps/docs.crx',
2413 # Whether to allow building of the GPU-related isolates.
2414 'archive_gpu_tests%': 0,
2416 # Whether to allow building of chromoting related isolates.
2417 'archive_chromoting_tests%': 0,
2419 'target_defaults': {
2421 # The condition that operates on chromium_code is in a target_conditions
2422 # section, and will not have access to the default fallback value of
2423 # chromium_code at the top of this file, or to the chromium_code
2424 # variable placed at the root variables scope of .gyp files, because
2425 # those variables are not set at target scope. As a workaround,
2426 # if chromium_code is not set at target scope, define it in target scope
2427 # to contain whatever value it has during early variable expansion.
2428 # That's enough to make it available during target conditional
2430 'chromium_code%': '<(chromium_code)',
2432 'component%': '<(component)',
2434 'chromecast%': '<(chromecast)',
2436 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2437 'win_release_Optimization%': '2', # 2 = /Os
2438 'win_debug_Optimization%': '0', # 0 = /Od
2440 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2441 # Tri-state: blank is default, 1 on, 0 off
2442 'win_release_OmitFramePointers%': '0',
2443 # Tri-state: blank is default, 1 on, 0 off
2444 'win_debug_OmitFramePointers%': '',
2446 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2447 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2449 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2450 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2451 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2453 # VS inserts quite a lot of extra checks to algorithms like
2454 # std::partial_sort in Debug build which make them O(N^2)
2455 # instead of O(N*logN). This is particularly slow under memory
2456 # tools like ThreadSanitizer so we want it to be disablable.
2457 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2458 'win_debug_disable_iterator_debugging%': '0',
2460 # An application manifest fragment to declare compatibility settings for
2461 # 'executable' targets. Ignored in other target type.
2462 'win_exe_compatibility_manifest%':
2463 '<(DEPTH)\\build\\win\\compatibility.manifest',
2465 'release_extra_cflags%': '',
2466 'debug_extra_cflags%': '',
2468 'release_valgrind_build%': '<(release_valgrind_build)',
2470 # the non-qualified versions are widely assumed to be *nix-only
2471 'win_release_extra_cflags%': '',
2472 'win_debug_extra_cflags%': '',
2474 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2475 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2477 # Only used by Windows build for now. Can be used to build into a
2478 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2479 # output files in src/build/VS2010_{Debug,Release}.
2480 'build_dir_prefix%': '',
2482 # Targets are by default not nacl untrusted code.
2483 'nacl_untrusted_build%': 0,
2485 'pnacl_compile_flags': [
2486 # pnacl uses the clang compiler so we need to suppress all the
2487 # same warnings as we do for clang.
2488 # TODO(sbc): Remove these if/when they are removed from the clang
2490 '-Wno-unused-function',
2491 '-Wno-char-subscripts',
2492 '-Wno-c++11-extensions',
2493 '-Wno-unnamed-type-template-args',
2496 # By default, Android targets have their exported JNI symbols stripped,
2497 # so we test the manual JNI registration code paths that are required
2498 # when using the crazy linker. To allow use of native JNI exports (lazily
2499 # resolved by the JVM), targets can enable this variable, which will stop
2500 # the stripping from happening. Only targets which do not need to be
2501 # compatible with the crazy linker are permitted to set this.
2502 'use_native_jni_exports%': 0,
2505 ['OS=="win" and component=="shared_library"', {
2506 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2507 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2508 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2510 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2511 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2512 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2515 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2516 'mac_release_optimization%': 's', # Use -Os unless overridden
2517 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2519 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2520 'mac_release_optimization%': '2', # Use -O2 unless overridden
2521 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2524 'host_os%': '<(host_os)', # See comment above chromium_code.
2527 'clang_warning_flags': [
2530 # Don't die on dtoa code that uses a char as an array index.
2531 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2532 '-Wno-char-subscripts',
2534 # TODO(thakis): This used to be implied by -Wno-unused-function,
2535 # which we no longer use. Check if it makes sense to remove
2536 # this as well. http://crbug.com/316352
2537 '-Wno-unneeded-internal-declaration',
2539 # Warns on switches on enums that cover all enum values but
2540 # also contain a default: branch. Chrome is full of that.
2541 '-Wno-covered-switch-default',
2543 # Warns when a const char[] is converted to bool.
2544 '-Wstring-conversion',
2546 # C++11-related flags:
2548 # This warns on using ints as initializers for floats in
2549 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2550 # which happens in several places in chrome code. Not sure if
2551 # this is worth fixing.
2552 '-Wno-c++11-narrowing',
2554 # Clang considers the `register` keyword as deprecated, but e.g.
2555 # code generated by flex (used in angle) contains that keyword.
2556 # http://crbug.com/255186
2557 '-Wno-deprecated-register',
2559 # TODO(hans): Get this cleaned up.
2560 '-Wno-inconsistent-missing-override',
2563 'includes': [ 'set_clang_warning_flags.gypi', ],
2565 # Don't use deprecated V8 APIs anywhere.
2566 'V8_DEPRECATION_WARNINGS',
2569 '<(SHARED_INTERMEDIATE_DIR)',
2572 ['(OS=="mac" or OS=="ios") and asan==1', {
2574 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2577 ['OS=="win" and asan==1 and component=="shared_library"', {
2579 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2582 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2583 'cflags_cc!': ['-fno-rtti'],
2586 '-gline-tables-only',
2587 '-fintercept-allocation-functions',
2589 'defines': ['TYPE_PROFILING'],
2591 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2594 ['branding=="Chrome"', {
2595 'defines': ['GOOGLE_CHROME_BUILD'],
2596 }, { # else: branding!="Chrome"
2597 'defines': ['CHROMIUM_BUILD'],
2599 ['OS=="mac" and component=="shared_library"', {
2601 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2602 'LD_RUNPATH_SEARCH_PATHS': [
2603 # For unbundled binaries.
2605 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2606 '@loader_path/../../..',
2610 ['clang==1 and OS!="win"', {
2611 # This is here so that all files get recompiled after a clang roll and
2612 # when turning clang on or off.
2613 # (defines are passed via the command line, and build systems rebuild
2614 # things when their commandline changes). Nothing should ever read this
2616 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2619 'defines': ['ENABLE_RLZ'],
2621 ['component=="shared_library"', {
2622 'defines': ['COMPONENT_BUILD'],
2624 ['toolkit_views==1', {
2625 'defines': ['TOOLKIT_VIEWS=1'],
2627 ['ui_compositor_image_transport==1', {
2628 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2631 'defines': ['USE_AURA=1'],
2634 'defines': ['USE_ASH=1'],
2637 'defines': ['USE_PANGO=1'],
2640 'defines': ['USE_CAIRO=1'],
2643 'defines': ['USE_CRAS=1'],
2646 'defines': ['USE_OZONE=1'],
2648 ['use_default_render_theme==1', {
2649 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2651 ['use_libjpeg_turbo==1', {
2652 'defines': ['USE_LIBJPEG_TURBO=1'],
2655 'defines': ['USE_X11=1'],
2657 ['use_clipboard_aurax11==1', {
2658 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2660 ['enable_one_click_signin==1', {
2661 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2663 ['enable_pre_sync_backup==1', {
2664 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2666 ['image_loader_extension==1', {
2667 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2670 'defines': ['ENABLE_PROFILING=1'],
2673 'defines': ['ENABLE_REMOTING=1'],
2675 ['enable_webrtc==1', {
2676 'defines': ['ENABLE_WEBRTC=1'],
2678 ['proprietary_codecs==1', {
2679 'defines': ['USE_PROPRIETARY_CODECS'],
2681 ['enable_mpeg2ts_stream_parser==1', {
2682 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2686 ['enable_viewport==1', {
2687 'defines': ['ENABLE_VIEWPORT'],
2689 ['enable_pepper_cdms==1', {
2690 'defines': ['ENABLE_PEPPER_CDMS'],
2692 ['enable_browser_cdms==1', {
2693 'defines': ['ENABLE_BROWSER_CDMS'],
2695 ['configuration_policy==1', {
2696 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2698 ['notifications==1', {
2699 'defines': ['ENABLE_NOTIFICATIONS'],
2701 ['enable_hidpi==1', {
2702 'defines': ['ENABLE_HIDPI=1'],
2704 ['native_discardable_memory==1', {
2705 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2707 ['native_memory_pressure_signals==1', {
2708 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2711 'defines': ['USE_UDEV'],
2715 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2718 ['OS=="win" and fastbuild==2', {
2719 # Completely disable debug information.
2722 'GenerateDebugInformation': 'false',
2724 'VCCLCompilerTool': {
2725 'DebugInformationFormat': '0',
2729 ['OS=="win" and fastbuild==1', {
2732 # This tells the linker to generate .pdbs, so that
2733 # we can get meaningful stack traces.
2734 'GenerateDebugInformation': 'true',
2736 'VCCLCompilerTool': {
2737 # No debug info to be generated by compiler.
2738 'DebugInformationFormat': '0',
2742 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2743 'variables': { 'debug_extra_cflags': '-g0', },
2745 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2746 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2748 'variables': { 'debug_extra_cflags': '-g0', },
2750 # Android builds symbols on release by default, disable them.
2751 ['OS=="android" and fastbuild==2', {
2752 'variables': { 'release_extra_cflags': '-g0', },
2754 ['OS=="android" and fastbuild==1', {
2755 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2757 'variables': { 'release_extra_cflags': '-g0', },
2761 ['dont_embed_build_metadata==1', {
2763 'DONT_EMBED_BUILD_METADATA',
2765 }], # dont_embed_build_metadata==1
2766 ['dcheck_always_on!=0', {
2767 'defines': ['DCHECK_ALWAYS_ON=1'],
2768 }], # dcheck_always_on!=0
2769 ['tracing_like_official_build!=0', {
2770 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2771 }], # tracing_like_official_build!=0
2773 'defines': ['NO_TCMALLOC'],
2775 ['win_use_allocator_shim==1', {
2776 'defines': ['ALLOCATOR_SHIM'],
2782 'ADDRESS_SANITIZER',
2783 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2784 'MEMORY_SANITIZER_INITIAL_SIZE',
2788 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2796 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2797 'MEMORY_SANITIZER_INITIAL_SIZE',
2800 '<(DEPTH)/third_party/kasko/include',
2806 '_CRT_SECURE_NO_DEPRECATE',
2807 '_SCL_SECURE_NO_DEPRECATE',
2808 # This define is required to pull in the new Win8 interfaces from
2809 # system headers like ShObjIdl.h.
2810 'NTDDI_VERSION=0x06030000',
2811 # This is required for ATL to use XP-safe versions of its functions.
2812 '_USING_V110_SDK71_',
2815 '<(DEPTH)/third_party/wtl/include',
2820 # Generates debug info when win_z7=1
2821 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2823 'GenerateDebugInformation': 'true',
2825 'VCCLCompilerTool': {
2826 'DebugInformationFormat': '1',
2832 # This is prohibited when running /analyze.
2833 '_USING_V110_SDK71_',
2836 'VCCLCompilerTool': {
2837 # Set WarnAsError to false to disable this setting for most
2838 # projects so that compilation continues.
2839 'WarnAsError': 'false',
2840 # When win_analyze is specified add the /analyze switch.
2841 # Also add /WX- to force-disable WarnAsError for projects that
2842 # override WarnAsError.
2843 # Also, disable various noisy warnings that have low value.
2844 'AdditionalOptions': [
2847 '/wd6011', # Dereferencing NULL pointer
2848 '/wd6312', # Possible infinite loop: use of the constant
2849 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2850 '/wd6326', # Potential comparison of constant with constant
2851 '/wd28159', # Consider using 'GetTickCount64'
2852 '/wd28204', # Inconsistent SAL annotations
2853 '/wd28251', # Inconsistent SAL annotations
2854 '/wd28252', # Inconsistent SAL annotations
2855 '/wd28253', # Inconsistent SAL annotations
2856 '/wd28196', # The precondition is not satisfied
2857 '/wd28301', # Inconsistent SAL annotations
2858 '/wd6340', # Sign mismatch in function parameter
2859 '/wd28182', # Dereferencing NULL pointer
2860 # C6285 is ~16% of raw warnings and has low value
2861 '/wd6285', # non-zero constant || non-zero constant
2862 # C6334 is ~80% of raw warnings and has low value
2863 '/wd6334', # sizeof applied to an expression with an operator
2875 ['use_playready==1', {
2877 'PLAYREADY_CDM_AVAILABLE',
2882 ['enable_task_manager==1', {
2884 'ENABLE_TASK_MANAGER=1',
2887 ['enable_extensions==1', {
2889 'ENABLE_EXTENSIONS=1',
2892 ['OS=="win" and branding=="Chrome"', {
2893 'defines': ['ENABLE_SWIFTSHADER'],
2895 ['enable_dart==1', {
2896 'defines': ['WEBKIT_USING_DART=1'],
2898 ['enable_plugin_installation==1', {
2899 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2901 ['enable_plugins==1', {
2902 'defines': ['ENABLE_PLUGINS=1'],
2904 ['enable_session_service==1', {
2905 'defines': ['ENABLE_SESSION_SERVICE=1'],
2907 ['enable_themes==1', {
2908 'defines': ['ENABLE_THEMES=1'],
2910 ['enable_autofill_dialog==1', {
2911 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2913 ['enable_prod_wallet_service==1', {
2914 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2916 ['enable_background==1', {
2917 'defines': ['ENABLE_BACKGROUND=1'],
2919 ['enable_google_now==1', {
2920 'defines': ['ENABLE_GOOGLE_NOW=1'],
2922 ['cld_version!=0', {
2923 'defines': ['CLD_VERSION=<(cld_version)'],
2925 ['enable_basic_printing==1 or enable_print_preview==1', {
2926 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2927 'defines': ['ENABLE_PRINTING=1'],
2929 ['enable_basic_printing==1', {
2930 # Enable basic printing support and UI.
2931 'defines': ['ENABLE_BASIC_PRINTING=1'],
2933 ['enable_print_preview==1', {
2934 # Enable printing with print preview.
2935 # Can be defined without ENABLE_BASIC_PRINTING.
2936 'defines': ['ENABLE_PRINT_PREVIEW=1'],
2938 ['enable_spellcheck==1', {
2939 'defines': ['ENABLE_SPELLCHECK=1'],
2941 ['enable_captive_portal_detection==1', {
2942 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2944 ['enable_app_list==1', {
2945 'defines': ['ENABLE_APP_LIST=1'],
2947 ['enable_settings_app==1', {
2948 'defines': ['ENABLE_SETTINGS_APP=1'],
2950 ['disable_file_support==1', {
2951 'defines': ['DISABLE_FILE_SUPPORT=1'],
2953 ['disable_ftp_support==1', {
2954 'defines': ['DISABLE_FTP_SUPPORT=1'],
2956 ['use_icu_alternatives_on_android==1', {
2957 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=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 ['use_lto==1 and (target_arch=="ia32" or target_arch=="x64")', {
2990 # Required for third_party/zlib/crc_folding.c and various other code
2991 # that uses SSE. TODO(pcc): Remove this once we properly support
2992 # subtarget specific code generation in LLVM.
2993 'ldflags': ['-Wl,-plugin-opt,mcpu=corei7-avx'],
2995 ], # conditions for 'target_defaults'
2996 'target_conditions': [
2997 ['<(use_libpci)==1', {
2998 'defines': ['USE_LIBPCI=1'],
3000 ['<(use_openssl)==1', {
3001 'defines': ['USE_OPENSSL=1'],
3003 ['<(use_openssl_certs)==1', {
3004 'defines': ['USE_OPENSSL_CERTS=1'],
3006 ['>(nacl_untrusted_build)==1', {
3009 'USE_OPENSSL_CERTS=1',
3012 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3013 'defines': ['USE_GLIB=1'],
3015 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
3016 'defines': ['USE_NSS=1'],
3018 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3019 'defines': ['OS_CHROMEOS=1'],
3021 ['enable_wexit_time_destructors==1 and OS!="win"', {
3022 # TODO: Enable on Windows too, http://crbug.com/404525
3023 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3025 ['chromium_code==0', {
3027 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3028 # We don't want to get warnings from third-party code,
3029 # so remove any existing warning-enabling flags like -Wall.
3035 # Don't warn about hash_map in third-party code.
3039 # Don't warn about printf format problems.
3040 # This is off by default in gcc but on in Ubuntu's gcc(!).
3044 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3048 # TODO: Fix all warnings on chromeos too.
3049 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3054 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3056 # Don't warn about ignoring the return value from e.g. close().
3057 # This is off by default in some gccs but on by default in others.
3058 # BSD systems do not support this option, since they are usually
3059 # using gcc 4.2.1, which does not have this flag yet.
3060 '-Wno-unused-result',
3065 '_CRT_SECURE_NO_DEPRECATE',
3066 '_CRT_NONSTDC_NO_WARNINGS',
3067 '_CRT_NONSTDC_NO_DEPRECATE',
3068 '_SCL_SECURE_NO_DEPRECATE',
3070 'msvs_disabled_warnings': [4800],
3072 'VCCLCompilerTool': {
3073 'WarningLevel': '3',
3074 'WarnAsError': 'true',
3075 'Detect64BitPortabilityProblems': 'false',
3079 ['buildtype=="Official"', {
3081 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3086 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3089 [ 'component=="shared_library"', {
3090 # TODO(darin): Unfortunately, some third_party code depends on base.
3091 'msvs_disabled_warnings': [
3092 4251, # class 'std::xx' needs to have dll-interface.
3098 [ 'OS=="mac" or OS=="ios"', {
3100 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3103 ['buildtype=="Official"', {
3105 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3112 # TODO(ios): Fix remaining warnings in third-party code, then
3113 # remove this; the Mac cleanup didn't get everything that's
3114 # flagged in an iOS build.
3115 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3116 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3117 # Several internal ios directories generate numerous warnings for
3118 # -Wobjc-missing-property-synthesis.
3119 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3125 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3126 'filename_rules.gypi',
3128 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3129 # C99 macros on Mac and Linux.
3131 '__STDC_CONSTANT_MACROS',
3132 '__STDC_FORMAT_MACROS',
3136 # turn on warnings for signed/unsigned mismatch on chromium code.
3138 'VCCLCompilerTool': {
3139 'AdditionalOptions': ['/we4389'],
3143 ['OS=="win" and component=="shared_library"', {
3144 'msvs_disabled_warnings': [
3145 4251, # class 'std::xx' needs to have dll-interface.
3150 ], # target_conditions for 'target_defaults'
3151 'default_configuration': 'Debug',
3153 # VCLinkerTool LinkIncremental values below:
3155 # 1 == /INCREMENTAL:NO
3157 # Debug links incremental, Release does not.
3159 # Abstract base configurations to cover common attributes.
3163 'msvs_configuration_attributes': {
3164 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3165 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3166 'CharacterSet': '1',
3168 # Add the default import libs.
3171 'AdditionalDependencies': [
3188 'AdditionalOptions': [
3189 # Suggested by Microsoft Devrel to avoid
3190 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3191 # which started happening more regularly after VS2013 Update 4.
3192 '/maxilksize:2147483647',
3201 'MinimumRequiredVersion': '5.01', # XP.
3202 'TargetMachine': '1',
3204 'VCLibrarianTool': {
3205 'TargetMachine': '1',
3208 'msvs_configuration_platform': 'Win32',
3212 'msvs_configuration_platform': 'x64',
3215 # Make sure to understand http://crbug.com/361720 if you want to
3217 'MinimumRequiredVersion': '5.02', # Server 2003.
3218 'TargetMachine': '17', # x86 - 64
3219 'AdditionalLibraryDirectories!':
3220 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3221 'AdditionalLibraryDirectories':
3222 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3223 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3224 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3226 'VCLibrarianTool': {
3227 'AdditionalLibraryDirectories!':
3228 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3229 'AdditionalLibraryDirectories':
3230 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3231 'TargetMachine': '17', # x64
3238 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3239 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3242 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3244 '<@(debug_extra_cflags)',
3248 'VCCLCompilerTool': {
3249 'Optimization': '<(win_debug_Optimization)',
3250 'PreprocessorDefinitions': ['_DEBUG'],
3251 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3252 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3254 # According to MSVS, InlineFunctionExpansion=0 means
3255 # "default inlining", not "/Ob0".
3256 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3257 ['win_debug_InlineFunctionExpansion==0', {
3258 'AdditionalOptions': ['/Ob0'],
3260 ['win_debug_InlineFunctionExpansion!=""', {
3261 'InlineFunctionExpansion':
3262 '<(win_debug_InlineFunctionExpansion)',
3264 ['win_debug_disable_iterator_debugging==1', {
3265 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3268 # if win_debug_OmitFramePointers is blank, leave as default
3269 ['win_debug_OmitFramePointers==1', {
3270 'OmitFramePointers': 'true',
3272 ['win_debug_OmitFramePointers==0', {
3273 'OmitFramePointers': 'false',
3274 # The above is not sufficient (http://crbug.com/106711): it
3275 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3276 # perform FPO regardless, so we must explicitly disable.
3277 # We still want the false setting above to avoid having
3278 # "/Oy /Oy-" and warnings about overriding.
3279 'AdditionalOptions': ['/Oy-'],
3282 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3285 'LinkIncremental': '<(msvs_debug_link_incremental)',
3286 # ASLR makes debugging with windbg difficult because Chrome.exe and
3287 # Chrome.dll share the same base name. As result, windbg will
3288 # name the Chrome.dll module like chrome_<base address>, where
3289 # <base address> typically changes with each launch. This in turn
3290 # means that breakpoints in Chrome.dll don't stick from one launch
3291 # to the next. For this reason, we turn ASLR off in debug builds.
3292 # Note that this is a three-way bool, where 0 means to pick up
3293 # the default setting, 1 is off and 2 is on.
3294 'RandomizedBaseAddress': 1,
3296 'VCResourceCompilerTool': {
3297 'PreprocessorDefinitions': ['_DEBUG'],
3301 ['OS=="linux" or OS=="android"', {
3302 'target_conditions': [
3303 ['_toolset=="target"', {
3305 '<@(debug_extra_cflags)',
3310 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3311 # Enable libstdc++ debugging facilities to help catch problems
3312 # early, see http://crbug.com/65151 .
3313 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3314 'defines': ['_GLIBCXX_DEBUG=1',],
3316 ['release_valgrind_build==0', {
3319 '-fstack-protector-all', # Implies -fstack-protector
3325 # Allow comparing the address of references and 'this' against 0
3326 # in debug builds. Technically, these can never be null in
3327 # well-defined C/C++ and Clang can optimize such checks away in
3328 # release builds, but they may be used in asserts in debug builds.
3329 '-Wno-undefined-bool-conversion',
3330 '-Wno-tautological-undefined-compare',
3334 '-Wno-undefined-bool-conversion',
3335 '-Wno-tautological-undefined-compare',
3339 'VCCLCompilerTool': {
3340 'AdditionalOptions': [
3341 '-Wno-undefined-bool-conversion',
3342 '-Wno-tautological-undefined-compare',
3355 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3356 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3357 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3360 'VCCLCompilerTool': {
3361 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3363 # In official builds, each target will self-select
3364 # an optimization level.
3365 ['buildtype!="Official"', {
3366 'Optimization': '<(win_release_Optimization)',
3369 # According to MSVS, InlineFunctionExpansion=0 means
3370 # "default inlining", not "/Ob0".
3371 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3372 ['win_release_InlineFunctionExpansion==0', {
3373 'AdditionalOptions': ['/Ob0'],
3375 ['win_release_InlineFunctionExpansion!=""', {
3376 'InlineFunctionExpansion':
3377 '<(win_release_InlineFunctionExpansion)',
3380 # if win_release_OmitFramePointers is blank, leave as default
3381 ['win_release_OmitFramePointers==1', {
3382 'OmitFramePointers': 'true',
3384 ['win_release_OmitFramePointers==0', {
3385 'OmitFramePointers': 'false',
3386 # The above is not sufficient (http://crbug.com/106711): it
3387 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3388 # perform FPO regardless, so we must explicitly disable.
3389 # We still want the false setting above to avoid having
3390 # "/Oy /Oy-" and warnings about overriding.
3391 'AdditionalOptions': ['/Oy-'],
3394 # Put data in separate COMDATs. This allows the linker
3395 # to put bit-identical constants at the same address even if
3396 # they're unrelated constants, which saves binary size.
3397 # This optimization can't be used when ASan is enabled because
3398 # it is not compatible with the ASan ODR checker.
3399 'AdditionalOptions': ['/Gw'],
3402 'AdditionalOptions': [
3403 '/d2Zi+', # Improve debugging of Release builds.
3404 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3405 '<@(win_release_extra_cflags)',
3409 # LinkIncremental is a tri-state boolean, where 0 means default
3410 # (i.e., inherit from parent solution), 1 means false, and
3412 'LinkIncremental': '1',
3413 # This corresponds to the /PROFILE flag which ensures the PDB
3414 # file contains FIXUP information (growing the PDB file by about
3415 # 5%) but does not otherwise alter the output binary. This
3416 # information is used by the Syzygy optimization tool when
3417 # decomposing the release image.
3422 ['msvs_use_common_release', {
3423 'includes': ['release.gypi'],
3425 ['release_valgrind_build==0 and tsan==0', {
3428 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3432 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3433 'MEMORY_SANITIZER_INITIAL_SIZE',
3434 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3435 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3439 'defines': ['NO_TCMALLOC'],
3441 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3442 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3443 # It seems to work fine with Ubuntu 12 headers though, so use it
3444 # in official builds.
3445 ['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")', {
3446 'target_conditions': [
3447 ['chromium_code==1', {
3448 # Non-chromium code is not guaranteed to compile cleanly
3449 # with _FORTIFY_SOURCE. Also, fortified build may fail
3450 # when optimizations are disabled, so only do that for Release
3453 '_FORTIFY_SOURCE=2',
3458 ['OS=="linux" or OS=="android"', {
3459 'target_conditions': [
3460 ['_toolset=="target"', {
3462 '<@(release_extra_cflags)',
3465 ['enable_resource_whitelist_generation==1', {
3467 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3476 'NS_BLOCK_ASSERTIONS=1',
3482 # Concrete configurations
3485 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3488 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3493 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3494 'target_conditions': [
3495 [ '_type=="executable"', {
3496 # To get a real .dSYM bundle produced by dsymutil, set the
3497 # debug information format to dwarf-with-dsym. Since
3498 # strip_from_xcode will not be used, set Xcode to do the
3499 # stripping as well.
3501 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3502 'DEPLOYMENT_POSTPROCESSING': 'YES',
3503 'STRIP_INSTALLED_PRODUCT': 'YES',
3510 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3512 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3515 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3523 'target_defaults': {
3528 # TODO(glider): enable the default options on other systems.
3530 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3532 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3538 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3539 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3540 'target_defaults': {
3542 '-Wl,--fatal-warnings',
3546 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3547 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
3548 'target_defaults': {
3554 ['os_posix==1 and chromeos==0', {
3555 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3556 # and we want to avoid overriding this, so stack-protector is only
3557 # enabled when not building on Chrome OS.
3558 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3560 'target_defaults': {
3562 '-fstack-protector',
3563 '--param=ssp-buffer-size=4',
3567 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3568 'target_defaults': {
3569 # Enable -Werror by default, but put it in a variable so it can
3570 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3572 'werror%': '-Werror',
3573 'libraries_for_target%': '',
3576 '_FILE_OFFSET_BITS=64',
3579 '<(werror)', # See note above about the werror variable.
3581 '-fno-strict-aliasing', # See http://crbug.com/32204
3583 # TODO(evan): turn this back on once all the builds work.
3585 # Don't warn about unused function params. We use those everywhere.
3586 '-Wno-unused-parameter',
3587 # Don't warn about the "struct foo f = {0};" initialization pattern.
3588 '-Wno-missing-field-initializers',
3589 # Don't export any symbols (for example, to plugins we dlopen()).
3590 # Note: this is *required* to make some plugins work.
3591 '-fvisibility=hidden',
3597 '-fno-threadsafe-statics',
3598 # Make inline functions have hidden visiblity by default.
3599 # Surprisingly, not covered by -fvisibility=hidden.
3600 '-fvisibility-inlines-hidden',
3601 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3602 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3606 '-pthread', '-Wl,-z,noexecstack',
3609 '<(libraries_for_target)',
3614 'debug_optimize%': '0',
3620 '-O>(debug_optimize)',
3625 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3626 # TODO(jdduke) Re-enable on mips after resolving linking
3627 # issues with libc++ (crbug.com/456380).
3629 # Warn in case of text relocations.
3630 '-Wl,--warn-shared-textrel',
3633 ['OS=="android" and android_full_debug==0', {
3634 # Some configurations are copied from Release_Base to reduce
3637 'debug_optimize%': 's',
3641 '-ffunction-sections',
3648 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3649 # We don't omit frame pointers on arm64 since they are required
3650 # to correctly unwind stackframes which contain system library
3651 # function frames (crbug.com/391706).
3653 '-fomit-frame-pointer',
3656 ['OS=="linux" and target_arch=="ia32"', {
3658 '-Wl,--no-as-needed',
3661 ['debug_unwind_tables==1', {
3662 'cflags': ['-funwind-tables'],
3664 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3665 'defines': ['NO_UNWIND_TABLES'],
3667 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3668 # definitions in to the right scope to use them when setting
3669 # linux_use_debug_fission, so it can be used here alone.
3670 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3671 'cflags': ['-gsplit-dwarf'],
3677 'release_optimize%': '2',
3678 # Binaries become big and gold is unable to perform GC
3679 # and remove unused sections for some of test targets
3680 # on 32 bit platform.
3681 # (This is currently observed only in chromeos valgrind bots)
3682 # The following flag is to disable --gc-sections linker
3683 # option for these bots.
3684 'no_gc_sections%': 0,
3686 # TODO(bradnelson): reexamine how this is done if we change the
3687 # expansion of configurations
3688 'release_valgrind_build%': 0,
3691 '-O<(release_optimize)',
3692 # Don't emit the GCC version ident directives, they just end up
3693 # in the .comment section taking up binary size.
3695 # Put data and code in their own sections, so that unused symbols
3696 # can be removed at link time with --gc-sections.
3698 '-ffunction-sections',
3701 # Specifically tell the linker to perform optimizations.
3702 # See http://lwn.net/Articles/192624/ .
3707 ['no_gc_sections==0', {
3709 '-Wl,--gc-sections',
3712 ['OS=="android" and target_arch!="arm64"', {
3713 # We don't omit frame pointers on arm64 since they are required
3714 # to correctly unwind stackframes which contain system library
3715 # function frames (crbug.com/391706).
3717 '-fomit-frame-pointer',
3720 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3721 # TODO(jdduke) Re-enable on mips after resolving linking
3722 # issues with libc++ (crbug.com/456380).
3724 # Warn in case of text relocations.
3725 '-Wl,--warn-shared-textrel',
3730 'release_optimize%': 's',
3735 '-fno-omit-frame-pointer',
3739 ['profiling_full_stack_frames==1', {
3742 '-fno-optimize-sibling-calls',
3747 ['release_unwind_tables==1', {
3748 'cflags': ['-funwind-tables'],
3750 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3751 'defines': ['NO_UNWIND_TABLES'],
3757 ['target_arch=="ia32"', {
3758 'target_conditions': [
3759 ['_toolset=="target"', {
3761 # Needed so that libs with .s files (e.g. libicudata.a)
3762 # are compatible with the general 32-bit-ness.
3765 # All floating-point computations on x87 happens in 80-bit
3766 # precision. Because the C and C++ language standards allow
3767 # the compiler to keep the floating-point values in higher
3768 # precision than what's specified in the source and doing so
3769 # is more efficient than constantly rounding up to 64-bit or
3770 # 32-bit precision as specified in the source, the compiler,
3771 # especially in the optimized mode, tries very hard to keep
3772 # values in x87 floating-point stack (in 80-bit precision)
3773 # as long as possible. This has important side effects, that
3774 # the real value used in computation may change depending on
3775 # how the compiler did the optimization - that is, the value
3776 # kept in 80-bit is different than the value rounded down to
3777 # 64-bit or 32-bit. There are possible compiler options to
3778 # make this behavior consistent (e.g. -ffloat-store would keep
3779 # all floating-values in the memory, thus force them to be
3780 # rounded to its original precision) but they have significant
3781 # runtime performance penalty.
3783 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3784 # which keep floating-point values in SSE registers in its
3785 # native precision (32-bit for single precision, and 64-bit
3786 # for double precision values). This means the floating-point
3787 # value used during computation does not change depending on
3788 # how the compiler optimized the code, since the value is
3789 # always kept in its specified precision.
3791 # Refer to http://crbug.com/348761 for rationale behind SSE2
3792 # being a minimum requirement for 32-bit Linux builds and
3793 # http://crbug.com/313032 for an example where this has "bit"
3798 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3805 # Use gold linker for Android ia32 target.
3811 # Install packages have started cropping up with
3812 # different headers between the 32-bit and 64-bit
3813 # versions, so we have to shadow those differences off
3814 # and make sure a 32-bit-on-64-bit build picks up the
3816 # For android build, use NDK headers instead of host headers
3817 ['host_arch!="ia32" and OS!="android"', {
3826 ['target_arch=="x64"', {
3827 'target_conditions': [
3828 ['_toolset=="target"', {
3830 # Use gold linker for Android x64 target.
3847 ['target_arch=="arm"', {
3848 'target_conditions': [
3849 ['_toolset=="target"', {
3853 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3854 # has changed whenever it encounters a varargs function. This
3855 # silences those warnings, as they are not helpful and
3856 # clutter legitimate warnings.
3860 ['clang==1 and arm_arch!="" and OS!="android"', {
3862 '-target arm-linux-gnueabihf',
3865 '-target arm-linux-gnueabihf',
3870 '-march=<(arm_arch)',
3873 ['use_lto==1 or use_lto_o2==1', {
3875 '-march=<(arm_arch)',
3880 ['clang==1 and OS!="android"', {
3882 # We need to disable clang's builtin assembler as it can't
3883 # handle several asm files, crbug.com/124610
3884 '-no-integrated-as',
3889 '-mtune=<(arm_tune)',
3892 ['use_lto==1 or use_lto_o2==1', {
3894 '-mtune=<(arm_tune)',
3904 ['use_lto==1 or use_lto_o2==1', {
3911 ['arm_float_abi!=""', {
3913 '-mfloat-abi=<(arm_float_abi)',
3916 ['use_lto==1 or use_lto_o2==1', {
3918 '-mfloat-abi=<(arm_float_abi)',
3928 ['use_lto==1 or use_lto_o2==1', {
3936 # Most of the following flags are derived from what Android
3937 # uses by default when building for arm, reference for which
3938 # can be found in the following file in the Android NDK:
3939 # toolchains/arm-linux-androideabi-4.9/setup.mk
3941 # The tree-sra optimization (scalar replacement for
3942 # aggregates enabling subsequent optimizations) leads to
3943 # invalid code generation when using the Android NDK's
3944 # compiler (r5-r7). This can be verified using
3945 # webkit_unit_tests' WTF.Checked_int8_t test.
3947 # The following option is disabled to improve binary
3948 # size and performance in gcc 4.9.
3949 '-fno-caller-saves',
3952 # Android now supports .relro sections properly.
3953 # NOTE: While these flags enable the generation of .relro
3954 # sections, the generated libraries can still be loaded on
3955 # older Android platform versions.
3962 ['gcc_version==48 and clang==0', {
3964 # The following 5 options are disabled to save on
3965 # binary size in GCC 4.8.
3966 '-fno-partial-inlining',
3967 '-fno-early-inlining',
3968 '-fno-tree-copy-prop',
3969 '-fno-tree-loop-optimize',
3970 '-fno-move-loop-invariants',
3974 'cflags': [ '-mthumb-interwork' ],
3978 # Thumb code with frame pointer makes chrome crash
3981 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3982 # The perf report sometimes incorrectly attributes
3983 # code from tail calls.
3984 '-fno-optimize-sibling-calls',
3987 '-fomit-frame-pointer',
3992 # Clang does not support the following options.
3993 '-mthumb-interwork',
3994 '-finline-limit=64',
3996 '-fno-caller-saves',
4000 # TODO(hans) Enable integrated-as (crbug.com/124610).
4001 '-no-integrated-as',
4002 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4005 # Let clang find the ld.gold in the NDK.
4006 '--gcc-toolchain=<(android_toolchain)/..',
4011 '-marm', # Required for frame pointer based stack traces.
4018 # We set arm_arch to "" so that -march compiler option
4019 # is not set. Otherwise a gcc bug that would complain
4020 # about it conflicting with '-mcpu=cortex-a9'. The flag
4021 # '-march=armv7-a' is actually redundant anyway because
4022 # it is enabled by default when we built the toolchain.
4023 # And using '-mcpu=cortex-a9' should be sufficient.
4026 # Breakpad requires symbols with debugging information
4030 # We want to statically link libstdc++/libgcc_s.
4031 '-static-libstdc++',
4035 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4036 # define their own cflags for arm builds that could
4037 # conflict with the flags we set here (e.g.
4038 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4047 ['target_arch=="arm64"', {
4048 'target_conditions': [
4049 ['_toolset=="target"', {
4053 '-fstack-protector', # stack protector is always enabled on arm64.
4056 # TODO: Remove webview test once webview fully compiles from
4057 # Chromium. crbug.com/440793
4058 ['OS=="android" and android_webview_build==0', {
4067 ['target_arch=="mipsel"', {
4068 'target_conditions': [
4069 ['_toolset=="target"', {
4071 ['android_webview_build==0', {
4073 ['mips_arch_variant=="r6"', {
4074 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
4077 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4081 ['mips_arch_variant=="r2"', {
4082 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
4084 ['mips_fpu_mode!=""', {
4085 'cflags': ['-m<(mips_fpu_mode)'],
4089 ['mips_arch_variant=="r1"', {
4090 'cflags': ['-mips32', '-Wa,-mips32'],
4092 ['mips_dsp_rev==1', {
4093 'cflags': ['-mdsp'],
4095 ['mips_dsp_rev==2', {
4096 'cflags': ['-mdspr2'],
4100 '-m<(mips_float_abi)-float'
4105 '-Wl,--no-keep-memory'
4108 '-Wno-uninitialized',
4113 ['target_arch=="mips64el"', {
4114 'target_conditions': [
4115 ['_toolset=="target"', {
4117 ['android_webview_build==0', {
4119 ['mips_arch_variant=="r6"', {
4120 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4121 'ldflags': ['-mips64r6'],
4123 ['mips_arch_variant=="r2"', {
4124 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4125 'ldflags': ['-mips64r2'],
4131 '-Wno-uninitialized',
4145 'target_conditions': [
4146 ['_toolset=="target"', {
4148 '--sysroot=<(sysroot)',
4151 '--sysroot=<(sysroot)',
4152 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4158 # TODO(thakis): Remove, http://crbug.com/263960
4159 '-Wno-reserved-user-defined-literal',
4162 # gnu++11 instead of c++11 is needed because some code uses
4163 # typeof() (a GNU extension).
4164 # TODO(thakis): Eventually switch this to c++11 instead,
4165 # http://crbug.com/427584
4169 ['clang==0 and host_clang==1', {
4170 'target_conditions': [
4171 ['_toolset=="host"', {
4172 'cflags_cc': [ '-std=gnu++11', ],
4176 ['clang==1 and clang_use_chrome_plugins==1', {
4178 '<@(clang_chrome_plugins_flags)',
4181 ['clang==1 and clang_load!=""', {
4183 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4186 ['clang==1 and clang_add_plugin!=""', {
4188 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4191 ['clang==1 and target_arch=="ia32"', {
4193 # Else building libyuv gives clang's register allocator issues,
4194 # see llvm.org/PR15798 / crbug.com/233709
4195 '-momit-leaf-frame-pointer',
4196 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4197 '-mstack-alignment=16',
4201 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4203 # See http://crbug.com/110262
4204 '-fcolor-diagnostics',
4207 # Common options for AddressSanitizer, LeakSanitizer,
4208 # ThreadSanitizer and MemorySanitizer.
4209 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4210 'target_conditions': [
4211 ['_toolset=="target"', {
4213 '-fno-omit-frame-pointer',
4214 '-gline-tables-only',
4217 '-fomit-frame-pointer',
4222 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4223 'target_conditions': [
4224 ['_toolset=="target"', {
4226 # Functions interposed by the sanitizers can make ld think
4227 # that some libraries aren't needed when they actually are,
4228 # http://crbug.com/234010. As workaround, disable --as-needed.
4232 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4233 'MEMORY_SANITIZER_INITIAL_SIZE',
4239 'target_conditions': [
4240 ['_toolset=="target"', {
4242 '-fsanitize=address',
4243 # TODO(earthdok): Re-enable. http://crbug.com/427202
4244 #'-fsanitize-blacklist=<(asan_blacklist)',
4247 '-fsanitize=address',
4254 '-mllvm -asan-globals=0', # http://crbug.com/352073
4260 'target_conditions': [
4261 ['_toolset=="target"', {
4263 '-fsanitize=undefined',
4264 '-fsanitize-blacklist=<(ubsan_blacklist)',
4265 # Employ the experimental PBQP register allocator to avoid
4266 # slow compilation on files with too many basic blocks.
4267 # See http://crbug.com/426271.
4268 '-mllvm -regalloc=pbqp',
4269 # Speculatively use coalescing to slightly improve the code
4270 # generated by PBQP regallocator. May increase compile time.
4271 '-mllvm -pbqp-coalescing',
4280 '-fsanitize=undefined',
4283 'UNDEFINED_SANITIZER',
4289 'target_conditions': [
4290 ['_toolset=="target"', {
4293 '-fsanitize-blacklist=<(ubsan_blacklist)',
4305 'UNDEFINED_SANITIZER',
4310 ['asan_coverage!=0 and sanitizer_coverage==0', {
4311 'target_conditions': [
4312 ['_toolset=="target"', {
4314 '-fsanitize-coverage=<(asan_coverage)',
4317 'SANITIZER_COVERAGE',
4322 ['sanitizer_coverage!=0', {
4323 'target_conditions': [
4324 ['_toolset=="target"', {
4326 '-fsanitize-coverage=<(sanitizer_coverage)',
4329 'SANITIZER_COVERAGE',
4334 ['asan_field_padding!=0', {
4335 'target_conditions': [
4336 ['_toolset=="target"', {
4338 '-fsanitize-address-field-padding=<(asan_field_padding)',
4344 'target_conditions': [
4345 ['_toolset=="target"', {
4354 'WTF_USE_LEAK_SANITIZER=1',
4360 'target_conditions': [
4361 ['_toolset=="target"', {
4363 '-fsanitize=thread',
4364 '-fsanitize-blacklist=<(tsan_blacklist)',
4367 '-fsanitize=thread',
4371 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4372 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4378 'target_conditions': [
4379 ['_toolset=="target"', {
4381 '-fsanitize=memory',
4382 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4383 '-fsanitize-blacklist=<(msan_blacklist)',
4386 '-fsanitize=memory',
4394 ['use_instrumented_libraries==1', {
4396 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4399 ['use_custom_libcxx==1', {
4401 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4404 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4405 'target_conditions' : [
4406 # crazy_linker has an upstream gyp file we can't edit, and we
4407 # don't want to instrument it.
4408 ['_toolset=="target" and _target_name!="crazy_linker"', {
4410 '-finstrument-functions',
4411 # Allow mmx intrinsics to inline, so that the
4412 #0 compiler can expand the intrinsics.
4413 '-finstrument-functions-exclude-file-list=mmintrin.h',
4416 ['_toolset=="target" and OS=="android"', {
4418 # Avoids errors with current NDK:
4419 # "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"
4420 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4425 ['linux_dump_symbols==1', {
4428 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4429 'target_conditions': [
4430 ['_toolset=="target"', {
4432 # Attempt to use less memory to prevent the linker from
4433 # running out of address space. Considering installing a
4434 # 64-bit kernel and switching to a 64-bit linker.
4435 '-Wl,--no-keep-memory',
4442 ['use_allocator!="tcmalloc"', {
4443 'defines': ['NO_TCMALLOC'],
4445 ['linux_use_gold_flags==1', {
4446 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4448 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4449 'ldflags': [ '-fuse-ld=gold', ],
4451 'target_conditions': [
4452 ['_toolset=="target"', {
4454 # Experimentation found that using four linking threads
4455 # saved ~20% of link time.
4456 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4457 # Only apply this to the target linker, since the host
4458 # linker might not be gold, but isn't used much anyway.
4459 # TODO(raymes): Disable threading because gold is frequently
4460 # crashing on the bots: crbug.com/161942.
4462 # '-Wl,--thread-count=4',
4467 ['release_valgrind_build==0 and order_profiling==0', {
4468 'target_conditions': [
4469 ['_toolset=="target"', {
4471 '-Wl,--icf=<(gold_icf_level)',
4478 ['linux_use_bundled_binutils==1', {
4480 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4483 ['linux_use_bundled_gold==1', {
4484 # Put our binutils, which contains gold in the search path. We pass
4485 # the path to gold to the compiler. gyp leaves unspecified what the
4486 # cwd is when running the compiler, so the normal gyp path-munging
4487 # fails us. This hack gets the right path.
4489 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4492 # Some binutils 2.23 releases may or may not have new dtags enabled,
4493 # but they are all compatible with --disable-new-dtags,
4494 # because the new dynamic tags are not created by default.
4495 ['binutils_version>=223', {
4496 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4497 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4498 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4499 # inside this file to allow usage of --no-as-needed and removal of
4502 '-Wl,--disable-new-dtags',
4505 ['gcc_version>=47 and clang==0', {
4506 'target_conditions': [
4507 ['_toolset=="target"', {
4510 # See comment for -Wno-c++11-narrowing.
4512 # TODO(thakis): Remove, http://crbug.com/263960
4513 '-Wno-literal-suffix',
4518 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4519 'target_conditions': [
4520 ['_toolset=="host"', {
4523 # See comment for -Wno-c++11-narrowing.
4525 # TODO(thakis): Remove, http://crbug.com/263960
4526 '-Wno-literal-suffix',
4534 # FreeBSD-specific options; note that most FreeBSD options are set above,
4537 'target_defaults': {
4539 '-Wl,--no-keep-memory',
4543 # Android-specific options; note that most are set above with Linux.
4546 # This is a unique identifier for a given build. It's used for
4547 # identifying various build artifacts corresponding to a particular
4548 # build of chrome (e.g. where to find archived symbols).
4549 'chrome_build_id%': '',
4551 # Figure this out early since it needs symbols from libgcc.a, so it
4552 # has to be before that in the set of libraries.
4553 ['component=="shared_library"', {
4554 'android_stlport_library': 'stlport_shared',
4556 'android_stlport_library': 'stlport_static',
4560 # Placing this variable here prevents from forking libvpx, used
4561 # by remoting. Remoting is off, so it needn't built,
4562 # so forking it's deps seems like overkill.
4563 # But this variable need defined to properly run gyp.
4564 # A proper solution is to have an OS==android conditional
4565 # in third_party/libvpx/libvpx.gyp to define it.
4566 'libvpx_path': 'lib/linux/arm',
4568 'target_defaults': {
4570 'release_extra_cflags%': '',
4572 # If we're using the components build, append "cr" to all shared
4573 # libraries to avoid naming collisions with android system library
4574 # versions with the same name (e.g. skia, icu).
4575 ['component=="shared_library"', {
4576 'android_product_extension': 'cr.so',
4578 'android_product_extension': 'so',
4582 'target_conditions': [
4583 ['_type=="shared_library"', {
4584 'product_extension': '<(android_product_extension)',
4587 # Settings for building device targets using Android's toolchain.
4588 # These are based on the setup.mk file from the Android NDK.
4590 # The NDK Android executable link step looks as follows:
4592 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4593 # $(PRIVATE_OBJECTS) <-- The .o that we built
4594 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4595 # $(TARGET_LIBGCC) <-- libgcc.a
4596 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4597 # $(PRIVATE_LDLIBS) <-- System .so
4598 # $(TARGET_CRTEND_O) <-- crtend.o
4600 # For now the above are approximated for executables by adding
4601 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4604 # The NDK Android shared library link step looks as follows:
4606 # $(PRIVATE_OBJECTS) <-- The .o that we built
4607 # -l,--whole-archive
4608 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4609 # -l,--no-whole-archive
4610 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4611 # $(TARGET_LIBGCC) <-- libgcc.a
4612 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4613 # $(PRIVATE_LDLIBS) <-- System .so
4615 # For now, assume that whole static libraries are not needed.
4617 # For both executables and shared libraries, add the proper
4618 # libgcc.a to the start of libraries which puts it in the
4619 # proper spot after .o and .a files get linked in.
4621 # TODO: The proper thing to do longer-tem would be proper gyp
4622 # support for a custom link command line.
4623 ['_toolset=="target"', {
4625 '-pthread', # Not supported by Android toolchain.
4628 '-ffunction-sections',
4631 '-fstack-protector',
4633 '-finline-limit=64',
4634 '-Wa,--noexecstack',
4635 '<@(release_extra_cflags)',
4639 '__GNU_SOURCE=1', # Necessary for clone()
4641 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4642 'CHROME_BUILD_ID="<(chrome_build_id)"',
4645 '-pthread', # Not supported by Android toolchain.
4648 '-Wl,--no-undefined',
4651 ['component=="static_library" and android_webview_build==0', {
4652 'target_conditions': [
4653 ['use_native_jni_exports==0', {
4654 # Use a linker version script to strip JNI exports from
4655 # binaries which have not specifically asked to use them.
4657 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4664 # Work around incompatibilities between bionic and clang
4666 '-D__compiler_offsetof=__builtin_offsetof',
4667 '-Dnan=__builtin_nan',
4670 ['target_arch=="arm"', {
4672 '-target arm-linux-androideabi',
4675 '-target arm-linux-androideabi',
4678 ['target_arch=="ia32"', {
4680 '-target x86-linux-androideabi',
4683 '-target x86-linux-androideabi',
4686 # Place holder for x64 support, not tested.
4687 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4688 ['target_arch=="x64"', {
4690 '-target x86_64-linux-androideabi',
4693 '-target x86_64-linux-androideabi',
4700 # Android build relies on -Wl,--gc-sections removing
4701 # unreachable code. ASan instrumentation for globals inhibits
4702 # this and results in a library with unresolvable relocations.
4703 # TODO(eugenis): find a way to reenable this.
4704 '-mllvm -asan-globals=0',
4707 ['android_webview_build==0', {
4709 # The NDK has these things, but doesn't define the constants
4710 # to say that it does. Define them here instead.
4714 '--sysroot=<(android_ndk_sysroot)',
4717 '--sysroot=<(android_ndk_sysroot)',
4719 # Don't allow visible symbols from libgcc or stlport to be
4721 '-Wl,--exclude-libs=libgcc.a',
4722 '-Wl,--exclude-libs=libstlport_static.a',
4723 # Don't allow visible symbols from libraries that contain
4724 # assembly code with symbols that aren't hidden properly.
4725 # http://crbug.com/448386
4726 '-Wl,--exclude-libs=libcommon_audio.a',
4727 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4728 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4729 '-Wl,--exclude-libs=libiSACFix.a',
4730 '-Wl,--exclude-libs=libisac_neon.a',
4731 '-Wl,--exclude-libs=libopus.a',
4732 '-Wl,--exclude-libs=libvpx.a',
4735 '-l<(android_stlport_library)',
4736 # Manually link the libgcc.a that the cross compiler uses.
4737 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4743 ['android_webview_build==1', {
4745 # Android predefines this as 1; undefine it here so Chromium
4746 # can redefine it later to be 2 for chromium code and unset
4747 # for third party code. This works because cflags are added
4749 '-U_FORTIFY_SOURCE',
4750 # Disable any additional warnings enabled by the Android build system but which
4751 # chromium does not build cleanly with (when treating warning as errors).
4752 # Things that are part of -Wextra:
4753 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4754 '-Wno-ignored-qualifiers',
4756 '-Wno-unused-but-set-variable',
4759 # Other things unrelated to -Wextra:
4760 '-Wno-non-virtual-dtor',
4767 ['android_webview_build==1', {
4768 'target_conditions': [
4769 ['chromium_code==0', {
4771 # There is a class of warning which:
4772 # 1) Android always enables and also treats as errors
4773 # 2) Chromium ignores in third party code
4774 # So we re-enable those warnings when building Android.
4776 '-Wno-format-security',
4778 '-Wno-sequence-point',
4781 '-Wno-non-virtual-dtor',
4786 ['target_arch == "arm" and order_profiling==0', {
4788 # Enable identical code folding to reduce size.
4789 '-Wl,--icf=<(gold_icf_level)',
4792 # NOTE: The stlport header include paths below are specified in
4793 # cflags rather than include_dirs because they need to come
4794 # after include_dirs. Think of them like system headers, but
4795 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4796 # toolchain (circa Gingerbread) will exhibit strange errors.
4797 # The include ordering here is important; change with caution.
4798 ['android_webview_build==0', {
4800 '-isystem<(android_stlport_include)',
4803 '-L<(android_stlport_libs_dir)',
4805 }, { # else: android_webview_build!=0
4806 'aosp_build_settings': {
4807 # Specify that we want to statically link stlport from the
4808 # NDK. This will provide all the include and library paths
4809 # automatically at build time, and link the right library.
4810 'LOCAL_NDK_STL_VARIANT': 'stlport_static',
4813 ['target_arch=="ia32"', {
4814 # The x86 toolchain currently has problems with stack-protector.
4816 '-fstack-protector',
4819 '-fno-stack-protector',
4823 'target_conditions': [
4824 ['_type=="executable"', {
4825 # Force android tools to export the "main" symbol so they can be
4826 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4827 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4828 # when ICS support will be dropped.
4831 '-fvisibility=default',
4835 '-Wl,--gc-sections',
4836 '-Wl,-z,nocopyreloc',
4839 # crtbegin_dynamic.o should be the last item in ldflags.
4840 '<(android_ndk_lib)/crtbegin_dynamic.o',
4843 # crtend_android.o needs to be the last item in libraries.
4844 # Do not add any libraries after this!
4845 '<(android_ndk_lib)/crtend_android.o',
4848 ['_type=="shared_library" or _type=="loadable_module"', {
4850 '-Wl,-shared,-Bsymbolic',
4853 ['android_webview_build==0', {
4855 # crtbegin_so.o should be the last item in ldflags.
4856 '<(android_ndk_lib)/crtbegin_so.o',
4859 # crtend_so.o needs to be the last item in libraries.
4860 # Do not add any libraries after this!
4861 '<(android_ndk_lib)/crtend_so.o',
4868 # Settings for building host targets using the system toolchain.
4869 ['_toolset=="host"', {
4871 # Due to issues in Clang build system, using ASan on 32-bit
4872 # binaries on x86_64 host is problematic.
4873 # TODO(eugenis): re-enable.
4874 '-fsanitize=address',
4877 '-fsanitize=address',
4878 '-Wl,-z,noexecstack',
4879 '-Wl,--gc-sections',
4882 '-Wl,--warn-shared-textrel',
4883 '-Wl,--fatal-warnings',
4886 # Settings for building host targets on mac.
4887 ['_toolset=="host" and host_os=="mac"', {
4897 'cflags!': ['-fvisibility=hidden'],
4898 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4900 ['OS=="mac" or OS=="ios"', {
4901 'target_defaults': {
4904 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4905 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4906 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4907 'COPY_PHASE_STRIP': 'NO',
4908 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4909 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4910 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4911 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4912 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4913 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4914 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4915 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4916 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4917 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4918 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4919 'GCC_VERSION': '4.2',
4920 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4921 'USE_HEADERMAP': 'NO',
4926 # Don't warn about unused function parameters.
4927 '-Wno-unused-parameter',
4928 # Don't warn about the "struct foo f = {0};" initialization
4930 '-Wno-missing-field-initializers',
4933 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4934 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4936 # Note that the prebuilt Clang binaries should not be used for iOS
4937 # development except for ASan builds.
4939 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
4940 # Warn if automatic synthesis is triggered with
4941 # the -Wobjc-missing-property-synthesis flag.
4942 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4943 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4945 # This warns on selectors from Cocoa headers (-length, -set).
4946 # cfe-dev is currently discussing the merits of this warning.
4947 # TODO(thakis): Reevaluate what to do with this, based one
4948 # cfe-dev discussion.
4949 '-Wno-selector-type-mismatch',
4952 ['clang_xcode==0', {
4953 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4954 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4958 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4960 '<@(clang_chrome_plugins_flags)',
4963 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4965 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4968 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4970 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4973 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4975 # See http://crbug.com/110262
4976 '-fcolor-diagnostics',
4979 ['OS=="ios" and target_subarch!="arm32" and \
4980 "<(GENERATOR)"=="xcode"', {
4982 # TODO(ios): when building Chrome for iOS on 64-bit platform
4983 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4984 # enabled. This cause failures when compiling protobuf code,
4985 # so disable the warning. http://crbug.com/359107
4986 '-Wno-shorten-64-to-32',
4994 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
5000 '-fsanitize=address',
5001 '-mllvm -asan-globals=0', # http://crbug.com/352073
5002 '-gline-tables-only',
5006 ['asan_coverage!=0 and sanitizer_coverage==0', {
5007 'target_conditions': [
5008 ['_toolset=="target"', {
5010 '-fsanitize-coverage=<(asan_coverage)',
5013 'SANITIZER_COVERAGE',
5018 ['sanitizer_coverage!=0', {
5019 'target_conditions': [
5020 ['_toolset=="target"', {
5022 '-fsanitize-coverage=<(sanitizer_coverage)',
5025 'SANITIZER_COVERAGE',
5031 'target_conditions': [
5032 ['_type!="static_library"', {
5033 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5038 '-fsanitize=address',
5042 ['mac_write_linker_maps==1', {
5045 '-Wl,-map,>(_target_name).map',
5052 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5053 'target_conditions': [
5054 ['_type=="executable"', {
5060 # Define copy_asan_dylib_path in a variable ending in
5061 # _path so that gyp understands it's a path and
5062 # performs proper relativization during dict merging.
5063 'copy_asan_dylib_path':
5064 'mac/copy_asan_runtime_dylib.sh',
5066 'postbuild_name': 'Copy ASan runtime dylib',
5068 '<(copy_asan_dylib_path)',
5077 ], # target_conditions
5078 }, # target_defaults
5079 }], # OS=="mac" or OS=="ios"
5081 'target_defaults': {
5083 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5084 # with common names, like 'check', 'require', and 'verify'.
5085 # (Included by system header. Also exists on iOS but not included.)
5086 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5087 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5090 # These should end with %, but there seems to be a bug with % in
5091 # variables that are intended to be set to different values in
5092 # different targets, like these.
5093 'mac_pie': 1, # Most executables can be position-independent.
5094 # Strip debugging symbols from the target.
5095 'mac_strip': '<(mac_strip_release)',
5099 ['mac_want_real_dsym=="default"', {
5102 'mac_real_dsym': '<(mac_want_real_dsym)'
5107 ['mac_want_real_dsym=="default"', {
5108 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5110 'mac_real_dsym': '<(mac_want_real_dsym)'
5117 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5118 # (Equivalent to -fPIC)
5119 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5120 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5121 # Keep pch files below xcodebuild/.
5122 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5124 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5125 # xcode_setting, but not until all downstream projects' mac bots are
5126 # using xcode >= 4.6, because that's when the default value of the
5127 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5128 # setting is a no-op as far as xcode is concerned, but the compiler
5129 # behaves differently based on whether -fno-strict-aliasing is
5131 '-fno-strict-aliasing', # See http://crbug.com/32204.
5134 'target_conditions': [
5135 ['_type=="executable"', {
5138 # Arranges for data (heap) pages to be protected against
5139 # code execution when running on Mac OS X 10.7 ("Lion"), and
5140 # ensures that the position-independent executable (PIE) bit
5141 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5143 # Define change_mach_o_flags in a variable ending in _path
5144 # so that GYP understands it's a path and performs proper
5145 # relativization during dict merging.
5146 'change_mach_o_flags_path':
5147 'mac/change_mach_o_flags_from_xcode.sh',
5148 'change_mach_o_flags_options%': [
5150 'target_conditions': [
5151 ['mac_pie==0 or release_valgrind_build==1', {
5152 # Don't enable PIE if it's unwanted. It's unwanted if
5153 # the target specifies mac_pie=0 or if building for
5154 # Valgrind, because Valgrind doesn't understand slide.
5155 # See the similar mac_pie/release_valgrind_build check
5157 'change_mach_o_flags_options': [
5163 'postbuild_name': 'Change Mach-O Flags',
5165 '<(change_mach_o_flags_path)',
5166 '>@(change_mach_o_flags_options)',
5170 'target_conditions': [
5171 ['mac_pie==1 and release_valgrind_build==0', {
5172 # Turn on position-independence (ASLR) for executables. When
5173 # PIE is on for the Chrome executables, the framework will
5174 # also be subject to ASLR.
5175 # Don't do this when building for Valgrind, because Valgrind
5176 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5177 # understand slide, and get rid of the Valgrind check.
5180 '-Wl,-pie', # Position-independent executable (MH_PIE)
5186 ['(_type=="executable" or _type=="shared_library" or \
5187 _type=="loadable_module") and mac_strip!=0', {
5188 'target_conditions': [
5189 ['mac_real_dsym == 1', {
5190 # To get a real .dSYM bundle produced by dsymutil, set the
5191 # debug information format to dwarf-with-dsym. Since
5192 # strip_from_xcode will not be used, set Xcode to do the
5193 # stripping as well.
5197 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5198 'DEPLOYMENT_POSTPROCESSING': 'YES',
5199 'STRIP_INSTALLED_PRODUCT': 'YES',
5201 # Only strip non-ASan builds.
5203 'target_conditions': [
5204 ['_type=="shared_library" or _type=="loadable_module"', {
5205 # The Xcode default is to strip debugging symbols
5206 # only (-S). Local symbols should be stripped as
5207 # well, which will be handled by -x. Xcode will
5208 # continue to insert -S when stripping even when
5209 # additional flags are added with STRIPFLAGS.
5211 }], # _type=="shared_library" or _type=="loadable_module"
5212 ], # target_conditions
5218 }, # configuration "Release"
5220 }, { # mac_real_dsym != 1
5221 # To get a fast fake .dSYM bundle, use a post-build step to
5222 # produce the .dSYM and strip the executable. strip_from_xcode
5223 # only operates in the Release configuration.
5227 # Define strip_from_xcode in a variable ending in _path
5228 # so that gyp understands it's a path and performs proper
5229 # relativization during dict merging.
5230 'strip_from_xcode_path': 'mac/strip_from_xcode',
5232 'postbuild_name': 'Strip If Needed',
5233 'action': ['<(strip_from_xcode_path)'],
5237 ], # target_conditions
5238 }], # (_type=="executable" or _type=="shared_library" or
5239 # _type=="loadable_module") and mac_strip!=0
5240 ], # target_conditions
5241 }, # target_defaults
5245 'ios/coverage.gypi',
5247 'target_defaults': {
5248 'xcode_settings' : {
5249 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5252 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5253 # additional flag to suppress the "unknown compiler option" error.
5254 # Restrict this flag to builds that are either compiling with Xcode
5255 # or compiling with Xcode's Clang. This will allow Ninja builds to
5256 # continue failing on unknown compiler options.
5257 # TODO(rohitrao): This flag is temporary and should be removed as
5258 # soon as the iOS bots are updated to use Xcode 5.1.
5259 ['clang_xcode==1', {
5261 '-Wno-unknown-warning-option',
5265 # Limit the valid architectures depending on "target_subarch".
5266 # This need to include the "arm" architectures but also the "x86"
5267 # ones (they are used when building for the simulator).
5268 ['target_subarch=="arm32"', {
5269 'VALID_ARCHS': ['armv7', 'i386'],
5271 ['target_subarch=="arm64"', {
5272 'VALID_ARCHS': ['arm64', 'x86_64'],
5274 ['target_subarch=="both"', {
5275 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5277 ['use_system_libcxx==1', {
5278 'target_conditions': [
5279 # Only use libc++ when building target for iOS not when building
5280 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5281 # does not support libc++.
5282 ['_toolset=="target"', {
5283 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5287 # The default for deployment target of 7.0+ is libc++, so force
5288 # the old behavior unless libc++ is enabled.
5289 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5293 'target_conditions': [
5294 ['_toolset=="host"', {
5296 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5297 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5306 ['_toolset=="target"', {
5308 # This section should be for overriding host settings. But,
5309 # since we can't negate the iphone deployment target above, we
5310 # instead set it here for target only.
5311 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5312 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5315 ['_type=="executable"', {
5319 'DEPLOYMENT_POSTPROCESSING': 'YES',
5320 'STRIP_INSTALLED_PRODUCT': 'YES',
5325 # Remove dSYM to reduce build time.
5326 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5332 ['chromium_ios_signing', {
5333 # iOS SDK wants everything for device signed.
5334 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5336 'CODE_SIGNING_REQUIRED': 'NO',
5337 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5342 ], # target_conditions
5343 }, # target_defaults
5346 'target_defaults': {
5348 '_WIN32_WINNT=0x0603',
5355 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5356 'WIN32_LEAN_AND_MEAN',
5359 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5360 '_HAS_EXCEPTIONS=0',
5361 # Silence some warnings; we can't switch the the 'recommended'
5362 # versions as they're not available on old OSs.
5363 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5366 ['buildtype=="Official"', {
5367 # In official builds, targets can self-select an optimization
5368 # level by defining a variable named 'optimize', and setting it
5370 # - "size", optimizes for minimal code size - the default.
5371 # - "speed", optimizes for speed over code size.
5372 # - "max", whole program optimization and link-time code
5373 # generation. This is very expensive and should be used
5376 'optimize%': 'size',
5380 # Set /LTCG for the official builds.
5381 'LinkTimeCodeGeneration': '1',
5382 'AdditionalOptions': [
5383 # Set the number of LTCG code-gen threads to eight.
5384 # The default is four. This gives a 5-10% link speedup.
5389 'target_conditions': [
5390 ['optimize=="size"', {
5392 'VCCLCompilerTool': {
5393 # 1, optimizeMinSpace, Minimize Size (/O1)
5394 'Optimization': '1',
5395 # 2, favorSize - Favor small code (/Os)
5396 'FavorSizeOrSpeed': '2',
5401 ['optimize=="speed"', {
5403 'VCCLCompilerTool': {
5404 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5405 'Optimization': '2',
5406 # 1, favorSpeed - Favor fast code (/Ot)
5407 'FavorSizeOrSpeed': '1',
5412 ['optimize=="max"', {
5413 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5414 # builds. Probably anything that this would catch that
5415 # wouldn't be caught in a normal build isn't going to
5416 # actually be a bug, so the incremental value of C4702 for
5417 # PGO builds is likely very small.
5418 'msvs_disabled_warnings': [
5422 'VCCLCompilerTool': {
5423 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5424 'Optimization': '2',
5425 # 1, favorSpeed - Favor fast code (/Ot)
5426 'FavorSizeOrSpeed': '1',
5427 # This implies link time code generation.
5428 'WholeProgramOptimization': 'true',
5436 ['msvs_xtree_patched!=1', {
5437 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5438 # it's enabled. This will generally only be true for system-level
5439 # installed Express users.
5440 'msvs_disabled_warnings': [
5445 'msvs_system_include_dirs': [
5446 '<(windows_sdk_path)/Include/shared',
5447 '<(windows_sdk_path)/Include/um',
5448 '<(windows_sdk_path)/Include/winrt',
5449 '$(VSInstallDir)/VC/atlmfc/include',
5451 'msvs_cygwin_shell': 0,
5452 'msvs_disabled_warnings': [
5453 # C4127: conditional expression is constant
5454 # This warning can in theory catch dead code and other problems, but
5455 # triggers in far too many desirable cases where the conditional
5456 # expression is either set by macros or corresponds some legitimate
5457 # compile-time constant expression (due to constant template args,
5458 # conditionals comparing the sizes of different types, etc.). Some of
5459 # these can be worked around, but it's not worth it.
5462 # C4351: new behavior: elements of array 'array' will be default
5464 # This is a silly "warning" that basically just alerts you that the
5465 # compiler is going to actually follow the language spec like it's
5466 # supposed to, instead of not following it like old buggy versions
5467 # did. There's absolutely no reason to turn this on.
5470 # C4355: 'this': used in base member initializer list
5471 # It's commonly useful to pass |this| to objects in a class'
5472 # initializer list. While this warning can catch real bugs, most of
5473 # the time the constructors in question don't attempt to call methods
5474 # on the passed-in pointer (until later), and annotating every legit
5475 # usage of this is simply more hassle than the warning is worth.
5478 # C4503: 'identifier': decorated name length exceeded, name was
5480 # This only means that some long error messages might have truncated
5481 # identifiers in the presence of lots of templates. It has no effect
5482 # on program correctness and there's no real reason to waste time
5483 # trying to prevent it.
5486 # C4611: interaction between 'function' and C++ object destruction is
5488 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5489 # suggests using exceptions instead of setjmp/longjmp for C++, but
5490 # Chromium code compiles without exception support. We therefore have
5491 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5492 # means we have to turn off this warning (and be careful about how
5493 # object destruction happens in such cases).
5496 # TODO(maruel): These warnings are level 4. They will be slowly
5497 # removed as code is fixed.
5498 4100, # Unreferenced formal parameter
5499 4121, # Alignment of a member was sensitive to packing
5500 4244, # Conversion from 'type1' to 'type2', possible loss of data
5501 4481, # Nonstandard extension used: override specifier 'keyword'
5502 4505, # Unreferenced local function has been removed
5503 4510, # Default constructor could not be generated
5504 4512, # Assignment operator could not be generated
5505 4610, # Object can never be instantiated
5506 4996, # 'X': was declared deprecated (for GetVersionEx).
5509 'VCCLCompilerTool': {
5510 'AdditionalOptions': ['/MP'],
5511 'MinimalRebuild': 'false',
5512 'BufferSecurityCheck': 'true',
5513 'EnableFunctionLevelLinking': 'true',
5514 'RuntimeTypeInfo': 'false',
5515 'WarningLevel': '4',
5516 'WarnAsError': 'true',
5517 'DebugInformationFormat': '3',
5518 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5519 'ExceptionHandling': '0',
5521 'VCLibrarianTool': {
5522 'AdditionalOptions': ['/ignore:4221'],
5523 'AdditionalLibraryDirectories': [
5524 '<(windows_sdk_path)/Lib/win8/um/x86',
5528 'AdditionalDependencies': [
5540 'AdditionalLibraryDirectories': [
5541 '<(windows_sdk_path)/Lib/win8/um/x86',
5543 'GenerateDebugInformation': 'true',
5544 'MapFileName': '$(OutDir)\\$(TargetName).map',
5545 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5546 'FixedBaseAddress': '1',
5549 # 1 == /SUBSYSTEM:CONSOLE
5550 # 2 == /SUBSYSTEM:WINDOWS
5551 # Most of the executables we'll ever create are tests
5552 # and utilities with console output.
5556 'GenerateStublessProxies': 'true',
5557 'TypeLibraryName': '$(InputName).tlb',
5558 'OutputDirectory': '$(IntDir)',
5559 'HeaderFileName': '$(InputName).h',
5560 'DLLDataFileName': '$(InputName).dlldata.c',
5561 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5562 'ProxyFileName': '$(InputName)_p.c',
5564 'VCResourceCompilerTool': {
5566 'AdditionalIncludeDirectories': [
5568 '<(SHARED_INTERMEDIATE_DIR)',
5571 'target_conditions': [
5572 ['_type=="executable"', {
5574 'EmbedManifest': 'true',
5577 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5579 'AdditionalManifestFiles': [
5580 '>(win_exe_compatibility_manifest)',
5586 # Building with Clang on Windows is a work in progress and very
5587 # experimental. See crbug.com/82385.
5589 'VCCLCompilerTool': {
5590 'AdditionalOptions': [
5591 '-fmsc-version=1800',
5593 # Many files use intrinsics without including this header.
5594 # TODO(hans): Fix those files, or move this to sub-GYPs.
5597 # TODO(hans): Make this list shorter eventually.
5598 '-Qunused-arguments',
5599 '-Wno-c++11-compat-deprecated-writable-strings',
5600 '-Wno-deprecated-declarations',
5602 '-Wno-enum-conversion',
5603 '-Wno-extra-tokens',
5604 '-Wno-ignored-attributes',
5605 '-Wno-incompatible-pointer-types',
5606 '-Wno-int-to-void-pointer-cast',
5607 '-Wno-invalid-noreturn',
5608 '-Wno-logical-op-parentheses',
5610 '-Wno-missing-braces',
5611 '-Wno-missing-declarations',
5612 '-Wno-msvc-include',
5613 '-Wno-null-dereference',
5614 '-Wno-overloaded-virtual',
5616 '-Wno-pointer-sign',
5618 '-Wno-return-type-c-linkage',
5620 '-Wno-sometimes-uninitialized',
5622 '-Wno-tautological-compare',
5623 '-Wno-unknown-pragmas',
5625 '-Wno-unused-function',
5626 '-Wno-unused-private-field',
5627 '-Wno-unused-value',
5628 '-Wno-unused-variable',
5629 '-Wno-unused-local-typedef', # http://crbug.com/411648
5630 '-Wno-inconsistent-missing-override', #http://crbug.com/428099
5634 ['clang==1 and target_arch=="ia32"', {
5635 'VCCLCompilerTool': {
5636 'WarnAsError': 'false',
5637 'AdditionalOptions': [
5646 ['disable_nacl==1', {
5647 'target_defaults': {
5653 ['OS=="win" and msvs_use_common_linker_extras', {
5654 'target_defaults': {
5669 'AdditionalOptions': [
5680 'AdditionalOptions': ['/largeaddressaware'],
5684 # TODO(asan/win): Move this down into the general
5685 # win-target_defaults section once the 64-bit asan runtime
5686 # exists. See crbug.com/345874.
5687 'VCCLCompilerTool': {
5688 'AdditionalOptions': [
5689 '-fsanitize=address',
5690 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5692 'AdditionalIncludeDirectories': [
5693 # MSVC needs to be able to find the sanitizer headers when
5694 # invoked via /fallback. This is critical for using macros
5695 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5697 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/include_sanitizer',
5701 'AdditionalLibraryDirectories': [
5702 # TODO(hans): If make_clang_dir is absolute, this breaks.
5703 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/lib/windows',
5706 'target_conditions': [
5707 ['component=="shared_library"', {
5709 'AdditionalDependencies': [
5710 'clang_rt.asan_dynamic-i386.lib',
5711 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5715 ['_type=="executable" and component=="static_library"', {
5717 'AdditionalDependencies': [
5718 'clang_rt.asan-i386.lib',
5722 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5724 'AdditionalDependencies': [
5725 'clang_rt.asan_dll_thunk-i386.lib',
5737 'AdditionalOptions': [
5738 # safeseh is not compatible with x64
5750 ['enable_new_npdevice_api==1', {
5751 'target_defaults': {
5753 'ENABLE_NEW_NPDEVICE_API',
5757 # Don't warn about the "typedef 'foo' locally defined but not used"
5758 # for gcc 4.8 and higher.
5759 # TODO: remove this flag once all builds work. See crbug.com/227506
5760 ['gcc_version>=48 and clang==0', {
5761 'target_defaults': {
5763 '-Wno-unused-local-typedefs',
5767 ['gcc_version>=48 and clang==0 and host_clang==1', {
5768 'target_defaults': {
5769 'target_conditions': [
5770 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5774 # In the android webview build, force host targets to be compiled with clang
5775 # as the hermetic host gcc is very old on some platforms. This is already
5776 # the default on the current development version of AOSP but we force it
5777 # here in case we need to compile against an older release version. We also
5778 # explicitly set it to false for target binaries to avoid causing problems
5779 # for the work to enable clang by default in AOSP. We also force the use of
5780 # libstdc++ on host as peculiarities of the android gyp backend mean that
5781 # using libc++ doesn't work, and Chromium doesn't yet require a more modern
5783 ['android_webview_build==1', {
5784 'target_defaults': {
5785 'target_conditions': [
5786 ['_toolset=="host"', {
5787 'aosp_build_settings': {
5788 'LOCAL_CLANG': 'true',
5789 'LOCAL_CXX_STL': 'libstdc++',
5791 }, { # else: _toolset != "host"
5792 'aosp_build_settings': {
5793 'LOCAL_CLANG': 'false',
5799 # We need a special case to handle the android webview build on mac because
5800 # the host gcc there doesn't accept this flag, but the target gcc may
5802 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5803 'target_defaults': {
5804 'target_conditions': [
5805 ['_toolset=="host"', {
5807 '-Wno-unused-local-typedefs',
5813 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5815 'make_global_settings': [
5816 ['CC', '<(make_clang_dir)/bin/clang'],
5817 ['CXX', '<(make_clang_dir)/bin/clang++'],
5818 ['CC.host', '$(CC)'],
5819 ['CXX.host', '$(CXX)'],
5822 ['clang==1 and OS=="win"', {
5823 'make_global_settings': [
5824 # On Windows, gyp's ninja generator only looks at CC.
5825 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5828 ['use_lld==1 and OS=="win"', {
5829 'make_global_settings': [
5830 # Limited to Windows because lld-link is the driver that is compatible
5832 ['LD', '<(make_clang_dir)/bin/lld-link'],
5835 ['OS=="android" and clang==0', {
5836 # Hardcode the compiler names in the Makefile so that
5837 # it won't depend on the environment at make time.
5838 'make_global_settings': [
5839 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5840 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5841 ['CC.host', '<(host_cc)'],
5842 ['CXX.host', '<(host_cxx)'],
5845 ['OS=="linux" and target_arch=="mipsel"', {
5846 'make_global_settings': [
5847 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5848 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5849 ['CC.host', '<(host_cc)'],
5850 ['CXX.host', '<(host_cxx)'],
5853 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5854 # Set default ARM cross compiling on linux. These can be overridden
5855 # using CC/CXX/etc environment variables.
5856 'make_global_settings': [
5857 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5858 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5859 ['CC.host', '<(host_cc)'],
5860 ['CXX.host', '<(host_cxx)'],
5864 # TODO(yyanagisawa): supports GENERATOR==make
5865 # make generator doesn't support CC_wrapper without CC
5866 # in make_global_settings yet.
5867 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5868 'make_global_settings': [
5869 ['CC_wrapper', '<(gomadir)/gomacc'],
5870 ['CXX_wrapper', '<(gomadir)/gomacc'],
5871 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5872 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5876 'target_defaults': {
5877 'target_conditions': [
5878 ['_toolset=="target"', {
5886 ['use_lto==1 and clang==0', {
5887 'target_defaults': {
5888 'target_conditions': [
5889 ['_toolset=="target"', {
5891 '-ffat-lto-objects',
5897 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
5898 'target_defaults': {
5899 'target_conditions': [
5900 ['_toolset=="target"', {
5908 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
5909 'target_defaults': {
5910 'target_conditions': [
5911 ['_toolset=="target"', {
5921 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5922 # This block adds *project-wide* configuration settings to each project
5923 # file. It's almost always wrong to put things here. Specify your
5924 # custom xcode_settings in target_defaults to add them to targets instead.
5927 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5928 # setting sets the SDK on a project-wide basis. In order to get the
5929 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5930 # here at the project level.
5933 ['mac_sdk_path==""', {
5934 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5936 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5942 ['ios_sdk_path==""', {
5944 # TODO(justincohen): Ninja only supports simulator for now.
5945 ['"<(GENERATOR)"=="xcode"', {
5946 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5948 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5952 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5957 # Target both iPhone and iPad.
5958 'TARGETED_DEVICE_FAMILY': '1,2',
5961 ['target_arch=="x64"', {
5966 ['target_arch=="ia32"', {
5975 # The Xcode generator will look for an xcode_settings section at the root
5976 # of each dict and use it to apply settings on a file-wide basis. Most
5977 # settings should not be here, they should be in target-specific
5978 # xcode_settings sections, or better yet, should use non-Xcode-specific
5979 # settings in target dicts. SYMROOT is a special case, because many other
5980 # Xcode variables depend on it, including variables such as
5981 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5982 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5983 # files to appear (when present) in the UI as actual files and not red
5984 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5985 # and therefore SYMROOT, needs to be set at the project level.
5986 'SYMROOT': '<(DEPTH)/xcodebuild',