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=="ios"', {
47 'host_arch%': '<!pymod_do_main(detect_host_arch)',
51 # Copy conditionally-set variables out one scope.
52 'chromeos%': '<(chromeos)',
53 'chromecast%': '<(chromecast)',
54 'use_aura%': '<(use_aura)',
55 'use_ash%': '<(use_ash)',
56 'use_cras%': '<(use_cras)',
57 'use_ozone%': '<(use_ozone)',
58 'embedded%': '<(embedded)',
59 'host_arch%': '<(host_arch)',
61 # Whether we are using Views Toolkit
64 # Use the PCI lib to collect GPU information.
67 # Use OpenSSL instead of NSS as the underlying SSL and crypto
68 # implementation. Certificate verification will in most cases be
69 # handled by the OS. If OpenSSL's struct X509 is used to represent
70 # certificates, use_openssl_certs must be set.
73 # Typedef X509Certificate::OSCertHandle to OpenSSL's struct X509*.
74 'use_openssl_certs%': 0,
76 # Disable viewport meta tag by default.
77 'enable_viewport%': 0,
79 # Enable HiDPI support.
82 # Override buildtype to select the desired build flavor.
83 # Dev - everyday build for development/testing
84 # Official - release build (generally implies additional processing)
85 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
86 # conversion is done), some of the things which are now controlled by
87 # 'branding', such as symbol generation, will need to be refactored
88 # based on 'buildtype' (i.e. we don't care about saving symbols for
89 # non-Official # builds).
92 # Override branding to select the desired branding flavor.
93 'branding%': 'Chromium',
96 # ChromeOS and Windows use Aura and Ash.
97 ['chromeos==1 or OS=="win" or OS=="linux"', {
102 ['chromecast==1 and OS!="android"', {
112 # Whether we're a traditional desktop unix.
113 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
119 # Embedded implies ozone.
125 'target_arch%': 'arm',
127 # Default architecture we're building for is the architecture we're
128 # building on, and possibly sub-architecture (for iOS builds).
129 'target_arch%': '<(host_arch)',
133 # Copy conditionally-set variables out one scope.
134 'chromeos%': '<(chromeos)',
135 'chromecast%': '<(chromecast)',
136 'desktop_linux%': '<(desktop_linux)',
137 'use_aura%': '<(use_aura)',
138 'use_ash%': '<(use_ash)',
139 'use_cras%': '<(use_cras)',
140 'use_ozone%': '<(use_ozone)',
141 'embedded%': '<(embedded)',
142 'use_libpci%': '<(use_libpci)',
143 'use_openssl%': '<(use_openssl)',
144 'use_openssl_certs%': '<(use_openssl_certs)',
145 'enable_viewport%': '<(enable_viewport)',
146 'enable_hidpi%': '<(enable_hidpi)',
147 'buildtype%': '<(buildtype)',
148 'branding%': '<(branding)',
149 'host_arch%': '<(host_arch)',
150 'target_arch%': '<(target_arch)',
152 'target_subarch%': '',
154 # The channel to build on Android: stable, beta, dev, canary, or
155 # default. "default" should be used on non-official builds.
156 'android_channel%': 'default',
158 # This is set when building the Android WebView inside the Android
159 # build system, using the 'android' gyp backend. The WebView code is
160 # still built when this is unset, but builds using the normal chromium
162 'android_webview_build%': 0,
164 # Set ARM architecture version.
167 # Use aurax11 for clipboard implementation. This is true on linux_aura.
168 'use_clipboard_aurax11%': 0,
172 # If no gomadir is set, it uses the default gomadir.
176 # The system root for cross-compiles. Default: none.
180 # The system libdir used for this ABI.
181 'system_libdir%': 'lib',
183 # Default MIPS arch variant. This is set in the conditions block
184 # below for MIPS targets.
185 'mips_arch_variant%': '',
193 # Set default value of toolkit_views based on OS.
194 ['OS=="win" or chromeos==1 or use_aura==1', {
200 # Embedded builds use aura without ash or views.
207 # Enable HiDPI on Mac OS, Chrome OS and Windows.
208 ['OS=="mac" or chromeos==1 or OS=="win"', {
212 # Enable the OpenSSL backend on Mac OS and Windows.
213 ['OS=="mac" or OS=="win"', {
217 # Enable App Launcher everywhere but mobile.
218 ['OS!="ios" and OS!="android"', {
219 'enable_app_list%': 1,
221 'enable_app_list%': 0,
224 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
225 'use_default_render_theme%': 1,
227 'use_default_render_theme%': 0,
231 'use_ozone_evdev%': 1,
233 'use_ozone_evdev%': 0,
236 # Set default gomadir.
238 'gomadir': 'c:\\goma\\goma-win',
240 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
243 # Set the default "target_subarch" on iOS. Valid values are "arm32",
244 # "arm64" and "both" (meaning a fat binary).
246 # TODO(sdefresne): change the default from "arm32" to "both" for
247 # "target_subarch" once http://crbug.com/339477 is fixed.
249 # TODO(sdefresne): set the "target_arch" to "arm" once compilation
250 # of skia has been fixed for simulator. http://crbug.com/342377
252 'target_subarch%': 'arm32',
255 # Set arch variants for MIPS platforms.
256 ['target_arch=="mips64el"', {
259 'mips_arch_variant%': 'r6',
261 'mips_arch_variant%': 'r2',
266 ['target_arch=="mipsel"', {
267 'mips_arch_variant%': 'r1',
272 # Copy conditionally-set variables out one scope.
273 'chromeos%': '<(chromeos)',
274 'chromecast%': '<(chromecast)',
275 'host_arch%': '<(host_arch)',
276 'target_arch%': '<(target_arch)',
277 'target_subarch%': '<(target_subarch)',
278 'mips_arch_variant%': '<(mips_arch_variant)',
279 'toolkit_views%': '<(toolkit_views)',
280 'desktop_linux%': '<(desktop_linux)',
281 'use_aura%': '<(use_aura)',
282 'use_ash%': '<(use_ash)',
283 'use_cras%': '<(use_cras)',
284 'use_libpci%': '<(use_libpci)',
285 'use_ozone%': '<(use_ozone)',
286 'use_ozone_evdev%': '<(use_ozone_evdev)',
287 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
288 'embedded%': '<(embedded)',
289 'use_openssl%': '<(use_openssl)',
290 'use_openssl_certs%': '<(use_openssl_certs)',
291 'enable_viewport%': '<(enable_viewport)',
292 'enable_hidpi%': '<(enable_hidpi)',
293 'android_channel%': '<(android_channel)',
294 'android_webview_build%': '<(android_webview_build)',
295 'use_goma%': '<(use_goma)',
296 'gomadir%': '<(gomadir)',
297 'enable_app_list%': '<(enable_app_list)',
298 'use_default_render_theme%': '<(use_default_render_theme)',
299 'buildtype%': '<(buildtype)',
300 'branding%': '<(branding)',
301 'arm_version%': '<(arm_version)',
302 'sysroot%': '<(sysroot)',
303 'chroot_cmd%': '<(chroot_cmd)',
304 'system_libdir%': '<(system_libdir)',
306 # Set to 1 to enable fast builds. Set to 2 for even faster builds
307 # (it disables debug info for fastest compilation - only for use
308 # on compile-only bots).
311 # Set to 1 to not store any build metadata, e.g. ifdef out all __DATE__
312 # and __TIME__. Set to 0 to reenable the use of these macros in the code
313 # base. See http://crbug.com/314403.
314 'dont_embed_build_metadata%': 1,
316 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
317 # This is useful for parallel compilation tools which can't support /Zi.
318 # Only used on Windows.
321 # Set to 1 to enable dcheck in Release build.
322 'dcheck_always_on%': 0,
324 # Set to 1 to make a build that disables unshipped tracing events.
325 # Note: this setting is ignored if buildtype=="Official".
326 'tracing_like_official_build%': 0,
328 # Disable image loader component extension by default.
329 'image_loader_extension%': 0,
331 # Set NEON compilation flags.
334 # Detect NEON support at run-time.
335 'arm_neon_optional%': 0,
337 # Use libjpeg-turbo as the JPEG codec used by Chromium.
338 'use_libjpeg_turbo%': 1,
340 # Use system libjpeg. Note that the system's libjepg will be used even if
341 # use_libjpeg_turbo is set.
342 'use_system_libjpeg%': 0,
344 # By default, component is set to static_library and it can be overriden
345 # by the GYP command line or by ~/.gyp/include.gypi.
346 'component%': 'static_library',
348 # /analyze is off by default on Windows because it is very slow and noisy.
349 # Enable with GYP_DEFINES=win_analyze=1
352 # Set to select the Title Case versions of strings in GRD files.
353 'use_titlecase_in_grd%': 0,
355 # Use translations provided by volunteers at launchpad.net. This
356 # currently only works on Linux.
357 'use_third_party_translations%': 0,
359 # Remoting compilation is enabled by default. Set to 0 to disable.
362 # Configuration policy is enabled by default. Set to 0 to disable.
363 'configuration_policy%': 1,
365 # Variable safe_browsing is used to control the build time configuration
366 # for safe browsing feature. Safe browsing can be compiled in 3 different
367 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
368 # reporting features without enabling phishing and malware detection. This
369 # is useful to integrate a third party phishing/malware detection to
370 # existing safe browsing logic.
373 # Web speech is enabled by default. Set to 0 to disable.
374 'enable_web_speech%': 1,
376 # Notifications are compiled in by default. Set to 0 to disable.
377 'notifications%' : 1,
379 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
380 # regular builds and 1 for ASan builds.
381 'mac_want_real_dsym%': 'default',
383 # If this is set, the clang plugins used on the buildbot will be used.
384 # Run tools/clang/scripts/update.sh to make sure they are compiled.
385 # This causes 'clang_chrome_plugins_flags' to be set.
386 # Has no effect if 'clang' is not set as well.
387 'clang_use_chrome_plugins%': 1,
389 # Enable building with ASAN (Clang's -fsanitize=address option).
390 # -fsanitize=address only works with clang, but asan=1 implies clang=1
391 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
393 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
394 # Enable coverage gathering instrumentation in ASan. This flag also
395 # controls coverage granularity (1 for function-level coverage, 2 for
396 # block-level coverage).
398 # Enable intra-object-overflow detection in ASan (experimental).
399 'asan_field_padding%': 0,
401 # Enable Chromium overrides of the default configurations for various
402 # dynamic tools (like ASan).
403 'use_sanitizer_options%': 0,
405 # Enable building with SyzyAsan.
406 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
409 # Enable building with LSan (Clang's -fsanitize=leak option).
410 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
411 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
414 # Enable building with TSan (Clang's -fsanitize=thread option).
415 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
416 # See http://clang.llvm.org/docs/ThreadSanitizer.html
418 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
420 # Enable building with MSan (Clang's -fsanitize=memory option).
421 # MemorySanitizer only works with clang, but msan=1 implies clang=1
422 # See http://clang.llvm.org/docs/MemorySanitizer.html
424 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
425 # Track where uninitialized memory originates from. From fastest to
426 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
427 # - track the chain of stores leading from allocation site to use site.
428 'msan_track_origins%': 1,
430 # Enable building with UBSan (Clang's -fsanitize=undefined option).
431 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
432 # See http://clang.llvm.org/docs/UsersManual.html
434 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
436 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
437 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
440 # Use the dynamic libraries instrumented by one of the sanitizers
441 # instead of the standard system libraries.
442 'use_instrumented_libraries%': 0,
444 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
445 # stdlibc++ as standard library. This is intended to use for instrumented
447 'use_custom_libcxx%': 0,
449 # Use system libc++ instead of the default C++ library, usually libstdc++.
450 # This is intended for iOS builds only.
451 'use_system_libcxx%': 0,
453 # Use a modified version of Clang to intercept allocated types and sizes
454 # for allocated objects. clang_type_profiler=1 implies clang=1.
455 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
456 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
457 'clang_type_profiler%': 0,
459 # Set to true to instrument the code with function call logger.
460 # See src/third_party/cygprofile/cyg-profile.cc for details.
461 'order_profiling%': 0,
463 # Use the provided profiled order file to link Chrome image with it.
464 # This makes Chrome faster by better using CPU cache when executing code.
465 # This is known as PGO (profile guided optimization).
466 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
467 'order_text_section%' : "",
469 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
470 # libraries on linux x86-64 and arm, plus ASLR.
473 # Whether one-click signin is enabled or not.
474 'enable_one_click_signin%': 0,
476 # Whether to back up data before sync.
477 'enable_pre_sync_backup%': 0,
479 # Enable Chrome browser extensions
480 'enable_extensions%': 1,
483 'enable_google_now%': 1,
485 # Enable basic printing support and UI.
486 'enable_basic_printing%': 1,
488 # Enable printing with print preview. It does not imply
489 # enable_basic_printing. It's possible to build Chrome with preview only.
490 'enable_print_preview%': 1,
492 # Set the version of CLD.
493 # 0: Don't specify the version. This option is for the Finch testing.
498 # For CLD2, the size of the tables that should be included in the build
499 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
501 # See third_party/cld_2/cld_2.gyp for more information.
502 # 0: Small tables, lower accuracy
503 # 2: Large tables, high accuracy
504 'cld2_table_size%': 2,
506 # Enable spell checker.
507 'enable_spellcheck%': 1,
509 # Webrtc compilation is enabled by default. Set to 0 to disable.
512 # Enables use of the session service, which is enabled by default.
513 # Support for disabling depends on the platform.
514 'enable_session_service%': 1,
516 # Enables theme support, which is enabled by default. Support for
517 # disabling depends on the platform.
520 # Enables autofill dialog and associated features; disabled by default.
521 'enable_autofill_dialog%' : 0,
523 # Defaults Wallet integration in Autofill dialog to use production
524 # servers. Unofficial builds won't have the proper API keys.
525 'enable_prod_wallet_service%': 0,
527 # Enables support for background apps.
528 'enable_background%': 1,
530 # Enable the task manager by default.
531 'enable_task_manager%': 1,
533 # Enables used resource whitelist generation; disabled by default.
534 'enable_resource_whitelist_generation%': 0,
536 # Enable FILE support by default.
537 'disable_file_support%': 0,
539 # Enable FTP support by default.
540 'disable_ftp_support%': 0,
542 # Use native android functions in place of ICU. Not supported by most
544 'use_icu_alternatives_on_android%': 0,
546 # Use of precompiled headers on Windows.
548 # This variable may be explicitly set to 1 (enabled) or 0
549 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
550 # This setting will override the default.
553 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
555 'chromium_win_pch%': 0,
558 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
559 # Set this to true when building with Clang.
560 # See http://code.google.com/p/chromium/wiki/Clang for details.
561 # If this is set, clang is used as both host and target compiler in
562 # cross-compile builds.
565 # Use experimental lld linker instead of the platform's default linker.
568 # Enable plug-in installation by default.
569 'enable_plugin_installation%': 1,
571 # Specifies whether to use canvas_skia.cc in place of platform
572 # specific implementations of gfx::Canvas. Affects text drawing in the
574 # TODO(asvitkine): Enable this on all platforms and delete this flag.
575 # http://crbug.com/105550
576 'use_canvas_skia%': 0,
578 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
579 # with one of those tools.
580 'build_for_tool%': '',
582 # If no directory is specified then a temporary directory will be used.
583 'test_isolation_outdir%': '',
584 # True if isolate should fail if the isolate files refer to files
586 'test_isolation_fail_on_missing': 1,
588 'wix_path%': '<(DEPTH)/third_party/wix',
590 # Supervised users are enabled by default.
591 'enable_supervised_users%': 1,
593 # Platform natively supports discardable memory.
594 'native_discardable_memory%': 0,
596 # Platform sends memory pressure signals natively.
597 'native_memory_pressure_signals%': 0,
599 'spdy_proxy_auth_property%' : '',
600 'spdy_proxy_auth_value%' : '',
602 'enable_service_discovery%': 0,
603 'enable_wifi_bootstrapping%': 0,
604 'enable_hangout_services_extension%': 0,
606 # Enable the Syzygy optimization step.
607 'syzygy_optimize%': 0,
609 # Enable hole punching for the protected video.
612 # Automatically select platforms under ozone. Turn this off to
613 # build only explicitly selected platforms.
614 'ozone_auto_platforms%': 1,
616 # If this is set clang is used as host compiler, but not as target
617 # compiler. Always do this by default.
620 # Variables to control Link-Time Optimizations (LTO).
621 # Note: the variables must *not* be enabled at the same time.
622 # In this case LTO would 'merge' the optimization flags
623 # at link-time which would lead to all code be optimized with -O2.
624 # Enable LTO on the code compiled with -Os.
625 # See crbug.com/407544
627 # Enable LTO on code compiled with -O2.
630 # Libxkbcommon usage.
634 # A flag for POSIX platforms
641 # A flag for BSD platforms
642 ['OS=="freebsd" or OS=="openbsd"', {
649 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
655 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
656 # OpenSSL's certificate definition.
657 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
658 'use_openssl_certs%': 1,
660 'use_openssl_certs%': 0,
663 # libudev usage. This currently only affects the content layer.
664 ['OS=="linux" and embedded==0', {
670 # Flags to use X11 on non-Mac POSIX platforms.
671 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
678 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
684 # Flags to use pango and cairo.
685 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
694 ['OS=="linux" and embedded==0', {
700 # We always use skia text rendering in Aura on Windows, since GDI
701 # doesn't agree with our BackingStore.
702 # TODO(beng): remove once skia text rendering is on by default.
703 ['use_aura==1 and OS=="win"', {
704 'enable_skia_text%': 1,
707 # A flag to enable or disable our compile-time dependency
708 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
709 # support will be available. This option is useful
710 # for Linux distributions and for Aura.
711 ['OS!="linux" or chromeos==1', {
712 'use_gnome_keyring%': 0,
714 'use_gnome_keyring%': 1,
717 ['OS=="mac" or OS=="ios"', {
718 # Mac and iOS want Title Case strings
719 'use_titlecase_in_grd%': 1,
722 # Enable loader extensions on Chrome OS.
724 'image_loader_extension%': 1,
726 'image_loader_extension%': 0,
729 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
730 'enable_one_click_signin%': 1,
731 'enable_pre_sync_backup%': 1,
735 'enable_extensions%': 0,
736 'enable_google_now%': 0,
738 'enable_spellcheck%': 0,
742 'arm_neon_optional%': 1,
743 'native_discardable_memory%': 1,
744 'native_memory_pressure_signals%': 1,
745 'enable_basic_printing%': 1,
746 'enable_print_preview%': 0,
747 'enable_task_manager%':0,
751 # Android OS includes support for proprietary codecs regardless of
752 # building Chromium or Google Chrome. We also ship Google Chrome and
753 # Chromecast with proprietary codecs.
754 ['OS=="android" or branding=="Chrome" or chromecast==1', {
755 'proprietary_codecs%': 1,
757 'proprietary_codecs%': 0,
760 ['OS=="mac" or OS=="ios"', {
761 'native_discardable_memory%': 1,
762 'native_memory_pressure_signals%': 1,
765 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
766 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
767 'enable_autofill_dialog%': 1,
770 ['buildtype=="Official"', {
771 'enable_prod_wallet_service%': 1,
781 'disable_ftp_support%': 1,
782 'enable_extensions%': 0,
783 'enable_google_now%': 0,
785 'cld2_table_size%': 0,
786 'enable_basic_printing%': 0,
787 'enable_print_preview%': 0,
788 'enable_session_service%': 0,
789 'enable_spellcheck%': 0,
795 'enable_supervised_users%': 0,
796 'enable_task_manager%': 0,
797 'use_system_libcxx%': 1,
798 'support_pre_M6_history_database%': 0,
801 # Use GPU accelerated cross process image transport by default
802 # on linux builds with the Aura window manager
803 ['use_aura==1 and OS=="linux"', {
804 'ui_compositor_image_transport%': 1,
806 'ui_compositor_image_transport%': 0,
809 # Turn precompiled headers on by default.
810 ['OS=="win" and buildtype!="Official"', {
811 'chromium_win_pch%': 1
814 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
815 'enable_plugin_installation%': 0,
817 'enable_plugin_installation%': 1,
820 # Whether PPAPI is enabled.
821 ['OS=="android" or OS=="ios" or embedded==1', {
822 'enable_plugins%': 0,
824 'enable_plugins%': 1,
827 # linux_use_bundled_gold: whether to use the gold linker binary checked
828 # into third_party/binutils. Force this off via GYP_DEFINES when you
829 # are using a custom toolchain and need to control -B in ldflags.
830 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
831 # for component=static_library builds.
832 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
833 'linux_use_bundled_gold%': 1,
835 'linux_use_bundled_gold%': 0,
838 # linux_use_bundled_binutils: whether to use the binary binutils
839 # checked into third_party/binutils. These are not multi-arch so cannot
840 # be used except on x86 and x86-64 (the only two architectures which
841 # are currently checke in). Force this off via GYP_DEFINES when you
842 # are using a custom toolchain and need to control -B in cflags.
843 ['OS=="linux" and (target_arch=="x64")', {
844 'linux_use_bundled_binutils%': 1,
846 'linux_use_bundled_binutils%': 0,
849 # linux_use_gold_flags: whether to use build flags that rely on gold.
850 # On by default for x64 Linux.
851 ['OS=="linux" and target_arch=="x64"', {
852 'linux_use_gold_flags%': 1,
854 'linux_use_gold_flags%': 0,
857 # linux_use_debug_fission: whether to use split DWARF debug info
858 # files. This can reduce link time significantly, but is incompatible
859 # with some utilities such as icecc and ccache. Requires gold and
860 # gcc >= 4.8 or clang.
861 # http://gcc.gnu.org/wiki/DebugFission
862 ['OS=="linux" and target_arch=="x64"', {
863 'linux_use_debug_fission%': 1,
865 'linux_use_debug_fission%': 0,
868 ['OS=="android" or OS=="ios"', {
869 'enable_captive_portal_detection%': 0,
871 'enable_captive_portal_detection%': 1,
874 # Enable Skia UI text drawing incrementally on different platforms.
875 # http://crbug.com/105550
877 # On Aura, this allows per-tile painting to be used in the browser
880 'use_canvas_skia%': 1,
884 'enable_basic_printing%': 0,
885 'enable_print_preview%': 1,
886 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
887 'use_libjpeg_turbo%': 0,
890 # Do not enable the Settings App on ChromeOS.
891 ['enable_app_list==1 and chromeos==0', {
892 'enable_settings_app%': 1,
894 'enable_settings_app%': 0,
897 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
898 # Set some defaults for arm/linux chrome builds
899 'use_allocator%': 'none',
900 # sysroot needs to be an absolute path otherwise it generates
901 # incorrect results when passed to pkg-config
902 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot',
903 }], # OS=="linux" and target_arch=="arm" and chromeos==0
905 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
907 ['target_arch=="x64"', {
908 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
910 ['target_arch=="ia32"', {
911 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
914 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
916 ['OS=="linux" and target_arch=="mipsel"', {
917 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
918 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
921 # Whether tests targets should be run, archived or just have the
922 # dependencies verified. All the tests targets have the '_run' suffix,
923 # e.g. base_unittests_run runs the target base_unittests. The test
924 # target always calls tools/swarming_client/isolate.py. See the script's
925 # --help for more information. Meant to be overriden with GYP_DEFINES.
926 # TODO(maruel): Remove the conditions as more configurations are
928 ['OS!="ios" and OS!="android" and chromeos==0', {
929 'test_isolation_mode%': 'check',
931 'test_isolation_mode%': 'noop',
933 # Whether Android build uses OpenMAX DL FFT.
934 ['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")', {
935 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
936 # When enabled, this will also enable WebAudio support on
937 # Android for these architectures. Default is enabled. Whether
938 # WebAudio is actually available depends on runtime settings
940 'use_openmax_dl_fft%': 1,
942 'use_openmax_dl_fft%': 0,
944 ['OS=="win" or OS=="linux"', {
948 # Turns on compiler optimizations in V8 in Debug build, except
949 # on android_clang, where we're hitting a weird linker error.
950 # TODO(dpranke): http://crbug.com/266155 .
952 'v8_optimized_debug%': 1,
954 'v8_optimized_debug%': 2,
957 # Disable various features by default on embedded.
960 'enable_basic_printing%': 0,
961 'enable_print_preview%': 0,
964 # By default, use ICU data file (icudtl.dat) on all platforms
965 # except when building Android WebView.
966 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
967 # Set the data reduction proxy origin for Android Webview.
968 ['android_webview_build==0', {
969 'icu_use_data_file_flag%' : 1,
971 'icu_use_data_file_flag%' : 0,
973 ['OS=="win" or OS=="mac"', {
974 'enable_wifi_bootstrapping%' : 1,
977 # Path to sas.dll, which provides the SendSAS function.
978 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
979 ['target_arch=="x64"', {
980 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
982 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
985 # Turn on JNI generation optimizations on non-WebView builds.
986 ['OS=="android" and android_webview_build==0', {
987 'optimize_jni_generation%': 1,
989 'optimize_jni_generation%': 0,
992 # TODO(rmcilroy): Enable v8_use_external_startup_data on ChromeOS
993 # http://crbug.com/421063
994 ['android_webview_build==0 and chromecast==0 and chromeos==0 and OS!="ios"', {
995 'v8_use_external_startup_data%': 1,
997 'v8_use_external_startup_data%': 0,
1001 # Set this to 1 to enable use of concatenated impulse responses
1002 # for the HRTF panner in WebAudio.
1003 'use_concatenated_impulse_responses': 1,
1005 # You can set the variable 'use_official_google_api_keys' to 1
1006 # to use the Google-internal file containing official API keys
1007 # for Google Chrome even in a developer build. Setting this
1008 # variable explicitly to 1 will cause your build to fail if the
1009 # internal file is missing.
1011 # The variable is documented here, but not handled in this file;
1012 # see //google_apis/determine_use_official_keys.gypi for the
1015 # Set the variable to 0 to not use the internal file, even when
1016 # it exists in your checkout.
1018 # Leave it unset in your include.gypi to have the variable
1019 # implicitly set to 1 if you have
1020 # src/google_apis/internal/google_chrome_api_keys.h in your
1021 # checkout, and implicitly set to 0 if not.
1023 # Note that official builds always behave as if the variable
1024 # was explicitly set to 1, i.e. they always use official keys,
1025 # and will fail to build if the internal file is missing.
1027 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1028 # include.gypi or by other means. Due to subtleties of GYP, this
1029 # is not the same as leaving the variable unset, even though its
1031 # //google_apis/determine_use_official_keys.gypi is 2.
1033 # Set these to bake the specified API keys and OAuth client
1034 # IDs/secrets into your build.
1036 # If you create a build without values baked in, you can instead
1037 # set environment variables to provide the keys at runtime (see
1038 # src/google_apis/google_api_keys.h for details). Features that
1039 # require server-side APIs may fail to work if no keys are
1042 # Note that if you are building an official build or if
1043 # use_official_google_api_keys has been set to 1 (explicitly or
1044 # implicitly), these values will be ignored and the official
1045 # keys will be used instead.
1046 'google_api_key%': '',
1047 'google_default_client_id%': '',
1048 'google_default_client_secret%': '',
1049 # Native Client is enabled by default.
1050 'disable_nacl%': '0',
1052 # Set to 1 to support old history files
1053 'support_pre_M6_history_database%': '1',
1056 # Copy conditionally-set variables out one scope.
1057 'branding%': '<(branding)',
1058 'buildtype%': '<(buildtype)',
1059 'target_arch%': '<(target_arch)',
1060 'target_subarch%': '<(target_subarch)',
1061 'mips_arch_variant%': '<(mips_arch_variant)',
1062 'host_arch%': '<(host_arch)',
1063 'toolkit_views%': '<(toolkit_views)',
1064 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1065 'use_aura%': '<(use_aura)',
1066 'use_ash%': '<(use_ash)',
1067 'use_cras%': '<(use_cras)',
1068 'use_libpci%': '<(use_libpci)',
1069 'use_openssl%': '<(use_openssl)',
1070 'use_openssl_certs%': '<(use_openssl_certs)',
1071 'use_nss%': '<(use_nss)',
1072 'use_udev%': '<(use_udev)',
1073 'os_bsd%': '<(os_bsd)',
1074 'os_posix%': '<(os_posix)',
1075 'use_dbus%': '<(use_dbus)',
1076 'use_glib%': '<(use_glib)',
1077 'use_pango%': '<(use_pango)',
1078 'use_cairo%': '<(use_cairo)',
1079 'use_ozone%': '<(use_ozone)',
1080 'use_ozone_evdev%': '<(use_ozone_evdev)',
1081 'use_xkbcommon%': '<(use_xkbcommon)',
1082 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1083 'desktop_linux%': '<(desktop_linux)',
1084 'use_x11%': '<(use_x11)',
1085 'use_gnome_keyring%': '<(use_gnome_keyring)',
1086 'linux_fpic%': '<(linux_fpic)',
1087 'chromeos%': '<(chromeos)',
1088 'chromecast%': '<(chromecast)',
1089 'enable_viewport%': '<(enable_viewport)',
1090 'enable_hidpi%': '<(enable_hidpi)',
1091 'image_loader_extension%': '<(image_loader_extension)',
1092 'fastbuild%': '<(fastbuild)',
1093 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1094 'win_z7%': '<(win_z7)',
1095 'dcheck_always_on%': '<(dcheck_always_on)',
1096 'tracing_like_official_build%': '<(tracing_like_official_build)',
1097 'arm_version%': '<(arm_version)',
1098 'arm_neon%': '<(arm_neon)',
1099 'arm_neon_optional%': '<(arm_neon_optional)',
1100 'sysroot%': '<(sysroot)',
1101 'chroot_cmd%': '<(chroot_cmd)',
1102 'system_libdir%': '<(system_libdir)',
1103 'component%': '<(component)',
1104 'win_analyze%': '<(win_analyze)',
1105 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1106 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1107 'use_third_party_translations%': '<(use_third_party_translations)',
1108 'remoting%': '<(remoting)',
1109 'enable_one_click_signin%': '<(enable_one_click_signin)',
1110 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1111 'enable_webrtc%': '<(enable_webrtc)',
1112 'chromium_win_pch%': '<(chromium_win_pch)',
1113 'configuration_policy%': '<(configuration_policy)',
1114 'safe_browsing%': '<(safe_browsing)',
1115 'enable_web_speech%': '<(enable_web_speech)',
1116 'notifications%': '<(notifications)',
1117 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1118 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1120 'asan_blacklist%': '<(asan_blacklist)',
1121 'asan_coverage%': '<(asan_coverage)',
1122 'asan_field_padding%': '<(asan_field_padding)',
1123 'use_sanitizer_options%': '<(use_sanitizer_options)',
1124 'syzyasan%': '<(syzyasan)',
1125 'syzygy_optimize%': '<(syzygy_optimize)',
1128 'msan_blacklist%': '<(msan_blacklist)',
1129 'msan_track_origins%': '<(msan_track_origins)',
1131 'tsan_blacklist%': '<(tsan_blacklist)',
1132 'ubsan%': '<(ubsan)',
1133 'ubsan_blacklist%': '<(ubsan_blacklist)',
1134 'ubsan_vptr%': '<(ubsan_vptr)',
1135 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1136 'use_custom_libcxx%': '<(use_custom_libcxx)',
1137 'use_system_libcxx%': '<(use_system_libcxx)',
1138 'clang_type_profiler%': '<(clang_type_profiler)',
1139 'order_profiling%': '<(order_profiling)',
1140 'order_text_section%': '<(order_text_section)',
1141 'enable_extensions%': '<(enable_extensions)',
1142 'enable_plugin_installation%': '<(enable_plugin_installation)',
1143 'enable_plugins%': '<(enable_plugins)',
1144 'enable_session_service%': '<(enable_session_service)',
1145 'enable_themes%': '<(enable_themes)',
1146 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1147 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1148 'enable_background%': '<(enable_background)',
1149 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1150 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1151 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1152 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1153 'use_canvas_skia%': '<(use_canvas_skia)',
1154 'test_isolation_mode%': '<(test_isolation_mode)',
1155 'test_isolation_outdir%': '<(test_isolation_outdir)',
1156 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
1157 'enable_basic_printing%': '<(enable_basic_printing)',
1158 'enable_print_preview%': '<(enable_print_preview)',
1159 'enable_spellcheck%': '<(enable_spellcheck)',
1160 'enable_google_now%': '<(enable_google_now)',
1161 'cld_version%': '<(cld_version)',
1162 'cld2_table_size%': '<(cld2_table_size)',
1163 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1164 'disable_file_support%': '<(disable_file_support)',
1165 'disable_ftp_support%': '<(disable_ftp_support)',
1166 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1167 'enable_task_manager%': '<(enable_task_manager)',
1168 'sas_dll_path%': '<(sas_dll_path)',
1169 'wix_path%': '<(wix_path)',
1170 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1171 'use_system_libjpeg%': '<(use_system_libjpeg)',
1172 'android_channel%': '<(android_channel)',
1173 'android_webview_build%': '<(android_webview_build)',
1174 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1175 'gyp_managed_install%': 0,
1176 'create_standalone_apk%': 1,
1177 'enable_app_list%': '<(enable_app_list)',
1178 'use_default_render_theme%': '<(use_default_render_theme)',
1179 'enable_settings_app%': '<(enable_settings_app)',
1180 'google_api_key%': '<(google_api_key)',
1181 'google_default_client_id%': '<(google_default_client_id)',
1182 'google_default_client_secret%': '<(google_default_client_secret)',
1183 'enable_supervised_users%': '<(enable_supervised_users)',
1184 'native_discardable_memory%': '<(native_discardable_memory)',
1185 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1186 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1187 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1188 'enable_mdns%' : '<(enable_mdns)',
1189 'enable_service_discovery%' : '<(enable_service_discovery)',
1190 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1191 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1192 'v8_optimized_debug%': '<(v8_optimized_debug)',
1193 'proprietary_codecs%': '<(proprietary_codecs)',
1194 'use_goma%': '<(use_goma)',
1195 'gomadir%': '<(gomadir)',
1196 'use_lto%': '<(use_lto)',
1197 'use_lto_o2%': '<(use_lto_o2)',
1198 'video_hole%': '<(video_hole)',
1199 'support_pre_M6_history_database%': '<(support_pre_M6_history_database)',
1200 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1202 # Use system protobuf instead of bundled one.
1203 'use_system_protobuf%': 0,
1205 # Use system yasm instead of bundled one.
1206 'use_system_yasm%': 0,
1208 # Use system ICU instead of bundled one.
1209 'use_system_icu%' : 0,
1211 # Default to enabled PIE; this is important for ASLR but we may need to be
1212 # able to turn it off for various reasons.
1213 'linux_disable_pie%': 0,
1215 # The release channel that this build targets. This is used to restrict
1216 # channel-specific build options, like which installer packages to create.
1217 # The default is 'all', which does no channel-specific filtering.
1220 # Override chromium_mac_pch and set it to 0 to suppress the use of
1221 # precompiled headers on the Mac. Prefix header injection may still be
1222 # used, but prefix headers will not be precompiled. This is useful when
1223 # using distcc to distribute a build to compile slaves that don't
1224 # share the same compiler executable as the system driving the compilation,
1225 # because precompiled headers rely on pointers into a specific compiler
1226 # executable's image. Setting this to 0 is needed to use an experimental
1227 # Linux-Mac cross compiler distcc farm.
1228 'chromium_mac_pch%': 1,
1230 # The default value for mac_strip in target_defaults. This cannot be
1231 # set there, per the comment about variable% in a target_defaults.
1232 'mac_strip_release%': 0,
1234 # Set to 1 to enable java code coverage. Instruments classes during build
1235 # to produce .ec files during runtime.
1236 'emma_coverage%': 0,
1238 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1239 # separated with whitespace and/or comma. Only has effect if
1240 # 'emma_coverage=1'.
1243 # Set to 1 to enable running Android lint on java/class files.
1246 # Although base/allocator lets you select a heap library via an
1247 # environment variable, the libcmt shim it uses sometimes gets in
1248 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1249 # 'win_use_allocator_shim': 0,
1250 # 'win_release_RuntimeLibrary': 2
1251 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1252 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1254 # TODO(bradnelson): eliminate this when possible.
1255 # To allow local gyp files to prevent release.vsprops from being included.
1256 # Yes(1) means include release.vsprops.
1257 # Once all vsprops settings are migrated into gyp, this can go away.
1258 'msvs_use_common_release%': 1,
1260 # TODO(bradnelson): eliminate this when possible.
1261 # To allow local gyp files to override additional linker options for msvs.
1262 # Yes(1) means set use the common linker options.
1263 'msvs_use_common_linker_extras%': 1,
1265 # TODO(sgk): eliminate this if possible.
1266 # It would be nicer to support this via a setting in 'target_defaults'
1267 # in chrome/app/locales/locales.gypi overriding the setting in the
1268 # 'Debug' configuration in the 'target_defaults' dict below,
1269 # but that doesn't work as we'd like.
1270 'msvs_debug_link_incremental%': '2',
1272 # Needed for some of the largest modules.
1273 'msvs_debug_link_nonincremental%': '1',
1275 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1276 # to get incremental linking to be faster in debug builds.
1277 'incremental_chrome_dll%': '0',
1279 # Experimental setting to break chrome.dll into multiple pieces based on
1281 'chrome_multiple_dll%': '0',
1283 # Experimental setting to optimize Chrome's DLLs with PGO.
1284 'chrome_pgo_phase%': '0',
1286 # Whether the VS xtree header has been patched to disable warning 4702. If
1287 # it has, then we don't need to disable 4702 (unreachable code warning).
1288 # The patch is preapplied to the internal toolchain and hence all bots.
1289 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1292 'clang%': '<(clang)',
1293 'host_clang%': '<(host_clang)',
1294 'make_clang_dir%': '<(make_clang_dir)',
1295 'use_lld%': '<(use_lld)',
1297 # Control which version of clang to use when building for iOS. If set to
1298 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1299 # the version of clang that ships with the Chromium source. This variable
1300 # is automatically set to '1' when using the Xcode generator.
1303 # These two variables can be set in GYP_DEFINES while running
1304 # |gclient runhooks| to let clang run a plugin in every compilation.
1305 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1307 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1310 'clang_add_plugin%': '',
1312 # Tell ld64 to write map files describing binary layout. Useful
1313 # for looking at what contributes to binary size, e.g. with
1314 # https://github.com/nico/bloat
1315 'mac_write_linker_maps%': 0,
1317 # The default type of gtest.
1318 'gtest_target_type%': 'executable',
1320 # Enable sampling based profiler.
1321 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1323 # Profile without optimizing out stack frames when profiling==1.
1324 'profiling_full_stack_frames%': '0',
1326 # And if we want to dump symbols for Breakpad-enabled builds.
1327 'linux_dump_symbols%': 0,
1328 # And if we want to strip the binary after dumping symbols.
1329 'linux_strip_binary%': 0,
1330 # If we want stack unwind support for backtrace().
1331 'debug_unwind_tables%': 1,
1332 'release_unwind_tables%': 1,
1334 # Override where to find binutils
1335 'binutils_version%': 0,
1336 'binutils_dir%': '',
1339 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1340 'use_allocator%': 'tcmalloc',
1342 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1343 'linux_link_gnome_keyring%': 0,
1344 # Set to 1 to link against gsettings APIs instead of using dlopen().
1345 'linux_link_gsettings%': 0,
1347 # Enable use of OpenMAX DL FFT routines.
1348 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1350 # Enable new NPDevice API.
1351 'enable_new_npdevice_api%': 0,
1353 # .gyp files or targets should set chromium_code to 1 if they build
1354 # Chromium-specific code, as opposed to external code. This variable is
1355 # used to control such things as the set of warnings to enable, and
1356 # whether warnings are treated as errors.
1357 'chromium_code%': 0,
1359 # Disable fatal linker warnings, similarly to how we make it possible
1360 # to disable -Werror (e.g. for different toolchain versions).
1361 'disable_fatal_linker_warnings%': 0,
1363 'release_valgrind_build%': 0,
1365 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1366 'enable_wexit_time_destructors%': 0,
1368 # Build libpeerconnection as a static library by default.
1369 'libpeer_target_type%': 'static_library',
1371 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1372 'internal_gles2_conform_tests%': 0,
1374 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1375 'internal_khronos_glcts_tests%': 0,
1377 # Set to 1 to compile the filter fuzzer.
1378 'internal_filter_fuzzer%': 0,
1380 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1381 # so Cocoa is happy (http://crbug.com/20441).
1383 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1384 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1385 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1386 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1387 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1388 'vi', 'zh-CN', 'zh-TW',
1391 # Pseudo locales are special locales which are used for testing and
1392 # debugging. They don't get copied to the final app. For more info,
1393 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
1400 # If debug_devtools is set to 1, JavaScript files for DevTools are
1401 # stored as is and loaded from disk. Otherwise, a concatenated file
1402 # is stored in resources.pak. It is still possible to load JS files
1403 # from disk by passing --debug-devtools cmdline switch.
1404 'debug_devtools%': 0,
1406 # The Java Bridge is not compiled in by default.
1409 # Code signing for iOS binaries. The bots need to be able to disable this.
1410 'chromium_ios_signing%': 1,
1412 # This flag is only used when disable_nacl==0 and disables all those
1413 # subcomponents which would require the installation of a native_client
1414 # untrusted toolchain.
1415 'disable_nacl_untrusted%': 0,
1417 # Disable Dart by default.
1420 # Copy out the setting of disable_nacl.
1421 'disable_nacl%': '<(disable_nacl)',
1423 # Portable Native Client is enabled by default.
1424 'disable_pnacl%': 0,
1426 # Whether to build full debug version for Debug configuration on Android.
1427 # Compared to full debug version, the default Debug configuration on Android
1428 # has no full v8 debug, has size optimization and linker gc section, so that
1429 # we can build a debug version with acceptable size and performance.
1430 'android_full_debug%': 0,
1432 # Sets the default version name and code for Android app, by default we
1433 # do a developer build.
1434 'android_app_version_name%': 'Developer Build',
1435 'android_app_version_code%': 1,
1437 # Contains data about the attached devices for gyp_managed_install.
1438 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1440 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1441 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1443 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1444 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1446 # Whether we are using the rlz library or not. Platforms like Android send
1447 # rlz codes for searches but do not use the library.
1450 # Turns on the i18n support in V8.
1451 'v8_enable_i18n_support': 1,
1453 # Compile d8 for the host toolset.
1454 'v8_toolset_for_d8': 'host',
1456 # Enable the V8 heap verification code. The verification itself is enabled
1457 # via a command line option.
1458 'v8_enable_verify_heap%': 1,
1460 # Use brlapi from brltty for braille display support.
1463 # Relative path to icu.gyp from this file.
1464 'icu_gyp_path': '../third_party/icu/icu.gyp',
1466 # IPC fuzzer is disabled by default.
1467 'enable_ipc_fuzzer%': 0,
1469 # Force disable libstdc++ debug mode.
1470 'disable_glibcxx_debug%': 0,
1472 # Set to 1 to compile with MSE support for MPEG2 TS
1473 'enable_mpeg2ts_stream_parser%': 0,
1475 # Support ChromeOS touchpad gestures with ozone.
1476 'use_evdev_gestures%': 0,
1478 # Default ozone platform (if no --ozone-platform flag).
1479 'ozone_platform%': "",
1481 # Ozone platforms to include in the build.
1482 'ozone_platform_caca%': 0,
1483 'ozone_platform_dri%': 0,
1484 'ozone_platform_egltest%': 0,
1485 'ozone_platform_gbm%': 0,
1486 'ozone_platform_ozonex%': 0,
1487 'ozone_platform_test%': 0,
1489 # Whether the browser is non-native (using Views Toolkit) on Mac.
1490 'mac_views_browser%': 0,
1492 # Experiment: http://crbug.com/426914
1496 ['buildtype=="Official"', {
1497 # Continue to embed build meta data in Official builds, basically the
1498 # time it was built.
1499 # TODO(maruel): This decision should be revisited because having an
1500 # official deterministic build has high value too but MSVC toolset can't
1501 # generate anything deterministic with WPO enabled AFAIK.
1502 'dont_embed_build_metadata%': 0,
1504 # Enable the Syzygy optimization step for the official builds.
1505 ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
1506 'syzygy_optimize%': 1,
1508 'syzygy_optimize%': 0,
1510 # Get binutils version so we can enable debug fission if we can.
1511 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1513 # compiler_version doesn't work with clang
1514 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1515 # compiler_version works with clang.
1516 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1517 # that it takes effect here.
1518 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1519 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1521 # On Android we know the binutils version in the toolchain.
1523 'binutils_version%': 222,
1525 ['host_arch=="x64"', {
1526 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1528 ['host_arch=="ia32"', {
1529 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1531 # Our version of binutils in third_party/binutils
1532 ['linux_use_bundled_binutils==1', {
1533 'binutils_version%': 224,
1537 'binutils_version%': 0,
1539 # The version of GCC in use, set later in platforms that use GCC and have
1540 # not explicitly chosen to build with clang. Currently, this means all
1541 # platforms except Windows, Mac and iOS.
1542 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1543 # it takes effect here.
1544 ['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', {
1546 ['OS=="android" and android_webview_build==0', {
1547 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1548 # We directly set the gcc version since we know what we use.
1551 ['OS=="android" and android_webview_build==1', {
1552 # Android WebView uses a hermetic clang toolchain for host builds.
1553 'host_gcc_version%': 0,
1554 # Android WebView uses the GCC toolchain from the Android build.
1558 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1559 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1563 'host_gcc_version%': 0,
1566 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1567 'windows_sdk_path%': '<(windows_sdk_default_path)',
1569 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1571 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1572 'directx_sdk_path%': '<(directx_sdk_default_path)',
1574 'directx_sdk_path%': '$(DXSDK_DIR)',
1577 'windows_driver_kit_path%': '$(WDK_DIR)',
1579 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1581 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1584 'nacl_untrusted_build%': 0,
1585 'use_allocator%': 'none',
1587 ['OS=="linux" and target_arch=="mipsel"', {
1588 'sysroot%': '<(sysroot)',
1591 # Use a 64-bit linker to avoid running out of address space. The
1592 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1593 ['host_arch=="ia32" and target_arch=="ia32"', {
1594 # TODO(thestig) This is a horrible way to force the desired
1595 # configuration. Our gyp variable scoping is likely wrong and
1596 # needs to be cleaned up. The GN configuration should be changed
1598 'binutils_version%': 224,
1599 'linux_use_bundled_binutils%': '1',
1600 'linux_use_bundled_gold%': '1',
1601 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1603 # All Chrome builds have breakpad symbols, but only process the
1604 # symbols from official builds.
1605 ['(branding=="Chrome" and buildtype=="Official")', {
1606 'linux_dump_symbols%': 1,
1608 # Omit unwind support in official release builds to save space. We
1609 # can use breakpad for these builds.
1610 'release_unwind_tables%': 0,
1613 }], # os_posix==1 and OS!="mac" and OS!="ios"
1616 'enable_background%': 0,
1617 'icu_use_data_file_flag%': 1,
1618 'enable_web_speech%': 0,
1619 'use_system_libxml%': 1,
1620 'use_system_sqlite%': 1,
1622 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1623 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1624 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1625 'uk', 'vi', 'zh-CN', 'zh-TW',
1628 # iOS SDK and deployment target support. The |ios_sdk| value is left
1629 # blank so that when it is set in the project files it will be the
1630 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1631 # causes Xcode to spit out a warning for every single project file for
1632 # not using the "current" SDK.
1634 'ios_sdk_path%': '',
1635 'ios_deployment_target%': '7.0',
1638 # ios_product_name is set to the name of the .app bundle as it should
1640 ['branding=="Chrome"', {
1641 'ios_product_name%': 'Chrome',
1642 }, { # else: branding!="Chrome"
1643 'ios_product_name%': 'Chromium',
1645 ['branding=="Chrome" and buildtype=="Official"', {
1647 }, { # else: branding!="Chrome" or buildtype!="Official"
1653 # Location of Android NDK.
1656 # Unfortunately we have to use absolute paths to the SDK/NDK because
1657 # they're passed to ant which uses a different relative path from
1659 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1660 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1661 'android_host_arch%': '<!(uname -m)',
1662 # Android API-level of the SDK used for compilation.
1663 'android_sdk_version%': '21',
1664 'android_sdk_build_tools_version%': '21.0.1',
1665 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1667 # Copy conditionally-set variables out one scope.
1668 'android_ndk_root%': '<(android_ndk_root)',
1669 'android_sdk_root%': '<(android_sdk_root)',
1670 'android_sdk_version%': '<(android_sdk_version)',
1671 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1672 'host_os%': '<(host_os)',
1674 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1675 # Android SDK build tools (e.g. dx, aapt, aidl)
1676 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1678 # Android API level 14 is ICS (Android 4.0) which is the minimum
1679 # platform requirement for Chrome on Android, we use it for native
1682 ['target_arch == "ia32"', {
1683 'android_app_abi%': 'x86',
1684 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver',
1685 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1686 'android_ndk_lib_dir%': 'usr/lib',
1687 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1689 ['target_arch == "x64"', {
1690 'android_app_abi%': 'x86_64',
1691 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1692 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1693 'android_ndk_lib_dir%': 'usr/lib64',
1694 'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1696 ['target_arch=="arm"', {
1699 'android_app_abi%': 'armeabi',
1701 'android_app_abi%': 'armeabi-v7a',
1704 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver',
1705 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1706 'android_ndk_lib_dir%': 'usr/lib',
1707 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1709 ['target_arch == "arm64"', {
1710 'android_app_abi%': 'arm64-v8a',
1711 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1712 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1713 'android_ndk_lib_dir%': 'usr/lib',
1714 'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1716 ['target_arch == "mipsel"', {
1717 'android_app_abi%': 'mips',
1718 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver',
1719 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1720 'android_ndk_lib_dir%': 'usr/lib',
1721 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1723 ['target_arch == "mips64el"', {
1724 'android_app_abi%': 'mips64',
1725 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1726 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1727 'android_ndk_lib_dir%': 'usr/lib64',
1728 'android_toolchain%': '<(android_ndk_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1733 # Copy conditionally-set variables out one scope.
1734 'android_app_abi%': '<(android_app_abi)',
1735 'android_gdbserver%': '<(android_gdbserver)',
1736 'android_ndk_root%': '<(android_ndk_root)',
1737 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1738 'android_sdk_root%': '<(android_sdk_root)',
1739 'android_sdk_version%': '<(android_sdk_version)',
1740 'android_toolchain%': '<(android_toolchain)',
1742 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1743 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1744 'android_sdk_tools%': '<(android_sdk_tools)',
1745 'android_sdk%': '<(android_sdk)',
1746 'android_sdk_jar%': '<(android_sdk)/android.jar',
1748 'android_stlport_root': '<(android_stlport_root)',
1749 'android_stlport_include': '<(android_stlport_root)/stlport',
1750 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1751 'host_os%': '<(host_os)',
1753 # Location of the "objcopy" binary, used by both gyp and scripts.
1754 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1756 # Location of the "strip" binary, used by both gyp and scripts.
1757 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1759 # Location of the "readelf" binary.
1760 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1762 # Determines whether we should optimize JNI generation at the cost of
1763 # breaking assumptions in the build system that when inputs have changed
1764 # the outputs should always change as well. This is meant purely for
1765 # developer builds, to avoid spurious re-linking of native files.
1766 'optimize_jni_generation%': '<(optimize_jni_generation)',
1768 # Always uses openssl.
1770 'use_openssl_certs%': 1,
1772 'proprietary_codecs%': '<(proprietary_codecs)',
1773 'safe_browsing%': 2,
1774 'enable_web_speech%': 0,
1776 'build_ffmpegsumo%': 0,
1777 'use_allocator%': 'none',
1779 # Disable Native Client.
1782 # Android does not support background apps.
1783 'enable_background%': 0,
1785 # Sessions are store separately in the Java side.
1786 'enable_session_service%': 0,
1790 'gtest_target_type%': 'shared_library',
1792 # Uses system APIs for decoding audio and video.
1793 'use_libffmpeg%': '0',
1795 # TODO(torne): Remove this unsupported option once all the places that
1796 # test it have been updated.
1797 'use_system_stlport%': 0,
1799 # Copy it out one scope.
1800 'android_webview_build%': '<(android_webview_build)',
1802 # Default android linker script for shared library exports.
1803 'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_exports.lst',
1806 'use_system_fontconfig%': 0,
1808 'use_system_fontconfig%': 1,
1811 'enable_mpeg2ts_stream_parser%': 1,
1812 'ffmpeg_branding%': 'ChromeOS',
1813 'ozone_platform_ozonex%': 1,
1814 'use_playready%': 0,
1816 ['target_arch=="arm"', {
1818 'arm_tune%': 'cortex-a9',
1824 ['android_webview_build==1', {
1825 # When building the WebView in the Android tree, jarjar will remap all
1826 # the class names, so the JNI generator needs to know this.
1827 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1829 ['OS=="linux" and target_arch!="mipsel"', {
1830 # TODO(thakis): This is here to measure perf for a while.
1835 # All Chrome builds have breakpad symbols, but only process the
1836 # symbols from official builds.
1837 ['(branding=="Chrome" and buildtype=="Official")', {
1838 'mac_strip_release%': 1,
1842 ['OS=="mac" or OS=="ios"', {
1846 # Mac OS X SDK and deployment target support. The SDK identifies
1847 # the version of the system headers that will be used, and
1848 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1849 # macro. "Maximum allowed" refers to the operating system version
1850 # whose APIs are available in the headers. The deployment target
1851 # identifies the minimum system version that the built products are
1852 # expected to function on. It corresponds to the
1853 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1854 # macros are available, #include <AvailabilityMacros.h>. Additional
1855 # documentation on these macros is available at
1856 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1857 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1858 # deployment target to 10.6. Other projects, such as O3D, may
1859 # override these defaults.
1861 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1862 # about that is at least the specified version. In official builds,
1863 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1864 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1865 # path to the SDK; when set to a non-empty string, SDK detection
1866 # based on mac_sdk_min will be bypassed entirely.
1869 'mac_sdk_min%': '10.8',
1870 }, { # else OS!="ios"
1871 'mac_sdk_min%': '10.6',
1874 'mac_sdk_path%': '',
1876 'mac_deployment_target%': '10.6',
1879 'mac_sdk_min': '<(mac_sdk_min)',
1880 'mac_sdk_path': '<(mac_sdk_path)',
1881 'mac_deployment_target': '<(mac_deployment_target)',
1883 # Compile in Breakpad support by default so that it can be
1884 # tested, even if it is not enabled by default at runtime.
1885 'mac_breakpad_compiled_in%': 1,
1887 # mac_product_name is set to the name of the .app bundle as it should
1888 # appear on disk. This duplicates data from
1889 # chrome/app/theme/chromium/BRANDING and
1890 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1891 # these names into the build system.
1892 ['branding=="Chrome"', {
1893 'mac_product_name%': 'Google Chrome',
1894 }, { # else: branding!="Chrome"
1895 'mac_product_name%': 'Chromium',
1897 # Official mac builds require a specific OS X SDK, but iOS and
1898 # non-official mac builds do not.
1899 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1900 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1902 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1904 ['branding=="Chrome" and buildtype=="Official"', {
1905 # Enable uploading crash dumps.
1906 'mac_breakpad_uploads%': 1,
1907 # Enable dumping symbols at build time for use by Mac Breakpad.
1909 # Enable Keystone auto-update support.
1911 }, { # else: branding!="Chrome" or buildtype!="Official"
1912 'mac_breakpad_uploads%': 0,
1917 }], # OS=="mac" or OS=="ios"
1920 # This is the architecture convention used in WinSDK paths.
1921 ['target_arch=="ia32"', {
1922 'winsdk_arch%': 'x86',
1924 'winsdk_arch%': '<(target_arch)',
1926 ['component=="shared_library"', {
1927 'win_use_allocator_shim%': 0,
1929 # Turn on multiple dll by default on Windows when in static_library.
1930 'chrome_multiple_dll%': 1,
1933 'win_use_allocator_shim%': 0,
1935 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1936 # Only enabled by default for ninja because it's buggy in VS.
1937 # Not enabled for component=static_library because some targets
1938 # are too large and the toolchain fails due to the size of the
1940 'incremental_chrome_dll%': 1,
1942 # Don't do incremental linking for large modules on 32-bit or when
1943 # component=static_library as the toolchain fails due to the size of
1945 ['MSVS_OS_BITS==32 or component=="static_library"', {
1946 'msvs_large_module_debug_link_mode%': '1', # No
1948 'msvs_large_module_debug_link_mode%': '2', # Yes
1951 'nacl_win64_defines': [
1952 # This flag is used to minimize dependencies when building
1953 # Native Client loader for 64-bit Windows.
1956 # Need to include allocator target, but exclude tcmalloc files.
1957 'use_allocator%': 'winheap',
1960 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
1966 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
1967 'enable_pepper_cdms%': 1,
1969 'enable_pepper_cdms%': 0,
1972 ['OS=="android" or chromecast==1', {
1973 'enable_browser_cdms%': 1,
1975 'enable_browser_cdms%': 0,
1978 # Native Client glibc toolchain is enabled
1979 # by default except on arm, mips and mips64.
1980 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
1981 'disable_glibc%': 1,
1983 'disable_glibc%': 0,
1986 # Set the relative path from this file to the GYP file of the JPEG
1987 # library used by Chromium.
1988 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
1989 # Configuration for using the system libjeg is here.
1990 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
1992 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
1995 # Options controlling the use of GConf (the classic GNOME configuration
1996 # system) and GIO, which contains GSettings (the new GNOME config system).
1997 ['chromeos==1 or embedded==1', {
2005 # Set up -D and -E flags passed into grit.
2006 ['branding=="Chrome"', {
2007 # TODO(mmoss) The .grd files look for _google_chrome, but for
2008 # consistency they should look for google_chrome_build like C++.
2009 'grit_defines': ['-D', '_google_chrome',
2010 '-E', 'CHROMIUM_BUILD=google_chrome'],
2012 'grit_defines': ['-D', '_chromium',
2013 '-E', 'CHROMIUM_BUILD=chromium'],
2016 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2018 ['desktop_linux==1', {
2019 'grit_defines': ['-D', 'desktop_linux'],
2021 ['toolkit_views==1', {
2022 'grit_defines': ['-D', 'toolkit_views'],
2025 'grit_defines': ['-D', 'use_aura'],
2028 'grit_defines': ['-D', 'use_ash'],
2031 'grit_defines': ['-D', 'use_nss'],
2034 'grit_defines': ['-D', 'use_ozone'],
2036 ['image_loader_extension==1', {
2037 'grit_defines': ['-D', 'image_loader_extension'],
2040 'grit_defines': ['-D', 'remoting'],
2042 ['use_titlecase_in_grd==1', {
2043 'grit_defines': ['-D', 'use_titlecase'],
2045 ['use_third_party_translations==1', {
2046 'grit_defines': ['-D', 'use_third_party_translations'],
2048 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2049 'ka', 'ku', 'kw', 'ms', 'ug'
2055 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2056 '--no-output-all-resource-defines',
2059 ['OS=="mac" or OS=="ios"', {
2060 'grit_defines': ['-D', 'scale_factors=2x'],
2064 'enable_coverage%': 0,
2068 '--no-output-all-resource-defines',
2070 # iOS uses a whitelist to filter resources.
2071 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2073 # Enable host builds when generating with ninja-ios.
2075 ['"<(GENERATOR)"=="ninja"', {
2079 # TODO(sdefresne): Remove the target_subarch check once Apple has
2080 # upstreamed the support for "arm64". http://crbug.com/341453
2081 # TODO(eugenebut): Remove enable_coverage check once
2082 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2083 # http://crbug.com/450379
2084 ['target_subarch!="arm32" or enable_coverage or "<(GENERATOR)"=="xcode"', {
2089 ['enable_extensions==1', {
2090 'grit_defines': ['-D', 'enable_extensions'],
2092 ['enable_plugins!=0', {
2093 'grit_defines': ['-D', 'enable_plugins'],
2095 ['enable_basic_printing==1 or enable_print_preview==1', {
2096 'grit_defines': ['-D', 'enable_printing'],
2098 ['enable_print_preview==1', {
2099 'grit_defines': ['-D', 'enable_print_preview'],
2101 ['enable_themes==1', {
2102 'grit_defines': ['-D', 'enable_themes'],
2104 ['enable_app_list==1', {
2105 'grit_defines': ['-D', 'enable_app_list'],
2107 ['enable_settings_app==1', {
2108 'grit_defines': ['-D', 'enable_settings_app'],
2110 ['enable_google_now==1', {
2111 'grit_defines': ['-D', 'enable_google_now'],
2113 ['use_concatenated_impulse_responses==1', {
2114 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2116 ['enable_webrtc==1', {
2117 'grit_defines': ['-D', 'enable_webrtc'],
2119 ['enable_hangout_services_extension==1', {
2120 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2122 ['enable_task_manager==1', {
2123 'grit_defines': ['-D', 'enable_task_manager'],
2125 ['notifications==1', {
2126 'grit_defines': ['-D', 'enable_notifications'],
2128 ['enable_wifi_bootstrapping==1', {
2129 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2131 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2132 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2134 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2135 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2137 ['enable_mdns==1 or OS=="mac"', {
2138 'grit_defines': ['-D', 'enable_service_discovery'],
2139 'enable_service_discovery%': 1
2141 ['clang_use_chrome_plugins==1 and OS!="win"', {
2142 'clang_chrome_plugins_flags': [
2143 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
2146 # TODO(dcheng): https://crbug.com/417463 -- work to enable this flag
2147 # on all platforms is currently underway.
2148 ['OS=="android" or OS=="linux" or OS=="mac" or OS=="ios"', {
2149 'clang_chrome_plugins_flags': [
2151 '-plugin-arg-find-bad-constructs',
2153 'strict-virtual-specifiers',
2158 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2160 'use_allocator%': 'none',
2161 'use_sanitizer_options%': 1,
2163 ['asan==1 and OS=="linux" and chromeos==0', {
2164 'use_custom_libcxx%': 1,
2172 ['asan==1 and OS=="mac"', {
2173 'mac_strip_release': 1,
2176 'use_custom_libcxx%': 1,
2179 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2180 # libstdc++. This is required to avoid false positive reports whenever
2181 # the C++ standard library is used.
2182 'use_custom_libcxx%': 1,
2183 # Running the V8-generated code on an ARM simulator is a powerful hack
2184 # that allows the tool to see the memory accesses from JITted code.
2185 # Without this flag, JS code causes false positive reports from MSan.
2186 'v8_target_arch': 'arm64',
2189 ['OS=="linux" and clang_type_profiler==1', {
2191 'clang_use_chrome_plugins%': 0,
2193 ['host_arch=="x64"', {
2194 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2196 ['host_arch=="ia32"', {
2197 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2198 # Clang in this directory at your own risk if needed for some
2199 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2200 # usage). Any failure by this compiler should not close the tree.
2201 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2207 # The Clang plugins don't currently work on Windows.
2208 # TODO(hans): One day, this will work. (crbug.com/82385)
2209 'clang_use_chrome_plugins%': 0,
2212 # On valgrind bots, override the optimizer settings so we don't inline too
2213 # much and make the stacks harder to figure out.
2215 # TODO(rnk): Kill off variables that no one else uses and just implement
2216 # them under a build_for_tool== condition.
2217 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2219 'mac_debug_optimization': '1',
2220 'mac_release_optimization': '1',
2221 'release_optimize': '1',
2222 'no_gc_sections': 1,
2223 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2224 '-fno-builtin -fno-optimize-sibling-calls',
2225 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2226 '-fno-builtin -fno-optimize-sibling-calls',
2228 # MSVS flags for TSan on Pin and Windows.
2229 'win_debug_RuntimeChecks': '0',
2230 'win_debug_disable_iterator_debugging': '1',
2231 'win_debug_Optimization': '1',
2232 'win_debug_InlineFunctionExpansion': '0',
2233 'win_release_InlineFunctionExpansion': '0',
2234 'win_release_OmitFramePointers': '0',
2236 'use_allocator': 'tcmalloc',
2237 'release_valgrind_build': 1,
2239 'component': 'static_library',
2240 'use_system_zlib': 0,
2243 # Build tweaks for DrMemory.
2244 # TODO(rnk): Combine with tsan config to share the builder.
2245 # http://crbug.com/108155
2246 ['build_for_tool=="drmemory"', {
2247 # These runtime checks force initialization of stack vars which blocks
2248 # DrMemory's uninit detection.
2249 'win_debug_RuntimeChecks': '0',
2250 # Iterator debugging is slow.
2251 'win_debug_disable_iterator_debugging': '1',
2252 # Try to disable optimizations that mess up stacks in a release build.
2253 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2254 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2255 # compiler bug, so we use /Ob1 instead.
2256 'win_release_InlineFunctionExpansion': '1',
2257 'win_release_OmitFramePointers': '0',
2258 # Ditto for debug, to support bumping win_debug_Optimization.
2259 'win_debug_InlineFunctionExpansion': 0,
2260 'win_debug_OmitFramePointers': 0,
2261 # Keep the code under #ifndef NVALGRIND.
2262 'release_valgrind_build': 1,
2265 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2266 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2270 # Set default compiler flags depending on ARM version.
2271 ['arm_version==6 and android_webview_build==0', {
2272 'arm_arch%': 'armv6',
2275 'arm_float_abi%': 'softfp',
2278 ['arm_version==7 and android_webview_build==0', {
2279 'arm_arch%': 'armv7-a',
2280 'arm_tune%': 'generic-armv7-a',
2285 'arm_fpu%': 'vfpv3-d16',
2288 # Change the default to hard once the armhf transition is complete.
2289 'arm_float_abi%': 'softfp',
2293 # Set default compiler flags depending on MIPS architecture variant.
2294 ['target_arch=="mipsel" and mips_arch_variant=="r2" and android_webview_build==0', {
2295 'mips_fpu_mode%': 'fp32',
2298 ['android_webview_build==1', {
2299 # The WebView build gets its cpu-specific flags from the Android build system.
2303 'arm_float_abi%': '',
2305 'mips_fpu_mode%': '',
2308 # Enable brlapi by default for chromeos.
2313 ['use_ozone==1 and ozone_auto_platforms==1', {
2314 # Use test as the default platform.
2315 'ozone_platform%': 'test',
2317 # Build all platforms whose deps are in install-build-deps.sh.
2318 # Only these platforms will be compile tested by buildbots.
2319 'ozone_platform_dri%': 1,
2320 'ozone_platform_test%': 1,
2321 'ozone_platform_egltest%': 1,
2324 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2325 'use_clipboard_aurax11%': 1,
2328 ['OS=="win" and use_goma==1', {
2329 # goma doesn't support pch yet.
2330 'chromium_win_pch': 0,
2331 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2333 ['win_z7==0 and fastbuild==0', {
2339 ['OS=="win" and (clang==1 or asan==1)', {
2340 'chromium_win_pch': 0,
2344 'host_cc': '<(make_clang_dir)/bin/clang',
2345 'host_cxx': '<(make_clang_dir)/bin/clang++',
2347 'host_cc': '<!(which gcc)',
2348 'host_cxx': '<!(which g++)',
2351 # The seccomp-bpf sandbox is only supported on five architectures
2353 # Do not disable seccomp_bpf anywhere without talking to
2354 # security@chromium.org!
2355 ['((OS=="linux" or OS=="android") and '
2356 '(target_arch=="ia32" or target_arch=="x64" or '
2357 'target_arch=="arm" or target_arch=="mipsel" or '
2358 'target_arch=="arm64"))', {
2359 'use_seccomp_bpf%': 1,
2361 'use_seccomp_bpf%': 0,
2365 # older history files use fts2 instead of fts3
2366 'sqlite_enable_fts2%': '<(support_pre_M6_history_database)',
2368 # The path to the ANGLE library.
2369 'angle_path': '<(DEPTH)/third_party/angle',
2371 # List of default apps to install in new profiles. The first list contains
2372 # the source files as found in svn. The second list, used only for linux,
2373 # contains the destination location for each of the files. When a crx
2374 # is added or removed from the list, the chrome/browser/resources/
2375 # default_apps/external_extensions.json file must also be updated.
2376 'default_apps_list': [
2377 'browser/resources/default_apps/external_extensions.json',
2378 'browser/resources/default_apps/gmail.crx',
2379 'browser/resources/default_apps/search.crx',
2380 'browser/resources/default_apps/youtube.crx',
2381 'browser/resources/default_apps/drive.crx',
2382 'browser/resources/default_apps/docs.crx',
2384 'default_apps_list_linux_dest': [
2385 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2386 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2387 '<(PRODUCT_DIR)/default_apps/search.crx',
2388 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2389 '<(PRODUCT_DIR)/default_apps/drive.crx',
2390 '<(PRODUCT_DIR)/default_apps/docs.crx',
2393 # Whether to allow building of the GPU-related isolates.
2394 'archive_gpu_tests%': 0,
2396 # Whether to allow building of chromoting related isolates.
2397 'archive_chromoting_tests%': 0,
2399 'target_defaults': {
2401 # The condition that operates on chromium_code is in a target_conditions
2402 # section, and will not have access to the default fallback value of
2403 # chromium_code at the top of this file, or to the chromium_code
2404 # variable placed at the root variables scope of .gyp files, because
2405 # those variables are not set at target scope. As a workaround,
2406 # if chromium_code is not set at target scope, define it in target scope
2407 # to contain whatever value it has during early variable expansion.
2408 # That's enough to make it available during target conditional
2410 'chromium_code%': '<(chromium_code)',
2412 'component%': '<(component)',
2414 'chromecast%': '<(chromecast)',
2416 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2417 'win_release_Optimization%': '2', # 2 = /Os
2418 'win_debug_Optimization%': '0', # 0 = /Od
2420 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2421 # Tri-state: blank is default, 1 on, 0 off
2422 'win_release_OmitFramePointers%': '0',
2423 # Tri-state: blank is default, 1 on, 0 off
2424 'win_debug_OmitFramePointers%': '',
2426 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2427 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2429 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2430 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2431 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2433 # VS inserts quite a lot of extra checks to algorithms like
2434 # std::partial_sort in Debug build which make them O(N^2)
2435 # instead of O(N*logN). This is particularly slow under memory
2436 # tools like ThreadSanitizer so we want it to be disablable.
2437 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2438 'win_debug_disable_iterator_debugging%': '0',
2440 # An application manifest fragment to declare compatibility settings for
2441 # 'executable' targets. Ignored in other target type.
2442 'win_exe_compatibility_manifest%':
2443 '<(DEPTH)\\build\\win\\compatibility.manifest',
2445 'release_extra_cflags%': '',
2446 'debug_extra_cflags%': '',
2448 'release_valgrind_build%': '<(release_valgrind_build)',
2450 # the non-qualified versions are widely assumed to be *nix-only
2451 'win_release_extra_cflags%': '',
2452 'win_debug_extra_cflags%': '',
2454 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2455 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2457 # Only used by Windows build for now. Can be used to build into a
2458 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2459 # output files in src/build/VS2010_{Debug,Release}.
2460 'build_dir_prefix%': '',
2462 # Targets are by default not nacl untrusted code.
2463 'nacl_untrusted_build%': 0,
2465 'pnacl_compile_flags': [
2466 # pnacl uses the clang compiler so we need to suppress all the
2467 # same warnings as we do for clang.
2468 # TODO(sbc): Remove these if/when they are removed from the clang
2470 '-Wno-unused-function',
2471 '-Wno-char-subscripts',
2472 '-Wno-c++11-extensions',
2473 '-Wno-unnamed-type-template-args',
2477 ['OS=="win" and component=="shared_library"', {
2478 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2479 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2480 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2482 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2483 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2484 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2487 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2488 'mac_release_optimization%': 's', # Use -Os unless overridden
2489 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2491 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2492 'mac_release_optimization%': '2', # Use -O2 unless overridden
2493 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2496 'host_os%': '<(host_os)', # See comment above chromium_code.
2499 'clang_warning_flags': [
2502 # Don't die on dtoa code that uses a char as an array index.
2503 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2504 '-Wno-char-subscripts',
2506 # TODO(thakis): This used to be implied by -Wno-unused-function,
2507 # which we no longer use. Check if it makes sense to remove
2508 # this as well. http://crbug.com/316352
2509 '-Wno-unneeded-internal-declaration',
2511 # Warns on switches on enums that cover all enum values but
2512 # also contain a default: branch. Chrome is full of that.
2513 '-Wno-covered-switch-default',
2515 # Warns when a const char[] is converted to bool.
2516 '-Wstring-conversion',
2518 # C++11-related flags:
2520 # This warns on using ints as initializers for floats in
2521 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2522 # which happens in several places in chrome code. Not sure if
2523 # this is worth fixing.
2524 '-Wno-c++11-narrowing',
2526 # Clang considers the `register` keyword as deprecated, but e.g.
2527 # code generated by flex (used in angle) contains that keyword.
2528 # http://crbug.com/255186
2529 '-Wno-deprecated-register',
2531 # TODO(hans): Get this cleaned up.
2532 '-Wno-inconsistent-missing-override',
2535 'includes': [ 'set_clang_warning_flags.gypi', ],
2537 # Don't use deprecated V8 APIs anywhere.
2538 'V8_DEPRECATION_WARNINGS',
2541 '<(SHARED_INTERMEDIATE_DIR)',
2544 ['(OS=="mac" or OS=="ios") and asan==1', {
2546 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2549 ['OS=="win" and asan==1 and component=="shared_library"', {
2551 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2554 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2555 'cflags_cc!': ['-fno-rtti'],
2558 '-gline-tables-only',
2559 '-fintercept-allocation-functions',
2561 'defines': ['TYPE_PROFILING'],
2563 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2566 ['branding=="Chrome"', {
2567 'defines': ['GOOGLE_CHROME_BUILD'],
2568 }, { # else: branding!="Chrome"
2569 'defines': ['CHROMIUM_BUILD'],
2571 ['OS=="mac" and component=="shared_library"', {
2573 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2574 'LD_RUNPATH_SEARCH_PATHS': [
2575 # For unbundled binaries.
2577 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2578 '@loader_path/../../..',
2582 ['clang==1 and OS!="win"', {
2583 # This is here so that all files get recompiled after a clang roll and
2584 # when turning clang on or off.
2585 # (defines are passed via the command line, and build systems rebuild
2586 # things when their commandline changes). Nothing should ever read this
2588 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2591 'defines': ['ENABLE_RLZ'],
2593 ['component=="shared_library"', {
2594 'defines': ['COMPONENT_BUILD'],
2596 ['toolkit_views==1', {
2597 'defines': ['TOOLKIT_VIEWS=1'],
2599 ['ui_compositor_image_transport==1', {
2600 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2603 'defines': ['USE_AURA=1'],
2606 'defines': ['USE_ASH=1'],
2609 'defines': ['USE_PANGO=1'],
2612 'defines': ['USE_CAIRO=1'],
2615 'defines': ['USE_CRAS=1'],
2618 'defines': ['USE_OZONE=1'],
2620 ['use_default_render_theme==1', {
2621 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2623 ['use_libjpeg_turbo==1', {
2624 'defines': ['USE_LIBJPEG_TURBO=1'],
2627 'defines': ['USE_X11=1'],
2629 ['use_clipboard_aurax11==1', {
2630 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2632 ['enable_one_click_signin==1', {
2633 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2635 ['enable_pre_sync_backup==1', {
2636 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2638 ['image_loader_extension==1', {
2639 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2642 'defines': ['ENABLE_PROFILING=1'],
2645 'defines': ['ENABLE_REMOTING=1'],
2647 ['enable_webrtc==1', {
2648 'defines': ['ENABLE_WEBRTC=1'],
2650 ['proprietary_codecs==1', {
2651 'defines': ['USE_PROPRIETARY_CODECS'],
2653 ['enable_mpeg2ts_stream_parser==1', {
2654 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2658 ['enable_viewport==1', {
2659 'defines': ['ENABLE_VIEWPORT'],
2661 ['enable_pepper_cdms==1', {
2662 'defines': ['ENABLE_PEPPER_CDMS'],
2664 ['enable_browser_cdms==1', {
2665 'defines': ['ENABLE_BROWSER_CDMS'],
2667 ['configuration_policy==1', {
2668 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2670 ['notifications==1', {
2671 'defines': ['ENABLE_NOTIFICATIONS'],
2673 ['enable_hidpi==1', {
2674 'defines': ['ENABLE_HIDPI=1'],
2676 ['native_discardable_memory==1', {
2677 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
2679 ['native_memory_pressure_signals==1', {
2680 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2683 'defines': ['USE_UDEV'],
2687 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2690 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', {
2691 # Clang creates chubby debug information, which makes linking very
2692 # slow. For now, don't create debug information with clang. See
2693 # http://crbug.com/70000
2697 'debug_extra_cflags': '-g0',
2700 # Android builds symbols on release by default, disable them.
2703 'debug_extra_cflags': '-g0',
2704 'release_extra_cflags': '-g0',
2708 }, { # else clang!=1
2710 ['OS=="win" and fastbuild==2', {
2711 # Completely disable debug information.
2714 'GenerateDebugInformation': 'false',
2716 'VCCLCompilerTool': {
2717 'DebugInformationFormat': '0',
2721 ['OS=="win" and fastbuild==1', {
2724 # This tells the linker to generate .pdbs, so that
2725 # we can get meaningful stack traces.
2726 'GenerateDebugInformation': 'true',
2728 'VCCLCompilerTool': {
2729 # No debug info to be generated by compiler.
2730 'DebugInformationFormat': '0',
2734 ['OS=="linux" and fastbuild==2', {
2736 'debug_extra_cflags': '-g0',
2739 ['OS=="linux" and fastbuild==1', {
2741 'debug_extra_cflags': '-g1',
2744 ['OS=="android" and fastbuild==2', {
2746 'debug_extra_cflags': '-g0',
2747 'release_extra_cflags': '-g0',
2750 ['OS=="android" and fastbuild==1', {
2752 'debug_extra_cflags': '-g1',
2753 'release_extra_cflags': '-g1',
2760 ['dont_embed_build_metadata==1', {
2762 'DONT_EMBED_BUILD_METADATA',
2764 }], # dont_embed_build_metadata==1
2765 ['dcheck_always_on!=0', {
2766 'defines': ['DCHECK_ALWAYS_ON=1'],
2767 }], # dcheck_always_on!=0
2768 ['tracing_like_official_build!=0', {
2769 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2770 }], # tracing_like_official_build!=0
2772 'defines': ['NO_TCMALLOC'],
2774 ['win_use_allocator_shim==1', {
2775 'defines': ['ALLOCATOR_SHIM'],
2781 'ADDRESS_SANITIZER',
2782 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2783 'MEMORY_SANITIZER_INITIAL_SIZE',
2787 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2795 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2796 'MEMORY_SANITIZER_INITIAL_SIZE',
2799 '<(DEPTH)/third_party/kasko/include',
2805 '_CRT_SECURE_NO_DEPRECATE',
2806 '_SCL_SECURE_NO_DEPRECATE',
2807 # This define is required to pull in the new Win8 interfaces from
2808 # system headers like ShObjIdl.h.
2809 'NTDDI_VERSION=0x06030000',
2810 # This is required for ATL to use XP-safe versions of its functions.
2811 '_USING_V110_SDK71_',
2814 '<(DEPTH)/third_party/wtl/include',
2819 # Generates debug info when win_z7=1
2820 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2822 'GenerateDebugInformation': 'true',
2824 'VCCLCompilerTool': {
2825 'DebugInformationFormat': '1',
2831 # This is prohibited when running /analyze.
2832 '_USING_V110_SDK71_',
2835 'VCCLCompilerTool': {
2836 # Set WarnAsError to false to disable this setting for most
2837 # projects so that compilation continues.
2838 'WarnAsError': 'false',
2839 # When win_analyze is specified add the /analyze switch.
2840 # Also add /WX- to force-disable WarnAsError for projects that
2841 # override WarnAsError.
2842 # Also, disable various noisy warnings that have low value.
2843 'AdditionalOptions': [
2846 '/wd6011', # Dereferencing NULL pointer
2847 '/wd6312', # Possible infinite loop: use of the constant
2848 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2849 '/wd6326', # Potential comparison of constant with constant
2850 '/wd28159', # Consider using 'GetTickCount64'
2851 '/wd28204', # Inconsistent SAL annotations
2852 '/wd28251', # Inconsistent SAL annotations
2853 '/wd28252', # Inconsistent SAL annotations
2854 '/wd28253', # Inconsistent SAL annotations
2855 '/wd28196', # The precondition is not satisfied
2856 '/wd28301', # Inconsistent SAL annotations
2857 '/wd6340', # Sign mismatch in function parameter
2858 '/wd28182', # Dereferencing NULL pointer
2859 # C6285 is ~16% of raw warnings and has low value
2860 '/wd6285', # non-zero constant || non-zero constant
2861 # C6334 is ~80% of raw warnings and has low value
2862 '/wd6334', # sizeof applied to an expression with an operator
2874 ['use_playready==1', {
2876 'PLAYREADY_CDM_AVAILABLE',
2881 ['enable_task_manager==1', {
2883 'ENABLE_TASK_MANAGER=1',
2886 ['enable_extensions==1', {
2888 'ENABLE_EXTENSIONS=1',
2891 ['OS=="win" and branding=="Chrome"', {
2892 'defines': ['ENABLE_SWIFTSHADER'],
2894 ['enable_dart==1', {
2895 'defines': ['WEBKIT_USING_DART=1'],
2897 ['enable_plugin_installation==1', {
2898 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2900 ['enable_plugins==1', {
2901 'defines': ['ENABLE_PLUGINS=1'],
2903 ['enable_session_service==1', {
2904 'defines': ['ENABLE_SESSION_SERVICE=1'],
2906 ['enable_themes==1', {
2907 'defines': ['ENABLE_THEMES=1'],
2909 ['enable_autofill_dialog==1', {
2910 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2912 ['enable_prod_wallet_service==1', {
2913 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2915 ['enable_background==1', {
2916 'defines': ['ENABLE_BACKGROUND=1'],
2918 ['enable_google_now==1', {
2919 'defines': ['ENABLE_GOOGLE_NOW=1'],
2921 ['cld_version!=0', {
2922 'defines': ['CLD_VERSION=<(cld_version)'],
2924 ['enable_basic_printing==1 or enable_print_preview==1', {
2925 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2926 'defines': ['ENABLE_PRINTING=1'],
2928 ['enable_basic_printing==1', {
2929 # Enable basic printing support and UI.
2930 'defines': ['ENABLE_BASIC_PRINTING=1'],
2932 ['enable_print_preview==1', {
2933 # Enable printing with print preview.
2934 # Can be defined without ENABLE_BASIC_PRINTING.
2935 'defines': ['ENABLE_PRINT_PREVIEW=1'],
2937 ['enable_spellcheck==1', {
2938 'defines': ['ENABLE_SPELLCHECK=1'],
2940 ['enable_captive_portal_detection==1', {
2941 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2943 ['enable_app_list==1', {
2944 'defines': ['ENABLE_APP_LIST=1'],
2946 ['enable_settings_app==1', {
2947 'defines': ['ENABLE_SETTINGS_APP=1'],
2949 ['disable_file_support==1', {
2950 'defines': ['DISABLE_FILE_SUPPORT=1'],
2952 ['disable_ftp_support==1', {
2953 'defines': ['DISABLE_FTP_SUPPORT=1'],
2955 ['use_icu_alternatives_on_android==1', {
2956 'defines': ['USE_ICU_ALTERNATIVES_ON_ANDROID=1'],
2958 ['enable_supervised_users==1', {
2959 'defines': ['ENABLE_SUPERVISED_USERS=1'],
2961 ['spdy_proxy_auth_property != ""', {
2962 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
2964 ['spdy_proxy_auth_value != ""', {
2965 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
2967 ['enable_mdns==1', {
2968 'defines': ['ENABLE_MDNS=1'],
2970 ['enable_service_discovery==1', {
2971 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
2973 ['enable_wifi_bootstrapping==1', {
2974 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
2976 ['enable_hangout_services_extension==1', {
2977 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
2979 ['enable_ipc_fuzzer==1', {
2980 'defines': ['ENABLE_IPC_FUZZER=1'],
2983 'defines': ['VIDEO_HOLE=1'],
2985 ['v8_use_external_startup_data==1', {
2986 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
2988 ['use_lto==1 and (target_arch=="ia32" or target_arch=="x64")', {
2989 # Required for third_party/zlib/crc_folding.c and various other code
2990 # that uses SSE. TODO(pcc): Remove this once we properly support
2991 # subtarget specific code generation in LLVM.
2992 'ldflags': ['-Wl,-plugin-opt,mcpu=corei7-avx'],
2994 ], # conditions for 'target_defaults'
2995 'target_conditions': [
2996 ['<(use_libpci)==1', {
2997 'defines': ['USE_LIBPCI=1'],
2999 ['<(use_openssl)==1', {
3000 'defines': ['USE_OPENSSL=1'],
3002 ['<(use_openssl_certs)==1', {
3003 'defines': ['USE_OPENSSL_CERTS=1'],
3005 ['>(nacl_untrusted_build)==1', {
3008 'USE_OPENSSL_CERTS=1',
3011 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3012 'defines': ['USE_GLIB=1'],
3014 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
3015 'defines': ['USE_NSS=1'],
3017 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3018 'defines': ['OS_CHROMEOS=1'],
3020 ['enable_wexit_time_destructors==1 and OS!="win"', {
3021 # TODO: Enable on Windows too, http://crbug.com/404525
3022 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3024 ['chromium_code==0', {
3026 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3027 # We don't want to get warnings from third-party code,
3028 # so remove any existing warning-enabling flags like -Wall.
3034 # Don't warn about hash_map in third-party code.
3038 # Don't warn about printf format problems.
3039 # This is off by default in gcc but on in Ubuntu's gcc(!).
3043 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3047 # TODO: Fix all warnings on chromeos too.
3048 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3053 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3055 # Don't warn about ignoring the return value from e.g. close().
3056 # This is off by default in some gccs but on by default in others.
3057 # BSD systems do not support this option, since they are usually
3058 # using gcc 4.2.1, which does not have this flag yet.
3059 '-Wno-unused-result',
3064 '_CRT_SECURE_NO_DEPRECATE',
3065 '_CRT_NONSTDC_NO_WARNINGS',
3066 '_CRT_NONSTDC_NO_DEPRECATE',
3067 '_SCL_SECURE_NO_DEPRECATE',
3069 'msvs_disabled_warnings': [4800],
3071 'VCCLCompilerTool': {
3072 'WarningLevel': '3',
3073 'WarnAsError': 'true',
3074 'Detect64BitPortabilityProblems': 'false',
3078 ['buildtype=="Official"', {
3080 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3085 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3088 [ 'component=="shared_library"', {
3089 # TODO(darin): Unfortunately, some third_party code depends on base.
3090 'msvs_disabled_warnings': [
3091 4251, # class 'std::xx' needs to have dll-interface.
3097 [ 'OS=="mac" or OS=="ios"', {
3099 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3102 ['buildtype=="Official"', {
3104 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3111 # TODO(ios): Fix remaining warnings in third-party code, then
3112 # remove this; the Mac cleanup didn't get everything that's
3113 # flagged in an iOS build.
3114 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3115 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3116 # Several internal ios directories generate numerous warnings for
3117 # -Wobjc-missing-property-synthesis.
3118 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3124 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3125 'filename_rules.gypi',
3127 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3128 # C99 macros on Mac and Linux.
3130 '__STDC_CONSTANT_MACROS',
3131 '__STDC_FORMAT_MACROS',
3135 # turn on warnings for signed/unsigned mismatch on chromium code.
3137 'VCCLCompilerTool': {
3138 'AdditionalOptions': ['/we4389'],
3142 ['OS=="win" and component=="shared_library"', {
3143 'msvs_disabled_warnings': [
3144 4251, # class 'std::xx' needs to have dll-interface.
3149 ], # target_conditions for 'target_defaults'
3150 'default_configuration': 'Debug',
3152 # VCLinkerTool LinkIncremental values below:
3154 # 1 == /INCREMENTAL:NO
3156 # Debug links incremental, Release does not.
3158 # Abstract base configurations to cover common attributes.
3162 'msvs_configuration_attributes': {
3163 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3164 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3165 'CharacterSet': '1',
3167 # Add the default import libs.
3170 'AdditionalDependencies': [
3187 'AdditionalOptions': [
3188 # Suggested by Microsoft Devrel to avoid
3189 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3190 # which started happening more regularly after VS2013 Update 4.
3191 '/maxilksize:2147483647',
3200 'MinimumRequiredVersion': '5.01', # XP.
3201 'TargetMachine': '1',
3203 'VCLibrarianTool': {
3204 'TargetMachine': '1',
3207 'msvs_configuration_platform': 'Win32',
3211 'msvs_configuration_platform': 'x64',
3214 # Make sure to understand http://crbug.com/361720 if you want to
3216 'MinimumRequiredVersion': '5.02', # Server 2003.
3217 'TargetMachine': '17', # x86 - 64
3218 'AdditionalLibraryDirectories!':
3219 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3220 'AdditionalLibraryDirectories':
3221 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3222 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3223 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3225 'VCLibrarianTool': {
3226 'AdditionalLibraryDirectories!':
3227 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3228 'AdditionalLibraryDirectories':
3229 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3230 'TargetMachine': '17', # x64
3237 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3238 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3241 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3243 '<@(debug_extra_cflags)',
3247 'VCCLCompilerTool': {
3248 'Optimization': '<(win_debug_Optimization)',
3249 'PreprocessorDefinitions': ['_DEBUG'],
3250 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3251 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3253 # According to MSVS, InlineFunctionExpansion=0 means
3254 # "default inlining", not "/Ob0".
3255 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3256 ['win_debug_InlineFunctionExpansion==0', {
3257 'AdditionalOptions': ['/Ob0'],
3259 ['win_debug_InlineFunctionExpansion!=""', {
3260 'InlineFunctionExpansion':
3261 '<(win_debug_InlineFunctionExpansion)',
3263 ['win_debug_disable_iterator_debugging==1', {
3264 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3267 # if win_debug_OmitFramePointers is blank, leave as default
3268 ['win_debug_OmitFramePointers==1', {
3269 'OmitFramePointers': 'true',
3271 ['win_debug_OmitFramePointers==0', {
3272 'OmitFramePointers': 'false',
3273 # The above is not sufficient (http://crbug.com/106711): it
3274 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3275 # perform FPO regardless, so we must explicitly disable.
3276 # We still want the false setting above to avoid having
3277 # "/Oy /Oy-" and warnings about overriding.
3278 'AdditionalOptions': ['/Oy-'],
3281 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3284 'LinkIncremental': '<(msvs_debug_link_incremental)',
3285 # ASLR makes debugging with windbg difficult because Chrome.exe and
3286 # Chrome.dll share the same base name. As result, windbg will
3287 # name the Chrome.dll module like chrome_<base address>, where
3288 # <base address> typically changes with each launch. This in turn
3289 # means that breakpoints in Chrome.dll don't stick from one launch
3290 # to the next. For this reason, we turn ASLR off in debug builds.
3291 # Note that this is a three-way bool, where 0 means to pick up
3292 # the default setting, 1 is off and 2 is on.
3293 'RandomizedBaseAddress': 1,
3295 'VCResourceCompilerTool': {
3296 'PreprocessorDefinitions': ['_DEBUG'],
3300 ['OS=="linux" or OS=="android"', {
3301 'target_conditions': [
3302 ['_toolset=="target"', {
3304 '<@(debug_extra_cflags)',
3309 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3310 # Enable libstdc++ debugging facilities to help catch problems
3311 # early, see http://crbug.com/65151 .
3312 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3313 'defines': ['_GLIBCXX_DEBUG=1',],
3315 ['release_valgrind_build==0', {
3318 '-fstack-protector-all', # Implies -fstack-protector
3324 # Allow comparing the address of references and 'this' against 0
3325 # in debug builds. Technically, these can never be null in
3326 # well-defined C/C++ and Clang can optimize such checks away in
3327 # release builds, but they may be used in asserts in debug builds.
3328 '-Wno-undefined-bool-conversion',
3329 '-Wno-tautological-undefined-compare',
3333 '-Wno-undefined-bool-conversion',
3334 '-Wno-tautological-undefined-compare',
3338 'VCCLCompilerTool': {
3339 'AdditionalOptions': [
3340 '-Wno-undefined-bool-conversion',
3341 '-Wno-tautological-undefined-compare',
3354 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3355 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3356 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3359 'VCCLCompilerTool': {
3360 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3362 # In official builds, each target will self-select
3363 # an optimization level.
3364 ['buildtype!="Official"', {
3365 'Optimization': '<(win_release_Optimization)',
3368 # According to MSVS, InlineFunctionExpansion=0 means
3369 # "default inlining", not "/Ob0".
3370 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3371 ['win_release_InlineFunctionExpansion==0', {
3372 'AdditionalOptions': ['/Ob0'],
3374 ['win_release_InlineFunctionExpansion!=""', {
3375 'InlineFunctionExpansion':
3376 '<(win_release_InlineFunctionExpansion)',
3379 # if win_release_OmitFramePointers is blank, leave as default
3380 ['win_release_OmitFramePointers==1', {
3381 'OmitFramePointers': 'true',
3383 ['win_release_OmitFramePointers==0', {
3384 'OmitFramePointers': 'false',
3385 # The above is not sufficient (http://crbug.com/106711): it
3386 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3387 # perform FPO regardless, so we must explicitly disable.
3388 # We still want the false setting above to avoid having
3389 # "/Oy /Oy-" and warnings about overriding.
3390 'AdditionalOptions': ['/Oy-'],
3393 # Put data in separate COMDATs. This allows the linker
3394 # to put bit-identical constants at the same address even if
3395 # they're unrelated constants, which saves binary size.
3396 # This optimization can't be used when ASan is enabled because
3397 # it is not compatible with the ASan ODR checker.
3398 'AdditionalOptions': ['/Gw'],
3401 'AdditionalOptions': [
3402 '/d2Zi+', # Improve debugging of Release builds.
3403 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3404 '<@(win_release_extra_cflags)',
3408 # LinkIncremental is a tri-state boolean, where 0 means default
3409 # (i.e., inherit from parent solution), 1 means false, and
3411 'LinkIncremental': '1',
3412 # This corresponds to the /PROFILE flag which ensures the PDB
3413 # file contains FIXUP information (growing the PDB file by about
3414 # 5%) but does not otherwise alter the output binary. This
3415 # information is used by the Syzygy optimization tool when
3416 # decomposing the release image.
3421 ['msvs_use_common_release', {
3422 'includes': ['release.gypi'],
3424 ['release_valgrind_build==0 and tsan==0', {
3427 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3431 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3432 'MEMORY_SANITIZER_INITIAL_SIZE',
3433 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3434 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3438 'defines': ['NO_TCMALLOC'],
3440 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3441 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3442 # It seems to work fine with Ubuntu 12 headers though, so use it
3443 # in official builds.
3444 ['os_posix==1 and (asan!=1 and msan!=1 and tsan!=1 and lsan!=1 and ubsan!=1) and (OS!="linux" or clang!=1 or buildtype=="Official")', {
3445 'target_conditions': [
3446 ['chromium_code==1', {
3447 # Non-chromium code is not guaranteed to compile cleanly
3448 # with _FORTIFY_SOURCE. Also, fortified build may fail
3449 # when optimizations are disabled, so only do that for Release
3452 '_FORTIFY_SOURCE=2',
3457 ['OS=="linux" or OS=="android"', {
3458 'target_conditions': [
3459 ['_toolset=="target"', {
3461 '<@(release_extra_cflags)',
3464 ['enable_resource_whitelist_generation==1', {
3466 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3475 'NS_BLOCK_ASSERTIONS=1',
3481 # Concrete configurations
3484 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3487 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3492 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3493 'target_conditions': [
3494 [ '_type=="executable"', {
3495 # To get a real .dSYM bundle produced by dsymutil, set the
3496 # debug information format to dwarf-with-dsym. Since
3497 # strip_from_xcode will not be used, set Xcode to do the
3498 # stripping as well.
3500 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3501 'DEPLOYMENT_POSTPROCESSING': 'YES',
3502 'STRIP_INSTALLED_PRODUCT': 'YES',
3509 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3511 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3514 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3522 'target_defaults': {
3527 # TODO(glider): enable the default options on other systems.
3529 ['use_sanitizer_options==1 and (OS=="linux" or OS=="mac")', {
3531 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3537 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3538 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3539 'target_defaults': {
3541 '-Wl,--fatal-warnings',
3545 # TODO(thakis): Enable this everywhere. http://crbug.com/371125
3546 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
3547 'target_defaults': {
3553 ['os_posix==1 and chromeos==0', {
3554 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3555 # and we want to avoid overriding this, so stack-protector is only
3556 # enabled when not building on Chrome OS.
3557 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3559 'target_defaults': {
3561 '-fstack-protector',
3562 '--param=ssp-buffer-size=4',
3566 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3567 'target_defaults': {
3568 # Enable -Werror by default, but put it in a variable so it can
3569 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3571 'werror%': '-Werror',
3572 'libraries_for_target%': '',
3575 '_FILE_OFFSET_BITS=64',
3578 '<(werror)', # See note above about the werror variable.
3580 '-fno-strict-aliasing', # See http://crbug.com/32204
3582 # TODO(evan): turn this back on once all the builds work.
3584 # Don't warn about unused function params. We use those everywhere.
3585 '-Wno-unused-parameter',
3586 # Don't warn about the "struct foo f = {0};" initialization pattern.
3587 '-Wno-missing-field-initializers',
3588 # Don't export any symbols (for example, to plugins we dlopen()).
3589 # Note: this is *required* to make some plugins work.
3590 '-fvisibility=hidden',
3596 '-fno-threadsafe-statics',
3597 # Make inline functions have hidden visiblity by default.
3598 # Surprisingly, not covered by -fvisibility=hidden.
3599 '-fvisibility-inlines-hidden',
3600 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3601 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3605 '-pthread', '-Wl,-z,noexecstack',
3608 '<(libraries_for_target)',
3613 'debug_optimize%': '0',
3619 '-O>(debug_optimize)',
3626 # Warn in case of text relocations.
3627 '-Wl,--warn-shared-textrel',
3630 ['OS=="android" and android_full_debug==0', {
3631 # Some configurations are copied from Release_Base to reduce
3634 'debug_optimize%': 's',
3638 '-ffunction-sections',
3645 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3646 # We don't omit frame pointers on arm64 since they are required
3647 # to correctly unwind stackframes which contain system library
3648 # function frames (crbug.com/391706).
3650 '-fomit-frame-pointer',
3653 ['OS=="linux" and target_arch=="ia32"', {
3655 '-Wl,--no-as-needed',
3658 ['debug_unwind_tables==1', {
3659 'cflags': ['-funwind-tables'],
3661 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3662 'defines': ['NO_UNWIND_TABLES'],
3664 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3665 # definitions in to the right scope to use them when setting
3666 # linux_use_debug_fission, so it can be used here alone.
3667 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3668 'cflags': ['-gsplit-dwarf'],
3674 'release_optimize%': '2',
3675 # Binaries become big and gold is unable to perform GC
3676 # and remove unused sections for some of test targets
3677 # on 32 bit platform.
3678 # (This is currently observed only in chromeos valgrind bots)
3679 # The following flag is to disable --gc-sections linker
3680 # option for these bots.
3681 'no_gc_sections%': 0,
3683 # TODO(bradnelson): reexamine how this is done if we change the
3684 # expansion of configurations
3685 'release_valgrind_build%': 0,
3688 '-O<(release_optimize)',
3689 # Don't emit the GCC version ident directives, they just end up
3690 # in the .comment section taking up binary size.
3692 # Put data and code in their own sections, so that unused symbols
3693 # can be removed at link time with --gc-sections.
3695 '-ffunction-sections',
3698 # Specifically tell the linker to perform optimizations.
3699 # See http://lwn.net/Articles/192624/ .
3704 ['no_gc_sections==0', {
3706 '-Wl,--gc-sections',
3709 ['OS=="android" and target_arch!="arm64"', {
3710 # We don't omit frame pointers on arm64 since they are required
3711 # to correctly unwind stackframes which contain system library
3712 # function frames (crbug.com/391706).
3714 '-fomit-frame-pointer',
3719 'release_optimize%': 's',
3722 # Warn in case of text relocations.
3723 '-Wl,--warn-shared-textrel',
3728 '-fno-omit-frame-pointer',
3732 ['profiling_full_stack_frames==1', {
3735 '-fno-optimize-sibling-calls',
3740 ['release_unwind_tables==1', {
3741 'cflags': ['-funwind-tables'],
3743 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3744 'defines': ['NO_UNWIND_TABLES'],
3750 ['target_arch=="ia32"', {
3751 'target_conditions': [
3752 ['_toolset=="target"', {
3754 # Needed so that libs with .s files (e.g. libicudata.a)
3755 # are compatible with the general 32-bit-ness.
3758 # All floating-point computations on x87 happens in 80-bit
3759 # precision. Because the C and C++ language standards allow
3760 # the compiler to keep the floating-point values in higher
3761 # precision than what's specified in the source and doing so
3762 # is more efficient than constantly rounding up to 64-bit or
3763 # 32-bit precision as specified in the source, the compiler,
3764 # especially in the optimized mode, tries very hard to keep
3765 # values in x87 floating-point stack (in 80-bit precision)
3766 # as long as possible. This has important side effects, that
3767 # the real value used in computation may change depending on
3768 # how the compiler did the optimization - that is, the value
3769 # kept in 80-bit is different than the value rounded down to
3770 # 64-bit or 32-bit. There are possible compiler options to
3771 # make this behavior consistent (e.g. -ffloat-store would keep
3772 # all floating-values in the memory, thus force them to be
3773 # rounded to its original precision) but they have significant
3774 # runtime performance penalty.
3776 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3777 # which keep floating-point values in SSE registers in its
3778 # native precision (32-bit for single precision, and 64-bit
3779 # for double precision values). This means the floating-point
3780 # value used during computation does not change depending on
3781 # how the compiler optimized the code, since the value is
3782 # always kept in its specified precision.
3784 # Refer to http://crbug.com/348761 for rationale behind SSE2
3785 # being a minimum requirement for 32-bit Linux builds and
3786 # http://crbug.com/313032 for an example where this has "bit"
3791 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3798 # Use gold linker for Android ia32 target.
3804 # Install packages have started cropping up with
3805 # different headers between the 32-bit and 64-bit
3806 # versions, so we have to shadow those differences off
3807 # and make sure a 32-bit-on-64-bit build picks up the
3809 # For android build, use NDK headers instead of host headers
3810 ['host_arch!="ia32" and OS!="android"', {
3819 ['target_arch=="x64"', {
3820 'target_conditions': [
3821 ['_toolset=="target"', {
3823 # Use gold linker for Android x64 target.
3840 ['target_arch=="arm"', {
3841 'target_conditions': [
3842 ['_toolset=="target"', {
3846 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3847 # has changed whenever it encounters a varargs function. This
3848 # silences those warnings, as they are not helpful and
3849 # clutter legitimate warnings.
3853 ['clang==1 and arm_arch!="" and OS!="android"', {
3855 '-target arm-linux-gnueabihf',
3858 '-target arm-linux-gnueabihf',
3863 '-march=<(arm_arch)',
3866 ['use_lto==1 or use_lto_o2==1', {
3868 '-march=<(arm_arch)',
3873 ['clang==1 and OS!="android"', {
3875 # We need to disable clang's builtin assembler as it can't
3876 # handle several asm files, crbug.com/124610
3877 '-no-integrated-as',
3882 '-mtune=<(arm_tune)',
3885 ['use_lto==1 or use_lto_o2==1', {
3887 '-mtune=<(arm_tune)',
3897 ['use_lto==1 or use_lto_o2==1', {
3904 ['arm_float_abi!=""', {
3906 '-mfloat-abi=<(arm_float_abi)',
3909 ['use_lto==1 or use_lto_o2==1', {
3911 '-mfloat-abi=<(arm_float_abi)',
3921 ['use_lto==1 or use_lto_o2==1', {
3929 # Most of the following flags are derived from what Android
3930 # uses by default when building for arm, reference for which
3931 # can be found in the following file in the Android NDK:
3932 # toolchains/arm-linux-androideabi-4.9/setup.mk
3934 # The tree-sra optimization (scalar replacement for
3935 # aggregates enabling subsequent optimizations) leads to
3936 # invalid code generation when using the Android NDK's
3937 # compiler (r5-r7). This can be verified using
3938 # webkit_unit_tests' WTF.Checked_int8_t test.
3940 # The following option is disabled to improve binary
3941 # size and performance in gcc 4.9.
3942 '-fno-caller-saves',
3945 # Android now supports .relro sections properly.
3946 # NOTE: While these flags enable the generation of .relro
3947 # sections, the generated libraries can still be loaded on
3948 # older Android platform versions.
3955 ['gcc_version==48 and clang==0', {
3957 # The following 5 options are disabled to save on
3958 # binary size in GCC 4.8.
3959 '-fno-partial-inlining',
3960 '-fno-early-inlining',
3961 '-fno-tree-copy-prop',
3962 '-fno-tree-loop-optimize',
3963 '-fno-move-loop-invariants',
3967 'cflags': [ '-mthumb-interwork' ],
3971 # Thumb code with frame pointer makes chrome crash
3974 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
3975 # The perf report sometimes incorrectly attributes
3976 # code from tail calls.
3977 '-fno-optimize-sibling-calls',
3980 '-fomit-frame-pointer',
3985 # Clang does not support the following options.
3986 '-mthumb-interwork',
3987 '-finline-limit=64',
3989 '-fno-caller-saves',
3993 # TODO(hans) Enable integrated-as (crbug.com/124610).
3994 '-no-integrated-as',
3995 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
3998 # Let clang find the ld.gold in the NDK.
3999 '--gcc-toolchain=<(android_toolchain)/..',
4004 '-marm', # Required for frame pointer based stack traces.
4011 # We set arm_arch to "" so that -march compiler option
4012 # is not set. Otherwise a gcc bug that would complain
4013 # about it conflicting with '-mcpu=cortex-a9'. The flag
4014 # '-march=armv7-a' is actually redundant anyway because
4015 # it is enabled by default when we built the toolchain.
4016 # And using '-mcpu=cortex-a9' should be sufficient.
4019 # Breakpad requires symbols with debugging information
4023 # We want to statically link libstdc++/libgcc_s.
4024 '-static-libstdc++',
4028 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4029 # define their own cflags for arm builds that could
4030 # conflict with the flags we set here (e.g.
4031 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4040 ['target_arch=="arm64"', {
4041 'target_conditions': [
4042 ['_toolset=="target"', {
4046 '-fstack-protector', # stack protector is always enabled on arm64.
4053 ['target_arch=="mipsel"', {
4054 'target_conditions': [
4055 ['_toolset=="target"', {
4057 ['android_webview_build==0 and mips_arch_variant=="r6"', {
4058 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
4061 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4065 ['android_webview_build==0 and mips_arch_variant=="r2"', {
4066 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
4068 ['android_webview_build==0 and mips_arch_variant=="r1"', {
4069 'cflags': ['-mips32', '-Wa,-mips32'],
4073 '-Wl,--no-keep-memory'
4076 '-Wno-uninitialized',
4081 ['target_arch=="mips64el"', {
4082 'target_conditions': [
4083 ['_toolset=="target"', {
4085 ['android_webview_build==0 and mips_arch_variant=="r6"', {
4086 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4087 'ldflags': [ '-mips64r6' ],
4089 ['android_webview_build==0 and mips_arch_variant=="r2"', {
4090 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4091 'ldflags': [ '-mips64r2' ],
4095 '-Wno-uninitialized',
4109 'target_conditions': [
4110 ['_toolset=="target"', {
4112 '--sysroot=<(sysroot)',
4115 '--sysroot=<(sysroot)',
4116 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4122 # TODO(thakis): Remove, http://crbug.com/263960
4123 '-Wno-reserved-user-defined-literal',
4126 # gnu++11 instead of c++11 is needed because some code uses
4127 # typeof() (a GNU extension).
4128 # TODO(thakis): Eventually switch this to c++11 instead,
4129 # http://crbug.com/427584
4133 ['clang==0 and host_clang==1', {
4134 'target_conditions': [
4135 ['_toolset=="host"', {
4136 'cflags_cc': [ '-std=gnu++11', ],
4140 ['clang==1 and clang_use_chrome_plugins==1', {
4142 '<@(clang_chrome_plugins_flags)',
4145 ['clang==1 and clang_load!=""', {
4147 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4150 ['clang==1 and clang_add_plugin!=""', {
4152 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4155 ['clang==1 and target_arch=="ia32"', {
4157 # Else building libyuv gives clang's register allocator issues,
4158 # see llvm.org/PR15798 / crbug.com/233709
4159 '-momit-leaf-frame-pointer',
4160 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4161 '-mstack-alignment=16',
4165 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4167 # See http://crbug.com/110262
4168 '-fcolor-diagnostics',
4171 # Common options for AddressSanitizer, LeakSanitizer,
4172 # ThreadSanitizer and MemorySanitizer.
4173 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4174 'target_conditions': [
4175 ['_toolset=="target"', {
4177 '-fno-omit-frame-pointer',
4178 '-gline-tables-only',
4181 '-fomit-frame-pointer',
4186 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4187 'target_conditions': [
4188 ['_toolset=="target"', {
4190 # Functions interposed by the sanitizers can make ld think
4191 # that some libraries aren't needed when they actually are,
4192 # http://crbug.com/234010. As workaround, disable --as-needed.
4196 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4197 'MEMORY_SANITIZER_INITIAL_SIZE',
4203 'target_conditions': [
4204 ['_toolset=="target"', {
4206 '-fsanitize=address',
4207 # TODO(earthdok): Re-enable. http://crbug.com/427202
4208 #'-fsanitize-blacklist=<(asan_blacklist)',
4211 '-fsanitize=address',
4218 '-mllvm -asan-globals=0', # http://crbug.com/352073
4224 'target_conditions': [
4225 ['_toolset=="target"', {
4227 '-fsanitize=undefined',
4228 '-fsanitize-blacklist=<(ubsan_blacklist)',
4229 # Employ the experimental PBQP register allocator to avoid
4230 # slow compilation on files with too many basic blocks.
4231 # See http://crbug.com/426271.
4232 '-mllvm -regalloc=pbqp',
4233 # Speculatively use coalescing to slightly improve the code
4234 # generated by PBQP regallocator. May increase compile time.
4235 '-mllvm -pbqp-coalescing',
4244 '-fsanitize=undefined',
4247 'UNDEFINED_SANITIZER',
4253 'target_conditions': [
4254 ['_toolset=="target"', {
4257 '-fsanitize-blacklist=<(ubsan_blacklist)',
4269 'UNDEFINED_SANITIZER',
4274 ['asan_coverage!=0', {
4275 'target_conditions': [
4276 ['_toolset=="target"', {
4278 '-fsanitize-coverage=<(asan_coverage)',
4283 ['asan_field_padding!=0', {
4284 'target_conditions': [
4285 ['_toolset=="target"', {
4287 '-fsanitize-address-field-padding=<(asan_field_padding)',
4293 'target_conditions': [
4294 ['_toolset=="target"', {
4303 'WTF_USE_LEAK_SANITIZER=1',
4309 'target_conditions': [
4310 ['_toolset=="target"', {
4312 '-fsanitize=thread',
4313 '-fsanitize-blacklist=<(tsan_blacklist)',
4316 '-fsanitize=thread',
4320 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4321 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4327 'target_conditions': [
4328 ['_toolset=="target"', {
4330 '-fsanitize=memory',
4331 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4332 '-fsanitize-blacklist=<(msan_blacklist)',
4335 '-fsanitize=memory',
4343 ['use_instrumented_libraries==1', {
4345 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4348 ['use_custom_libcxx==1', {
4350 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4353 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4354 'target_conditions' : [
4355 # crazy_linker has an upstream gyp file we can't edit, and we
4356 # don't want to instrument it.
4357 ['_toolset=="target" and _target_name!="crazy_linker"', {
4359 '-finstrument-functions',
4360 # Allow mmx intrinsics to inline, so that the
4361 #0 compiler can expand the intrinsics.
4362 '-finstrument-functions-exclude-file-list=mmintrin.h',
4365 ['_toolset=="target" and OS=="android"', {
4367 # Avoids errors with current NDK:
4368 # "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"
4369 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4374 ['linux_dump_symbols==1', {
4377 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4378 'target_conditions': [
4379 ['_toolset=="target"', {
4381 # Attempt to use less memory to prevent the linker from
4382 # running out of address space. Considering installing a
4383 # 64-bit kernel and switching to a 64-bit linker.
4384 '-Wl,--no-keep-memory',
4391 ['use_allocator!="tcmalloc"', {
4392 'defines': ['NO_TCMALLOC'],
4394 ['linux_use_gold_flags==1', {
4395 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4397 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4398 'ldflags': [ '-fuse-ld=gold', ],
4400 'target_conditions': [
4401 ['_toolset=="target"', {
4403 # Experimentation found that using four linking threads
4404 # saved ~20% of link time.
4405 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4406 # Only apply this to the target linker, since the host
4407 # linker might not be gold, but isn't used much anyway.
4408 # TODO(raymes): Disable threading because gold is frequently
4409 # crashing on the bots: crbug.com/161942.
4411 # '-Wl,--thread-count=4',
4416 ['release_valgrind_build==0 and order_profiling==0', {
4417 'target_conditions': [
4418 ['_toolset=="target"', {
4427 ['linux_use_bundled_binutils==1', {
4429 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4432 ['linux_use_bundled_gold==1', {
4433 # Put our binutils, which contains gold in the search path. We pass
4434 # the path to gold to the compiler. gyp leaves unspecified what the
4435 # cwd is when running the compiler, so the normal gyp path-munging
4436 # fails us. This hack gets the right path.
4438 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4441 # Some binutils 2.23 releases may or may not have new dtags enabled,
4442 # but they are all compatible with --disable-new-dtags,
4443 # because the new dynamic tags are not created by default.
4444 ['binutils_version>=223', {
4445 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4446 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4447 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4448 # inside this file to allow usage of --no-as-needed and removal of
4451 '-Wl,--disable-new-dtags',
4454 ['gcc_version>=47 and clang==0', {
4455 'target_conditions': [
4456 ['_toolset=="target"', {
4459 # See comment for -Wno-c++11-narrowing.
4461 # TODO(thakis): Remove, http://crbug.com/263960
4462 '-Wno-literal-suffix',
4467 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4468 'target_conditions': [
4469 ['_toolset=="host"', {
4472 # See comment for -Wno-c++11-narrowing.
4474 # TODO(thakis): Remove, http://crbug.com/263960
4475 '-Wno-literal-suffix',
4483 # FreeBSD-specific options; note that most FreeBSD options are set above,
4486 'target_defaults': {
4488 '-Wl,--no-keep-memory',
4492 # Android-specific options; note that most are set above with Linux.
4495 # This is a unique identifier for a given build. It's used for
4496 # identifying various build artifacts corresponding to a particular
4497 # build of chrome (e.g. where to find archived symbols).
4498 'chrome_build_id%': '',
4500 # Figure this out early since it needs symbols from libgcc.a, so it
4501 # has to be before that in the set of libraries.
4502 ['component=="shared_library"', {
4503 'android_stlport_library': 'stlport_shared',
4505 'android_stlport_library': 'stlport_static',
4509 # Placing this variable here prevents from forking libvpx, used
4510 # by remoting. Remoting is off, so it needn't built,
4511 # so forking it's deps seems like overkill.
4512 # But this variable need defined to properly run gyp.
4513 # A proper solution is to have an OS==android conditional
4514 # in third_party/libvpx/libvpx.gyp to define it.
4515 'libvpx_path': 'lib/linux/arm',
4517 'target_defaults': {
4519 'release_extra_cflags%': '',
4521 # If we're using the components build, append "cr" to all shared
4522 # libraries to avoid naming collisions with android system library
4523 # versions with the same name (e.g. skia, icu).
4524 ['component=="shared_library"', {
4525 'android_product_extension': 'cr.so',
4527 'android_product_extension': 'so',
4531 'target_conditions': [
4532 ['_type=="shared_library"', {
4533 'product_extension': '<(android_product_extension)',
4536 # Settings for building device targets using Android's toolchain.
4537 # These are based on the setup.mk file from the Android NDK.
4539 # The NDK Android executable link step looks as follows:
4541 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4542 # $(PRIVATE_OBJECTS) <-- The .o that we built
4543 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4544 # $(TARGET_LIBGCC) <-- libgcc.a
4545 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4546 # $(PRIVATE_LDLIBS) <-- System .so
4547 # $(TARGET_CRTEND_O) <-- crtend.o
4549 # For now the above are approximated for executables by adding
4550 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4553 # The NDK Android shared library link step looks as follows:
4555 # $(PRIVATE_OBJECTS) <-- The .o that we built
4556 # -l,--whole-archive
4557 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4558 # -l,--no-whole-archive
4559 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4560 # $(TARGET_LIBGCC) <-- libgcc.a
4561 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4562 # $(PRIVATE_LDLIBS) <-- System .so
4564 # For now, assume that whole static libraries are not needed.
4566 # For both executables and shared libraries, add the proper
4567 # libgcc.a to the start of libraries which puts it in the
4568 # proper spot after .o and .a files get linked in.
4570 # TODO: The proper thing to do longer-tem would be proper gyp
4571 # support for a custom link command line.
4572 ['_toolset=="target"', {
4574 '-pthread', # Not supported by Android toolchain.
4577 '-ffunction-sections',
4580 '-fstack-protector',
4582 '-finline-limit=64',
4583 '-Wa,--noexecstack',
4584 '<@(release_extra_cflags)',
4588 '__GNU_SOURCE=1', # Necessary for clone()
4590 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4591 'CHROME_BUILD_ID="<(chrome_build_id)"',
4594 '-pthread', # Not supported by Android toolchain.
4597 '-Wl,--no-undefined',
4600 ['component=="static_library"', {
4602 '-Wl,--exclude-libs=ALL',
4607 # Work around incompatibilities between bionic and clang
4609 '-D__compiler_offsetof=__builtin_offsetof',
4610 '-Dnan=__builtin_nan',
4613 ['target_arch=="arm"', {
4615 '-target arm-linux-androideabi',
4618 '-target arm-linux-androideabi',
4621 ['target_arch=="ia32"', {
4623 '-target x86-linux-androideabi',
4626 '-target x86-linux-androideabi',
4629 # Place holder for x64 support, not tested.
4630 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4631 ['target_arch=="x64"', {
4633 '-target x86_64-linux-androideabi',
4636 '-target x86_64-linux-androideabi',
4643 # Android build relies on -Wl,--gc-sections removing
4644 # unreachable code. ASan instrumentation for globals inhibits
4645 # this and results in a library with unresolvable relocations.
4646 # TODO(eugenis): find a way to reenable this.
4647 '-mllvm -asan-globals=0',
4650 ['android_webview_build==0', {
4652 # The NDK has these things, but doesn't define the constants
4653 # to say that it does. Define them here instead.
4657 '--sysroot=<(android_ndk_sysroot)',
4660 '--sysroot=<(android_ndk_sysroot)',
4664 '-l<(android_stlport_library)',
4665 # Manually link the libgcc.a that the cross compiler uses.
4666 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4672 ['android_webview_build==1', {
4674 # Android predefines this as 1; undefine it here so Chromium
4675 # can redefine it later to be 2 for chromium code and unset
4676 # for third party code. This works because cflags are added
4678 '-U_FORTIFY_SOURCE',
4679 # Disable any additional warnings enabled by the Android build system but which
4680 # chromium does not build cleanly with (when treating warning as errors).
4681 # Things that are part of -Wextra:
4682 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4683 '-Wno-ignored-qualifiers',
4685 '-Wno-unused-but-set-variable',
4688 # Other things unrelated to -Wextra:
4689 '-Wno-non-virtual-dtor',
4696 ['android_webview_build==1', {
4697 'target_conditions': [
4698 ['chromium_code==0', {
4700 # There is a class of warning which:
4701 # 1) Android always enables and also treats as errors
4702 # 2) Chromium ignores in third party code
4703 # So we re-enable those warnings when building Android.
4705 '-Wno-format-security',
4707 '-Wno-sequence-point',
4710 '-Wno-non-virtual-dtor',
4715 ['target_arch == "arm" and order_profiling==0', {
4717 # Enable identical code folding to reduce size.
4721 # NOTE: The stlport header include paths below are specified in
4722 # cflags rather than include_dirs because they need to come
4723 # after include_dirs. Think of them like system headers, but
4724 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4725 # toolchain (circa Gingerbread) will exhibit strange errors.
4726 # The include ordering here is important; change with caution.
4727 ['android_webview_build==0', {
4729 '-isystem<(android_stlport_include)',
4732 '-L<(android_stlport_libs_dir)',
4734 }, { # else: android_webview_build!=0
4735 'aosp_build_settings': {
4736 # Specify that we want to statically link stlport from the
4737 # NDK. This will provide all the include and library paths
4738 # automatically at build time, and link the right library.
4739 'LOCAL_NDK_STL_VARIANT': 'stlport_static',
4742 ['target_arch=="ia32"', {
4743 # The x86 toolchain currently has problems with stack-protector.
4745 '-fstack-protector',
4748 '-fno-stack-protector',
4752 'target_conditions': [
4753 ['_type=="executable"', {
4754 # Force android tools to export the "main" symbol so they can be
4755 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4756 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4757 # when ICS support will be dropped.
4760 '-fvisibility=default',
4764 '-Wl,--gc-sections',
4765 '-Wl,-z,nocopyreloc',
4768 # crtbegin_dynamic.o should be the last item in ldflags.
4769 '<(android_ndk_lib)/crtbegin_dynamic.o',
4772 # crtend_android.o needs to be the last item in libraries.
4773 # Do not add any libraries after this!
4774 '<(android_ndk_lib)/crtend_android.o',
4777 ['_type=="shared_library" or _type=="loadable_module"', {
4779 '-Wl,--exclude-libs=ALL',
4782 '-Wl,-shared,-Bsymbolic',
4785 ['android_webview_build==0', {
4787 # crtbegin_so.o should be the last item in ldflags.
4788 '<(android_ndk_lib)/crtbegin_so.o',
4791 # crtend_so.o needs to be the last item in libraries.
4792 # Do not add any libraries after this!
4793 '<(android_ndk_lib)/crtend_so.o',
4800 # Settings for building host targets using the system toolchain.
4801 ['_toolset=="host"', {
4803 # Due to issues in Clang build system, using ASan on 32-bit
4804 # binaries on x86_64 host is problematic.
4805 # TODO(eugenis): re-enable.
4806 '-fsanitize=address',
4809 '-fsanitize=address',
4810 '-Wl,-z,noexecstack',
4811 '-Wl,--gc-sections',
4814 '-Wl,--warn-shared-textrel',
4815 '-Wl,--fatal-warnings',
4818 # Settings for building host targets on mac.
4819 ['_toolset=="host" and host_os=="mac"', {
4829 'cflags!': ['-fvisibility=hidden'],
4830 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4832 ['OS=="mac" or OS=="ios"', {
4833 'target_defaults': {
4836 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4837 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4838 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4839 'COPY_PHASE_STRIP': 'NO',
4840 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4841 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4842 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4843 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
4844 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
4845 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
4846 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
4847 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
4848 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
4849 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
4850 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
4851 'GCC_VERSION': '4.2',
4852 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
4853 'USE_HEADERMAP': 'NO',
4858 # Don't warn about unused function parameters.
4859 '-Wno-unused-parameter',
4860 # Don't warn about the "struct foo f = {0};" initialization
4862 '-Wno-missing-field-initializers',
4865 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
4866 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
4868 # Note that the prebuilt Clang binaries should not be used for iOS
4869 # development except for ASan builds.
4871 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
4872 # Warn if automatic synthesis is triggered with
4873 # the -Wobjc-missing-property-synthesis flag.
4874 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4875 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4877 # This warns on selectors from Cocoa headers (-length, -set).
4878 # cfe-dev is currently discussing the merits of this warning.
4879 # TODO(thakis): Reevaluate what to do with this, based one
4880 # cfe-dev discussion.
4881 '-Wno-selector-type-mismatch',
4884 ['clang_xcode==0', {
4885 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4886 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4890 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4892 '<@(clang_chrome_plugins_flags)',
4895 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4897 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4900 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
4902 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4905 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4907 # See http://crbug.com/110262
4908 '-fcolor-diagnostics',
4911 ['OS=="ios" and target_subarch!="arm32" and \
4912 "<(GENERATOR)"=="xcode"', {
4914 # TODO(ios): when building Chrome for iOS on 64-bit platform
4915 # with Xcode, the -Wshorted-64-to-32 warning is automatically
4916 # enabled. This cause failures when compiling protobuf code,
4917 # so disable the warning. http://crbug.com/359107
4918 '-Wno-shorten-64-to-32',
4926 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4932 '-fsanitize=address',
4933 '-mllvm -asan-globals=0', # http://crbug.com/352073
4934 '-gline-tables-only',
4938 ['asan_coverage!=0', {
4939 'target_conditions': [
4940 ['_toolset=="target"', {
4942 '-fsanitize-coverage=<(asan_coverage)',
4948 'target_conditions': [
4949 ['_type!="static_library"', {
4950 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
4955 '-fsanitize=address',
4959 ['mac_write_linker_maps==1', {
4962 '-Wl,-map,>(_target_name).map',
4969 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
4970 'target_conditions': [
4971 ['_type=="executable"', {
4977 # Define copy_asan_dylib_path in a variable ending in
4978 # _path so that gyp understands it's a path and
4979 # performs proper relativization during dict merging.
4980 'copy_asan_dylib_path':
4981 'mac/copy_asan_runtime_dylib.sh',
4983 'postbuild_name': 'Copy ASan runtime dylib',
4985 '<(copy_asan_dylib_path)',
4994 ], # target_conditions
4995 }, # target_defaults
4996 }], # OS=="mac" or OS=="ios"
4998 'target_defaults': {
5000 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5001 # with common names, like 'check', 'require', and 'verify'.
5002 # (Included by system header. Also exists on iOS but not included.)
5003 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5004 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5007 # These should end with %, but there seems to be a bug with % in
5008 # variables that are intended to be set to different values in
5009 # different targets, like these.
5010 'mac_pie': 1, # Most executables can be position-independent.
5011 # Strip debugging symbols from the target.
5012 'mac_strip': '<(mac_strip_release)',
5016 ['mac_want_real_dsym=="default"', {
5019 'mac_real_dsym': '<(mac_want_real_dsym)'
5024 ['mac_want_real_dsym=="default"', {
5025 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5027 'mac_real_dsym': '<(mac_want_real_dsym)'
5034 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5035 # (Equivalent to -fPIC)
5036 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5037 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5038 # Keep pch files below xcodebuild/.
5039 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5041 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5042 # xcode_setting, but not until all downstream projects' mac bots are
5043 # using xcode >= 4.6, because that's when the default value of the
5044 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5045 # setting is a no-op as far as xcode is concerned, but the compiler
5046 # behaves differently based on whether -fno-strict-aliasing is
5048 '-fno-strict-aliasing', # See http://crbug.com/32204.
5051 'target_conditions': [
5052 ['_type=="executable"', {
5055 # Arranges for data (heap) pages to be protected against
5056 # code execution when running on Mac OS X 10.7 ("Lion"), and
5057 # ensures that the position-independent executable (PIE) bit
5058 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5060 # Define change_mach_o_flags in a variable ending in _path
5061 # so that GYP understands it's a path and performs proper
5062 # relativization during dict merging.
5063 'change_mach_o_flags_path':
5064 'mac/change_mach_o_flags_from_xcode.sh',
5065 'change_mach_o_flags_options%': [
5067 'target_conditions': [
5068 ['mac_pie==0 or release_valgrind_build==1', {
5069 # Don't enable PIE if it's unwanted. It's unwanted if
5070 # the target specifies mac_pie=0 or if building for
5071 # Valgrind, because Valgrind doesn't understand slide.
5072 # See the similar mac_pie/release_valgrind_build check
5074 'change_mach_o_flags_options': [
5080 'postbuild_name': 'Change Mach-O Flags',
5082 '<(change_mach_o_flags_path)',
5083 '>@(change_mach_o_flags_options)',
5087 'target_conditions': [
5088 ['mac_pie==1 and release_valgrind_build==0', {
5089 # Turn on position-independence (ASLR) for executables. When
5090 # PIE is on for the Chrome executables, the framework will
5091 # also be subject to ASLR.
5092 # Don't do this when building for Valgrind, because Valgrind
5093 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5094 # understand slide, and get rid of the Valgrind check.
5097 '-Wl,-pie', # Position-independent executable (MH_PIE)
5103 ['(_type=="executable" or _type=="shared_library" or \
5104 _type=="loadable_module") and mac_strip!=0', {
5105 'target_conditions': [
5106 ['mac_real_dsym == 1', {
5107 # To get a real .dSYM bundle produced by dsymutil, set the
5108 # debug information format to dwarf-with-dsym. Since
5109 # strip_from_xcode will not be used, set Xcode to do the
5110 # stripping as well.
5114 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5115 'DEPLOYMENT_POSTPROCESSING': 'YES',
5116 'STRIP_INSTALLED_PRODUCT': 'YES',
5118 # Only strip non-ASan builds.
5120 'target_conditions': [
5121 ['_type=="shared_library" or _type=="loadable_module"', {
5122 # The Xcode default is to strip debugging symbols
5123 # only (-S). Local symbols should be stripped as
5124 # well, which will be handled by -x. Xcode will
5125 # continue to insert -S when stripping even when
5126 # additional flags are added with STRIPFLAGS.
5128 }], # _type=="shared_library" or _type=="loadable_module"
5129 ], # target_conditions
5135 }, # configuration "Release"
5137 }, { # mac_real_dsym != 1
5138 # To get a fast fake .dSYM bundle, use a post-build step to
5139 # produce the .dSYM and strip the executable. strip_from_xcode
5140 # only operates in the Release configuration.
5144 # Define strip_from_xcode in a variable ending in _path
5145 # so that gyp understands it's a path and performs proper
5146 # relativization during dict merging.
5147 'strip_from_xcode_path': 'mac/strip_from_xcode',
5149 'postbuild_name': 'Strip If Needed',
5150 'action': ['<(strip_from_xcode_path)'],
5154 ], # target_conditions
5155 }], # (_type=="executable" or _type=="shared_library" or
5156 # _type=="loadable_module") and mac_strip!=0
5157 ], # target_conditions
5158 }, # target_defaults
5162 'ios/coverage.gypi',
5164 'target_defaults': {
5165 'xcode_settings' : {
5166 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5169 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5170 # additional flag to suppress the "unknown compiler option" error.
5171 # Restrict this flag to builds that are either compiling with Xcode
5172 # or compiling with Xcode's Clang. This will allow Ninja builds to
5173 # continue failing on unknown compiler options.
5174 # TODO(rohitrao): This flag is temporary and should be removed as
5175 # soon as the iOS bots are updated to use Xcode 5.1.
5176 ['clang_xcode==1', {
5178 '-Wno-unknown-warning-option',
5182 # Limit the valid architectures depending on "target_subarch".
5183 # This need to include the "arm" architectures but also the "x86"
5184 # ones (they are used when building for the simulator).
5185 ['target_subarch=="arm32"', {
5186 'VALID_ARCHS': ['armv7', 'i386'],
5188 ['target_subarch=="arm64"', {
5189 'VALID_ARCHS': ['arm64', 'x86_64'],
5191 ['target_subarch=="both"', {
5192 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5194 ['use_system_libcxx==1', {
5195 'target_conditions': [
5196 # Only use libc++ when building target for iOS not when building
5197 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5198 # does not support libc++.
5199 ['_toolset=="target"', {
5200 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5204 # The default for deployment target of 7.0+ is libc++, so force
5205 # the old behavior unless libc++ is enabled.
5206 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5210 'target_conditions': [
5211 ['_toolset=="host"', {
5213 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5214 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5223 ['_toolset=="target"', {
5225 # This section should be for overriding host settings. But,
5226 # since we can't negate the iphone deployment target above, we
5227 # instead set it here for target only.
5228 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5229 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5232 ['_type=="executable"', {
5236 'DEPLOYMENT_POSTPROCESSING': 'YES',
5237 'STRIP_INSTALLED_PRODUCT': 'YES',
5242 # Remove dSYM to reduce build time.
5243 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5249 ['chromium_ios_signing', {
5250 # iOS SDK wants everything for device signed.
5251 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5253 'CODE_SIGNING_REQUIRED': 'NO',
5254 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5259 ], # target_conditions
5260 }, # target_defaults
5263 'target_defaults': {
5265 '_WIN32_WINNT=0x0603',
5272 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5273 'WIN32_LEAN_AND_MEAN',
5276 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5277 '_HAS_EXCEPTIONS=0',
5278 # Silence some warnings; we can't switch the the 'recommended'
5279 # versions as they're not available on old OSs.
5280 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5283 ['buildtype=="Official"', {
5284 # In official builds, targets can self-select an optimization
5285 # level by defining a variable named 'optimize', and setting it
5287 # - "size", optimizes for minimal code size - the default.
5288 # - "speed", optimizes for speed over code size.
5289 # - "max", whole program optimization and link-time code
5290 # generation. This is very expensive and should be used
5293 'optimize%': 'size',
5297 # Set /LTCG for the official builds.
5298 'LinkTimeCodeGeneration': '1',
5299 'AdditionalOptions': [
5300 # Set the number of LTCG code-gen threads to eight.
5301 # The default is four. This gives a 5-10% link speedup.
5306 'target_conditions': [
5307 ['optimize=="size"', {
5309 'VCCLCompilerTool': {
5310 # 1, optimizeMinSpace, Minimize Size (/O1)
5311 'Optimization': '1',
5312 # 2, favorSize - Favor small code (/Os)
5313 'FavorSizeOrSpeed': '2',
5318 ['optimize=="speed"', {
5320 'VCCLCompilerTool': {
5321 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5322 'Optimization': '2',
5323 # 1, favorSpeed - Favor fast code (/Ot)
5324 'FavorSizeOrSpeed': '1',
5329 ['optimize=="max"', {
5330 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5331 # builds. Probably anything that this would catch that
5332 # wouldn't be caught in a normal build isn't going to
5333 # actually be a bug, so the incremental value of C4702 for
5334 # PGO builds is likely very small.
5335 'msvs_disabled_warnings': [
5339 'VCCLCompilerTool': {
5340 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5341 'Optimization': '2',
5342 # 1, favorSpeed - Favor fast code (/Ot)
5343 'FavorSizeOrSpeed': '1',
5344 # This implies link time code generation.
5345 'WholeProgramOptimization': 'true',
5353 ['msvs_xtree_patched!=1', {
5354 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5355 # it's enabled. This will generally only be true for system-level
5356 # installed Express users.
5357 'msvs_disabled_warnings': [
5362 'msvs_system_include_dirs': [
5363 '<(windows_sdk_path)/Include/shared',
5364 '<(windows_sdk_path)/Include/um',
5365 '<(windows_sdk_path)/Include/winrt',
5366 '$(VSInstallDir)/VC/atlmfc/include',
5368 'msvs_cygwin_shell': 0,
5369 'msvs_disabled_warnings': [
5370 # C4127: conditional expression is constant
5371 # This warning can in theory catch dead code and other problems, but
5372 # triggers in far too many desirable cases where the conditional
5373 # expression is either set by macros or corresponds some legitimate
5374 # compile-time constant expression (due to constant template args,
5375 # conditionals comparing the sizes of different types, etc.). Some of
5376 # these can be worked around, but it's not worth it.
5379 # C4351: new behavior: elements of array 'array' will be default
5381 # This is a silly "warning" that basically just alerts you that the
5382 # compiler is going to actually follow the language spec like it's
5383 # supposed to, instead of not following it like old buggy versions
5384 # did. There's absolutely no reason to turn this on.
5387 # C4355: 'this': used in base member initializer list
5388 # It's commonly useful to pass |this| to objects in a class'
5389 # initializer list. While this warning can catch real bugs, most of
5390 # the time the constructors in question don't attempt to call methods
5391 # on the passed-in pointer (until later), and annotating every legit
5392 # usage of this is simply more hassle than the warning is worth.
5395 # C4503: 'identifier': decorated name length exceeded, name was
5397 # This only means that some long error messages might have truncated
5398 # identifiers in the presence of lots of templates. It has no effect
5399 # on program correctness and there's no real reason to waste time
5400 # trying to prevent it.
5403 # C4611: interaction between 'function' and C++ object destruction is
5405 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5406 # suggests using exceptions instead of setjmp/longjmp for C++, but
5407 # Chromium code compiles without exception support. We therefore have
5408 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5409 # means we have to turn off this warning (and be careful about how
5410 # object destruction happens in such cases).
5413 # TODO(maruel): These warnings are level 4. They will be slowly
5414 # removed as code is fixed.
5415 4100, # Unreferenced formal parameter
5416 4121, # Alignment of a member was sensitive to packing
5417 4244, # Conversion from 'type1' to 'type2', possible loss of data
5418 4481, # Nonstandard extension used: override specifier 'keyword'
5419 4505, # Unreferenced local function has been removed
5420 4510, # Default constructor could not be generated
5421 4512, # Assignment operator could not be generated
5422 4610, # Object can never be instantiated
5423 4996, # 'X': was declared deprecated (for GetVersionEx).
5426 'VCCLCompilerTool': {
5427 'AdditionalOptions': ['/MP'],
5428 'MinimalRebuild': 'false',
5429 'BufferSecurityCheck': 'true',
5430 'EnableFunctionLevelLinking': 'true',
5431 'RuntimeTypeInfo': 'false',
5432 'WarningLevel': '4',
5433 'WarnAsError': 'true',
5434 'DebugInformationFormat': '3',
5435 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5436 'ExceptionHandling': '0',
5438 'VCLibrarianTool': {
5439 'AdditionalOptions': ['/ignore:4221'],
5440 'AdditionalLibraryDirectories': [
5441 '<(windows_sdk_path)/Lib/win8/um/x86',
5445 'AdditionalDependencies': [
5457 'AdditionalLibraryDirectories': [
5458 '<(windows_sdk_path)/Lib/win8/um/x86',
5460 'GenerateDebugInformation': 'true',
5461 'MapFileName': '$(OutDir)\\$(TargetName).map',
5462 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5463 'FixedBaseAddress': '1',
5466 # 1 == /SUBSYSTEM:CONSOLE
5467 # 2 == /SUBSYSTEM:WINDOWS
5468 # Most of the executables we'll ever create are tests
5469 # and utilities with console output.
5473 'GenerateStublessProxies': 'true',
5474 'TypeLibraryName': '$(InputName).tlb',
5475 'OutputDirectory': '$(IntDir)',
5476 'HeaderFileName': '$(InputName).h',
5477 'DLLDataFileName': '$(InputName).dlldata.c',
5478 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5479 'ProxyFileName': '$(InputName)_p.c',
5481 'VCResourceCompilerTool': {
5483 'AdditionalIncludeDirectories': [
5485 '<(SHARED_INTERMEDIATE_DIR)',
5488 'target_conditions': [
5489 ['_type=="executable"', {
5491 'EmbedManifest': 'true',
5494 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5496 'AdditionalManifestFiles': [
5497 '>(win_exe_compatibility_manifest)',
5504 # Building with Clang on Windows is a work in progress and very
5505 # experimental. See crbug.com/82385.
5506 'VCCLCompilerTool': {
5507 'WarnAsError': 'false',
5508 'RuntimeTypeInfo': 'false',
5509 'AdditionalOptions': [
5510 '-fmsc-version=1800',
5513 # Many files use intrinsics without including this header.
5514 # TODO(hans): Fix those files, or move this to sub-GYPs.
5517 # TODO(hans): Make this list shorter eventually.
5518 '-Qunused-arguments',
5519 '-Wno-c++11-compat-deprecated-writable-strings',
5520 '-Wno-deprecated-declarations',
5522 '-Wno-enum-conversion',
5523 '-Wno-extra-tokens',
5524 '-Wno-ignored-attributes',
5525 '-Wno-incompatible-pointer-types',
5526 '-Wno-int-to-void-pointer-cast',
5527 '-Wno-invalid-noreturn',
5528 '-Wno-logical-op-parentheses',
5530 '-Wno-missing-braces',
5531 '-Wno-missing-declarations',
5532 '-Wno-msvc-include',
5533 '-Wno-null-dereference',
5534 '-Wno-overloaded-virtual',
5536 '-Wno-pointer-sign',
5538 '-Wno-return-type-c-linkage',
5540 '-Wno-sometimes-uninitialized',
5542 '-Wno-tautological-compare',
5543 '-Wno-unknown-pragmas',
5545 '-Wno-unused-function',
5546 '-Wno-unused-private-field',
5547 '-Wno-unused-value',
5548 '-Wno-unused-variable',
5549 '-Wno-unused-local-typedef', # http://crbug.com/411648
5550 '-Wno-inconsistent-missing-override', #http://crbug.com/428099
5558 ['disable_nacl==1', {
5559 'target_defaults': {
5565 ['OS=="win" and msvs_use_common_linker_extras', {
5566 'target_defaults': {
5581 'AdditionalOptions': [
5592 'AdditionalOptions': ['/largeaddressaware'],
5596 # TODO(asan/win): Move this down into the general
5597 # win-target_defaults section once the 64-bit asan runtime
5598 # exists. See crbug.com/345874.
5599 'VCCLCompilerTool': {
5600 'AdditionalOptions': [
5601 '-fsanitize=address',
5602 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5604 'AdditionalIncludeDirectories': [
5605 # MSVC needs to be able to find the sanitizer headers when
5606 # invoked via /fallback. This is critical for using macros
5607 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5609 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/include_sanitizer',
5613 'AdditionalLibraryDirectories': [
5614 # TODO(hans): If make_clang_dir is absolute, this breaks.
5615 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/lib/windows',
5618 'target_conditions': [
5619 ['component=="shared_library"', {
5621 'AdditionalDependencies': [
5622 'clang_rt.asan_dynamic-i386.lib',
5623 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5627 ['_type=="executable" and component=="static_library"', {
5629 'AdditionalDependencies': [
5630 'clang_rt.asan-i386.lib',
5634 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5636 'AdditionalDependencies': [
5637 'clang_rt.asan_dll_thunk-i386.lib',
5649 'AdditionalOptions': [
5650 # safeseh is not compatible with x64
5662 ['enable_new_npdevice_api==1', {
5663 'target_defaults': {
5665 'ENABLE_NEW_NPDEVICE_API',
5669 # Don't warn about the "typedef 'foo' locally defined but not used"
5670 # for gcc 4.8 and higher.
5671 # TODO: remove this flag once all builds work. See crbug.com/227506
5672 ['gcc_version>=48 and clang==0', {
5673 'target_defaults': {
5675 '-Wno-unused-local-typedefs',
5679 ['gcc_version>=48 and clang==0 and host_clang==1', {
5680 'target_defaults': {
5681 'target_conditions': [
5682 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5686 # In the android webview build, force host targets to be compiled with clang
5687 # as the hermetic host gcc is very old on some platforms. This is already
5688 # the default on the current development version of AOSP but we force it
5689 # here in case we need to compile against an older release version. We also
5690 # explicitly set it to false for target binaries to avoid causing problems
5691 # for the work to enable clang by default in AOSP. We also force the use of
5692 # libstdc++ on host as peculiarities of the android gyp backend mean that
5693 # using libc++ doesn't work, and Chromium doesn't yet require a more modern
5695 ['android_webview_build==1', {
5696 'target_defaults': {
5697 'target_conditions': [
5698 ['_toolset=="host"', {
5699 'aosp_build_settings': {
5700 'LOCAL_CLANG': 'true',
5701 'LOCAL_CXX_STL': 'libstdc++',
5703 }, { # else: _toolset != "host"
5704 'aosp_build_settings': {
5705 'LOCAL_CLANG': 'false',
5711 # We need a special case to handle the android webview build on mac because
5712 # the host gcc there doesn't accept this flag, but the target gcc may
5714 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5715 'target_defaults': {
5716 'target_conditions': [
5717 ['_toolset=="host"', {
5719 '-Wno-unused-local-typedefs',
5725 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5727 'make_global_settings': [
5728 ['CC', '<(make_clang_dir)/bin/clang'],
5729 ['CXX', '<(make_clang_dir)/bin/clang++'],
5730 ['CC.host', '$(CC)'],
5731 ['CXX.host', '$(CXX)'],
5734 ['clang==1 and OS=="win"', {
5735 'make_global_settings': [
5736 # On Windows, gyp's ninja generator only looks at CC.
5737 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5740 ['use_lld==1 and OS=="win"', {
5741 'make_global_settings': [
5742 # Limited to Windows because lld-link is the driver that is compatible
5744 ['LD', '<(make_clang_dir)/bin/lld-link'],
5747 ['OS=="android" and clang==0', {
5748 # Hardcode the compiler names in the Makefile so that
5749 # it won't depend on the environment at make time.
5750 'make_global_settings': [
5751 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5752 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5753 ['CC.host', '<(host_cc)'],
5754 ['CXX.host', '<(host_cxx)'],
5757 ['OS=="linux" and target_arch=="mipsel"', {
5758 'make_global_settings': [
5759 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5760 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5761 ['CC.host', '<(host_cc)'],
5762 ['CXX.host', '<(host_cxx)'],
5765 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5766 # Set default ARM cross compiling on linux. These can be overridden
5767 # using CC/CXX/etc environment variables.
5768 'make_global_settings': [
5769 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5770 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5771 ['CC.host', '<(host_cc)'],
5772 ['CXX.host', '<(host_cxx)'],
5776 # TODO(yyanagisawa): supports GENERATOR==make
5777 # make generator doesn't support CC_wrapper without CC
5778 # in make_global_settings yet.
5779 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5780 'make_global_settings': [
5781 ['CC_wrapper', '<(gomadir)/gomacc'],
5782 ['CXX_wrapper', '<(gomadir)/gomacc'],
5783 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5784 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5788 'target_defaults': {
5789 'target_conditions': [
5790 ['_toolset=="target"', {
5798 ['use_lto==1 and clang==0', {
5799 'target_defaults': {
5800 'target_conditions': [
5801 ['_toolset=="target"', {
5803 '-ffat-lto-objects',
5809 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
5810 'target_defaults': {
5811 'target_conditions': [
5812 ['_toolset=="target"', {
5820 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
5821 'target_defaults': {
5822 'target_conditions': [
5823 ['_toolset=="target"', {
5833 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
5834 # This block adds *project-wide* configuration settings to each project
5835 # file. It's almost always wrong to put things here. Specify your
5836 # custom xcode_settings in target_defaults to add them to targets instead.
5839 # In an Xcode Project Info window, the "Base SDK for All Configurations"
5840 # setting sets the SDK on a project-wide basis. In order to get the
5841 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
5842 # here at the project level.
5845 ['mac_sdk_path==""', {
5846 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5848 'SDKROOT': '<(mac_sdk_path)', # -isysroot
5854 ['ios_sdk_path==""', {
5856 # TODO(justincohen): Ninja only supports simulator for now.
5857 ['"<(GENERATOR)"=="xcode"', {
5858 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
5860 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
5864 'SDKROOT': '<(ios_sdk_path)', # -isysroot
5869 # Target both iPhone and iPad.
5870 'TARGETED_DEVICE_FAMILY': '1,2',
5873 ['target_arch=="x64"', {
5878 ['target_arch=="ia32"', {
5887 # The Xcode generator will look for an xcode_settings section at the root
5888 # of each dict and use it to apply settings on a file-wide basis. Most
5889 # settings should not be here, they should be in target-specific
5890 # xcode_settings sections, or better yet, should use non-Xcode-specific
5891 # settings in target dicts. SYMROOT is a special case, because many other
5892 # Xcode variables depend on it, including variables such as
5893 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5894 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5895 # files to appear (when present) in the UI as actual files and not red
5896 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5897 # and therefore SYMROOT, needs to be set at the project level.
5898 'SYMROOT': '<(DEPTH)/xcodebuild',