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 # This is set when building the Android WebView in ninja for the
166 'android_webview_telemetry_build%': 0,
168 # Set ARM architecture version.
171 # Use aurax11 for clipboard implementation. This is true on linux_aura.
172 'use_clipboard_aurax11%': 0,
176 # If no gomadir is set, it uses the default gomadir.
180 # The system root for cross-compiles. Default: none.
184 # The system libdir used for this ABI.
185 'system_libdir%': 'lib',
187 # Default MIPS arch variant. This is set in the conditions block
188 # below for MIPS targets.
189 'mips_arch_variant%': '',
197 # Set default value of toolkit_views based on OS.
198 ['OS=="win" or chromeos==1 or use_aura==1', {
204 # Embedded builds use aura without ash or views.
211 # Enable HiDPI on Mac OS, Chrome OS and Windows.
212 ['OS=="mac" or chromeos==1 or OS=="win"', {
216 # Enable the OpenSSL backend on Mac OS and Windows.
217 ['OS=="mac" or OS=="win"', {
221 # Enable App Launcher everywhere but mobile.
222 ['OS!="ios" and OS!="android"', {
223 'enable_app_list%': 1,
225 'enable_app_list%': 0,
228 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
229 'use_default_render_theme%': 1,
231 'use_default_render_theme%': 0,
235 'use_ozone_evdev%': 1,
237 'use_ozone_evdev%': 0,
240 # Set default gomadir.
242 'gomadir': 'c:\\goma\\goma-win',
244 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
247 # Set the default "target_subarch" on iOS. Valid values are "arm32",
248 # "arm64" and "both" (meaning a fat binary).
250 # TODO(sdefresne): change the default from "arm32" to "both" for
251 # "target_subarch" once http://crbug.com/339477 is fixed.
253 # TODO(sdefresne): set the "target_arch" to "arm" once compilation
254 # of skia has been fixed for simulator. http://crbug.com/342377
256 'target_subarch%': 'arm32',
259 # Set arch variants for MIPS platforms.
260 ['target_arch=="mips64el"', {
263 'mips_arch_variant%': 'r6',
265 'mips_arch_variant%': 'r2',
270 ['target_arch=="mipsel"', {
271 'mips_arch_variant%': 'r1',
276 # Copy conditionally-set variables out one scope.
277 'chromeos%': '<(chromeos)',
278 'chromecast%': '<(chromecast)',
279 'host_arch%': '<(host_arch)',
280 'target_arch%': '<(target_arch)',
281 'target_subarch%': '<(target_subarch)',
282 'mips_arch_variant%': '<(mips_arch_variant)',
283 'toolkit_views%': '<(toolkit_views)',
284 'desktop_linux%': '<(desktop_linux)',
285 'use_aura%': '<(use_aura)',
286 'use_ash%': '<(use_ash)',
287 'use_cras%': '<(use_cras)',
288 'use_libpci%': '<(use_libpci)',
289 'use_ozone%': '<(use_ozone)',
290 'use_ozone_evdev%': '<(use_ozone_evdev)',
291 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
292 'embedded%': '<(embedded)',
293 'use_openssl%': '<(use_openssl)',
294 'use_openssl_certs%': '<(use_openssl_certs)',
295 'enable_viewport%': '<(enable_viewport)',
296 'enable_hidpi%': '<(enable_hidpi)',
297 'android_channel%': '<(android_channel)',
298 'android_webview_build%': '<(android_webview_build)',
299 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
300 'use_goma%': '<(use_goma)',
301 'gomadir%': '<(gomadir)',
302 'enable_app_list%': '<(enable_app_list)',
303 'use_default_render_theme%': '<(use_default_render_theme)',
304 'buildtype%': '<(buildtype)',
305 'branding%': '<(branding)',
306 'arm_version%': '<(arm_version)',
307 'sysroot%': '<(sysroot)',
308 'chroot_cmd%': '<(chroot_cmd)',
309 'system_libdir%': '<(system_libdir)',
311 # Set to 1 to enable fast builds. Set to 2 for even faster builds
312 # (it disables debug info for fastest compilation - only for use
313 # on compile-only bots).
316 # Set to 1 to not store any build metadata, e.g. ifdef out all __DATE__
317 # and __TIME__. Set to 0 to reenable the use of these macros in the code
318 # base. See http://crbug.com/314403.
319 'dont_embed_build_metadata%': 1,
321 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
322 # This is useful for parallel compilation tools which can't support /Zi.
323 # Only used on Windows.
326 # Set to 1 to enable dcheck in release.
327 'dcheck_always_on%': 0,
329 # Set to 1 to make a build that disables unshipped tracing events.
330 # Note: this setting is ignored if buildtype=="Official".
331 'tracing_like_official_build%': 0,
333 # Disable image loader component extension by default.
334 'image_loader_extension%': 0,
336 # Set NEON compilation flags.
339 # Detect NEON support at run-time.
340 'arm_neon_optional%': 0,
342 # Use libjpeg-turbo as the JPEG codec used by Chromium.
343 'use_libjpeg_turbo%': 1,
345 # Use system libjpeg. Note that the system's libjepg will be used even if
346 # use_libjpeg_turbo is set.
347 'use_system_libjpeg%': 0,
349 # By default, component is set to static_library and it can be overriden
350 # by the GYP command line or by ~/.gyp/include.gypi.
351 'component%': 'static_library',
353 # /analyze is off by default on Windows because it is very slow and noisy.
354 # Enable with GYP_DEFINES=win_analyze=1
357 # Set to select the Title Case versions of strings in GRD files.
358 'use_titlecase_in_grd%': 0,
360 # Use translations provided by volunteers at launchpad.net. This
361 # currently only works on Linux.
362 'use_third_party_translations%': 0,
364 # Remoting compilation is enabled by default. Set to 0 to disable.
367 # Configuration policy is enabled by default. Set to 0 to disable.
368 'configuration_policy%': 1,
370 # Variable safe_browsing is used to control the build time configuration
371 # for safe browsing feature. Safe browsing can be compiled in 3 different
372 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
373 # reporting features without enabling phishing and malware detection. This
374 # is useful to integrate a third party phishing/malware detection to
375 # existing safe browsing logic.
378 # Web speech is enabled by default. Set to 0 to disable.
379 'enable_web_speech%': 1,
381 # Notifications are compiled in by default. Set to 0 to disable.
382 'notifications%' : 1,
384 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
385 # regular builds and 1 for ASan builds.
386 'mac_want_real_dsym%': 'default',
388 # If this is set, the clang plugins used on the buildbot will be used.
389 # Run tools/clang/scripts/update.sh to make sure they are compiled.
390 # This causes 'clang_chrome_plugins_flags' to be set.
391 # Has no effect if 'clang' is not set as well.
392 'clang_use_chrome_plugins%': 1,
394 # Enable building with ASAN (Clang's -fsanitize=address option).
395 # -fsanitize=address only works with clang, but asan=1 implies clang=1
396 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
398 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
399 # Enable coverage gathering instrumentation in ASan. This flag also
400 # controls coverage granularity (1 for function-level coverage, 2 for
401 # block-level coverage).
403 # Enable intra-object-overflow detection in ASan (experimental).
404 'asan_field_padding%': 0,
406 # Enable Chromium overrides of the default configurations for various
407 # dynamic tools (like ASan).
408 'use_sanitizer_options%': 0,
410 # Enable building with SyzyAsan.
411 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
414 # Enable building with LSan (Clang's -fsanitize=leak option).
415 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
416 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
419 # Enable building with TSan (Clang's -fsanitize=thread option).
420 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
421 # See http://clang.llvm.org/docs/ThreadSanitizer.html
423 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
425 # Enable building with MSan (Clang's -fsanitize=memory option).
426 # MemorySanitizer only works with clang, but msan=1 implies clang=1
427 # See http://clang.llvm.org/docs/MemorySanitizer.html
429 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
430 # Track where uninitialized memory originates from. From fastest to
431 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
432 # - track the chain of stores leading from allocation site to use site.
433 'msan_track_origins%': 1,
435 # Enable building with UBSan (Clang's -fsanitize=undefined option).
436 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
437 # See http://clang.llvm.org/docs/UsersManual.html
440 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
441 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
443 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan_vptr/blacklist.txt',
445 # Use the dynamic libraries instrumented by one of the sanitizers
446 # instead of the standard system libraries.
447 'use_instrumented_libraries%': 0,
449 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
450 # stdlibc++ as standard library. This is intended to use for instrumented
452 'use_custom_libcxx%': 0,
454 # Use system libc++ instead of the default C++ library, usually libstdc++.
455 # This is intended for iOS builds only.
456 'use_system_libcxx%': 0,
458 # Use a modified version of Clang to intercept allocated types and sizes
459 # for allocated objects. clang_type_profiler=1 implies clang=1.
460 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
461 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
462 'clang_type_profiler%': 0,
464 # Set to true to instrument the code with function call logger.
465 # See src/third_party/cygprofile/cyg-profile.cc for details.
466 'order_profiling%': 0,
468 # Use the provided profiled order file to link Chrome image with it.
469 # This makes Chrome faster by better using CPU cache when executing code.
470 # This is known as PGO (profile guided optimization).
471 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
472 'order_text_section%' : "",
474 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
475 # libraries on linux x86-64 and arm, plus ASLR.
478 # Whether one-click signin is enabled or not.
479 'enable_one_click_signin%': 0,
481 # Whether to back up data before sync.
482 'enable_pre_sync_backup%': 0,
484 # Enable Chrome browser extensions
485 'enable_extensions%': 1,
488 'enable_google_now%': 1,
490 # Enable basic printing support and UI.
491 'enable_basic_printing%': 1,
493 # Enable printing with print preview. It does not imply
494 # enable_basic_printing. It's possible to build Chrome with preview only.
495 'enable_print_preview%': 1,
497 # Set the version of CLD.
498 # 0: Don't specify the version. This option is for the Finch testing.
503 # For CLD2, the size of the tables that should be included in the build
504 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
506 # See third_party/cld_2/cld_2.gyp for more information.
507 # 0: Small tables, lower accuracy
508 # 2: Large tables, high accuracy
509 'cld2_table_size%': 2,
511 # Enable spell checker.
512 'enable_spellcheck%': 1,
514 # Webrtc compilation is enabled by default. Set to 0 to disable.
517 # Enables use of the session service, which is enabled by default.
518 # Support for disabling depends on the platform.
519 'enable_session_service%': 1,
521 # Enables theme support, which is enabled by default. Support for
522 # disabling depends on the platform.
525 # Enables autofill dialog and associated features; disabled by default.
526 'enable_autofill_dialog%' : 0,
528 # Defaults Wallet integration in Autofill dialog to use production
529 # servers. Unofficial builds won't have the proper API keys.
530 'enable_prod_wallet_service%': 0,
532 # Enables support for background apps.
533 'enable_background%': 1,
535 # Enable the task manager by default.
536 'enable_task_manager%': 1,
538 # Enables used resource whitelist generation; disabled by default.
539 'enable_resource_whitelist_generation%': 0,
541 # Enable FILE support by default.
542 'disable_file_support%': 0,
544 # Enable FTP support by default.
545 'disable_ftp_support%': 0,
547 # Use native android functions in place of ICU. Not supported by most
549 'use_icu_alternatives_on_android%': 0,
551 # Use of precompiled headers on Windows.
553 # This variable may be explicitly set to 1 (enabled) or 0
554 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
555 # This setting will override the default.
558 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
560 'chromium_win_pch%': 0,
563 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
564 # Set this to true when building with Clang.
565 # See http://code.google.com/p/chromium/wiki/Clang for details.
566 # If this is set, clang is used as both host and target compiler in
567 # cross-compile builds.
570 # Use experimental lld linker instead of the platform's default linker.
573 # Enable plug-in installation by default.
574 'enable_plugin_installation%': 1,
576 # Specifies whether to use canvas_skia.cc in place of platform
577 # specific implementations of gfx::Canvas. Affects text drawing in the
579 # TODO(asvitkine): Enable this on all platforms and delete this flag.
580 # http://crbug.com/105550
581 'use_canvas_skia%': 0,
583 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
584 # with one of those tools.
585 'build_for_tool%': '',
587 # If no directory is specified then a temporary directory will be used.
588 'test_isolation_outdir%': '',
589 # True if isolate should fail if the isolate files refer to files
591 'test_isolation_fail_on_missing': 1,
593 'wix_path%': '<(DEPTH)/third_party/wix',
595 # Supervised users are enabled by default.
596 'enable_supervised_users%': 1,
598 # Platform natively supports discardable memory.
599 'native_discardable_memory%': 0,
601 # Platform sends memory pressure signals natively.
602 'native_memory_pressure_signals%': 0,
604 'spdy_proxy_auth_property%' : '',
605 'spdy_proxy_auth_value%' : '',
607 'enable_service_discovery%': 0,
608 'enable_wifi_bootstrapping%': 0,
609 'enable_hangout_services_extension%': 0,
611 # Enable the Syzygy optimization step.
612 'syzygy_optimize%': 0,
614 # Enable hole punching for the protected video.
617 # Automatically select platforms under ozone. Turn this off to
618 # build only explicitly selected platforms.
619 'ozone_auto_platforms%': 1,
621 # If this is set clang is used as host compiler, but not as target
622 # compiler. Always do this by default.
625 # Variables to control Link-Time Optimizations (LTO).
626 # Note: the variables must *not* be enabled at the same time.
627 # In this case LTO would 'merge' the optimization flags
628 # at link-time which would lead to all code be optimized with -O2.
629 # Enable LTO on the code compiled with -Os.
630 # See crbug.com/407544
632 # Enable LTO on code compiled with -O2.
635 # Libxkbcommon usage.
639 # A flag for POSIX platforms
646 # A flag for BSD platforms
647 ['OS=="freebsd" or OS=="openbsd"', {
654 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
660 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
661 # OpenSSL's certificate definition.
662 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
663 'use_openssl_certs%': 1,
665 'use_openssl_certs%': 0,
668 # libudev usage. This currently only affects the content layer.
669 ['OS=="linux" and embedded==0', {
675 # Flags to use X11 on non-Mac POSIX platforms.
676 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
683 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
689 # Flags to use pango and cairo.
690 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
699 ['OS=="linux" and embedded==0', {
705 # We always use skia text rendering in Aura on Windows, since GDI
706 # doesn't agree with our BackingStore.
707 # TODO(beng): remove once skia text rendering is on by default.
708 ['use_aura==1 and OS=="win"', {
709 'enable_skia_text%': 1,
712 # A flag to enable or disable our compile-time dependency
713 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
714 # support will be available. This option is useful
715 # for Linux distributions and for Aura.
716 ['OS!="linux" or chromeos==1', {
717 'use_gnome_keyring%': 0,
719 'use_gnome_keyring%': 1,
722 ['OS=="mac" or OS=="ios"', {
723 # Mac and iOS want Title Case strings
724 'use_titlecase_in_grd%': 1,
727 # Enable loader extensions on Chrome OS.
729 'image_loader_extension%': 1,
731 'image_loader_extension%': 0,
734 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
735 'enable_one_click_signin%': 1,
736 'enable_pre_sync_backup%': 1,
740 'enable_extensions%': 0,
741 'enable_google_now%': 0,
743 'enable_spellcheck%': 0,
747 'arm_neon_optional%': 1,
748 'native_discardable_memory%': 1,
749 'native_memory_pressure_signals%': 1,
750 'enable_basic_printing%': 1,
751 'enable_print_preview%': 0,
752 'enable_task_manager%':0,
756 # Android OS includes support for proprietary codecs regardless of
757 # building Chromium or Google Chrome. We also ship Google Chrome and
758 # Chromecast with proprietary codecs.
759 ['OS=="android" or branding=="Chrome" or chromecast==1', {
760 'proprietary_codecs%': 1,
762 'proprietary_codecs%': 0,
765 ['OS=="mac" or OS=="ios"', {
766 'native_discardable_memory%': 1,
767 'native_memory_pressure_signals%': 1,
770 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
771 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
772 'enable_autofill_dialog%': 1,
775 ['buildtype=="Official"', {
776 'enable_prod_wallet_service%': 1,
786 'disable_ftp_support%': 1,
787 'enable_extensions%': 0,
788 'enable_google_now%': 0,
790 'cld2_table_size%': 0,
791 'enable_basic_printing%': 0,
792 'enable_print_preview%': 0,
793 'enable_session_service%': 0,
794 'enable_spellcheck%': 0,
800 'enable_supervised_users%': 0,
801 'enable_task_manager%': 0,
802 'use_system_libcxx%': 1,
803 'support_pre_M6_history_database%': 0,
806 # Use GPU accelerated cross process image transport by default
807 # on linux builds with the Aura window manager
808 ['use_aura==1 and OS=="linux"', {
809 'ui_compositor_image_transport%': 1,
811 'ui_compositor_image_transport%': 0,
814 # Turn precompiled headers on by default.
815 ['OS=="win" and buildtype!="Official"', {
816 'chromium_win_pch%': 1
819 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
820 'enable_plugin_installation%': 0,
822 'enable_plugin_installation%': 1,
825 # Whether PPAPI is enabled.
826 ['OS=="android" or OS=="ios" or embedded==1', {
827 'enable_plugins%': 0,
829 'enable_plugins%': 1,
832 # linux_use_bundled_gold: whether to use the gold linker binary checked
833 # into third_party/binutils. Force this off via GYP_DEFINES when you
834 # are using a custom toolchain and need to control -B in ldflags.
835 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
836 # for component=static_library builds.
837 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
838 'linux_use_bundled_gold%': 1,
840 'linux_use_bundled_gold%': 0,
843 # linux_use_bundled_binutils: whether to use the binary binutils
844 # checked into third_party/binutils. These are not multi-arch so cannot
845 # be used except on x86 and x86-64 (the only two architectures which
846 # are currently checke in). Force this off via GYP_DEFINES when you
847 # are using a custom toolchain and need to control -B in cflags.
848 ['OS=="linux" and (target_arch=="x64")', {
849 'linux_use_bundled_binutils%': 1,
851 'linux_use_bundled_binutils%': 0,
854 # linux_use_gold_flags: whether to use build flags that rely on gold.
855 # On by default for x64 Linux.
856 ['OS=="linux" and target_arch=="x64"', {
857 'linux_use_gold_flags%': 1,
859 'linux_use_gold_flags%': 0,
862 # linux_use_debug_fission: whether to use split DWARF debug info
863 # files. This can reduce link time significantly, but is incompatible
864 # with some utilities such as icecc and ccache. Requires gold and
865 # gcc >= 4.8 or clang.
866 # http://gcc.gnu.org/wiki/DebugFission
867 ['OS=="linux" and target_arch=="x64"', {
868 'linux_use_debug_fission%': 1,
870 'linux_use_debug_fission%': 0,
873 ['OS=="android" or OS=="ios"', {
874 'enable_captive_portal_detection%': 0,
876 'enable_captive_portal_detection%': 1,
879 # Enable Skia UI text drawing incrementally on different platforms.
880 # http://crbug.com/105550
882 # On Aura, this allows per-tile painting to be used in the browser
885 'use_canvas_skia%': 1,
889 'enable_basic_printing%': 0,
890 'enable_print_preview%': 1,
891 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
892 'use_libjpeg_turbo%': 0,
895 # Do not enable the Settings App on ChromeOS.
896 ['enable_app_list==1 and chromeos==0', {
897 'enable_settings_app%': 1,
899 'enable_settings_app%': 0,
902 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
903 # Set some defaults for arm/linux chrome builds
904 'use_allocator%': 'none',
905 # sysroot needs to be an absolute path otherwise it generates
906 # incorrect results when passed to pkg-config
907 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot',
908 }], # OS=="linux" and target_arch=="arm" and chromeos==0
910 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
912 ['target_arch=="x64"', {
913 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
915 ['target_arch=="ia32"', {
916 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
919 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
921 ['OS=="linux" and target_arch=="mipsel"', {
922 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
923 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
926 # Whether tests targets should be run, archived or just have the
927 # dependencies verified. All the tests targets have the '_run' suffix,
928 # e.g. base_unittests_run runs the target base_unittests. The test
929 # target always calls tools/swarming_client/isolate.py. See the script's
930 # --help for more information. Meant to be overriden with GYP_DEFINES.
931 # TODO(maruel): Remove the conditions as more configurations are
933 ['OS!="ios" and OS!="android" and chromeos==0', {
934 'test_isolation_mode%': 'check',
936 'test_isolation_mode%': 'noop',
938 # Whether Android build uses OpenMAX DL FFT.
939 ['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")', {
940 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
941 # When enabled, this will also enable WebAudio support on
942 # Android for these architectures. Default is enabled. Whether
943 # WebAudio is actually available depends on runtime settings
945 'use_openmax_dl_fft%': 1,
947 'use_openmax_dl_fft%': 0,
949 ['OS=="win" or OS=="linux"', {
953 # Turns on compiler optimizations in V8 in Debug build, except
954 # on android_clang, where we're hitting a weird linker error.
955 # TODO(dpranke): http://crbug.com/266155 .
957 'v8_optimized_debug%': 1,
959 'v8_optimized_debug%': 2,
962 # Disable various features by default on embedded.
965 'enable_basic_printing%': 0,
966 'enable_print_preview%': 0,
969 # By default, use ICU data file (icudtl.dat) on all platforms
970 # except when building Android WebView or Chromecast.
971 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
972 # Set the data reduction proxy origin for Android Webview.
973 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0', {
974 'icu_use_data_file_flag%' : 1,
976 'icu_use_data_file_flag%' : 0,
978 ['OS=="win" or OS=="mac"', {
979 'enable_wifi_bootstrapping%' : 1,
982 # Path to sas.dll, which provides the SendSAS function.
983 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
984 ['target_arch=="x64"', {
985 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
987 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
990 # Turn on JNI generation optimizations on non-WebView builds.
991 ['OS=="android" and android_webview_build==0', {
992 'optimize_jni_generation%': 1,
994 'optimize_jni_generation%': 0,
997 # TODO(baixo): Enable v8_use_external_startup_data
998 # http://crbug.com/421063
999 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0 and chromeos==0 and (OS=="android" or OS=="linux" or OS=="mac")', {
1000 'v8_use_external_startup_data%': 1,
1002 'v8_use_external_startup_data%': 0,
1006 # Set this to 1 to enable use of concatenated impulse responses
1007 # for the HRTF panner in WebAudio.
1008 'use_concatenated_impulse_responses': 1,
1010 # You can set the variable 'use_official_google_api_keys' to 1
1011 # to use the Google-internal file containing official API keys
1012 # for Google Chrome even in a developer build. Setting this
1013 # variable explicitly to 1 will cause your build to fail if the
1014 # internal file is missing.
1016 # The variable is documented here, but not handled in this file;
1017 # see //google_apis/determine_use_official_keys.gypi for the
1020 # Set the variable to 0 to not use the internal file, even when
1021 # it exists in your checkout.
1023 # Leave it unset in your include.gypi to have the variable
1024 # implicitly set to 1 if you have
1025 # src/google_apis/internal/google_chrome_api_keys.h in your
1026 # checkout, and implicitly set to 0 if not.
1028 # Note that official builds always behave as if the variable
1029 # was explicitly set to 1, i.e. they always use official keys,
1030 # and will fail to build if the internal file is missing.
1032 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1033 # include.gypi or by other means. Due to subtleties of GYP, this
1034 # is not the same as leaving the variable unset, even though its
1036 # //google_apis/determine_use_official_keys.gypi is 2.
1038 # Set these to bake the specified API keys and OAuth client
1039 # IDs/secrets into your build.
1041 # If you create a build without values baked in, you can instead
1042 # set environment variables to provide the keys at runtime (see
1043 # src/google_apis/google_api_keys.h for details). Features that
1044 # require server-side APIs may fail to work if no keys are
1047 # Note that if you are building an official build or if
1048 # use_official_google_api_keys has been set to 1 (explicitly or
1049 # implicitly), these values will be ignored and the official
1050 # keys will be used instead.
1051 'google_api_key%': '',
1052 'google_default_client_id%': '',
1053 'google_default_client_secret%': '',
1054 # Native Client is enabled by default.
1055 'disable_nacl%': '0',
1057 # Set to 1 to support old history files
1058 'support_pre_M6_history_database%': '1',
1061 # Copy conditionally-set variables out one scope.
1062 'branding%': '<(branding)',
1063 'buildtype%': '<(buildtype)',
1064 'target_arch%': '<(target_arch)',
1065 'target_subarch%': '<(target_subarch)',
1066 'mips_arch_variant%': '<(mips_arch_variant)',
1067 'host_arch%': '<(host_arch)',
1068 'toolkit_views%': '<(toolkit_views)',
1069 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1070 'use_aura%': '<(use_aura)',
1071 'use_ash%': '<(use_ash)',
1072 'use_cras%': '<(use_cras)',
1073 'use_libpci%': '<(use_libpci)',
1074 'use_openssl%': '<(use_openssl)',
1075 'use_openssl_certs%': '<(use_openssl_certs)',
1076 'use_nss%': '<(use_nss)',
1077 'use_udev%': '<(use_udev)',
1078 'os_bsd%': '<(os_bsd)',
1079 'os_posix%': '<(os_posix)',
1080 'use_dbus%': '<(use_dbus)',
1081 'use_glib%': '<(use_glib)',
1082 'use_pango%': '<(use_pango)',
1083 'use_cairo%': '<(use_cairo)',
1084 'use_ozone%': '<(use_ozone)',
1085 'use_ozone_evdev%': '<(use_ozone_evdev)',
1086 'use_xkbcommon%': '<(use_xkbcommon)',
1087 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1088 'desktop_linux%': '<(desktop_linux)',
1089 'use_x11%': '<(use_x11)',
1090 'use_gnome_keyring%': '<(use_gnome_keyring)',
1091 'linux_fpic%': '<(linux_fpic)',
1092 'chromeos%': '<(chromeos)',
1093 'chromecast%': '<(chromecast)',
1094 'enable_viewport%': '<(enable_viewport)',
1095 'enable_hidpi%': '<(enable_hidpi)',
1096 'image_loader_extension%': '<(image_loader_extension)',
1097 'fastbuild%': '<(fastbuild)',
1098 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1099 'win_z7%': '<(win_z7)',
1100 'dcheck_always_on%': '<(dcheck_always_on)',
1101 'tracing_like_official_build%': '<(tracing_like_official_build)',
1102 'arm_version%': '<(arm_version)',
1103 'arm_neon%': '<(arm_neon)',
1104 'arm_neon_optional%': '<(arm_neon_optional)',
1105 'sysroot%': '<(sysroot)',
1106 'chroot_cmd%': '<(chroot_cmd)',
1107 'system_libdir%': '<(system_libdir)',
1108 'component%': '<(component)',
1109 'win_analyze%': '<(win_analyze)',
1110 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1111 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1112 'use_third_party_translations%': '<(use_third_party_translations)',
1113 'remoting%': '<(remoting)',
1114 'enable_one_click_signin%': '<(enable_one_click_signin)',
1115 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1116 'enable_webrtc%': '<(enable_webrtc)',
1117 'chromium_win_pch%': '<(chromium_win_pch)',
1118 'configuration_policy%': '<(configuration_policy)',
1119 'safe_browsing%': '<(safe_browsing)',
1120 'enable_web_speech%': '<(enable_web_speech)',
1121 'notifications%': '<(notifications)',
1122 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1123 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1125 'asan_blacklist%': '<(asan_blacklist)',
1126 'asan_coverage%': '<(asan_coverage)',
1127 'asan_field_padding%': '<(asan_field_padding)',
1128 'use_sanitizer_options%': '<(use_sanitizer_options)',
1129 'syzyasan%': '<(syzyasan)',
1130 'syzygy_optimize%': '<(syzygy_optimize)',
1133 'msan_blacklist%': '<(msan_blacklist)',
1134 'msan_track_origins%': '<(msan_track_origins)',
1136 'tsan_blacklist%': '<(tsan_blacklist)',
1137 'ubsan%': '<(ubsan)',
1138 'ubsan_vptr%': '<(ubsan_vptr)',
1139 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1140 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1141 'use_custom_libcxx%': '<(use_custom_libcxx)',
1142 'use_system_libcxx%': '<(use_system_libcxx)',
1143 'clang_type_profiler%': '<(clang_type_profiler)',
1144 'order_profiling%': '<(order_profiling)',
1145 'order_text_section%': '<(order_text_section)',
1146 'enable_extensions%': '<(enable_extensions)',
1147 'enable_plugin_installation%': '<(enable_plugin_installation)',
1148 'enable_plugins%': '<(enable_plugins)',
1149 'enable_session_service%': '<(enable_session_service)',
1150 'enable_themes%': '<(enable_themes)',
1151 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1152 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1153 'enable_background%': '<(enable_background)',
1154 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1155 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1156 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1157 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1158 'use_canvas_skia%': '<(use_canvas_skia)',
1159 'test_isolation_mode%': '<(test_isolation_mode)',
1160 'test_isolation_outdir%': '<(test_isolation_outdir)',
1161 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1162 'enable_basic_printing%': '<(enable_basic_printing)',
1163 'enable_print_preview%': '<(enable_print_preview)',
1164 'enable_spellcheck%': '<(enable_spellcheck)',
1165 'enable_google_now%': '<(enable_google_now)',
1166 'cld_version%': '<(cld_version)',
1167 'cld2_table_size%': '<(cld2_table_size)',
1168 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1169 'disable_file_support%': '<(disable_file_support)',
1170 'disable_ftp_support%': '<(disable_ftp_support)',
1171 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1172 'enable_task_manager%': '<(enable_task_manager)',
1173 'sas_dll_path%': '<(sas_dll_path)',
1174 'wix_path%': '<(wix_path)',
1175 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1176 'use_system_libjpeg%': '<(use_system_libjpeg)',
1177 'android_channel%': '<(android_channel)',
1178 'android_webview_build%': '<(android_webview_build)',
1179 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
1180 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1181 'gyp_managed_install%': 0,
1182 'create_standalone_apk%': 1,
1183 'enable_app_list%': '<(enable_app_list)',
1184 'use_default_render_theme%': '<(use_default_render_theme)',
1185 'enable_settings_app%': '<(enable_settings_app)',
1186 'google_api_key%': '<(google_api_key)',
1187 'google_default_client_id%': '<(google_default_client_id)',
1188 'google_default_client_secret%': '<(google_default_client_secret)',
1189 'enable_supervised_users%': '<(enable_supervised_users)',
1190 'native_discardable_memory%': '<(native_discardable_memory)',
1191 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1192 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1193 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1194 'enable_mdns%' : '<(enable_mdns)',
1195 'enable_service_discovery%' : '<(enable_service_discovery)',
1196 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1197 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1198 'v8_optimized_debug%': '<(v8_optimized_debug)',
1199 'proprietary_codecs%': '<(proprietary_codecs)',
1200 'use_goma%': '<(use_goma)',
1201 'gomadir%': '<(gomadir)',
1202 'use_lto%': '<(use_lto)',
1203 'use_lto_o2%': '<(use_lto_o2)',
1204 'video_hole%': '<(video_hole)',
1205 'support_pre_M6_history_database%': '<(support_pre_M6_history_database)',
1206 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1208 # Whether or not we are building the Athena shell.
1211 # Use system protobuf instead of bundled one.
1212 'use_system_protobuf%': 0,
1214 # Use system yasm instead of bundled one.
1215 'use_system_yasm%': 0,
1217 # Use system ICU instead of bundled one.
1218 'use_system_icu%' : 0,
1220 # Default to enabled PIE; this is important for ASLR but we may need to be
1221 # able to turn it off for various reasons.
1222 'linux_disable_pie%': 0,
1224 # The release channel that this build targets. This is used to restrict
1225 # channel-specific build options, like which installer packages to create.
1226 # The default is 'all', which does no channel-specific filtering.
1229 # Override chromium_mac_pch and set it to 0 to suppress the use of
1230 # precompiled headers on the Mac. Prefix header injection may still be
1231 # used, but prefix headers will not be precompiled. This is useful when
1232 # using distcc to distribute a build to compile slaves that don't
1233 # share the same compiler executable as the system driving the compilation,
1234 # because precompiled headers rely on pointers into a specific compiler
1235 # executable's image. Setting this to 0 is needed to use an experimental
1236 # Linux-Mac cross compiler distcc farm.
1237 'chromium_mac_pch%': 1,
1239 # The default value for mac_strip in target_defaults. This cannot be
1240 # set there, per the comment about variable% in a target_defaults.
1241 'mac_strip_release%': 0,
1243 # Set to 1 to enable java code coverage. Instruments classes during build
1244 # to produce .ec files during runtime.
1245 'emma_coverage%': 0,
1247 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1248 # separated with whitespace and/or comma. Only has effect if
1249 # 'emma_coverage=1'.
1252 # Set to 1 to enable running Android lint on java/class files.
1255 # Although base/allocator lets you select a heap library via an
1256 # environment variable, the libcmt shim it uses sometimes gets in
1257 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1258 # 'win_use_allocator_shim': 0,
1259 # 'win_release_RuntimeLibrary': 2
1260 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1261 'win_use_allocator_shim%': 0, # 1 = shim allocator via libcmt; 0 = msvcrt
1263 # TODO(bradnelson): eliminate this when possible.
1264 # To allow local gyp files to prevent release.vsprops from being included.
1265 # Yes(1) means include release.vsprops.
1266 # Once all vsprops settings are migrated into gyp, this can go away.
1267 'msvs_use_common_release%': 1,
1269 # TODO(bradnelson): eliminate this when possible.
1270 # To allow local gyp files to override additional linker options for msvs.
1271 # Yes(1) means set use the common linker options.
1272 'msvs_use_common_linker_extras%': 1,
1274 # TODO(sgk): eliminate this if possible.
1275 # It would be nicer to support this via a setting in 'target_defaults'
1276 # in chrome/app/locales/locales.gypi overriding the setting in the
1277 # 'Debug' configuration in the 'target_defaults' dict below,
1278 # but that doesn't work as we'd like.
1279 'msvs_debug_link_incremental%': '2',
1281 # Needed for some of the largest modules.
1282 'msvs_debug_link_nonincremental%': '1',
1284 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1285 # to get incremental linking to be faster in debug builds.
1286 'incremental_chrome_dll%': '0',
1288 # Experimental setting to break chrome.dll into multiple pieces based on
1290 'chrome_multiple_dll%': '0',
1292 # Experimental setting to optimize Chrome's DLLs with PGO.
1293 'chrome_pgo_phase%': '0',
1295 # Whether the VS xtree header has been patched to disable warning 4702. If
1296 # it has, then we don't need to disable 4702 (unreachable code warning).
1297 # The patch is preapplied to the internal toolchain and hence all bots.
1298 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1301 'clang%': '<(clang)',
1302 'host_clang%': '<(host_clang)',
1303 'make_clang_dir%': '<(make_clang_dir)',
1304 'use_lld%': '<(use_lld)',
1306 # Control which version of clang to use when building for iOS. If set to
1307 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1308 # the version of clang that ships with the Chromium source. This variable
1309 # is automatically set to '1' when using the Xcode generator.
1312 # These two variables can be set in GYP_DEFINES while running
1313 # |gclient runhooks| to let clang run a plugin in every compilation.
1314 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1316 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1319 'clang_add_plugin%': '',
1321 # Tell ld64 to write map files describing binary layout. Useful
1322 # for looking at what contributes to binary size, e.g. with
1323 # https://github.com/nico/bloat
1324 'mac_write_linker_maps%': 0,
1326 # The default type of gtest.
1327 'gtest_target_type%': 'executable',
1329 # Enable sampling based profiler.
1330 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1332 # Profile without optimizing out stack frames when profiling==1.
1333 'profiling_full_stack_frames%': '0',
1335 # And if we want to dump symbols for Breakpad-enabled builds.
1336 'linux_dump_symbols%': 0,
1337 # And if we want to strip the binary after dumping symbols.
1338 'linux_strip_binary%': 0,
1339 # If we want stack unwind support for backtrace().
1340 'debug_unwind_tables%': 1,
1341 'release_unwind_tables%': 1,
1343 # Override where to find binutils
1344 'binutils_version%': 0,
1345 'binutils_dir%': '',
1348 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1349 'use_allocator%': 'tcmalloc',
1351 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1352 'linux_link_gnome_keyring%': 0,
1353 # Set to 1 to link against gsettings APIs instead of using dlopen().
1354 'linux_link_gsettings%': 0,
1356 # Enable use of OpenMAX DL FFT routines.
1357 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1359 # Enable new NPDevice API.
1360 'enable_new_npdevice_api%': 0,
1362 # .gyp files or targets should set chromium_code to 1 if they build
1363 # Chromium-specific code, as opposed to external code. This variable is
1364 # used to control such things as the set of warnings to enable, and
1365 # whether warnings are treated as errors.
1366 'chromium_code%': 0,
1368 # Disable fatal linker warnings, similarly to how we make it possible
1369 # to disable -Werror (e.g. for different toolchain versions).
1370 'disable_fatal_linker_warnings%': 0,
1372 'release_valgrind_build%': 0,
1374 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1375 'enable_wexit_time_destructors%': 0,
1377 # Build libpeerconnection as a static library by default.
1378 'libpeer_target_type%': 'static_library',
1380 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1381 'internal_gles2_conform_tests%': 0,
1383 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1384 'internal_khronos_glcts_tests%': 0,
1386 # Set to 1 to compile the filter fuzzer.
1387 'internal_filter_fuzzer%': 0,
1389 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1390 # so Cocoa is happy (http://crbug.com/20441).
1392 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1393 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1394 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1395 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1396 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1397 'vi', 'zh-CN', 'zh-TW',
1400 # Pseudo locales are special locales which are used for testing and
1401 # debugging. They don't get copied to the final app. For more info,
1402 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1409 # If debug_devtools is set to 1, JavaScript files for DevTools are
1410 # stored as is and loaded from disk. Otherwise, a concatenated file
1411 # is stored in resources.pak. It is still possible to load JS files
1412 # from disk by passing --debug-devtools cmdline switch.
1413 'debug_devtools%': 0,
1415 # The Java Bridge is not compiled in by default.
1418 # Code signing for iOS binaries. The bots need to be able to disable this.
1419 'chromium_ios_signing%': 1,
1421 # This flag is only used when disable_nacl==0 and disables all those
1422 # subcomponents which would require the installation of a native_client
1423 # untrusted toolchain.
1424 'disable_nacl_untrusted%': 0,
1426 # Disable Dart by default.
1429 # Copy out the setting of disable_nacl.
1430 'disable_nacl%': '<(disable_nacl)',
1432 # Portable Native Client is enabled by default.
1433 'disable_pnacl%': 0,
1435 # Whether to build full debug version for Debug configuration on Android.
1436 # Compared to full debug version, the default Debug configuration on Android
1437 # has no full v8 debug, has size optimization and linker gc section, so that
1438 # we can build a debug version with acceptable size and performance.
1439 'android_full_debug%': 0,
1441 # Sets the default version name and code for Android app, by default we
1442 # do a developer build.
1443 'android_app_version_name%': 'Developer Build',
1444 'android_app_version_code%': 1,
1446 # Contains data about the attached devices for gyp_managed_install.
1447 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1449 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1450 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1452 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1453 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1455 # Whether we are using the rlz library or not. Platforms like Android send
1456 # rlz codes for searches but do not use the library.
1459 # Turns on the i18n support in V8.
1460 'v8_enable_i18n_support': 1,
1462 # Compile d8 for the host toolset.
1463 'v8_toolset_for_d8': 'host',
1465 # Use brlapi from brltty for braille display support.
1468 # Relative path to icu.gyp from this file.
1469 'icu_gyp_path': '../third_party/icu/icu.gyp',
1471 # IPC fuzzer is disabled by default.
1472 'enable_ipc_fuzzer%': 0,
1474 # Force disable libstdc++ debug mode.
1475 'disable_glibcxx_debug%': 0,
1477 # Set to 1 to compile with MSE support for MPEG2 TS
1478 'enable_mpeg2ts_stream_parser%': 0,
1480 # Support ChromeOS touchpad gestures with ozone.
1481 'use_evdev_gestures%': 0,
1483 # Default ozone platform (if no --ozone-platform flag).
1484 'ozone_platform%': "",
1486 # Ozone platforms to include in the build.
1487 'ozone_platform_caca%': 0,
1488 'ozone_platform_dri%': 0,
1489 'ozone_platform_egltest%': 0,
1490 'ozone_platform_gbm%': 0,
1491 'ozone_platform_ozonex%': 0,
1492 'ozone_platform_test%': 0,
1494 # Whether the browser is non-native (using Views Toolkit) on Mac.
1495 'mac_views_browser%': 0,
1497 # Experiment: http://crbug.com/426914
1501 ['buildtype=="Official"', {
1502 # Continue to embed build meta data in Official builds, basically the
1503 # time it was built.
1504 # TODO(maruel): This decision should be revisited because having an
1505 # official deterministic build has high value too but MSVC toolset can't
1506 # generate anything deterministic with WPO enabled AFAIK.
1507 'dont_embed_build_metadata%': 0,
1509 # Enable the Syzygy optimization step for the official builds.
1510 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1511 'syzygy_optimize%': 1,
1513 'syzygy_optimize%': 0,
1515 # Get binutils version so we can enable debug fission if we can.
1516 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1518 # compiler_version doesn't work with clang
1519 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1520 # compiler_version works with clang.
1521 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1522 # that it takes effect here.
1523 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1524 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1526 # On Android we know the binutils version in the toolchain.
1528 'binutils_version%': 222,
1530 ['host_arch=="x64"', {
1531 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1533 ['host_arch=="ia32"', {
1534 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1536 # Our version of binutils in third_party/binutils
1537 ['linux_use_bundled_binutils==1', {
1538 'binutils_version%': 224,
1542 'binutils_version%': 0,
1544 # The version of GCC in use, set later in platforms that use GCC and have
1545 # not explicitly chosen to build with clang. Currently, this means all
1546 # platforms except Windows, Mac and iOS.
1547 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1548 # it takes effect here.
1549 ['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', {
1551 ['OS=="android" and android_webview_build==0', {
1552 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1553 # We directly set the gcc version since we know what we use.
1556 ['OS=="android" and android_webview_build==1', {
1557 # Android WebView uses a hermetic clang toolchain for host builds.
1558 'host_gcc_version%': 0,
1559 # Android WebView uses the GCC toolchain from the Android build.
1563 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1564 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1568 'host_gcc_version%': 0,
1571 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1572 'windows_sdk_path%': '<(windows_sdk_default_path)',
1574 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1576 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1577 'directx_sdk_path%': '<(directx_sdk_default_path)',
1579 'directx_sdk_path%': '$(DXSDK_DIR)',
1582 'windows_driver_kit_path%': '$(WDK_DIR)',
1584 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1586 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1589 'nacl_untrusted_build%': 0,
1590 'use_allocator%': 'none',
1592 ['OS=="linux" and target_arch=="mipsel"', {
1593 'sysroot%': '<(sysroot)',
1596 # All Chrome builds have breakpad symbols, but only process the
1597 # symbols from official builds.
1598 ['(branding=="Chrome" and buildtype=="Official")', {
1599 'linux_dump_symbols%': 1,
1601 # Omit unwind support in official release builds to save space. We
1602 # can use breakpad for these builds.
1603 'release_unwind_tables%': 0,
1606 # For official builds, use a 64-bit linker to avoid running out
1607 # of address space. The buildbots should have a 64-bit kernel
1608 # and a 64-bit libc installed.
1609 ['host_arch=="ia32" and target_arch=="ia32"', {
1610 'linux_use_bundled_gold%': '1',
1611 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1616 }], # os_posix==1 and OS!="mac" and OS!="ios"
1619 'enable_background%': 0,
1620 'icu_use_data_file_flag%': 1,
1621 'enable_web_speech%': 0,
1622 'use_system_libxml%': 1,
1623 'use_system_sqlite%': 1,
1625 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1626 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1627 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1628 'uk', 'vi', 'zh-CN', 'zh-TW',
1631 # iOS SDK and deployment target support. The |ios_sdk| value is left
1632 # blank so that when it is set in the project files it will be the
1633 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1634 # causes Xcode to spit out a warning for every single project file for
1635 # not using the "current" SDK.
1637 'ios_sdk_path%': '',
1638 'ios_deployment_target%': '7.0',
1641 # ios_product_name is set to the name of the .app bundle as it should
1643 ['branding=="Chrome"', {
1644 'ios_product_name%': 'Chrome',
1645 }, { # else: branding!="Chrome"
1646 'ios_product_name%': 'Chromium',
1648 ['branding=="Chrome" and buildtype=="Official"', {
1650 }, { # else: branding!="Chrome" or buildtype!="Official"
1656 # Location of Android NDK.
1659 # Unfortunately we have to use absolute paths to the SDK/NDK because
1660 # they're passed to ant which uses a different relative path from
1662 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1663 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1664 'android_host_arch%': '<!(uname -m)',
1665 # Android API-level of the SDK used for compilation.
1666 'android_sdk_version%': '21',
1667 'android_sdk_build_tools_version%': '21.0.1',
1668 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1670 # Copy conditionally-set variables out one scope.
1671 'android_ndk_root%': '<(android_ndk_root)',
1672 'android_sdk_root%': '<(android_sdk_root)',
1673 'android_sdk_version%': '<(android_sdk_version)',
1674 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1675 'host_os%': '<(host_os)',
1677 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1678 # Android SDK build tools (e.g. dx, aapt, aidl)
1679 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1681 # Android API level 14 is ICS (Android 4.0) which is the minimum
1682 # platform requirement for Chrome on Android, we use it for native
1685 ['target_arch == "ia32"', {
1686 'android_app_abi%': 'x86',
1687 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1688 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1689 'android_ndk_lib_dir%': 'usr/lib',
1690 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1692 ['target_arch == "x64"', {
1693 'android_app_abi%': 'x86_64',
1694 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1695 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1696 'android_ndk_lib_dir%': 'usr/lib64',
1697 'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1699 ['target_arch=="arm"', {
1702 'android_app_abi%': 'armeabi',
1704 'android_app_abi%': 'armeabi-v7a',
1707 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1708 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1709 'android_ndk_lib_dir%': 'usr/lib',
1710 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1712 ['target_arch == "arm64"', {
1713 'android_app_abi%': 'arm64-v8a',
1714 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1715 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1716 'android_ndk_lib_dir%': 'usr/lib',
1717 'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1719 ['target_arch == "mipsel"', {
1720 'android_app_abi%': 'mips',
1721 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1722 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1723 'android_ndk_lib_dir%': 'usr/lib',
1724 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1726 ['target_arch == "mips64el"', {
1727 'android_app_abi%': 'mips64',
1728 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1729 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1730 'android_ndk_lib_dir%': 'usr/lib64',
1731 'android_toolchain%': '<(android_ndk_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1736 # Copy conditionally-set variables out one scope.
1737 'android_app_abi%': '<(android_app_abi)',
1738 'android_gdbserver%': '<(android_gdbserver)',
1739 'android_ndk_root%': '<(android_ndk_root)',
1740 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1741 'android_sdk_root%': '<(android_sdk_root)',
1742 'android_sdk_version%': '<(android_sdk_version)',
1743 'android_toolchain%': '<(android_toolchain)',
1745 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1746 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1747 'android_sdk_tools%': '<(android_sdk_tools)',
1748 'android_sdk%': '<(android_sdk)',
1749 'android_sdk_jar%': '<(android_sdk)/android.jar',
1751 'android_stlport_root': '<(android_stlport_root)',
1752 'android_stlport_include': '<(android_stlport_root)/stlport',
1753 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1754 'host_os%': '<(host_os)',
1756 # Location of the "objcopy" binary, used by both gyp and scripts.
1757 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1759 # Location of the "strip" binary, used by both gyp and scripts.
1760 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1762 # Location of the "readelf" binary.
1763 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1765 # Determines whether we should optimize JNI generation at the cost of
1766 # breaking assumptions in the build system that when inputs have changed
1767 # the outputs should always change as well. This is meant purely for
1768 # developer builds, to avoid spurious re-linking of native files.
1769 'optimize_jni_generation%': '<(optimize_jni_generation)',
1771 # Always uses openssl.
1773 'use_openssl_certs%': 1,
1775 'proprietary_codecs%': '<(proprietary_codecs)',
1776 'safe_browsing%': 2,
1777 'enable_web_speech%': 0,
1779 'build_ffmpegsumo%': 0,
1780 'use_allocator%': 'none',
1782 # Disable Native Client.
1785 # Android does not support background apps.
1786 'enable_background%': 0,
1788 # Sessions are store separately in the Java side.
1789 'enable_session_service%': 0,
1793 'gtest_target_type%': 'shared_library',
1795 # Uses system APIs for decoding audio and video.
1796 'use_libffmpeg%': '0',
1798 # TODO(torne): Remove this unsupported option once all the places that
1799 # test it have been updated.
1800 'use_system_stlport%': 0,
1802 # Copy it out one scope.
1803 'android_webview_build%': '<(android_webview_build)',
1805 # Default android linker script for shared library exports.
1806 'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_exports.lst',
1809 'use_system_fontconfig%': 0,
1811 'use_system_fontconfig%': 1,
1814 'enable_mpeg2ts_stream_parser%': 1,
1815 'ffmpeg_branding%': 'Chrome',
1816 'ozone_platform_ozonex%': 1,
1817 'use_playready%': 0,
1819 ['target_arch=="arm"', {
1821 'arm_tune%': 'cortex-a9',
1827 ['android_webview_build==1', {
1828 # When building the WebView in the Android tree, jarjar will remap all
1829 # the class names, so the JNI generator needs to know this.
1830 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1832 ['OS=="linux" and target_arch!="mipsel"', {
1833 # TODO(thakis): This is here to measure perf for a while.
1838 # All Chrome builds have breakpad symbols, but only process the
1839 # symbols from official builds.
1840 ['(branding=="Chrome" and buildtype=="Official")', {
1841 'mac_strip_release%': 1,
1845 ['OS=="mac" or OS=="ios"', {
1849 # Mac OS X SDK and deployment target support. The SDK identifies
1850 # the version of the system headers that will be used, and
1851 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1852 # macro. "Maximum allowed" refers to the operating system version
1853 # whose APIs are available in the headers. The deployment target
1854 # identifies the minimum system version that the built products are
1855 # expected to function on. It corresponds to the
1856 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1857 # macros are available, #include <AvailabilityMacros.h>. Additional
1858 # documentation on these macros is available at
1859 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1860 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1861 # deployment target to 10.6. Other projects, such as O3D, may
1862 # override these defaults.
1864 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1865 # about that is at least the specified version. In official builds,
1866 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1867 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1868 # path to the SDK; when set to a non-empty string, SDK detection
1869 # based on mac_sdk_min will be bypassed entirely.
1872 'mac_sdk_min%': '10.8',
1873 }, { # else OS!="ios"
1874 'mac_sdk_min%': '10.6',
1877 'mac_sdk_path%': '',
1879 'mac_deployment_target%': '10.6',
1882 'mac_sdk_min': '<(mac_sdk_min)',
1883 'mac_sdk_path': '<(mac_sdk_path)',
1884 'mac_deployment_target': '<(mac_deployment_target)',
1886 # Compile in Breakpad support by default so that it can be
1887 # tested, even if it is not enabled by default at runtime.
1888 'mac_breakpad_compiled_in%': 1,
1890 # mac_product_name is set to the name of the .app bundle as it should
1891 # appear on disk. This duplicates data from
1892 # chrome/app/theme/chromium/BRANDING and
1893 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1894 # these names into the build system.
1895 ['branding=="Chrome"', {
1896 'mac_product_name%': 'Google Chrome',
1897 }, { # else: branding!="Chrome"
1898 'mac_product_name%': 'Chromium',
1900 # Official mac builds require a specific OS X SDK, but iOS and
1901 # non-official mac builds do not.
1902 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1903 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1905 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1907 ['branding=="Chrome" and buildtype=="Official"', {
1908 # Enable uploading crash dumps.
1909 'mac_breakpad_uploads%': 1,
1910 # Enable dumping symbols at build time for use by Mac Breakpad.
1912 # Enable Keystone auto-update support.
1914 }, { # else: branding!="Chrome" or buildtype!="Official"
1915 'mac_breakpad_uploads%': 0,
1920 }], # OS=="mac" or OS=="ios"
1923 # This is the architecture convention used in WinSDK paths.
1924 ['target_arch=="ia32"', {
1925 'winsdk_arch%': 'x86',
1927 'winsdk_arch%': '<(target_arch)',
1929 ['component=="shared_library"', {
1930 'win_use_allocator_shim%': 0,
1932 # Turn on multiple dll by default on Windows when in static_library.
1933 'chrome_multiple_dll%': 1,
1936 'win_use_allocator_shim%': 0,
1938 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1939 # Only enabled by default for ninja because it's buggy in VS.
1940 # Not enabled for component=static_library because some targets
1941 # are too large and the toolchain fails due to the size of the
1943 'incremental_chrome_dll%': 1,
1945 # Don't do incremental linking for large modules on 32-bit or when
1946 # component=static_library as the toolchain fails due to the size of
1948 ['MSVS_OS_BITS==32 or component=="static_library"', {
1949 'msvs_large_module_debug_link_mode%': '1', # No
1951 'msvs_large_module_debug_link_mode%': '2', # Yes
1954 'nacl_win64_defines': [
1955 # This flag is used to minimize dependencies when building
1956 # Native Client loader for 64-bit Windows.
1961 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1967 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1968 'enable_pepper_cdms%': 1,
1970 'enable_pepper_cdms%': 0,
1973 ['OS=="android" or chromecast==1', {
1974 'enable_browser_cdms%': 1,
1976 'enable_browser_cdms%': 0,
1979 # Native Client glibc toolchain is enabled
1980 # by default except on arm, mips and mips64.
1981 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
1982 'disable_glibc%': 1,
1984 'disable_glibc%': 0,
1987 # Set the relative path from this file to the GYP file of the JPEG
1988 # library used by Chromium.
1989 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1990 # Configuration for using the system libjeg is here.
1991 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1993 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1996 # Options controlling the use of GConf (the classic GNOME configuration
1997 # system) and GIO, which contains GSettings (the new GNOME config system).
1998 ['chromeos==1 or embedded==1', {
2006 # Set up -D and -E flags passed into grit.
2007 ['branding=="Chrome"', {
2008 # TODO(mmoss) The .grd files look for _google_chrome, but for
2009 # consistency they should look for google_chrome_build like C++.
2010 'grit_defines': ['-D', '_google_chrome',
2011 '-E', 'CHROMIUM_BUILD=google_chrome'],
2013 'grit_defines': ['-D', '_chromium',
2014 '-E', 'CHROMIUM_BUILD=chromium'],
2017 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2019 ['desktop_linux==1', {
2020 'grit_defines': ['-D', 'desktop_linux'],
2022 ['toolkit_views==1', {
2023 'grit_defines': ['-D', 'toolkit_views'],
2026 'grit_defines': ['-D', 'use_aura'],
2029 'grit_defines': ['-D', 'use_ash'],
2032 'grit_defines': ['-D', 'use_nss'],
2035 'grit_defines': ['-D', 'use_ozone'],
2037 ['image_loader_extension==1', {
2038 'grit_defines': ['-D', 'image_loader_extension'],
2041 'grit_defines': ['-D', 'remoting'],
2043 ['use_titlecase_in_grd==1', {
2044 'grit_defines': ['-D', 'use_titlecase'],
2046 ['use_third_party_translations==1', {
2047 'grit_defines': ['-D', 'use_third_party_translations'],
2049 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2050 'ka', 'ku', 'kw', 'ms', 'ug'
2056 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2057 '--no-output-all-resource-defines',
2060 ['OS=="mac" or OS=="ios"', {
2061 'grit_defines': ['-D', 'scale_factors=2x'],
2066 # iOS uses a whitelist to filter resources.
2067 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt',
2068 '--no-output-all-resource-defines',
2071 # Enable host builds when generating with ninja-ios.
2073 ['"<(GENERATOR)"=="ninja"', {
2077 # TODO(sdefresne): Remove the target_subarch check once Apple has
2078 # upstreamed the support for "arm64". http://crbug.com/341453
2079 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
2084 ['enable_extensions==1', {
2085 'grit_defines': ['-D', 'enable_extensions'],
2087 ['enable_plugins!=0', {
2088 'grit_defines': ['-D', 'enable_plugins'],
2090 ['enable_basic_printing==1 or enable_print_preview==1', {
2091 'grit_defines': ['-D', 'enable_printing'],
2093 ['enable_print_preview==1', {
2094 'grit_defines': ['-D', 'enable_print_preview'],
2096 ['enable_themes==1', {
2097 'grit_defines': ['-D', 'enable_themes'],
2099 ['enable_app_list==1', {
2100 'grit_defines': ['-D', 'enable_app_list'],
2102 ['enable_settings_app==1', {
2103 'grit_defines': ['-D', 'enable_settings_app'],
2105 ['enable_google_now==1', {
2106 'grit_defines': ['-D', 'enable_google_now'],
2108 ['use_concatenated_impulse_responses==1', {
2109 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2111 ['enable_webrtc==1', {
2112 'grit_defines': ['-D', 'enable_webrtc'],
2114 ['enable_hangout_services_extension==1', {
2115 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2117 ['enable_task_manager==1', {
2118 'grit_defines': ['-D', 'enable_task_manager'],
2120 ['notifications==1', {
2121 'grit_defines': ['-D', 'enable_notifications'],
2123 ['enable_wifi_bootstrapping==1', {
2124 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2126 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2127 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2129 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2130 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2132 ['enable_mdns==1 or OS=="mac"', {
2133 'grit_defines': ['-D', 'enable_service_discovery'],
2134 'enable_service_discovery%': 1
2136 ['clang_use_chrome_plugins==1 and OS!="win"', {
2137 'clang_chrome_plugins_flags': [
2138 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
2141 # TODO(dcheng): https://crbug.com/417463 -- work to enable this flag
2142 # on all platforms is currently underway.
2143 ['OS=="linux" and chromeos==0', {
2144 'clang_chrome_plugins_flags': [
2146 '-plugin-arg-find-bad-constructs',
2148 'strict-virtual-specifiers',
2153 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2155 'use_allocator%': 'none',
2156 'use_sanitizer_options%': 1,
2158 ['asan==1 and OS=="linux" and chromeos==0', {
2159 'use_custom_libcxx%': 1,
2167 ['asan==1 and OS=="mac"', {
2168 'mac_strip_release': 1,
2171 'use_custom_libcxx%': 1,
2174 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2175 # libstdc++. This is required to avoid false positive reports whenever
2176 # the C++ standard library is used.
2177 'use_custom_libcxx%': 1,
2178 # Running the V8-generated code on an ARM simulator is a powerful hack
2179 # that allows the tool to see the memory accesses from JITted code.
2180 # Without this flag, JS code causes false positive reports from MSan.
2181 'v8_target_arch': 'arm64',
2184 ['OS=="linux" and clang_type_profiler==1', {
2186 'clang_use_chrome_plugins%': 0,
2188 ['host_arch=="x64"', {
2189 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2191 ['host_arch=="ia32"', {
2192 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2193 # Clang in this directory at your own risk if needed for some
2194 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2195 # usage). Any failure by this compiler should not close the tree.
2196 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2202 # The Clang plugins don't currently work on Windows.
2203 # TODO(hans): One day, this will work. (crbug.com/82385)
2204 'clang_use_chrome_plugins%': 0,
2207 # On valgrind bots, override the optimizer settings so we don't inline too
2208 # much and make the stacks harder to figure out.
2210 # TODO(rnk): Kill off variables that no one else uses and just implement
2211 # them under a build_for_tool== condition.
2212 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2214 'mac_debug_optimization': '1',
2215 'mac_release_optimization': '1',
2216 'release_optimize': '1',
2217 'no_gc_sections': 1,
2218 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2219 '-fno-builtin -fno-optimize-sibling-calls',
2220 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2221 '-fno-builtin -fno-optimize-sibling-calls',
2223 # MSVS flags for TSan on Pin and Windows.
2224 'win_debug_RuntimeChecks': '0',
2225 'win_debug_disable_iterator_debugging': '1',
2226 'win_debug_Optimization': '1',
2227 'win_debug_InlineFunctionExpansion': '0',
2228 'win_release_InlineFunctionExpansion': '0',
2229 'win_release_OmitFramePointers': '0',
2231 'use_allocator': 'tcmalloc',
2232 'release_valgrind_build': 1,
2234 'component': 'static_library',
2235 'use_system_zlib': 0,
2238 # Build tweaks for DrMemory.
2239 # TODO(rnk): Combine with tsan config to share the builder.
2240 # http://crbug.com/108155
2241 ['build_for_tool=="drmemory"', {
2242 # These runtime checks force initialization of stack vars which blocks
2243 # DrMemory's uninit detection.
2244 'win_debug_RuntimeChecks': '0',
2245 # Iterator debugging is slow.
2246 'win_debug_disable_iterator_debugging': '1',
2247 # Try to disable optimizations that mess up stacks in a release build.
2248 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2249 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2250 # compiler bug, so we use /Ob1 instead.
2251 'win_release_InlineFunctionExpansion': '1',
2252 'win_release_OmitFramePointers': '0',
2253 # Ditto for debug, to support bumping win_debug_Optimization.
2254 'win_debug_InlineFunctionExpansion': 0,
2255 'win_debug_OmitFramePointers': 0,
2256 # Keep the code under #ifndef NVALGRIND.
2257 'release_valgrind_build': 1,
2260 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2261 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2265 # Set default compiler flags depending on ARM version.
2266 ['arm_version==6 and android_webview_build==0', {
2267 'arm_arch%': 'armv6',
2270 'arm_float_abi%': 'softfp',
2273 ['arm_version==7 and android_webview_build==0', {
2274 'arm_arch%': 'armv7-a',
2275 'arm_tune%': 'generic-armv7-a',
2280 'arm_fpu%': 'vfpv3-d16',
2283 # Change the default to hard once the armhf transition is complete.
2284 'arm_float_abi%': 'softfp',
2288 # Set default compiler flags depending on MIPS architecture variant.
2289 ['target_arch=="mipsel" and mips_arch_variant=="r2" and android_webview_build==0', {
2290 'mips_fpu_mode%': 'fp32',
2293 ['android_webview_build==1', {
2294 # The WebView build gets its cpu-specific flags from the Android build system.
2298 'arm_float_abi%': '',
2300 'mips_fpu_mode%': '',
2303 # Enable brlapi by default for chromeos.
2308 ['use_ozone==1 and ozone_auto_platforms==1', {
2309 # Use test as the default platform.
2310 'ozone_platform%': 'test',
2312 # Build all platforms whose deps are in install-build-deps.sh.
2313 # Only these platforms will be compile tested by buildbots.
2314 'ozone_platform_dri%': 1,
2315 'ozone_platform_test%': 1,
2316 'ozone_platform_egltest%': 1,
2319 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2320 'use_clipboard_aurax11%': 1,
2323 ['OS=="win" and use_goma==1', {
2324 # goma doesn't support pch yet.
2325 'chromium_win_pch': 0,
2326 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2328 ['win_z7==0 and fastbuild==0', {
2334 ['OS=="win" and (clang==1 or asan==1)', {
2335 'chromium_win_pch': 0,
2339 'host_cc': '<(make_clang_dir)/bin/clang',
2340 'host_cxx': '<(make_clang_dir)/bin/clang++',
2342 'host_cc': '<!(which gcc)',
2343 'host_cxx': '<!(which g++)',
2346 # The seccomp-bpf sandbox is only supported on five architectures
2348 # Do not disable seccomp_bpf anywhere without talking to
2349 # security@chromium.org!
2350 ['((OS=="linux" or OS=="android") and '
2351 '(target_arch=="ia32" or target_arch=="x64" or '
2352 'target_arch=="arm" or target_arch=="mipsel" or '
2353 'target_arch=="arm64"))', {
2354 'use_seccomp_bpf%': 1,
2356 'use_seccomp_bpf%': 0,
2358 # Set component build with LTO until all tests pass.
2359 # This also reduces link time.
2361 'component%': "shared_library",
2365 # older history files use fts2 instead of fts3
2366 'sqlite_enable_fts2%': '<(support_pre_M6_history_database)',
2368 # The path to the ANGLE library.
2369 'angle_path': '<(DEPTH)/third_party/angle',
2371 # List of default apps to install in new profiles. The first list contains
2372 # the source files as found in svn. The second list, used only for linux,
2373 # contains the destination location for each of the files. When a crx
2374 # is added or removed from the list, the chrome/browser/resources/
2375 # default_apps/external_extensions.json file must also be updated.
2376 'default_apps_list': [
2377 'browser/resources/default_apps/external_extensions.json',
2378 'browser/resources/default_apps/gmail.crx',
2379 'browser/resources/default_apps/search.crx',
2380 'browser/resources/default_apps/youtube.crx',
2381 'browser/resources/default_apps/drive.crx',
2382 'browser/resources/default_apps/docs.crx',
2384 'default_apps_list_linux_dest': [
2385 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2386 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2387 '<(PRODUCT_DIR)/default_apps/search.crx',
2388 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2389 '<(PRODUCT_DIR)/default_apps/drive.crx',
2390 '<(PRODUCT_DIR)/default_apps/docs.crx',
2393 # Whether to allow building of the GPU-related isolates.
2394 'archive_gpu_tests%': 0,
2396 # Whether to allow building of chromoting related isolates.
2397 'archive_chromoting_tests%': 0,
2399 'target_defaults': {
2401 # The condition that operates on chromium_code is in a target_conditions
2402 # section, and will not have access to the default fallback value of
2403 # chromium_code at the top of this file, or to the chromium_code
2404 # variable placed at the root variables scope of .gyp files, because
2405 # those variables are not set at target scope. As a workaround,
2406 # if chromium_code is not set at target scope, define it in target scope
2407 # to contain whatever value it has during early variable expansion.
2408 # That's enough to make it available during target conditional
2410 'chromium_code%': '<(chromium_code)',
2412 'component%': '<(component)',
2414 'chromecast%': '<(chromecast)',
2416 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2417 'win_release_Optimization%': '2', # 2 = /Os
2418 'win_debug_Optimization%': '0', # 0 = /Od
2420 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2421 # Tri-state: blank is default, 1 on, 0 off
2422 'win_release_OmitFramePointers%': '0',
2423 # Tri-state: blank is default, 1 on, 0 off
2424 'win_debug_OmitFramePointers%': '',
2426 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2427 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2429 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2430 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2431 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2433 # VS inserts quite a lot of extra checks to algorithms like
2434 # std::partial_sort in Debug build which make them O(N^2)
2435 # instead of O(N*logN). This is particularly slow under memory
2436 # tools like ThreadSanitizer so we want it to be disablable.
2437 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2438 'win_debug_disable_iterator_debugging%': '0',
2440 # An application manifest fragment to declare compatibility settings for
2441 # 'executable' targets. Ignored in other target type.
2442 'win_exe_compatibility_manifest%':
2443 '<(DEPTH)\\build\\win\\compatibility.manifest',
2445 'release_extra_cflags%': '',
2446 'debug_extra_cflags%': '',
2448 'release_valgrind_build%': '<(release_valgrind_build)',
2450 # the non-qualified versions are widely assumed to be *nix-only
2451 'win_release_extra_cflags%': '',
2452 'win_debug_extra_cflags%': '',
2454 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2455 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2457 # Only used by Windows build for now. Can be used to build into a
2458 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2459 # output files in src/build/VS2010_{Debug,Release}.
2460 'build_dir_prefix%': '',
2462 # Targets are by default not nacl untrusted code.
2463 'nacl_untrusted_build%': 0,
2465 'pnacl_compile_flags': [
2466 # pnacl uses the clang compiler so we need to suppress all the
2467 # same warnings as we do for clang.
2468 # TODO(sbc): Remove these if/when they are removed from the clang
2470 '-Wno-unused-function',
2471 '-Wno-char-subscripts',
2472 '-Wno-c++11-extensions',
2473 '-Wno-unnamed-type-template-args',
2477 ['OS=="win" and component=="shared_library"', {
2478 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2479 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2480 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2482 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2483 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2484 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2487 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2488 'mac_release_optimization%': 's', # Use -Os unless overridden
2489 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2491 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2492 'mac_release_optimization%': '2', # Use -O2 unless overridden
2493 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2496 'host_os%': '<(host_os)', # See comment above chromium_code.
2499 'clang_warning_flags': [
2502 # Don't die on dtoa code that uses a char as an array index.
2503 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2504 '-Wno-char-subscripts',
2506 # TODO(thakis): This used to be implied by -Wno-unused-function,
2507 # which we no longer use. Check if it makes sense to remove
2508 # this as well. http://crbug.com/316352
2509 '-Wno-unneeded-internal-declaration',
2511 # Warns on switches on enums that cover all enum values but
2512 # also contain a default: branch. Chrome is full of that.
2513 '-Wno-covered-switch-default',
2515 # Warns when a const char[] is converted to bool.
2516 '-Wstring-conversion',
2518 # C++11-related flags:
2520 # This warns on using ints as initializers for floats in
2521 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2522 # which happens in several places in chrome code. Not sure if
2523 # this is worth fixing.
2524 '-Wno-c++11-narrowing',
2526 # Clang considers the `register` keyword as deprecated, but e.g.
2527 # code generated by flex (used in angle) contains that keyword.
2528 # http://crbug.com/255186
2529 '-Wno-deprecated-register',
2531 # TODO(hans): Get this cleaned up.
2532 '-Wno-inconsistent-missing-override',
2535 'includes': [ 'set_clang_warning_flags.gypi', ],
2537 # Don't use deprecated V8 APIs anywhere.
2538 'V8_DEPRECATION_WARNINGS',
2541 '<(SHARED_INTERMEDIATE_DIR)',
2544 ['(OS=="mac" or OS=="ios") and asan==1', {
2546 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2549 ['OS=="win" and asan==1 and component=="shared_library"', {
2551 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2554 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2555 'cflags_cc!': ['-fno-rtti'],
2558 '-gline-tables-only',
2559 '-fintercept-allocation-functions',
2561 'defines': ['TYPE_PROFILING'],
2563 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2566 ['branding=="Chrome"', {
2567 'defines': ['GOOGLE_CHROME_BUILD'],
2568 }, { # else: branding!="Chrome"
2569 'defines': ['CHROMIUM_BUILD'],
2571 ['OS=="mac" and component=="shared_library"', {
2573 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2574 'LD_RUNPATH_SEARCH_PATHS': [
2575 # For unbundled binaries.
2577 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2578 '@loader_path/../../..',
2582 ['clang==1 and OS!="win"', {
2583 # This is here so that all files get recompiled after a clang roll and
2584 # when turning clang on or off.
2585 # (defines are passed via the command line, and build systems rebuild
2586 # things when their commandline changes). Nothing should ever read this
2588 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2591 'defines': ['ENABLE_RLZ'],
2593 ['component=="shared_library"', {
2594 'defines': ['COMPONENT_BUILD'],
2596 ['toolkit_views==1', {
2597 'defines': ['TOOLKIT_VIEWS=1'],
2599 ['ui_compositor_image_transport==1', {
2600 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2603 'defines': ['USE_AURA=1'],
2606 'defines': ['USE_ASH=1'],
2609 'defines': ['USE_PANGO=1'],
2612 'defines': ['USE_CAIRO=1'],
2615 'defines': ['USE_CRAS=1'],
2618 'defines': ['USE_OZONE=1'],
2620 ['use_default_render_theme==1', {
2621 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2623 ['use_libjpeg_turbo==1', {
2624 'defines': ['USE_LIBJPEG_TURBO=1'],
2627 'defines': ['USE_X11=1'],
2629 ['use_clipboard_aurax11==1', {
2630 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2632 ['enable_one_click_signin==1', {
2633 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2635 ['enable_pre_sync_backup==1', {
2636 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2638 ['image_loader_extension==1', {
2639 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2642 'defines': ['ENABLE_PROFILING=1'],
2645 'defines': ['ENABLE_REMOTING=1'],
2647 ['enable_webrtc==1', {
2648 'defines': ['ENABLE_WEBRTC=1'],
2650 ['proprietary_codecs==1', {
2651 'defines': ['USE_PROPRIETARY_CODECS'],
2653 ['enable_mpeg2ts_stream_parser==1', {
2654 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2658 ['enable_viewport==1', {
2659 'defines': ['ENABLE_VIEWPORT'],
2661 ['enable_pepper_cdms==1', {
2662 'defines': ['ENABLE_PEPPER_CDMS'],
2664 ['enable_browser_cdms==1', {
2665 'defines': ['ENABLE_BROWSER_CDMS'],
2667 ['configuration_policy==1', {
2668 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2670 ['notifications==1', {
2671 'defines': ['ENABLE_NOTIFICATIONS'],
2673 ['enable_hidpi==1', {
2674 'defines': ['ENABLE_HIDPI=1'],
2676 ['native_discardable_memory==1', {
2677 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2679 ['native_memory_pressure_signals==1', {
2680 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2683 'defines': ['USE_UDEV'],
2687 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2690 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2691 # Clang creates chubby debug information, which makes linking very
2692 # slow. For now, don't create debug information with clang. See
2693 # http://crbug.com/70000
2697 'debug_extra_cflags': '-g0',
2700 # Android builds symbols on release by default, disable them.
2703 'debug_extra_cflags': '-g0',
2704 'release_extra_cflags': '-g0',
2708 }, { # else clang!=1
2710 ['OS=="win" and fastbuild==2', {
2711 # Completely disable debug information.
2714 'GenerateDebugInformation': 'false',
2716 'VCCLCompilerTool': {
2717 'DebugInformationFormat': '0',
2721 ['OS=="win" and fastbuild==1', {
2724 # This tells the linker to generate .pdbs, so that
2725 # we can get meaningful stack traces.
2726 'GenerateDebugInformation': 'true',
2728 'VCCLCompilerTool': {
2729 # No debug info to be generated by compiler.
2730 'DebugInformationFormat': '0',
2734 ['OS=="linux" and fastbuild==2', {
2736 'debug_extra_cflags': '-g0',
2739 ['OS=="linux" and fastbuild==1', {
2741 'debug_extra_cflags': '-g1',
2744 ['OS=="android" and fastbuild==2', {
2746 'debug_extra_cflags': '-g0',
2747 'release_extra_cflags': '-g0',
2750 ['OS=="android" and fastbuild==1', {
2752 'debug_extra_cflags': '-g1',
2753 'release_extra_cflags': '-g1',
2760 ['dont_embed_build_metadata==1', {
2762 'DONT_EMBED_BUILD_METADATA',
2764 }], # dont_embed_build_metadata==1
2765 ['dcheck_always_on!=0', {
2766 'defines': ['DCHECK_ALWAYS_ON=1'],
2767 }], # dcheck_always_on!=0
2768 ['tracing_like_official_build!=0', {
2769 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2770 }], # tracing_like_official_build!=0
2771 ['win_use_allocator_shim==0', {
2774 'defines': ['NO_TCMALLOC'],
2780 'ADDRESS_SANITIZER',
2781 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2782 'MEMORY_SANITIZER_INITIAL_SIZE',
2786 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2794 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2795 'MEMORY_SANITIZER_INITIAL_SIZE',
2801 '_CRT_SECURE_NO_DEPRECATE',
2802 '_SCL_SECURE_NO_DEPRECATE',
2803 # This define is required to pull in the new Win8 interfaces from
2804 # system headers like ShObjIdl.h.
2805 'NTDDI_VERSION=0x06030000',
2806 # This is required for ATL to use XP-safe versions of its functions.
2807 '_USING_V110_SDK71_',
2810 '<(DEPTH)/third_party/wtl/include',
2815 # Generates debug info when win_z7=1
2816 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2818 'GenerateDebugInformation': 'true',
2820 'VCCLCompilerTool': {
2821 'DebugInformationFormat': '1',
2827 # This is prohibited when running /analyze.
2828 '_USING_V110_SDK71_',
2831 'VCCLCompilerTool': {
2832 # Set WarnAsError to false to disable this setting for most
2833 # projects so that compilation continues.
2834 'WarnAsError': 'false',
2835 # When win_analyze is specified add the /analyze switch.
2836 # Also add /WX- to force-disable WarnAsError for projects that
2837 # override WarnAsError.
2838 # Also, disable various noisy warnings that have low value.
2839 'AdditionalOptions': [
2842 '/wd6011', # Dereferencing NULL pointer
2843 '/wd6312', # Possible infinite loop: use of the constant
2844 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2845 '/wd6326', # Potential comparison of constant with constant
2846 '/wd28159', # Consider using 'GetTickCount64'
2847 '/wd28204', # Inconsistent SAL annotations
2848 '/wd28251', # Inconsistent SAL annotations
2849 '/wd28252', # Inconsistent SAL annotations
2850 '/wd28253', # Inconsistent SAL annotations
2851 '/wd28196', # The precondition is not satisfied
2852 '/wd28301', # Inconsistent SAL annotations
2853 '/wd6340', # Sign mismatch in function parameter
2854 '/wd28182', # Dereferencing NULL pointer
2866 ['target_arch=="arm"', {
2868 # TODO(lcwu): Work around an error when building Chromium
2869 # with gcc-4.5.3 (e.g. v8/src/platform-linux.cc). Remove
2870 # this define once the toolchain is updated.
2871 # See crbug.com/388933.
2875 ['use_playready==1', {
2877 'PLAYREADY_CDM_AVAILABLE',
2882 ['enable_task_manager==1', {
2884 'ENABLE_TASK_MANAGER=1',
2887 ['enable_extensions==1', {
2889 'ENABLE_EXTENSIONS=1',
2892 ['OS=="win" and branding=="Chrome"', {
2893 'defines': ['ENABLE_SWIFTSHADER'],
2895 ['enable_dart==1', {
2896 'defines': ['WEBKIT_USING_DART=1'],
2898 ['enable_plugin_installation==1', {
2899 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2901 ['enable_plugins==1', {
2902 'defines': ['ENABLE_PLUGINS=1'],
2904 ['enable_session_service==1', {
2905 'defines': ['ENABLE_SESSION_SERVICE=1'],
2907 ['enable_themes==1', {
2908 'defines': ['ENABLE_THEMES=1'],
2910 ['enable_autofill_dialog==1', {
2911 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2913 ['enable_prod_wallet_service==1', {
2914 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2916 ['enable_background==1', {
2917 'defines': ['ENABLE_BACKGROUND=1'],
2919 ['enable_google_now==1', {
2920 'defines': ['ENABLE_GOOGLE_NOW=1'],
2922 ['cld_version!=0', {
2923 'defines': ['CLD_VERSION=<(cld_version)'],
2925 ['enable_basic_printing==1 or enable_print_preview==1', {
2926 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2927 'defines': ['ENABLE_PRINTING=1'],
2929 ['enable_basic_printing==1', {
2930 # Enable basic printing support and UI.
2931 'defines': ['ENABLE_BASIC_PRINTING=1'],
2933 ['enable_print_preview==1', {
2934 # Enable printing with print preview.
2935 # Can be defined without ENABLE_BASIC_PRINTING.
2936 'defines': ['ENABLE_PRINT_PREVIEW=1'],
2938 ['enable_spellcheck==1', {
2939 'defines': ['ENABLE_SPELLCHECK=1'],
2941 ['enable_captive_portal_detection==1', {
2942 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2944 ['enable_app_list==1', {
2945 'defines': ['ENABLE_APP_LIST=1'],
2947 ['enable_settings_app==1', {
2948 'defines': ['ENABLE_SETTINGS_APP=1'],
2950 ['disable_file_support==1', {
2951 'defines': ['DISABLE_FILE_SUPPORT=1'],
2953 ['disable_ftp_support==1', {
2954 'defines': ['DISABLE_FTP_SUPPORT=1'],
2956 ['use_icu_alternatives_on_android==1', {
2957 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2959 ['enable_supervised_users==1', {
2960 'defines': ['ENABLE_SUPERVISED_USERS=1'],
2962 ['spdy_proxy_auth_property != ""', {
2963 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2965 ['spdy_proxy_auth_value != ""', {
2966 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2968 ['enable_mdns==1', {
2969 'defines': ['ENABLE_MDNS=1'],
2971 ['enable_service_discovery==1', {
2972 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2974 ['enable_wifi_bootstrapping==1', {
2975 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2977 ['enable_hangout_services_extension==1', {
2978 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2980 ['enable_ipc_fuzzer==1', {
2981 'defines': ['ENABLE_IPC_FUZZER=1'],
2984 'defines': ['VIDEO_HOLE=1'],
2986 ['v8_use_external_startup_data==1', {
2987 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
2989 ], # conditions for 'target_defaults'
2990 'target_conditions': [
2991 ['<(use_libpci)==1', {
2992 'defines': ['USE_LIBPCI=1'],
2994 ['<(use_openssl)==1', {
2995 'defines': ['USE_OPENSSL=1'],
2997 ['<(use_openssl_certs)==1', {
2998 'defines': ['USE_OPENSSL_CERTS=1'],
3000 ['>(nacl_untrusted_build)==1', {
3003 'USE_OPENSSL_CERTS=1',
3006 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3007 'defines': ['USE_GLIB=1'],
3009 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
3010 'defines': ['USE_NSS=1'],
3012 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3013 'defines': ['OS_CHROMEOS=1'],
3015 ['enable_wexit_time_destructors==1 and OS!="win"', {
3016 # TODO: Enable on Windows too, http://crbug.com/404525
3017 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3019 ['chromium_code==0', {
3021 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3022 # We don't want to get warnings from third-party code,
3023 # so remove any existing warning-enabling flags like -Wall.
3029 # Don't warn about hash_map in third-party code.
3033 # Don't warn about printf format problems.
3034 # This is off by default in gcc but on in Ubuntu's gcc(!).
3038 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3042 # TODO: Fix all warnings on chromeos too.
3043 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3048 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3050 # Don't warn about ignoring the return value from e.g. close().
3051 # This is off by default in some gccs but on by default in others.
3052 # BSD systems do not support this option, since they are usually
3053 # using gcc 4.2.1, which does not have this flag yet.
3054 '-Wno-unused-result',
3059 '_CRT_SECURE_NO_DEPRECATE',
3060 '_CRT_NONSTDC_NO_WARNINGS',
3061 '_CRT_NONSTDC_NO_DEPRECATE',
3062 '_SCL_SECURE_NO_DEPRECATE',
3064 'msvs_disabled_warnings': [4800],
3066 'VCCLCompilerTool': {
3067 'WarningLevel': '3',
3068 'WarnAsError': 'true',
3069 'Detect64BitPortabilityProblems': 'false',
3073 ['buildtype=="Official"', {
3075 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3080 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3083 [ 'component=="shared_library"', {
3084 # TODO(darin): Unfortunately, some third_party code depends on base.
3085 'msvs_disabled_warnings': [
3086 4251, # class 'std::xx' needs to have dll-interface.
3092 [ 'OS=="mac" or OS=="ios"', {
3094 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3097 ['buildtype=="Official"', {
3099 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3106 # TODO(ios): Fix remaining warnings in third-party code, then
3107 # remove this; the Mac cleanup didn't get everything that's
3108 # flagged in an iOS build.
3109 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3110 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3111 # Several internal ios directories generate numerous warnings for
3112 # -Wobjc-missing-property-synthesis.
3113 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3119 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3120 'filename_rules.gypi',
3122 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3123 # C99 macros on Mac and Linux.
3125 '__STDC_CONSTANT_MACROS',
3126 '__STDC_FORMAT_MACROS',
3130 # turn on warnings for signed/unsigned mismatch on chromium code.
3132 'VCCLCompilerTool': {
3133 'AdditionalOptions': ['/we4389'],
3137 ['OS=="win" and component=="shared_library"', {
3138 'msvs_disabled_warnings': [
3139 4251, # class 'std::xx' needs to have dll-interface.
3144 ], # target_conditions for 'target_defaults'
3145 'default_configuration': 'Debug',
3147 # VCLinkerTool LinkIncremental values below:
3149 # 1 == /INCREMENTAL:NO
3151 # Debug links incremental, Release does not.
3153 # Abstract base configurations to cover common attributes.
3157 'msvs_configuration_attributes': {
3158 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3159 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3160 'CharacterSet': '1',
3162 # Add the default import libs.
3165 'AdditionalDependencies': [
3182 'AdditionalOptions': [
3183 # Suggested by Microsoft Devrel to avoid
3184 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3185 # which started happening more regularly after VS2013 Update 4.
3186 '/maxilksize:2147483647',
3195 'MinimumRequiredVersion': '5.01', # XP.
3196 'TargetMachine': '1',
3198 'VCLibrarianTool': {
3199 'TargetMachine': '1',
3202 'msvs_configuration_platform': 'Win32',
3206 'msvs_configuration_platform': 'x64',
3209 # Make sure to understand http://crbug.com/361720 if you want to
3211 'MinimumRequiredVersion': '5.02', # Server 2003.
3212 'TargetMachine': '17', # x86 - 64
3213 'AdditionalLibraryDirectories!':
3214 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3215 'AdditionalLibraryDirectories':
3216 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3217 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3218 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3220 'VCLibrarianTool': {
3221 'AdditionalLibraryDirectories!':
3222 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3223 'AdditionalLibraryDirectories':
3224 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3225 'TargetMachine': '17', # x64
3232 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3233 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3236 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3238 '<@(debug_extra_cflags)',
3242 'VCCLCompilerTool': {
3243 'Optimization': '<(win_debug_Optimization)',
3244 'PreprocessorDefinitions': ['_DEBUG'],
3245 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3246 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3248 # According to MSVS, InlineFunctionExpansion=0 means
3249 # "default inlining", not "/Ob0".
3250 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3251 ['win_debug_InlineFunctionExpansion==0', {
3252 'AdditionalOptions': ['/Ob0'],
3254 ['win_debug_InlineFunctionExpansion!=""', {
3255 'InlineFunctionExpansion':
3256 '<(win_debug_InlineFunctionExpansion)',
3258 ['win_debug_disable_iterator_debugging==1', {
3259 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3262 # if win_debug_OmitFramePointers is blank, leave as default
3263 ['win_debug_OmitFramePointers==1', {
3264 'OmitFramePointers': 'true',
3266 ['win_debug_OmitFramePointers==0', {
3267 'OmitFramePointers': 'false',
3268 # The above is not sufficient (http://crbug.com/106711): it
3269 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3270 # perform FPO regardless, so we must explicitly disable.
3271 # We still want the false setting above to avoid having
3272 # "/Oy /Oy-" and warnings about overriding.
3273 'AdditionalOptions': ['/Oy-'],
3276 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3279 'LinkIncremental': '<(msvs_debug_link_incremental)',
3280 # ASLR makes debugging with windbg difficult because Chrome.exe and
3281 # Chrome.dll share the same base name. As result, windbg will
3282 # name the Chrome.dll module like chrome_<base address>, where
3283 # <base address> typically changes with each launch. This in turn
3284 # means that breakpoints in Chrome.dll don't stick from one launch
3285 # to the next. For this reason, we turn ASLR off in debug builds.
3286 # Note that this is a three-way bool, where 0 means to pick up
3287 # the default setting, 1 is off and 2 is on.
3288 'RandomizedBaseAddress': 1,
3290 'VCResourceCompilerTool': {
3291 'PreprocessorDefinitions': ['_DEBUG'],
3295 ['OS=="linux" or OS=="android"', {
3296 'target_conditions': [
3297 ['_toolset=="target"', {
3299 '<@(debug_extra_cflags)',
3304 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3305 # Enable libstdc++ debugging facilities to help catch problems
3306 # early, see http://crbug.com/65151 .
3307 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3308 'defines': ['_GLIBCXX_DEBUG=1',],
3310 ['release_valgrind_build==0', {
3313 '-fstack-protector-all', # Implies -fstack-protector
3319 # Allow comparing the address of references and 'this' against 0
3320 # in debug builds. Technically, these can never be null in
3321 # well-defined C/C++ and Clang can optimize such checks away in
3322 # release builds, but they may be used in asserts in debug builds.
3323 '-Wno-undefined-bool-conversion',
3324 '-Wno-tautological-undefined-compare',
3328 '-Wno-undefined-bool-conversion',
3329 '-Wno-tautological-undefined-compare',
3333 'VCCLCompilerTool': {
3334 'AdditionalOptions': [
3335 '-Wno-undefined-bool-conversion',
3336 '-Wno-tautological-undefined-compare',
3349 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3350 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3351 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3354 'VCCLCompilerTool': {
3355 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3357 # In official builds, each target will self-select
3358 # an optimization level.
3359 ['buildtype!="Official"', {
3360 'Optimization': '<(win_release_Optimization)',
3363 # According to MSVS, InlineFunctionExpansion=0 means
3364 # "default inlining", not "/Ob0".
3365 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3366 ['win_release_InlineFunctionExpansion==0', {
3367 'AdditionalOptions': ['/Ob0'],
3369 ['win_release_InlineFunctionExpansion!=""', {
3370 'InlineFunctionExpansion':
3371 '<(win_release_InlineFunctionExpansion)',
3374 # if win_release_OmitFramePointers is blank, leave as default
3375 ['win_release_OmitFramePointers==1', {
3376 'OmitFramePointers': 'true',
3378 ['win_release_OmitFramePointers==0', {
3379 'OmitFramePointers': 'false',
3380 # The above is not sufficient (http://crbug.com/106711): it
3381 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3382 # perform FPO regardless, so we must explicitly disable.
3383 # We still want the false setting above to avoid having
3384 # "/Oy /Oy-" and warnings about overriding.
3385 'AdditionalOptions': ['/Oy-'],
3388 # Put data in separate COMDATs. This allows the linker
3389 # to put bit-identical constants at the same address even if
3390 # they're unrelated constants, which saves binary size.
3391 # This optimization can't be used when ASan is enabled because
3392 # it is not compatible with the ASan ODR checker.
3393 'AdditionalOptions': ['/Gw'],
3396 'AdditionalOptions': [
3397 '/d2Zi+', # Improve debugging of Release builds.
3398 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3399 '<@(win_release_extra_cflags)',
3403 # LinkIncremental is a tri-state boolean, where 0 means default
3404 # (i.e., inherit from parent solution), 1 means false, and
3406 'LinkIncremental': '1',
3407 # This corresponds to the /PROFILE flag which ensures the PDB
3408 # file contains FIXUP information (growing the PDB file by about
3409 # 5%) but does not otherwise alter the output binary. This
3410 # information is used by the Syzygy optimization tool when
3411 # decomposing the release image.
3416 ['msvs_use_common_release', {
3417 'includes': ['release.gypi'],
3419 ['release_valgrind_build==0 and tsan==0', {
3422 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3426 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3427 'MEMORY_SANITIZER_INITIAL_SIZE',
3428 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3429 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3432 ['OS=="win" and win_use_allocator_shim==0', {
3433 'defines': ['NO_TCMALLOC'],
3435 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3436 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3437 # It seems to work fine with Ubuntu 12 headers though, so use it
3438 # in official builds.
3439 ['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")', {
3440 'target_conditions': [
3441 ['chromium_code==1', {
3442 # Non-chromium code is not guaranteed to compile cleanly
3443 # with _FORTIFY_SOURCE. Also, fortified build may fail
3444 # when optimizations are disabled, so only do that for Release
3447 '_FORTIFY_SOURCE=2',
3452 ['OS=="linux" or OS=="android"', {
3453 'target_conditions': [
3454 ['_toolset=="target"', {
3456 '<@(release_extra_cflags)',
3459 ['enable_resource_whitelist_generation==1', {
3461 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3470 'NS_BLOCK_ASSERTIONS=1',
3476 # Concrete configurations
3479 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3482 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3487 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3488 'target_conditions': [
3489 [ '_type=="executable"', {
3490 # To get a real .dSYM bundle produced by dsymutil, set the
3491 # debug information format to dwarf-with-dsym. Since
3492 # strip_from_xcode will not be used, set Xcode to do the
3493 # stripping as well.
3495 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3496 'DEPLOYMENT_POSTPROCESSING': 'YES',
3497 'STRIP_INSTALLED_PRODUCT': 'YES',
3504 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3506 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3509 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3517 'target_defaults': {
3522 # TODO(glider): enable the default options on other systems.
3524 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3526 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3532 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3533 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3534 'target_defaults': {
3536 '-Wl,--fatal-warnings',
3540 ['os_posix==1 and chromeos==0', {
3541 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3542 # and we want to avoid overriding this, so stack-protector is only
3543 # enabled when not building on Chrome OS.
3544 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3546 'target_defaults': {
3548 '-fstack-protector',
3549 '--param=ssp-buffer-size=4',
3553 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3554 'target_defaults': {
3555 # Enable -Werror by default, but put it in a variable so it can
3556 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3558 'werror%': '-Werror',
3559 'libraries_for_target%': '',
3562 '_FILE_OFFSET_BITS=64',
3565 '<(werror)', # See note above about the werror variable.
3567 '-fno-strict-aliasing', # See http://crbug.com/32204
3569 # TODO(evan): turn this back on once all the builds work.
3571 # Don't warn about unused function params. We use those everywhere.
3572 '-Wno-unused-parameter',
3573 # Don't warn about the "struct foo f = {0};" initialization pattern.
3574 '-Wno-missing-field-initializers',
3575 # Don't export any symbols (for example, to plugins we dlopen()).
3576 # Note: this is *required* to make some plugins work.
3577 '-fvisibility=hidden',
3583 '-fno-threadsafe-statics',
3584 # Make inline functions have hidden visiblity by default.
3585 # Surprisingly, not covered by -fvisibility=hidden.
3586 '-fvisibility-inlines-hidden',
3587 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3588 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3592 '-pthread', '-Wl,-z,noexecstack',
3595 '<(libraries_for_target)',
3600 'debug_optimize%': '0',
3606 '-O>(debug_optimize)',
3613 # Warn in case of text relocations.
3614 '-Wl,--warn-shared-textrel',
3617 ['OS=="android" and android_full_debug==0', {
3618 # Some configurations are copied from Release_Base to reduce
3621 'debug_optimize%': 's',
3625 '-ffunction-sections',
3632 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3633 # We don't omit frame pointers on arm64 since they are required
3634 # to correctly unwind stackframes which contain system library
3635 # function frames (crbug.com/391706).
3637 '-fomit-frame-pointer',
3640 ['OS=="linux" and target_arch=="ia32"', {
3642 '-Wl,--no-as-needed',
3645 ['debug_unwind_tables==1', {
3646 'cflags': ['-funwind-tables'],
3648 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3649 'defines': ['NO_UNWIND_TABLES'],
3651 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3652 # definitions in to the right scope to use them when setting
3653 # linux_use_debug_fission, so it can be used here alone.
3654 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3655 'cflags': ['-gsplit-dwarf'],
3661 'release_optimize%': '2',
3662 # Binaries become big and gold is unable to perform GC
3663 # and remove unused sections for some of test targets
3664 # on 32 bit platform.
3665 # (This is currently observed only in chromeos valgrind bots)
3666 # The following flag is to disable --gc-sections linker
3667 # option for these bots.
3668 'no_gc_sections%': 0,
3670 # TODO(bradnelson): reexamine how this is done if we change the
3671 # expansion of configurations
3672 'release_valgrind_build%': 0,
3675 '-O<(release_optimize)',
3676 # Don't emit the GCC version ident directives, they just end up
3677 # in the .comment section taking up binary size.
3679 # Put data and code in their own sections, so that unused symbols
3680 # can be removed at link time with --gc-sections.
3682 '-ffunction-sections',
3685 # Specifically tell the linker to perform optimizations.
3686 # See http://lwn.net/Articles/192624/ .
3691 ['no_gc_sections==0', {
3693 '-Wl,--gc-sections',
3696 ['OS=="android" and target_arch!="arm64"', {
3697 # We don't omit frame pointers on arm64 since they are required
3698 # to correctly unwind stackframes which contain system library
3699 # function frames (crbug.com/391706).
3701 '-fomit-frame-pointer',
3706 'release_optimize%': 's',
3709 # Warn in case of text relocations.
3710 '-Wl,--warn-shared-textrel',
3715 '-fno-omit-frame-pointer',
3719 ['profiling_full_stack_frames==1', {
3722 '-fno-optimize-sibling-calls',
3727 ['release_unwind_tables==1', {
3728 'cflags': ['-funwind-tables'],
3730 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3731 'defines': ['NO_UNWIND_TABLES'],
3737 ['target_arch=="ia32"', {
3738 'target_conditions': [
3739 ['_toolset=="target"', {
3741 # Needed so that libs with .s files (e.g. libicudata.a)
3742 # are compatible with the general 32-bit-ness.
3745 # All floating-point computations on x87 happens in 80-bit
3746 # precision. Because the C and C++ language standards allow
3747 # the compiler to keep the floating-point values in higher
3748 # precision than what's specified in the source and doing so
3749 # is more efficient than constantly rounding up to 64-bit or
3750 # 32-bit precision as specified in the source, the compiler,
3751 # especially in the optimized mode, tries very hard to keep
3752 # values in x87 floating-point stack (in 80-bit precision)
3753 # as long as possible. This has important side effects, that
3754 # the real value used in computation may change depending on
3755 # how the compiler did the optimization - that is, the value
3756 # kept in 80-bit is different than the value rounded down to
3757 # 64-bit or 32-bit. There are possible compiler options to
3758 # make this behavior consistent (e.g. -ffloat-store would keep
3759 # all floating-values in the memory, thus force them to be
3760 # rounded to its original precision) but they have significant
3761 # runtime performance penalty.
3763 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3764 # which keep floating-point values in SSE registers in its
3765 # native precision (32-bit for single precision, and 64-bit
3766 # for double precision values). This means the floating-point
3767 # value used during computation does not change depending on
3768 # how the compiler optimized the code, since the value is
3769 # always kept in its specified precision.
3771 # Refer to http://crbug.com/348761 for rationale behind SSE2
3772 # being a minimum requirement for 32-bit Linux builds and
3773 # http://crbug.com/313032 for an example where this has "bit"
3778 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3785 # Use gold linker for Android ia32 target.
3791 # Install packages have started cropping up with
3792 # different headers between the 32-bit and 64-bit
3793 # versions, so we have to shadow those differences off
3794 # and make sure a 32-bit-on-64-bit build picks up the
3796 # For android build, use NDK headers instead of host headers
3797 ['host_arch!="ia32" and OS!="android"', {
3806 ['target_arch=="x64"', {
3807 'target_conditions': [
3808 ['_toolset=="target"', {
3810 # Use gold linker for Android x64 target.
3827 ['target_arch=="arm"', {
3828 'target_conditions': [
3829 ['_toolset=="target"', {
3833 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3834 # has changed whenever it encounters a varargs function. This
3835 # silences those warnings, as they are not helpful and
3836 # clutter legitimate warnings.
3840 ['clang==1 and arm_arch!="" and OS!="android"', {
3842 '-target arm-linux-gnueabihf',
3845 '-target arm-linux-gnueabihf',
3850 '-march=<(arm_arch)',
3853 ['use_lto==1 or use_lto_o2==1', {
3855 '-march=<(arm_arch)',
3860 ['clang==1 and OS!="android"', {
3862 # We need to disable clang's builtin assembler as it can't
3863 # handle several asm files, crbug.com/124610
3864 '-no-integrated-as',
3869 '-mtune=<(arm_tune)',
3872 ['use_lto==1 or use_lto_o2==1', {
3874 '-mtune=<(arm_tune)',
3884 ['use_lto==1 or use_lto_o2==1', {
3891 ['arm_float_abi!=""', {
3893 '-mfloat-abi=<(arm_float_abi)',
3896 ['use_lto==1 or use_lto_o2==1', {
3898 '-mfloat-abi=<(arm_float_abi)',
3908 ['use_lto==1 or use_lto_o2==1', {
3916 # Most of the following flags are derived from what Android
3917 # uses by default when building for arm, reference for which
3918 # can be found in the following file in the Android NDK:
3919 # toolchains/arm-linux-androideabi-4.9/setup.mk
3921 # The tree-sra optimization (scalar replacement for
3922 # aggregates enabling subsequent optimizations) leads to
3923 # invalid code generation when using the Android NDK's
3924 # compiler (r5-r7). This can be verified using
3925 # webkit_unit_tests' WTF.Checked_int8_t test.
3927 # The following option is disabled to improve binary
3928 # size and performance in gcc 4.9.
3929 '-fno-caller-saves',
3932 # Android now supports .relro sections properly.
3933 # NOTE: While these flags enable the generation of .relro
3934 # sections, the generated libraries can still be loaded on
3935 # older Android platform versions.
3942 ['gcc_version==48 and clang==0', {
3944 # The following 5 options are disabled to save on
3945 # binary size in GCC 4.8.
3946 '-fno-partial-inlining',
3947 '-fno-early-inlining',
3948 '-fno-tree-copy-prop',
3949 '-fno-tree-loop-optimize',
3950 '-fno-move-loop-invariants',
3954 'cflags': [ '-mthumb-interwork' ],
3958 # Thumb code with frame pointer makes chrome crash
3961 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3962 # The perf report sometimes incorrectly attributes
3963 # code from tail calls.
3964 '-fno-optimize-sibling-calls',
3967 '-fomit-frame-pointer',
3972 # Clang does not support the following options.
3973 '-mthumb-interwork',
3974 '-finline-limit=64',
3976 '-fno-caller-saves',
3980 # TODO(hans) Enable integrated-as (crbug.com/124610).
3981 '-no-integrated-as',
3982 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3985 # Let clang find the ld.gold in the NDK.
3986 '--gcc-toolchain=<(android_toolchain)/..',
3991 '-marm', # Required for frame pointer based stack traces.
3998 # We set arm_arch to "" so that -march compiler option
3999 # is not set. Otherwise a gcc bug that would complain
4000 # about it conflicting with '-mcpu=cortex-a9'. The flag
4001 # '-march=armv7-a' is actually redundant anyway because
4002 # it is enabled by default when we built the toolchain.
4003 # And using '-mcpu=cortex-a9' should be sufficient.
4006 # Breakpad requires symbols with debugging information
4010 # We want to statically link libstdc++/libgcc_s.
4011 '-static-libstdc++',
4015 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4016 # define their own cflags for arm builds that could
4017 # conflict with the flags we set here (e.g.
4018 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4027 ['target_arch=="arm64"', {
4028 'target_conditions': [
4029 ['_toolset=="target"', {
4033 '-fstack-protector', # stack protector is always enabled on arm64.
4040 ['target_arch=="mipsel"', {
4041 'target_conditions': [
4042 ['_toolset=="target"', {
4044 ['android_webview_build==0 and mips_arch_variant=="r6"', {
4045 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
4048 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4052 ['android_webview_build==0 and mips_arch_variant=="r2"', {
4053 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
4055 ['android_webview_build==0 and mips_arch_variant=="r1"', {
4056 'cflags': ['-mips32', '-Wa,-mips32'],
4060 '-Wl,--no-keep-memory'
4063 '-Wno-uninitialized',
4068 ['target_arch=="mips64el"', {
4069 'target_conditions': [
4070 ['_toolset=="target"', {
4072 ['android_webview_build==0 and mips_arch_variant=="r6"', {
4073 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4074 'ldflags': [ '-mips64r6' ],
4076 ['android_webview_build==0 and mips_arch_variant=="r2"', {
4077 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4078 'ldflags': [ '-mips64r2' ],
4082 '-Wno-uninitialized',
4096 'target_conditions': [
4097 ['_toolset=="target"', {
4099 '--sysroot=<(sysroot)',
4102 '--sysroot=<(sysroot)',
4103 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4109 # TODO(thakis): Remove, http://crbug.com/263960
4110 '-Wno-reserved-user-defined-literal',
4113 # gnu++11 instead of c++11 is needed because some code uses
4114 # typeof() (a GNU extension).
4115 # TODO(thakis): Eventually switch this to c++11 instead,
4116 # http://crbug.com/427584
4120 ['clang==0 and host_clang==1', {
4121 'target_conditions': [
4122 ['_toolset=="host"', {
4123 'cflags_cc': [ '-std=gnu++11', ],
4127 ['clang==1 and clang_use_chrome_plugins==1', {
4129 '<@(clang_chrome_plugins_flags)',
4132 ['clang==1 and clang_load!=""', {
4134 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4137 ['clang==1 and clang_add_plugin!=""', {
4139 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4142 ['clang==1 and target_arch=="ia32"', {
4144 # Else building libyuv gives clang's register allocator issues,
4145 # see llvm.org/PR15798 / crbug.com/233709
4146 '-momit-leaf-frame-pointer',
4147 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4148 '-mstack-alignment=16',
4152 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4154 # See http://crbug.com/110262
4155 '-fcolor-diagnostics',
4158 # Common options for AddressSanitizer, LeakSanitizer,
4159 # ThreadSanitizer and MemorySanitizer.
4160 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4161 'target_conditions': [
4162 ['_toolset=="target"', {
4164 '-fno-omit-frame-pointer',
4165 '-gline-tables-only',
4168 '-fomit-frame-pointer',
4173 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4174 'target_conditions': [
4175 ['_toolset=="target"', {
4177 # Functions interposed by the sanitizers can make ld think
4178 # that some libraries aren't needed when they actually are,
4179 # http://crbug.com/234010. As workaround, disable --as-needed.
4183 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4184 'MEMORY_SANITIZER_INITIAL_SIZE',
4190 'target_conditions': [
4191 ['_toolset=="target"', {
4193 '-fsanitize=address',
4194 # TODO(earthdok): Re-enable. http://crbug.com/427202
4195 #'-fsanitize-blacklist=<(asan_blacklist)',
4198 '-fsanitize=address',
4205 '-mllvm -asan-globals=0', # http://crbug.com/352073
4211 'target_conditions': [
4212 ['_toolset=="target"', {
4214 '-fsanitize=undefined',
4215 # -fsanitize=vptr is incompatible with -fno-rtti.
4216 '-fno-sanitize=vptr',
4217 # Employ the experimental PBQP register allocator to avoid
4218 # slow compilation on files with too many basic blocks.
4219 # See http://crbug.com/426271.
4220 '-mllvm -regalloc=pbqp',
4221 # Speculatively use coalescing to slightly improve the code
4222 # generated by PBQP regallocator. May increase compile time.
4223 '-mllvm -pbqp-coalescing',
4226 '-fsanitize=undefined',
4227 # -fsanitize=vptr is incompatible with -fno-rtti.
4228 '-fno-sanitize=vptr',
4234 'target_conditions': [
4235 ['_toolset=="target"', {
4238 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4250 'UNDEFINED_SANITIZER',
4255 ['asan_coverage!=0', {
4256 'target_conditions': [
4257 ['_toolset=="target"', {
4259 '-fsanitize-coverage=<(asan_coverage)',
4264 ['asan_field_padding!=0', {
4265 'target_conditions': [
4266 ['_toolset=="target"', {
4268 '-fsanitize-address-field-padding=<(asan_field_padding)',
4274 'target_conditions': [
4275 ['_toolset=="target"', {
4284 'WTF_USE_LEAK_SANITIZER=1',
4290 'target_conditions': [
4291 ['_toolset=="target"', {
4293 '-fsanitize=thread',
4294 '-fsanitize-blacklist=<(tsan_blacklist)',
4297 '-fsanitize=thread',
4301 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4302 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4308 'target_conditions': [
4309 ['_toolset=="target"', {
4311 '-fsanitize=memory',
4312 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4313 '-fsanitize-blacklist=<(msan_blacklist)',
4316 '-fsanitize=memory',
4324 ['use_instrumented_libraries==1', {
4326 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4329 ['use_custom_libcxx==1', {
4331 '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4334 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4335 'target_conditions' : [
4336 # crazy_linker has an upstream gyp file we can't edit, and we
4337 # don't want to instrument it.
4338 ['_toolset=="target" and _target_name!="crazy_linker"', {
4340 '-finstrument-functions',
4341 # Allow mmx intrinsics to inline, so that the
4342 #0 compiler can expand the intrinsics.
4343 '-finstrument-functions-exclude-file-list=mmintrin.h',
4346 ['_toolset=="target" and OS=="android"', {
4348 # Avoids errors with current NDK:
4349 # "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"
4350 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4355 ['linux_dump_symbols==1', {
4358 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4359 'target_conditions': [
4360 ['_toolset=="target"', {
4362 # Attempt to use less memory to prevent the linker from
4363 # running out of address space. Considering installing a
4364 # 64-bit kernel and switching to a 64-bit linker.
4365 '-Wl,--no-keep-memory',
4372 ['use_allocator!="tcmalloc"', {
4373 'defines': ['NO_TCMALLOC'],
4375 ['linux_use_gold_flags==1', {
4376 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4378 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4379 'ldflags': [ '-fuse-ld=gold', ],
4381 'target_conditions': [
4382 ['_toolset=="target"', {
4384 # Experimentation found that using four linking threads
4385 # saved ~20% of link time.
4386 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4387 # Only apply this to the target linker, since the host
4388 # linker might not be gold, but isn't used much anyway.
4389 # TODO(raymes): Disable threading because gold is frequently
4390 # crashing on the bots: crbug.com/161942.
4392 # '-Wl,--thread-count=4',
4397 ['release_valgrind_build==0 and order_profiling==0', {
4398 'target_conditions': [
4399 ['_toolset=="target"', {
4408 ['linux_use_bundled_binutils==1', {
4410 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4413 ['linux_use_bundled_gold==1', {
4414 # Put our binutils, which contains gold in the search path. We pass
4415 # the path to gold to the compiler. gyp leaves unspecified what the
4416 # cwd is when running the compiler, so the normal gyp path-munging
4417 # fails us. This hack gets the right path.
4419 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4422 # Some binutils 2.23 releases may or may not have new dtags enabled,
4423 # but they are all compatible with --disable-new-dtags,
4424 # because the new dynamic tags are not created by default.
4425 ['binutils_version>=223', {
4426 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4427 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4428 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4429 # inside this file to allow usage of --no-as-needed and removal of
4432 '-Wl,--disable-new-dtags',
4435 ['gcc_version>=47 and clang==0', {
4436 'target_conditions': [
4437 ['_toolset=="target"', {
4440 # See comment for -Wno-c++11-narrowing.
4442 # TODO(thakis): Remove, http://crbug.com/263960
4443 '-Wno-literal-suffix',
4448 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4449 'target_conditions': [
4450 ['_toolset=="host"', {
4453 # See comment for -Wno-c++11-narrowing.
4455 # TODO(thakis): Remove, http://crbug.com/263960
4456 '-Wno-literal-suffix',
4464 # FreeBSD-specific options; note that most FreeBSD options are set above,
4467 'target_defaults': {
4469 '-Wl,--no-keep-memory',
4473 # Android-specific options; note that most are set above with Linux.
4476 # This is a unique identifier for a given build. It's used for
4477 # identifying various build artifacts corresponding to a particular
4478 # build of chrome (e.g. where to find archived symbols).
4479 'chrome_build_id%': '',
4481 # Figure this out early since it needs symbols from libgcc.a, so it
4482 # has to be before that in the set of libraries.
4483 ['component=="shared_library"', {
4484 'android_stlport_library': 'stlport_shared',
4486 'android_stlport_library': 'stlport_static',
4490 # Placing this variable here prevents from forking libvpx, used
4491 # by remoting. Remoting is off, so it needn't built,
4492 # so forking it's deps seems like overkill.
4493 # But this variable need defined to properly run gyp.
4494 # A proper solution is to have an OS==android conditional
4495 # in third_party/libvpx/libvpx.gyp to define it.
4496 'libvpx_path': 'lib/linux/arm',
4498 'target_defaults': {
4500 'release_extra_cflags%': '',
4502 # If we're using the components build, append "cr" to all shared
4503 # libraries to avoid naming collisions with android system library
4504 # versions with the same name (e.g. skia, icu).
4505 ['component=="shared_library"', {
4506 'android_product_extension': 'cr.so',
4508 'android_product_extension': 'so',
4512 'target_conditions': [
4513 ['_type=="shared_library"', {
4514 'product_extension': '<(android_product_extension)',
4517 # Settings for building device targets using Android's toolchain.
4518 # These are based on the setup.mk file from the Android NDK.
4520 # The NDK Android executable link step looks as follows:
4522 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4523 # $(PRIVATE_OBJECTS) <-- The .o that we built
4524 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4525 # $(TARGET_LIBGCC) <-- libgcc.a
4526 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4527 # $(PRIVATE_LDLIBS) <-- System .so
4528 # $(TARGET_CRTEND_O) <-- crtend.o
4530 # For now the above are approximated for executables by adding
4531 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4534 # The NDK Android shared library link step looks as follows:
4536 # $(PRIVATE_OBJECTS) <-- The .o that we built
4537 # -l,--whole-archive
4538 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4539 # -l,--no-whole-archive
4540 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4541 # $(TARGET_LIBGCC) <-- libgcc.a
4542 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4543 # $(PRIVATE_LDLIBS) <-- System .so
4545 # For now, assume that whole static libraries are not needed.
4547 # For both executables and shared libraries, add the proper
4548 # libgcc.a to the start of libraries which puts it in the
4549 # proper spot after .o and .a files get linked in.
4551 # TODO: The proper thing to do longer-tem would be proper gyp
4552 # support for a custom link command line.
4553 ['_toolset=="target"', {
4555 '-pthread', # Not supported by Android toolchain.
4558 '-ffunction-sections',
4561 '-fstack-protector',
4563 '-finline-limit=64',
4564 '-Wa,--noexecstack',
4565 '<@(release_extra_cflags)',
4569 '__GNU_SOURCE=1', # Necessary for clone()
4571 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4572 'CHROME_BUILD_ID="<(chrome_build_id)"',
4575 '-pthread', # Not supported by Android toolchain.
4578 '-Wl,--no-undefined',
4581 ['component=="static_library"', {
4583 '-Wl,--exclude-libs=ALL',
4588 # Work around incompatibilities between bionic and clang
4590 '-D__compiler_offsetof=__builtin_offsetof',
4591 '-Dnan=__builtin_nan',
4594 ['target_arch=="arm"', {
4596 '-target arm-linux-androideabi',
4599 '-target arm-linux-androideabi',
4602 ['target_arch=="ia32"', {
4604 '-target x86-linux-androideabi',
4607 '-target x86-linux-androideabi',
4610 # Place holder for x64 support, not tested.
4611 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4612 ['target_arch=="x64"', {
4614 '-target x86_64-linux-androideabi',
4617 '-target x86_64-linux-androideabi',
4624 # Android build relies on -Wl,--gc-sections removing
4625 # unreachable code. ASan instrumentation for globals inhibits
4626 # this and results in a library with unresolvable relocations.
4627 # TODO(eugenis): find a way to reenable this.
4628 '-mllvm -asan-globals=0',
4631 ['android_webview_build==0', {
4633 # The NDK has these things, but doesn't define the constants
4634 # to say that it does. Define them here instead.
4638 '--sysroot=<(android_ndk_sysroot)',
4641 '--sysroot=<(android_ndk_sysroot)',
4645 '-l<(android_stlport_library)',
4646 # Manually link the libgcc.a that the cross compiler uses.
4647 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4653 ['android_webview_build==1', {
4655 # Android predefines this as 1; undefine it here so Chromium
4656 # can redefine it later to be 2 for chromium code and unset
4657 # for third party code. This works because cflags are added
4659 '-U_FORTIFY_SOURCE',
4660 # Disable any additional warnings enabled by the Android build system but which
4661 # chromium does not build cleanly with (when treating warning as errors).
4662 # Things that are part of -Wextra:
4663 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4664 '-Wno-ignored-qualifiers',
4666 '-Wno-unused-but-set-variable',
4669 # Other things unrelated to -Wextra:
4670 '-Wno-non-virtual-dtor',
4677 ['android_webview_build==1', {
4678 'target_conditions': [
4679 ['chromium_code==0', {
4681 # There is a class of warning which:
4682 # 1) Android always enables and also treats as errors
4683 # 2) Chromium ignores in third party code
4684 # So we re-enable those warnings when building Android.
4686 '-Wno-format-security',
4688 '-Wno-sequence-point',
4691 '-Wno-non-virtual-dtor',
4696 ['target_arch == "arm" and order_profiling==0', {
4698 # Enable identical code folding to reduce size.
4702 # NOTE: The stlport header include paths below are specified in
4703 # cflags rather than include_dirs because they need to come
4704 # after include_dirs. Think of them like system headers, but
4705 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4706 # toolchain (circa Gingerbread) will exhibit strange errors.
4707 # The include ordering here is important; change with caution.
4708 ['android_webview_build==0', {
4710 '-isystem<(android_stlport_include)',
4713 '-L<(android_stlport_libs_dir)',
4715 }, { # else: android_webview_build!=0
4716 'aosp_build_settings': {
4717 # Specify that we want to statically link stlport from the
4718 # NDK. This will provide all the include and library paths
4719 # automatically at build time, and link the right library.
4720 'LOCAL_NDK_STL_VARIANT': 'stlport_static',
4723 ['target_arch=="ia32"', {
4724 # The x86 toolchain currently has problems with stack-protector.
4726 '-fstack-protector',
4729 '-fno-stack-protector',
4733 'target_conditions': [
4734 ['_type=="executable"', {
4735 # Force android tools to export the "main" symbol so they can be
4736 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4737 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4738 # when ICS support will be dropped.
4741 '-fvisibility=default',
4745 '-Wl,--gc-sections',
4746 '-Wl,-z,nocopyreloc',
4749 # crtbegin_dynamic.o should be the last item in ldflags.
4750 '<(android_ndk_lib)/crtbegin_dynamic.o',
4753 # crtend_android.o needs to be the last item in libraries.
4754 # Do not add any libraries after this!
4755 '<(android_ndk_lib)/crtend_android.o',
4758 ['_type=="shared_library" or _type=="loadable_module"', {
4760 '-Wl,--exclude-libs=ALL',
4763 '-Wl,-shared,-Bsymbolic',
4766 ['android_webview_build==0', {
4768 # crtbegin_so.o should be the last item in ldflags.
4769 '<(android_ndk_lib)/crtbegin_so.o',
4772 # crtend_so.o needs to be the last item in libraries.
4773 # Do not add any libraries after this!
4774 '<(android_ndk_lib)/crtend_so.o',
4781 # Settings for building host targets using the system toolchain.
4782 ['_toolset=="host"', {
4784 # Due to issues in Clang build system, using ASan on 32-bit
4785 # binaries on x86_64 host is problematic.
4786 # TODO(eugenis): re-enable.
4787 '-fsanitize=address',
4790 '-fsanitize=address',
4791 '-Wl,-z,noexecstack',
4792 '-Wl,--gc-sections',
4795 '-Wl,--warn-shared-textrel',
4796 '-Wl,--fatal-warnings',
4799 # Settings for building host targets on mac.
4800 ['_toolset=="host" and host_os=="mac"', {
4810 'cflags!': ['-fvisibility=hidden'],
4811 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4813 ['OS=="mac" or OS=="ios"', {
4814 'target_defaults': {
4817 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4818 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4819 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4820 'COPY_PHASE_STRIP': 'NO',
4821 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4822 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4823 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4824 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4825 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4826 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4827 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4828 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4829 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4830 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4831 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4832 'GCC_VERSION': '4.2',
4833 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4834 'USE_HEADERMAP': 'NO',
4839 # Don't warn about unused function parameters.
4840 '-Wno-unused-parameter',
4841 # Don't warn about the "struct foo f = {0};" initialization
4843 '-Wno-missing-field-initializers',
4846 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4847 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4849 # Note that the prebuilt Clang binaries should not be used for iOS
4850 # development except for ASan builds.
4852 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
4853 # Warn if automatic synthesis is triggered with
4854 # the -Wobjc-missing-property-synthesis flag.
4855 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4856 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4858 # This warns on selectors from Cocoa headers (-length, -set).
4859 # cfe-dev is currently discussing the merits of this warning.
4860 # TODO(thakis): Reevaluate what to do with this, based one
4861 # cfe-dev discussion.
4862 '-Wno-selector-type-mismatch',
4865 ['clang_xcode==0', {
4866 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4867 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4871 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4873 '<@(clang_chrome_plugins_flags)',
4876 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4878 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4881 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4883 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4886 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4888 # See http://crbug.com/110262
4889 '-fcolor-diagnostics',
4892 ['OS=="ios" and target_subarch!="arm32" and \
4893 "<(GENERATOR)"=="xcode"', {
4895 # TODO(ios): when building Chrome for iOS on 64-bit platform
4896 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4897 # enabled. This cause failures when compiling protobuf code,
4898 # so disable the warning. http://crbug.com/359107
4899 '-Wno-shorten-64-to-32',
4907 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4913 '-fsanitize=address',
4914 '-mllvm -asan-globals=0', # http://crbug.com/352073
4915 '-gline-tables-only',
4919 ['asan_coverage!=0', {
4920 'target_conditions': [
4921 ['_toolset=="target"', {
4923 '-fsanitize-coverage=<(asan_coverage)',
4929 'target_conditions': [
4930 ['_type!="static_library"', {
4931 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4936 '-fsanitize=address',
4940 ['mac_write_linker_maps==1', {
4943 '-Wl,-map,>(_target_name).map',
4950 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4951 'target_conditions': [
4952 ['_type=="executable"', {
4958 # Define copy_asan_dylib_path in a variable ending in
4959 # _path so that gyp understands it's a path and
4960 # performs proper relativization during dict merging.
4961 'copy_asan_dylib_path':
4962 'mac/copy_asan_runtime_dylib.sh',
4964 'postbuild_name': 'Copy ASan runtime dylib',
4966 '<(copy_asan_dylib_path)',
4975 ], # target_conditions
4976 }, # target_defaults
4977 }], # OS=="mac" or OS=="ios"
4979 'target_defaults': {
4981 # Prevent Mac OS X AssertMacros.h from defining macros that collide
4982 # with common names, like 'check', 'require', and 'verify'.
4983 # (Included by system header. Also exists on iOS but not included.)
4984 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
4985 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
4988 # These should end with %, but there seems to be a bug with % in
4989 # variables that are intended to be set to different values in
4990 # different targets, like these.
4991 'mac_pie': 1, # Most executables can be position-independent.
4992 # Strip debugging symbols from the target.
4993 'mac_strip': '<(mac_strip_release)',
4997 ['mac_want_real_dsym=="default"', {
5000 'mac_real_dsym': '<(mac_want_real_dsym)'
5005 ['mac_want_real_dsym=="default"', {
5006 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5008 'mac_real_dsym': '<(mac_want_real_dsym)'
5015 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5016 # (Equivalent to -fPIC)
5017 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5018 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5019 # Keep pch files below xcodebuild/.
5020 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5022 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5023 # xcode_setting, but not until all downstream projects' mac bots are
5024 # using xcode >= 4.6, because that's when the default value of the
5025 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5026 # setting is a no-op as far as xcode is concerned, but the compiler
5027 # behaves differently based on whether -fno-strict-aliasing is
5029 '-fno-strict-aliasing', # See http://crbug.com/32204.
5032 'target_conditions': [
5033 ['_type=="executable"', {
5036 # Arranges for data (heap) pages to be protected against
5037 # code execution when running on Mac OS X 10.7 ("Lion"), and
5038 # ensures that the position-independent executable (PIE) bit
5039 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5041 # Define change_mach_o_flags in a variable ending in _path
5042 # so that GYP understands it's a path and performs proper
5043 # relativization during dict merging.
5044 'change_mach_o_flags_path':
5045 'mac/change_mach_o_flags_from_xcode.sh',
5046 'change_mach_o_flags_options%': [
5048 'target_conditions': [
5049 ['mac_pie==0 or release_valgrind_build==1', {
5050 # Don't enable PIE if it's unwanted. It's unwanted if
5051 # the target specifies mac_pie=0 or if building for
5052 # Valgrind, because Valgrind doesn't understand slide.
5053 # See the similar mac_pie/release_valgrind_build check
5055 'change_mach_o_flags_options': [
5061 'postbuild_name': 'Change Mach-O Flags',
5063 '<(change_mach_o_flags_path)',
5064 '>@(change_mach_o_flags_options)',
5068 'target_conditions': [
5069 ['mac_pie==1 and release_valgrind_build==0', {
5070 # Turn on position-independence (ASLR) for executables. When
5071 # PIE is on for the Chrome executables, the framework will
5072 # also be subject to ASLR.
5073 # Don't do this when building for Valgrind, because Valgrind
5074 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5075 # understand slide, and get rid of the Valgrind check.
5078 '-Wl,-pie', # Position-independent executable (MH_PIE)
5084 ['(_type=="executable" or _type=="shared_library" or \
5085 _type=="loadable_module") and mac_strip!=0', {
5086 'target_conditions': [
5087 ['mac_real_dsym == 1', {
5088 # To get a real .dSYM bundle produced by dsymutil, set the
5089 # debug information format to dwarf-with-dsym. Since
5090 # strip_from_xcode will not be used, set Xcode to do the
5091 # stripping as well.
5095 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5096 'DEPLOYMENT_POSTPROCESSING': 'YES',
5097 'STRIP_INSTALLED_PRODUCT': 'YES',
5099 # Only strip non-ASan builds.
5101 'target_conditions': [
5102 ['_type=="shared_library" or _type=="loadable_module"', {
5103 # The Xcode default is to strip debugging symbols
5104 # only (-S). Local symbols should be stripped as
5105 # well, which will be handled by -x. Xcode will
5106 # continue to insert -S when stripping even when
5107 # additional flags are added with STRIPFLAGS.
5109 }], # _type=="shared_library" or _type=="loadable_module"
5110 ], # target_conditions
5116 }, # configuration "Release"
5118 }, { # mac_real_dsym != 1
5119 # To get a fast fake .dSYM bundle, use a post-build step to
5120 # produce the .dSYM and strip the executable. strip_from_xcode
5121 # only operates in the Release configuration.
5125 # Define strip_from_xcode in a variable ending in _path
5126 # so that gyp understands it's a path and performs proper
5127 # relativization during dict merging.
5128 'strip_from_xcode_path': 'mac/strip_from_xcode',
5130 'postbuild_name': 'Strip If Needed',
5131 'action': ['<(strip_from_xcode_path)'],
5135 ], # target_conditions
5136 }], # (_type=="executable" or _type=="shared_library" or
5137 # _type=="loadable_module") and mac_strip!=0
5138 ], # target_conditions
5139 }, # target_defaults
5142 'target_defaults': {
5143 'xcode_settings' : {
5144 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5147 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5148 # additional flag to suppress the "unknown compiler option" error.
5149 # Restrict this flag to builds that are either compiling with Xcode
5150 # or compiling with Xcode's Clang. This will allow Ninja builds to
5151 # continue failing on unknown compiler options.
5152 # TODO(rohitrao): This flag is temporary and should be removed as
5153 # soon as the iOS bots are updated to use Xcode 5.1.
5154 ['clang_xcode==1', {
5156 '-Wno-unknown-warning-option',
5160 # Limit the valid architectures depending on "target_subarch".
5161 # This need to include the "arm" architectures but also the "x86"
5162 # ones (they are used when building for the simulator).
5163 ['target_subarch=="arm32"', {
5164 'VALID_ARCHS': ['armv7', 'i386'],
5166 ['target_subarch=="arm64"', {
5167 'VALID_ARCHS': ['arm64', 'x86_64'],
5169 ['target_subarch=="both"', {
5170 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5172 ['use_system_libcxx==1', {
5173 'target_conditions': [
5174 # Only use libc++ when building target for iOS not when building
5175 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5176 # does not support libc++.
5177 ['_toolset=="target"', {
5178 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5182 # The default for deployment target of 7.0+ is libc++, so force
5183 # the old behavior unless libc++ is enabled.
5184 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5188 'target_conditions': [
5189 ['_toolset=="host"', {
5191 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5192 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5201 ['_toolset=="target"', {
5203 # This section should be for overriding host settings. But,
5204 # since we can't negate the iphone deployment target above, we
5205 # instead set it here for target only.
5206 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5207 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5210 ['_type=="executable"', {
5214 'DEPLOYMENT_POSTPROCESSING': 'YES',
5215 'STRIP_INSTALLED_PRODUCT': 'YES',
5220 # Remove dSYM to reduce build time.
5221 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5227 ['chromium_ios_signing', {
5228 # iOS SDK wants everything for device signed.
5229 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5231 'CODE_SIGNING_REQUIRED': 'NO',
5232 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5237 ], # target_conditions
5238 }, # target_defaults
5241 'target_defaults': {
5243 '_WIN32_WINNT=0x0603',
5250 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5251 'WIN32_LEAN_AND_MEAN',
5254 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5255 '_HAS_EXCEPTIONS=0',
5256 # Silence some warnings; we can't switch the the 'recommended'
5257 # versions as they're not available on old OSs.
5258 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5261 ['buildtype=="Official"', {
5262 # In official builds, targets can self-select an optimization
5263 # level by defining a variable named 'optimize', and setting it
5265 # - "size", optimizes for minimal code size - the default.
5266 # - "speed", optimizes for speed over code size.
5267 # - "max", whole program optimization and link-time code
5268 # generation. This is very expensive and should be used
5271 'optimize%': 'size',
5275 # Set /LTCG for the official builds.
5276 'LinkTimeCodeGeneration': '1',
5277 'AdditionalOptions': [
5278 # Set the number of LTCG code-gen threads to eight.
5279 # The default is four. This gives a 5-10% link speedup.
5284 'target_conditions': [
5285 ['optimize=="size"', {
5287 'VCCLCompilerTool': {
5288 # 1, optimizeMinSpace, Minimize Size (/O1)
5289 'Optimization': '1',
5290 # 2, favorSize - Favor small code (/Os)
5291 'FavorSizeOrSpeed': '2',
5296 ['optimize=="speed"', {
5298 'VCCLCompilerTool': {
5299 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5300 'Optimization': '2',
5301 # 1, favorSpeed - Favor fast code (/Ot)
5302 'FavorSizeOrSpeed': '1',
5307 ['optimize=="max"', {
5308 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5309 # builds. Probably anything that this would catch that
5310 # wouldn't be caught in a normal build isn't going to
5311 # actually be a bug, so the incremental value of C4702 for
5312 # PGO builds is likely very small.
5313 'msvs_disabled_warnings': [
5317 'VCCLCompilerTool': {
5318 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5319 'Optimization': '2',
5320 # 1, favorSpeed - Favor fast code (/Ot)
5321 'FavorSizeOrSpeed': '1',
5322 # This implies link time code generation.
5323 'WholeProgramOptimization': 'true',
5331 ['msvs_xtree_patched!=1', {
5332 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5333 # it's enabled. This will generally only be true for system-level
5334 # installed Express users.
5335 'msvs_disabled_warnings': [
5340 'msvs_system_include_dirs': [
5341 '<(windows_sdk_path)/Include/shared',
5342 '<(windows_sdk_path)/Include/um',
5343 '<(windows_sdk_path)/Include/winrt',
5344 '$(VSInstallDir)/VC/atlmfc/include',
5346 'msvs_cygwin_shell': 0,
5347 'msvs_disabled_warnings': [
5348 # C4127: conditional expression is constant
5349 # This warning can in theory catch dead code and other problems, but
5350 # triggers in far too many desirable cases where the conditional
5351 # expression is either set by macros or corresponds some legitimate
5352 # compile-time constant expression (due to constant template args,
5353 # conditionals comparing the sizes of different types, etc.). Some of
5354 # these can be worked around, but it's not worth it.
5357 # C4351: new behavior: elements of array 'array' will be default
5359 # This is a silly "warning" that basically just alerts you that the
5360 # compiler is going to actually follow the language spec like it's
5361 # supposed to, instead of not following it like old buggy versions
5362 # did. There's absolutely no reason to turn this on.
5365 # C4355: 'this': used in base member initializer list
5366 # It's commonly useful to pass |this| to objects in a class'
5367 # initializer list. While this warning can catch real bugs, most of
5368 # the time the constructors in question don't attempt to call methods
5369 # on the passed-in pointer (until later), and annotating every legit
5370 # usage of this is simply more hassle than the warning is worth.
5373 # C4503: 'identifier': decorated name length exceeded, name was
5375 # This only means that some long error messages might have truncated
5376 # identifiers in the presence of lots of templates. It has no effect
5377 # on program correctness and there's no real reason to waste time
5378 # trying to prevent it.
5381 # C4611: interaction between 'function' and C++ object destruction is
5383 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5384 # suggests using exceptions instead of setjmp/longjmp for C++, but
5385 # Chromium code compiles without exception support. We therefore have
5386 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5387 # means we have to turn off this warning (and be careful about how
5388 # object destruction happens in such cases).
5391 # TODO(maruel): These warnings are level 4. They will be slowly
5392 # removed as code is fixed.
5393 4100, # Unreferenced formal parameter
5394 4121, # Alignment of a member was sensitive to packing
5395 4244, # Conversion from 'type1' to 'type2', possible loss of data
5396 4481, # Nonstandard extension used: override specifier 'keyword'
5397 4505, # Unreferenced local function has been removed
5398 4510, # Default constructor could not be generated
5399 4512, # Assignment operator could not be generated
5400 4610, # Object can never be instantiated
5401 4996, # 'X': was declared deprecated (for GetVersionEx).
5404 'VCCLCompilerTool': {
5405 'AdditionalOptions': ['/MP'],
5406 'MinimalRebuild': 'false',
5407 'BufferSecurityCheck': 'true',
5408 'EnableFunctionLevelLinking': 'true',
5409 'RuntimeTypeInfo': 'false',
5410 'WarningLevel': '4',
5411 'WarnAsError': 'true',
5412 'DebugInformationFormat': '3',
5413 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5414 'ExceptionHandling': '0',
5416 'VCLibrarianTool': {
5417 'AdditionalOptions': ['/ignore:4221'],
5418 'AdditionalLibraryDirectories': [
5419 '<(windows_sdk_path)/Lib/win8/um/x86',
5423 'AdditionalDependencies': [
5435 'AdditionalLibraryDirectories': [
5436 '<(windows_sdk_path)/Lib/win8/um/x86',
5438 'GenerateDebugInformation': 'true',
5439 'MapFileName': '$(OutDir)\\$(TargetName).map',
5440 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5441 'FixedBaseAddress': '1',
5444 # 1 == /SUBSYSTEM:CONSOLE
5445 # 2 == /SUBSYSTEM:WINDOWS
5446 # Most of the executables we'll ever create are tests
5447 # and utilities with console output.
5451 'GenerateStublessProxies': 'true',
5452 'TypeLibraryName': '$(InputName).tlb',
5453 'OutputDirectory': '$(IntDir)',
5454 'HeaderFileName': '$(InputName).h',
5455 'DLLDataFileName': '$(InputName).dlldata.c',
5456 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5457 'ProxyFileName': '$(InputName)_p.c',
5459 'VCResourceCompilerTool': {
5461 'AdditionalIncludeDirectories': [
5463 '<(SHARED_INTERMEDIATE_DIR)',
5466 'target_conditions': [
5467 ['_type=="executable"', {
5469 'EmbedManifest': 'true',
5472 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5474 'AdditionalManifestFiles': [
5475 '>(win_exe_compatibility_manifest)',
5482 # Building with Clang on Windows is a work in progress and very
5483 # experimental. See crbug.com/82385.
5484 'VCCLCompilerTool': {
5485 'WarnAsError': 'false',
5486 'RuntimeTypeInfo': 'false',
5487 'AdditionalOptions': [
5488 '-fmsc-version=1800',
5491 # Many files use intrinsics without including this header.
5492 # TODO(hans): Fix those files, or move this to sub-GYPs.
5495 # TODO(hans): Make this list shorter eventually.
5496 '-Qunused-arguments',
5497 '-Wno-c++11-compat-deprecated-writable-strings',
5498 '-Wno-deprecated-declarations',
5500 '-Wno-enum-conversion',
5501 '-Wno-extra-tokens',
5502 '-Wno-ignored-attributes',
5503 '-Wno-incompatible-pointer-types',
5504 '-Wno-int-to-void-pointer-cast',
5505 '-Wno-invalid-noreturn',
5506 '-Wno-logical-op-parentheses',
5508 '-Wno-missing-braces',
5509 '-Wno-missing-declarations',
5510 '-Wno-msvc-include',
5511 '-Wno-null-dereference',
5512 '-Wno-overloaded-virtual',
5514 '-Wno-pointer-sign',
5516 '-Wno-return-type-c-linkage',
5518 '-Wno-sometimes-uninitialized',
5520 '-Wno-tautological-compare',
5521 '-Wno-unknown-pragmas',
5523 '-Wno-unused-function',
5524 '-Wno-unused-private-field',
5525 '-Wno-unused-value',
5526 '-Wno-unused-variable',
5527 '-Wno-unused-local-typedef', # http://crbug.com/411648
5528 '-Wno-inconsistent-missing-override', #http://crbug.com/428099
5533 # ASan on Windows is a work in progress and very experimental.
5534 # See crbug.com/345874.
5535 'VCCLCompilerTool': {
5536 'AdditionalOptions': [
5537 '-fsanitize=address',
5539 'AdditionalIncludeDirectories': [
5540 # MSVC needs to be able to find the sanitizer headers when
5541 # invoked via /fallback. This is critical for using macros
5542 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5544 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/include_sanitizer',
5548 'AdditionalLibraryDirectories': [
5549 # TODO(hans): If make_clang_dir is absolute, this breaks.
5550 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/lib/windows',
5553 'target_conditions': [
5554 ['component=="shared_library"', {
5556 'AdditionalDependencies': [
5557 'clang_rt.asan_dynamic-i386.lib',
5558 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5562 ['_type=="executable" and component=="static_library"', {
5564 'AdditionalDependencies': [
5565 'clang_rt.asan-i386.lib',
5569 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5571 'AdditionalDependencies': [
5572 'clang_rt.asan_dll_thunk-i386.lib',
5582 ['disable_nacl==1', {
5583 'target_defaults': {
5589 ['OS=="win" and msvs_use_common_linker_extras', {
5590 'target_defaults': {
5605 'AdditionalOptions': [
5614 'AdditionalOptions': ['/largeaddressaware'],
5623 'AdditionalOptions': [
5624 # safeseh is not compatible with x64
5636 ['enable_new_npdevice_api==1', {
5637 'target_defaults': {
5639 'ENABLE_NEW_NPDEVICE_API',
5643 # Don't warn about the "typedef 'foo' locally defined but not used"
5644 # for gcc 4.8 and higher.
5645 # TODO: remove this flag once all builds work. See crbug.com/227506
5646 ['gcc_version>=48 and clang==0', {
5647 'target_defaults': {
5649 '-Wno-unused-local-typedefs',
5653 ['gcc_version>=48 and clang==0 and host_clang==1', {
5654 'target_defaults': {
5655 'target_conditions': [
5656 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5660 # In the android webview build, force host targets to be compiled with clang
5661 # as the hermetic host gcc is very old on some platforms. This is already
5662 # the default on the current development version of AOSP but we force it
5663 # here in case we need to compile against an older release version. We also
5664 # explicitly set it to false for target binaries to avoid causing problems
5665 # for the work to enable clang by default in AOSP. We also force the use of
5666 # libstdc++ on host as peculiarities of the android gyp backend mean that
5667 # using libc++ doesn't work, and Chromium doesn't yet require a more modern
5669 ['android_webview_build==1', {
5670 'target_defaults': {
5671 'target_conditions': [
5672 ['_toolset=="host"', {
5673 'aosp_build_settings': {
5674 'LOCAL_CLANG': 'true',
5675 'LOCAL_CXX_STL': 'libstdc++',
5677 }, { # else: _toolset != "host"
5678 'aosp_build_settings': {
5679 'LOCAL_CLANG': 'false',
5685 # We need a special case to handle the android webview build on mac because
5686 # the host gcc there doesn't accept this flag, but the target gcc may
5688 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5689 'target_defaults': {
5690 'target_conditions': [
5691 ['_toolset=="host"', {
5693 '-Wno-unused-local-typedefs',
5699 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5701 'make_global_settings': [
5702 ['CC', '<(make_clang_dir)/bin/clang'],
5703 ['CXX', '<(make_clang_dir)/bin/clang++'],
5704 ['CC.host', '$(CC)'],
5705 ['CXX.host', '$(CXX)'],
5708 ['clang==1 and OS=="win"', {
5709 'make_global_settings': [
5710 # On Windows, gyp's ninja generator only looks at CC.
5711 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5714 ['use_lld==1 and OS=="win"', {
5715 'make_global_settings': [
5716 # Limited to Windows because lld-link is the driver that is compatible
5718 ['LD', '<(make_clang_dir)/bin/lld-link'],
5721 ['OS=="android" and clang==0', {
5722 # Hardcode the compiler names in the Makefile so that
5723 # it won't depend on the environment at make time.
5724 'make_global_settings': [
5725 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5726 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5727 ['CC.host', '<(host_cc)'],
5728 ['CXX.host', '<(host_cxx)'],
5731 ['OS=="linux" and target_arch=="mipsel"', {
5732 'make_global_settings': [
5733 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5734 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5735 ['CC.host', '<(host_cc)'],
5736 ['CXX.host', '<(host_cxx)'],
5739 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5740 # Set default ARM cross compiling on linux. These can be overridden
5741 # using CC/CXX/etc environment variables.
5742 'make_global_settings': [
5743 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5744 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5745 ['CC.host', '<(host_cc)'],
5746 ['CXX.host', '<(host_cxx)'],
5750 # TODO(yyanagisawa): supports GENERATOR==make
5751 # make generator doesn't support CC_wrapper without CC
5752 # in make_global_settings yet.
5753 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5754 'make_global_settings': [
5755 ['CC_wrapper', '<(gomadir)/gomacc'],
5756 ['CXX_wrapper', '<(gomadir)/gomacc'],
5757 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5758 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5762 'target_defaults': {
5763 'target_conditions': [
5764 ['_toolset=="target"', {
5767 '-ffat-lto-objects',
5773 ['use_lto==1 or use_lto_o2==1', {
5774 'target_defaults': {
5775 'target_conditions': [
5776 ['_toolset=="target"', {
5786 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5787 # This block adds *project-wide* configuration settings to each project
5788 # file. It's almost always wrong to put things here. Specify your
5789 # custom xcode_settings in target_defaults to add them to targets instead.
5792 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5793 # setting sets the SDK on a project-wide basis. In order to get the
5794 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5795 # here at the project level.
5798 ['mac_sdk_path==""', {
5799 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5801 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5807 ['ios_sdk_path==""', {
5809 # TODO(justincohen): Ninja only supports simulator for now.
5810 ['"<(GENERATOR)"=="xcode"', {
5811 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5813 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5817 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5822 # Target both iPhone and iPad.
5823 'TARGETED_DEVICE_FAMILY': '1,2',
5826 ['target_arch=="x64"', {
5831 ['target_arch=="ia32"', {
5840 # The Xcode generator will look for an xcode_settings section at the root
5841 # of each dict and use it to apply settings on a file-wide basis. Most
5842 # settings should not be here, they should be in target-specific
5843 # xcode_settings sections, or better yet, should use non-Xcode-specific
5844 # settings in target dicts. SYMROOT is a special case, because many other
5845 # Xcode variables depend on it, including variables such as
5846 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5847 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5848 # files to appear (when present) in the UI as actual files and not red
5849 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5850 # and therefore SYMROOT, needs to be set at the project level.
5851 'SYMROOT': '<(DEPTH)/xcodebuild',