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 printing support and UI. This variable is used to configure
491 # which parts of printing will be built. 0 disables printing completely,
492 # 1 enables it fully, and 2 enables only the codepath to generate a
493 # Metafile (e.g. usually a PDF or EMF) and disables print preview, cloud
495 'enable_printing%': 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_printing%': 2,
774 'enable_task_manager%':0,
778 # Android OS includes support for proprietary codecs regardless of
779 # building Chromium or Google Chrome. We also ship Google Chrome and
780 # Chromecast with proprietary codecs.
781 ['OS=="android" or branding=="Chrome" or chromecast==1', {
782 'proprietary_codecs%': 1,
784 'proprietary_codecs%': 0,
787 ['OS=="mac" or OS=="ios"', {
788 'native_discardable_memory%': 1,
789 'native_memory_pressure_signals%': 1,
792 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
793 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
794 'enable_autofill_dialog%': 1,
797 ['buildtype=="Official"', {
798 'enable_prod_wallet_service%': 1,
808 'disable_ftp_support%': 1,
809 'enable_extensions%': 0,
810 'enable_google_now%': 0,
812 'enable_printing%': 0,
813 'enable_session_service%': 0,
819 'enable_managed_users%': 0,
820 'enable_task_manager%': 0,
821 'use_system_libcxx%': 1,
822 'support_pre_M6_history_database%': 0,
825 # Use GPU accelerated cross process image transport by default
826 # on linux builds with the Aura window manager
827 ['use_aura==1 and OS=="linux"', {
828 'ui_compositor_image_transport%': 1,
830 'ui_compositor_image_transport%': 0,
833 # Turn precompiled headers on by default.
834 ['OS=="win" and buildtype!="Official"', {
835 'chromium_win_pch%': 1
838 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
839 'enable_plugin_installation%': 0,
841 'enable_plugin_installation%': 1,
844 # Whether PPAPI is enabled.
845 ['OS=="android" or OS=="ios" or embedded==1', {
846 'enable_plugins%': 0,
848 'enable_plugins%': 1,
851 # linux_use_bundled_gold: whether to use the gold linker binary checked
852 # into third_party/binutils. Force this off via GYP_DEFINES when you
853 # are using a custom toolchain and need to control -B in ldflags.
854 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
855 # for component=static_library builds.
856 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
857 'linux_use_bundled_gold%': 1,
859 'linux_use_bundled_gold%': 0,
862 # linux_use_bundled_binutils: whether to use the binary binutils
863 # checked into third_party/binutils. These are not multi-arch so cannot
864 # be used except on x86 and x86-64 (the only two architectures which
865 # are currently checke in). Force this off via GYP_DEFINES when you
866 # are using a custom toolchain and need to control -B in cflags.
867 ['OS=="linux" and (target_arch=="x64")', {
868 'linux_use_bundled_binutils%': 1,
870 'linux_use_bundled_binutils%': 0,
873 # linux_use_gold_flags: whether to use build flags that rely on gold.
874 # On by default for x64 Linux.
875 ['OS=="linux" and target_arch=="x64"', {
876 'linux_use_gold_flags%': 1,
878 'linux_use_gold_flags%': 0,
881 # linux_use_debug_fission: whether to use split DWARF debug info
882 # files. This can reduce link time significantly, but is incompatible
883 # with some utilities such as icecc and ccache. Requires gold and
884 # gcc >= 4.8 or clang.
885 # http://gcc.gnu.org/wiki/DebugFission
886 ['OS=="linux" and target_arch=="x64"', {
887 'linux_use_debug_fission%': 1,
889 'linux_use_debug_fission%': 0,
892 ['OS=="android" or OS=="ios"', {
893 'enable_captive_portal_detection%': 0,
895 'enable_captive_portal_detection%': 1,
898 # Enable Skia UI text drawing incrementally on different platforms.
899 # http://crbug.com/105550
901 # On Aura, this allows per-tile painting to be used in the browser
904 'use_canvas_skia%': 1,
908 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
909 'use_libjpeg_turbo%': 0,
912 # Do not enable the Settings App on ChromeOS.
913 ['enable_app_list==1 and chromeos==0', {
914 'enable_settings_app%': 1,
916 'enable_settings_app%': 0,
919 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
920 # Set some defaults for arm/linux chrome builds
921 'use_allocator%': 'none',
922 # sysroot needs to be an absolute path otherwise it generates
923 # incorrect results when passed to pkg-config
924 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot',
925 }], # OS=="linux" and target_arch=="arm" and chromeos==0
927 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
929 ['target_arch=="x64"', {
930 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
932 ['target_arch=="ia32"', {
933 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
936 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
938 ['OS=="linux" and target_arch=="mipsel"', {
939 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
940 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
943 # Whether tests targets should be run, archived or just have the
944 # dependencies verified. All the tests targets have the '_run' suffix,
945 # e.g. base_unittests_run runs the target base_unittests. The test
946 # target always calls tools/swarming_client/isolate.py. See the script's
947 # --help for more information. Meant to be overriden with GYP_DEFINES.
948 # TODO(maruel): Remove the conditions as more configurations are
950 ['OS!="ios" and OS!="android" and chromeos==0', {
951 'test_isolation_mode%': 'check',
953 'test_isolation_mode%': 'noop',
955 # Whether Android build uses OpenMAX DL FFT.
956 ['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")', {
957 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
958 # When enabled, this will also enable WebAudio support on
959 # Android for these architectures. Default is enabled. Whether
960 # WebAudio is actually available depends on runtime settings
962 'use_openmax_dl_fft%': 1,
964 'use_openmax_dl_fft%': 0,
966 ['OS=="win" or OS=="linux"', {
970 # Turns on compiler optimizations in V8 in Debug build, except
971 # on android_clang, where we're hitting a weird linker error.
972 # TODO(dpranke): http://crbug.com/266155 .
974 'v8_optimized_debug%': 1,
976 'v8_optimized_debug%': 2,
979 # Disable various features by default on embedded.
982 'enable_printing%': 0,
985 # By default, use ICU data file (icudtl.dat) on all platforms
986 # except when building Android WebView or Chromecast.
987 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
988 # Set the data reduction proxy origin for Android Webview.
989 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0', {
990 'icu_use_data_file_flag%' : 1,
992 'icu_use_data_file_flag%' : 0,
994 ['OS=="win" or OS=="mac"', {
995 'enable_wifi_bootstrapping%' : 1,
998 # Path to sas.dll, which provides the SendSAS function.
999 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1000 ['target_arch=="x64"', {
1001 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1003 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1006 # Turn on JNI generation optimizations on non-WebView builds.
1007 ['OS=="android" and android_webview_build==0', {
1008 'optimize_jni_generation%': 1,
1010 'optimize_jni_generation%': 0,
1013 # TODO(baixo): Enable v8_use_external_startup_data
1014 # http://crbug.com/421063
1015 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0', {
1016 'v8_use_external_startup_data': 0,
1018 'v8_use_external_startup_data': 0,
1022 # Set this to 1 to enable use of concatenated impulse responses
1023 # for the HRTF panner in WebAudio.
1024 'use_concatenated_impulse_responses': 1,
1026 # You can set the variable 'use_official_google_api_keys' to 1
1027 # to use the Google-internal file containing official API keys
1028 # for Google Chrome even in a developer build. Setting this
1029 # variable explicitly to 1 will cause your build to fail if the
1030 # internal file is missing.
1032 # The variable is documented here, but not handled in this file;
1033 # see //google_apis/determine_use_official_keys.gypi for the
1036 # Set the variable to 0 to not use the internal file, even when
1037 # it exists in your checkout.
1039 # Leave it unset in your include.gypi to have the variable
1040 # implicitly set to 1 if you have
1041 # src/google_apis/internal/google_chrome_api_keys.h in your
1042 # checkout, and implicitly set to 0 if not.
1044 # Note that official builds always behave as if the variable
1045 # was explicitly set to 1, i.e. they always use official keys,
1046 # and will fail to build if the internal file is missing.
1048 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1049 # include.gypi or by other means. Due to subtleties of GYP, this
1050 # is not the same as leaving the variable unset, even though its
1052 # //google_apis/determine_use_official_keys.gypi is 2.
1054 # Set these to bake the specified API keys and OAuth client
1055 # IDs/secrets into your build.
1057 # If you create a build without values baked in, you can instead
1058 # set environment variables to provide the keys at runtime (see
1059 # src/google_apis/google_api_keys.h for details). Features that
1060 # require server-side APIs may fail to work if no keys are
1063 # Note that if you are building an official build or if
1064 # use_official_google_api_keys has been set to 1 (explicitly or
1065 # implicitly), these values will be ignored and the official
1066 # keys will be used instead.
1067 'google_api_key%': '',
1068 'google_default_client_id%': '',
1069 'google_default_client_secret%': '',
1070 # Native Client is enabled by default.
1071 'disable_nacl%': '0',
1073 # Set to 1 to support old history files
1074 'support_pre_M6_history_database%': '1',
1077 # Copy conditionally-set variables out one scope.
1078 'branding%': '<(branding)',
1079 'buildtype%': '<(buildtype)',
1080 'target_arch%': '<(target_arch)',
1081 'target_subarch%': '<(target_subarch)',
1082 'mips_arch_variant%': '<(mips_arch_variant)',
1083 'host_arch%': '<(host_arch)',
1084 'toolkit_views%': '<(toolkit_views)',
1085 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1086 'use_aura%': '<(use_aura)',
1087 'use_ash%': '<(use_ash)',
1088 'use_cras%': '<(use_cras)',
1089 'use_libpci%': '<(use_libpci)',
1090 'use_openssl%': '<(use_openssl)',
1091 'use_openssl_certs%': '<(use_openssl_certs)',
1092 'use_nss%': '<(use_nss)',
1093 'use_udev%': '<(use_udev)',
1094 'os_bsd%': '<(os_bsd)',
1095 'os_posix%': '<(os_posix)',
1096 'use_dbus%': '<(use_dbus)',
1097 'use_glib%': '<(use_glib)',
1098 'use_pango%': '<(use_pango)',
1099 'use_cairo%': '<(use_cairo)',
1100 'use_ozone%': '<(use_ozone)',
1101 'use_ozone_evdev%': '<(use_ozone_evdev)',
1102 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1103 'desktop_linux%': '<(desktop_linux)',
1104 'use_x11%': '<(use_x11)',
1105 'use_gnome_keyring%': '<(use_gnome_keyring)',
1106 'linux_fpic%': '<(linux_fpic)',
1107 'chromeos%': '<(chromeos)',
1108 'chromecast%': '<(chromecast)',
1109 'enable_viewport%': '<(enable_viewport)',
1110 'enable_hidpi%': '<(enable_hidpi)',
1111 'use_xi2_mt%':'<(use_xi2_mt)',
1112 'image_loader_extension%': '<(image_loader_extension)',
1113 'fastbuild%': '<(fastbuild)',
1114 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1115 'win_z7%': '<(win_z7)',
1116 'dcheck_always_on%': '<(dcheck_always_on)',
1117 'tracing_like_official_build%': '<(tracing_like_official_build)',
1118 'arm_version%': '<(arm_version)',
1119 'arm_neon%': '<(arm_neon)',
1120 'arm_neon_optional%': '<(arm_neon_optional)',
1121 'sysroot%': '<(sysroot)',
1122 'chroot_cmd%': '<(chroot_cmd)',
1123 'system_libdir%': '<(system_libdir)',
1124 'component%': '<(component)',
1125 'win_analyze%': '<(win_analyze)',
1126 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1127 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1128 'use_third_party_translations%': '<(use_third_party_translations)',
1129 'remoting%': '<(remoting)',
1130 'enable_one_click_signin%': '<(enable_one_click_signin)',
1131 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1132 'enable_webrtc%': '<(enable_webrtc)',
1133 'chromium_win_pch%': '<(chromium_win_pch)',
1134 'configuration_policy%': '<(configuration_policy)',
1135 'safe_browsing%': '<(safe_browsing)',
1136 'enable_web_speech%': '<(enable_web_speech)',
1137 'notifications%': '<(notifications)',
1138 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1139 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1141 'asan_blacklist%': '<(asan_blacklist)',
1142 'asan_coverage%': '<(asan_coverage)',
1143 'asan_field_padding%': '<(asan_field_padding)',
1144 'use_sanitizer_options%': '<(use_sanitizer_options)',
1145 'syzyasan%': '<(syzyasan)',
1146 'syzygy_optimize%': '<(syzygy_optimize)',
1149 'msan_blacklist%': '<(msan_blacklist)',
1150 'msan_track_origins%': '<(msan_track_origins)',
1152 'tsan_blacklist%': '<(tsan_blacklist)',
1153 'ubsan%': '<(ubsan)',
1154 'ubsan_vptr%': '<(ubsan_vptr)',
1155 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1156 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1157 'use_custom_libcxx%': '<(use_custom_libcxx)',
1158 'use_system_libcxx%': '<(use_system_libcxx)',
1159 'clang_type_profiler%': '<(clang_type_profiler)',
1160 'order_profiling%': '<(order_profiling)',
1161 'order_text_section%': '<(order_text_section)',
1162 'enable_extensions%': '<(enable_extensions)',
1163 'enable_plugin_installation%': '<(enable_plugin_installation)',
1164 'enable_plugins%': '<(enable_plugins)',
1165 'enable_session_service%': '<(enable_session_service)',
1166 'enable_themes%': '<(enable_themes)',
1167 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1168 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1169 'enable_background%': '<(enable_background)',
1170 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1171 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1172 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1173 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1174 'use_canvas_skia%': '<(use_canvas_skia)',
1175 'test_isolation_mode%': '<(test_isolation_mode)',
1176 'test_isolation_outdir%': '<(test_isolation_outdir)',
1177 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1178 'enable_printing%': '<(enable_printing)',
1179 'enable_spellcheck%': '<(enable_spellcheck)',
1180 'enable_google_now%': '<(enable_google_now)',
1181 'cld_version%': '<(cld_version)',
1182 'cld2_table_size%': '<(cld2_table_size)',
1183 'cld2_data_source%': '<(cld2_data_source)',
1184 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1185 'disable_file_support%': '<(disable_file_support)',
1186 'disable_ftp_support%': '<(disable_ftp_support)',
1187 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1188 'enable_task_manager%': '<(enable_task_manager)',
1189 'sas_dll_path%': '<(sas_dll_path)',
1190 'wix_path%': '<(wix_path)',
1191 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1192 'use_system_libjpeg%': '<(use_system_libjpeg)',
1193 'android_channel%': '<(android_channel)',
1194 'android_webview_build%': '<(android_webview_build)',
1195 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
1196 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1197 'gyp_managed_install%': 0,
1198 'create_standalone_apk%': 1,
1199 'enable_app_list%': '<(enable_app_list)',
1200 'use_default_render_theme%': '<(use_default_render_theme)',
1201 'enable_settings_app%': '<(enable_settings_app)',
1202 'google_api_key%': '<(google_api_key)',
1203 'google_default_client_id%': '<(google_default_client_id)',
1204 'google_default_client_secret%': '<(google_default_client_secret)',
1205 'enable_managed_users%': '<(enable_managed_users)',
1206 'native_discardable_memory%': '<(native_discardable_memory)',
1207 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1208 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1209 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1210 'enable_mdns%' : '<(enable_mdns)',
1211 'enable_service_discovery%' : '<(enable_service_discovery)',
1212 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1213 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1214 'v8_optimized_debug%': '<(v8_optimized_debug)',
1215 'proprietary_codecs%': '<(proprietary_codecs)',
1216 'use_goma%': '<(use_goma)',
1217 'gomadir%': '<(gomadir)',
1218 'use_lto%': '<(use_lto)',
1219 'use_lto_o2%': '<(use_lto_o2)',
1220 'video_hole%': '<(video_hole)',
1221 'enable_load_completion_hacks%': '<(enable_load_completion_hacks)',
1222 'support_pre_M6_history_database%': '<(support_pre_M6_history_database)',
1223 'v8_use_external_startup_data': '<(v8_use_external_startup_data)',
1225 # Whether or not we are building the Athena shell.
1228 # Use system protobuf instead of bundled one.
1229 'use_system_protobuf%': 0,
1231 # Use system yasm instead of bundled one.
1232 'use_system_yasm%': 0,
1234 # Use system ICU instead of bundled one.
1235 'use_system_icu%' : 0,
1237 # Default to enabled PIE; this is important for ASLR but we may need to be
1238 # able to turn it off for various reasons.
1239 'linux_disable_pie%': 0,
1241 # The release channel that this build targets. This is used to restrict
1242 # channel-specific build options, like which installer packages to create.
1243 # The default is 'all', which does no channel-specific filtering.
1246 # Override chromium_mac_pch and set it to 0 to suppress the use of
1247 # precompiled headers on the Mac. Prefix header injection may still be
1248 # used, but prefix headers will not be precompiled. This is useful when
1249 # using distcc to distribute a build to compile slaves that don't
1250 # share the same compiler executable as the system driving the compilation,
1251 # because precompiled headers rely on pointers into a specific compiler
1252 # executable's image. Setting this to 0 is needed to use an experimental
1253 # Linux-Mac cross compiler distcc farm.
1254 'chromium_mac_pch%': 1,
1256 # The default value for mac_strip in target_defaults. This cannot be
1257 # set there, per the comment about variable% in a target_defaults.
1258 'mac_strip_release%': 0,
1260 # Set to 1 to enable java code coverage. Instruments classes during build
1261 # to produce .ec files during runtime.
1262 'emma_coverage%': 0,
1264 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1265 # separated with whitespace and/or comma. Only has effect if
1266 # 'emma_coverage=1'.
1269 # Set to 1 to enable running Android lint on java/class files.
1272 # Although base/allocator lets you select a heap library via an
1273 # environment variable, the libcmt shim it uses sometimes gets in
1274 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1275 # 'win_use_allocator_shim': 0,
1276 # 'win_release_RuntimeLibrary': 2
1277 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1278 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1280 # TODO(bradnelson): eliminate this when possible.
1281 # To allow local gyp files to prevent release.vsprops from being included.
1282 # Yes(1) means include release.vsprops.
1283 # Once all vsprops settings are migrated into gyp, this can go away.
1284 'msvs_use_common_release%': 1,
1286 # TODO(bradnelson): eliminate this when possible.
1287 # To allow local gyp files to override additional linker options for msvs.
1288 # Yes(1) means set use the common linker options.
1289 'msvs_use_common_linker_extras%': 1,
1291 # TODO(sgk): eliminate this if possible.
1292 # It would be nicer to support this via a setting in 'target_defaults'
1293 # in chrome/app/locales/locales.gypi overriding the setting in the
1294 # 'Debug' configuration in the 'target_defaults' dict below,
1295 # but that doesn't work as we'd like.
1296 'msvs_debug_link_incremental%': '2',
1298 # Needed for some of the largest modules.
1299 'msvs_debug_link_nonincremental%': '1',
1301 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1302 # to get incremental linking to be faster in debug builds.
1303 'incremental_chrome_dll%': '0',
1305 # Experimental setting to break chrome.dll into multiple pieces based on
1307 'chrome_multiple_dll%': '0',
1309 # Experimental setting to optimize Chrome's DLLs with PGO.
1310 'chrome_pgo_phase%': '0',
1313 'clang%': '<(clang)',
1314 'host_clang%': '<(host_clang)',
1315 'make_clang_dir%': '<(make_clang_dir)',
1317 # Control which version of clang to use when building for iOS. If set to
1318 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1319 # the version of clang that ships with the Chromium source. This variable
1320 # is automatically set to '1' when using the Xcode generator.
1323 # These two variables can be set in GYP_DEFINES while running
1324 # |gclient runhooks| to let clang run a plugin in every compilation.
1325 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1327 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1330 'clang_add_plugin%': '',
1332 # Tell ld64 to write map files describing binary layout. Useful
1333 # for looking at what contributes to binary size, e.g. with
1334 # https://github.com/nico/bloat
1335 'mac_write_linker_maps%': 0,
1337 # The default type of gtest.
1338 'gtest_target_type%': 'executable',
1340 # Enable sampling based profiler.
1341 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1343 # Profile without optimizing out stack frames when profiling==1.
1344 'profiling_full_stack_frames%': '0',
1346 # And if we want to dump symbols for Breakpad-enabled builds.
1347 'linux_dump_symbols%': 0,
1348 # And if we want to strip the binary after dumping symbols.
1349 'linux_strip_binary%': 0,
1350 # If we want stack unwind support for backtrace().
1351 'debug_unwind_tables%': 1,
1352 'release_unwind_tables%': 1,
1354 # Override where to find binutils
1355 'binutils_version%': 0,
1356 'binutils_dir%': '',
1359 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1360 'use_allocator%': 'tcmalloc',
1362 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1363 'linux_link_gnome_keyring%': 0,
1364 # Set to 1 to link against gsettings APIs instead of using dlopen().
1365 'linux_link_gsettings%': 0,
1367 # Enable use of OpenMAX DL FFT routines.
1368 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1370 # Enable new NPDevice API.
1371 'enable_new_npdevice_api%': 0,
1373 # .gyp files or targets should set chromium_code to 1 if they build
1374 # Chromium-specific code, as opposed to external code. This variable is
1375 # used to control such things as the set of warnings to enable, and
1376 # whether warnings are treated as errors.
1377 'chromium_code%': 0,
1379 # Disable fatal linker warnings, similarly to how we make it possible
1380 # to disable -Werror (e.g. for different toolchain versions).
1381 'disable_fatal_linker_warnings%': 0,
1383 'release_valgrind_build%': 0,
1385 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1386 'enable_wexit_time_destructors%': 0,
1388 # Build libpeerconnection as a static library by default.
1389 'libpeer_target_type%': 'static_library',
1391 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1392 'internal_gles2_conform_tests%': 0,
1394 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1395 'internal_khronos_glcts_tests%': 0,
1397 # Set to 1 to compile the filter fuzzer.
1398 'internal_filter_fuzzer%': 0,
1400 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1401 # so Cocoa is happy (http://crbug.com/20441).
1403 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1404 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1405 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1406 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1407 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1408 'vi', 'zh-CN', 'zh-TW',
1411 # Pseudo locales are special locales which are used for testing and
1412 # debugging. They don't get copied to the final app. For more info,
1413 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1420 # If debug_devtools is set to 1, JavaScript files for DevTools are
1421 # stored as is and loaded from disk. Otherwise, a concatenated file
1422 # is stored in resources.pak. It is still possible to load JS files
1423 # from disk by passing --debug-devtools cmdline switch.
1424 'debug_devtools%': 0,
1426 # The Java Bridge is not compiled in by default.
1429 # Code signing for iOS binaries. The bots need to be able to disable this.
1430 'chromium_ios_signing%': 1,
1432 # This flag is only used when disable_nacl==0 and disables all those
1433 # subcomponents which would require the installation of a native_client
1434 # untrusted toolchain.
1435 'disable_nacl_untrusted%': 0,
1437 # Disable Dart by default.
1440 # Copy out the setting of disable_nacl.
1441 'disable_nacl%': '<(disable_nacl)',
1443 # Portable Native Client is enabled by default.
1444 'disable_pnacl%': 0,
1446 # Whether to build full debug version for Debug configuration on Android.
1447 # Compared to full debug version, the default Debug configuration on Android
1448 # has no full v8 debug, has size optimization and linker gc section, so that
1449 # we can build a debug version with acceptable size and performance.
1450 'android_full_debug%': 0,
1452 # Sets the default version name and code for Android app, by default we
1453 # do a developer build.
1454 'android_app_version_name%': 'Developer Build',
1455 'android_app_version_code%': 1,
1457 # Contains data about the attached devices for gyp_managed_install.
1458 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1460 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1461 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1463 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1464 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1466 # Whether we are using the rlz library or not. Platforms like Android send
1467 # rlz codes for searches but do not use the library.
1470 # Turns on the i18n support in V8.
1471 'v8_enable_i18n_support': 1,
1473 # Compile d8 for the host toolset.
1474 'v8_toolset_for_d8': 'host',
1476 # Use brlapi from brltty for braille display support.
1479 # Relative path to icu.gyp from this file.
1480 'icu_gyp_path': '../third_party/icu/icu.gyp',
1482 # IPC fuzzer is disabled by default.
1483 'enable_ipc_fuzzer%': 0,
1486 # Force disable libstdc++ debug mode.
1487 'disable_glibcxx_debug%': 0,
1489 # Set to 1 to compile with MSE support for MPEG2 TS
1490 'enable_mpeg2ts_stream_parser%': 0,
1492 # Support ChromeOS touchpad gestures with ozone.
1493 'use_evdev_gestures%': 0,
1495 # Default ozone platform (if no --ozone-platform flag).
1496 'ozone_platform%': "",
1498 # Ozone platforms to include in the build.
1499 'ozone_platform_caca%': 0,
1500 'ozone_platform_dri%': 0,
1501 'ozone_platform_egltest%': 0,
1502 'ozone_platform_gbm%': 0,
1503 'ozone_platform_ozonex%': 0,
1504 'ozone_platform_test%': 0,
1507 ['buildtype=="Official"', {
1508 # Continue to embed build meta data in Official builds, basically the
1509 # time it was built.
1510 # TODO(maruel): This decision should be revisited because having an
1511 # official deterministic build has high value too but MSVC toolset can't
1512 # generate anything deterministic with WPO enabled AFAIK.
1513 'dont_embed_build_metadata%': 0,
1515 # Enable the Syzygy optimization step for the official builds.
1516 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1517 'syzygy_optimize%': 1,
1519 'syzygy_optimize%': 0,
1521 # Get binutils version so we can enable debug fission if we can.
1522 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1524 # compiler_version doesn't work with clang
1525 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1526 # compiler_version works with clang.
1527 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1528 # that it takes effect here.
1529 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1530 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1532 # On Android we know the binutils version in the toolchain.
1534 'binutils_version%': 222,
1536 ['host_arch=="x64"', {
1537 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1539 ['host_arch=="ia32"', {
1540 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1542 # Our version of binutils in third_party/binutils
1543 ['linux_use_bundled_binutils==1', {
1544 'binutils_version%': 224,
1548 'binutils_version%': 0,
1550 # The version of GCC in use, set later in platforms that use GCC and have
1551 # not explicitly chosen to build with clang. Currently, this means all
1552 # platforms except Windows, Mac and iOS.
1553 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1554 # it takes effect here.
1555 ['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', {
1557 ['OS=="android" and android_webview_build==0', {
1558 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1559 # We directly set the gcc version since we know what we use.
1562 ['OS=="android" and android_webview_build==1', {
1563 # Android WebView uses a hermetic clang toolchain for host builds.
1564 'host_gcc_version%': 0,
1565 # Android WebView uses the GCC toolchain from the Android build.
1569 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1570 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1574 'host_gcc_version%': 0,
1577 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1578 'windows_sdk_path%': '<(windows_sdk_default_path)',
1580 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
1582 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1583 'directx_sdk_path%': '<(directx_sdk_default_path)',
1585 'directx_sdk_path%': '$(DXSDK_DIR)',
1588 'windows_driver_kit_path%': '$(WDK_DIR)',
1590 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1592 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1595 'nacl_untrusted_build%': 0,
1596 'use_allocator%': 'none',
1598 ['OS=="linux" and target_arch=="mipsel"', {
1599 'sysroot%': '<(sysroot)',
1602 # All Chrome builds have breakpad symbols, but only process the
1603 # symbols from official builds.
1604 ['(branding=="Chrome" and buildtype=="Official")', {
1605 'linux_dump_symbols%': 1,
1607 # Omit unwind support in official release builds to save space. We
1608 # can use breakpad for these builds.
1609 'release_unwind_tables%': 0,
1612 # For official builds, use a 64-bit linker to avoid running out
1613 # of address space. The buildbots should have a 64-bit kernel
1614 # and a 64-bit libc installed.
1615 ['host_arch=="ia32" and target_arch=="ia32"', {
1616 'linux_use_bundled_gold%': '1',
1617 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1622 }], # os_posix==1 and OS!="mac" and OS!="ios"
1625 'enable_background%': 0,
1626 'icu_use_data_file_flag%': 1,
1627 'enable_web_speech%': 0,
1628 'use_system_libxml%': 1,
1629 'use_system_sqlite%': 1,
1631 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1632 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1633 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1634 'uk', 'vi', 'zh-CN', 'zh-TW',
1637 # iOS SDK and deployment target support. The |ios_sdk| value is left
1638 # blank so that when it is set in the project files it will be the
1639 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1640 # causes Xcode to spit out a warning for every single project file for
1641 # not using the "current" SDK.
1643 'ios_sdk_path%': '',
1644 'ios_deployment_target%': '7.0',
1647 # ios_product_name is set to the name of the .app bundle as it should
1649 ['branding=="Chrome"', {
1650 'ios_product_name%': 'Chrome',
1651 }, { # else: branding!="Chrome"
1652 'ios_product_name%': 'Chromium',
1654 ['branding=="Chrome" and buildtype=="Official"', {
1656 }, { # else: branding!="Chrome" or buildtype!="Official"
1662 # Location of Android NDK.
1665 # Unfortunately we have to use absolute paths to the SDK/NDK because
1666 # they're passed to ant which uses a different relative path from
1668 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1669 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1670 'android_host_arch%': '<!(uname -m)',
1671 # Android API-level of the SDK used for compilation.
1672 'android_sdk_version%': '21',
1673 'android_sdk_build_tools_version%': '21.0.1',
1674 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1676 # Copy conditionally-set variables out one scope.
1677 'android_ndk_root%': '<(android_ndk_root)',
1678 'android_sdk_root%': '<(android_sdk_root)',
1679 'android_sdk_version%': '<(android_sdk_version)',
1680 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1681 'host_os%': '<(host_os)',
1683 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1684 # Android SDK build tools (e.g. dx, aapt, aidl)
1685 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1687 # Android API level 14 is ICS (Android 4.0) which is the minimum
1688 # platform requirement for Chrome on Android, we use it for native
1691 ['target_arch == "ia32"', {
1692 'android_app_abi%': 'x86',
1693 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1694 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1695 'android_ndk_lib_dir%': 'usr/lib',
1696 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1698 ['target_arch == "x64"', {
1699 'android_app_abi%': 'x86_64',
1700 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1701 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1702 'android_ndk_lib_dir%': 'usr/lib64',
1703 'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1705 ['target_arch=="arm"', {
1708 'android_app_abi%': 'armeabi',
1710 'android_app_abi%': 'armeabi-v7a',
1713 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1714 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1715 'android_ndk_lib_dir%': 'usr/lib',
1716 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1718 ['target_arch == "arm64"', {
1719 'android_app_abi%': 'arm64-v8a',
1720 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1721 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1722 'android_ndk_lib_dir%': 'usr/lib',
1723 'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1725 ['target_arch == "mipsel"', {
1726 'android_app_abi%': 'mips',
1727 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1728 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1729 'android_ndk_lib_dir%': 'usr/lib',
1730 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1732 ['target_arch == "mips64el"', {
1733 'android_app_abi%': 'mips64',
1734 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1735 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1736 'android_ndk_lib_dir%': 'usr/lib64',
1737 'android_toolchain%': '<(android_ndk_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1742 # Copy conditionally-set variables out one scope.
1743 'android_app_abi%': '<(android_app_abi)',
1744 'android_gdbserver%': '<(android_gdbserver)',
1745 'android_ndk_root%': '<(android_ndk_root)',
1746 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1747 'android_sdk_root%': '<(android_sdk_root)',
1748 'android_sdk_version%': '<(android_sdk_version)',
1749 'android_toolchain%': '<(android_toolchain)',
1751 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1752 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1753 'android_sdk_tools%': '<(android_sdk_tools)',
1754 'android_sdk%': '<(android_sdk)',
1755 'android_sdk_jar%': '<(android_sdk)/android.jar',
1757 'android_stlport_root': '<(android_stlport_root)',
1758 'android_stlport_include': '<(android_stlport_root)/stlport',
1759 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1760 'host_os%': '<(host_os)',
1762 # Location of the "objcopy" binary, used by both gyp and scripts.
1763 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1765 # Location of the "strip" binary, used by both gyp and scripts.
1766 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1768 # Location of the "readelf" binary.
1769 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1771 # Determines whether we should optimize JNI generation at the cost of
1772 # breaking assumptions in the build system that when inputs have changed
1773 # the outputs should always change as well. This is meant purely for
1774 # developer builds, to avoid spurious re-linking of native files.
1775 'optimize_jni_generation%': '<(optimize_jni_generation)',
1777 # Always uses openssl.
1779 'use_openssl_certs%': 1,
1781 'proprietary_codecs%': '<(proprietary_codecs)',
1782 'safe_browsing%': 1,
1783 'enable_web_speech%': 0,
1785 'build_ffmpegsumo%': 0,
1786 'use_allocator%': 'none',
1788 # Disable Native Client.
1791 # Android does not support background apps.
1792 'enable_background%': 0,
1794 # Sessions are store separately in the Java side.
1795 'enable_session_service%': 0,
1799 'gtest_target_type%': 'shared_library',
1801 # Uses system APIs for decoding audio and video.
1802 'use_libffmpeg%': '0',
1804 # TODO(torne): Remove this unsupported option once all the places that
1805 # test it have been updated.
1806 'use_system_stlport%': 0,
1808 # Copy it out one scope.
1809 'android_webview_build%': '<(android_webview_build)',
1811 # Default android linker script for shared library exports.
1812 'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_exports.lst',
1815 'use_system_fontconfig%': 0,
1817 'use_system_fontconfig%': 1,
1820 'enable_mpeg2ts_stream_parser%': 1,
1821 'ffmpeg_branding%': 'Chrome',
1822 'ozone_platform_ozonex%': 1,
1823 'use_playready%': 0,
1825 ['target_arch=="arm"', {
1827 'arm_tune%': 'cortex-a9',
1833 ['android_webview_build==1', {
1834 # When building the WebView in the Android tree, jarjar will remap all
1835 # the class names, so the JNI generator needs to know this.
1836 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1838 ['OS=="linux" and target_arch!="mipsel"', {
1839 # TODO(thakis): This is here to measure perf for a while.
1844 # All Chrome builds have breakpad symbols, but only process the
1845 # symbols from official builds.
1846 ['(branding=="Chrome" and buildtype=="Official")', {
1847 'mac_strip_release%': 1,
1851 ['OS=="mac" or OS=="ios"', {
1855 # Mac OS X SDK and deployment target support. The SDK identifies
1856 # the version of the system headers that will be used, and
1857 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1858 # macro. "Maximum allowed" refers to the operating system version
1859 # whose APIs are available in the headers. The deployment target
1860 # identifies the minimum system version that the built products are
1861 # expected to function on. It corresponds to the
1862 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1863 # macros are available, #include <AvailabilityMacros.h>. Additional
1864 # documentation on these macros is available at
1865 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1866 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1867 # deployment target to 10.6. Other projects, such as O3D, may
1868 # override these defaults.
1870 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1871 # about that is at least the specified version. In official builds,
1872 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1873 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1874 # path to the SDK; when set to a non-empty string, SDK detection
1875 # based on mac_sdk_min will be bypassed entirely.
1878 'mac_sdk_min%': '10.8',
1879 }, { # else OS!="ios"
1880 'mac_sdk_min%': '10.6',
1883 'mac_sdk_path%': '',
1885 'mac_deployment_target%': '10.6',
1888 'mac_sdk_min': '<(mac_sdk_min)',
1889 'mac_sdk_path': '<(mac_sdk_path)',
1890 'mac_deployment_target': '<(mac_deployment_target)',
1892 # Compile in Breakpad support by default so that it can be
1893 # tested, even if it is not enabled by default at runtime.
1894 'mac_breakpad_compiled_in%': 1,
1896 # mac_product_name is set to the name of the .app bundle as it should
1897 # appear on disk. This duplicates data from
1898 # chrome/app/theme/chromium/BRANDING and
1899 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1900 # these names into the build system.
1901 ['branding=="Chrome"', {
1902 'mac_product_name%': 'Google Chrome',
1903 }, { # else: branding!="Chrome"
1904 'mac_product_name%': 'Chromium',
1906 # Official mac builds require a specific OS X SDK, but iOS and
1907 # non-official mac builds do not.
1908 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1909 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1911 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1913 ['branding=="Chrome" and buildtype=="Official"', {
1914 # Enable uploading crash dumps.
1915 'mac_breakpad_uploads%': 1,
1916 # Enable dumping symbols at build time for use by Mac Breakpad.
1918 # Enable Keystone auto-update support.
1920 }, { # else: branding!="Chrome" or buildtype!="Official"
1921 'mac_breakpad_uploads%': 0,
1926 }], # OS=="mac" or OS=="ios"
1929 # This is the architecture convention used in WinSDK paths.
1930 ['target_arch=="ia32"', {
1931 'winsdk_arch%': 'x86',
1933 'winsdk_arch%': '<(target_arch)',
1935 ['component=="shared_library"', {
1936 'win_use_allocator_shim%': 0,
1938 # Turn on multiple dll by default on Windows when in static_library.
1939 'chrome_multiple_dll%': 1,
1942 'win_use_allocator_shim%': 0,
1944 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1945 # Only enabled by default for ninja because it's buggy in VS.
1946 # Not enabled for component=static_library because some targets
1947 # are too large and the toolchain fails due to the size of the
1949 'incremental_chrome_dll%': 1,
1951 # Don't do incremental linking for large modules on 32-bit or when
1952 # component=static_library as the toolchain fails due to the size of
1954 ['MSVS_OS_BITS==32 or component=="static_library"', {
1955 'msvs_large_module_debug_link_mode%': '1', # No
1957 'msvs_large_module_debug_link_mode%': '2', # Yes
1959 ['MSVS_VERSION=="2013e"', {
1967 'nacl_win64_defines': [
1968 # This flag is used to minimize dependencies when building
1969 # Native Client loader for 64-bit Windows.
1974 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1980 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1981 'enable_pepper_cdms%': 1,
1983 'enable_pepper_cdms%': 0,
1987 'enable_browser_cdms%': 1,
1989 'enable_browser_cdms%': 0,
1992 # Native Client glibc toolchain is enabled
1993 # by default except on arm, mips and mips64.
1994 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
1995 'disable_glibc%': 1,
1997 'disable_glibc%': 0,
2000 # Set the relative path from this file to the GYP file of the JPEG
2001 # library used by Chromium.
2002 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2003 # Configuration for using the system libjeg is here.
2004 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
2006 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
2009 # Options controlling the use of GConf (the classic GNOME configuration
2010 # system) and GIO, which contains GSettings (the new GNOME config system).
2011 ['chromeos==1 or embedded==1', {
2019 # Set up -D and -E flags passed into grit.
2020 ['branding=="Chrome"', {
2021 # TODO(mmoss) The .grd files look for _google_chrome, but for
2022 # consistency they should look for google_chrome_build like C++.
2023 'grit_defines': ['-D', '_google_chrome',
2024 '-E', 'CHROMIUM_BUILD=google_chrome'],
2026 'grit_defines': ['-D', '_chromium',
2027 '-E', 'CHROMIUM_BUILD=chromium'],
2030 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2032 ['desktop_linux==1', {
2033 'grit_defines': ['-D', 'desktop_linux'],
2035 ['toolkit_views==1', {
2036 'grit_defines': ['-D', 'toolkit_views'],
2039 'grit_defines': ['-D', 'use_aura'],
2042 'grit_defines': ['-D', 'use_ash'],
2045 'grit_defines': ['-D', 'use_nss'],
2048 'grit_defines': ['-D', 'use_ozone'],
2050 ['image_loader_extension==1', {
2051 'grit_defines': ['-D', 'image_loader_extension'],
2054 'grit_defines': ['-D', 'remoting'],
2056 ['use_titlecase_in_grd==1', {
2057 'grit_defines': ['-D', 'use_titlecase'],
2059 ['use_third_party_translations==1', {
2060 'grit_defines': ['-D', 'use_third_party_translations'],
2062 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2063 'ka', 'ku', 'kw', 'ms', 'ug'
2067 'grit_defines': ['-t', 'android',
2068 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true'],
2070 ['OS=="mac" or OS=="ios"', {
2071 'grit_defines': ['-D', 'scale_factors=2x'],
2076 # iOS uses a whitelist to filter resources.
2077 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
2080 # Enable host builds when generating with ninja-ios.
2082 ['"<(GENERATOR)"=="ninja"', {
2086 # TODO(sdefresne): Remove the target_subarch check once Apple has
2087 # upstreamed the support for "arm64". http://crbug.com/341453
2088 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
2093 ['enable_extensions==1', {
2094 'grit_defines': ['-D', 'enable_extensions'],
2096 ['enable_plugins!=0', {
2097 'grit_defines': ['-D', 'enable_plugins'],
2099 ['enable_printing!=0', {
2100 'grit_defines': ['-D', 'enable_printing'],
2102 ['enable_printing==1', {
2103 'grit_defines': ['-D', 'enable_full_printing'],
2105 ['enable_themes==1', {
2106 'grit_defines': ['-D', 'enable_themes'],
2108 ['enable_app_list==1', {
2109 'grit_defines': ['-D', 'enable_app_list'],
2111 ['enable_settings_app==1', {
2112 'grit_defines': ['-D', 'enable_settings_app'],
2114 ['enable_google_now==1', {
2115 'grit_defines': ['-D', 'enable_google_now'],
2117 ['use_concatenated_impulse_responses==1', {
2118 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2120 ['enable_webrtc==1', {
2121 'grit_defines': ['-D', 'enable_webrtc'],
2123 ['enable_hangout_services_extension==1', {
2124 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2126 ['enable_task_manager==1', {
2127 'grit_defines': ['-D', 'enable_task_manager'],
2129 ['notifications==1', {
2130 'grit_defines': ['-D', 'enable_notifications'],
2132 ['enable_wifi_bootstrapping==1', {
2133 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2135 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2136 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2138 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2139 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2141 ['enable_mdns==1 or OS=="mac"', {
2142 'grit_defines': ['-D', 'enable_service_discovery'],
2143 'enable_service_discovery%': 1
2145 ['clang_use_chrome_plugins==1 and OS!="win"', {
2146 'clang_chrome_plugins_flags': [
2147 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
2150 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2152 'use_allocator%': 'none',
2153 'use_sanitizer_options%': 1,
2155 ['asan==1 and OS=="linux" and chromeos==0', {
2156 'use_custom_libcxx%': 1,
2164 ['asan==1 and OS=="mac"', {
2165 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
2166 # runtime is fully adopted. See http://crbug.com/242503.
2167 'mac_strip_release': 0,
2170 'use_custom_libcxx%': 1,
2173 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2174 # libstdc++. This is required to avoid false positive reports whenever
2175 # the C++ standard library is used.
2176 'use_custom_libcxx%': 1,
2177 # Running the V8-generated code on an ARM simulator is a powerful hack
2178 # that allows the tool to see the memory accesses from JITted code.
2179 # Without this flag, JS code causes false positive reports from MSan.
2180 'v8_target_arch': 'arm64',
2183 ['OS=="linux" and clang_type_profiler==1', {
2185 'clang_use_chrome_plugins%': 0,
2187 ['host_arch=="x64"', {
2188 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2190 ['host_arch=="ia32"', {
2191 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2192 # Clang in this directory at your own risk if needed for some
2193 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2194 # usage). Any failure by this compiler should not close the tree.
2195 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2201 # The Clang plugins don't currently work on Windows.
2202 # TODO(hans): One day, this will work. (crbug.com/82385)
2203 'clang_use_chrome_plugins%': 0,
2206 # On valgrind bots, override the optimizer settings so we don't inline too
2207 # much and make the stacks harder to figure out.
2209 # TODO(rnk): Kill off variables that no one else uses and just implement
2210 # them under a build_for_tool== condition.
2211 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2213 'mac_debug_optimization': '1',
2214 'mac_release_optimization': '1',
2215 'release_optimize': '1',
2216 'no_gc_sections': 1,
2217 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2218 '-fno-builtin -fno-optimize-sibling-calls',
2219 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2220 '-fno-builtin -fno-optimize-sibling-calls',
2222 # MSVS flags for TSan on Pin and Windows.
2223 'win_debug_RuntimeChecks': '0',
2224 'win_debug_disable_iterator_debugging': '1',
2225 'win_debug_Optimization': '1',
2226 'win_debug_InlineFunctionExpansion': '0',
2227 'win_release_InlineFunctionExpansion': '0',
2228 'win_release_OmitFramePointers': '0',
2230 'use_allocator': 'tcmalloc',
2231 'release_valgrind_build': 1,
2233 'component': 'static_library',
2234 'use_system_zlib': 0,
2237 # Build tweaks for DrMemory.
2238 # TODO(rnk): Combine with tsan config to share the builder.
2239 # http://crbug.com/108155
2240 ['build_for_tool=="drmemory"', {
2241 # These runtime checks force initialization of stack vars which blocks
2242 # DrMemory's uninit detection.
2243 'win_debug_RuntimeChecks': '0',
2244 # Iterator debugging is slow.
2245 'win_debug_disable_iterator_debugging': '1',
2246 # Try to disable optimizations that mess up stacks in a release build.
2247 # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054)
2248 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2249 # compiler bug, so we use /Ob1 instead.
2250 'win_release_InlineFunctionExpansion': '1',
2251 'win_release_OmitFramePointers': '0',
2252 # Ditto for debug, to support bumping win_debug_Optimization.
2253 'win_debug_InlineFunctionExpansion': 0,
2254 'win_debug_OmitFramePointers': 0,
2255 # Keep the code under #ifndef NVALGRIND.
2256 'release_valgrind_build': 1,
2259 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2260 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2264 # Set default compiler flags depending on ARM version.
2265 ['arm_version==6 and android_webview_build==0', {
2266 'arm_arch%': 'armv6',
2269 'arm_float_abi%': 'softfp',
2272 ['arm_version==7 and android_webview_build==0', {
2273 'arm_arch%': 'armv7-a',
2274 'arm_tune%': 'generic-armv7-a',
2279 'arm_fpu%': 'vfpv3-d16',
2282 # Change the default to hard once the armhf transition is complete.
2283 'arm_float_abi%': 'softfp',
2287 ['android_webview_build==1', {
2288 # The WebView build gets its cpu-specific flags from the Android build system.
2292 'arm_float_abi%': '',
2296 # Enable brlapi by default for chromeos.
2301 ['use_ozone==1 and ozone_auto_platforms==1', {
2302 # Use test as the default platform.
2303 'ozone_platform%': 'test',
2305 # Build all platforms whose deps are in install-build-deps.sh.
2306 # Only these platforms will be compile tested by buildbots.
2307 'ozone_platform_dri%': 1,
2308 'ozone_platform_test%': 1,
2309 'ozone_platform_egltest%': 1,
2312 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2313 'use_clipboard_aurax11%': 1,
2316 ['OS=="win" and use_goma==1', {
2317 # goma doesn't support pch yet.
2318 'chromium_win_pch': 0,
2319 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2321 ['win_z7==0 and fastbuild==0', {
2327 ['OS=="win" and (clang==1 or asan==1)', {
2328 'chromium_win_pch': 0,
2332 'host_cc': '<(make_clang_dir)/bin/clang',
2333 'host_cxx': '<(make_clang_dir)/bin/clang++',
2335 'host_cc': '<!(which gcc)',
2336 'host_cxx': '<!(which g++)',
2339 # The seccomp-bpf sandbox is only supported on five architectures
2341 # Do not disable seccomp_bpf anywhere without talking to
2342 # security@chromium.org!
2343 ['((OS=="linux" or OS=="android") and '
2344 '(target_arch=="ia32" or target_arch=="x64" or '
2345 'target_arch=="arm" or target_arch=="mipsel" or '
2346 'target_arch=="arm64"))', {
2347 'use_seccomp_bpf%': 1,
2349 'use_seccomp_bpf%': 0,
2351 # Set component build with LTO until all tests pass.
2352 # This also reduces link time.
2354 'component%': "shared_library",
2358 # older history files use fts2 instead of fts3
2359 'sqlite_enable_fts2%': '<(support_pre_M6_history_database)',
2361 # The path to the ANGLE library.
2362 'angle_path': '<(DEPTH)/third_party/angle',
2364 # List of default apps to install in new profiles. The first list contains
2365 # the source files as found in svn. The second list, used only for linux,
2366 # contains the destination location for each of the files. When a crx
2367 # is added or removed from the list, the chrome/browser/resources/
2368 # default_apps/external_extensions.json file must also be updated.
2369 'default_apps_list': [
2370 'browser/resources/default_apps/external_extensions.json',
2371 'browser/resources/default_apps/gmail.crx',
2372 'browser/resources/default_apps/search.crx',
2373 'browser/resources/default_apps/youtube.crx',
2374 'browser/resources/default_apps/drive.crx',
2375 'browser/resources/default_apps/docs.crx',
2377 'default_apps_list_linux_dest': [
2378 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2379 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2380 '<(PRODUCT_DIR)/default_apps/search.crx',
2381 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2382 '<(PRODUCT_DIR)/default_apps/drive.crx',
2383 '<(PRODUCT_DIR)/default_apps/docs.crx',
2386 # Whether to allow building of the GPU-related isolates.
2387 'archive_gpu_tests%': 0,
2389 # Whether to allow building of chromoting related isolates.
2390 'archive_chromoting_tests%': 0,
2392 'target_defaults': {
2394 # The condition that operates on chromium_code is in a target_conditions
2395 # section, and will not have access to the default fallback value of
2396 # chromium_code at the top of this file, or to the chromium_code
2397 # variable placed at the root variables scope of .gyp files, because
2398 # those variables are not set at target scope. As a workaround,
2399 # if chromium_code is not set at target scope, define it in target scope
2400 # to contain whatever value it has during early variable expansion.
2401 # That's enough to make it available during target conditional
2403 'chromium_code%': '<(chromium_code)',
2405 'component%': '<(component)',
2407 'chromecast%': '<(chromecast)',
2409 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2410 'win_release_Optimization%': '2', # 2 = /Os
2411 'win_debug_Optimization%': '0', # 0 = /Od
2413 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2414 # Tri-state: blank is default, 1 on, 0 off
2415 'win_release_OmitFramePointers%': '0',
2416 # Tri-state: blank is default, 1 on, 0 off
2417 'win_debug_OmitFramePointers%': '',
2419 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2420 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2422 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2423 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2424 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2426 # VS inserts quite a lot of extra checks to algorithms like
2427 # std::partial_sort in Debug build which make them O(N^2)
2428 # instead of O(N*logN). This is particularly slow under memory
2429 # tools like ThreadSanitizer so we want it to be disablable.
2430 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2431 'win_debug_disable_iterator_debugging%': '0',
2433 # An application manifest fragment to declare compatibility settings for
2434 # 'executable' targets. Ignored in other target type.
2435 'win_exe_compatibility_manifest%':
2436 '<(DEPTH)\\build\\win\\compatibility.manifest',
2438 'release_extra_cflags%': '',
2439 'debug_extra_cflags%': '',
2441 'release_valgrind_build%': '<(release_valgrind_build)',
2443 # the non-qualified versions are widely assumed to be *nix-only
2444 'win_release_extra_cflags%': '',
2445 'win_debug_extra_cflags%': '',
2447 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2448 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2450 # Only used by Windows build for now. Can be used to build into a
2451 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2452 # output files in src/build/VS2010_{Debug,Release}.
2453 'build_dir_prefix%': '',
2455 # Targets are by default not nacl untrusted code.
2456 'nacl_untrusted_build%': 0,
2458 'pnacl_compile_flags': [
2459 # pnacl uses the clang compiler so we need to suppress all the
2460 # same warnings as we do for clang.
2461 # TODO(sbc): Remove these if/when they are removed from the clang
2463 '-Wno-unused-function',
2464 '-Wno-char-subscripts',
2465 '-Wno-c++11-extensions',
2466 '-Wno-unnamed-type-template-args',
2470 ['OS=="win" and component=="shared_library"', {
2471 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2472 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2473 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2475 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2476 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2477 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2480 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2481 'mac_release_optimization%': 's', # Use -Os unless overridden
2482 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2484 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2485 'mac_release_optimization%': '3', # Use -O3 unless overridden
2486 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2489 'host_os%': '<(host_os)', # See comment above chromium_code.
2492 'clang_warning_flags': [
2495 # Don't die on dtoa code that uses a char as an array index.
2496 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2497 '-Wno-char-subscripts',
2499 # TODO(thakis): This used to be implied by -Wno-unused-function,
2500 # which we no longer use. Check if it makes sense to remove
2501 # this as well. http://crbug.com/316352
2502 '-Wno-unneeded-internal-declaration',
2504 # Warns on switches on enums that cover all enum values but
2505 # also contain a default: branch. Chrome is full of that.
2506 '-Wno-covered-switch-default',
2508 # Warns when a const char[] is converted to bool.
2509 '-Wstring-conversion',
2511 # C++11-related flags:
2513 # This warns on using ints as initializers for floats in
2514 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2515 # which happens in several places in chrome code. Not sure if
2516 # this is worth fixing.
2517 '-Wno-c++11-narrowing',
2519 # Clang considers the `register` keyword as deprecated, but e.g.
2520 # code generated by flex (used in angle) contains that keyword.
2521 # http://crbug.com/255186
2522 '-Wno-deprecated-register',
2524 # TODO(hans): Clean this up. Or disable with finer granularity.
2525 '-Wno-unused-local-typedef',
2528 'includes': [ 'set_clang_warning_flags.gypi', ],
2530 # Don't use deprecated V8 APIs anywhere.
2531 'V8_DEPRECATION_WARNINGS',
2534 '<(SHARED_INTERMEDIATE_DIR)',
2537 ['(OS=="mac" or OS=="ios") and asan==1', {
2539 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2542 ['OS=="win" and asan==1 and component=="shared_library"', {
2544 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2547 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2548 'cflags_cc!': ['-fno-rtti'],
2551 '-gline-tables-only',
2552 '-fintercept-allocation-functions',
2554 'defines': ['TYPE_PROFILING'],
2556 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2559 ['branding=="Chrome"', {
2560 'defines': ['GOOGLE_CHROME_BUILD'],
2561 }, { # else: branding!="Chrome"
2562 'defines': ['CHROMIUM_BUILD'],
2564 ['OS=="mac" and component=="shared_library"', {
2566 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2567 'LD_RUNPATH_SEARCH_PATHS': [
2568 # For unbundled binaries.
2570 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2571 '@loader_path/../../..',
2575 ['clang==1 and OS!="win"', {
2576 # This is here so that all files get recompiled after a clang roll and
2577 # when turning clang on or off.
2578 # (defines are passed via the command line, and build systems rebuild
2579 # things when their commandline changes). Nothing should ever read this
2581 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2584 'defines': ['ENABLE_RLZ'],
2586 ['component=="shared_library"', {
2587 'defines': ['COMPONENT_BUILD'],
2589 ['toolkit_views==1', {
2590 'defines': ['TOOLKIT_VIEWS=1'],
2592 ['ui_compositor_image_transport==1', {
2593 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2596 'defines': ['USE_AURA=1'],
2599 'defines': ['USE_ASH=1'],
2602 'defines': ['USE_PANGO=1'],
2605 'defines': ['USE_CAIRO=1'],
2608 'defines': ['USE_CRAS=1'],
2611 'defines': ['USE_OZONE=1'],
2613 ['use_default_render_theme==1', {
2614 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2616 ['use_libjpeg_turbo==1', {
2617 'defines': ['USE_LIBJPEG_TURBO=1'],
2620 'defines': ['USE_X11=1'],
2622 ['use_clipboard_aurax11==1', {
2623 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2625 ['enable_one_click_signin==1', {
2626 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2628 ['enable_pre_sync_backup==1', {
2629 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2631 ['use_xi2_mt!=0 and use_x11==1', {
2632 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2634 ['image_loader_extension==1', {
2635 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2638 'defines': ['ENABLE_PROFILING=1'],
2641 'defines': ['ENABLE_REMOTING=1'],
2643 ['enable_webrtc==1', {
2644 'defines': ['ENABLE_WEBRTC=1'],
2646 ['proprietary_codecs==1', {
2647 'defines': ['USE_PROPRIETARY_CODECS'],
2649 ['enable_mpeg2ts_stream_parser==1', {
2650 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2654 ['enable_viewport==1', {
2655 'defines': ['ENABLE_VIEWPORT'],
2657 ['enable_pepper_cdms==1', {
2658 'defines': ['ENABLE_PEPPER_CDMS'],
2660 ['enable_browser_cdms==1', {
2661 'defines': ['ENABLE_BROWSER_CDMS'],
2663 ['configuration_policy==1', {
2664 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2666 ['notifications==1', {
2667 'defines': ['ENABLE_NOTIFICATIONS'],
2669 ['enable_hidpi==1', {
2670 'defines': ['ENABLE_HIDPI=1'],
2672 ['native_discardable_memory==1', {
2673 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2675 ['native_memory_pressure_signals==1', {
2676 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2679 'defines': ['USE_UDEV'],
2683 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2686 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2687 # Clang creates chubby debug information, which makes linking very
2688 # slow. For now, don't create debug information with clang. See
2689 # http://crbug.com/70000
2693 'debug_extra_cflags': '-g0',
2696 # Android builds symbols on release by default, disable them.
2699 'debug_extra_cflags': '-g0',
2700 'release_extra_cflags': '-g0',
2704 }, { # else clang!=1
2706 ['OS=="win" and fastbuild==2', {
2707 # Completely disable debug information.
2710 'GenerateDebugInformation': 'false',
2712 'VCCLCompilerTool': {
2713 'DebugInformationFormat': '0',
2717 ['OS=="win" and fastbuild==1', {
2720 # This tells the linker to generate .pdbs, so that
2721 # we can get meaningful stack traces.
2722 'GenerateDebugInformation': 'true',
2724 'VCCLCompilerTool': {
2725 # No debug info to be generated by compiler.
2726 'DebugInformationFormat': '0',
2730 ['OS=="linux" and fastbuild==2', {
2732 'debug_extra_cflags': '-g0',
2735 ['OS=="linux" and fastbuild==1', {
2737 'debug_extra_cflags': '-g1',
2740 ['OS=="android" and fastbuild==2', {
2742 'debug_extra_cflags': '-g0',
2743 'release_extra_cflags': '-g0',
2746 ['OS=="android" and fastbuild==1', {
2748 'debug_extra_cflags': '-g1',
2749 'release_extra_cflags': '-g1',
2756 ['dont_embed_build_metadata==1', {
2758 'DONT_EMBED_BUILD_METADATA',
2760 }], # dont_embed_build_metadata==1
2761 ['dcheck_always_on!=0', {
2762 'defines': ['DCHECK_ALWAYS_ON=1'],
2763 }], # dcheck_always_on!=0
2764 ['tracing_like_official_build!=0', {
2765 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2766 }], # tracing_like_official_build!=0
2767 ['win_use_allocator_shim==0', {
2770 'defines': ['NO_TCMALLOC'],
2776 'ADDRESS_SANITIZER',
2777 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2778 'MEMORY_SANITIZER_INITIAL_SIZE',
2782 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2790 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2791 'MEMORY_SANITIZER_INITIAL_SIZE',
2797 '_CRT_SECURE_NO_DEPRECATE',
2798 '_SCL_SECURE_NO_DEPRECATE',
2799 # This define is required to pull in the new Win8 interfaces from
2800 # system headers like ShObjIdl.h.
2801 'NTDDI_VERSION=0x06020000',
2802 # This is required for ATL to use XP-safe versions of its functions.
2803 '_USING_V110_SDK71_',
2806 '<(DEPTH)/third_party/wtl/include',
2811 # Generates debug info when win_z7=1
2812 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2814 'GenerateDebugInformation': 'true',
2816 'VCCLCompilerTool': {
2817 'DebugInformationFormat': '1',
2823 # This is prohibited when running /analyze.
2824 '_USING_V110_SDK71_',
2827 'VCCLCompilerTool': {
2828 # Set WarnAsError to false to disable this setting for most
2829 # projects so that compilation continues.
2830 'WarnAsError': 'false',
2831 # When win_analyze is specified add the /analyze switch.
2832 # Also add /WX- to force-disable WarnAsError for projects that
2833 # override WarnAsError.
2834 # Also, disable various noisy warnings that have low value.
2835 'AdditionalOptions': [
2838 '/wd6011', # Dereferencing NULL pointer
2839 '/wd6312', # Possible infinite loop: use of the constant
2840 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2841 '/wd6326', # Potential comparison of constant with constant
2842 '/wd28159', # Consider using 'GetTickCount64'
2843 '/wd28204', # Inconsistent SAL annotations
2844 '/wd28251', # Inconsistent SAL annotations
2845 '/wd28252', # Inconsistent SAL annotations
2846 '/wd28253', # Inconsistent SAL annotations
2847 '/wd28196', # The precondition is not satisfied
2848 '/wd28301', # Inconsistent SAL annotations
2849 '/wd6340', # Sign mismatch in function parameter
2850 '/wd28182', # Dereferencing NULL pointer
2862 ['target_arch=="arm"', {
2864 # TODO(lcwu): Work around an error when building Chromium
2865 # with gcc-4.5.3 (e.g. v8/src/platform-linux.cc). Remove
2866 # this define once the toolchain is updated.
2867 # See crbug.com/388933.
2871 ['use_playready==1', {
2873 'PLAYREADY_CDM_AVAILABLE',
2878 ['enable_task_manager==1', {
2880 'ENABLE_TASK_MANAGER=1',
2883 ['enable_extensions==1', {
2885 'ENABLE_EXTENSIONS=1',
2888 ['OS=="win" and branding=="Chrome"', {
2889 'defines': ['ENABLE_SWIFTSHADER'],
2891 ['enable_dart==1', {
2892 'defines': ['WEBKIT_USING_DART=1'],
2894 ['enable_plugin_installation==1', {
2895 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2897 ['enable_plugins==1', {
2898 'defines': ['ENABLE_PLUGINS=1'],
2900 ['enable_session_service==1', {
2901 'defines': ['ENABLE_SESSION_SERVICE=1'],
2903 ['enable_themes==1', {
2904 'defines': ['ENABLE_THEMES=1'],
2906 ['enable_autofill_dialog==1', {
2907 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2909 ['enable_prod_wallet_service==1', {
2910 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2912 ['enable_background==1', {
2913 'defines': ['ENABLE_BACKGROUND=1'],
2915 ['enable_google_now==1', {
2916 'defines': ['ENABLE_GOOGLE_NOW=1'],
2918 ['cld_version!=0', {
2919 'defines': ['CLD_VERSION=<(cld_version)'],
2921 ['cld_version==2', {
2922 # This is used to populate the "CLD Data Source" field in:
2923 # chrome://translate-internals
2924 'defines': ['CLD2_DATA_SOURCE=<(cld2_data_source)'],
2926 ['enable_printing==1', {
2927 'defines': ['ENABLE_FULL_PRINTING=1', 'ENABLE_PRINTING=1'],
2929 ['enable_printing==2', {
2930 'defines': ['ENABLE_PRINTING=1'],
2932 ['enable_spellcheck==1', {
2933 'defines': ['ENABLE_SPELLCHECK=1'],
2935 ['enable_captive_portal_detection==1', {
2936 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2938 ['enable_app_list==1', {
2939 'defines': ['ENABLE_APP_LIST=1'],
2941 ['enable_settings_app==1', {
2942 'defines': ['ENABLE_SETTINGS_APP=1'],
2944 ['disable_file_support==1', {
2945 'defines': ['DISABLE_FILE_SUPPORT=1'],
2947 ['disable_ftp_support==1', {
2948 'defines': ['DISABLE_FTP_SUPPORT=1'],
2950 ['use_icu_alternatives_on_android==1', {
2951 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2953 ['enable_managed_users==1', {
2954 'defines': ['ENABLE_MANAGED_USERS=1'],
2956 ['spdy_proxy_auth_property != ""', {
2957 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2959 ['spdy_proxy_auth_value != ""', {
2960 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2962 ['enable_mdns==1', {
2963 'defines': ['ENABLE_MDNS=1'],
2965 ['enable_service_discovery==1', {
2966 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2968 ['enable_wifi_bootstrapping==1', {
2969 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2971 ['enable_hangout_services_extension==1', {
2972 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2974 ['enable_ipc_fuzzer==1', {
2975 'defines': ['ENABLE_IPC_FUZZER=1'],
2978 'defines': ['VIDEO_HOLE=1'],
2980 ['enable_load_completion_hacks==1', {
2981 'defines': ['ENABLE_LOAD_COMPLETION_HACKS=1'],
2983 ['v8_use_external_startup_data==1', {
2984 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
2986 ], # conditions for 'target_defaults'
2987 'target_conditions': [
2988 ['<(use_libpci)==1', {
2989 'defines': ['USE_LIBPCI=1'],
2991 ['<(use_openssl)==1', {
2992 'defines': ['USE_OPENSSL=1'],
2994 ['<(use_openssl_certs)==1', {
2995 'defines': ['USE_OPENSSL_CERTS=1'],
2997 ['>(nacl_untrusted_build)==1', {
3000 'USE_OPENSSL_CERTS=1',
3003 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3004 'defines': ['USE_GLIB=1'],
3006 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
3007 'defines': ['USE_NSS=1'],
3009 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3010 'defines': ['OS_CHROMEOS=1'],
3012 ['enable_wexit_time_destructors==1 and OS!="win"', {
3013 # TODO: Enable on Windows too, http://crbug.com/404525
3014 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3016 ['chromium_code==0', {
3018 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3019 # We don't want to get warnings from third-party code,
3020 # so remove any existing warning-enabling flags like -Wall.
3026 # Don't warn about hash_map in third-party code.
3030 # Don't warn about printf format problems.
3031 # This is off by default in gcc but on in Ubuntu's gcc(!).
3035 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3039 # TODO: Fix all warnings on chromeos too.
3040 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3045 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3047 # Don't warn about ignoring the return value from e.g. close().
3048 # This is off by default in some gccs but on by default in others.
3049 # BSD systems do not support this option, since they are usually
3050 # using gcc 4.2.1, which does not have this flag yet.
3051 '-Wno-unused-result',
3056 '_CRT_SECURE_NO_DEPRECATE',
3057 '_CRT_NONSTDC_NO_WARNINGS',
3058 '_CRT_NONSTDC_NO_DEPRECATE',
3059 '_SCL_SECURE_NO_DEPRECATE',
3061 'msvs_disabled_warnings': [4800],
3063 'VCCLCompilerTool': {
3064 'WarningLevel': '3',
3065 'WarnAsError': 'true',
3066 'Detect64BitPortabilityProblems': 'false',
3070 ['buildtype=="Official"', {
3072 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3077 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3080 [ 'component=="shared_library"', {
3081 # TODO(darin): Unfortunately, some third_party code depends on base.
3082 'msvs_disabled_warnings': [
3083 4251, # class 'std::xx' needs to have dll-interface.
3089 [ 'OS=="mac" or OS=="ios"', {
3091 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3094 ['buildtype=="Official"', {
3096 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3103 # TODO(ios): Fix remaining warnings in third-party code, then
3104 # remove this; the Mac cleanup didn't get everything that's
3105 # flagged in an iOS build.
3106 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3107 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3108 # Several internal ios directories generate numerous warnings for
3109 # -Wobjc-missing-property-synthesis.
3110 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3116 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3117 'filename_rules.gypi',
3119 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3120 # C99 macros on Mac and Linux.
3122 '__STDC_CONSTANT_MACROS',
3123 '__STDC_FORMAT_MACROS',
3127 # turn on warnings for signed/unsigned mismatch on chromium code.
3129 'VCCLCompilerTool': {
3130 'AdditionalOptions': ['/we4389'],
3134 ['OS=="win" and component=="shared_library"', {
3135 'msvs_disabled_warnings': [
3136 4251, # class 'std::xx' needs to have dll-interface.
3141 ], # target_conditions for 'target_defaults'
3142 'default_configuration': 'Debug',
3144 # VCLinkerTool LinkIncremental values below:
3146 # 1 == /INCREMENTAL:NO
3148 # Debug links incremental, Release does not.
3150 # Abstract base configurations to cover common attributes.
3154 'msvs_configuration_attributes': {
3155 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3156 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3157 'CharacterSet': '1',
3159 # Add the default import libs.
3162 'AdditionalDependencies': [
3186 'MinimumRequiredVersion': '5.01', # XP.
3187 'TargetMachine': '1',
3189 'VCLibrarianTool': {
3190 'TargetMachine': '1',
3193 'msvs_configuration_platform': 'Win32',
3197 'msvs_configuration_platform': 'x64',
3200 # Make sure to understand http://crbug.com/361720 if you want to
3202 'MinimumRequiredVersion': '5.02', # Server 2003.
3203 'TargetMachine': '17', # x86 - 64
3204 'AdditionalLibraryDirectories!':
3205 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3206 'AdditionalLibraryDirectories':
3207 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3208 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3209 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3211 'VCLibrarianTool': {
3212 'AdditionalLibraryDirectories!':
3213 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3214 'AdditionalLibraryDirectories':
3215 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3216 'TargetMachine': '17', # x64
3223 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3224 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3227 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3229 '<@(debug_extra_cflags)',
3233 'VCCLCompilerTool': {
3234 'Optimization': '<(win_debug_Optimization)',
3235 'PreprocessorDefinitions': ['_DEBUG'],
3236 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3237 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3239 # According to MSVS, InlineFunctionExpansion=0 means
3240 # "default inlining", not "/Ob0".
3241 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3242 ['win_debug_InlineFunctionExpansion==0', {
3243 'AdditionalOptions': ['/Ob0'],
3245 ['win_debug_InlineFunctionExpansion!=""', {
3246 'InlineFunctionExpansion':
3247 '<(win_debug_InlineFunctionExpansion)',
3249 ['win_debug_disable_iterator_debugging==1', {
3250 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3253 # if win_debug_OmitFramePointers is blank, leave as default
3254 ['win_debug_OmitFramePointers==1', {
3255 'OmitFramePointers': 'true',
3257 ['win_debug_OmitFramePointers==0', {
3258 'OmitFramePointers': 'false',
3259 # The above is not sufficient (http://crbug.com/106711): it
3260 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3261 # perform FPO regardless, so we must explicitly disable.
3262 # We still want the false setting above to avoid having
3263 # "/Oy /Oy-" and warnings about overriding.
3264 'AdditionalOptions': ['/Oy-'],
3267 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3270 'LinkIncremental': '<(msvs_debug_link_incremental)',
3271 # ASLR makes debugging with windbg difficult because Chrome.exe and
3272 # Chrome.dll share the same base name. As result, windbg will
3273 # name the Chrome.dll module like chrome_<base address>, where
3274 # <base address> typically changes with each launch. This in turn
3275 # means that breakpoints in Chrome.dll don't stick from one launch
3276 # to the next. For this reason, we turn ASLR off in debug builds.
3277 # Note that this is a three-way bool, where 0 means to pick up
3278 # the default setting, 1 is off and 2 is on.
3279 'RandomizedBaseAddress': 1,
3281 'VCResourceCompilerTool': {
3282 'PreprocessorDefinitions': ['_DEBUG'],
3286 ['OS=="linux" or OS=="android"', {
3287 'target_conditions': [
3288 ['_toolset=="target"', {
3290 '<@(debug_extra_cflags)',
3295 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3296 # Enable libstdc++ debugging facilities to help catch problems
3297 # early, see http://crbug.com/65151 .
3298 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3299 'defines': ['_GLIBCXX_DEBUG=1',],
3301 ['release_valgrind_build==0', {
3304 '-fstack-protector-all', # Implies -fstack-protector
3310 # Allow comparing the address of references and 'this' against 0
3311 # in debug builds. Technically, these can never be null in
3312 # well-defined C/C++ and Clang can optimize such checks away in
3313 # release builds, but they may be used in asserts in debug builds.
3314 '-Wno-undefined-bool-conversion',
3315 '-Wno-tautological-undefined-compare',
3319 '-Wno-undefined-bool-conversion',
3320 '-Wno-tautological-undefined-compare',
3324 'VCCLCompilerTool': {
3325 'AdditionalOptions': [
3326 '-Wno-undefined-bool-conversion',
3327 '-Wno-tautological-undefined-compare',
3340 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3341 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3342 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3345 'VCCLCompilerTool': {
3346 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3348 # In official builds, each target will self-select
3349 # an optimization level.
3350 ['buildtype!="Official"', {
3351 'Optimization': '<(win_release_Optimization)',
3354 # According to MSVS, InlineFunctionExpansion=0 means
3355 # "default inlining", not "/Ob0".
3356 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3357 ['win_release_InlineFunctionExpansion==0', {
3358 'AdditionalOptions': ['/Ob0'],
3360 ['win_release_InlineFunctionExpansion!=""', {
3361 'InlineFunctionExpansion':
3362 '<(win_release_InlineFunctionExpansion)',
3365 # if win_release_OmitFramePointers is blank, leave as default
3366 ['win_release_OmitFramePointers==1', {
3367 'OmitFramePointers': 'true',
3369 ['win_release_OmitFramePointers==0', {
3370 'OmitFramePointers': 'false',
3371 # The above is not sufficient (http://crbug.com/106711): it
3372 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3373 # perform FPO regardless, so we must explicitly disable.
3374 # We still want the false setting above to avoid having
3375 # "/Oy /Oy-" and warnings about overriding.
3376 'AdditionalOptions': ['/Oy-'],
3379 'AdditionalOptions': [
3380 '/d2Zi+', # Improve debugging of Release builds.
3381 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3382 '<@(win_release_extra_cflags)',
3386 # LinkIncremental is a tri-state boolean, where 0 means default
3387 # (i.e., inherit from parent solution), 1 means false, and
3389 'LinkIncremental': '1',
3390 # This corresponds to the /PROFILE flag which ensures the PDB
3391 # file contains FIXUP information (growing the PDB file by about
3392 # 5%) but does not otherwise alter the output binary. This
3393 # information is used by the Syzygy optimization tool when
3394 # decomposing the release image.
3399 ['msvs_use_common_release', {
3400 'includes': ['release.gypi'],
3402 ['release_valgrind_build==0 and tsan==0', {
3405 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3409 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3410 'MEMORY_SANITIZER_INITIAL_SIZE',
3411 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3412 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3415 ['win_use_allocator_shim==0', {
3416 'defines': ['NO_TCMALLOC'],
3418 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3419 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3420 # It seems to work fine with Ubuntu 12 headers though, so use it
3421 # in official builds.
3422 ['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")', {
3423 'target_conditions': [
3424 ['chromium_code==1', {
3425 # Non-chromium code is not guaranteed to compile cleanly
3426 # with _FORTIFY_SOURCE. Also, fortified build may fail
3427 # when optimizations are disabled, so only do that for Release
3430 '_FORTIFY_SOURCE=2',
3435 ['OS=="linux" or OS=="android"', {
3436 'target_conditions': [
3437 ['_toolset=="target"', {
3439 '<@(release_extra_cflags)',
3442 ['enable_resource_whitelist_generation==1', {
3444 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3453 'NS_BLOCK_ASSERTIONS=1',
3459 # Concrete configurations
3462 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3465 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3470 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3471 'target_conditions': [
3472 [ '_type=="executable"', {
3473 # To get a real .dSYM bundle produced by dsymutil, set the
3474 # debug information format to dwarf-with-dsym. Since
3475 # strip_from_xcode will not be used, set Xcode to do the
3476 # stripping as well.
3478 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3479 'DEPLOYMENT_POSTPROCESSING': 'YES',
3480 'STRIP_INSTALLED_PRODUCT': 'YES',
3487 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3489 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3492 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3500 'target_defaults': {
3505 # TODO(glider): enable the default options on other systems.
3507 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3509 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3515 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3516 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3517 'target_defaults': {
3519 '-Wl,--fatal-warnings',
3523 ['os_posix==1 and chromeos==0', {
3524 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3525 # and we want to avoid overriding this, so stack-protector is only
3526 # enabled when not building on Chrome OS.
3527 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3529 'target_defaults': {
3531 '-fstack-protector',
3532 '--param=ssp-buffer-size=4',
3536 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3537 'target_defaults': {
3538 # Enable -Werror by default, but put it in a variable so it can
3539 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3541 'werror%': '-Werror',
3542 'libraries_for_target%': '',
3545 '_FILE_OFFSET_BITS=64',
3548 '<(werror)', # See note above about the werror variable.
3550 '-fno-strict-aliasing', # See http://crbug.com/32204
3552 # TODO(evan): turn this back on once all the builds work.
3554 # Don't warn about unused function params. We use those everywhere.
3555 '-Wno-unused-parameter',
3556 # Don't warn about the "struct foo f = {0};" initialization pattern.
3557 '-Wno-missing-field-initializers',
3558 # Don't export any symbols (for example, to plugins we dlopen()).
3559 # Note: this is *required* to make some plugins work.
3560 '-fvisibility=hidden',
3566 '-fno-threadsafe-statics',
3567 # Make inline functions have hidden visiblity by default.
3568 # Surprisingly, not covered by -fvisibility=hidden.
3569 '-fvisibility-inlines-hidden',
3570 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3571 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3575 '-pthread', '-Wl,-z,noexecstack',
3578 '<(libraries_for_target)',
3583 'debug_optimize%': '0',
3589 '-O>(debug_optimize)',
3596 # Warn in case of text relocations.
3597 '-Wl,--warn-shared-textrel',
3600 ['OS=="android" and android_full_debug==0', {
3601 # Some configurations are copied from Release_Base to reduce
3604 'debug_optimize%': 's',
3608 '-ffunction-sections',
3615 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3616 # We don't omit frame pointers on arm64 since they are required
3617 # to correctly unwind stackframes which contain system library
3618 # function frames (crbug.com/391706).
3620 '-fomit-frame-pointer',
3623 ['OS=="linux" and target_arch=="ia32"', {
3625 '-Wl,--no-as-needed',
3628 ['debug_unwind_tables==1', {
3629 'cflags': ['-funwind-tables'],
3631 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3633 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3634 # definitions in to the right scope to use them when setting
3635 # linux_use_debug_fission, so it can be used here alone.
3636 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3637 'cflags': ['-gsplit-dwarf'],
3643 'release_optimize%': '2',
3644 # Binaries become big and gold is unable to perform GC
3645 # and remove unused sections for some of test targets
3646 # on 32 bit platform.
3647 # (This is currently observed only in chromeos valgrind bots)
3648 # The following flag is to disable --gc-sections linker
3649 # option for these bots.
3650 'no_gc_sections%': 0,
3652 # TODO(bradnelson): reexamine how this is done if we change the
3653 # expansion of configurations
3654 'release_valgrind_build%': 0,
3657 '-O<(release_optimize)',
3658 # Don't emit the GCC version ident directives, they just end up
3659 # in the .comment section taking up binary size.
3661 # Put data and code in their own sections, so that unused symbols
3662 # can be removed at link time with --gc-sections.
3664 '-ffunction-sections',
3667 # Specifically tell the linker to perform optimizations.
3668 # See http://lwn.net/Articles/192624/ .
3673 ['no_gc_sections==0', {
3675 '-Wl,--gc-sections',
3678 ['OS=="android" and target_arch!="arm64"', {
3679 # We don't omit frame pointers on arm64 since they are required
3680 # to correctly unwind stackframes which contain system library
3681 # function frames (crbug.com/391706).
3683 '-fomit-frame-pointer',
3688 'release_optimize%': 's',
3691 # Warn in case of text relocations.
3692 '-Wl,--warn-shared-textrel',
3697 '-fno-omit-frame-pointer',
3701 ['profiling_full_stack_frames==1', {
3704 '-fno-optimize-sibling-calls',
3709 ['release_unwind_tables==1', {
3710 'cflags': ['-funwind-tables'],
3712 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3718 ['target_arch=="ia32"', {
3719 'target_conditions': [
3720 ['_toolset=="target"', {
3722 # Needed so that libs with .s files (e.g. libicudata.a)
3723 # are compatible with the general 32-bit-ness.
3726 # All floating-point computations on x87 happens in 80-bit
3727 # precision. Because the C and C++ language standards allow
3728 # the compiler to keep the floating-point values in higher
3729 # precision than what's specified in the source and doing so
3730 # is more efficient than constantly rounding up to 64-bit or
3731 # 32-bit precision as specified in the source, the compiler,
3732 # especially in the optimized mode, tries very hard to keep
3733 # values in x87 floating-point stack (in 80-bit precision)
3734 # as long as possible. This has important side effects, that
3735 # the real value used in computation may change depending on
3736 # how the compiler did the optimization - that is, the value
3737 # kept in 80-bit is different than the value rounded down to
3738 # 64-bit or 32-bit. There are possible compiler options to
3739 # make this behavior consistent (e.g. -ffloat-store would keep
3740 # all floating-values in the memory, thus force them to be
3741 # rounded to its original precision) but they have significant
3742 # runtime performance penalty.
3744 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3745 # which keep floating-point values in SSE registers in its
3746 # native precision (32-bit for single precision, and 64-bit
3747 # for double precision values). This means the floating-point
3748 # value used during computation does not change depending on
3749 # how the compiler optimized the code, since the value is
3750 # always kept in its specified precision.
3752 # Refer to http://crbug.com/348761 for rationale behind SSE2
3753 # being a minimum requirement for 32-bit Linux builds and
3754 # http://crbug.com/313032 for an example where this has "bit"
3759 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3766 # Use gold linker for Android ia32 target.
3772 # Install packages have started cropping up with
3773 # different headers between the 32-bit and 64-bit
3774 # versions, so we have to shadow those differences off
3775 # and make sure a 32-bit-on-64-bit build picks up the
3777 # For android build, use NDK headers instead of host headers
3778 ['host_arch!="ia32" and OS!="android"', {
3787 ['target_arch=="x64"', {
3788 'target_conditions': [
3789 ['_toolset=="target"', {
3791 # Use gold linker for Android x64 target.
3808 ['target_arch=="arm"', {
3809 'target_conditions': [
3810 ['_toolset=="target"', {
3814 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3815 # has changed whenever it encounters a varargs function. This
3816 # silences those warnings, as they are not helpful and
3817 # clutter legitimate warnings.
3821 ['clang==1 and arm_arch!="" and OS!="android"', {
3823 '-target arm-linux-gnueabihf',
3826 '-target arm-linux-gnueabihf',
3831 '-march=<(arm_arch)',
3834 ['use_lto==1 or use_lto_o2==1', {
3836 '-march=<(arm_arch)',
3841 ['clang==1 and OS!="android"', {
3843 # We need to disable clang's builtin assembler as it can't
3844 # handle several asm files, crbug.com/124610
3845 '-no-integrated-as',
3850 '-mtune=<(arm_tune)',
3853 ['use_lto==1 or use_lto_o2==1', {
3855 '-mtune=<(arm_tune)',
3865 ['use_lto==1 or use_lto_o2==1', {
3872 ['arm_float_abi!=""', {
3874 '-mfloat-abi=<(arm_float_abi)',
3877 ['use_lto==1 or use_lto_o2==1', {
3879 '-mfloat-abi=<(arm_float_abi)',
3889 ['use_lto==1 or use_lto_o2==1', {
3897 # Most of the following flags are derived from what Android
3898 # uses by default when building for arm, reference for which
3899 # can be found in the following file in the Android NDK:
3900 # toolchains/arm-linux-androideabi-4.9/setup.mk
3902 # The tree-sra optimization (scalar replacement for
3903 # aggregates enabling subsequent optimizations) leads to
3904 # invalid code generation when using the Android NDK's
3905 # compiler (r5-r7). This can be verified using
3906 # webkit_unit_tests' WTF.Checked_int8_t test.
3908 # The following option is disabled to improve binary
3909 # size and performance in gcc 4.9.
3910 '-fno-caller-saves',
3913 # Android now supports .relro sections properly.
3914 # NOTE: While these flags enable the generation of .relro
3915 # sections, the generated libraries can still be loaded on
3916 # older Android platform versions.
3923 ['gcc_version==48 and clang==0', {
3925 # The following 5 options are disabled to save on
3926 # binary size in GCC 4.8.
3927 '-fno-partial-inlining',
3928 '-fno-early-inlining',
3929 '-fno-tree-copy-prop',
3930 '-fno-tree-loop-optimize',
3931 '-fno-move-loop-invariants',
3935 'cflags': [ '-mthumb-interwork' ],
3939 # Thumb code with frame pointer makes chrome crash
3942 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3943 # The perf report sometimes incorrectly attributes
3944 # code from tail calls.
3945 '-fno-optimize-sibling-calls',
3948 '-fomit-frame-pointer',
3953 # Clang does not support the following options.
3954 '-mthumb-interwork',
3955 '-finline-limit=64',
3957 '-fno-caller-saves',
3961 # TODO(hans) Enable integrated-as (crbug.com/124610).
3962 '-no-integrated-as',
3963 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3966 # Let clang find the ld.gold in the NDK.
3967 '--gcc-toolchain=<(android_toolchain)/..',
3972 '-marm', # Required for frame pointer based stack traces.
3979 # We set arm_arch to "" so that -march compiler option
3980 # is not set. Otherwise a gcc bug that would complain
3981 # about it conflicting with '-mcpu=cortex-a9'. The flag
3982 # '-march=armv7-a' is actually redundant anyway because
3983 # it is enabled by default when we built the toolchain.
3984 # And using '-mcpu=cortex-a9' should be sufficient.
3987 # Breakpad requires symbols with debugging information
3991 # We want to statically link libstdc++/libgcc_s.
3992 '-static-libstdc++',
3996 # Some components in Chromium (e.g. v8, skia, ffmpeg)
3997 # define their own cflags for arm builds that could
3998 # conflict with the flags we set here (e.g.
3999 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4008 ['target_arch=="arm64"', {
4009 'target_conditions': [
4010 ['_toolset=="target"', {
4014 '-fstack-protector', # stack protector is always enabled on arm64.
4021 ['target_arch=="mipsel"', {
4022 'target_conditions': [
4023 ['_toolset=="target"', {
4025 ['android_webview_build==0 and mips_arch_variant=="r6"', {
4026 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
4029 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4033 ['android_webview_build==0 and mips_arch_variant=="r2"', {
4034 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
4036 ['android_webview_build==0 and mips_arch_variant=="r1"', {
4037 'cflags': ['-mips32', '-Wa,-mips32'],
4041 '-Wl,--no-keep-memory'
4044 '-Wno-uninitialized',
4049 ['target_arch=="mips64el"', {
4050 'target_conditions': [
4051 ['_toolset=="target"', {
4053 ['android_webview_build==0 and mips_arch_variant=="r6"', {
4054 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4055 'ldflags': [ '-mips64r6' ],
4057 ['android_webview_build==0 and mips_arch_variant=="r2"', {
4058 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4059 'ldflags': [ '-mips64r2' ],
4063 '-Wno-uninitialized',
4077 'target_conditions': [
4078 ['_toolset=="target"', {
4080 '--sysroot=<(sysroot)',
4083 '--sysroot=<(sysroot)',
4084 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4090 # TODO(thakis): Remove, http://crbug.com/263960
4091 '-Wno-reserved-user-defined-literal',
4094 # gnu++11 instead of c++11 is needed because some code uses
4095 # typeof() (a GNU extension).
4096 # TODO(thakis): Eventually switch this to c++11 instead,
4097 # http://crbug.com/427584
4101 ['clang==0 and host_clang==1', {
4102 'target_conditions': [
4103 ['_toolset=="host"', {
4104 'cflags_cc': [ '-std=gnu++11', ],
4108 ['clang==1 and clang_use_chrome_plugins==1', {
4110 '<@(clang_chrome_plugins_flags)',
4113 ['clang==1 and clang_load!=""', {
4115 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4118 ['clang==1 and clang_add_plugin!=""', {
4120 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4123 ['clang==1 and target_arch=="ia32"', {
4125 # Else building libyuv gives clang's register allocator issues,
4126 # see llvm.org/PR15798 / crbug.com/233709
4127 '-momit-leaf-frame-pointer',
4128 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4129 '-mstack-alignment=16',
4133 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4135 # See http://crbug.com/110262
4136 '-fcolor-diagnostics',
4139 # Common options for AddressSanitizer, LeakSanitizer,
4140 # ThreadSanitizer and MemorySanitizer.
4141 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4142 'target_conditions': [
4143 ['_toolset=="target"', {
4145 '-fno-omit-frame-pointer',
4146 '-gline-tables-only',
4149 '-fomit-frame-pointer',
4154 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4155 'target_conditions': [
4156 ['_toolset=="target"', {
4158 # Functions interposed by the sanitizers can make ld think
4159 # that some libraries aren't needed when they actually are,
4160 # http://crbug.com/234010. As workaround, disable --as-needed.
4164 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4165 'MEMORY_SANITIZER_INITIAL_SIZE',
4171 'target_conditions': [
4172 ['_toolset=="target"', {
4174 '-fsanitize=address',
4175 # TODO(earthdok): Re-enable. http://crbug.com/427202
4176 #'-fsanitize-blacklist=<(asan_blacklist)',
4179 '-fsanitize=address',
4186 '-mllvm -asan-globals=0', # http://crbug.com/352073
4192 'target_conditions': [
4193 ['_toolset=="target"', {
4195 '-fsanitize=undefined',
4196 # -fsanitize=vptr is incompatible with -fno-rtti.
4197 '-fno-sanitize=vptr',
4200 '-fsanitize=undefined',
4201 # -fsanitize=vptr is incompatible with -fno-rtti.
4202 '-fno-sanitize=vptr',
4208 'target_conditions': [
4209 ['_toolset=="target"', {
4212 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4224 'UNDEFINED_SANITIZER',
4229 ['asan_coverage!=0', {
4230 'target_conditions': [
4231 ['_toolset=="target"', {
4233 '-mllvm -asan-coverage=<(asan_coverage)',
4238 ['asan_field_padding!=0', {
4239 'target_conditions': [
4240 ['_toolset=="target"', {
4242 '-fsanitize-address-field-padding=<(asan_field_padding)',
4248 'target_conditions': [
4249 ['_toolset=="target"', {
4258 'WTF_USE_LEAK_SANITIZER=1',
4264 'target_conditions': [
4265 ['_toolset=="target"', {
4267 '-fsanitize=thread',
4269 '-fsanitize-blacklist=<(tsan_blacklist)',
4272 '-fsanitize=thread',
4276 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4277 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4279 'target_conditions': [
4280 ['_type=="executable"', {
4290 'target_conditions': [
4291 ['_toolset=="target"', {
4293 '-fsanitize=memory',
4294 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4296 '-fsanitize-blacklist=<(msan_blacklist)',
4299 '-fsanitize=memory',
4304 'target_conditions': [
4305 ['_type=="executable"', {
4314 ['use_instrumented_libraries==1', {
4316 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4319 ['use_custom_libcxx==1', {
4321 '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4324 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4325 'target_conditions' : [
4326 # crazy_linker has an upstream gyp file we can't edit, and we
4327 # don't want to instrument it.
4328 ['_toolset=="target" and _target_name!="crazy_linker"', {
4330 '-finstrument-functions',
4331 # Allow mmx intrinsics to inline, so that the
4332 #0 compiler can expand the intrinsics.
4333 '-finstrument-functions-exclude-file-list=mmintrin.h',
4336 ['_toolset=="target" and OS=="android"', {
4338 # Avoids errors with current NDK:
4339 # "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"
4340 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4345 ['linux_dump_symbols==1', {
4348 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4349 'target_conditions': [
4350 ['_toolset=="target"', {
4352 # Attempt to use less memory to prevent the linker from
4353 # running out of address space. Considering installing a
4354 # 64-bit kernel and switching to a 64-bit linker.
4355 '-Wl,--no-keep-memory',
4362 ['use_allocator!="tcmalloc"', {
4363 'defines': ['NO_TCMALLOC'],
4365 ['linux_use_gold_flags==1', {
4366 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4368 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4369 'ldflags': [ '-fuse-ld=gold', ],
4371 'target_conditions': [
4372 ['_toolset=="target"', {
4374 # Experimentation found that using four linking threads
4375 # saved ~20% of link time.
4376 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4377 # Only apply this to the target linker, since the host
4378 # linker might not be gold, but isn't used much anyway.
4379 # TODO(raymes): Disable threading because gold is frequently
4380 # crashing on the bots: crbug.com/161942.
4382 # '-Wl,--thread-count=4',
4387 ['release_valgrind_build==0', {
4388 'target_conditions': [
4389 ['_toolset=="target"', {
4398 ['linux_use_bundled_binutils==1', {
4400 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4403 ['linux_use_bundled_gold==1', {
4404 # Put our binutils, which contains gold in the search path. We pass
4405 # the path to gold to the compiler. gyp leaves unspecified what the
4406 # cwd is when running the compiler, so the normal gyp path-munging
4407 # fails us. This hack gets the right path.
4409 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4412 # Some binutils 2.23 releases may or may not have new dtags enabled,
4413 # but they are all compatible with --disable-new-dtags,
4414 # because the new dynamic tags are not created by default.
4415 ['binutils_version>=223', {
4416 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4417 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4418 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4419 # inside this file to allow usage of --no-as-needed and removal of
4422 '-Wl,--disable-new-dtags',
4425 ['gcc_version>=47 and clang==0', {
4426 'target_conditions': [
4427 ['_toolset=="target"', {
4430 # See comment for -Wno-c++11-narrowing.
4432 # TODO(thakis): Remove, http://crbug.com/263960
4433 '-Wno-literal-suffix',
4438 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4439 'target_conditions': [
4440 ['_toolset=="host"', {
4443 # See comment for -Wno-c++11-narrowing.
4445 # TODO(thakis): Remove, http://crbug.com/263960
4446 '-Wno-literal-suffix',
4454 # FreeBSD-specific options; note that most FreeBSD options are set above,
4457 'target_defaults': {
4459 '-Wl,--no-keep-memory',
4463 # Android-specific options; note that most are set above with Linux.
4466 # This is a unique identifier for a given build. It's used for
4467 # identifying various build artifacts corresponding to a particular
4468 # build of chrome (e.g. where to find archived symbols).
4469 'chrome_build_id%': '',
4471 # Figure this out early since it needs symbols from libgcc.a, so it
4472 # has to be before that in the set of libraries.
4473 ['component=="shared_library"', {
4474 'android_stlport_library': 'stlport_shared',
4476 'android_stlport_library': 'stlport_static',
4480 # Placing this variable here prevents from forking libvpx, used
4481 # by remoting. Remoting is off, so it needn't built,
4482 # so forking it's deps seems like overkill.
4483 # But this variable need defined to properly run gyp.
4484 # A proper solution is to have an OS==android conditional
4485 # in third_party/libvpx/libvpx.gyp to define it.
4486 'libvpx_path': 'lib/linux/arm',
4488 'target_defaults': {
4490 'release_extra_cflags%': '',
4492 # If we're using the components build, append "cr" to all shared
4493 # libraries to avoid naming collisions with android system library
4494 # versions with the same name (e.g. skia, icu).
4495 ['component=="shared_library"', {
4496 'android_product_extension': 'cr.so',
4498 'android_product_extension': 'so',
4502 'target_conditions': [
4503 ['_type=="shared_library"', {
4504 'product_extension': '<(android_product_extension)',
4507 # Settings for building device targets using Android's toolchain.
4508 # These are based on the setup.mk file from the Android NDK.
4510 # The NDK Android executable link step looks as follows:
4512 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4513 # $(PRIVATE_OBJECTS) <-- The .o that we built
4514 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4515 # $(TARGET_LIBGCC) <-- libgcc.a
4516 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4517 # $(PRIVATE_LDLIBS) <-- System .so
4518 # $(TARGET_CRTEND_O) <-- crtend.o
4520 # For now the above are approximated for executables by adding
4521 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4524 # The NDK Android shared library link step looks as follows:
4526 # $(PRIVATE_OBJECTS) <-- The .o that we built
4527 # -l,--whole-archive
4528 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4529 # -l,--no-whole-archive
4530 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4531 # $(TARGET_LIBGCC) <-- libgcc.a
4532 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4533 # $(PRIVATE_LDLIBS) <-- System .so
4535 # For now, assume that whole static libraries are not needed.
4537 # For both executables and shared libraries, add the proper
4538 # libgcc.a to the start of libraries which puts it in the
4539 # proper spot after .o and .a files get linked in.
4541 # TODO: The proper thing to do longer-tem would be proper gyp
4542 # support for a custom link command line.
4543 ['_toolset=="target"', {
4545 '-pthread', # Not supported by Android toolchain.
4548 '-ffunction-sections',
4551 '-fstack-protector',
4553 '-finline-limit=64',
4554 '-Wa,--noexecstack',
4555 '<@(release_extra_cflags)',
4559 '__GNU_SOURCE=1', # Necessary for clone()
4561 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4562 'CHROME_BUILD_ID="<(chrome_build_id)"',
4565 '-pthread', # Not supported by Android toolchain.
4568 '-Wl,--no-undefined',
4571 ['component=="static_library"', {
4573 '-Wl,--exclude-libs=ALL',
4578 # Work around incompatibilities between bionic and clang
4580 '-D__compiler_offsetof=__builtin_offsetof',
4581 '-Dnan=__builtin_nan',
4584 ['target_arch=="arm"', {
4586 '-target arm-linux-androideabi',
4589 '-target arm-linux-androideabi',
4592 ['target_arch=="ia32"', {
4594 '-target x86-linux-androideabi',
4597 '-target x86-linux-androideabi',
4600 # Place holder for x64 support, not tested.
4601 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4602 ['target_arch=="x64"', {
4604 '-target x86_64-linux-androideabi',
4607 '-target x86_64-linux-androideabi',
4614 # Android build relies on -Wl,--gc-sections removing
4615 # unreachable code. ASan instrumentation for globals inhibits
4616 # this and results in a library with unresolvable relocations.
4617 # TODO(eugenis): find a way to reenable this.
4618 '-mllvm -asan-globals=0',
4621 ['target_arch=="arm"', {
4623 # TODO(hans): The ASan runtime is no longer automatically
4624 # added to the link line when using -nostdlib. Can we
4625 # stop adding -nostdlib? (crbug.com/423429)
4626 '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/lib/clang/3.6.0/lib/linux/libclang_rt.asan-arm-android.so',
4631 ['android_webview_build==0', {
4633 # The NDK has these things, but doesn't define the constants
4634 # to say that it does. Define them here instead.
4638 '--sysroot=<(android_ndk_sysroot)',
4641 '--sysroot=<(android_ndk_sysroot)',
4645 '-l<(android_stlport_library)',
4646 # Manually link the libgcc.a that the cross compiler uses.
4647 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4653 ['android_webview_build==1', {
4655 # Android predefines this as 1; undefine it here so Chromium
4656 # can redefine it later to be 2 for chromium code and unset
4657 # for third party code. This works because cflags are added
4659 '-U_FORTIFY_SOURCE',
4660 # Disable any additional warnings enabled by the Android build system but which
4661 # chromium does not build cleanly with (when treating warning as errors).
4662 # Things that are part of -Wextra:
4663 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4664 '-Wno-ignored-qualifiers',
4666 '-Wno-unused-but-set-variable',
4669 # Other things unrelated to -Wextra:
4670 '-Wno-non-virtual-dtor',
4677 ['android_webview_build==1', {
4678 'target_conditions': [
4679 ['chromium_code==0', {
4681 # There is a class of warning which:
4682 # 1) Android always enables and also treats as errors
4683 # 2) Chromium ignores in third party code
4684 # So we re-enable those warnings when building Android.
4686 '-Wno-format-security',
4688 '-Wno-sequence-point',
4691 '-Wno-non-virtual-dtor',
4696 ['target_arch == "arm"', {
4698 # Enable identical code folding to reduce size.
4702 # NOTE: The stlport header include paths below are specified in
4703 # cflags rather than include_dirs because they need to come
4704 # after include_dirs. Think of them like system headers, but
4705 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4706 # toolchain (circa Gingerbread) will exhibit strange errors.
4707 # The include ordering here is important; change with caution.
4708 ['android_webview_build==0', {
4710 '-isystem<(android_stlport_include)',
4713 '-L<(android_stlport_libs_dir)',
4715 }, { # else: android_webview_build!=0
4716 'aosp_build_settings': {
4717 # Specify that we want to statically link stlport from the
4718 # NDK. This will provide all the include and library paths
4719 # automatically at build time, and link the right library.
4720 'LOCAL_NDK_STL_VARIANT': 'stlport_static',
4723 ['target_arch=="ia32"', {
4724 # The x86 toolchain currently has problems with stack-protector.
4726 '-fstack-protector',
4729 '-fno-stack-protector',
4733 'target_conditions': [
4734 ['_type=="executable"', {
4735 # Force android tools to export the "main" symbol so they can be
4736 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4737 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4738 # when ICS support will be dropped.
4741 '-fvisibility=default',
4745 '-Wl,--gc-sections',
4746 '-Wl,-z,nocopyreloc',
4749 # crtbegin_dynamic.o should be the last item in ldflags.
4750 '<(android_ndk_lib)/crtbegin_dynamic.o',
4753 # crtend_android.o needs to be the last item in libraries.
4754 # Do not add any libraries after this!
4755 '<(android_ndk_lib)/crtend_android.o',
4758 ['_type=="shared_library" or _type=="loadable_module"', {
4760 '-Wl,--exclude-libs=ALL',
4763 '-Wl,-shared,-Bsymbolic',
4766 ['android_webview_build==0', {
4768 # crtbegin_so.o should be the last item in ldflags.
4769 '<(android_ndk_lib)/crtbegin_so.o',
4772 # crtend_so.o needs to be the last item in libraries.
4773 # Do not add any libraries after this!
4774 '<(android_ndk_lib)/crtend_so.o',
4781 # Settings for building host targets using the system toolchain.
4782 ['_toolset=="host"', {
4784 # Due to issues in Clang build system, using ASan on 32-bit
4785 # binaries on x86_64 host is problematic.
4786 # TODO(eugenis): re-enable.
4787 '-fsanitize=address',
4790 '-fsanitize=address',
4791 '-Wl,-z,noexecstack',
4792 '-Wl,--gc-sections',
4795 '-Wl,--warn-shared-textrel',
4796 '-Wl,--fatal-warnings',
4799 # Settings for building host targets on mac.
4800 ['_toolset=="host" and host_os=="mac"', {
4810 'cflags!': ['-fvisibility=hidden'],
4811 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4813 ['OS=="mac" or OS=="ios"', {
4814 'target_defaults': {
4817 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4818 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4819 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4820 'COPY_PHASE_STRIP': 'NO',
4821 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4822 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4823 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4824 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4825 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4826 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4827 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4828 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4829 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4830 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4831 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4832 'GCC_VERSION': '4.2',
4833 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4834 'USE_HEADERMAP': 'NO',
4839 # Don't warn about unused function parameters.
4840 '-Wno-unused-parameter',
4841 # Don't warn about the "struct foo f = {0};" initialization
4843 '-Wno-missing-field-initializers',
4846 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4847 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4849 # Note that the prebuilt Clang binaries should not be used for iOS
4850 # development except for ASan builds.
4852 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
4853 # Warn if automatic synthesis is triggered with
4854 # the -Wobjc-missing-property-synthesis flag.
4855 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4856 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4858 # This warns on selectors from Cocoa headers (-length, -set).
4859 # cfe-dev is currently discussing the merits of this warning.
4860 # TODO(thakis): Reevaluate what to do with this, based one
4861 # cfe-dev discussion.
4862 '-Wno-selector-type-mismatch',
4865 ['clang_xcode==0', {
4866 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4867 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4871 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4873 '<@(clang_chrome_plugins_flags)',
4876 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4878 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4881 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4883 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4886 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4888 # See http://crbug.com/110262
4889 '-fcolor-diagnostics',
4892 ['OS=="ios" and target_subarch!="arm32" and \
4893 "<(GENERATOR)"=="xcode"', {
4895 # TODO(ios): when building Chrome for iOS on 64-bit platform
4896 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4897 # enabled. This cause failures when compiling protobuf code,
4898 # so disable the warning. http://crbug.com/359107
4899 '-Wno-shorten-64-to-32',
4907 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4913 '-fsanitize=address',
4914 '-mllvm -asan-globals=0', # http://crbug.com/352073
4915 '-gline-tables-only',
4919 ['asan_coverage!=0', {
4920 'target_conditions': [
4921 ['_toolset=="target"', {
4923 '-mllvm -asan-coverage=<(asan_coverage)',
4929 'target_conditions': [
4930 ['_type!="static_library"', {
4931 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4936 '-fsanitize=address',
4940 ['mac_write_linker_maps==1', {
4943 '-Wl,-map,>(_target_name).map',
4950 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4951 'target_conditions': [
4952 ['_type=="executable"', {
4958 # Define copy_asan_dylib_path in a variable ending in
4959 # _path so that gyp understands it's a path and
4960 # performs proper relativization during dict merging.
4961 'copy_asan_dylib_path':
4962 'mac/copy_asan_runtime_dylib.sh',
4964 'postbuild_name': 'Copy ASan runtime dylib',
4966 '<(copy_asan_dylib_path)',
4975 ], # target_conditions
4976 }, # target_defaults
4977 }], # OS=="mac" or OS=="ios"
4979 'target_defaults': {
4981 # Prevent Mac OS X AssertMacros.h from defining macros that collide
4982 # with common names, like 'check', 'require', and 'verify'.
4983 # (Included by system header. Also exists on iOS but not included.)
4984 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
4985 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
4988 # These should end with %, but there seems to be a bug with % in
4989 # variables that are intended to be set to different values in
4990 # different targets, like these.
4991 'mac_pie': 1, # Most executables can be position-independent.
4992 # Strip debugging symbols from the target.
4993 'mac_strip': '<(mac_strip_release)',
4997 ['mac_want_real_dsym=="default"', {
5000 'mac_real_dsym': '<(mac_want_real_dsym)'
5005 ['mac_want_real_dsym=="default"', {
5006 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5008 'mac_real_dsym': '<(mac_want_real_dsym)'
5015 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5016 # (Equivalent to -fPIC)
5017 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5018 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5019 # Keep pch files below xcodebuild/.
5020 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5022 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5023 # xcode_setting, but not until all downstream projects' mac bots are
5024 # using xcode >= 4.6, because that's when the default value of the
5025 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5026 # setting is a no-op as far as xcode is concerned, but the compiler
5027 # behaves differently based on whether -fno-strict-aliasing is
5029 '-fno-strict-aliasing', # See http://crbug.com/32204.
5032 'target_conditions': [
5033 ['_type=="executable"', {
5036 # Arranges for data (heap) pages to be protected against
5037 # code execution when running on Mac OS X 10.7 ("Lion"), and
5038 # ensures that the position-independent executable (PIE) bit
5039 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5041 # Define change_mach_o_flags in a variable ending in _path
5042 # so that GYP understands it's a path and performs proper
5043 # relativization during dict merging.
5044 'change_mach_o_flags_path':
5045 'mac/change_mach_o_flags_from_xcode.sh',
5046 'change_mach_o_flags_options%': [
5048 'target_conditions': [
5049 ['mac_pie==0 or release_valgrind_build==1', {
5050 # Don't enable PIE if it's unwanted. It's unwanted if
5051 # the target specifies mac_pie=0 or if building for
5052 # Valgrind, because Valgrind doesn't understand slide.
5053 # See the similar mac_pie/release_valgrind_build check
5055 'change_mach_o_flags_options': [
5061 'postbuild_name': 'Change Mach-O Flags',
5063 '<(change_mach_o_flags_path)',
5064 '>@(change_mach_o_flags_options)',
5071 'asan_saves_file': 'asan.saves',
5074 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
5078 'target_conditions': [
5079 ['mac_pie==1 and release_valgrind_build==0', {
5080 # Turn on position-independence (ASLR) for executables. When
5081 # PIE is on for the Chrome executables, the framework will
5082 # also be subject to ASLR.
5083 # Don't do this when building for Valgrind, because Valgrind
5084 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5085 # understand slide, and get rid of the Valgrind check.
5088 '-Wl,-pie', # Position-independent executable (MH_PIE)
5094 ['(_type=="executable" or _type=="shared_library" or \
5095 _type=="loadable_module") and mac_strip!=0', {
5096 'target_conditions': [
5097 ['mac_real_dsym == 1', {
5098 # To get a real .dSYM bundle produced by dsymutil, set the
5099 # debug information format to dwarf-with-dsym. Since
5100 # strip_from_xcode will not be used, set Xcode to do the
5101 # stripping as well.
5105 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5106 'DEPLOYMENT_POSTPROCESSING': 'YES',
5107 'STRIP_INSTALLED_PRODUCT': 'YES',
5108 'target_conditions': [
5109 ['_type=="shared_library" or _type=="loadable_module"', {
5110 # The Xcode default is to strip debugging symbols
5111 # only (-S). Local symbols should be stripped as
5112 # well, which will be handled by -x. Xcode will
5113 # continue to insert -S when stripping even when
5114 # additional flags are added with STRIPFLAGS.
5116 }], # _type=="shared_library" or _type=="loadable_module"
5117 ['_type=="executable"', {
5120 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
5123 }], # _type=="executable" and asan==1
5124 ], # target_conditions
5126 }, # configuration "Release"
5128 }, { # mac_real_dsym != 1
5129 # To get a fast fake .dSYM bundle, use a post-build step to
5130 # produce the .dSYM and strip the executable. strip_from_xcode
5131 # only operates in the Release configuration.
5135 # Define strip_from_xcode in a variable ending in _path
5136 # so that gyp understands it's a path and performs proper
5137 # relativization during dict merging.
5138 'strip_from_xcode_path': 'mac/strip_from_xcode',
5140 'postbuild_name': 'Strip If Needed',
5141 'action': ['<(strip_from_xcode_path)'],
5145 ], # target_conditions
5146 }], # (_type=="executable" or _type=="shared_library" or
5147 # _type=="loadable_module") and mac_strip!=0
5148 ], # target_conditions
5149 }, # target_defaults
5152 'target_defaults': {
5153 'xcode_settings' : {
5154 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5157 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5158 # additional flag to suppress the "unknown compiler option" error.
5159 # Restrict this flag to builds that are either compiling with Xcode
5160 # or compiling with Xcode's Clang. This will allow Ninja builds to
5161 # continue failing on unknown compiler options.
5162 # TODO(rohitrao): This flag is temporary and should be removed as
5163 # soon as the iOS bots are updated to use Xcode 5.1.
5164 ['clang_xcode==1', {
5166 '-Wno-unknown-warning-option',
5170 # Limit the valid architectures depending on "target_subarch".
5171 # This need to include the "arm" architectures but also the "x86"
5172 # ones (they are used when building for the simulator).
5173 ['target_subarch=="arm32"', {
5174 'VALID_ARCHS': ['armv7', 'i386'],
5176 ['target_subarch=="arm64"', {
5177 'VALID_ARCHS': ['arm64', 'x86_64'],
5179 ['target_subarch=="both"', {
5180 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5182 ['use_system_libcxx==1', {
5183 'target_conditions': [
5184 # Only use libc++ when building target for iOS not when building
5185 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5186 # does not support libc++.
5187 ['_toolset=="target"', {
5188 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5192 # The default for deployment target of 7.0+ is libc++, so force
5193 # the old behavior unless libc++ is enabled.
5194 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5198 'target_conditions': [
5199 ['_toolset=="host"', {
5201 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5202 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5211 ['_toolset=="target"', {
5213 # This section should be for overriding host settings. But,
5214 # since we can't negate the iphone deployment target above, we
5215 # instead set it here for target only.
5216 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5217 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5220 ['_type=="executable"', {
5224 'DEPLOYMENT_POSTPROCESSING': 'YES',
5225 'STRIP_INSTALLED_PRODUCT': 'YES',
5230 # Remove dSYM to reduce build time.
5231 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5237 ['chromium_ios_signing', {
5238 # iOS SDK wants everything for device signed.
5239 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5241 'CODE_SIGNING_REQUIRED': 'NO',
5242 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5247 ], # target_conditions
5248 }, # target_defaults
5251 'target_defaults': {
5253 '_WIN32_WINNT=0x0602',
5260 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5261 'WIN32_LEAN_AND_MEAN',
5263 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5264 '_HAS_EXCEPTIONS=0',
5267 ['buildtype=="Official"', {
5268 # In official builds, targets can self-select an optimization
5269 # level by defining a variable named 'optimize', and setting it
5271 # - "size", optimizes for minimal code size - the default.
5272 # - "speed", optimizes for speed over code size.
5273 # - "max", whole program optimization and link-time code
5274 # generation. This is very expensive and should be used
5277 'optimize%': 'size',
5281 # Set /LTCG for the official builds.
5282 'LinkTimeCodeGeneration': '1',
5285 'target_conditions': [
5286 ['optimize=="size"', {
5288 'VCCLCompilerTool': {
5289 # 1, optimizeMinSpace, Minimize Size (/O1)
5290 'Optimization': '1',
5291 # 2, favorSize - Favor small code (/Os)
5292 'FavorSizeOrSpeed': '2',
5297 ['optimize=="speed"', {
5299 'VCCLCompilerTool': {
5300 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5301 'Optimization': '2',
5302 # 1, favorSpeed - Favor fast code (/Ot)
5303 'FavorSizeOrSpeed': '1',
5308 ['optimize=="max"', {
5309 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5310 # builds. Probably anything that this would catch that
5311 # wouldn't be caught in a normal build isn't going to
5312 # actually be a bug, so the incremental value of C4702 for
5313 # PGO builds is likely very small.
5314 'msvs_disabled_warnings': [
5318 'VCCLCompilerTool': {
5319 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5320 'Optimization': '2',
5321 # 1, favorSpeed - Favor fast code (/Ot)
5322 'FavorSizeOrSpeed': '1',
5323 # This implies link time code generation.
5324 'WholeProgramOptimization': 'true',
5342 'AdditionalLibraryDirectories':
5343 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5345 'VCLibrarianTool': {
5346 'AdditionalLibraryDirectories':
5347 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5353 'VCLibrarianTool': {
5354 'AdditionalLibraryDirectories':
5355 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5358 'AdditionalLibraryDirectories':
5359 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5364 # https://code.google.com/p/chromium/issues/detail?id=372451#c20
5365 # Warning 4702 ("Unreachable code") should be re-enabled once
5366 # Express users are updated to VS2013 Update 2.
5367 'msvs_disabled_warnings': [
5371 'VCCLCompilerTool': {
5372 'AdditionalOptions!': [
5373 '/Zc:inline', # Not supported on non-updated Express.
5377 # Explicitly required when using the ATL with express
5378 'AdditionalDependencies': ['atlthunk.lib'],
5380 # ATL 8.0 included in WDK 7.1 makes the linker to generate
5381 # almost eight hundred LNK4254 and LNK4078 warnings:
5382 # - warning LNK4254: section 'ATL' (50000040) merged into
5383 # '.rdata' (40000040) with different attributes
5384 # - warning LNK4078: multiple 'ATL' sections found with
5385 # different attributes
5386 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
5389 'msvs_system_include_dirs': [
5390 '<(windows_driver_kit_path)/inc/atl71',
5391 '<(windows_driver_kit_path)/inc/mfc42',
5395 'msvs_system_include_dirs': [
5396 '<(windows_sdk_path)/Include/shared',
5397 '<(windows_sdk_path)/Include/um',
5398 '<(windows_sdk_path)/Include/winrt',
5399 '$(VSInstallDir)/VC/atlmfc/include',
5401 'msvs_cygwin_shell': 0,
5402 'msvs_disabled_warnings': [
5403 # C4127: conditional expression is constant
5404 # This warning can in theory catch dead code and other problems, but
5405 # triggers in far too many desirable cases where the conditional
5406 # expression is either set by macros or corresponds some legitimate
5407 # compile-time constant expression (due to constant template args,
5408 # conditionals comparing the sizes of different types, etc.). Some of
5409 # these can be worked around, but it's not worth it.
5412 # C4351: new behavior: elements of array 'array' will be default
5414 # This is a silly "warning" that basically just alerts you that the
5415 # compiler is going to actually follow the language spec like it's
5416 # supposed to, instead of not following it like old buggy versions
5417 # did. There's absolutely no reason to turn this on.
5420 # C4355: 'this': used in base member initializer list
5421 # It's commonly useful to pass |this| to objects in a class'
5422 # initializer list. While this warning can catch real bugs, most of
5423 # the time the constructors in question don't attempt to call methods
5424 # on the passed-in pointer (until later), and annotating every legit
5425 # usage of this is simply more hassle than the warning is worth.
5428 # C4503: 'identifier': decorated name length exceeded, name was
5430 # This only means that some long error messages might have truncated
5431 # identifiers in the presence of lots of templates. It has no effect
5432 # on program correctness and there's no real reason to waste time
5433 # trying to prevent it.
5436 # C4611: interaction between 'function' and C++ object destruction is
5438 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5439 # suggests using exceptions instead of setjmp/longjmp for C++, but
5440 # Chromium code compiles without exception support. We therefore have
5441 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5442 # means we have to turn off this warning (and be careful about how
5443 # object destruction happens in such cases).
5446 # TODO(maruel): These warnings are level 4. They will be slowly
5447 # removed as code is fixed.
5448 4100, # Unreferenced formal parameter
5449 4121, # Alignment of a member was sensitive to packing
5450 4189, # Local variable is initialized but not referenced
5451 4244, # Conversion from 'type1' to 'type2', possible loss of data
5452 4481, # Nonstandard extension used: override specifier 'keyword'
5453 4505, # Unreferenced local function has been removed
5454 4510, # Default constructor could not be generated
5455 4512, # Assignment operator could not be generated
5456 4610, # Object can never be instantiated
5459 'VCCLCompilerTool': {
5460 'AdditionalOptions': ['/MP'],
5461 'MinimalRebuild': 'false',
5462 'BufferSecurityCheck': 'true',
5463 'EnableFunctionLevelLinking': 'true',
5464 'RuntimeTypeInfo': 'false',
5465 'WarningLevel': '4',
5466 'WarnAsError': 'true',
5467 'DebugInformationFormat': '3',
5468 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5469 'ExceptionHandling': '0',
5471 'VCLibrarianTool': {
5472 'AdditionalOptions': ['/ignore:4221'],
5473 'AdditionalLibraryDirectories': [
5474 '<(windows_sdk_path)/Lib/win8/um/x86',
5478 'AdditionalDependencies': [
5490 'AdditionalLibraryDirectories': [
5491 '<(windows_sdk_path)/Lib/win8/um/x86',
5493 'GenerateDebugInformation': 'true',
5494 'MapFileName': '$(OutDir)\\$(TargetName).map',
5495 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5496 'FixedBaseAddress': '1',
5499 # 1 == /SUBSYSTEM:CONSOLE
5500 # 2 == /SUBSYSTEM:WINDOWS
5501 # Most of the executables we'll ever create are tests
5502 # and utilities with console output.
5506 'GenerateStublessProxies': 'true',
5507 'TypeLibraryName': '$(InputName).tlb',
5508 'OutputDirectory': '$(IntDir)',
5509 'HeaderFileName': '$(InputName).h',
5510 'DLLDataFileName': '$(InputName).dlldata.c',
5511 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5512 'ProxyFileName': '$(InputName)_p.c',
5514 'VCResourceCompilerTool': {
5516 'AdditionalIncludeDirectories': [
5518 '<(SHARED_INTERMEDIATE_DIR)',
5521 'target_conditions': [
5522 ['_type=="executable"', {
5524 'EmbedManifest': 'true',
5527 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5529 'AdditionalManifestFiles': [
5530 '>(win_exe_compatibility_manifest)',
5537 # Building with Clang on Windows is a work in progress and very
5538 # experimental. See crbug.com/82385.
5539 'VCCLCompilerTool': {
5540 'WarnAsError': 'false',
5541 'RuntimeTypeInfo': 'false',
5542 'AdditionalOptions': [
5543 '-fmsc-version=1800',
5546 # Many files use intrinsics without including this header.
5547 # TODO(hans): Fix those files, or move this to sub-GYPs.
5550 # TODO(hans): Make this list shorter eventually.
5551 '-Qunused-arguments',
5552 '-Wno-c++11-compat-deprecated-writable-strings',
5553 '-Wno-deprecated-declarations',
5555 '-Wno-enum-conversion',
5556 '-Wno-extra-tokens',
5557 '-Wno-ignored-attributes',
5558 '-Wno-incompatible-pointer-types',
5559 '-Wno-int-to-void-pointer-cast',
5560 '-Wno-invalid-noreturn',
5561 '-Wno-logical-op-parentheses',
5563 '-Wno-missing-braces',
5564 '-Wno-missing-declarations',
5565 '-Wno-msvc-include',
5566 '-Wno-null-dereference',
5567 '-Wno-overloaded-virtual',
5569 '-Wno-pointer-sign',
5571 '-Wno-return-type-c-linkage',
5573 '-Wno-sometimes-uninitialized',
5575 '-Wno-tautological-compare',
5576 '-Wno-unknown-pragmas',
5578 '-Wno-unused-function',
5579 '-Wno-unused-private-field',
5580 '-Wno-unused-value',
5581 '-Wno-unused-variable',
5582 '-Wno-unused-local-typedef', # http://crbug.com/411648
5583 '-Wno-inconsistent-missing-override', #http://crbug.com/428099
5588 # ASan on Windows is a work in progress and very experimental.
5589 # See crbug.com/345874.
5590 'VCCLCompilerTool': {
5591 'AdditionalOptions': [
5592 '-fsanitize=address',
5594 'AdditionalIncludeDirectories': [
5595 # MSVC needs to be able to find the sanitizer headers when
5596 # invoked via /fallback. This is critical for using macros
5597 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5599 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/include_sanitizer',
5603 'AdditionalLibraryDirectories': [
5604 # TODO(hans): If make_clang_dir is absolute, this breaks.
5605 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/lib/windows',
5608 'target_conditions': [
5609 ['component=="shared_library"', {
5611 'AdditionalDependencies': [
5612 'clang_rt.asan_dynamic-i386.lib',
5613 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5617 ['_type=="executable" and component=="static_library"', {
5619 'AdditionalDependencies': [
5620 'clang_rt.asan-i386.lib',
5624 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5626 'AdditionalDependencies': [
5627 'clang_rt.asan_dll_thunk-i386.lib',
5637 ['disable_nacl==1', {
5638 'target_defaults': {
5644 ['OS=="win" and msvs_use_common_linker_extras', {
5645 'target_defaults': {
5660 'AdditionalOptions': [
5669 'AdditionalOptions': ['/largeaddressaware'],
5678 'AdditionalOptions': [
5679 # safeseh is not compatible with x64
5691 ['enable_new_npdevice_api==1', {
5692 'target_defaults': {
5694 'ENABLE_NEW_NPDEVICE_API',
5698 # Don't warn about the "typedef 'foo' locally defined but not used"
5699 # for gcc 4.8 and higher.
5700 # TODO: remove this flag once all builds work. See crbug.com/227506
5701 ['gcc_version>=48 and clang==0', {
5702 'target_defaults': {
5704 '-Wno-unused-local-typedefs',
5708 ['gcc_version>=48 and clang==0 and host_clang==1', {
5709 'target_defaults': {
5710 'target_conditions': [
5711 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5715 # In the android webview build, force host targets to be compiled with clang
5716 # as the hermetic host gcc is very old on some platforms. This is already
5717 # the default on the current development version of AOSP but we force it
5718 # here in case we need to compile against an older release version. We also
5719 # explicitly set it to false for target binaries to avoid causing problems
5720 # for the work to enable clang by default in AOSP.
5721 ['android_webview_build==1', {
5722 'target_defaults': {
5723 'target_conditions': [
5724 ['_toolset=="host"', {
5725 'aosp_build_settings': {
5726 'LOCAL_CLANG': 'true',
5728 }, { # else: _toolset != "host"
5729 'aosp_build_settings': {
5730 'LOCAL_CLANG': 'false',
5736 # We need a special case to handle the android webview build on mac because
5737 # the host gcc there doesn't accept this flag, but the target gcc may
5739 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5740 'target_defaults': {
5741 'target_conditions': [
5742 ['_toolset=="host"', {
5744 '-Wno-unused-local-typedefs',
5750 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5752 'make_global_settings': [
5753 ['CC', '<(make_clang_dir)/bin/clang'],
5754 ['CXX', '<(make_clang_dir)/bin/clang++'],
5755 ['CC.host', '$(CC)'],
5756 ['CXX.host', '$(CXX)'],
5759 ['clang==1 and OS=="win"', {
5760 'make_global_settings': [
5761 # On Windows, gyp's ninja generator only looks at CC.
5762 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5765 ['OS=="android" and clang==0', {
5766 # Hardcode the compiler names in the Makefile so that
5767 # it won't depend on the environment at make time.
5768 'make_global_settings': [
5769 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5770 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5771 ['CC.host', '<(host_cc)'],
5772 ['CXX.host', '<(host_cxx)'],
5775 ['OS=="linux" and target_arch=="mipsel"', {
5776 'make_global_settings': [
5777 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5778 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5779 ['CC.host', '<(host_cc)'],
5780 ['CXX.host', '<(host_cxx)'],
5783 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5784 # Set default ARM cross compiling on linux. These can be overridden
5785 # using CC/CXX/etc environment variables.
5786 'make_global_settings': [
5787 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5788 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5789 ['CC.host', '<(host_cc)'],
5790 ['CXX.host', '<(host_cxx)'],
5794 # TODO(yyanagisawa): supports GENERATOR==make
5795 # make generator doesn't support CC_wrapper without CC
5796 # in make_global_settings yet.
5797 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5798 'make_global_settings': [
5799 ['CC_wrapper', '<(gomadir)/gomacc'],
5800 ['CXX_wrapper', '<(gomadir)/gomacc'],
5801 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5802 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5806 'target_defaults': {
5807 'target_conditions': [
5808 ['_toolset=="target"', {
5811 '-ffat-lto-objects',
5817 ['use_lto==1 or use_lto_o2==1', {
5818 'target_defaults': {
5819 'target_conditions': [
5820 ['_toolset=="target"', {
5830 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5831 # This block adds *project-wide* configuration settings to each project
5832 # file. It's almost always wrong to put things here. Specify your
5833 # custom xcode_settings in target_defaults to add them to targets instead.
5836 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5837 # setting sets the SDK on a project-wide basis. In order to get the
5838 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5839 # here at the project level.
5842 ['mac_sdk_path==""', {
5843 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5845 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5851 ['ios_sdk_path==""', {
5853 # TODO(justincohen): Ninja only supports simulator for now.
5854 ['"<(GENERATOR)"=="xcode"', {
5855 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5857 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5861 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5866 # Target both iPhone and iPad.
5867 'TARGETED_DEVICE_FAMILY': '1,2',
5870 ['target_arch=="x64"', {
5875 ['target_arch=="ia32"', {
5884 # The Xcode generator will look for an xcode_settings section at the root
5885 # of each dict and use it to apply settings on a file-wide basis. Most
5886 # settings should not be here, they should be in target-specific
5887 # xcode_settings sections, or better yet, should use non-Xcode-specific
5888 # settings in target dicts. SYMROOT is a special case, because many other
5889 # Xcode variables depend on it, including variables such as
5890 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5891 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5892 # files to appear (when present) in the UI as actual files and not red
5893 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5894 # and therefore SYMROOT, needs to be set at the project level.
5895 'SYMROOT': '<(DEPTH)/xcodebuild',