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%': '',
187 # MIPS DSP ASE revision. Possible values are:
199 # Set default value of toolkit_views based on OS.
200 ['OS=="mac" or OS=="win" or chromeos==1 or use_aura==1', {
206 # Embedded builds use aura without ash or views.
213 # Enable HiDPI on Mac OS, Chrome OS, Windows and Linux.
214 ['OS=="mac" or chromeos==1 or OS=="win" or OS=="linux"', {
218 # Enable the OpenSSL backend on Mac OS and Windows.
219 ['OS=="mac" or OS=="win"', {
223 # Enable App Launcher everywhere but mobile.
224 ['OS!="ios" and OS!="android"', {
225 'enable_app_list%': 1,
227 'enable_app_list%': 0,
230 ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
231 'use_default_render_theme%': 1,
233 'use_default_render_theme%': 0,
237 'use_ozone_evdev%': 1,
239 'use_ozone_evdev%': 0,
242 # Set default gomadir.
244 'gomadir': 'c:\\goma\\goma-win',
246 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
249 # Set the default "target_subarch" on iOS. Valid values are "arm32",
250 # "arm64" and "both" (meaning a fat binary).
252 # TODO(sdefresne): change the default from "arm32" to "both" for
253 # "target_subarch" once http://crbug.com/339477 is fixed.
255 # TODO(sdefresne): set the "target_arch" to "arm" once compilation
256 # of skia has been fixed for simulator. http://crbug.com/342377
258 'target_subarch%': 'arm32',
261 # Set arch variants for MIPS platforms.
262 ['target_arch=="mips64el"', {
265 'mips_arch_variant%': 'r6',
267 'mips_arch_variant%': 'r2',
272 ['target_arch=="mipsel"', {
273 'mips_arch_variant%': 'r1',
278 # Copy conditionally-set variables out one scope.
279 'chromeos%': '<(chromeos)',
280 'chromecast%': '<(chromecast)',
281 'host_arch%': '<(host_arch)',
282 'target_arch%': '<(target_arch)',
283 'target_subarch%': '<(target_subarch)',
284 'mips_arch_variant%': '<(mips_arch_variant)',
285 'mips_dsp_rev%': '<(mips_dsp_rev)',
286 'toolkit_views%': '<(toolkit_views)',
287 'desktop_linux%': '<(desktop_linux)',
288 'use_aura%': '<(use_aura)',
289 'use_ash%': '<(use_ash)',
290 'use_cras%': '<(use_cras)',
291 'use_libpci%': '<(use_libpci)',
292 'use_ozone%': '<(use_ozone)',
293 'use_ozone_evdev%': '<(use_ozone_evdev)',
294 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
295 'embedded%': '<(embedded)',
296 'use_openssl%': '<(use_openssl)',
297 'use_openssl_certs%': '<(use_openssl_certs)',
298 'enable_viewport%': '<(enable_viewport)',
299 'enable_hidpi%': '<(enable_hidpi)',
300 'android_channel%': '<(android_channel)',
301 'android_webview_build%': '<(android_webview_build)',
302 'use_goma%': '<(use_goma)',
303 'gomadir%': '<(gomadir)',
304 'enable_app_list%': '<(enable_app_list)',
305 'use_default_render_theme%': '<(use_default_render_theme)',
306 'buildtype%': '<(buildtype)',
307 'branding%': '<(branding)',
308 'arm_version%': '<(arm_version)',
309 'sysroot%': '<(sysroot)',
310 'chroot_cmd%': '<(chroot_cmd)',
311 'system_libdir%': '<(system_libdir)',
313 # Set to 1 to enable fast builds. Set to 2 for even faster builds
314 # (it disables debug info for fastest compilation - only for use
315 # on compile-only bots).
318 # Set to 1 to not store any build metadata, e.g. ifdef out all __DATE__
319 # and __TIME__. Set to 0 to reenable the use of these macros in the code
320 # base. See http://crbug.com/314403.
321 'dont_embed_build_metadata%': 1,
323 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
324 # This is useful for parallel compilation tools which can't support /Zi.
325 # Only used on Windows.
328 # Set to 1 to enable dcheck in Release build.
329 'dcheck_always_on%': 0,
331 # Set to 1 to make a build that disables unshipped tracing events.
332 # Note: this setting is ignored if buildtype=="Official".
333 'tracing_like_official_build%': 0,
335 # Disable image loader component extension by default.
336 'image_loader_extension%': 0,
338 # Set NEON compilation flags.
341 # Detect NEON support at run-time.
342 'arm_neon_optional%': 0,
344 # Use libjpeg-turbo as the JPEG codec used by Chromium.
345 'use_libjpeg_turbo%': 1,
347 # Use system libjpeg. Note that the system's libjepg will be used even if
348 # use_libjpeg_turbo is set.
349 'use_system_libjpeg%': 0,
351 # By default, component is set to static_library and it can be overriden
352 # by the GYP command line or by ~/.gyp/include.gypi.
353 'component%': 'static_library',
355 # /analyze is off by default on Windows because it is very slow and noisy.
356 # Enable with GYP_DEFINES=win_analyze=1
359 # Set to select the Title Case versions of strings in GRD files.
360 'use_titlecase_in_grd%': 0,
362 # Use translations provided by volunteers at launchpad.net. This
363 # currently only works on Linux.
364 'use_third_party_translations%': 0,
366 # Remoting compilation is enabled by default. Set to 0 to disable.
369 # Configuration policy is enabled by default. Set to 0 to disable.
370 'configuration_policy%': 1,
372 # Variable safe_browsing is used to control the build time configuration
373 # for safe browsing feature. Safe browsing can be compiled in 3 different
374 # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and
375 # reporting features without enabling phishing and malware detection. This
376 # is useful to integrate a third party phishing/malware detection to
377 # existing safe browsing logic.
380 # Web speech is enabled by default. Set to 0 to disable.
381 'enable_web_speech%': 1,
383 # Notifications are compiled in by default. Set to 0 to disable.
384 'notifications%' : 1,
386 # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
387 # regular builds and 1 for ASan builds.
388 'mac_want_real_dsym%': 'default',
390 # If this is set, the clang plugins used on the buildbot will be used.
391 # Run tools/clang/scripts/update.sh to make sure they are compiled.
392 # This causes 'clang_chrome_plugins_flags' to be set.
393 # Has no effect if 'clang' is not set as well.
394 'clang_use_chrome_plugins%': 1,
396 # Enable building with ASAN (Clang's -fsanitize=address option).
397 # -fsanitize=address only works with clang, but asan=1 implies clang=1
398 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
400 'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
401 # Enable coverage gathering instrumentation in sanitizer tools. This flag
402 # also controls coverage granularity (1 for function-level coverage, 2
403 # for block-level coverage).
404 'sanitizer_coverage%': 0,
405 # Deprecated, only works if |sanitizer_coverage| isn't set.
406 # TODO(glider): remove this flag.
408 # Enable intra-object-overflow detection in ASan (experimental).
409 'asan_field_padding%': 0,
411 # Enable Chromium overrides of the default configurations for various
412 # dynamic tools (like ASan).
413 'use_sanitizer_options%': 0,
415 # Enable building with SyzyAsan.
416 # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo
419 # Enable crash reporting via Kasko.
422 # Enable building with LSan (Clang's -fsanitize=leak option).
423 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
424 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
427 # Enable building with TSan (Clang's -fsanitize=thread option).
428 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
429 # See http://clang.llvm.org/docs/ThreadSanitizer.html
431 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
433 # Enable building with MSan (Clang's -fsanitize=memory option).
434 # MemorySanitizer only works with clang, but msan=1 implies clang=1
435 # See http://clang.llvm.org/docs/MemorySanitizer.html
437 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
438 # Track where uninitialized memory originates from. From fastest to
439 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
440 # - track the chain of stores leading from allocation site to use site.
441 'msan_track_origins%': 2,
443 # Enable building with UBSan (Clang's -fsanitize=undefined option).
444 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
445 # See http://clang.llvm.org/docs/UsersManual.html
447 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
449 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
450 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
453 # Use dynamic libraries instrumented by one of the sanitizers
454 # instead of the standard system libraries. Set this flag to build the
455 # libraries from source.
456 'use_instrumented_libraries%': 0,
458 # Use dynamic libraries instrumented by one of the sanitizers
459 # instead of the standard system libraries. Set this flag to download
460 # prebuilt binaries from GCS.
461 'use_prebuilt_instrumented_libraries%': 0,
463 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
464 # stdlibc++ as standard library. This is intended to use for instrumented
466 'use_custom_libcxx%': 0,
468 # Use system libc++ instead of the default C++ library, usually libstdc++.
469 # This is intended for iOS builds only.
470 'use_system_libcxx%': 0,
472 # Use a modified version of Clang to intercept allocated types and sizes
473 # for allocated objects. clang_type_profiler=1 implies clang=1.
474 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
475 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
476 'clang_type_profiler%': 0,
478 # Set to true to instrument the code with function call logger.
479 # See src/third_party/cygprofile/cyg-profile.cc for details.
480 'order_profiling%': 0,
482 # Use the provided profiled order file to link Chrome image with it.
483 # This makes Chrome faster by better using CPU cache when executing code.
484 # This is known as PGO (profile guided optimization).
485 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
486 'order_text_section%' : "",
488 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
489 # libraries on linux x86-64 and arm, plus ASLR.
492 # Whether one-click signin is enabled or not.
493 'enable_one_click_signin%': 0,
495 # Whether to back up data before sync.
496 'enable_pre_sync_backup%': 0,
498 # Enable Chrome browser extensions
499 'enable_extensions%': 1,
502 'enable_google_now%': 1,
504 # Enable basic printing support and UI.
505 'enable_basic_printing%': 1,
507 # Enable printing with print preview. It does not imply
508 # enable_basic_printing. It's possible to build Chrome with preview only.
509 'enable_print_preview%': 1,
511 # Set the version of CLD.
512 # 0: Don't specify the version. This option is for the Finch testing.
517 # For CLD2, the size of the tables that should be included in the build
518 # Only evaluated if cld_version == 2 or if building the CLD2 dynamic data
520 # See third_party/cld_2/cld_2.gyp for more information.
521 # 0: Small tables, lower accuracy
522 # 2: Large tables, high accuracy
523 'cld2_table_size%': 2,
525 # Enable spell checker.
526 'enable_spellcheck%': 1,
528 # Webrtc compilation is enabled by default. Set to 0 to disable.
531 # Media router support is enabled by default. Set to 0 to disable.
532 'enable_media_router%': 1,
534 # Enables use of the session service, which is enabled by default.
535 # Support for disabling depends on the platform.
536 'enable_session_service%': 1,
538 # Enables theme support, which is enabled by default. Support for
539 # disabling depends on the platform.
542 # Enables autofill dialog and associated features; disabled by default.
543 'enable_autofill_dialog%' : 0,
545 # Defaults Wallet integration in Autofill dialog to use production
546 # servers. Unofficial builds won't have the proper API keys.
547 'enable_prod_wallet_service%': 0,
549 # Enables support for background apps.
550 'enable_background%': 1,
552 # Enable the task manager by default.
553 'enable_task_manager%': 1,
555 # Enables used resource whitelist generation; disabled by default.
556 'enable_resource_whitelist_generation%': 0,
558 # Enable FILE support by default.
559 'disable_file_support%': 0,
561 # Enable FTP support by default.
562 'disable_ftp_support%': 0,
564 # Use native android functions in place of ICU. Not supported by most
566 'use_icu_alternatives_on_android%': 0,
568 # Use of precompiled headers on Windows.
570 # This variable may be explicitly set to 1 (enabled) or 0
571 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
572 # This setting will override the default.
575 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
577 'chromium_win_pch%': 0,
580 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
581 # Set this to true when building with Clang.
582 # See http://code.google.com/p/chromium/wiki/Clang for details.
583 # If this is set, clang is used as both host and target compiler in
584 # cross-compile builds.
587 # Use experimental lld linker instead of the platform's default linker.
590 # Enable plugin installation by default.
591 'enable_plugin_installation%': 1,
593 # Specifies whether to use canvas_skia.cc in place of platform
594 # specific implementations of gfx::Canvas. Affects text drawing in the
596 # TODO(asvitkine): Enable this on all platforms and delete this flag.
597 # http://crbug.com/105550
598 'use_canvas_skia%': 0,
600 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
601 # with one of those tools.
602 'build_for_tool%': '',
604 # If no directory is specified then a temporary directory will be used.
605 'test_isolation_outdir%': '',
607 'wix_path%': '<(DEPTH)/third_party/wix',
609 # Supervised users are enabled by default.
610 'enable_supervised_users%': 1,
612 # Platform sends memory pressure signals natively.
613 'native_memory_pressure_signals%': 0,
615 'spdy_proxy_auth_property%' : '',
616 'spdy_proxy_auth_value%' : '',
618 'enable_service_discovery%': 0,
619 'enable_wifi_bootstrapping%': 0,
620 'enable_hangout_services_extension%': 0,
622 # Enable the Syzygy optimization step.
623 'syzygy_optimize%': 0,
625 # Enable hole punching for the protected video.
628 # Automatically select platforms under ozone. Turn this off to
629 # build only explicitly selected platforms.
630 'ozone_auto_platforms%': 1,
632 # If this is set clang is used as host compiler, but not as target
633 # compiler. Always do this by default.
636 # Variables to control Link-Time Optimizations (LTO).
637 # Note: the variables must *not* be enabled at the same time.
638 # In this case LTO would 'merge' the optimization flags
639 # at link-time which would lead to all code be optimized with -O2.
640 # Enable LTO on the code compiled with -Os.
641 # See crbug.com/407544
643 # Enable LTO on code compiled with -O2.
646 # Allowed level of identical code folding in the gold linker.
647 'gold_icf_level%': 'safe',
649 # Libxkbcommon usage.
652 # Control Flow Integrity for virtual calls.
653 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
656 # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
657 'mac_views_browser%': 0,
660 # A flag for POSIX platforms
667 # A flag for BSD platforms
668 ['OS=="freebsd" or OS=="openbsd"', {
675 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
681 # When OpenSSL is used for SSL and crypto on Unix-like systems, use
682 # OpenSSL's certificate definition.
683 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==1', {
684 'use_openssl_certs%': 1,
686 'use_openssl_certs%': 0,
689 # libudev usage. This currently only affects the content layer.
690 ['OS=="linux" and embedded==0', {
696 # Flags to use X11 on non-Mac POSIX platforms.
697 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
704 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
710 # Flags to use pango and cairo.
711 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
720 ['OS=="linux" and embedded==0', {
726 # We always use skia text rendering in Aura on Windows, since GDI
727 # doesn't agree with our BackingStore.
728 # TODO(beng): remove once skia text rendering is on by default.
729 ['use_aura==1 and OS=="win"', {
730 'enable_skia_text%': 1,
733 # A flag to enable or disable our compile-time dependency
734 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
735 # support will be available. This option is useful
736 # for Linux distributions and for Aura.
737 ['OS!="linux" or chromeos==1', {
738 'use_gnome_keyring%': 0,
740 'use_gnome_keyring%': 1,
743 ['OS=="mac" or OS=="ios"', {
744 # Mac and iOS want Title Case strings
745 'use_titlecase_in_grd%': 1,
748 # Enable loader extensions on Chrome OS.
750 'image_loader_extension%': 1,
752 'image_loader_extension%': 0,
755 ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
756 'enable_one_click_signin%': 1,
757 'enable_pre_sync_backup%': 1,
761 'enable_extensions%': 0,
762 'enable_google_now%': 0,
764 'enable_spellcheck%': 0,
768 'arm_neon_optional%': 1,
769 'native_memory_pressure_signals%': 1,
770 'enable_basic_printing%': 1,
771 'enable_print_preview%': 0,
772 'enable_task_manager%':0,
776 # Android OS includes support for proprietary codecs regardless of
777 # building Chromium or Google Chrome. We also ship Google Chrome and
778 # Chromecast with proprietary codecs.
779 ['OS=="android" or branding=="Chrome" or chromecast==1', {
780 'proprietary_codecs%': 1,
782 'proprietary_codecs%': 0,
785 ['OS=="mac" or OS=="ios"', {
786 'native_memory_pressure_signals%': 1,
789 # Enable autofill dialog for Android, Mac and Views-enabled platforms.
790 ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', {
791 'enable_autofill_dialog%': 1,
794 ['buildtype=="Official"', {
795 'enable_prod_wallet_service%': 1,
805 'disable_ftp_support%': 1,
806 'enable_extensions%': 0,
807 'enable_google_now%': 0,
809 'cld2_table_size%': 0,
810 'enable_basic_printing%': 0,
811 'enable_print_preview%': 0,
812 'enable_session_service%': 0,
813 'enable_spellcheck%': 0,
819 'enable_supervised_users%': 0,
820 'enable_task_manager%': 0,
821 'use_system_libcxx%': 1,
824 # Use GPU accelerated cross process image transport by default
825 # on linux builds with the Aura window manager
826 ['use_aura==1 and OS=="linux"', {
827 'ui_compositor_image_transport%': 1,
829 'ui_compositor_image_transport%': 0,
832 # Turn precompiled headers on by default.
833 ['OS=="win" and buildtype!="Official"', {
834 'chromium_win_pch%': 1
837 ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
838 'enable_plugin_installation%': 0,
840 'enable_plugin_installation%': 1,
843 # Whether PPAPI is enabled.
844 ['OS=="android" or OS=="ios" or embedded==1', {
845 'enable_plugins%': 0,
847 'enable_plugins%': 1,
850 # linux_use_bundled_gold: whether to use the gold linker binary checked
851 # into third_party/binutils. Force this off via GYP_DEFINES when you
852 # are using a custom toolchain and need to control -B in ldflags.
853 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
854 # for component=static_library builds.
855 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
856 'linux_use_bundled_gold%': 1,
858 'linux_use_bundled_gold%': 0,
861 # linux_use_bundled_binutils: whether to use the binary binutils
862 # checked into third_party/binutils. These are not multi-arch so cannot
863 # be used except on x86 and x86-64 (the only two architectures which
864 # are currently checke in). Force this off via GYP_DEFINES when you
865 # are using a custom toolchain and need to control -B in cflags.
866 ['OS=="linux" and (target_arch=="x64")', {
867 'linux_use_bundled_binutils%': 1,
869 'linux_use_bundled_binutils%': 0,
872 # linux_use_gold_flags: whether to use build flags that rely on gold.
873 # On by default for x64 Linux.
874 ['OS=="linux" and target_arch=="x64"', {
875 'linux_use_gold_flags%': 1,
877 'linux_use_gold_flags%': 0,
880 # linux_use_debug_fission: whether to use split DWARF debug info
881 # files. This can reduce link time significantly, but is incompatible
882 # with some utilities such as icecc and ccache. Requires gold and
883 # gcc >= 4.8 or clang.
884 # http://gcc.gnu.org/wiki/DebugFission
885 ['OS=="linux" and target_arch=="x64"', {
886 'linux_use_debug_fission%': 1,
888 'linux_use_debug_fission%': 0,
891 ['OS=="android" or OS=="ios"', {
892 'enable_captive_portal_detection%': 0,
893 'enable_media_router%': 0,
895 'enable_captive_portal_detection%': 1,
896 'enable_media_router%': 1,
899 # Enable Skia UI text drawing incrementally on different platforms.
900 # http://crbug.com/105550
902 # On Aura, this allows per-tile painting to be used in the browser
905 'use_canvas_skia%': 1,
909 'enable_basic_printing%': 0,
910 'enable_print_preview%': 1,
911 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
912 'use_libjpeg_turbo%': 0,
915 # Do not enable the Settings App on ChromeOS.
916 ['enable_app_list==1 and chromeos==0', {
917 'enable_settings_app%': 1,
919 'enable_settings_app%': 0,
922 ['OS=="linux" and target_arch=="arm" and chromeos==0', {
923 # Set some defaults for arm/linux chrome builds
924 'use_allocator%': 'none',
925 # sysroot needs to be an absolute path otherwise it generates
926 # incorrect results when passed to pkg-config
927 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot',
928 }], # OS=="linux" and target_arch=="arm" and chromeos==0
930 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', {
932 ['target_arch=="x64"', {
933 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
935 ['target_arch=="ia32"', {
936 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
939 }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
941 ['OS=="linux" and target_arch=="mipsel"', {
942 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
943 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
946 # Whether tests targets should be run, archived or just have the
947 # dependencies verified. All the tests targets have the '_run' suffix,
948 # e.g. base_unittests_run runs the target base_unittests. The test
949 # target always calls tools/swarming_client/isolate.py. See the script's
950 # --help for more information. Meant to be overriden with GYP_DEFINES.
951 # TODO(maruel): Remove the conditions as more configurations are
953 ['OS!="ios" and OS!="android" and chromeos==0', {
954 'test_isolation_mode%': 'check',
956 'test_isolation_mode%': 'noop',
958 # Whether Android build uses OpenMAX DL FFT.
959 ['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")', {
960 # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
961 # When enabled, this will also enable WebAudio support on
962 # Android for these architectures. Default is enabled. Whether
963 # WebAudio is actually available depends on runtime settings
965 'use_openmax_dl_fft%': 1,
967 'use_openmax_dl_fft%': 0,
969 ['OS=="win" or OS=="linux"', {
973 # Turns on compiler optimizations in V8 in Debug build, except
974 # on android_clang, where we're hitting a weird linker error.
975 # TODO(dpranke): http://crbug.com/266155 .
977 'v8_optimized_debug%': 1,
979 'v8_optimized_debug%': 2,
982 # Disable various features by default on embedded.
985 'enable_basic_printing%': 0,
986 'enable_print_preview%': 0,
989 # By default, use ICU data file (icudtl.dat) on all platforms
990 # except when building Android WebView.
991 # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium).
992 # Set the data reduction proxy origin for Android Webview.
993 ['android_webview_build==0', {
994 'icu_use_data_file_flag%' : 1,
996 'icu_use_data_file_flag%' : 0,
998 ['OS=="win" or OS=="mac"', {
999 'enable_wifi_bootstrapping%' : 1,
1002 # Path to sas.dll, which provides the SendSAS function.
1003 # http://msdn.microsoft.com/en-us/library/windows/desktop/dd979761(v=vs.85).aspx
1004 ['target_arch=="x64"', {
1005 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/amd64',
1007 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
1010 # Turn on JNI generation optimizations on non-WebView builds.
1011 ['OS=="android" and android_webview_build==0', {
1012 'optimize_jni_generation%': 1,
1014 'optimize_jni_generation%': 0,
1017 # TODO(rmcilroy): Enable v8_use_external_startup_data on ChromeOS
1018 # http://crbug.com/421063
1019 ['android_webview_build==0 and chromecast==0 and chromeos==0 and OS!="ios"', {
1020 'v8_use_external_startup_data%': 1,
1022 'v8_use_external_startup_data%': 0,
1025 # Controls whether Wallet cards can be saved to the local instance of
1026 # chrome. TODO(estade): set to 0 for Linux before M43 branch.
1027 ['desktop_linux==1', {
1028 'enable_save_wallet_cards_locally%': 1,
1030 'enable_save_wallet_cards_locally%': 1,
1035 # Set this to 1 to enable use of concatenated impulse responses
1036 # for the HRTF panner in WebAudio.
1037 'use_concatenated_impulse_responses': 1,
1039 # You can set the variable 'use_official_google_api_keys' to 1
1040 # to use the Google-internal file containing official API keys
1041 # for Google Chrome even in a developer build. Setting this
1042 # variable explicitly to 1 will cause your build to fail if the
1043 # internal file is missing.
1045 # The variable is documented here, but not handled in this file;
1046 # see //google_apis/determine_use_official_keys.gypi for the
1049 # Set the variable to 0 to not use the internal file, even when
1050 # it exists in your checkout.
1052 # Leave it unset in your include.gypi to have the variable
1053 # implicitly set to 1 if you have
1054 # src/google_apis/internal/google_chrome_api_keys.h in your
1055 # checkout, and implicitly set to 0 if not.
1057 # Note that official builds always behave as if the variable
1058 # was explicitly set to 1, i.e. they always use official keys,
1059 # and will fail to build if the internal file is missing.
1061 # NOTE: You MUST NOT explicitly set the variable to 2 in your
1062 # include.gypi or by other means. Due to subtleties of GYP, this
1063 # is not the same as leaving the variable unset, even though its
1065 # //google_apis/determine_use_official_keys.gypi is 2.
1067 # Set these to bake the specified API keys and OAuth client
1068 # IDs/secrets into your build.
1070 # If you create a build without values baked in, you can instead
1071 # set environment variables to provide the keys at runtime (see
1072 # src/google_apis/google_api_keys.h for details). Features that
1073 # require server-side APIs may fail to work if no keys are
1076 # Note that if you are building an official build or if
1077 # use_official_google_api_keys has been set to 1 (explicitly or
1078 # implicitly), these values will be ignored and the official
1079 # keys will be used instead.
1080 'google_api_key%': '',
1081 'google_default_client_id%': '',
1082 'google_default_client_secret%': '',
1083 # Native Client is enabled by default.
1084 'disable_nacl%': '0',
1087 # Copy conditionally-set variables out one scope.
1088 'branding%': '<(branding)',
1089 'buildtype%': '<(buildtype)',
1090 'target_arch%': '<(target_arch)',
1091 'target_subarch%': '<(target_subarch)',
1092 'mips_arch_variant%': '<(mips_arch_variant)',
1093 'mips_dsp_rev%': '<(mips_dsp_rev)',
1094 'host_arch%': '<(host_arch)',
1095 'toolkit_views%': '<(toolkit_views)',
1096 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
1097 'use_aura%': '<(use_aura)',
1098 'use_ash%': '<(use_ash)',
1099 'use_cras%': '<(use_cras)',
1100 'use_libpci%': '<(use_libpci)',
1101 'use_openssl%': '<(use_openssl)',
1102 'use_openssl_certs%': '<(use_openssl_certs)',
1103 'use_nss%': '<(use_nss)',
1104 'use_udev%': '<(use_udev)',
1105 'os_bsd%': '<(os_bsd)',
1106 'os_posix%': '<(os_posix)',
1107 'use_dbus%': '<(use_dbus)',
1108 'use_glib%': '<(use_glib)',
1109 'use_pango%': '<(use_pango)',
1110 'use_cairo%': '<(use_cairo)',
1111 'use_ozone%': '<(use_ozone)',
1112 'use_ozone_evdev%': '<(use_ozone_evdev)',
1113 'use_xkbcommon%': '<(use_xkbcommon)',
1114 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
1115 'desktop_linux%': '<(desktop_linux)',
1116 'use_x11%': '<(use_x11)',
1117 'use_gnome_keyring%': '<(use_gnome_keyring)',
1118 'linux_fpic%': '<(linux_fpic)',
1119 'chromeos%': '<(chromeos)',
1120 'chromecast%': '<(chromecast)',
1121 'enable_viewport%': '<(enable_viewport)',
1122 'enable_hidpi%': '<(enable_hidpi)',
1123 'image_loader_extension%': '<(image_loader_extension)',
1124 'fastbuild%': '<(fastbuild)',
1125 'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
1126 'win_z7%': '<(win_z7)',
1127 'dcheck_always_on%': '<(dcheck_always_on)',
1128 'tracing_like_official_build%': '<(tracing_like_official_build)',
1129 'arm_version%': '<(arm_version)',
1130 'arm_neon%': '<(arm_neon)',
1131 'arm_neon_optional%': '<(arm_neon_optional)',
1132 'sysroot%': '<(sysroot)',
1133 'chroot_cmd%': '<(chroot_cmd)',
1134 'system_libdir%': '<(system_libdir)',
1135 'component%': '<(component)',
1136 'win_analyze%': '<(win_analyze)',
1137 'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
1138 'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
1139 'use_third_party_translations%': '<(use_third_party_translations)',
1140 'remoting%': '<(remoting)',
1141 'enable_one_click_signin%': '<(enable_one_click_signin)',
1142 'enable_pre_sync_backup%': '<(enable_pre_sync_backup)',
1143 'enable_media_router%': '<(enable_media_router)',
1144 'enable_webrtc%': '<(enable_webrtc)',
1145 'chromium_win_pch%': '<(chromium_win_pch)',
1146 'configuration_policy%': '<(configuration_policy)',
1147 'safe_browsing%': '<(safe_browsing)',
1148 'enable_web_speech%': '<(enable_web_speech)',
1149 'notifications%': '<(notifications)',
1150 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1151 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1153 'asan_blacklist%': '<(asan_blacklist)',
1154 'asan_coverage%': '<(asan_coverage)',
1155 'sanitizer_coverage%': '<(sanitizer_coverage)',
1156 'asan_field_padding%': '<(asan_field_padding)',
1157 'use_sanitizer_options%': '<(use_sanitizer_options)',
1158 'syzyasan%': '<(syzyasan)',
1159 'kasko%': '<(kasko)',
1160 'syzygy_optimize%': '<(syzygy_optimize)',
1163 'msan_blacklist%': '<(msan_blacklist)',
1164 'msan_track_origins%': '<(msan_track_origins)',
1166 'tsan_blacklist%': '<(tsan_blacklist)',
1167 'ubsan%': '<(ubsan)',
1168 'ubsan_blacklist%': '<(ubsan_blacklist)',
1169 'ubsan_vptr%': '<(ubsan_vptr)',
1170 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1171 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
1172 'use_custom_libcxx%': '<(use_custom_libcxx)',
1173 'use_system_libcxx%': '<(use_system_libcxx)',
1174 'clang_type_profiler%': '<(clang_type_profiler)',
1175 'order_profiling%': '<(order_profiling)',
1176 'order_text_section%': '<(order_text_section)',
1177 'enable_extensions%': '<(enable_extensions)',
1178 'enable_plugin_installation%': '<(enable_plugin_installation)',
1179 'enable_plugins%': '<(enable_plugins)',
1180 'enable_session_service%': '<(enable_session_service)',
1181 'enable_themes%': '<(enable_themes)',
1182 'enable_autofill_dialog%': '<(enable_autofill_dialog)',
1183 'enable_prod_wallet_service%': '<(enable_prod_wallet_service)',
1184 'enable_save_wallet_cards_locally%': '<(enable_save_wallet_cards_locally)',
1185 'enable_background%': '<(enable_background)',
1186 'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
1187 'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
1188 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
1189 'linux_use_debug_fission%': '<(linux_use_debug_fission)',
1190 'use_canvas_skia%': '<(use_canvas_skia)',
1191 'test_isolation_mode%': '<(test_isolation_mode)',
1192 'test_isolation_outdir%': '<(test_isolation_outdir)',
1193 'enable_basic_printing%': '<(enable_basic_printing)',
1194 'enable_print_preview%': '<(enable_print_preview)',
1195 'enable_spellcheck%': '<(enable_spellcheck)',
1196 'enable_google_now%': '<(enable_google_now)',
1197 'cld_version%': '<(cld_version)',
1198 'cld2_table_size%': '<(cld2_table_size)',
1199 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
1200 'disable_file_support%': '<(disable_file_support)',
1201 'disable_ftp_support%': '<(disable_ftp_support)',
1202 'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
1203 'enable_task_manager%': '<(enable_task_manager)',
1204 'sas_dll_path%': '<(sas_dll_path)',
1205 'wix_path%': '<(wix_path)',
1206 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
1207 'use_system_libjpeg%': '<(use_system_libjpeg)',
1208 'android_channel%': '<(android_channel)',
1209 'android_webview_build%': '<(android_webview_build)',
1210 'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
1211 'gyp_managed_install%': 0,
1212 'create_standalone_apk%': 1,
1213 'enable_app_list%': '<(enable_app_list)',
1214 'use_default_render_theme%': '<(use_default_render_theme)',
1215 'enable_settings_app%': '<(enable_settings_app)',
1216 'google_api_key%': '<(google_api_key)',
1217 'google_default_client_id%': '<(google_default_client_id)',
1218 'google_default_client_secret%': '<(google_default_client_secret)',
1219 'enable_supervised_users%': '<(enable_supervised_users)',
1220 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
1221 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
1222 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
1223 'enable_mdns%' : '<(enable_mdns)',
1224 'enable_service_discovery%' : '<(enable_service_discovery)',
1225 'enable_wifi_bootstrapping%': '<(enable_wifi_bootstrapping)',
1226 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
1227 'v8_optimized_debug%': '<(v8_optimized_debug)',
1228 'proprietary_codecs%': '<(proprietary_codecs)',
1229 'use_goma%': '<(use_goma)',
1230 'gomadir%': '<(gomadir)',
1231 'use_lto%': '<(use_lto)',
1232 'use_lto_o2%': '<(use_lto_o2)',
1233 'gold_icf_level%': '<(gold_icf_level)',
1234 'video_hole%': '<(video_hole)',
1235 'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
1236 'cfi_vptr%': '<(cfi_vptr)',
1237 'mac_views_browser%': '<(mac_views_browser)',
1239 # Use system protobuf instead of bundled one.
1240 'use_system_protobuf%': 0,
1242 # Use system yasm instead of bundled one.
1243 'use_system_yasm%': 0,
1245 # Use system ICU instead of bundled one.
1246 'use_system_icu%' : 0,
1248 # Default to enabled PIE; this is important for ASLR but we may need to be
1249 # able to turn it off for various reasons.
1250 'linux_disable_pie%': 0,
1252 # The release channel that this build targets. This is used to restrict
1253 # channel-specific build options, like which installer packages to create.
1254 # The default is 'all', which does no channel-specific filtering.
1257 # Override chromium_mac_pch and set it to 0 to suppress the use of
1258 # precompiled headers on the Mac. Prefix header injection may still be
1259 # used, but prefix headers will not be precompiled. This is useful when
1260 # using distcc to distribute a build to compile slaves that don't
1261 # share the same compiler executable as the system driving the compilation,
1262 # because precompiled headers rely on pointers into a specific compiler
1263 # executable's image. Setting this to 0 is needed to use an experimental
1264 # Linux-Mac cross compiler distcc farm.
1265 'chromium_mac_pch%': 1,
1267 # The default value for mac_strip in target_defaults. This cannot be
1268 # set there, per the comment about variable% in a target_defaults.
1269 'mac_strip_release%': 0,
1271 # Set to 1 to enable java code coverage. Instruments classes during build
1272 # to produce .ec files during runtime.
1273 'emma_coverage%': 0,
1275 # EMMA filter string consisting of a list of inclusion/exclusion patterns
1276 # separated with whitespace and/or comma. Only has effect if
1277 # 'emma_coverage=1'.
1280 # Set to 1 to enable running Android lint on java/class files.
1283 # Although base/allocator lets you select a heap library via an
1284 # environment variable, the libcmt shim it uses sometimes gets in
1285 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
1286 # 'win_use_allocator_shim': 0,
1287 # 'win_release_RuntimeLibrary': 2
1288 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
1289 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
1291 # TODO(bradnelson): eliminate this when possible.
1292 # To allow local gyp files to prevent release.vsprops from being included.
1293 # Yes(1) means include release.vsprops.
1294 # Once all vsprops settings are migrated into gyp, this can go away.
1295 'msvs_use_common_release%': 1,
1297 # TODO(bradnelson): eliminate this when possible.
1298 # To allow local gyp files to override additional linker options for msvs.
1299 # Yes(1) means set use the common linker options.
1300 'msvs_use_common_linker_extras%': 1,
1302 # TODO(sgk): eliminate this if possible.
1303 # It would be nicer to support this via a setting in 'target_defaults'
1304 # in chrome/app/locales/locales.gypi overriding the setting in the
1305 # 'Debug' configuration in the 'target_defaults' dict below,
1306 # but that doesn't work as we'd like.
1307 'msvs_debug_link_incremental%': '2',
1309 # Needed for some of the largest modules.
1310 'msvs_debug_link_nonincremental%': '1',
1312 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
1313 # to get incremental linking to be faster in debug builds.
1314 'incremental_chrome_dll%': '0',
1316 # Experimental setting to break chrome.dll into multiple pieces based on
1318 'chrome_multiple_dll%': '0',
1320 # Experimental setting to optimize Chrome's DLLs with PGO.
1321 'chrome_pgo_phase%': '0',
1323 # Whether the VS xtree header has been patched to disable warning 4702. If
1324 # it has, then we don't need to disable 4702 (unreachable code warning).
1325 # The patch is preapplied to the internal toolchain and hence all bots.
1326 'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
1329 'clang%': '<(clang)',
1330 'host_clang%': '<(host_clang)',
1331 'make_clang_dir%': '<(make_clang_dir)',
1332 'use_lld%': '<(use_lld)',
1334 # Control which version of clang to use when building for iOS. If set to
1335 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1336 # the version of clang that ships with the Chromium source. This variable
1337 # is automatically set to '1' when using the Xcode generator.
1340 # These two variables can be set in GYP_DEFINES while running
1341 # |gclient runhooks| to let clang run a plugin in every compilation.
1342 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1344 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
1347 'clang_add_plugin%': '',
1349 # Tell ld64 to write map files describing binary layout. Useful
1350 # for looking at what contributes to binary size, e.g. with
1351 # https://github.com/nico/bloat
1352 'mac_write_linker_maps%': 0,
1354 # The default type of gtest.
1355 'gtest_target_type%': 'executable',
1357 # Enable sampling based profiler.
1358 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
1360 # Profile without optimizing out stack frames when profiling==1.
1361 'profiling_full_stack_frames%': '0',
1363 # And if we want to dump symbols for Breakpad-enabled builds.
1364 'linux_dump_symbols%': 0,
1365 # And if we want to strip the binary after dumping symbols.
1366 'linux_strip_binary%': 0,
1367 # If we want stack unwind support for backtrace().
1368 'debug_unwind_tables%': 1,
1369 'release_unwind_tables%': 1,
1371 # Override where to find binutils
1372 'binutils_version%': 0,
1373 'binutils_dir%': '',
1376 # Default of 'use_allocator' is set to 'none' if OS=='android' later.
1377 'use_allocator%': 'tcmalloc',
1379 # Set to 1 to link against libgnome-keyring instead of using dlopen().
1380 'linux_link_gnome_keyring%': 0,
1381 # Set to 1 to link against gsettings APIs instead of using dlopen().
1382 'linux_link_gsettings%': 0,
1384 # Enable use of OpenMAX DL FFT routines.
1385 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
1387 # Enable new NPDevice API.
1388 'enable_new_npdevice_api%': 0,
1390 # .gyp files or targets should set chromium_code to 1 if they build
1391 # Chromium-specific code, as opposed to external code. This variable is
1392 # used to control such things as the set of warnings to enable, and
1393 # whether warnings are treated as errors.
1394 'chromium_code%': 0,
1396 # Disable fatal linker warnings, similarly to how we make it possible
1397 # to disable -Werror (e.g. for different toolchain versions).
1398 'disable_fatal_linker_warnings%': 0,
1400 'release_valgrind_build%': 0,
1402 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
1403 'enable_wexit_time_destructors%': 0,
1405 # Build libpeerconnection as a static library by default.
1406 'libpeer_target_type%': 'static_library',
1408 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
1409 'internal_gles2_conform_tests%': 0,
1411 # Set to 1 to compile with the Khronos GL-CTS conformance tests.
1412 'internal_khronos_glcts_tests%': 0,
1414 # Set to 1 to compile the filter fuzzer.
1415 'internal_filter_fuzzer%': 0,
1417 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
1418 # so Cocoa is happy (http://crbug.com/20441).
1420 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
1421 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
1422 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
1423 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
1424 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
1425 'vi', 'zh-CN', 'zh-TW',
1428 # Pseudo locales are special locales which are used for testing and
1429 # debugging. They don't get copied to the final app. For more info,
1430 # check out https://www.chromium.org/developers/testing/fake-bidi
1437 # If debug_devtools is set to 1, JavaScript files for DevTools are
1438 # stored as is and loaded from disk. Otherwise, a concatenated file
1439 # is stored in resources.pak. It is still possible to load JS files
1440 # from disk by passing --debug-devtools cmdline switch.
1441 'debug_devtools%': 0,
1443 # The Java Bridge is not compiled in by default.
1446 # Code signing for iOS binaries. The bots need to be able to disable this.
1447 'chromium_ios_signing%': 1,
1449 # This flag is only used when disable_nacl==0 and disables all those
1450 # subcomponents which would require the installation of a native_client
1451 # untrusted toolchain.
1452 'disable_nacl_untrusted%': 0,
1454 # Disable Dart by default.
1457 # Copy out the setting of disable_nacl.
1458 'disable_nacl%': '<(disable_nacl)',
1460 # Portable Native Client is enabled by default.
1461 'disable_pnacl%': 0,
1463 # Whether to build full debug version for Debug configuration on Android.
1464 # Compared to full debug version, the default Debug configuration on Android
1465 # has no full v8 debug, has size optimization and linker gc section, so that
1466 # we can build a debug version with acceptable size and performance.
1467 'android_full_debug%': 0,
1469 # Sets the default version name and code for Android app, by default we
1470 # do a developer build.
1471 'android_app_version_name%': 'Developer Build',
1472 'android_app_version_code%': 1,
1474 # Contains data about the attached devices for gyp_managed_install.
1475 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
1477 'sas_dll_exists': '<!pymod_do_main(dir_exists "<(sas_dll_path)")',
1478 'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
1480 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
1481 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
1483 # Whether we are using the rlz library or not. Platforms like Android send
1484 # rlz codes for searches but do not use the library.
1487 # Turns on the i18n support in V8.
1488 'v8_enable_i18n_support': 1,
1490 # Compile d8 for the host toolset.
1491 'v8_toolset_for_d8': 'host',
1493 # Use brlapi from brltty for braille display support.
1496 # Relative path to icu.gyp from this file.
1497 'icu_gyp_path': '../third_party/icu/icu.gyp',
1499 # IPC fuzzer is disabled by default.
1500 'enable_ipc_fuzzer%': 0,
1502 # Force disable libstdc++ debug mode.
1503 'disable_glibcxx_debug%': 0,
1505 # Set to 1 to compile with MSE support for MPEG2 TS
1506 'enable_mpeg2ts_stream_parser%': 0,
1508 # Support ChromeOS touchpad gestures with ozone.
1509 'use_evdev_gestures%': 0,
1511 # Default ozone platform (if no --ozone-platform flag).
1512 'ozone_platform%': "",
1514 # Ozone platforms to include in the build.
1515 'ozone_platform_caca%': 0,
1516 'ozone_platform_dri%': 0,
1517 'ozone_platform_drm%': 0,
1518 'ozone_platform_egltest%': 0,
1519 'ozone_platform_gbm%': 0,
1520 'ozone_platform_ozonex%': 0,
1521 'ozone_platform_test%': 0,
1523 # Experiment: http://crbug.com/426914
1527 ['buildtype=="Official"', {
1528 # Continue to embed build meta data in Official builds, basically the
1529 # time it was built.
1530 # TODO(maruel): This decision should be revisited because having an
1531 # official deterministic build has high value too but MSVC toolset can't
1532 # generate anything deterministic with WPO enabled AFAIK.
1533 'dont_embed_build_metadata%': 0,
1535 # Enable the Syzygy optimization step for the official builds.
1536 ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
1537 'syzygy_optimize%': 1,
1539 'syzygy_optimize%': 0,
1541 # Get binutils version so we can enable debug fission if we can.
1542 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1544 # compiler_version doesn't work with clang
1545 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1546 # compiler_version works with clang.
1547 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1548 # that it takes effect here.
1549 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
1550 'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
1552 # On Android we know the binutils version in the toolchain.
1554 'binutils_version%': 222,
1556 ['host_arch=="x64"', {
1557 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1559 ['host_arch=="ia32"', {
1560 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
1562 # Our version of binutils in third_party/binutils
1563 ['linux_use_bundled_binutils==1', {
1564 'binutils_version%': 224,
1568 'binutils_version%': 0,
1570 # The version of GCC in use, set later in platforms that use GCC and have
1571 # not explicitly chosen to build with clang. Currently, this means all
1572 # platforms except Windows, Mac and iOS.
1573 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1574 # it takes effect here.
1575 ['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', {
1577 ['OS=="android" and android_webview_build==0', {
1578 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1579 # We directly set the gcc version since we know what we use.
1582 ['OS=="android" and android_webview_build==1', {
1583 # Android WebView uses a hermetic clang toolchain for host builds.
1584 'host_gcc_version%': 0,
1585 # Android WebView uses the GCC toolchain from the Android build.
1589 'host_gcc_version%': '<!pymod_do_main(compiler_version host compiler)',
1590 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)',
1594 'host_gcc_version%': 0,
1597 ['OS=="win" and "<!pymod_do_main(dir_exists <(windows_sdk_default_path))"=="True"', {
1598 'windows_sdk_path%': '<(windows_sdk_default_path)',
1600 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
1602 ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
1603 'directx_sdk_path%': '<(directx_sdk_default_path)',
1605 'directx_sdk_path%': '$(DXSDK_DIR)',
1608 'windows_driver_kit_path%': '$(WDK_DIR)',
1610 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1612 ['target_arch=="mipsel" or target_arch=="mips64el"', {
1615 'nacl_untrusted_build%': 0,
1616 'use_allocator%': 'none',
1618 ['OS=="linux" and target_arch=="mipsel"', {
1619 'sysroot%': '<(sysroot)',
1622 # Use a 64-bit linker to avoid running out of address space. The
1623 # buildbots should have a 64-bit kernel and a 64-bit libc installed.
1624 ['host_arch=="ia32" and target_arch=="ia32"', {
1625 # TODO(thestig) This is a horrible way to force the desired
1626 # configuration. Our gyp variable scoping is likely wrong and
1627 # needs to be cleaned up. The GN configuration should be changed
1629 'binutils_version%': 224,
1630 'linux_use_bundled_binutils%': '1',
1631 'linux_use_bundled_gold%': '1',
1632 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1634 # All Chrome builds have breakpad symbols, but only process the
1635 # symbols from official builds.
1636 ['(branding=="Chrome" and buildtype=="Official")', {
1637 'linux_dump_symbols%': 1,
1639 # Omit unwind support in official release builds to save space. We
1640 # can use breakpad for these builds.
1641 'release_unwind_tables%': 0,
1644 }], # os_posix==1 and OS!="mac" and OS!="ios"
1647 'enable_background%': 0,
1648 'icu_use_data_file_flag%': 1,
1649 'enable_web_speech%': 0,
1650 'use_system_libxml%': 1,
1651 'use_system_sqlite%': 1,
1653 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
1654 'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
1655 'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
1656 'uk', 'vi', 'zh-CN', 'zh-TW',
1659 # iOS SDK and deployment target support. The |ios_sdk| value is left
1660 # blank so that when it is set in the project files it will be the
1661 # "current" iOS SDK. Forcing a specific SDK even if it is "current"
1662 # causes Xcode to spit out a warning for every single project file for
1663 # not using the "current" SDK.
1665 'ios_sdk_path%': '',
1666 'ios_deployment_target%': '7.0',
1669 # ios_product_name is set to the name of the .app bundle as it should
1671 ['branding=="Chrome"', {
1672 'ios_product_name%': 'Chrome',
1673 }, { # else: branding!="Chrome"
1674 'ios_product_name%': 'Chromium',
1676 ['branding=="Chrome" and buildtype=="Official"', {
1678 }, { # else: branding!="Chrome" or buildtype!="Official"
1684 # Location of Android NDK.
1687 # Standard libraries can use the relative path to the NDK.
1688 'android_ndk_root%': '../../third_party/android_tools/ndk/',
1689 # Unfortunately, it is required to use the absolute path to the SDK
1690 # because it us passed to ant which uses a different relative path
1692 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
1693 # Similarly, gdbserver and the Android toolchain need to use the
1694 # absolute path to the NDK because they are used at different levels
1696 'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
1697 'android_host_arch%': '<!(uname -m)',
1698 # Android API-level of the SDK used for compilation.
1699 'android_sdk_version%': '22',
1700 'android_sdk_build_tools_version%': '22.0.0',
1701 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1703 # Copy conditionally-set variables out one scope.
1704 'android_ndk_root%': '<(android_ndk_root)',
1705 'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
1706 'android_sdk_root%': '<(android_sdk_root)',
1707 'android_sdk_version%': '<(android_sdk_version)',
1708 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
1709 'host_os%': '<(host_os)',
1711 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
1712 # Android SDK build tools (e.g. dx, aapt, aidl)
1713 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
1715 # Android API level 14 is ICS (Android 4.0) which is the minimum
1716 # platform requirement for Chrome on Android, we use it for native
1719 ['target_arch == "ia32"', {
1720 'android_app_abi%': 'x86',
1721 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
1722 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86',
1723 'android_ndk_lib_dir%': 'usr/lib',
1724 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1726 ['target_arch == "x64"', {
1727 'android_app_abi%': 'x86_64',
1728 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
1729 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
1730 'android_ndk_lib_dir%': 'usr/lib64',
1731 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1733 ['target_arch=="arm"', {
1736 'android_app_abi%': 'armeabi',
1738 'android_app_abi%': 'armeabi-v7a',
1741 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
1742 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm',
1743 'android_ndk_lib_dir%': 'usr/lib',
1744 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1746 ['target_arch == "arm64"', {
1747 'android_app_abi%': 'arm64-v8a',
1748 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
1749 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
1750 'android_ndk_lib_dir%': 'usr/lib',
1751 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1753 ['target_arch == "mipsel"', {
1754 'android_app_abi%': 'mips',
1755 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
1756 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips',
1757 'android_ndk_lib_dir%': 'usr/lib',
1758 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1760 ['target_arch == "mips64el"', {
1761 'android_app_abi%': 'mips64',
1762 'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
1763 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
1764 'android_ndk_lib_dir%': 'usr/lib64',
1765 'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
1769 # Copy conditionally-set variables out one scope.
1770 'android_app_abi%': '<(android_app_abi)',
1771 'android_gdbserver%': '<(android_gdbserver)',
1772 'android_ndk_root%': '<(android_ndk_root)',
1773 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
1774 'android_sdk_root%': '<(android_sdk_root)',
1775 'android_sdk_version%': '<(android_sdk_version)',
1776 'android_toolchain%': '<(android_toolchain)',
1778 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1779 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1780 'android_sdk_tools%': '<(android_sdk_tools)',
1781 'android_sdk%': '<(android_sdk)',
1782 'android_sdk_jar%': '<(android_sdk)/android.jar',
1784 'android_stlport_root': '<(android_stlport_root)',
1785 'android_stlport_include': '<(android_stlport_root)/stlport',
1786 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
1787 'host_os%': '<(host_os)',
1789 # Location of the "objcopy" binary, used by both gyp and scripts.
1790 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1792 # Location of the "strip" binary, used by both gyp and scripts.
1793 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1795 # Location of the "readelf" binary.
1796 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
1798 # Determines whether we should optimize JNI generation at the cost of
1799 # breaking assumptions in the build system that when inputs have changed
1800 # the outputs should always change as well. This is meant purely for
1801 # developer builds, to avoid spurious re-linking of native files.
1802 'optimize_jni_generation%': '<(optimize_jni_generation)',
1804 # Always uses openssl.
1806 'use_openssl_certs%': 1,
1808 'proprietary_codecs%': '<(proprietary_codecs)',
1809 'safe_browsing%': 2,
1810 'enable_web_speech%': 0,
1812 'build_ffmpegsumo%': 0,
1813 'use_allocator%': 'none',
1815 # Disable Native Client.
1818 # Android does not support background apps.
1819 'enable_background%': 0,
1821 # Sessions are store separately in the Java side.
1822 'enable_session_service%': 0,
1826 'gtest_target_type%': 'shared_library',
1828 # Uses system APIs for decoding audio and video.
1829 'use_libffmpeg%': '0',
1831 # TODO(torne): Remove this unsupported option once all the places that
1832 # test it have been updated.
1833 'use_system_stlport%': 0,
1835 # Copy it out one scope.
1836 'android_webview_build%': '<(android_webview_build)',
1839 'use_system_fontconfig%': 0,
1841 'use_system_fontconfig%': 1,
1844 'enable_mpeg2ts_stream_parser%': 1,
1845 'ffmpeg_branding%': 'ChromeOS',
1846 'ozone_platform_ozonex%': 1,
1847 'use_playready%': 0,
1849 ['target_arch=="arm"', {
1851 'arm_tune%': 'cortex-a9',
1857 ['android_webview_build==1', {
1858 # When building the WebView in the Android tree, jarjar will remap all
1859 # the class names, so the JNI generator needs to know this.
1860 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
1862 ['OS=="linux" and target_arch!="mipsel"', {
1867 # All Chrome builds have breakpad symbols, but only process the
1868 # symbols from official builds.
1869 ['(branding=="Chrome" and buildtype=="Official")', {
1870 'mac_strip_release%': 1,
1874 ['OS=="mac" or OS=="ios"', {
1878 # Mac OS X SDK and deployment target support. The SDK identifies
1879 # the version of the system headers that will be used, and
1880 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1881 # macro. "Maximum allowed" refers to the operating system version
1882 # whose APIs are available in the headers. The deployment target
1883 # identifies the minimum system version that the built products are
1884 # expected to function on. It corresponds to the
1885 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1886 # macros are available, #include <AvailabilityMacros.h>. Additional
1887 # documentation on these macros is available at
1888 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
1889 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
1890 # deployment target to 10.6. Other projects, such as O3D, may
1891 # override these defaults.
1893 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
1894 # about that is at least the specified version. In official builds,
1895 # the SDK must match mac_sdk_min exactly. If the SDK is installed
1896 # someplace that Xcode doesn't know about, set mac_sdk_path to the
1897 # path to the SDK; when set to a non-empty string, SDK detection
1898 # based on mac_sdk_min will be bypassed entirely.
1901 'mac_sdk_min%': '10.8',
1902 }, { # else OS!="ios"
1903 'mac_sdk_min%': '10.6',
1906 'mac_sdk_path%': '',
1908 'mac_deployment_target%': '10.6',
1911 'mac_sdk_min': '<(mac_sdk_min)',
1912 'mac_sdk_path': '<(mac_sdk_path)',
1913 'mac_deployment_target': '<(mac_deployment_target)',
1915 # Compile in Breakpad support by default so that it can be
1916 # tested, even if it is not enabled by default at runtime.
1917 'mac_breakpad_compiled_in%': 1,
1919 # mac_product_name is set to the name of the .app bundle as it should
1920 # appear on disk. This duplicates data from
1921 # chrome/app/theme/chromium/BRANDING and
1922 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
1923 # these names into the build system.
1924 ['branding=="Chrome"', {
1925 'mac_product_name%': 'Google Chrome',
1926 }, { # else: branding!="Chrome"
1927 'mac_product_name%': 'Chromium',
1929 # Official mac builds require a specific OS X SDK, but iOS and
1930 # non-official mac builds do not.
1931 ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
1932 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
1934 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
1936 ['branding=="Chrome" and buildtype=="Official"', {
1937 # Enable uploading crash dumps.
1938 'mac_breakpad_uploads%': 1,
1939 # Enable dumping symbols at build time for use by Mac Breakpad.
1941 # Enable Keystone auto-update support.
1943 }, { # else: branding!="Chrome" or buildtype!="Official"
1944 'mac_breakpad_uploads%': 0,
1949 }], # OS=="mac" or OS=="ios"
1952 # This is the architecture convention used in WinSDK paths.
1953 ['target_arch=="ia32"', {
1954 'winsdk_arch%': 'x86',
1956 'winsdk_arch%': '<(target_arch)',
1958 ['component=="shared_library"', {
1959 'win_use_allocator_shim%': 0,
1961 # Turn on multiple dll by default on Windows when in static_library.
1962 'chrome_multiple_dll%': 1,
1964 ['asan==1 or syzyasan==1', {
1965 'win_use_allocator_shim%': 0,
1970 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
1971 # Only enabled by default for ninja because it's buggy in VS.
1972 # Not enabled for component=static_library because some targets
1973 # are too large and the toolchain fails due to the size of the
1975 'incremental_chrome_dll%': 1,
1977 # Don't do incremental linking for large modules on 32-bit or when
1978 # component=static_library as the toolchain fails due to the size of
1980 ['MSVS_OS_BITS==32 or component=="static_library"', {
1981 'msvs_large_module_debug_link_mode%': '1', # No
1983 'msvs_large_module_debug_link_mode%': '2', # Yes
1986 'nacl_win64_defines': [
1987 # This flag is used to minimize dependencies when building
1988 # Native Client loader for 64-bit Windows.
1991 # Need to include allocator target, but exclude tcmalloc files.
1992 'use_allocator%': 'winheap',
1995 ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
2001 ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', {
2002 'enable_pepper_cdms%': 1,
2004 'enable_pepper_cdms%': 0,
2007 ['OS=="android" or chromecast==1', {
2008 'enable_browser_cdms%': 1,
2010 'enable_browser_cdms%': 0,
2013 # Native Client glibc toolchain is enabled
2014 # by default except on arm, mips and mips64.
2015 ['target_arch=="arm" or target_arch=="mipsel" or target_arch=="mips64el"', {
2016 'disable_glibc%': 1,
2018 'disable_glibc%': 0,
2021 # Set the relative path from this file to the GYP file of the JPEG
2022 # library used by Chromium.
2023 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
2024 # Configuration for using the system libjeg is here.
2025 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
2027 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
2030 # Options controlling the use of GConf (the classic GNOME configuration
2031 # system) and GIO, which contains GSettings (the new GNOME config system).
2032 ['chromeos==1 or embedded==1', {
2040 # Set up -D and -E flags passed into grit.
2041 ['branding=="Chrome"', {
2042 # TODO(mmoss) The .grd files look for _google_chrome, but for
2043 # consistency they should look for google_chrome_build like C++.
2044 'grit_defines': ['-D', '_google_chrome',
2045 '-E', 'CHROMIUM_BUILD=google_chrome'],
2047 'grit_defines': ['-D', '_chromium',
2048 '-E', 'CHROMIUM_BUILD=chromium'],
2051 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
2053 ['desktop_linux==1', {
2054 'grit_defines': ['-D', 'desktop_linux'],
2056 ['toolkit_views==1', {
2057 'grit_defines': ['-D', 'toolkit_views'],
2060 'grit_defines': ['-D', 'use_aura'],
2063 'grit_defines': ['-D', 'use_ash'],
2066 'grit_defines': ['-D', 'use_nss'],
2069 'grit_defines': ['-D', 'use_ozone'],
2071 ['image_loader_extension==1', {
2072 'grit_defines': ['-D', 'image_loader_extension'],
2075 'grit_defines': ['-D', 'remoting'],
2077 ['use_titlecase_in_grd==1', {
2078 'grit_defines': ['-D', 'use_titlecase'],
2080 ['use_third_party_translations==1', {
2081 'grit_defines': ['-D', 'use_third_party_translations'],
2083 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
2084 'ka', 'ku', 'kw', 'ms', 'ug'
2090 '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
2091 '--no-output-all-resource-defines',
2094 ['<(android_webview_build)==1', {
2095 'grit_defines': ['-D', 'is_android_webview_build'],
2099 ['OS=="mac" or OS=="ios"', {
2100 'grit_defines': ['-D', 'scale_factors=2x'],
2104 'enable_coverage%': 0,
2108 '--no-output-all-resource-defines',
2110 # iOS uses a whitelist to filter resources.
2111 'grit_whitelist%': '<(DEPTH)/build/ios/grit_whitelist.txt',
2113 # Enable host builds when generating with ninja-ios.
2115 ['"<(GENERATOR)"=="ninja"', {
2119 # Use the version of clang shipped with Xcode when building official
2120 # version of Chrome for iOS.
2122 # TODO(eugenebut): Remove enable_coverage check once
2123 # libclang_rt.profile_ios.a is bundled with Chromium's clang.
2124 # http://crbug.com/450379
2125 ['buildtype=="Official" or enable_coverage', {
2130 ['enable_extensions==1', {
2131 'grit_defines': ['-D', 'enable_extensions'],
2133 ['enable_plugins!=0', {
2134 'grit_defines': ['-D', 'enable_plugins'],
2136 ['enable_basic_printing==1 or enable_print_preview==1', {
2137 'grit_defines': ['-D', 'enable_printing'],
2139 ['enable_print_preview==1', {
2140 'grit_defines': ['-D', 'enable_print_preview'],
2142 ['enable_themes==1', {
2143 'grit_defines': ['-D', 'enable_themes'],
2145 ['enable_app_list==1', {
2146 'grit_defines': ['-D', 'enable_app_list'],
2148 ['enable_settings_app==1', {
2149 'grit_defines': ['-D', 'enable_settings_app'],
2151 ['enable_google_now==1', {
2152 'grit_defines': ['-D', 'enable_google_now'],
2154 ['use_concatenated_impulse_responses==1', {
2155 'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
2157 ['enable_media_router==1', {
2158 'grit_defines': ['-D', 'enable_media_router'],
2160 ['enable_webrtc==1', {
2161 'grit_defines': ['-D', 'enable_webrtc'],
2163 ['enable_hangout_services_extension==1', {
2164 'grit_defines': ['-D', 'enable_hangout_services_extension'],
2166 ['enable_task_manager==1', {
2167 'grit_defines': ['-D', 'enable_task_manager'],
2169 ['notifications==1', {
2170 'grit_defines': ['-D', 'enable_notifications'],
2172 ['enable_wifi_bootstrapping==1', {
2173 'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
2175 ['mac_views_browser==1', {
2176 'grit_defines': ['-D', 'mac_views_browser'],
2178 ['enable_resource_whitelist_generation==1 and OS!="win"', {
2179 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
2181 ['enable_resource_whitelist_generation==1 and OS=="win"', {
2182 'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
2184 ['enable_mdns==1 or OS=="mac"', {
2185 'grit_defines': ['-D', 'enable_service_discovery'],
2186 'enable_service_discovery%': 1
2188 ['clang_use_chrome_plugins==1 and OS!="win"', {
2191 ['OS=="mac" or OS=="ios"', {
2192 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
2193 }, { # OS != "mac" or OS != "ios"
2194 'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
2198 # If you change these, also change build/config/clang/BUILD.gn.
2199 'clang_chrome_plugins_flags%':
2200 '-Xclang -load -Xclang <(clang_lib_path)'
2201 ' -Xclang -add-plugin -Xclang find-bad-constructs',
2203 ['asan==1 or msan==1 or lsan==1 or tsan==1', {
2205 'use_allocator%': 'none',
2206 'use_sanitizer_options%': 1,
2207 # Disable ICF in the linker to avoid debug info loss.
2208 'gold_icf_level%': 'none',
2210 ['asan==1 and OS=="linux" and chromeos==0', {
2211 'use_custom_libcxx%': 1,
2219 ['asan==1 and OS=="mac"', {
2220 'mac_strip_release': 1,
2223 'use_custom_libcxx%': 1,
2226 # Use a just-built, MSan-instrumented libc++ instead of the system-wide
2227 # libstdc++. This is required to avoid false positive reports whenever
2228 # the C++ standard library is used.
2229 'use_custom_libcxx%': 1,
2230 # Running the V8-generated code on an ARM simulator is a powerful hack
2231 # that allows the tool to see the memory accesses from JITted code.
2232 # Without this flag, JS code causes false positive reports from MSan.
2233 'v8_target_arch': 'arm64',
2236 ['OS=="linux" and clang_type_profiler==1', {
2238 'clang_use_chrome_plugins%': 0,
2240 ['host_arch=="x64"', {
2241 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
2243 ['host_arch=="ia32"', {
2244 # 32-bit Clang is unsupported. It may not build. Put your 32-bit
2245 # Clang in this directory at your own risk if needed for some
2246 # purpose (e.g. to compare 32-bit and 64-bit behavior like memory
2247 # usage). Any failure by this compiler should not close the tree.
2248 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32',
2254 # The Clang plugins don't currently work on Windows.
2255 # TODO(hans): One day, this will work. (crbug.com/82385)
2256 'clang_use_chrome_plugins%': 0,
2259 # On valgrind bots, override the optimizer settings so we don't inline too
2260 # much and make the stacks harder to figure out.
2262 # TODO(rnk): Kill off variables that no one else uses and just implement
2263 # them under a build_for_tool== condition.
2264 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
2266 'mac_debug_optimization': '1',
2267 'mac_release_optimization': '1',
2268 'release_optimize': '1',
2269 'no_gc_sections': 1,
2270 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2271 '-fno-builtin -fno-optimize-sibling-calls',
2272 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
2273 '-fno-builtin -fno-optimize-sibling-calls',
2275 # MSVS flags for TSan on Pin and Windows.
2276 'win_debug_RuntimeChecks': '0',
2277 'win_debug_disable_iterator_debugging': '1',
2278 'win_debug_Optimization': '1',
2279 'win_debug_InlineFunctionExpansion': '0',
2280 'win_release_InlineFunctionExpansion': '0',
2281 'win_release_OmitFramePointers': '0',
2283 'use_allocator': 'tcmalloc',
2284 'release_valgrind_build': 1,
2286 'component': 'static_library',
2287 'use_system_zlib': 0,
2290 # Build tweaks for DrMemory.
2291 # TODO(rnk): Combine with tsan config to share the builder.
2292 # http://crbug.com/108155
2293 ['build_for_tool=="drmemory"', {
2294 # These runtime checks force initialization of stack vars which blocks
2295 # DrMemory's uninit detection.
2296 'win_debug_RuntimeChecks': '0',
2297 # Iterator debugging is slow.
2298 'win_debug_disable_iterator_debugging': '1',
2299 # Try to disable optimizations that mess up stacks in a release build.
2300 # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
2301 # /O2 and /Ob0 (disable inline) cannot be used together because of a
2302 # compiler bug, so we use /Ob1 instead.
2303 'win_release_InlineFunctionExpansion': '1',
2304 'win_release_OmitFramePointers': '0',
2305 # Ditto for debug, to support bumping win_debug_Optimization.
2306 'win_debug_InlineFunctionExpansion': 0,
2307 'win_debug_OmitFramePointers': 0,
2308 # Keep the code under #ifndef NVALGRIND.
2309 'release_valgrind_build': 1,
2312 # Enable RLZ on Win, Mac, iOS and ChromeOS.
2313 ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', {
2317 # Set default compiler flags depending on ARM version.
2318 ['arm_version==6 and android_webview_build==0', {
2319 'arm_arch%': 'armv6',
2322 'arm_float_abi%': 'softfp',
2325 ['arm_version==7 and android_webview_build==0', {
2326 'arm_arch%': 'armv7-a',
2327 'arm_tune%': 'generic-armv7-a',
2332 'arm_fpu%': 'vfpv3-d16',
2335 # Change the default to hard once the armhf transition is complete.
2336 'arm_float_abi%': 'softfp',
2340 # Set default compiler flags for MIPS floating-point support.
2341 ['target_arch=="mipsel" and android_webview_build==0', {
2342 'mips_float_abi%': 'hard',
2344 ['target_arch=="mipsel" and mips_arch_variant=="r2" and android_webview_build==0', {
2345 'mips_fpu_mode%': 'fp32',
2348 ['android_webview_build==1', {
2349 # The WebView build gets its cpu-specific flags from the Android build system.
2353 'arm_float_abi%': '',
2355 'mips_float_abi%': '',
2356 'mips_fpu_mode%': '',
2359 # Enable brlapi by default for chromeos.
2364 ['use_ozone==1 and ozone_auto_platforms==1', {
2365 # Use test as the default platform.
2366 'ozone_platform%': 'test',
2368 # Build all platforms whose deps are in install-build-deps.sh.
2369 # Only these platforms will be compile tested by buildbots.
2370 'ozone_platform_dri%': 1,
2371 'ozone_platform_drm%': 1,
2372 'ozone_platform_test%': 1,
2373 'ozone_platform_egltest%': 1,
2376 ['desktop_linux==1 and use_aura==1 and use_x11==1', {
2377 'use_clipboard_aurax11%': 1,
2380 ['OS=="win" and use_goma==1', {
2381 # goma doesn't support pch yet.
2382 'chromium_win_pch': 0,
2383 # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
2385 ['win_z7==0 and fastbuild==0', {
2391 ['OS=="win" and (clang==1 or asan==1)', {
2392 'chromium_win_pch': 0,
2396 'host_cc': '<(make_clang_dir)/bin/clang',
2397 'host_cxx': '<(make_clang_dir)/bin/clang++',
2399 'host_cc': '<!(which gcc)',
2400 'host_cxx': '<!(which g++)',
2403 # The seccomp-bpf sandbox is only supported on five architectures
2405 # Do not disable seccomp_bpf anywhere without talking to
2406 # security@chromium.org!
2407 ['((OS=="linux" or OS=="android") and '
2408 '(target_arch=="ia32" or target_arch=="x64" or '
2409 'target_arch=="arm" or target_arch=="mipsel" or '
2410 'target_arch=="arm64"))', {
2411 'use_seccomp_bpf%': 1,
2413 'use_seccomp_bpf%': 0,
2421 # The path to the ANGLE library.
2422 'angle_path': '<(DEPTH)/third_party/angle',
2424 # List of default apps to install in new profiles. The first list contains
2425 # the source files as found in svn. The second list, used only for linux,
2426 # contains the destination location for each of the files. When a crx
2427 # is added or removed from the list, the chrome/browser/resources/
2428 # default_apps/external_extensions.json file must also be updated.
2430 # README: GN version of these is in the target //chrome:default_apps
2431 # (there's no global variable like in GYP). Be sure to update that target
2432 # if you change these lists!
2433 'default_apps_list': [
2434 'browser/resources/default_apps/external_extensions.json',
2435 'browser/resources/default_apps/gmail.crx',
2436 'browser/resources/default_apps/search.crx',
2437 'browser/resources/default_apps/youtube.crx',
2438 'browser/resources/default_apps/drive.crx',
2439 'browser/resources/default_apps/docs.crx',
2441 'default_apps_list_linux_dest': [
2442 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
2443 '<(PRODUCT_DIR)/default_apps/gmail.crx',
2444 '<(PRODUCT_DIR)/default_apps/search.crx',
2445 '<(PRODUCT_DIR)/default_apps/youtube.crx',
2446 '<(PRODUCT_DIR)/default_apps/drive.crx',
2447 '<(PRODUCT_DIR)/default_apps/docs.crx',
2450 # Whether to allow building of the GPU-related isolates.
2451 'archive_gpu_tests%': 0,
2453 # Whether to allow building of chromoting related isolates.
2454 'archive_chromoting_tests%': 0,
2456 'target_defaults': {
2458 # The condition that operates on chromium_code is in a target_conditions
2459 # section, and will not have access to the default fallback value of
2460 # chromium_code at the top of this file, or to the chromium_code
2461 # variable placed at the root variables scope of .gyp files, because
2462 # those variables are not set at target scope. As a workaround,
2463 # if chromium_code is not set at target scope, define it in target scope
2464 # to contain whatever value it has during early variable expansion.
2465 # That's enough to make it available during target conditional
2467 'chromium_code%': '<(chromium_code)',
2469 'component%': '<(component)',
2471 'chromecast%': '<(chromecast)',
2473 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
2474 'win_release_Optimization%': '2', # 2 = /O2
2475 'win_debug_Optimization%': '0', # 0 = /Od
2477 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
2478 # Tri-state: blank is default, 1 on, 0 off
2479 'win_release_OmitFramePointers%': '0',
2480 # Tri-state: blank is default, 1 on, 0 off
2481 'win_debug_OmitFramePointers%': '',
2483 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
2484 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
2486 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
2487 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
2488 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
2490 # VS inserts quite a lot of extra checks to algorithms like
2491 # std::partial_sort in Debug build which make them O(N^2)
2492 # instead of O(N*logN). This is particularly slow under memory
2493 # tools like ThreadSanitizer so we want it to be disablable.
2494 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
2495 'win_debug_disable_iterator_debugging%': '0',
2497 # An application manifest fragment to declare compatibility settings for
2498 # 'executable' targets. Ignored in other target type.
2499 'win_exe_compatibility_manifest%':
2500 '<(DEPTH)\\build\\win\\compatibility.manifest',
2502 'release_extra_cflags%': '',
2503 'debug_extra_cflags%': '',
2505 'release_valgrind_build%': '<(release_valgrind_build)',
2507 # the non-qualified versions are widely assumed to be *nix-only
2508 'win_release_extra_cflags%': '',
2509 'win_debug_extra_cflags%': '',
2511 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
2512 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
2514 # Only used by Windows build for now. Can be used to build into a
2515 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
2516 # output files in src/build/VS2010_{Debug,Release}.
2517 'build_dir_prefix%': '',
2519 # Targets are by default not nacl untrusted code.
2520 'nacl_untrusted_build%': 0,
2522 'pnacl_compile_flags': [
2523 # pnacl uses the clang compiler so we need to suppress all the
2524 # same warnings as we do for clang.
2525 # TODO(sbc): Remove these if/when they are removed from the clang
2527 '-Wno-unused-function',
2528 '-Wno-char-subscripts',
2529 '-Wno-c++11-extensions',
2530 '-Wno-unnamed-type-template-args',
2533 # By default, Android targets have their exported JNI symbols stripped,
2534 # so we test the manual JNI registration code paths that are required
2535 # when using the crazy linker. To allow use of native JNI exports (lazily
2536 # resolved by the JVM), targets can enable this variable, which will stop
2537 # the stripping from happening. Only targets which do not need to be
2538 # compatible with the crazy linker are permitted to set this.
2539 'use_native_jni_exports%': 0,
2542 ['OS=="win" and component=="shared_library"', {
2543 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2544 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
2545 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
2547 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
2548 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
2549 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
2552 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2553 'mac_release_optimization%': 's', # Use -Os unless overridden
2554 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2556 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
2557 'mac_release_optimization%': '2', # Use -O2 unless overridden
2558 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2561 'host_os%': '<(host_os)', # See comment above chromium_code.
2564 'clang_warning_flags': [
2567 # Don't die on dtoa code that uses a char as an array index.
2568 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2569 '-Wno-char-subscripts',
2571 # TODO(thakis): This used to be implied by -Wno-unused-function,
2572 # which we no longer use. Check if it makes sense to remove
2573 # this as well. http://crbug.com/316352
2574 '-Wno-unneeded-internal-declaration',
2576 # Warns on switches on enums that cover all enum values but
2577 # also contain a default: branch. Chrome is full of that.
2578 '-Wno-covered-switch-default',
2580 # Warns when a const char[] is converted to bool.
2581 '-Wstring-conversion',
2583 # C++11-related flags:
2585 # This warns on using ints as initializers for floats in
2586 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2587 # which happens in several places in chrome code. Not sure if
2588 # this is worth fixing.
2589 '-Wno-c++11-narrowing',
2591 # Clang considers the `register` keyword as deprecated, but e.g.
2592 # code generated by flex (used in angle) contains that keyword.
2593 # http://crbug.com/255186
2594 '-Wno-deprecated-register',
2596 # TODO(hans): Get this cleaned up.
2597 '-Wno-inconsistent-missing-override',
2600 'includes': [ 'set_clang_warning_flags.gypi', ],
2602 # Don't use deprecated V8 APIs anywhere.
2603 'V8_DEPRECATION_WARNINGS',
2606 '<(SHARED_INTERMEDIATE_DIR)',
2609 ['(OS=="mac" or OS=="ios") and asan==1', {
2611 '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
2614 ['OS=="win" and asan==1 and component=="shared_library"', {
2616 '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
2619 ['OS=="linux" and use_allocator!="none" and clang_type_profiler==1', {
2620 'cflags_cc!': ['-fno-rtti'],
2623 '-gline-tables-only',
2624 '-fintercept-allocation-functions',
2626 'defines': ['TYPE_PROFILING'],
2628 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
2631 ['branding=="Chrome"', {
2632 'defines': ['GOOGLE_CHROME_BUILD'],
2633 }, { # else: branding!="Chrome"
2634 'defines': ['CHROMIUM_BUILD'],
2636 ['OS=="mac" and component=="shared_library"', {
2638 'DYLIB_INSTALL_NAME_BASE': '@rpath',
2639 'LD_RUNPATH_SEARCH_PATHS': [
2640 # For unbundled binaries.
2642 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
2643 '@loader_path/../../..',
2647 ['(clang==1 or host_clang==1) and OS!="win"', {
2648 # This is here so that all files get recompiled after a clang roll and
2649 # when turning clang on or off.
2650 # (defines are passed via the command line, and build systems rebuild
2651 # things when their commandline changes). Nothing should ever read this
2653 'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
2656 'defines': ['ENABLE_RLZ'],
2658 ['component=="shared_library"', {
2659 'defines': ['COMPONENT_BUILD'],
2661 ['toolkit_views==1', {
2662 'defines': ['TOOLKIT_VIEWS=1'],
2664 ['ui_compositor_image_transport==1', {
2665 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
2668 'defines': ['USE_AURA=1'],
2671 'defines': ['USE_ASH=1'],
2674 'defines': ['USE_PANGO=1'],
2677 'defines': ['USE_CAIRO=1'],
2680 'defines': ['USE_CRAS=1'],
2683 'defines': ['USE_OZONE=1'],
2685 ['use_default_render_theme==1', {
2686 'defines': ['USE_DEFAULT_RENDER_THEME=1'],
2688 ['use_libjpeg_turbo==1', {
2689 'defines': ['USE_LIBJPEG_TURBO=1'],
2692 'defines': ['USE_X11=1'],
2694 ['use_clipboard_aurax11==1', {
2695 'defines': ['USE_CLIPBOARD_AURAX11=1'],
2697 ['enable_one_click_signin==1', {
2698 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
2700 ['enable_pre_sync_backup==1', {
2701 'defines': ['ENABLE_PRE_SYNC_BACKUP'],
2703 ['image_loader_extension==1', {
2704 'defines': ['IMAGE_LOADER_EXTENSION=1'],
2707 'defines': ['ENABLE_PROFILING=1'],
2710 'defines': ['ENABLE_REMOTING=1'],
2712 ['enable_webrtc==1', {
2713 'defines': ['ENABLE_WEBRTC=1'],
2715 ['proprietary_codecs==1', {
2716 'defines': ['USE_PROPRIETARY_CODECS'],
2718 ['enable_mpeg2ts_stream_parser==1', {
2719 'defines': ['ENABLE_MPEG2TS_STREAM_PARSER'],
2723 ['enable_viewport==1', {
2724 'defines': ['ENABLE_VIEWPORT'],
2726 ['enable_pepper_cdms==1', {
2727 'defines': ['ENABLE_PEPPER_CDMS'],
2729 ['enable_browser_cdms==1', {
2730 'defines': ['ENABLE_BROWSER_CDMS'],
2732 ['configuration_policy==1', {
2733 'defines': ['ENABLE_CONFIGURATION_POLICY'],
2735 ['notifications==1', {
2736 'defines': ['ENABLE_NOTIFICATIONS'],
2738 ['enable_hidpi==1', {
2739 'defines': ['ENABLE_HIDPI=1'],
2741 ['native_memory_pressure_signals==1', {
2742 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'],
2745 'defines': ['USE_UDEV'],
2749 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
2752 ['OS=="win" and fastbuild==2', {
2753 # Completely disable debug information.
2756 'GenerateDebugInformation': 'false',
2758 'VCCLCompilerTool': {
2759 'DebugInformationFormat': '0',
2763 ['OS=="win" and fastbuild==1', {
2766 # This tells the linker to generate .pdbs, so that
2767 # we can get meaningful stack traces.
2768 'GenerateDebugInformation': 'true',
2770 'VCCLCompilerTool': {
2771 # No debug info to be generated by compiler.
2772 'DebugInformationFormat': '0',
2776 ['(OS=="android" or OS=="linux") and fastbuild==2', {
2777 'variables': { 'debug_extra_cflags': '-g0', },
2779 ['(OS=="android" or OS=="linux") and fastbuild==1', {
2780 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2782 'variables': { 'debug_extra_cflags': '-g0', },
2784 # Android builds symbols on release by default, disable them.
2785 ['OS=="android" and fastbuild==2', {
2786 'variables': { 'release_extra_cflags': '-g0', },
2788 ['OS=="android" and fastbuild==1', {
2789 # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
2791 'variables': { 'release_extra_cflags': '-g0', },
2795 ['dont_embed_build_metadata==1', {
2797 'DONT_EMBED_BUILD_METADATA',
2799 }], # dont_embed_build_metadata==1
2800 ['dcheck_always_on!=0', {
2801 'defines': ['DCHECK_ALWAYS_ON=1'],
2802 }], # dcheck_always_on!=0
2803 ['tracing_like_official_build!=0', {
2804 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
2805 }], # tracing_like_official_build!=0
2807 'defines': ['NO_TCMALLOC'],
2809 ['win_use_allocator_shim==1', {
2810 'defines': ['ALLOCATOR_SHIM'],
2816 'ADDRESS_SANITIZER',
2817 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2818 'MEMORY_SANITIZER_INITIAL_SIZE',
2822 # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
2830 'MEMORY_TOOL_REPLACES_ALLOCATOR',
2831 'MEMORY_SANITIZER_INITIAL_SIZE',
2839 '<(DEPTH)/third_party/kasko/include',
2845 '_CRT_SECURE_NO_DEPRECATE',
2846 '_SCL_SECURE_NO_DEPRECATE',
2847 # This define is required to pull in the new Win8 interfaces from
2848 # system headers like ShObjIdl.h.
2849 'NTDDI_VERSION=0x06030000',
2850 # This is required for ATL to use XP-safe versions of its functions.
2851 '_USING_V110_SDK71_',
2854 '<(DEPTH)/third_party/wtl/include',
2859 # Generates debug info when win_z7=1
2860 # even if fastbuild=1 (that makes GenerateDebugInformation false).
2862 'GenerateDebugInformation': 'true',
2864 'VCCLCompilerTool': {
2865 'DebugInformationFormat': '1',
2871 # This is prohibited when running /analyze.
2872 '_USING_V110_SDK71_',
2875 'VCCLCompilerTool': {
2876 # Set WarnAsError to false to disable this setting for most
2877 # projects so that compilation continues.
2878 'WarnAsError': 'false',
2879 # When win_analyze is specified add the /analyze switch.
2880 # Also add /WX- to force-disable WarnAsError for projects that
2881 # override WarnAsError.
2882 # Also, disable various noisy warnings that have low value.
2883 'AdditionalOptions': [
2886 '/wd6011', # Dereferencing NULL pointer
2887 '/wd6312', # Possible infinite loop: use of the constant
2888 # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
2889 '/wd6326', # Potential comparison of constant with constant
2890 '/wd28159', # Consider using 'GetTickCount64'
2891 '/wd28204', # Inconsistent SAL annotations
2892 '/wd28251', # Inconsistent SAL annotations
2893 '/wd28252', # Inconsistent SAL annotations
2894 '/wd28253', # Inconsistent SAL annotations
2895 '/wd28196', # The precondition is not satisfied
2896 '/wd28301', # Inconsistent SAL annotations
2897 '/wd6340', # Sign mismatch in function parameter
2898 '/wd28182', # Dereferencing NULL pointer
2899 # C6285 is ~16% of raw warnings and has low value
2900 '/wd6285', # non-zero constant || non-zero constant
2901 # C6334 is ~80% of raw warnings and has low value
2902 '/wd6334', # sizeof applied to an expression with an operator
2914 ['use_playready==1', {
2916 'PLAYREADY_CDM_AVAILABLE',
2921 ['enable_task_manager==1', {
2923 'ENABLE_TASK_MANAGER=1',
2926 ['enable_extensions==1', {
2928 'ENABLE_EXTENSIONS=1',
2931 ['OS=="win" and branding=="Chrome"', {
2932 'defines': ['ENABLE_SWIFTSHADER'],
2934 ['enable_dart==1', {
2935 'defines': ['WEBKIT_USING_DART=1'],
2937 ['enable_plugin_installation==1', {
2938 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
2940 ['enable_plugins==1', {
2941 'defines': ['ENABLE_PLUGINS=1'],
2943 ['enable_session_service==1', {
2944 'defines': ['ENABLE_SESSION_SERVICE=1'],
2946 ['enable_themes==1', {
2947 'defines': ['ENABLE_THEMES=1'],
2949 ['enable_autofill_dialog==1', {
2950 'defines': ['ENABLE_AUTOFILL_DIALOG=1'],
2952 ['enable_prod_wallet_service==1', {
2953 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'],
2955 ['enable_save_wallet_cards_locally==1', {
2956 'defines': ['ENABLE_SAVE_WALLET_CARDS_LOCALLY=1'],
2958 ['enable_background==1', {
2959 'defines': ['ENABLE_BACKGROUND=1'],
2961 ['enable_google_now==1', {
2962 'defines': ['ENABLE_GOOGLE_NOW=1'],
2964 ['cld_version!=0', {
2965 'defines': ['CLD_VERSION=<(cld_version)'],
2967 ['enable_basic_printing==1 or enable_print_preview==1', {
2968 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
2969 'defines': ['ENABLE_PRINTING=1'],
2971 ['enable_basic_printing==1', {
2972 # Enable basic printing support and UI.
2973 'defines': ['ENABLE_BASIC_PRINTING=1'],
2975 ['enable_print_preview==1', {
2976 # Enable printing with print preview.
2977 # Can be defined without ENABLE_BASIC_PRINTING.
2978 'defines': ['ENABLE_PRINT_PREVIEW=1'],
2980 ['enable_spellcheck==1', {
2981 'defines': ['ENABLE_SPELLCHECK=1'],
2983 ['enable_captive_portal_detection==1', {
2984 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
2986 ['enable_app_list==1', {
2987 'defines': ['ENABLE_APP_LIST=1'],
2989 ['enable_settings_app==1', {
2990 'defines': ['ENABLE_SETTINGS_APP=1'],
2992 ['disable_file_support==1', {
2993 'defines': ['DISABLE_FILE_SUPPORT=1'],
2995 ['disable_ftp_support==1', {
2996 'defines': ['DISABLE_FTP_SUPPORT=1'],
2998 ['enable_supervised_users==1', {
2999 'defines': ['ENABLE_SUPERVISED_USERS=1'],
3001 ['spdy_proxy_auth_property != ""', {
3002 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'],
3004 ['spdy_proxy_auth_value != ""', {
3005 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'],
3007 ['enable_mdns==1', {
3008 'defines': ['ENABLE_MDNS=1'],
3010 ['enable_service_discovery==1', {
3011 'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
3013 ['enable_wifi_bootstrapping==1', {
3014 'defines' : [ 'ENABLE_WIFI_BOOTSTRAPPING=1' ],
3016 ['enable_hangout_services_extension==1', {
3017 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
3019 ['enable_ipc_fuzzer==1', {
3020 'defines': ['ENABLE_IPC_FUZZER=1'],
3023 'defines': ['VIDEO_HOLE=1'],
3025 ['v8_use_external_startup_data==1', {
3026 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
3028 ], # conditions for 'target_defaults'
3029 'target_conditions': [
3030 ['<(use_libpci)==1', {
3031 'defines': ['USE_LIBPCI=1'],
3033 ['<(use_openssl)==1', {
3034 'defines': ['USE_OPENSSL=1'],
3036 ['<(use_openssl_certs)==1', {
3037 'defines': ['USE_OPENSSL_CERTS=1'],
3039 ['>(nacl_untrusted_build)==1', {
3042 'USE_OPENSSL_CERTS=1',
3045 ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
3046 'defines': ['USE_GLIB=1'],
3048 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
3049 'defines': ['USE_NSS=1'],
3051 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
3052 'defines': ['OS_CHROMEOS=1'],
3054 ['enable_wexit_time_destructors==1 and OS!="win"', {
3055 # TODO: Enable on Windows too, http://crbug.com/404525
3056 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
3058 ['chromium_code==0', {
3060 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3061 # We don't want to get warnings from third-party code,
3062 # so remove any existing warning-enabling flags like -Wall.
3068 # Don't warn about hash_map in third-party code.
3072 # Don't warn about printf format problems.
3073 # This is off by default in gcc but on in Ubuntu's gcc(!).
3077 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3081 # TODO: Fix all warnings on chromeos too.
3082 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
3087 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3089 # Don't warn about ignoring the return value from e.g. close().
3090 # This is off by default in some gccs but on by default in others.
3091 # BSD systems do not support this option, since they are usually
3092 # using gcc 4.2.1, which does not have this flag yet.
3093 '-Wno-unused-result',
3098 '_CRT_SECURE_NO_DEPRECATE',
3099 '_CRT_NONSTDC_NO_WARNINGS',
3100 '_CRT_NONSTDC_NO_DEPRECATE',
3101 '_SCL_SECURE_NO_DEPRECATE',
3103 'msvs_disabled_warnings': [
3104 # These are variable shadowing warnings that are new in VS2015.
3105 # We should probably work through these at some point for
3106 # non-chromium code, but for now, focus on chromium_code==1 code.
3107 4456, 4457, 4458, 4459,
3112 'VCCLCompilerTool': {
3113 'WarningLevel': '3',
3114 'WarnAsError': 'true',
3115 'Detect64BitPortabilityProblems': 'false',
3119 ['buildtype=="Official"', {
3121 'VCCLCompilerTool': { 'WarnAsError': 'false' },
3124 [ 'component=="shared_library"', {
3125 # TODO(darin): Unfortunately, some third_party code depends on base.
3126 'msvs_disabled_warnings': [
3127 4251, # class 'std::xx' needs to have dll-interface.
3133 [ 'OS=="mac" or OS=="ios"', {
3135 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
3138 ['buildtype=="Official"', {
3140 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3147 # TODO(ios): Fix remaining warnings in third-party code, then
3148 # remove this; the Mac cleanup didn't get everything that's
3149 # flagged in an iOS build.
3150 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
3151 'RUN_CLANG_STATIC_ANALYZER': 'NO',
3152 # Several internal ios directories generate numerous warnings for
3153 # -Wobjc-missing-property-synthesis.
3154 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
3160 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
3161 'filename_rules.gypi',
3163 # In Chromium code, we define __STDC_foo_MACROS in order to get the
3164 # C99 macros on Mac and Linux.
3166 '__STDC_CONSTANT_MACROS',
3167 '__STDC_FORMAT_MACROS',
3171 # turn on warnings for signed/unsigned mismatch on chromium code.
3173 'VCCLCompilerTool': {
3174 'AdditionalOptions': ['/we4389'],
3178 ['OS=="win" and component=="shared_library"', {
3179 'msvs_disabled_warnings': [
3180 4251, # class 'std::xx' needs to have dll-interface.
3185 ], # target_conditions for 'target_defaults'
3186 'default_configuration': 'Debug',
3188 # VCLinkerTool LinkIncremental values below:
3190 # 1 == /INCREMENTAL:NO
3192 # Debug links incremental, Release does not.
3194 # Abstract base configurations to cover common attributes.
3198 'msvs_configuration_attributes': {
3199 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
3200 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
3201 'CharacterSet': '1',
3203 # Add the default import libs.
3206 'AdditionalDependencies': [
3223 'AdditionalOptions': [
3224 # Suggested by Microsoft Devrel to avoid
3225 # LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
3226 # which started happening more regularly after VS2013 Update 4.
3227 # Needs to be a bit lower for VS2015, or else errors out.
3228 '/maxilksize:0x7ff00000',
3237 'MinimumRequiredVersion': '5.01', # XP.
3238 'TargetMachine': '1',
3240 'VCLibrarianTool': {
3241 'TargetMachine': '1',
3244 'msvs_configuration_platform': 'Win32',
3248 'msvs_configuration_platform': 'x64',
3251 # Make sure to understand http://crbug.com/361720 if you want to
3253 'MinimumRequiredVersion': '5.02', # Server 2003.
3254 'TargetMachine': '17', # x86 - 64
3255 'AdditionalLibraryDirectories!':
3256 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3257 'AdditionalLibraryDirectories':
3258 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3259 # Doesn't exist x64 SDK. Should use oleaut32 in any case.
3260 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
3262 'VCLibrarianTool': {
3263 'AdditionalLibraryDirectories!':
3264 ['<(windows_sdk_path)/Lib/win8/um/x86'],
3265 'AdditionalLibraryDirectories':
3266 ['<(windows_sdk_path)/Lib/win8/um/x64'],
3267 'TargetMachine': '17', # x64
3274 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3275 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3278 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
3280 '<@(debug_extra_cflags)',
3284 'VCCLCompilerTool': {
3285 'Optimization': '<(win_debug_Optimization)',
3286 'PreprocessorDefinitions': ['_DEBUG'],
3287 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
3288 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
3290 # According to MSVS, InlineFunctionExpansion=0 means
3291 # "default inlining", not "/Ob0".
3292 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3293 ['win_debug_InlineFunctionExpansion==0', {
3294 'AdditionalOptions': ['/Ob0'],
3296 ['win_debug_InlineFunctionExpansion!=""', {
3297 'InlineFunctionExpansion':
3298 '<(win_debug_InlineFunctionExpansion)',
3300 ['win_debug_disable_iterator_debugging==1', {
3301 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
3304 # if win_debug_OmitFramePointers is blank, leave as default
3305 ['win_debug_OmitFramePointers==1', {
3306 'OmitFramePointers': 'true',
3308 ['win_debug_OmitFramePointers==0', {
3309 'OmitFramePointers': 'false',
3310 # The above is not sufficient (http://crbug.com/106711): it
3311 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3312 # perform FPO regardless, so we must explicitly disable.
3313 # We still want the false setting above to avoid having
3314 # "/Oy /Oy-" and warnings about overriding.
3315 'AdditionalOptions': ['/Oy-'],
3318 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
3321 'LinkIncremental': '<(msvs_debug_link_incremental)',
3322 # ASLR makes debugging with windbg difficult because Chrome.exe and
3323 # Chrome.dll share the same base name. As result, windbg will
3324 # name the Chrome.dll module like chrome_<base address>, where
3325 # <base address> typically changes with each launch. This in turn
3326 # means that breakpoints in Chrome.dll don't stick from one launch
3327 # to the next. For this reason, we turn ASLR off in debug builds.
3328 # Note that this is a three-way bool, where 0 means to pick up
3329 # the default setting, 1 is off and 2 is on.
3330 'RandomizedBaseAddress': 1,
3332 'VCResourceCompilerTool': {
3333 'PreprocessorDefinitions': ['_DEBUG'],
3337 ['OS=="linux" or OS=="android"', {
3338 'target_conditions': [
3339 ['_toolset=="target"', {
3341 '<@(debug_extra_cflags)',
3346 ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
3347 # Enable libstdc++ debugging facilities to help catch problems
3348 # early, see http://crbug.com/65151 .
3349 # TODO(phajdan.jr): Should we enable this for all of POSIX?
3350 'defines': ['_GLIBCXX_DEBUG=1',],
3352 ['release_valgrind_build==0', {
3355 '-fstack-protector-all', # Implies -fstack-protector
3361 # Allow comparing the address of references and 'this' against 0
3362 # in debug builds. Technically, these can never be null in
3363 # well-defined C/C++ and Clang can optimize such checks away in
3364 # release builds, but they may be used in asserts in debug builds.
3365 '-Wno-undefined-bool-conversion',
3366 '-Wno-tautological-undefined-compare',
3370 '-Wno-undefined-bool-conversion',
3371 '-Wno-tautological-undefined-compare',
3375 'VCCLCompilerTool': {
3376 'AdditionalOptions': [
3377 '-Wno-undefined-bool-conversion',
3378 '-Wno-tautological-undefined-compare',
3391 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
3392 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
3393 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
3396 'VCCLCompilerTool': {
3397 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
3399 # In official builds, each target will self-select
3400 # an optimization level.
3401 ['buildtype!="Official"', {
3402 'Optimization': '<(win_release_Optimization)',
3405 # According to MSVS, InlineFunctionExpansion=0 means
3406 # "default inlining", not "/Ob0".
3407 # Thus, we have to handle InlineFunctionExpansion==0 separately.
3408 ['win_release_InlineFunctionExpansion==0', {
3409 'AdditionalOptions': ['/Ob0'],
3411 ['win_release_InlineFunctionExpansion!=""', {
3412 'InlineFunctionExpansion':
3413 '<(win_release_InlineFunctionExpansion)',
3416 # if win_release_OmitFramePointers is blank, leave as default
3417 ['win_release_OmitFramePointers==1', {
3418 'OmitFramePointers': 'true',
3420 ['win_release_OmitFramePointers==0', {
3421 'OmitFramePointers': 'false',
3422 # The above is not sufficient (http://crbug.com/106711): it
3423 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
3424 # perform FPO regardless, so we must explicitly disable.
3425 # We still want the false setting above to avoid having
3426 # "/Oy /Oy-" and warnings about overriding.
3427 'AdditionalOptions': ['/Oy-'],
3430 # Put data in separate COMDATs. This allows the linker
3431 # to put bit-identical constants at the same address even if
3432 # they're unrelated constants, which saves binary size.
3433 # This optimization can't be used when ASan is enabled because
3434 # it is not compatible with the ASan ODR checker.
3435 'AdditionalOptions': ['/Gw'],
3438 'AdditionalOptions': [
3439 '/d2Zi+', # Improve debugging of Release builds.
3440 '/Zc:inline', # Remove unreferenced COMDAT (faster links).
3441 '<@(win_release_extra_cflags)',
3445 # LinkIncremental is a tri-state boolean, where 0 means default
3446 # (i.e., inherit from parent solution), 1 means false, and
3448 'LinkIncremental': '1',
3449 # This corresponds to the /PROFILE flag which ensures the PDB
3450 # file contains FIXUP information (growing the PDB file by about
3451 # 5%) but does not otherwise alter the output binary. This
3452 # information is used by the Syzygy optimization tool when
3453 # decomposing the release image.
3458 ['msvs_use_common_release', {
3459 'includes': ['release.gypi'],
3461 ['release_valgrind_build==0 and tsan==0', {
3464 'DYNAMIC_ANNOTATIONS_ENABLED=0',
3468 'MEMORY_TOOL_REPLACES_ALLOCATOR',
3469 'MEMORY_SANITIZER_INITIAL_SIZE',
3470 'DYNAMIC_ANNOTATIONS_ENABLED=1',
3471 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
3475 'defines': ['NO_TCMALLOC'],
3477 # _FORTIFY_SOURCE isn't really supported by Clang now, see
3478 # http://llvm.org/bugs/show_bug.cgi?id=16821.
3479 # It seems to work fine with Ubuntu 12 headers though, so use it
3480 # in official builds.
3481 ['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")', {
3482 'target_conditions': [
3483 ['chromium_code==1', {
3484 # Non-chromium code is not guaranteed to compile cleanly
3485 # with _FORTIFY_SOURCE. Also, fortified build may fail
3486 # when optimizations are disabled, so only do that for Release
3489 '_FORTIFY_SOURCE=2',
3494 ['OS=="linux" or OS=="android"', {
3495 'target_conditions': [
3496 ['_toolset=="target"', {
3498 '<@(release_extra_cflags)',
3501 ['enable_resource_whitelist_generation==1', {
3503 '-Wunknown-pragmas -Wno-error=unknown-pragmas',
3512 'NS_BLOCK_ASSERTIONS=1',
3518 # Concrete configurations
3521 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
3524 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3529 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
3530 'target_conditions': [
3531 [ '_type=="executable"', {
3532 # To get a real .dSYM bundle produced by dsymutil, set the
3533 # debug information format to dwarf-with-dsym. Since
3534 # strip_from_xcode will not be used, set Xcode to do the
3535 # stripping as well.
3537 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
3538 'DEPLOYMENT_POSTPROCESSING': 'YES',
3539 'STRIP_INSTALLED_PRODUCT': 'YES',
3546 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
3548 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
3551 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
3559 'target_defaults': {
3564 # TODO(glider): enable the default options on other systems.
3566 ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
3568 '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
3574 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3575 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3576 'target_defaults': {
3578 '-Wl,--fatal-warnings',
3582 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3583 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
3584 'target_defaults': {
3590 ['os_posix==1 and chromeos==0', {
3591 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3592 # and we want to avoid overriding this, so stack-protector is only
3593 # enabled when not building on Chrome OS.
3594 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
3596 'target_defaults': {
3598 '-fstack-protector',
3599 '--param=ssp-buffer-size=4',
3603 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3604 'target_defaults': {
3605 # Enable -Werror by default, but put it in a variable so it can
3606 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3608 'werror%': '-Werror',
3609 'libraries_for_target%': '',
3612 '_FILE_OFFSET_BITS=64',
3615 '<(werror)', # See note above about the werror variable.
3617 '-fno-strict-aliasing', # See http://crbug.com/32204
3619 # Don't warn about unused function params. We use those everywhere.
3620 '-Wno-unused-parameter',
3621 # Don't warn about the "struct foo f = {0};" initialization pattern.
3622 '-Wno-missing-field-initializers',
3623 # Don't export any symbols (for example, to plugins we dlopen()).
3624 # Note: this is *required* to make some plugins work.
3625 '-fvisibility=hidden',
3631 '-fno-threadsafe-statics',
3632 # Make inline functions have hidden visiblity by default.
3633 # Surprisingly, not covered by -fvisibility=hidden.
3634 '-fvisibility-inlines-hidden',
3635 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3636 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3640 '-pthread', '-Wl,-z,noexecstack',
3643 '<(libraries_for_target)',
3648 'debug_optimize%': '0',
3654 '-O>(debug_optimize)',
3659 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3660 # TODO(jdduke) Re-enable on mips after resolving linking
3661 # issues with libc++ (crbug.com/456380).
3663 # Warn in case of text relocations.
3664 '-Wl,--warn-shared-textrel',
3667 ['OS=="android" and android_full_debug==0', {
3668 # Some configurations are copied from Release_Base to reduce
3671 'debug_optimize%': 's',
3675 '-ffunction-sections',
3682 ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
3683 # We don't omit frame pointers on arm64 since they are required
3684 # to correctly unwind stackframes which contain system library
3685 # function frames (crbug.com/391706).
3687 '-fomit-frame-pointer',
3690 ['OS=="linux" and target_arch=="ia32"', {
3692 '-Wl,--no-as-needed',
3695 ['debug_unwind_tables==1', {
3696 'cflags': ['-funwind-tables'],
3698 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3699 'defines': ['NO_UNWIND_TABLES'],
3701 # TODO(mostynb): shuffle clang/gcc_version/binutils_version
3702 # definitions in to the right scope to use them when setting
3703 # linux_use_debug_fission, so it can be used here alone.
3704 ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and (clang==1 or gcc_version>=48) and binutils_version>=223', {
3705 'cflags': ['-gsplit-dwarf'],
3711 'release_optimize%': '2',
3712 # Binaries become big and gold is unable to perform GC
3713 # and remove unused sections for some of test targets
3714 # on 32 bit platform.
3715 # (This is currently observed only in chromeos valgrind bots)
3716 # The following flag is to disable --gc-sections linker
3717 # option for these bots.
3718 'no_gc_sections%': 0,
3720 # TODO(bradnelson): reexamine how this is done if we change the
3721 # expansion of configurations
3722 'release_valgrind_build%': 0,
3725 '-O<(release_optimize)',
3726 # Don't emit the GCC version ident directives, they just end up
3727 # in the .comment section taking up binary size.
3729 # Put data and code in their own sections, so that unused symbols
3730 # can be removed at link time with --gc-sections.
3732 '-ffunction-sections',
3735 # Specifically tell the linker to perform optimizations.
3736 # See http://lwn.net/Articles/192624/ .
3741 ['no_gc_sections==0', {
3743 '-Wl,--gc-sections',
3746 ['OS=="android" and target_arch!="arm64"', {
3747 # We don't omit frame pointers on arm64 since they are required
3748 # to correctly unwind stackframes which contain system library
3749 # function frames (crbug.com/391706).
3751 '-fomit-frame-pointer',
3754 ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
3755 # TODO(jdduke) Re-enable on mips after resolving linking
3756 # issues with libc++ (crbug.com/456380).
3758 # Warn in case of text relocations.
3759 '-Wl,--warn-shared-textrel',
3764 'release_optimize%': 's',
3769 '-fno-omit-frame-pointer',
3773 ['profiling_full_stack_frames==1', {
3776 '-fno-optimize-sibling-calls',
3781 ['release_unwind_tables==1', {
3782 'cflags': ['-funwind-tables'],
3784 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
3785 'defines': ['NO_UNWIND_TABLES'],
3791 ['target_arch=="ia32"', {
3792 'target_conditions': [
3793 ['_toolset=="target"', {
3795 # Needed so that libs with .s files (e.g. libicudata.a)
3796 # are compatible with the general 32-bit-ness.
3799 # All floating-point computations on x87 happens in 80-bit
3800 # precision. Because the C and C++ language standards allow
3801 # the compiler to keep the floating-point values in higher
3802 # precision than what's specified in the source and doing so
3803 # is more efficient than constantly rounding up to 64-bit or
3804 # 32-bit precision as specified in the source, the compiler,
3805 # especially in the optimized mode, tries very hard to keep
3806 # values in x87 floating-point stack (in 80-bit precision)
3807 # as long as possible. This has important side effects, that
3808 # the real value used in computation may change depending on
3809 # how the compiler did the optimization - that is, the value
3810 # kept in 80-bit is different than the value rounded down to
3811 # 64-bit or 32-bit. There are possible compiler options to
3812 # make this behavior consistent (e.g. -ffloat-store would keep
3813 # all floating-values in the memory, thus force them to be
3814 # rounded to its original precision) but they have significant
3815 # runtime performance penalty.
3817 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
3818 # which keep floating-point values in SSE registers in its
3819 # native precision (32-bit for single precision, and 64-bit
3820 # for double precision values). This means the floating-point
3821 # value used during computation does not change depending on
3822 # how the compiler optimized the code, since the value is
3823 # always kept in its specified precision.
3825 # Refer to http://crbug.com/348761 for rationale behind SSE2
3826 # being a minimum requirement for 32-bit Linux builds and
3827 # http://crbug.com/313032 for an example where this has "bit"
3832 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
3839 # Use gold linker for Android ia32 target.
3845 # Install packages have started cropping up with
3846 # different headers between the 32-bit and 64-bit
3847 # versions, so we have to shadow those differences off
3848 # and make sure a 32-bit-on-64-bit build picks up the
3850 # For android build, use NDK headers instead of host headers
3851 ['host_arch!="ia32" and OS!="android"', {
3860 ['target_arch=="x64"', {
3861 'target_conditions': [
3862 ['_toolset=="target"', {
3864 # Use gold linker for Android x64 target.
3881 ['target_arch=="arm"', {
3882 'target_conditions': [
3883 ['_toolset=="target"', {
3887 # The codesourcery arm-2009q3 toolchain warns at that the ABI
3888 # has changed whenever it encounters a varargs function. This
3889 # silences those warnings, as they are not helpful and
3890 # clutter legitimate warnings.
3894 ['clang==1 and arm_arch!="" and OS!="android"', {
3896 '-target arm-linux-gnueabihf',
3899 '-target arm-linux-gnueabihf',
3904 '-march=<(arm_arch)',
3907 ['use_lto==1 or use_lto_o2==1', {
3909 '-march=<(arm_arch)',
3914 ['clang==1 and OS!="android"', {
3916 # We need to disable clang's builtin assembler as it can't
3917 # handle several asm files, crbug.com/124610
3918 '-no-integrated-as',
3923 '-mtune=<(arm_tune)',
3926 ['use_lto==1 or use_lto_o2==1', {
3928 '-mtune=<(arm_tune)',
3938 ['use_lto==1 or use_lto_o2==1', {
3945 ['arm_float_abi!=""', {
3947 '-mfloat-abi=<(arm_float_abi)',
3950 ['use_lto==1 or use_lto_o2==1', {
3952 '-mfloat-abi=<(arm_float_abi)',
3962 ['use_lto==1 or use_lto_o2==1', {
3970 # Most of the following flags are derived from what Android
3971 # uses by default when building for arm, reference for which
3972 # can be found in the following file in the Android NDK:
3973 # toolchains/arm-linux-androideabi-4.9/setup.mk
3975 # The tree-sra optimization (scalar replacement for
3976 # aggregates enabling subsequent optimizations) leads to
3977 # invalid code generation when using the Android NDK's
3978 # compiler (r5-r7). This can be verified using
3979 # webkit_unit_tests' WTF.Checked_int8_t test.
3981 # The following option is disabled to improve binary
3982 # size and performance in gcc 4.9.
3983 '-fno-caller-saves',
3986 # Android now supports .relro sections properly.
3987 # NOTE: While these flags enable the generation of .relro
3988 # sections, the generated libraries can still be loaded on
3989 # older Android platform versions.
3996 ['gcc_version==48 and clang==0', {
3998 # The following 5 options are disabled to save on
3999 # binary size in GCC 4.8.
4000 '-fno-partial-inlining',
4001 '-fno-early-inlining',
4002 '-fno-tree-copy-prop',
4003 '-fno-tree-loop-optimize',
4004 '-fno-move-loop-invariants',
4008 'cflags': [ '-mthumb-interwork' ],
4012 # Thumb code with frame pointer makes chrome crash
4015 '-mapcs-frame', # Required by -fno-omit-frame-pointer.
4016 # The perf report sometimes incorrectly attributes
4017 # code from tail calls.
4018 '-fno-optimize-sibling-calls',
4021 '-fomit-frame-pointer',
4026 # Clang does not support the following options.
4028 '-mthumb-interwork',
4029 '-finline-limit=64',
4031 '-fno-caller-saves',
4035 # TODO(hans) Enable integrated-as (crbug.com/124610).
4036 '-no-integrated-as',
4037 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4040 # Let clang find the ld.gold in the NDK.
4041 '--gcc-toolchain=<(android_toolchain)/..',
4046 '-marm', # Required for frame pointer based stack traces.
4053 # We set arm_arch to "" so that -march compiler option
4054 # is not set. Otherwise a gcc bug that would complain
4055 # about it conflicting with '-mcpu=cortex-a9'. The flag
4056 # '-march=armv7-a' is actually redundant anyway because
4057 # it is enabled by default when we built the toolchain.
4058 # And using '-mcpu=cortex-a9' should be sufficient.
4061 # Breakpad requires symbols with debugging information
4065 # We want to statically link libstdc++/libgcc_s.
4066 '-static-libstdc++',
4070 # Some components in Chromium (e.g. v8, skia, ffmpeg)
4071 # define their own cflags for arm builds that could
4072 # conflict with the flags we set here (e.g.
4073 # '-mcpu=cortex-a9'). Remove these flags explicitly.
4082 ['target_arch=="arm64"', {
4083 'target_conditions': [
4084 ['_toolset=="target"', {
4088 '-fstack-protector', # stack protector is always enabled on arm64.
4091 # TODO: Remove webview test once webview fully compiles from
4092 # Chromium. crbug.com/440793
4093 ['OS=="android" and android_webview_build==0', {
4102 ['target_arch=="mipsel"', {
4103 'target_conditions': [
4104 ['_toolset=="target"', {
4106 ['android_webview_build==0', {
4108 ['mips_arch_variant=="r6"', {
4111 'cflags': [ '-target mipsel-linux-gnu', '-march=mips32r6', ],
4112 'ldflags': [ '-target mipsel-linux-gnu', ],
4114 'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
4116 ['clang==0 and OS=="android"', {
4117 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
4121 ['mips_arch_variant=="r2"', {
4123 ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
4124 'cflags': ['-m<(mips_fpu_mode)'],
4129 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
4130 'ldflags': [ '-target mipsel-linux-android', ],
4134 'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
4138 ['mips_arch_variant=="r1"', {
4143 'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
4144 'ldflags': [ '-target mipsel-linux-android', ],
4148 'cflags': ['-mips32', '-Wa,-mips32', ],
4154 # Clang does not support the following options.
4155 '-finline-limit=64',
4158 # TODO(gordanac) Enable integrated-as.
4159 '-no-integrated-as',
4160 '-B<(android_toolchain)', # Else /usr/bin/as gets picked up.
4163 # Let clang find the ld in the NDK.
4164 '--gcc-toolchain=<(android_toolchain)/..',
4167 ['mips_dsp_rev==1', {
4168 'cflags': ['-mdsp'],
4170 ['mips_dsp_rev==2', {
4171 'cflags': ['-mdspr2'],
4175 '-m<(mips_float_abi)-float'
4180 '-Wl,--no-keep-memory'
4183 '-Wno-uninitialized',
4188 ['target_arch=="mips64el"', {
4189 'target_conditions': [
4190 ['_toolset=="target"', {
4192 ['android_webview_build==0', {
4194 ['mips_arch_variant=="r6"', {
4195 'cflags': ['-mips64r6', '-Wa,-mips64r6'],
4196 'ldflags': ['-mips64r6'],
4198 ['mips_arch_variant=="r2"', {
4199 'cflags': ['-mips64r2', '-Wa,-mips64r2'],
4200 'ldflags': ['-mips64r2'],
4206 '-Wno-uninitialized',
4220 'target_conditions': [
4221 ['_toolset=="target"', {
4223 '--sysroot=<(sysroot)',
4226 '--sysroot=<(sysroot)',
4227 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
4233 # TODO(thakis): Remove, http://crbug.com/263960
4234 '-Wno-reserved-user-defined-literal',
4237 # gnu++11 instead of c++11 is needed because some code uses
4238 # typeof() (a GNU extension).
4239 # TODO(thakis): Eventually switch this to c++11 instead,
4240 # http://crbug.com/427584
4244 ['clang==0 and host_clang==1', {
4245 'target_conditions': [
4246 ['_toolset=="host"', {
4247 'cflags_cc': [ '-std=gnu++11', ],
4251 ['clang==1 and clang_use_chrome_plugins==1', {
4253 '<@(clang_chrome_plugins_flags)',
4256 ['clang==1 and clang_load!=""', {
4258 '-Xclang', '-load', '-Xclang', '<(clang_load)',
4261 ['clang==1 and clang_add_plugin!=""', {
4263 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
4266 ['clang==1 and target_arch=="ia32"', {
4268 # Else building libyuv gives clang's register allocator issues,
4269 # see llvm.org/PR15798 / crbug.com/233709
4270 '-momit-leaf-frame-pointer',
4271 # Align the stack on 16-byte boundaries, http://crbug.com/418554.
4272 '-mstack-alignment=16',
4276 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4278 # See http://crbug.com/110262
4279 '-fcolor-diagnostics',
4282 # Common options for AddressSanitizer, LeakSanitizer,
4283 # ThreadSanitizer and MemorySanitizer.
4284 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==1', {
4285 'target_conditions': [
4286 ['_toolset=="target"', {
4288 '-fno-omit-frame-pointer',
4289 '-gline-tables-only',
4292 '-fomit-frame-pointer',
4297 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
4298 'target_conditions': [
4299 ['_toolset=="target"', {
4301 # Functions interposed by the sanitizers can make ld think
4302 # that some libraries aren't needed when they actually are,
4303 # http://crbug.com/234010. As workaround, disable --as-needed.
4307 'MEMORY_TOOL_REPLACES_ALLOCATOR',
4308 'MEMORY_SANITIZER_INITIAL_SIZE',
4314 'target_conditions': [
4315 ['_toolset=="target"', {
4317 '-fsanitize=address',
4318 # TODO(earthdok): Re-enable. http://crbug.com/427202
4319 #'-fsanitize-blacklist=<(asan_blacklist)',
4322 '-fsanitize=address',
4329 '-mllvm -asan-globals=0', # http://crbug.com/352073
4335 'target_conditions': [
4336 ['_toolset=="target"', {
4338 '-fsanitize=undefined',
4339 '-fsanitize-blacklist=<(ubsan_blacklist)',
4340 # Employ the experimental PBQP register allocator to avoid
4341 # slow compilation on files with too many basic blocks.
4342 # See http://crbug.com/426271.
4343 '-mllvm -regalloc=pbqp',
4344 # Speculatively use coalescing to slightly improve the code
4345 # generated by PBQP regallocator. May increase compile time.
4346 '-mllvm -pbqp-coalescing',
4355 '-fsanitize=undefined',
4358 'UNDEFINED_SANITIZER',
4364 'target_conditions': [
4365 ['_toolset=="target"', {
4368 '-fsanitize-blacklist=<(ubsan_blacklist)',
4380 'UNDEFINED_SANITIZER',
4385 ['asan_coverage!=0 and sanitizer_coverage==0', {
4386 'target_conditions': [
4387 ['_toolset=="target"', {
4389 '-fsanitize-coverage=<(asan_coverage)',
4392 'SANITIZER_COVERAGE',
4397 ['sanitizer_coverage!=0', {
4398 'target_conditions': [
4399 ['_toolset=="target"', {
4401 '-fsanitize-coverage=<(sanitizer_coverage)',
4404 'SANITIZER_COVERAGE',
4409 ['asan_field_padding!=0', {
4410 'target_conditions': [
4411 ['_toolset=="target"', {
4413 '-fsanitize-address-field-padding=<(asan_field_padding)',
4419 'target_conditions': [
4420 ['_toolset=="target"', {
4429 'WTF_USE_LEAK_SANITIZER=1',
4435 'target_conditions': [
4436 ['_toolset=="target"', {
4438 '-fsanitize=thread',
4439 '-fsanitize-blacklist=<(tsan_blacklist)',
4442 '-fsanitize=thread',
4446 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
4447 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
4453 'target_conditions': [
4454 ['_toolset=="target"', {
4456 '-fsanitize=memory',
4457 '-fsanitize-memory-track-origins=<(msan_track_origins)',
4458 '-fsanitize-blacklist=<(msan_blacklist)',
4461 '-fsanitize=memory',
4469 ['use_instrumented_libraries==1', {
4471 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
4474 ['use_prebuilt_instrumented_libraries==1', {
4476 '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
4479 ['use_custom_libcxx==1', {
4481 '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
4484 ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', {
4485 'target_conditions' : [
4486 # crazy_linker has an upstream gyp file we can't edit, and we
4487 # don't want to instrument it.
4488 ['_toolset=="target" and _target_name!="crazy_linker"', {
4490 '-finstrument-functions',
4491 # Allow mmx intrinsics to inline, so that the
4492 #0 compiler can expand the intrinsics.
4493 '-finstrument-functions-exclude-file-list=mmintrin.h',
4496 ['_toolset=="target" and OS=="android"', {
4498 # Avoids errors with current NDK:
4499 # "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"
4500 '-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.h',
4505 ['linux_dump_symbols==1', {
4508 ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
4509 'target_conditions': [
4510 ['_toolset=="target"', {
4512 # Attempt to use less memory to prevent the linker from
4513 # running out of address space. Considering installing a
4514 # 64-bit kernel and switching to a 64-bit linker.
4515 '-Wl,--no-keep-memory',
4522 ['use_allocator!="tcmalloc"', {
4523 'defines': ['NO_TCMALLOC'],
4525 ['linux_use_gold_flags==1', {
4526 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
4528 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
4529 'ldflags': [ '-fuse-ld=gold', ],
4531 'target_conditions': [
4532 ['_toolset=="target"', {
4534 # Experimentation found that using four linking threads
4535 # saved ~20% of link time.
4536 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
4537 # Only apply this to the target linker, since the host
4538 # linker might not be gold, but isn't used much anyway.
4539 # TODO(raymes): Disable threading because gold is frequently
4540 # crashing on the bots: crbug.com/161942.
4542 # '-Wl,--thread-count=4',
4545 # TODO(thestig): Enable this for disabled cases.
4546 [ 'buildtype!="Official" and chromeos==0 and release_valgrind_build==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_vptr==0', {
4548 '-Wl,--detect-odr-violations',
4555 ['release_valgrind_build==0 and order_profiling==0', {
4556 'target_conditions': [
4557 ['_toolset=="target"', {
4559 '-Wl,--icf=<(gold_icf_level)',
4566 ['linux_use_bundled_binutils==1', {
4568 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4571 ['linux_use_bundled_gold==1', {
4572 # Put our binutils, which contains gold in the search path. We pass
4573 # the path to gold to the compiler. gyp leaves unspecified what the
4574 # cwd is when running the compiler, so the normal gyp path-munging
4575 # fails us. This hack gets the right path.
4577 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
4580 # Some binutils 2.23 releases may or may not have new dtags enabled,
4581 # but they are all compatible with --disable-new-dtags,
4582 # because the new dynamic tags are not created by default.
4583 ['binutils_version>=223', {
4584 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
4585 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
4586 # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
4587 # inside this file to allow usage of --no-as-needed and removal of
4590 '-Wl,--disable-new-dtags',
4593 ['gcc_version>=47 and clang==0', {
4594 'target_conditions': [
4595 ['_toolset=="target"', {
4598 # See comment for -Wno-c++11-narrowing.
4600 # TODO(thakis): Remove, http://crbug.com/263960
4601 '-Wno-literal-suffix',
4606 ['host_gcc_version>=47 and clang==0 and host_clang==0', {
4607 'target_conditions': [
4608 ['_toolset=="host"', {
4611 # See comment for -Wno-c++11-narrowing.
4613 # TODO(thakis): Remove, http://crbug.com/263960
4614 '-Wno-literal-suffix',
4622 # FreeBSD-specific options; note that most FreeBSD options are set above,
4625 'target_defaults': {
4627 '-Wl,--no-keep-memory',
4631 # Android-specific options; note that most are set above with Linux.
4634 # This is a unique identifier for a given build. It's used for
4635 # identifying various build artifacts corresponding to a particular
4636 # build of chrome (e.g. where to find archived symbols).
4637 'chrome_build_id%': '',
4639 # Figure this out early since it needs symbols from libgcc.a, so it
4640 # has to be before that in the set of libraries.
4641 ['component=="shared_library"', {
4642 'android_stlport_library': 'stlport_shared',
4644 'android_stlport_library': 'stlport_static',
4648 # Placing this variable here prevents from forking libvpx, used
4649 # by remoting. Remoting is off, so it needn't built,
4650 # so forking it's deps seems like overkill.
4651 # But this variable need defined to properly run gyp.
4652 # A proper solution is to have an OS==android conditional
4653 # in third_party/libvpx/libvpx.gyp to define it.
4654 'libvpx_path': 'lib/linux/arm',
4656 'target_defaults': {
4658 'release_extra_cflags%': '',
4660 # If we're using the components build, append "cr" to all shared
4661 # libraries to avoid naming collisions with android system library
4662 # versions with the same name (e.g. skia, icu).
4663 ['component=="shared_library"', {
4664 'android_product_extension': 'cr.so',
4666 'android_product_extension': 'so',
4670 'target_conditions': [
4671 ['_type=="shared_library"', {
4672 'product_extension': '<(android_product_extension)',
4675 # Settings for building device targets using Android's toolchain.
4676 # These are based on the setup.mk file from the Android NDK.
4678 # The NDK Android executable link step looks as follows:
4680 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
4681 # $(PRIVATE_OBJECTS) <-- The .o that we built
4682 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4683 # $(TARGET_LIBGCC) <-- libgcc.a
4684 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4685 # $(PRIVATE_LDLIBS) <-- System .so
4686 # $(TARGET_CRTEND_O) <-- crtend.o
4688 # For now the above are approximated for executables by adding
4689 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
4692 # The NDK Android shared library link step looks as follows:
4694 # $(PRIVATE_OBJECTS) <-- The .o that we built
4695 # -l,--whole-archive
4696 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
4697 # -l,--no-whole-archive
4698 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
4699 # $(TARGET_LIBGCC) <-- libgcc.a
4700 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
4701 # $(PRIVATE_LDLIBS) <-- System .so
4703 # For now, assume that whole static libraries are not needed.
4705 # For both executables and shared libraries, add the proper
4706 # libgcc.a to the start of libraries which puts it in the
4707 # proper spot after .o and .a files get linked in.
4709 # TODO: The proper thing to do longer-tem would be proper gyp
4710 # support for a custom link command line.
4711 ['_toolset=="target"', {
4713 '-pthread', # Not supported by Android toolchain.
4716 '-ffunction-sections',
4719 '-fstack-protector',
4721 '-finline-limit=64',
4722 '-Wa,--noexecstack',
4723 '<@(release_extra_cflags)',
4727 '__GNU_SOURCE=1', # Necessary for clone()
4729 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4730 'CHROME_BUILD_ID="<(chrome_build_id)"',
4733 '-pthread', # Not supported by Android toolchain.
4736 '-Wl,--no-undefined',
4739 ['component=="static_library" and android_webview_build==0', {
4740 'target_conditions': [
4741 ['use_native_jni_exports==0', {
4742 # Use a linker version script to strip JNI exports from
4743 # binaries which have not specifically asked to use them.
4745 '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
4752 # Work around incompatibilities between bionic and clang
4754 '-D__compiler_offsetof=__builtin_offsetof',
4755 '-Dnan=__builtin_nan',
4758 ['target_arch=="arm"', {
4760 '-target arm-linux-androideabi',
4763 '-target arm-linux-androideabi',
4766 ['target_arch=="ia32"', {
4768 '-target x86-linux-androideabi',
4771 '-target x86-linux-androideabi',
4774 # Place holder for x64 support, not tested.
4775 # TODO: Enable clang support for Android x64. http://crbug.com/346626
4776 ['target_arch=="x64"', {
4778 '-target x86_64-linux-androideabi',
4781 '-target x86_64-linux-androideabi',
4788 # Android build relies on -Wl,--gc-sections removing
4789 # unreachable code. ASan instrumentation for globals inhibits
4790 # this and results in a library with unresolvable relocations.
4791 # TODO(eugenis): find a way to reenable this.
4792 '-mllvm -asan-globals=0',
4795 ['android_webview_build==0', {
4797 # The NDK has these things, but doesn't define the constants
4798 # to say that it does. Define them here instead.
4802 '--sysroot=<(android_ndk_sysroot)',
4805 '--sysroot=<(android_ndk_sysroot)',
4807 # Don't allow visible symbols from libgcc or stlport to be
4809 '-Wl,--exclude-libs=libgcc.a',
4810 '-Wl,--exclude-libs=libstlport_static.a',
4811 # Don't allow visible symbols from libraries that contain
4812 # assembly code with symbols that aren't hidden properly.
4813 # http://crbug.com/448386
4814 '-Wl,--exclude-libs=libcommon_audio.a',
4815 '-Wl,--exclude-libs=libcommon_audio_neon.a',
4816 '-Wl,--exclude-libs=libcommon_audio_sse2.a',
4817 '-Wl,--exclude-libs=libiSACFix.a',
4818 '-Wl,--exclude-libs=libisac_neon.a',
4819 '-Wl,--exclude-libs=libopus.a',
4820 '-Wl,--exclude-libs=libvpx.a',
4823 '-l<(android_stlport_library)',
4824 # Manually link the libgcc.a that the cross compiler uses.
4825 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4831 ['android_webview_build==1', {
4833 # Android predefines this as 1; undefine it here so Chromium
4834 # can redefine it later to be 2 for chromium code and unset
4835 # for third party code. This works because cflags are added
4837 '-U_FORTIFY_SOURCE',
4838 # Disable any additional warnings enabled by the Android build system but which
4839 # chromium does not build cleanly with (when treating warning as errors).
4840 # Things that are part of -Wextra:
4841 '-Wno-extra', # Enabled by -Wextra, but no specific flag
4842 '-Wno-ignored-qualifiers',
4844 '-Wno-unused-but-set-variable',
4847 # Other things unrelated to -Wextra:
4848 '-Wno-non-virtual-dtor',
4855 ['android_webview_build==1', {
4856 'target_conditions': [
4857 ['chromium_code==0', {
4859 # There is a class of warning which:
4860 # 1) Android always enables and also treats as errors
4861 # 2) Chromium ignores in third party code
4862 # So we re-enable those warnings when building Android.
4864 '-Wno-format-security',
4866 '-Wno-sequence-point',
4869 '-Wno-non-virtual-dtor',
4874 ['target_arch == "arm" and order_profiling==0', {
4876 # Enable identical code folding to reduce size.
4877 '-Wl,--icf=<(gold_icf_level)',
4880 # NOTE: The stlport header include paths below are specified in
4881 # cflags rather than include_dirs because they need to come
4882 # after include_dirs. Think of them like system headers, but
4883 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4884 # toolchain (circa Gingerbread) will exhibit strange errors.
4885 # The include ordering here is important; change with caution.
4886 ['android_webview_build==0', {
4888 '-isystem<(android_stlport_include)',
4891 '-L<(android_stlport_libs_dir)',
4893 }, { # else: android_webview_build!=0
4894 'aosp_build_settings': {
4895 # Specify that we want to statically link stlport from the
4896 # NDK. This will provide all the include and library paths
4897 # automatically at build time, and link the right library.
4898 'LOCAL_NDK_STL_VARIANT': 'stlport_static',
4901 ['target_arch=="ia32"', {
4902 # The x86 toolchain currently has problems with stack-protector.
4904 '-fstack-protector',
4907 '-fno-stack-protector',
4911 'target_conditions': [
4912 ['_type=="executable"', {
4913 # Force android tools to export the "main" symbol so they can be
4914 # loaded on ICS using the run_pie wrapper. See crbug.com/373219.
4915 # TODO(primiano): remove -fvisibility and -rdynamic flags below
4916 # when ICS support will be dropped.
4919 '-fvisibility=default',
4923 '-Wl,--gc-sections',
4924 '-Wl,-z,nocopyreloc',
4927 # crtbegin_dynamic.o should be the last item in ldflags.
4928 '<(android_ndk_lib)/crtbegin_dynamic.o',
4931 # crtend_android.o needs to be the last item in libraries.
4932 # Do not add any libraries after this!
4933 '<(android_ndk_lib)/crtend_android.o',
4936 ['_type=="shared_library" or _type=="loadable_module"', {
4938 '-Wl,-shared,-Bsymbolic',
4941 ['android_webview_build==0', {
4943 # crtbegin_so.o should be the last item in ldflags.
4944 '<(android_ndk_lib)/crtbegin_so.o',
4947 # crtend_so.o needs to be the last item in libraries.
4948 # Do not add any libraries after this!
4949 '<(android_ndk_lib)/crtend_so.o',
4956 # Settings for building host targets using the system toolchain.
4957 ['_toolset=="host"', {
4959 # Due to issues in Clang build system, using ASan on 32-bit
4960 # binaries on x86_64 host is problematic.
4961 # TODO(eugenis): re-enable.
4962 '-fsanitize=address',
4965 '-fsanitize=address',
4966 '-Wl,-z,noexecstack',
4967 '-Wl,--gc-sections',
4970 '-Wl,--warn-shared-textrel',
4971 '-Wl,--fatal-warnings',
4974 # Settings for building host targets on mac.
4975 ['_toolset=="host" and host_os=="mac"', {
4985 'cflags!': ['-fvisibility=hidden'],
4986 'cflags_cc!': ['-fvisibility-inlines-hidden'],
4988 ['OS=="mac" or OS=="ios"', {
4989 'target_defaults': {
4992 'ALWAYS_SEARCH_USER_PATHS': 'NO',
4993 # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
4994 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
4995 'COPY_PHASE_STRIP': 'NO',
4996 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
4997 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
4998 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
4999 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
5000 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
5001 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
5002 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
5003 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
5004 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
5005 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
5006 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
5007 'GCC_VERSION': '4.2',
5008 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
5009 'USE_HEADERMAP': 'NO',
5014 # Don't warn about unused function parameters.
5015 '-Wno-unused-parameter',
5016 # Don't warn about the "struct foo f = {0};" initialization
5018 '-Wno-missing-field-initializers',
5021 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
5022 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
5024 # Note that the prebuilt Clang binaries should not be used for iOS
5025 # development except for ASan builds.
5027 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
5028 # Warn if automatic synthesis is triggered with
5029 # the -Wobjc-missing-property-synthesis flag.
5030 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
5031 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
5033 # This warns on selectors from Cocoa headers (-length, -set).
5034 # cfe-dev is currently discussing the merits of this warning.
5035 # TODO(thakis): Reevaluate what to do with this, based one
5036 # cfe-dev discussion.
5037 '-Wno-selector-type-mismatch',
5040 ['clang_xcode==0', {
5041 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
5042 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
5046 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
5048 '<@(clang_chrome_plugins_flags)',
5051 ['clang==1 and clang_xcode==0 and clang_load!=""', {
5053 '-Xclang', '-load', '-Xclang', '<(clang_load)',
5056 ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
5058 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
5061 ['clang==1 and "<(GENERATOR)"=="ninja"', {
5063 # See http://crbug.com/110262
5064 '-fcolor-diagnostics',
5067 ['OS=="ios" and target_subarch!="arm32" and \
5068 "<(GENERATOR)"=="xcode"', {
5070 # TODO(ios): when building Chrome for iOS on 64-bit platform
5071 # with Xcode, the -Wshorted-64-to-32 warning is automatically
5072 # enabled. This cause failures when compiling protobuf code,
5073 # so disable the warning. http://crbug.com/359107
5074 '-Wno-shorten-64-to-32',
5082 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
5088 '-fsanitize=address',
5089 '-mllvm -asan-globals=0', # http://crbug.com/352073
5090 '-gline-tables-only',
5094 ['asan_coverage!=0 and sanitizer_coverage==0', {
5095 'target_conditions': [
5096 ['_toolset=="target"', {
5098 '-fsanitize-coverage=<(asan_coverage)',
5101 'SANITIZER_COVERAGE',
5106 ['sanitizer_coverage!=0', {
5107 'target_conditions': [
5108 ['_toolset=="target"', {
5110 '-fsanitize-coverage=<(sanitizer_coverage)',
5113 'SANITIZER_COVERAGE',
5119 'target_conditions': [
5120 ['_type!="static_library"', {
5121 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
5126 '-fsanitize=address',
5130 ['mac_write_linker_maps==1', {
5133 '-Wl,-map,>(_target_name).map',
5140 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
5141 'target_conditions': [
5142 ['_type=="executable"', {
5148 # Define copy_asan_dylib_path in a variable ending in
5149 # _path so that gyp understands it's a path and
5150 # performs proper relativization during dict merging.
5151 'copy_asan_dylib_path':
5152 'mac/copy_asan_runtime_dylib.sh',
5154 'postbuild_name': 'Copy ASan runtime dylib',
5156 '<(copy_asan_dylib_path)',
5165 ], # target_conditions
5166 }, # target_defaults
5167 }], # OS=="mac" or OS=="ios"
5169 'target_defaults': {
5171 # Prevent Mac OS X AssertMacros.h from defining macros that collide
5172 # with common names, like 'check', 'require', and 'verify'.
5173 # (Included by system header. Also exists on iOS but not included.)
5174 # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
5175 '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
5178 # These should end with %, but there seems to be a bug with % in
5179 # variables that are intended to be set to different values in
5180 # different targets, like these.
5181 'mac_pie': 1, # Most executables can be position-independent.
5182 # Strip debugging symbols from the target.
5183 'mac_strip': '<(mac_strip_release)',
5187 ['mac_want_real_dsym=="default"', {
5190 'mac_real_dsym': '<(mac_want_real_dsym)'
5195 ['mac_want_real_dsym=="default"', {
5196 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
5198 'mac_real_dsym': '<(mac_want_real_dsym)'
5205 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
5206 # (Equivalent to -fPIC)
5207 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
5208 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5209 # Keep pch files below xcodebuild/.
5210 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
5212 # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
5213 # xcode_setting, but not until all downstream projects' mac bots are
5214 # using xcode >= 4.6, because that's when the default value of the
5215 # flag in the compiler switched. Pre-4.6, the value 'NO' for that
5216 # setting is a no-op as far as xcode is concerned, but the compiler
5217 # behaves differently based on whether -fno-strict-aliasing is
5219 '-fno-strict-aliasing', # See http://crbug.com/32204.
5222 'target_conditions': [
5223 ['_type=="executable"', {
5226 # Arranges for data (heap) pages to be protected against
5227 # code execution when running on Mac OS X 10.7 ("Lion"), and
5228 # ensures that the position-independent executable (PIE) bit
5229 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
5231 # Define change_mach_o_flags in a variable ending in _path
5232 # so that GYP understands it's a path and performs proper
5233 # relativization during dict merging.
5234 'change_mach_o_flags_path':
5235 'mac/change_mach_o_flags_from_xcode.sh',
5236 'change_mach_o_flags_options%': [
5238 'target_conditions': [
5239 ['mac_pie==0 or release_valgrind_build==1', {
5240 # Don't enable PIE if it's unwanted. It's unwanted if
5241 # the target specifies mac_pie=0 or if building for
5242 # Valgrind, because Valgrind doesn't understand slide.
5243 # See the similar mac_pie/release_valgrind_build check
5245 'change_mach_o_flags_options': [
5251 'postbuild_name': 'Change Mach-O Flags',
5253 '<(change_mach_o_flags_path)',
5254 '>@(change_mach_o_flags_options)',
5258 'target_conditions': [
5259 ['mac_pie==1 and release_valgrind_build==0', {
5260 # Turn on position-independence (ASLR) for executables. When
5261 # PIE is on for the Chrome executables, the framework will
5262 # also be subject to ASLR.
5263 # Don't do this when building for Valgrind, because Valgrind
5264 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
5265 # understand slide, and get rid of the Valgrind check.
5268 '-Wl,-pie', # Position-independent executable (MH_PIE)
5274 ['(_type=="executable" or _type=="shared_library" or \
5275 _type=="loadable_module") and mac_strip!=0', {
5276 'target_conditions': [
5277 ['mac_real_dsym == 1', {
5278 # To get a real .dSYM bundle produced by dsymutil, set the
5279 # debug information format to dwarf-with-dsym. Since
5280 # strip_from_xcode will not be used, set Xcode to do the
5281 # stripping as well.
5285 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
5286 'DEPLOYMENT_POSTPROCESSING': 'YES',
5287 'STRIP_INSTALLED_PRODUCT': 'YES',
5289 # Only strip non-ASan builds.
5291 'target_conditions': [
5292 ['_type=="shared_library" or _type=="loadable_module"', {
5293 # The Xcode default is to strip debugging symbols
5294 # only (-S). Local symbols should be stripped as
5295 # well, which will be handled by -x. Xcode will
5296 # continue to insert -S when stripping even when
5297 # additional flags are added with STRIPFLAGS.
5299 }], # _type=="shared_library" or _type=="loadable_module"
5300 ], # target_conditions
5306 }, # configuration "Release"
5308 }, { # mac_real_dsym != 1
5309 # To get a fast fake .dSYM bundle, use a post-build step to
5310 # produce the .dSYM and strip the executable. strip_from_xcode
5311 # only operates in the Release configuration.
5315 # Define strip_from_xcode in a variable ending in _path
5316 # so that gyp understands it's a path and performs proper
5317 # relativization during dict merging.
5318 'strip_from_xcode_path': 'mac/strip_from_xcode',
5320 'postbuild_name': 'Strip If Needed',
5321 'action': ['<(strip_from_xcode_path)'],
5325 ], # target_conditions
5326 }], # (_type=="executable" or _type=="shared_library" or
5327 # _type=="loadable_module") and mac_strip!=0
5328 ], # target_conditions
5329 }, # target_defaults
5333 'ios/coverage.gypi',
5335 'target_defaults': {
5336 'xcode_settings' : {
5337 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
5340 # Older Xcodes do not support -Wno-deprecated-register, so pass an
5341 # additional flag to suppress the "unknown compiler option" error.
5342 # Restrict this flag to builds that are either compiling with Xcode
5343 # or compiling with Xcode's Clang. This will allow Ninja builds to
5344 # continue failing on unknown compiler options.
5345 # TODO(rohitrao): This flag is temporary and should be removed as
5346 # soon as the iOS bots are updated to use Xcode 5.1.
5347 ['clang_xcode==1', {
5349 '-Wno-unknown-warning-option',
5353 # Limit the valid architectures depending on "target_subarch".
5354 # This need to include the "arm" architectures but also the "x86"
5355 # ones (they are used when building for the simulator).
5356 ['target_subarch=="arm32"', {
5357 'VALID_ARCHS': ['armv7', 'i386'],
5359 ['target_subarch=="arm64"', {
5360 'VALID_ARCHS': ['arm64', 'x86_64'],
5362 ['target_subarch=="both"', {
5363 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
5365 ['use_system_libcxx==1', {
5366 'target_conditions': [
5367 # Only use libc++ when building target for iOS not when building
5368 # tools for the host (OS X) as Mac targets OS X SDK 10.6 which
5369 # does not support libc++.
5370 ['_toolset=="target"', {
5371 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
5375 # The default for deployment target of 7.0+ is libc++, so force
5376 # the old behavior unless libc++ is enabled.
5377 'CLANG_CXX_LIBRARY': 'libstdc++', # -stdlib=libstdc++
5381 'target_conditions': [
5382 ['_toolset=="host"', {
5384 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
5385 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
5394 ['_toolset=="target"', {
5396 # This section should be for overriding host settings. But,
5397 # since we can't negate the iphone deployment target above, we
5398 # instead set it here for target only.
5399 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
5400 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
5403 ['_type=="executable"', {
5407 'DEPLOYMENT_POSTPROCESSING': 'YES',
5408 'STRIP_INSTALLED_PRODUCT': 'YES',
5413 # Remove dSYM to reduce build time.
5414 'DEBUG_INFORMATION_FORMAT': 'dwarf',
5420 ['chromium_ios_signing', {
5421 # iOS SDK wants everything for device signed.
5422 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
5424 'CODE_SIGNING_REQUIRED': 'NO',
5425 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
5430 ], # target_conditions
5431 }, # target_defaults
5434 'target_defaults': {
5436 '_WIN32_WINNT=0x0603',
5443 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
5444 'WIN32_LEAN_AND_MEAN',
5447 # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
5448 '_HAS_EXCEPTIONS=0',
5449 # Silence some warnings; we can't switch the the 'recommended'
5450 # versions as they're not available on old OSs.
5451 '_WINSOCK_DEPRECATED_NO_WARNINGS',
5454 ['buildtype=="Official"', {
5455 # In official builds, targets can self-select an optimization
5456 # level by defining a variable named 'optimize', and setting it
5458 # - "size", optimizes for minimal code size - the default.
5459 # - "speed", optimizes for speed over code size.
5460 # - "max", whole program optimization and link-time code
5461 # generation. This is very expensive and should be used
5464 'optimize%': 'size',
5468 # Set /LTCG for the official builds.
5469 'LinkTimeCodeGeneration': '1',
5470 'AdditionalOptions': [
5471 # Set the number of LTCG code-gen threads to eight.
5472 # The default is four. This gives a 5-10% link speedup.
5477 'target_conditions': [
5478 ['optimize=="size"', {
5480 'VCCLCompilerTool': {
5481 # 1, optimizeMinSpace, Minimize Size (/O1)
5482 'Optimization': '1',
5483 # 2, favorSize - Favor small code (/Os)
5484 'FavorSizeOrSpeed': '2',
5489 ['optimize=="speed"', {
5491 'VCCLCompilerTool': {
5492 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5493 'Optimization': '2',
5494 # 1, favorSpeed - Favor fast code (/Ot)
5495 'FavorSizeOrSpeed': '1',
5500 ['optimize=="max"', {
5501 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
5502 # builds. Probably anything that this would catch that
5503 # wouldn't be caught in a normal build isn't going to
5504 # actually be a bug, so the incremental value of C4702 for
5505 # PGO builds is likely very small.
5506 'msvs_disabled_warnings': [
5510 'VCCLCompilerTool': {
5511 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
5512 'Optimization': '2',
5513 # 1, favorSpeed - Favor fast code (/Ot)
5514 'FavorSizeOrSpeed': '1',
5515 # This implies link time code generation.
5516 'WholeProgramOptimization': 'true',
5524 ['msvs_xtree_patched!=1', {
5525 # If xtree hasn't been patched, then we disable C4702. Otherwise,
5526 # it's enabled. This will generally only be true for system-level
5527 # installed Express users.
5528 'msvs_disabled_warnings': [
5533 'msvs_system_include_dirs': [
5534 '<(windows_sdk_path)/Include/shared',
5535 '<(windows_sdk_path)/Include/um',
5536 '<(windows_sdk_path)/Include/winrt',
5537 '$(VSInstallDir)/VC/atlmfc/include',
5539 'msvs_cygwin_shell': 0,
5540 'msvs_disabled_warnings': [
5541 # C4091: 'typedef ': ignored on left of 'X' when no variable is
5543 # This happens in a number of Windows headers. Dumb.
5546 # C4127: conditional expression is constant
5547 # This warning can in theory catch dead code and other problems, but
5548 # triggers in far too many desirable cases where the conditional
5549 # expression is either set by macros or corresponds some legitimate
5550 # compile-time constant expression (due to constant template args,
5551 # conditionals comparing the sizes of different types, etc.). Some of
5552 # these can be worked around, but it's not worth it.
5555 # C4351: new behavior: elements of array 'array' will be default
5557 # This is a silly "warning" that basically just alerts you that the
5558 # compiler is going to actually follow the language spec like it's
5559 # supposed to, instead of not following it like old buggy versions
5560 # did. There's absolutely no reason to turn this on.
5563 # C4355: 'this': used in base member initializer list
5564 # It's commonly useful to pass |this| to objects in a class'
5565 # initializer list. While this warning can catch real bugs, most of
5566 # the time the constructors in question don't attempt to call methods
5567 # on the passed-in pointer (until later), and annotating every legit
5568 # usage of this is simply more hassle than the warning is worth.
5571 # C4503: 'identifier': decorated name length exceeded, name was
5573 # This only means that some long error messages might have truncated
5574 # identifiers in the presence of lots of templates. It has no effect
5575 # on program correctness and there's no real reason to waste time
5576 # trying to prevent it.
5579 # C4611: interaction between 'function' and C++ object destruction is
5581 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
5582 # suggests using exceptions instead of setjmp/longjmp for C++, but
5583 # Chromium code compiles without exception support. We therefore have
5584 # to use setjmp/longjmp for e.g. JPEG decode error handling, which
5585 # means we have to turn off this warning (and be careful about how
5586 # object destruction happens in such cases).
5589 # TODO(maruel): These warnings are level 4. They will be slowly
5590 # removed as code is fixed.
5591 4100, # Unreferenced formal parameter
5592 4121, # Alignment of a member was sensitive to packing
5593 4244, # Conversion from 'type1' to 'type2', possible loss of data
5594 4481, # Nonstandard extension used: override specifier 'keyword'
5595 4505, # Unreferenced local function has been removed
5596 4510, # Default constructor could not be generated
5597 4512, # Assignment operator could not be generated
5598 4610, # Object can never be instantiated
5599 4996, # 'X': was declared deprecated (for GetVersionEx).
5602 'VCCLCompilerTool': {
5603 'AdditionalOptions': ['/MP'],
5604 'MinimalRebuild': 'false',
5605 'BufferSecurityCheck': 'true',
5606 'EnableFunctionLevelLinking': 'true',
5607 'RuntimeTypeInfo': 'false',
5608 'WarningLevel': '4',
5609 'WarnAsError': 'true',
5610 'DebugInformationFormat': '3',
5611 # ExceptionHandling must match _HAS_EXCEPTIONS above.
5612 'ExceptionHandling': '0',
5614 'VCLibrarianTool': {
5615 'AdditionalOptions': ['/ignore:4221'],
5616 'AdditionalLibraryDirectories': [
5617 '<(windows_sdk_path)/Lib/win8/um/x86',
5621 'AdditionalDependencies': [
5633 'AdditionalLibraryDirectories': [
5634 '<(windows_sdk_path)/Lib/win8/um/x86',
5636 'GenerateDebugInformation': 'true',
5637 'MapFileName': '$(OutDir)\\$(TargetName).map',
5638 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
5639 'FixedBaseAddress': '1',
5642 # 1 == /SUBSYSTEM:CONSOLE
5643 # 2 == /SUBSYSTEM:WINDOWS
5644 # Most of the executables we'll ever create are tests
5645 # and utilities with console output.
5649 'GenerateStublessProxies': 'true',
5650 'TypeLibraryName': '$(InputName).tlb',
5651 'OutputDirectory': '$(IntDir)',
5652 'HeaderFileName': '$(InputName).h',
5653 'DLLDataFileName': '$(InputName).dlldata.c',
5654 'InterfaceIdentifierFileName': '$(InputName)_i.c',
5655 'ProxyFileName': '$(InputName)_p.c',
5657 'VCResourceCompilerTool': {
5659 'AdditionalIncludeDirectories': [
5661 '<(SHARED_INTERMEDIATE_DIR)',
5664 'target_conditions': [
5665 ['_type=="executable"', {
5667 'EmbedManifest': 'true',
5670 ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
5672 'AdditionalManifestFiles': [
5673 '>(win_exe_compatibility_manifest)',
5679 # Building with Clang on Windows is a work in progress and very
5680 # experimental. See crbug.com/82385.
5682 'VCCLCompilerTool': {
5683 'AdditionalOptions': [
5684 '-fmsc-version=1800',
5686 # Many files use intrinsics without including this header.
5687 # TODO(hans): Fix those files, or move this to sub-GYPs.
5690 # TODO(hans): Make this list shorter eventually.
5691 '-Qunused-arguments',
5692 '-Wno-c++11-compat-deprecated-writable-strings',
5693 '-Wno-deprecated-declarations',
5695 '-Wno-enum-conversion',
5696 '-Wno-extra-tokens',
5697 '-Wno-ignored-attributes',
5698 '-Wno-incompatible-pointer-types',
5699 '-Wno-int-to-void-pointer-cast',
5700 '-Wno-invalid-noreturn',
5701 '-Wno-logical-op-parentheses',
5703 '-Wno-missing-braces',
5704 '-Wno-missing-declarations',
5705 '-Wno-msvc-include',
5706 '-Wno-null-dereference',
5707 '-Wno-overloaded-virtual',
5709 '-Wno-pointer-sign',
5711 '-Wno-return-type-c-linkage',
5713 '-Wno-sometimes-uninitialized',
5715 '-Wno-tautological-compare',
5716 '-Wno-unknown-pragmas',
5718 '-Wno-unused-function',
5719 '-Wno-unused-private-field',
5720 '-Wno-unused-value',
5721 '-Wno-unused-variable',
5722 '-Wno-unused-local-typedef', # http://crbug.com/411648
5723 '-Wno-inconsistent-missing-override', #http://crbug.com/428099
5727 ['clang==1 and target_arch=="ia32"', {
5728 'VCCLCompilerTool': {
5729 'WarnAsError': 'false',
5730 'AdditionalOptions': [
5739 ['disable_nacl==1', {
5740 'target_defaults': {
5746 ['OS=="win" and msvs_use_common_linker_extras', {
5747 'target_defaults': {
5762 'AdditionalOptions': [
5773 'AdditionalOptions': ['/largeaddressaware'],
5777 # TODO(asan/win): Move this down into the general
5778 # win-target_defaults section once the 64-bit asan runtime
5779 # exists. See crbug.com/345874.
5780 'VCCLCompilerTool': {
5781 'AdditionalOptions': [
5782 '-fsanitize=address',
5783 '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
5785 'AdditionalIncludeDirectories': [
5786 # MSVC needs to be able to find the sanitizer headers when
5787 # invoked via /fallback. This is critical for using macros
5788 # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
5790 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/include_sanitizer',
5794 'AdditionalLibraryDirectories': [
5795 # TODO(hans): If make_clang_dir is absolute, this breaks.
5796 '<(DEPTH)/<(make_clang_dir)/lib/clang/3.7.0/lib/windows',
5799 'target_conditions': [
5800 ['component=="shared_library"', {
5802 'AdditionalDependencies': [
5803 'clang_rt.asan_dynamic-i386.lib',
5804 'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
5808 ['_type=="executable" and component=="static_library"', {
5810 'AdditionalDependencies': [
5811 'clang_rt.asan-i386.lib',
5815 ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
5817 'AdditionalDependencies': [
5818 'clang_rt.asan_dll_thunk-i386.lib',
5830 'AdditionalOptions': [
5831 # safeseh is not compatible with x64
5843 ['enable_new_npdevice_api==1', {
5844 'target_defaults': {
5846 'ENABLE_NEW_NPDEVICE_API',
5850 # Don't warn about the "typedef 'foo' locally defined but not used"
5851 # for gcc 4.8 and higher.
5852 # TODO: remove this flag once all builds work. See crbug.com/227506
5853 ['gcc_version>=48 and clang==0', {
5854 'target_defaults': {
5856 '-Wno-unused-local-typedefs',
5860 ['gcc_version>=48 and clang==0 and host_clang==1', {
5861 'target_defaults': {
5862 'target_conditions': [
5863 ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
5867 # In the android webview build, force host targets to be compiled with clang
5868 # as the hermetic host gcc is very old on some platforms. This is already
5869 # the default on the current development version of AOSP but we force it
5870 # here in case we need to compile against an older release version. We also
5871 # explicitly set it to false for target binaries to avoid causing problems
5872 # for the work to enable clang by default in AOSP. We also force the use of
5873 # libstdc++ on host as peculiarities of the android gyp backend mean that
5874 # using libc++ doesn't work, and Chromium doesn't yet require a more modern
5876 ['android_webview_build==1', {
5877 'target_defaults': {
5878 'target_conditions': [
5879 ['_toolset=="host"', {
5880 'aosp_build_settings': {
5881 'LOCAL_CLANG': 'true',
5882 'LOCAL_CXX_STL': 'libstdc++',
5884 }, { # else: _toolset != "host"
5885 'aosp_build_settings': {
5886 'LOCAL_CLANG': 'false',
5892 # We need a special case to handle the android webview build on mac because
5893 # the host gcc there doesn't accept this flag, but the target gcc may
5895 ['gcc_version>=48 and android_webview_build==1 and host_os=="mac"', {
5896 'target_defaults': {
5897 'target_conditions': [
5898 ['_toolset=="host"', {
5900 '-Wno-unused-local-typedefs',
5906 ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
5908 'make_global_settings': [
5909 ['CC', '<(make_clang_dir)/bin/clang'],
5910 ['CXX', '<(make_clang_dir)/bin/clang++'],
5911 ['CC.host', '$(CC)'],
5912 ['CXX.host', '$(CXX)'],
5915 ['clang==1 and OS=="win"', {
5916 'make_global_settings': [
5917 # On Windows, gyp's ninja generator only looks at CC.
5918 ['CC', '<(make_clang_dir)/bin/clang-cl'],
5921 ['use_lld==1 and OS=="win"', {
5922 'make_global_settings': [
5923 # Limited to Windows because lld-link is the driver that is compatible
5925 ['LD', '<(make_clang_dir)/bin/lld-link'],
5928 ['OS=="android" and clang==0', {
5929 # Hardcode the compiler names in the Makefile so that
5930 # it won't depend on the environment at make time.
5931 'make_global_settings': [
5932 ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
5933 ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
5934 ['CC.host', '<(host_cc)'],
5935 ['CXX.host', '<(host_cxx)'],
5938 ['OS=="linux" and target_arch=="mipsel"', {
5939 'make_global_settings': [
5940 ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'],
5941 ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'],
5942 ['CC.host', '<(host_cc)'],
5943 ['CXX.host', '<(host_cxx)'],
5946 ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
5947 # Set default ARM cross compiling on linux. These can be overridden
5948 # using CC/CXX/etc environment variables.
5949 'make_global_settings': [
5950 ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
5951 ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
5952 ['CC.host', '<(host_cc)'],
5953 ['CXX.host', '<(host_cxx)'],
5957 # TODO(yyanagisawa): supports GENERATOR==make
5958 # make generator doesn't support CC_wrapper without CC
5959 # in make_global_settings yet.
5960 ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
5961 'make_global_settings': [
5962 ['CC_wrapper', '<(gomadir)/gomacc'],
5963 ['CXX_wrapper', '<(gomadir)/gomacc'],
5964 ['CC.host_wrapper', '<(gomadir)/gomacc'],
5965 ['CXX.host_wrapper', '<(gomadir)/gomacc'],
5969 'target_defaults': {
5970 'target_conditions': [
5971 ['_toolset=="target"', {
5979 ['use_lto==1 and clang==0', {
5980 'target_defaults': {
5981 'target_conditions': [
5982 ['_toolset=="target"', {
5984 '-ffat-lto-objects',
5990 ['use_lto==1 and clang==1', {
5991 'target_defaults': {
5992 'target_conditions': [
5993 ['_toolset=="target"', {
5995 '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
6001 ['use_lto==1 and clang==1 and (target_arch=="ia32" or target_arch=="x64")', {
6002 'target_defaults': {
6003 'target_conditions': [
6004 # Required for third_party/zlib/crc_folding.c and various other code
6005 # that uses SSE. TODO(pcc): Remove this once we properly support
6006 # subtarget specific code generation in LLVM.
6007 ['_toolset=="target"', {
6009 '-Wl,-plugin-opt,mcpu=corei7-avx',
6012 ['_toolset=="target" and _type!="static_library"', {
6015 '-Wl,-mcpu,corei7-avx',
6022 ['use_lto==1 and clang==1 and target_arch=="arm"', {
6023 'target_defaults': {
6024 'target_conditions': [
6025 ['_toolset=="target"', {
6026 # Without this flag, LTO produces a .text section that is larger
6027 # than the maximum call displacement, preventing the linker from
6028 # relocating calls (http://llvm.org/PR22999).
6030 '-Wl,-plugin-opt,-function-sections',
6036 ['(use_lto==1 or use_lto_o2==1) and clang==0', {
6037 'target_defaults': {
6038 'target_conditions': [
6039 ['_toolset=="target"', {
6047 ['(use_lto==1 or use_lto_o2==1) and clang==1', {
6048 'target_defaults': {
6049 'target_conditions': [
6050 ['_toolset=="target"', {
6059 'target_defaults': {
6060 'target_conditions': [
6061 ['_toolset=="target"', {
6063 '-fsanitize=cfi-vptr',
6066 '-fsanitize=cfi-vptr',
6070 '-fsanitize=cfi-vptr',
6074 ['_toolset=="target" and _type!="static_library"', {
6077 '-fsanitize=cfi-vptr',
6086 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
6087 # This block adds *project-wide* configuration settings to each project
6088 # file. It's almost always wrong to put things here. Specify your
6089 # custom xcode_settings in target_defaults to add them to targets instead.
6092 # In an Xcode Project Info window, the "Base SDK for All Configurations"
6093 # setting sets the SDK on a project-wide basis. In order to get the
6094 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
6095 # here at the project level.
6098 ['mac_sdk_path==""', {
6099 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
6101 'SDKROOT': '<(mac_sdk_path)', # -isysroot
6107 ['ios_sdk_path==""', {
6109 # TODO(justincohen): Ninja only supports simulator for now.
6110 ['"<(GENERATOR)"=="xcode"', {
6111 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
6113 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot
6117 'SDKROOT': '<(ios_sdk_path)', # -isysroot
6122 # Target both iPhone and iPad.
6123 'TARGETED_DEVICE_FAMILY': '1,2',
6126 ['target_arch=="x64"', {
6131 ['target_arch=="ia32"', {
6140 # The Xcode generator will look for an xcode_settings section at the root
6141 # of each dict and use it to apply settings on a file-wide basis. Most
6142 # settings should not be here, they should be in target-specific
6143 # xcode_settings sections, or better yet, should use non-Xcode-specific
6144 # settings in target dicts. SYMROOT is a special case, because many other
6145 # Xcode variables depend on it, including variables such as
6146 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6147 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6148 # files to appear (when present) in the UI as actual files and not red
6149 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6150 # and therefore SYMROOT, needs to be set at the project level.
6151 'SYMROOT': '<(DEPTH)/xcodebuild',