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=="mac" 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.
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 # 1: Medium tables, medium accuracy
509 # 2: Large tables, high accuracy
510 'cld2_table_size%': 2,
512 # The data acquisition mode for CLD2. Possible values are:
513 # static: CLD2 data is statically linked to the executable.
514 # standalone: CLD2 data is provided in a standalone file that is
515 # bundled with the executable.
516 # component: CLD2 data is provided as a Chrome "component" and is
517 # downloaded via the component updater.
519 # For more information on switching the CLD2 data source, see:
520 # https://sites.google.com/a/chromium.org/dev/developers/how-tos/compact-language-detector-cld-data-source-configuration
522 # This string will be exposed in chrome://translate-internals under the
523 # heading "CLD Data Source". This allows easy determination of which
524 # data source the browser was built with.
525 'cld2_data_source%': 'static',
527 # Enable spell checker.
528 'enable_spellcheck%': 1,
530 # Webrtc compilation is enabled by default. Set to 0 to disable.
533 # Enables use of the session service, which is enabled by default.
534 # Support for disabling depends on the platform.
535 'enable_session_service%': 1,
537 # Enables theme support, which is enabled by default. Support for
538 # disabling depends on the platform.
541 # Enables autofill dialog and associated features; disabled by default.
542 'enable_autofill_dialog%' : 0,
544 # Defaults Wallet integration in Autofill dialog to use production
545 # servers. Unofficial builds won't have the proper API keys.
546 'enable_prod_wallet_service%': 0,
548 # Enables support for background apps.
549 'enable_background%': 1,
551 # Enable the task manager by default.
552 'enable_task_manager%': 1,
554 # Enables used resource whitelist generation; disabled by default.
555 'enable_resource_whitelist_generation%': 0,
557 # Enable FILE support by default.
558 'disable_file_support%': 0,
560 # Enable FTP support by default.
561 'disable_ftp_support%': 0,
563 # Use native android functions in place of ICU. Not supported by most
565 'use_icu_alternatives_on_android%': 0,
567 # XInput2 multitouch support is enabled by default (use_xi2_mt=2).
568 # Setting to zero value disables XI2 MT. When XI2 MT is enabled,
569 # the input value also defines the required XI2 minor minimum version.
570 # For example, use_xi2_mt=2 means XI2.2 or above version is required.
573 # Use of precompiled headers on Windows.
575 # This variable may be explicitly set to 1 (enabled) or 0
576 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
577 # This setting will override the default.
580 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
582 'chromium_win_pch%': 0,
585 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
586 # Set this to true when building with Clang.
587 # See http://code.google.com/p/chromium/wiki/Clang for details.
588 # If this is set, clang is used as both host and target compiler in
589 # cross-compile builds.
592 # Enable plug-in installation by default.
593 'enable_plugin_installation%': 1,
595 # Specifies whether to use canvas_skia.cc in place of platform
596 # specific implementations of gfx::Canvas. Affects text drawing in the
598 # TODO(asvitkine): Enable this on all platforms and delete this flag.
599 # http://crbug.com/105550
600 'use_canvas_skia%': 0,
602 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
603 # with one of those tools.
604 'build_for_tool%': '',
606 # If no directory is specified then a temporary directory will be used.
607 'test_isolation_outdir%': '',
608 # True if isolate should fail if the isolate files refer to files
610 'test_isolation_fail_on_missing': 1,
612 'wix_path%': '<(DEPTH)/third_party/wix',
614 # Managed users are enabled by default.
615 'enable_managed_users%': 1,
617 # Platform natively supports discardable memory.
618 'native_discardable_memory%': 0,
620 # Platform sends memory pressure signals natively.
621 'native_memory_pressure_signals%': 0,
623 'spdy_proxy_auth_property%' : '',
624 'spdy_proxy_auth_value%' : '',
626 'enable_service_discovery%': 0,
627 'enable_wifi_bootstrapping%': 0,
628 'enable_hangout_services_extension%': 0,
630 # Enable the Syzygy optimization step.
631 'syzygy_optimize%': 0,
633 # Enable hole punching for the protected video.
636 # Temporary hack to allow us to unify blink's definitions of load
637 # completion. blink uses a crazy set of constraints to determine load
638 # completion, but only actually requires them for layout tests. However,
639 # we need to maintain all the old behaviors while the plumbing is put in
640 # place on both sides of the repo boundary.
641 'enable_load_completion_hacks%': 1,
643 # Automatically select platforms under ozone. Turn this off to
644 # build only explicitly selected platforms.
645 'ozone_auto_platforms%': 1,
647 # If this is set clang is used as host compiler, but not as target
648 # compiler. Always do this by default.
651 # Variables to control Link-Time Optimizations (LTO).
652 # Note: the variables must *not* be enabled at the same time.
653 # In this case LTO would 'merge' the optimization flags
654 # at link-time which would lead to all code be optimized with -O2.
655 # Enable LTO on the code compiled with -Os.
656 # See crbug.com/407544
658 # Enable LTO on code compiled with -O2.
662 # A flag for POSIX platforms
669 # A flag for BSD platforms
670 ['OS=="freebsd" or OS=="openbsd"', {
677 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
683 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
684 # OpenSSL's certificate definition.
685 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
686 'use_openssl_certs%': 1,
688 'use_openssl_certs%': 0,
691 # libudev usage. This currently only affects the content layer.
692 ['OS=="linux" and embedded==0', {
698 # Flags to use X11 on non-Mac POSIX platforms.
699 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
706 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
712 # Flags to use pango and cairo.
713 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
722 ['OS=="linux" and embedded==0', {
728 # We always use skia text rendering in Aura on Windows, since GDI
729 # doesn't agree with our BackingStore.
730 # TODO(beng): remove once skia text rendering is on by default.
731 ['use_aura==1 and OS=="win"', {
732 'enable_skia_text%': 1,
735 # A flag to enable or disable our compile-time dependency
736 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
737 # support will be available. This option is useful
738 # for Linux distributions and for Aura.
739 ['OS!="linux" or chromeos==1', {
740 'use_gnome_keyring%': 0,
742 'use_gnome_keyring%': 1,
745 ['OS=="mac" or OS=="ios"', {
746 # Mac and iOS want Title Case strings
747 'use_titlecase_in_grd%': 1,
750 # Enable loader extensions on Chrome OS.
752 'image_loader_extension%': 1,
754 'image_loader_extension%': 0,
757 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
758 'enable_one_click_signin%': 1,
759 'enable_pre_sync_backup%': 1,
763 'enable_extensions%': 0,
764 'enable_google_now%': 0,
766 'enable_spellcheck%': 0,
770 'arm_neon_optional%': 1,
771 'native_discardable_memory%': 1,
772 'native_memory_pressure_signals%': 1,
773 'enable_basic_printing%': 1,
774 'enable_print_preview%': 0,
775 'enable_task_manager%':0,
779 # Android OS includes support for proprietary codecs regardless of
780 # building Chromium or Google Chrome. We also ship Google Chrome and
781 # Chromecast with proprietary codecs.
782 ['OS=="android" or branding=="Chrome" or chromecast==1', {
783 'proprietary_codecs%': 1,
785 'proprietary_codecs%': 0,
788 ['OS=="mac" or OS=="ios"', {
789 'native_discardable_memory%': 1,
790 'native_memory_pressure_signals%': 1,
793 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
794 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
795 'enable_autofill_dialog%': 1,
798 ['buildtype=="Official"', {
799 'enable_prod_wallet_service%': 1,
809 'disable_ftp_support%': 1,
810 'enable_extensions%': 0,
811 'enable_google_now%': 0,
813 'enable_basic_printing%': 0,
814 'enable_print_preview%': 0,
815 'enable_session_service%': 0,
816 'enable_spellcheck%': 0,
822 'enable_managed_users%': 0,
823 'enable_task_manager%': 0,
824 'use_system_libcxx%': 1,
825 'support_pre_M6_history_database%': 0,
828 # Use GPU accelerated cross process image transport by default
829 # on linux builds with the Aura window manager
830 ['use_aura==1 and OS=="linux"', {
831 'ui_compositor_image_transport%': 1,
833 'ui_compositor_image_transport%': 0,
836 # Turn precompiled headers on by default.
837 ['OS=="win" and buildtype!="Official"', {
838 'chromium_win_pch%': 1
841 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
842 'enable_plugin_installation%': 0,
844 'enable_plugin_installation%': 1,
847 # Whether PPAPI is enabled.
848 ['OS=="android" or OS=="ios" or embedded==1', {
849 'enable_plugins%': 0,
851 'enable_plugins%': 1,
854 # linux_use_bundled_gold: whether to use the gold linker binary checked
855 # into third_party/binutils. Force this off via GYP_DEFINES when you
856 # are using a custom toolchain and need to control -B in ldflags.
857 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
858 # for component=static_library builds.
859 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
860 'linux_use_bundled_gold%': 1,
862 'linux_use_bundled_gold%': 0,
865 # linux_use_bundled_binutils: whether to use the binary binutils
866 # checked into third_party/binutils. These are not multi-arch so cannot
867 # be used except on x86 and x86-64 (the only two architectures which
868 # are currently checke in). Force this off via GYP_DEFINES when you
869 # are using a custom toolchain and need to control -B in cflags.
870 ['OS=="linux" and (target_arch=="x64")', {
871 'linux_use_bundled_binutils%': 1,
873 'linux_use_bundled_binutils%': 0,
876 # linux_use_gold_flags: whether to use build flags that rely on gold.
877 # On by default for x64 Linux.
878 ['OS=="linux" and target_arch=="x64"', {
879 'linux_use_gold_flags%': 1,
881 'linux_use_gold_flags%': 0,
884 # linux_use_debug_fission: whether to use split DWARF debug info
885 # files. This can reduce link time significantly, but is incompatible
886 # with some utilities such as icecc and ccache. Requires gold and
887 # gcc >= 4.8 or clang.
888 # http://gcc.gnu.org/wiki/DebugFission
889 ['OS=="linux" and target_arch=="x64"', {
890 'linux_use_debug_fission%': 1,
892 'linux_use_debug_fission%': 0,
895 ['OS=="android" or OS=="ios"', {
896 'enable_captive_portal_detection%': 0,
898 'enable_captive_portal_detection%': 1,
901 # Enable Skia UI text drawing incrementally on different platforms.
902 # http://crbug.com/105550
904 # On Aura, this allows per-tile painting to be used in the browser
907 'use_canvas_skia%': 1,
911 'enable_basic_printing%': 0,
912 'enable_print_preview%': 1,
913 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
914 'use_libjpeg_turbo%': 0,
917 # Do not enable the Settings App on ChromeOS.
918 ['enable_app_list==1 and chromeos==0', {
919 'enable_settings_app%': 1,
921 'enable_settings_app%': 0,
924 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
925 # Set some defaults for arm/linux chrome builds
926 'use_allocator%': 'none',
927 # sysroot needs to be an absolute path otherwise it generates
928 # incorrect results when passed to pkg-config
929 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot',
930 }], # OS=="linux" and target_arch=="arm" and chromeos==0
932 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
934 ['target_arch=="x64"', {
935 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
937 ['target_arch=="ia32"', {
938 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
941 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
943 ['OS=="linux" and target_arch=="mipsel"', {
944 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
945 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
948 # Whether tests targets should be run, archived or just have the
949 # dependencies verified. All the tests targets have the '_run' suffix,
950 # e.g. base_unittests_run runs the target base_unittests. The test
951 # target always calls tools/swarming_client/isolate.py. See the script's
952 # --help for more information. Meant to be overriden with GYP_DEFINES.
953 # TODO(maruel): Remove the conditions as more configurations are
955 ['OS!="ios" and OS!="android" and chromeos==0', {
956 'test_isolation_mode%': 'check',
958 'test_isolation_mode%': 'noop',
960 # Whether Android build uses OpenMAX DL FFT.
961 ['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")', {
962 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
963 # When enabled, this will also enable WebAudio support on
964 # Android for these architectures. Default is enabled. Whether
965 # WebAudio is actually available depends on runtime settings
967 'use_openmax_dl_fft%': 1,
969 'use_openmax_dl_fft%': 0,
971 ['OS=="win" or OS=="linux"', {
975 # Turns on compiler optimizations in V8 in Debug build, except
976 # on android_clang, where we're hitting a weird linker error.
977 # TODO(dpranke): http://crbug.com/266155 .
979 'v8_optimized_debug%': 1,
981 'v8_optimized_debug%': 2,
984 # Disable various features by default on embedded.
987 'enable_basic_printing%': 0,
988 'enable_print_preview%': 0,
991 # By default, use ICU data file (icudtl.dat) on all platforms
992 # except when building Android WebView or Chromecast.
993 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
994 # Set the data reduction proxy origin for Android Webview.
995 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0', {
996 'icu_use_data_file_flag%' : 1,
998 'icu_use_data_file_flag%' : 0,
1000 ['OS=="win" or OS=="mac"', {
1001 'enable_wifi_bootstrapping%' : 1,
1004 # Path to sas.dll, which provides the SendSAS function.
1005 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1006 ['target_arch=="x64"', {
1007 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1009 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1012 # Turn on JNI generation optimizations on non-WebView builds.
1013 ['OS=="android" and android_webview_build==0', {
1014 'optimize_jni_generation%': 1,
1016 'optimize_jni_generation%': 0,
1019 # TODO(baixo): Enable v8_use_external_startup_data
1020 # http://crbug.com/421063
1021 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0', {
1022 'v8_use_external_startup_data': 0,
1024 'v8_use_external_startup_data': 0,
1028 # Set this to 1 to enable use of concatenated impulse responses
1029 # for the HRTF panner in WebAudio.
1030 'use_concatenated_impulse_responses': 1,
1032 # You can set the variable 'use_official_google_api_keys' to 1
1033 # to use the Google-internal file containing official API keys
1034 # for Google Chrome even in a developer build. Setting this
1035 # variable explicitly to 1 will cause your build to fail if the
1036 # internal file is missing.
1038 # The variable is documented here, but not handled in this file;
1039 # see //google_apis/determine_use_official_keys.gypi for the
1042 # Set the variable to 0 to not use the internal file, even when
1043 # it exists in your checkout.
1045 # Leave it unset in your include.gypi to have the variable
1046 # implicitly set to 1 if you have
1047 # src/google_apis/internal/google_chrome_api_keys.h in your
1048 # checkout, and implicitly set to 0 if not.
1050 # Note that official builds always behave as if the variable
1051 # was explicitly set to 1, i.e. they always use official keys,
1052 # and will fail to build if the internal file is missing.
1054 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1055 # include.gypi or by other means. Due to subtleties of GYP, this
1056 # is not the same as leaving the variable unset, even though its
1058 # //google_apis/determine_use_official_keys.gypi is 2.
1060 # Set these to bake the specified API keys and OAuth client
1061 # IDs/secrets into your build.
1063 # If you create a build without values baked in, you can instead
1064 # set environment variables to provide the keys at runtime (see
1065 # src/google_apis/google_api_keys.h for details). Features that
1066 # require server-side APIs may fail to work if no keys are
1069 # Note that if you are building an official build or if
1070 # use_official_google_api_keys has been set to 1 (explicitly or
1071 # implicitly), these values will be ignored and the official
1072 # keys will be used instead.
1073 'google_api_key%': '',
1074 'google_default_client_id%': '',
1075 'google_default_client_secret%': '',
1076 # Native Client is enabled by default.
1077 'disable_nacl%': '0',
1079 # Set to 1 to support old history files
1080 'support_pre_M6_history_database%': '1',
1083 # Copy conditionally-set variables out one scope.
1084 'branding%': '<(branding)',
1085 'buildtype%': '<(buildtype)',
1086 'target_arch%': '<(target_arch)',
1087 'target_subarch%': '<(target_subarch)',
1088 'mips_arch_variant%': '<(mips_arch_variant)',
1089 'host_arch%': '<(host_arch)',
1090 'toolkit_views%': '<(toolkit_views)',
1091 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1092 'use_aura%': '<(use_aura)',
1093 'use_ash%': '<(use_ash)',
1094 'use_cras%': '<(use_cras)',
1095 'use_libpci%': '<(use_libpci)',
1096 'use_openssl%': '<(use_openssl)',
1097 'use_openssl_certs%': '<(use_openssl_certs)',
1098 'use_nss%': '<(use_nss)',
1099 'use_udev%': '<(use_udev)',
1100 'os_bsd%': '<(os_bsd)',
1101 'os_posix%': '<(os_posix)',
1102 'use_dbus%': '<(use_dbus)',
1103 'use_glib%': '<(use_glib)',
1104 'use_pango%': '<(use_pango)',
1105 'use_cairo%': '<(use_cairo)',
1106 'use_ozone%': '<(use_ozone)',
1107 'use_ozone_evdev%': '<(use_ozone_evdev)',
1108 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1109 'desktop_linux%': '<(desktop_linux)',
1110 'use_x11%': '<(use_x11)',
1111 'use_gnome_keyring%': '<(use_gnome_keyring)',
1112 'linux_fpic%': '<(linux_fpic)',
1113 'chromeos%': '<(chromeos)',
1114 'chromecast%': '<(chromecast)',
1115 'enable_viewport%': '<(enable_viewport)',
1116 'enable_hidpi%': '<(enable_hidpi)',
1117 'use_xi2_mt%':'<(use_xi2_mt)',
1118 'image_loader_extension%': '<(image_loader_extension)',
1119 'fastbuild%': '<(fastbuild)',
1120 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1121 'win_z7%': '<(win_z7)',
1122 'dcheck_always_on%': '<(dcheck_always_on)',
1123 'tracing_like_official_build%': '<(tracing_like_official_build)',
1124 'arm_version%': '<(arm_version)',
1125 'arm_neon%': '<(arm_neon)',
1126 'arm_neon_optional%': '<(arm_neon_optional)',
1127 'sysroot%': '<(sysroot)',
1128 'chroot_cmd%': '<(chroot_cmd)',
1129 'system_libdir%': '<(system_libdir)',
1130 'component%': '<(component)',
1131 'win_analyze%': '<(win_analyze)',
1132 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1133 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1134 'use_third_party_translations%': '<(use_third_party_translations)',
1135 'remoting%': '<(remoting)',
1136 'enable_one_click_signin%': '<(enable_one_click_signin)',
1137 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1138 'enable_webrtc%': '<(enable_webrtc)',
1139 'chromium_win_pch%': '<(chromium_win_pch)',
1140 'configuration_policy%': '<(configuration_policy)',
1141 'safe_browsing%': '<(safe_browsing)',
1142 'enable_web_speech%': '<(enable_web_speech)',
1143 'notifications%': '<(notifications)',
1144 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1145 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1147 'asan_blacklist%': '<(asan_blacklist)',
1148 'asan_coverage%': '<(asan_coverage)',
1149 'asan_field_padding%': '<(asan_field_padding)',
1150 'use_sanitizer_options%': '<(use_sanitizer_options)',
1151 'syzyasan%': '<(syzyasan)',
1152 'syzygy_optimize%': '<(syzygy_optimize)',
1155 'msan_blacklist%': '<(msan_blacklist)',
1156 'msan_track_origins%': '<(msan_track_origins)',
1158 'tsan_blacklist%': '<(tsan_blacklist)',
1159 'ubsan%': '<(ubsan)',
1160 'ubsan_vptr%': '<(ubsan_vptr)',
1161 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1162 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1163 'use_custom_libcxx%': '<(use_custom_libcxx)',
1164 'use_system_libcxx%': '<(use_system_libcxx)',
1165 'clang_type_profiler%': '<(clang_type_profiler)',
1166 'order_profiling%': '<(order_profiling)',
1167 'order_text_section%': '<(order_text_section)',
1168 'enable_extensions%': '<(enable_extensions)',
1169 'enable_plugin_installation%': '<(enable_plugin_installation)',
1170 'enable_plugins%': '<(enable_plugins)',
1171 'enable_session_service%': '<(enable_session_service)',
1172 'enable_themes%': '<(enable_themes)',
1173 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1174 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1175 'enable_background%': '<(enable_background)',
1176 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1177 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1178 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1179 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1180 'use_canvas_skia%': '<(use_canvas_skia)',
1181 'test_isolation_mode%': '<(test_isolation_mode)',
1182 'test_isolation_outdir%': '<(test_isolation_outdir)',
1183 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1184 'enable_basic_printing%': '<(enable_basic_printing)',
1185 'enable_print_preview%': '<(enable_print_preview)',
1186 'enable_spellcheck%': '<(enable_spellcheck)',
1187 'enable_google_now%': '<(enable_google_now)',
1188 'cld_version%': '<(cld_version)',
1189 'cld2_table_size%': '<(cld2_table_size)',
1190 'cld2_data_source%': '<(cld2_data_source)',
1191 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1192 'disable_file_support%': '<(disable_file_support)',
1193 'disable_ftp_support%': '<(disable_ftp_support)',
1194 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1195 'enable_task_manager%': '<(enable_task_manager)',
1196 'sas_dll_path%': '<(sas_dll_path)',
1197 'wix_path%': '<(wix_path)',
1198 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1199 'use_system_libjpeg%': '<(use_system_libjpeg)',
1200 'android_channel%': '<(android_channel)',
1201 'android_webview_build%': '<(android_webview_build)',
1202 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
1203 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1204 'gyp_managed_install%': 0,
1205 'create_standalone_apk%': 1,
1206 'enable_app_list%': '<(enable_app_list)',
1207 'use_default_render_theme%': '<(use_default_render_theme)',
1208 'enable_settings_app%': '<(enable_settings_app)',
1209 'google_api_key%': '<(google_api_key)',
1210 'google_default_client_id%': '<(google_default_client_id)',
1211 'google_default_client_secret%': '<(google_default_client_secret)',
1212 'enable_managed_users%': '<(enable_managed_users)',
1213 'native_discardable_memory%': '<(native_discardable_memory)',
1214 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1215 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1216 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1217 'enable_mdns%' : '<(enable_mdns)',
1218 'enable_service_discovery%' : '<(enable_service_discovery)',
1219 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1220 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1221 'v8_optimized_debug%': '<(v8_optimized_debug)',
1222 'proprietary_codecs%': '<(proprietary_codecs)',
1223 'use_goma%': '<(use_goma)',
1224 'gomadir%': '<(gomadir)',
1225 'use_lto%': '<(use_lto)',
1226 'use_lto_o2%': '<(use_lto_o2)',
1227 'video_hole%': '<(video_hole)',
1228 'enable_load_completion_hacks%': '<(enable_load_completion_hacks)',
1229 'support_pre_M6_history_database%': '<(support_pre_M6_history_database)',
1230 'v8_use_external_startup_data': '<(v8_use_external_startup_data)',
1232 # Whether or not we are building the Athena shell.
1235 # Use system protobuf instead of bundled one.
1236 'use_system_protobuf%': 0,
1238 # Use system yasm instead of bundled one.
1239 'use_system_yasm%': 0,
1241 # Use system ICU instead of bundled one.
1242 'use_system_icu%' : 0,
1244 # Default to enabled PIE; this is important for ASLR but we may need to be
1245 # able to turn it off for various reasons.
1246 'linux_disable_pie%': 0,
1248 # The release channel that this build targets. This is used to restrict
1249 # channel-specific build options, like which installer packages to create.
1250 # The default is 'all', which does no channel-specific filtering.
1253 # Override chromium_mac_pch and set it to 0 to suppress the use of
1254 # precompiled headers on the Mac. Prefix header injection may still be
1255 # used, but prefix headers will not be precompiled. This is useful when
1256 # using distcc to distribute a build to compile slaves that don't
1257 # share the same compiler executable as the system driving the compilation,
1258 # because precompiled headers rely on pointers into a specific compiler
1259 # executable's image. Setting this to 0 is needed to use an experimental
1260 # Linux-Mac cross compiler distcc farm.
1261 'chromium_mac_pch%': 1,
1263 # The default value for mac_strip in target_defaults. This cannot be
1264 # set there, per the comment about variable% in a target_defaults.
1265 'mac_strip_release%': 0,
1267 # Set to 1 to enable java code coverage. Instruments classes during build
1268 # to produce .ec files during runtime.
1269 'emma_coverage%': 0,
1271 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1272 # separated with whitespace and/or comma. Only has effect if
1273 # 'emma_coverage=1'.
1276 # Set to 1 to enable running Android lint on java/class files.
1279 # Although base/allocator lets you select a heap library via an
1280 # environment variable, the libcmt shim it uses sometimes gets in
1281 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1282 # 'win_use_allocator_shim': 0,
1283 # 'win_release_RuntimeLibrary': 2
1284 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1285 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1287 # TODO(bradnelson): eliminate this when possible.
1288 # To allow local gyp files to prevent release.vsprops from being included.
1289 # Yes(1) means include release.vsprops.
1290 # Once all vsprops settings are migrated into gyp, this can go away.
1291 'msvs_use_common_release%': 1,
1293 # TODO(bradnelson): eliminate this when possible.
1294 # To allow local gyp files to override additional linker options for msvs.
1295 # Yes(1) means set use the common linker options.
1296 'msvs_use_common_linker_extras%': 1,
1298 # TODO(sgk): eliminate this if possible.
1299 # It would be nicer to support this via a setting in 'target_defaults'
1300 # in chrome/app/locales/locales.gypi overriding the setting in the
1301 # 'Debug' configuration in the 'target_defaults' dict below,
1302 # but that doesn't work as we'd like.
1303 'msvs_debug_link_incremental%': '2',
1305 # Needed for some of the largest modules.
1306 'msvs_debug_link_nonincremental%': '1',
1308 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1309 # to get incremental linking to be faster in debug builds.
1310 'incremental_chrome_dll%': '0',
1312 # Experimental setting to break chrome.dll into multiple pieces based on
1314 'chrome_multiple_dll%': '0',
1316 # Experimental setting to optimize Chrome's DLLs with PGO.
1317 'chrome_pgo_phase%': '0',
1320 'clang%': '<(clang)',
1321 'host_clang%': '<(host_clang)',
1322 'make_clang_dir%': '<(make_clang_dir)',
1324 # Control which version of clang to use when building for iOS. If set to
1325 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1326 # the version of clang that ships with the Chromium source. This variable
1327 # is automatically set to '1' when using the Xcode generator.
1330 # These two variables can be set in GYP_DEFINES while running
1331 # |gclient runhooks| to let clang run a plugin in every compilation.
1332 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1334 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1337 'clang_add_plugin%': '',
1339 # Tell ld64 to write map files describing binary layout. Useful
1340 # for looking at what contributes to binary size, e.g. with
1341 # https://github.com/nico/bloat
1342 'mac_write_linker_maps%': 0,
1344 # The default type of gtest.
1345 'gtest_target_type%': 'executable',
1347 # Enable sampling based profiler.
1348 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1350 # Profile without optimizing out stack frames when profiling==1.
1351 'profiling_full_stack_frames%': '0',
1353 # And if we want to dump symbols for Breakpad-enabled builds.
1354 'linux_dump_symbols%': 0,
1355 # And if we want to strip the binary after dumping symbols.
1356 'linux_strip_binary%': 0,
1357 # If we want stack unwind support for backtrace().
1358 'debug_unwind_tables%': 1,
1359 'release_unwind_tables%': 1,
1361 # Override where to find binutils
1362 'binutils_version%': 0,
1363 'binutils_dir%': '',
1366 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1367 'use_allocator%': 'tcmalloc',
1369 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1370 'linux_link_gnome_keyring%': 0,
1371 # Set to 1 to link against gsettings APIs instead of using dlopen().
1372 'linux_link_gsettings%': 0,
1374 # Enable use of OpenMAX DL FFT routines.
1375 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1377 # Enable new NPDevice API.
1378 'enable_new_npdevice_api%': 0,
1380 # .gyp files or targets should set chromium_code to 1 if they build
1381 # Chromium-specific code, as opposed to external code. This variable is
1382 # used to control such things as the set of warnings to enable, and
1383 # whether warnings are treated as errors.
1384 'chromium_code%': 0,
1386 # Disable fatal linker warnings, similarly to how we make it possible
1387 # to disable -Werror (e.g. for different toolchain versions).
1388 'disable_fatal_linker_warnings%': 0,
1390 'release_valgrind_build%': 0,
1392 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1393 'enable_wexit_time_destructors%': 0,
1395 # Build libpeerconnection as a static library by default.
1396 'libpeer_target_type%': 'static_library',
1398 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1399 'internal_gles2_conform_tests%': 0,
1401 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1402 'internal_khronos_glcts_tests%': 0,
1404 # Set to 1 to compile the filter fuzzer.
1405 'internal_filter_fuzzer%': 0,
1407 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1408 # so Cocoa is happy (http://crbug.com/20441).
1410 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1411 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1412 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1413 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1414 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1415 'vi', 'zh-CN', 'zh-TW',
1418 # Pseudo locales are special locales which are used for testing and
1419 # debugging. They don't get copied to the final app. For more info,
1420 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1427 # If debug_devtools is set to 1, JavaScript files for DevTools are
1428 # stored as is and loaded from disk. Otherwise, a concatenated file
1429 # is stored in resources.pak. It is still possible to load JS files
1430 # from disk by passing --debug-devtools cmdline switch.
1431 'debug_devtools%': 0,
1433 # The Java Bridge is not compiled in by default.
1436 # Code signing for iOS binaries. The bots need to be able to disable this.
1437 'chromium_ios_signing%': 1,
1439 # This flag is only used when disable_nacl==0 and disables all those
1440 # subcomponents which would require the installation of a native_client
1441 # untrusted toolchain.
1442 'disable_nacl_untrusted%': 0,
1444 # Disable Dart by default.
1447 # Copy out the setting of disable_nacl.
1448 'disable_nacl%': '<(disable_nacl)',
1450 # Portable Native Client is enabled by default.
1451 'disable_pnacl%': 0,
1453 # Whether to build full debug version for Debug configuration on Android.
1454 # Compared to full debug version, the default Debug configuration on Android
1455 # has no full v8 debug, has size optimization and linker gc section, so that
1456 # we can build a debug version with acceptable size and performance.
1457 'android_full_debug%': 0,
1459 # Sets the default version name and code for Android app, by default we
1460 # do a developer build.
1461 'android_app_version_name%': 'Developer Build',
1462 'android_app_version_code%': 1,
1464 # Contains data about the attached devices for gyp_managed_install.
1465 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1467 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1468 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1470 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1471 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1473 # Whether we are using the rlz library or not. Platforms like Android send
1474 # rlz codes for searches but do not use the library.
1477 # Turns on the i18n support in V8.
1478 'v8_enable_i18n_support': 1,
1480 # Compile d8 for the host toolset.
1481 'v8_toolset_for_d8': 'host',
1483 # Use brlapi from brltty for braille display support.
1486 # Relative path to icu.gyp from this file.
1487 'icu_gyp_path': '../third_party/icu/icu.gyp',
1489 # IPC fuzzer is disabled by default.
1490 'enable_ipc_fuzzer%': 0,
1493 # Force disable libstdc++ debug mode.
1494 'disable_glibcxx_debug%': 0,
1496 # Set to 1 to compile with MSE support for MPEG2 TS
1497 'enable_mpeg2ts_stream_parser%': 0,
1499 # Support ChromeOS touchpad gestures with ozone.
1500 'use_evdev_gestures%': 0,
1502 # Default ozone platform (if no --ozone-platform flag).
1503 'ozone_platform%': "",
1505 # Ozone platforms to include in the build.
1506 'ozone_platform_caca%': 0,
1507 'ozone_platform_dri%': 0,
1508 'ozone_platform_egltest%': 0,
1509 'ozone_platform_gbm%': 0,
1510 'ozone_platform_ozonex%': 0,
1511 'ozone_platform_test%': 0,
1513 # Whether the browser is non-native (using Views Toolkit) on Mac.
1514 'mac_views_browser%': 0,
1517 ['buildtype=="Official"', {
1518 # Continue to embed build meta data in Official builds, basically the
1519 # time it was built.
1520 # TODO(maruel): This decision should be revisited because having an
1521 # official deterministic build has high value too but MSVC toolset can't
1522 # generate anything deterministic with WPO enabled AFAIK.
1523 'dont_embed_build_metadata%': 0,
1525 # Enable the Syzygy optimization step for the official builds.
1526 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1527 'syzygy_optimize%': 1,
1529 'syzygy_optimize%': 0,
1531 # Get binutils version so we can enable debug fission if we can.
1532 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1534 # compiler_version doesn't work with clang
1535 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1536 # compiler_version works with clang.
1537 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1538 # that it takes effect here.
1539 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1540 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1542 # On Android we know the binutils version in the toolchain.
1544 'binutils_version%': 222,
1546 ['host_arch=="x64"', {
1547 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1549 ['host_arch=="ia32"', {
1550 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1552 # Our version of binutils in third_party/binutils
1553 ['linux_use_bundled_binutils==1', {
1554 'binutils_version%': 224,
1558 'binutils_version%': 0,
1560 # The version of GCC in use, set later in platforms that use GCC and have
1561 # not explicitly chosen to build with clang. Currently, this means all
1562 # platforms except Windows, Mac and iOS.
1563 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1564 # it takes effect here.
1565 ['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', {
1567 ['OS=="android" and android_webview_build==0', {
1568 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1569 # We directly set the gcc version since we know what we use.
1572 ['OS=="android" and android_webview_build==1', {
1573 # Android WebView uses a hermetic clang toolchain for host builds.
1574 'host_gcc_version%': 0,
1575 # Android WebView uses the GCC toolchain from the Android build.
1579 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1580 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1584 'host_gcc_version%': 0,
1587 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1588 'windows_sdk_path%': '<(windows_sdk_default_path)',
1590 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
1592 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1593 'directx_sdk_path%': '<(directx_sdk_default_path)',
1595 'directx_sdk_path%': '$(DXSDK_DIR)',
1598 'windows_driver_kit_path%': '$(WDK_DIR)',
1600 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1602 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1605 'nacl_untrusted_build%': 0,
1606 'use_allocator%': 'none',
1608 ['OS=="linux" and target_arch=="mipsel"', {
1609 'sysroot%': '<(sysroot)',
1612 # All Chrome builds have breakpad symbols, but only process the
1613 # symbols from official builds.
1614 ['(branding=="Chrome" and buildtype=="Official")', {
1615 'linux_dump_symbols%': 1,
1617 # Omit unwind support in official release builds to save space. We
1618 # can use breakpad for these builds.
1619 'release_unwind_tables%': 0,
1622 # For official builds, use a 64-bit linker to avoid running out
1623 # of address space. The buildbots should have a 64-bit kernel
1624 # and a 64-bit libc installed.
1625 ['host_arch=="ia32" and target_arch=="ia32"', {
1626 'linux_use_bundled_gold%': '1',
1627 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1632 }], # os_posix==1 and OS!="mac" and OS!="ios"
1635 'enable_background%': 0,
1636 'icu_use_data_file_flag%': 1,
1637 'enable_web_speech%': 0,
1638 'use_system_libxml%': 1,
1639 'use_system_sqlite%': 1,
1641 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1642 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1643 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1644 'uk', 'vi', 'zh-CN', 'zh-TW',
1647 # iOS SDK and deployment target support. The |ios_sdk| value is left
1648 # blank so that when it is set in the project files it will be the
1649 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1650 # causes Xcode to spit out a warning for every single project file for
1651 # not using the "current" SDK.
1653 'ios_sdk_path%': '',
1654 'ios_deployment_target%': '7.0',
1657 # ios_product_name is set to the name of the .app bundle as it should
1659 ['branding=="Chrome"', {
1660 'ios_product_name%': 'Chrome',
1661 }, { # else: branding!="Chrome"
1662 'ios_product_name%': 'Chromium',
1664 ['branding=="Chrome" and buildtype=="Official"', {
1666 }, { # else: branding!="Chrome" or buildtype!="Official"
1672 # Location of Android NDK.
1675 # Unfortunately we have to use absolute paths to the SDK/NDK because
1676 # they're passed to ant which uses a different relative path from
1678 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1679 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1680 'android_host_arch%': '<!(uname -m)',
1681 # Android API-level of the SDK used for compilation.
1682 'android_sdk_version%': '21',
1683 'android_sdk_build_tools_version%': '21.0.1',
1684 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1686 # Copy conditionally-set variables out one scope.
1687 'android_ndk_root%': '<(android_ndk_root)',
1688 'android_sdk_root%': '<(android_sdk_root)',
1689 'android_sdk_version%': '<(android_sdk_version)',
1690 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1691 'host_os%': '<(host_os)',
1693 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1694 # Android SDK build tools (e.g. dx, aapt, aidl)
1695 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1697 # Android API level 14 is ICS (Android 4.0) which is the minimum
1698 # platform requirement for Chrome on Android, we use it for native
1701 ['target_arch == "ia32"', {
1702 'android_app_abi%': 'x86',
1703 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1704 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1705 'android_ndk_lib_dir%': 'usr/lib',
1706 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1708 ['target_arch == "x64"', {
1709 'android_app_abi%': 'x86_64',
1710 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1711 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1712 'android_ndk_lib_dir%': 'usr/lib64',
1713 'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1715 ['target_arch=="arm"', {
1718 'android_app_abi%': 'armeabi',
1720 'android_app_abi%': 'armeabi-v7a',
1723 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1724 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1725 'android_ndk_lib_dir%': 'usr/lib',
1726 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1728 ['target_arch == "arm64"', {
1729 'android_app_abi%': 'arm64-v8a',
1730 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1731 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1732 'android_ndk_lib_dir%': 'usr/lib',
1733 'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1735 ['target_arch == "mipsel"', {
1736 'android_app_abi%': 'mips',
1737 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1738 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1739 'android_ndk_lib_dir%': 'usr/lib',
1740 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1742 ['target_arch == "mips64el"', {
1743 'android_app_abi%': 'mips64',
1744 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1745 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1746 'android_ndk_lib_dir%': 'usr/lib64',
1747 'android_toolchain%': '<(android_ndk_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1752 # Copy conditionally-set variables out one scope.
1753 'android_app_abi%': '<(android_app_abi)',
1754 'android_gdbserver%': '<(android_gdbserver)',
1755 'android_ndk_root%': '<(android_ndk_root)',
1756 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1757 'android_sdk_root%': '<(android_sdk_root)',
1758 'android_sdk_version%': '<(android_sdk_version)',
1759 'android_toolchain%': '<(android_toolchain)',
1761 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1762 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1763 'android_sdk_tools%': '<(android_sdk_tools)',
1764 'android_sdk%': '<(android_sdk)',
1765 'android_sdk_jar%': '<(android_sdk)/android.jar',
1767 'android_stlport_root': '<(android_stlport_root)',
1768 'android_stlport_include': '<(android_stlport_root)/stlport',
1769 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1770 'host_os%': '<(host_os)',
1772 # Location of the "objcopy" binary, used by both gyp and scripts.
1773 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1775 # Location of the "strip" binary, used by both gyp and scripts.
1776 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1778 # Location of the "readelf" binary.
1779 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1781 # Determines whether we should optimize JNI generation at the cost of
1782 # breaking assumptions in the build system that when inputs have changed
1783 # the outputs should always change as well. This is meant purely for
1784 # developer builds, to avoid spurious re-linking of native files.
1785 'optimize_jni_generation%': '<(optimize_jni_generation)',
1787 # Always uses openssl.
1789 'use_openssl_certs%': 1,
1791 'proprietary_codecs%': '<(proprietary_codecs)',
1792 'safe_browsing%': 1,
1793 'enable_web_speech%': 0,
1795 'build_ffmpegsumo%': 0,
1796 'use_allocator%': 'none',
1798 # Disable Native Client.
1801 # Android does not support background apps.
1802 'enable_background%': 0,
1804 # Sessions are store separately in the Java side.
1805 'enable_session_service%': 0,
1809 'gtest_target_type%': 'shared_library',
1811 # Uses system APIs for decoding audio and video.
1812 'use_libffmpeg%': '0',
1814 # TODO(torne): Remove this unsupported option once all the places that
1815 # test it have been updated.
1816 'use_system_stlport%': 0,
1818 # Copy it out one scope.
1819 'android_webview_build%': '<(android_webview_build)',
1821 # Default android linker script for shared library exports.
1822 'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_exports.lst',
1825 'use_system_fontconfig%': 0,
1827 'use_system_fontconfig%': 1,
1830 'enable_mpeg2ts_stream_parser%': 1,
1831 'ffmpeg_branding%': 'Chrome',
1832 'ozone_platform_ozonex%': 1,
1833 'use_playready%': 0,
1835 ['target_arch=="arm"', {
1837 'arm_tune%': 'cortex-a9',
1843 ['android_webview_build==1', {
1844 # When building the WebView in the Android tree, jarjar will remap all
1845 # the class names, so the JNI generator needs to know this.
1846 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1848 ['OS=="linux" and target_arch!="mipsel"', {
1849 # TODO(thakis): This is here to measure perf for a while.
1854 # All Chrome builds have breakpad symbols, but only process the
1855 # symbols from official builds.
1856 ['(branding=="Chrome" and buildtype=="Official")', {
1857 'mac_strip_release%': 1,
1861 ['OS=="mac" or OS=="ios"', {
1865 # Mac OS X SDK and deployment target support. The SDK identifies
1866 # the version of the system headers that will be used, and
1867 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1868 # macro. "Maximum allowed" refers to the operating system version
1869 # whose APIs are available in the headers. The deployment target
1870 # identifies the minimum system version that the built products are
1871 # expected to function on. It corresponds to the
1872 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1873 # macros are available, #include <AvailabilityMacros.h>. Additional
1874 # documentation on these macros is available at
1875 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1876 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1877 # deployment target to 10.6. Other projects, such as O3D, may
1878 # override these defaults.
1880 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1881 # about that is at least the specified version. In official builds,
1882 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1883 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1884 # path to the SDK; when set to a non-empty string, SDK detection
1885 # based on mac_sdk_min will be bypassed entirely.
1888 'mac_sdk_min%': '10.8',
1889 }, { # else OS!="ios"
1890 'mac_sdk_min%': '10.6',
1893 'mac_sdk_path%': '',
1895 'mac_deployment_target%': '10.6',
1898 'mac_sdk_min': '<(mac_sdk_min)',
1899 'mac_sdk_path': '<(mac_sdk_path)',
1900 'mac_deployment_target': '<(mac_deployment_target)',
1902 # Compile in Breakpad support by default so that it can be
1903 # tested, even if it is not enabled by default at runtime.
1904 'mac_breakpad_compiled_in%': 1,
1906 # mac_product_name is set to the name of the .app bundle as it should
1907 # appear on disk. This duplicates data from
1908 # chrome/app/theme/chromium/BRANDING and
1909 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1910 # these names into the build system.
1911 ['branding=="Chrome"', {
1912 'mac_product_name%': 'Google Chrome',
1913 }, { # else: branding!="Chrome"
1914 'mac_product_name%': 'Chromium',
1916 # Official mac builds require a specific OS X SDK, but iOS and
1917 # non-official mac builds do not.
1918 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1919 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1921 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1923 ['branding=="Chrome" and buildtype=="Official"', {
1924 # Enable uploading crash dumps.
1925 'mac_breakpad_uploads%': 1,
1926 # Enable dumping symbols at build time for use by Mac Breakpad.
1928 # Enable Keystone auto-update support.
1930 }, { # else: branding!="Chrome" or buildtype!="Official"
1931 'mac_breakpad_uploads%': 0,
1936 }], # OS=="mac" or OS=="ios"
1939 # This is the architecture convention used in WinSDK paths.
1940 ['target_arch=="ia32"', {
1941 'winsdk_arch%': 'x86',
1943 'winsdk_arch%': '<(target_arch)',
1945 ['component=="shared_library"', {
1946 'win_use_allocator_shim%': 0,
1948 # Turn on multiple dll by default on Windows when in static_library.
1949 'chrome_multiple_dll%': 1,
1952 'win_use_allocator_shim%': 0,
1954 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1955 # Only enabled by default for ninja because it's buggy in VS.
1956 # Not enabled for component=static_library because some targets
1957 # are too large and the toolchain fails due to the size of the
1959 'incremental_chrome_dll%': 1,
1961 # Don't do incremental linking for large modules on 32-bit or when
1962 # component=static_library as the toolchain fails due to the size of
1964 ['MSVS_OS_BITS==32 or component=="static_library"', {
1965 'msvs_large_module_debug_link_mode%': '1', # No
1967 'msvs_large_module_debug_link_mode%': '2', # Yes
1969 ['MSVS_VERSION=="2013e"', {
1977 'nacl_win64_defines': [
1978 # This flag is used to minimize dependencies when building
1979 # Native Client loader for 64-bit Windows.
1984 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1990 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1991 'enable_pepper_cdms%': 1,
1993 'enable_pepper_cdms%': 0,
1997 'enable_browser_cdms%': 1,
1999 'enable_browser_cdms%': 0,
2002 # Native Client glibc toolchain is enabled
2003 # by default except on arm, mips and mips64.
2004 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
2005 'disable_glibc%': 1,
2007 'disable_glibc%': 0,
2010 # Set the relative path from this file to the GYP file of the JPEG
2011 # library used by Chromium.
2012 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2013 # Configuration for using the system libjeg is here.
2014 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
2016 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
2019 # Options controlling the use of GConf (the classic GNOME configuration
2020 # system) and GIO, which contains GSettings (the new GNOME config system).
2021 ['chromeos==1 or embedded==1', {
2029 # Set up -D and -E flags passed into grit.
2030 ['branding=="Chrome"', {
2031 # TODO(mmoss) The .grd files look for _google_chrome, but for
2032 # consistency they should look for google_chrome_build like C++.
2033 'grit_defines': ['-D', '_google_chrome',
2034 '-E', 'CHROMIUM_BUILD=google_chrome'],
2036 'grit_defines': ['-D', '_chromium',
2037 '-E', 'CHROMIUM_BUILD=chromium'],
2040 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2042 ['desktop_linux==1', {
2043 'grit_defines': ['-D', 'desktop_linux'],
2045 ['toolkit_views==1', {
2046 'grit_defines': ['-D', 'toolkit_views'],
2049 'grit_defines': ['-D', 'use_aura'],
2052 'grit_defines': ['-D', 'use_ash'],
2055 'grit_defines': ['-D', 'use_nss'],
2058 'grit_defines': ['-D', 'use_ozone'],
2060 ['image_loader_extension==1', {
2061 'grit_defines': ['-D', 'image_loader_extension'],
2064 'grit_defines': ['-D', 'remoting'],
2066 ['use_titlecase_in_grd==1', {
2067 'grit_defines': ['-D', 'use_titlecase'],
2069 ['use_third_party_translations==1', {
2070 'grit_defines': ['-D', 'use_third_party_translations'],
2072 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2073 'ka', 'ku', 'kw', 'ms', 'ug'
2079 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2080 '--no-output-all-resource-defines',
2083 ['OS=="mac" or OS=="ios"', {
2084 'grit_defines': ['-D', 'scale_factors=2x'],
2089 # iOS uses a whitelist to filter resources.
2090 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt',
2091 '--no-output-all-resource-defines',
2094 # Enable host builds when generating with ninja-ios.
2096 ['"<(GENERATOR)"=="ninja"', {
2100 # TODO(sdefresne): Remove the target_subarch check once Apple has
2101 # upstreamed the support for "arm64". http://crbug.com/341453
2102 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
2107 ['enable_extensions==1', {
2108 'grit_defines': ['-D', 'enable_extensions'],
2110 ['enable_plugins!=0', {
2111 'grit_defines': ['-D', 'enable_plugins'],
2113 ['enable_basic_printing==1 or enable_print_preview==1', {
2114 'grit_defines': ['-D', 'enable_printing'],
2116 ['enable_print_preview==1', {
2117 'grit_defines': ['-D', 'enable_print_preview'],
2119 ['enable_themes==1', {
2120 'grit_defines': ['-D', 'enable_themes'],
2122 ['enable_app_list==1', {
2123 'grit_defines': ['-D', 'enable_app_list'],
2125 ['enable_settings_app==1', {
2126 'grit_defines': ['-D', 'enable_settings_app'],
2128 ['enable_google_now==1', {
2129 'grit_defines': ['-D', 'enable_google_now'],
2131 ['use_concatenated_impulse_responses==1', {
2132 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2134 ['enable_webrtc==1', {
2135 'grit_defines': ['-D', 'enable_webrtc'],
2137 ['enable_hangout_services_extension==1', {
2138 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2140 ['enable_task_manager==1', {
2141 'grit_defines': ['-D', 'enable_task_manager'],
2143 ['notifications==1', {
2144 'grit_defines': ['-D', 'enable_notifications'],
2146 ['enable_wifi_bootstrapping==1', {
2147 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2149 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2150 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2152 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2153 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2155 ['enable_mdns==1 or OS=="mac"', {
2156 'grit_defines': ['-D', 'enable_service_discovery'],
2157 'enable_service_discovery%': 1
2159 ['clang_use_chrome_plugins==1 and OS!="win"', {
2160 'clang_chrome_plugins_flags': [
2161 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
2164 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2166 'use_allocator%': 'none',
2167 'use_sanitizer_options%': 1,
2169 ['asan==1 and OS=="linux" and chromeos==0', {
2170 'use_custom_libcxx%': 1,
2178 ['asan==1 and OS=="mac"', {
2179 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
2180 # runtime is fully adopted. See http://crbug.com/242503.
2181 'mac_strip_release': 0,
2184 'use_custom_libcxx%': 1,
2187 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2188 # libstdc++. This is required to avoid false positive reports whenever
2189 # the C++ standard library is used.
2190 'use_custom_libcxx%': 1,
2191 # Running the V8-generated code on an ARM simulator is a powerful hack
2192 # that allows the tool to see the memory accesses from JITted code.
2193 # Without this flag, JS code causes false positive reports from MSan.
2194 'v8_target_arch': 'arm64',
2197 ['OS=="linux" and clang_type_profiler==1', {
2199 'clang_use_chrome_plugins%': 0,
2201 ['host_arch=="x64"', {
2202 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2204 ['host_arch=="ia32"', {
2205 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2206 # Clang in this directory at your own risk if needed for some
2207 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2208 # usage). Any failure by this compiler should not close the tree.
2209 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2215 # The Clang plugins don't currently work on Windows.
2216 # TODO(hans): One day, this will work. (crbug.com/82385)
2217 'clang_use_chrome_plugins%': 0,
2220 # On valgrind bots, override the optimizer settings so we don't inline too
2221 # much and make the stacks harder to figure out.
2223 # TODO(rnk): Kill off variables that no one else uses and just implement
2224 # them under a build_for_tool== condition.
2225 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2227 'mac_debug_optimization': '1',
2228 'mac_release_optimization': '1',
2229 'release_optimize': '1',
2230 'no_gc_sections': 1,
2231 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2232 '-fno-builtin -fno-optimize-sibling-calls',
2233 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2234 '-fno-builtin -fno-optimize-sibling-calls',
2236 # MSVS flags for TSan on Pin and Windows.
2237 'win_debug_RuntimeChecks': '0',
2238 'win_debug_disable_iterator_debugging': '1',
2239 'win_debug_Optimization': '1',
2240 'win_debug_InlineFunctionExpansion': '0',
2241 'win_release_InlineFunctionExpansion': '0',
2242 'win_release_OmitFramePointers': '0',
2244 'use_allocator': 'tcmalloc',
2245 'release_valgrind_build': 1,
2247 'component': 'static_library',
2248 'use_system_zlib': 0,
2251 # Build tweaks for DrMemory.
2252 # TODO(rnk): Combine with tsan config to share the builder.
2253 # http://crbug.com/108155
2254 ['build_for_tool=="drmemory"', {
2255 # These runtime checks force initialization of stack vars which blocks
2256 # DrMemory's uninit detection.
2257 'win_debug_RuntimeChecks': '0',
2258 # Iterator debugging is slow.
2259 'win_debug_disable_iterator_debugging': '1',
2260 # Try to disable optimizations that mess up stacks in a release build.
2261 # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054)
2262 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2263 # compiler bug, so we use /Ob1 instead.
2264 'win_release_InlineFunctionExpansion': '1',
2265 'win_release_OmitFramePointers': '0',
2266 # Ditto for debug, to support bumping win_debug_Optimization.
2267 'win_debug_InlineFunctionExpansion': 0,
2268 'win_debug_OmitFramePointers': 0,
2269 # Keep the code under #ifndef NVALGRIND.
2270 'release_valgrind_build': 1,
2273 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2274 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2278 # Set default compiler flags depending on ARM version.
2279 ['arm_version==6 and android_webview_build==0', {
2280 'arm_arch%': 'armv6',
2283 'arm_float_abi%': 'softfp',
2286 ['arm_version==7 and android_webview_build==0', {
2287 'arm_arch%': 'armv7-a',
2288 'arm_tune%': 'generic-armv7-a',
2293 'arm_fpu%': 'vfpv3-d16',
2296 # Change the default to hard once the armhf transition is complete.
2297 'arm_float_abi%': 'softfp',
2301 ['android_webview_build==1', {
2302 # The WebView build gets its cpu-specific flags from the Android build system.
2306 'arm_float_abi%': '',
2310 # Enable brlapi by default for chromeos.
2315 ['use_ozone==1 and ozone_auto_platforms==1', {
2316 # Use test as the default platform.
2317 'ozone_platform%': 'test',
2319 # Build all platforms whose deps are in install-build-deps.sh.
2320 # Only these platforms will be compile tested by buildbots.
2321 'ozone_platform_dri%': 1,
2322 'ozone_platform_test%': 1,
2323 'ozone_platform_egltest%': 1,
2326 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2327 'use_clipboard_aurax11%': 1,
2330 ['OS=="win" and use_goma==1', {
2331 # goma doesn't support pch yet.
2332 'chromium_win_pch': 0,
2333 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2335 ['win_z7==0 and fastbuild==0', {
2341 ['OS=="win" and (clang==1 or asan==1)', {
2342 'chromium_win_pch': 0,
2346 'host_cc': '<(make_clang_dir)/bin/clang',
2347 'host_cxx': '<(make_clang_dir)/bin/clang++',
2349 'host_cc': '<!(which gcc)',
2350 'host_cxx': '<!(which g++)',
2353 # The seccomp-bpf sandbox is only supported on five architectures
2355 # Do not disable seccomp_bpf anywhere without talking to
2356 # security@chromium.org!
2357 ['((OS=="linux" or OS=="android") and '
2358 '(target_arch=="ia32" or target_arch=="x64" or '
2359 'target_arch=="arm" or target_arch=="mipsel" or '
2360 'target_arch=="arm64"))', {
2361 'use_seccomp_bpf%': 1,
2363 'use_seccomp_bpf%': 0,
2366 # Set component build with LTO until all tests pass.
2367 # This also reduces link time.
2369 'component%': "shared_library",
2373 # older history files use fts2 instead of fts3
2374 'sqlite_enable_fts2%': '<(support_pre_M6_history_database)',
2376 # The path to the ANGLE library.
2377 'angle_path': '<(DEPTH)/third_party/angle',
2379 # List of default apps to install in new profiles. The first list contains
2380 # the source files as found in svn. The second list, used only for linux,
2381 # contains the destination location for each of the files. When a crx
2382 # is added or removed from the list, the chrome/browser/resources/
2383 # default_apps/external_extensions.json file must also be updated.
2384 'default_apps_list': [
2385 'browser/resources/default_apps/external_extensions.json',
2386 'browser/resources/default_apps/gmail.crx',
2387 'browser/resources/default_apps/search.crx',
2388 'browser/resources/default_apps/youtube.crx',
2389 'browser/resources/default_apps/drive.crx',
2390 'browser/resources/default_apps/docs.crx',
2392 'default_apps_list_linux_dest': [
2393 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2394 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2395 '<(PRODUCT_DIR)/default_apps/search.crx',
2396 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2397 '<(PRODUCT_DIR)/default_apps/drive.crx',
2398 '<(PRODUCT_DIR)/default_apps/docs.crx',
2401 # Whether to allow building of the GPU-related isolates.
2402 'archive_gpu_tests%': 0,
2404 # Whether to allow building of chromoting related isolates.
2405 'archive_chromoting_tests%': 0,
2407 'target_defaults': {
2409 # The condition that operates on chromium_code is in a target_conditions
2410 # section, and will not have access to the default fallback value of
2411 # chromium_code at the top of this file, or to the chromium_code
2412 # variable placed at the root variables scope of .gyp files, because
2413 # those variables are not set at target scope. As a workaround,
2414 # if chromium_code is not set at target scope, define it in target scope
2415 # to contain whatever value it has during early variable expansion.
2416 # That's enough to make it available during target conditional
2418 'chromium_code%': '<(chromium_code)',
2420 'component%': '<(component)',
2422 'chromecast%': '<(chromecast)',
2424 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2425 'win_release_Optimization%': '2', # 2 = /Os
2426 'win_debug_Optimization%': '0', # 0 = /Od
2428 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2429 # Tri-state: blank is default, 1 on, 0 off
2430 'win_release_OmitFramePointers%': '0',
2431 # Tri-state: blank is default, 1 on, 0 off
2432 'win_debug_OmitFramePointers%': '',
2434 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2435 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2437 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2438 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2439 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2441 # VS inserts quite a lot of extra checks to algorithms like
2442 # std::partial_sort in Debug build which make them O(N^2)
2443 # instead of O(N*logN). This is particularly slow under memory
2444 # tools like ThreadSanitizer so we want it to be disablable.
2445 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2446 'win_debug_disable_iterator_debugging%': '0',
2448 # An application manifest fragment to declare compatibility settings for
2449 # 'executable' targets. Ignored in other target type.
2450 'win_exe_compatibility_manifest%':
2451 '<(DEPTH)\\build\\win\\compatibility.manifest',
2453 'release_extra_cflags%': '',
2454 'debug_extra_cflags%': '',
2456 'release_valgrind_build%': '<(release_valgrind_build)',
2458 # the non-qualified versions are widely assumed to be *nix-only
2459 'win_release_extra_cflags%': '',
2460 'win_debug_extra_cflags%': '',
2462 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2463 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2465 # Only used by Windows build for now. Can be used to build into a
2466 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2467 # output files in src/build/VS2010_{Debug,Release}.
2468 'build_dir_prefix%': '',
2470 # Targets are by default not nacl untrusted code.
2471 'nacl_untrusted_build%': 0,
2473 'pnacl_compile_flags': [
2474 # pnacl uses the clang compiler so we need to suppress all the
2475 # same warnings as we do for clang.
2476 # TODO(sbc): Remove these if/when they are removed from the clang
2478 '-Wno-unused-function',
2479 '-Wno-char-subscripts',
2480 '-Wno-c++11-extensions',
2481 '-Wno-unnamed-type-template-args',
2485 ['OS=="win" and component=="shared_library"', {
2486 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2487 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2488 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2490 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2491 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2492 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2495 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2496 'mac_release_optimization%': 's', # Use -Os unless overridden
2497 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2499 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2500 'mac_release_optimization%': '3', # Use -O3 unless overridden
2501 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2504 'host_os%': '<(host_os)', # See comment above chromium_code.
2507 'clang_warning_flags': [
2510 # Don't die on dtoa code that uses a char as an array index.
2511 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2512 '-Wno-char-subscripts',
2514 # TODO(thakis): This used to be implied by -Wno-unused-function,
2515 # which we no longer use. Check if it makes sense to remove
2516 # this as well. http://crbug.com/316352
2517 '-Wno-unneeded-internal-declaration',
2519 # Warns on switches on enums that cover all enum values but
2520 # also contain a default: branch. Chrome is full of that.
2521 '-Wno-covered-switch-default',
2523 # Warns when a const char[] is converted to bool.
2524 '-Wstring-conversion',
2526 # C++11-related flags:
2528 # This warns on using ints as initializers for floats in
2529 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2530 # which happens in several places in chrome code. Not sure if
2531 # this is worth fixing.
2532 '-Wno-c++11-narrowing',
2534 # Clang considers the `register` keyword as deprecated, but e.g.
2535 # code generated by flex (used in angle) contains that keyword.
2536 # http://crbug.com/255186
2537 '-Wno-deprecated-register',
2539 # TODO(hans): Clean this up. Or disable with finer granularity.
2540 '-Wno-unused-local-typedef',
2543 'includes': [ 'set_clang_warning_flags.gypi', ],
2545 # Don't use deprecated V8 APIs anywhere.
2546 'V8_DEPRECATION_WARNINGS',
2549 '<(SHARED_INTERMEDIATE_DIR)',
2552 ['(OS=="mac" or OS=="ios") and asan==1', {
2554 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2557 ['OS=="win" and asan==1 and component=="shared_library"', {
2559 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2562 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2563 'cflags_cc!': ['-fno-rtti'],
2566 '-gline-tables-only',
2567 '-fintercept-allocation-functions',
2569 'defines': ['TYPE_PROFILING'],
2571 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2574 ['branding=="Chrome"', {
2575 'defines': ['GOOGLE_CHROME_BUILD'],
2576 }, { # else: branding!="Chrome"
2577 'defines': ['CHROMIUM_BUILD'],
2579 ['OS=="mac" and component=="shared_library"', {
2581 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2582 'LD_RUNPATH_SEARCH_PATHS': [
2583 # For unbundled binaries.
2585 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2586 '@loader_path/../../..',
2590 ['clang==1 and OS!="win"', {
2591 # This is here so that all files get recompiled after a clang roll and
2592 # when turning clang on or off.
2593 # (defines are passed via the command line, and build systems rebuild
2594 # things when their commandline changes). Nothing should ever read this
2596 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2599 'defines': ['ENABLE_RLZ'],
2601 ['component=="shared_library"', {
2602 'defines': ['COMPONENT_BUILD'],
2604 ['toolkit_views==1', {
2605 'defines': ['TOOLKIT_VIEWS=1'],
2607 ['ui_compositor_image_transport==1', {
2608 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2611 'defines': ['USE_AURA=1'],
2614 'defines': ['USE_ASH=1'],
2617 'defines': ['USE_PANGO=1'],
2620 'defines': ['USE_CAIRO=1'],
2623 'defines': ['USE_CRAS=1'],
2626 'defines': ['USE_OZONE=1'],
2628 ['use_default_render_theme==1', {
2629 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2631 ['use_libjpeg_turbo==1', {
2632 'defines': ['USE_LIBJPEG_TURBO=1'],
2635 'defines': ['USE_X11=1'],
2637 ['use_clipboard_aurax11==1', {
2638 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2640 ['enable_one_click_signin==1', {
2641 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2643 ['enable_pre_sync_backup==1', {
2644 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2646 ['use_xi2_mt!=0 and use_x11==1', {
2647 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2649 ['image_loader_extension==1', {
2650 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2653 'defines': ['ENABLE_PROFILING=1'],
2656 'defines': ['ENABLE_REMOTING=1'],
2658 ['enable_webrtc==1', {
2659 'defines': ['ENABLE_WEBRTC=1'],
2661 ['proprietary_codecs==1', {
2662 'defines': ['USE_PROPRIETARY_CODECS'],
2664 ['enable_mpeg2ts_stream_parser==1', {
2665 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2669 ['enable_viewport==1', {
2670 'defines': ['ENABLE_VIEWPORT'],
2672 ['enable_pepper_cdms==1', {
2673 'defines': ['ENABLE_PEPPER_CDMS'],
2675 ['enable_browser_cdms==1', {
2676 'defines': ['ENABLE_BROWSER_CDMS'],
2678 ['configuration_policy==1', {
2679 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2681 ['notifications==1', {
2682 'defines': ['ENABLE_NOTIFICATIONS'],
2684 ['enable_hidpi==1', {
2685 'defines': ['ENABLE_HIDPI=1'],
2687 ['native_discardable_memory==1', {
2688 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2690 ['native_memory_pressure_signals==1', {
2691 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2694 'defines': ['USE_UDEV'],
2698 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2701 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2702 # Clang creates chubby debug information, which makes linking very
2703 # slow. For now, don't create debug information with clang. See
2704 # http://crbug.com/70000
2708 'debug_extra_cflags': '-g0',
2711 # Android builds symbols on release by default, disable them.
2714 'debug_extra_cflags': '-g0',
2715 'release_extra_cflags': '-g0',
2719 }, { # else clang!=1
2721 ['OS=="win" and fastbuild==2', {
2722 # Completely disable debug information.
2725 'GenerateDebugInformation': 'false',
2727 'VCCLCompilerTool': {
2728 'DebugInformationFormat': '0',
2732 ['OS=="win" and fastbuild==1', {
2735 # This tells the linker to generate .pdbs, so that
2736 # we can get meaningful stack traces.
2737 'GenerateDebugInformation': 'true',
2739 'VCCLCompilerTool': {
2740 # No debug info to be generated by compiler.
2741 'DebugInformationFormat': '0',
2745 ['OS=="linux" and fastbuild==2', {
2747 'debug_extra_cflags': '-g0',
2750 ['OS=="linux" and fastbuild==1', {
2752 'debug_extra_cflags': '-g1',
2755 ['OS=="android" and fastbuild==2', {
2757 'debug_extra_cflags': '-g0',
2758 'release_extra_cflags': '-g0',
2761 ['OS=="android" and fastbuild==1', {
2763 'debug_extra_cflags': '-g1',
2764 'release_extra_cflags': '-g1',
2771 ['dont_embed_build_metadata==1', {
2773 'DONT_EMBED_BUILD_METADATA',
2775 }], # dont_embed_build_metadata==1
2776 ['dcheck_always_on!=0', {
2777 'defines': ['DCHECK_ALWAYS_ON=1'],
2778 }], # dcheck_always_on!=0
2779 ['tracing_like_official_build!=0', {
2780 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2781 }], # tracing_like_official_build!=0
2782 ['win_use_allocator_shim==0', {
2785 'defines': ['NO_TCMALLOC'],
2791 'ADDRESS_SANITIZER',
2792 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2793 'MEMORY_SANITIZER_INITIAL_SIZE',
2797 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2805 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2806 'MEMORY_SANITIZER_INITIAL_SIZE',
2812 '_CRT_SECURE_NO_DEPRECATE',
2813 '_SCL_SECURE_NO_DEPRECATE',
2814 # This define is required to pull in the new Win8 interfaces from
2815 # system headers like ShObjIdl.h.
2816 'NTDDI_VERSION=0x06020000',
2817 # This is required for ATL to use XP-safe versions of its functions.
2818 '_USING_V110_SDK71_',
2821 '<(DEPTH)/third_party/wtl/include',
2826 # Generates debug info when win_z7=1
2827 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2829 'GenerateDebugInformation': 'true',
2831 'VCCLCompilerTool': {
2832 'DebugInformationFormat': '1',
2838 # This is prohibited when running /analyze.
2839 '_USING_V110_SDK71_',
2842 'VCCLCompilerTool': {
2843 # Set WarnAsError to false to disable this setting for most
2844 # projects so that compilation continues.
2845 'WarnAsError': 'false',
2846 # When win_analyze is specified add the /analyze switch.
2847 # Also add /WX- to force-disable WarnAsError for projects that
2848 # override WarnAsError.
2849 # Also, disable various noisy warnings that have low value.
2850 'AdditionalOptions': [
2853 '/wd6011', # Dereferencing NULL pointer
2854 '/wd6312', # Possible infinite loop: use of the constant
2855 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2856 '/wd6326', # Potential comparison of constant with constant
2857 '/wd28159', # Consider using 'GetTickCount64'
2858 '/wd28204', # Inconsistent SAL annotations
2859 '/wd28251', # Inconsistent SAL annotations
2860 '/wd28252', # Inconsistent SAL annotations
2861 '/wd28253', # Inconsistent SAL annotations
2862 '/wd28196', # The precondition is not satisfied
2863 '/wd28301', # Inconsistent SAL annotations
2864 '/wd6340', # Sign mismatch in function parameter
2865 '/wd28182', # Dereferencing NULL pointer
2877 ['target_arch=="arm"', {
2879 # TODO(lcwu): Work around an error when building Chromium
2880 # with gcc-4.5.3 (e.g. v8/src/platform-linux.cc). Remove
2881 # this define once the toolchain is updated.
2882 # See crbug.com/388933.
2886 ['use_playready==1', {
2888 'PLAYREADY_CDM_AVAILABLE',
2893 ['enable_task_manager==1', {
2895 'ENABLE_TASK_MANAGER=1',
2898 ['enable_extensions==1', {
2900 'ENABLE_EXTENSIONS=1',
2903 ['OS=="win" and branding=="Chrome"', {
2904 'defines': ['ENABLE_SWIFTSHADER'],
2906 ['enable_dart==1', {
2907 'defines': ['WEBKIT_USING_DART=1'],
2909 ['enable_plugin_installation==1', {
2910 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2912 ['enable_plugins==1', {
2913 'defines': ['ENABLE_PLUGINS=1'],
2915 ['enable_session_service==1', {
2916 'defines': ['ENABLE_SESSION_SERVICE=1'],
2918 ['enable_themes==1', {
2919 'defines': ['ENABLE_THEMES=1'],
2921 ['enable_autofill_dialog==1', {
2922 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2924 ['enable_prod_wallet_service==1', {
2925 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2927 ['enable_background==1', {
2928 'defines': ['ENABLE_BACKGROUND=1'],
2930 ['enable_google_now==1', {
2931 'defines': ['ENABLE_GOOGLE_NOW=1'],
2933 ['cld_version!=0', {
2934 'defines': ['CLD_VERSION=<(cld_version)'],
2936 ['cld_version==2', {
2937 # This is used to populate the "CLD Data Source" field in:
2938 # chrome://translate-internals
2939 'defines': ['CLD2_DATA_SOURCE=<(cld2_data_source)'],
2941 ['enable_basic_printing==1 or enable_print_preview==1', {
2942 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2943 'defines': ['ENABLE_PRINTING=1'],
2945 ['enable_basic_printing==1', {
2946 # Enable basic printing support and UI.
2947 'defines': ['ENABLE_BASIC_PRINTING=1'],
2949 ['enable_print_preview==1', {
2950 # Enable printing with print preview.
2951 # Can be defined without ENABLE_BASIC_PRINTING.
2952 'defines': ['ENABLE_PRINT_PREVIEW=1'],
2954 ['enable_spellcheck==1', {
2955 'defines': ['ENABLE_SPELLCHECK=1'],
2957 ['enable_captive_portal_detection==1', {
2958 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2960 ['enable_app_list==1', {
2961 'defines': ['ENABLE_APP_LIST=1'],
2963 ['enable_settings_app==1', {
2964 'defines': ['ENABLE_SETTINGS_APP=1'],
2966 ['disable_file_support==1', {
2967 'defines': ['DISABLE_FILE_SUPPORT=1'],
2969 ['disable_ftp_support==1', {
2970 'defines': ['DISABLE_FTP_SUPPORT=1'],
2972 ['use_icu_alternatives_on_android==1', {
2973 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2975 ['enable_managed_users==1', {
2976 'defines': ['ENABLE_MANAGED_USERS=1'],
2978 ['spdy_proxy_auth_property != ""', {
2979 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2981 ['spdy_proxy_auth_value != ""', {
2982 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2984 ['enable_mdns==1', {
2985 'defines': ['ENABLE_MDNS=1'],
2987 ['enable_service_discovery==1', {
2988 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2990 ['enable_wifi_bootstrapping==1', {
2991 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2993 ['enable_hangout_services_extension==1', {
2994 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2996 ['enable_ipc_fuzzer==1', {
2997 'defines': ['ENABLE_IPC_FUZZER=1'],
3000 'defines': ['VIDEO_HOLE=1'],
3002 ['enable_load_completion_hacks==1', {
3003 'defines': ['ENABLE_LOAD_COMPLETION_HACKS=1'],
3005 ['v8_use_external_startup_data==1', {
3006 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
3008 ], # conditions for 'target_defaults'
3009 'target_conditions': [
3010 ['<(use_libpci)==1', {
3011 'defines': ['USE_LIBPCI=1'],
3013 ['<(use_openssl)==1', {
3014 'defines': ['USE_OPENSSL=1'],
3016 ['<(use_openssl_certs)==1', {
3017 'defines': ['USE_OPENSSL_CERTS=1'],
3019 ['>(nacl_untrusted_build)==1', {
3022 'USE_OPENSSL_CERTS=1',
3025 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3026 'defines': ['USE_GLIB=1'],
3028 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
3029 'defines': ['USE_NSS=1'],
3031 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3032 'defines': ['OS_CHROMEOS=1'],
3034 ['enable_wexit_time_destructors==1 and OS!="win"', {
3035 # TODO: Enable on Windows too, http://crbug.com/404525
3036 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3038 ['chromium_code==0', {
3040 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3041 # We don't want to get warnings from third-party code,
3042 # so remove any existing warning-enabling flags like -Wall.
3048 # Don't warn about hash_map in third-party code.
3052 # Don't warn about printf format problems.
3053 # This is off by default in gcc but on in Ubuntu's gcc(!).
3057 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3061 # TODO: Fix all warnings on chromeos too.
3062 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3067 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3069 # Don't warn about ignoring the return value from e.g. close().
3070 # This is off by default in some gccs but on by default in others.
3071 # BSD systems do not support this option, since they are usually
3072 # using gcc 4.2.1, which does not have this flag yet.
3073 '-Wno-unused-result',
3078 '_CRT_SECURE_NO_DEPRECATE',
3079 '_CRT_NONSTDC_NO_WARNINGS',
3080 '_CRT_NONSTDC_NO_DEPRECATE',
3081 '_SCL_SECURE_NO_DEPRECATE',
3083 'msvs_disabled_warnings': [4800],
3085 'VCCLCompilerTool': {
3086 'WarningLevel': '3',
3087 'WarnAsError': 'true',
3088 'Detect64BitPortabilityProblems': 'false',
3092 ['buildtype=="Official"', {
3094 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3099 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3102 [ 'component=="shared_library"', {
3103 # TODO(darin): Unfortunately, some third_party code depends on base.
3104 'msvs_disabled_warnings': [
3105 4251, # class 'std::xx' needs to have dll-interface.
3111 [ 'OS=="mac" or OS=="ios"', {
3113 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3116 ['buildtype=="Official"', {
3118 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3125 # TODO(ios): Fix remaining warnings in third-party code, then
3126 # remove this; the Mac cleanup didn't get everything that's
3127 # flagged in an iOS build.
3128 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3129 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3130 # Several internal ios directories generate numerous warnings for
3131 # -Wobjc-missing-property-synthesis.
3132 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3138 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3139 'filename_rules.gypi',
3141 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3142 # C99 macros on Mac and Linux.
3144 '__STDC_CONSTANT_MACROS',
3145 '__STDC_FORMAT_MACROS',
3149 # turn on warnings for signed/unsigned mismatch on chromium code.
3151 'VCCLCompilerTool': {
3152 'AdditionalOptions': ['/we4389'],
3156 ['OS=="win" and component=="shared_library"', {
3157 'msvs_disabled_warnings': [
3158 4251, # class 'std::xx' needs to have dll-interface.
3163 ], # target_conditions for 'target_defaults'
3164 'default_configuration': 'Debug',
3166 # VCLinkerTool LinkIncremental values below:
3168 # 1 == /INCREMENTAL:NO
3170 # Debug links incremental, Release does not.
3172 # Abstract base configurations to cover common attributes.
3176 'msvs_configuration_attributes': {
3177 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3178 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3179 'CharacterSet': '1',
3181 # Add the default import libs.
3184 'AdditionalDependencies': [
3208 'MinimumRequiredVersion': '5.01', # XP.
3209 'TargetMachine': '1',
3211 'VCLibrarianTool': {
3212 'TargetMachine': '1',
3215 'msvs_configuration_platform': 'Win32',
3219 'msvs_configuration_platform': 'x64',
3222 # Make sure to understand http://crbug.com/361720 if you want to
3224 'MinimumRequiredVersion': '5.02', # Server 2003.
3225 'TargetMachine': '17', # x86 - 64
3226 'AdditionalLibraryDirectories!':
3227 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3228 'AdditionalLibraryDirectories':
3229 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3230 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3231 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3233 'VCLibrarianTool': {
3234 'AdditionalLibraryDirectories!':
3235 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3236 'AdditionalLibraryDirectories':
3237 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3238 'TargetMachine': '17', # x64
3245 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3246 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3249 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3251 '<@(debug_extra_cflags)',
3255 'VCCLCompilerTool': {
3256 'Optimization': '<(win_debug_Optimization)',
3257 'PreprocessorDefinitions': ['_DEBUG'],
3258 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3259 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3261 # According to MSVS, InlineFunctionExpansion=0 means
3262 # "default inlining", not "/Ob0".
3263 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3264 ['win_debug_InlineFunctionExpansion==0', {
3265 'AdditionalOptions': ['/Ob0'],
3267 ['win_debug_InlineFunctionExpansion!=""', {
3268 'InlineFunctionExpansion':
3269 '<(win_debug_InlineFunctionExpansion)',
3271 ['win_debug_disable_iterator_debugging==1', {
3272 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3275 # if win_debug_OmitFramePointers is blank, leave as default
3276 ['win_debug_OmitFramePointers==1', {
3277 'OmitFramePointers': 'true',
3279 ['win_debug_OmitFramePointers==0', {
3280 'OmitFramePointers': 'false',
3281 # The above is not sufficient (http://crbug.com/106711): it
3282 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3283 # perform FPO regardless, so we must explicitly disable.
3284 # We still want the false setting above to avoid having
3285 # "/Oy /Oy-" and warnings about overriding.
3286 'AdditionalOptions': ['/Oy-'],
3289 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3292 'LinkIncremental': '<(msvs_debug_link_incremental)',
3293 # ASLR makes debugging with windbg difficult because Chrome.exe and
3294 # Chrome.dll share the same base name. As result, windbg will
3295 # name the Chrome.dll module like chrome_<base address>, where
3296 # <base address> typically changes with each launch. This in turn
3297 # means that breakpoints in Chrome.dll don't stick from one launch
3298 # to the next. For this reason, we turn ASLR off in debug builds.
3299 # Note that this is a three-way bool, where 0 means to pick up
3300 # the default setting, 1 is off and 2 is on.
3301 'RandomizedBaseAddress': 1,
3303 'VCResourceCompilerTool': {
3304 'PreprocessorDefinitions': ['_DEBUG'],
3308 ['OS=="linux" or OS=="android"', {
3309 'target_conditions': [
3310 ['_toolset=="target"', {
3312 '<@(debug_extra_cflags)',
3317 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3318 # Enable libstdc++ debugging facilities to help catch problems
3319 # early, see http://crbug.com/65151 .
3320 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3321 'defines': ['_GLIBCXX_DEBUG=1',],
3323 ['release_valgrind_build==0', {
3326 '-fstack-protector-all', # Implies -fstack-protector
3332 # Allow comparing the address of references and 'this' against 0
3333 # in debug builds. Technically, these can never be null in
3334 # well-defined C/C++ and Clang can optimize such checks away in
3335 # release builds, but they may be used in asserts in debug builds.
3336 '-Wno-undefined-bool-conversion',
3337 '-Wno-tautological-undefined-compare',
3341 '-Wno-undefined-bool-conversion',
3342 '-Wno-tautological-undefined-compare',
3346 'VCCLCompilerTool': {
3347 'AdditionalOptions': [
3348 '-Wno-undefined-bool-conversion',
3349 '-Wno-tautological-undefined-compare',
3362 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3363 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3364 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3367 'VCCLCompilerTool': {
3368 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3370 # In official builds, each target will self-select
3371 # an optimization level.
3372 ['buildtype!="Official"', {
3373 'Optimization': '<(win_release_Optimization)',
3376 # According to MSVS, InlineFunctionExpansion=0 means
3377 # "default inlining", not "/Ob0".
3378 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3379 ['win_release_InlineFunctionExpansion==0', {
3380 'AdditionalOptions': ['/Ob0'],
3382 ['win_release_InlineFunctionExpansion!=""', {
3383 'InlineFunctionExpansion':
3384 '<(win_release_InlineFunctionExpansion)',
3387 # if win_release_OmitFramePointers is blank, leave as default
3388 ['win_release_OmitFramePointers==1', {
3389 'OmitFramePointers': 'true',
3391 ['win_release_OmitFramePointers==0', {
3392 'OmitFramePointers': 'false',
3393 # The above is not sufficient (http://crbug.com/106711): it
3394 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3395 # perform FPO regardless, so we must explicitly disable.
3396 # We still want the false setting above to avoid having
3397 # "/Oy /Oy-" and warnings about overriding.
3398 'AdditionalOptions': ['/Oy-'],
3401 'AdditionalOptions': [
3402 '/d2Zi+', # Improve debugging of Release builds.
3403 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3404 '<@(win_release_extra_cflags)',
3408 # LinkIncremental is a tri-state boolean, where 0 means default
3409 # (i.e., inherit from parent solution), 1 means false, and
3411 'LinkIncremental': '1',
3412 # This corresponds to the /PROFILE flag which ensures the PDB
3413 # file contains FIXUP information (growing the PDB file by about
3414 # 5%) but does not otherwise alter the output binary. This
3415 # information is used by the Syzygy optimization tool when
3416 # decomposing the release image.
3421 ['msvs_use_common_release', {
3422 'includes': ['release.gypi'],
3424 ['release_valgrind_build==0 and tsan==0', {
3427 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3431 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3432 'MEMORY_SANITIZER_INITIAL_SIZE',
3433 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3434 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3437 ['win_use_allocator_shim==0', {
3438 'defines': ['NO_TCMALLOC'],
3440 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3441 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3442 # It seems to work fine with Ubuntu 12 headers though, so use it
3443 # in official builds.
3444 ['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")', {
3445 'target_conditions': [
3446 ['chromium_code==1', {
3447 # Non-chromium code is not guaranteed to compile cleanly
3448 # with _FORTIFY_SOURCE. Also, fortified build may fail
3449 # when optimizations are disabled, so only do that for Release
3452 '_FORTIFY_SOURCE=2',
3457 ['OS=="linux" or OS=="android"', {
3458 'target_conditions': [
3459 ['_toolset=="target"', {
3461 '<@(release_extra_cflags)',
3464 ['enable_resource_whitelist_generation==1', {
3466 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3475 'NS_BLOCK_ASSERTIONS=1',
3481 # Concrete configurations
3484 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3487 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3492 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3493 'target_conditions': [
3494 [ '_type=="executable"', {
3495 # To get a real .dSYM bundle produced by dsymutil, set the
3496 # debug information format to dwarf-with-dsym. Since
3497 # strip_from_xcode will not be used, set Xcode to do the
3498 # stripping as well.
3500 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3501 'DEPLOYMENT_POSTPROCESSING': 'YES',
3502 'STRIP_INSTALLED_PRODUCT': 'YES',
3509 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3511 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3514 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3522 'target_defaults': {
3527 # TODO(glider): enable the default options on other systems.
3529 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3531 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3537 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3538 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3539 'target_defaults': {
3541 '-Wl,--fatal-warnings',
3545 ['os_posix==1 and chromeos==0', {
3546 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3547 # and we want to avoid overriding this, so stack-protector is only
3548 # enabled when not building on Chrome OS.
3549 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3551 'target_defaults': {
3553 '-fstack-protector',
3554 '--param=ssp-buffer-size=4',
3558 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3559 'target_defaults': {
3560 # Enable -Werror by default, but put it in a variable so it can
3561 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3563 'werror%': '-Werror',
3564 'libraries_for_target%': '',
3567 '_FILE_OFFSET_BITS=64',
3570 '<(werror)', # See note above about the werror variable.
3572 '-fno-strict-aliasing', # See http://crbug.com/32204
3574 # TODO(evan): turn this back on once all the builds work.
3576 # Don't warn about unused function params. We use those everywhere.
3577 '-Wno-unused-parameter',
3578 # Don't warn about the "struct foo f = {0};" initialization pattern.
3579 '-Wno-missing-field-initializers',
3580 # Don't export any symbols (for example, to plugins we dlopen()).
3581 # Note: this is *required* to make some plugins work.
3582 '-fvisibility=hidden',
3588 '-fno-threadsafe-statics',
3589 # Make inline functions have hidden visiblity by default.
3590 # Surprisingly, not covered by -fvisibility=hidden.
3591 '-fvisibility-inlines-hidden',
3592 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3593 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3597 '-pthread', '-Wl,-z,noexecstack',
3600 '<(libraries_for_target)',
3605 'debug_optimize%': '0',
3611 '-O>(debug_optimize)',
3618 # Warn in case of text relocations.
3619 '-Wl,--warn-shared-textrel',
3622 ['OS=="android" and android_full_debug==0', {
3623 # Some configurations are copied from Release_Base to reduce
3626 'debug_optimize%': 's',
3630 '-ffunction-sections',
3637 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3638 # We don't omit frame pointers on arm64 since they are required
3639 # to correctly unwind stackframes which contain system library
3640 # function frames (crbug.com/391706).
3642 '-fomit-frame-pointer',
3645 ['OS=="linux" and target_arch=="ia32"', {
3647 '-Wl,--no-as-needed',
3650 ['debug_unwind_tables==1', {
3651 'cflags': ['-funwind-tables'],
3653 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3655 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3656 # definitions in to the right scope to use them when setting
3657 # linux_use_debug_fission, so it can be used here alone.
3658 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3659 'cflags': ['-gsplit-dwarf'],
3665 'release_optimize%': '2',
3666 # Binaries become big and gold is unable to perform GC
3667 # and remove unused sections for some of test targets
3668 # on 32 bit platform.
3669 # (This is currently observed only in chromeos valgrind bots)
3670 # The following flag is to disable --gc-sections linker
3671 # option for these bots.
3672 'no_gc_sections%': 0,
3674 # TODO(bradnelson): reexamine how this is done if we change the
3675 # expansion of configurations
3676 'release_valgrind_build%': 0,
3679 '-O<(release_optimize)',
3680 # Don't emit the GCC version ident directives, they just end up
3681 # in the .comment section taking up binary size.
3683 # Put data and code in their own sections, so that unused symbols
3684 # can be removed at link time with --gc-sections.
3686 '-ffunction-sections',
3689 # Specifically tell the linker to perform optimizations.
3690 # See http://lwn.net/Articles/192624/ .
3695 ['no_gc_sections==0', {
3697 '-Wl,--gc-sections',
3700 ['OS=="android" and target_arch!="arm64"', {
3701 # We don't omit frame pointers on arm64 since they are required
3702 # to correctly unwind stackframes which contain system library
3703 # function frames (crbug.com/391706).
3705 '-fomit-frame-pointer',
3710 'release_optimize%': 's',
3713 # Warn in case of text relocations.
3714 '-Wl,--warn-shared-textrel',
3719 '-fno-omit-frame-pointer',
3723 ['profiling_full_stack_frames==1', {
3726 '-fno-optimize-sibling-calls',
3731 ['release_unwind_tables==1', {
3732 'cflags': ['-funwind-tables'],
3734 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3740 ['target_arch=="ia32"', {
3741 'target_conditions': [
3742 ['_toolset=="target"', {
3744 # Needed so that libs with .s files (e.g. libicudata.a)
3745 # are compatible with the general 32-bit-ness.
3748 # All floating-point computations on x87 happens in 80-bit
3749 # precision. Because the C and C++ language standards allow
3750 # the compiler to keep the floating-point values in higher
3751 # precision than what's specified in the source and doing so
3752 # is more efficient than constantly rounding up to 64-bit or
3753 # 32-bit precision as specified in the source, the compiler,
3754 # especially in the optimized mode, tries very hard to keep
3755 # values in x87 floating-point stack (in 80-bit precision)
3756 # as long as possible. This has important side effects, that
3757 # the real value used in computation may change depending on
3758 # how the compiler did the optimization - that is, the value
3759 # kept in 80-bit is different than the value rounded down to
3760 # 64-bit or 32-bit. There are possible compiler options to
3761 # make this behavior consistent (e.g. -ffloat-store would keep
3762 # all floating-values in the memory, thus force them to be
3763 # rounded to its original precision) but they have significant
3764 # runtime performance penalty.
3766 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3767 # which keep floating-point values in SSE registers in its
3768 # native precision (32-bit for single precision, and 64-bit
3769 # for double precision values). This means the floating-point
3770 # value used during computation does not change depending on
3771 # how the compiler optimized the code, since the value is
3772 # always kept in its specified precision.
3774 # Refer to http://crbug.com/348761 for rationale behind SSE2
3775 # being a minimum requirement for 32-bit Linux builds and
3776 # http://crbug.com/313032 for an example where this has "bit"
3781 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3788 # Use gold linker for Android ia32 target.
3794 # Install packages have started cropping up with
3795 # different headers between the 32-bit and 64-bit
3796 # versions, so we have to shadow those differences off
3797 # and make sure a 32-bit-on-64-bit build picks up the
3799 # For android build, use NDK headers instead of host headers
3800 ['host_arch!="ia32" and OS!="android"', {
3809 ['target_arch=="x64"', {
3810 'target_conditions': [
3811 ['_toolset=="target"', {
3813 # Use gold linker for Android x64 target.
3830 ['target_arch=="arm"', {
3831 'target_conditions': [
3832 ['_toolset=="target"', {
3836 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3837 # has changed whenever it encounters a varargs function. This
3838 # silences those warnings, as they are not helpful and
3839 # clutter legitimate warnings.
3843 ['clang==1 and arm_arch!="" and OS!="android"', {
3845 '-target arm-linux-gnueabihf',
3848 '-target arm-linux-gnueabihf',
3853 '-march=<(arm_arch)',
3856 ['use_lto==1 or use_lto_o2==1', {
3858 '-march=<(arm_arch)',
3863 ['clang==1 and OS!="android"', {
3865 # We need to disable clang's builtin assembler as it can't
3866 # handle several asm files, crbug.com/124610
3867 '-no-integrated-as',
3872 '-mtune=<(arm_tune)',
3875 ['use_lto==1 or use_lto_o2==1', {
3877 '-mtune=<(arm_tune)',
3887 ['use_lto==1 or use_lto_o2==1', {
3894 ['arm_float_abi!=""', {
3896 '-mfloat-abi=<(arm_float_abi)',
3899 ['use_lto==1 or use_lto_o2==1', {
3901 '-mfloat-abi=<(arm_float_abi)',
3911 ['use_lto==1 or use_lto_o2==1', {
3919 # Most of the following flags are derived from what Android
3920 # uses by default when building for arm, reference for which
3921 # can be found in the following file in the Android NDK:
3922 # toolchains/arm-linux-androideabi-4.9/setup.mk
3924 # The tree-sra optimization (scalar replacement for
3925 # aggregates enabling subsequent optimizations) leads to
3926 # invalid code generation when using the Android NDK's
3927 # compiler (r5-r7). This can be verified using
3928 # webkit_unit_tests' WTF.Checked_int8_t test.
3930 # The following option is disabled to improve binary
3931 # size and performance in gcc 4.9.
3932 '-fno-caller-saves',
3935 # Android now supports .relro sections properly.
3936 # NOTE: While these flags enable the generation of .relro
3937 # sections, the generated libraries can still be loaded on
3938 # older Android platform versions.
3945 ['gcc_version==48 and clang==0', {
3947 # The following 5 options are disabled to save on
3948 # binary size in GCC 4.8.
3949 '-fno-partial-inlining',
3950 '-fno-early-inlining',
3951 '-fno-tree-copy-prop',
3952 '-fno-tree-loop-optimize',
3953 '-fno-move-loop-invariants',
3957 'cflags': [ '-mthumb-interwork' ],
3961 # Thumb code with frame pointer makes chrome crash
3964 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3965 # The perf report sometimes incorrectly attributes
3966 # code from tail calls.
3967 '-fno-optimize-sibling-calls',
3970 '-fomit-frame-pointer',
3975 # Clang does not support the following options.
3976 '-mthumb-interwork',
3977 '-finline-limit=64',
3979 '-fno-caller-saves',
3983 # TODO(hans) Enable integrated-as (crbug.com/124610).
3984 '-no-integrated-as',
3985 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3988 # Let clang find the ld.gold in the NDK.
3989 '--gcc-toolchain=<(android_toolchain)/..',
3994 '-marm', # Required for frame pointer based stack traces.
4001 # We set arm_arch to "" so that -march compiler option
4002 # is not set. Otherwise a gcc bug that would complain
4003 # about it conflicting with '-mcpu=cortex-a9'. The flag
4004 # '-march=armv7-a' is actually redundant anyway because
4005 # it is enabled by default when we built the toolchain.
4006 # And using '-mcpu=cortex-a9' should be sufficient.
4009 # Breakpad requires symbols with debugging information
4013 # We want to statically link libstdc++/libgcc_s.
4014 '-static-libstdc++',
4018 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4019 # define their own cflags for arm builds that could
4020 # conflict with the flags we set here (e.g.
4021 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4030 ['target_arch=="arm64"', {
4031 'target_conditions': [
4032 ['_toolset=="target"', {
4036 '-fstack-protector', # stack protector is always enabled on arm64.
4043 ['target_arch=="mipsel"', {
4044 'target_conditions': [
4045 ['_toolset=="target"', {
4047 ['android_webview_build==0 and mips_arch_variant=="r6"', {
4048 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
4051 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4055 ['android_webview_build==0 and mips_arch_variant=="r2"', {
4056 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
4058 ['android_webview_build==0 and mips_arch_variant=="r1"', {
4059 'cflags': ['-mips32', '-Wa,-mips32'],
4063 '-Wl,--no-keep-memory'
4066 '-Wno-uninitialized',
4071 ['target_arch=="mips64el"', {
4072 'target_conditions': [
4073 ['_toolset=="target"', {
4075 ['android_webview_build==0 and mips_arch_variant=="r6"', {
4076 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4077 'ldflags': [ '-mips64r6' ],
4079 ['android_webview_build==0 and mips_arch_variant=="r2"', {
4080 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4081 'ldflags': [ '-mips64r2' ],
4085 '-Wno-uninitialized',
4099 'target_conditions': [
4100 ['_toolset=="target"', {
4102 '--sysroot=<(sysroot)',
4105 '--sysroot=<(sysroot)',
4106 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4112 # TODO(thakis): Remove, http://crbug.com/263960
4113 '-Wno-reserved-user-defined-literal',
4116 # gnu++11 instead of c++11 is needed because some code uses
4117 # typeof() (a GNU extension).
4118 # TODO(thakis): Eventually switch this to c++11 instead,
4119 # http://crbug.com/427584
4123 ['clang==0 and host_clang==1', {
4124 'target_conditions': [
4125 ['_toolset=="host"', {
4126 'cflags_cc': [ '-std=gnu++11', ],
4130 ['clang==1 and clang_use_chrome_plugins==1', {
4132 '<@(clang_chrome_plugins_flags)',
4135 ['clang==1 and clang_load!=""', {
4137 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4140 ['clang==1 and clang_add_plugin!=""', {
4142 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4145 ['clang==1 and target_arch=="ia32"', {
4147 # Else building libyuv gives clang's register allocator issues,
4148 # see llvm.org/PR15798 / crbug.com/233709
4149 '-momit-leaf-frame-pointer',
4150 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4151 '-mstack-alignment=16',
4155 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4157 # See http://crbug.com/110262
4158 '-fcolor-diagnostics',
4161 # Common options for AddressSanitizer, LeakSanitizer,
4162 # ThreadSanitizer and MemorySanitizer.
4163 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4164 'target_conditions': [
4165 ['_toolset=="target"', {
4167 '-fno-omit-frame-pointer',
4168 '-gline-tables-only',
4171 '-fomit-frame-pointer',
4176 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4177 'target_conditions': [
4178 ['_toolset=="target"', {
4180 # Functions interposed by the sanitizers can make ld think
4181 # that some libraries aren't needed when they actually are,
4182 # http://crbug.com/234010. As workaround, disable --as-needed.
4186 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4187 'MEMORY_SANITIZER_INITIAL_SIZE',
4193 'target_conditions': [
4194 ['_toolset=="target"', {
4196 '-fsanitize=address',
4197 # TODO(earthdok): Re-enable. http://crbug.com/427202
4198 #'-fsanitize-blacklist=<(asan_blacklist)',
4201 '-fsanitize=address',
4208 '-mllvm -asan-globals=0', # http://crbug.com/352073
4214 'target_conditions': [
4215 ['_toolset=="target"', {
4217 '-fsanitize=undefined',
4218 # -fsanitize=vptr is incompatible with -fno-rtti.
4219 '-fno-sanitize=vptr',
4222 '-fsanitize=undefined',
4223 # -fsanitize=vptr is incompatible with -fno-rtti.
4224 '-fno-sanitize=vptr',
4230 'target_conditions': [
4231 ['_toolset=="target"', {
4234 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4246 'UNDEFINED_SANITIZER',
4251 ['asan_coverage!=0', {
4252 'target_conditions': [
4253 ['_toolset=="target"', {
4255 '-mllvm -asan-coverage=<(asan_coverage)',
4260 ['asan_field_padding!=0', {
4261 'target_conditions': [
4262 ['_toolset=="target"', {
4264 '-fsanitize-address-field-padding=<(asan_field_padding)',
4270 'target_conditions': [
4271 ['_toolset=="target"', {
4280 'WTF_USE_LEAK_SANITIZER=1',
4286 'target_conditions': [
4287 ['_toolset=="target"', {
4289 '-fsanitize=thread',
4291 '-fsanitize-blacklist=<(tsan_blacklist)',
4294 '-fsanitize=thread',
4298 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4299 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4301 'target_conditions': [
4302 ['_type=="executable"', {
4312 'target_conditions': [
4313 ['_toolset=="target"', {
4315 '-fsanitize=memory',
4316 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4318 '-fsanitize-blacklist=<(msan_blacklist)',
4321 '-fsanitize=memory',
4326 'target_conditions': [
4327 ['_type=="executable"', {
4336 ['use_instrumented_libraries==1', {
4338 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4341 ['use_custom_libcxx==1', {
4343 '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4346 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4347 'target_conditions' : [
4348 # crazy_linker has an upstream gyp file we can't edit, and we
4349 # don't want to instrument it.
4350 ['_toolset=="target" and _target_name!="crazy_linker"', {
4352 '-finstrument-functions',
4353 # Allow mmx intrinsics to inline, so that the
4354 #0 compiler can expand the intrinsics.
4355 '-finstrument-functions-exclude-file-list=mmintrin.h',
4358 ['_toolset=="target" and OS=="android"', {
4360 # Avoids errors with current NDK:
4361 # "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"
4362 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4367 ['linux_dump_symbols==1', {
4370 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4371 'target_conditions': [
4372 ['_toolset=="target"', {
4374 # Attempt to use less memory to prevent the linker from
4375 # running out of address space. Considering installing a
4376 # 64-bit kernel and switching to a 64-bit linker.
4377 '-Wl,--no-keep-memory',
4384 ['use_allocator!="tcmalloc"', {
4385 'defines': ['NO_TCMALLOC'],
4387 ['linux_use_gold_flags==1', {
4388 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4390 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4391 'ldflags': [ '-fuse-ld=gold', ],
4393 'target_conditions': [
4394 ['_toolset=="target"', {
4396 # Experimentation found that using four linking threads
4397 # saved ~20% of link time.
4398 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4399 # Only apply this to the target linker, since the host
4400 # linker might not be gold, but isn't used much anyway.
4401 # TODO(raymes): Disable threading because gold is frequently
4402 # crashing on the bots: crbug.com/161942.
4404 # '-Wl,--thread-count=4',
4409 ['release_valgrind_build==0', {
4410 'target_conditions': [
4411 ['_toolset=="target"', {
4420 ['linux_use_bundled_binutils==1', {
4422 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4425 ['linux_use_bundled_gold==1', {
4426 # Put our binutils, which contains gold in the search path. We pass
4427 # the path to gold to the compiler. gyp leaves unspecified what the
4428 # cwd is when running the compiler, so the normal gyp path-munging
4429 # fails us. This hack gets the right path.
4431 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4434 # Some binutils 2.23 releases may or may not have new dtags enabled,
4435 # but they are all compatible with --disable-new-dtags,
4436 # because the new dynamic tags are not created by default.
4437 ['binutils_version>=223', {
4438 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4439 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4440 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4441 # inside this file to allow usage of --no-as-needed and removal of
4444 '-Wl,--disable-new-dtags',
4447 ['gcc_version>=47 and clang==0', {
4448 'target_conditions': [
4449 ['_toolset=="target"', {
4452 # See comment for -Wno-c++11-narrowing.
4454 # TODO(thakis): Remove, http://crbug.com/263960
4455 '-Wno-literal-suffix',
4460 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4461 'target_conditions': [
4462 ['_toolset=="host"', {
4465 # See comment for -Wno-c++11-narrowing.
4467 # TODO(thakis): Remove, http://crbug.com/263960
4468 '-Wno-literal-suffix',
4476 # FreeBSD-specific options; note that most FreeBSD options are set above,
4479 'target_defaults': {
4481 '-Wl,--no-keep-memory',
4485 # Android-specific options; note that most are set above with Linux.
4488 # This is a unique identifier for a given build. It's used for
4489 # identifying various build artifacts corresponding to a particular
4490 # build of chrome (e.g. where to find archived symbols).
4491 'chrome_build_id%': '',
4493 # Figure this out early since it needs symbols from libgcc.a, so it
4494 # has to be before that in the set of libraries.
4495 ['component=="shared_library"', {
4496 'android_stlport_library': 'stlport_shared',
4498 'android_stlport_library': 'stlport_static',
4502 # Placing this variable here prevents from forking libvpx, used
4503 # by remoting. Remoting is off, so it needn't built,
4504 # so forking it's deps seems like overkill.
4505 # But this variable need defined to properly run gyp.
4506 # A proper solution is to have an OS==android conditional
4507 # in third_party/libvpx/libvpx.gyp to define it.
4508 'libvpx_path': 'lib/linux/arm',
4510 'target_defaults': {
4512 'release_extra_cflags%': '',
4514 # If we're using the components build, append "cr" to all shared
4515 # libraries to avoid naming collisions with android system library
4516 # versions with the same name (e.g. skia, icu).
4517 ['component=="shared_library"', {
4518 'android_product_extension': 'cr.so',
4520 'android_product_extension': 'so',
4524 'target_conditions': [
4525 ['_type=="shared_library"', {
4526 'product_extension': '<(android_product_extension)',
4529 # Settings for building device targets using Android's toolchain.
4530 # These are based on the setup.mk file from the Android NDK.
4532 # The NDK Android executable link step looks as follows:
4534 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4535 # $(PRIVATE_OBJECTS) <-- The .o that we built
4536 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4537 # $(TARGET_LIBGCC) <-- libgcc.a
4538 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4539 # $(PRIVATE_LDLIBS) <-- System .so
4540 # $(TARGET_CRTEND_O) <-- crtend.o
4542 # For now the above are approximated for executables by adding
4543 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4546 # The NDK Android shared library link step looks as follows:
4548 # $(PRIVATE_OBJECTS) <-- The .o that we built
4549 # -l,--whole-archive
4550 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4551 # -l,--no-whole-archive
4552 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4553 # $(TARGET_LIBGCC) <-- libgcc.a
4554 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4555 # $(PRIVATE_LDLIBS) <-- System .so
4557 # For now, assume that whole static libraries are not needed.
4559 # For both executables and shared libraries, add the proper
4560 # libgcc.a to the start of libraries which puts it in the
4561 # proper spot after .o and .a files get linked in.
4563 # TODO: The proper thing to do longer-tem would be proper gyp
4564 # support for a custom link command line.
4565 ['_toolset=="target"', {
4567 '-pthread', # Not supported by Android toolchain.
4570 '-ffunction-sections',
4573 '-fstack-protector',
4575 '-finline-limit=64',
4576 '-Wa,--noexecstack',
4577 '<@(release_extra_cflags)',
4581 '__GNU_SOURCE=1', # Necessary for clone()
4583 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4584 'CHROME_BUILD_ID="<(chrome_build_id)"',
4587 '-pthread', # Not supported by Android toolchain.
4590 '-Wl,--no-undefined',
4593 ['component=="static_library"', {
4595 '-Wl,--exclude-libs=ALL',
4600 # Work around incompatibilities between bionic and clang
4602 '-D__compiler_offsetof=__builtin_offsetof',
4603 '-Dnan=__builtin_nan',
4606 ['target_arch=="arm"', {
4608 '-target arm-linux-androideabi',
4611 '-target arm-linux-androideabi',
4614 ['target_arch=="ia32"', {
4616 '-target x86-linux-androideabi',
4619 '-target x86-linux-androideabi',
4622 # Place holder for x64 support, not tested.
4623 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4624 ['target_arch=="x64"', {
4626 '-target x86_64-linux-androideabi',
4629 '-target x86_64-linux-androideabi',
4636 # Android build relies on -Wl,--gc-sections removing
4637 # unreachable code. ASan instrumentation for globals inhibits
4638 # this and results in a library with unresolvable relocations.
4639 # TODO(eugenis): find a way to reenable this.
4640 '-mllvm -asan-globals=0',
4643 ['target_arch=="arm"', {
4645 # TODO(hans): The ASan runtime is no longer automatically
4646 # added to the link line when using -nostdlib. Can we
4647 # stop adding -nostdlib? (crbug.com/423429)
4648 '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/lib/clang/3.6.0/lib/linux/libclang_rt.asan-arm-android.so',
4653 ['android_webview_build==0', {
4655 # The NDK has these things, but doesn't define the constants
4656 # to say that it does. Define them here instead.
4660 '--sysroot=<(android_ndk_sysroot)',
4663 '--sysroot=<(android_ndk_sysroot)',
4668 ['target_arch=="arm" and arm_thumb==1', {
4669 'thumb_option%': '-mthumb',
4671 'thumb_option%': '',
4676 '-l<(android_stlport_library)',
4677 # Manually link the libgcc.a that the cross compiler uses.
4678 '<!(<(android_toolchain)/*-gcc <(thumb_option) -print-libgcc-file-name)',
4684 ['android_webview_build==1', {
4686 # Android predefines this as 1; undefine it here so Chromium
4687 # can redefine it later to be 2 for chromium code and unset
4688 # for third party code. This works because cflags are added
4690 '-U_FORTIFY_SOURCE',
4691 # Disable any additional warnings enabled by the Android build system but which
4692 # chromium does not build cleanly with (when treating warning as errors).
4693 # Things that are part of -Wextra:
4694 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4695 '-Wno-ignored-qualifiers',
4697 '-Wno-unused-but-set-variable',
4700 # Other things unrelated to -Wextra:
4701 '-Wno-non-virtual-dtor',
4708 ['android_webview_build==1', {
4709 'target_conditions': [
4710 ['chromium_code==0', {
4712 # There is a class of warning which:
4713 # 1) Android always enables and also treats as errors
4714 # 2) Chromium ignores in third party code
4715 # So we re-enable those warnings when building Android.
4717 '-Wno-format-security',
4719 '-Wno-sequence-point',
4722 '-Wno-non-virtual-dtor',
4727 ['target_arch == "arm"', {
4729 # Enable identical code folding to reduce size.
4733 # NOTE: The stlport header include paths below are specified in
4734 # cflags rather than include_dirs because they need to come
4735 # after include_dirs. Think of them like system headers, but
4736 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4737 # toolchain (circa Gingerbread) will exhibit strange errors.
4738 # The include ordering here is important; change with caution.
4739 ['android_webview_build==0', {
4741 '-isystem<(android_stlport_include)',
4744 ['target_arch=="arm" and arm_thumb==1', {
4745 'ldflags': [ '-L<(android_stlport_libs_dir)/thumb' ]
4747 'ldflags': [ '-L<(android_stlport_libs_dir)' ]
4750 }, { # else: android_webview_build!=0
4751 'aosp_build_settings': {
4752 # Specify that we want to statically link stlport from the
4753 # NDK. This will provide all the include and library paths
4754 # automatically at build time, and link the right library.
4755 'LOCAL_NDK_STL_VARIANT': 'stlport_static',
4758 ['target_arch=="ia32"', {
4759 # The x86 toolchain currently has problems with stack-protector.
4761 '-fstack-protector',
4764 '-fno-stack-protector',
4768 'target_conditions': [
4769 ['_type=="executable"', {
4770 # Force android tools to export the "main" symbol so they can be
4771 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4772 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4773 # when ICS support will be dropped.
4776 '-fvisibility=default',
4780 '-Wl,--gc-sections',
4781 '-Wl,-z,nocopyreloc',
4784 # crtbegin_dynamic.o should be the last item in ldflags.
4785 '<(android_ndk_lib)/crtbegin_dynamic.o',
4788 # crtend_android.o needs to be the last item in libraries.
4789 # Do not add any libraries after this!
4790 '<(android_ndk_lib)/crtend_android.o',
4793 ['_type=="shared_library" or _type=="loadable_module"', {
4795 '-Wl,--exclude-libs=ALL',
4798 '-Wl,-shared,-Bsymbolic',
4801 ['android_webview_build==0', {
4803 # crtbegin_so.o should be the last item in ldflags.
4804 '<(android_ndk_lib)/crtbegin_so.o',
4807 # crtend_so.o needs to be the last item in libraries.
4808 # Do not add any libraries after this!
4809 '<(android_ndk_lib)/crtend_so.o',
4816 # Settings for building host targets using the system toolchain.
4817 ['_toolset=="host"', {
4819 # Due to issues in Clang build system, using ASan on 32-bit
4820 # binaries on x86_64 host is problematic.
4821 # TODO(eugenis): re-enable.
4822 '-fsanitize=address',
4825 '-fsanitize=address',
4826 '-Wl,-z,noexecstack',
4827 '-Wl,--gc-sections',
4830 '-Wl,--warn-shared-textrel',
4831 '-Wl,--fatal-warnings',
4834 # Settings for building host targets on mac.
4835 ['_toolset=="host" and host_os=="mac"', {
4845 'cflags!': ['-fvisibility=hidden'],
4846 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4848 ['OS=="mac" or OS=="ios"', {
4849 'target_defaults': {
4852 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4853 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4854 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4855 'COPY_PHASE_STRIP': 'NO',
4856 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4857 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4858 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4859 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4860 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4861 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4862 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4863 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4864 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4865 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4866 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4867 'GCC_VERSION': '4.2',
4868 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4869 'USE_HEADERMAP': 'NO',
4874 # Don't warn about unused function parameters.
4875 '-Wno-unused-parameter',
4876 # Don't warn about the "struct foo f = {0};" initialization
4878 '-Wno-missing-field-initializers',
4881 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4882 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4884 # Note that the prebuilt Clang binaries should not be used for iOS
4885 # development except for ASan builds.
4887 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
4888 # Warn if automatic synthesis is triggered with
4889 # the -Wobjc-missing-property-synthesis flag.
4890 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4891 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4893 # This warns on selectors from Cocoa headers (-length, -set).
4894 # cfe-dev is currently discussing the merits of this warning.
4895 # TODO(thakis): Reevaluate what to do with this, based one
4896 # cfe-dev discussion.
4897 '-Wno-selector-type-mismatch',
4900 ['clang_xcode==0', {
4901 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4902 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4906 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4908 '<@(clang_chrome_plugins_flags)',
4911 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4913 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4916 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4918 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4921 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4923 # See http://crbug.com/110262
4924 '-fcolor-diagnostics',
4927 ['OS=="ios" and target_subarch!="arm32" and \
4928 "<(GENERATOR)"=="xcode"', {
4930 # TODO(ios): when building Chrome for iOS on 64-bit platform
4931 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4932 # enabled. This cause failures when compiling protobuf code,
4933 # so disable the warning. http://crbug.com/359107
4934 '-Wno-shorten-64-to-32',
4942 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4948 '-fsanitize=address',
4949 '-mllvm -asan-globals=0', # http://crbug.com/352073
4950 '-gline-tables-only',
4954 ['asan_coverage!=0', {
4955 'target_conditions': [
4956 ['_toolset=="target"', {
4958 '-mllvm -asan-coverage=<(asan_coverage)',
4964 'target_conditions': [
4965 ['_type!="static_library"', {
4966 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4971 '-fsanitize=address',
4975 ['mac_write_linker_maps==1', {
4978 '-Wl,-map,>(_target_name).map',
4985 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4986 'target_conditions': [
4987 ['_type=="executable"', {
4993 # Define copy_asan_dylib_path in a variable ending in
4994 # _path so that gyp understands it's a path and
4995 # performs proper relativization during dict merging.
4996 'copy_asan_dylib_path':
4997 'mac/copy_asan_runtime_dylib.sh',
4999 'postbuild_name': 'Copy ASan runtime dylib',
5001 '<(copy_asan_dylib_path)',
5010 ], # target_conditions
5011 }, # target_defaults
5012 }], # OS=="mac" or OS=="ios"
5014 'target_defaults': {
5016 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5017 # with common names, like 'check', 'require', and 'verify'.
5018 # (Included by system header. Also exists on iOS but not included.)
5019 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5020 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5023 # These should end with %, but there seems to be a bug with % in
5024 # variables that are intended to be set to different values in
5025 # different targets, like these.
5026 'mac_pie': 1, # Most executables can be position-independent.
5027 # Strip debugging symbols from the target.
5028 'mac_strip': '<(mac_strip_release)',
5032 ['mac_want_real_dsym=="default"', {
5035 'mac_real_dsym': '<(mac_want_real_dsym)'
5040 ['mac_want_real_dsym=="default"', {
5041 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5043 'mac_real_dsym': '<(mac_want_real_dsym)'
5050 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5051 # (Equivalent to -fPIC)
5052 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5053 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5054 # Keep pch files below xcodebuild/.
5055 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5057 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5058 # xcode_setting, but not until all downstream projects' mac bots are
5059 # using xcode >= 4.6, because that's when the default value of the
5060 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5061 # setting is a no-op as far as xcode is concerned, but the compiler
5062 # behaves differently based on whether -fno-strict-aliasing is
5064 '-fno-strict-aliasing', # See http://crbug.com/32204.
5067 'target_conditions': [
5068 ['_type=="executable"', {
5071 # Arranges for data (heap) pages to be protected against
5072 # code execution when running on Mac OS X 10.7 ("Lion"), and
5073 # ensures that the position-independent executable (PIE) bit
5074 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5076 # Define change_mach_o_flags in a variable ending in _path
5077 # so that GYP understands it's a path and performs proper
5078 # relativization during dict merging.
5079 'change_mach_o_flags_path':
5080 'mac/change_mach_o_flags_from_xcode.sh',
5081 'change_mach_o_flags_options%': [
5083 'target_conditions': [
5084 ['mac_pie==0 or release_valgrind_build==1', {
5085 # Don't enable PIE if it's unwanted. It's unwanted if
5086 # the target specifies mac_pie=0 or if building for
5087 # Valgrind, because Valgrind doesn't understand slide.
5088 # See the similar mac_pie/release_valgrind_build check
5090 'change_mach_o_flags_options': [
5096 'postbuild_name': 'Change Mach-O Flags',
5098 '<(change_mach_o_flags_path)',
5099 '>@(change_mach_o_flags_options)',
5106 'asan_saves_file': 'asan.saves',
5109 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
5113 'target_conditions': [
5114 ['mac_pie==1 and release_valgrind_build==0', {
5115 # Turn on position-independence (ASLR) for executables. When
5116 # PIE is on for the Chrome executables, the framework will
5117 # also be subject to ASLR.
5118 # Don't do this when building for Valgrind, because Valgrind
5119 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5120 # understand slide, and get rid of the Valgrind check.
5123 '-Wl,-pie', # Position-independent executable (MH_PIE)
5129 ['(_type=="executable" or _type=="shared_library" or \
5130 _type=="loadable_module") and mac_strip!=0', {
5131 'target_conditions': [
5132 ['mac_real_dsym == 1', {
5133 # To get a real .dSYM bundle produced by dsymutil, set the
5134 # debug information format to dwarf-with-dsym. Since
5135 # strip_from_xcode will not be used, set Xcode to do the
5136 # stripping as well.
5140 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5141 'DEPLOYMENT_POSTPROCESSING': 'YES',
5142 'STRIP_INSTALLED_PRODUCT': 'YES',
5143 'target_conditions': [
5144 ['_type=="shared_library" or _type=="loadable_module"', {
5145 # The Xcode default is to strip debugging symbols
5146 # only (-S). Local symbols should be stripped as
5147 # well, which will be handled by -x. Xcode will
5148 # continue to insert -S when stripping even when
5149 # additional flags are added with STRIPFLAGS.
5151 }], # _type=="shared_library" or _type=="loadable_module"
5152 ['_type=="executable"', {
5155 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
5158 }], # _type=="executable" and asan==1
5159 ], # target_conditions
5161 }, # configuration "Release"
5163 }, { # mac_real_dsym != 1
5164 # To get a fast fake .dSYM bundle, use a post-build step to
5165 # produce the .dSYM and strip the executable. strip_from_xcode
5166 # only operates in the Release configuration.
5170 # Define strip_from_xcode in a variable ending in _path
5171 # so that gyp understands it's a path and performs proper
5172 # relativization during dict merging.
5173 'strip_from_xcode_path': 'mac/strip_from_xcode',
5175 'postbuild_name': 'Strip If Needed',
5176 'action': ['<(strip_from_xcode_path)'],
5180 ], # target_conditions
5181 }], # (_type=="executable" or _type=="shared_library" or
5182 # _type=="loadable_module") and mac_strip!=0
5183 ], # target_conditions
5184 }, # target_defaults
5187 'target_defaults': {
5188 'xcode_settings' : {
5189 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5192 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5193 # additional flag to suppress the "unknown compiler option" error.
5194 # Restrict this flag to builds that are either compiling with Xcode
5195 # or compiling with Xcode's Clang. This will allow Ninja builds to
5196 # continue failing on unknown compiler options.
5197 # TODO(rohitrao): This flag is temporary and should be removed as
5198 # soon as the iOS bots are updated to use Xcode 5.1.
5199 ['clang_xcode==1', {
5201 '-Wno-unknown-warning-option',
5205 # Limit the valid architectures depending on "target_subarch".
5206 # This need to include the "arm" architectures but also the "x86"
5207 # ones (they are used when building for the simulator).
5208 ['target_subarch=="arm32"', {
5209 'VALID_ARCHS': ['armv7', 'i386'],
5211 ['target_subarch=="arm64"', {
5212 'VALID_ARCHS': ['arm64', 'x86_64'],
5214 ['target_subarch=="both"', {
5215 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5217 ['use_system_libcxx==1', {
5218 'target_conditions': [
5219 # Only use libc++ when building target for iOS not when building
5220 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5221 # does not support libc++.
5222 ['_toolset=="target"', {
5223 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5227 # The default for deployment target of 7.0+ is libc++, so force
5228 # the old behavior unless libc++ is enabled.
5229 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5233 'target_conditions': [
5234 ['_toolset=="host"', {
5236 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5237 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5246 ['_toolset=="target"', {
5248 # This section should be for overriding host settings. But,
5249 # since we can't negate the iphone deployment target above, we
5250 # instead set it here for target only.
5251 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5252 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5255 ['_type=="executable"', {
5259 'DEPLOYMENT_POSTPROCESSING': 'YES',
5260 'STRIP_INSTALLED_PRODUCT': 'YES',
5265 # Remove dSYM to reduce build time.
5266 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5272 ['chromium_ios_signing', {
5273 # iOS SDK wants everything for device signed.
5274 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5276 'CODE_SIGNING_REQUIRED': 'NO',
5277 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5282 ], # target_conditions
5283 }, # target_defaults
5286 'target_defaults': {
5288 '_WIN32_WINNT=0x0602',
5295 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5296 'WIN32_LEAN_AND_MEAN',
5298 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5299 '_HAS_EXCEPTIONS=0',
5302 ['buildtype=="Official"', {
5303 # In official builds, targets can self-select an optimization
5304 # level by defining a variable named 'optimize', and setting it
5306 # - "size", optimizes for minimal code size - the default.
5307 # - "speed", optimizes for speed over code size.
5308 # - "max", whole program optimization and link-time code
5309 # generation. This is very expensive and should be used
5312 'optimize%': 'size',
5316 # Set /LTCG for the official builds.
5317 'LinkTimeCodeGeneration': '1',
5320 'target_conditions': [
5321 ['optimize=="size"', {
5323 'VCCLCompilerTool': {
5324 # 1, optimizeMinSpace, Minimize Size (/O1)
5325 'Optimization': '1',
5326 # 2, favorSize - Favor small code (/Os)
5327 'FavorSizeOrSpeed': '2',
5332 ['optimize=="speed"', {
5334 'VCCLCompilerTool': {
5335 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5336 'Optimization': '2',
5337 # 1, favorSpeed - Favor fast code (/Ot)
5338 'FavorSizeOrSpeed': '1',
5343 ['optimize=="max"', {
5344 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5345 # builds. Probably anything that this would catch that
5346 # wouldn't be caught in a normal build isn't going to
5347 # actually be a bug, so the incremental value of C4702 for
5348 # PGO builds is likely very small.
5349 'msvs_disabled_warnings': [
5353 'VCCLCompilerTool': {
5354 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5355 'Optimization': '2',
5356 # 1, favorSpeed - Favor fast code (/Ot)
5357 'FavorSizeOrSpeed': '1',
5358 # This implies link time code generation.
5359 'WholeProgramOptimization': 'true',
5377 'AdditionalLibraryDirectories':
5378 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5380 'VCLibrarianTool': {
5381 'AdditionalLibraryDirectories':
5382 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5388 'VCLibrarianTool': {
5389 'AdditionalLibraryDirectories':
5390 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5393 'AdditionalLibraryDirectories':
5394 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5399 # https://code.google.com/p/chromium/issues/detail?id=372451#c20
5400 # Warning 4702 ("Unreachable code") should be re-enabled once
5401 # Express users are updated to VS2013 Update 2.
5402 'msvs_disabled_warnings': [
5406 'VCCLCompilerTool': {
5407 'AdditionalOptions!': [
5408 '/Zc:inline', # Not supported on non-updated Express.
5412 # Explicitly required when using the ATL with express
5413 'AdditionalDependencies': ['atlthunk.lib'],
5415 # ATL 8.0 included in WDK 7.1 makes the linker to generate
5416 # almost eight hundred LNK4254 and LNK4078 warnings:
5417 # - warning LNK4254: section 'ATL' (50000040) merged into
5418 # '.rdata' (40000040) with different attributes
5419 # - warning LNK4078: multiple 'ATL' sections found with
5420 # different attributes
5421 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
5424 'msvs_system_include_dirs': [
5425 '<(windows_driver_kit_path)/inc/atl71',
5426 '<(windows_driver_kit_path)/inc/mfc42',
5430 'msvs_system_include_dirs': [
5431 '<(windows_sdk_path)/Include/shared',
5432 '<(windows_sdk_path)/Include/um',
5433 '<(windows_sdk_path)/Include/winrt',
5434 '$(VSInstallDir)/VC/atlmfc/include',
5436 'msvs_cygwin_shell': 0,
5437 'msvs_disabled_warnings': [
5438 # C4127: conditional expression is constant
5439 # This warning can in theory catch dead code and other problems, but
5440 # triggers in far too many desirable cases where the conditional
5441 # expression is either set by macros or corresponds some legitimate
5442 # compile-time constant expression (due to constant template args,
5443 # conditionals comparing the sizes of different types, etc.). Some of
5444 # these can be worked around, but it's not worth it.
5447 # C4351: new behavior: elements of array 'array' will be default
5449 # This is a silly "warning" that basically just alerts you that the
5450 # compiler is going to actually follow the language spec like it's
5451 # supposed to, instead of not following it like old buggy versions
5452 # did. There's absolutely no reason to turn this on.
5455 # C4355: 'this': used in base member initializer list
5456 # It's commonly useful to pass |this| to objects in a class'
5457 # initializer list. While this warning can catch real bugs, most of
5458 # the time the constructors in question don't attempt to call methods
5459 # on the passed-in pointer (until later), and annotating every legit
5460 # usage of this is simply more hassle than the warning is worth.
5463 # C4503: 'identifier': decorated name length exceeded, name was
5465 # This only means that some long error messages might have truncated
5466 # identifiers in the presence of lots of templates. It has no effect
5467 # on program correctness and there's no real reason to waste time
5468 # trying to prevent it.
5471 # C4611: interaction between 'function' and C++ object destruction is
5473 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5474 # suggests using exceptions instead of setjmp/longjmp for C++, but
5475 # Chromium code compiles without exception support. We therefore have
5476 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5477 # means we have to turn off this warning (and be careful about how
5478 # object destruction happens in such cases).
5481 # TODO(maruel): These warnings are level 4. They will be slowly
5482 # removed as code is fixed.
5483 4100, # Unreferenced formal parameter
5484 4121, # Alignment of a member was sensitive to packing
5485 4189, # Local variable is initialized but not referenced
5486 4244, # Conversion from 'type1' to 'type2', possible loss of data
5487 4481, # Nonstandard extension used: override specifier 'keyword'
5488 4505, # Unreferenced local function has been removed
5489 4510, # Default constructor could not be generated
5490 4512, # Assignment operator could not be generated
5491 4610, # Object can never be instantiated
5494 'VCCLCompilerTool': {
5495 'AdditionalOptions': ['/MP'],
5496 'MinimalRebuild': 'false',
5497 'BufferSecurityCheck': 'true',
5498 'EnableFunctionLevelLinking': 'true',
5499 'RuntimeTypeInfo': 'false',
5500 'WarningLevel': '4',
5501 'WarnAsError': 'true',
5502 'DebugInformationFormat': '3',
5503 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5504 'ExceptionHandling': '0',
5506 'VCLibrarianTool': {
5507 'AdditionalOptions': ['/ignore:4221'],
5508 'AdditionalLibraryDirectories': [
5509 '<(windows_sdk_path)/Lib/win8/um/x86',
5513 'AdditionalDependencies': [
5525 'AdditionalLibraryDirectories': [
5526 '<(windows_sdk_path)/Lib/win8/um/x86',
5528 'GenerateDebugInformation': 'true',
5529 'MapFileName': '$(OutDir)\\$(TargetName).map',
5530 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5531 'FixedBaseAddress': '1',
5534 # 1 == /SUBSYSTEM:CONSOLE
5535 # 2 == /SUBSYSTEM:WINDOWS
5536 # Most of the executables we'll ever create are tests
5537 # and utilities with console output.
5541 'GenerateStublessProxies': 'true',
5542 'TypeLibraryName': '$(InputName).tlb',
5543 'OutputDirectory': '$(IntDir)',
5544 'HeaderFileName': '$(InputName).h',
5545 'DLLDataFileName': '$(InputName).dlldata.c',
5546 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5547 'ProxyFileName': '$(InputName)_p.c',
5549 'VCResourceCompilerTool': {
5551 'AdditionalIncludeDirectories': [
5553 '<(SHARED_INTERMEDIATE_DIR)',
5556 'target_conditions': [
5557 ['_type=="executable"', {
5559 'EmbedManifest': 'true',
5562 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5564 'AdditionalManifestFiles': [
5565 '>(win_exe_compatibility_manifest)',
5572 # Building with Clang on Windows is a work in progress and very
5573 # experimental. See crbug.com/82385.
5574 'VCCLCompilerTool': {
5575 'WarnAsError': 'false',
5576 'RuntimeTypeInfo': 'false',
5577 'AdditionalOptions': [
5578 '-fmsc-version=1800',
5581 # Many files use intrinsics without including this header.
5582 # TODO(hans): Fix those files, or move this to sub-GYPs.
5585 # TODO(hans): Make this list shorter eventually.
5586 '-Qunused-arguments',
5587 '-Wno-c++11-compat-deprecated-writable-strings',
5588 '-Wno-deprecated-declarations',
5590 '-Wno-enum-conversion',
5591 '-Wno-extra-tokens',
5592 '-Wno-ignored-attributes',
5593 '-Wno-incompatible-pointer-types',
5594 '-Wno-int-to-void-pointer-cast',
5595 '-Wno-invalid-noreturn',
5596 '-Wno-logical-op-parentheses',
5598 '-Wno-missing-braces',
5599 '-Wno-missing-declarations',
5600 '-Wno-msvc-include',
5601 '-Wno-null-dereference',
5602 '-Wno-overloaded-virtual',
5604 '-Wno-pointer-sign',
5606 '-Wno-return-type-c-linkage',
5608 '-Wno-sometimes-uninitialized',
5610 '-Wno-tautological-compare',
5611 '-Wno-unknown-pragmas',
5613 '-Wno-unused-function',
5614 '-Wno-unused-private-field',
5615 '-Wno-unused-value',
5616 '-Wno-unused-variable',
5617 '-Wno-unused-local-typedef', # http://crbug.com/411648
5618 '-Wno-inconsistent-missing-override', #http://crbug.com/428099
5623 # ASan on Windows is a work in progress and very experimental.
5624 # See crbug.com/345874.
5625 'VCCLCompilerTool': {
5626 'AdditionalOptions': [
5627 '-fsanitize=address',
5629 'AdditionalIncludeDirectories': [
5630 # MSVC needs to be able to find the sanitizer headers when
5631 # invoked via /fallback. This is critical for using macros
5632 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5634 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/include_sanitizer',
5638 'AdditionalLibraryDirectories': [
5639 # TODO(hans): If make_clang_dir is absolute, this breaks.
5640 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/lib/windows',
5643 'target_conditions': [
5644 ['component=="shared_library"', {
5646 'AdditionalDependencies': [
5647 'clang_rt.asan_dynamic-i386.lib',
5648 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5652 ['_type=="executable" and component=="static_library"', {
5654 'AdditionalDependencies': [
5655 'clang_rt.asan-i386.lib',
5659 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5661 'AdditionalDependencies': [
5662 'clang_rt.asan_dll_thunk-i386.lib',
5672 ['disable_nacl==1', {
5673 'target_defaults': {
5679 ['OS=="win" and msvs_use_common_linker_extras', {
5680 'target_defaults': {
5695 'AdditionalOptions': [
5704 'AdditionalOptions': ['/largeaddressaware'],
5713 'AdditionalOptions': [
5714 # safeseh is not compatible with x64
5726 ['enable_new_npdevice_api==1', {
5727 'target_defaults': {
5729 'ENABLE_NEW_NPDEVICE_API',
5733 # Don't warn about the "typedef 'foo' locally defined but not used"
5734 # for gcc 4.8 and higher.
5735 # TODO: remove this flag once all builds work. See crbug.com/227506
5736 ['gcc_version>=48 and clang==0', {
5737 'target_defaults': {
5739 '-Wno-unused-local-typedefs',
5743 ['gcc_version>=48 and clang==0 and host_clang==1', {
5744 'target_defaults': {
5745 'target_conditions': [
5746 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5750 # In the android webview build, force host targets to be compiled with clang
5751 # as the hermetic host gcc is very old on some platforms. This is already
5752 # the default on the current development version of AOSP but we force it
5753 # here in case we need to compile against an older release version. We also
5754 # explicitly set it to false for target binaries to avoid causing problems
5755 # for the work to enable clang by default in AOSP. We also force the use of
5756 # libstdc++ on host as peculiarities of the android gyp backend mean that
5757 # using libc++ doesn't work, and Chromium doesn't yet require a more modern
5759 ['android_webview_build==1', {
5760 'target_defaults': {
5761 'target_conditions': [
5762 ['_toolset=="host"', {
5763 'aosp_build_settings': {
5764 'LOCAL_CLANG': 'true',
5765 'LOCAL_CXX_STL': 'libstdc++',
5767 }, { # else: _toolset != "host"
5768 'aosp_build_settings': {
5769 'LOCAL_CLANG': 'false',
5775 # We need a special case to handle the android webview build on mac because
5776 # the host gcc there doesn't accept this flag, but the target gcc may
5778 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5779 'target_defaults': {
5780 'target_conditions': [
5781 ['_toolset=="host"', {
5783 '-Wno-unused-local-typedefs',
5789 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5791 'make_global_settings': [
5792 ['CC', '<(make_clang_dir)/bin/clang'],
5793 ['CXX', '<(make_clang_dir)/bin/clang++'],
5794 ['CC.host', '$(CC)'],
5795 ['CXX.host', '$(CXX)'],
5798 ['clang==1 and OS=="win"', {
5799 'make_global_settings': [
5800 # On Windows, gyp's ninja generator only looks at CC.
5801 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5804 ['OS=="android" and clang==0', {
5805 # Hardcode the compiler names in the Makefile so that
5806 # it won't depend on the environment at make time.
5807 'make_global_settings': [
5808 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5809 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5810 ['CC.host', '<(host_cc)'],
5811 ['CXX.host', '<(host_cxx)'],
5814 ['OS=="linux" and target_arch=="mipsel"', {
5815 'make_global_settings': [
5816 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5817 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5818 ['CC.host', '<(host_cc)'],
5819 ['CXX.host', '<(host_cxx)'],
5822 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5823 # Set default ARM cross compiling on linux. These can be overridden
5824 # using CC/CXX/etc environment variables.
5825 'make_global_settings': [
5826 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5827 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5828 ['CC.host', '<(host_cc)'],
5829 ['CXX.host', '<(host_cxx)'],
5833 # TODO(yyanagisawa): supports GENERATOR==make
5834 # make generator doesn't support CC_wrapper without CC
5835 # in make_global_settings yet.
5836 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5837 'make_global_settings': [
5838 ['CC_wrapper', '<(gomadir)/gomacc'],
5839 ['CXX_wrapper', '<(gomadir)/gomacc'],
5840 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5841 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5845 'target_defaults': {
5846 'target_conditions': [
5847 ['_toolset=="target"', {
5850 '-ffat-lto-objects',
5856 ['use_lto==1 or use_lto_o2==1', {
5857 'target_defaults': {
5858 'target_conditions': [
5859 ['_toolset=="target"', {
5869 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5870 # This block adds *project-wide* configuration settings to each project
5871 # file. It's almost always wrong to put things here. Specify your
5872 # custom xcode_settings in target_defaults to add them to targets instead.
5875 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5876 # setting sets the SDK on a project-wide basis. In order to get the
5877 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5878 # here at the project level.
5881 ['mac_sdk_path==""', {
5882 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5884 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5890 ['ios_sdk_path==""', {
5892 # TODO(justincohen): Ninja only supports simulator for now.
5893 ['"<(GENERATOR)"=="xcode"', {
5894 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5896 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5900 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5905 # Target both iPhone and iPad.
5906 'TARGETED_DEVICE_FAMILY': '1,2',
5909 ['target_arch=="x64"', {
5914 ['target_arch=="ia32"', {
5923 # The Xcode generator will look for an xcode_settings section at the root
5924 # of each dict and use it to apply settings on a file-wide basis. Most
5925 # settings should not be here, they should be in target-specific
5926 # xcode_settings sections, or better yet, should use non-Xcode-specific
5927 # settings in target dicts. SYMROOT is a special case, because many other
5928 # Xcode variables depend on it, including variables such as
5929 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5930 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5931 # files to appear (when present) in the UI as actual files and not red
5932 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5933 # and therefore SYMROOT, needs to be set at the project level.
5934 'SYMROOT': '<(DEPTH)/xcodebuild',