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 five 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" or '
2307 'target_arch=="arm64"))', {
2308 'use_seccomp_bpf%': 1,
2310 'use_seccomp_bpf%': 0,
2314 # The path to the ANGLE library.
2315 'angle_path': '<(DEPTH)/third_party/angle',
2317 # List of default apps to install in new profiles. The first list contains
2318 # the source files as found in svn. The second list, used only for linux,
2319 # contains the destination location for each of the files. When a crx
2320 # is added or removed from the list, the chrome/browser/resources/
2321 # default_apps/external_extensions.json file must also be updated.
2322 'default_apps_list': [
2323 'browser/resources/default_apps/external_extensions.json',
2324 'browser/resources/default_apps/gmail.crx',
2325 'browser/resources/default_apps/search.crx',
2326 'browser/resources/default_apps/youtube.crx',
2327 'browser/resources/default_apps/drive.crx',
2328 'browser/resources/default_apps/docs.crx',
2330 'default_apps_list_linux_dest': [
2331 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2332 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2333 '<(PRODUCT_DIR)/default_apps/search.crx',
2334 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2335 '<(PRODUCT_DIR)/default_apps/drive.crx',
2336 '<(PRODUCT_DIR)/default_apps/docs.crx',
2339 # Whether to allow building of the GPU-related isolates.
2340 'archive_gpu_tests%': 0,
2342 'target_defaults': {
2344 # The condition that operates on chromium_code is in a target_conditions
2345 # section, and will not have access to the default fallback value of
2346 # chromium_code at the top of this file, or to the chromium_code
2347 # variable placed at the root variables scope of .gyp files, because
2348 # those variables are not set at target scope. As a workaround,
2349 # if chromium_code is not set at target scope, define it in target scope
2350 # to contain whatever value it has during early variable expansion.
2351 # That's enough to make it available during target conditional
2353 'chromium_code%': '<(chromium_code)',
2355 'component%': '<(component)',
2357 'chromecast%': '<(chromecast)',
2359 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2360 'win_release_Optimization%': '2', # 2 = /Os
2361 'win_debug_Optimization%': '0', # 0 = /Od
2363 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2364 # Tri-state: blank is default, 1 on, 0 off
2365 'win_release_OmitFramePointers%': '0',
2366 # Tri-state: blank is default, 1 on, 0 off
2367 'win_debug_OmitFramePointers%': '',
2369 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2370 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2372 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2373 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2374 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2376 # VS inserts quite a lot of extra checks to algorithms like
2377 # std::partial_sort in Debug build which make them O(N^2)
2378 # instead of O(N*logN). This is particularly slow under memory
2379 # tools like ThreadSanitizer so we want it to be disablable.
2380 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2381 'win_debug_disable_iterator_debugging%': '0',
2383 # An application manifest fragment to declare compatibility settings for
2384 # 'executable' targets. Ignored in other target type.
2385 'win_exe_compatibility_manifest%':
2386 '<(DEPTH)\\build\\win\\compatibility.manifest',
2388 'release_extra_cflags%': '',
2389 'debug_extra_cflags%': '',
2391 'release_valgrind_build%': '<(release_valgrind_build)',
2393 # the non-qualified versions are widely assumed to be *nix-only
2394 'win_release_extra_cflags%': '',
2395 'win_debug_extra_cflags%': '',
2397 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2398 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2400 # Only used by Windows build for now. Can be used to build into a
2401 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2402 # output files in src/build/VS2010_{Debug,Release}.
2403 'build_dir_prefix%': '',
2405 # Targets are by default not nacl untrusted code.
2406 'nacl_untrusted_build%': 0,
2408 'pnacl_compile_flags': [
2409 # pnacl uses the clang compiler so we need to suppress all the
2410 # same warnings as we do for clang.
2411 # TODO(sbc): Remove these if/when they are removed from the clang
2413 '-Wno-unused-function',
2414 '-Wno-char-subscripts',
2415 '-Wno-c++11-extensions',
2416 '-Wno-unnamed-type-template-args',
2420 ['OS=="win" and component=="shared_library"', {
2421 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2422 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2423 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2425 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2426 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2427 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2430 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2431 'mac_release_optimization%': 's', # Use -Os unless overridden
2432 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2434 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2435 'mac_release_optimization%': '3', # Use -O3 unless overridden
2436 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2439 'host_os%': '<(host_os)', # See comment above chromium_code.
2442 'clang_warning_flags': [
2445 # Don't die on dtoa code that uses a char as an array index.
2446 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2447 '-Wno-char-subscripts',
2449 # TODO(thakis): This used to be implied by -Wno-unused-function,
2450 # which we no longer use. Check if it makes sense to remove
2451 # this as well. http://crbug.com/316352
2452 '-Wno-unneeded-internal-declaration',
2454 # Warns on switches on enums that cover all enum values but
2455 # also contain a default: branch. Chrome is full of that.
2456 '-Wno-covered-switch-default',
2458 # Warns when a const char[] is converted to bool.
2459 '-Wstring-conversion',
2461 # C++11-related flags:
2463 # This warns on using ints as initializers for floats in
2464 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2465 # which happens in several places in chrome code. Not sure if
2466 # this is worth fixing.
2467 '-Wno-c++11-narrowing',
2469 # Clang considers the `register` keyword as deprecated, but e.g.
2470 # code generated by flex (used in angle) contains that keyword.
2471 # http://crbug.com/255186
2472 '-Wno-deprecated-register',
2475 'includes': [ 'set_clang_warning_flags.gypi', ],
2477 # Don't use deprecated V8 APIs anywhere.
2478 'V8_DEPRECATION_WARNINGS',
2481 '<(SHARED_INTERMEDIATE_DIR)',
2484 ['(OS=="mac" or OS=="ios") and asan==1', {
2486 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2489 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2490 'cflags_cc!': ['-fno-rtti'],
2493 '-gline-tables-only',
2494 '-fintercept-allocation-functions',
2496 'defines': ['TYPE_PROFILING'],
2498 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2501 ['branding=="Chrome"', {
2502 'defines': ['GOOGLE_CHROME_BUILD'],
2503 }, { # else: branding!="Chrome"
2504 'defines': ['CHROMIUM_BUILD'],
2506 ['OS=="mac" and component=="shared_library"', {
2508 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2509 'LD_RUNPATH_SEARCH_PATHS': [
2510 # For unbundled binaries.
2512 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2513 '@loader_path/../../..',
2517 ['clang==1 and OS!="win"', {
2518 # This is here so that all files get recompiled after a clang roll and
2519 # when turning clang on or off.
2520 # (defines are passed via the command line, and build systems rebuild
2521 # things when their commandline changes). Nothing should ever read this
2523 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2526 'defines': ['ENABLE_RLZ'],
2528 ['component=="shared_library"', {
2529 'defines': ['COMPONENT_BUILD'],
2531 ['toolkit_views==1', {
2532 'defines': ['TOOLKIT_VIEWS=1'],
2534 ['ui_compositor_image_transport==1', {
2535 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2538 'defines': ['USE_AURA=1'],
2541 'defines': ['USE_ASH=1'],
2544 'defines': ['USE_PANGO=1'],
2547 'defines': ['USE_CAIRO=1'],
2550 'defines': ['USE_CRAS=1'],
2553 'defines': ['USE_GLIB=1'],
2556 'defines': ['USE_OZONE=1'],
2558 ['use_default_render_theme==1', {
2559 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2561 ['use_libjpeg_turbo==1', {
2562 'defines': ['USE_LIBJPEG_TURBO=1'],
2565 'defines': ['USE_X11=1'],
2567 ['use_clipboard_aurax11==1', {
2568 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2570 ['enable_one_click_signin==1', {
2571 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2573 ['enable_pre_sync_backup==1', {
2574 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2576 ['use_xi2_mt!=0 and use_x11==1', {
2577 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
2579 ['image_loader_extension==1', {
2580 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2583 'defines': ['ENABLE_PROFILING=1'],
2586 'defines': ['ENABLE_REMOTING=1'],
2588 ['enable_webrtc==1', {
2589 'defines': ['ENABLE_WEBRTC=1'],
2591 ['proprietary_codecs==1', {
2592 'defines': ['USE_PROPRIETARY_CODECS'],
2594 ['enable_viewport==1', {
2595 'defines': ['ENABLE_VIEWPORT'],
2597 ['enable_pepper_cdms==1', {
2598 'defines': ['ENABLE_PEPPER_CDMS'],
2600 ['enable_browser_cdms==1', {
2601 'defines': ['ENABLE_BROWSER_CDMS'],
2603 ['configuration_policy==1', {
2604 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2606 ['notifications==1', {
2607 'defines': ['ENABLE_NOTIFICATIONS'],
2609 ['enable_hidpi==1', {
2610 'defines': ['ENABLE_HIDPI=1'],
2612 ['native_discardable_memory==1', {
2613 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2615 ['native_memory_pressure_signals==1', {
2616 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2619 'defines': ['USE_UDEV'],
2623 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2626 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2627 # Clang creates chubby debug information, which makes linking very
2628 # slow. For now, don't create debug information with clang. See
2629 # http://crbug.com/70000
2633 'debug_extra_cflags': '-g0',
2636 # Android builds symbols on release by default, disable them.
2639 'debug_extra_cflags': '-g0',
2640 'release_extra_cflags': '-g0',
2644 }, { # else clang!=1
2646 ['OS=="win" and fastbuild==2', {
2647 # Completely disable debug information.
2650 'GenerateDebugInformation': 'false',
2652 'VCCLCompilerTool': {
2653 'DebugInformationFormat': '0',
2657 ['OS=="win" and fastbuild==1', {
2660 # This tells the linker to generate .pdbs, so that
2661 # we can get meaningful stack traces.
2662 'GenerateDebugInformation': 'true',
2664 'VCCLCompilerTool': {
2665 # No debug info to be generated by compiler.
2666 'DebugInformationFormat': '0',
2670 ['OS=="linux" and fastbuild==2', {
2672 'debug_extra_cflags': '-g0',
2675 ['OS=="linux" and fastbuild==1', {
2677 'debug_extra_cflags': '-g1',
2680 ['OS=="android" and fastbuild==2', {
2682 'debug_extra_cflags': '-g0',
2683 'release_extra_cflags': '-g0',
2686 ['OS=="android" and fastbuild==1', {
2688 'debug_extra_cflags': '-g1',
2689 'release_extra_cflags': '-g1',
2696 ['dont_embed_build_metadata==1', {
2698 'DONT_EMBED_BUILD_METADATA',
2700 }], # dont_embed_build_metadata==1
2701 ['dcheck_always_on!=0', {
2702 'defines': ['DCHECK_ALWAYS_ON=1'],
2703 }], # dcheck_always_on!=0
2704 ['tracing_like_official_build!=0', {
2705 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2706 }], # tracing_like_official_build!=0
2707 ['win_use_allocator_shim==0', {
2710 'defines': ['NO_TCMALLOC'],
2714 ['enable_eglimage==1', {
2716 'ENABLE_EGLIMAGE=1',
2721 'ADDRESS_SANITIZER',
2722 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2723 'MEMORY_SANITIZER_INITIAL_SIZE',
2727 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2735 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2736 'MEMORY_SANITIZER_INITIAL_SIZE',
2742 '_CRT_SECURE_NO_DEPRECATE',
2743 '_SCL_SECURE_NO_DEPRECATE',
2744 # This define is required to pull in the new Win8 interfaces from
2745 # system headers like ShObjIdl.h.
2746 'NTDDI_VERSION=0x06020000',
2747 # This is required for ATL to use XP-safe versions of its functions.
2748 '_USING_V110_SDK71_',
2751 '<(DEPTH)/third_party/wtl/include',
2756 # Generates debug info when win_z7=1
2757 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2759 'GenerateDebugInformation': 'true',
2761 'VCCLCompilerTool': {
2762 'DebugInformationFormat': '1',
2773 ['target_arch=="arm"', {
2775 # TODO(lcwu): Work around an error when building Chromium
2776 # with gcc-4.5.3 (e.g. v8/src/platform-linux.cc). Remove
2777 # this define once the toolchain is updated.
2778 # See crbug.com/388933.
2784 ['enable_task_manager==1', {
2786 'ENABLE_TASK_MANAGER=1',
2789 ['enable_extensions==1', {
2791 'ENABLE_EXTENSIONS=1',
2794 ['OS=="win" and branding=="Chrome"', {
2795 'defines': ['ENABLE_SWIFTSHADER'],
2797 ['enable_dart==1', {
2798 'defines': ['WEBKIT_USING_DART=1'],
2800 ['enable_plugin_installation==1', {
2801 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2803 ['enable_plugins==1', {
2804 'defines': ['ENABLE_PLUGINS=1'],
2806 ['enable_session_service==1', {
2807 'defines': ['ENABLE_SESSION_SERVICE=1'],
2809 ['enable_themes==1', {
2810 'defines': ['ENABLE_THEMES=1'],
2812 ['enable_autofill_dialog==1', {
2813 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2815 ['enable_prod_wallet_service==1', {
2816 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2818 ['enable_background==1', {
2819 'defines': ['ENABLE_BACKGROUND=1'],
2821 ['enable_google_now==1', {
2822 'defines': ['ENABLE_GOOGLE_NOW=1'],
2824 ['cld_version!=0', {
2825 'defines': ['CLD_VERSION=<(cld_version)'],
2827 ['cld_version==2', {
2828 # This is used to populate the "CLD Data Source" field in:
2829 # chrome://translate-internals
2830 'defines': ['CLD2_DATA_SOURCE=<(cld2_data_source)'],
2832 ['enable_printing==1', {
2833 'defines': ['ENABLE_FULL_PRINTING=1', 'ENABLE_PRINTING=1'],
2835 ['enable_printing==2', {
2836 'defines': ['ENABLE_PRINTING=1'],
2838 ['OS=="win" and win_pdf_metafile_for_printing==1', {
2839 'defines': ['WIN_PDF_METAFILE_FOR_PRINTING=1'],
2841 ['enable_spellcheck==1', {
2842 'defines': ['ENABLE_SPELLCHECK=1'],
2844 ['enable_captive_portal_detection==1', {
2845 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2847 ['enable_app_list==1', {
2848 'defines': ['ENABLE_APP_LIST=1'],
2850 ['enable_settings_app==1', {
2851 'defines': ['ENABLE_SETTINGS_APP=1'],
2853 ['disable_file_support==1', {
2854 'defines': ['DISABLE_FILE_SUPPORT=1'],
2856 ['disable_ftp_support==1', {
2857 'defines': ['DISABLE_FTP_SUPPORT=1'],
2859 ['use_icu_alternatives_on_android==1', {
2860 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2862 ['enable_managed_users==1', {
2863 'defines': ['ENABLE_MANAGED_USERS=1'],
2865 ['data_reduction_fallback_host != ""', {
2867 'DATA_REDUCTION_FALLBACK_HOST="<(data_reduction_fallback_host)"'],
2869 ['data_reduction_dev_host != ""', {
2871 'DATA_REDUCTION_DEV_HOST="<(data_reduction_dev_host)"'],
2873 ['spdy_proxy_auth_origin != ""', {
2874 'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'],
2876 ['spdy_proxy_auth_property != ""', {
2877 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2879 ['spdy_proxy_auth_value != ""', {
2880 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2882 ['data_reduction_proxy_probe_url != ""', {
2884 'DATA_REDUCTION_PROXY_PROBE_URL="<(data_reduction_proxy_probe_url)"'],
2886 ['data_reduction_proxy_warmup_url != ""', {
2888 'DATA_REDUCTION_PROXY_WARMUP_URL="<(data_reduction_proxy_warmup_url)"'],
2890 ['data_reduction_proxy_ssl_origin != ""', {
2892 'DATA_REDUCTION_PROXY_SSL_ORIGIN="<(data_reduction_proxy_ssl_origin)"'],
2894 ['data_reduction_proxy_alt_origin != ""', {
2896 'DATA_REDUCTION_PROXY_ALT_ORIGIN="<(data_reduction_proxy_alt_origin)"'],
2898 ['data_reduction_proxy_alt_fallback_origin != ""', {
2900 'DATA_REDUCTION_PROXY_ALT_FALLBACK_ORIGIN="<(data_reduction_proxy_alt_fallback_origin)"'],
2902 ['enable_mdns==1', {
2903 'defines': ['ENABLE_MDNS=1'],
2905 ['enable_service_discovery==1', {
2906 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2908 ['enable_wifi_bootstrapping==1', {
2909 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2911 ['enable_hangout_services_extension==1', {
2912 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2914 ['enable_ipc_fuzzer==1', {
2915 'defines': ['ENABLE_IPC_FUZZER=1'],
2918 'defines': ['VIDEO_HOLE=1'],
2920 ], # conditions for 'target_defaults'
2921 'target_conditions': [
2922 ['<(use_openssl)==1', {
2923 'defines': ['USE_OPENSSL=1'],
2925 ['<(use_openssl_certs)==1', {
2926 'defines': ['USE_OPENSSL_CERTS=1'],
2928 ['>(nacl_untrusted_build)==1', {
2931 'USE_OPENSSL_CERTS=1',
2934 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
2935 'defines': ['USE_NSS=1'],
2937 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
2938 'defines': ['OS_CHROMEOS=1'],
2940 ['enable_wexit_time_destructors==1 and OS!="win"', {
2941 # TODO: Enable on Windows too, http://crbug.com/404525
2942 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
2944 ['chromium_code==0', {
2946 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
2947 # We don't want to get warnings from third-party code,
2948 # so remove any existing warning-enabling flags like -Wall.
2954 # Don't warn about hash_map in third-party code.
2958 # Don't warn about printf format problems.
2959 # This is off by default in gcc but on in Ubuntu's gcc(!).
2963 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
2967 # TODO: Fix all warnings on chromeos too.
2968 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
2973 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
2975 # Don't warn about ignoring the return value from e.g. close().
2976 # This is off by default in some gccs but on by default in others.
2977 # BSD systems do not support this option, since they are usually
2978 # using gcc 4.2.1, which does not have this flag yet.
2979 '-Wno-unused-result',
2984 '_CRT_SECURE_NO_DEPRECATE',
2985 '_CRT_NONSTDC_NO_WARNINGS',
2986 '_CRT_NONSTDC_NO_DEPRECATE',
2987 '_SCL_SECURE_NO_DEPRECATE',
2989 'msvs_disabled_warnings': [4800],
2991 'VCCLCompilerTool': {
2992 'WarningLevel': '3',
2993 'WarnAsError': 'true',
2994 'Detect64BitPortabilityProblems': 'false',
2998 ['buildtype=="Official"', {
3000 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3005 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3010 # TODO(darin): Unfortunately, some third_party code depends on base.
3011 [ 'OS=="win" and component=="shared_library"', {
3012 'msvs_disabled_warnings': [
3013 4251, # class 'std::xx' needs to have dll-interface.
3016 [ 'OS=="mac" or OS=="ios"', {
3018 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3021 ['buildtype=="Official"', {
3023 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3030 # TODO(ios): Fix remaining warnings in third-party code, then
3031 # remove this; the Mac cleanup didn't get everything that's
3032 # flagged in an iOS build.
3033 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3034 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3035 # Several internal ios directories generate numerous warnings for
3036 # -Wobjc-missing-property-synthesis.
3037 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3043 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3044 'filename_rules.gypi',
3046 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3047 # C99 macros on Mac and Linux.
3049 '__STDC_CONSTANT_MACROS',
3050 '__STDC_FORMAT_MACROS',
3054 # turn on warnings for signed/unsigned mismatch on chromium code.
3056 'VCCLCompilerTool': {
3057 'AdditionalOptions': ['/we4389'],
3061 ['OS=="win" and component=="shared_library"', {
3062 'msvs_disabled_warnings': [
3063 4251, # class 'std::xx' needs to have dll-interface.
3068 ], # target_conditions for 'target_defaults'
3069 'default_configuration': 'Debug',
3071 # VCLinkerTool LinkIncremental values below:
3073 # 1 == /INCREMENTAL:NO
3075 # Debug links incremental, Release does not.
3077 # Abstract base configurations to cover common attributes.
3081 'msvs_configuration_attributes': {
3082 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3083 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3084 'CharacterSet': '1',
3086 # Add the default import libs.
3089 'AdditionalDependencies': [
3113 'MinimumRequiredVersion': '5.01', # XP.
3114 'TargetMachine': '1',
3116 'VCLibrarianTool': {
3117 'TargetMachine': '1',
3120 'msvs_configuration_platform': 'Win32',
3124 'msvs_configuration_platform': 'x64',
3127 # Make sure to understand http://crbug.com/361720 if you want to
3129 'MinimumRequiredVersion': '5.02', # Server 2003.
3130 'TargetMachine': '17', # x86 - 64
3131 'AdditionalLibraryDirectories!':
3132 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3133 'AdditionalLibraryDirectories':
3134 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3135 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3136 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3138 'VCLibrarianTool': {
3139 'AdditionalLibraryDirectories!':
3140 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3141 'AdditionalLibraryDirectories':
3142 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3143 'TargetMachine': '17', # x64
3150 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3151 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3154 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3156 '<@(debug_extra_cflags)',
3160 'VCCLCompilerTool': {
3161 'Optimization': '<(win_debug_Optimization)',
3162 'PreprocessorDefinitions': ['_DEBUG'],
3163 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3164 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3166 # According to MSVS, InlineFunctionExpansion=0 means
3167 # "default inlining", not "/Ob0".
3168 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3169 ['win_debug_InlineFunctionExpansion==0', {
3170 'AdditionalOptions': ['/Ob0'],
3172 ['win_debug_InlineFunctionExpansion!=""', {
3173 'InlineFunctionExpansion':
3174 '<(win_debug_InlineFunctionExpansion)',
3176 ['win_debug_disable_iterator_debugging==1', {
3177 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3180 # if win_debug_OmitFramePointers is blank, leave as default
3181 ['win_debug_OmitFramePointers==1', {
3182 'OmitFramePointers': 'true',
3184 ['win_debug_OmitFramePointers==0', {
3185 'OmitFramePointers': 'false',
3186 # The above is not sufficient (http://crbug.com/106711): it
3187 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3188 # perform FPO regardless, so we must explicitly disable.
3189 # We still want the false setting above to avoid having
3190 # "/Oy /Oy-" and warnings about overriding.
3191 'AdditionalOptions': ['/Oy-'],
3194 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3197 'LinkIncremental': '<(msvs_debug_link_incremental)',
3198 # ASLR makes debugging with windbg difficult because Chrome.exe and
3199 # Chrome.dll share the same base name. As result, windbg will
3200 # name the Chrome.dll module like chrome_<base address>, where
3201 # <base address> typically changes with each launch. This in turn
3202 # means that breakpoints in Chrome.dll don't stick from one launch
3203 # to the next. For this reason, we turn ASLR off in debug builds.
3204 # Note that this is a three-way bool, where 0 means to pick up
3205 # the default setting, 1 is off and 2 is on.
3206 'RandomizedBaseAddress': 1,
3208 'VCResourceCompilerTool': {
3209 'PreprocessorDefinitions': ['_DEBUG'],
3213 ['OS=="linux" or OS=="android"', {
3214 'target_conditions': [
3215 ['_toolset=="target"', {
3217 '<@(debug_extra_cflags)',
3222 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3223 # Enable libstdc++ debugging facilities to help catch problems
3224 # early, see http://crbug.com/65151 .
3225 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3226 'defines': ['_GLIBCXX_DEBUG=1',],
3228 ['release_valgrind_build==0', {
3231 '-fstack-protector-all', # Implies -fstack-protector
3237 # Allow comparing the address of references and 'this' against 0
3238 # in debug builds. Technically, these can never be null in
3239 # well-defined C/C++ and Clang can optimize such checks away in
3240 # release builds, but they may be used in asserts in debug builds.
3241 '-Wno-undefined-bool-conversion',
3242 '-Wno-tautological-undefined-compare',
3246 '-Wno-undefined-bool-conversion',
3247 '-Wno-tautological-undefined-compare',
3251 'VCCLCompilerTool': {
3252 'AdditionalOptions': [
3253 '-Wno-undefined-bool-conversion',
3254 '-Wno-tautological-undefined-compare',
3267 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3268 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3269 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3272 'VCCLCompilerTool': {
3273 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3275 # In official builds, each target will self-select
3276 # an optimization level.
3277 ['buildtype!="Official"', {
3278 'Optimization': '<(win_release_Optimization)',
3281 # According to MSVS, InlineFunctionExpansion=0 means
3282 # "default inlining", not "/Ob0".
3283 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3284 ['win_release_InlineFunctionExpansion==0', {
3285 'AdditionalOptions': ['/Ob0'],
3287 ['win_release_InlineFunctionExpansion!=""', {
3288 'InlineFunctionExpansion':
3289 '<(win_release_InlineFunctionExpansion)',
3292 # if win_release_OmitFramePointers is blank, leave as default
3293 ['win_release_OmitFramePointers==1', {
3294 'OmitFramePointers': 'true',
3296 ['win_release_OmitFramePointers==0', {
3297 'OmitFramePointers': 'false',
3298 # The above is not sufficient (http://crbug.com/106711): it
3299 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3300 # perform FPO regardless, so we must explicitly disable.
3301 # We still want the false setting above to avoid having
3302 # "/Oy /Oy-" and warnings about overriding.
3303 'AdditionalOptions': ['/Oy-'],
3306 'AdditionalOptions': [
3307 '/d2Zi+', # Improve debugging of Release builds.
3308 '<@(win_release_extra_cflags)',
3312 # LinkIncremental is a tri-state boolean, where 0 means default
3313 # (i.e., inherit from parent solution), 1 means false, and
3315 'LinkIncremental': '1',
3316 # This corresponds to the /PROFILE flag which ensures the PDB
3317 # file contains FIXUP information (growing the PDB file by about
3318 # 5%) but does not otherwise alter the output binary. This
3319 # information is used by the Syzygy optimization tool when
3320 # decomposing the release image.
3325 ['msvs_use_common_release', {
3326 'includes': ['release.gypi'],
3328 ['release_valgrind_build==0 and tsan==0', {
3331 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3335 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3336 'MEMORY_SANITIZER_INITIAL_SIZE',
3337 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3338 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3341 ['win_use_allocator_shim==0', {
3342 'defines': ['NO_TCMALLOC'],
3344 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3345 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3346 # It seems to work fine with Ubuntu 12 headers though, so use it
3347 # in official builds.
3348 ['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")', {
3349 'target_conditions': [
3350 ['chromium_code==1', {
3351 # Non-chromium code is not guaranteed to compile cleanly
3352 # with _FORTIFY_SOURCE. Also, fortified build may fail
3353 # when optimizations are disabled, so only do that for Release
3356 '_FORTIFY_SOURCE=2',
3361 ['OS=="linux" or OS=="android"', {
3362 'target_conditions': [
3363 ['_toolset=="target"', {
3365 '<@(release_extra_cflags)',
3368 ['enable_resource_whitelist_generation==1', {
3370 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3379 'NS_BLOCK_ASSERTIONS=1',
3385 # Concrete configurations
3388 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3391 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3396 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3397 'target_conditions': [
3398 [ '_type=="executable"', {
3399 # To get a real .dSYM bundle produced by dsymutil, set the
3400 # debug information format to dwarf-with-dsym. Since
3401 # strip_from_xcode will not be used, set Xcode to do the
3402 # stripping as well.
3404 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3405 'DEPLOYMENT_POSTPROCESSING': 'YES',
3406 'STRIP_INSTALLED_PRODUCT': 'YES',
3413 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3415 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3418 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3426 'target_defaults': {
3433 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3434 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3435 'target_defaults': {
3437 '-Wl,--fatal-warnings',
3441 ['os_posix==1 and chromeos==0', {
3442 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3443 # and we want to avoid overriding this, so stack-protector is only
3444 # enabled when not building on Chrome OS.
3445 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3447 'target_defaults': {
3449 '-fstack-protector',
3450 '--param=ssp-buffer-size=4',
3454 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3455 'target_defaults': {
3456 # Enable -Werror by default, but put it in a variable so it can
3457 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3459 'werror%': '-Werror',
3460 'libraries_for_target%': '',
3463 '_FILE_OFFSET_BITS=64',
3466 '<(werror)', # See note above about the werror variable.
3469 '-fno-strict-aliasing', # See http://crbug.com/32204
3471 # TODO(evan): turn this back on once all the builds work.
3473 # Don't warn about unused function params. We use those everywhere.
3474 '-Wno-unused-parameter',
3475 # Don't warn about the "struct foo f = {0};" initialization pattern.
3476 '-Wno-missing-field-initializers',
3477 # Don't export any symbols (for example, to plugins we dlopen()).
3478 # Note: this is *required* to make some plugins work.
3479 '-fvisibility=hidden',
3484 '-fno-threadsafe-statics',
3485 # Make inline functions have hidden visiblity by default.
3486 # Surprisingly, not covered by -fvisibility=hidden.
3487 '-fvisibility-inlines-hidden',
3488 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3489 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3493 '-pthread', '-Wl,-z,noexecstack',
3496 '<(libraries_for_target)',
3501 'debug_optimize%': '0',
3507 '-O>(debug_optimize)',
3513 # Warn in case of text relocations.
3514 '-Wl,--warn-shared-textrel',
3517 ['OS=="android" and android_full_debug==0', {
3518 # Some configurations are copied from Release_Base to reduce
3521 'debug_optimize%': 's',
3525 '-ffunction-sections',
3532 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3533 # We don't omit frame pointers on arm64 since they are required
3534 # to correctly unwind stackframes which contain system library
3535 # function frames (crbug.com/391706).
3537 '-fomit-frame-pointer',
3540 ['OS=="linux" and target_arch=="ia32"', {
3542 '-Wl,--no-as-needed',
3545 ['debug_unwind_tables==1', {
3546 'cflags': ['-funwind-tables'],
3548 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3550 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3551 # definitions in to the right scope to use them when setting
3552 # linux_use_debug_fission, so it can be used here alone.
3553 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3554 'cflags': ['-gsplit-dwarf'],
3560 'release_optimize%': '2',
3561 # Binaries become big and gold is unable to perform GC
3562 # and remove unused sections for some of test targets
3563 # on 32 bit platform.
3564 # (This is currently observed only in chromeos valgrind bots)
3565 # The following flag is to disable --gc-sections linker
3566 # option for these bots.
3567 'no_gc_sections%': 0,
3569 # TODO(bradnelson): reexamine how this is done if we change the
3570 # expansion of configurations
3571 'release_valgrind_build%': 0,
3574 '-O<(release_optimize)',
3575 # Don't emit the GCC version ident directives, they just end up
3576 # in the .comment section taking up binary size.
3578 # Put data and code in their own sections, so that unused symbols
3579 # can be removed at link time with --gc-sections.
3581 '-ffunction-sections',
3584 # Specifically tell the linker to perform optimizations.
3585 # See http://lwn.net/Articles/192624/ .
3590 ['no_gc_sections==0', {
3592 '-Wl,--gc-sections',
3595 ['OS=="android" and target_arch!="arm64"', {
3596 # We don't omit frame pointers on arm64 since they are required
3597 # to correctly unwind stackframes which contain system library
3598 # function frames (crbug.com/391706).
3600 '-fomit-frame-pointer',
3605 'release_optimize%': 's',
3608 # Warn in case of text relocations.
3609 '-Wl,--warn-shared-textrel',
3616 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed
3617 # and the fix is in chromium.
3618 'cflags': [ '-fno-slp-vectorize', ],
3622 '-fno-omit-frame-pointer',
3626 ['profiling_full_stack_frames==1', {
3629 '-fno-optimize-sibling-calls',
3634 ['release_unwind_tables==1', {
3635 'cflags': ['-funwind-tables'],
3637 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3643 ['target_arch=="ia32"', {
3644 'target_conditions': [
3645 ['_toolset=="target"', {
3647 # Needed so that libs with .s files (e.g. libicudata.a)
3648 # are compatible with the general 32-bit-ness.
3651 # All floating-point computations on x87 happens in 80-bit
3652 # precision. Because the C and C++ language standards allow
3653 # the compiler to keep the floating-point values in higher
3654 # precision than what's specified in the source and doing so
3655 # is more efficient than constantly rounding up to 64-bit or
3656 # 32-bit precision as specified in the source, the compiler,
3657 # especially in the optimized mode, tries very hard to keep
3658 # values in x87 floating-point stack (in 80-bit precision)
3659 # as long as possible. This has important side effects, that
3660 # the real value used in computation may change depending on
3661 # how the compiler did the optimization - that is, the value
3662 # kept in 80-bit is different than the value rounded down to
3663 # 64-bit or 32-bit. There are possible compiler options to
3664 # make this behavior consistent (e.g. -ffloat-store would keep
3665 # all floating-values in the memory, thus force them to be
3666 # rounded to its original precision) but they have significant
3667 # runtime performance penalty.
3669 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3670 # which keep floating-point values in SSE registers in its
3671 # native precision (32-bit for single precision, and 64-bit
3672 # for double precision values). This means the floating-point
3673 # value used during computation does not change depending on
3674 # how the compiler optimized the code, since the value is
3675 # always kept in its specified precision.
3677 # Refer to http://crbug.com/348761 for rationale behind SSE2
3678 # being a minimum requirement for 32-bit Linux builds and
3679 # http://crbug.com/313032 for an example where this has "bit"
3684 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3691 # Use gold linker for Android ia32 target.
3697 # Install packages have started cropping up with
3698 # different headers between the 32-bit and 64-bit
3699 # versions, so we have to shadow those differences off
3700 # and make sure a 32-bit-on-64-bit build picks up the
3702 # For android build, use NDK headers instead of host headers
3703 ['host_arch!="ia32" and OS!="android"', {
3712 ['target_arch=="x64"', {
3713 'target_conditions': [
3714 ['_toolset=="target"', {
3716 # Use gold linker for Android x64 target.
3733 ['target_arch=="arm"', {
3734 'target_conditions': [
3735 ['_toolset=="target"', {
3739 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3740 # has changed whenever it encounters a varargs function. This
3741 # silences those warnings, as they are not helpful and
3742 # clutter legitimate warnings.
3746 ['clang==1 and arm_arch!="" and OS!="android"', {
3748 '-target arm-linux-gnueabihf',
3751 '-target arm-linux-gnueabihf',
3756 '-march=<(arm_arch)',
3759 ['clang==1 and OS!="android"', {
3761 # We need to disable clang's builtin assembler as it can't
3762 # handle several asm files, crbug.com/124610
3763 '-no-integrated-as',
3768 '-mtune=<(arm_tune)',
3776 ['arm_float_abi!=""', {
3778 '-mfloat-abi=<(arm_float_abi)',
3787 # Most of the following flags are derived from what Android
3788 # uses by default when building for arm, reference for which
3789 # can be found in the following file in the Android NDK:
3790 # toolchains/arm-linux-androideabi-4.8/setup.mk
3792 # The tree-sra optimization (scalar replacement for
3793 # aggregates enabling subsequent optimizations) leads to
3794 # invalid code generation when using the Android NDK's
3795 # compiler (r5-r7). This can be verified using
3796 # webkit_unit_tests' WTF.Checked_int8_t test.
3798 # The following 6 options are disabled to save on
3799 # binary size in gcc 4.8.
3800 # TODO(fdegans) Reevaluate when we upgrade GCC.
3801 '-fno-partial-inlining',
3802 '-fno-early-inlining',
3803 '-fno-tree-copy-prop',
3804 '-fno-tree-loop-optimize',
3805 '-fno-move-loop-invariants',
3806 '-fno-caller-saves',
3809 # Android now supports .relro sections properly.
3810 # NOTE: While these flags enable the generation of .relro
3811 # sections, the generated libraries can still be loaded on
3812 # older Android platform versions.
3820 'cflags': [ '-mthumb-interwork' ],
3824 # Thumb code with frame pointer makes chrome crash
3827 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3828 # The perf report sometimes incorrectly attributes
3829 # code from tail calls.
3830 '-fno-optimize-sibling-calls',
3833 '-fomit-frame-pointer',
3838 # Clang does not support the following options.
3839 '-mthumb-interwork',
3840 '-finline-limit=64',
3842 '-fno-partial-inlining',
3843 '-fno-early-inlining',
3844 '-fno-tree-copy-prop',
3845 '-fno-tree-loop-optimize',
3846 '-fno-move-loop-invariants',
3847 '-fno-caller-saves',
3851 # TODO(hans) Enable integrated-as (crbug.com/124610).
3852 '-no-integrated-as',
3853 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3856 # Let clang find the ld.gold in the NDK.
3857 '--gcc-toolchain=<(android_toolchain)/..',
3862 '-marm', # Required for frame pointer based stack traces.
3869 # We set arm_arch to "" so that -march compiler option
3870 # is not set. Otherwise a gcc bug that would complain
3871 # about it conflicting with '-mcpu=cortex-a9'. The flag
3872 # '-march=armv7-a' is actually redundant anyway because
3873 # it is enabled by default when we built the toolchain.
3874 # And using '-mcpu=cortex-a9' should be sufficient.
3877 # Breakpad requires symbols with debugging information
3881 # We want to statically link libstdc++/libgcc_s.
3882 '-static-libstdc++',
3886 # Some components in Chromium (e.g. v8, skia, ffmpeg)
3887 # define their own cflags for arm builds that could
3888 # conflict with the flags we set here (e.g.
3889 # '-mcpu=cortex-a9'). Remove these flags explicitly.
3898 ['target_arch=="arm64"', {
3899 'target_conditions': [
3900 ['_toolset=="target"', {
3904 '-fstack-protector', # stack protector is always enabled on arm64.
3911 ['target_arch=="mipsel"', {
3912 'target_conditions': [
3913 ['_toolset=="target"', {
3915 ['android_webview_build==0 and mips_arch_variant=="mips32r2"', {
3916 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
3918 ['android_webview_build==0 and mips_arch_variant!="mips32r2"', {
3919 'cflags': ['-mips32', '-Wa,-mips32'],
3928 '-Wl,--no-keep-memory'
3931 '-Wno-uninitialized',
3945 'target_conditions': [
3946 ['_toolset=="target"', {
3948 '--sysroot=<(sysroot)',
3951 '--sysroot=<(sysroot)',
3952 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
3958 # TODO(thakis): Remove, http://crbug.com/263960
3959 '-Wno-reserved-user-defined-literal',
3962 # See the comment in the Mac section for what it takes to move
3963 # this to -std=c++11.
3967 ['clang==0 and host_clang==1', {
3968 'target_conditions': [
3969 ['_toolset=="host"', {
3970 'cflags_cc': [ '-std=gnu++11', ],
3974 ['clang==1 and clang_use_chrome_plugins==1', {
3976 '<@(clang_chrome_plugins_flags)',
3979 ['clang==1 and clang_load!=""', {
3981 '-Xclang', '-load', '-Xclang', '<(clang_load)',
3984 ['clang==1 and clang_add_plugin!=""', {
3986 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
3989 ['clang==1 and target_arch=="ia32"', {
3991 # Else building libyuv gives clang's register allocator issues,
3992 # see llvm.org/PR15798 / crbug.com/233709
3993 '-momit-leaf-frame-pointer',
3996 ['clang==1 and "<(GENERATOR)"=="ninja"', {
3998 # See http://crbug.com/110262
3999 '-fcolor-diagnostics',
4002 # Common options for AddressSanitizer, LeakSanitizer,
4003 # ThreadSanitizer and MemorySanitizer.
4004 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4005 'target_conditions': [
4006 ['_toolset=="target"', {
4008 '-fno-omit-frame-pointer',
4009 '-gline-tables-only',
4012 '-fomit-frame-pointer',
4017 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4018 'target_conditions': [
4019 ['_toolset=="target"', {
4021 # Functions interposed by the sanitizers can make ld think
4022 # that some libraries aren't needed when they actually are,
4023 # http://crbug.com/234010. As workaround, disable --as-needed.
4027 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4028 'MEMORY_SANITIZER_INITIAL_SIZE',
4032 # TODO(glider): enable the default options on other systems.
4034 ['use_sanitizer_options==1 and OS=="linux" and (chromeos==0 or target_arch!="ia32")', {
4036 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
4042 'target_conditions': [
4043 ['_toolset=="target"', {
4045 '-fsanitize=address',
4048 '-fsanitize=address',
4055 '-mllvm -asan-globals=0', # http://crbug.com/352073
4061 'target_conditions': [
4062 ['_toolset=="target"', {
4064 '-fsanitize=undefined',
4065 # -fsanitize=vptr is incompatible with -fno-rtti.
4066 '-fno-sanitize=vptr',
4069 '-fsanitize=undefined',
4070 # -fsanitize=vptr is incompatible with -fno-rtti.
4071 '-fno-sanitize=vptr',
4077 'target_conditions': [
4078 ['_toolset=="target"', {
4081 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4093 'UNDEFINED_SANITIZER',
4098 ['asan_coverage!=0', {
4099 'target_conditions': [
4100 ['_toolset=="target"', {
4102 '-mllvm -asan-coverage=<(asan_coverage)',
4108 'target_conditions': [
4109 ['_toolset=="target"', {
4118 'WTF_USE_LEAK_SANITIZER=1',
4124 'target_conditions': [
4125 ['_toolset=="target"', {
4127 '-fsanitize=thread',
4129 '-fsanitize-blacklist=<(tsan_blacklist)',
4132 '-fsanitize=thread',
4136 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4137 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4139 'target_conditions': [
4140 ['_type=="executable"', {
4150 'target_conditions': [
4151 ['_toolset=="target"', {
4153 '-fsanitize=memory',
4154 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4156 '-fsanitize-blacklist=<(msan_blacklist)',
4159 '-fsanitize=memory',
4164 'target_conditions': [
4165 ['_type=="executable"', {
4174 ['use_instrumented_libraries==1', {
4176 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4179 ['use_custom_libcxx==1', {
4181 '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
4184 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4185 'target_conditions' : [
4186 # crazy_linker has an upstream gyp file we can't edit, and we
4187 # don't want to instrument it.
4188 ['_toolset=="target" and _target_name!="crazy_linker"', {
4190 '-finstrument-functions',
4191 # Allow mmx intrinsics to inline, so that the
4192 #0 compiler can expand the intrinsics.
4193 '-finstrument-functions-exclude-file-list=mmintrin.h',
4196 ['_toolset=="target" and OS=="android"', {
4198 # Avoids errors with current NDK:
4199 # "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"
4200 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4205 ['linux_dump_symbols==1', {
4208 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4209 'target_conditions': [
4210 ['_toolset=="target"', {
4212 # Attempt to use less memory to prevent the linker from
4213 # running out of address space. Considering installing a
4214 # 64-bit kernel and switching to a 64-bit linker.
4215 '-Wl,--no-keep-memory',
4222 ['use_allocator!="tcmalloc"', {
4223 'defines': ['NO_TCMALLOC'],
4225 ['linux_use_gold_flags==1', {
4226 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4228 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4229 'ldflags': [ '-fuse-ld=gold', ],
4231 'target_conditions': [
4232 ['_toolset=="target"', {
4234 # Experimentation found that using four linking threads
4235 # saved ~20% of link time.
4236 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4237 # Only apply this to the target linker, since the host
4238 # linker might not be gold, but isn't used much anyway.
4239 # TODO(raymes): Disable threading because gold is frequently
4240 # crashing on the bots: crbug.com/161942.
4242 # '-Wl,--thread-count=4',
4247 ['release_valgrind_build==0', {
4248 'target_conditions': [
4249 ['_toolset=="target"', {
4251 # There seems to be a conflict of --icf and -pie
4252 # in gold which can generate crashy binaries. As
4253 # a security measure, -pie takes precedence for
4263 ['linux_use_bundled_binutils==1', {
4265 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4268 ['linux_use_bundled_gold==1', {
4269 # Put our binutils, which contains gold in the search path. We pass
4270 # the path to gold to the compiler. gyp leaves unspecified what the
4271 # cwd is when running the compiler, so the normal gyp path-munging
4272 # fails us. This hack gets the right path.
4274 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4277 # Some binutils 2.23 releases may or may not have new dtags enabled,
4278 # but they are all compatible with --disable-new-dtags,
4279 # because the new dynamic tags are not created by default.
4280 ['binutils_version>=223', {
4281 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4282 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4283 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4284 # inside this file to allow usage of --no-as-needed and removal of
4287 '-Wl,--disable-new-dtags',
4290 ['gcc_version>=47 and clang==0', {
4291 'target_conditions': [
4292 ['_toolset=="target"', {
4295 # See comment for -Wno-c++11-narrowing.
4297 # TODO(thakis): Remove, http://crbug.com/263960
4298 '-Wno-literal-suffix',
4303 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4304 'target_conditions': [
4305 ['_toolset=="host"', {
4308 # See comment for -Wno-c++11-narrowing.
4310 # TODO(thakis): Remove, http://crbug.com/263960
4311 '-Wno-literal-suffix',
4319 # FreeBSD-specific options; note that most FreeBSD options are set above,
4322 'target_defaults': {
4324 '-Wl,--no-keep-memory',
4328 # Android-specific options; note that most are set above with Linux.
4331 # This is a unique identifier for a given build. It's used for
4332 # identifying various build artifacts corresponding to a particular
4333 # build of chrome (e.g. where to find archived symbols).
4334 'chrome_build_id%': '',
4336 # Use shared stlport library when system one used.
4337 # Figure this out early since it needs symbols from libgcc.a, so it
4338 # has to be before that in the set of libraries.
4339 ['use_system_stlport==1', {
4340 'android_stlport_library': 'stlport',
4343 ['component=="shared_library"', {
4344 'android_stlport_library': 'stlport_shared',
4346 'android_stlport_library': 'stlport_static',
4352 # Placing this variable here prevents from forking libvpx, used
4353 # by remoting. Remoting is off, so it needn't built,
4354 # so forking it's deps seems like overkill.
4355 # But this variable need defined to properly run gyp.
4356 # A proper solution is to have an OS==android conditional
4357 # in third_party/libvpx/libvpx.gyp to define it.
4358 'libvpx_path': 'lib/linux/arm',
4360 'target_defaults': {
4362 'release_extra_cflags%': '',
4364 # If we're using the components build, append "cr" to all shared
4365 # libraries to avoid naming collisions with android system library
4366 # versions with the same name (e.g. skia, icu).
4367 ['component=="shared_library"', {
4368 'android_product_extension': 'cr.so',
4370 'android_product_extension': 'so',
4374 'target_conditions': [
4375 ['_type=="shared_library"', {
4376 'product_extension': '<(android_product_extension)',
4379 # Settings for building device targets using Android's toolchain.
4380 # These are based on the setup.mk file from the Android NDK.
4382 # The NDK Android executable link step looks as follows:
4384 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4385 # $(PRIVATE_OBJECTS) <-- The .o that we built
4386 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4387 # $(TARGET_LIBGCC) <-- libgcc.a
4388 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4389 # $(PRIVATE_LDLIBS) <-- System .so
4390 # $(TARGET_CRTEND_O) <-- crtend.o
4392 # For now the above are approximated for executables by adding
4393 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4396 # The NDK Android shared library link step looks as follows:
4398 # $(PRIVATE_OBJECTS) <-- The .o that we built
4399 # -l,--whole-archive
4400 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4401 # -l,--no-whole-archive
4402 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4403 # $(TARGET_LIBGCC) <-- libgcc.a
4404 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4405 # $(PRIVATE_LDLIBS) <-- System .so
4407 # For now, assume that whole static libraries are not needed.
4409 # For both executables and shared libraries, add the proper
4410 # libgcc.a to the start of libraries which puts it in the
4411 # proper spot after .o and .a files get linked in.
4413 # TODO: The proper thing to do longer-tem would be proper gyp
4414 # support for a custom link command line.
4415 ['_toolset=="target"', {
4417 '-pthread', # Not supported by Android toolchain.
4420 '-ffunction-sections',
4423 '-fstack-protector',
4425 '-finline-limit=64',
4426 '-Wa,--noexecstack',
4427 '<@(release_extra_cflags)',
4431 '__GNU_SOURCE=1', # Necessary for clone()
4433 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4434 'CHROME_BUILD_ID="<(chrome_build_id)"',
4437 '-pthread', # Not supported by Android toolchain.
4441 '-Wl,--no-undefined',
4444 '-l<(android_stlport_library)',
4445 # Manually link the libgcc.a that the cross compiler uses.
4446 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4452 ['component=="static_library"', {
4454 '-Wl,--exclude-libs=ALL',
4459 # Work around incompatibilities between bionic and clang
4461 '-D__compiler_offsetof=__builtin_offsetof',
4462 '-Dnan=__builtin_nan',
4465 ['target_arch=="arm"', {
4467 '-target arm-linux-androideabi',
4470 '-target arm-linux-androideabi',
4473 ['target_arch=="ia32"', {
4475 '-target x86-linux-androideabi',
4478 '-target x86-linux-androideabi',
4481 # Place holder for x64 support, not tested.
4482 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4483 ['target_arch=="x64"', {
4485 '-target x86_64-linux-androideabi',
4488 '-target x86_64-linux-androideabi',
4495 # Android build relies on -Wl,--gc-sections removing
4496 # unreachable code. ASan instrumentation for globals inhibits
4497 # this and results in a library with unresolvable relocations.
4498 # TODO(eugenis): find a way to reenable this.
4499 '-mllvm -asan-globals=0',
4502 ['android_webview_build==0', {
4504 # The NDK has these things, but doesn't define the constants
4505 # to say that it does. Define them here instead.
4509 '--sysroot=<(android_ndk_sysroot)',
4512 '--sysroot=<(android_ndk_sysroot)',
4515 ['android_webview_build==1', {
4517 # OpenAL headers from the Android tree.
4518 '<(android_src)/frameworks/wilhelm/include',
4521 # Android predefines this as 1; undefine it here so Chromium
4522 # can redefine it later to be 2 for chromium code and unset
4523 # for third party code. This works because cflags are added
4525 '-U_FORTIFY_SOURCE',
4526 # Disable any additional warnings enabled by the Android build system but which
4527 # chromium does not build cleanly with (when treating warning as errors).
4528 # Things that are part of -Wextra:
4529 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4530 '-Wno-ignored-qualifiers',
4532 '-Wno-unused-but-set-variable',
4535 # Other things unrelated to -Wextra:
4536 '-Wno-non-virtual-dtor',
4540 ['android_webview_build==1', {
4541 'target_conditions': [
4542 ['chromium_code==0', {
4544 # There is a class of warning which:
4545 # 1) Android always enables and also treats as errors
4546 # 2) Chromium ignores in third party code
4547 # So we re-enable those warnings when building Android.
4549 '-Wno-format-security',
4551 '-Wno-sequence-point',
4554 '-Wno-non-virtual-dtor',
4559 ['target_arch == "arm"', {
4561 # Enable identical code folding to reduce size.
4565 # NOTE: The stlport header include paths below are specified in
4566 # cflags rather than include_dirs because they need to come
4567 # after include_dirs. Think of them like system headers, but
4568 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4569 # toolchain (circa Gingerbread) will exhibit strange errors.
4570 # The include ordering here is important; change with caution.
4571 ['use_system_stlport==1', {
4573 # For libstdc++/include, which is used by stlport.
4574 '-I<(android_src)/bionic',
4575 '-I<(android_src)/external/stlport/stlport',
4577 }, { # else: use_system_stlport!=1
4579 '-isystem<(android_stlport_include)',
4582 '-L<(android_stlport_libs_dir)',
4585 ['target_arch=="ia32"', {
4586 # The x86 toolchain currently has problems with stack-protector.
4588 '-fstack-protector',
4591 '-fno-stack-protector',
4595 'target_conditions': [
4596 ['_type=="executable"', {
4597 # Force android tools to export the "main" symbol so they can be
4598 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4599 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4600 # when ICS support will be dropped.
4603 '-fvisibility=default',
4607 '-Wl,--gc-sections',
4608 '-Wl,-z,nocopyreloc',
4611 # crtbegin_dynamic.o should be the last item in ldflags.
4612 '<(android_ndk_lib)/crtbegin_dynamic.o',
4615 # crtend_android.o needs to be the last item in libraries.
4616 # Do not add any libraries after this!
4617 '<(android_ndk_lib)/crtend_android.o',
4620 ['_type=="shared_library" or _type=="loadable_module"', {
4622 '-Wl,--exclude-libs=ALL',
4625 '-Wl,-shared,-Bsymbolic',
4628 ['android_webview_build==0', {
4630 # crtbegin_so.o should be the last item in ldflags.
4631 '<(android_ndk_lib)/crtbegin_so.o',
4634 # crtend_so.o needs to be the last item in libraries.
4635 # Do not add any libraries after this!
4636 '<(android_ndk_lib)/crtend_so.o',
4643 # Settings for building host targets using the system toolchain.
4644 ['_toolset=="host"', {
4646 # Due to issues in Clang build system, using ASan on 32-bit
4647 # binaries on x86_64 host is problematic.
4648 # TODO(eugenis): re-enable.
4649 '-fsanitize=address',
4652 '-fsanitize=address',
4653 '-Wl,-z,noexecstack',
4654 '-Wl,--gc-sections',
4657 '-Wl,--warn-shared-textrel',
4658 '-Wl,--fatal-warnings',
4661 # Settings for building host targets on mac.
4662 ['_toolset=="host" and host_os=="mac"', {
4672 'cflags!': ['-fvisibility=hidden'],
4673 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4675 ['OS=="mac" or OS=="ios"', {
4676 'target_defaults': {
4679 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4680 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4681 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4682 'COPY_PHASE_STRIP': 'NO',
4683 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4684 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4685 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4686 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4687 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4688 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4689 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4690 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4691 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4692 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4693 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4694 'GCC_VERSION': '4.2',
4695 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4696 'USE_HEADERMAP': 'NO',
4701 # Don't warn about unused function parameters.
4702 '-Wno-unused-parameter',
4703 # Don't warn about the "struct foo f = {0};" initialization
4705 '-Wno-missing-field-initializers',
4708 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4709 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4711 # Note that the prebuilt Clang binaries should not be used for iOS
4712 # development except for ASan builds.
4714 # gnu++11 instead of c++11 is needed because some code uses
4715 # typeof() (a GNU extension).
4716 # TODO(thakis): Eventually switch this to c++11 instead of
4717 # gnu++11 (once typeof can be removed, which is blocked on c++11
4718 # being available everywhere).
4719 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', # -std=gnu++11
4720 # Warn if automatic synthesis is triggered with
4721 # the -Wobjc-missing-property-synthesis flag.
4722 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4723 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4725 # This warns on selectors from Cocoa headers (-length, -set).
4726 # cfe-dev is currently discussing the merits of this warning.
4727 # TODO(thakis): Reevaluate what to do with this, based one
4728 # cfe-dev discussion.
4729 '-Wno-selector-type-mismatch',
4732 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed
4733 # and the fix is in chromium.
4734 '-fno-slp-vectorize',
4738 ['clang_xcode==0', {
4739 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4740 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4744 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4746 '<@(clang_chrome_plugins_flags)',
4749 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4751 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4754 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4756 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4759 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4761 # See http://crbug.com/110262
4762 '-fcolor-diagnostics',
4765 ['OS=="ios" and target_subarch!="arm32" and \
4766 "<(GENERATOR)"=="xcode"', {
4768 # TODO(ios): when building Chrome for iOS on 64-bit platform
4769 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4770 # enabled. This cause failures when compiling protobuf code,
4771 # so disable the warning. http://crbug.com/359107
4772 '-Wno-shorten-64-to-32',
4780 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4786 '-fsanitize=address',
4787 '-mllvm -asan-globals=0', # http://crbug.com/352073
4788 '-gline-tables-only',
4792 ['asan_coverage!=0', {
4793 'target_conditions': [
4794 ['_toolset=="target"', {
4796 '-mllvm -asan-coverage=<(asan_coverage)',
4802 'target_conditions': [
4803 ['_type!="static_library"', {
4804 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4809 '-fsanitize=address',
4813 ['mac_write_linker_maps==1', {
4816 '-Wl,-map,>(_target_name).map',
4823 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4824 'target_conditions': [
4825 ['_type=="executable"', {
4831 # Define copy_asan_dylib_path in a variable ending in
4832 # _path so that gyp understands it's a path and
4833 # performs proper relativization during dict merging.
4834 'copy_asan_dylib_path':
4835 'mac/copy_asan_runtime_dylib.sh',
4837 'postbuild_name': 'Copy ASan runtime dylib',
4839 '<(copy_asan_dylib_path)',
4848 ], # target_conditions
4849 }, # target_defaults
4850 }], # OS=="mac" or OS=="ios"
4852 'target_defaults': {
4854 # Prevent Mac OS X AssertMacros.h from defining macros that collide
4855 # with common names, like 'check', 'require', and 'verify'.
4856 # (Included by system header. Also exists on iOS but not included.)
4857 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
4858 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
4861 # These should end with %, but there seems to be a bug with % in
4862 # variables that are intended to be set to different values in
4863 # different targets, like these.
4864 'mac_pie': 1, # Most executables can be position-independent.
4865 # Strip debugging symbols from the target.
4866 'mac_strip': '<(mac_strip_release)',
4870 ['mac_want_real_dsym=="default"', {
4873 'mac_real_dsym': '<(mac_want_real_dsym)'
4878 ['mac_want_real_dsym=="default"', {
4879 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
4881 'mac_real_dsym': '<(mac_want_real_dsym)'
4888 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
4889 # (Equivalent to -fPIC)
4890 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
4891 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
4892 # Keep pch files below xcodebuild/.
4893 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
4895 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
4896 # xcode_setting, but not until all downstream projects' mac bots are
4897 # using xcode >= 4.6, because that's when the default value of the
4898 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
4899 # setting is a no-op as far as xcode is concerned, but the compiler
4900 # behaves differently based on whether -fno-strict-aliasing is
4902 '-fno-strict-aliasing', # See http://crbug.com/32204.
4905 'target_conditions': [
4906 ['_type=="executable"', {
4909 # Arranges for data (heap) pages to be protected against
4910 # code execution when running on Mac OS X 10.7 ("Lion"), and
4911 # ensures that the position-independent executable (PIE) bit
4912 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
4914 # Define change_mach_o_flags in a variable ending in _path
4915 # so that GYP understands it's a path and performs proper
4916 # relativization during dict merging.
4917 'change_mach_o_flags_path':
4918 'mac/change_mach_o_flags_from_xcode.sh',
4919 'change_mach_o_flags_options%': [
4921 'target_conditions': [
4922 ['mac_pie==0 or release_valgrind_build==1', {
4923 # Don't enable PIE if it's unwanted. It's unwanted if
4924 # the target specifies mac_pie=0 or if building for
4925 # Valgrind, because Valgrind doesn't understand slide.
4926 # See the similar mac_pie/release_valgrind_build check
4928 'change_mach_o_flags_options': [
4934 'postbuild_name': 'Change Mach-O Flags',
4936 '<(change_mach_o_flags_path)',
4937 '>@(change_mach_o_flags_options)',
4944 'asan_saves_file': 'asan.saves',
4947 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
4951 'target_conditions': [
4952 ['mac_pie==1 and release_valgrind_build==0', {
4953 # Turn on position-independence (ASLR) for executables. When
4954 # PIE is on for the Chrome executables, the framework will
4955 # also be subject to ASLR.
4956 # Don't do this when building for Valgrind, because Valgrind
4957 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
4958 # understand slide, and get rid of the Valgrind check.
4961 '-Wl,-pie', # Position-independent executable (MH_PIE)
4967 ['(_type=="executable" or _type=="shared_library" or \
4968 _type=="loadable_module") and mac_strip!=0', {
4969 'target_conditions': [
4970 ['mac_real_dsym == 1', {
4971 # To get a real .dSYM bundle produced by dsymutil, set the
4972 # debug information format to dwarf-with-dsym. Since
4973 # strip_from_xcode will not be used, set Xcode to do the
4974 # stripping as well.
4978 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
4979 'DEPLOYMENT_POSTPROCESSING': 'YES',
4980 'STRIP_INSTALLED_PRODUCT': 'YES',
4981 'target_conditions': [
4982 ['_type=="shared_library" or _type=="loadable_module"', {
4983 # The Xcode default is to strip debugging symbols
4984 # only (-S). Local symbols should be stripped as
4985 # well, which will be handled by -x. Xcode will
4986 # continue to insert -S when stripping even when
4987 # additional flags are added with STRIPFLAGS.
4989 }], # _type=="shared_library" or _type=="loadable_module"
4990 ['_type=="executable"', {
4993 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
4996 }], # _type=="executable" and asan==1
4997 ], # target_conditions
4999 }, # configuration "Release"
5001 }, { # mac_real_dsym != 1
5002 # To get a fast fake .dSYM bundle, use a post-build step to
5003 # produce the .dSYM and strip the executable. strip_from_xcode
5004 # only operates in the Release configuration.
5008 # Define strip_from_xcode in a variable ending in _path
5009 # so that gyp understands it's a path and performs proper
5010 # relativization during dict merging.
5011 'strip_from_xcode_path': 'mac/strip_from_xcode',
5013 'postbuild_name': 'Strip If Needed',
5014 'action': ['<(strip_from_xcode_path)'],
5018 ], # target_conditions
5019 }], # (_type=="executable" or _type=="shared_library" or
5020 # _type=="loadable_module") and mac_strip!=0
5021 ], # target_conditions
5022 }, # target_defaults
5025 'target_defaults': {
5026 'xcode_settings' : {
5027 # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang
5029 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',
5032 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5033 # additional flag to suppress the "unknown compiler option" error.
5034 # Restrict this flag to builds that are either compiling with Xcode
5035 # or compiling with Xcode's Clang. This will allow Ninja builds to
5036 # continue failing on unknown compiler options.
5037 # TODO(rohitrao): This flag is temporary and should be removed as
5038 # soon as the iOS bots are updated to use Xcode 5.1.
5039 ['clang_xcode==1', {
5041 '-Wno-unknown-warning-option',
5045 # Limit the valid architectures depending on "target_subarch".
5046 # This need to include the "arm" architectures but also the "x86"
5047 # ones (they are used when building for the simulator).
5048 ['target_subarch=="arm32"', {
5049 'VALID_ARCHS': ['armv7', 'i386'],
5051 ['target_subarch=="arm64"', {
5052 'VALID_ARCHS': ['arm64', 'x86_64'],
5054 ['target_subarch=="both"', {
5055 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5057 ['use_system_libcxx==1', {
5058 'target_conditions': [
5059 # Only use libc++ when building target for iOS not when building
5060 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5061 # does not support libc++.
5062 ['_toolset=="target"', {
5063 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5067 # The default for deployment target of 7.0+ is libc++, so force
5068 # the old behavior unless libc++ is enabled.
5069 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5073 'target_conditions': [
5074 ['_toolset=="host"', {
5076 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5077 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5086 ['_toolset=="target"', {
5088 # This section should be for overriding host settings. But,
5089 # since we can't negate the iphone deployment target above, we
5090 # instead set it here for target only.
5091 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5092 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5095 ['_type=="executable"', {
5099 'DEPLOYMENT_POSTPROCESSING': 'YES',
5100 'STRIP_INSTALLED_PRODUCT': 'YES',
5105 # Remove dSYM to reduce build time.
5106 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5112 ['chromium_ios_signing', {
5113 # iOS SDK wants everything for device signed.
5114 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5116 'CODE_SIGNING_REQUIRED': 'NO',
5117 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5122 ], # target_conditions
5123 }, # target_defaults
5126 'target_defaults': {
5128 '_WIN32_WINNT=0x0602',
5135 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5136 'WIN32_LEAN_AND_MEAN',
5138 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5139 '_HAS_EXCEPTIONS=0',
5142 ['buildtype=="Official"', {
5143 # In official builds, targets can self-select an optimization
5144 # level by defining a variable named 'optimize', and setting it
5146 # - "size", optimizes for minimal code size - the default.
5147 # - "speed", optimizes for speed over code size.
5148 # - "max", whole program optimization and link-time code
5149 # generation. This is very expensive and should be used
5152 'optimize%': 'size',
5156 # Set /LTCG for the official builds.
5157 'LinkTimeCodeGeneration': '1',
5160 'target_conditions': [
5161 ['optimize=="size"', {
5163 'VCCLCompilerTool': {
5164 # 1, optimizeMinSpace, Minimize Size (/O1)
5165 'Optimization': '1',
5166 # 2, favorSize - Favor small code (/Os)
5167 'FavorSizeOrSpeed': '2',
5172 ['optimize=="speed"', {
5174 'VCCLCompilerTool': {
5175 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5176 'Optimization': '2',
5177 # 1, favorSpeed - Favor fast code (/Ot)
5178 'FavorSizeOrSpeed': '1',
5183 ['optimize=="max"', {
5184 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5185 # builds. Probably anything that this would catch that
5186 # wouldn't be caught in a normal build isn't going to
5187 # actually be a bug, so the incremental value of C4702 for
5188 # PGO builds is likely very small.
5189 'msvs_disabled_warnings': [
5193 'VCCLCompilerTool': {
5194 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5195 'Optimization': '2',
5196 # 1, favorSpeed - Favor fast code (/Ot)
5197 'FavorSizeOrSpeed': '1',
5198 # This implies link time code generation.
5199 'WholeProgramOptimization': 'true',
5217 'AdditionalLibraryDirectories':
5218 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5220 'VCLibrarianTool': {
5221 'AdditionalLibraryDirectories':
5222 ['<(windows_driver_kit_path)/lib/ATL/i386'],
5228 'VCLibrarianTool': {
5229 'AdditionalLibraryDirectories':
5230 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5233 'AdditionalLibraryDirectories':
5234 ['<(windows_driver_kit_path)/lib/ATL/amd64'],
5239 # https://code.google.com/p/chromium/issues/detail?id=372451#c20
5240 # Warning 4702 ("Unreachable code") should be re-enabled once
5241 # Express users are updated to VS2013 Update 2.
5242 'msvs_disabled_warnings': [
5247 # Explicitly required when using the ATL with express
5248 'AdditionalDependencies': ['atlthunk.lib'],
5250 # ATL 8.0 included in WDK 7.1 makes the linker to generate
5251 # almost eight hundred LNK4254 and LNK4078 warnings:
5252 # - warning LNK4254: section 'ATL' (50000040) merged into
5253 # '.rdata' (40000040) with different attributes
5254 # - warning LNK4078: multiple 'ATL' sections found with
5255 # different attributes
5256 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
5259 'msvs_system_include_dirs': [
5260 '<(windows_driver_kit_path)/inc/atl71',
5261 '<(windows_driver_kit_path)/inc/mfc42',
5265 'msvs_system_include_dirs': [
5266 '<(windows_sdk_path)/Include/shared',
5267 '<(windows_sdk_path)/Include/um',
5268 '<(windows_sdk_path)/Include/winrt',
5269 '$(VSInstallDir)/VC/atlmfc/include',
5271 'msvs_cygwin_shell': 0,
5272 'msvs_disabled_warnings': [
5273 # C4127: conditional expression is constant
5274 # This warning can in theory catch dead code and other problems, but
5275 # triggers in far too many desirable cases where the conditional
5276 # expression is either set by macros or corresponds some legitimate
5277 # compile-time constant expression (due to constant template args,
5278 # conditionals comparing the sizes of different types, etc.). Some of
5279 # these can be worked around, but it's not worth it.
5282 # C4351: new behavior: elements of array 'array' will be default
5284 # This is a silly "warning" that basically just alerts you that the
5285 # compiler is going to actually follow the language spec like it's
5286 # supposed to, instead of not following it like old buggy versions
5287 # did. There's absolutely no reason to turn this on.
5290 # C4355: 'this': used in base member initializer list
5291 # It's commonly useful to pass |this| to objects in a class'
5292 # initializer list. While this warning can catch real bugs, most of
5293 # the time the constructors in question don't attempt to call methods
5294 # on the passed-in pointer (until later), and annotating every legit
5295 # usage of this is simply more hassle than the warning is worth.
5298 # C4503: 'identifier': decorated name length exceeded, name was
5300 # This only means that some long error messages might have truncated
5301 # identifiers in the presence of lots of templates. It has no effect
5302 # on program correctness and there's no real reason to waste time
5303 # trying to prevent it.
5306 # C4611: interaction between 'function' and C++ object destruction is
5308 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5309 # suggests using exceptions instead of setjmp/longjmp for C++, but
5310 # Chromium code compiles without exception support. We therefore have
5311 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5312 # means we have to turn off this warning (and be careful about how
5313 # object destruction happens in such cases).
5316 # TODO(maruel): These warnings are level 4. They will be slowly
5317 # removed as code is fixed.
5318 4100, # Unreferenced formal parameter
5319 4121, # Alignment of a member was sensitive to packing
5320 4189, # Local variable is initialized but not referenced
5321 4244, # Conversion from 'type1' to 'type2', possible loss of data
5322 4481, # Nonstandard extension used: override specifier 'keyword'
5323 4505, # Unreferenced local function has been removed
5324 4510, # Default constructor could not be generated
5325 4512, # Assignment operator could not be generated
5326 4610, # Object can never be instantiated
5329 'VCCLCompilerTool': {
5330 'AdditionalOptions': ['/MP'],
5331 'MinimalRebuild': 'false',
5332 'BufferSecurityCheck': 'true',
5333 'EnableFunctionLevelLinking': 'true',
5334 'RuntimeTypeInfo': 'false',
5335 'WarningLevel': '4',
5336 'WarnAsError': 'true',
5337 'DebugInformationFormat': '3',
5338 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5339 'ExceptionHandling': '0',
5341 'VCLibrarianTool': {
5342 'AdditionalOptions': ['/ignore:4221'],
5343 'AdditionalLibraryDirectories': [
5344 '<(windows_sdk_path)/Lib/win8/um/x86',
5348 'AdditionalDependencies': [
5360 'AdditionalLibraryDirectories': [
5361 '<(windows_sdk_path)/Lib/win8/um/x86',
5363 'GenerateDebugInformation': 'true',
5364 'MapFileName': '$(OutDir)\\$(TargetName).map',
5365 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5366 'FixedBaseAddress': '1',
5369 # 1 == /SUBSYSTEM:CONSOLE
5370 # 2 == /SUBSYSTEM:WINDOWS
5371 # Most of the executables we'll ever create are tests
5372 # and utilities with console output.
5376 'GenerateStublessProxies': 'true',
5377 'TypeLibraryName': '$(InputName).tlb',
5378 'OutputDirectory': '$(IntDir)',
5379 'HeaderFileName': '$(InputName).h',
5380 'DLLDataFileName': '$(InputName).dlldata.c',
5381 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5382 'ProxyFileName': '$(InputName)_p.c',
5384 'VCResourceCompilerTool': {
5386 'AdditionalIncludeDirectories': [
5388 '<(SHARED_INTERMEDIATE_DIR)',
5391 'target_conditions': [
5392 ['_type=="executable"', {
5394 'EmbedManifest': 'true',
5397 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5399 'AdditionalManifestFiles': [
5400 '>(win_exe_compatibility_manifest)',
5407 # Building with Clang on Windows is a work in progress and very
5408 # experimental. See crbug.com/82385.
5409 'VCCLCompilerTool': {
5410 'WarnAsError': 'false',
5411 'RuntimeTypeInfo': 'false',
5412 'AdditionalOptions': [
5413 '-fmsc-version=1800',
5416 # Many files use intrinsics without including this header.
5417 # TODO(hans): Fix those files, or move this to sub-GYPs.
5420 # TODO(hans): Make this list shorter eventually.
5421 '-Qunused-arguments',
5422 '-Wno-c++11-compat-deprecated-writable-strings',
5423 '-Wno-deprecated-declarations',
5425 '-Wno-enum-conversion',
5426 '-Wno-extra-tokens',
5427 '-Wno-ignored-attributes',
5428 '-Wno-incompatible-pointer-types',
5429 '-Wno-int-to-void-pointer-cast',
5430 '-Wno-invalid-noreturn',
5431 '-Wno-logical-op-parentheses',
5433 '-Wno-missing-braces',
5434 '-Wno-missing-declarations',
5435 '-Wno-msvc-include',
5436 '-Wno-null-dereference',
5437 '-Wno-overloaded-virtual',
5439 '-Wno-pointer-sign',
5441 '-Wno-return-type-c-linkage',
5443 '-Wno-sometimes-uninitialized',
5445 '-Wno-tautological-compare',
5446 '-Wno-unknown-pragmas',
5448 '-Wno-unused-function',
5449 '-Wno-unused-private-field',
5450 '-Wno-unused-value',
5451 '-Wno-unused-variable',
5457 # ASan on Windows is a work in progress and very experimental.
5458 # See crbug.com/345874.
5459 'VCCLCompilerTool': {
5460 'AdditionalOptions': [
5461 '-fsanitize=address',
5463 'AdditionalIncludeDirectories': [
5464 # MSVC needs to be able to find the sanitizer headers when
5465 # invoked via /fallback. This is critical for using macros
5466 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5468 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/include_sanitizer',
5472 'AdditionalLibraryDirectories': [
5473 # TODO(hans): If make_clang_dir is absolute, this breaks.
5474 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.6.0/lib/windows',
5477 'target_conditions': [
5478 ['_type=="executable"', {
5480 'AdditionalDependencies': [
5481 'clang_rt.asan-i386.lib',
5485 ['_type=="shared_library" or _type=="loadable_module"', {
5487 'AdditionalDependencies': [
5488 'clang_rt.asan_dll_thunk-i386.lib',
5498 ['disable_nacl==1', {
5499 'target_defaults': {
5505 ['OS=="win" and msvs_use_common_linker_extras', {
5506 'target_defaults': {
5521 'AdditionalOptions': [
5530 'AdditionalOptions': ['/largeaddressaware'],
5539 'AdditionalOptions': [
5540 # safeseh is not compatible with x64
5552 ['enable_new_npdevice_api==1', {
5553 'target_defaults': {
5555 'ENABLE_NEW_NPDEVICE_API',
5559 # Don't warn about the "typedef 'foo' locally defined but not used"
5561 # TODO: remove this flag once all builds work. See crbug.com/227506
5562 ['gcc_version>=48 and clang==0', {
5563 'target_defaults': {
5565 '-Wno-unused-local-typedefs',
5569 ['gcc_version>=48 and clang==0 and host_clang==1', {
5570 'target_defaults': {
5571 'target_conditions': [
5572 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5576 # We need a special case to handle the android webview build on mac because
5577 # the host gcc there doesn't accept this flag, but the target gcc may
5579 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5580 'target_defaults': {
5581 'target_conditions': [
5582 ['_toolset=="host"', {
5584 '-Wno-unused-local-typedefs',
5590 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5592 'make_global_settings': [
5593 ['CC', '<(make_clang_dir)/bin/clang'],
5594 ['CXX', '<(make_clang_dir)/bin/clang++'],
5595 ['CC.host', '$(CC)'],
5596 ['CXX.host', '$(CXX)'],
5599 ['clang==1 and OS=="win"', {
5600 'make_global_settings': [
5601 # On Windows, gyp's ninja generator only looks at CC.
5602 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5605 ['OS=="android" and clang==0', {
5606 # Hardcode the compiler names in the Makefile so that
5607 # it won't depend on the environment at make time.
5608 'make_global_settings': [
5609 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5610 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5611 ['CC.host', '<(host_cc)'],
5612 ['CXX.host', '<(host_cxx)'],
5615 ['OS=="linux" and target_arch=="mipsel"', {
5616 'make_global_settings': [
5617 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5618 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5619 ['CC.host', '<(host_cc)'],
5620 ['CXX.host', '<(host_cxx)'],
5623 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5624 # Set default ARM cross compiling on linux. These can be overridden
5625 # using CC/CXX/etc environment variables.
5626 'make_global_settings': [
5627 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5628 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5629 ['CC.host', '<(host_cc)'],
5630 ['CXX.host', '<(host_cxx)'],
5634 # TODO(yyanagisawa): supports GENERATOR==make
5635 # make generator doesn't support CC_wrapper without CC
5636 # in make_global_settings yet.
5637 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5638 'make_global_settings': [
5639 ['CC_wrapper', '<(gomadir)/gomacc'],
5640 ['CXX_wrapper', '<(gomadir)/gomacc'],
5641 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5642 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5647 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5648 # This block adds *project-wide* configuration settings to each project
5649 # file. It's almost always wrong to put things here. Specify your
5650 # custom xcode_settings in target_defaults to add them to targets instead.
5653 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5654 # setting sets the SDK on a project-wide basis. In order to get the
5655 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5656 # here at the project level.
5659 ['mac_sdk_path==""', {
5660 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5662 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5668 ['ios_sdk_path==""', {
5670 # TODO(justincohen): Ninja only supports simulator for now.
5671 ['"<(GENERATOR)"=="xcode"', {
5672 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5674 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5678 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5683 # Target both iPhone and iPad.
5684 'TARGETED_DEVICE_FAMILY': '1,2',
5687 ['target_arch=="x64"', {
5692 ['target_arch=="ia32"', {
5701 # The Xcode generator will look for an xcode_settings section at the root
5702 # of each dict and use it to apply settings on a file-wide basis. Most
5703 # settings should not be here, they should be in target-specific
5704 # xcode_settings sections, or better yet, should use non-Xcode-specific
5705 # settings in target dicts. SYMROOT is a special case, because many other
5706 # Xcode variables depend on it, including variables such as
5707 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5708 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5709 # files to appear (when present) in the UI as actual files and not red
5710 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5711 # and therefore SYMROOT, needs to be set at the project level.
5712 'SYMROOT': '<(DEPTH)/xcodebuild',