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 OpenSSL instead of NSS as the underlying SSL and crypto
65 # implementation. Certificate verification will in most cases be
66 # handled by the OS. If OpenSSL's struct X509 is used to represent
67 # certificates, use_openssl_certs must be set.
70 # Typedef X509Certificate::OSCertHandle to OpenSSL's struct X509*.
71 'use_openssl_certs%': 0,
73 # Disable viewport meta tag by default.
74 'enable_viewport%': 0,
76 # Enable HiDPI support.
79 # Override buildtype to select the desired build flavor.
80 # Dev - everyday build for development/testing
81 # Official - release build (generally implies additional processing)
82 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
83 # conversion is done), some of the things which are now controlled by
84 # 'branding', such as symbol generation, will need to be refactored
85 # based on 'buildtype' (i.e. we don't care about saving symbols for
86 # non-Official # builds).
89 # Override branding to select the desired branding flavor.
90 'branding%': 'Chromium',
93 # ChromeOS and Windows use Aura and Ash.
94 ['chromeos==1 or OS=="win" or OS=="linux"', {
109 # Whether we're a traditional desktop unix.
110 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
116 # Embedded implies ozone.
122 'target_arch%': 'arm',
124 # Default architecture we're building for is the architecture we're
125 # building on, and possibly sub-architecture (for iOS builds).
126 'target_arch%': '<(host_arch)',
130 # Copy conditionally-set variables out one scope.
131 'chromeos%': '<(chromeos)',
132 'chromecast%': '<(chromecast)',
133 'desktop_linux%': '<(desktop_linux)',
134 'use_aura%': '<(use_aura)',
135 'use_ash%': '<(use_ash)',
136 'use_cras%': '<(use_cras)',
137 'use_ozone%': '<(use_ozone)',
138 'embedded%': '<(embedded)',
139 'use_openssl%': '<(use_openssl)',
140 'use_openssl_certs%': '<(use_openssl_certs)',
141 'enable_viewport%': '<(enable_viewport)',
142 'enable_hidpi%': '<(enable_hidpi)',
143 'buildtype%': '<(buildtype)',
144 'branding%': '<(branding)',
145 'host_arch%': '<(host_arch)',
146 'target_arch%': '<(target_arch)',
148 'target_subarch%': '',
150 # This is set when building the Android WebView inside the Android
151 # build system, using the 'android' gyp backend. The WebView code is
152 # still built when this is unset, but builds using the normal chromium
154 'android_webview_build%': 0,
156 # This is set when building the Android WebView in ninja for the
158 'android_webview_telemetry_build%': 0,
160 # Set ARM architecture version.
163 # Use aurax11 for clipboard implementation. This is true on linux_aura.
164 'use_clipboard_aurax11%': 0,
168 # If no gomadir is set, it uses the default gomadir.
172 # The system root for cross-compiles. Default: none.
176 # The system libdir used for this ABI.
177 'system_libdir%': 'lib',
185 # Set default value of toolkit_views based on OS.
186 ['OS=="win" or chromeos==1 or use_aura==1', {
192 # Embedded builds use aura without ash or views.
199 # Enable HiDPI on Mac OS, Chrome OS and Windows.
200 ['OS=="mac" or chromeos==1 or OS=="win"', {
204 # Enable App Launcher everywhere but mobile.
205 ['OS!="ios" and OS!="android"', {
206 'enable_app_list%': 1,
208 'enable_app_list%': 0,
211 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
212 'use_default_render_theme%': 1,
214 'use_default_render_theme%': 0,
218 'use_ozone_evdev%': 1,
220 'use_ozone_evdev%': 0,
223 # Set default gomadir.
225 'gomadir': 'c:\\goma\\goma-win',
227 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
230 # Set the default "target_subarch" on iOS. Valid values are "arm32",
231 # "arm64" and "both" (meaning a fat binary).
233 # TODO(sdefresne): change the default from "arm32" to "both" for
234 # "target_subarch" once http://crbug.com/339477 is fixed.
236 # TODO(sdefresne): set the "target_arch" to "arm" once compilation
237 # of skia has been fixed for simulator. http://crbug.com/342377
239 'target_subarch%': 'arm32',
244 # Copy conditionally-set variables out one scope.
245 'chromeos%': '<(chromeos)',
246 'chromecast%': '<(chromecast)',
247 'host_arch%': '<(host_arch)',
248 'target_arch%': '<(target_arch)',
249 'target_subarch%': '<(target_subarch)',
250 'toolkit_views%': '<(toolkit_views)',
251 'desktop_linux%': '<(desktop_linux)',
252 'use_aura%': '<(use_aura)',
253 'use_ash%': '<(use_ash)',
254 'use_cras%': '<(use_cras)',
255 'use_ozone%': '<(use_ozone)',
256 'use_ozone_evdev%': '<(use_ozone_evdev)',
257 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
258 'embedded%': '<(embedded)',
259 'use_openssl%': '<(use_openssl)',
260 'use_openssl_certs%': '<(use_openssl_certs)',
261 'enable_viewport%': '<(enable_viewport)',
262 'enable_hidpi%': '<(enable_hidpi)',
263 'android_webview_build%': '<(android_webview_build)',
264 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
265 'use_goma%': '<(use_goma)',
266 'gomadir%': '<(gomadir)',
267 'enable_app_list%': '<(enable_app_list)',
268 'use_default_render_theme%': '<(use_default_render_theme)',
269 'buildtype%': '<(buildtype)',
270 'branding%': '<(branding)',
271 'arm_version%': '<(arm_version)',
272 'sysroot%': '<(sysroot)',
273 'chroot_cmd%': '<(chroot_cmd)',
274 'system_libdir%': '<(system_libdir)',
276 # Set to 1 to enable fast builds. Set to 2 for even faster builds
277 # (it disables debug info for fastest compilation - only for use
278 # on compile-only bots).
281 # Set to 1 to not store any build metadata (this isn't working yet but
282 # this flag will help us to get there). See http://crbug.com/314403.
283 # TODO(sebmarchand): Update this comment once this flag guarantee that
284 # there's no build metadata in the build artifacts.
285 'dont_embed_build_metadata%': 0,
287 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
288 # This is useful for parallel compilation tools which can't support /Zi.
289 # Only used on Windows.
292 # Set to 1 to enable dcheck in release.
293 'dcheck_always_on%': 0,
295 # Set to 1 to make a build that disables unshipped tracing events.
296 # Note: this setting is ignored if buildtype=="Official".
297 'tracing_like_official_build%': 0,
299 # Disable image loader component extension by default.
300 'image_loader_extension%': 0,
302 # Set NEON compilation flags.
305 # Detect NEON support at run-time.
306 'arm_neon_optional%': 0,
308 # Use libjpeg-turbo as the JPEG codec used by Chromium.
309 'use_libjpeg_turbo%': 1,
311 # Use system libjpeg. Note that the system's libjepg will be used even if
312 # use_libjpeg_turbo is set.
313 'use_system_libjpeg%': 0,
315 # By default, component is set to static_library and it can be overriden
316 # by the GYP command line or by ~/.gyp/include.gypi.
317 'component%': 'static_library',
319 # Set to select the Title Case versions of strings in GRD files.
320 'use_titlecase_in_grd_files%': 0,
322 # Use translations provided by volunteers at launchpad.net. This
323 # currently only works on Linux.
324 'use_third_party_translations%': 0,
326 # Remoting compilation is enabled by default. Set to 0 to disable.
329 # Configuration policy is enabled by default. Set to 0 to disable.
330 'configuration_policy%': 1,
332 # Variable safe_browsing is used to control the build time configuration
333 # for safe browsing feature. Safe browsing can be compiled in 3 different
334 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
335 # reporting features without enabling phishing and malware detection. This
336 # is useful to integrate a third party phishing/malware detection to
337 # existing safe browsing logic.
340 # Web speech is enabled by default. Set to 0 to disable.
341 'enable_web_speech%': 1,
343 # Notifications are compiled in by default. Set to 0 to disable.
344 'notifications%' : 1,
346 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
347 # regular builds and 1 for ASan builds.
348 'mac_want_real_dsym%': 'default',
350 # If this is set, the clang plugins used on the buildbot will be used.
351 # Run tools/clang/scripts/update.sh to make sure they are compiled.
352 # This causes 'clang_chrome_plugins_flags' to be set.
353 # Has no effect if 'clang' is not set as well.
354 'clang_use_chrome_plugins%': 1,
356 # Enable building with ASAN (Clang's -fsanitize=address option).
357 # -fsanitize=address only works with clang, but asan=1 implies clang=1
358 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
360 # Enable coverage gathering instrumentation in ASan. This flag also
361 # controls coverage granularity (1 for function-level coverage, 2 for
362 # block-level coverage).
365 # Enable Chromium overrides of the default configurations for various
366 # dynamic tools (like ASan).
367 'use_sanitizer_options%': 1,
369 # Enable building with SyzyAsan.
370 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
373 # Enable building with LSan (Clang's -fsanitize=leak option).
374 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
375 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
378 # Enable building with TSan (Clang's -fsanitize=thread option).
379 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
380 # See http://clang.llvm.org/docs/ThreadSanitizer.html
382 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
384 # Enable building with MSan (Clang's -fsanitize=memory option).
385 # MemorySanitizer only works with clang, but msan=1 implies clang=1
386 # See http://clang.llvm.org/docs/MemorySanitizer.html
388 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
389 # Track where uninitialized memory originates from. From fastest to
390 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
391 # - track the chain of stores leading from allocation site to use site.
392 'msan_track_origins%': 1,
394 # Enable building with UBSan (Clang's -fsanitize=undefined option).
395 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
396 # See http://clang.llvm.org/docs/UsersManual.html
399 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
400 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
402 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan_vptr/blacklist.txt',
404 # Use the dynamic libraries instrumented by one of the sanitizers
405 # instead of the standard system libraries.
406 'use_instrumented_libraries%': 0,
408 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
409 # stdlibc++ as standard library. This is intended to use for instrumented
411 'use_custom_libcxx%': 0,
413 # Use system libc++ instead of the default C++ library, usually libstdc++.
414 # This is intended for iOS builds only.
415 'use_system_libcxx%': 0,
417 # Use a modified version of Clang to intercept allocated types and sizes
418 # for allocated objects. clang_type_profiler=1 implies clang=1.
419 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
420 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
421 'clang_type_profiler%': 0,
423 # Set to true to instrument the code with function call logger.
424 # See src/third_party/cygprofile/cyg-profile.cc for details.
425 'order_profiling%': 0,
427 # Use the provided profiled order file to link Chrome image with it.
428 # This makes Chrome faster by better using CPU cache when executing code.
429 # This is known as PGO (profile guided optimization).
430 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
431 'order_text_section%' : "",
433 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
434 # libraries on linux x86-64 and arm, plus ASLR.
437 # Whether one-click signin is enabled or not.
438 'enable_one_click_signin%': 0,
440 # Whether to back up data before sync.
441 'enable_pre_sync_backup%': 0,
443 # Enable Chrome browser extensions
444 'enable_extensions%': 1,
447 'enable_google_now%': 1,
449 # Enable printing support and UI. This variable is used to configure
450 # which parts of printing will be built. 0 disables printing completely,
451 # 1 enables it fully, and 2 enables only the codepath to generate a
452 # Metafile (e.g. usually a PDF or EMF) and disables print preview, cloud
454 'enable_printing%': 1,
456 # Windows prints using a PDF as the metafile from the renderer.
457 'win_pdf_metafile_for_printing%': 1,
459 # Set the version of CLD.
460 # 0: Don't specify the version. This option is for the Finch testing.
465 # For CLD2, the size of the tables that should be included in the build
466 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
468 # See third_party/cld_2/cld_2.gyp for more information.
469 # 0: Small tables, lower accuracy
470 # 1: Medium tables, medium accuracy
471 # 2: Large tables, high accuracy
472 'cld2_table_size%': 2,
474 # The data acquisition mode for CLD2. Possible values are:
475 # static: CLD2 data is statically linked to the executable.
476 # standalone: CLD2 data is provided in a standalone file that is
477 # bundled with the executable.
478 # component: CLD2 data is provided as a Chrome "component" and is
479 # downloaded via the component updater.
481 # For more information on switching the CLD2 data source, see:
482 # https://sites.google.com/a/chromium.org/dev/developers/how-tos/compact-language-detector-cld-data-source-configuration
484 # This string will be exposed in chrome://translate-internals under the
485 # heading "CLD Data Source". This allows easy determination of which
486 # data source the browser was built with.
487 'cld2_data_source%': 'static',
489 # Enable spell checker.
490 'enable_spellcheck%': 1,
492 # Webrtc compilation is enabled by default. Set to 0 to disable.
495 # Enables use of the session service, which is enabled by default.
496 # Support for disabling depends on the platform.
497 'enable_session_service%': 1,
499 # Enables theme support, which is enabled by default. Support for
500 # disabling depends on the platform.
503 # Enables autofill dialog and associated features; disabled by default.
504 'enable_autofill_dialog%' : 0,
506 # Defaults Wallet integration in Autofill dialog to use production
507 # servers. Unofficial builds won't have the proper API keys.
508 'enable_prod_wallet_service%': 0,
510 # Enables support for background apps.
511 'enable_background%': 1,
513 # Enable the task manager by default.
514 'enable_task_manager%': 1,
516 # Enables used resource whitelist generation; disabled by default.
517 'enable_resource_whitelist_generation%': 0,
519 # Enable FILE support by default.
520 'disable_file_support%': 0,
522 # Enable FTP support by default.
523 'disable_ftp_support%': 0,
525 # Use native android functions in place of ICU. Not supported by most
527 'use_icu_alternatives_on_android%': 0,
529 # XInput2 multitouch support is enabled by default (use_xi2_mt=2).
530 # Setting to zero value disables XI2 MT. When XI2 MT is enabled,
531 # the input value also defines the required XI2 minor minimum version.
532 # For example, use_xi2_mt=2 means XI2.2 or above version is required.
535 # Use of precompiled headers on Windows.
537 # This variable may be explicitly set to 1 (enabled) or 0
538 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
539 # This setting will override the default.
542 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
544 'chromium_win_pch%': 0,
547 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
548 # Set this to true when building with Clang.
549 # See http://code.google.com/p/chromium/wiki/Clang for details.
550 # If this is set, clang is used as both host and target compiler in
551 # cross-compile builds.
554 # Enable plug-in installation by default.
555 'enable_plugin_installation%': 1,
557 # Specifies whether to use canvas_skia.cc in place of platform
558 # specific implementations of gfx::Canvas. Affects text drawing in the
560 # TODO(asvitkine): Enable this on all platforms and delete this flag.
561 # http://crbug.com/105550
562 'use_canvas_skia%': 0,
564 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
565 # with one of those tools.
566 'build_for_tool%': '',
568 # If no directory is specified then a temporary directory will be used.
569 'test_isolation_outdir%': '',
570 # True if isolate should fail if the isolate files refer to files
572 'test_isolation_fail_on_missing': 0,
574 'wix_path%': '<(DEPTH)/third_party/wix',
576 # Managed users are enabled by default.
577 'enable_managed_users%': 1,
579 # Platform natively supports discardable memory.
580 'native_discardable_memory%': 0,
582 # Platform sends memory pressure signals natively.
583 'native_memory_pressure_signals%': 0,
585 'data_reduction_fallback_host%' : '',
586 'data_reduction_dev_host%' : '',
587 'spdy_proxy_auth_origin%' : '',
588 'spdy_proxy_auth_property%' : '',
589 'spdy_proxy_auth_value%' : '',
590 'data_reduction_proxy_probe_url%' : '',
591 'data_reduction_proxy_warmup_url%' : '',
592 'data_reduction_proxy_ssl_origin%' : '',
593 'data_reduction_proxy_alt_origin%' : '',
594 'data_reduction_proxy_alt_fallback_origin%' : '',
596 'enable_service_discovery%': 0,
597 'enable_wifi_bootstrapping%': 0,
598 'enable_hangout_services_extension%': 0,
600 # Enable the Syzygy optimization step.
601 'syzygy_optimize%': 0,
603 # Enable hole punching for the protected video.
606 # Automatically select platforms under ozone. Turn this off to
607 # build only explicitly selected platforms.
608 'ozone_auto_platforms%': 1,
611 ['android_webview_build==0', {
612 # If this is set clang is used as host compiler, but not as target
613 # compiler. Always do this by default, except when building for AOSP.
616 # See http://crbug.com/377684
619 # A flag for POSIX platforms
626 # A flag for BSD platforms
627 ['OS=="freebsd" or OS=="openbsd"', {
634 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
640 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
641 # OpenSSL's certificate definition.
642 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
643 'use_openssl_certs%': 1,
645 'use_openssl_certs%': 0,
648 # libudev usage. This currently only affects the content layer.
649 ['OS=="linux" and embedded==0', {
655 # Flags to use X11 on non-Mac POSIX platforms.
656 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
663 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
669 # Flags to use pango and cairo.
670 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
679 ['OS=="linux" and embedded==0', {
685 # We always use skia text rendering in Aura on Windows, since GDI
686 # doesn't agree with our BackingStore.
687 # TODO(beng): remove once skia text rendering is on by default.
688 ['use_aura==1 and OS=="win"', {
689 'enable_skia_text%': 1,
692 # A flag to enable or disable our compile-time dependency
693 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
694 # support will be available. This option is useful
695 # for Linux distributions and for Aura.
696 ['OS!="linux" or chromeos==1', {
697 'use_gnome_keyring%': 0,
699 'use_gnome_keyring%': 1,
702 ['OS=="mac" or OS=="ios"', {
703 # Mac and iOS want Title Case strings
704 'use_titlecase_in_grd_files%': 1,
707 # Enable loader extensions on Chrome OS.
709 'image_loader_extension%': 1,
711 'image_loader_extension%': 0,
714 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
715 'enable_one_click_signin%': 1,
716 'enable_pre_sync_backup%': 1,
720 'enable_extensions%': 0,
721 'enable_google_now%': 0,
723 'enable_spellcheck%': 0,
727 'arm_neon_optional%': 1,
728 'native_discardable_memory%': 1,
729 'native_memory_pressure_signals%': 1,
730 'enable_printing%': 2,
731 'enable_task_manager%':0,
732 # Set to 1 once we have a notification system for Android.
733 # http://crbug.com/115320
738 # Android OS includes support for proprietary codecs regardless of
739 # building Chromium or Google Chrome. We also ship Google Chrome and
740 # Chromecast with proprietary codecs.
741 ['OS=="android" or branding=="Chrome" or chromecast==1', {
742 'proprietary_codecs%': 1,
744 'proprietary_codecs%': 0,
747 ['OS=="mac" or OS=="ios"', {
748 'native_discardable_memory%': 1,
749 'native_memory_pressure_signals%': 1,
752 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
753 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
754 'enable_autofill_dialog%': 1,
757 ['buildtype=="Official"', {
758 'enable_prod_wallet_service%': 1,
768 'disable_ftp_support%': 1,
769 'enable_extensions%': 0,
770 'enable_google_now%': 0,
772 'enable_printing%': 0,
773 'enable_session_service%': 0,
779 'enable_managed_users%': 0,
780 'enable_task_manager%': 0,
783 # Use GPU accelerated cross process image transport by default
784 # on linux builds with the Aura window manager
785 ['use_aura==1 and OS=="linux"', {
786 'ui_compositor_image_transport%': 1,
788 'ui_compositor_image_transport%': 0,
791 # Turn precompiled headers on by default.
792 ['OS=="win" and buildtype!="Official"', {
793 'chromium_win_pch%': 1
796 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
797 'enable_plugin_installation%': 0,
799 'enable_plugin_installation%': 1,
802 # Whether PPAPI is enabled.
803 ['OS=="android" or OS=="ios" or embedded==1', {
804 'enable_plugins%': 0,
806 'enable_plugins%': 1,
809 # linux_use_bundled_gold: whether to use the gold linker binary checked
810 # into third_party/binutils. Force this off via GYP_DEFINES when you
811 # are using a custom toolchain and need to control -B in ldflags.
812 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
813 # for component=static_library builds.
814 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
815 'linux_use_bundled_gold%': 1,
817 'linux_use_bundled_gold%': 0,
820 # linux_use_bundled_binutils: whether to use the binary binutils
821 # checked into third_party/binutils. These are not multi-arch so cannot
822 # be used except on x86 and x86-64 (the only two architectures which
823 # are currently checke in). Force this off via GYP_DEFINES when you
824 # are using a custom toolchain and need to control -B in cflags.
825 ['OS=="linux" and (target_arch=="x64")', {
826 'linux_use_bundled_binutils%': 1,
828 'linux_use_bundled_binutils%': 0,
831 # linux_use_gold_flags: whether to use build flags that rely on gold.
832 # On by default for x64 Linux.
833 ['OS=="linux" and target_arch=="x64"', {
834 'linux_use_gold_flags%': 1,
836 'linux_use_gold_flags%': 0,
839 # linux_use_debug_fission: whether to use split DWARF debug info
840 # files. This can reduce link time significantly, but is incompatible
841 # with some utilities such as icecc and ccache. Requires gold and
842 # gcc >= 4.8 or clang.
843 # http://gcc.gnu.org/wiki/DebugFission
844 ['OS=="linux" and target_arch=="x64"', {
845 'linux_use_debug_fission%': 1,
847 'linux_use_debug_fission%': 0,
850 ['OS=="android" or OS=="ios"', {
851 'enable_captive_portal_detection%': 0,
853 'enable_captive_portal_detection%': 1,
856 # Enable Skia UI text drawing incrementally on different platforms.
857 # http://crbug.com/105550
859 # On Aura, this allows per-tile painting to be used in the browser
862 'use_canvas_skia%': 1,
866 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
867 'use_libjpeg_turbo%': 0,
871 # When building as part of the Android system, use system libraries
872 # where possible to reduce ROM size.
873 'use_system_libjpeg%': '<(android_webview_build)',
876 # Do not enable the Settings App on ChromeOS.
877 ['enable_app_list==1 and chromeos==0', {
878 'enable_settings_app%': 1,
880 'enable_settings_app%': 0,
883 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
884 # Set some defaults for arm/linux chrome builds
885 'use_allocator%': 'none',
886 # sysroot needs to be an absolute path otherwise it generates
887 # incorrect results when passed to pkg-config
888 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot',
889 }], # OS=="linux" and target_arch=="arm" and chromeos==0
891 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
893 ['target_arch=="x64"', {
894 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
896 ['target_arch=="ia32"', {
897 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
900 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
902 ['OS=="linux" and target_arch=="mipsel"', {
903 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
904 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
907 # Whether tests targets should be run, archived or just have the
908 # dependencies verified. All the tests targets have the '_run' suffix,
909 # e.g. base_unittests_run runs the target base_unittests. The test
910 # target always calls tools/swarming_client/isolate.py. See the script's
911 # --help for more information and the valid --mode values. Meant to be
912 # overriden with GYP_DEFINES.
913 # TODO(maruel): Remove the conditions as more configurations are
915 # NOTE: The check for disable_nacl==0 and component=="static_library"
916 # can't be used here because these variables are not defined yet, but it
917 # is still not supported.
918 ['OS!="ios" and OS!="android" and chromeos==0', {
919 'test_isolation_mode%': 'check',
921 'test_isolation_mode%': 'noop',
923 # Whether Android build uses OpenMAX DL FFT.
924 ['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")', {
925 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
926 # When enabled, this will also enable WebAudio support on
927 # Android for these architectures. Default is enabled. Whether
928 # WebAudio is actually available depends on runtime settings
930 'use_openmax_dl_fft%': 1,
932 'use_openmax_dl_fft%': 0,
934 ['OS=="win" or OS=="linux"', {
938 # Turns on compiler optimizations in V8 in Debug build, except
939 # on android_clang, where we're hitting a weird linker error.
940 # TODO(dpranke): http://crbug.com/266155 .
942 'v8_optimized_debug%': 1,
944 'v8_optimized_debug%': 2,
947 # Disable various features by default on embedded.
950 'enable_printing%': 0,
953 # By default, use ICU data file (icudtl.dat) on all platforms
954 # except when building Android WebView or Chromecast.
955 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
956 # Set the data reduction proxy origin for Android Webview.
957 ['android_webview_build==0 and android_webview_telemetry_build==0 and chromecast==0', {
958 'icu_use_data_file_flag%' : 1,
959 'spdy_proxy_auth_origin%': '',
960 'data_reduction_proxy_probe_url%': '',
961 'data_reduction_proxy_warmup_url%': '',
962 'data_reduction_dev_host%': '',
963 'data_reduction_fallback_host%': '',
965 'icu_use_data_file_flag%' : 0,
966 'spdy_proxy_auth_origin%': 'https://proxy.googlezip.net:443/',
967 'data_reduction_proxy_probe_url%': 'http://check.googlezip.net/connect',
968 'data_reduction_proxy_warmup_url%': 'http://www.gstatic.com/generate_204',
969 'data_reduction_dev_host%': 'http://proxy-dev.googlezip.net:80/',
970 'data_reduction_fallback_host%': 'http://compress.googlezip.net:80/',
972 ['OS=="win" or OS=="mac"', {
973 'enable_wifi_bootstrapping%' : 1,
976 # Path to sas.dll, which provides the SendSAS function.
977 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
978 ['target_arch=="x64"', {
979 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
981 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
985 # Set this to 1 to enable use of concatenated impulse responses
986 # for the HRTF panner in WebAudio.
987 'use_concatenated_impulse_responses': 1,
989 # You can set the variable 'use_official_google_api_keys' to 1
990 # to use the Google-internal file containing official API keys
991 # for Google Chrome even in a developer build. Setting this
992 # variable explicitly to 1 will cause your build to fail if the
993 # internal file is missing.
995 # The variable is documented here, but not handled in this file;
996 # see //google_apis/determine_use_official_keys.gypi for the
999 # Set the variable to 0 to not use the internal file, even when
1000 # it exists in your checkout.
1002 # Leave it unset in your include.gypi to have the variable
1003 # implicitly set to 1 if you have
1004 # src/google_apis/internal/google_chrome_api_keys.h in your
1005 # checkout, and implicitly set to 0 if not.
1007 # Note that official builds always behave as if the variable
1008 # was explicitly set to 1, i.e. they always use official keys,
1009 # and will fail to build if the internal file is missing.
1011 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1012 # include.gypi or by other means. Due to subtleties of GYP, this
1013 # is not the same as leaving the variable unset, even though its
1015 # //google_apis/determine_use_official_keys.gypi is 2.
1017 # Set these to bake the specified API keys and OAuth client
1018 # IDs/secrets into your build.
1020 # If you create a build without values baked in, you can instead
1021 # set environment variables to provide the keys at runtime (see
1022 # src/google_apis/google_api_keys.h for details). Features that
1023 # require server-side APIs may fail to work if no keys are
1026 # Note that if you are building an official build or if
1027 # use_official_google_api_keys has been set to 1 (explicitly or
1028 # implicitly), these values will be ignored and the official
1029 # keys will be used instead.
1030 'google_api_key%': '',
1031 'google_default_client_id%': '',
1032 'google_default_client_secret%': '',
1033 # Native Client is enabled by default.
1034 'disable_nacl%': '0',
1037 # Copy conditionally-set variables out one scope.
1038 'branding%': '<(branding)',
1039 'buildtype%': '<(buildtype)',
1040 'target_arch%': '<(target_arch)',
1041 'target_subarch%': '<(target_subarch)',
1042 'host_arch%': '<(host_arch)',
1043 'toolkit_views%': '<(toolkit_views)',
1044 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1045 'use_aura%': '<(use_aura)',
1046 'use_ash%': '<(use_ash)',
1047 'use_cras%': '<(use_cras)',
1048 'use_openssl%': '<(use_openssl)',
1049 'use_openssl_certs%': '<(use_openssl_certs)',
1050 'use_nss%': '<(use_nss)',
1051 'use_udev%': '<(use_udev)',
1052 'os_bsd%': '<(os_bsd)',
1053 'os_posix%': '<(os_posix)',
1054 'use_dbus%': '<(use_dbus)',
1055 'use_glib%': '<(use_glib)',
1056 'use_pango%': '<(use_pango)',
1057 'use_cairo%': '<(use_cairo)',
1058 'use_ozone%': '<(use_ozone)',
1059 'use_ozone_evdev%': '<(use_ozone_evdev)',
1060 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1061 'desktop_linux%': '<(desktop_linux)',
1062 'use_x11%': '<(use_x11)',
1063 'use_gnome_keyring%': '<(use_gnome_keyring)',
1064 'linux_fpic%': '<(linux_fpic)',
1065 'chromeos%': '<(chromeos)',
1066 'chromecast%': '<(chromecast)',
1067 'enable_viewport%': '<(enable_viewport)',
1068 'enable_hidpi%': '<(enable_hidpi)',
1069 'use_xi2_mt%':'<(use_xi2_mt)',
1070 'image_loader_extension%': '<(image_loader_extension)',
1071 'fastbuild%': '<(fastbuild)',
1072 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1073 'win_z7%': '<(win_z7)',
1074 'dcheck_always_on%': '<(dcheck_always_on)',
1075 'tracing_like_official_build%': '<(tracing_like_official_build)',
1076 'arm_version%': '<(arm_version)',
1077 'arm_neon%': '<(arm_neon)',
1078 'arm_neon_optional%': '<(arm_neon_optional)',
1079 'sysroot%': '<(sysroot)',
1080 'chroot_cmd%': '<(chroot_cmd)',
1081 'system_libdir%': '<(system_libdir)',
1082 'component%': '<(component)',
1083 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1084 'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
1085 'use_third_party_translations%': '<(use_third_party_translations)',
1086 'remoting%': '<(remoting)',
1087 'enable_one_click_signin%': '<(enable_one_click_signin)',
1088 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1089 'enable_webrtc%': '<(enable_webrtc)',
1090 'chromium_win_pch%': '<(chromium_win_pch)',
1091 'configuration_policy%': '<(configuration_policy)',
1092 'safe_browsing%': '<(safe_browsing)',
1093 'enable_web_speech%': '<(enable_web_speech)',
1094 'notifications%': '<(notifications)',
1095 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1096 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1098 'asan_coverage%': '<(asan_coverage)',
1099 'use_sanitizer_options%': '<(use_sanitizer_options)',
1100 'syzyasan%': '<(syzyasan)',
1101 'syzygy_optimize%': '<(syzygy_optimize)',
1104 'msan_blacklist%': '<(msan_blacklist)',
1105 'msan_track_origins%': '<(msan_track_origins)',
1107 'tsan_blacklist%': '<(tsan_blacklist)',
1108 'ubsan%': '<(ubsan)',
1109 'ubsan_vptr%': '<(ubsan_vptr)',
1110 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1111 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1112 'use_custom_libcxx%': '<(use_custom_libcxx)',
1113 'use_system_libcxx%': '<(use_system_libcxx)',
1114 'clang_type_profiler%': '<(clang_type_profiler)',
1115 'order_profiling%': '<(order_profiling)',
1116 'order_text_section%': '<(order_text_section)',
1117 'enable_extensions%': '<(enable_extensions)',
1118 'enable_plugin_installation%': '<(enable_plugin_installation)',
1119 'enable_plugins%': '<(enable_plugins)',
1120 'enable_session_service%': '<(enable_session_service)',
1121 'enable_themes%': '<(enable_themes)',
1122 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1123 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1124 'enable_background%': '<(enable_background)',
1125 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1126 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1127 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1128 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1129 'use_canvas_skia%': '<(use_canvas_skia)',
1130 'test_isolation_mode%': '<(test_isolation_mode)',
1131 'test_isolation_outdir%': '<(test_isolation_outdir)',
1132 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1133 'enable_printing%': '<(enable_printing)',
1134 'win_pdf_metafile_for_printing%': '<(win_pdf_metafile_for_printing)',
1135 'enable_spellcheck%': '<(enable_spellcheck)',
1136 'enable_google_now%': '<(enable_google_now)',
1137 'cld_version%': '<(cld_version)',
1138 'cld2_table_size%': '<(cld2_table_size)',
1139 'cld2_data_source%': '<(cld2_data_source)',
1140 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1141 'disable_file_support%': '<(disable_file_support)',
1142 'disable_ftp_support%': '<(disable_ftp_support)',
1143 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1144 'enable_task_manager%': '<(enable_task_manager)',
1145 'sas_dll_path%': '<(sas_dll_path)',
1146 'wix_path%': '<(wix_path)',
1147 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1148 'use_system_libjpeg%': '<(use_system_libjpeg)',
1149 'android_webview_build%': '<(android_webview_build)',
1150 'android_webview_telemetry_build%': '<(android_webview_telemetry_build)',
1151 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1152 'gyp_managed_install%': 0,
1153 'create_standalone_apk%': 1,
1154 'enable_app_list%': '<(enable_app_list)',
1155 'use_default_render_theme%': '<(use_default_render_theme)',
1156 'enable_settings_app%': '<(enable_settings_app)',
1157 'google_api_key%': '<(google_api_key)',
1158 'google_default_client_id%': '<(google_default_client_id)',
1159 'google_default_client_secret%': '<(google_default_client_secret)',
1160 'enable_managed_users%': '<(enable_managed_users)',
1161 'native_discardable_memory%': '<(native_discardable_memory)',
1162 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1163 'data_reduction_fallback_host%': '<(data_reduction_fallback_host)',
1164 'data_reduction_dev_host%': '<(data_reduction_dev_host)',
1165 'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)',
1166 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1167 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1168 'data_reduction_proxy_probe_url%': '<(data_reduction_proxy_probe_url)',
1169 'data_reduction_proxy_warmup_url%': '<(data_reduction_proxy_warmup_url)',
1170 'data_reduction_proxy_ssl_origin%' : '<(data_reduction_proxy_ssl_origin)',
1171 'data_reduction_proxy_alt_origin%' : '<(data_reduction_proxy_alt_origin)',
1172 'data_reduction_proxy_alt_fallback_origin%' : '<(data_reduction_proxy_alt_fallback_origin)',
1173 'enable_mdns%' : '<(enable_mdns)',
1174 'enable_service_discovery%' : '<(enable_service_discovery)',
1175 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1176 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1177 'v8_optimized_debug%': '<(v8_optimized_debug)',
1178 'proprietary_codecs%': '<(proprietary_codecs)',
1179 'use_goma%': '<(use_goma)',
1180 'gomadir%': '<(gomadir)',
1181 'video_hole%': '<(video_hole)',
1183 # Use system protobuf instead of bundled one.
1184 'use_system_protobuf%': 0,
1186 # Use system yasm instead of bundled one.
1187 'use_system_yasm%': 0,
1189 # Use system ICU instead of bundled one.
1190 'use_system_icu%' : 0,
1192 # Default to enabled PIE; this is important for ASLR but we may need to be
1193 # able to turn it off for various reasons.
1194 'linux_disable_pie%': 0,
1196 # The release channel that this build targets. This is used to restrict
1197 # channel-specific build options, like which installer packages to create.
1198 # The default is 'all', which does no channel-specific filtering.
1201 # Override chromium_mac_pch and set it to 0 to suppress the use of
1202 # precompiled headers on the Mac. Prefix header injection may still be
1203 # used, but prefix headers will not be precompiled. This is useful when
1204 # using distcc to distribute a build to compile slaves that don't
1205 # share the same compiler executable as the system driving the compilation,
1206 # because precompiled headers rely on pointers into a specific compiler
1207 # executable's image. Setting this to 0 is needed to use an experimental
1208 # Linux-Mac cross compiler distcc farm.
1209 'chromium_mac_pch%': 1,
1211 # The default value for mac_strip in target_defaults. This cannot be
1212 # set there, per the comment about variable% in a target_defaults.
1213 'mac_strip_release%': 0,
1215 # Set to 1 to enable java code coverage. Instruments classes during build
1216 # to produce .ec files during runtime.
1217 'emma_coverage%': 0,
1219 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1220 # separated with whitespace and/or comma. Only has effect if
1221 # 'emma_coverage=1'.
1224 # Set to 1 to enable running Android lint on java/class files.
1227 # Although base/allocator lets you select a heap library via an
1228 # environment variable, the libcmt shim it uses sometimes gets in
1229 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1230 # 'win_use_allocator_shim': 0,
1231 # 'win_release_RuntimeLibrary': 2
1232 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1233 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1235 # TODO(bradnelson): eliminate this when possible.
1236 # To allow local gyp files to prevent release.vsprops from being included.
1237 # Yes(1) means include release.vsprops.
1238 # Once all vsprops settings are migrated into gyp, this can go away.
1239 'msvs_use_common_release%': 1,
1241 # TODO(bradnelson): eliminate this when possible.
1242 # To allow local gyp files to override additional linker options for msvs.
1243 # Yes(1) means set use the common linker options.
1244 'msvs_use_common_linker_extras%': 1,
1246 # TODO(sgk): eliminate this if possible.
1247 # It would be nicer to support this via a setting in 'target_defaults'
1248 # in chrome/app/locales/locales.gypi overriding the setting in the
1249 # 'Debug' configuration in the 'target_defaults' dict below,
1250 # but that doesn't work as we'd like.
1251 'msvs_debug_link_incremental%': '2',
1253 # Needed for some of the largest modules.
1254 'msvs_debug_link_nonincremental%': '1',
1256 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1257 # to get incremental linking to be faster in debug builds.
1258 'incremental_chrome_dll%': '0',
1260 # Experimental setting to break chrome.dll into multiple pieces based on
1262 'chrome_multiple_dll%': '0',
1264 # Experimental setting to optimize Chrome's DLLs with PGO.
1265 'chrome_pgo_phase%': '0',
1268 'clang%': '<(clang)',
1269 'host_clang%': '<(host_clang)',
1270 'make_clang_dir%': '<(make_clang_dir)',
1272 # Control which version of clang to use when building for iOS. If set to
1273 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1274 # the version of clang that ships with the Chromium source. This variable
1275 # is automatically set to '1' when using the Xcode generator.
1278 # These two variables can be set in GYP_DEFINES while running
1279 # |gclient runhooks| to let clang run a plugin in every compilation.
1280 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1282 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1285 'clang_add_plugin%': '',
1287 # Tell ld64 to write map files describing binary layout. Useful
1288 # for looking at what contributes to binary size, e.g. with
1289 # https://github.com/nico/bloat
1290 'mac_write_linker_maps%': 0,
1292 # The default type of gtest.
1293 'gtest_target_type%': 'executable',
1295 # Enable sampling based profiler.
1296 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1298 # Profile without optimizing out stack frames when profiling==1.
1299 'profiling_full_stack_frames%': '0',
1301 # And if we want to dump symbols for Breakpad-enabled builds.
1302 'linux_dump_symbols%': 0,
1303 # And if we want to strip the binary after dumping symbols.
1304 'linux_strip_binary%': 0,
1305 # If we want stack unwind support for backtrace().
1306 'debug_unwind_tables%': 1,
1307 'release_unwind_tables%': 1,
1309 # Override where to find binutils
1310 'binutils_version%': 0,
1311 'binutils_dir%': '',
1314 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1315 'use_allocator%': 'tcmalloc',
1317 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1318 'linux_link_gnome_keyring%': 0,
1319 # Set to 1 to link against gsettings APIs instead of using dlopen().
1320 'linux_link_gsettings%': 0,
1322 # Default arch variant for MIPS.
1323 'mips_arch_variant%': 'mips32r1',
1325 # Enable use of OpenMAX DL FFT routines.
1326 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1328 # Enable new NPDevice API.
1329 'enable_new_npdevice_api%': 0,
1331 # Enable EGLImage support in OpenMAX
1332 'enable_eglimage%': 1,
1334 # .gyp files or targets should set chromium_code to 1 if they build
1335 # Chromium-specific code, as opposed to external code. This variable is
1336 # used to control such things as the set of warnings to enable, and
1337 # whether warnings are treated as errors.
1338 'chromium_code%': 0,
1340 # Disable fatal linker warnings, similarly to how we make it possible
1341 # to disable -Werror (e.g. for different toolchain versions).
1342 'disable_fatal_linker_warnings%': 0,
1344 'release_valgrind_build%': 0,
1346 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1347 'enable_wexit_time_destructors%': 0,
1349 # Build libpeerconnection as a static library by default.
1350 'libpeer_target_type%': 'static_library',
1352 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1353 'internal_gles2_conform_tests%': 0,
1355 # Set to 1 to compile the filter fuzzer.
1356 'internal_filter_fuzzer%': 0,
1358 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1359 # so Cocoa is happy (http://crbug.com/20441).
1361 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1362 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1363 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1364 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1365 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1366 'vi', 'zh-CN', 'zh-TW',
1369 # Pseudo locales are special locales which are used for testing and
1370 # debugging. They don't get copied to the final app. For more info,
1371 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1378 # If debug_devtools is set to 1, JavaScript files for DevTools are
1379 # stored as is and loaded from disk. Otherwise, a concatenated file
1380 # is stored in resources.pak. It is still possible to load JS files
1381 # from disk by passing --debug-devtools cmdline switch.
1382 'debug_devtools%': 0,
1384 # The Java Bridge is not compiled in by default.
1387 # Code signing for iOS binaries. The bots need to be able to disable this.
1388 'chromium_ios_signing%': 1,
1390 # This flag is only used when disable_nacl==0 and disables all those
1391 # subcomponents which would require the installation of a native_client
1392 # untrusted toolchain.
1393 'disable_nacl_untrusted%': 0,
1395 # Disable Dart by default.
1398 # Copy out the setting of disable_nacl.
1399 'disable_nacl%': '<(disable_nacl)',
1401 # Portable Native Client is enabled by default.
1402 'disable_pnacl%': 0,
1404 # Whether to build full debug version for Debug configuration on Android.
1405 # Compared to full debug version, the default Debug configuration on Android
1406 # has no full v8 debug, has size optimization and linker gc section, so that
1407 # we can build a debug version with acceptable size and performance.
1408 'android_full_debug%': 0,
1410 # Sets the default version name and code for Android app, by default we
1411 # do a developer build.
1412 'android_app_version_name%': 'Developer Build',
1413 'android_app_version_code%': 0,
1415 # Contains data about the attached devices for gyp_managed_install.
1416 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1418 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1419 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1421 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1422 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1424 # Whether we are using the rlz library or not. Platforms like Android send
1425 # rlz codes for searches but do not use the library.
1428 # Turns on the i18n support in V8.
1429 'v8_enable_i18n_support': 1,
1431 # Compile d8 for the host toolset.
1432 'v8_toolset_for_d8': 'host',
1434 # Use the chromium skia by default.
1435 'use_system_skia%': '0',
1437 # Use brlapi from brltty for braille display support.
1440 # Relative path to icu.gyp from this file.
1441 'icu_gyp_path': '../third_party/icu/icu.gyp',
1443 # IPC fuzzer is disabled by default.
1444 'enable_ipc_fuzzer%': 0,
1447 # Force disable libstdc++ debug mode.
1448 'disable_glibcxx_debug%': 0,
1450 # Set to 1 to compile with MSE support for MPEG2 TS
1451 'enable_mpeg2ts_stream_parser%': 0,
1453 # Support ChromeOS touchpad gestures with ozone.
1454 'use_evdev_gestures%': 0,
1456 # Default ozone platform (if no --ozone-platform flag).
1457 'ozone_platform%': "",
1459 # Ozone platforms to include in the build.
1460 'ozone_platform_caca%': 0,
1461 'ozone_platform_dri%': 0,
1462 'ozone_platform_egltest%': 0,
1463 'ozone_platform_gbm%': 0,
1464 'ozone_platform_ozonex%': 0,
1465 'ozone_platform_test%': 0,
1467 # Chrome OS: whether to build ChromeVox from sources in the Chromium
1468 # repository rather than using precompiled JavaScript in
1469 # chrome/third_party/chromevox. This is still experimental.
1470 'use_migrated_chromevox%': 1,
1472 # Chrome OS: whether to also build the upcoming version of
1473 # ChromeVox, which can then be enabled via a command-line switch.
1474 'use_chromevox_next%': 0,
1477 # The version of clang shipped upstream does not find C++ headers when
1478 # using -stdlib=libc++ so we instead need to use the version of clang
1479 # coming with Xcode.
1480 ['OS=="ios" and use_system_libcxx==1', {
1483 # Enable the Syzygy optimization step for the official builds.
1484 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1485 'syzygy_optimize%': 1,
1487 'syzygy_optimize%': 0,
1489 # Get binutils version so we can enable debug fission if we can.
1490 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1492 # compiler_version doesn't work with clang
1493 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1494 # compiler_version works with clang.
1495 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1496 # that it takes effect here.
1497 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1498 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1500 # On Android we know the binutils version in the toolchain.
1502 'binutils_version%': 222,
1504 ['host_arch=="x64"', {
1505 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1507 ['host_arch=="ia32"', {
1508 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1510 # Our version of binutils in third_party/binutils
1511 ['linux_use_bundled_binutils==1', {
1512 'binutils_version%': 224,
1516 'binutils_version%': 0,
1518 # The version of GCC in use, set later in platforms that use GCC and have
1519 # not explicitly chosen to build with clang. Currently, this means all
1520 # platforms except Windows, Mac and iOS.
1521 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1522 # it takes effect here.
1523 ['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', {
1526 # We directly set the gcc versions since we know what we use.
1529 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1531 ['android_webview_build==1', {
1532 # Android WebView uses a hermetic toolchain even for host, so set it
1535 ['host_os=="mac"', {
1536 'host_gcc_version%': 42,
1538 'host_gcc_version%': 46,
1541 }, { # android_webview_build!=1
1542 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1546 'host_gcc_version%': 0,
1549 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1550 'windows_sdk_path%': '<(windows_sdk_default_path)',
1552 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
1554 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1555 'directx_sdk_path%': '<(directx_sdk_default_path)',
1557 'directx_sdk_path%': '$(DXSDK_DIR)',
1560 'windows_driver_kit_path%': '$(WDK_DIR)',
1562 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1564 ['target_arch=="mipsel"', {
1567 'nacl_untrusted_build%': 0,
1568 'use_allocator%': 'none',
1570 ['OS=="linux" and target_arch=="mipsel"', {
1571 'sysroot%': '<(sysroot)',
1574 # All Chrome builds have breakpad symbols, but only process the
1575 # symbols from official builds.
1576 ['(branding=="Chrome" and buildtype=="Official")', {
1577 'linux_dump_symbols%': 1,
1579 # Omit unwind support in official release builds to save space. We
1580 # can use breakpad for these builds.
1581 'release_unwind_tables%': 0,
1584 # For official builds, use a 64-bit linker to avoid running out
1585 # of address space. The buildbots should have a 64-bit kernel
1586 # and a 64-bit libc installed.
1587 ['host_arch=="ia32" and target_arch=="ia32"', {
1588 'linux_use_bundled_gold%': '1',
1589 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1594 }], # os_posix==1 and OS!="mac" and OS!="ios"
1597 'enable_background%': 0,
1598 'icu_use_data_file_flag%': 1,
1599 'enable_web_speech%': 0,
1600 'use_system_libxml%': 1,
1601 'use_system_sqlite%': 1,
1603 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1604 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1605 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1606 'uk', 'vi', 'zh-CN', 'zh-TW',
1609 # The Mac SDK is set for iOS builds and passed through to Mac
1610 # sub-builds. This allows the Mac sub-build SDK in an iOS build to be
1611 # overridden from the command line the same way it is for a Mac build.
1612 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py 10.6)',
1614 # iOS SDK and deployment target support. The |ios_sdk| value is left
1615 # blank so that when it is set in the project files it will be the
1616 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1617 # causes Xcode to spit out a warning for every single project file for
1618 # not using the "current" SDK.
1620 'ios_sdk_path%': '',
1621 'ios_deployment_target%': '7.0',
1624 # ios_product_name is set to the name of the .app bundle as it should
1626 ['branding=="Chrome"', {
1627 'ios_product_name%': 'Chrome',
1628 }, { # else: branding!="Chrome"
1629 'ios_product_name%': 'Chromium',
1631 ['branding=="Chrome" and buildtype=="Official"', {
1633 }, { # else: branding!="Chrome" or buildtype!="Official"
1639 # Location of Android NDK.
1642 # Unfortunately we have to use absolute paths to the SDK/NDK because
1643 # they're passed to ant which uses a different relative path from
1645 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1646 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1647 'android_host_arch%': '<!(uname -m)',
1648 # Android API-level of the SDK used for compilation.
1649 'android_sdk_version%': '20',
1650 'android_sdk_build_tools_version%': '20.0.0',
1651 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1653 # Copy conditionally-set variables out one scope.
1654 'android_ndk_root%': '<(android_ndk_root)',
1655 'android_sdk_root%': '<(android_sdk_root)',
1656 'android_sdk_version%': '<(android_sdk_version)',
1657 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1658 'host_os%': '<(host_os)',
1660 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1661 # Android SDK build tools (e.g. dx, aapt, aidl)
1662 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1664 # Android API level 14 is ICS (Android 4.0) which is the minimum
1665 # platform requirement for Chrome on Android, we use it for native
1668 ['target_arch == "ia32"', {
1669 'android_app_abi%': 'x86',
1670 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1671 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1672 'android_ndk_lib_dir%': 'usr/lib',
1673 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1675 ['target_arch == "x64"', {
1676 'android_app_abi%': 'x86_64',
1677 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1678 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-x86_64',
1679 'android_ndk_lib_dir%': 'usr/lib64',
1680 'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1682 ['target_arch=="arm"', {
1685 'android_app_abi%': 'armeabi',
1687 'android_app_abi%': 'armeabi-v7a',
1690 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1691 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1692 'android_ndk_lib_dir%': 'usr/lib',
1693 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1695 ['target_arch == "arm64"', {
1696 'android_app_abi%': 'arm64-v8a',
1697 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1698 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-L/arch-arm64',
1699 'android_ndk_lib_dir%': 'usr/lib',
1700 'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1702 ['target_arch == "mipsel"', {
1703 'android_app_abi%': 'mips',
1704 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1705 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1706 'android_ndk_lib_dir%': 'usr/lib',
1707 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.8/prebuilt/<(host_os)-<(android_host_arch)/bin',
1711 # Copy conditionally-set variables out one scope.
1712 'android_app_abi%': '<(android_app_abi)',
1713 'android_gdbserver%': '<(android_gdbserver)',
1714 'android_ndk_root%': '<(android_ndk_root)',
1715 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1716 'android_sdk_root%': '<(android_sdk_root)',
1717 'android_sdk_version%': '<(android_sdk_version)',
1718 'android_toolchain%': '<(android_toolchain)',
1720 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1721 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1722 'android_sdk_tools%': '<(android_sdk_tools)',
1723 'android_sdk%': '<(android_sdk)',
1724 'android_sdk_jar%': '<(android_sdk)/android.jar',
1726 'android_stlport_root': '<(android_stlport_root)',
1727 'android_stlport_include': '<(android_stlport_root)/stlport',
1728 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1729 'host_os%': '<(host_os)',
1731 # Location of the "objcopy" binary, used by both gyp and scripts.
1732 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1734 # Location of the "strip" binary, used by both gyp and scripts.
1735 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1737 # Location of the "readelf" binary.
1738 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1740 # Determines whether we should optimize JNI generation at the cost of
1741 # breaking assumptions in the build system that when inputs have changed
1742 # the outputs should always change as well. This is meant purely for
1743 # developer builds, to avoid spurious re-linking of native files.
1744 'optimize_jni_generation%': 0,
1746 # Always uses openssl.
1748 'use_openssl_certs%': 1,
1750 'proprietary_codecs%': '<(proprietary_codecs)',
1751 'safe_browsing%': 1,
1752 'enable_web_speech%': 0,
1754 'build_ffmpegsumo%': 0,
1755 'use_allocator%': 'none',
1757 # Disable Native Client.
1760 # Android does not support background apps.
1761 'enable_background%': 0,
1763 # Sessions are store separately in the Java side.
1764 'enable_session_service%': 0,
1768 'gtest_target_type%': 'shared_library',
1770 # Uses system APIs for decoding audio and video.
1771 'use_libffmpeg%': '0',
1773 # When building as part of the Android system, use system libraries
1774 # where possible to reduce ROM size.
1775 # TODO(steveblock): Investigate using the system version of sqlite.
1776 'use_system_sqlite%': 0, # '<(android_webview_build)',
1777 'use_system_expat%': '<(android_webview_build)',
1778 'use_system_icu%': '<(android_webview_build)',
1779 'use_system_stlport%': '<(android_webview_build)',
1781 # Copy it out one scope.
1782 'android_webview_build%': '<(android_webview_build)',
1784 # Default android linker script for shared library exports.
1785 'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_exports.lst',
1788 'use_system_fontconfig%': 0,
1790 'use_system_fontconfig%': 1,
1793 'enable_mpeg2ts_stream_parser%': 1,
1794 'ffmpeg_branding%': 'Chrome',
1795 'ozone_platform_ozonex%': 1,
1797 ['target_arch=="arm"', {
1799 'arm_tune%': 'cortex-a9',
1805 ['android_webview_build==1 or android_webview_telemetry_build==1', {
1806 # When building the WebView in the Android tree, jarjar will remap all
1807 # the class names, so the JNI generator needs to know this.
1808 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1810 ['OS=="linux" and target_arch!="mipsel"', {
1811 # TODO(thakis): This is here to measure perf for a while.
1816 # All Chrome builds have breakpad symbols, but only process the
1817 # symbols from official builds.
1818 ['(branding=="Chrome" and buildtype=="Official")', {
1819 'mac_strip_release%': 1,
1823 ['OS=="mac" or OS=="ios"', {
1827 # Mac OS X SDK and deployment target support. The SDK identifies
1828 # the version of the system headers that will be used, and
1829 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1830 # macro. "Maximum allowed" refers to the operating system version
1831 # whose APIs are available in the headers. The deployment target
1832 # identifies the minimum system version that the built products are
1833 # expected to function on. It corresponds to the
1834 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1835 # macros are available, #include <AvailabilityMacros.h>. Additional
1836 # documentation on these macros is available at
1837 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1838 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1839 # deployment target to 10.6. Other projects, such as O3D, may
1840 # override these defaults.
1842 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1843 # about that is at least the specified version. In official builds,
1844 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1845 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1846 # path to the SDK; when set to a non-empty string, SDK detection
1847 # based on mac_sdk_min will be bypassed entirely.
1848 'mac_sdk_min%': '10.6',
1849 'mac_sdk_path%': '',
1851 'mac_deployment_target%': '10.6',
1854 'mac_sdk_min': '<(mac_sdk_min)',
1855 'mac_sdk_path': '<(mac_sdk_path)',
1856 'mac_deployment_target': '<(mac_deployment_target)',
1858 # Compile in Breakpad support by default so that it can be
1859 # tested, even if it is not enabled by default at runtime.
1860 'mac_breakpad_compiled_in%': 1,
1862 # mac_product_name is set to the name of the .app bundle as it should
1863 # appear on disk. This duplicates data from
1864 # chrome/app/theme/chromium/BRANDING and
1865 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1866 # these names into the build system.
1867 ['branding=="Chrome"', {
1868 'mac_product_name%': 'Google Chrome',
1869 }, { # else: branding!="Chrome"
1870 'mac_product_name%': 'Chromium',
1873 ['branding=="Chrome" and buildtype=="Official"', {
1874 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1875 # Enable uploading crash dumps.
1876 'mac_breakpad_uploads%': 1,
1877 # Enable dumping symbols at build time for use by Mac Breakpad.
1879 # Enable Keystone auto-update support.
1881 }, { # else: branding!="Chrome" or buildtype!="Official"
1882 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1883 'mac_breakpad_uploads%': 0,
1888 }], # OS=="mac" or OS=="ios"
1891 # This is the architecture convention used in WinSDK paths.
1892 ['target_arch=="ia32"', {
1893 'winsdk_arch%': 'x86',
1895 'winsdk_arch%': '<(target_arch)',
1897 ['component=="shared_library"', {
1898 'win_use_allocator_shim%': 0,
1900 # Turn on multiple dll by default on Windows when in static_library.
1901 'chrome_multiple_dll%': 1,
1904 'win_use_allocator_shim%': 0,
1906 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1907 # Only enabled by default for ninja because it's buggy in VS.
1908 # Not enabled for component=static_library because some targets
1909 # are too large and the toolchain fails due to the size of the
1911 'incremental_chrome_dll%': 1,
1913 # Don't do incremental linking for large modules on 32-bit or when
1914 # component=static_library as the toolchain fails due to the size of
1916 ['MSVS_OS_BITS==32 or component=="static_library"', {
1917 'msvs_large_module_debug_link_mode%': '1', # No
1919 'msvs_large_module_debug_link_mode%': '2', # Yes
1921 ['MSVS_VERSION=="2013e"', {
1929 'nacl_win64_defines': [
1930 # This flag is used to minimize dependencies when building
1931 # Native Client loader for 64-bit Windows.
1936 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1942 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1943 'enable_pepper_cdms%': 1,
1945 'enable_pepper_cdms%': 0,
1949 'enable_browser_cdms%': 1,
1951 'enable_browser_cdms%': 0,
1954 # Native Client glibc toolchain is enabled
1955 # by default except on arm and mips.
1956 ['target_arch=="arm" or target_arch=="mipsel"', {
1957 'disable_glibc%': 1,
1959 'disable_glibc%': 0,
1962 # Set the relative path from this file to the GYP file of the JPEG
1963 # library used by Chromium.
1964 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1965 # Configuration for using the system libjeg is here.
1966 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1968 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1971 # Options controlling the use of GConf (the classic GNOME configuration
1972 # system) and GIO, which contains GSettings (the new GNOME config system).
1973 ['chromeos==1 or embedded==1', {
1981 # Set up -D and -E flags passed into grit.
1982 ['branding=="Chrome"', {
1983 # TODO(mmoss) The .grd files look for _google_chrome, but for
1984 # consistency they should look for google_chrome_build like C++.
1985 'grit_defines': ['-D', '_google_chrome',
1986 '-E', 'CHROMIUM_BUILD=google_chrome'],
1988 'grit_defines': ['-D', '_chromium',
1989 '-E', 'CHROMIUM_BUILD=chromium'],
1992 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
1994 ['desktop_linux==1', {
1995 'grit_defines': ['-D', 'desktop_linux'],
1997 ['toolkit_views==1', {
1998 'grit_defines': ['-D', 'toolkit_views'],
2001 'grit_defines': ['-D', 'use_aura'],
2004 'grit_defines': ['-D', 'use_ash'],
2007 'grit_defines': ['-D', 'use_nss'],
2010 'grit_defines': ['-D', 'use_ozone'],
2012 ['image_loader_extension==1', {
2013 'grit_defines': ['-D', 'image_loader_extension'],
2016 'grit_defines': ['-D', 'remoting'],
2018 ['use_titlecase_in_grd_files==1', {
2019 'grit_defines': ['-D', 'use_titlecase'],
2021 ['use_third_party_translations==1', {
2022 'grit_defines': ['-D', 'use_third_party_translations'],
2024 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2025 'ka', 'ku', 'kw', 'ms', 'ug'
2029 'grit_defines': ['-t', 'android',
2030 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true'],
2032 ['OS=="mac" or OS=="ios"', {
2033 'grit_defines': ['-D', 'scale_factors=2x'],
2038 # iOS uses a whitelist to filter resources.
2039 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
2042 # Enable host builds when generating with ninja-ios.
2044 ['"<(GENERATOR)"=="ninja"', {
2048 # TODO(sdefresne): Remove the target_subarch check once Apple has
2049 # upstreamed the support for "arm64". http://crbug.com/341453
2050 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
2055 ['enable_extensions==1', {
2056 'grit_defines': ['-D', 'enable_extensions'],
2058 ['enable_plugins!=0', {
2059 'grit_defines': ['-D', 'enable_plugins'],
2061 ['enable_printing!=0', {
2062 'grit_defines': ['-D', 'enable_printing'],
2064 ['enable_printing==1', {
2065 'grit_defines': ['-D', 'enable_full_printing'],
2067 ['enable_themes==1', {
2068 'grit_defines': ['-D', 'enable_themes'],
2070 ['enable_app_list==1', {
2071 'grit_defines': ['-D', 'enable_app_list'],
2073 ['enable_settings_app==1', {
2074 'grit_defines': ['-D', 'enable_settings_app'],
2076 ['enable_google_now==1', {
2077 'grit_defines': ['-D', 'enable_google_now'],
2079 ['use_concatenated_impulse_responses==1', {
2080 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2082 ['enable_webrtc==1', {
2083 'grit_defines': ['-D', 'enable_webrtc'],
2085 ['enable_hangout_services_extension==1', {
2086 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2088 ['enable_task_manager==1', {
2089 'grit_defines': ['-D', 'enable_task_manager'],
2091 ['notifications==1', {
2092 'grit_defines': ['-D', 'enable_notifications'],
2094 ['enable_wifi_bootstrapping==1', {
2095 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2097 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2098 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2100 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2101 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2103 ['enable_mdns==1 or OS=="mac"', {
2104 'grit_defines': ['-D', 'enable_service_discovery'],
2105 'enable_service_discovery%': 1
2107 ['clang_use_chrome_plugins==1 and OS!="win"', {
2108 'clang_chrome_plugins_flags': [
2109 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
2112 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2114 'use_allocator%': 'none',
2116 ['asan==1 and OS=="linux" and chromeos==0', {
2117 'use_custom_libcxx%': 1,
2125 ['asan==1 and OS=="mac"', {
2126 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
2127 # runtime is fully adopted. See http://crbug.com/242503.
2128 'mac_strip_release': 0,
2131 'use_custom_libcxx%': 1,
2134 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2135 # libstdc++. This is required to avoid false positive reports whenever
2136 # the C++ standard library is used.
2137 'use_custom_libcxx%': 1,
2138 # Running the V8-generated code on an ARM simulator is a powerful hack
2139 # that allows the tool to see the memory accesses from JITted code.
2140 # Without this flag, JS code causes false positive reports from MSan.
2141 'v8_target_arch': 'arm64',
2144 ['OS=="linux" and clang_type_profiler==1', {
2146 'clang_use_chrome_plugins%': 0,
2148 ['host_arch=="x64"', {
2149 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2151 ['host_arch=="ia32"', {
2152 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2153 # Clang in this directory at your own risk if needed for some
2154 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2155 # usage). Any failure by this compiler should not close the tree.
2156 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2162 # The Clang plugins don't currently work on Windows.
2163 # TODO(hans): One day, this will work. (crbug.com/82385)
2164 'clang_use_chrome_plugins%': 0,
2167 # On valgrind bots, override the optimizer settings so we don't inline too
2168 # much and make the stacks harder to figure out.
2170 # TODO(rnk): Kill off variables that no one else uses and just implement
2171 # them under a build_for_tool== condition.
2172 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2174 'mac_debug_optimization': '1',
2175 'mac_release_optimization': '1',
2176 'release_optimize': '1',
2177 'no_gc_sections': 1,
2178 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2179 '-fno-builtin -fno-optimize-sibling-calls',
2180 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2181 '-fno-builtin -fno-optimize-sibling-calls',
2183 # MSVS flags for TSan on Pin and Windows.
2184 'win_debug_RuntimeChecks': '0',
2185 'win_debug_disable_iterator_debugging': '1',
2186 'win_debug_Optimization': '1',
2187 'win_debug_InlineFunctionExpansion': '0',
2188 'win_release_InlineFunctionExpansion': '0',
2189 'win_release_OmitFramePointers': '0',
2191 'use_allocator': 'tcmalloc',
2192 'release_valgrind_build': 1,
2194 'component': 'static_library',
2195 'use_system_zlib': 0,
2198 # Build tweaks for DrMemory.
2199 # TODO(rnk): Combine with tsan config to share the builder.
2200 # http://crbug.com/108155
2201 ['build_for_tool=="drmemory"', {
2202 # These runtime checks force initialization of stack vars which blocks
2203 # DrMemory's uninit detection.
2204 'win_debug_RuntimeChecks': '0',
2205 # Iterator debugging is slow.
2206 'win_debug_disable_iterator_debugging': '1',
2207 # Try to disable optimizations that mess up stacks in a release build.
2208 # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054)
2209 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2210 # compiler bug, so we use /Ob1 instead.
2211 'win_release_InlineFunctionExpansion': '1',
2212 'win_release_OmitFramePointers': '0',
2213 # Ditto for debug, to support bumping win_debug_Optimization.
2214 'win_debug_InlineFunctionExpansion': 0,
2215 'win_debug_OmitFramePointers': 0,
2216 # Keep the code under #ifndef NVALGRIND.
2217 'release_valgrind_build': 1,
2220 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2221 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2225 # Set default compiler flags depending on ARM version.
2226 ['arm_version==6 and android_webview_build==0', {
2227 'arm_arch%': 'armv6',
2230 'arm_float_abi%': 'softfp',
2233 ['arm_version==7 and android_webview_build==0', {
2234 'arm_arch%': 'armv7-a',
2235 'arm_tune%': 'generic-armv7-a',
2240 'arm_fpu%': 'vfpv3-d16',
2243 # Change the default to hard once the armhf transition is complete.
2244 'arm_float_abi%': 'softfp',
2248 ['android_webview_build==1', {
2249 # The WebView build gets its cpu-specific flags from the Android build system.
2253 'arm_float_abi%': '',
2257 # Enable brlapi by default for chromeos.
2262 ['use_ozone==1 and ozone_auto_platforms==1', {
2263 # Use test as the default platform.
2264 'ozone_platform%': 'test',
2266 # Build all platforms whose deps are in install-build-deps.sh.
2267 # Only these platforms will be compile tested by buildbots.
2268 'ozone_platform_dri%': 1,
2269 'ozone_platform_test%': 1,
2270 'ozone_platform_egltest%': 1,
2273 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2274 'use_clipboard_aurax11%': 1,
2277 ['OS=="win" and use_goma==1', {
2278 # goma doesn't support pch yet.
2279 'chromium_win_pch': 0,
2280 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2288 ['OS=="win" and (clang==1 or asan==1)', {
2289 'chromium_win_pch': 0,
2293 'host_cc': '<(make_clang_dir)/bin/clang',
2294 'host_cxx': '<(make_clang_dir)/bin/clang++',
2296 'host_cc': '<!(which gcc)',
2297 'host_cxx': '<!(which g++)',
2300 # The seccomp-bpf sandbox is only supported on four architectures
2302 # Do not disable seccomp_bpf anywhere without talking to
2303 # security@chromium.org!
2304 ['((OS=="linux" or OS=="android") and '
2305 '(target_arch=="ia32" or target_arch=="x64" or '
2306 'target_arch=="arm" or target_arch=="mipsel"))', {
2307 'use_seccomp_bpf%': 1,
2309 'use_seccomp_bpf%': 0,
2313 # The path to the ANGLE library.
2314 'angle_path': '<(DEPTH)/third_party/angle',
2316 # List of default apps to install in new profiles. The first list contains
2317 # the source files as found in svn. The second list, used only for linux,
2318 # contains the destination location for each of the files. When a crx
2319 # is added or removed from the list, the chrome/browser/resources/
2320 # default_apps/external_extensions.json file must also be updated.
2321 'default_apps_list': [
2322 'browser/resources/default_apps/external_extensions.json',
2323 'browser/resources/default_apps/gmail.crx',
2324 'browser/resources/default_apps/search.crx',
2325 'browser/resources/default_apps/youtube.crx',
2326 'browser/resources/default_apps/drive.crx',
2327 'browser/resources/default_apps/docs.crx',
2329 'default_apps_list_linux_dest': [
2330 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2331 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2332 '<(PRODUCT_DIR)/default_apps/search.crx',
2333 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2334 '<(PRODUCT_DIR)/default_apps/drive.crx',
2335 '<(PRODUCT_DIR)/default_apps/docs.crx',
2338 # Whether to allow building of the GPU-related isolates.
2339 'archive_gpu_tests%': 0,
2341 'target_defaults': {
2343 # The condition that operates on chromium_code is in a target_conditions
2344 # section, and will not have access to the default fallback value of
2345 # chromium_code at the top of this file, or to the chromium_code
2346 # variable placed at the root variables scope of .gyp files, because
2347 # those variables are not set at target scope. As a workaround,
2348 # if chromium_code is not set at target scope, define it in target scope
2349 # to contain whatever value it has during early variable expansion.
2350 # That's enough to make it available during target conditional
2352 'chromium_code%': '<(chromium_code)',
2354 'component%': '<(component)',
2356 'chromecast%': '<(chromecast)',
2358 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2359 'win_release_Optimization%': '2', # 2 = /Os
2360 'win_debug_Optimization%': '0', # 0 = /Od
2362 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2363 # Tri-state: blank is default, 1 on, 0 off
2364 'win_release_OmitFramePointers%': '0',
2365 # Tri-state: blank is default, 1 on, 0 off
2366 'win_debug_OmitFramePointers%': '',
2368 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2369 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2371 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2372 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2373 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2375 # VS inserts quite a lot of extra checks to algorithms like
2376 # std::partial_sort in Debug build which make them O(N^2)
2377 # instead of O(N*logN). This is particularly slow under memory
2378 # tools like ThreadSanitizer so we want it to be disablable.
2379 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2380 'win_debug_disable_iterator_debugging%': '0',
2382 # An application manifest fragment to declare compatibility settings for
2383 # 'executable' targets. Ignored in other target type.
2384 'win_exe_compatibility_manifest%':
2385 '<(DEPTH)\\build\\win\\compatibility.manifest',
2387 'release_extra_cflags%': '',
2388 'debug_extra_cflags%': '',
2390 'release_valgrind_build%': '<(release_valgrind_build)',
2392 # the non-qualified versions are widely assumed to be *nix-only
2393 'win_release_extra_cflags%': '',
2394 'win_debug_extra_cflags%': '',
2396 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2397 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2399 # Only used by Windows build for now. Can be used to build into a
2400 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2401 # output files in src/build/VS2010_{Debug,Release}.
2402 'build_dir_prefix%': '',
2404 # Targets are by default not nacl untrusted code.
2405 'nacl_untrusted_build%': 0,
2407 'pnacl_compile_flags': [
2408 # pnacl uses the clang compiler so we need to suppress all the
2409 # same warnings as we do for clang.
2410 # TODO(sbc): Remove these if/when they are removed from the clang
2412 '-Wno-unused-function',
2413 '-Wno-char-subscripts',
2414 '-Wno-c++11-extensions',
2415 '-Wno-unnamed-type-template-args',
2419 ['OS=="win" and component=="shared_library"', {
2420 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2421 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2422 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2424 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2425 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2426 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2429 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2430 'mac_release_optimization%': 's', # Use -Os unless overridden
2431 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2433 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2434 'mac_release_optimization%': '3', # Use -O3 unless overridden
2435 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2438 'host_os%': '<(host_os)', # See comment above chromium_code.
2441 'clang_warning_flags': [
2444 # Don't die on dtoa code that uses a char as an array index.
2445 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2446 '-Wno-char-subscripts',
2448 # TODO(thakis): This used to be implied by -Wno-unused-function,
2449 # which we no longer use. Check if it makes sense to remove
2450 # this as well. http://crbug.com/316352
2451 '-Wno-unneeded-internal-declaration',
2453 # Warns on switches on enums that cover all enum values but
2454 # also contain a default: branch. Chrome is full of that.
2455 '-Wno-covered-switch-default',
2457 # Warns when a const char[] is converted to bool.
2458 '-Wstring-conversion',
2460 # C++11-related flags:
2462 # This warns on using ints as initializers for floats in
2463 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2464 # which happens in several places in chrome code. Not sure if
2465 # this is worth fixing.
2466 '-Wno-c++11-narrowing',
2468 # Clang considers the `register` keyword as deprecated, but e.g.
2469 # code generated by flex (used in angle) contains that keyword.
2470 # http://crbug.com/255186
2471 '-Wno-deprecated-register',
2474 'includes': [ 'set_clang_warning_flags.gypi', ],
2476 # Don't use deprecated V8 APIs anywhere.
2477 'V8_DEPRECATION_WARNINGS',
2480 '<(SHARED_INTERMEDIATE_DIR)',
2483 ['(OS=="mac" or OS=="ios") and asan==1', {
2485 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2488 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2489 'cflags_cc!': ['-fno-rtti'],
2492 '-gline-tables-only',
2493 '-fintercept-allocation-functions',
2495 'defines': ['TYPE_PROFILING'],
2497 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2500 ['branding=="Chrome"', {
2501 'defines': ['GOOGLE_CHROME_BUILD'],
2502 }, { # else: branding!="Chrome"
2503 'defines': ['CHROMIUM_BUILD'],
2505 ['OS=="mac" and component=="shared_library"', {
2507 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2508 'LD_RUNPATH_SEARCH_PATHS': [
2509 # For unbundled binaries.
2511 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2512 '@loader_path/../../..',
2516 ['clang==1 and OS!="win"', {
2517 # This is here so that all files get recompiled after a clang roll and
2518 # when turning clang on or off.
2519 # (defines are passed via the command line, and build systems rebuild
2520 # things when their commandline changes). Nothing should ever read this
2522 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2525 'defines': ['ENABLE_RLZ'],
2527 ['component=="shared_library"', {
2528 'defines': ['COMPONENT_BUILD'],
2530 ['toolkit_views==1', {
2531 'defines': ['TOOLKIT_VIEWS=1'],
2533 ['ui_compositor_image_transport==1', {
2534 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2537 'defines': ['USE_AURA=1'],
2540 'defines': ['USE_ASH=1'],
2543 'defines': ['USE_PANGO=1'],
2546 'defines': ['USE_CAIRO=1'],
2549 'defines': ['USE_CRAS=1'],
2552 'defines': ['USE_GLIB=1'],
2555 'defines': ['USE_OZONE=1'],
2557 ['use_default_render_theme==1', {
2558 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2560 ['use_libjpeg_turbo==1', {
2561 'defines': ['USE_LIBJPEG_TURBO=1'],
2564 'defines': ['USE_X11=1'],
2566 ['use_clipboard_aurax11==1', {
2567 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2569 ['enable_one_click_signin==1', {
2570 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2572 ['enable_pre_sync_backup==1', {
2573 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2575 ['use_xi2_mt!=0 and use_x11==1', {
2576 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2578 ['image_loader_extension==1', {
2579 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2582 'defines': ['ENABLE_PROFILING=1'],
2585 'defines': ['ENABLE_REMOTING=1'],
2587 ['enable_webrtc==1', {
2588 'defines': ['ENABLE_WEBRTC=1'],
2590 ['proprietary_codecs==1', {
2591 'defines': ['USE_PROPRIETARY_CODECS'],
2593 ['enable_viewport==1', {
2594 'defines': ['ENABLE_VIEWPORT'],
2596 ['enable_pepper_cdms==1', {
2597 'defines': ['ENABLE_PEPPER_CDMS'],
2599 ['enable_browser_cdms==1', {
2600 'defines': ['ENABLE_BROWSER_CDMS'],
2602 ['configuration_policy==1', {
2603 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2605 ['notifications==1', {
2606 'defines': ['ENABLE_NOTIFICATIONS'],
2608 ['enable_hidpi==1', {
2609 'defines': ['ENABLE_HIDPI=1'],
2611 ['native_discardable_memory==1', {
2612 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2614 ['native_memory_pressure_signals==1', {
2615 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2618 'defines': ['USE_UDEV'],
2622 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2625 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2626 # Clang creates chubby debug information, which makes linking very
2627 # slow. For now, don't create debug information with clang. See
2628 # http://crbug.com/70000
2632 'debug_extra_cflags': '-g0',
2635 # Android builds symbols on release by default, disable them.
2638 'debug_extra_cflags': '-g0',
2639 'release_extra_cflags': '-g0',
2643 }, { # else clang!=1
2645 ['OS=="win" and fastbuild==2', {
2646 # Completely disable debug information.
2649 'GenerateDebugInformation': 'false',
2651 'VCCLCompilerTool': {
2652 'DebugInformationFormat': '0',
2656 ['OS=="win" and fastbuild==1', {
2659 # This tells the linker to generate .pdbs, so that
2660 # we can get meaningful stack traces.
2661 'GenerateDebugInformation': 'true',
2663 'VCCLCompilerTool': {
2664 # No debug info to be generated by compiler.
2665 'DebugInformationFormat': '0',
2669 ['OS=="linux" and fastbuild==2', {
2671 'debug_extra_cflags': '-g0',
2674 ['OS=="linux" and fastbuild==1', {
2676 'debug_extra_cflags': '-g1',
2679 ['OS=="android" and fastbuild==2', {
2681 'debug_extra_cflags': '-g0',
2682 'release_extra_cflags': '-g0',
2685 ['OS=="android" and fastbuild==1', {
2687 'debug_extra_cflags': '-g1',
2688 'release_extra_cflags': '-g1',
2695 ['dont_embed_build_metadata==1', {
2697 'DONT_EMBED_BUILD_METADATA',
2699 }], # dont_embed_build_metadata==1
2700 ['dcheck_always_on!=0', {
2701 'defines': ['DCHECK_ALWAYS_ON=1'],
2702 }], # dcheck_always_on!=0
2703 ['tracing_like_official_build!=0', {
2704 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2705 }], # tracing_like_official_build!=0
2706 ['win_use_allocator_shim==0', {
2709 'defines': ['NO_TCMALLOC'],
2713 ['enable_eglimage==1', {
2715 'ENABLE_EGLIMAGE=1',
2720 'ADDRESS_SANITIZER',
2721 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2722 'MEMORY_SANITIZER_INITIAL_SIZE',
2726 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2734 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2735 'MEMORY_SANITIZER_INITIAL_SIZE',
2741 '_CRT_SECURE_NO_DEPRECATE',
2742 '_SCL_SECURE_NO_DEPRECATE',
2743 # This define is required to pull in the new Win8 interfaces from
2744 # system headers like ShObjIdl.h.
2745 'NTDDI_VERSION=0x06020000',
2746 # This is required for ATL to use XP-safe versions of its functions.
2747 '_USING_V110_SDK71_',
2750 '<(DEPTH)/third_party/wtl/include',
2755 # Generates debug info when win_z7=1
2756 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2758 'GenerateDebugInformation': 'true',
2760 'VCCLCompilerTool': {
2761 'DebugInformationFormat': '1',
2772 ['target_arch=="arm"', {
2774 # TODO(lcwu): Work around an error when building Chromium
2775 # with gcc-4.5.3 (e.g. v8/src/platform-linux.cc). Remove
2776 # this define once the toolchain is updated.
2777 # See crbug.com/388933.
2783 ['enable_task_manager==1', {
2785 'ENABLE_TASK_MANAGER=1',
2788 ['enable_extensions==1', {
2790 'ENABLE_EXTENSIONS=1',
2793 ['OS=="win" and branding=="Chrome"', {
2794 'defines': ['ENABLE_SWIFTSHADER'],
2796 ['enable_dart==1', {
2797 'defines': ['WEBKIT_USING_DART=1'],
2799 ['enable_plugin_installation==1', {
2800 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2802 ['enable_plugins==1', {
2803 'defines': ['ENABLE_PLUGINS=1'],
2805 ['enable_session_service==1', {
2806 'defines': ['ENABLE_SESSION_SERVICE=1'],
2808 ['enable_themes==1', {
2809 'defines': ['ENABLE_THEMES=1'],
2811 ['enable_autofill_dialog==1', {
2812 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2814 ['enable_prod_wallet_service==1', {
2815 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2817 ['enable_background==1', {
2818 'defines': ['ENABLE_BACKGROUND=1'],
2820 ['enable_google_now==1', {
2821 'defines': ['ENABLE_GOOGLE_NOW=1'],
2823 ['cld_version!=0', {
2824 'defines': ['CLD_VERSION=<(cld_version)'],
2826 ['cld_version==2', {
2827 # This is used to populate the "CLD Data Source" field in:
2828 # chrome://translate-internals
2829 'defines': ['CLD2_DATA_SOURCE=<(cld2_data_source)'],
2831 ['enable_printing==1', {
2832 'defines': ['ENABLE_FULL_PRINTING=1', 'ENABLE_PRINTING=1'],
2834 ['enable_printing==2', {
2835 'defines': ['ENABLE_PRINTING=1'],
2837 ['OS=="win" and win_pdf_metafile_for_printing==1', {
2838 'defines': ['WIN_PDF_METAFILE_FOR_PRINTING=1'],
2840 ['enable_spellcheck==1', {
2841 'defines': ['ENABLE_SPELLCHECK=1'],
2843 ['enable_captive_portal_detection==1', {
2844 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2846 ['enable_app_list==1', {
2847 'defines': ['ENABLE_APP_LIST=1'],
2849 ['enable_settings_app==1', {
2850 'defines': ['ENABLE_SETTINGS_APP=1'],
2852 ['disable_file_support==1', {
2853 'defines': ['DISABLE_FILE_SUPPORT=1'],
2855 ['disable_ftp_support==1', {
2856 'defines': ['DISABLE_FTP_SUPPORT=1'],
2858 ['use_icu_alternatives_on_android==1', {
2859 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2861 ['enable_managed_users==1', {
2862 'defines': ['ENABLE_MANAGED_USERS=1'],
2864 ['data_reduction_fallback_host != ""', {
2866 'DATA_REDUCTION_FALLBACK_HOST="<(data_reduction_fallback_host)"'],
2868 ['data_reduction_dev_host != ""', {
2870 'DATA_REDUCTION_DEV_HOST="<(data_reduction_dev_host)"'],
2872 ['spdy_proxy_auth_origin != ""', {
2873 'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'],
2875 ['spdy_proxy_auth_property != ""', {
2876 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2878 ['spdy_proxy_auth_value != ""', {
2879 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2881 ['data_reduction_proxy_probe_url != ""', {
2883 'DATA_REDUCTION_PROXY_PROBE_URL="<(data_reduction_proxy_probe_url)"'],
2885 ['data_reduction_proxy_warmup_url != ""', {
2887 'DATA_REDUCTION_PROXY_WARMUP_URL="<(data_reduction_proxy_warmup_url)"'],
2889 ['data_reduction_proxy_ssl_origin != ""', {
2891 'DATA_REDUCTION_PROXY_SSL_ORIGIN="<(data_reduction_proxy_ssl_origin)"'],
2893 ['data_reduction_proxy_alt_origin != ""', {
2895 'DATA_REDUCTION_PROXY_ALT_ORIGIN="<(data_reduction_proxy_alt_origin)"'],
2897 ['data_reduction_proxy_alt_fallback_origin != ""', {
2899 'DATA_REDUCTION_PROXY_ALT_FALLBACK_ORIGIN="<(data_reduction_proxy_alt_fallback_origin)"'],
2901 ['enable_mdns==1', {
2902 'defines': ['ENABLE_MDNS=1'],
2904 ['enable_service_discovery==1', {
2905 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2907 ['enable_wifi_bootstrapping==1', {
2908 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2910 ['enable_hangout_services_extension==1', {
2911 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2913 ['enable_ipc_fuzzer==1', {
2914 'defines': ['ENABLE_IPC_FUZZER=1'],
2917 'defines': ['VIDEO_HOLE=1'],
2919 ], # conditions for 'target_defaults'
2920 'target_conditions': [
2921 ['<(use_openssl)==1', {
2922 'defines': ['USE_OPENSSL=1'],
2924 ['<(use_openssl_certs)==1', {
2925 'defines': ['USE_OPENSSL_CERTS=1'],
2927 ['>(nacl_untrusted_build)==1', {
2930 'USE_OPENSSL_CERTS=1',
2933 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
2934 'defines': ['USE_NSS=1'],
2936 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
2937 'defines': ['OS_CHROMEOS=1'],
2939 ['enable_wexit_time_destructors==1', {
2940 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
2942 ['chromium_code==0', {
2944 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
2945 # We don't want to get warnings from third-party code,
2946 # so remove any existing warning-enabling flags like -Wall.
2952 # Don't warn about hash_map in third-party code.
2956 # Don't warn about printf format problems.
2957 # This is off by default in gcc but on in Ubuntu's gcc(!).
2961 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
2965 # TODO: Fix all warnings on chromeos too.
2966 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
2971 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
2973 # Don't warn about ignoring the return value from e.g. close().
2974 # This is off by default in some gccs but on by default in others.
2975 # BSD systems do not support this option, since they are usually
2976 # using gcc 4.2.1, which does not have this flag yet.
2977 '-Wno-unused-result',
2982 '_CRT_SECURE_NO_DEPRECATE',
2983 '_CRT_NONSTDC_NO_WARNINGS',
2984 '_CRT_NONSTDC_NO_DEPRECATE',
2985 '_SCL_SECURE_NO_DEPRECATE',
2987 'msvs_disabled_warnings': [4800],
2989 'VCCLCompilerTool': {
2990 'WarningLevel': '3',
2991 'WarnAsError': 'true',
2992 'Detect64BitPortabilityProblems': 'false',
2996 ['buildtype=="Official"', {
2998 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3003 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3008 # TODO(darin): Unfortunately, some third_party code depends on base.
3009 [ 'OS=="win" and component=="shared_library"', {
3010 'msvs_disabled_warnings': [
3011 4251, # class 'std::xx' needs to have dll-interface.
3014 [ 'OS=="mac" or OS=="ios"', {
3016 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3019 ['buildtype=="Official"', {
3021 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3028 # TODO(ios): Fix remaining warnings in third-party code, then
3029 # remove this; the Mac cleanup didn't get everything that's
3030 # flagged in an iOS build.
3031 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3032 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3033 # Several internal ios directories generate numerous warnings for
3034 # -Wobjc-missing-property-synthesis.
3035 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3041 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3042 'filename_rules.gypi',
3044 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3045 # C99 macros on Mac and Linux.
3047 '__STDC_CONSTANT_MACROS',
3048 '__STDC_FORMAT_MACROS',
3052 # turn on warnings for signed/unsigned mismatch on chromium code.
3054 'VCCLCompilerTool': {
3055 'AdditionalOptions': ['/we4389'],
3059 ['OS=="win" and component=="shared_library"', {
3060 'msvs_disabled_warnings': [
3061 4251, # class 'std::xx' needs to have dll-interface.
3066 ], # target_conditions for 'target_defaults'
3067 'default_configuration': 'Debug',
3069 # VCLinkerTool LinkIncremental values below:
3071 # 1 == /INCREMENTAL:NO
3073 # Debug links incremental, Release does not.
3075 # Abstract base configurations to cover common attributes.
3079 'msvs_configuration_attributes': {
3080 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3081 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3082 'CharacterSet': '1',
3084 # Add the default import libs.
3087 'AdditionalDependencies': [
3111 'MinimumRequiredVersion': '5.01', # XP.
3112 'TargetMachine': '1',
3114 'VCLibrarianTool': {
3115 'TargetMachine': '1',
3118 'msvs_configuration_platform': 'Win32',
3122 'msvs_configuration_platform': 'x64',
3125 # Make sure to understand http://crbug.com/361720 if you want to
3127 'MinimumRequiredVersion': '5.02', # Server 2003.
3128 'TargetMachine': '17', # x86 - 64
3129 'AdditionalLibraryDirectories!':
3130 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3131 'AdditionalLibraryDirectories':
3132 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3133 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3134 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3136 'VCLibrarianTool': {
3137 'AdditionalLibraryDirectories!':
3138 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3139 'AdditionalLibraryDirectories':
3140 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3141 'TargetMachine': '17', # x64
3148 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3149 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3152 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3154 '<@(debug_extra_cflags)',
3158 'VCCLCompilerTool': {
3159 'Optimization': '<(win_debug_Optimization)',
3160 'PreprocessorDefinitions': ['_DEBUG'],
3161 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3162 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3164 # According to MSVS, InlineFunctionExpansion=0 means
3165 # "default inlining", not "/Ob0".
3166 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3167 ['win_debug_InlineFunctionExpansion==0', {
3168 'AdditionalOptions': ['/Ob0'],
3170 ['win_debug_InlineFunctionExpansion!=""', {
3171 'InlineFunctionExpansion':
3172 '<(win_debug_InlineFunctionExpansion)',
3174 ['win_debug_disable_iterator_debugging==1', {
3175 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3178 # if win_debug_OmitFramePointers is blank, leave as default
3179 ['win_debug_OmitFramePointers==1', {
3180 'OmitFramePointers': 'true',
3182 ['win_debug_OmitFramePointers==0', {
3183 'OmitFramePointers': 'false',
3184 # The above is not sufficient (http://crbug.com/106711): it
3185 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3186 # perform FPO regardless, so we must explicitly disable.
3187 # We still want the false setting above to avoid having
3188 # "/Oy /Oy-" and warnings about overriding.
3189 'AdditionalOptions': ['/Oy-'],
3192 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3195 'LinkIncremental': '<(msvs_debug_link_incremental)',
3196 # ASLR makes debugging with windbg difficult because Chrome.exe and
3197 # Chrome.dll share the same base name. As result, windbg will
3198 # name the Chrome.dll module like chrome_<base address>, where
3199 # <base address> typically changes with each launch. This in turn
3200 # means that breakpoints in Chrome.dll don't stick from one launch
3201 # to the next. For this reason, we turn ASLR off in debug builds.
3202 # Note that this is a three-way bool, where 0 means to pick up
3203 # the default setting, 1 is off and 2 is on.
3204 'RandomizedBaseAddress': 1,
3206 'VCResourceCompilerTool': {
3207 'PreprocessorDefinitions': ['_DEBUG'],
3211 ['OS=="linux" or OS=="android"', {
3212 'target_conditions': [
3213 ['_toolset=="target"', {
3215 '<@(debug_extra_cflags)',
3220 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3221 # Enable libstdc++ debugging facilities to help catch problems
3222 # early, see http://crbug.com/65151 .
3223 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3224 'defines': ['_GLIBCXX_DEBUG=1',],
3226 ['release_valgrind_build==0', {
3229 '-fstack-protector-all', # Implies -fstack-protector
3241 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3242 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3243 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3246 'VCCLCompilerTool': {
3247 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3249 # In official builds, each target will self-select
3250 # an optimization level.
3251 ['buildtype!="Official"', {
3252 'Optimization': '<(win_release_Optimization)',
3255 # According to MSVS, InlineFunctionExpansion=0 means
3256 # "default inlining", not "/Ob0".
3257 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3258 ['win_release_InlineFunctionExpansion==0', {
3259 'AdditionalOptions': ['/Ob0'],
3261 ['win_release_InlineFunctionExpansion!=""', {
3262 'InlineFunctionExpansion':
3263 '<(win_release_InlineFunctionExpansion)',
3266 # if win_release_OmitFramePointers is blank, leave as default
3267 ['win_release_OmitFramePointers==1', {
3268 'OmitFramePointers': 'true',
3270 ['win_release_OmitFramePointers==0', {
3271 'OmitFramePointers': 'false',
3272 # The above is not sufficient (http://crbug.com/106711): it
3273 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3274 # perform FPO regardless, so we must explicitly disable.
3275 # We still want the false setting above to avoid having
3276 # "/Oy /Oy-" and warnings about overriding.
3277 'AdditionalOptions': ['/Oy-'],
3280 'AdditionalOptions': [
3281 '/d2Zi+', # Improve debugging of Release builds.
3282 '<@(win_release_extra_cflags)',
3286 # LinkIncremental is a tri-state boolean, where 0 means default
3287 # (i.e., inherit from parent solution), 1 means false, and
3289 'LinkIncremental': '1',
3290 # This corresponds to the /PROFILE flag which ensures the PDB
3291 # file contains FIXUP information (growing the PDB file by about
3292 # 5%) but does not otherwise alter the output binary. This
3293 # information is used by the Syzygy optimization tool when
3294 # decomposing the release image.
3299 ['msvs_use_common_release', {
3300 'includes': ['release.gypi'],
3302 ['release_valgrind_build==0 and tsan==0', {
3305 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3309 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3310 'MEMORY_SANITIZER_INITIAL_SIZE',
3311 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3312 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3315 ['win_use_allocator_shim==0', {
3316 'defines': ['NO_TCMALLOC'],
3318 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3319 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3320 # It seems to work fine with Ubuntu 12 headers though, so use it
3321 # in official builds.
3322 ['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")', {
3323 'target_conditions': [
3324 ['chromium_code==1', {
3325 # Non-chromium code is not guaranteed to compile cleanly
3326 # with _FORTIFY_SOURCE. Also, fortified build may fail
3327 # when optimizations are disabled, so only do that for Release
3330 '_FORTIFY_SOURCE=2',
3335 ['OS=="linux" or OS=="android"', {
3336 'target_conditions': [
3337 ['_toolset=="target"', {
3339 '<@(release_extra_cflags)',
3342 ['enable_resource_whitelist_generation==1', {
3344 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3353 'NS_BLOCK_ASSERTIONS=1',
3359 # Concrete configurations
3362 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3365 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3370 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3371 'target_conditions': [
3372 [ '_type=="executable"', {
3373 # To get a real .dSYM bundle produced by dsymutil, set the
3374 # debug information format to dwarf-with-dsym. Since
3375 # strip_from_xcode will not be used, set Xcode to do the
3376 # stripping as well.
3378 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3379 'DEPLOYMENT_POSTPROCESSING': 'YES',
3380 'STRIP_INSTALLED_PRODUCT': 'YES',
3387 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3389 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3392 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3400 'target_defaults': {
3407 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3408 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3409 'target_defaults': {
3411 '-Wl,--fatal-warnings',
3415 ['os_posix==1 and chromeos==0', {
3416 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3417 # and we want to avoid overriding this, so stack-protector is only
3418 # enabled when not building on Chrome OS.
3419 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3421 'target_defaults': {
3423 '-fstack-protector',
3424 '--param=ssp-buffer-size=4',
3428 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3429 'target_defaults': {
3430 # Enable -Werror by default, but put it in a variable so it can
3431 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3433 'werror%': '-Werror',
3434 'libraries_for_target%': '',
3437 '_FILE_OFFSET_BITS=64',
3440 '<(werror)', # See note above about the werror variable.
3443 '-fno-strict-aliasing', # See http://crbug.com/32204
3445 # TODO(evan): turn this back on once all the builds work.
3447 # Don't warn about unused function params. We use those everywhere.
3448 '-Wno-unused-parameter',
3449 # Don't warn about the "struct foo f = {0};" initialization pattern.
3450 '-Wno-missing-field-initializers',
3451 # Don't export any symbols (for example, to plugins we dlopen()).
3452 # Note: this is *required* to make some plugins work.
3453 '-fvisibility=hidden',
3458 '-fno-threadsafe-statics',
3459 # Make inline functions have hidden visiblity by default.
3460 # Surprisingly, not covered by -fvisibility=hidden.
3461 '-fvisibility-inlines-hidden',
3462 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3463 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3467 '-pthread', '-Wl,-z,noexecstack',
3470 '<(libraries_for_target)',
3475 'debug_optimize%': '0',
3481 '-O>(debug_optimize)',
3487 # Warn in case of text relocations.
3488 '-Wl,--warn-shared-textrel',
3491 ['OS=="android" and android_full_debug==0', {
3492 # Some configurations are copied from Release_Base to reduce
3495 'debug_optimize%': 's',
3499 '-ffunction-sections',
3506 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3507 # We don't omit frame pointers on arm64 since they are required
3508 # to correctly unwind stackframes which contain system library
3509 # function frames (crbug.com/391706).
3511 '-fomit-frame-pointer',
3514 ['OS=="linux" and target_arch=="ia32"', {
3516 '-Wl,--no-as-needed',
3519 ['debug_unwind_tables==1', {
3520 'cflags': ['-funwind-tables'],
3522 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3524 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3525 # definitions in to the right scope to use them when setting
3526 # linux_use_debug_fission, so it can be used here alone.
3527 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3528 'cflags': ['-gsplit-dwarf'],
3534 'release_optimize%': '2',
3535 # Binaries become big and gold is unable to perform GC
3536 # and remove unused sections for some of test targets
3537 # on 32 bit platform.
3538 # (This is currently observed only in chromeos valgrind bots)
3539 # The following flag is to disable --gc-sections linker
3540 # option for these bots.
3541 'no_gc_sections%': 0,
3543 # TODO(bradnelson): reexamine how this is done if we change the
3544 # expansion of configurations
3545 'release_valgrind_build%': 0,
3548 '-O<(release_optimize)',
3549 # Don't emit the GCC version ident directives, they just end up
3550 # in the .comment section taking up binary size.
3552 # Put data and code in their own sections, so that unused symbols
3553 # can be removed at link time with --gc-sections.
3555 '-ffunction-sections',
3558 # Specifically tell the linker to perform optimizations.
3559 # See http://lwn.net/Articles/192624/ .
3564 ['no_gc_sections==0', {
3566 '-Wl,--gc-sections',
3569 ['OS=="android" and target_arch!="arm64"', {
3570 # We don't omit frame pointers on arm64 since they are required
3571 # to correctly unwind stackframes which contain system library
3572 # function frames (crbug.com/391706).
3574 '-fomit-frame-pointer',
3579 'release_optimize%': 's',
3582 # Warn in case of text relocations.
3583 '-Wl,--warn-shared-textrel',
3590 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed
3591 # and the fix is in chromium.
3592 'cflags': [ '-fno-slp-vectorize', ],
3596 '-fno-omit-frame-pointer',
3600 ['profiling_full_stack_frames==1', {
3603 '-fno-optimize-sibling-calls',
3608 ['release_unwind_tables==1', {
3609 'cflags': ['-funwind-tables'],
3611 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3617 ['target_arch=="ia32"', {
3618 'target_conditions': [
3619 ['_toolset=="target"', {
3621 # Needed so that libs with .s files (e.g. libicudata.a)
3622 # are compatible with the general 32-bit-ness.
3625 # All floating-point computations on x87 happens in 80-bit
3626 # precision. Because the C and C++ language standards allow
3627 # the compiler to keep the floating-point values in higher
3628 # precision than what's specified in the source and doing so
3629 # is more efficient than constantly rounding up to 64-bit or
3630 # 32-bit precision as specified in the source, the compiler,
3631 # especially in the optimized mode, tries very hard to keep
3632 # values in x87 floating-point stack (in 80-bit precision)
3633 # as long as possible. This has important side effects, that
3634 # the real value used in computation may change depending on
3635 # how the compiler did the optimization - that is, the value
3636 # kept in 80-bit is different than the value rounded down to
3637 # 64-bit or 32-bit. There are possible compiler options to
3638 # make this behavior consistent (e.g. -ffloat-store would keep
3639 # all floating-values in the memory, thus force them to be
3640 # rounded to its original precision) but they have significant
3641 # runtime performance penalty.
3643 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3644 # which keep floating-point values in SSE registers in its
3645 # native precision (32-bit for single precision, and 64-bit
3646 # for double precision values). This means the floating-point
3647 # value used during computation does not change depending on
3648 # how the compiler optimized the code, since the value is
3649 # always kept in its specified precision.
3651 # Refer to http://crbug.com/348761 for rationale behind SSE2
3652 # being a minimum requirement for 32-bit Linux builds and
3653 # http://crbug.com/313032 for an example where this has "bit"
3658 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3665 # Use gold linker for Android ia32 target.
3671 # Install packages have started cropping up with
3672 # different headers between the 32-bit and 64-bit
3673 # versions, so we have to shadow those differences off
3674 # and make sure a 32-bit-on-64-bit build picks up the
3676 # For android build, use NDK headers instead of host headers
3677 ['host_arch!="ia32" and OS!="android"', {
3686 ['target_arch=="x64"', {
3687 'target_conditions': [
3688 ['_toolset=="target"', {
3690 # Use gold linker for Android x64 target.
3707 ['target_arch=="arm"', {
3708 'target_conditions': [
3709 ['_toolset=="target"', {
3711 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3712 # has changed whenever it encounters a varargs function. This
3713 # silences those warnings, as they are not helpful and
3714 # clutter legitimate warnings.
3720 '-march=<(arm_arch)',
3725 '-mtune=<(arm_tune)',
3733 ['arm_float_abi!=""', {
3735 '-mfloat-abi=<(arm_float_abi)',
3744 # Most of the following flags are derived from what Android
3745 # uses by default when building for arm, reference for which
3746 # can be found in the following file in the Android NDK:
3747 # toolchains/arm-linux-androideabi-4.8/setup.mk
3749 # The tree-sra optimization (scalar replacement for
3750 # aggregates enabling subsequent optimizations) leads to
3751 # invalid code generation when using the Android NDK's
3752 # compiler (r5-r7). This can be verified using
3753 # webkit_unit_tests' WTF.Checked_int8_t test.
3755 # The following 6 options are disabled to save on
3756 # binary size in gcc 4.8.
3757 # TODO(fdegans) Reevaluate when we upgrade GCC.
3758 '-fno-partial-inlining',
3759 '-fno-early-inlining',
3760 '-fno-tree-copy-prop',
3761 '-fno-tree-loop-optimize',
3762 '-fno-move-loop-invariants',
3763 '-fno-caller-saves',
3766 # Android now supports .relro sections properly.
3767 # NOTE: While these flags enable the generation of .relro
3768 # sections, the generated libraries can still be loaded on
3769 # older Android platform versions.
3777 'cflags': [ '-mthumb-interwork' ],
3781 # Thumb code with frame pointer makes chrome crash
3784 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3785 # The perf report sometimes incorrectly attributes
3786 # code from tail calls.
3787 '-fno-optimize-sibling-calls',
3790 '-fomit-frame-pointer',
3795 # Clang does not support the following options.
3796 '-mthumb-interwork',
3797 '-finline-limit=64',
3799 '-fno-partial-inlining',
3800 '-fno-early-inlining',
3801 '-fno-tree-copy-prop',
3802 '-fno-tree-loop-optimize',
3803 '-fno-move-loop-invariants',
3804 '-fno-caller-saves',
3808 # TODO(hans) Enable integrated-as (crbug.com/124610).
3809 '-no-integrated-as',
3810 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3813 # Let clang find the ld.gold in the NDK.
3814 '--gcc-toolchain=<(android_toolchain)/..',
3819 '-marm', # Required for frame pointer based stack traces.
3826 # We set arm_arch to "" so that -march compiler option
3827 # is not set. Otherwise a gcc bug that would complain
3828 # about it conflicting with '-mcpu=cortex-a9'. The flag
3829 # '-march=armv7-a' is actually redundant anyway because
3830 # it is enabled by default when we built the toolchain.
3831 # And using '-mcpu=cortex-a9' should be sufficient.
3834 # Breakpad requires symbols with debugging information
3838 # We want to statically link libstdc++/libgcc_s.
3839 '-static-libstdc++',
3843 # Some components in Chromium (e.g. v8, skia, ffmpeg)
3844 # define their own cflags for arm builds that could
3845 # conflict with the flags we set here (e.g.
3846 # '-mcpu=cortex-a9'). Remove these flags explicitly.
3855 ['target_arch=="arm64"', {
3856 'target_conditions': [
3857 ['_toolset=="target"', {
3861 '-fstack-protector', # stack protector is always enabled on arm64.
3868 ['target_arch=="mipsel"', {
3869 'target_conditions': [
3870 ['_toolset=="target"', {
3872 ['android_webview_build==0 and mips_arch_variant=="mips32r2"', {
3873 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
3875 ['android_webview_build==0 and mips_arch_variant!="mips32r2"', {
3876 'cflags': ['-mips32', '-Wa,-mips32'],
3885 '-Wl,--no-keep-memory'
3888 '-Wno-uninitialized',
3902 'target_conditions': [
3903 ['_toolset=="target"', {
3905 '--sysroot=<(sysroot)',
3908 '--sysroot=<(sysroot)',
3909 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
3915 # TODO(thakis): Remove, http://crbug.com/263960
3916 '-Wno-reserved-user-defined-literal',
3919 # See the comment in the Mac section for what it takes to move
3920 # this to -std=c++11.
3924 ['clang==0 and host_clang==1', {
3925 'target_conditions': [
3926 ['_toolset=="host"', {
3927 'cflags_cc': [ '-std=gnu++11', ],
3931 ['clang==1 and clang_use_chrome_plugins==1', {
3933 '<@(clang_chrome_plugins_flags)',
3936 ['clang==1 and clang_load!=""', {
3938 '-Xclang', '-load', '-Xclang', '<(clang_load)',
3941 ['clang==1 and clang_add_plugin!=""', {
3943 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
3946 ['clang==1 and target_arch=="ia32"', {
3948 # Else building libyuv gives clang's register allocator issues,
3949 # see llvm.org/PR15798 / crbug.com/233709
3950 '-momit-leaf-frame-pointer',
3953 ['clang==1 and "<(GENERATOR)"=="ninja"', {
3955 # See http://crbug.com/110262
3956 '-fcolor-diagnostics',
3959 # Common options for AddressSanitizer, LeakSanitizer,
3960 # ThreadSanitizer and MemorySanitizer.
3961 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
3962 'target_conditions': [
3963 ['_toolset=="target"', {
3965 '-fno-omit-frame-pointer',
3966 '-gline-tables-only',
3969 '-fomit-frame-pointer',
3974 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
3975 'target_conditions': [
3976 ['_toolset=="target"', {
3978 # Functions interposed by the sanitizers can make ld think
3979 # that some libraries aren't needed when they actually are,
3980 # http://crbug.com/234010. As workaround, disable --as-needed.
3984 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3985 'MEMORY_SANITIZER_INITIAL_SIZE',
3989 # TODO(glider): enable the default options on other systems.
3991 ['use_sanitizer_options==1 and OS=="linux" and (chromeos==0 or target_arch!="ia32")', {
3993 '<(DEPTH)/base/base.gyp:sanitizer_options',
3999 'target_conditions': [
4000 ['_toolset=="target"', {
4002 '-fsanitize=address',
4005 '-fsanitize=address',
4012 '-mllvm -asan-globals=0', # http://crbug.com/352073
4018 'target_conditions': [
4019 ['_toolset=="target"', {
4021 '-fsanitize=undefined',
4022 # -fsanitize=vptr is incompatible with -fno-rtti.
4023 '-fno-sanitize=vptr',
4026 '-fsanitize=undefined',
4027 # -fsanitize=vptr is incompatible with -fno-rtti.
4028 '-fno-sanitize=vptr',
4034 'target_conditions': [
4035 ['_toolset=="target"', {
4038 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4050 'UNDEFINED_SANITIZER',
4055 ['asan_coverage!=0', {
4056 'target_conditions': [
4057 ['_toolset=="target"', {
4059 '-mllvm -asan-coverage=<(asan_coverage)',
4065 'target_conditions': [
4066 ['_toolset=="target"', {
4075 'WTF_USE_LEAK_SANITIZER=1',
4081 'target_conditions': [
4082 ['_toolset=="target"', {
4084 '-fsanitize=thread',
4086 '-fsanitize-blacklist=<(tsan_blacklist)',
4089 '-fsanitize=thread',
4093 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4094 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4096 'target_conditions': [
4097 ['_type=="executable"', {
4107 'target_conditions': [
4108 ['_toolset=="target"', {
4110 '-fsanitize=memory',
4111 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4113 '-fsanitize-blacklist=<(msan_blacklist)',
4116 '-fsanitize=memory',
4121 'target_conditions': [
4122 ['_type=="executable"', {
4131 ['use_instrumented_libraries==1', {
4133 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4136 ['use_custom_libcxx==1', {
4138 '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4141 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4142 'target_conditions' : [
4143 # crazy_linker has an upstream gyp file we can't edit, and we
4144 # don't want to instrument it.
4145 ['_toolset=="target" and _target_name!="crazy_linker"', {
4147 '-finstrument-functions',
4148 # Allow mmx intrinsics to inline, so that the
4149 #0 compiler can expand the intrinsics.
4150 '-finstrument-functions-exclude-file-list=mmintrin.h',
4153 ['_toolset=="target" and OS=="android"', {
4155 # Avoids errors with current NDK:
4156 # "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"
4157 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4162 ['linux_dump_symbols==1', {
4165 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4166 'target_conditions': [
4167 ['_toolset=="target"', {
4169 # Attempt to use less memory to prevent the linker from
4170 # running out of address space. Considering installing a
4171 # 64-bit kernel and switching to a 64-bit linker.
4172 '-Wl,--no-keep-memory',
4179 ['use_allocator!="tcmalloc"', {
4180 'defines': ['NO_TCMALLOC'],
4182 ['linux_use_gold_flags==1', {
4183 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4185 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4186 'ldflags': [ '-fuse-ld=gold', ],
4188 'target_conditions': [
4189 ['_toolset=="target"', {
4191 # Experimentation found that using four linking threads
4192 # saved ~20% of link time.
4193 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4194 # Only apply this to the target linker, since the host
4195 # linker might not be gold, but isn't used much anyway.
4196 # TODO(raymes): Disable threading because gold is frequently
4197 # crashing on the bots: crbug.com/161942.
4199 # '-Wl,--thread-count=4',
4204 ['release_valgrind_build==0', {
4205 'target_conditions': [
4206 ['_toolset=="target"', {
4208 # There seems to be a conflict of --icf and -pie
4209 # in gold which can generate crashy binaries. As
4210 # a security measure, -pie takes precedence for
4220 ['linux_use_bundled_binutils==1', {
4222 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4225 ['linux_use_bundled_gold==1', {
4226 # Put our binutils, which contains gold in the search path. We pass
4227 # the path to gold to the compiler. gyp leaves unspecified what the
4228 # cwd is when running the compiler, so the normal gyp path-munging
4229 # fails us. This hack gets the right path.
4231 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4234 # Some binutils 2.23 releases may or may not have new dtags enabled,
4235 # but they are all compatible with --disable-new-dtags,
4236 # because the new dynamic tags are not created by default.
4237 ['binutils_version>=223', {
4238 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4239 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4240 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4241 # inside this file to allow usage of --no-as-needed and removal of
4244 '-Wl,--disable-new-dtags',
4247 ['gcc_version>=47 and clang==0', {
4248 'target_conditions': [
4249 ['_toolset=="target"', {
4252 # See comment for -Wno-c++11-narrowing.
4254 # TODO(thakis): Remove, http://crbug.com/263960
4255 '-Wno-literal-suffix',
4260 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4261 'target_conditions': [
4262 ['_toolset=="host"', {
4265 # See comment for -Wno-c++11-narrowing.
4267 # TODO(thakis): Remove, http://crbug.com/263960
4268 '-Wno-literal-suffix',
4276 # FreeBSD-specific options; note that most FreeBSD options are set above,
4279 'target_defaults': {
4281 '-Wl,--no-keep-memory',
4285 # Android-specific options; note that most are set above with Linux.
4288 # This is a unique identifier for a given build. It's used for
4289 # identifying various build artifacts corresponding to a particular
4290 # build of chrome (e.g. where to find archived symbols).
4291 'chrome_build_id%': '',
4293 # Use shared stlport library when system one used.
4294 # Figure this out early since it needs symbols from libgcc.a, so it
4295 # has to be before that in the set of libraries.
4296 ['use_system_stlport==1', {
4297 'android_stlport_library': 'stlport',
4300 ['component=="shared_library"', {
4301 'android_stlport_library': 'stlport_shared',
4303 'android_stlport_library': 'stlport_static',
4309 # Placing this variable here prevents from forking libvpx, used
4310 # by remoting. Remoting is off, so it needn't built,
4311 # so forking it's deps seems like overkill.
4312 # But this variable need defined to properly run gyp.
4313 # A proper solution is to have an OS==android conditional
4314 # in third_party/libvpx/libvpx.gyp to define it.
4315 'libvpx_path': 'lib/linux/arm',
4317 'target_defaults': {
4319 'release_extra_cflags%': '',
4321 # If we're using the components build, append "cr" to all shared
4322 # libraries to avoid naming collisions with android system library
4323 # versions with the same name (e.g. skia, icu).
4324 ['component=="shared_library"', {
4325 'android_product_extension': 'cr.so',
4327 'android_product_extension': 'so',
4331 'target_conditions': [
4332 ['_type=="shared_library"', {
4333 'product_extension': '<(android_product_extension)',
4336 # Settings for building device targets using Android's toolchain.
4337 # These are based on the setup.mk file from the Android NDK.
4339 # The NDK Android executable link step looks as follows:
4341 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4342 # $(PRIVATE_OBJECTS) <-- The .o that we built
4343 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4344 # $(TARGET_LIBGCC) <-- libgcc.a
4345 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4346 # $(PRIVATE_LDLIBS) <-- System .so
4347 # $(TARGET_CRTEND_O) <-- crtend.o
4349 # For now the above are approximated for executables by adding
4350 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4353 # The NDK Android shared library link step looks as follows:
4355 # $(PRIVATE_OBJECTS) <-- The .o that we built
4356 # -l,--whole-archive
4357 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4358 # -l,--no-whole-archive
4359 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4360 # $(TARGET_LIBGCC) <-- libgcc.a
4361 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4362 # $(PRIVATE_LDLIBS) <-- System .so
4364 # For now, assume that whole static libraries are not needed.
4366 # For both executables and shared libraries, add the proper
4367 # libgcc.a to the start of libraries which puts it in the
4368 # proper spot after .o and .a files get linked in.
4370 # TODO: The proper thing to do longer-tem would be proper gyp
4371 # support for a custom link command line.
4372 ['_toolset=="target"', {
4374 '-pthread', # Not supported by Android toolchain.
4377 '-ffunction-sections',
4380 '-fstack-protector',
4382 '-finline-limit=64',
4383 '-Wa,--noexecstack',
4384 '<@(release_extra_cflags)',
4388 '__GNU_SOURCE=1', # Necessary for clone()
4390 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4391 'CHROME_BUILD_ID="<(chrome_build_id)"',
4394 '-pthread', # Not supported by Android toolchain.
4398 '-Wl,--no-undefined',
4401 '-l<(android_stlport_library)',
4402 # Manually link the libgcc.a that the cross compiler uses.
4403 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4409 ['component=="static_library"', {
4411 '-Wl,--exclude-libs=ALL',
4416 # Work around incompatibilities between bionic and clang
4418 '-D__compiler_offsetof=__builtin_offsetof',
4419 '-Dnan=__builtin_nan',
4422 ['target_arch=="arm"', {
4424 '-target arm-linux-androideabi',
4427 '-target arm-linux-androideabi',
4430 ['target_arch=="ia32"', {
4432 '-target x86-linux-androideabi',
4435 '-target x86-linux-androideabi',
4438 # Place holder for x64 support, not tested.
4439 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4440 ['target_arch=="x64"', {
4442 '-target x86_64-linux-androideabi',
4445 '-target x86_64-linux-androideabi',
4452 # Android build relies on -Wl,--gc-sections removing
4453 # unreachable code. ASan instrumentation for globals inhibits
4454 # this and results in a library with unresolvable relocations.
4455 # TODO(eugenis): find a way to reenable this.
4456 '-mllvm -asan-globals=0',
4459 ['android_webview_build==0', {
4461 # The NDK has these things, but doesn't define the constants
4462 # to say that it does. Define them here instead.
4466 '--sysroot=<(android_ndk_sysroot)',
4469 '--sysroot=<(android_ndk_sysroot)',
4472 ['android_webview_build==1', {
4474 # OpenAL headers from the Android tree.
4475 '<(android_src)/frameworks/wilhelm/include',
4478 # Android predefines this as 1; undefine it here so Chromium
4479 # can redefine it later to be 2 for chromium code and unset
4480 # for third party code. This works because cflags are added
4482 '-U_FORTIFY_SOURCE',
4483 # Disable any additional warnings enabled by the Android build system but which
4484 # chromium does not build cleanly with (when treating warning as errors).
4485 # Things that are part of -Wextra:
4486 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4487 '-Wno-ignored-qualifiers',
4489 '-Wno-unused-but-set-variable',
4492 # Other things unrelated to -Wextra:
4493 '-Wno-non-virtual-dtor',
4497 ['android_webview_build==1', {
4498 'target_conditions': [
4499 ['chromium_code==0', {
4501 # There is a class of warning which:
4502 # 1) Android always enables and also treats as errors
4503 # 2) Chromium ignores in third party code
4504 # So we re-enable those warnings when building Android.
4506 '-Wno-format-security',
4508 '-Wno-sequence-point',
4511 '-Wno-non-virtual-dtor',
4516 ['target_arch == "arm"', {
4518 # Enable identical code folding to reduce size.
4522 # NOTE: The stlport header include paths below are specified in
4523 # cflags rather than include_dirs because they need to come
4524 # after include_dirs. Think of them like system headers, but
4525 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4526 # toolchain (circa Gingerbread) will exhibit strange errors.
4527 # The include ordering here is important; change with caution.
4528 ['use_system_stlport==1', {
4530 # For libstdc++/include, which is used by stlport.
4531 '-I<(android_src)/bionic',
4532 '-I<(android_src)/external/stlport/stlport',
4534 }, { # else: use_system_stlport!=1
4536 '-isystem<(android_stlport_include)',
4539 '-L<(android_stlport_libs_dir)',
4542 ['target_arch=="ia32"', {
4543 # The x86 toolchain currently has problems with stack-protector.
4545 '-fstack-protector',
4548 '-fno-stack-protector',
4552 'target_conditions': [
4553 ['_type=="executable"', {
4554 # Force android tools to export the "main" symbol so they can be
4555 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4556 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4557 # when ICS support will be dropped.
4560 '-fvisibility=default',
4564 '-Wl,--gc-sections',
4565 '-Wl,-z,nocopyreloc',
4568 # crtbegin_dynamic.o should be the last item in ldflags.
4569 '<(android_ndk_lib)/crtbegin_dynamic.o',
4572 # crtend_android.o needs to be the last item in libraries.
4573 # Do not add any libraries after this!
4574 '<(android_ndk_lib)/crtend_android.o',
4577 ['_type=="shared_library" or _type=="loadable_module"', {
4579 '-Wl,--exclude-libs=ALL',
4582 '-Wl,-shared,-Bsymbolic',
4585 ['android_webview_build==0', {
4587 # crtbegin_so.o should be the last item in ldflags.
4588 '<(android_ndk_lib)/crtbegin_so.o',
4591 # crtend_so.o needs to be the last item in libraries.
4592 # Do not add any libraries after this!
4593 '<(android_ndk_lib)/crtend_so.o',
4600 # Settings for building host targets using the system toolchain.
4601 ['_toolset=="host"', {
4603 # Due to issues in Clang build system, using ASan on 32-bit
4604 # binaries on x86_64 host is problematic.
4605 # TODO(eugenis): re-enable.
4606 '-fsanitize=address',
4609 '-fsanitize=address',
4610 '-Wl,-z,noexecstack',
4611 '-Wl,--gc-sections',
4614 '-Wl,--warn-shared-textrel',
4615 '-Wl,--fatal-warnings',
4618 # Settings for building host targets on mac.
4619 ['_toolset=="host" and host_os=="mac"', {
4629 'cflags!': ['-fvisibility=hidden'],
4630 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4632 ['OS=="mac" or OS=="ios"', {
4633 'target_defaults': {
4636 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4637 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4638 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4639 'COPY_PHASE_STRIP': 'NO',
4640 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4641 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4642 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4643 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4644 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4645 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4646 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4647 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4648 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4649 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4650 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4651 'GCC_VERSION': '4.2',
4652 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4653 'USE_HEADERMAP': 'NO',
4658 # Don't warn about unused function parameters.
4659 '-Wno-unused-parameter',
4660 # Don't warn about the "struct foo f = {0};" initialization
4662 '-Wno-missing-field-initializers',
4665 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4666 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4668 # Note that the prebuilt Clang binaries should not be used for iOS
4669 # development except for ASan builds.
4671 # gnu++11 instead of c++11 is needed because some code uses
4672 # typeof() (a GNU extension).
4673 # TODO(thakis): Eventually switch this to c++11 instead of
4674 # gnu++11 (once typeof can be removed, which is blocked on c++11
4675 # being available everywhere).
4676 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', # -std=gnu++11
4677 # Warn if automatic synthesis is triggered with
4678 # the -Wobjc-missing-property-synthesis flag.
4679 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4680 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4682 # This warns on selectors from Cocoa headers (-length, -set).
4683 # cfe-dev is currently discussing the merits of this warning.
4684 # TODO(thakis): Reevaluate what to do with this, based one
4685 # cfe-dev discussion.
4686 '-Wno-selector-type-mismatch',
4689 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed
4690 # and the fix is in chromium.
4691 '-fno-slp-vectorize',
4695 ['clang_xcode==0', {
4696 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4697 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4701 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4703 '<@(clang_chrome_plugins_flags)',
4706 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4708 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4711 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4713 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4716 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4718 # See http://crbug.com/110262
4719 '-fcolor-diagnostics',
4722 ['OS=="ios" and target_subarch!="arm32" and \
4723 "<(GENERATOR)"=="xcode"', {
4725 # TODO(ios): when building Chrome for iOS on 64-bit platform
4726 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4727 # enabled. This cause failures when compiling protobuf code,
4728 # so disable the warning. http://crbug.com/359107
4729 '-Wno-shorten-64-to-32',
4737 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4743 '-fsanitize=address',
4744 '-mllvm -asan-globals=0', # http://crbug.com/352073
4745 '-gline-tables-only',
4749 ['asan_coverage!=0', {
4750 'target_conditions': [
4751 ['_toolset=="target"', {
4753 '-mllvm -asan-coverage=<(asan_coverage)',
4759 'target_conditions': [
4760 ['_type!="static_library"', {
4761 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4766 '-fsanitize=address',
4770 ['mac_write_linker_maps==1', {
4773 '-Wl,-map,>(_target_name).map',
4780 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4781 'target_conditions': [
4782 ['_type=="executable"', {
4788 # Define copy_asan_dylib_path in a variable ending in
4789 # _path so that gyp understands it's a path and
4790 # performs proper relativization during dict merging.
4791 'copy_asan_dylib_path':
4792 'mac/copy_asan_runtime_dylib.sh',
4794 'postbuild_name': 'Copy ASan runtime dylib',
4796 '<(copy_asan_dylib_path)',
4805 ], # target_conditions
4806 }, # target_defaults
4807 }], # OS=="mac" or OS=="ios"
4809 'target_defaults': {
4811 # Prevent Mac OS X AssertMacros.h from defining macros that collide
4812 # with common names, like 'check', 'require', and 'verify'.
4813 # (Included by system header. Also exists on iOS but not included.)
4814 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
4815 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
4818 # These should end with %, but there seems to be a bug with % in
4819 # variables that are intended to be set to different values in
4820 # different targets, like these.
4821 'mac_pie': 1, # Most executables can be position-independent.
4822 # Strip debugging symbols from the target.
4823 'mac_strip': '<(mac_strip_release)',
4827 ['mac_want_real_dsym=="default"', {
4830 'mac_real_dsym': '<(mac_want_real_dsym)'
4835 ['mac_want_real_dsym=="default"', {
4836 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
4838 'mac_real_dsym': '<(mac_want_real_dsym)'
4845 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
4846 # (Equivalent to -fPIC)
4847 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
4848 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4849 # Keep pch files below xcodebuild/.
4850 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
4852 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
4853 # xcode_setting, but not until all downstream projects' mac bots are
4854 # using xcode >= 4.6, because that's when the default value of the
4855 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
4856 # setting is a no-op as far as xcode is concerned, but the compiler
4857 # behaves differently based on whether -fno-strict-aliasing is
4859 '-fno-strict-aliasing', # See http://crbug.com/32204.
4862 'target_conditions': [
4863 ['_type=="executable"', {
4866 # Arranges for data (heap) pages to be protected against
4867 # code execution when running on Mac OS X 10.7 ("Lion"), and
4868 # ensures that the position-independent executable (PIE) bit
4869 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
4871 # Define change_mach_o_flags in a variable ending in _path
4872 # so that GYP understands it's a path and performs proper
4873 # relativization during dict merging.
4874 'change_mach_o_flags_path':
4875 'mac/change_mach_o_flags_from_xcode.sh',
4876 'change_mach_o_flags_options%': [
4878 'target_conditions': [
4879 ['mac_pie==0 or release_valgrind_build==1', {
4880 # Don't enable PIE if it's unwanted. It's unwanted if
4881 # the target specifies mac_pie=0 or if building for
4882 # Valgrind, because Valgrind doesn't understand slide.
4883 # See the similar mac_pie/release_valgrind_build check
4885 'change_mach_o_flags_options': [
4891 'postbuild_name': 'Change Mach-O Flags',
4893 '<(change_mach_o_flags_path)',
4894 '>@(change_mach_o_flags_options)',
4901 'asan_saves_file': 'asan.saves',
4904 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
4908 'target_conditions': [
4909 ['mac_pie==1 and release_valgrind_build==0', {
4910 # Turn on position-independence (ASLR) for executables. When
4911 # PIE is on for the Chrome executables, the framework will
4912 # also be subject to ASLR.
4913 # Don't do this when building for Valgrind, because Valgrind
4914 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
4915 # understand slide, and get rid of the Valgrind check.
4918 '-Wl,-pie', # Position-independent executable (MH_PIE)
4924 ['(_type=="executable" or _type=="shared_library" or \
4925 _type=="loadable_module") and mac_strip!=0', {
4926 'target_conditions': [
4927 ['mac_real_dsym == 1', {
4928 # To get a real .dSYM bundle produced by dsymutil, set the
4929 # debug information format to dwarf-with-dsym. Since
4930 # strip_from_xcode will not be used, set Xcode to do the
4931 # stripping as well.
4935 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
4936 'DEPLOYMENT_POSTPROCESSING': 'YES',
4937 'STRIP_INSTALLED_PRODUCT': 'YES',
4938 'target_conditions': [
4939 ['_type=="shared_library" or _type=="loadable_module"', {
4940 # The Xcode default is to strip debugging symbols
4941 # only (-S). Local symbols should be stripped as
4942 # well, which will be handled by -x. Xcode will
4943 # continue to insert -S when stripping even when
4944 # additional flags are added with STRIPFLAGS.
4946 }], # _type=="shared_library" or _type=="loadable_module"
4947 ['_type=="executable"', {
4950 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
4953 }], # _type=="executable" and asan==1
4954 ], # target_conditions
4956 }, # configuration "Release"
4958 }, { # mac_real_dsym != 1
4959 # To get a fast fake .dSYM bundle, use a post-build step to
4960 # produce the .dSYM and strip the executable. strip_from_xcode
4961 # only operates in the Release configuration.
4965 # Define strip_from_xcode in a variable ending in _path
4966 # so that gyp understands it's a path and performs proper
4967 # relativization during dict merging.
4968 'strip_from_xcode_path': 'mac/strip_from_xcode',
4970 'postbuild_name': 'Strip If Needed',
4971 'action': ['<(strip_from_xcode_path)'],
4975 ], # target_conditions
4976 }], # (_type=="executable" or _type=="shared_library" or
4977 # _type=="loadable_module") and mac_strip!=0
4978 ], # target_conditions
4979 }, # target_defaults
4982 'target_defaults': {
4983 'xcode_settings' : {
4984 # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang
4986 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',
4989 # Older Xcodes do not support -Wno-deprecated-register, so pass an
4990 # additional flag to suppress the "unknown compiler option" error.
4991 # Restrict this flag to builds that are either compiling with Xcode
4992 # or compiling with Xcode's Clang. This will allow Ninja builds to
4993 # continue failing on unknown compiler options.
4994 # TODO(rohitrao): This flag is temporary and should be removed as
4995 # soon as the iOS bots are updated to use Xcode 5.1.
4996 ['clang_xcode==1', {
4998 '-Wno-unknown-warning-option',
5002 # Limit the valid architectures depending on "target_subarch".
5003 # This need to include the "arm" architectures but also the "x86"
5004 # ones (they are used when building for the simulator).
5005 ['target_subarch=="arm32"', {
5006 'VALID_ARCHS': ['armv7', 'i386'],
5008 ['target_subarch=="arm64"', {
5009 'VALID_ARCHS': ['arm64', 'x86_64'],
5011 ['target_subarch=="both"', {
5012 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5014 ['use_system_libcxx==1', {
5015 'target_conditions': [
5016 # Only use libc++ when building target for iOS not when building
5017 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5018 # does not support libc++.
5019 ['_toolset=="target"', {
5020 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5024 # The default for deployment target of 7.0+ is libc++, so force
5025 # the old behavior unless libc++ is enabled.
5026 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5030 'target_conditions': [
5031 ['_toolset=="host"', {
5033 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5034 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5043 ['_toolset=="target"', {
5045 # This section should be for overriding host settings. But,
5046 # since we can't negate the iphone deployment target above, we
5047 # instead set it here for target only.
5048 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5049 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5052 ['_type=="executable"', {
5056 'DEPLOYMENT_POSTPROCESSING': 'YES',
5057 'STRIP_INSTALLED_PRODUCT': 'YES',
5062 # Remove dSYM to reduce build time.
5063 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5069 ['chromium_ios_signing', {
5070 # iOS SDK wants everything for device signed.
5071 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5073 'CODE_SIGNING_REQUIRED': 'NO',
5074 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5079 ], # target_conditions
5080 }, # target_defaults
5083 'target_defaults': {
5085 '_WIN32_WINNT=0x0602',
5092 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5093 'WIN32_LEAN_AND_MEAN',
5095 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5096 '_HAS_EXCEPTIONS=0',
5099 ['buildtype=="Official"', {
5100 # In official builds, targets can self-select an optimization
5101 # level by defining a variable named 'optimize', and setting it
5103 # - "size", optimizes for minimal code size - the default.
5104 # - "speed", optimizes for speed over code size.
5105 # - "max", whole program optimization and link-time code
5106 # generation. This is very expensive and should be used
5109 'optimize%': 'size',
5113 # Set /LTCG for the official builds.
5114 'LinkTimeCodeGeneration': '1',
5117 'target_conditions': [
5118 ['optimize=="size"', {
5120 'VCCLCompilerTool': {
5121 # 1, optimizeMinSpace, Minimize Size (/O1)
5122 'Optimization': '1',
5123 # 2, favorSize - Favor small code (/Os)
5124 'FavorSizeOrSpeed': '2',
5129 ['optimize=="speed"', {
5131 'VCCLCompilerTool': {
5132 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5133 'Optimization': '2',
5134 # 1, favorSpeed - Favor fast code (/Ot)
5135 'FavorSizeOrSpeed': '1',
5140 ['optimize=="max"', {
5141 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5142 # builds. Probably anything that this would catch that
5143 # wouldn't be caught in a normal build isn't going to
5144 # actually be a bug, so the incremental value of C4702 for
5145 # PGO builds is likely very small.
5146 'msvs_disabled_warnings': [
5150 'VCCLCompilerTool': {
5151 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5152 'Optimization': '2',
5153 # 1, favorSpeed - Favor fast code (/Ot)
5154 'FavorSizeOrSpeed': '1',
5155 # This implies link time code generation.
5156 'WholeProgramOptimization': 'true',
5174 'AdditionalLibraryDirectories':
5175 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5177 'VCLibrarianTool': {
5178 'AdditionalLibraryDirectories':
5179 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5185 'VCLibrarianTool': {
5186 'AdditionalLibraryDirectories':
5187 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5190 'AdditionalLibraryDirectories':
5191 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5196 # https://code.google.com/p/chromium/issues/detail?id=372451#c20
5197 # Warning 4702 ("Unreachable code") should be re-enabled once
5198 # Express users are updated to VS2013 Update 2.
5199 'msvs_disabled_warnings': [
5204 # Explicitly required when using the ATL with express
5205 'AdditionalDependencies': ['atlthunk.lib'],
5207 # ATL 8.0 included in WDK 7.1 makes the linker to generate
5208 # almost eight hundred LNK4254 and LNK4078 warnings:
5209 # - warning LNK4254: section 'ATL' (50000040) merged into
5210 # '.rdata' (40000040) with different attributes
5211 # - warning LNK4078: multiple 'ATL' sections found with
5212 # different attributes
5213 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
5216 'msvs_system_include_dirs': [
5217 '<(windows_driver_kit_path)/inc/atl71',
5218 '<(windows_driver_kit_path)/inc/mfc42',
5222 'msvs_system_include_dirs': [
5223 '<(windows_sdk_path)/Include/shared',
5224 '<(windows_sdk_path)/Include/um',
5225 '<(windows_sdk_path)/Include/winrt',
5226 '$(VSInstallDir)/VC/atlmfc/include',
5228 'msvs_cygwin_shell': 0,
5229 'msvs_disabled_warnings': [
5230 # C4127: conditional expression is constant
5231 # This warning can in theory catch dead code and other problems, but
5232 # triggers in far too many desirable cases where the conditional
5233 # expression is either set by macros or corresponds some legitimate
5234 # compile-time constant expression (due to constant template args,
5235 # conditionals comparing the sizes of different types, etc.). Some of
5236 # these can be worked around, but it's not worth it.
5239 # C4351: new behavior: elements of array 'array' will be default
5241 # This is a silly "warning" that basically just alerts you that the
5242 # compiler is going to actually follow the language spec like it's
5243 # supposed to, instead of not following it like old buggy versions
5244 # did. There's absolutely no reason to turn this on.
5247 # C4355: 'this': used in base member initializer list
5248 # It's commonly useful to pass |this| to objects in a class'
5249 # initializer list. While this warning can catch real bugs, most of
5250 # the time the constructors in question don't attempt to call methods
5251 # on the passed-in pointer (until later), and annotating every legit
5252 # usage of this is simply more hassle than the warning is worth.
5255 # C4503: 'identifier': decorated name length exceeded, name was
5257 # This only means that some long error messages might have truncated
5258 # identifiers in the presence of lots of templates. It has no effect
5259 # on program correctness and there's no real reason to waste time
5260 # trying to prevent it.
5263 # C4611: interaction between 'function' and C++ object destruction is
5265 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5266 # suggests using exceptions instead of setjmp/longjmp for C++, but
5267 # Chromium code compiles without exception support. We therefore have
5268 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5269 # means we have to turn off this warning (and be careful about how
5270 # object destruction happens in such cases).
5273 # TODO(maruel): These warnings are level 4. They will be slowly
5274 # removed as code is fixed.
5275 4100, # Unreferenced formal parameter
5276 4121, # Alignment of a member was sensitive to packing
5277 4189, # Local variable is initialized but not referenced
5278 4244, # Conversion from 'type1' to 'type2', possible loss of data
5279 4481, # Nonstandard extension used: override specifier 'keyword'
5280 4505, # Unreferenced local function has been removed
5281 4510, # Default constructor could not be generated
5282 4512, # Assignment operator could not be generated
5283 4610, # Object can never be instantiated
5286 'VCCLCompilerTool': {
5287 'AdditionalOptions': ['/MP'],
5288 'MinimalRebuild': 'false',
5289 'BufferSecurityCheck': 'true',
5290 'EnableFunctionLevelLinking': 'true',
5291 'RuntimeTypeInfo': 'false',
5292 'WarningLevel': '4',
5293 'WarnAsError': 'true',
5294 'DebugInformationFormat': '3',
5295 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5296 'ExceptionHandling': '0',
5298 'VCLibrarianTool': {
5299 'AdditionalOptions': ['/ignore:4221'],
5300 'AdditionalLibraryDirectories': [
5301 '<(windows_sdk_path)/Lib/win8/um/x86',
5305 'AdditionalDependencies': [
5317 'AdditionalLibraryDirectories': [
5318 '<(windows_sdk_path)/Lib/win8/um/x86',
5320 'GenerateDebugInformation': 'true',
5321 'MapFileName': '$(OutDir)\\$(TargetName).map',
5322 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5323 'FixedBaseAddress': '1',
5326 # 1 == /SUBSYSTEM:CONSOLE
5327 # 2 == /SUBSYSTEM:WINDOWS
5328 # Most of the executables we'll ever create are tests
5329 # and utilities with console output.
5333 'GenerateStublessProxies': 'true',
5334 'TypeLibraryName': '$(InputName).tlb',
5335 'OutputDirectory': '$(IntDir)',
5336 'HeaderFileName': '$(InputName).h',
5337 'DLLDataFileName': '$(InputName).dlldata.c',
5338 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5339 'ProxyFileName': '$(InputName)_p.c',
5341 'VCResourceCompilerTool': {
5343 'AdditionalIncludeDirectories': [
5345 '<(SHARED_INTERMEDIATE_DIR)',
5348 'target_conditions': [
5349 ['_type=="executable"', {
5351 'EmbedManifest': 'true',
5354 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5356 'AdditionalManifestFiles': [
5357 '>(win_exe_compatibility_manifest)',
5364 # Building with Clang on Windows is a work in progress and very
5365 # experimental. See crbug.com/82385.
5366 'VCCLCompilerTool': {
5367 'WarnAsError': 'false',
5368 'RuntimeTypeInfo': 'false',
5369 'AdditionalOptions': [
5370 '-fmsc-version=1800',
5373 # Many files use intrinsics without including this header.
5374 # TODO(hans): Fix those files, or move this to sub-GYPs.
5377 # TODO(hans): Make this list shorter eventually.
5378 '-Qunused-arguments',
5379 '-Wno-c++11-compat-deprecated-writable-strings',
5380 '-Wno-deprecated-declarations',
5382 '-Wno-enum-conversion',
5383 '-Wno-extra-tokens',
5384 '-Wno-ignored-attributes',
5385 '-Wno-incompatible-pointer-types',
5386 '-Wno-int-to-void-pointer-cast',
5387 '-Wno-invalid-noreturn',
5388 '-Wno-logical-op-parentheses',
5390 '-Wno-missing-braces',
5391 '-Wno-missing-declarations',
5392 '-Wno-msvc-include',
5393 '-Wno-null-dereference',
5394 '-Wno-overloaded-virtual',
5396 '-Wno-pointer-sign',
5398 '-Wno-return-type-c-linkage',
5400 '-Wno-sometimes-uninitialized',
5402 '-Wno-tautological-compare',
5403 '-Wno-unknown-pragmas',
5405 '-Wno-unused-function',
5406 '-Wno-unused-private-field',
5407 '-Wno-unused-value',
5408 '-Wno-unused-variable',
5414 # ASan on Windows is a work in progress and very experimental.
5415 # See crbug.com/345874.
5416 'VCCLCompilerTool': {
5417 'AdditionalOptions': [
5418 '-fsanitize=address',
5420 'AdditionalIncludeDirectories': [
5421 # MSVC needs to be able to find the sanitizer headers when
5422 # invoked via /fallback. This is critical for using macros
5423 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5425 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/include_sanitizer',
5429 'AdditionalLibraryDirectories': [
5430 # TODO(hans): If make_clang_dir is absolute, this breaks.
5431 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/lib/windows',
5434 'target_conditions': [
5435 ['_type=="executable"', {
5437 'AdditionalDependencies': [
5438 'clang_rt.asan-i386.lib',
5442 ['_type=="shared_library" or _type=="loadable_module"', {
5444 'AdditionalDependencies': [
5445 'clang_rt.asan_dll_thunk-i386.lib',
5455 ['disable_nacl==1', {
5456 'target_defaults': {
5462 ['OS=="win" and msvs_use_common_linker_extras', {
5463 'target_defaults': {
5478 'AdditionalOptions': [
5487 'AdditionalOptions': ['/largeaddressaware'],
5496 'AdditionalOptions': [
5497 # safeseh is not compatible with x64
5509 ['enable_new_npdevice_api==1', {
5510 'target_defaults': {
5512 'ENABLE_NEW_NPDEVICE_API',
5516 # Don't warn about the "typedef 'foo' locally defined but not used"
5518 # TODO: remove this flag once all builds work. See crbug.com/227506
5519 ['gcc_version>=48 and clang==0', {
5520 'target_defaults': {
5522 '-Wno-unused-local-typedefs',
5526 ['gcc_version>=48 and clang==0 and host_clang==1', {
5527 'target_defaults': {
5528 'target_conditions': [
5529 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5533 # We need a special case to handle the android webview build on mac because
5534 # the host gcc there doesn't accept this flag, but the target gcc may
5536 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5537 'target_defaults': {
5538 'target_conditions': [
5539 ['_toolset=="host"', {
5541 '-Wno-unused-local-typedefs',
5547 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5549 'make_global_settings': [
5550 ['CC', '<(make_clang_dir)/bin/clang'],
5551 ['CXX', '<(make_clang_dir)/bin/clang++'],
5552 ['CC.host', '$(CC)'],
5553 ['CXX.host', '$(CXX)'],
5556 ['clang==1 and OS=="win"', {
5557 'make_global_settings': [
5558 # On Windows, gyp's ninja generator only looks at CC.
5559 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5562 ['OS=="android" and clang==0', {
5563 # Hardcode the compiler names in the Makefile so that
5564 # it won't depend on the environment at make time.
5565 'make_global_settings': [
5566 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5567 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5568 ['CC.host', '<(host_cc)'],
5569 ['CXX.host', '<(host_cxx)'],
5572 ['OS=="linux" and target_arch=="mipsel"', {
5573 'make_global_settings': [
5574 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5575 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5576 ['CC.host', '<(host_cc)'],
5577 ['CXX.host', '<(host_cxx)'],
5580 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5581 # Set default ARM cross compiling on linux. These can be overridden
5582 # using CC/CXX/etc environment variables.
5583 'make_global_settings': [
5584 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5585 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5586 ['CC.host', '<(host_cc)'],
5587 ['CXX.host', '<(host_cxx)'],
5591 # TODO(yyanagisawa): supports GENERATOR==make
5592 # make generator doesn't support CC_wrapper without CC
5593 # in make_global_settings yet.
5594 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5595 'make_global_settings': [
5596 ['CC_wrapper', '<(gomadir)/gomacc'],
5597 ['CXX_wrapper', '<(gomadir)/gomacc'],
5598 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5599 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5604 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5605 # This block adds *project-wide* configuration settings to each project
5606 # file. It's almost always wrong to put things here. Specify your
5607 # custom xcode_settings in target_defaults to add them to targets instead.
5610 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5611 # setting sets the SDK on a project-wide basis. In order to get the
5612 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5613 # here at the project level.
5616 ['mac_sdk_path==""', {
5617 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5619 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5625 ['ios_sdk_path==""', {
5627 # TODO(justincohen): Ninja only supports simulator for now.
5628 ['"<(GENERATOR)"=="xcode"', {
5629 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5631 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5635 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5640 # Target both iPhone and iPad.
5641 'TARGETED_DEVICE_FAMILY': '1,2',
5644 ['target_arch=="x64"', {
5649 ['target_arch=="ia32"', {
5658 # The Xcode generator will look for an xcode_settings section at the root
5659 # of each dict and use it to apply settings on a file-wide basis. Most
5660 # settings should not be here, they should be in target-specific
5661 # xcode_settings sections, or better yet, should use non-Xcode-specific
5662 # settings in target dicts. SYMROOT is a special case, because many other
5663 # Xcode variables depend on it, including variables such as
5664 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5665 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5666 # files to appear (when present) in the UI as actual files and not red
5667 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5668 # and therefore SYMROOT, needs to be set at the project level.
5669 'SYMROOT': '<(DEPTH)/xcodebuild',