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 crash reporting via Kasko.
422 # Enable building with LSan (Clang's -fsanitize=leak option).
423 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
424 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
427 # Enable building with TSan (Clang's -fsanitize=thread option).
428 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
429 # See http://clang.llvm.org/docs/ThreadSanitizer.html
431 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
433 # Enable building with MSan (Clang's -fsanitize=memory option).
434 # MemorySanitizer only works with clang, but msan=1 implies clang=1
435 # See http://clang.llvm.org/docs/MemorySanitizer.html
437 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
438 # Track where uninitialized memory originates from. From fastest to
439 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
440 # - track the chain of stores leading from allocation site to use site.
441 'msan_track_origins%': 1,
443 # Enable building with UBSan (Clang's -fsanitize=undefined option).
444 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
445 # See http://clang.llvm.org/docs/UsersManual.html
447 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
449 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
450 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
453 # Use the dynamic libraries instrumented by one of the sanitizers
454 # instead of the standard system libraries.
455 'use_instrumented_libraries%': 0,
457 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
458 # stdlibc++ as standard library. This is intended to use for instrumented
460 'use_custom_libcxx%': 0,
462 # Use system libc++ instead of the default C++ library, usually libstdc++.
463 # This is intended for iOS builds only.
464 'use_system_libcxx%': 0,
466 # Use a modified version of Clang to intercept allocated types and sizes
467 # for allocated objects. clang_type_profiler=1 implies clang=1.
468 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
469 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
470 'clang_type_profiler%': 0,
472 # Set to true to instrument the code with function call logger.
473 # See src/third_party/cygprofile/cyg-profile.cc for details.
474 'order_profiling%': 0,
476 # Use the provided profiled order file to link Chrome image with it.
477 # This makes Chrome faster by better using CPU cache when executing code.
478 # This is known as PGO (profile guided optimization).
479 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
480 'order_text_section%' : "",
482 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
483 # libraries on linux x86-64 and arm, plus ASLR.
486 # Whether one-click signin is enabled or not.
487 'enable_one_click_signin%': 0,
489 # Whether to back up data before sync.
490 'enable_pre_sync_backup%': 0,
492 # Enable Chrome browser extensions
493 'enable_extensions%': 1,
496 'enable_google_now%': 1,
498 # Enable basic printing support and UI.
499 'enable_basic_printing%': 1,
501 # Enable printing with print preview. It does not imply
502 # enable_basic_printing. It's possible to build Chrome with preview only.
503 'enable_print_preview%': 1,
505 # Set the version of CLD.
506 # 0: Don't specify the version. This option is for the Finch testing.
511 # For CLD2, the size of the tables that should be included in the build
512 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
514 # See third_party/cld_2/cld_2.gyp for more information.
515 # 0: Small tables, lower accuracy
516 # 2: Large tables, high accuracy
517 'cld2_table_size%': 2,
519 # Enable spell checker.
520 'enable_spellcheck%': 1,
522 # Webrtc compilation is enabled by default. Set to 0 to disable.
525 # Media router support is enabled by default. Set to 0 to disable.
526 'enable_media_router%': 1,
528 # Enables use of the session service, which is enabled by default.
529 # Support for disabling depends on the platform.
530 'enable_session_service%': 1,
532 # Enables theme support, which is enabled by default. Support for
533 # disabling depends on the platform.
536 # Enables autofill dialog and associated features; disabled by default.
537 'enable_autofill_dialog%' : 0,
539 # Defaults Wallet integration in Autofill dialog to use production
540 # servers. Unofficial builds won't have the proper API keys.
541 'enable_prod_wallet_service%': 0,
543 # Enables support for background apps.
544 'enable_background%': 1,
546 # Enable the task manager by default.
547 'enable_task_manager%': 1,
549 # Enables used resource whitelist generation; disabled by default.
550 'enable_resource_whitelist_generation%': 0,
552 # Enable FILE support by default.
553 'disable_file_support%': 0,
555 # Enable FTP support by default.
556 'disable_ftp_support%': 0,
558 # Use native android functions in place of ICU. Not supported by most
560 'use_icu_alternatives_on_android%': 0,
562 # Use of precompiled headers on Windows.
564 # This variable may be explicitly set to 1 (enabled) or 0
565 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
566 # This setting will override the default.
569 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
571 'chromium_win_pch%': 0,
574 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
575 # Set this to true when building with Clang.
576 # See http://code.google.com/p/chromium/wiki/Clang for details.
577 # If this is set, clang is used as both host and target compiler in
578 # cross-compile builds.
581 # Use experimental lld linker instead of the platform's default linker.
584 # Enable plug-in installation by default.
585 'enable_plugin_installation%': 1,
587 # Specifies whether to use canvas_skia.cc in place of platform
588 # specific implementations of gfx::Canvas. Affects text drawing in the
590 # TODO(asvitkine): Enable this on all platforms and delete this flag.
591 # http://crbug.com/105550
592 'use_canvas_skia%': 0,
594 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
595 # with one of those tools.
596 'build_for_tool%': '',
598 # If no directory is specified then a temporary directory will be used.
599 'test_isolation_outdir%': '',
601 'wix_path%': '<(DEPTH)/third_party/wix',
603 # Supervised users are enabled by default.
604 'enable_supervised_users%': 1,
606 # Platform natively supports discardable memory.
607 'native_discardable_memory%': 0,
609 # Platform sends memory pressure signals natively.
610 'native_memory_pressure_signals%': 0,
612 'spdy_proxy_auth_property%' : '',
613 'spdy_proxy_auth_value%' : '',
615 'enable_service_discovery%': 0,
616 'enable_wifi_bootstrapping%': 0,
617 'enable_hangout_services_extension%': 0,
619 # Enable the Syzygy optimization step.
620 'syzygy_optimize%': 0,
622 # Enable hole punching for the protected video.
625 # Automatically select platforms under ozone. Turn this off to
626 # build only explicitly selected platforms.
627 'ozone_auto_platforms%': 1,
629 # If this is set clang is used as host compiler, but not as target
630 # compiler. Always do this by default.
633 # Variables to control Link-Time Optimizations (LTO).
634 # Note: the variables must *not* be enabled at the same time.
635 # In this case LTO would 'merge' the optimization flags
636 # at link-time which would lead to all code be optimized with -O2.
637 # Enable LTO on the code compiled with -Os.
638 # See crbug.com/407544
640 # Enable LTO on code compiled with -O2.
643 # Allowed level of identical code folding in the gold linker.
644 'gold_icf_level%': 'safe',
646 # Libxkbcommon usage.
649 # Control Flow Integrity for virtual calls.
650 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
654 # A flag for POSIX platforms
661 # A flag for BSD platforms
662 ['OS=="freebsd" or OS=="openbsd"', {
669 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
675 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
676 # OpenSSL's certificate definition.
677 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
678 'use_openssl_certs%': 1,
680 'use_openssl_certs%': 0,
683 # libudev usage. This currently only affects the content layer.
684 ['OS=="linux" and embedded==0', {
690 # Flags to use X11 on non-Mac POSIX platforms.
691 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
698 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
704 # Flags to use pango and cairo.
705 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
714 ['OS=="linux" and embedded==0', {
720 # We always use skia text rendering in Aura on Windows, since GDI
721 # doesn't agree with our BackingStore.
722 # TODO(beng): remove once skia text rendering is on by default.
723 ['use_aura==1 and OS=="win"', {
724 'enable_skia_text%': 1,
727 # A flag to enable or disable our compile-time dependency
728 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
729 # support will be available. This option is useful
730 # for Linux distributions and for Aura.
731 ['OS!="linux" or chromeos==1', {
732 'use_gnome_keyring%': 0,
734 'use_gnome_keyring%': 1,
737 ['OS=="mac" or OS=="ios"', {
738 # Mac and iOS want Title Case strings
739 'use_titlecase_in_grd%': 1,
742 # Enable loader extensions on Chrome OS.
744 'image_loader_extension%': 1,
746 'image_loader_extension%': 0,
749 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
750 'enable_one_click_signin%': 1,
751 'enable_pre_sync_backup%': 1,
755 'enable_extensions%': 0,
756 'enable_google_now%': 0,
758 'enable_spellcheck%': 0,
762 'arm_neon_optional%': 1,
763 'native_discardable_memory%': 1,
764 'native_memory_pressure_signals%': 1,
765 'enable_basic_printing%': 1,
766 'enable_print_preview%': 0,
767 'enable_task_manager%':0,
771 # Android OS includes support for proprietary codecs regardless of
772 # building Chromium or Google Chrome. We also ship Google Chrome and
773 # Chromecast with proprietary codecs.
774 ['OS=="android" or branding=="Chrome" or chromecast==1', {
775 'proprietary_codecs%': 1,
777 'proprietary_codecs%': 0,
780 ['OS=="mac" or OS=="ios"', {
781 'native_discardable_memory%': 1,
782 'native_memory_pressure_signals%': 1,
785 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
786 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
787 'enable_autofill_dialog%': 1,
790 ['buildtype=="Official"', {
791 'enable_prod_wallet_service%': 1,
801 'disable_ftp_support%': 1,
802 'enable_extensions%': 0,
803 'enable_google_now%': 0,
805 'cld2_table_size%': 0,
806 'enable_basic_printing%': 0,
807 'enable_print_preview%': 0,
808 'enable_session_service%': 0,
809 'enable_spellcheck%': 0,
815 'enable_supervised_users%': 0,
816 'enable_task_manager%': 0,
817 'use_system_libcxx%': 1,
820 # Use GPU accelerated cross process image transport by default
821 # on linux builds with the Aura window manager
822 ['use_aura==1 and OS=="linux"', {
823 'ui_compositor_image_transport%': 1,
825 'ui_compositor_image_transport%': 0,
828 # Turn precompiled headers on by default.
829 ['OS=="win" and buildtype!="Official"', {
830 'chromium_win_pch%': 1
833 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
834 'enable_plugin_installation%': 0,
836 'enable_plugin_installation%': 1,
839 # Whether PPAPI is enabled.
840 ['OS=="android" or OS=="ios" or embedded==1', {
841 'enable_plugins%': 0,
843 'enable_plugins%': 1,
846 # linux_use_bundled_gold: whether to use the gold linker binary checked
847 # into third_party/binutils. Force this off via GYP_DEFINES when you
848 # are using a custom toolchain and need to control -B in ldflags.
849 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
850 # for component=static_library builds.
851 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
852 'linux_use_bundled_gold%': 1,
854 'linux_use_bundled_gold%': 0,
857 # linux_use_bundled_binutils: whether to use the binary binutils
858 # checked into third_party/binutils. These are not multi-arch so cannot
859 # be used except on x86 and x86-64 (the only two architectures which
860 # are currently checke in). Force this off via GYP_DEFINES when you
861 # are using a custom toolchain and need to control -B in cflags.
862 ['OS=="linux" and (target_arch=="x64")', {
863 'linux_use_bundled_binutils%': 1,
865 'linux_use_bundled_binutils%': 0,
868 # linux_use_gold_flags: whether to use build flags that rely on gold.
869 # On by default for x64 Linux.
870 ['OS=="linux" and target_arch=="x64"', {
871 'linux_use_gold_flags%': 1,
873 'linux_use_gold_flags%': 0,
876 # linux_use_debug_fission: whether to use split DWARF debug info
877 # files. This can reduce link time significantly, but is incompatible
878 # with some utilities such as icecc and ccache. Requires gold and
879 # gcc >= 4.8 or clang.
880 # http://gcc.gnu.org/wiki/DebugFission
881 ['OS=="linux" and target_arch=="x64"', {
882 'linux_use_debug_fission%': 1,
884 'linux_use_debug_fission%': 0,
887 ['OS=="android" or OS=="ios"', {
888 'enable_captive_portal_detection%': 0,
889 'enable_media_router%': 0,
891 'enable_captive_portal_detection%': 1,
892 'enable_media_router%': 1,
895 # Enable Skia UI text drawing incrementally on different platforms.
896 # http://crbug.com/105550
898 # On Aura, this allows per-tile painting to be used in the browser
901 'use_canvas_skia%': 1,
905 'enable_basic_printing%': 0,
906 'enable_print_preview%': 1,
907 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
908 'use_libjpeg_turbo%': 0,
911 # Do not enable the Settings App on ChromeOS.
912 ['enable_app_list==1 and chromeos==0', {
913 'enable_settings_app%': 1,
915 'enable_settings_app%': 0,
918 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
919 # Set some defaults for arm/linux chrome builds
920 'use_allocator%': 'none',
921 # sysroot needs to be an absolute path otherwise it generates
922 # incorrect results when passed to pkg-config
923 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot',
924 }], # OS=="linux" and target_arch=="arm" and chromeos==0
926 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
928 ['target_arch=="x64"', {
929 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
931 ['target_arch=="ia32"', {
932 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
935 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
937 ['OS=="linux" and target_arch=="mipsel"', {
938 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
939 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
942 # Whether tests targets should be run, archived or just have the
943 # dependencies verified. All the tests targets have the '_run' suffix,
944 # e.g. base_unittests_run runs the target base_unittests. The test
945 # target always calls tools/swarming_client/isolate.py. See the script's
946 # --help for more information. Meant to be overriden with GYP_DEFINES.
947 # TODO(maruel): Remove the conditions as more configurations are
949 ['OS!="ios" and OS!="android" and chromeos==0', {
950 'test_isolation_mode%': 'check',
952 'test_isolation_mode%': 'noop',
954 # Whether Android build uses OpenMAX DL FFT.
955 ['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")', {
956 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
957 # When enabled, this will also enable WebAudio support on
958 # Android for these architectures. Default is enabled. Whether
959 # WebAudio is actually available depends on runtime settings
961 'use_openmax_dl_fft%': 1,
963 'use_openmax_dl_fft%': 0,
965 ['OS=="win" or OS=="linux"', {
969 # Turns on compiler optimizations in V8 in Debug build, except
970 # on android_clang, where we're hitting a weird linker error.
971 # TODO(dpranke): http://crbug.com/266155 .
973 'v8_optimized_debug%': 1,
975 'v8_optimized_debug%': 2,
978 # Disable various features by default on embedded.
981 'enable_basic_printing%': 0,
982 'enable_print_preview%': 0,
985 # By default, use ICU data file (icudtl.dat) on all platforms
986 # except when building Android WebView.
987 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
988 # Set the data reduction proxy origin for Android Webview.
989 ['android_webview_build==0', {
990 'icu_use_data_file_flag%' : 1,
992 'icu_use_data_file_flag%' : 0,
994 ['OS=="win" or OS=="mac"', {
995 'enable_wifi_bootstrapping%' : 1,
998 # Path to sas.dll, which provides the SendSAS function.
999 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1000 ['target_arch=="x64"', {
1001 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1003 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1006 # Turn on JNI generation optimizations on non-WebView builds.
1007 ['OS=="android" and android_webview_build==0', {
1008 'optimize_jni_generation%': 1,
1010 'optimize_jni_generation%': 0,
1013 # TODO(rmcilroy): Enable v8_use_external_startup_data on ChromeOS
1014 # http://crbug.com/421063
1015 ['android_webview_build==0 and chromecast==0 and chromeos==0 and OS!="ios"', {
1016 'v8_use_external_startup_data%': 1,
1018 'v8_use_external_startup_data%': 0,
1022 # Set this to 1 to enable use of concatenated impulse responses
1023 # for the HRTF panner in WebAudio.
1024 'use_concatenated_impulse_responses': 1,
1026 # You can set the variable 'use_official_google_api_keys' to 1
1027 # to use the Google-internal file containing official API keys
1028 # for Google Chrome even in a developer build. Setting this
1029 # variable explicitly to 1 will cause your build to fail if the
1030 # internal file is missing.
1032 # The variable is documented here, but not handled in this file;
1033 # see //google_apis/determine_use_official_keys.gypi for the
1036 # Set the variable to 0 to not use the internal file, even when
1037 # it exists in your checkout.
1039 # Leave it unset in your include.gypi to have the variable
1040 # implicitly set to 1 if you have
1041 # src/google_apis/internal/google_chrome_api_keys.h in your
1042 # checkout, and implicitly set to 0 if not.
1044 # Note that official builds always behave as if the variable
1045 # was explicitly set to 1, i.e. they always use official keys,
1046 # and will fail to build if the internal file is missing.
1048 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1049 # include.gypi or by other means. Due to subtleties of GYP, this
1050 # is not the same as leaving the variable unset, even though its
1052 # //google_apis/determine_use_official_keys.gypi is 2.
1054 # Set these to bake the specified API keys and OAuth client
1055 # IDs/secrets into your build.
1057 # If you create a build without values baked in, you can instead
1058 # set environment variables to provide the keys at runtime (see
1059 # src/google_apis/google_api_keys.h for details). Features that
1060 # require server-side APIs may fail to work if no keys are
1063 # Note that if you are building an official build or if
1064 # use_official_google_api_keys has been set to 1 (explicitly or
1065 # implicitly), these values will be ignored and the official
1066 # keys will be used instead.
1067 'google_api_key%': '',
1068 'google_default_client_id%': '',
1069 'google_default_client_secret%': '',
1070 # Native Client is enabled by default.
1071 'disable_nacl%': '0',
1074 # Copy conditionally-set variables out one scope.
1075 'branding%': '<(branding)',
1076 'buildtype%': '<(buildtype)',
1077 'target_arch%': '<(target_arch)',
1078 'target_subarch%': '<(target_subarch)',
1079 'mips_arch_variant%': '<(mips_arch_variant)',
1080 'mips_dsp_rev%': '<(mips_dsp_rev)',
1081 'host_arch%': '<(host_arch)',
1082 'toolkit_views%': '<(toolkit_views)',
1083 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1084 'use_aura%': '<(use_aura)',
1085 'use_ash%': '<(use_ash)',
1086 'use_cras%': '<(use_cras)',
1087 'use_libpci%': '<(use_libpci)',
1088 'use_openssl%': '<(use_openssl)',
1089 'use_openssl_certs%': '<(use_openssl_certs)',
1090 'use_nss%': '<(use_nss)',
1091 'use_udev%': '<(use_udev)',
1092 'os_bsd%': '<(os_bsd)',
1093 'os_posix%': '<(os_posix)',
1094 'use_dbus%': '<(use_dbus)',
1095 'use_glib%': '<(use_glib)',
1096 'use_pango%': '<(use_pango)',
1097 'use_cairo%': '<(use_cairo)',
1098 'use_ozone%': '<(use_ozone)',
1099 'use_ozone_evdev%': '<(use_ozone_evdev)',
1100 'use_xkbcommon%': '<(use_xkbcommon)',
1101 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1102 'desktop_linux%': '<(desktop_linux)',
1103 'use_x11%': '<(use_x11)',
1104 'use_gnome_keyring%': '<(use_gnome_keyring)',
1105 'linux_fpic%': '<(linux_fpic)',
1106 'chromeos%': '<(chromeos)',
1107 'chromecast%': '<(chromecast)',
1108 'enable_viewport%': '<(enable_viewport)',
1109 'enable_hidpi%': '<(enable_hidpi)',
1110 'image_loader_extension%': '<(image_loader_extension)',
1111 'fastbuild%': '<(fastbuild)',
1112 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1113 'win_z7%': '<(win_z7)',
1114 'dcheck_always_on%': '<(dcheck_always_on)',
1115 'tracing_like_official_build%': '<(tracing_like_official_build)',
1116 'arm_version%': '<(arm_version)',
1117 'arm_neon%': '<(arm_neon)',
1118 'arm_neon_optional%': '<(arm_neon_optional)',
1119 'sysroot%': '<(sysroot)',
1120 'chroot_cmd%': '<(chroot_cmd)',
1121 'system_libdir%': '<(system_libdir)',
1122 'component%': '<(component)',
1123 'win_analyze%': '<(win_analyze)',
1124 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1125 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1126 'use_third_party_translations%': '<(use_third_party_translations)',
1127 'remoting%': '<(remoting)',
1128 'enable_one_click_signin%': '<(enable_one_click_signin)',
1129 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1130 'enable_media_router%': '<(enable_media_router)',
1131 'enable_webrtc%': '<(enable_webrtc)',
1132 'chromium_win_pch%': '<(chromium_win_pch)',
1133 'configuration_policy%': '<(configuration_policy)',
1134 'safe_browsing%': '<(safe_browsing)',
1135 'enable_web_speech%': '<(enable_web_speech)',
1136 'notifications%': '<(notifications)',
1137 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1138 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1140 'asan_blacklist%': '<(asan_blacklist)',
1141 'asan_coverage%': '<(asan_coverage)',
1142 'sanitizer_coverage%': '<(sanitizer_coverage)',
1143 'asan_field_padding%': '<(asan_field_padding)',
1144 'use_sanitizer_options%': '<(use_sanitizer_options)',
1145 'syzyasan%': '<(syzyasan)',
1146 'kasko%': '<(kasko)',
1147 'syzygy_optimize%': '<(syzygy_optimize)',
1150 'msan_blacklist%': '<(msan_blacklist)',
1151 'msan_track_origins%': '<(msan_track_origins)',
1153 'tsan_blacklist%': '<(tsan_blacklist)',
1154 'ubsan%': '<(ubsan)',
1155 'ubsan_blacklist%': '<(ubsan_blacklist)',
1156 'ubsan_vptr%': '<(ubsan_vptr)',
1157 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1158 'use_custom_libcxx%': '<(use_custom_libcxx)',
1159 'use_system_libcxx%': '<(use_system_libcxx)',
1160 'clang_type_profiler%': '<(clang_type_profiler)',
1161 'order_profiling%': '<(order_profiling)',
1162 'order_text_section%': '<(order_text_section)',
1163 'enable_extensions%': '<(enable_extensions)',
1164 'enable_plugin_installation%': '<(enable_plugin_installation)',
1165 'enable_plugins%': '<(enable_plugins)',
1166 'enable_session_service%': '<(enable_session_service)',
1167 'enable_themes%': '<(enable_themes)',
1168 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1169 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1170 'enable_background%': '<(enable_background)',
1171 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1172 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1173 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1174 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1175 'use_canvas_skia%': '<(use_canvas_skia)',
1176 'test_isolation_mode%': '<(test_isolation_mode)',
1177 'test_isolation_outdir%': '<(test_isolation_outdir)',
1178 'enable_basic_printing%': '<(enable_basic_printing)',
1179 'enable_print_preview%': '<(enable_print_preview)',
1180 'enable_spellcheck%': '<(enable_spellcheck)',
1181 'enable_google_now%': '<(enable_google_now)',
1182 'cld_version%': '<(cld_version)',
1183 'cld2_table_size%': '<(cld2_table_size)',
1184 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1185 'disable_file_support%': '<(disable_file_support)',
1186 'disable_ftp_support%': '<(disable_ftp_support)',
1187 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1188 'enable_task_manager%': '<(enable_task_manager)',
1189 'sas_dll_path%': '<(sas_dll_path)',
1190 'wix_path%': '<(wix_path)',
1191 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1192 'use_system_libjpeg%': '<(use_system_libjpeg)',
1193 'android_channel%': '<(android_channel)',
1194 'android_webview_build%': '<(android_webview_build)',
1195 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1196 'gyp_managed_install%': 0,
1197 'create_standalone_apk%': 1,
1198 'enable_app_list%': '<(enable_app_list)',
1199 'use_default_render_theme%': '<(use_default_render_theme)',
1200 'enable_settings_app%': '<(enable_settings_app)',
1201 'google_api_key%': '<(google_api_key)',
1202 'google_default_client_id%': '<(google_default_client_id)',
1203 'google_default_client_secret%': '<(google_default_client_secret)',
1204 'enable_supervised_users%': '<(enable_supervised_users)',
1205 'native_discardable_memory%': '<(native_discardable_memory)',
1206 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1207 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1208 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1209 'enable_mdns%' : '<(enable_mdns)',
1210 'enable_service_discovery%' : '<(enable_service_discovery)',
1211 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1212 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1213 'v8_optimized_debug%': '<(v8_optimized_debug)',
1214 'proprietary_codecs%': '<(proprietary_codecs)',
1215 'use_goma%': '<(use_goma)',
1216 'gomadir%': '<(gomadir)',
1217 'use_lto%': '<(use_lto)',
1218 'use_lto_o2%': '<(use_lto_o2)',
1219 'gold_icf_level%': '<(gold_icf_level)',
1220 'video_hole%': '<(video_hole)',
1221 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1222 'cfi_vptr%': '<(cfi_vptr)',
1224 # Use system protobuf instead of bundled one.
1225 'use_system_protobuf%': 0,
1227 # Use system yasm instead of bundled one.
1228 'use_system_yasm%': 0,
1230 # Use system ICU instead of bundled one.
1231 'use_system_icu%' : 0,
1233 # Default to enabled PIE; this is important for ASLR but we may need to be
1234 # able to turn it off for various reasons.
1235 'linux_disable_pie%': 0,
1237 # The release channel that this build targets. This is used to restrict
1238 # channel-specific build options, like which installer packages to create.
1239 # The default is 'all', which does no channel-specific filtering.
1242 # Override chromium_mac_pch and set it to 0 to suppress the use of
1243 # precompiled headers on the Mac. Prefix header injection may still be
1244 # used, but prefix headers will not be precompiled. This is useful when
1245 # using distcc to distribute a build to compile slaves that don't
1246 # share the same compiler executable as the system driving the compilation,
1247 # because precompiled headers rely on pointers into a specific compiler
1248 # executable's image. Setting this to 0 is needed to use an experimental
1249 # Linux-Mac cross compiler distcc farm.
1250 'chromium_mac_pch%': 1,
1252 # The default value for mac_strip in target_defaults. This cannot be
1253 # set there, per the comment about variable% in a target_defaults.
1254 'mac_strip_release%': 0,
1256 # Set to 1 to enable java code coverage. Instruments classes during build
1257 # to produce .ec files during runtime.
1258 'emma_coverage%': 0,
1260 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1261 # separated with whitespace and/or comma. Only has effect if
1262 # 'emma_coverage=1'.
1265 # Set to 1 to enable running Android lint on java/class files.
1268 # Although base/allocator lets you select a heap library via an
1269 # environment variable, the libcmt shim it uses sometimes gets in
1270 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1271 # 'win_use_allocator_shim': 0,
1272 # 'win_release_RuntimeLibrary': 2
1273 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1274 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1276 # TODO(bradnelson): eliminate this when possible.
1277 # To allow local gyp files to prevent release.vsprops from being included.
1278 # Yes(1) means include release.vsprops.
1279 # Once all vsprops settings are migrated into gyp, this can go away.
1280 'msvs_use_common_release%': 1,
1282 # TODO(bradnelson): eliminate this when possible.
1283 # To allow local gyp files to override additional linker options for msvs.
1284 # Yes(1) means set use the common linker options.
1285 'msvs_use_common_linker_extras%': 1,
1287 # TODO(sgk): eliminate this if possible.
1288 # It would be nicer to support this via a setting in 'target_defaults'
1289 # in chrome/app/locales/locales.gypi overriding the setting in the
1290 # 'Debug' configuration in the 'target_defaults' dict below,
1291 # but that doesn't work as we'd like.
1292 'msvs_debug_link_incremental%': '2',
1294 # Needed for some of the largest modules.
1295 'msvs_debug_link_nonincremental%': '1',
1297 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1298 # to get incremental linking to be faster in debug builds.
1299 'incremental_chrome_dll%': '0',
1301 # Experimental setting to break chrome.dll into multiple pieces based on
1303 'chrome_multiple_dll%': '0',
1305 # Experimental setting to optimize Chrome's DLLs with PGO.
1306 'chrome_pgo_phase%': '0',
1308 # Whether the VS xtree header has been patched to disable warning 4702. If
1309 # it has, then we don't need to disable 4702 (unreachable code warning).
1310 # The patch is preapplied to the internal toolchain and hence all bots.
1311 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1314 'clang%': '<(clang)',
1315 'host_clang%': '<(host_clang)',
1316 'make_clang_dir%': '<(make_clang_dir)',
1317 'use_lld%': '<(use_lld)',
1319 # Control which version of clang to use when building for iOS. If set to
1320 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1321 # the version of clang that ships with the Chromium source. This variable
1322 # is automatically set to '1' when using the Xcode generator.
1325 # These two variables can be set in GYP_DEFINES while running
1326 # |gclient runhooks| to let clang run a plugin in every compilation.
1327 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1329 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1332 'clang_add_plugin%': '',
1334 # Tell ld64 to write map files describing binary layout. Useful
1335 # for looking at what contributes to binary size, e.g. with
1336 # https://github.com/nico/bloat
1337 'mac_write_linker_maps%': 0,
1339 # The default type of gtest.
1340 'gtest_target_type%': 'executable',
1342 # Enable sampling based profiler.
1343 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1345 # Profile without optimizing out stack frames when profiling==1.
1346 'profiling_full_stack_frames%': '0',
1348 # And if we want to dump symbols for Breakpad-enabled builds.
1349 'linux_dump_symbols%': 0,
1350 # And if we want to strip the binary after dumping symbols.
1351 'linux_strip_binary%': 0,
1352 # If we want stack unwind support for backtrace().
1353 'debug_unwind_tables%': 1,
1354 'release_unwind_tables%': 1,
1356 # Override where to find binutils
1357 'binutils_version%': 0,
1358 'binutils_dir%': '',
1361 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1362 'use_allocator%': 'tcmalloc',
1364 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1365 'linux_link_gnome_keyring%': 0,
1366 # Set to 1 to link against gsettings APIs instead of using dlopen().
1367 'linux_link_gsettings%': 0,
1369 # Enable use of OpenMAX DL FFT routines.
1370 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1372 # Enable new NPDevice API.
1373 'enable_new_npdevice_api%': 0,
1375 # .gyp files or targets should set chromium_code to 1 if they build
1376 # Chromium-specific code, as opposed to external code. This variable is
1377 # used to control such things as the set of warnings to enable, and
1378 # whether warnings are treated as errors.
1379 'chromium_code%': 0,
1381 # Disable fatal linker warnings, similarly to how we make it possible
1382 # to disable -Werror (e.g. for different toolchain versions).
1383 'disable_fatal_linker_warnings%': 0,
1385 'release_valgrind_build%': 0,
1387 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1388 'enable_wexit_time_destructors%': 0,
1390 # Build libpeerconnection as a static library by default.
1391 'libpeer_target_type%': 'static_library',
1393 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1394 'internal_gles2_conform_tests%': 0,
1396 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1397 'internal_khronos_glcts_tests%': 0,
1399 # Set to 1 to compile the filter fuzzer.
1400 'internal_filter_fuzzer%': 0,
1402 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1403 # so Cocoa is happy (http://crbug.com/20441).
1405 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1406 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1407 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1408 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1409 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1410 'vi', 'zh-CN', 'zh-TW',
1413 # Pseudo locales are special locales which are used for testing and
1414 # debugging. They don't get copied to the final app. For more info,
1415 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1422 # If debug_devtools is set to 1, JavaScript files for DevTools are
1423 # stored as is and loaded from disk. Otherwise, a concatenated file
1424 # is stored in resources.pak. It is still possible to load JS files
1425 # from disk by passing --debug-devtools cmdline switch.
1426 'debug_devtools%': 0,
1428 # The Java Bridge is not compiled in by default.
1431 # Code signing for iOS binaries. The bots need to be able to disable this.
1432 'chromium_ios_signing%': 1,
1434 # This flag is only used when disable_nacl==0 and disables all those
1435 # subcomponents which would require the installation of a native_client
1436 # untrusted toolchain.
1437 'disable_nacl_untrusted%': 0,
1439 # Disable Dart by default.
1442 # Copy out the setting of disable_nacl.
1443 'disable_nacl%': '<(disable_nacl)',
1445 # Portable Native Client is enabled by default.
1446 'disable_pnacl%': 0,
1448 # Whether to build full debug version for Debug configuration on Android.
1449 # Compared to full debug version, the default Debug configuration on Android
1450 # has no full v8 debug, has size optimization and linker gc section, so that
1451 # we can build a debug version with acceptable size and performance.
1452 'android_full_debug%': 0,
1454 # Sets the default version name and code for Android app, by default we
1455 # do a developer build.
1456 'android_app_version_name%': 'Developer Build',
1457 'android_app_version_code%': 1,
1459 # Contains data about the attached devices for gyp_managed_install.
1460 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1462 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1463 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1465 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1466 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1468 # Whether we are using the rlz library or not. Platforms like Android send
1469 # rlz codes for searches but do not use the library.
1472 # Turns on the i18n support in V8.
1473 'v8_enable_i18n_support': 1,
1475 # Compile d8 for the host toolset.
1476 'v8_toolset_for_d8': 'host',
1478 # Enable the V8 heap verification code. The verification itself is enabled
1479 # via a command line option.
1480 'v8_enable_verify_heap%': 1,
1482 # Use brlapi from brltty for braille display support.
1485 # Relative path to icu.gyp from this file.
1486 'icu_gyp_path': '../third_party/icu/icu.gyp',
1488 # IPC fuzzer is disabled by default.
1489 'enable_ipc_fuzzer%': 0,
1491 # Force disable libstdc++ debug mode.
1492 'disable_glibcxx_debug%': 0,
1494 # Set to 1 to compile with MSE support for MPEG2 TS
1495 'enable_mpeg2ts_stream_parser%': 0,
1497 # Support ChromeOS touchpad gestures with ozone.
1498 'use_evdev_gestures%': 0,
1500 # Default ozone platform (if no --ozone-platform flag).
1501 'ozone_platform%': "",
1503 # Ozone platforms to include in the build.
1504 'ozone_platform_caca%': 0,
1505 'ozone_platform_dri%': 0,
1506 'ozone_platform_egltest%': 0,
1507 'ozone_platform_gbm%': 0,
1508 'ozone_platform_ozonex%': 0,
1509 'ozone_platform_test%': 0,
1511 # Whether the browser is non-native (using Views Toolkit) on Mac.
1512 'mac_views_browser%': 0,
1514 # Experiment: http://crbug.com/426914
1518 ['buildtype=="Official"', {
1519 # Continue to embed build meta data in Official builds, basically the
1520 # time it was built.
1521 # TODO(maruel): This decision should be revisited because having an
1522 # official deterministic build has high value too but MSVC toolset can't
1523 # generate anything deterministic with WPO enabled AFAIK.
1524 'dont_embed_build_metadata%': 0,
1526 # Enable the Syzygy optimization step for the official builds.
1527 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1528 'syzygy_optimize%': 1,
1530 'syzygy_optimize%': 0,
1532 # Get binutils version so we can enable debug fission if we can.
1533 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1535 # compiler_version doesn't work with clang
1536 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1537 # compiler_version works with clang.
1538 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1539 # that it takes effect here.
1540 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1541 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1543 # On Android we know the binutils version in the toolchain.
1545 'binutils_version%': 222,
1547 ['host_arch=="x64"', {
1548 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1550 ['host_arch=="ia32"', {
1551 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1553 # Our version of binutils in third_party/binutils
1554 ['linux_use_bundled_binutils==1', {
1555 'binutils_version%': 224,
1559 'binutils_version%': 0,
1561 # The version of GCC in use, set later in platforms that use GCC and have
1562 # not explicitly chosen to build with clang. Currently, this means all
1563 # platforms except Windows, Mac and iOS.
1564 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1565 # it takes effect here.
1566 ['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', {
1568 ['OS=="android" and android_webview_build==0', {
1569 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1570 # We directly set the gcc version since we know what we use.
1573 ['OS=="android" and android_webview_build==1', {
1574 # Android WebView uses a hermetic clang toolchain for host builds.
1575 'host_gcc_version%': 0,
1576 # Android WebView uses the GCC toolchain from the Android build.
1580 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1581 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1585 'host_gcc_version%': 0,
1588 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1589 'windows_sdk_path%': '<(windows_sdk_default_path)',
1591 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1593 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1594 'directx_sdk_path%': '<(directx_sdk_default_path)',
1596 'directx_sdk_path%': '$(DXSDK_DIR)',
1599 'windows_driver_kit_path%': '$(WDK_DIR)',
1601 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1603 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1606 'nacl_untrusted_build%': 0,
1607 'use_allocator%': 'none',
1609 ['OS=="linux" and target_arch=="mipsel"', {
1610 'sysroot%': '<(sysroot)',
1613 # Use a 64-bit linker to avoid running out of address space. The
1614 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1615 ['host_arch=="ia32" and target_arch=="ia32"', {
1616 # TODO(thestig) This is a horrible way to force the desired
1617 # configuration. Our gyp variable scoping is likely wrong and
1618 # needs to be cleaned up. The GN configuration should be changed
1620 'binutils_version%': 224,
1621 'linux_use_bundled_binutils%': '1',
1622 'linux_use_bundled_gold%': '1',
1623 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1625 # All Chrome builds have breakpad symbols, but only process the
1626 # symbols from official builds.
1627 ['(branding=="Chrome" and buildtype=="Official")', {
1628 'linux_dump_symbols%': 1,
1630 # Omit unwind support in official release builds to save space. We
1631 # can use breakpad for these builds.
1632 'release_unwind_tables%': 0,
1635 }], # os_posix==1 and OS!="mac" and OS!="ios"
1638 'enable_background%': 0,
1639 'icu_use_data_file_flag%': 1,
1640 'enable_web_speech%': 0,
1641 'use_system_libxml%': 1,
1642 'use_system_sqlite%': 1,
1644 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1645 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1646 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1647 'uk', 'vi', 'zh-CN', 'zh-TW',
1650 # iOS SDK and deployment target support. The |ios_sdk| value is left
1651 # blank so that when it is set in the project files it will be the
1652 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1653 # causes Xcode to spit out a warning for every single project file for
1654 # not using the "current" SDK.
1656 'ios_sdk_path%': '',
1657 'ios_deployment_target%': '7.0',
1660 # ios_product_name is set to the name of the .app bundle as it should
1662 ['branding=="Chrome"', {
1663 'ios_product_name%': 'Chrome',
1664 }, { # else: branding!="Chrome"
1665 'ios_product_name%': 'Chromium',
1667 ['branding=="Chrome" and buildtype=="Official"', {
1669 }, { # else: branding!="Chrome" or buildtype!="Official"
1675 # Location of Android NDK.
1678 # Standard libraries can use the relative path to the NDK.
1679 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1680 # Unfortunately, it is required to use the absolute path to the SDK
1681 # because it us passed to ant which uses a different relative path
1683 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1684 # Similarly, gdbserver and the Android toolchain need to use the
1685 # absolute path to the NDK because they are used at different levels
1687 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1688 'android_host_arch%': '<!(uname -m)',
1689 # Android API-level of the SDK used for compilation.
1690 'android_sdk_version%': '21',
1691 'android_sdk_build_tools_version%': '21.0.1',
1692 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1694 # Copy conditionally-set variables out one scope.
1695 'android_ndk_root%': '<(android_ndk_root)',
1696 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1697 'android_sdk_root%': '<(android_sdk_root)',
1698 'android_sdk_version%': '<(android_sdk_version)',
1699 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1700 'host_os%': '<(host_os)',
1702 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1703 # Android SDK build tools (e.g. dx, aapt, aidl)
1704 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1706 # Android API level 14 is ICS (Android 4.0) which is the minimum
1707 # platform requirement for Chrome on Android, we use it for native
1710 ['target_arch == "ia32"', {
1711 'android_app_abi%': 'x86',
1712 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
1713 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1714 'android_ndk_lib_dir%': 'usr/lib',
1715 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1717 ['target_arch == "x64"', {
1718 'android_app_abi%': 'x86_64',
1719 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1720 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1721 'android_ndk_lib_dir%': 'usr/lib64',
1722 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1724 ['target_arch=="arm"', {
1727 'android_app_abi%': 'armeabi',
1729 'android_app_abi%': 'armeabi-v7a',
1732 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
1733 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1734 'android_ndk_lib_dir%': 'usr/lib',
1735 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1737 ['target_arch == "arm64"', {
1738 'android_app_abi%': 'arm64-v8a',
1739 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1740 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1741 'android_ndk_lib_dir%': 'usr/lib',
1742 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1744 ['target_arch == "mipsel"', {
1745 'android_app_abi%': 'mips',
1746 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
1747 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1748 'android_ndk_lib_dir%': 'usr/lib',
1749 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1751 ['target_arch == "mips64el"', {
1752 'android_app_abi%': 'mips64',
1753 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1754 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1755 'android_ndk_lib_dir%': 'usr/lib64',
1756 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1760 # Copy conditionally-set variables out one scope.
1761 'android_app_abi%': '<(android_app_abi)',
1762 'android_gdbserver%': '<(android_gdbserver)',
1763 'android_ndk_root%': '<(android_ndk_root)',
1764 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1765 'android_sdk_root%': '<(android_sdk_root)',
1766 'android_sdk_version%': '<(android_sdk_version)',
1767 'android_toolchain%': '<(android_toolchain)',
1769 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1770 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1771 'android_sdk_tools%': '<(android_sdk_tools)',
1772 'android_sdk%': '<(android_sdk)',
1773 'android_sdk_jar%': '<(android_sdk)/android.jar',
1775 'android_stlport_root': '<(android_stlport_root)',
1776 'android_stlport_include': '<(android_stlport_root)/stlport',
1777 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1778 'host_os%': '<(host_os)',
1780 # Location of the "objcopy" binary, used by both gyp and scripts.
1781 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1783 # Location of the "strip" binary, used by both gyp and scripts.
1784 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1786 # Location of the "readelf" binary.
1787 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1789 # Determines whether we should optimize JNI generation at the cost of
1790 # breaking assumptions in the build system that when inputs have changed
1791 # the outputs should always change as well. This is meant purely for
1792 # developer builds, to avoid spurious re-linking of native files.
1793 'optimize_jni_generation%': '<(optimize_jni_generation)',
1795 # Always uses openssl.
1797 'use_openssl_certs%': 1,
1799 'proprietary_codecs%': '<(proprietary_codecs)',
1800 'safe_browsing%': 2,
1801 'enable_web_speech%': 0,
1803 'build_ffmpegsumo%': 0,
1804 'use_allocator%': 'none',
1806 # Disable Native Client.
1809 # Android does not support background apps.
1810 'enable_background%': 0,
1812 # Sessions are store separately in the Java side.
1813 'enable_session_service%': 0,
1817 'gtest_target_type%': 'shared_library',
1819 # Uses system APIs for decoding audio and video.
1820 'use_libffmpeg%': '0',
1822 # TODO(torne): Remove this unsupported option once all the places that
1823 # test it have been updated.
1824 'use_system_stlport%': 0,
1826 # Copy it out one scope.
1827 'android_webview_build%': '<(android_webview_build)',
1830 'use_system_fontconfig%': 0,
1832 'use_system_fontconfig%': 1,
1835 'enable_mpeg2ts_stream_parser%': 1,
1836 'ffmpeg_branding%': 'ChromeOS',
1837 'ozone_platform_ozonex%': 1,
1838 'use_playready%': 0,
1840 ['target_arch=="arm"', {
1842 'arm_tune%': 'cortex-a9',
1848 ['android_webview_build==1', {
1849 # When building the WebView in the Android tree, jarjar will remap all
1850 # the class names, so the JNI generator needs to know this.
1851 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1853 ['OS=="linux" and target_arch!="mipsel"', {
1858 # All Chrome builds have breakpad symbols, but only process the
1859 # symbols from official builds.
1860 ['(branding=="Chrome" and buildtype=="Official")', {
1861 'mac_strip_release%': 1,
1865 ['OS=="mac" or OS=="ios"', {
1869 # Mac OS X SDK and deployment target support. The SDK identifies
1870 # the version of the system headers that will be used, and
1871 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1872 # macro. "Maximum allowed" refers to the operating system version
1873 # whose APIs are available in the headers. The deployment target
1874 # identifies the minimum system version that the built products are
1875 # expected to function on. It corresponds to the
1876 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1877 # macros are available, #include <AvailabilityMacros.h>. Additional
1878 # documentation on these macros is available at
1879 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1880 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1881 # deployment target to 10.6. Other projects, such as O3D, may
1882 # override these defaults.
1884 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1885 # about that is at least the specified version. In official builds,
1886 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1887 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1888 # path to the SDK; when set to a non-empty string, SDK detection
1889 # based on mac_sdk_min will be bypassed entirely.
1892 'mac_sdk_min%': '10.8',
1893 }, { # else OS!="ios"
1894 'mac_sdk_min%': '10.6',
1897 'mac_sdk_path%': '',
1899 'mac_deployment_target%': '10.6',
1902 'mac_sdk_min': '<(mac_sdk_min)',
1903 'mac_sdk_path': '<(mac_sdk_path)',
1904 'mac_deployment_target': '<(mac_deployment_target)',
1906 # Compile in Breakpad support by default so that it can be
1907 # tested, even if it is not enabled by default at runtime.
1908 'mac_breakpad_compiled_in%': 1,
1910 # mac_product_name is set to the name of the .app bundle as it should
1911 # appear on disk. This duplicates data from
1912 # chrome/app/theme/chromium/BRANDING and
1913 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1914 # these names into the build system.
1915 ['branding=="Chrome"', {
1916 'mac_product_name%': 'Google Chrome',
1917 }, { # else: branding!="Chrome"
1918 'mac_product_name%': 'Chromium',
1920 # Official mac builds require a specific OS X SDK, but iOS and
1921 # non-official mac builds do not.
1922 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1923 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1925 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1927 ['branding=="Chrome" and buildtype=="Official"', {
1928 # Enable uploading crash dumps.
1929 'mac_breakpad_uploads%': 1,
1930 # Enable dumping symbols at build time for use by Mac Breakpad.
1932 # Enable Keystone auto-update support.
1934 }, { # else: branding!="Chrome" or buildtype!="Official"
1935 'mac_breakpad_uploads%': 0,
1940 }], # OS=="mac" or OS=="ios"
1943 # This is the architecture convention used in WinSDK paths.
1944 ['target_arch=="ia32"', {
1945 'winsdk_arch%': 'x86',
1947 'winsdk_arch%': '<(target_arch)',
1949 ['component=="shared_library"', {
1950 'win_use_allocator_shim%': 0,
1952 # Turn on multiple dll by default on Windows when in static_library.
1953 'chrome_multiple_dll%': 1,
1955 ['asan==1 or syzyasan==1', {
1956 'win_use_allocator_shim%': 0,
1961 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1962 # Only enabled by default for ninja because it's buggy in VS.
1963 # Not enabled for component=static_library because some targets
1964 # are too large and the toolchain fails due to the size of the
1966 'incremental_chrome_dll%': 1,
1968 # Don't do incremental linking for large modules on 32-bit or when
1969 # component=static_library as the toolchain fails due to the size of
1971 ['MSVS_OS_BITS==32 or component=="static_library"', {
1972 'msvs_large_module_debug_link_mode%': '1', # No
1974 'msvs_large_module_debug_link_mode%': '2', # Yes
1977 'nacl_win64_defines': [
1978 # This flag is used to minimize dependencies when building
1979 # Native Client loader for 64-bit Windows.
1982 # Need to include allocator target, but exclude tcmalloc files.
1983 'use_allocator%': 'winheap',
1986 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1992 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1993 'enable_pepper_cdms%': 1,
1995 'enable_pepper_cdms%': 0,
1998 ['OS=="android" or chromecast==1', {
1999 'enable_browser_cdms%': 1,
2001 'enable_browser_cdms%': 0,
2004 # Native Client glibc toolchain is enabled
2005 # by default except on arm, mips and mips64.
2006 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
2007 'disable_glibc%': 1,
2009 'disable_glibc%': 0,
2012 # Set the relative path from this file to the GYP file of the JPEG
2013 # library used by Chromium.
2014 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2015 # Configuration for using the system libjeg is here.
2016 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
2018 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
2021 # Options controlling the use of GConf (the classic GNOME configuration
2022 # system) and GIO, which contains GSettings (the new GNOME config system).
2023 ['chromeos==1 or embedded==1', {
2031 # Set up -D and -E flags passed into grit.
2032 ['branding=="Chrome"', {
2033 # TODO(mmoss) The .grd files look for _google_chrome, but for
2034 # consistency they should look for google_chrome_build like C++.
2035 'grit_defines': ['-D', '_google_chrome',
2036 '-E', 'CHROMIUM_BUILD=google_chrome'],
2038 'grit_defines': ['-D', '_chromium',
2039 '-E', 'CHROMIUM_BUILD=chromium'],
2042 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2044 ['desktop_linux==1', {
2045 'grit_defines': ['-D', 'desktop_linux'],
2047 ['toolkit_views==1', {
2048 'grit_defines': ['-D', 'toolkit_views'],
2051 'grit_defines': ['-D', 'use_aura'],
2054 'grit_defines': ['-D', 'use_ash'],
2057 'grit_defines': ['-D', 'use_nss'],
2060 'grit_defines': ['-D', 'use_ozone'],
2062 ['image_loader_extension==1', {
2063 'grit_defines': ['-D', 'image_loader_extension'],
2066 'grit_defines': ['-D', 'remoting'],
2068 ['use_titlecase_in_grd==1', {
2069 'grit_defines': ['-D', 'use_titlecase'],
2071 ['use_third_party_translations==1', {
2072 'grit_defines': ['-D', 'use_third_party_translations'],
2074 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2075 'ka', 'ku', 'kw', 'ms', 'ug'
2081 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2082 '--no-output-all-resource-defines',
2085 ['OS=="mac" or OS=="ios"', {
2086 'grit_defines': ['-D', 'scale_factors=2x'],
2090 'enable_coverage%': 0,
2094 '--no-output-all-resource-defines',
2096 # iOS uses a whitelist to filter resources.
2097 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2099 # Enable host builds when generating with ninja-ios.
2101 ['"<(GENERATOR)"=="ninja"', {
2105 # Use the version of clang shipped with Xcode when building official
2106 # version of Chrome for iOS.
2108 # TODO(eugenebut): Remove enable_coverage check once
2109 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2110 # http://crbug.com/450379
2111 ['buildtype=="Official" or enable_coverage', {
2116 ['enable_extensions==1', {
2117 'grit_defines': ['-D', 'enable_extensions'],
2119 ['enable_plugins!=0', {
2120 'grit_defines': ['-D', 'enable_plugins'],
2122 ['enable_basic_printing==1 or enable_print_preview==1', {
2123 'grit_defines': ['-D', 'enable_printing'],
2125 ['enable_print_preview==1', {
2126 'grit_defines': ['-D', 'enable_print_preview'],
2128 ['enable_themes==1', {
2129 'grit_defines': ['-D', 'enable_themes'],
2131 ['enable_app_list==1', {
2132 'grit_defines': ['-D', 'enable_app_list'],
2134 ['enable_settings_app==1', {
2135 'grit_defines': ['-D', 'enable_settings_app'],
2137 ['enable_google_now==1', {
2138 'grit_defines': ['-D', 'enable_google_now'],
2140 ['use_concatenated_impulse_responses==1', {
2141 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2143 ['enable_media_router==1', {
2144 'grit_defines': ['-D', 'enable_media_router'],
2146 ['enable_webrtc==1', {
2147 'grit_defines': ['-D', 'enable_webrtc'],
2149 ['enable_hangout_services_extension==1', {
2150 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2152 ['enable_task_manager==1', {
2153 'grit_defines': ['-D', 'enable_task_manager'],
2155 ['notifications==1', {
2156 'grit_defines': ['-D', 'enable_notifications'],
2158 ['enable_wifi_bootstrapping==1', {
2159 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2161 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2162 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2164 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2165 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2167 ['enable_mdns==1 or OS=="mac"', {
2168 'grit_defines': ['-D', 'enable_service_discovery'],
2169 'enable_service_discovery%': 1
2171 ['clang_use_chrome_plugins==1 and OS!="win"', {
2174 ['OS=="mac" or OS=="ios"', {
2175 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2176 }, { # OS != "mac" or OS != "ios"
2177 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
2181 # If you change these, also change build/config/clang/BUILD.gn.
2182 'clang_chrome_plugins_flags%':
2183 '-Xclang -load -Xclang <(clang_lib_path)'
2184 ' -Xclang -add-plugin -Xclang find-bad-constructs',
2186 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2188 'use_allocator%': 'none',
2189 'use_sanitizer_options%': 1,
2190 # Disable ICF in the linker to avoid debug info loss.
2191 'gold_icf_level%': 'none',
2193 ['asan==1 and OS=="linux" and chromeos==0', {
2194 'use_custom_libcxx%': 1,
2202 ['asan==1 and OS=="mac"', {
2203 'mac_strip_release': 1,
2206 'use_custom_libcxx%': 1,
2209 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2210 # libstdc++. This is required to avoid false positive reports whenever
2211 # the C++ standard library is used.
2212 'use_custom_libcxx%': 1,
2213 # Running the V8-generated code on an ARM simulator is a powerful hack
2214 # that allows the tool to see the memory accesses from JITted code.
2215 # Without this flag, JS code causes false positive reports from MSan.
2216 'v8_target_arch': 'arm64',
2219 ['OS=="linux" and clang_type_profiler==1', {
2221 'clang_use_chrome_plugins%': 0,
2223 ['host_arch=="x64"', {
2224 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2226 ['host_arch=="ia32"', {
2227 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2228 # Clang in this directory at your own risk if needed for some
2229 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2230 # usage). Any failure by this compiler should not close the tree.
2231 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2237 # The Clang plugins don't currently work on Windows.
2238 # TODO(hans): One day, this will work. (crbug.com/82385)
2239 'clang_use_chrome_plugins%': 0,
2242 # On valgrind bots, override the optimizer settings so we don't inline too
2243 # much and make the stacks harder to figure out.
2245 # TODO(rnk): Kill off variables that no one else uses and just implement
2246 # them under a build_for_tool== condition.
2247 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2249 'mac_debug_optimization': '1',
2250 'mac_release_optimization': '1',
2251 'release_optimize': '1',
2252 'no_gc_sections': 1,
2253 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2254 '-fno-builtin -fno-optimize-sibling-calls',
2255 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2256 '-fno-builtin -fno-optimize-sibling-calls',
2258 # MSVS flags for TSan on Pin and Windows.
2259 'win_debug_RuntimeChecks': '0',
2260 'win_debug_disable_iterator_debugging': '1',
2261 'win_debug_Optimization': '1',
2262 'win_debug_InlineFunctionExpansion': '0',
2263 'win_release_InlineFunctionExpansion': '0',
2264 'win_release_OmitFramePointers': '0',
2266 'use_allocator': 'tcmalloc',
2267 'release_valgrind_build': 1,
2269 'component': 'static_library',
2270 'use_system_zlib': 0,
2273 # Build tweaks for DrMemory.
2274 # TODO(rnk): Combine with tsan config to share the builder.
2275 # http://crbug.com/108155
2276 ['build_for_tool=="drmemory"', {
2277 # These runtime checks force initialization of stack vars which blocks
2278 # DrMemory's uninit detection.
2279 'win_debug_RuntimeChecks': '0',
2280 # Iterator debugging is slow.
2281 'win_debug_disable_iterator_debugging': '1',
2282 # Try to disable optimizations that mess up stacks in a release build.
2283 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2284 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2285 # compiler bug, so we use /Ob1 instead.
2286 'win_release_InlineFunctionExpansion': '1',
2287 'win_release_OmitFramePointers': '0',
2288 # Ditto for debug, to support bumping win_debug_Optimization.
2289 'win_debug_InlineFunctionExpansion': 0,
2290 'win_debug_OmitFramePointers': 0,
2291 # Keep the code under #ifndef NVALGRIND.
2292 'release_valgrind_build': 1,
2295 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2296 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2300 # Set default compiler flags depending on ARM version.
2301 ['arm_version==6 and android_webview_build==0', {
2302 'arm_arch%': 'armv6',
2305 'arm_float_abi%': 'softfp',
2308 ['arm_version==7 and android_webview_build==0', {
2309 'arm_arch%': 'armv7-a',
2310 'arm_tune%': 'generic-armv7-a',
2315 'arm_fpu%': 'vfpv3-d16',
2318 # Change the default to hard once the armhf transition is complete.
2319 'arm_float_abi%': 'softfp',
2323 # Set default compiler flags for MIPS floating-point support.
2324 ['target_arch=="mipsel" and android_webview_build==0', {
2325 'mips_float_abi%': 'hard',
2327 ['target_arch=="mipsel" and mips_arch_variant=="r2" and android_webview_build==0', {
2328 'mips_fpu_mode%': 'fp32',
2331 ['android_webview_build==1', {
2332 # The WebView build gets its cpu-specific flags from the Android build system.
2336 'arm_float_abi%': '',
2338 'mips_float_abi%': '',
2339 'mips_fpu_mode%': '',
2342 # Enable brlapi by default for chromeos.
2347 ['use_ozone==1 and ozone_auto_platforms==1', {
2348 # Use test as the default platform.
2349 'ozone_platform%': 'test',
2351 # Build all platforms whose deps are in install-build-deps.sh.
2352 # Only these platforms will be compile tested by buildbots.
2353 'ozone_platform_dri%': 1,
2354 'ozone_platform_test%': 1,
2355 'ozone_platform_egltest%': 1,
2358 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2359 'use_clipboard_aurax11%': 1,
2362 ['OS=="win" and use_goma==1', {
2363 # goma doesn't support pch yet.
2364 'chromium_win_pch': 0,
2365 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2367 ['win_z7==0 and fastbuild==0', {
2373 ['OS=="win" and (clang==1 or asan==1)', {
2374 'chromium_win_pch': 0,
2378 'host_cc': '<(make_clang_dir)/bin/clang',
2379 'host_cxx': '<(make_clang_dir)/bin/clang++',
2381 'host_cc': '<!(which gcc)',
2382 'host_cxx': '<!(which g++)',
2385 # The seccomp-bpf sandbox is only supported on five architectures
2387 # Do not disable seccomp_bpf anywhere without talking to
2388 # security@chromium.org!
2389 ['((OS=="linux" or OS=="android") and '
2390 '(target_arch=="ia32" or target_arch=="x64" or '
2391 'target_arch=="arm" or target_arch=="mipsel" or '
2392 'target_arch=="arm64"))', {
2393 'use_seccomp_bpf%': 1,
2395 'use_seccomp_bpf%': 0,
2403 # The path to the ANGLE library.
2404 'angle_path': '<(DEPTH)/third_party/angle',
2406 # List of default apps to install in new profiles. The first list contains
2407 # the source files as found in svn. The second list, used only for linux,
2408 # contains the destination location for each of the files. When a crx
2409 # is added or removed from the list, the chrome/browser/resources/
2410 # default_apps/external_extensions.json file must also be updated.
2412 # README: GN version of these is in the target //chrome:default_apps
2413 # (there's no global variable like in GYP). Be sure to update that target
2414 # if you change these lists!
2415 'default_apps_list': [
2416 'browser/resources/default_apps/external_extensions.json',
2417 'browser/resources/default_apps/gmail.crx',
2418 'browser/resources/default_apps/search.crx',
2419 'browser/resources/default_apps/youtube.crx',
2420 'browser/resources/default_apps/drive.crx',
2421 'browser/resources/default_apps/docs.crx',
2423 'default_apps_list_linux_dest': [
2424 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2425 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2426 '<(PRODUCT_DIR)/default_apps/search.crx',
2427 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2428 '<(PRODUCT_DIR)/default_apps/drive.crx',
2429 '<(PRODUCT_DIR)/default_apps/docs.crx',
2432 # Whether to allow building of the GPU-related isolates.
2433 'archive_gpu_tests%': 0,
2435 # Whether to allow building of chromoting related isolates.
2436 'archive_chromoting_tests%': 0,
2438 'target_defaults': {
2440 # The condition that operates on chromium_code is in a target_conditions
2441 # section, and will not have access to the default fallback value of
2442 # chromium_code at the top of this file, or to the chromium_code
2443 # variable placed at the root variables scope of .gyp files, because
2444 # those variables are not set at target scope. As a workaround,
2445 # if chromium_code is not set at target scope, define it in target scope
2446 # to contain whatever value it has during early variable expansion.
2447 # That's enough to make it available during target conditional
2449 'chromium_code%': '<(chromium_code)',
2451 'component%': '<(component)',
2453 'chromecast%': '<(chromecast)',
2455 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2456 'win_release_Optimization%': '2', # 2 = /Os
2457 'win_debug_Optimization%': '0', # 0 = /Od
2459 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2460 # Tri-state: blank is default, 1 on, 0 off
2461 'win_release_OmitFramePointers%': '0',
2462 # Tri-state: blank is default, 1 on, 0 off
2463 'win_debug_OmitFramePointers%': '',
2465 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2466 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2468 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2469 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2470 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2472 # VS inserts quite a lot of extra checks to algorithms like
2473 # std::partial_sort in Debug build which make them O(N^2)
2474 # instead of O(N*logN). This is particularly slow under memory
2475 # tools like ThreadSanitizer so we want it to be disablable.
2476 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2477 'win_debug_disable_iterator_debugging%': '0',
2479 # An application manifest fragment to declare compatibility settings for
2480 # 'executable' targets. Ignored in other target type.
2481 'win_exe_compatibility_manifest%':
2482 '<(DEPTH)\\build\\win\\compatibility.manifest',
2484 'release_extra_cflags%': '',
2485 'debug_extra_cflags%': '',
2487 'release_valgrind_build%': '<(release_valgrind_build)',
2489 # the non-qualified versions are widely assumed to be *nix-only
2490 'win_release_extra_cflags%': '',
2491 'win_debug_extra_cflags%': '',
2493 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2494 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2496 # Only used by Windows build for now. Can be used to build into a
2497 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2498 # output files in src/build/VS2010_{Debug,Release}.
2499 'build_dir_prefix%': '',
2501 # Targets are by default not nacl untrusted code.
2502 'nacl_untrusted_build%': 0,
2504 'pnacl_compile_flags': [
2505 # pnacl uses the clang compiler so we need to suppress all the
2506 # same warnings as we do for clang.
2507 # TODO(sbc): Remove these if/when they are removed from the clang
2509 '-Wno-unused-function',
2510 '-Wno-char-subscripts',
2511 '-Wno-c++11-extensions',
2512 '-Wno-unnamed-type-template-args',
2515 # By default, Android targets have their exported JNI symbols stripped,
2516 # so we test the manual JNI registration code paths that are required
2517 # when using the crazy linker. To allow use of native JNI exports (lazily
2518 # resolved by the JVM), targets can enable this variable, which will stop
2519 # the stripping from happening. Only targets which do not need to be
2520 # compatible with the crazy linker are permitted to set this.
2521 'use_native_jni_exports%': 0,
2524 ['OS=="win" and component=="shared_library"', {
2525 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2526 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2527 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2529 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2530 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2531 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2534 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2535 'mac_release_optimization%': 's', # Use -Os unless overridden
2536 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2538 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2539 'mac_release_optimization%': '2', # Use -O2 unless overridden
2540 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2543 'host_os%': '<(host_os)', # See comment above chromium_code.
2546 'clang_warning_flags': [
2549 # Don't die on dtoa code that uses a char as an array index.
2550 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2551 '-Wno-char-subscripts',
2553 # TODO(thakis): This used to be implied by -Wno-unused-function,
2554 # which we no longer use. Check if it makes sense to remove
2555 # this as well. http://crbug.com/316352
2556 '-Wno-unneeded-internal-declaration',
2558 # Warns on switches on enums that cover all enum values but
2559 # also contain a default: branch. Chrome is full of that.
2560 '-Wno-covered-switch-default',
2562 # Warns when a const char[] is converted to bool.
2563 '-Wstring-conversion',
2565 # C++11-related flags:
2567 # This warns on using ints as initializers for floats in
2568 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2569 # which happens in several places in chrome code. Not sure if
2570 # this is worth fixing.
2571 '-Wno-c++11-narrowing',
2573 # Clang considers the `register` keyword as deprecated, but e.g.
2574 # code generated by flex (used in angle) contains that keyword.
2575 # http://crbug.com/255186
2576 '-Wno-deprecated-register',
2578 # TODO(hans): Get this cleaned up.
2579 '-Wno-inconsistent-missing-override',
2582 'includes': [ 'set_clang_warning_flags.gypi', ],
2584 # Don't use deprecated V8 APIs anywhere.
2585 'V8_DEPRECATION_WARNINGS',
2588 '<(SHARED_INTERMEDIATE_DIR)',
2591 ['(OS=="mac" or OS=="ios") and asan==1', {
2593 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2596 ['OS=="win" and asan==1 and component=="shared_library"', {
2598 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2601 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2602 'cflags_cc!': ['-fno-rtti'],
2605 '-gline-tables-only',
2606 '-fintercept-allocation-functions',
2608 'defines': ['TYPE_PROFILING'],
2610 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2613 ['branding=="Chrome"', {
2614 'defines': ['GOOGLE_CHROME_BUILD'],
2615 }, { # else: branding!="Chrome"
2616 'defines': ['CHROMIUM_BUILD'],
2618 ['OS=="mac" and component=="shared_library"', {
2620 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2621 'LD_RUNPATH_SEARCH_PATHS': [
2622 # For unbundled binaries.
2624 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2625 '@loader_path/../../..',
2629 ['(clang==1 or host_clang==1) and OS!="win"', {
2630 # This is here so that all files get recompiled after a clang roll and
2631 # when turning clang on or off.
2632 # (defines are passed via the command line, and build systems rebuild
2633 # things when their commandline changes). Nothing should ever read this
2635 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2638 'defines': ['ENABLE_RLZ'],
2640 ['component=="shared_library"', {
2641 'defines': ['COMPONENT_BUILD'],
2643 ['toolkit_views==1', {
2644 'defines': ['TOOLKIT_VIEWS=1'],
2646 ['ui_compositor_image_transport==1', {
2647 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2650 'defines': ['USE_AURA=1'],
2653 'defines': ['USE_ASH=1'],
2656 'defines': ['USE_PANGO=1'],
2659 'defines': ['USE_CAIRO=1'],
2662 'defines': ['USE_CRAS=1'],
2665 'defines': ['USE_OZONE=1'],
2667 ['use_default_render_theme==1', {
2668 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2670 ['use_libjpeg_turbo==1', {
2671 'defines': ['USE_LIBJPEG_TURBO=1'],
2674 'defines': ['USE_X11=1'],
2676 ['use_clipboard_aurax11==1', {
2677 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2679 ['enable_one_click_signin==1', {
2680 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2682 ['enable_pre_sync_backup==1', {
2683 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2685 ['image_loader_extension==1', {
2686 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2689 'defines': ['ENABLE_PROFILING=1'],
2692 'defines': ['ENABLE_REMOTING=1'],
2694 ['enable_webrtc==1', {
2695 'defines': ['ENABLE_WEBRTC=1'],
2697 ['proprietary_codecs==1', {
2698 'defines': ['USE_PROPRIETARY_CODECS'],
2700 ['enable_mpeg2ts_stream_parser==1', {
2701 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2705 ['enable_viewport==1', {
2706 'defines': ['ENABLE_VIEWPORT'],
2708 ['enable_pepper_cdms==1', {
2709 'defines': ['ENABLE_PEPPER_CDMS'],
2711 ['enable_browser_cdms==1', {
2712 'defines': ['ENABLE_BROWSER_CDMS'],
2714 ['configuration_policy==1', {
2715 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2717 ['notifications==1', {
2718 'defines': ['ENABLE_NOTIFICATIONS'],
2720 ['enable_hidpi==1', {
2721 'defines': ['ENABLE_HIDPI=1'],
2723 ['native_discardable_memory==1', {
2724 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2726 ['native_memory_pressure_signals==1', {
2727 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2730 'defines': ['USE_UDEV'],
2734 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2737 ['OS=="win" and fastbuild==2', {
2738 # Completely disable debug information.
2741 'GenerateDebugInformation': 'false',
2743 'VCCLCompilerTool': {
2744 'DebugInformationFormat': '0',
2748 ['OS=="win" and fastbuild==1', {
2751 # This tells the linker to generate .pdbs, so that
2752 # we can get meaningful stack traces.
2753 'GenerateDebugInformation': 'true',
2755 'VCCLCompilerTool': {
2756 # No debug info to be generated by compiler.
2757 'DebugInformationFormat': '0',
2761 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2762 'variables': { 'debug_extra_cflags': '-g0', },
2764 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2765 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2767 'variables': { 'debug_extra_cflags': '-g0', },
2769 # Android builds symbols on release by default, disable them.
2770 ['OS=="android" and fastbuild==2', {
2771 'variables': { 'release_extra_cflags': '-g0', },
2773 ['OS=="android" and fastbuild==1', {
2774 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2776 'variables': { 'release_extra_cflags': '-g0', },
2780 ['dont_embed_build_metadata==1', {
2782 'DONT_EMBED_BUILD_METADATA',
2784 }], # dont_embed_build_metadata==1
2785 ['dcheck_always_on!=0', {
2786 'defines': ['DCHECK_ALWAYS_ON=1'],
2787 }], # dcheck_always_on!=0
2788 ['tracing_like_official_build!=0', {
2789 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2790 }], # tracing_like_official_build!=0
2792 'defines': ['NO_TCMALLOC'],
2794 ['win_use_allocator_shim==1', {
2795 'defines': ['ALLOCATOR_SHIM'],
2801 'ADDRESS_SANITIZER',
2802 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2803 'MEMORY_SANITIZER_INITIAL_SIZE',
2807 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2815 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2816 'MEMORY_SANITIZER_INITIAL_SIZE',
2824 '<(DEPTH)/third_party/kasko/include',
2830 '_CRT_SECURE_NO_DEPRECATE',
2831 '_SCL_SECURE_NO_DEPRECATE',
2832 # This define is required to pull in the new Win8 interfaces from
2833 # system headers like ShObjIdl.h.
2834 'NTDDI_VERSION=0x06030000',
2835 # This is required for ATL to use XP-safe versions of its functions.
2836 '_USING_V110_SDK71_',
2839 '<(DEPTH)/third_party/wtl/include',
2844 # Generates debug info when win_z7=1
2845 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2847 'GenerateDebugInformation': 'true',
2849 'VCCLCompilerTool': {
2850 'DebugInformationFormat': '1',
2856 # This is prohibited when running /analyze.
2857 '_USING_V110_SDK71_',
2860 'VCCLCompilerTool': {
2861 # Set WarnAsError to false to disable this setting for most
2862 # projects so that compilation continues.
2863 'WarnAsError': 'false',
2864 # When win_analyze is specified add the /analyze switch.
2865 # Also add /WX- to force-disable WarnAsError for projects that
2866 # override WarnAsError.
2867 # Also, disable various noisy warnings that have low value.
2868 'AdditionalOptions': [
2871 '/wd6011', # Dereferencing NULL pointer
2872 '/wd6312', # Possible infinite loop: use of the constant
2873 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2874 '/wd6326', # Potential comparison of constant with constant
2875 '/wd28159', # Consider using 'GetTickCount64'
2876 '/wd28204', # Inconsistent SAL annotations
2877 '/wd28251', # Inconsistent SAL annotations
2878 '/wd28252', # Inconsistent SAL annotations
2879 '/wd28253', # Inconsistent SAL annotations
2880 '/wd28196', # The precondition is not satisfied
2881 '/wd28301', # Inconsistent SAL annotations
2882 '/wd6340', # Sign mismatch in function parameter
2883 '/wd28182', # Dereferencing NULL pointer
2884 # C6285 is ~16% of raw warnings and has low value
2885 '/wd6285', # non-zero constant || non-zero constant
2886 # C6334 is ~80% of raw warnings and has low value
2887 '/wd6334', # sizeof applied to an expression with an operator
2899 ['use_playready==1', {
2901 'PLAYREADY_CDM_AVAILABLE',
2906 ['enable_task_manager==1', {
2908 'ENABLE_TASK_MANAGER=1',
2911 ['enable_extensions==1', {
2913 'ENABLE_EXTENSIONS=1',
2916 ['OS=="win" and branding=="Chrome"', {
2917 'defines': ['ENABLE_SWIFTSHADER'],
2919 ['enable_dart==1', {
2920 'defines': ['WEBKIT_USING_DART=1'],
2922 ['enable_plugin_installation==1', {
2923 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2925 ['enable_plugins==1', {
2926 'defines': ['ENABLE_PLUGINS=1'],
2928 ['enable_session_service==1', {
2929 'defines': ['ENABLE_SESSION_SERVICE=1'],
2931 ['enable_themes==1', {
2932 'defines': ['ENABLE_THEMES=1'],
2934 ['enable_autofill_dialog==1', {
2935 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2937 ['enable_prod_wallet_service==1', {
2938 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2940 ['enable_background==1', {
2941 'defines': ['ENABLE_BACKGROUND=1'],
2943 ['enable_google_now==1', {
2944 'defines': ['ENABLE_GOOGLE_NOW=1'],
2946 ['cld_version!=0', {
2947 'defines': ['CLD_VERSION=<(cld_version)'],
2949 ['enable_basic_printing==1 or enable_print_preview==1', {
2950 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2951 'defines': ['ENABLE_PRINTING=1'],
2953 ['enable_basic_printing==1', {
2954 # Enable basic printing support and UI.
2955 'defines': ['ENABLE_BASIC_PRINTING=1'],
2957 ['enable_print_preview==1', {
2958 # Enable printing with print preview.
2959 # Can be defined without ENABLE_BASIC_PRINTING.
2960 'defines': ['ENABLE_PRINT_PREVIEW=1'],
2962 ['enable_spellcheck==1', {
2963 'defines': ['ENABLE_SPELLCHECK=1'],
2965 ['enable_captive_portal_detection==1', {
2966 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2968 ['enable_app_list==1', {
2969 'defines': ['ENABLE_APP_LIST=1'],
2971 ['enable_settings_app==1', {
2972 'defines': ['ENABLE_SETTINGS_APP=1'],
2974 ['disable_file_support==1', {
2975 'defines': ['DISABLE_FILE_SUPPORT=1'],
2977 ['disable_ftp_support==1', {
2978 'defines': ['DISABLE_FTP_SUPPORT=1'],
2980 ['enable_supervised_users==1', {
2981 'defines': ['ENABLE_SUPERVISED_USERS=1'],
2983 ['spdy_proxy_auth_property != ""', {
2984 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2986 ['spdy_proxy_auth_value != ""', {
2987 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2989 ['enable_mdns==1', {
2990 'defines': ['ENABLE_MDNS=1'],
2992 ['enable_service_discovery==1', {
2993 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2995 ['enable_wifi_bootstrapping==1', {
2996 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2998 ['enable_hangout_services_extension==1', {
2999 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
3001 ['enable_ipc_fuzzer==1', {
3002 'defines': ['ENABLE_IPC_FUZZER=1'],
3005 'defines': ['VIDEO_HOLE=1'],
3007 ['v8_use_external_startup_data==1', {
3008 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
3010 ['use_lto==1 and (target_arch=="ia32" or target_arch=="x64")', {
3011 # Required for third_party/zlib/crc_folding.c and various other code
3012 # that uses SSE. TODO(pcc): Remove this once we properly support
3013 # subtarget specific code generation in LLVM.
3014 'ldflags': ['-Wl,-plugin-opt,mcpu=corei7-avx'],
3016 ], # conditions for 'target_defaults'
3017 'target_conditions': [
3018 ['<(use_libpci)==1', {
3019 'defines': ['USE_LIBPCI=1'],
3021 ['<(use_openssl)==1', {
3022 'defines': ['USE_OPENSSL=1'],
3024 ['<(use_openssl_certs)==1', {
3025 'defines': ['USE_OPENSSL_CERTS=1'],
3027 ['>(nacl_untrusted_build)==1', {
3030 'USE_OPENSSL_CERTS=1',
3033 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3034 'defines': ['USE_GLIB=1'],
3036 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
3037 'defines': ['USE_NSS=1'],
3039 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3040 'defines': ['OS_CHROMEOS=1'],
3042 ['enable_wexit_time_destructors==1 and OS!="win"', {
3043 # TODO: Enable on Windows too, http://crbug.com/404525
3044 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3046 ['chromium_code==0', {
3048 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3049 # We don't want to get warnings from third-party code,
3050 # so remove any existing warning-enabling flags like -Wall.
3056 # Don't warn about hash_map in third-party code.
3060 # Don't warn about printf format problems.
3061 # This is off by default in gcc but on in Ubuntu's gcc(!).
3065 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3069 # TODO: Fix all warnings on chromeos too.
3070 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3075 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3077 # Don't warn about ignoring the return value from e.g. close().
3078 # This is off by default in some gccs but on by default in others.
3079 # BSD systems do not support this option, since they are usually
3080 # using gcc 4.2.1, which does not have this flag yet.
3081 '-Wno-unused-result',
3086 '_CRT_SECURE_NO_DEPRECATE',
3087 '_CRT_NONSTDC_NO_WARNINGS',
3088 '_CRT_NONSTDC_NO_DEPRECATE',
3089 '_SCL_SECURE_NO_DEPRECATE',
3091 'msvs_disabled_warnings': [4800],
3093 'VCCLCompilerTool': {
3094 'WarningLevel': '3',
3095 'WarnAsError': 'true',
3096 'Detect64BitPortabilityProblems': 'false',
3100 ['buildtype=="Official"', {
3102 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3107 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3110 [ 'component=="shared_library"', {
3111 # TODO(darin): Unfortunately, some third_party code depends on base.
3112 'msvs_disabled_warnings': [
3113 4251, # class 'std::xx' needs to have dll-interface.
3119 [ 'OS=="mac" or OS=="ios"', {
3121 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3124 ['buildtype=="Official"', {
3126 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3133 # TODO(ios): Fix remaining warnings in third-party code, then
3134 # remove this; the Mac cleanup didn't get everything that's
3135 # flagged in an iOS build.
3136 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3137 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3138 # Several internal ios directories generate numerous warnings for
3139 # -Wobjc-missing-property-synthesis.
3140 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3146 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3147 'filename_rules.gypi',
3149 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3150 # C99 macros on Mac and Linux.
3152 '__STDC_CONSTANT_MACROS',
3153 '__STDC_FORMAT_MACROS',
3157 # turn on warnings for signed/unsigned mismatch on chromium code.
3159 'VCCLCompilerTool': {
3160 'AdditionalOptions': ['/we4389'],
3164 ['OS=="win" and component=="shared_library"', {
3165 'msvs_disabled_warnings': [
3166 4251, # class 'std::xx' needs to have dll-interface.
3171 ], # target_conditions for 'target_defaults'
3172 'default_configuration': 'Debug',
3174 # VCLinkerTool LinkIncremental values below:
3176 # 1 == /INCREMENTAL:NO
3178 # Debug links incremental, Release does not.
3180 # Abstract base configurations to cover common attributes.
3184 'msvs_configuration_attributes': {
3185 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3186 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3187 'CharacterSet': '1',
3189 # Add the default import libs.
3192 'AdditionalDependencies': [
3209 'AdditionalOptions': [
3210 # Suggested by Microsoft Devrel to avoid
3211 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3212 # which started happening more regularly after VS2013 Update 4.
3213 '/maxilksize:2147483647',
3222 'MinimumRequiredVersion': '5.01', # XP.
3223 'TargetMachine': '1',
3225 'VCLibrarianTool': {
3226 'TargetMachine': '1',
3229 'msvs_configuration_platform': 'Win32',
3233 'msvs_configuration_platform': 'x64',
3236 # Make sure to understand http://crbug.com/361720 if you want to
3238 'MinimumRequiredVersion': '5.02', # Server 2003.
3239 'TargetMachine': '17', # x86 - 64
3240 'AdditionalLibraryDirectories!':
3241 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3242 'AdditionalLibraryDirectories':
3243 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3244 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3245 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3247 'VCLibrarianTool': {
3248 'AdditionalLibraryDirectories!':
3249 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3250 'AdditionalLibraryDirectories':
3251 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3252 'TargetMachine': '17', # x64
3259 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3260 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3263 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3265 '<@(debug_extra_cflags)',
3269 'VCCLCompilerTool': {
3270 'Optimization': '<(win_debug_Optimization)',
3271 'PreprocessorDefinitions': ['_DEBUG'],
3272 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3273 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3275 # According to MSVS, InlineFunctionExpansion=0 means
3276 # "default inlining", not "/Ob0".
3277 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3278 ['win_debug_InlineFunctionExpansion==0', {
3279 'AdditionalOptions': ['/Ob0'],
3281 ['win_debug_InlineFunctionExpansion!=""', {
3282 'InlineFunctionExpansion':
3283 '<(win_debug_InlineFunctionExpansion)',
3285 ['win_debug_disable_iterator_debugging==1', {
3286 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3289 # if win_debug_OmitFramePointers is blank, leave as default
3290 ['win_debug_OmitFramePointers==1', {
3291 'OmitFramePointers': 'true',
3293 ['win_debug_OmitFramePointers==0', {
3294 'OmitFramePointers': 'false',
3295 # The above is not sufficient (http://crbug.com/106711): it
3296 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3297 # perform FPO regardless, so we must explicitly disable.
3298 # We still want the false setting above to avoid having
3299 # "/Oy /Oy-" and warnings about overriding.
3300 'AdditionalOptions': ['/Oy-'],
3303 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3306 'LinkIncremental': '<(msvs_debug_link_incremental)',
3307 # ASLR makes debugging with windbg difficult because Chrome.exe and
3308 # Chrome.dll share the same base name. As result, windbg will
3309 # name the Chrome.dll module like chrome_<base address>, where
3310 # <base address> typically changes with each launch. This in turn
3311 # means that breakpoints in Chrome.dll don't stick from one launch
3312 # to the next. For this reason, we turn ASLR off in debug builds.
3313 # Note that this is a three-way bool, where 0 means to pick up
3314 # the default setting, 1 is off and 2 is on.
3315 'RandomizedBaseAddress': 1,
3317 'VCResourceCompilerTool': {
3318 'PreprocessorDefinitions': ['_DEBUG'],
3322 ['OS=="linux" or OS=="android"', {
3323 'target_conditions': [
3324 ['_toolset=="target"', {
3326 '<@(debug_extra_cflags)',
3331 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3332 # Enable libstdc++ debugging facilities to help catch problems
3333 # early, see http://crbug.com/65151 .
3334 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3335 'defines': ['_GLIBCXX_DEBUG=1',],
3337 ['release_valgrind_build==0', {
3340 '-fstack-protector-all', # Implies -fstack-protector
3346 # Allow comparing the address of references and 'this' against 0
3347 # in debug builds. Technically, these can never be null in
3348 # well-defined C/C++ and Clang can optimize such checks away in
3349 # release builds, but they may be used in asserts in debug builds.
3350 '-Wno-undefined-bool-conversion',
3351 '-Wno-tautological-undefined-compare',
3355 '-Wno-undefined-bool-conversion',
3356 '-Wno-tautological-undefined-compare',
3360 'VCCLCompilerTool': {
3361 'AdditionalOptions': [
3362 '-Wno-undefined-bool-conversion',
3363 '-Wno-tautological-undefined-compare',
3376 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3377 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3378 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3381 'VCCLCompilerTool': {
3382 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3384 # In official builds, each target will self-select
3385 # an optimization level.
3386 ['buildtype!="Official"', {
3387 'Optimization': '<(win_release_Optimization)',
3390 # According to MSVS, InlineFunctionExpansion=0 means
3391 # "default inlining", not "/Ob0".
3392 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3393 ['win_release_InlineFunctionExpansion==0', {
3394 'AdditionalOptions': ['/Ob0'],
3396 ['win_release_InlineFunctionExpansion!=""', {
3397 'InlineFunctionExpansion':
3398 '<(win_release_InlineFunctionExpansion)',
3401 # if win_release_OmitFramePointers is blank, leave as default
3402 ['win_release_OmitFramePointers==1', {
3403 'OmitFramePointers': 'true',
3405 ['win_release_OmitFramePointers==0', {
3406 'OmitFramePointers': 'false',
3407 # The above is not sufficient (http://crbug.com/106711): it
3408 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3409 # perform FPO regardless, so we must explicitly disable.
3410 # We still want the false setting above to avoid having
3411 # "/Oy /Oy-" and warnings about overriding.
3412 'AdditionalOptions': ['/Oy-'],
3415 # Put data in separate COMDATs. This allows the linker
3416 # to put bit-identical constants at the same address even if
3417 # they're unrelated constants, which saves binary size.
3418 # This optimization can't be used when ASan is enabled because
3419 # it is not compatible with the ASan ODR checker.
3420 'AdditionalOptions': ['/Gw'],
3423 'AdditionalOptions': [
3424 '/d2Zi+', # Improve debugging of Release builds.
3425 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3426 '<@(win_release_extra_cflags)',
3430 # LinkIncremental is a tri-state boolean, where 0 means default
3431 # (i.e., inherit from parent solution), 1 means false, and
3433 'LinkIncremental': '1',
3434 # This corresponds to the /PROFILE flag which ensures the PDB
3435 # file contains FIXUP information (growing the PDB file by about
3436 # 5%) but does not otherwise alter the output binary. This
3437 # information is used by the Syzygy optimization tool when
3438 # decomposing the release image.
3443 ['msvs_use_common_release', {
3444 'includes': ['release.gypi'],
3446 ['release_valgrind_build==0 and tsan==0', {
3449 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3453 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3454 'MEMORY_SANITIZER_INITIAL_SIZE',
3455 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3456 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3460 'defines': ['NO_TCMALLOC'],
3462 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3463 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3464 # It seems to work fine with Ubuntu 12 headers though, so use it
3465 # in official builds.
3466 ['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")', {
3467 'target_conditions': [
3468 ['chromium_code==1', {
3469 # Non-chromium code is not guaranteed to compile cleanly
3470 # with _FORTIFY_SOURCE. Also, fortified build may fail
3471 # when optimizations are disabled, so only do that for Release
3474 '_FORTIFY_SOURCE=2',
3479 ['OS=="linux" or OS=="android"', {
3480 'target_conditions': [
3481 ['_toolset=="target"', {
3483 '<@(release_extra_cflags)',
3486 ['enable_resource_whitelist_generation==1', {
3488 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3497 'NS_BLOCK_ASSERTIONS=1',
3503 # Concrete configurations
3506 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3509 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3514 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3515 'target_conditions': [
3516 [ '_type=="executable"', {
3517 # To get a real .dSYM bundle produced by dsymutil, set the
3518 # debug information format to dwarf-with-dsym. Since
3519 # strip_from_xcode will not be used, set Xcode to do the
3520 # stripping as well.
3522 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3523 'DEPLOYMENT_POSTPROCESSING': 'YES',
3524 'STRIP_INSTALLED_PRODUCT': 'YES',
3531 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3533 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3536 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3544 'target_defaults': {
3549 # TODO(glider): enable the default options on other systems.
3551 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3553 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3559 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3560 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3561 'target_defaults': {
3563 '-Wl,--fatal-warnings',
3567 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3568 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
3569 'target_defaults': {
3575 ['os_posix==1 and chromeos==0', {
3576 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3577 # and we want to avoid overriding this, so stack-protector is only
3578 # enabled when not building on Chrome OS.
3579 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3581 'target_defaults': {
3583 '-fstack-protector',
3584 '--param=ssp-buffer-size=4',
3588 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3589 'target_defaults': {
3590 # Enable -Werror by default, but put it in a variable so it can
3591 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3593 'werror%': '-Werror',
3594 'libraries_for_target%': '',
3597 '_FILE_OFFSET_BITS=64',
3600 '<(werror)', # See note above about the werror variable.
3602 '-fno-strict-aliasing', # See http://crbug.com/32204
3604 # TODO(evan): turn this back on once all the builds work.
3606 # Don't warn about unused function params. We use those everywhere.
3607 '-Wno-unused-parameter',
3608 # Don't warn about the "struct foo f = {0};" initialization pattern.
3609 '-Wno-missing-field-initializers',
3610 # Don't export any symbols (for example, to plugins we dlopen()).
3611 # Note: this is *required* to make some plugins work.
3612 '-fvisibility=hidden',
3618 '-fno-threadsafe-statics',
3619 # Make inline functions have hidden visiblity by default.
3620 # Surprisingly, not covered by -fvisibility=hidden.
3621 '-fvisibility-inlines-hidden',
3622 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3623 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3627 '-pthread', '-Wl,-z,noexecstack',
3630 '<(libraries_for_target)',
3635 'debug_optimize%': '0',
3641 '-O>(debug_optimize)',
3646 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3647 # TODO(jdduke) Re-enable on mips after resolving linking
3648 # issues with libc++ (crbug.com/456380).
3650 # Warn in case of text relocations.
3651 '-Wl,--warn-shared-textrel',
3654 ['OS=="android" and android_full_debug==0', {
3655 # Some configurations are copied from Release_Base to reduce
3658 'debug_optimize%': 's',
3662 '-ffunction-sections',
3669 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3670 # We don't omit frame pointers on arm64 since they are required
3671 # to correctly unwind stackframes which contain system library
3672 # function frames (crbug.com/391706).
3674 '-fomit-frame-pointer',
3677 ['OS=="linux" and target_arch=="ia32"', {
3679 '-Wl,--no-as-needed',
3682 ['debug_unwind_tables==1', {
3683 'cflags': ['-funwind-tables'],
3685 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3686 'defines': ['NO_UNWIND_TABLES'],
3688 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3689 # definitions in to the right scope to use them when setting
3690 # linux_use_debug_fission, so it can be used here alone.
3691 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3692 'cflags': ['-gsplit-dwarf'],
3698 'release_optimize%': '2',
3699 # Binaries become big and gold is unable to perform GC
3700 # and remove unused sections for some of test targets
3701 # on 32 bit platform.
3702 # (This is currently observed only in chromeos valgrind bots)
3703 # The following flag is to disable --gc-sections linker
3704 # option for these bots.
3705 'no_gc_sections%': 0,
3707 # TODO(bradnelson): reexamine how this is done if we change the
3708 # expansion of configurations
3709 'release_valgrind_build%': 0,
3712 '-O<(release_optimize)',
3713 # Don't emit the GCC version ident directives, they just end up
3714 # in the .comment section taking up binary size.
3716 # Put data and code in their own sections, so that unused symbols
3717 # can be removed at link time with --gc-sections.
3719 '-ffunction-sections',
3722 # Specifically tell the linker to perform optimizations.
3723 # See http://lwn.net/Articles/192624/ .
3728 ['no_gc_sections==0', {
3730 '-Wl,--gc-sections',
3733 ['OS=="android" and target_arch!="arm64"', {
3734 # We don't omit frame pointers on arm64 since they are required
3735 # to correctly unwind stackframes which contain system library
3736 # function frames (crbug.com/391706).
3738 '-fomit-frame-pointer',
3741 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3742 # TODO(jdduke) Re-enable on mips after resolving linking
3743 # issues with libc++ (crbug.com/456380).
3745 # Warn in case of text relocations.
3746 '-Wl,--warn-shared-textrel',
3751 'release_optimize%': 's',
3756 '-fno-omit-frame-pointer',
3760 ['profiling_full_stack_frames==1', {
3763 '-fno-optimize-sibling-calls',
3768 ['release_unwind_tables==1', {
3769 'cflags': ['-funwind-tables'],
3771 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3772 'defines': ['NO_UNWIND_TABLES'],
3778 ['target_arch=="ia32"', {
3779 'target_conditions': [
3780 ['_toolset=="target"', {
3782 # Needed so that libs with .s files (e.g. libicudata.a)
3783 # are compatible with the general 32-bit-ness.
3786 # All floating-point computations on x87 happens in 80-bit
3787 # precision. Because the C and C++ language standards allow
3788 # the compiler to keep the floating-point values in higher
3789 # precision than what's specified in the source and doing so
3790 # is more efficient than constantly rounding up to 64-bit or
3791 # 32-bit precision as specified in the source, the compiler,
3792 # especially in the optimized mode, tries very hard to keep
3793 # values in x87 floating-point stack (in 80-bit precision)
3794 # as long as possible. This has important side effects, that
3795 # the real value used in computation may change depending on
3796 # how the compiler did the optimization - that is, the value
3797 # kept in 80-bit is different than the value rounded down to
3798 # 64-bit or 32-bit. There are possible compiler options to
3799 # make this behavior consistent (e.g. -ffloat-store would keep
3800 # all floating-values in the memory, thus force them to be
3801 # rounded to its original precision) but they have significant
3802 # runtime performance penalty.
3804 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3805 # which keep floating-point values in SSE registers in its
3806 # native precision (32-bit for single precision, and 64-bit
3807 # for double precision values). This means the floating-point
3808 # value used during computation does not change depending on
3809 # how the compiler optimized the code, since the value is
3810 # always kept in its specified precision.
3812 # Refer to http://crbug.com/348761 for rationale behind SSE2
3813 # being a minimum requirement for 32-bit Linux builds and
3814 # http://crbug.com/313032 for an example where this has "bit"
3819 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3826 # Use gold linker for Android ia32 target.
3832 # Install packages have started cropping up with
3833 # different headers between the 32-bit and 64-bit
3834 # versions, so we have to shadow those differences off
3835 # and make sure a 32-bit-on-64-bit build picks up the
3837 # For android build, use NDK headers instead of host headers
3838 ['host_arch!="ia32" and OS!="android"', {
3847 ['target_arch=="x64"', {
3848 'target_conditions': [
3849 ['_toolset=="target"', {
3851 # Use gold linker for Android x64 target.
3868 ['target_arch=="arm"', {
3869 'target_conditions': [
3870 ['_toolset=="target"', {
3874 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3875 # has changed whenever it encounters a varargs function. This
3876 # silences those warnings, as they are not helpful and
3877 # clutter legitimate warnings.
3881 ['clang==1 and arm_arch!="" and OS!="android"', {
3883 '-target arm-linux-gnueabihf',
3886 '-target arm-linux-gnueabihf',
3891 '-march=<(arm_arch)',
3894 ['use_lto==1 or use_lto_o2==1', {
3896 '-march=<(arm_arch)',
3901 ['clang==1 and OS!="android"', {
3903 # We need to disable clang's builtin assembler as it can't
3904 # handle several asm files, crbug.com/124610
3905 '-no-integrated-as',
3910 '-mtune=<(arm_tune)',
3913 ['use_lto==1 or use_lto_o2==1', {
3915 '-mtune=<(arm_tune)',
3925 ['use_lto==1 or use_lto_o2==1', {
3932 ['arm_float_abi!=""', {
3934 '-mfloat-abi=<(arm_float_abi)',
3937 ['use_lto==1 or use_lto_o2==1', {
3939 '-mfloat-abi=<(arm_float_abi)',
3949 ['use_lto==1 or use_lto_o2==1', {
3957 # Most of the following flags are derived from what Android
3958 # uses by default when building for arm, reference for which
3959 # can be found in the following file in the Android NDK:
3960 # toolchains/arm-linux-androideabi-4.9/setup.mk
3962 # The tree-sra optimization (scalar replacement for
3963 # aggregates enabling subsequent optimizations) leads to
3964 # invalid code generation when using the Android NDK's
3965 # compiler (r5-r7). This can be verified using
3966 # webkit_unit_tests' WTF.Checked_int8_t test.
3968 # The following option is disabled to improve binary
3969 # size and performance in gcc 4.9.
3970 '-fno-caller-saves',
3973 # Android now supports .relro sections properly.
3974 # NOTE: While these flags enable the generation of .relro
3975 # sections, the generated libraries can still be loaded on
3976 # older Android platform versions.
3983 ['gcc_version==48 and clang==0', {
3985 # The following 5 options are disabled to save on
3986 # binary size in GCC 4.8.
3987 '-fno-partial-inlining',
3988 '-fno-early-inlining',
3989 '-fno-tree-copy-prop',
3990 '-fno-tree-loop-optimize',
3991 '-fno-move-loop-invariants',
3995 'cflags': [ '-mthumb-interwork' ],
3999 # Thumb code with frame pointer makes chrome crash
4002 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
4003 # The perf report sometimes incorrectly attributes
4004 # code from tail calls.
4005 '-fno-optimize-sibling-calls',
4008 '-fomit-frame-pointer',
4013 # Clang does not support the following options.
4014 '-mthumb-interwork',
4015 '-finline-limit=64',
4017 '-fno-caller-saves',
4021 # TODO(hans) Enable integrated-as (crbug.com/124610).
4022 '-no-integrated-as',
4023 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4026 # Let clang find the ld.gold in the NDK.
4027 '--gcc-toolchain=<(android_toolchain)/..',
4032 '-marm', # Required for frame pointer based stack traces.
4039 # We set arm_arch to "" so that -march compiler option
4040 # is not set. Otherwise a gcc bug that would complain
4041 # about it conflicting with '-mcpu=cortex-a9'. The flag
4042 # '-march=armv7-a' is actually redundant anyway because
4043 # it is enabled by default when we built the toolchain.
4044 # And using '-mcpu=cortex-a9' should be sufficient.
4047 # Breakpad requires symbols with debugging information
4051 # We want to statically link libstdc++/libgcc_s.
4052 '-static-libstdc++',
4056 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4057 # define their own cflags for arm builds that could
4058 # conflict with the flags we set here (e.g.
4059 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4068 ['target_arch=="arm64"', {
4069 'target_conditions': [
4070 ['_toolset=="target"', {
4074 '-fstack-protector', # stack protector is always enabled on arm64.
4077 # TODO: Remove webview test once webview fully compiles from
4078 # Chromium. crbug.com/440793
4079 ['OS=="android" and android_webview_build==0', {
4088 ['target_arch=="mipsel"', {
4089 'target_conditions': [
4090 ['_toolset=="target"', {
4092 ['android_webview_build==0', {
4094 ['mips_arch_variant=="r6"', {
4095 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
4098 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4102 ['mips_arch_variant=="r2"', {
4103 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
4105 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4106 'cflags': ['-m<(mips_fpu_mode)'],
4110 ['mips_arch_variant=="r1"', {
4111 'cflags': ['-mips32', '-Wa,-mips32'],
4113 ['mips_dsp_rev==1', {
4114 'cflags': ['-mdsp'],
4116 ['mips_dsp_rev==2', {
4117 'cflags': ['-mdspr2'],
4121 '-m<(mips_float_abi)-float'
4126 '-Wl,--no-keep-memory'
4129 '-Wno-uninitialized',
4134 ['target_arch=="mips64el"', {
4135 'target_conditions': [
4136 ['_toolset=="target"', {
4138 ['android_webview_build==0', {
4140 ['mips_arch_variant=="r6"', {
4141 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4142 'ldflags': ['-mips64r6'],
4144 ['mips_arch_variant=="r2"', {
4145 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4146 'ldflags': ['-mips64r2'],
4152 '-Wno-uninitialized',
4166 'target_conditions': [
4167 ['_toolset=="target"', {
4169 '--sysroot=<(sysroot)',
4172 '--sysroot=<(sysroot)',
4173 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4179 # TODO(thakis): Remove, http://crbug.com/263960
4180 '-Wno-reserved-user-defined-literal',
4183 # gnu++11 instead of c++11 is needed because some code uses
4184 # typeof() (a GNU extension).
4185 # TODO(thakis): Eventually switch this to c++11 instead,
4186 # http://crbug.com/427584
4190 ['clang==0 and host_clang==1', {
4191 'target_conditions': [
4192 ['_toolset=="host"', {
4193 'cflags_cc': [ '-std=gnu++11', ],
4197 ['clang==1 and clang_use_chrome_plugins==1', {
4199 '<@(clang_chrome_plugins_flags)',
4202 ['clang==1 and clang_load!=""', {
4204 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4207 ['clang==1 and clang_add_plugin!=""', {
4209 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4212 ['clang==1 and target_arch=="ia32"', {
4214 # Else building libyuv gives clang's register allocator issues,
4215 # see llvm.org/PR15798 / crbug.com/233709
4216 '-momit-leaf-frame-pointer',
4217 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4218 '-mstack-alignment=16',
4222 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4224 # See http://crbug.com/110262
4225 '-fcolor-diagnostics',
4228 # Common options for AddressSanitizer, LeakSanitizer,
4229 # ThreadSanitizer and MemorySanitizer.
4230 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4231 'target_conditions': [
4232 ['_toolset=="target"', {
4234 '-fno-omit-frame-pointer',
4235 '-gline-tables-only',
4238 '-fomit-frame-pointer',
4243 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4244 'target_conditions': [
4245 ['_toolset=="target"', {
4247 # Functions interposed by the sanitizers can make ld think
4248 # that some libraries aren't needed when they actually are,
4249 # http://crbug.com/234010. As workaround, disable --as-needed.
4253 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4254 'MEMORY_SANITIZER_INITIAL_SIZE',
4260 'target_conditions': [
4261 ['_toolset=="target"', {
4263 '-fsanitize=address',
4264 # TODO(earthdok): Re-enable. http://crbug.com/427202
4265 #'-fsanitize-blacklist=<(asan_blacklist)',
4268 '-fsanitize=address',
4275 '-mllvm -asan-globals=0', # http://crbug.com/352073
4281 'target_conditions': [
4282 ['_toolset=="target"', {
4284 '-fsanitize=undefined',
4285 '-fsanitize-blacklist=<(ubsan_blacklist)',
4286 # Employ the experimental PBQP register allocator to avoid
4287 # slow compilation on files with too many basic blocks.
4288 # See http://crbug.com/426271.
4289 '-mllvm -regalloc=pbqp',
4290 # Speculatively use coalescing to slightly improve the code
4291 # generated by PBQP regallocator. May increase compile time.
4292 '-mllvm -pbqp-coalescing',
4301 '-fsanitize=undefined',
4304 'UNDEFINED_SANITIZER',
4310 'target_conditions': [
4311 ['_toolset=="target"', {
4314 '-fsanitize-blacklist=<(ubsan_blacklist)',
4326 'UNDEFINED_SANITIZER',
4331 ['asan_coverage!=0 and sanitizer_coverage==0', {
4332 'target_conditions': [
4333 ['_toolset=="target"', {
4335 '-fsanitize-coverage=<(asan_coverage)',
4338 'SANITIZER_COVERAGE',
4343 ['sanitizer_coverage!=0', {
4344 'target_conditions': [
4345 ['_toolset=="target"', {
4347 '-fsanitize-coverage=<(sanitizer_coverage)',
4350 'SANITIZER_COVERAGE',
4355 ['asan_field_padding!=0', {
4356 'target_conditions': [
4357 ['_toolset=="target"', {
4359 '-fsanitize-address-field-padding=<(asan_field_padding)',
4365 'target_conditions': [
4366 ['_toolset=="target"', {
4375 'WTF_USE_LEAK_SANITIZER=1',
4381 'target_conditions': [
4382 ['_toolset=="target"', {
4384 '-fsanitize=thread',
4385 '-fsanitize-blacklist=<(tsan_blacklist)',
4388 '-fsanitize=thread',
4392 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4393 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4399 'target_conditions': [
4400 ['_toolset=="target"', {
4402 '-fsanitize=memory',
4403 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4404 '-fsanitize-blacklist=<(msan_blacklist)',
4407 '-fsanitize=memory',
4415 ['use_instrumented_libraries==1', {
4417 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4420 ['use_custom_libcxx==1', {
4422 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4425 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4426 'target_conditions' : [
4427 # crazy_linker has an upstream gyp file we can't edit, and we
4428 # don't want to instrument it.
4429 ['_toolset=="target" and _target_name!="crazy_linker"', {
4431 '-finstrument-functions',
4432 # Allow mmx intrinsics to inline, so that the
4433 #0 compiler can expand the intrinsics.
4434 '-finstrument-functions-exclude-file-list=mmintrin.h',
4437 ['_toolset=="target" and OS=="android"', {
4439 # Avoids errors with current NDK:
4440 # "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"
4441 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4446 ['linux_dump_symbols==1', {
4449 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4450 'target_conditions': [
4451 ['_toolset=="target"', {
4453 # Attempt to use less memory to prevent the linker from
4454 # running out of address space. Considering installing a
4455 # 64-bit kernel and switching to a 64-bit linker.
4456 '-Wl,--no-keep-memory',
4463 ['use_allocator!="tcmalloc"', {
4464 'defines': ['NO_TCMALLOC'],
4466 ['linux_use_gold_flags==1', {
4467 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4469 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4470 'ldflags': [ '-fuse-ld=gold', ],
4472 'target_conditions': [
4473 ['_toolset=="target"', {
4475 # Experimentation found that using four linking threads
4476 # saved ~20% of link time.
4477 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4478 # Only apply this to the target linker, since the host
4479 # linker might not be gold, but isn't used much anyway.
4480 # TODO(raymes): Disable threading because gold is frequently
4481 # crashing on the bots: crbug.com/161942.
4483 # '-Wl,--thread-count=4',
4486 # TODO(thestig): Enable this for disabled cases.
4487 [ 'buildtype!="Official" and chromeos==0 and release_valgrind_build==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
4489 '-Wl,--detect-odr-violations',
4496 ['release_valgrind_build==0 and order_profiling==0', {
4497 'target_conditions': [
4498 ['_toolset=="target"', {
4500 '-Wl,--icf=<(gold_icf_level)',
4507 ['linux_use_bundled_binutils==1', {
4509 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4512 ['linux_use_bundled_gold==1', {
4513 # Put our binutils, which contains gold in the search path. We pass
4514 # the path to gold to the compiler. gyp leaves unspecified what the
4515 # cwd is when running the compiler, so the normal gyp path-munging
4516 # fails us. This hack gets the right path.
4518 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4521 # Some binutils 2.23 releases may or may not have new dtags enabled,
4522 # but they are all compatible with --disable-new-dtags,
4523 # because the new dynamic tags are not created by default.
4524 ['binutils_version>=223', {
4525 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4526 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4527 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4528 # inside this file to allow usage of --no-as-needed and removal of
4531 '-Wl,--disable-new-dtags',
4534 ['gcc_version>=47 and clang==0', {
4535 'target_conditions': [
4536 ['_toolset=="target"', {
4539 # See comment for -Wno-c++11-narrowing.
4541 # TODO(thakis): Remove, http://crbug.com/263960
4542 '-Wno-literal-suffix',
4547 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4548 'target_conditions': [
4549 ['_toolset=="host"', {
4552 # See comment for -Wno-c++11-narrowing.
4554 # TODO(thakis): Remove, http://crbug.com/263960
4555 '-Wno-literal-suffix',
4563 # FreeBSD-specific options; note that most FreeBSD options are set above,
4566 'target_defaults': {
4568 '-Wl,--no-keep-memory',
4572 # Android-specific options; note that most are set above with Linux.
4575 # This is a unique identifier for a given build. It's used for
4576 # identifying various build artifacts corresponding to a particular
4577 # build of chrome (e.g. where to find archived symbols).
4578 'chrome_build_id%': '',
4580 # Figure this out early since it needs symbols from libgcc.a, so it
4581 # has to be before that in the set of libraries.
4582 ['component=="shared_library"', {
4583 'android_stlport_library': 'stlport_shared',
4585 'android_stlport_library': 'stlport_static',
4589 # Placing this variable here prevents from forking libvpx, used
4590 # by remoting. Remoting is off, so it needn't built,
4591 # so forking it's deps seems like overkill.
4592 # But this variable need defined to properly run gyp.
4593 # A proper solution is to have an OS==android conditional
4594 # in third_party/libvpx/libvpx.gyp to define it.
4595 'libvpx_path': 'lib/linux/arm',
4597 'target_defaults': {
4599 'release_extra_cflags%': '',
4601 # If we're using the components build, append "cr" to all shared
4602 # libraries to avoid naming collisions with android system library
4603 # versions with the same name (e.g. skia, icu).
4604 ['component=="shared_library"', {
4605 'android_product_extension': 'cr.so',
4607 'android_product_extension': 'so',
4611 'target_conditions': [
4612 ['_type=="shared_library"', {
4613 'product_extension': '<(android_product_extension)',
4616 # Settings for building device targets using Android's toolchain.
4617 # These are based on the setup.mk file from the Android NDK.
4619 # The NDK Android executable link step looks as follows:
4621 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4622 # $(PRIVATE_OBJECTS) <-- The .o that we built
4623 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4624 # $(TARGET_LIBGCC) <-- libgcc.a
4625 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4626 # $(PRIVATE_LDLIBS) <-- System .so
4627 # $(TARGET_CRTEND_O) <-- crtend.o
4629 # For now the above are approximated for executables by adding
4630 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4633 # The NDK Android shared library link step looks as follows:
4635 # $(PRIVATE_OBJECTS) <-- The .o that we built
4636 # -l,--whole-archive
4637 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4638 # -l,--no-whole-archive
4639 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4640 # $(TARGET_LIBGCC) <-- libgcc.a
4641 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4642 # $(PRIVATE_LDLIBS) <-- System .so
4644 # For now, assume that whole static libraries are not needed.
4646 # For both executables and shared libraries, add the proper
4647 # libgcc.a to the start of libraries which puts it in the
4648 # proper spot after .o and .a files get linked in.
4650 # TODO: The proper thing to do longer-tem would be proper gyp
4651 # support for a custom link command line.
4652 ['_toolset=="target"', {
4654 '-pthread', # Not supported by Android toolchain.
4657 '-ffunction-sections',
4660 '-fstack-protector',
4662 '-finline-limit=64',
4663 '-Wa,--noexecstack',
4664 '<@(release_extra_cflags)',
4668 '__GNU_SOURCE=1', # Necessary for clone()
4670 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4671 'CHROME_BUILD_ID="<(chrome_build_id)"',
4674 '-pthread', # Not supported by Android toolchain.
4677 '-Wl,--no-undefined',
4680 ['component=="static_library" and android_webview_build==0', {
4681 'target_conditions': [
4682 ['use_native_jni_exports==0', {
4683 # Use a linker version script to strip JNI exports from
4684 # binaries which have not specifically asked to use them.
4686 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4693 # Work around incompatibilities between bionic and clang
4695 '-D__compiler_offsetof=__builtin_offsetof',
4696 '-Dnan=__builtin_nan',
4699 ['target_arch=="arm"', {
4701 '-target arm-linux-androideabi',
4704 '-target arm-linux-androideabi',
4707 ['target_arch=="ia32"', {
4709 '-target x86-linux-androideabi',
4712 '-target x86-linux-androideabi',
4715 # Place holder for x64 support, not tested.
4716 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4717 ['target_arch=="x64"', {
4719 '-target x86_64-linux-androideabi',
4722 '-target x86_64-linux-androideabi',
4729 # Android build relies on -Wl,--gc-sections removing
4730 # unreachable code. ASan instrumentation for globals inhibits
4731 # this and results in a library with unresolvable relocations.
4732 # TODO(eugenis): find a way to reenable this.
4733 '-mllvm -asan-globals=0',
4736 ['android_webview_build==0', {
4738 # The NDK has these things, but doesn't define the constants
4739 # to say that it does. Define them here instead.
4743 '--sysroot=<(android_ndk_sysroot)',
4746 '--sysroot=<(android_ndk_sysroot)',
4748 # Don't allow visible symbols from libgcc or stlport to be
4750 '-Wl,--exclude-libs=libgcc.a',
4751 '-Wl,--exclude-libs=libstlport_static.a',
4752 # Don't allow visible symbols from libraries that contain
4753 # assembly code with symbols that aren't hidden properly.
4754 # http://crbug.com/448386
4755 '-Wl,--exclude-libs=libcommon_audio.a',
4756 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4757 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4758 '-Wl,--exclude-libs=libiSACFix.a',
4759 '-Wl,--exclude-libs=libisac_neon.a',
4760 '-Wl,--exclude-libs=libopus.a',
4761 '-Wl,--exclude-libs=libvpx.a',
4764 '-l<(android_stlport_library)',
4765 # Manually link the libgcc.a that the cross compiler uses.
4766 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4772 ['android_webview_build==1', {
4774 # Android predefines this as 1; undefine it here so Chromium
4775 # can redefine it later to be 2 for chromium code and unset
4776 # for third party code. This works because cflags are added
4778 '-U_FORTIFY_SOURCE',
4779 # Disable any additional warnings enabled by the Android build system but which
4780 # chromium does not build cleanly with (when treating warning as errors).
4781 # Things that are part of -Wextra:
4782 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4783 '-Wno-ignored-qualifiers',
4785 '-Wno-unused-but-set-variable',
4788 # Other things unrelated to -Wextra:
4789 '-Wno-non-virtual-dtor',
4796 ['android_webview_build==1', {
4797 'target_conditions': [
4798 ['chromium_code==0', {
4800 # There is a class of warning which:
4801 # 1) Android always enables and also treats as errors
4802 # 2) Chromium ignores in third party code
4803 # So we re-enable those warnings when building Android.
4805 '-Wno-format-security',
4807 '-Wno-sequence-point',
4810 '-Wno-non-virtual-dtor',
4815 ['target_arch == "arm" and order_profiling==0', {
4817 # Enable identical code folding to reduce size.
4818 '-Wl,--icf=<(gold_icf_level)',
4821 # NOTE: The stlport header include paths below are specified in
4822 # cflags rather than include_dirs because they need to come
4823 # after include_dirs. Think of them like system headers, but
4824 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4825 # toolchain (circa Gingerbread) will exhibit strange errors.
4826 # The include ordering here is important; change with caution.
4827 ['android_webview_build==0', {
4829 '-isystem<(android_stlport_include)',
4832 '-L<(android_stlport_libs_dir)',
4834 }, { # else: android_webview_build!=0
4835 'aosp_build_settings': {
4836 # Specify that we want to statically link stlport from the
4837 # NDK. This will provide all the include and library paths
4838 # automatically at build time, and link the right library.
4839 'LOCAL_NDK_STL_VARIANT': 'stlport_static',
4842 ['target_arch=="ia32"', {
4843 # The x86 toolchain currently has problems with stack-protector.
4845 '-fstack-protector',
4848 '-fno-stack-protector',
4852 'target_conditions': [
4853 ['_type=="executable"', {
4854 # Force android tools to export the "main" symbol so they can be
4855 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4856 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4857 # when ICS support will be dropped.
4860 '-fvisibility=default',
4864 '-Wl,--gc-sections',
4865 '-Wl,-z,nocopyreloc',
4868 # crtbegin_dynamic.o should be the last item in ldflags.
4869 '<(android_ndk_lib)/crtbegin_dynamic.o',
4872 # crtend_android.o needs to be the last item in libraries.
4873 # Do not add any libraries after this!
4874 '<(android_ndk_lib)/crtend_android.o',
4877 ['_type=="shared_library" or _type=="loadable_module"', {
4879 '-Wl,-shared,-Bsymbolic',
4882 ['android_webview_build==0', {
4884 # crtbegin_so.o should be the last item in ldflags.
4885 '<(android_ndk_lib)/crtbegin_so.o',
4888 # crtend_so.o needs to be the last item in libraries.
4889 # Do not add any libraries after this!
4890 '<(android_ndk_lib)/crtend_so.o',
4897 # Settings for building host targets using the system toolchain.
4898 ['_toolset=="host"', {
4900 # Due to issues in Clang build system, using ASan on 32-bit
4901 # binaries on x86_64 host is problematic.
4902 # TODO(eugenis): re-enable.
4903 '-fsanitize=address',
4906 '-fsanitize=address',
4907 '-Wl,-z,noexecstack',
4908 '-Wl,--gc-sections',
4911 '-Wl,--warn-shared-textrel',
4912 '-Wl,--fatal-warnings',
4915 # Settings for building host targets on mac.
4916 ['_toolset=="host" and host_os=="mac"', {
4926 'cflags!': ['-fvisibility=hidden'],
4927 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4929 ['OS=="mac" or OS=="ios"', {
4930 'target_defaults': {
4933 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4934 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4935 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4936 'COPY_PHASE_STRIP': 'NO',
4937 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4938 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4939 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4940 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4941 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4942 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4943 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4944 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4945 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4946 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4947 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4948 'GCC_VERSION': '4.2',
4949 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4950 'USE_HEADERMAP': 'NO',
4955 # Don't warn about unused function parameters.
4956 '-Wno-unused-parameter',
4957 # Don't warn about the "struct foo f = {0};" initialization
4959 '-Wno-missing-field-initializers',
4962 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4963 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4965 # Note that the prebuilt Clang binaries should not be used for iOS
4966 # development except for ASan builds.
4968 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
4969 # Warn if automatic synthesis is triggered with
4970 # the -Wobjc-missing-property-synthesis flag.
4971 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4972 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4974 # This warns on selectors from Cocoa headers (-length, -set).
4975 # cfe-dev is currently discussing the merits of this warning.
4976 # TODO(thakis): Reevaluate what to do with this, based one
4977 # cfe-dev discussion.
4978 '-Wno-selector-type-mismatch',
4981 ['clang_xcode==0', {
4982 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4983 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4987 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4989 '<@(clang_chrome_plugins_flags)',
4992 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4994 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4997 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4999 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
5002 ['clang==1 and "<(GENERATOR)"=="ninja"', {
5004 # See http://crbug.com/110262
5005 '-fcolor-diagnostics',
5008 ['OS=="ios" and target_subarch!="arm32" and \
5009 "<(GENERATOR)"=="xcode"', {
5011 # TODO(ios): when building Chrome for iOS on 64-bit platform
5012 # with Xcode, the -Wshorted-64-to-32 warning is automatically
5013 # enabled. This cause failures when compiling protobuf code,
5014 # so disable the warning. http://crbug.com/359107
5015 '-Wno-shorten-64-to-32',
5023 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
5029 '-fsanitize=address',
5030 '-mllvm -asan-globals=0', # http://crbug.com/352073
5031 '-gline-tables-only',
5035 ['asan_coverage!=0 and sanitizer_coverage==0', {
5036 'target_conditions': [
5037 ['_toolset=="target"', {
5039 '-fsanitize-coverage=<(asan_coverage)',
5042 'SANITIZER_COVERAGE',
5047 ['sanitizer_coverage!=0', {
5048 'target_conditions': [
5049 ['_toolset=="target"', {
5051 '-fsanitize-coverage=<(sanitizer_coverage)',
5054 'SANITIZER_COVERAGE',
5060 'target_conditions': [
5061 ['_type!="static_library"', {
5062 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5067 '-fsanitize=address',
5071 ['mac_write_linker_maps==1', {
5074 '-Wl,-map,>(_target_name).map',
5081 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5082 'target_conditions': [
5083 ['_type=="executable"', {
5089 # Define copy_asan_dylib_path in a variable ending in
5090 # _path so that gyp understands it's a path and
5091 # performs proper relativization during dict merging.
5092 'copy_asan_dylib_path':
5093 'mac/copy_asan_runtime_dylib.sh',
5095 'postbuild_name': 'Copy ASan runtime dylib',
5097 '<(copy_asan_dylib_path)',
5106 ], # target_conditions
5107 }, # target_defaults
5108 }], # OS=="mac" or OS=="ios"
5110 'target_defaults': {
5112 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5113 # with common names, like 'check', 'require', and 'verify'.
5114 # (Included by system header. Also exists on iOS but not included.)
5115 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5116 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5119 # These should end with %, but there seems to be a bug with % in
5120 # variables that are intended to be set to different values in
5121 # different targets, like these.
5122 'mac_pie': 1, # Most executables can be position-independent.
5123 # Strip debugging symbols from the target.
5124 'mac_strip': '<(mac_strip_release)',
5128 ['mac_want_real_dsym=="default"', {
5131 'mac_real_dsym': '<(mac_want_real_dsym)'
5136 ['mac_want_real_dsym=="default"', {
5137 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5139 'mac_real_dsym': '<(mac_want_real_dsym)'
5146 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5147 # (Equivalent to -fPIC)
5148 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5149 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5150 # Keep pch files below xcodebuild/.
5151 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5153 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5154 # xcode_setting, but not until all downstream projects' mac bots are
5155 # using xcode >= 4.6, because that's when the default value of the
5156 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5157 # setting is a no-op as far as xcode is concerned, but the compiler
5158 # behaves differently based on whether -fno-strict-aliasing is
5160 '-fno-strict-aliasing', # See http://crbug.com/32204.
5163 'target_conditions': [
5164 ['_type=="executable"', {
5167 # Arranges for data (heap) pages to be protected against
5168 # code execution when running on Mac OS X 10.7 ("Lion"), and
5169 # ensures that the position-independent executable (PIE) bit
5170 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5172 # Define change_mach_o_flags in a variable ending in _path
5173 # so that GYP understands it's a path and performs proper
5174 # relativization during dict merging.
5175 'change_mach_o_flags_path':
5176 'mac/change_mach_o_flags_from_xcode.sh',
5177 'change_mach_o_flags_options%': [
5179 'target_conditions': [
5180 ['mac_pie==0 or release_valgrind_build==1', {
5181 # Don't enable PIE if it's unwanted. It's unwanted if
5182 # the target specifies mac_pie=0 or if building for
5183 # Valgrind, because Valgrind doesn't understand slide.
5184 # See the similar mac_pie/release_valgrind_build check
5186 'change_mach_o_flags_options': [
5192 'postbuild_name': 'Change Mach-O Flags',
5194 '<(change_mach_o_flags_path)',
5195 '>@(change_mach_o_flags_options)',
5199 'target_conditions': [
5200 ['mac_pie==1 and release_valgrind_build==0', {
5201 # Turn on position-independence (ASLR) for executables. When
5202 # PIE is on for the Chrome executables, the framework will
5203 # also be subject to ASLR.
5204 # Don't do this when building for Valgrind, because Valgrind
5205 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5206 # understand slide, and get rid of the Valgrind check.
5209 '-Wl,-pie', # Position-independent executable (MH_PIE)
5215 ['(_type=="executable" or _type=="shared_library" or \
5216 _type=="loadable_module") and mac_strip!=0', {
5217 'target_conditions': [
5218 ['mac_real_dsym == 1', {
5219 # To get a real .dSYM bundle produced by dsymutil, set the
5220 # debug information format to dwarf-with-dsym. Since
5221 # strip_from_xcode will not be used, set Xcode to do the
5222 # stripping as well.
5226 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5227 'DEPLOYMENT_POSTPROCESSING': 'YES',
5228 'STRIP_INSTALLED_PRODUCT': 'YES',
5230 # Only strip non-ASan builds.
5232 'target_conditions': [
5233 ['_type=="shared_library" or _type=="loadable_module"', {
5234 # The Xcode default is to strip debugging symbols
5235 # only (-S). Local symbols should be stripped as
5236 # well, which will be handled by -x. Xcode will
5237 # continue to insert -S when stripping even when
5238 # additional flags are added with STRIPFLAGS.
5240 }], # _type=="shared_library" or _type=="loadable_module"
5241 ], # target_conditions
5247 }, # configuration "Release"
5249 }, { # mac_real_dsym != 1
5250 # To get a fast fake .dSYM bundle, use a post-build step to
5251 # produce the .dSYM and strip the executable. strip_from_xcode
5252 # only operates in the Release configuration.
5256 # Define strip_from_xcode in a variable ending in _path
5257 # so that gyp understands it's a path and performs proper
5258 # relativization during dict merging.
5259 'strip_from_xcode_path': 'mac/strip_from_xcode',
5261 'postbuild_name': 'Strip If Needed',
5262 'action': ['<(strip_from_xcode_path)'],
5266 ], # target_conditions
5267 }], # (_type=="executable" or _type=="shared_library" or
5268 # _type=="loadable_module") and mac_strip!=0
5269 ], # target_conditions
5270 }, # target_defaults
5274 'ios/coverage.gypi',
5276 'target_defaults': {
5277 'xcode_settings' : {
5278 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5281 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5282 # additional flag to suppress the "unknown compiler option" error.
5283 # Restrict this flag to builds that are either compiling with Xcode
5284 # or compiling with Xcode's Clang. This will allow Ninja builds to
5285 # continue failing on unknown compiler options.
5286 # TODO(rohitrao): This flag is temporary and should be removed as
5287 # soon as the iOS bots are updated to use Xcode 5.1.
5288 ['clang_xcode==1', {
5290 '-Wno-unknown-warning-option',
5294 # Limit the valid architectures depending on "target_subarch".
5295 # This need to include the "arm" architectures but also the "x86"
5296 # ones (they are used when building for the simulator).
5297 ['target_subarch=="arm32"', {
5298 'VALID_ARCHS': ['armv7', 'i386'],
5300 ['target_subarch=="arm64"', {
5301 'VALID_ARCHS': ['arm64', 'x86_64'],
5303 ['target_subarch=="both"', {
5304 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5306 ['use_system_libcxx==1', {
5307 'target_conditions': [
5308 # Only use libc++ when building target for iOS not when building
5309 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5310 # does not support libc++.
5311 ['_toolset=="target"', {
5312 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5316 # The default for deployment target of 7.0+ is libc++, so force
5317 # the old behavior unless libc++ is enabled.
5318 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5322 'target_conditions': [
5323 ['_toolset=="host"', {
5325 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5326 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5335 ['_toolset=="target"', {
5337 # This section should be for overriding host settings. But,
5338 # since we can't negate the iphone deployment target above, we
5339 # instead set it here for target only.
5340 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5341 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5344 ['_type=="executable"', {
5348 'DEPLOYMENT_POSTPROCESSING': 'YES',
5349 'STRIP_INSTALLED_PRODUCT': 'YES',
5354 # Remove dSYM to reduce build time.
5355 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5361 ['chromium_ios_signing', {
5362 # iOS SDK wants everything for device signed.
5363 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5365 'CODE_SIGNING_REQUIRED': 'NO',
5366 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5371 ], # target_conditions
5372 }, # target_defaults
5375 'target_defaults': {
5377 '_WIN32_WINNT=0x0603',
5384 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5385 'WIN32_LEAN_AND_MEAN',
5388 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5389 '_HAS_EXCEPTIONS=0',
5390 # Silence some warnings; we can't switch the the 'recommended'
5391 # versions as they're not available on old OSs.
5392 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5395 ['buildtype=="Official"', {
5396 # In official builds, targets can self-select an optimization
5397 # level by defining a variable named 'optimize', and setting it
5399 # - "size", optimizes for minimal code size - the default.
5400 # - "speed", optimizes for speed over code size.
5401 # - "max", whole program optimization and link-time code
5402 # generation. This is very expensive and should be used
5405 'optimize%': 'size',
5409 # Set /LTCG for the official builds.
5410 'LinkTimeCodeGeneration': '1',
5411 'AdditionalOptions': [
5412 # Set the number of LTCG code-gen threads to eight.
5413 # The default is four. This gives a 5-10% link speedup.
5418 'target_conditions': [
5419 ['optimize=="size"', {
5421 'VCCLCompilerTool': {
5422 # 1, optimizeMinSpace, Minimize Size (/O1)
5423 'Optimization': '1',
5424 # 2, favorSize - Favor small code (/Os)
5425 'FavorSizeOrSpeed': '2',
5430 ['optimize=="speed"', {
5432 'VCCLCompilerTool': {
5433 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5434 'Optimization': '2',
5435 # 1, favorSpeed - Favor fast code (/Ot)
5436 'FavorSizeOrSpeed': '1',
5441 ['optimize=="max"', {
5442 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5443 # builds. Probably anything that this would catch that
5444 # wouldn't be caught in a normal build isn't going to
5445 # actually be a bug, so the incremental value of C4702 for
5446 # PGO builds is likely very small.
5447 'msvs_disabled_warnings': [
5451 'VCCLCompilerTool': {
5452 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5453 'Optimization': '2',
5454 # 1, favorSpeed - Favor fast code (/Ot)
5455 'FavorSizeOrSpeed': '1',
5456 # This implies link time code generation.
5457 'WholeProgramOptimization': 'true',
5465 ['msvs_xtree_patched!=1', {
5466 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5467 # it's enabled. This will generally only be true for system-level
5468 # installed Express users.
5469 'msvs_disabled_warnings': [
5474 'msvs_system_include_dirs': [
5475 '<(windows_sdk_path)/Include/shared',
5476 '<(windows_sdk_path)/Include/um',
5477 '<(windows_sdk_path)/Include/winrt',
5478 '$(VSInstallDir)/VC/atlmfc/include',
5480 'msvs_cygwin_shell': 0,
5481 'msvs_disabled_warnings': [
5482 # C4127: conditional expression is constant
5483 # This warning can in theory catch dead code and other problems, but
5484 # triggers in far too many desirable cases where the conditional
5485 # expression is either set by macros or corresponds some legitimate
5486 # compile-time constant expression (due to constant template args,
5487 # conditionals comparing the sizes of different types, etc.). Some of
5488 # these can be worked around, but it's not worth it.
5491 # C4351: new behavior: elements of array 'array' will be default
5493 # This is a silly "warning" that basically just alerts you that the
5494 # compiler is going to actually follow the language spec like it's
5495 # supposed to, instead of not following it like old buggy versions
5496 # did. There's absolutely no reason to turn this on.
5499 # C4355: 'this': used in base member initializer list
5500 # It's commonly useful to pass |this| to objects in a class'
5501 # initializer list. While this warning can catch real bugs, most of
5502 # the time the constructors in question don't attempt to call methods
5503 # on the passed-in pointer (until later), and annotating every legit
5504 # usage of this is simply more hassle than the warning is worth.
5507 # C4503: 'identifier': decorated name length exceeded, name was
5509 # This only means that some long error messages might have truncated
5510 # identifiers in the presence of lots of templates. It has no effect
5511 # on program correctness and there's no real reason to waste time
5512 # trying to prevent it.
5515 # C4611: interaction between 'function' and C++ object destruction is
5517 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5518 # suggests using exceptions instead of setjmp/longjmp for C++, but
5519 # Chromium code compiles without exception support. We therefore have
5520 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5521 # means we have to turn off this warning (and be careful about how
5522 # object destruction happens in such cases).
5525 # TODO(maruel): These warnings are level 4. They will be slowly
5526 # removed as code is fixed.
5527 4100, # Unreferenced formal parameter
5528 4121, # Alignment of a member was sensitive to packing
5529 4244, # Conversion from 'type1' to 'type2', possible loss of data
5530 4481, # Nonstandard extension used: override specifier 'keyword'
5531 4505, # Unreferenced local function has been removed
5532 4510, # Default constructor could not be generated
5533 4512, # Assignment operator could not be generated
5534 4610, # Object can never be instantiated
5535 4996, # 'X': was declared deprecated (for GetVersionEx).
5538 'VCCLCompilerTool': {
5539 'AdditionalOptions': ['/MP'],
5540 'MinimalRebuild': 'false',
5541 'BufferSecurityCheck': 'true',
5542 'EnableFunctionLevelLinking': 'true',
5543 'RuntimeTypeInfo': 'false',
5544 'WarningLevel': '4',
5545 'WarnAsError': 'true',
5546 'DebugInformationFormat': '3',
5547 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5548 'ExceptionHandling': '0',
5550 'VCLibrarianTool': {
5551 'AdditionalOptions': ['/ignore:4221'],
5552 'AdditionalLibraryDirectories': [
5553 '<(windows_sdk_path)/Lib/win8/um/x86',
5557 'AdditionalDependencies': [
5569 'AdditionalLibraryDirectories': [
5570 '<(windows_sdk_path)/Lib/win8/um/x86',
5572 'GenerateDebugInformation': 'true',
5573 'MapFileName': '$(OutDir)\\$(TargetName).map',
5574 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5575 'FixedBaseAddress': '1',
5578 # 1 == /SUBSYSTEM:CONSOLE
5579 # 2 == /SUBSYSTEM:WINDOWS
5580 # Most of the executables we'll ever create are tests
5581 # and utilities with console output.
5585 'GenerateStublessProxies': 'true',
5586 'TypeLibraryName': '$(InputName).tlb',
5587 'OutputDirectory': '$(IntDir)',
5588 'HeaderFileName': '$(InputName).h',
5589 'DLLDataFileName': '$(InputName).dlldata.c',
5590 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5591 'ProxyFileName': '$(InputName)_p.c',
5593 'VCResourceCompilerTool': {
5595 'AdditionalIncludeDirectories': [
5597 '<(SHARED_INTERMEDIATE_DIR)',
5600 'target_conditions': [
5601 ['_type=="executable"', {
5603 'EmbedManifest': 'true',
5606 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5608 'AdditionalManifestFiles': [
5609 '>(win_exe_compatibility_manifest)',
5615 # Building with Clang on Windows is a work in progress and very
5616 # experimental. See crbug.com/82385.
5618 'VCCLCompilerTool': {
5619 'AdditionalOptions': [
5620 '-fmsc-version=1800',
5622 # Many files use intrinsics without including this header.
5623 # TODO(hans): Fix those files, or move this to sub-GYPs.
5626 # TODO(hans): Make this list shorter eventually.
5627 '-Qunused-arguments',
5628 '-Wno-c++11-compat-deprecated-writable-strings',
5629 '-Wno-deprecated-declarations',
5631 '-Wno-enum-conversion',
5632 '-Wno-extra-tokens',
5633 '-Wno-ignored-attributes',
5634 '-Wno-incompatible-pointer-types',
5635 '-Wno-int-to-void-pointer-cast',
5636 '-Wno-invalid-noreturn',
5637 '-Wno-logical-op-parentheses',
5639 '-Wno-missing-braces',
5640 '-Wno-missing-declarations',
5641 '-Wno-msvc-include',
5642 '-Wno-null-dereference',
5643 '-Wno-overloaded-virtual',
5645 '-Wno-pointer-sign',
5647 '-Wno-return-type-c-linkage',
5649 '-Wno-sometimes-uninitialized',
5651 '-Wno-tautological-compare',
5652 '-Wno-unknown-pragmas',
5654 '-Wno-unused-function',
5655 '-Wno-unused-private-field',
5656 '-Wno-unused-value',
5657 '-Wno-unused-variable',
5658 '-Wno-unused-local-typedef', # http://crbug.com/411648
5659 '-Wno-inconsistent-missing-override', #http://crbug.com/428099
5663 ['clang==1 and target_arch=="ia32"', {
5664 'VCCLCompilerTool': {
5665 'WarnAsError': 'false',
5666 'AdditionalOptions': [
5675 ['disable_nacl==1', {
5676 'target_defaults': {
5682 ['OS=="win" and msvs_use_common_linker_extras', {
5683 'target_defaults': {
5698 'AdditionalOptions': [
5709 'AdditionalOptions': ['/largeaddressaware'],
5713 # TODO(asan/win): Move this down into the general
5714 # win-target_defaults section once the 64-bit asan runtime
5715 # exists. See crbug.com/345874.
5716 'VCCLCompilerTool': {
5717 'AdditionalOptions': [
5718 '-fsanitize=address',
5719 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5721 'AdditionalIncludeDirectories': [
5722 # MSVC needs to be able to find the sanitizer headers when
5723 # invoked via /fallback. This is critical for using macros
5724 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5726 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/include_sanitizer',
5730 'AdditionalLibraryDirectories': [
5731 # TODO(hans): If make_clang_dir is absolute, this breaks.
5732 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/lib/windows',
5735 'target_conditions': [
5736 ['component=="shared_library"', {
5738 'AdditionalDependencies': [
5739 'clang_rt.asan_dynamic-i386.lib',
5740 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5744 ['_type=="executable" and component=="static_library"', {
5746 'AdditionalDependencies': [
5747 'clang_rt.asan-i386.lib',
5751 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5753 'AdditionalDependencies': [
5754 'clang_rt.asan_dll_thunk-i386.lib',
5766 'AdditionalOptions': [
5767 # safeseh is not compatible with x64
5779 ['enable_new_npdevice_api==1', {
5780 'target_defaults': {
5782 'ENABLE_NEW_NPDEVICE_API',
5786 # Don't warn about the "typedef 'foo' locally defined but not used"
5787 # for gcc 4.8 and higher.
5788 # TODO: remove this flag once all builds work. See crbug.com/227506
5789 ['gcc_version>=48 and clang==0', {
5790 'target_defaults': {
5792 '-Wno-unused-local-typedefs',
5796 ['gcc_version>=48 and clang==0 and host_clang==1', {
5797 'target_defaults': {
5798 'target_conditions': [
5799 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5803 # In the android webview build, force host targets to be compiled with clang
5804 # as the hermetic host gcc is very old on some platforms. This is already
5805 # the default on the current development version of AOSP but we force it
5806 # here in case we need to compile against an older release version. We also
5807 # explicitly set it to false for target binaries to avoid causing problems
5808 # for the work to enable clang by default in AOSP. We also force the use of
5809 # libstdc++ on host as peculiarities of the android gyp backend mean that
5810 # using libc++ doesn't work, and Chromium doesn't yet require a more modern
5812 ['android_webview_build==1', {
5813 'target_defaults': {
5814 'target_conditions': [
5815 ['_toolset=="host"', {
5816 'aosp_build_settings': {
5817 'LOCAL_CLANG': 'true',
5818 'LOCAL_CXX_STL': 'libstdc++',
5820 }, { # else: _toolset != "host"
5821 'aosp_build_settings': {
5822 'LOCAL_CLANG': 'false',
5828 # We need a special case to handle the android webview build on mac because
5829 # the host gcc there doesn't accept this flag, but the target gcc may
5831 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5832 'target_defaults': {
5833 'target_conditions': [
5834 ['_toolset=="host"', {
5836 '-Wno-unused-local-typedefs',
5842 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5844 'make_global_settings': [
5845 ['CC', '<(make_clang_dir)/bin/clang'],
5846 ['CXX', '<(make_clang_dir)/bin/clang++'],
5847 ['CC.host', '$(CC)'],
5848 ['CXX.host', '$(CXX)'],
5851 ['clang==1 and OS=="win"', {
5852 'make_global_settings': [
5853 # On Windows, gyp's ninja generator only looks at CC.
5854 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5857 ['use_lld==1 and OS=="win"', {
5858 'make_global_settings': [
5859 # Limited to Windows because lld-link is the driver that is compatible
5861 ['LD', '<(make_clang_dir)/bin/lld-link'],
5864 ['OS=="android" and clang==0', {
5865 # Hardcode the compiler names in the Makefile so that
5866 # it won't depend on the environment at make time.
5867 'make_global_settings': [
5868 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5869 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5870 ['CC.host', '<(host_cc)'],
5871 ['CXX.host', '<(host_cxx)'],
5874 ['OS=="linux" and target_arch=="mipsel"', {
5875 'make_global_settings': [
5876 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5877 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5878 ['CC.host', '<(host_cc)'],
5879 ['CXX.host', '<(host_cxx)'],
5882 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5883 # Set default ARM cross compiling on linux. These can be overridden
5884 # using CC/CXX/etc environment variables.
5885 'make_global_settings': [
5886 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5887 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5888 ['CC.host', '<(host_cc)'],
5889 ['CXX.host', '<(host_cxx)'],
5893 # TODO(yyanagisawa): supports GENERATOR==make
5894 # make generator doesn't support CC_wrapper without CC
5895 # in make_global_settings yet.
5896 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5897 'make_global_settings': [
5898 ['CC_wrapper', '<(gomadir)/gomacc'],
5899 ['CXX_wrapper', '<(gomadir)/gomacc'],
5900 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5901 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5905 'target_defaults': {
5906 'target_conditions': [
5907 ['_toolset=="target"', {
5915 ['use_lto==1 and clang==0', {
5916 'target_defaults': {
5917 'target_conditions': [
5918 ['_toolset=="target"', {
5920 '-ffat-lto-objects',
5926 ['use_lto==1 and clang==1', {
5927 'target_defaults': {
5928 'target_conditions': [
5929 ['_toolset=="target"', {
5931 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
5937 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
5938 'target_defaults': {
5939 'target_conditions': [
5940 ['_toolset=="target"', {
5948 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
5949 'target_defaults': {
5950 'target_conditions': [
5951 ['_toolset=="target"', {
5960 'target_defaults': {
5961 'target_conditions': [
5962 ['_toolset=="target"', {
5964 '-fsanitize=cfi-vptr',
5967 '-fsanitize=cfi-vptr',
5975 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5976 # This block adds *project-wide* configuration settings to each project
5977 # file. It's almost always wrong to put things here. Specify your
5978 # custom xcode_settings in target_defaults to add them to targets instead.
5981 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5982 # setting sets the SDK on a project-wide basis. In order to get the
5983 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5984 # here at the project level.
5987 ['mac_sdk_path==""', {
5988 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5990 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5996 ['ios_sdk_path==""', {
5998 # TODO(justincohen): Ninja only supports simulator for now.
5999 ['"<(GENERATOR)"=="xcode"', {
6000 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6002 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
6006 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6011 # Target both iPhone and iPad.
6012 'TARGETED_DEVICE_FAMILY': '1,2',
6015 ['target_arch=="x64"', {
6020 ['target_arch=="ia32"', {
6029 # The Xcode generator will look for an xcode_settings section at the root
6030 # of each dict and use it to apply settings on a file-wide basis. Most
6031 # settings should not be here, they should be in target-specific
6032 # xcode_settings sections, or better yet, should use non-Xcode-specific
6033 # settings in target dicts. SYMROOT is a special case, because many other
6034 # Xcode variables depend on it, including variables such as
6035 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6036 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6037 # files to appear (when present) in the UI as actual files and not red
6038 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6039 # and therefore SYMROOT, needs to be set at the project level.
6040 'SYMROOT': '<(DEPTH)/xcodebuild',