1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6 # Please don't directly include this file if you are building via gyp_chromium,
7 # since gyp_chromium is automatically forcing its inclusion.
9 # Variables expected to be overriden on the GYP command line (-D) or by
10 # ~/.gyp/include.gypi.
12 # Putting a variables dict inside another variables dict looks kind of
13 # weird. This is done so that 'host_arch', 'chromeos', etc are defined as
14 # variables within the outer variables dict here. This is necessary
15 # to get these variables defined for the conditions within this variables
16 # dict that operate on these variables.
21 # Whether we're building a ChromeOS build.
24 # Whether we're building the cast (chromecast) shell
27 # Whether or not we are using the Aura windowing framework.
30 # Whether or not we are building the Ash shell.
33 # Whether or not we are using CRAS, the ChromeOS Audio Server.
36 # Use a raw surface abstraction.
39 # Configure the build for small devices. See crbug.com/318413
43 # Compute the architecture that we're building on.
44 ['OS=="win" or OS=="mac" or OS=="ios"', {
47 'host_arch%': '<!pymod_do_main(detect_host_arch)',
51 # Copy conditionally-set variables out one scope.
52 'chromeos%': '<(chromeos)',
53 'chromecast%': '<(chromecast)',
54 'use_aura%': '<(use_aura)',
55 'use_ash%': '<(use_ash)',
56 'use_cras%': '<(use_cras)',
57 'use_ozone%': '<(use_ozone)',
58 'embedded%': '<(embedded)',
59 'host_arch%': '<(host_arch)',
61 # Whether we are using Views Toolkit
64 # Use the PCI lib to collect GPU information.
67 # Use OpenSSL instead of NSS as the underlying SSL and crypto
68 # implementation. Certificate verification will in most cases be
69 # handled by the OS. If OpenSSL's struct X509 is used to represent
70 # certificates, use_openssl_certs must be set.
73 # Typedef X509Certificate::OSCertHandle to OpenSSL's struct X509*.
74 'use_openssl_certs%': 0,
76 # Disable viewport meta tag by default.
77 'enable_viewport%': 0,
79 # Enable HiDPI support.
82 # Override buildtype to select the desired build flavor.
83 # Dev - everyday build for development/testing
84 # Official - release build (generally implies additional processing)
85 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
86 # conversion is done), some of the things which are now controlled by
87 # 'branding', such as symbol generation, will need to be refactored
88 # based on 'buildtype' (i.e. we don't care about saving symbols for
89 # non-Official # builds).
92 # Override branding to select the desired branding flavor.
93 'branding%': 'Chromium',
96 # ChromeOS and Windows use Aura and Ash.
97 ['chromeos==1 or OS=="win" or OS=="linux"', {
102 ['chromecast==1 and OS!="android"', {
112 # Whether we're a traditional desktop unix.
113 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
119 # Embedded implies ozone.
125 'target_arch%': 'arm',
127 # Default architecture we're building for is the architecture we're
128 # building on, and possibly sub-architecture (for iOS builds).
129 'target_arch%': '<(host_arch)',
133 # Copy conditionally-set variables out one scope.
134 'chromeos%': '<(chromeos)',
135 'chromecast%': '<(chromecast)',
136 'desktop_linux%': '<(desktop_linux)',
137 'use_aura%': '<(use_aura)',
138 'use_ash%': '<(use_ash)',
139 'use_cras%': '<(use_cras)',
140 'use_ozone%': '<(use_ozone)',
141 'embedded%': '<(embedded)',
142 'use_libpci%': '<(use_libpci)',
143 'use_openssl%': '<(use_openssl)',
144 'use_openssl_certs%': '<(use_openssl_certs)',
145 'enable_viewport%': '<(enable_viewport)',
146 'enable_hidpi%': '<(enable_hidpi)',
147 'buildtype%': '<(buildtype)',
148 'branding%': '<(branding)',
149 'host_arch%': '<(host_arch)',
150 'target_arch%': '<(target_arch)',
152 'target_subarch%': '',
154 # The channel to build on Android: stable, beta, dev, canary, or
155 # default. "default" should be used on non-official builds.
156 'android_channel%': 'default',
158 # This is set when building the Android WebView inside the Android
159 # build system, using the 'android' gyp backend. The WebView code is
160 # still built when this is unset, but builds using the normal chromium
162 'android_webview_build%': 0,
164 # This is set when building the Android WebView in ninja for the
166 'android_webview_telemetry_build%': 0,
168 # Set ARM architecture version.
171 # Use aurax11 for clipboard implementation. This is true on linux_aura.
172 'use_clipboard_aurax11%': 0,
176 # If no gomadir is set, it uses the default gomadir.
180 # The system root for cross-compiles. Default: none.
184 # The system libdir used for this ABI.
185 'system_libdir%': 'lib',
187 # Default MIPS arch variant. This is set in the conditions block
188 # below for MIPS targets.
189 'mips_arch_variant%': '',
197 # Set default value of toolkit_views based on OS.
198 ['OS=="win" or chromeos==1 or use_aura==1', {
204 # Embedded builds use aura without ash or views.
211 # Enable HiDPI on Mac OS, Chrome OS and Windows.
212 ['OS=="mac" or chromeos==1 or OS=="win"', {
216 # Enable the OpenSSL backend on Mac OS.
221 # Enable App Launcher everywhere but mobile.
222 ['OS!="ios" and OS!="android"', {
223 'enable_app_list%': 1,
225 'enable_app_list%': 0,
228 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
229 'use_default_render_theme%': 1,
231 'use_default_render_theme%': 0,
235 'use_ozone_evdev%': 1,
237 'use_ozone_evdev%': 0,
240 # Set default gomadir.
242 'gomadir': 'c:\\goma\\goma-win',
244 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
247 # Set the default "target_subarch" on iOS. Valid values are "arm32",
248 # "arm64" and "both" (meaning a fat binary).
250 # TODO(sdefresne): change the default from "arm32" to "both" for
251 # "target_subarch" once http://crbug.com/339477 is fixed.
253 # TODO(sdefresne): set the "target_arch" to "arm" once compilation
254 # of skia has been fixed for simulator. http://crbug.com/342377
256 'target_subarch%': 'arm32',
259 # Set arch variants for MIPS platforms.
260 ['target_arch=="mips64el"', {
263 'mips_arch_variant%': 'r6',
265 'mips_arch_variant%': 'r2',
270 ['target_arch=="mipsel"', {
271 'mips_arch_variant%': 'r1',
276 # Copy conditionally-set variables out one scope.
277 'chromeos%': '<(chromeos)',
278 'chromecast%': '<(chromecast)',
279 'host_arch%': '<(host_arch)',
280 'target_arch%': '<(target_arch)',
281 'target_subarch%': '<(target_subarch)',
282 'mips_arch_variant%': '<(mips_arch_variant)',
283 'toolkit_views%': '<(toolkit_views)',
284 'desktop_linux%': '<(desktop_linux)',
285 'use_aura%': '<(use_aura)',
286 'use_ash%': '<(use_ash)',
287 'use_cras%': '<(use_cras)',
288 'use_libpci%': '<(use_libpci)',
289 'use_ozone%': '<(use_ozone)',
290 'use_ozone_evdev%': '<(use_ozone_evdev)',
291 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
292 'embedded%': '<(embedded)',
293 'use_openssl%': '<(use_openssl)',
294 'use_openssl_certs%': '<(use_openssl_certs)',
295 'enable_viewport%': '<(enable_viewport)',
296 'enable_hidpi%': '<(enable_hidpi)',
297 'android_channel%': '<(android_channel)',
298 'android_webview_build%': '<(android_webview_build)',
299 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
300 'use_goma%': '<(use_goma)',
301 'gomadir%': '<(gomadir)',
302 'enable_app_list%': '<(enable_app_list)',
303 'use_default_render_theme%': '<(use_default_render_theme)',
304 'buildtype%': '<(buildtype)',
305 'branding%': '<(branding)',
306 'arm_version%': '<(arm_version)',
307 'sysroot%': '<(sysroot)',
308 'chroot_cmd%': '<(chroot_cmd)',
309 'system_libdir%': '<(system_libdir)',
311 # Set to 1 to enable fast builds. Set to 2 for even faster builds
312 # (it disables debug info for fastest compilation - only for use
313 # on compile-only bots).
316 # Set to 1 to not store any build metadata, e.g. ifdef out all __DATE__
317 # and __TIME__. Set to 0 to reenable the use of these macros in the code
318 # base. See http://crbug.com/314403.
319 'dont_embed_build_metadata%': 1,
321 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
322 # This is useful for parallel compilation tools which can't support /Zi.
323 # Only used on Windows.
326 # Set to 1 to enable dcheck in release.
327 'dcheck_always_on%': 0,
329 # Set to 1 to make a build that disables unshipped tracing events.
330 # Note: this setting is ignored if buildtype=="Official".
331 'tracing_like_official_build%': 0,
333 # Disable image loader component extension by default.
334 'image_loader_extension%': 0,
336 # Set NEON compilation flags.
339 # Detect NEON support at run-time.
340 'arm_neon_optional%': 0,
342 # Use libjpeg-turbo as the JPEG codec used by Chromium.
343 'use_libjpeg_turbo%': 1,
345 # Use system libjpeg. Note that the system's libjepg will be used even if
346 # use_libjpeg_turbo is set.
347 'use_system_libjpeg%': 0,
349 # By default, component is set to static_library and it can be overriden
350 # by the GYP command line or by ~/.gyp/include.gypi.
351 'component%': 'static_library',
353 # /analyze is off by default on Windows because it is very slow and noisy.
354 # Enable with GYP_DEFINES=win_analyze=1
357 # Set to select the Title Case versions of strings in GRD files.
358 'use_titlecase_in_grd%': 0,
360 # Use translations provided by volunteers at launchpad.net. This
361 # currently only works on Linux.
362 'use_third_party_translations%': 0,
364 # Remoting compilation is enabled by default. Set to 0 to disable.
367 # Configuration policy is enabled by default. Set to 0 to disable.
368 'configuration_policy%': 1,
370 # Variable safe_browsing is used to control the build time configuration
371 # for safe browsing feature. Safe browsing can be compiled in 3 different
372 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
373 # reporting features without enabling phishing and malware detection. This
374 # is useful to integrate a third party phishing/malware detection to
375 # existing safe browsing logic.
378 # Web speech is enabled by default. Set to 0 to disable.
379 'enable_web_speech%': 1,
381 # Notifications are compiled in by default. Set to 0 to disable.
382 'notifications%' : 1,
384 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
385 # regular builds and 1 for ASan builds.
386 'mac_want_real_dsym%': 'default',
388 # If this is set, the clang plugins used on the buildbot will be used.
389 # Run tools/clang/scripts/update.sh to make sure they are compiled.
390 # This causes 'clang_chrome_plugins_flags' to be set.
391 # Has no effect if 'clang' is not set as well.
392 'clang_use_chrome_plugins%': 1,
394 # Enable building with ASAN (Clang's -fsanitize=address option).
395 # -fsanitize=address only works with clang, but asan=1 implies clang=1
396 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
398 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
399 # Enable coverage gathering instrumentation in ASan. This flag also
400 # controls coverage granularity (1 for function-level coverage, 2 for
401 # block-level coverage).
403 # Enable intra-object-overflow detection in ASan (experimental).
404 'asan_field_padding%': 0,
406 # Enable Chromium overrides of the default configurations for various
407 # dynamic tools (like ASan).
408 'use_sanitizer_options%': 0,
410 # Enable building with SyzyAsan.
411 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
414 # Enable building with LSan (Clang's -fsanitize=leak option).
415 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
416 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
419 # Enable building with TSan (Clang's -fsanitize=thread option).
420 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
421 # See http://clang.llvm.org/docs/ThreadSanitizer.html
423 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
425 # Enable building with MSan (Clang's -fsanitize=memory option).
426 # MemorySanitizer only works with clang, but msan=1 implies clang=1
427 # See http://clang.llvm.org/docs/MemorySanitizer.html
429 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
430 # Track where uninitialized memory originates from. From fastest to
431 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
432 # - track the chain of stores leading from allocation site to use site.
433 'msan_track_origins%': 1,
435 # Enable building with UBSan (Clang's -fsanitize=undefined option).
436 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
437 # See http://clang.llvm.org/docs/UsersManual.html
440 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
441 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
443 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan_vptr/blacklist.txt',
445 # Use the dynamic libraries instrumented by one of the sanitizers
446 # instead of the standard system libraries.
447 'use_instrumented_libraries%': 0,
449 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
450 # stdlibc++ as standard library. This is intended to use for instrumented
452 'use_custom_libcxx%': 0,
454 # Use system libc++ instead of the default C++ library, usually libstdc++.
455 # This is intended for iOS builds only.
456 'use_system_libcxx%': 0,
458 # Use a modified version of Clang to intercept allocated types and sizes
459 # for allocated objects. clang_type_profiler=1 implies clang=1.
460 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
461 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
462 'clang_type_profiler%': 0,
464 # Set to true to instrument the code with function call logger.
465 # See src/third_party/cygprofile/cyg-profile.cc for details.
466 'order_profiling%': 0,
468 # Use the provided profiled order file to link Chrome image with it.
469 # This makes Chrome faster by better using CPU cache when executing code.
470 # This is known as PGO (profile guided optimization).
471 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
472 'order_text_section%' : "",
474 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
475 # libraries on linux x86-64 and arm, plus ASLR.
478 # Whether one-click signin is enabled or not.
479 'enable_one_click_signin%': 0,
481 # Whether to back up data before sync.
482 'enable_pre_sync_backup%': 0,
484 # Enable Chrome browser extensions
485 'enable_extensions%': 1,
488 'enable_google_now%': 1,
490 # Enable basic printing support and UI.
491 'enable_basic_printing%': 1,
493 # Enable printing with print preview. It does not imply
494 # enable_basic_printing. It's possible to build Chrome with preview only.
495 'enable_print_preview%': 1,
497 # Set the version of CLD.
498 # 0: Don't specify the version. This option is for the Finch testing.
503 # For CLD2, the size of the tables that should be included in the build
504 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
506 # See third_party/cld_2/cld_2.gyp for more information.
507 # 0: Small tables, lower accuracy
508 # 2: Large tables, high accuracy
509 'cld2_table_size%': 2,
511 # Enable spell checker.
512 'enable_spellcheck%': 1,
514 # Webrtc compilation is enabled by default. Set to 0 to disable.
517 # Enables use of the session service, which is enabled by default.
518 # Support for disabling depends on the platform.
519 'enable_session_service%': 1,
521 # Enables theme support, which is enabled by default. Support for
522 # disabling depends on the platform.
525 # Enables autofill dialog and associated features; disabled by default.
526 'enable_autofill_dialog%' : 0,
528 # Defaults Wallet integration in Autofill dialog to use production
529 # servers. Unofficial builds won't have the proper API keys.
530 'enable_prod_wallet_service%': 0,
532 # Enables support for background apps.
533 'enable_background%': 1,
535 # Enable the task manager by default.
536 'enable_task_manager%': 1,
538 # Enables used resource whitelist generation; disabled by default.
539 'enable_resource_whitelist_generation%': 0,
541 # Enable FILE support by default.
542 'disable_file_support%': 0,
544 # Enable FTP support by default.
545 'disable_ftp_support%': 0,
547 # Use native android functions in place of ICU. Not supported by most
549 'use_icu_alternatives_on_android%': 0,
551 # Use of precompiled headers on Windows.
553 # This variable may be explicitly set to 1 (enabled) or 0
554 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
555 # This setting will override the default.
558 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
560 'chromium_win_pch%': 0,
563 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
564 # Set this to true when building with Clang.
565 # See http://code.google.com/p/chromium/wiki/Clang for details.
566 # If this is set, clang is used as both host and target compiler in
567 # cross-compile builds.
570 # Enable plug-in installation by default.
571 'enable_plugin_installation%': 1,
573 # Specifies whether to use canvas_skia.cc in place of platform
574 # specific implementations of gfx::Canvas. Affects text drawing in the
576 # TODO(asvitkine): Enable this on all platforms and delete this flag.
577 # http://crbug.com/105550
578 'use_canvas_skia%': 0,
580 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
581 # with one of those tools.
582 'build_for_tool%': '',
584 # If no directory is specified then a temporary directory will be used.
585 'test_isolation_outdir%': '',
586 # True if isolate should fail if the isolate files refer to files
588 'test_isolation_fail_on_missing': 1,
590 'wix_path%': '<(DEPTH)/third_party/wix',
592 # Managed users are enabled by default.
593 'enable_managed_users%': 1,
595 # Platform natively supports discardable memory.
596 'native_discardable_memory%': 0,
598 # Platform sends memory pressure signals natively.
599 'native_memory_pressure_signals%': 0,
601 'spdy_proxy_auth_property%' : '',
602 'spdy_proxy_auth_value%' : '',
604 'enable_service_discovery%': 0,
605 'enable_wifi_bootstrapping%': 0,
606 'enable_hangout_services_extension%': 0,
608 # Enable the Syzygy optimization step.
609 'syzygy_optimize%': 0,
611 # Enable hole punching for the protected video.
614 # Temporary hack to allow us to unify blink's definitions of load
615 # completion. blink uses a crazy set of constraints to determine load
616 # completion, but only actually requires them for layout tests. However,
617 # we need to maintain all the old behaviors while the plumbing is put in
618 # place on both sides of the repo boundary.
619 'enable_load_completion_hacks%': 1,
621 # Automatically select platforms under ozone. Turn this off to
622 # build only explicitly selected platforms.
623 'ozone_auto_platforms%': 1,
625 # If this is set clang is used as host compiler, but not as target
626 # compiler. Always do this by default.
629 # Variables to control Link-Time Optimizations (LTO).
630 # Note: the variables must *not* be enabled at the same time.
631 # In this case LTO would 'merge' the optimization flags
632 # at link-time which would lead to all code be optimized with -O2.
633 # Enable LTO on the code compiled with -Os.
634 # See crbug.com/407544
636 # Enable LTO on code compiled with -O2.
640 # A flag for POSIX platforms
647 # A flag for BSD platforms
648 ['OS=="freebsd" or OS=="openbsd"', {
655 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
661 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
662 # OpenSSL's certificate definition.
663 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
664 'use_openssl_certs%': 1,
666 'use_openssl_certs%': 0,
669 # libudev usage. This currently only affects the content layer.
670 ['OS=="linux" and embedded==0', {
676 # Flags to use X11 on non-Mac POSIX platforms.
677 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
684 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
690 # Flags to use pango and cairo.
691 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
700 ['OS=="linux" and embedded==0', {
706 # We always use skia text rendering in Aura on Windows, since GDI
707 # doesn't agree with our BackingStore.
708 # TODO(beng): remove once skia text rendering is on by default.
709 ['use_aura==1 and OS=="win"', {
710 'enable_skia_text%': 1,
713 # A flag to enable or disable our compile-time dependency
714 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
715 # support will be available. This option is useful
716 # for Linux distributions and for Aura.
717 ['OS!="linux" or chromeos==1', {
718 'use_gnome_keyring%': 0,
720 'use_gnome_keyring%': 1,
723 ['OS=="mac" or OS=="ios"', {
724 # Mac and iOS want Title Case strings
725 'use_titlecase_in_grd%': 1,
728 # Enable loader extensions on Chrome OS.
730 'image_loader_extension%': 1,
732 'image_loader_extension%': 0,
735 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
736 'enable_one_click_signin%': 1,
737 'enable_pre_sync_backup%': 1,
741 'enable_extensions%': 0,
742 'enable_google_now%': 0,
744 'enable_spellcheck%': 0,
748 'arm_neon_optional%': 1,
749 'native_discardable_memory%': 1,
750 'native_memory_pressure_signals%': 1,
751 'enable_basic_printing%': 1,
752 'enable_print_preview%': 0,
753 'enable_task_manager%':0,
757 # Android OS includes support for proprietary codecs regardless of
758 # building Chromium or Google Chrome. We also ship Google Chrome and
759 # Chromecast with proprietary codecs.
760 ['OS=="android" or branding=="Chrome" or chromecast==1', {
761 'proprietary_codecs%': 1,
763 'proprietary_codecs%': 0,
766 ['OS=="mac" or OS=="ios"', {
767 'native_discardable_memory%': 1,
768 'native_memory_pressure_signals%': 1,
771 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
772 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
773 'enable_autofill_dialog%': 1,
776 ['buildtype=="Official"', {
777 'enable_prod_wallet_service%': 1,
787 'disable_ftp_support%': 1,
788 'enable_extensions%': 0,
789 'enable_google_now%': 0,
791 'enable_basic_printing%': 0,
792 'enable_print_preview%': 0,
793 'enable_session_service%': 0,
794 'enable_spellcheck%': 0,
800 'enable_managed_users%': 0,
801 'enable_task_manager%': 0,
802 'use_system_libcxx%': 1,
803 'support_pre_M6_history_database%': 0,
806 # Use GPU accelerated cross process image transport by default
807 # on linux builds with the Aura window manager
808 ['use_aura==1 and OS=="linux"', {
809 'ui_compositor_image_transport%': 1,
811 'ui_compositor_image_transport%': 0,
814 # Turn precompiled headers on by default.
815 ['OS=="win" and buildtype!="Official"', {
816 'chromium_win_pch%': 1
819 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
820 'enable_plugin_installation%': 0,
822 'enable_plugin_installation%': 1,
825 # Whether PPAPI is enabled.
826 ['OS=="android" or OS=="ios" or embedded==1', {
827 'enable_plugins%': 0,
829 'enable_plugins%': 1,
832 # linux_use_bundled_gold: whether to use the gold linker binary checked
833 # into third_party/binutils. Force this off via GYP_DEFINES when you
834 # are using a custom toolchain and need to control -B in ldflags.
835 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
836 # for component=static_library builds.
837 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
838 'linux_use_bundled_gold%': 1,
840 'linux_use_bundled_gold%': 0,
843 # linux_use_bundled_binutils: whether to use the binary binutils
844 # checked into third_party/binutils. These are not multi-arch so cannot
845 # be used except on x86 and x86-64 (the only two architectures which
846 # are currently checke in). Force this off via GYP_DEFINES when you
847 # are using a custom toolchain and need to control -B in cflags.
848 ['OS=="linux" and (target_arch=="x64")', {
849 'linux_use_bundled_binutils%': 1,
851 'linux_use_bundled_binutils%': 0,
854 # linux_use_gold_flags: whether to use build flags that rely on gold.
855 # On by default for x64 Linux.
856 ['OS=="linux" and target_arch=="x64"', {
857 'linux_use_gold_flags%': 1,
859 'linux_use_gold_flags%': 0,
862 # linux_use_debug_fission: whether to use split DWARF debug info
863 # files. This can reduce link time significantly, but is incompatible
864 # with some utilities such as icecc and ccache. Requires gold and
865 # gcc >= 4.8 or clang.
866 # http://gcc.gnu.org/wiki/DebugFission
867 ['OS=="linux" and target_arch=="x64"', {
868 'linux_use_debug_fission%': 1,
870 'linux_use_debug_fission%': 0,
873 ['OS=="android" or OS=="ios"', {
874 'enable_captive_portal_detection%': 0,
876 'enable_captive_portal_detection%': 1,
879 # Enable Skia UI text drawing incrementally on different platforms.
880 # http://crbug.com/105550
882 # On Aura, this allows per-tile painting to be used in the browser
885 'use_canvas_skia%': 1,
889 'enable_basic_printing%': 0,
890 'enable_print_preview%': 1,
891 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
892 'use_libjpeg_turbo%': 0,
895 # Do not enable the Settings App on ChromeOS.
896 ['enable_app_list==1 and chromeos==0', {
897 'enable_settings_app%': 1,
899 'enable_settings_app%': 0,
902 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
903 # Set some defaults for arm/linux chrome builds
904 'use_allocator%': 'none',
905 # sysroot needs to be an absolute path otherwise it generates
906 # incorrect results when passed to pkg-config
907 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot',
908 }], # OS=="linux" and target_arch=="arm" and chromeos==0
910 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
912 ['target_arch=="x64"', {
913 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
915 ['target_arch=="ia32"', {
916 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
919 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
921 ['OS=="linux" and target_arch=="mipsel"', {
922 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
923 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
926 # Whether tests targets should be run, archived or just have the
927 # dependencies verified. All the tests targets have the '_run' suffix,
928 # e.g. base_unittests_run runs the target base_unittests. The test
929 # target always calls tools/swarming_client/isolate.py. See the script's
930 # --help for more information. Meant to be overriden with GYP_DEFINES.
931 # TODO(maruel): Remove the conditions as more configurations are
933 ['OS!="ios" and OS!="android" and chromeos==0', {
934 'test_isolation_mode%': 'check',
936 'test_isolation_mode%': 'noop',
938 # Whether Android build uses OpenMAX DL FFT.
939 ['OS=="android" and ((target_arch=="arm" and arm_version >= 7) or target_arch=="ia32" or target_arch=="x64" or target_arch=="arm64" or target_arch=="mipsel")', {
940 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
941 # When enabled, this will also enable WebAudio support on
942 # Android for these architectures. Default is enabled. Whether
943 # WebAudio is actually available depends on runtime settings
945 'use_openmax_dl_fft%': 1,
947 'use_openmax_dl_fft%': 0,
949 ['OS=="win" or OS=="linux"', {
953 # Turns on compiler optimizations in V8 in Debug build, except
954 # on android_clang, where we're hitting a weird linker error.
955 # TODO(dpranke): http://crbug.com/266155 .
957 'v8_optimized_debug%': 1,
959 'v8_optimized_debug%': 2,
962 # Disable various features by default on embedded.
965 'enable_basic_printing%': 0,
966 'enable_print_preview%': 0,
969 # By default, use ICU data file (icudtl.dat) on all platforms
970 # except when building Android WebView or Chromecast.
971 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
972 # Set the data reduction proxy origin for Android Webview.
973 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0', {
974 'icu_use_data_file_flag%' : 1,
976 'icu_use_data_file_flag%' : 0,
978 ['OS=="win" or OS=="mac"', {
979 'enable_wifi_bootstrapping%' : 1,
982 # Path to sas.dll, which provides the SendSAS function.
983 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
984 ['target_arch=="x64"', {
985 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
987 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
990 # Turn on JNI generation optimizations on non-WebView builds.
991 ['OS=="android" and android_webview_build==0', {
992 'optimize_jni_generation%': 1,
994 'optimize_jni_generation%': 0,
997 # TODO(baixo): Enable v8_use_external_startup_data
998 # http://crbug.com/421063
999 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0', {
1000 'v8_use_external_startup_data': 0,
1002 'v8_use_external_startup_data': 0,
1006 # Set this to 1 to enable use of concatenated impulse responses
1007 # for the HRTF panner in WebAudio.
1008 'use_concatenated_impulse_responses': 1,
1010 # You can set the variable 'use_official_google_api_keys' to 1
1011 # to use the Google-internal file containing official API keys
1012 # for Google Chrome even in a developer build. Setting this
1013 # variable explicitly to 1 will cause your build to fail if the
1014 # internal file is missing.
1016 # The variable is documented here, but not handled in this file;
1017 # see //google_apis/determine_use_official_keys.gypi for the
1020 # Set the variable to 0 to not use the internal file, even when
1021 # it exists in your checkout.
1023 # Leave it unset in your include.gypi to have the variable
1024 # implicitly set to 1 if you have
1025 # src/google_apis/internal/google_chrome_api_keys.h in your
1026 # checkout, and implicitly set to 0 if not.
1028 # Note that official builds always behave as if the variable
1029 # was explicitly set to 1, i.e. they always use official keys,
1030 # and will fail to build if the internal file is missing.
1032 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1033 # include.gypi or by other means. Due to subtleties of GYP, this
1034 # is not the same as leaving the variable unset, even though its
1036 # //google_apis/determine_use_official_keys.gypi is 2.
1038 # Set these to bake the specified API keys and OAuth client
1039 # IDs/secrets into your build.
1041 # If you create a build without values baked in, you can instead
1042 # set environment variables to provide the keys at runtime (see
1043 # src/google_apis/google_api_keys.h for details). Features that
1044 # require server-side APIs may fail to work if no keys are
1047 # Note that if you are building an official build or if
1048 # use_official_google_api_keys has been set to 1 (explicitly or
1049 # implicitly), these values will be ignored and the official
1050 # keys will be used instead.
1051 'google_api_key%': '',
1052 'google_default_client_id%': '',
1053 'google_default_client_secret%': '',
1054 # Native Client is enabled by default.
1055 'disable_nacl%': '0',
1057 # Set to 1 to support old history files
1058 'support_pre_M6_history_database%': '1',
1061 # Copy conditionally-set variables out one scope.
1062 'branding%': '<(branding)',
1063 'buildtype%': '<(buildtype)',
1064 'target_arch%': '<(target_arch)',
1065 'target_subarch%': '<(target_subarch)',
1066 'mips_arch_variant%': '<(mips_arch_variant)',
1067 'host_arch%': '<(host_arch)',
1068 'toolkit_views%': '<(toolkit_views)',
1069 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1070 'use_aura%': '<(use_aura)',
1071 'use_ash%': '<(use_ash)',
1072 'use_cras%': '<(use_cras)',
1073 'use_libpci%': '<(use_libpci)',
1074 'use_openssl%': '<(use_openssl)',
1075 'use_openssl_certs%': '<(use_openssl_certs)',
1076 'use_nss%': '<(use_nss)',
1077 'use_udev%': '<(use_udev)',
1078 'os_bsd%': '<(os_bsd)',
1079 'os_posix%': '<(os_posix)',
1080 'use_dbus%': '<(use_dbus)',
1081 'use_glib%': '<(use_glib)',
1082 'use_pango%': '<(use_pango)',
1083 'use_cairo%': '<(use_cairo)',
1084 'use_ozone%': '<(use_ozone)',
1085 'use_ozone_evdev%': '<(use_ozone_evdev)',
1086 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1087 'desktop_linux%': '<(desktop_linux)',
1088 'use_x11%': '<(use_x11)',
1089 'use_gnome_keyring%': '<(use_gnome_keyring)',
1090 'linux_fpic%': '<(linux_fpic)',
1091 'chromeos%': '<(chromeos)',
1092 'chromecast%': '<(chromecast)',
1093 'enable_viewport%': '<(enable_viewport)',
1094 'enable_hidpi%': '<(enable_hidpi)',
1095 'image_loader_extension%': '<(image_loader_extension)',
1096 'fastbuild%': '<(fastbuild)',
1097 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1098 'win_z7%': '<(win_z7)',
1099 'dcheck_always_on%': '<(dcheck_always_on)',
1100 'tracing_like_official_build%': '<(tracing_like_official_build)',
1101 'arm_version%': '<(arm_version)',
1102 'arm_neon%': '<(arm_neon)',
1103 'arm_neon_optional%': '<(arm_neon_optional)',
1104 'sysroot%': '<(sysroot)',
1105 'chroot_cmd%': '<(chroot_cmd)',
1106 'system_libdir%': '<(system_libdir)',
1107 'component%': '<(component)',
1108 'win_analyze%': '<(win_analyze)',
1109 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1110 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1111 'use_third_party_translations%': '<(use_third_party_translations)',
1112 'remoting%': '<(remoting)',
1113 'enable_one_click_signin%': '<(enable_one_click_signin)',
1114 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1115 'enable_webrtc%': '<(enable_webrtc)',
1116 'chromium_win_pch%': '<(chromium_win_pch)',
1117 'configuration_policy%': '<(configuration_policy)',
1118 'safe_browsing%': '<(safe_browsing)',
1119 'enable_web_speech%': '<(enable_web_speech)',
1120 'notifications%': '<(notifications)',
1121 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1122 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1124 'asan_blacklist%': '<(asan_blacklist)',
1125 'asan_coverage%': '<(asan_coverage)',
1126 'asan_field_padding%': '<(asan_field_padding)',
1127 'use_sanitizer_options%': '<(use_sanitizer_options)',
1128 'syzyasan%': '<(syzyasan)',
1129 'syzygy_optimize%': '<(syzygy_optimize)',
1132 'msan_blacklist%': '<(msan_blacklist)',
1133 'msan_track_origins%': '<(msan_track_origins)',
1135 'tsan_blacklist%': '<(tsan_blacklist)',
1136 'ubsan%': '<(ubsan)',
1137 'ubsan_vptr%': '<(ubsan_vptr)',
1138 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1139 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1140 'use_custom_libcxx%': '<(use_custom_libcxx)',
1141 'use_system_libcxx%': '<(use_system_libcxx)',
1142 'clang_type_profiler%': '<(clang_type_profiler)',
1143 'order_profiling%': '<(order_profiling)',
1144 'order_text_section%': '<(order_text_section)',
1145 'enable_extensions%': '<(enable_extensions)',
1146 'enable_plugin_installation%': '<(enable_plugin_installation)',
1147 'enable_plugins%': '<(enable_plugins)',
1148 'enable_session_service%': '<(enable_session_service)',
1149 'enable_themes%': '<(enable_themes)',
1150 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1151 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1152 'enable_background%': '<(enable_background)',
1153 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1154 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1155 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1156 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1157 'use_canvas_skia%': '<(use_canvas_skia)',
1158 'test_isolation_mode%': '<(test_isolation_mode)',
1159 'test_isolation_outdir%': '<(test_isolation_outdir)',
1160 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1161 'enable_basic_printing%': '<(enable_basic_printing)',
1162 'enable_print_preview%': '<(enable_print_preview)',
1163 'enable_spellcheck%': '<(enable_spellcheck)',
1164 'enable_google_now%': '<(enable_google_now)',
1165 'cld_version%': '<(cld_version)',
1166 'cld2_table_size%': '<(cld2_table_size)',
1167 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1168 'disable_file_support%': '<(disable_file_support)',
1169 'disable_ftp_support%': '<(disable_ftp_support)',
1170 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1171 'enable_task_manager%': '<(enable_task_manager)',
1172 'sas_dll_path%': '<(sas_dll_path)',
1173 'wix_path%': '<(wix_path)',
1174 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1175 'use_system_libjpeg%': '<(use_system_libjpeg)',
1176 'android_channel%': '<(android_channel)',
1177 'android_webview_build%': '<(android_webview_build)',
1178 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
1179 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1180 'gyp_managed_install%': 0,
1181 'create_standalone_apk%': 1,
1182 'enable_app_list%': '<(enable_app_list)',
1183 'use_default_render_theme%': '<(use_default_render_theme)',
1184 'enable_settings_app%': '<(enable_settings_app)',
1185 'google_api_key%': '<(google_api_key)',
1186 'google_default_client_id%': '<(google_default_client_id)',
1187 'google_default_client_secret%': '<(google_default_client_secret)',
1188 'enable_managed_users%': '<(enable_managed_users)',
1189 'native_discardable_memory%': '<(native_discardable_memory)',
1190 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1191 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1192 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1193 'enable_mdns%' : '<(enable_mdns)',
1194 'enable_service_discovery%' : '<(enable_service_discovery)',
1195 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1196 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1197 'v8_optimized_debug%': '<(v8_optimized_debug)',
1198 'proprietary_codecs%': '<(proprietary_codecs)',
1199 'use_goma%': '<(use_goma)',
1200 'gomadir%': '<(gomadir)',
1201 'use_lto%': '<(use_lto)',
1202 'use_lto_o2%': '<(use_lto_o2)',
1203 'video_hole%': '<(video_hole)',
1204 'enable_load_completion_hacks%': '<(enable_load_completion_hacks)',
1205 'support_pre_M6_history_database%': '<(support_pre_M6_history_database)',
1206 'v8_use_external_startup_data': '<(v8_use_external_startup_data)',
1208 # Whether or not we are building the Athena shell.
1211 # Use system protobuf instead of bundled one.
1212 'use_system_protobuf%': 0,
1214 # Use system yasm instead of bundled one.
1215 'use_system_yasm%': 0,
1217 # Use system ICU instead of bundled one.
1218 'use_system_icu%' : 0,
1220 # Default to enabled PIE; this is important for ASLR but we may need to be
1221 # able to turn it off for various reasons.
1222 'linux_disable_pie%': 0,
1224 # The release channel that this build targets. This is used to restrict
1225 # channel-specific build options, like which installer packages to create.
1226 # The default is 'all', which does no channel-specific filtering.
1229 # Override chromium_mac_pch and set it to 0 to suppress the use of
1230 # precompiled headers on the Mac. Prefix header injection may still be
1231 # used, but prefix headers will not be precompiled. This is useful when
1232 # using distcc to distribute a build to compile slaves that don't
1233 # share the same compiler executable as the system driving the compilation,
1234 # because precompiled headers rely on pointers into a specific compiler
1235 # executable's image. Setting this to 0 is needed to use an experimental
1236 # Linux-Mac cross compiler distcc farm.
1237 'chromium_mac_pch%': 1,
1239 # The default value for mac_strip in target_defaults. This cannot be
1240 # set there, per the comment about variable% in a target_defaults.
1241 'mac_strip_release%': 0,
1243 # Set to 1 to enable java code coverage. Instruments classes during build
1244 # to produce .ec files during runtime.
1245 'emma_coverage%': 0,
1247 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1248 # separated with whitespace and/or comma. Only has effect if
1249 # 'emma_coverage=1'.
1252 # Set to 1 to enable running Android lint on java/class files.
1255 # Although base/allocator lets you select a heap library via an
1256 # environment variable, the libcmt shim it uses sometimes gets in
1257 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1258 # 'win_use_allocator_shim': 0,
1259 # 'win_release_RuntimeLibrary': 2
1260 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1261 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1263 # TODO(bradnelson): eliminate this when possible.
1264 # To allow local gyp files to prevent release.vsprops from being included.
1265 # Yes(1) means include release.vsprops.
1266 # Once all vsprops settings are migrated into gyp, this can go away.
1267 'msvs_use_common_release%': 1,
1269 # TODO(bradnelson): eliminate this when possible.
1270 # To allow local gyp files to override additional linker options for msvs.
1271 # Yes(1) means set use the common linker options.
1272 'msvs_use_common_linker_extras%': 1,
1274 # TODO(sgk): eliminate this if possible.
1275 # It would be nicer to support this via a setting in 'target_defaults'
1276 # in chrome/app/locales/locales.gypi overriding the setting in the
1277 # 'Debug' configuration in the 'target_defaults' dict below,
1278 # but that doesn't work as we'd like.
1279 'msvs_debug_link_incremental%': '2',
1281 # Needed for some of the largest modules.
1282 'msvs_debug_link_nonincremental%': '1',
1284 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1285 # to get incremental linking to be faster in debug builds.
1286 'incremental_chrome_dll%': '0',
1288 # Experimental setting to break chrome.dll into multiple pieces based on
1290 'chrome_multiple_dll%': '0',
1292 # Experimental setting to optimize Chrome's DLLs with PGO.
1293 'chrome_pgo_phase%': '0',
1295 # Whether the VS xtree header has been patched to disable warning 4702. If
1296 # it has, then we don't need to disable 4702 (unreachable code warning).
1297 # The patch is preapplied to the internal toolchain and hence all bots.
1298 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1301 'clang%': '<(clang)',
1302 'host_clang%': '<(host_clang)',
1303 'make_clang_dir%': '<(make_clang_dir)',
1305 # Control which version of clang to use when building for iOS. If set to
1306 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1307 # the version of clang that ships with the Chromium source. This variable
1308 # is automatically set to '1' when using the Xcode generator.
1311 # These two variables can be set in GYP_DEFINES while running
1312 # |gclient runhooks| to let clang run a plugin in every compilation.
1313 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1315 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1318 'clang_add_plugin%': '',
1320 # Tell ld64 to write map files describing binary layout. Useful
1321 # for looking at what contributes to binary size, e.g. with
1322 # https://github.com/nico/bloat
1323 'mac_write_linker_maps%': 0,
1325 # The default type of gtest.
1326 'gtest_target_type%': 'executable',
1328 # Enable sampling based profiler.
1329 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1331 # Profile without optimizing out stack frames when profiling==1.
1332 'profiling_full_stack_frames%': '0',
1334 # And if we want to dump symbols for Breakpad-enabled builds.
1335 'linux_dump_symbols%': 0,
1336 # And if we want to strip the binary after dumping symbols.
1337 'linux_strip_binary%': 0,
1338 # If we want stack unwind support for backtrace().
1339 'debug_unwind_tables%': 1,
1340 'release_unwind_tables%': 1,
1342 # Override where to find binutils
1343 'binutils_version%': 0,
1344 'binutils_dir%': '',
1347 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1348 'use_allocator%': 'tcmalloc',
1350 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1351 'linux_link_gnome_keyring%': 0,
1352 # Set to 1 to link against gsettings APIs instead of using dlopen().
1353 'linux_link_gsettings%': 0,
1355 # Enable use of OpenMAX DL FFT routines.
1356 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1358 # Enable new NPDevice API.
1359 'enable_new_npdevice_api%': 0,
1361 # .gyp files or targets should set chromium_code to 1 if they build
1362 # Chromium-specific code, as opposed to external code. This variable is
1363 # used to control such things as the set of warnings to enable, and
1364 # whether warnings are treated as errors.
1365 'chromium_code%': 0,
1367 # Disable fatal linker warnings, similarly to how we make it possible
1368 # to disable -Werror (e.g. for different toolchain versions).
1369 'disable_fatal_linker_warnings%': 0,
1371 'release_valgrind_build%': 0,
1373 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1374 'enable_wexit_time_destructors%': 0,
1376 # Build libpeerconnection as a static library by default.
1377 'libpeer_target_type%': 'static_library',
1379 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1380 'internal_gles2_conform_tests%': 0,
1382 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1383 'internal_khronos_glcts_tests%': 0,
1385 # Set to 1 to compile the filter fuzzer.
1386 'internal_filter_fuzzer%': 0,
1388 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1389 # so Cocoa is happy (http://crbug.com/20441).
1391 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1392 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1393 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1394 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1395 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1396 'vi', 'zh-CN', 'zh-TW',
1399 # Pseudo locales are special locales which are used for testing and
1400 # debugging. They don't get copied to the final app. For more info,
1401 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1408 # If debug_devtools is set to 1, JavaScript files for DevTools are
1409 # stored as is and loaded from disk. Otherwise, a concatenated file
1410 # is stored in resources.pak. It is still possible to load JS files
1411 # from disk by passing --debug-devtools cmdline switch.
1412 'debug_devtools%': 0,
1414 # The Java Bridge is not compiled in by default.
1417 # Code signing for iOS binaries. The bots need to be able to disable this.
1418 'chromium_ios_signing%': 1,
1420 # This flag is only used when disable_nacl==0 and disables all those
1421 # subcomponents which would require the installation of a native_client
1422 # untrusted toolchain.
1423 'disable_nacl_untrusted%': 0,
1425 # Disable Dart by default.
1428 # Copy out the setting of disable_nacl.
1429 'disable_nacl%': '<(disable_nacl)',
1431 # Portable Native Client is enabled by default.
1432 'disable_pnacl%': 0,
1434 # Whether to build full debug version for Debug configuration on Android.
1435 # Compared to full debug version, the default Debug configuration on Android
1436 # has no full v8 debug, has size optimization and linker gc section, so that
1437 # we can build a debug version with acceptable size and performance.
1438 'android_full_debug%': 0,
1440 # Sets the default version name and code for Android app, by default we
1441 # do a developer build.
1442 'android_app_version_name%': 'Developer Build',
1443 'android_app_version_code%': 1,
1445 # Contains data about the attached devices for gyp_managed_install.
1446 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1448 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1449 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1451 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1452 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1454 # Whether we are using the rlz library or not. Platforms like Android send
1455 # rlz codes for searches but do not use the library.
1458 # Turns on the i18n support in V8.
1459 'v8_enable_i18n_support': 1,
1461 # Compile d8 for the host toolset.
1462 'v8_toolset_for_d8': 'host',
1464 # Use brlapi from brltty for braille display support.
1467 # Relative path to icu.gyp from this file.
1468 'icu_gyp_path': '../third_party/icu/icu.gyp',
1470 # IPC fuzzer is disabled by default.
1471 'enable_ipc_fuzzer%': 0,
1473 # Force disable libstdc++ debug mode.
1474 'disable_glibcxx_debug%': 0,
1476 # Set to 1 to compile with MSE support for MPEG2 TS
1477 'enable_mpeg2ts_stream_parser%': 0,
1479 # Support ChromeOS touchpad gestures with ozone.
1480 'use_evdev_gestures%': 0,
1482 # Default ozone platform (if no --ozone-platform flag).
1483 'ozone_platform%': "",
1485 # Ozone platforms to include in the build.
1486 'ozone_platform_caca%': 0,
1487 'ozone_platform_dri%': 0,
1488 'ozone_platform_egltest%': 0,
1489 'ozone_platform_gbm%': 0,
1490 'ozone_platform_ozonex%': 0,
1491 'ozone_platform_test%': 0,
1493 # Whether the browser is non-native (using Views Toolkit) on Mac.
1494 'mac_views_browser%': 0,
1496 # Experiment: http://crbug.com/426914
1500 ['buildtype=="Official"', {
1501 # Continue to embed build meta data in Official builds, basically the
1502 # time it was built.
1503 # TODO(maruel): This decision should be revisited because having an
1504 # official deterministic build has high value too but MSVC toolset can't
1505 # generate anything deterministic with WPO enabled AFAIK.
1506 'dont_embed_build_metadata%': 0,
1508 # Enable the Syzygy optimization step for the official builds.
1509 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1510 'syzygy_optimize%': 1,
1512 'syzygy_optimize%': 0,
1514 # Get binutils version so we can enable debug fission if we can.
1515 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1517 # compiler_version doesn't work with clang
1518 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1519 # compiler_version works with clang.
1520 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1521 # that it takes effect here.
1522 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1523 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1525 # On Android we know the binutils version in the toolchain.
1527 'binutils_version%': 222,
1529 ['host_arch=="x64"', {
1530 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1532 ['host_arch=="ia32"', {
1533 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1535 # Our version of binutils in third_party/binutils
1536 ['linux_use_bundled_binutils==1', {
1537 'binutils_version%': 224,
1541 'binutils_version%': 0,
1543 # The version of GCC in use, set later in platforms that use GCC and have
1544 # not explicitly chosen to build with clang. Currently, this means all
1545 # platforms except Windows, Mac and iOS.
1546 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1547 # it takes effect here.
1548 ['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', {
1550 ['OS=="android" and android_webview_build==0', {
1551 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1552 # We directly set the gcc version since we know what we use.
1555 ['OS=="android" and android_webview_build==1', {
1556 # Android WebView uses a hermetic clang toolchain for host builds.
1557 'host_gcc_version%': 0,
1558 # Android WebView uses the GCC toolchain from the Android build.
1562 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1563 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1567 'host_gcc_version%': 0,
1570 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1571 'windows_sdk_path%': '<(windows_sdk_default_path)',
1573 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1575 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1576 'directx_sdk_path%': '<(directx_sdk_default_path)',
1578 'directx_sdk_path%': '$(DXSDK_DIR)',
1581 'windows_driver_kit_path%': '$(WDK_DIR)',
1583 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1585 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1588 'nacl_untrusted_build%': 0,
1589 'use_allocator%': 'none',
1591 ['OS=="linux" and target_arch=="mipsel"', {
1592 'sysroot%': '<(sysroot)',
1595 # All Chrome builds have breakpad symbols, but only process the
1596 # symbols from official builds.
1597 ['(branding=="Chrome" and buildtype=="Official")', {
1598 'linux_dump_symbols%': 1,
1600 # Omit unwind support in official release builds to save space. We
1601 # can use breakpad for these builds.
1602 'release_unwind_tables%': 0,
1605 # For official builds, use a 64-bit linker to avoid running out
1606 # of address space. The buildbots should have a 64-bit kernel
1607 # and a 64-bit libc installed.
1608 ['host_arch=="ia32" and target_arch=="ia32"', {
1609 'linux_use_bundled_gold%': '1',
1610 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1615 }], # os_posix==1 and OS!="mac" and OS!="ios"
1618 'enable_background%': 0,
1619 'icu_use_data_file_flag%': 1,
1620 'enable_web_speech%': 0,
1621 'use_system_libxml%': 1,
1622 'use_system_sqlite%': 1,
1624 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1625 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1626 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1627 'uk', 'vi', 'zh-CN', 'zh-TW',
1630 # iOS SDK and deployment target support. The |ios_sdk| value is left
1631 # blank so that when it is set in the project files it will be the
1632 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1633 # causes Xcode to spit out a warning for every single project file for
1634 # not using the "current" SDK.
1636 'ios_sdk_path%': '',
1637 'ios_deployment_target%': '7.0',
1640 # ios_product_name is set to the name of the .app bundle as it should
1642 ['branding=="Chrome"', {
1643 'ios_product_name%': 'Chrome',
1644 }, { # else: branding!="Chrome"
1645 'ios_product_name%': 'Chromium',
1647 ['branding=="Chrome" and buildtype=="Official"', {
1649 }, { # else: branding!="Chrome" or buildtype!="Official"
1655 # Location of Android NDK.
1658 # Unfortunately we have to use absolute paths to the SDK/NDK because
1659 # they're passed to ant which uses a different relative path from
1661 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1662 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1663 'android_host_arch%': '<!(uname -m)',
1664 # Android API-level of the SDK used for compilation.
1665 'android_sdk_version%': '21',
1666 'android_sdk_build_tools_version%': '21.0.1',
1667 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1669 # Copy conditionally-set variables out one scope.
1670 'android_ndk_root%': '<(android_ndk_root)',
1671 'android_sdk_root%': '<(android_sdk_root)',
1672 'android_sdk_version%': '<(android_sdk_version)',
1673 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1674 'host_os%': '<(host_os)',
1676 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1677 # Android SDK build tools (e.g. dx, aapt, aidl)
1678 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1680 # Android API level 14 is ICS (Android 4.0) which is the minimum
1681 # platform requirement for Chrome on Android, we use it for native
1684 ['target_arch == "ia32"', {
1685 'android_app_abi%': 'x86',
1686 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1687 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1688 'android_ndk_lib_dir%': 'usr/lib',
1689 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1691 ['target_arch == "x64"', {
1692 'android_app_abi%': 'x86_64',
1693 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1694 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1695 'android_ndk_lib_dir%': 'usr/lib64',
1696 'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1698 ['target_arch=="arm"', {
1701 'android_app_abi%': 'armeabi',
1703 'android_app_abi%': 'armeabi-v7a',
1706 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1707 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1708 'android_ndk_lib_dir%': 'usr/lib',
1709 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1711 ['target_arch == "arm64"', {
1712 'android_app_abi%': 'arm64-v8a',
1713 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1714 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1715 'android_ndk_lib_dir%': 'usr/lib',
1716 'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1718 ['target_arch == "mipsel"', {
1719 'android_app_abi%': 'mips',
1720 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1721 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1722 'android_ndk_lib_dir%': 'usr/lib',
1723 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1725 ['target_arch == "mips64el"', {
1726 'android_app_abi%': 'mips64',
1727 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1728 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1729 'android_ndk_lib_dir%': 'usr/lib64',
1730 'android_toolchain%': '<(android_ndk_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1735 # Copy conditionally-set variables out one scope.
1736 'android_app_abi%': '<(android_app_abi)',
1737 'android_gdbserver%': '<(android_gdbserver)',
1738 'android_ndk_root%': '<(android_ndk_root)',
1739 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1740 'android_sdk_root%': '<(android_sdk_root)',
1741 'android_sdk_version%': '<(android_sdk_version)',
1742 'android_toolchain%': '<(android_toolchain)',
1744 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1745 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1746 'android_sdk_tools%': '<(android_sdk_tools)',
1747 'android_sdk%': '<(android_sdk)',
1748 'android_sdk_jar%': '<(android_sdk)/android.jar',
1750 'android_stlport_root': '<(android_stlport_root)',
1751 'android_stlport_include': '<(android_stlport_root)/stlport',
1752 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1753 'host_os%': '<(host_os)',
1755 # Location of the "objcopy" binary, used by both gyp and scripts.
1756 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1758 # Location of the "strip" binary, used by both gyp and scripts.
1759 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1761 # Location of the "readelf" binary.
1762 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1764 # Determines whether we should optimize JNI generation at the cost of
1765 # breaking assumptions in the build system that when inputs have changed
1766 # the outputs should always change as well. This is meant purely for
1767 # developer builds, to avoid spurious re-linking of native files.
1768 'optimize_jni_generation%': '<(optimize_jni_generation)',
1770 # Always uses openssl.
1772 'use_openssl_certs%': 1,
1774 'proprietary_codecs%': '<(proprietary_codecs)',
1775 'safe_browsing%': 1,
1776 'enable_web_speech%': 0,
1778 'build_ffmpegsumo%': 0,
1779 'use_allocator%': 'none',
1781 # Disable Native Client.
1784 # Android does not support background apps.
1785 'enable_background%': 0,
1787 # Sessions are store separately in the Java side.
1788 'enable_session_service%': 0,
1792 'gtest_target_type%': 'shared_library',
1794 # Uses system APIs for decoding audio and video.
1795 'use_libffmpeg%': '0',
1797 # TODO(torne): Remove this unsupported option once all the places that
1798 # test it have been updated.
1799 'use_system_stlport%': 0,
1801 # Copy it out one scope.
1802 'android_webview_build%': '<(android_webview_build)',
1804 # Default android linker script for shared library exports.
1805 'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_exports.lst',
1808 'use_system_fontconfig%': 0,
1810 'use_system_fontconfig%': 1,
1813 'enable_mpeg2ts_stream_parser%': 1,
1814 'ffmpeg_branding%': 'Chrome',
1815 'ozone_platform_ozonex%': 1,
1816 'use_playready%': 0,
1818 ['target_arch=="arm"', {
1820 'arm_tune%': 'cortex-a9',
1826 ['android_webview_build==1', {
1827 # When building the WebView in the Android tree, jarjar will remap all
1828 # the class names, so the JNI generator needs to know this.
1829 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1831 ['OS=="linux" and target_arch!="mipsel"', {
1832 # TODO(thakis): This is here to measure perf for a while.
1837 # All Chrome builds have breakpad symbols, but only process the
1838 # symbols from official builds.
1839 ['(branding=="Chrome" and buildtype=="Official")', {
1840 'mac_strip_release%': 1,
1844 ['OS=="mac" or OS=="ios"', {
1848 # Mac OS X SDK and deployment target support. The SDK identifies
1849 # the version of the system headers that will be used, and
1850 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1851 # macro. "Maximum allowed" refers to the operating system version
1852 # whose APIs are available in the headers. The deployment target
1853 # identifies the minimum system version that the built products are
1854 # expected to function on. It corresponds to the
1855 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1856 # macros are available, #include <AvailabilityMacros.h>. Additional
1857 # documentation on these macros is available at
1858 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1859 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1860 # deployment target to 10.6. Other projects, such as O3D, may
1861 # override these defaults.
1863 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1864 # about that is at least the specified version. In official builds,
1865 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1866 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1867 # path to the SDK; when set to a non-empty string, SDK detection
1868 # based on mac_sdk_min will be bypassed entirely.
1871 'mac_sdk_min%': '10.8',
1872 }, { # else OS!="ios"
1873 'mac_sdk_min%': '10.6',
1876 'mac_sdk_path%': '',
1878 'mac_deployment_target%': '10.6',
1881 'mac_sdk_min': '<(mac_sdk_min)',
1882 'mac_sdk_path': '<(mac_sdk_path)',
1883 'mac_deployment_target': '<(mac_deployment_target)',
1885 # Compile in Breakpad support by default so that it can be
1886 # tested, even if it is not enabled by default at runtime.
1887 'mac_breakpad_compiled_in%': 1,
1889 # mac_product_name is set to the name of the .app bundle as it should
1890 # appear on disk. This duplicates data from
1891 # chrome/app/theme/chromium/BRANDING and
1892 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1893 # these names into the build system.
1894 ['branding=="Chrome"', {
1895 'mac_product_name%': 'Google Chrome',
1896 }, { # else: branding!="Chrome"
1897 'mac_product_name%': 'Chromium',
1899 # Official mac builds require a specific OS X SDK, but iOS and
1900 # non-official mac builds do not.
1901 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1902 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1904 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1906 ['branding=="Chrome" and buildtype=="Official"', {
1907 # Enable uploading crash dumps.
1908 'mac_breakpad_uploads%': 1,
1909 # Enable dumping symbols at build time for use by Mac Breakpad.
1911 # Enable Keystone auto-update support.
1913 }, { # else: branding!="Chrome" or buildtype!="Official"
1914 'mac_breakpad_uploads%': 0,
1919 }], # OS=="mac" or OS=="ios"
1922 # This is the architecture convention used in WinSDK paths.
1923 ['target_arch=="ia32"', {
1924 'winsdk_arch%': 'x86',
1926 'winsdk_arch%': '<(target_arch)',
1928 ['component=="shared_library"', {
1929 'win_use_allocator_shim%': 0,
1931 # Turn on multiple dll by default on Windows when in static_library.
1932 'chrome_multiple_dll%': 1,
1935 'win_use_allocator_shim%': 0,
1937 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1938 # Only enabled by default for ninja because it's buggy in VS.
1939 # Not enabled for component=static_library because some targets
1940 # are too large and the toolchain fails due to the size of the
1942 'incremental_chrome_dll%': 1,
1944 # Don't do incremental linking for large modules on 32-bit or when
1945 # component=static_library as the toolchain fails due to the size of
1947 ['MSVS_OS_BITS==32 or component=="static_library"', {
1948 'msvs_large_module_debug_link_mode%': '1', # No
1950 'msvs_large_module_debug_link_mode%': '2', # Yes
1953 'nacl_win64_defines': [
1954 # This flag is used to minimize dependencies when building
1955 # Native Client loader for 64-bit Windows.
1960 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1966 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1967 'enable_pepper_cdms%': 1,
1969 'enable_pepper_cdms%': 0,
1973 'enable_browser_cdms%': 1,
1975 'enable_browser_cdms%': 0,
1978 # Native Client glibc toolchain is enabled
1979 # by default except on arm, mips and mips64.
1980 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
1981 'disable_glibc%': 1,
1983 'disable_glibc%': 0,
1986 # Set the relative path from this file to the GYP file of the JPEG
1987 # library used by Chromium.
1988 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1989 # Configuration for using the system libjeg is here.
1990 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1992 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1995 # Options controlling the use of GConf (the classic GNOME configuration
1996 # system) and GIO, which contains GSettings (the new GNOME config system).
1997 ['chromeos==1 or embedded==1', {
2005 # Set up -D and -E flags passed into grit.
2006 ['branding=="Chrome"', {
2007 # TODO(mmoss) The .grd files look for _google_chrome, but for
2008 # consistency they should look for google_chrome_build like C++.
2009 'grit_defines': ['-D', '_google_chrome',
2010 '-E', 'CHROMIUM_BUILD=google_chrome'],
2012 'grit_defines': ['-D', '_chromium',
2013 '-E', 'CHROMIUM_BUILD=chromium'],
2016 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2018 ['desktop_linux==1', {
2019 'grit_defines': ['-D', 'desktop_linux'],
2021 ['toolkit_views==1', {
2022 'grit_defines': ['-D', 'toolkit_views'],
2025 'grit_defines': ['-D', 'use_aura'],
2028 'grit_defines': ['-D', 'use_ash'],
2031 'grit_defines': ['-D', 'use_nss'],
2034 'grit_defines': ['-D', 'use_ozone'],
2036 ['image_loader_extension==1', {
2037 'grit_defines': ['-D', 'image_loader_extension'],
2040 'grit_defines': ['-D', 'remoting'],
2042 ['use_titlecase_in_grd==1', {
2043 'grit_defines': ['-D', 'use_titlecase'],
2045 ['use_third_party_translations==1', {
2046 'grit_defines': ['-D', 'use_third_party_translations'],
2048 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2049 'ka', 'ku', 'kw', 'ms', 'ug'
2055 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2056 '--no-output-all-resource-defines',
2059 ['OS=="mac" or OS=="ios"', {
2060 'grit_defines': ['-D', 'scale_factors=2x'],
2065 # iOS uses a whitelist to filter resources.
2066 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt',
2067 '--no-output-all-resource-defines',
2070 # Enable host builds when generating with ninja-ios.
2072 ['"<(GENERATOR)"=="ninja"', {
2076 # TODO(sdefresne): Remove the target_subarch check once Apple has
2077 # upstreamed the support for "arm64". http://crbug.com/341453
2078 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
2083 ['enable_extensions==1', {
2084 'grit_defines': ['-D', 'enable_extensions'],
2086 ['enable_plugins!=0', {
2087 'grit_defines': ['-D', 'enable_plugins'],
2089 ['enable_basic_printing==1 or enable_print_preview==1', {
2090 'grit_defines': ['-D', 'enable_printing'],
2092 ['enable_print_preview==1', {
2093 'grit_defines': ['-D', 'enable_print_preview'],
2095 ['enable_themes==1', {
2096 'grit_defines': ['-D', 'enable_themes'],
2098 ['enable_app_list==1', {
2099 'grit_defines': ['-D', 'enable_app_list'],
2101 ['enable_settings_app==1', {
2102 'grit_defines': ['-D', 'enable_settings_app'],
2104 ['enable_google_now==1', {
2105 'grit_defines': ['-D', 'enable_google_now'],
2107 ['use_concatenated_impulse_responses==1', {
2108 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2110 ['enable_webrtc==1', {
2111 'grit_defines': ['-D', 'enable_webrtc'],
2113 ['enable_hangout_services_extension==1', {
2114 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2116 ['enable_task_manager==1', {
2117 'grit_defines': ['-D', 'enable_task_manager'],
2119 ['notifications==1', {
2120 'grit_defines': ['-D', 'enable_notifications'],
2122 ['enable_wifi_bootstrapping==1', {
2123 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2125 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2126 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2128 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2129 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2131 ['enable_mdns==1 or OS=="mac"', {
2132 'grit_defines': ['-D', 'enable_service_discovery'],
2133 'enable_service_discovery%': 1
2135 ['clang_use_chrome_plugins==1 and OS!="win"', {
2136 'clang_chrome_plugins_flags': [
2137 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
2140 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2142 'use_allocator%': 'none',
2143 'use_sanitizer_options%': 1,
2145 ['asan==1 and OS=="linux" and chromeos==0', {
2146 'use_custom_libcxx%': 1,
2154 ['asan==1 and OS=="mac"', {
2155 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
2156 # runtime is fully adopted. See http://crbug.com/242503.
2157 'mac_strip_release': 0,
2160 'use_custom_libcxx%': 1,
2163 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2164 # libstdc++. This is required to avoid false positive reports whenever
2165 # the C++ standard library is used.
2166 'use_custom_libcxx%': 1,
2167 # Running the V8-generated code on an ARM simulator is a powerful hack
2168 # that allows the tool to see the memory accesses from JITted code.
2169 # Without this flag, JS code causes false positive reports from MSan.
2170 'v8_target_arch': 'arm64',
2173 ['OS=="linux" and clang_type_profiler==1', {
2175 'clang_use_chrome_plugins%': 0,
2177 ['host_arch=="x64"', {
2178 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2180 ['host_arch=="ia32"', {
2181 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2182 # Clang in this directory at your own risk if needed for some
2183 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2184 # usage). Any failure by this compiler should not close the tree.
2185 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2191 # The Clang plugins don't currently work on Windows.
2192 # TODO(hans): One day, this will work. (crbug.com/82385)
2193 'clang_use_chrome_plugins%': 0,
2196 # On valgrind bots, override the optimizer settings so we don't inline too
2197 # much and make the stacks harder to figure out.
2199 # TODO(rnk): Kill off variables that no one else uses and just implement
2200 # them under a build_for_tool== condition.
2201 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2203 'mac_debug_optimization': '1',
2204 'mac_release_optimization': '1',
2205 'release_optimize': '1',
2206 'no_gc_sections': 1,
2207 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2208 '-fno-builtin -fno-optimize-sibling-calls',
2209 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2210 '-fno-builtin -fno-optimize-sibling-calls',
2212 # MSVS flags for TSan on Pin and Windows.
2213 'win_debug_RuntimeChecks': '0',
2214 'win_debug_disable_iterator_debugging': '1',
2215 'win_debug_Optimization': '1',
2216 'win_debug_InlineFunctionExpansion': '0',
2217 'win_release_InlineFunctionExpansion': '0',
2218 'win_release_OmitFramePointers': '0',
2220 'use_allocator': 'tcmalloc',
2221 'release_valgrind_build': 1,
2223 'component': 'static_library',
2224 'use_system_zlib': 0,
2227 # Build tweaks for DrMemory.
2228 # TODO(rnk): Combine with tsan config to share the builder.
2229 # http://crbug.com/108155
2230 ['build_for_tool=="drmemory"', {
2231 # These runtime checks force initialization of stack vars which blocks
2232 # DrMemory's uninit detection.
2233 'win_debug_RuntimeChecks': '0',
2234 # Iterator debugging is slow.
2235 'win_debug_disable_iterator_debugging': '1',
2236 # Try to disable optimizations that mess up stacks in a release build.
2237 # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054)
2238 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2239 # compiler bug, so we use /Ob1 instead.
2240 'win_release_InlineFunctionExpansion': '1',
2241 'win_release_OmitFramePointers': '0',
2242 # Ditto for debug, to support bumping win_debug_Optimization.
2243 'win_debug_InlineFunctionExpansion': 0,
2244 'win_debug_OmitFramePointers': 0,
2245 # Keep the code under #ifndef NVALGRIND.
2246 'release_valgrind_build': 1,
2249 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2250 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2254 # Set default compiler flags depending on ARM version.
2255 ['arm_version==6 and android_webview_build==0', {
2256 'arm_arch%': 'armv6',
2259 'arm_float_abi%': 'softfp',
2262 ['arm_version==7 and android_webview_build==0', {
2263 'arm_arch%': 'armv7-a',
2264 'arm_tune%': 'generic-armv7-a',
2269 'arm_fpu%': 'vfpv3-d16',
2272 # Change the default to hard once the armhf transition is complete.
2273 'arm_float_abi%': 'softfp',
2277 ['android_webview_build==1', {
2278 # The WebView build gets its cpu-specific flags from the Android build system.
2282 'arm_float_abi%': '',
2286 # Enable brlapi by default for chromeos.
2291 ['use_ozone==1 and ozone_auto_platforms==1', {
2292 # Use test as the default platform.
2293 'ozone_platform%': 'test',
2295 # Build all platforms whose deps are in install-build-deps.sh.
2296 # Only these platforms will be compile tested by buildbots.
2297 'ozone_platform_dri%': 1,
2298 'ozone_platform_test%': 1,
2299 'ozone_platform_egltest%': 1,
2302 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2303 'use_clipboard_aurax11%': 1,
2306 ['OS=="win" and use_goma==1', {
2307 # goma doesn't support pch yet.
2308 'chromium_win_pch': 0,
2309 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2311 ['win_z7==0 and fastbuild==0', {
2317 ['OS=="win" and (clang==1 or asan==1)', {
2318 'chromium_win_pch': 0,
2322 'host_cc': '<(make_clang_dir)/bin/clang',
2323 'host_cxx': '<(make_clang_dir)/bin/clang++',
2325 'host_cc': '<!(which gcc)',
2326 'host_cxx': '<!(which g++)',
2329 # The seccomp-bpf sandbox is only supported on five architectures
2331 # Do not disable seccomp_bpf anywhere without talking to
2332 # security@chromium.org!
2333 ['((OS=="linux" or OS=="android") and '
2334 '(target_arch=="ia32" or target_arch=="x64" or '
2335 'target_arch=="arm" or target_arch=="mipsel" or '
2336 'target_arch=="arm64"))', {
2337 'use_seccomp_bpf%': 1,
2339 'use_seccomp_bpf%': 0,
2342 # Set component build with LTO until all tests pass.
2343 # This also reduces link time.
2345 'component%': "shared_library",
2349 # older history files use fts2 instead of fts3
2350 'sqlite_enable_fts2%': '<(support_pre_M6_history_database)',
2352 # The path to the ANGLE library.
2353 'angle_path': '<(DEPTH)/third_party/angle',
2355 # List of default apps to install in new profiles. The first list contains
2356 # the source files as found in svn. The second list, used only for linux,
2357 # contains the destination location for each of the files. When a crx
2358 # is added or removed from the list, the chrome/browser/resources/
2359 # default_apps/external_extensions.json file must also be updated.
2360 'default_apps_list': [
2361 'browser/resources/default_apps/external_extensions.json',
2362 'browser/resources/default_apps/gmail.crx',
2363 'browser/resources/default_apps/search.crx',
2364 'browser/resources/default_apps/youtube.crx',
2365 'browser/resources/default_apps/drive.crx',
2366 'browser/resources/default_apps/docs.crx',
2368 'default_apps_list_linux_dest': [
2369 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2370 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2371 '<(PRODUCT_DIR)/default_apps/search.crx',
2372 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2373 '<(PRODUCT_DIR)/default_apps/drive.crx',
2374 '<(PRODUCT_DIR)/default_apps/docs.crx',
2377 # Whether to allow building of the GPU-related isolates.
2378 'archive_gpu_tests%': 0,
2380 # Whether to allow building of chromoting related isolates.
2381 'archive_chromoting_tests%': 0,
2383 'target_defaults': {
2385 # The condition that operates on chromium_code is in a target_conditions
2386 # section, and will not have access to the default fallback value of
2387 # chromium_code at the top of this file, or to the chromium_code
2388 # variable placed at the root variables scope of .gyp files, because
2389 # those variables are not set at target scope. As a workaround,
2390 # if chromium_code is not set at target scope, define it in target scope
2391 # to contain whatever value it has during early variable expansion.
2392 # That's enough to make it available during target conditional
2394 'chromium_code%': '<(chromium_code)',
2396 'component%': '<(component)',
2398 'chromecast%': '<(chromecast)',
2400 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2401 'win_release_Optimization%': '2', # 2 = /Os
2402 'win_debug_Optimization%': '0', # 0 = /Od
2404 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2405 # Tri-state: blank is default, 1 on, 0 off
2406 'win_release_OmitFramePointers%': '0',
2407 # Tri-state: blank is default, 1 on, 0 off
2408 'win_debug_OmitFramePointers%': '',
2410 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2411 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2413 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2414 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2415 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2417 # VS inserts quite a lot of extra checks to algorithms like
2418 # std::partial_sort in Debug build which make them O(N^2)
2419 # instead of O(N*logN). This is particularly slow under memory
2420 # tools like ThreadSanitizer so we want it to be disablable.
2421 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2422 'win_debug_disable_iterator_debugging%': '0',
2424 # An application manifest fragment to declare compatibility settings for
2425 # 'executable' targets. Ignored in other target type.
2426 'win_exe_compatibility_manifest%':
2427 '<(DEPTH)\\build\\win\\compatibility.manifest',
2429 'release_extra_cflags%': '',
2430 'debug_extra_cflags%': '',
2432 'release_valgrind_build%': '<(release_valgrind_build)',
2434 # the non-qualified versions are widely assumed to be *nix-only
2435 'win_release_extra_cflags%': '',
2436 'win_debug_extra_cflags%': '',
2438 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2439 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2441 # Only used by Windows build for now. Can be used to build into a
2442 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2443 # output files in src/build/VS2010_{Debug,Release}.
2444 'build_dir_prefix%': '',
2446 # Targets are by default not nacl untrusted code.
2447 'nacl_untrusted_build%': 0,
2449 'pnacl_compile_flags': [
2450 # pnacl uses the clang compiler so we need to suppress all the
2451 # same warnings as we do for clang.
2452 # TODO(sbc): Remove these if/when they are removed from the clang
2454 '-Wno-unused-function',
2455 '-Wno-char-subscripts',
2456 '-Wno-c++11-extensions',
2457 '-Wno-unnamed-type-template-args',
2461 ['OS=="win" and component=="shared_library"', {
2462 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2463 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2464 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2466 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2467 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2468 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2471 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2472 'mac_release_optimization%': 's', # Use -Os unless overridden
2473 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2475 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2476 'mac_release_optimization%': '2', # Use -O2 unless overridden
2477 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2480 'host_os%': '<(host_os)', # See comment above chromium_code.
2483 'clang_warning_flags': [
2486 # Don't die on dtoa code that uses a char as an array index.
2487 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2488 '-Wno-char-subscripts',
2490 # TODO(thakis): This used to be implied by -Wno-unused-function,
2491 # which we no longer use. Check if it makes sense to remove
2492 # this as well. http://crbug.com/316352
2493 '-Wno-unneeded-internal-declaration',
2495 # Warns on switches on enums that cover all enum values but
2496 # also contain a default: branch. Chrome is full of that.
2497 '-Wno-covered-switch-default',
2499 # Warns when a const char[] is converted to bool.
2500 '-Wstring-conversion',
2502 # C++11-related flags:
2504 # This warns on using ints as initializers for floats in
2505 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2506 # which happens in several places in chrome code. Not sure if
2507 # this is worth fixing.
2508 '-Wno-c++11-narrowing',
2510 # Clang considers the `register` keyword as deprecated, but e.g.
2511 # code generated by flex (used in angle) contains that keyword.
2512 # http://crbug.com/255186
2513 '-Wno-deprecated-register',
2516 'includes': [ 'set_clang_warning_flags.gypi', ],
2518 # Don't use deprecated V8 APIs anywhere.
2519 'V8_DEPRECATION_WARNINGS',
2522 '<(SHARED_INTERMEDIATE_DIR)',
2525 ['(OS=="mac" or OS=="ios") and asan==1', {
2527 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2530 ['OS=="win" and asan==1 and component=="shared_library"', {
2532 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2535 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2536 'cflags_cc!': ['-fno-rtti'],
2539 '-gline-tables-only',
2540 '-fintercept-allocation-functions',
2542 'defines': ['TYPE_PROFILING'],
2544 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2547 ['branding=="Chrome"', {
2548 'defines': ['GOOGLE_CHROME_BUILD'],
2549 }, { # else: branding!="Chrome"
2550 'defines': ['CHROMIUM_BUILD'],
2552 ['OS=="mac" and component=="shared_library"', {
2554 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2555 'LD_RUNPATH_SEARCH_PATHS': [
2556 # For unbundled binaries.
2558 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2559 '@loader_path/../../..',
2563 ['clang==1 and OS!="win"', {
2564 # This is here so that all files get recompiled after a clang roll and
2565 # when turning clang on or off.
2566 # (defines are passed via the command line, and build systems rebuild
2567 # things when their commandline changes). Nothing should ever read this
2569 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2572 'defines': ['ENABLE_RLZ'],
2574 ['component=="shared_library"', {
2575 'defines': ['COMPONENT_BUILD'],
2577 ['toolkit_views==1', {
2578 'defines': ['TOOLKIT_VIEWS=1'],
2580 ['ui_compositor_image_transport==1', {
2581 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2584 'defines': ['USE_AURA=1'],
2587 'defines': ['USE_ASH=1'],
2590 'defines': ['USE_PANGO=1'],
2593 'defines': ['USE_CAIRO=1'],
2596 'defines': ['USE_CRAS=1'],
2599 'defines': ['USE_OZONE=1'],
2601 ['use_default_render_theme==1', {
2602 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2604 ['use_libjpeg_turbo==1', {
2605 'defines': ['USE_LIBJPEG_TURBO=1'],
2608 'defines': ['USE_X11=1'],
2610 ['use_clipboard_aurax11==1', {
2611 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2613 ['enable_one_click_signin==1', {
2614 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2616 ['enable_pre_sync_backup==1', {
2617 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2619 ['image_loader_extension==1', {
2620 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2623 'defines': ['ENABLE_PROFILING=1'],
2626 'defines': ['ENABLE_REMOTING=1'],
2628 ['enable_webrtc==1', {
2629 'defines': ['ENABLE_WEBRTC=1'],
2631 ['proprietary_codecs==1', {
2632 'defines': ['USE_PROPRIETARY_CODECS'],
2634 ['enable_mpeg2ts_stream_parser==1', {
2635 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2639 ['enable_viewport==1', {
2640 'defines': ['ENABLE_VIEWPORT'],
2642 ['enable_pepper_cdms==1', {
2643 'defines': ['ENABLE_PEPPER_CDMS'],
2645 ['enable_browser_cdms==1', {
2646 'defines': ['ENABLE_BROWSER_CDMS'],
2648 ['configuration_policy==1', {
2649 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2651 ['notifications==1', {
2652 'defines': ['ENABLE_NOTIFICATIONS'],
2654 ['enable_hidpi==1', {
2655 'defines': ['ENABLE_HIDPI=1'],
2657 ['native_discardable_memory==1', {
2658 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2660 ['native_memory_pressure_signals==1', {
2661 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2664 'defines': ['USE_UDEV'],
2668 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2671 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2672 # Clang creates chubby debug information, which makes linking very
2673 # slow. For now, don't create debug information with clang. See
2674 # http://crbug.com/70000
2678 'debug_extra_cflags': '-g0',
2681 # Android builds symbols on release by default, disable them.
2684 'debug_extra_cflags': '-g0',
2685 'release_extra_cflags': '-g0',
2689 }, { # else clang!=1
2691 ['OS=="win" and fastbuild==2', {
2692 # Completely disable debug information.
2695 'GenerateDebugInformation': 'false',
2697 'VCCLCompilerTool': {
2698 'DebugInformationFormat': '0',
2702 ['OS=="win" and fastbuild==1', {
2705 # This tells the linker to generate .pdbs, so that
2706 # we can get meaningful stack traces.
2707 'GenerateDebugInformation': 'true',
2709 'VCCLCompilerTool': {
2710 # No debug info to be generated by compiler.
2711 'DebugInformationFormat': '0',
2715 ['OS=="linux" and fastbuild==2', {
2717 'debug_extra_cflags': '-g0',
2720 ['OS=="linux" and fastbuild==1', {
2722 'debug_extra_cflags': '-g1',
2725 ['OS=="android" and fastbuild==2', {
2727 'debug_extra_cflags': '-g0',
2728 'release_extra_cflags': '-g0',
2731 ['OS=="android" and fastbuild==1', {
2733 'debug_extra_cflags': '-g1',
2734 'release_extra_cflags': '-g1',
2741 ['dont_embed_build_metadata==1', {
2743 'DONT_EMBED_BUILD_METADATA',
2745 }], # dont_embed_build_metadata==1
2746 ['dcheck_always_on!=0', {
2747 'defines': ['DCHECK_ALWAYS_ON=1'],
2748 }], # dcheck_always_on!=0
2749 ['tracing_like_official_build!=0', {
2750 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2751 }], # tracing_like_official_build!=0
2752 ['win_use_allocator_shim==0', {
2755 'defines': ['NO_TCMALLOC'],
2761 'ADDRESS_SANITIZER',
2762 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2763 'MEMORY_SANITIZER_INITIAL_SIZE',
2767 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2775 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2776 'MEMORY_SANITIZER_INITIAL_SIZE',
2782 '_CRT_SECURE_NO_DEPRECATE',
2783 '_SCL_SECURE_NO_DEPRECATE',
2784 # This define is required to pull in the new Win8 interfaces from
2785 # system headers like ShObjIdl.h.
2786 'NTDDI_VERSION=0x06030000',
2787 # This is required for ATL to use XP-safe versions of its functions.
2788 '_USING_V110_SDK71_',
2791 '<(DEPTH)/third_party/wtl/include',
2796 # Generates debug info when win_z7=1
2797 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2799 'GenerateDebugInformation': 'true',
2801 'VCCLCompilerTool': {
2802 'DebugInformationFormat': '1',
2808 # This is prohibited when running /analyze.
2809 '_USING_V110_SDK71_',
2812 'VCCLCompilerTool': {
2813 # Set WarnAsError to false to disable this setting for most
2814 # projects so that compilation continues.
2815 'WarnAsError': 'false',
2816 # When win_analyze is specified add the /analyze switch.
2817 # Also add /WX- to force-disable WarnAsError for projects that
2818 # override WarnAsError.
2819 # Also, disable various noisy warnings that have low value.
2820 'AdditionalOptions': [
2823 '/wd6011', # Dereferencing NULL pointer
2824 '/wd6312', # Possible infinite loop: use of the constant
2825 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2826 '/wd6326', # Potential comparison of constant with constant
2827 '/wd28159', # Consider using 'GetTickCount64'
2828 '/wd28204', # Inconsistent SAL annotations
2829 '/wd28251', # Inconsistent SAL annotations
2830 '/wd28252', # Inconsistent SAL annotations
2831 '/wd28253', # Inconsistent SAL annotations
2832 '/wd28196', # The precondition is not satisfied
2833 '/wd28301', # Inconsistent SAL annotations
2834 '/wd6340', # Sign mismatch in function parameter
2835 '/wd28182', # Dereferencing NULL pointer
2847 ['target_arch=="arm"', {
2849 # TODO(lcwu): Work around an error when building Chromium
2850 # with gcc-4.5.3 (e.g. v8/src/platform-linux.cc). Remove
2851 # this define once the toolchain is updated.
2852 # See crbug.com/388933.
2856 ['use_playready==1', {
2858 'PLAYREADY_CDM_AVAILABLE',
2863 ['enable_task_manager==1', {
2865 'ENABLE_TASK_MANAGER=1',
2868 ['enable_extensions==1', {
2870 'ENABLE_EXTENSIONS=1',
2873 ['OS=="win" and branding=="Chrome"', {
2874 'defines': ['ENABLE_SWIFTSHADER'],
2876 ['enable_dart==1', {
2877 'defines': ['WEBKIT_USING_DART=1'],
2879 ['enable_plugin_installation==1', {
2880 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2882 ['enable_plugins==1', {
2883 'defines': ['ENABLE_PLUGINS=1'],
2885 ['enable_session_service==1', {
2886 'defines': ['ENABLE_SESSION_SERVICE=1'],
2888 ['enable_themes==1', {
2889 'defines': ['ENABLE_THEMES=1'],
2891 ['enable_autofill_dialog==1', {
2892 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2894 ['enable_prod_wallet_service==1', {
2895 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2897 ['enable_background==1', {
2898 'defines': ['ENABLE_BACKGROUND=1'],
2900 ['enable_google_now==1', {
2901 'defines': ['ENABLE_GOOGLE_NOW=1'],
2903 ['cld_version!=0', {
2904 'defines': ['CLD_VERSION=<(cld_version)'],
2906 ['enable_basic_printing==1 or enable_print_preview==1', {
2907 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2908 'defines': ['ENABLE_PRINTING=1'],
2910 ['enable_basic_printing==1', {
2911 # Enable basic printing support and UI.
2912 'defines': ['ENABLE_BASIC_PRINTING=1'],
2914 ['enable_print_preview==1', {
2915 # Enable printing with print preview.
2916 # Can be defined without ENABLE_BASIC_PRINTING.
2917 'defines': ['ENABLE_PRINT_PREVIEW=1'],
2919 ['enable_spellcheck==1', {
2920 'defines': ['ENABLE_SPELLCHECK=1'],
2922 ['enable_captive_portal_detection==1', {
2923 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2925 ['enable_app_list==1', {
2926 'defines': ['ENABLE_APP_LIST=1'],
2928 ['enable_settings_app==1', {
2929 'defines': ['ENABLE_SETTINGS_APP=1'],
2931 ['disable_file_support==1', {
2932 'defines': ['DISABLE_FILE_SUPPORT=1'],
2934 ['disable_ftp_support==1', {
2935 'defines': ['DISABLE_FTP_SUPPORT=1'],
2937 ['use_icu_alternatives_on_android==1', {
2938 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2940 ['enable_managed_users==1', {
2941 'defines': ['ENABLE_MANAGED_USERS=1'],
2943 ['spdy_proxy_auth_property != ""', {
2944 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2946 ['spdy_proxy_auth_value != ""', {
2947 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2949 ['enable_mdns==1', {
2950 'defines': ['ENABLE_MDNS=1'],
2952 ['enable_service_discovery==1', {
2953 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2955 ['enable_wifi_bootstrapping==1', {
2956 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2958 ['enable_hangout_services_extension==1', {
2959 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2961 ['enable_ipc_fuzzer==1', {
2962 'defines': ['ENABLE_IPC_FUZZER=1'],
2965 'defines': ['VIDEO_HOLE=1'],
2967 ['enable_load_completion_hacks==1', {
2968 'defines': ['ENABLE_LOAD_COMPLETION_HACKS=1'],
2970 ['v8_use_external_startup_data==1', {
2971 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
2973 ], # conditions for 'target_defaults'
2974 'target_conditions': [
2975 ['<(use_libpci)==1', {
2976 'defines': ['USE_LIBPCI=1'],
2978 ['<(use_openssl)==1', {
2979 'defines': ['USE_OPENSSL=1'],
2981 ['<(use_openssl_certs)==1', {
2982 'defines': ['USE_OPENSSL_CERTS=1'],
2984 ['>(nacl_untrusted_build)==1', {
2987 'USE_OPENSSL_CERTS=1',
2990 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
2991 'defines': ['USE_GLIB=1'],
2993 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
2994 'defines': ['USE_NSS=1'],
2996 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
2997 'defines': ['OS_CHROMEOS=1'],
2999 ['enable_wexit_time_destructors==1 and OS!="win"', {
3000 # TODO: Enable on Windows too, http://crbug.com/404525
3001 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3003 ['chromium_code==0', {
3005 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3006 # We don't want to get warnings from third-party code,
3007 # so remove any existing warning-enabling flags like -Wall.
3013 # Don't warn about hash_map in third-party code.
3017 # Don't warn about printf format problems.
3018 # This is off by default in gcc but on in Ubuntu's gcc(!).
3022 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3026 # TODO: Fix all warnings on chromeos too.
3027 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3032 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3034 # Don't warn about ignoring the return value from e.g. close().
3035 # This is off by default in some gccs but on by default in others.
3036 # BSD systems do not support this option, since they are usually
3037 # using gcc 4.2.1, which does not have this flag yet.
3038 '-Wno-unused-result',
3043 '_CRT_SECURE_NO_DEPRECATE',
3044 '_CRT_NONSTDC_NO_WARNINGS',
3045 '_CRT_NONSTDC_NO_DEPRECATE',
3046 '_SCL_SECURE_NO_DEPRECATE',
3048 'msvs_disabled_warnings': [4800],
3050 'VCCLCompilerTool': {
3051 'WarningLevel': '3',
3052 'WarnAsError': 'true',
3053 'Detect64BitPortabilityProblems': 'false',
3057 ['buildtype=="Official"', {
3059 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3064 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3067 [ 'component=="shared_library"', {
3068 # TODO(darin): Unfortunately, some third_party code depends on base.
3069 'msvs_disabled_warnings': [
3070 4251, # class 'std::xx' needs to have dll-interface.
3076 [ 'OS=="mac" or OS=="ios"', {
3078 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3081 ['buildtype=="Official"', {
3083 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3090 # TODO(ios): Fix remaining warnings in third-party code, then
3091 # remove this; the Mac cleanup didn't get everything that's
3092 # flagged in an iOS build.
3093 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3094 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3095 # Several internal ios directories generate numerous warnings for
3096 # -Wobjc-missing-property-synthesis.
3097 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3103 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3104 'filename_rules.gypi',
3106 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3107 # C99 macros on Mac and Linux.
3109 '__STDC_CONSTANT_MACROS',
3110 '__STDC_FORMAT_MACROS',
3114 # turn on warnings for signed/unsigned mismatch on chromium code.
3116 'VCCLCompilerTool': {
3117 'AdditionalOptions': ['/we4389'],
3121 ['OS=="win" and component=="shared_library"', {
3122 'msvs_disabled_warnings': [
3123 4251, # class 'std::xx' needs to have dll-interface.
3128 ], # target_conditions for 'target_defaults'
3129 'default_configuration': 'Debug',
3131 # VCLinkerTool LinkIncremental values below:
3133 # 1 == /INCREMENTAL:NO
3135 # Debug links incremental, Release does not.
3137 # Abstract base configurations to cover common attributes.
3141 'msvs_configuration_attributes': {
3142 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3143 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3144 'CharacterSet': '1',
3146 # Add the default import libs.
3149 'AdditionalDependencies': [
3173 'MinimumRequiredVersion': '5.01', # XP.
3174 'TargetMachine': '1',
3176 'VCLibrarianTool': {
3177 'TargetMachine': '1',
3180 'msvs_configuration_platform': 'Win32',
3184 'msvs_configuration_platform': 'x64',
3187 # Make sure to understand http://crbug.com/361720 if you want to
3189 'MinimumRequiredVersion': '5.02', # Server 2003.
3190 'TargetMachine': '17', # x86 - 64
3191 'AdditionalLibraryDirectories!':
3192 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3193 'AdditionalLibraryDirectories':
3194 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3195 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3196 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3198 'VCLibrarianTool': {
3199 'AdditionalLibraryDirectories!':
3200 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3201 'AdditionalLibraryDirectories':
3202 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3203 'TargetMachine': '17', # x64
3210 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3211 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3214 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3216 '<@(debug_extra_cflags)',
3220 'VCCLCompilerTool': {
3221 'Optimization': '<(win_debug_Optimization)',
3222 'PreprocessorDefinitions': ['_DEBUG'],
3223 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3224 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3226 # According to MSVS, InlineFunctionExpansion=0 means
3227 # "default inlining", not "/Ob0".
3228 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3229 ['win_debug_InlineFunctionExpansion==0', {
3230 'AdditionalOptions': ['/Ob0'],
3232 ['win_debug_InlineFunctionExpansion!=""', {
3233 'InlineFunctionExpansion':
3234 '<(win_debug_InlineFunctionExpansion)',
3236 ['win_debug_disable_iterator_debugging==1', {
3237 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3240 # if win_debug_OmitFramePointers is blank, leave as default
3241 ['win_debug_OmitFramePointers==1', {
3242 'OmitFramePointers': 'true',
3244 ['win_debug_OmitFramePointers==0', {
3245 'OmitFramePointers': 'false',
3246 # The above is not sufficient (http://crbug.com/106711): it
3247 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3248 # perform FPO regardless, so we must explicitly disable.
3249 # We still want the false setting above to avoid having
3250 # "/Oy /Oy-" and warnings about overriding.
3251 'AdditionalOptions': ['/Oy-'],
3254 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3257 'LinkIncremental': '<(msvs_debug_link_incremental)',
3258 # ASLR makes debugging with windbg difficult because Chrome.exe and
3259 # Chrome.dll share the same base name. As result, windbg will
3260 # name the Chrome.dll module like chrome_<base address>, where
3261 # <base address> typically changes with each launch. This in turn
3262 # means that breakpoints in Chrome.dll don't stick from one launch
3263 # to the next. For this reason, we turn ASLR off in debug builds.
3264 # Note that this is a three-way bool, where 0 means to pick up
3265 # the default setting, 1 is off and 2 is on.
3266 'RandomizedBaseAddress': 1,
3268 'VCResourceCompilerTool': {
3269 'PreprocessorDefinitions': ['_DEBUG'],
3273 ['OS=="linux" or OS=="android"', {
3274 'target_conditions': [
3275 ['_toolset=="target"', {
3277 '<@(debug_extra_cflags)',
3282 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3283 # Enable libstdc++ debugging facilities to help catch problems
3284 # early, see http://crbug.com/65151 .
3285 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3286 'defines': ['_GLIBCXX_DEBUG=1',],
3288 ['release_valgrind_build==0', {
3291 '-fstack-protector-all', # Implies -fstack-protector
3297 # Allow comparing the address of references and 'this' against 0
3298 # in debug builds. Technically, these can never be null in
3299 # well-defined C/C++ and Clang can optimize such checks away in
3300 # release builds, but they may be used in asserts in debug builds.
3301 '-Wno-undefined-bool-conversion',
3302 '-Wno-tautological-undefined-compare',
3306 '-Wno-undefined-bool-conversion',
3307 '-Wno-tautological-undefined-compare',
3311 'VCCLCompilerTool': {
3312 'AdditionalOptions': [
3313 '-Wno-undefined-bool-conversion',
3314 '-Wno-tautological-undefined-compare',
3327 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3328 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3329 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3332 'VCCLCompilerTool': {
3333 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3335 # In official builds, each target will self-select
3336 # an optimization level.
3337 ['buildtype!="Official"', {
3338 'Optimization': '<(win_release_Optimization)',
3341 # According to MSVS, InlineFunctionExpansion=0 means
3342 # "default inlining", not "/Ob0".
3343 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3344 ['win_release_InlineFunctionExpansion==0', {
3345 'AdditionalOptions': ['/Ob0'],
3347 ['win_release_InlineFunctionExpansion!=""', {
3348 'InlineFunctionExpansion':
3349 '<(win_release_InlineFunctionExpansion)',
3352 # if win_release_OmitFramePointers is blank, leave as default
3353 ['win_release_OmitFramePointers==1', {
3354 'OmitFramePointers': 'true',
3356 ['win_release_OmitFramePointers==0', {
3357 'OmitFramePointers': 'false',
3358 # The above is not sufficient (http://crbug.com/106711): it
3359 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3360 # perform FPO regardless, so we must explicitly disable.
3361 # We still want the false setting above to avoid having
3362 # "/Oy /Oy-" and warnings about overriding.
3363 'AdditionalOptions': ['/Oy-'],
3366 'AdditionalOptions': [
3367 '/d2Zi+', # Improve debugging of Release builds.
3368 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3369 '<@(win_release_extra_cflags)',
3373 # LinkIncremental is a tri-state boolean, where 0 means default
3374 # (i.e., inherit from parent solution), 1 means false, and
3376 'LinkIncremental': '1',
3377 # This corresponds to the /PROFILE flag which ensures the PDB
3378 # file contains FIXUP information (growing the PDB file by about
3379 # 5%) but does not otherwise alter the output binary. This
3380 # information is used by the Syzygy optimization tool when
3381 # decomposing the release image.
3386 ['msvs_use_common_release', {
3387 'includes': ['release.gypi'],
3389 ['release_valgrind_build==0 and tsan==0', {
3392 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3396 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3397 'MEMORY_SANITIZER_INITIAL_SIZE',
3398 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3399 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3402 ['win_use_allocator_shim==0', {
3403 'defines': ['NO_TCMALLOC'],
3405 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3406 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3407 # It seems to work fine with Ubuntu 12 headers though, so use it
3408 # in official builds.
3409 ['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")', {
3410 'target_conditions': [
3411 ['chromium_code==1', {
3412 # Non-chromium code is not guaranteed to compile cleanly
3413 # with _FORTIFY_SOURCE. Also, fortified build may fail
3414 # when optimizations are disabled, so only do that for Release
3417 '_FORTIFY_SOURCE=2',
3422 ['OS=="linux" or OS=="android"', {
3423 'target_conditions': [
3424 ['_toolset=="target"', {
3426 '<@(release_extra_cflags)',
3429 ['enable_resource_whitelist_generation==1', {
3431 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3440 'NS_BLOCK_ASSERTIONS=1',
3446 # Concrete configurations
3449 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3452 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3457 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3458 'target_conditions': [
3459 [ '_type=="executable"', {
3460 # To get a real .dSYM bundle produced by dsymutil, set the
3461 # debug information format to dwarf-with-dsym. Since
3462 # strip_from_xcode will not be used, set Xcode to do the
3463 # stripping as well.
3465 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3466 'DEPLOYMENT_POSTPROCESSING': 'YES',
3467 'STRIP_INSTALLED_PRODUCT': 'YES',
3474 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3476 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3479 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3487 'target_defaults': {
3492 # TODO(glider): enable the default options on other systems.
3494 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3496 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3502 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3503 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3504 'target_defaults': {
3506 '-Wl,--fatal-warnings',
3510 ['os_posix==1 and chromeos==0', {
3511 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3512 # and we want to avoid overriding this, so stack-protector is only
3513 # enabled when not building on Chrome OS.
3514 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3516 'target_defaults': {
3518 '-fstack-protector',
3519 '--param=ssp-buffer-size=4',
3523 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3524 'target_defaults': {
3525 # Enable -Werror by default, but put it in a variable so it can
3526 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3528 'werror%': '-Werror',
3529 'libraries_for_target%': '',
3532 '_FILE_OFFSET_BITS=64',
3535 '<(werror)', # See note above about the werror variable.
3537 '-fno-strict-aliasing', # See http://crbug.com/32204
3539 # TODO(evan): turn this back on once all the builds work.
3541 # Don't warn about unused function params. We use those everywhere.
3542 '-Wno-unused-parameter',
3543 # Don't warn about the "struct foo f = {0};" initialization pattern.
3544 '-Wno-missing-field-initializers',
3545 # Don't export any symbols (for example, to plugins we dlopen()).
3546 # Note: this is *required* to make some plugins work.
3547 '-fvisibility=hidden',
3553 '-fno-threadsafe-statics',
3554 # Make inline functions have hidden visiblity by default.
3555 # Surprisingly, not covered by -fvisibility=hidden.
3556 '-fvisibility-inlines-hidden',
3557 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3558 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3562 '-pthread', '-Wl,-z,noexecstack',
3565 '<(libraries_for_target)',
3570 'debug_optimize%': '0',
3576 '-O>(debug_optimize)',
3583 # Warn in case of text relocations.
3584 '-Wl,--warn-shared-textrel',
3587 ['OS=="android" and android_full_debug==0', {
3588 # Some configurations are copied from Release_Base to reduce
3591 'debug_optimize%': 's',
3595 '-ffunction-sections',
3602 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3603 # We don't omit frame pointers on arm64 since they are required
3604 # to correctly unwind stackframes which contain system library
3605 # function frames (crbug.com/391706).
3607 '-fomit-frame-pointer',
3610 ['OS=="linux" and target_arch=="ia32"', {
3612 '-Wl,--no-as-needed',
3615 ['debug_unwind_tables==1', {
3616 'cflags': ['-funwind-tables'],
3618 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3620 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3621 # definitions in to the right scope to use them when setting
3622 # linux_use_debug_fission, so it can be used here alone.
3623 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3624 'cflags': ['-gsplit-dwarf'],
3630 'release_optimize%': '2',
3631 # Binaries become big and gold is unable to perform GC
3632 # and remove unused sections for some of test targets
3633 # on 32 bit platform.
3634 # (This is currently observed only in chromeos valgrind bots)
3635 # The following flag is to disable --gc-sections linker
3636 # option for these bots.
3637 'no_gc_sections%': 0,
3639 # TODO(bradnelson): reexamine how this is done if we change the
3640 # expansion of configurations
3641 'release_valgrind_build%': 0,
3644 '-O<(release_optimize)',
3645 # Don't emit the GCC version ident directives, they just end up
3646 # in the .comment section taking up binary size.
3648 # Put data and code in their own sections, so that unused symbols
3649 # can be removed at link time with --gc-sections.
3651 '-ffunction-sections',
3654 # Specifically tell the linker to perform optimizations.
3655 # See http://lwn.net/Articles/192624/ .
3660 ['no_gc_sections==0', {
3662 '-Wl,--gc-sections',
3665 ['OS=="android" and target_arch!="arm64"', {
3666 # We don't omit frame pointers on arm64 since they are required
3667 # to correctly unwind stackframes which contain system library
3668 # function frames (crbug.com/391706).
3670 '-fomit-frame-pointer',
3675 'release_optimize%': 's',
3678 # Warn in case of text relocations.
3679 '-Wl,--warn-shared-textrel',
3684 '-fno-omit-frame-pointer',
3688 ['profiling_full_stack_frames==1', {
3691 '-fno-optimize-sibling-calls',
3696 ['release_unwind_tables==1', {
3697 'cflags': ['-funwind-tables'],
3699 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3705 ['target_arch=="ia32"', {
3706 'target_conditions': [
3707 ['_toolset=="target"', {
3709 # Needed so that libs with .s files (e.g. libicudata.a)
3710 # are compatible with the general 32-bit-ness.
3713 # All floating-point computations on x87 happens in 80-bit
3714 # precision. Because the C and C++ language standards allow
3715 # the compiler to keep the floating-point values in higher
3716 # precision than what's specified in the source and doing so
3717 # is more efficient than constantly rounding up to 64-bit or
3718 # 32-bit precision as specified in the source, the compiler,
3719 # especially in the optimized mode, tries very hard to keep
3720 # values in x87 floating-point stack (in 80-bit precision)
3721 # as long as possible. This has important side effects, that
3722 # the real value used in computation may change depending on
3723 # how the compiler did the optimization - that is, the value
3724 # kept in 80-bit is different than the value rounded down to
3725 # 64-bit or 32-bit. There are possible compiler options to
3726 # make this behavior consistent (e.g. -ffloat-store would keep
3727 # all floating-values in the memory, thus force them to be
3728 # rounded to its original precision) but they have significant
3729 # runtime performance penalty.
3731 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3732 # which keep floating-point values in SSE registers in its
3733 # native precision (32-bit for single precision, and 64-bit
3734 # for double precision values). This means the floating-point
3735 # value used during computation does not change depending on
3736 # how the compiler optimized the code, since the value is
3737 # always kept in its specified precision.
3739 # Refer to http://crbug.com/348761 for rationale behind SSE2
3740 # being a minimum requirement for 32-bit Linux builds and
3741 # http://crbug.com/313032 for an example where this has "bit"
3746 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3753 # Use gold linker for Android ia32 target.
3759 # Install packages have started cropping up with
3760 # different headers between the 32-bit and 64-bit
3761 # versions, so we have to shadow those differences off
3762 # and make sure a 32-bit-on-64-bit build picks up the
3764 # For android build, use NDK headers instead of host headers
3765 ['host_arch!="ia32" and OS!="android"', {
3774 ['target_arch=="x64"', {
3775 'target_conditions': [
3776 ['_toolset=="target"', {
3778 # Use gold linker for Android x64 target.
3795 ['target_arch=="arm"', {
3796 'target_conditions': [
3797 ['_toolset=="target"', {
3801 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3802 # has changed whenever it encounters a varargs function. This
3803 # silences those warnings, as they are not helpful and
3804 # clutter legitimate warnings.
3808 ['clang==1 and arm_arch!="" and OS!="android"', {
3810 '-target arm-linux-gnueabihf',
3813 '-target arm-linux-gnueabihf',
3818 '-march=<(arm_arch)',
3821 ['use_lto==1 or use_lto_o2==1', {
3823 '-march=<(arm_arch)',
3828 ['clang==1 and OS!="android"', {
3830 # We need to disable clang's builtin assembler as it can't
3831 # handle several asm files, crbug.com/124610
3832 '-no-integrated-as',
3837 '-mtune=<(arm_tune)',
3840 ['use_lto==1 or use_lto_o2==1', {
3842 '-mtune=<(arm_tune)',
3852 ['use_lto==1 or use_lto_o2==1', {
3859 ['arm_float_abi!=""', {
3861 '-mfloat-abi=<(arm_float_abi)',
3864 ['use_lto==1 or use_lto_o2==1', {
3866 '-mfloat-abi=<(arm_float_abi)',
3876 ['use_lto==1 or use_lto_o2==1', {
3884 # Most of the following flags are derived from what Android
3885 # uses by default when building for arm, reference for which
3886 # can be found in the following file in the Android NDK:
3887 # toolchains/arm-linux-androideabi-4.9/setup.mk
3889 # The tree-sra optimization (scalar replacement for
3890 # aggregates enabling subsequent optimizations) leads to
3891 # invalid code generation when using the Android NDK's
3892 # compiler (r5-r7). This can be verified using
3893 # webkit_unit_tests' WTF.Checked_int8_t test.
3895 # The following option is disabled to improve binary
3896 # size and performance in gcc 4.9.
3897 '-fno-caller-saves',
3900 # Android now supports .relro sections properly.
3901 # NOTE: While these flags enable the generation of .relro
3902 # sections, the generated libraries can still be loaded on
3903 # older Android platform versions.
3910 ['gcc_version==48 and clang==0', {
3912 # The following 5 options are disabled to save on
3913 # binary size in GCC 4.8.
3914 '-fno-partial-inlining',
3915 '-fno-early-inlining',
3916 '-fno-tree-copy-prop',
3917 '-fno-tree-loop-optimize',
3918 '-fno-move-loop-invariants',
3922 'cflags': [ '-mthumb-interwork' ],
3926 # Thumb code with frame pointer makes chrome crash
3929 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3930 # The perf report sometimes incorrectly attributes
3931 # code from tail calls.
3932 '-fno-optimize-sibling-calls',
3935 '-fomit-frame-pointer',
3940 # Clang does not support the following options.
3941 '-mthumb-interwork',
3942 '-finline-limit=64',
3944 '-fno-caller-saves',
3948 # TODO(hans) Enable integrated-as (crbug.com/124610).
3949 '-no-integrated-as',
3950 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3953 # Let clang find the ld.gold in the NDK.
3954 '--gcc-toolchain=<(android_toolchain)/..',
3959 '-marm', # Required for frame pointer based stack traces.
3966 # We set arm_arch to "" so that -march compiler option
3967 # is not set. Otherwise a gcc bug that would complain
3968 # about it conflicting with '-mcpu=cortex-a9'. The flag
3969 # '-march=armv7-a' is actually redundant anyway because
3970 # it is enabled by default when we built the toolchain.
3971 # And using '-mcpu=cortex-a9' should be sufficient.
3974 # Breakpad requires symbols with debugging information
3978 # We want to statically link libstdc++/libgcc_s.
3979 '-static-libstdc++',
3983 # Some components in Chromium (e.g. v8, skia, ffmpeg)
3984 # define their own cflags for arm builds that could
3985 # conflict with the flags we set here (e.g.
3986 # '-mcpu=cortex-a9'). Remove these flags explicitly.
3995 ['target_arch=="arm64"', {
3996 'target_conditions': [
3997 ['_toolset=="target"', {
4001 '-fstack-protector', # stack protector is always enabled on arm64.
4008 ['target_arch=="mipsel"', {
4009 'target_conditions': [
4010 ['_toolset=="target"', {
4012 ['android_webview_build==0 and mips_arch_variant=="r6"', {
4013 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
4016 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4020 ['android_webview_build==0 and mips_arch_variant=="r2"', {
4021 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
4023 ['android_webview_build==0 and mips_arch_variant=="r1"', {
4024 'cflags': ['-mips32', '-Wa,-mips32'],
4028 '-Wl,--no-keep-memory'
4031 '-Wno-uninitialized',
4036 ['target_arch=="mips64el"', {
4037 'target_conditions': [
4038 ['_toolset=="target"', {
4040 ['android_webview_build==0 and mips_arch_variant=="r6"', {
4041 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4042 'ldflags': [ '-mips64r6' ],
4044 ['android_webview_build==0 and mips_arch_variant=="r2"', {
4045 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4046 'ldflags': [ '-mips64r2' ],
4050 '-Wno-uninitialized',
4064 'target_conditions': [
4065 ['_toolset=="target"', {
4067 '--sysroot=<(sysroot)',
4070 '--sysroot=<(sysroot)',
4071 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4077 # TODO(thakis): Remove, http://crbug.com/263960
4078 '-Wno-reserved-user-defined-literal',
4081 # gnu++11 instead of c++11 is needed because some code uses
4082 # typeof() (a GNU extension).
4083 # TODO(thakis): Eventually switch this to c++11 instead,
4084 # http://crbug.com/427584
4088 ['clang==0 and host_clang==1', {
4089 'target_conditions': [
4090 ['_toolset=="host"', {
4091 'cflags_cc': [ '-std=gnu++11', ],
4095 ['clang==1 and clang_use_chrome_plugins==1', {
4097 '<@(clang_chrome_plugins_flags)',
4100 ['clang==1 and clang_load!=""', {
4102 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4105 ['clang==1 and clang_add_plugin!=""', {
4107 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4110 ['clang==1 and target_arch=="ia32"', {
4112 # Else building libyuv gives clang's register allocator issues,
4113 # see llvm.org/PR15798 / crbug.com/233709
4114 '-momit-leaf-frame-pointer',
4115 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4116 '-mstack-alignment=16',
4120 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4122 # See http://crbug.com/110262
4123 '-fcolor-diagnostics',
4126 # Common options for AddressSanitizer, LeakSanitizer,
4127 # ThreadSanitizer and MemorySanitizer.
4128 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4129 'target_conditions': [
4130 ['_toolset=="target"', {
4132 '-fno-omit-frame-pointer',
4133 '-gline-tables-only',
4136 '-fomit-frame-pointer',
4141 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4142 'target_conditions': [
4143 ['_toolset=="target"', {
4145 # Functions interposed by the sanitizers can make ld think
4146 # that some libraries aren't needed when they actually are,
4147 # http://crbug.com/234010. As workaround, disable --as-needed.
4151 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4152 'MEMORY_SANITIZER_INITIAL_SIZE',
4158 'target_conditions': [
4159 ['_toolset=="target"', {
4161 '-fsanitize=address',
4162 # TODO(earthdok): Re-enable. http://crbug.com/427202
4163 #'-fsanitize-blacklist=<(asan_blacklist)',
4166 '-fsanitize=address',
4173 '-mllvm -asan-globals=0', # http://crbug.com/352073
4179 'target_conditions': [
4180 ['_toolset=="target"', {
4182 '-fsanitize=undefined',
4183 # -fsanitize=vptr is incompatible with -fno-rtti.
4184 '-fno-sanitize=vptr',
4185 # Employ the experimental PBQP register allocator to avoid
4186 # slow compilation on files with too many basic blocks.
4187 # See http://crbug.com/426271.
4188 '-mllvm -regalloc=pbqp',
4189 # Speculatively use coalescing to slightly improve the code
4190 # generated by PBQP regallocator. May increase compile time.
4191 '-mllvm -pbqp-coalescing',
4194 '-fsanitize=undefined',
4195 # -fsanitize=vptr is incompatible with -fno-rtti.
4196 '-fno-sanitize=vptr',
4202 'target_conditions': [
4203 ['_toolset=="target"', {
4206 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4218 'UNDEFINED_SANITIZER',
4223 ['asan_coverage!=0', {
4224 'target_conditions': [
4225 ['_toolset=="target"', {
4227 '-mllvm -asan-coverage=<(asan_coverage)',
4232 ['asan_field_padding!=0', {
4233 'target_conditions': [
4234 ['_toolset=="target"', {
4236 '-fsanitize-address-field-padding=<(asan_field_padding)',
4242 'target_conditions': [
4243 ['_toolset=="target"', {
4252 'WTF_USE_LEAK_SANITIZER=1',
4258 'target_conditions': [
4259 ['_toolset=="target"', {
4261 '-fsanitize=thread',
4263 '-fsanitize-blacklist=<(tsan_blacklist)',
4266 '-fsanitize=thread',
4270 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4271 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4273 'target_conditions': [
4274 ['_type=="executable"', {
4284 'target_conditions': [
4285 ['_toolset=="target"', {
4287 '-fsanitize=memory',
4288 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4290 '-fsanitize-blacklist=<(msan_blacklist)',
4293 '-fsanitize=memory',
4298 'target_conditions': [
4299 ['_type=="executable"', {
4308 ['use_instrumented_libraries==1', {
4310 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4313 ['use_custom_libcxx==1', {
4315 '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4318 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4319 'target_conditions' : [
4320 # crazy_linker has an upstream gyp file we can't edit, and we
4321 # don't want to instrument it.
4322 ['_toolset=="target" and _target_name!="crazy_linker"', {
4324 '-finstrument-functions',
4325 # Allow mmx intrinsics to inline, so that the
4326 #0 compiler can expand the intrinsics.
4327 '-finstrument-functions-exclude-file-list=mmintrin.h',
4330 ['_toolset=="target" and OS=="android"', {
4332 # Avoids errors with current NDK:
4333 # "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"
4334 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4339 ['linux_dump_symbols==1', {
4342 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4343 'target_conditions': [
4344 ['_toolset=="target"', {
4346 # Attempt to use less memory to prevent the linker from
4347 # running out of address space. Considering installing a
4348 # 64-bit kernel and switching to a 64-bit linker.
4349 '-Wl,--no-keep-memory',
4356 ['use_allocator!="tcmalloc"', {
4357 'defines': ['NO_TCMALLOC'],
4359 ['linux_use_gold_flags==1', {
4360 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4362 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4363 'ldflags': [ '-fuse-ld=gold', ],
4365 'target_conditions': [
4366 ['_toolset=="target"', {
4368 # Experimentation found that using four linking threads
4369 # saved ~20% of link time.
4370 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4371 # Only apply this to the target linker, since the host
4372 # linker might not be gold, but isn't used much anyway.
4373 # TODO(raymes): Disable threading because gold is frequently
4374 # crashing on the bots: crbug.com/161942.
4376 # '-Wl,--thread-count=4',
4381 ['release_valgrind_build==0', {
4382 'target_conditions': [
4383 ['_toolset=="target"', {
4392 ['linux_use_bundled_binutils==1', {
4394 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4397 ['linux_use_bundled_gold==1', {
4398 # Put our binutils, which contains gold in the search path. We pass
4399 # the path to gold to the compiler. gyp leaves unspecified what the
4400 # cwd is when running the compiler, so the normal gyp path-munging
4401 # fails us. This hack gets the right path.
4403 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4406 # Some binutils 2.23 releases may or may not have new dtags enabled,
4407 # but they are all compatible with --disable-new-dtags,
4408 # because the new dynamic tags are not created by default.
4409 ['binutils_version>=223', {
4410 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4411 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4412 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4413 # inside this file to allow usage of --no-as-needed and removal of
4416 '-Wl,--disable-new-dtags',
4419 ['gcc_version>=47 and clang==0', {
4420 'target_conditions': [
4421 ['_toolset=="target"', {
4424 # See comment for -Wno-c++11-narrowing.
4426 # TODO(thakis): Remove, http://crbug.com/263960
4427 '-Wno-literal-suffix',
4432 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4433 'target_conditions': [
4434 ['_toolset=="host"', {
4437 # See comment for -Wno-c++11-narrowing.
4439 # TODO(thakis): Remove, http://crbug.com/263960
4440 '-Wno-literal-suffix',
4448 # FreeBSD-specific options; note that most FreeBSD options are set above,
4451 'target_defaults': {
4453 '-Wl,--no-keep-memory',
4457 # Android-specific options; note that most are set above with Linux.
4460 # This is a unique identifier for a given build. It's used for
4461 # identifying various build artifacts corresponding to a particular
4462 # build of chrome (e.g. where to find archived symbols).
4463 'chrome_build_id%': '',
4465 # Figure this out early since it needs symbols from libgcc.a, so it
4466 # has to be before that in the set of libraries.
4467 ['component=="shared_library"', {
4468 'android_stlport_library': 'stlport_shared',
4470 'android_stlport_library': 'stlport_static',
4474 # Placing this variable here prevents from forking libvpx, used
4475 # by remoting. Remoting is off, so it needn't built,
4476 # so forking it's deps seems like overkill.
4477 # But this variable need defined to properly run gyp.
4478 # A proper solution is to have an OS==android conditional
4479 # in third_party/libvpx/libvpx.gyp to define it.
4480 'libvpx_path': 'lib/linux/arm',
4482 'target_defaults': {
4484 'release_extra_cflags%': '',
4486 # If we're using the components build, append "cr" to all shared
4487 # libraries to avoid naming collisions with android system library
4488 # versions with the same name (e.g. skia, icu).
4489 ['component=="shared_library"', {
4490 'android_product_extension': 'cr.so',
4492 'android_product_extension': 'so',
4496 'target_conditions': [
4497 ['_type=="shared_library"', {
4498 'product_extension': '<(android_product_extension)',
4501 # Settings for building device targets using Android's toolchain.
4502 # These are based on the setup.mk file from the Android NDK.
4504 # The NDK Android executable link step looks as follows:
4506 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4507 # $(PRIVATE_OBJECTS) <-- The .o that we built
4508 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4509 # $(TARGET_LIBGCC) <-- libgcc.a
4510 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4511 # $(PRIVATE_LDLIBS) <-- System .so
4512 # $(TARGET_CRTEND_O) <-- crtend.o
4514 # For now the above are approximated for executables by adding
4515 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4518 # The NDK Android shared library link step looks as follows:
4520 # $(PRIVATE_OBJECTS) <-- The .o that we built
4521 # -l,--whole-archive
4522 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4523 # -l,--no-whole-archive
4524 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4525 # $(TARGET_LIBGCC) <-- libgcc.a
4526 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4527 # $(PRIVATE_LDLIBS) <-- System .so
4529 # For now, assume that whole static libraries are not needed.
4531 # For both executables and shared libraries, add the proper
4532 # libgcc.a to the start of libraries which puts it in the
4533 # proper spot after .o and .a files get linked in.
4535 # TODO: The proper thing to do longer-tem would be proper gyp
4536 # support for a custom link command line.
4537 ['_toolset=="target"', {
4539 '-pthread', # Not supported by Android toolchain.
4542 '-ffunction-sections',
4545 '-fstack-protector',
4547 '-finline-limit=64',
4548 '-Wa,--noexecstack',
4549 '<@(release_extra_cflags)',
4553 '__GNU_SOURCE=1', # Necessary for clone()
4555 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4556 'CHROME_BUILD_ID="<(chrome_build_id)"',
4559 '-pthread', # Not supported by Android toolchain.
4562 '-Wl,--no-undefined',
4565 ['component=="static_library"', {
4567 '-Wl,--exclude-libs=ALL',
4572 # Work around incompatibilities between bionic and clang
4574 '-D__compiler_offsetof=__builtin_offsetof',
4575 '-Dnan=__builtin_nan',
4578 ['target_arch=="arm"', {
4580 '-target arm-linux-androideabi',
4583 '-target arm-linux-androideabi',
4586 ['target_arch=="ia32"', {
4588 '-target x86-linux-androideabi',
4591 '-target x86-linux-androideabi',
4594 # Place holder for x64 support, not tested.
4595 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4596 ['target_arch=="x64"', {
4598 '-target x86_64-linux-androideabi',
4601 '-target x86_64-linux-androideabi',
4608 # Android build relies on -Wl,--gc-sections removing
4609 # unreachable code. ASan instrumentation for globals inhibits
4610 # this and results in a library with unresolvable relocations.
4611 # TODO(eugenis): find a way to reenable this.
4612 '-mllvm -asan-globals=0',
4615 ['target_arch=="arm"', {
4617 # TODO(hans): The ASan runtime is no longer automatically
4618 # added to the link line when using -nostdlib. Can we
4619 # stop adding -nostdlib? (crbug.com/423429)
4620 '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/lib/clang/3.6.0/lib/linux/libclang_rt.asan-arm-android.so',
4625 ['android_webview_build==0', {
4627 # The NDK has these things, but doesn't define the constants
4628 # to say that it does. Define them here instead.
4632 '--sysroot=<(android_ndk_sysroot)',
4635 '--sysroot=<(android_ndk_sysroot)',
4640 ['target_arch=="arm" and arm_thumb==1', {
4641 'thumb_option%': '-mthumb',
4643 'thumb_option%': '',
4648 '-l<(android_stlport_library)',
4649 # Manually link the libgcc.a that the cross compiler uses.
4650 '<!(<(android_toolchain)/*-gcc <(thumb_option) -print-libgcc-file-name)',
4656 ['android_webview_build==1', {
4658 # Android predefines this as 1; undefine it here so Chromium
4659 # can redefine it later to be 2 for chromium code and unset
4660 # for third party code. This works because cflags are added
4662 '-U_FORTIFY_SOURCE',
4663 # Disable any additional warnings enabled by the Android build system but which
4664 # chromium does not build cleanly with (when treating warning as errors).
4665 # Things that are part of -Wextra:
4666 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4667 '-Wno-ignored-qualifiers',
4669 '-Wno-unused-but-set-variable',
4672 # Other things unrelated to -Wextra:
4673 '-Wno-non-virtual-dtor',
4680 ['android_webview_build==1', {
4681 'target_conditions': [
4682 ['chromium_code==0', {
4684 # There is a class of warning which:
4685 # 1) Android always enables and also treats as errors
4686 # 2) Chromium ignores in third party code
4687 # So we re-enable those warnings when building Android.
4689 '-Wno-format-security',
4691 '-Wno-sequence-point',
4694 '-Wno-non-virtual-dtor',
4699 ['target_arch == "arm"', {
4701 # Enable identical code folding to reduce size.
4705 # NOTE: The stlport header include paths below are specified in
4706 # cflags rather than include_dirs because they need to come
4707 # after include_dirs. Think of them like system headers, but
4708 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4709 # toolchain (circa Gingerbread) will exhibit strange errors.
4710 # The include ordering here is important; change with caution.
4711 ['android_webview_build==0', {
4713 '-isystem<(android_stlport_include)',
4716 ['target_arch=="arm" and arm_thumb==1', {
4717 'ldflags': [ '-L<(android_stlport_libs_dir)/thumb' ]
4719 'ldflags': [ '-L<(android_stlport_libs_dir)' ]
4722 }, { # else: android_webview_build!=0
4723 'aosp_build_settings': {
4724 # Specify that we want to statically link stlport from the
4725 # NDK. This will provide all the include and library paths
4726 # automatically at build time, and link the right library.
4727 'LOCAL_NDK_STL_VARIANT': 'stlport_static',
4730 ['target_arch=="ia32"', {
4731 # The x86 toolchain currently has problems with stack-protector.
4733 '-fstack-protector',
4736 '-fno-stack-protector',
4740 'target_conditions': [
4741 ['_type=="executable"', {
4742 # Force android tools to export the "main" symbol so they can be
4743 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4744 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4745 # when ICS support will be dropped.
4748 '-fvisibility=default',
4752 '-Wl,--gc-sections',
4753 '-Wl,-z,nocopyreloc',
4756 # crtbegin_dynamic.o should be the last item in ldflags.
4757 '<(android_ndk_lib)/crtbegin_dynamic.o',
4760 # crtend_android.o needs to be the last item in libraries.
4761 # Do not add any libraries after this!
4762 '<(android_ndk_lib)/crtend_android.o',
4765 ['_type=="shared_library" or _type=="loadable_module"', {
4767 '-Wl,--exclude-libs=ALL',
4770 '-Wl,-shared,-Bsymbolic',
4773 ['android_webview_build==0', {
4775 # crtbegin_so.o should be the last item in ldflags.
4776 '<(android_ndk_lib)/crtbegin_so.o',
4779 # crtend_so.o needs to be the last item in libraries.
4780 # Do not add any libraries after this!
4781 '<(android_ndk_lib)/crtend_so.o',
4788 # Settings for building host targets using the system toolchain.
4789 ['_toolset=="host"', {
4791 # Due to issues in Clang build system, using ASan on 32-bit
4792 # binaries on x86_64 host is problematic.
4793 # TODO(eugenis): re-enable.
4794 '-fsanitize=address',
4797 '-fsanitize=address',
4798 '-Wl,-z,noexecstack',
4799 '-Wl,--gc-sections',
4802 '-Wl,--warn-shared-textrel',
4803 '-Wl,--fatal-warnings',
4806 # Settings for building host targets on mac.
4807 ['_toolset=="host" and host_os=="mac"', {
4817 'cflags!': ['-fvisibility=hidden'],
4818 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4820 ['OS=="mac" or OS=="ios"', {
4821 'target_defaults': {
4824 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4825 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4826 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4827 'COPY_PHASE_STRIP': 'NO',
4828 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4829 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4830 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4831 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4832 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4833 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4834 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4835 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4836 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4837 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4838 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4839 'GCC_VERSION': '4.2',
4840 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4841 'USE_HEADERMAP': 'NO',
4846 # Don't warn about unused function parameters.
4847 '-Wno-unused-parameter',
4848 # Don't warn about the "struct foo f = {0};" initialization
4850 '-Wno-missing-field-initializers',
4853 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4854 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4856 # Note that the prebuilt Clang binaries should not be used for iOS
4857 # development except for ASan builds.
4859 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
4860 # Warn if automatic synthesis is triggered with
4861 # the -Wobjc-missing-property-synthesis flag.
4862 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4863 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4865 # This warns on selectors from Cocoa headers (-length, -set).
4866 # cfe-dev is currently discussing the merits of this warning.
4867 # TODO(thakis): Reevaluate what to do with this, based one
4868 # cfe-dev discussion.
4869 '-Wno-selector-type-mismatch',
4872 ['clang_xcode==0', {
4873 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4874 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4878 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4880 '<@(clang_chrome_plugins_flags)',
4883 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4885 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4888 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4890 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4893 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4895 # See http://crbug.com/110262
4896 '-fcolor-diagnostics',
4899 ['OS=="ios" and target_subarch!="arm32" and \
4900 "<(GENERATOR)"=="xcode"', {
4902 # TODO(ios): when building Chrome for iOS on 64-bit platform
4903 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4904 # enabled. This cause failures when compiling protobuf code,
4905 # so disable the warning. http://crbug.com/359107
4906 '-Wno-shorten-64-to-32',
4914 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4920 '-fsanitize=address',
4921 '-mllvm -asan-globals=0', # http://crbug.com/352073
4922 '-gline-tables-only',
4926 ['asan_coverage!=0', {
4927 'target_conditions': [
4928 ['_toolset=="target"', {
4930 '-mllvm -asan-coverage=<(asan_coverage)',
4936 'target_conditions': [
4937 ['_type!="static_library"', {
4938 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4943 '-fsanitize=address',
4947 ['mac_write_linker_maps==1', {
4950 '-Wl,-map,>(_target_name).map',
4957 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4958 'target_conditions': [
4959 ['_type=="executable"', {
4965 # Define copy_asan_dylib_path in a variable ending in
4966 # _path so that gyp understands it's a path and
4967 # performs proper relativization during dict merging.
4968 'copy_asan_dylib_path':
4969 'mac/copy_asan_runtime_dylib.sh',
4971 'postbuild_name': 'Copy ASan runtime dylib',
4973 '<(copy_asan_dylib_path)',
4982 ], # target_conditions
4983 }, # target_defaults
4984 }], # OS=="mac" or OS=="ios"
4986 'target_defaults': {
4988 # Prevent Mac OS X AssertMacros.h from defining macros that collide
4989 # with common names, like 'check', 'require', and 'verify'.
4990 # (Included by system header. Also exists on iOS but not included.)
4991 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
4992 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
4995 # These should end with %, but there seems to be a bug with % in
4996 # variables that are intended to be set to different values in
4997 # different targets, like these.
4998 'mac_pie': 1, # Most executables can be position-independent.
4999 # Strip debugging symbols from the target.
5000 'mac_strip': '<(mac_strip_release)',
5004 ['mac_want_real_dsym=="default"', {
5007 'mac_real_dsym': '<(mac_want_real_dsym)'
5012 ['mac_want_real_dsym=="default"', {
5013 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5015 'mac_real_dsym': '<(mac_want_real_dsym)'
5022 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5023 # (Equivalent to -fPIC)
5024 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5025 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5026 # Keep pch files below xcodebuild/.
5027 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5029 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5030 # xcode_setting, but not until all downstream projects' mac bots are
5031 # using xcode >= 4.6, because that's when the default value of the
5032 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5033 # setting is a no-op as far as xcode is concerned, but the compiler
5034 # behaves differently based on whether -fno-strict-aliasing is
5036 '-fno-strict-aliasing', # See http://crbug.com/32204.
5039 'target_conditions': [
5040 ['_type=="executable"', {
5043 # Arranges for data (heap) pages to be protected against
5044 # code execution when running on Mac OS X 10.7 ("Lion"), and
5045 # ensures that the position-independent executable (PIE) bit
5046 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5048 # Define change_mach_o_flags in a variable ending in _path
5049 # so that GYP understands it's a path and performs proper
5050 # relativization during dict merging.
5051 'change_mach_o_flags_path':
5052 'mac/change_mach_o_flags_from_xcode.sh',
5053 'change_mach_o_flags_options%': [
5055 'target_conditions': [
5056 ['mac_pie==0 or release_valgrind_build==1', {
5057 # Don't enable PIE if it's unwanted. It's unwanted if
5058 # the target specifies mac_pie=0 or if building for
5059 # Valgrind, because Valgrind doesn't understand slide.
5060 # See the similar mac_pie/release_valgrind_build check
5062 'change_mach_o_flags_options': [
5068 'postbuild_name': 'Change Mach-O Flags',
5070 '<(change_mach_o_flags_path)',
5071 '>@(change_mach_o_flags_options)',
5078 'asan_saves_file': 'asan.saves',
5081 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
5085 'target_conditions': [
5086 ['mac_pie==1 and release_valgrind_build==0', {
5087 # Turn on position-independence (ASLR) for executables. When
5088 # PIE is on for the Chrome executables, the framework will
5089 # also be subject to ASLR.
5090 # Don't do this when building for Valgrind, because Valgrind
5091 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5092 # understand slide, and get rid of the Valgrind check.
5095 '-Wl,-pie', # Position-independent executable (MH_PIE)
5101 ['(_type=="executable" or _type=="shared_library" or \
5102 _type=="loadable_module") and mac_strip!=0', {
5103 'target_conditions': [
5104 ['mac_real_dsym == 1', {
5105 # To get a real .dSYM bundle produced by dsymutil, set the
5106 # debug information format to dwarf-with-dsym. Since
5107 # strip_from_xcode will not be used, set Xcode to do the
5108 # stripping as well.
5112 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5113 'DEPLOYMENT_POSTPROCESSING': 'YES',
5114 'STRIP_INSTALLED_PRODUCT': 'YES',
5115 'target_conditions': [
5116 ['_type=="shared_library" or _type=="loadable_module"', {
5117 # The Xcode default is to strip debugging symbols
5118 # only (-S). Local symbols should be stripped as
5119 # well, which will be handled by -x. Xcode will
5120 # continue to insert -S when stripping even when
5121 # additional flags are added with STRIPFLAGS.
5123 }], # _type=="shared_library" or _type=="loadable_module"
5124 ['_type=="executable"', {
5127 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
5130 }], # _type=="executable" and asan==1
5131 ], # target_conditions
5133 }, # configuration "Release"
5135 }, { # mac_real_dsym != 1
5136 # To get a fast fake .dSYM bundle, use a post-build step to
5137 # produce the .dSYM and strip the executable. strip_from_xcode
5138 # only operates in the Release configuration.
5142 # Define strip_from_xcode in a variable ending in _path
5143 # so that gyp understands it's a path and performs proper
5144 # relativization during dict merging.
5145 'strip_from_xcode_path': 'mac/strip_from_xcode',
5147 'postbuild_name': 'Strip If Needed',
5148 'action': ['<(strip_from_xcode_path)'],
5152 ], # target_conditions
5153 }], # (_type=="executable" or _type=="shared_library" or
5154 # _type=="loadable_module") and mac_strip!=0
5155 ], # target_conditions
5156 }, # target_defaults
5159 'target_defaults': {
5160 'xcode_settings' : {
5161 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5164 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5165 # additional flag to suppress the "unknown compiler option" error.
5166 # Restrict this flag to builds that are either compiling with Xcode
5167 # or compiling with Xcode's Clang. This will allow Ninja builds to
5168 # continue failing on unknown compiler options.
5169 # TODO(rohitrao): This flag is temporary and should be removed as
5170 # soon as the iOS bots are updated to use Xcode 5.1.
5171 ['clang_xcode==1', {
5173 '-Wno-unknown-warning-option',
5177 # Limit the valid architectures depending on "target_subarch".
5178 # This need to include the "arm" architectures but also the "x86"
5179 # ones (they are used when building for the simulator).
5180 ['target_subarch=="arm32"', {
5181 'VALID_ARCHS': ['armv7', 'i386'],
5183 ['target_subarch=="arm64"', {
5184 'VALID_ARCHS': ['arm64', 'x86_64'],
5186 ['target_subarch=="both"', {
5187 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5189 ['use_system_libcxx==1', {
5190 'target_conditions': [
5191 # Only use libc++ when building target for iOS not when building
5192 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5193 # does not support libc++.
5194 ['_toolset=="target"', {
5195 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5199 # The default for deployment target of 7.0+ is libc++, so force
5200 # the old behavior unless libc++ is enabled.
5201 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5205 'target_conditions': [
5206 ['_toolset=="host"', {
5208 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5209 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5218 ['_toolset=="target"', {
5220 # This section should be for overriding host settings. But,
5221 # since we can't negate the iphone deployment target above, we
5222 # instead set it here for target only.
5223 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5224 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5227 ['_type=="executable"', {
5231 'DEPLOYMENT_POSTPROCESSING': 'YES',
5232 'STRIP_INSTALLED_PRODUCT': 'YES',
5237 # Remove dSYM to reduce build time.
5238 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5244 ['chromium_ios_signing', {
5245 # iOS SDK wants everything for device signed.
5246 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5248 'CODE_SIGNING_REQUIRED': 'NO',
5249 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5254 ], # target_conditions
5255 }, # target_defaults
5258 'target_defaults': {
5260 '_WIN32_WINNT=0x0603',
5267 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5268 'WIN32_LEAN_AND_MEAN',
5271 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5272 '_HAS_EXCEPTIONS=0',
5273 # Silence some warnings; we can't switch the the 'recommended'
5274 # versions as they're not available on old OSs.
5275 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5278 ['buildtype=="Official"', {
5279 # In official builds, targets can self-select an optimization
5280 # level by defining a variable named 'optimize', and setting it
5282 # - "size", optimizes for minimal code size - the default.
5283 # - "speed", optimizes for speed over code size.
5284 # - "max", whole program optimization and link-time code
5285 # generation. This is very expensive and should be used
5288 'optimize%': 'size',
5292 # Set /LTCG for the official builds.
5293 'LinkTimeCodeGeneration': '1',
5296 'target_conditions': [
5297 ['optimize=="size"', {
5299 'VCCLCompilerTool': {
5300 # 1, optimizeMinSpace, Minimize Size (/O1)
5301 'Optimization': '1',
5302 # 2, favorSize - Favor small code (/Os)
5303 'FavorSizeOrSpeed': '2',
5308 ['optimize=="speed"', {
5310 'VCCLCompilerTool': {
5311 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5312 'Optimization': '2',
5313 # 1, favorSpeed - Favor fast code (/Ot)
5314 'FavorSizeOrSpeed': '1',
5319 ['optimize=="max"', {
5320 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5321 # builds. Probably anything that this would catch that
5322 # wouldn't be caught in a normal build isn't going to
5323 # actually be a bug, so the incremental value of C4702 for
5324 # PGO builds is likely very small.
5325 'msvs_disabled_warnings': [
5329 'VCCLCompilerTool': {
5330 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5331 'Optimization': '2',
5332 # 1, favorSpeed - Favor fast code (/Ot)
5333 'FavorSizeOrSpeed': '1',
5334 # This implies link time code generation.
5335 'WholeProgramOptimization': 'true',
5343 ['msvs_xtree_patched!=1', {
5344 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5345 # it's enabled. This will generally only be true for system-level
5346 # installed Express users.
5347 'msvs_disabled_warnings': [
5352 'msvs_system_include_dirs': [
5353 '<(windows_sdk_path)/Include/shared',
5354 '<(windows_sdk_path)/Include/um',
5355 '<(windows_sdk_path)/Include/winrt',
5356 '$(VSInstallDir)/VC/atlmfc/include',
5358 'msvs_cygwin_shell': 0,
5359 'msvs_disabled_warnings': [
5360 # C4127: conditional expression is constant
5361 # This warning can in theory catch dead code and other problems, but
5362 # triggers in far too many desirable cases where the conditional
5363 # expression is either set by macros or corresponds some legitimate
5364 # compile-time constant expression (due to constant template args,
5365 # conditionals comparing the sizes of different types, etc.). Some of
5366 # these can be worked around, but it's not worth it.
5369 # C4351: new behavior: elements of array 'array' will be default
5371 # This is a silly "warning" that basically just alerts you that the
5372 # compiler is going to actually follow the language spec like it's
5373 # supposed to, instead of not following it like old buggy versions
5374 # did. There's absolutely no reason to turn this on.
5377 # C4355: 'this': used in base member initializer list
5378 # It's commonly useful to pass |this| to objects in a class'
5379 # initializer list. While this warning can catch real bugs, most of
5380 # the time the constructors in question don't attempt to call methods
5381 # on the passed-in pointer (until later), and annotating every legit
5382 # usage of this is simply more hassle than the warning is worth.
5385 # C4503: 'identifier': decorated name length exceeded, name was
5387 # This only means that some long error messages might have truncated
5388 # identifiers in the presence of lots of templates. It has no effect
5389 # on program correctness and there's no real reason to waste time
5390 # trying to prevent it.
5393 # C4611: interaction between 'function' and C++ object destruction is
5395 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5396 # suggests using exceptions instead of setjmp/longjmp for C++, but
5397 # Chromium code compiles without exception support. We therefore have
5398 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5399 # means we have to turn off this warning (and be careful about how
5400 # object destruction happens in such cases).
5403 # TODO(maruel): These warnings are level 4. They will be slowly
5404 # removed as code is fixed.
5405 4100, # Unreferenced formal parameter
5406 4121, # Alignment of a member was sensitive to packing
5407 4189, # Local variable is initialized but not referenced
5408 4244, # Conversion from 'type1' to 'type2', possible loss of data
5409 4481, # Nonstandard extension used: override specifier 'keyword'
5410 4505, # Unreferenced local function has been removed
5411 4510, # Default constructor could not be generated
5412 4512, # Assignment operator could not be generated
5413 4610, # Object can never be instantiated
5414 4996, # 'X': was declared deprecated (for GetVersionEx).
5417 'VCCLCompilerTool': {
5418 'AdditionalOptions': ['/MP'],
5419 'MinimalRebuild': 'false',
5420 'BufferSecurityCheck': 'true',
5421 'EnableFunctionLevelLinking': 'true',
5422 'RuntimeTypeInfo': 'false',
5423 'WarningLevel': '4',
5424 'WarnAsError': 'true',
5425 'DebugInformationFormat': '3',
5426 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5427 'ExceptionHandling': '0',
5429 'VCLibrarianTool': {
5430 'AdditionalOptions': ['/ignore:4221'],
5431 'AdditionalLibraryDirectories': [
5432 '<(windows_sdk_path)/Lib/win8/um/x86',
5436 'AdditionalDependencies': [
5448 'AdditionalLibraryDirectories': [
5449 '<(windows_sdk_path)/Lib/win8/um/x86',
5451 'GenerateDebugInformation': 'true',
5452 'MapFileName': '$(OutDir)\\$(TargetName).map',
5453 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5454 'FixedBaseAddress': '1',
5457 # 1 == /SUBSYSTEM:CONSOLE
5458 # 2 == /SUBSYSTEM:WINDOWS
5459 # Most of the executables we'll ever create are tests
5460 # and utilities with console output.
5464 'GenerateStublessProxies': 'true',
5465 'TypeLibraryName': '$(InputName).tlb',
5466 'OutputDirectory': '$(IntDir)',
5467 'HeaderFileName': '$(InputName).h',
5468 'DLLDataFileName': '$(InputName).dlldata.c',
5469 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5470 'ProxyFileName': '$(InputName)_p.c',
5472 'VCResourceCompilerTool': {
5474 'AdditionalIncludeDirectories': [
5476 '<(SHARED_INTERMEDIATE_DIR)',
5479 'target_conditions': [
5480 ['_type=="executable"', {
5482 'EmbedManifest': 'true',
5485 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5487 'AdditionalManifestFiles': [
5488 '>(win_exe_compatibility_manifest)',
5495 # Building with Clang on Windows is a work in progress and very
5496 # experimental. See crbug.com/82385.
5497 'VCCLCompilerTool': {
5498 'WarnAsError': 'false',
5499 'RuntimeTypeInfo': 'false',
5500 'AdditionalOptions': [
5501 '-fmsc-version=1800',
5504 # Many files use intrinsics without including this header.
5505 # TODO(hans): Fix those files, or move this to sub-GYPs.
5508 # TODO(hans): Make this list shorter eventually.
5509 '-Qunused-arguments',
5510 '-Wno-c++11-compat-deprecated-writable-strings',
5511 '-Wno-deprecated-declarations',
5513 '-Wno-enum-conversion',
5514 '-Wno-extra-tokens',
5515 '-Wno-ignored-attributes',
5516 '-Wno-incompatible-pointer-types',
5517 '-Wno-int-to-void-pointer-cast',
5518 '-Wno-invalid-noreturn',
5519 '-Wno-logical-op-parentheses',
5521 '-Wno-missing-braces',
5522 '-Wno-missing-declarations',
5523 '-Wno-msvc-include',
5524 '-Wno-null-dereference',
5525 '-Wno-overloaded-virtual',
5527 '-Wno-pointer-sign',
5529 '-Wno-return-type-c-linkage',
5531 '-Wno-sometimes-uninitialized',
5533 '-Wno-tautological-compare',
5534 '-Wno-unknown-pragmas',
5536 '-Wno-unused-function',
5537 '-Wno-unused-private-field',
5538 '-Wno-unused-value',
5539 '-Wno-unused-variable',
5540 '-Wno-unused-local-typedef', # http://crbug.com/411648
5541 '-Wno-inconsistent-missing-override', #http://crbug.com/428099
5546 # ASan on Windows is a work in progress and very experimental.
5547 # See crbug.com/345874.
5548 'VCCLCompilerTool': {
5549 'AdditionalOptions': [
5550 '-fsanitize=address',
5552 'AdditionalIncludeDirectories': [
5553 # MSVC needs to be able to find the sanitizer headers when
5554 # invoked via /fallback. This is critical for using macros
5555 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5557 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/include_sanitizer',
5561 'AdditionalLibraryDirectories': [
5562 # TODO(hans): If make_clang_dir is absolute, this breaks.
5563 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/lib/windows',
5566 'target_conditions': [
5567 ['component=="shared_library"', {
5569 'AdditionalDependencies': [
5570 'clang_rt.asan_dynamic-i386.lib',
5571 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5575 ['_type=="executable" and component=="static_library"', {
5577 'AdditionalDependencies': [
5578 'clang_rt.asan-i386.lib',
5582 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5584 'AdditionalDependencies': [
5585 'clang_rt.asan_dll_thunk-i386.lib',
5595 ['disable_nacl==1', {
5596 'target_defaults': {
5602 ['OS=="win" and msvs_use_common_linker_extras', {
5603 'target_defaults': {
5618 'AdditionalOptions': [
5627 'AdditionalOptions': ['/largeaddressaware'],
5636 'AdditionalOptions': [
5637 # safeseh is not compatible with x64
5649 ['enable_new_npdevice_api==1', {
5650 'target_defaults': {
5652 'ENABLE_NEW_NPDEVICE_API',
5656 # Don't warn about the "typedef 'foo' locally defined but not used"
5657 # for gcc 4.8 and higher.
5658 # TODO: remove this flag once all builds work. See crbug.com/227506
5659 ['gcc_version>=48 and clang==0', {
5660 'target_defaults': {
5662 '-Wno-unused-local-typedefs',
5666 ['gcc_version>=48 and clang==0 and host_clang==1', {
5667 'target_defaults': {
5668 'target_conditions': [
5669 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5673 # In the android webview build, force host targets to be compiled with clang
5674 # as the hermetic host gcc is very old on some platforms. This is already
5675 # the default on the current development version of AOSP but we force it
5676 # here in case we need to compile against an older release version. We also
5677 # explicitly set it to false for target binaries to avoid causing problems
5678 # for the work to enable clang by default in AOSP. We also force the use of
5679 # libstdc++ on host as peculiarities of the android gyp backend mean that
5680 # using libc++ doesn't work, and Chromium doesn't yet require a more modern
5682 ['android_webview_build==1', {
5683 'target_defaults': {
5684 'target_conditions': [
5685 ['_toolset=="host"', {
5686 'aosp_build_settings': {
5687 'LOCAL_CLANG': 'true',
5688 'LOCAL_CXX_STL': 'libstdc++',
5690 }, { # else: _toolset != "host"
5691 'aosp_build_settings': {
5692 'LOCAL_CLANG': 'false',
5698 # We need a special case to handle the android webview build on mac because
5699 # the host gcc there doesn't accept this flag, but the target gcc may
5701 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5702 'target_defaults': {
5703 'target_conditions': [
5704 ['_toolset=="host"', {
5706 '-Wno-unused-local-typedefs',
5712 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5714 'make_global_settings': [
5715 ['CC', '<(make_clang_dir)/bin/clang'],
5716 ['CXX', '<(make_clang_dir)/bin/clang++'],
5717 ['CC.host', '$(CC)'],
5718 ['CXX.host', '$(CXX)'],
5721 ['clang==1 and OS=="win"', {
5722 'make_global_settings': [
5723 # On Windows, gyp's ninja generator only looks at CC.
5724 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5727 ['OS=="android" and clang==0', {
5728 # Hardcode the compiler names in the Makefile so that
5729 # it won't depend on the environment at make time.
5730 'make_global_settings': [
5731 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5732 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5733 ['CC.host', '<(host_cc)'],
5734 ['CXX.host', '<(host_cxx)'],
5737 ['OS=="linux" and target_arch=="mipsel"', {
5738 'make_global_settings': [
5739 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5740 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5741 ['CC.host', '<(host_cc)'],
5742 ['CXX.host', '<(host_cxx)'],
5745 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5746 # Set default ARM cross compiling on linux. These can be overridden
5747 # using CC/CXX/etc environment variables.
5748 'make_global_settings': [
5749 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5750 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5751 ['CC.host', '<(host_cc)'],
5752 ['CXX.host', '<(host_cxx)'],
5756 # TODO(yyanagisawa): supports GENERATOR==make
5757 # make generator doesn't support CC_wrapper without CC
5758 # in make_global_settings yet.
5759 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5760 'make_global_settings': [
5761 ['CC_wrapper', '<(gomadir)/gomacc'],
5762 ['CXX_wrapper', '<(gomadir)/gomacc'],
5763 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5764 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5768 'target_defaults': {
5769 'target_conditions': [
5770 ['_toolset=="target"', {
5773 '-ffat-lto-objects',
5779 ['use_lto==1 or use_lto_o2==1', {
5780 'target_defaults': {
5781 'target_conditions': [
5782 ['_toolset=="target"', {
5792 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5793 # This block adds *project-wide* configuration settings to each project
5794 # file. It's almost always wrong to put things here. Specify your
5795 # custom xcode_settings in target_defaults to add them to targets instead.
5798 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5799 # setting sets the SDK on a project-wide basis. In order to get the
5800 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5801 # here at the project level.
5804 ['mac_sdk_path==""', {
5805 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5807 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5813 ['ios_sdk_path==""', {
5815 # TODO(justincohen): Ninja only supports simulator for now.
5816 ['"<(GENERATOR)"=="xcode"', {
5817 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5819 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5823 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5828 # Target both iPhone and iPad.
5829 'TARGETED_DEVICE_FAMILY': '1,2',
5832 ['target_arch=="x64"', {
5837 ['target_arch=="ia32"', {
5846 # The Xcode generator will look for an xcode_settings section at the root
5847 # of each dict and use it to apply settings on a file-wide basis. Most
5848 # settings should not be here, they should be in target-specific
5849 # xcode_settings sections, or better yet, should use non-Xcode-specific
5850 # settings in target dicts. SYMROOT is a special case, because many other
5851 # Xcode variables depend on it, including variables such as
5852 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5853 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5854 # files to appear (when present) in the UI as actual files and not red
5855 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5856 # and therefore SYMROOT, needs to be set at the project level.
5857 'SYMROOT': '<(DEPTH)/xcodebuild',