media/webrtc/trunk/build/common.gypi

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
michael@0 2 # Use of this source code is governed by a BSD-style license that can be
michael@0 3 # found in the LICENSE file.
michael@0 4
michael@0 5 # IMPORTANT:
michael@0 6 # Please don't directly include this file if you are building via gyp_chromium,
michael@0 7 # since gyp_chromium is automatically forcing its inclusion.
michael@0 8 {
michael@0 9 # Variables expected to be overriden on the GYP command line (-D) or by
michael@0 10 # ~/.gyp/include.gypi.
michael@0 11 'variables': {
michael@0 12 # Putting a variables dict inside another variables dict looks kind of
michael@0 13 # weird. This is done so that 'host_arch', 'chromeos', etc are defined as
michael@0 14 # variables within the outer variables dict here. This is necessary
michael@0 15 # to get these variables defined for the conditions within this variables
michael@0 16 # dict that operate on these variables.
michael@0 17 'variables': {
michael@0 18 'variables': {
michael@0 19 'variables': {
michael@0 20 'variables': {
michael@0 21 # Whether we're building a ChromeOS build.
michael@0 22 'chromeos%': 0,
michael@0 23
michael@0 24 # Whether or not we are using the Aura windowing framework.
michael@0 25 'use_aura%': 0,
michael@0 26
michael@0 27 # Whether or not we are building the Ash shell.
michael@0 28 'use_ash%': 0,
michael@0 29 },
michael@0 30 # Copy conditionally-set variables out one scope.
michael@0 31 'chromeos%': '<(chromeos)',
michael@0 32 'use_aura%': '<(use_aura)',
michael@0 33 'use_ash%': '<(use_ash)',
michael@0 34
michael@0 35 # Whether we are using Views Toolkit
michael@0 36 'toolkit_views%': 0,
michael@0 37
michael@0 38 # Use OpenSSL instead of NSS. Under development: see http://crbug.com/62803
michael@0 39 'use_openssl%': 0,
michael@0 40
michael@0 41 'use_ibus%': 0,
michael@0 42
michael@0 43 # Disable viewport meta tag by default.
michael@0 44 'enable_viewport%': 0,
michael@0 45
michael@0 46 # Enable HiDPI support.
michael@0 47 'enable_hidpi%': 0,
michael@0 48
michael@0 49 # Enable touch optimized art assets and metrics.
michael@0 50 'enable_touch_ui%': 0,
michael@0 51
michael@0 52 # Is this change part of the android upstream bringup?
michael@0 53 # Allows us to *temporarily* disable certain things for
michael@0 54 # staging. Only set to 1 in a GYP_DEFINES.
michael@0 55 'android_upstream_bringup%': 0,
michael@0 56
michael@0 57 # Override buildtype to select the desired build flavor.
michael@0 58 # Dev - everyday build for development/testing
michael@0 59 # Official - release build (generally implies additional processing)
michael@0 60 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
michael@0 61 # conversion is done), some of the things which are now controlled by
michael@0 62 # 'branding', such as symbol generation, will need to be refactored
michael@0 63 # based on 'buildtype' (i.e. we don't care about saving symbols for
michael@0 64 # non-Official # builds).
michael@0 65 'buildtype%': 'Dev',
michael@0 66
michael@0 67 'conditions': [
michael@0 68 # ChromeOS implies ash.
michael@0 69 ['chromeos==1', {
michael@0 70 'use_ash%': 1,
michael@0 71 'use_aura%': 1,
michael@0 72 }],
michael@0 73
michael@0 74 # For now, Windows builds that |use_aura| should also imply using
michael@0 75 # ash. This rule should be removed for the future when Windows is
michael@0 76 # using the aura windows without the ash interface.
michael@0 77 ['use_aura==1 and OS=="win"', {
michael@0 78 'use_ash%': 1,
michael@0 79 }],
michael@0 80 ['use_ash==1', {
michael@0 81 'use_aura%': 1,
michael@0 82 }],
michael@0 83
michael@0 84 # A flag for BSD platforms
michael@0 85 ['OS=="dragonfly" or OS=="freebsd" or OS=="netbsd" or \
michael@0 86 OS=="openbsd"', {
michael@0 87 'os_bsd%': 1,
michael@0 88 }, {
michael@0 89 'os_bsd%': 0,
michael@0 90 }],
michael@0 91 ],
michael@0 92 },
michael@0 93 # Copy conditionally-set variables out one scope.
michael@0 94 'chromeos%': '<(chromeos)',
michael@0 95 'use_aura%': '<(use_aura)',
michael@0 96 'use_ash%': '<(use_ash)',
michael@0 97 'os_bsd%': '<(os_bsd)',
michael@0 98 'use_openssl%': '<(use_openssl)',
michael@0 99 'use_ibus%': '<(use_ibus)',
michael@0 100 'enable_viewport%': '<(enable_viewport)',
michael@0 101 'enable_hidpi%': '<(enable_hidpi)',
michael@0 102 'enable_touch_ui%': '<(enable_touch_ui)',
michael@0 103 'android_upstream_bringup%': '<(android_upstream_bringup)',
michael@0 104 'buildtype%': '<(buildtype)',
michael@0 105
michael@0 106 # Sets whether we're building with the Android SDK/NDK (and hence with
michael@0 107 # Ant, value 0), or as part of the Android system (and hence with the
michael@0 108 # Android build system, value 1).
michael@0 109 'android_build_type%': 0,
michael@0 110
michael@0 111 # Compute the architecture that we're building on.
michael@0 112 'conditions': [
michael@0 113 ['OS=="win" or OS=="ios"', {
michael@0 114 'host_arch%': 'ia32',
michael@0 115 }, {
michael@0 116 # This handles the Unix platforms for which there is some support.
michael@0 117 # Anything else gets passed through, which probably won't work very
michael@0 118 # well; such hosts should pass an explicit target_arch to gyp.
michael@0 119 'host_arch%':
michael@0 120 '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/")',
michael@0 121 }],
michael@0 122
michael@0 123 # Set default value of toolkit_views based on OS.
michael@0 124 ['OS=="win" or chromeos==1 or use_aura==1', {
michael@0 125 'toolkit_views%': 1,
michael@0 126 }, {
michael@0 127 'toolkit_views%': 0,
michael@0 128 }],
michael@0 129
michael@0 130 # Set toolkit_uses_gtk for the Chromium browser on Linux.
michael@0 131 ['(OS=="linux" or OS=="solaris" or os_bsd==1) and use_aura==0', {
michael@0 132 'toolkit_uses_gtk%': 1,
michael@0 133 }, {
michael@0 134 'toolkit_uses_gtk%': 0,
michael@0 135 }],
michael@0 136
michael@0 137 # Enable HiDPI on Mac OS and Chrome OS.
michael@0 138 ['OS=="mac" or chromeos==1', {
michael@0 139 'enable_hidpi%': 1,
michael@0 140 }],
michael@0 141
michael@0 142 # Enable touch UI on Metro.
michael@0 143 ['OS=="win"', {
michael@0 144 'enable_touch_ui%': 1,
michael@0 145 }],
michael@0 146 ],
michael@0 147 },
michael@0 148
michael@0 149 # Copy conditionally-set variables out one scope.
michael@0 150 'chromeos%': '<(chromeos)',
michael@0 151 'host_arch%': '<(host_arch)',
michael@0 152 'toolkit_views%': '<(toolkit_views)',
michael@0 153 'toolkit_uses_gtk%': '<(toolkit_uses_gtk)',
michael@0 154 'use_aura%': '<(use_aura)',
michael@0 155 'use_ash%': '<(use_ash)',
michael@0 156 'os_bsd%': '<(os_bsd)',
michael@0 157 'use_openssl%': '<(use_openssl)',
michael@0 158 'use_ibus%': '<(use_ibus)',
michael@0 159 'enable_viewport%': '<(enable_viewport)',
michael@0 160 'enable_hidpi%': '<(enable_hidpi)',
michael@0 161 'enable_touch_ui%': '<(enable_touch_ui)',
michael@0 162 'android_upstream_bringup%': '<(android_upstream_bringup)',
michael@0 163 'android_build_type%': '<(android_build_type)',
michael@0 164
michael@0 165 # We used to provide a variable for changing how libraries were built.
michael@0 166 # This variable remains until we can clean up all the users.
michael@0 167 # This needs to be one nested variables dict in so that dependent
michael@0 168 # gyp files can make use of it in their outer variables. (Yikes!)
michael@0 169 # http://code.google.com/p/chromium/issues/detail?id=83308
michael@0 170 'library%': 'static_library',
michael@0 171
michael@0 172 # Override branding to select the desired branding flavor.
michael@0 173 'branding%': 'Chromium',
michael@0 174
michael@0 175 'buildtype%': '<(buildtype)',
michael@0 176
michael@0 177 # Default architecture we're building for is the architecture we're
michael@0 178 # building on.
michael@0 179 'target_arch%': '<(host_arch)',
michael@0 180
michael@0 181 # This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are
michael@0 182 # are built under a chromium full build (1) or a webkit.org chromium
michael@0 183 # build (0).
michael@0 184 'inside_chromium_build%': 1,
michael@0 185
michael@0 186 # Set to 1 to enable fast builds. It disables debug info for fastest
michael@0 187 # compilation.
michael@0 188 'fastbuild%': 0,
michael@0 189
michael@0 190 # Set to 1 to enable dcheck in release without having to use the flag.
michael@0 191 'dcheck_always_on%': 0,
michael@0 192
michael@0 193 # Disable file manager component extension by default.
michael@0 194 'file_manager_extension%': 0,
michael@0 195
michael@0 196 # Python version.
michael@0 197 'python_ver%': '2.6',
michael@0 198
michael@0 199 # Set ARM version (for libyuv)
michael@0 200 'arm_version%': 6,
michael@0 201
michael@0 202 # Set ARM-v7 compilation flags
michael@0 203 'armv7%': 0,
michael@0 204
michael@0 205 # Set Neon compilation flags (only meaningful if armv7==1).
michael@0 206 'arm_neon%': 1,
michael@0 207 'arm_neon_optional%': 0,
michael@0 208
michael@0 209 # The system root for cross-compiles. Default: none.
michael@0 210 'sysroot%': '',
michael@0 211
michael@0 212 # The system libdir used for this ABI.
michael@0 213 'system_libdir%': 'lib',
michael@0 214
michael@0 215 # On Linux, we build with sse2 for Chromium builds.
michael@0 216 'disable_sse2%': 0,
michael@0 217
michael@0 218 # Use libjpeg-turbo as the JPEG codec used by Chromium.
michael@0 219 'use_libjpeg_turbo%': 1,
michael@0 220
michael@0 221 # Use system libjpeg. Note that the system's libjepg will be used even if
michael@0 222 # use_libjpeg_turbo is set.
michael@0 223 'use_system_libjpeg%': 0,
michael@0 224
michael@0 225 # Use system libvpx
michael@0 226 'use_system_libvpx%': 0,
michael@0 227
michael@0 228 # Variable 'component' is for cases where we would like to build some
michael@0 229 # components as dynamic shared libraries but still need variable
michael@0 230 # 'library' for static libraries.
michael@0 231 # By default, component is set to whatever library is set to and
michael@0 232 # it can be overriden by the GYP command line or by ~/.gyp/include.gypi.
michael@0 233 'component%': 'static_library',
michael@0 234
michael@0 235 # Set to select the Title Case versions of strings in GRD files.
michael@0 236 'use_titlecase_in_grd_files%': 0,
michael@0 237
michael@0 238 # Use translations provided by volunteers at launchpad.net. This
michael@0 239 # currently only works on Linux.
michael@0 240 'use_third_party_translations%': 0,
michael@0 241
michael@0 242 # Remoting compilation is enabled by default. Set to 0 to disable.
michael@0 243 'remoting%': 1,
michael@0 244
michael@0 245 # Configuration policy is enabled by default. Set to 0 to disable.
michael@0 246 'configuration_policy%': 1,
michael@0 247
michael@0 248 # Safe browsing is compiled in by default. Set to 0 to disable.
michael@0 249 'safe_browsing%': 1,
michael@0 250
michael@0 251 # Speech input is compiled in by default. Set to 0 to disable.
michael@0 252 'input_speech%': 1,
michael@0 253
michael@0 254 # Notifications are compiled in by default. Set to 0 to disable.
michael@0 255 'notifications%' : 1,
michael@0 256
michael@0 257 # If this is set, the clang plugins used on the buildbot will be used.
michael@0 258 # Run tools/clang/scripts/update.sh to make sure they are compiled.
michael@0 259 # This causes 'clang_chrome_plugins_flags' to be set.
michael@0 260 # Has no effect if 'clang' is not set as well.
michael@0 261 'clang_use_chrome_plugins%': 1,
michael@0 262
michael@0 263 # Enable building with ASAN (Clang's -faddress-sanitizer option).
michael@0 264 # -faddress-sanitizer only works with clang, but asan=1 implies clang=1
michael@0 265 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
michael@0 266 'asan%': 0,
michael@0 267
michael@0 268 # Enable building with TSAN (Clang's -fthread-sanitizer option).
michael@0 269 # -fthread-sanitizer only works with clang, but tsan=1 implies clang=1
michael@0 270 # See http://clang.llvm.org/docs/ThreadSanitizer.html
michael@0 271 'tsan%': 0,
michael@0 272
michael@0 273 # Use a modified version of Clang to intercept allocated types and sizes
michael@0 274 # for allocated objects. clang_type_profiler=1 implies clang=1.
michael@0 275 # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier
michael@0 276 # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11
michael@0 277 'clang_type_profiler%': 0,
michael@0 278
michael@0 279 # Set to true to instrument the code with function call logger.
michael@0 280 # See src/third_party/cygprofile/cyg-profile.cc for details.
michael@0 281 'order_profiling%': 0,
michael@0 282
michael@0 283 # Use the provided profiled order file to link Chrome image with it.
michael@0 284 # This makes Chrome faster by better using CPU cache when executing code.
michael@0 285 # This is known as PGO (profile guided optimization).
michael@0 286 # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
michael@0 287 'order_text_section%' : "",
michael@0 288
michael@0 289 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
michael@0 290 # libraries on linux x86-64 and arm, plus ASLR.
michael@0 291 'linux_fpic%': 1,
michael@0 292
michael@0 293 # Whether one-click signin is enabled or not.
michael@0 294 'enable_one_click_signin%': 0,
michael@0 295
michael@0 296 # Enable Web Intents support in WebKit.
michael@0 297 'enable_web_intents%': 1,
michael@0 298
michael@0 299 # Enable Chrome browser extensions
michael@0 300 'enable_extensions%': 1,
michael@0 301
michael@0 302 # Enable browser automation.
michael@0 303 'enable_automation%': 1,
michael@0 304
michael@0 305 # Enable printing support and UI.
michael@0 306 'enable_printing%': 1,
michael@0 307
michael@0 308 # Enable Web Intents web content registration via HTML element
michael@0 309 # and WebUI managing such registrations.
michael@0 310 'enable_web_intents_tag%': 0,
michael@0 311
michael@0 312 # Webrtc compilation is enabled by default. Set to 0 to disable.
michael@0 313 'enable_webrtc%': 1,
michael@0 314
michael@0 315 # PPAPI by default does not support plugins making calls off the main
michael@0 316 # thread. Set to 1 to turn on experimental support for out-of-process
michael@0 317 # plugins to make call of the main thread.
michael@0 318 'enable_pepper_threading%': 0,
michael@0 319
michael@0 320 # Enables use of the session service, which is enabled by default.
michael@0 321 # Support for disabling depends on the platform.
michael@0 322 'enable_session_service%': 1,
michael@0 323
michael@0 324 # Enables theme support, which is enabled by default. Support for
michael@0 325 # disabling depends on the platform.
michael@0 326 'enable_themes%': 1,
michael@0 327
michael@0 328 # Uses OEM-specific wallpaper resources on Chrome OS.
michael@0 329 'use_oem_wallpaper%': 0,
michael@0 330
michael@0 331 # Enables support for background apps.
michael@0 332 'enable_background%': 1,
michael@0 333
michael@0 334 # Enable the task manager by default.
michael@0 335 'enable_task_manager%': 1,
michael@0 336
michael@0 337 # Enable FTP support by default.
michael@0 338 'disable_ftp_support%': 0,
michael@0 339
michael@0 340 # XInput2 multitouch support is disabled by default (use_xi2_mt=0).
michael@0 341 # Setting to non-zero value enables XI2 MT. When XI2 MT is enabled,
michael@0 342 # the input value also defines the required XI2 minor minimum version.
michael@0 343 # For example, use_xi2_mt=2 means XI2.2 or above version is required.
michael@0 344 'use_xi2_mt%': 0,
michael@0 345
michael@0 346 # Use of precompiled headers on Windows.
michael@0 347 #
michael@0 348 # This is on by default in VS 2010, but off by default for VS
michael@0 349 # 2008 because of complications that it can cause with our
michael@0 350 # trybots etc.
michael@0 351 #
michael@0 352 # This variable may be explicitly set to 1 (enabled) or 0
michael@0 353 # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
michael@0 354 # This setting will override the default.
michael@0 355 #
michael@0 356 # Note that a setting of 1 is probably suitable for most or all
michael@0 357 # Windows developers using VS 2008, since precompiled headers
michael@0 358 # provide a build speedup of 20-25%. There are a couple of
michael@0 359 # small workarounds you may need to use when using VS 2008 (but
michael@0 360 # not 2010), see
michael@0 361 # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders
michael@0 362 # for details.
michael@0 363 'chromium_win_pch%': 0,
michael@0 364
michael@0 365 # Set this to true when building with Clang.
michael@0 366 # See http://code.google.com/p/chromium/wiki/Clang for details.
michael@0 367 'clang%': 0,
michael@0 368
michael@0 369 # Enable plug-in installation by default.
michael@0 370 'enable_plugin_installation%': 1,
michael@0 371
michael@0 372 # Enable protector service by default.
michael@0 373 'enable_protector_service%': 1,
michael@0 374
michael@0 375 # Specifies whether to use canvas_skia.cc in place of platform
michael@0 376 # specific implementations of gfx::Canvas. Affects text drawing in the
michael@0 377 # Chrome UI.
michael@0 378 # TODO(asvitkine): Enable this on all platforms and delete this flag.
michael@0 379 # http://crbug.com/105550
michael@0 380 'use_canvas_skia%': 0,
michael@0 381
michael@0 382 # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
michael@0 383 # with one of those tools.
michael@0 384 'build_for_tool%': '',
michael@0 385
michael@0 386 # Whether tests targets should be run, archived or just have the
michael@0 387 # dependencies verified. All the tests targets have the '_run' suffix,
michael@0 388 # e.g. base_unittests_run runs the target base_unittests. The test target
michael@0 389 # always calls tools/swarm_client/isolate.py. See the script's --help for
michael@0 390 # more information and the valid --mode values. Meant to be overriden with
michael@0 391 # GYP_DEFINES.
michael@0 392 # TODO(maruel): Converted the default from 'check' to 'noop' so work can
michael@0 393 # be done while the builders are being reconfigured to check out test data
michael@0 394 # files.
michael@0 395 'test_isolation_mode%': 'noop',
michael@0 396 # It must not be '<(PRODUCT_DIR)' alone, the '/' is necessary otherwise
michael@0 397 # gyp will remove duplicate flags, causing isolate.py to be confused.
michael@0 398 'test_isolation_outdir%': '<(PRODUCT_DIR)/isolate',
michael@0 399
michael@0 400 # Force rlz to use chrome's networking stack.
michael@0 401 'force_rlz_use_chrome_net%': 1,
michael@0 402
michael@0 403 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
michael@0 404 'wix_path%': '<(DEPTH)/third_party/wix',
michael@0 405
michael@0 406 'conditions': [
michael@0 407 # TODO(epoger): Figure out how to set use_skia=1 for Mac outside of
michael@0 408 # the 'conditions' clause. Initial attempts resulted in chromium and
michael@0 409 # webkit disagreeing on its setting.
michael@0 410 ['OS=="mac"', {
michael@0 411 'use_skia%': 1,
michael@0 412 }, {
michael@0 413 'use_skia%': 1,
michael@0 414 }],
michael@0 415
michael@0 416 # A flag for POSIX platforms
michael@0 417 ['OS=="win"', {
michael@0 418 'os_posix%': 0,
michael@0 419 }, {
michael@0 420 'os_posix%': 1,
michael@0 421 }],
michael@0 422
michael@0 423 # NSS usage.
michael@0 424 ['(OS=="linux" or OS=="solaris" or os_bsd==1) and use_openssl==0', {
michael@0 425 'use_nss%': 1,
michael@0 426 }, {
michael@0 427 'use_nss%': 0,
michael@0 428 }],
michael@0 429
michael@0 430 # Flags to use X11 on non-Mac POSIX platforms
michael@0 431 ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android"', {
michael@0 432 'use_glib%': 0,
michael@0 433 'use_x11%': 0,
michael@0 434 }, {
michael@0 435 'use_glib%': 1,
michael@0 436 'use_x11%': 1,
michael@0 437 }],
michael@0 438
michael@0 439 # We always use skia text rendering in Aura on Windows, since GDI
michael@0 440 # doesn't agree with our BackingStore.
michael@0 441 # TODO(beng): remove once skia text rendering is on by default.
michael@0 442 ['use_aura==1 and OS=="win"', {
michael@0 443 'enable_skia_text%': 1,
michael@0 444 }],
michael@0 445
michael@0 446 # A flag to enable or disable our compile-time dependency
michael@0 447 # on gnome-keyring. If that dependency is disabled, no gnome-keyring
michael@0 448 # support will be available. This option is useful
michael@0 449 # for Linux distributions and for Aura.
michael@0 450 ['chromeos==1 or use_aura==1', {
michael@0 451 'use_gnome_keyring%': 0,
michael@0 452 }, {
michael@0 453 'use_gnome_keyring%': 1,
michael@0 454 }],
michael@0 455
michael@0 456 ['toolkit_uses_gtk==1 or OS=="mac" or OS=="ios"', {
michael@0 457 # GTK+, Mac and iOS want Title Case strings
michael@0 458 'use_titlecase_in_grd_files%': 1,
michael@0 459 }],
michael@0 460
michael@0 461 # Enable file manager extension on Chrome OS.
michael@0 462 ['chromeos==1', {
michael@0 463 'file_manager_extension%': 1,
michael@0 464 }, {
michael@0 465 'file_manager_extension%': 0,
michael@0 466 }],
michael@0 467
michael@0 468 ['OS=="win" or OS=="mac" or (OS=="linux" and use_aura==0)', {
michael@0 469 'enable_one_click_signin%': 1,
michael@0 470 }],
michael@0 471
michael@0 472 ['OS=="android"', {
michael@0 473 'enable_extensions%': 0,
michael@0 474 'enable_printing%': 0,
michael@0 475 'enable_themes%': 0,
michael@0 476 'enable_webrtc%': 0,
michael@0 477 'proprietary_codecs%': 1,
michael@0 478 'remoting%': 0,
michael@0 479 }],
michael@0 480
michael@0 481 ['OS=="ios"', {
michael@0 482 'configuration_policy%': 0,
michael@0 483 'disable_ftp_support%': 1,
michael@0 484 'enable_automation%': 0,
michael@0 485 'enable_extensions%': 0,
michael@0 486 'enable_printing%': 0,
michael@0 487 'enable_themes%': 0,
michael@0 488 'enable_webrtc%': 0,
michael@0 489 'notifications%': 0,
michael@0 490 'remoting%': 0,
michael@0 491 }],
michael@0 492
michael@0 493 # Use GPU accelerated cross process image transport by default
michael@0 494 # on linux builds with the Aura window manager
michael@0 495 ['use_aura==1 and OS=="linux"', {
michael@0 496 'ui_compositor_image_transport%': 1,
michael@0 497 }, {
michael@0 498 'ui_compositor_image_transport%': 0,
michael@0 499 }],
michael@0 500
michael@0 501 # Turn precompiled headers on by default for VS 2010.
michael@0 502 ['OS=="win" and MSVS_VERSION=="2010" and buildtype!="Official"', {
michael@0 503 'chromium_win_pch%': 1
michael@0 504 }],
michael@0 505
michael@0 506 ['use_aura==1 or chromeos==1 or OS=="android"', {
michael@0 507 'enable_plugin_installation%': 0,
michael@0 508 }, {
michael@0 509 'enable_plugin_installation%': 1,
michael@0 510 }],
michael@0 511
michael@0 512 ['OS=="android" or OS=="ios"', {
michael@0 513 'enable_protector_service%': 0,
michael@0 514 }, {
michael@0 515 'enable_protector_service%': 1,
michael@0 516 }],
michael@0 517
michael@0 518 # linux_use_gold_binary: whether to use the binary checked into
michael@0 519 # third_party/gold.
michael@0 520 ['OS=="linux"', {
michael@0 521 'linux_use_gold_binary%': 1,
michael@0 522 }, {
michael@0 523 'linux_use_gold_binary%': 0,
michael@0 524 }],
michael@0 525
michael@0 526 # linux_use_gold_flags: whether to use build flags that rely on gold.
michael@0 527 # On by default for x64 Linux. Temporarily off for ChromeOS as
michael@0 528 # it failed on a buildbot.
michael@0 529 ['OS=="linux" and chromeos==0', {
michael@0 530 'linux_use_gold_flags%': 1,
michael@0 531 }, {
michael@0 532 'linux_use_gold_flags%': 0,
michael@0 533 }],
michael@0 534
michael@0 535 ['OS=="android"', {
michael@0 536 'enable_captive_portal_detection%': 0,
michael@0 537 }, {
michael@0 538 'enable_captive_portal_detection%': 1,
michael@0 539 }],
michael@0 540
michael@0 541 # Enable Skia UI text drawing incrementally on different platforms.
michael@0 542 # http://crbug.com/105550
michael@0 543 #
michael@0 544 # On Aura, this allows per-tile painting to be used in the browser
michael@0 545 # compositor.
michael@0 546 ['OS!="mac" and OS!="android"', {
michael@0 547 'use_canvas_skia%': 1,
michael@0 548 }],
michael@0 549
michael@0 550 ['chromeos==1', {
michael@0 551 # When building for ChromeOS we dont want Chromium to use libjpeg_turbo.
michael@0 552 'use_libjpeg_turbo%': 0,
michael@0 553 }],
michael@0 554
michael@0 555 ['OS=="android"', {
michael@0 556 # When building as part of the Android system, use system libraries
michael@0 557 # where possible to reduce ROM size.
michael@0 558 'use_system_libjpeg%': '<(android_build_type)',
michael@0 559 }],
michael@0 560 ],
michael@0 561
michael@0 562 # Set this to 1 to use the Google-internal file containing
michael@0 563 # official API keys for Google Chrome even in a developer build.
michael@0 564 # Setting this variable explicitly to 1 will cause your build to
michael@0 565 # fail if the internal file is missing.
michael@0 566 #
michael@0 567 # Set this to 0 to not use the internal file, even when it
michael@0 568 # exists in your checkout.
michael@0 569 #
michael@0 570 # Leave set to 2 to have this variable implicitly set to 1 if
michael@0 571 # you have src/google_apis/internal/google_chrome_api_keys.h in
michael@0 572 # your checkout, and implicitly set to 0 if not.
michael@0 573 #
michael@0 574 # Note that official builds always behave as if this variable
michael@0 575 # was explicitly set to 1, i.e. they always use official keys,
michael@0 576 # and will fail to build if the internal file is missing.
michael@0 577 'use_official_google_api_keys%': 2,
michael@0 578
michael@0 579 # Set these to bake the specified API keys and OAuth client
michael@0 580 # IDs/secrets into your build.
michael@0 581 #
michael@0 582 # If you create a build without values baked in, you can instead
michael@0 583 # set environment variables to provide the keys at runtime (see
michael@0 584 # src/google_apis/google_api_keys.h for details). Features that
michael@0 585 # require server-side APIs may fail to work if no keys are
michael@0 586 # provided.
michael@0 587 #
michael@0 588 # Note that if you are building an official build or if
michael@0 589 # use_official_google_api_keys has been set to 1 (explicitly or
michael@0 590 # implicitly), these values will be ignored and the official
michael@0 591 # keys will be used instead.
michael@0 592 'google_api_key%': '',
michael@0 593 'google_default_client_id%': '',
michael@0 594 'google_default_client_secret%': '',
michael@0 595 },
michael@0 596
michael@0 597 # Copy conditionally-set variables out one scope.
michael@0 598 'branding%': '<(branding)',
michael@0 599 'buildtype%': '<(buildtype)',
michael@0 600 'target_arch%': '<(target_arch)',
michael@0 601 'host_arch%': '<(host_arch)',
michael@0 602 'library%': 'static_library',
michael@0 603 'toolkit_views%': '<(toolkit_views)',
michael@0 604 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
michael@0 605 'use_aura%': '<(use_aura)',
michael@0 606 'use_ash%': '<(use_ash)',
michael@0 607 'use_openssl%': '<(use_openssl)',
michael@0 608 'use_ibus%': '<(use_ibus)',
michael@0 609 'use_nss%': '<(use_nss)',
michael@0 610 'os_bsd%': '<(os_bsd)',
michael@0 611 'os_posix%': '<(os_posix)',
michael@0 612 'use_glib%': '<(use_glib)',
michael@0 613 'toolkit_uses_gtk%': '<(toolkit_uses_gtk)',
michael@0 614 'use_skia%': '<(use_skia)',
michael@0 615 'use_x11%': '<(use_x11)',
michael@0 616 'use_gnome_keyring%': '<(use_gnome_keyring)',
michael@0 617 'linux_fpic%': '<(linux_fpic)',
michael@0 618 'enable_pepper_threading%': '<(enable_pepper_threading)',
michael@0 619 'chromeos%': '<(chromeos)',
michael@0 620 'enable_viewport%': '<(enable_viewport)',
michael@0 621 'enable_hidpi%': '<(enable_hidpi)',
michael@0 622 'enable_touch_ui%': '<(enable_touch_ui)',
michael@0 623 'use_xi2_mt%':'<(use_xi2_mt)',
michael@0 624 'file_manager_extension%': '<(file_manager_extension)',
michael@0 625 'inside_chromium_build%': '<(inside_chromium_build)',
michael@0 626 'fastbuild%': '<(fastbuild)',
michael@0 627 'dcheck_always_on%': '<(dcheck_always_on)',
michael@0 628 'python_ver%': '<(python_ver)',
michael@0 629 'arm_version%': '<(arm_version)',
michael@0 630 'armv7%': '<(armv7)',
michael@0 631 'arm_neon%': '<(arm_neon)',
michael@0 632 'arm_neon_optional%': '<(arm_neon_optional)',
michael@0 633 'sysroot%': '<(sysroot)',
michael@0 634 'system_libdir%': '<(system_libdir)',
michael@0 635 'component%': '<(component)',
michael@0 636 'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)',
michael@0 637 'use_third_party_translations%': '<(use_third_party_translations)',
michael@0 638 'remoting%': '<(remoting)',
michael@0 639 'enable_one_click_signin%': '<(enable_one_click_signin)',
michael@0 640 'enable_webrtc%': '<(enable_webrtc)',
michael@0 641 'chromium_win_pch%': '<(chromium_win_pch)',
michael@0 642 'configuration_policy%': '<(configuration_policy)',
michael@0 643 'safe_browsing%': '<(safe_browsing)',
michael@0 644 'input_speech%': '<(input_speech)',
michael@0 645 'notifications%': '<(notifications)',
michael@0 646 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
michael@0 647 'asan%': '<(asan)',
michael@0 648 'tsan%': '<(tsan)',
michael@0 649 'clang_type_profiler%': '<(clang_type_profiler)',
michael@0 650 'order_profiling%': '<(order_profiling)',
michael@0 651 'order_text_section%': '<(order_text_section)',
michael@0 652 'enable_extensions%': '<(enable_extensions)',
michael@0 653 'enable_web_intents%': '<(enable_web_intents)',
michael@0 654 'enable_web_intents_tag%': '<(enable_web_intents_tag)',
michael@0 655 'enable_plugin_installation%': '<(enable_plugin_installation)',
michael@0 656 'enable_protector_service%': '<(enable_protector_service)',
michael@0 657 'enable_session_service%': '<(enable_session_service)',
michael@0 658 'enable_themes%': '<(enable_themes)',
michael@0 659 'use_oem_wallpaper%': '<(use_oem_wallpaper)',
michael@0 660 'enable_background%': '<(enable_background)',
michael@0 661 'linux_use_gold_binary%': '<(linux_use_gold_binary)',
michael@0 662 'linux_use_gold_flags%': '<(linux_use_gold_flags)',
michael@0 663 'use_canvas_skia%': '<(use_canvas_skia)',
michael@0 664 'test_isolation_mode%': '<(test_isolation_mode)',
michael@0 665 'test_isolation_outdir%': '<(test_isolation_outdir)',
michael@0 666 'enable_automation%': '<(enable_automation)',
michael@0 667 'enable_printing%': '<(enable_printing)',
michael@0 668 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
michael@0 669 'disable_ftp_support%': '<(disable_ftp_support)',
michael@0 670 'force_rlz_use_chrome_net%': '<(force_rlz_use_chrome_net)',
michael@0 671 'enable_task_manager%': '<(enable_task_manager)',
michael@0 672 'sas_dll_path%': '<(sas_dll_path)',
michael@0 673 'wix_path%': '<(wix_path)',
michael@0 674 'android_upstream_bringup%': '<(android_upstream_bringup)',
michael@0 675 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
michael@0 676 'use_system_libjpeg%': '<(use_system_libjpeg)',
michael@0 677 'android_build_type%': '<(android_build_type)',
michael@0 678 'use_official_google_api_keys%': '<(use_official_google_api_keys)',
michael@0 679 'google_api_key%': '<(google_api_key)',
michael@0 680 'google_default_client_id%': '<(google_default_client_id)',
michael@0 681 'google_default_client_secret%': '<(google_default_client_secret)',
michael@0 682
michael@0 683 # Use system yasm instead of bundled one.
michael@0 684 'use_system_yasm%': 0,
michael@0 685
michael@0 686 # Default to enabled PIE; this is important for ASLR but we may need to be
michael@0 687 # able to turn it off for various reasons.
michael@0 688 'linux_disable_pie%': 0,
michael@0 689
michael@0 690 # The release channel that this build targets. This is used to restrict
michael@0 691 # channel-specific build options, like which installer packages to create.
michael@0 692 # The default is 'all', which does no channel-specific filtering.
michael@0 693 'channel%': 'all',
michael@0 694
michael@0 695 # Override chromium_mac_pch and set it to 0 to suppress the use of
michael@0 696 # precompiled headers on the Mac. Prefix header injection may still be
michael@0 697 # used, but prefix headers will not be precompiled. This is useful when
michael@0 698 # using distcc to distribute a build to compile slaves that don't
michael@0 699 # share the same compiler executable as the system driving the compilation,
michael@0 700 # because precompiled headers rely on pointers into a specific compiler
michael@0 701 # executable's image. Setting this to 0 is needed to use an experimental
michael@0 702 # Linux-Mac cross compiler distcc farm.
michael@0 703 'chromium_mac_pch%': 1,
michael@0 704
michael@0 705 # The default value for mac_strip in target_defaults. This cannot be
michael@0 706 # set there, per the comment about variable% in a target_defaults.
michael@0 707 'mac_strip_release%': 1,
michael@0 708
michael@0 709 # Set to 1 to enable code coverage. In addition to build changes
michael@0 710 # (e.g. extra CFLAGS), also creates a new target in the src/chrome
michael@0 711 # project file called "coverage".
michael@0 712 # Currently ignored on Windows.
michael@0 713 'coverage%': 0,
michael@0 714
michael@0 715 # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
michael@0 716 # This is useful for parallel compilation tools which can't support /Zi.
michael@0 717 # Only used on Windows.
michael@0 718 'win_z7%' : 0,
michael@0 719
michael@0 720 # Although base/allocator lets you select a heap library via an
michael@0 721 # environment variable, the libcmt shim it uses sometimes gets in
michael@0 722 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
michael@0 723 # 'win_use_allocator_shim': 0,
michael@0 724 # 'win_release_RuntimeLibrary': 2
michael@0 725 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
michael@0 726 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt
michael@0 727
michael@0 728 # Whether usage of OpenMAX is enabled.
michael@0 729 'enable_openmax%': 0,
michael@0 730
michael@0 731 # Whether proprietary audio/video codecs are assumed to be included with
michael@0 732 # this build (only meaningful if branding!=Chrome).
michael@0 733 'proprietary_codecs%': 0,
michael@0 734
michael@0 735 # TODO(bradnelson): eliminate this when possible.
michael@0 736 # To allow local gyp files to prevent release.vsprops from being included.
michael@0 737 # Yes(1) means include release.vsprops.
michael@0 738 # Once all vsprops settings are migrated into gyp, this can go away.
michael@0 739 'msvs_use_common_release%': 1,
michael@0 740
michael@0 741 # TODO(bradnelson): eliminate this when possible.
michael@0 742 # To allow local gyp files to override additional linker options for msvs.
michael@0 743 # Yes(1) means set use the common linker options.
michael@0 744 'msvs_use_common_linker_extras%': 1,
michael@0 745
michael@0 746 # TODO(sgk): eliminate this if possible.
michael@0 747 # It would be nicer to support this via a setting in 'target_defaults'
michael@0 748 # in chrome/app/locales/locales.gypi overriding the setting in the
michael@0 749 # 'Debug' configuration in the 'target_defaults' dict below,
michael@0 750 # but that doesn't work as we'd like.
michael@0 751 'msvs_debug_link_incremental%': '2',
michael@0 752
michael@0 753 # Needed for some of the largest modules.
michael@0 754 'msvs_debug_link_nonincremental%': '1',
michael@0 755
michael@0 756 # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
michael@0 757 # to get incremental linking to be faster in debug builds.
michael@0 758 'incremental_chrome_dll%': '0',
michael@0 759
michael@0 760 # The default settings for third party code for treating
michael@0 761 # warnings-as-errors. Ideally, this would not be required, however there
michael@0 762 # is some third party code that takes a long time to fix/roll. So, this
michael@0 763 # flag allows us to have warnings as errors in general to prevent
michael@0 764 # regressions in most modules, while working on the bits that are
michael@0 765 # remaining.
michael@0 766 'win_third_party_warn_as_error%': 'true',
michael@0 767
michael@0 768 # This is the location of the sandbox binary. Chrome looks for this before
michael@0 769 # running the zygote process. If found, and SUID, it will be used to
michael@0 770 # sandbox the zygote process and, thus, all renderer processes.
michael@0 771 'linux_sandbox_path%': '',
michael@0 772
michael@0 773 # Set this to true to enable SELinux support.
michael@0 774 'selinux%': 0,
michael@0 775
michael@0 776 # Clang stuff.
michael@0 777 'clang%': '<(clang)',
michael@0 778 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
michael@0 779
michael@0 780 # These two variables can be set in GYP_DEFINES while running
michael@0 781 # |gclient runhooks| to let clang run a plugin in every compilation.
michael@0 782 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
michael@0 783 # Example:
michael@0 784 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
michael@0 785
michael@0 786 'clang_load%': '',
michael@0 787 'clang_add_plugin%': '',
michael@0 788
michael@0 789 # The default type of gtest.
michael@0 790 'gtest_target_type%': 'executable',
michael@0 791
michael@0 792 # Enable sampling based profiler.
michael@0 793 # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
michael@0 794 'profiling%': '0',
michael@0 795
michael@0 796 # Enable strict glibc debug mode.
michael@0 797 'glibcxx_debug%': 0,
michael@0 798
michael@0 799 # Override whether we should use Breakpad on Linux. I.e. for Chrome bot.
michael@0 800 'linux_breakpad%': 0,
michael@0 801 # And if we want to dump symbols for Breakpad-enabled builds.
michael@0 802 'linux_dump_symbols%': 0,
michael@0 803 # And if we want to strip the binary after dumping symbols.
michael@0 804 'linux_strip_binary%': 0,
michael@0 805 # Strip the test binaries needed for Linux reliability tests.
michael@0 806 'linux_strip_reliability_tests%': 0,
michael@0 807
michael@0 808 # Enable TCMalloc.
michael@0 809 'linux_use_tcmalloc%': 1,
michael@0 810
michael@0 811 # Disable TCMalloc's debugallocation.
michael@0 812 'linux_use_debugallocation%': 0,
michael@0 813
michael@0 814 # Disable TCMalloc's heapchecker.
michael@0 815 'linux_use_heapchecker%': 0,
michael@0 816
michael@0 817 # Disable shadow stack keeping used by heapcheck to unwind the stacks
michael@0 818 # better.
michael@0 819 'linux_keep_shadow_stacks%': 0,
michael@0 820
michael@0 821 # Set to 1 to link against libgnome-keyring instead of using dlopen().
michael@0 822 'linux_link_gnome_keyring%': 0,
michael@0 823 # Set to 1 to link against gsettings APIs instead of using dlopen().
michael@0 824 'linux_link_gsettings%': 0,
michael@0 825
michael@0 826 # Set Thumb compilation flags.
michael@0 827 'arm_thumb%': 0,
michael@0 828
michael@0 829 # Set ARM fpu compilation flags (only meaningful if armv7==1 and
michael@0 830 # arm_neon==0).
michael@0 831 'arm_fpu%': 'vfpv3',
michael@0 832
michael@0 833 # Set ARM float abi compilation flag.
michael@0 834 'arm_float_abi%': 'softfp',
michael@0 835
michael@0 836 # Enable new NPDevice API.
michael@0 837 'enable_new_npdevice_api%': 0,
michael@0 838
michael@0 839 # Enable EGLImage support in OpenMAX
michael@0 840 'enable_eglimage%': 1,
michael@0 841
michael@0 842 # Enable a variable used elsewhere throughout the GYP files to determine
michael@0 843 # whether to compile in the sources for the GPU plugin / process.
michael@0 844 'enable_gpu%': 1,
michael@0 845
michael@0 846 # .gyp files or targets should set chromium_code to 1 if they build
michael@0 847 # Chromium-specific code, as opposed to external code. This variable is
michael@0 848 # used to control such things as the set of warnings to enable, and
michael@0 849 # whether warnings are treated as errors.
michael@0 850 'chromium_code%': 0,
michael@0 851
michael@0 852 'release_valgrind_build%': 0,
michael@0 853
michael@0 854 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
michael@0 855 'enable_wexit_time_destructors%': 0,
michael@0 856
michael@0 857 # Set to 1 to compile with the built in pdf viewer.
michael@0 858 'internal_pdf%': 0,
michael@0 859
michael@0 860 # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
michael@0 861 'internal_gles2_conform_tests%': 0,
michael@0 862
michael@0 863 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
michael@0 864 # so Cocoa is happy (http://crbug.com/20441).
michael@0 865 'locales': [
michael@0 866 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
michael@0 867 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
michael@0 868 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
michael@0 869 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
michael@0 870 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
michael@0 871 'vi', 'zh-CN', 'zh-TW',
michael@0 872 ],
michael@0 873
michael@0 874 # Pseudo locales are special locales which are used for testing and
michael@0 875 # debugging. They don't get copied to the final app. For more info,
michael@0 876 # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi
michael@0 877 'pseudo_locales': [
michael@0 878 'fake-bidi',
michael@0 879 ],
michael@0 880
michael@0 881 'grit_defines': [],
michael@0 882
michael@0 883 # If debug_devtools is set to 1, JavaScript files for DevTools are
michael@0 884 # stored as is and loaded from disk. Otherwise, a concatenated file
michael@0 885 # is stored in resources.pak. It is still possible to load JS files
michael@0 886 # from disk by passing --debug-devtools cmdline switch.
michael@0 887 'debug_devtools%': 0,
michael@0 888
michael@0 889 # The Java Bridge is not compiled in by default.
michael@0 890 'java_bridge%': 0,
michael@0 891
michael@0 892 # Code signing for iOS binaries. The bots need to be able to disable this.
michael@0 893 'chromium_ios_signing%': 1,
michael@0 894
michael@0 895 # This flag is only used when disable_nacl==0 and disables all those
michael@0 896 # subcomponents which would require the installation of a native_client
michael@0 897 # untrusted toolchain.
michael@0 898 'disable_nacl_untrusted%': 0,
michael@0 899
michael@0 900 # Disable Dart by default.
michael@0 901 'enable_dart%': 0,
michael@0 902
michael@0 903 # The desired version of Windows SDK can be set in ~/.gyp/include.gypi.
michael@0 904 'msbuild_toolset%': '',
michael@0 905
michael@0 906 # Native Client is enabled by default.
michael@0 907 'disable_nacl%': 0,
michael@0 908
michael@0 909 # Whether to build full debug version for Debug configuration on Android.
michael@0 910 # Compared to full debug version, the default Debug configuration on Android
michael@0 911 # has no full v8 debug, has size optimization and linker gc section, so that
michael@0 912 # we can build a debug version with acceptable size and performance.
michael@0 913 'android_full_debug%': 0,
michael@0 914
michael@0 915 # Sets the default version name and code for Android app, by default we
michael@0 916 # do a developer build.
michael@0 917 'android_app_version_name%': 'Developer Build',
michael@0 918 'android_app_version_code%': 0,
michael@0 919
michael@0 920 'sas_dll_exists': '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(sas_dll_path))',
michael@0 921 'wix_exists': '<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(wix_path))',
michael@0 922
michael@0 923 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
michael@0 924 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
michael@0 925
michael@0 926 'conditions': [
michael@0 927 ['"<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(windows_sdk_default_path))"=="True"', {
michael@0 928 'windows_sdk_path%': '<(windows_sdk_default_path)',
michael@0 929 }, {
michael@0 930 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
michael@0 931 }],
michael@0 932 ['OS=="win" and "<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(directx_sdk_default_path))"=="True"', {
michael@0 933 'directx_sdk_path%': '<(directx_sdk_default_path)',
michael@0 934 }, {
michael@0 935 'directx_sdk_path%': '$(DXSDK_DIR)',
michael@0 936 }],
michael@0 937 # If use_official_google_api_keys is already set (to 0 or 1), we
michael@0 938 # do none of the implicit checking. If it is set to 1 and the
michael@0 939 # internal keys file is missing, the build will fail at compile
michael@0 940 # time. If it is set to 0 and keys are not provided by other
michael@0 941 # means, a warning will be printed at compile time.
michael@0 942 ['use_official_google_api_keys==2', {
michael@0 943 'use_official_google_api_keys%':
michael@0 944 '<!(<(PYTHON) <(DEPTH)/google_apis/build/check_internal.py <(DEPTH)/google_apis/internal/google_chrome_api_keys.h)',
michael@0 945 }],
michael@0 946 ['os_posix==1 and OS!="mac" and OS!="ios"', {
michael@0 947 # Figure out the python architecture to decide if we build pyauto.
michael@0 948 # disabled for mozilla because windows != mac and this runs a shell script
michael@0 949 # 'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/<(system_libdir)/libpython<(python_ver).so.1.0)',
michael@0 950 'conditions': [
michael@0 951 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
michael@0 952 # that it takes effect here.
michael@0 953 # disabled for Mozilla since it doesn't use this, and 'msys' messes $(CXX) up
michael@0 954 ['build_with_mozilla==0 and clang==0 and asan==0 and tsan==0', {
michael@0 955 # This will set gcc_version to XY if you are running gcc X.Y.*.
michael@0 956 'gcc_version%': '<!(<(PYTHON) <(DEPTH)/build/compiler_version.py)',
michael@0 957 }, {
michael@0 958 'gcc_version%': 0,
michael@0 959 }],
michael@0 960 ['branding=="Chrome"', {
michael@0 961 'linux_breakpad%': 1,
michael@0 962 }],
michael@0 963 # All Chrome builds have breakpad symbols, but only process the
michael@0 964 # symbols from official builds.
michael@0 965 ['(branding=="Chrome" and buildtype=="Official")', {
michael@0 966 'linux_dump_symbols%': 1,
michael@0 967 }],
michael@0 968 ],
michael@0 969 }], # os_posix==1 and OS!="mac" and OS!="ios"
michael@0 970 ['OS=="ios"', {
michael@0 971 'disable_nacl%': 1,
michael@0 972 'enable_gpu%': 0,
michael@0 973 'icu_use_data_file_flag%': 1,
michael@0 974 'use_system_bzip2%': 1,
michael@0 975 'use_system_libxml%': 1,
michael@0 976 'use_system_sqlite%': 1,
michael@0 977
michael@0 978 # The Mac SDK is set for iOS builds and passed through to Mac
michael@0 979 # sub-builds. This allows the Mac sub-build SDK in an iOS build to be
michael@0 980 # overridden from the command line the same way it is for a Mac build.
michael@0 981 'mac_sdk%': '<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk.py 10.6)',
michael@0 982
michael@0 983 # iOS SDK and deployment target support. The iOS 5.0 SDK is actually
michael@0 984 # what is required, but the value is left blank so when it is set in
michael@0 985 # the project files it will be the "current" iOS SDK. Forcing 5.0
michael@0 986 # even though it is "current" causes Xcode to spit out a warning for
michael@0 987 # every single project file for not using the "current" SDK.
michael@0 988 'ios_sdk%': '',
michael@0 989 'ios_sdk_path%': '',
michael@0 990 'ios_deployment_target%': '4.3',
michael@0 991
michael@0 992 'conditions': [
michael@0 993 # ios_product_name is set to the name of the .app bundle as it should
michael@0 994 # appear on disk.
michael@0 995 ['branding=="Chrome"', {
michael@0 996 'ios_product_name%': 'Chrome',
michael@0 997 }, { # else: branding!="Chrome"
michael@0 998 'ios_product_name%': 'Chromium',
michael@0 999 }],
michael@0 1000 ['branding=="Chrome" and buildtype=="Official"', {
michael@0 1001 'ios_breakpad%': 1,
michael@0 1002 }, { # else: branding!="Chrome" or buildtype!="Official"
michael@0 1003 'ios_breakpad%': 0,
michael@0 1004 }],
michael@0 1005 ],
michael@0 1006 }], # OS=="ios"
michael@0 1007 ['OS=="android"', {
michael@0 1008 # Location of Android NDK.
michael@0 1009 'variables': {
michael@0 1010 'variables': {
michael@0 1011 'variables': {
michael@0 1012 'android_ndk_root%': '<!(/bin/echo -n $ANDROID_NDK_ROOT)',
michael@0 1013 },
michael@0 1014 'android_ndk_root%': '<(android_ndk_root)',
michael@0 1015 'conditions': [
michael@0 1016 ['target_arch == "ia32"', {
michael@0 1017 'android_app_abi%': 'x86',
michael@0 1018 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-9/arch-x86',
michael@0 1019 }],
michael@0 1020 ['target_arch=="arm"', {
michael@0 1021 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-9/arch-arm',
michael@0 1022 'conditions': [
michael@0 1023 ['armv7==0', {
michael@0 1024 'android_app_abi%': 'armeabi',
michael@0 1025 }, {
michael@0 1026 'android_app_abi%': 'armeabi-v7a',
michael@0 1027 }],
michael@0 1028 ],
michael@0 1029 }],
michael@0 1030 ],
michael@0 1031 },
michael@0 1032 'android_ndk_root%': '<(android_ndk_root)',
michael@0 1033 'android_app_abi%': '<(android_app_abi)',
michael@0 1034 'android_ndk_sysroot%': '<(android_ndk_sysroot)',
michael@0 1035 },
michael@0 1036 'android_ndk_root%': '<(android_ndk_root)',
michael@0 1037 'android_ndk_sysroot': '<(android_ndk_sysroot)',
michael@0 1038 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
michael@0 1039 'android_ndk_lib': '<(android_ndk_sysroot)/usr/lib',
michael@0 1040 'android_app_abi%': '<(android_app_abi)',
michael@0 1041
michael@0 1042 # Location of the "strip" binary, used by both gyp and scripts.
michael@0 1043 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
michael@0 1044
michael@0 1045 # Provides an absolute path to PRODUCT_DIR (e.g. out/Release). Used
michael@0 1046 # to specify the output directory for Ant in the Android build.
michael@0 1047 'ant_build_out': '`cd <(PRODUCT_DIR) && pwd -P`',
michael@0 1048
michael@0 1049 # Uses Android's crash report system
michael@0 1050 'linux_breakpad%': 0,
michael@0 1051
michael@0 1052 # Always uses openssl.
michael@0 1053 'use_openssl%': 1,
michael@0 1054
michael@0 1055 'proprietary_codecs%': '<(proprietary_codecs)',
michael@0 1056 'enable_task_manager%': 0,
michael@0 1057 'safe_browsing%': 0,
michael@0 1058 'configuration_policy%': 0,
michael@0 1059 'input_speech%': 0,
michael@0 1060 'enable_web_intents%': 0,
michael@0 1061 'enable_automation%': 0,
michael@0 1062 'java_bridge%': 1,
michael@0 1063 'build_ffmpegsumo%': 0,
michael@0 1064 'linux_use_tcmalloc%': 0,
michael@0 1065
michael@0 1066 # Disable Native Client.
michael@0 1067 'disable_nacl%': 1,
michael@0 1068
michael@0 1069 # Android does not support background apps.
michael@0 1070 'enable_background%': 0,
michael@0 1071
michael@0 1072 # Sessions are store separately in the Java side.
michael@0 1073 'enable_session_service%': 0,
michael@0 1074
michael@0 1075 # Set to 1 once we have a notification system for Android.
michael@0 1076 # http://crbug.com/115320
michael@0 1077 'notifications%': 0,
michael@0 1078
michael@0 1079 'p2p_apis%' : 0,
michael@0 1080
michael@0 1081 # TODO(jrg): when 'gtest_target_type'=='shared_library' and
michael@0 1082 # OS==android, make all gtest_targets depend on
michael@0 1083 # testing/android/native_test.gyp:native_test_apk.
michael@0 1084 'gtest_target_type%': 'shared_library',
michael@0 1085
michael@0 1086 # Uses system APIs for decoding audio and video.
michael@0 1087 'use_libffmpeg%': '0',
michael@0 1088
michael@0 1089 # Always use the chromium skia. The use_system_harfbuzz needs to
michael@0 1090 # match use_system_skia.
michael@0 1091 'use_system_skia%': '0',
michael@0 1092 'use_system_harfbuzz%': '0',
michael@0 1093
michael@0 1094 # Configure crash reporting and build options based on release type.
michael@0 1095 'conditions': [
michael@0 1096 ['buildtype=="Official"', {
michael@0 1097 # Only report crash dumps for Official builds.
michael@0 1098 'linux_breakpad%': 1,
michael@0 1099 }, {
michael@0 1100 'linux_breakpad%': 0,
michael@0 1101 }],
michael@0 1102 ],
michael@0 1103
michael@0 1104 # When building as part of the Android system, use system libraries
michael@0 1105 # where possible to reduce ROM size.
michael@0 1106 # TODO(steveblock): Investigate using the system version of sqlite.
michael@0 1107 'use_system_sqlite%': 0, # '<(android_build_type)',
michael@0 1108 'use_system_expat%': '<(android_build_type)',
michael@0 1109 'use_system_icu%': '<(android_build_type)',
michael@0 1110 'use_system_stlport%': '<(android_build_type)',
michael@0 1111
michael@0 1112 # Copy it out one scope.
michael@0 1113 'android_build_type%': '<(android_build_type)',
michael@0 1114 }], # OS=="android"
michael@0 1115 ['OS=="mac"', {
michael@0 1116 'variables': {
michael@0 1117 # Mac OS X SDK and deployment target support. The SDK identifies
michael@0 1118 # the version of the system headers that will be used, and
michael@0 1119 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
michael@0 1120 # macro. "Maximum allowed" refers to the operating system version
michael@0 1121 # whose APIs are available in the headers. The deployment target
michael@0 1122 # identifies the minimum system version that the built products are
michael@0 1123 # expected to function on. It corresponds to the
michael@0 1124 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
michael@0 1125 # macros are available, #include <AvailabilityMacros.h>. Additional
michael@0 1126 # documentation on these macros is available at
michael@0 1127 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
michael@0 1128 # Chrome normally builds with the Mac OS X 10.6 SDK and sets the
michael@0 1129 # deployment target to 10.6. Other projects, such as O3D, may
michael@0 1130 # override these defaults.
michael@0 1131
michael@0 1132 # Normally, mac_sdk_min is used to find an SDK that Xcode knows
michael@0 1133 # about that is at least the specified version. In official builds,
michael@0 1134 # the SDK must match mac_sdk_min exactly. If the SDK is installed
michael@0 1135 # someplace that Xcode doesn't know about, set mac_sdk_path to the
michael@0 1136 # path to the SDK; when set to a non-empty string, SDK detection
michael@0 1137 # based on mac_sdk_min will be bypassed entirely.
michael@0 1138 'mac_sdk_min%': '10.6',
michael@0 1139 'mac_sdk_path%': '',
michael@0 1140
michael@0 1141 'mac_deployment_target%': '10.6',
michael@0 1142 },
michael@0 1143
michael@0 1144 'mac_sdk_min': '<(mac_sdk_min)',
michael@0 1145 'mac_sdk_path': '<(mac_sdk_path)',
michael@0 1146 'mac_deployment_target': '<(mac_deployment_target)',
michael@0 1147
michael@0 1148 # Enable clang on mac by default!
michael@0 1149 'clang%': 1,
michael@0 1150
michael@0 1151 # Compile in Breakpad support by default so that it can be
michael@0 1152 # tested, even if it is not enabled by default at runtime.
michael@0 1153 'mac_breakpad_compiled_in%': 1,
michael@0 1154 'conditions': [
michael@0 1155 # mac_product_name is set to the name of the .app bundle as it should
michael@0 1156 # appear on disk. This duplicates data from
michael@0 1157 # chrome/app/theme/chromium/BRANDING and
michael@0 1158 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
michael@0 1159 # these names into the build system.
michael@0 1160 ['branding=="Chrome"', {
michael@0 1161 'mac_product_name%': 'Google Chrome',
michael@0 1162 }, { # else: branding!="Chrome"
michael@0 1163 'mac_product_name%': 'Chromium',
michael@0 1164 }],
michael@0 1165
michael@0 1166 ['branding=="Chrome" and buildtype=="Official"', {
michael@0 1167 'mac_sdk%': '<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
michael@0 1168 # Enable uploading crash dumps.
michael@0 1169 'mac_breakpad_uploads%': 1,
michael@0 1170 # Enable dumping symbols at build time for use by Mac Breakpad.
michael@0 1171 'mac_breakpad%': 1,
michael@0 1172 # Enable Keystone auto-update support.
michael@0 1173 'mac_keystone%': 1,
michael@0 1174 }, { # else: branding!="Chrome" or buildtype!="Official"
michael@0 1175 'mac_sdk%': '<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
michael@0 1176 'mac_breakpad_uploads%': 0,
michael@0 1177 'mac_breakpad%': 0,
michael@0 1178 'mac_keystone%': 0,
michael@0 1179 }],
michael@0 1180 ],
michael@0 1181 }], # OS=="mac"
michael@0 1182
michael@0 1183 ['OS=="win"', {
michael@0 1184 'conditions': [
michael@0 1185 ['component=="shared_library"', {
michael@0 1186 'win_use_allocator_shim%': 0,
michael@0 1187 }],
michael@0 1188 ['component=="shared_library" and "<(GENERATOR)"=="ninja"', {
michael@0 1189 # Only enabled by default for ninja because it's buggy in VS.
michael@0 1190 # Not enabled for component=static_library because some targets
michael@0 1191 # are too large and the toolchain fails due to the size of the
michael@0 1192 # .obj files.
michael@0 1193 'incremental_chrome_dll%': 1,
michael@0 1194 }],
michael@0 1195 # Don't do incremental linking for large modules on 32-bit.
michael@0 1196 ['MSVS_OS_BITS==32', {
michael@0 1197 'msvs_large_module_debug_link_mode%': '1', # No
michael@0 1198 },{
michael@0 1199 'msvs_large_module_debug_link_mode%': '2', # Yes
michael@0 1200 }],
michael@0 1201 ['MSVS_VERSION=="2010e" or MSVS_VERSION=="2008e" or MSVS_VERSION=="2005e"', {
michael@0 1202 'msvs_express%': 1,
michael@0 1203 'secure_atl%': 0,
michael@0 1204 },{
michael@0 1205 'msvs_express%': 0,
michael@0 1206 'secure_atl%': 1,
michael@0 1207 }],
michael@0 1208 ],
michael@0 1209 'nacl_win64_defines': [
michael@0 1210 # This flag is used to minimize dependencies when building
michael@0 1211 # Native Client loader for 64-bit Windows.
michael@0 1212 'NACL_WIN64',
michael@0 1213 ],
michael@0 1214 }],
michael@0 1215
michael@0 1216 ['os_posix==1 and chromeos==0 and OS!="android"', {
michael@0 1217 'use_cups%': 1,
michael@0 1218 }, {
michael@0 1219 'use_cups%': 0,
michael@0 1220 }],
michael@0 1221
michael@0 1222 # Native Client glibc toolchain is enabled by default except on arm.
michael@0 1223 ['target_arch=="arm"', {
michael@0 1224 'disable_glibc%': 1,
michael@0 1225 }, {
michael@0 1226 'disable_glibc%': 0,
michael@0 1227 }],
michael@0 1228
michael@0 1229 # Disable SSE2 when building for ARM or MIPS.
michael@0 1230 ['target_arch=="arm" or target_arch=="mipsel"', {
michael@0 1231 'disable_sse2%': 1,
michael@0 1232 }, {
michael@0 1233 'disable_sse2%': '<(disable_sse2)',
michael@0 1234 }],
michael@0 1235
michael@0 1236 # Set the relative path from this file to the GYP file of the JPEG
michael@0 1237 # library used by Chromium.
michael@0 1238 ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
michael@0 1239 # Configuration for using the system libjeg is here.
michael@0 1240 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp',
michael@0 1241 }, {
michael@0 1242 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp',
michael@0 1243 }],
michael@0 1244
michael@0 1245 # Options controlling the use of GConf (the classic GNOME configuration
michael@0 1246 # system) and GIO, which contains GSettings (the new GNOME config system).
michael@0 1247 ['chromeos==1', {
michael@0 1248 'use_gconf%': 0,
michael@0 1249 'use_gio%': 0,
michael@0 1250 }, {
michael@0 1251 'use_gconf%': 1,
michael@0 1252 'use_gio%': 1,
michael@0 1253 }],
michael@0 1254
michael@0 1255 # Set up -D and -E flags passed into grit.
michael@0 1256 ['branding=="Chrome"', {
michael@0 1257 # TODO(mmoss) The .grd files look for _google_chrome, but for
michael@0 1258 # consistency they should look for google_chrome_build like C++.
michael@0 1259 'grit_defines': ['-D', '_google_chrome',
michael@0 1260 '-E', 'CHROMIUM_BUILD=google_chrome'],
michael@0 1261 }, {
michael@0 1262 'grit_defines': ['-D', '_chromium',
michael@0 1263 '-E', 'CHROMIUM_BUILD=chromium'],
michael@0 1264 }],
michael@0 1265 ['chromeos==1', {
michael@0 1266 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
michael@0 1267 }],
michael@0 1268 ['toolkit_views==1', {
michael@0 1269 'grit_defines': ['-D', 'toolkit_views'],
michael@0 1270 }],
michael@0 1271 ['use_aura==1', {
michael@0 1272 'grit_defines': ['-D', 'use_aura'],
michael@0 1273 }],
michael@0 1274 ['use_ash==1', {
michael@0 1275 'grit_defines': ['-D', 'use_ash'],
michael@0 1276 }],
michael@0 1277 ['use_nss==1', {
michael@0 1278 'grit_defines': ['-D', 'use_nss'],
michael@0 1279 }],
michael@0 1280 ['file_manager_extension==1', {
michael@0 1281 'grit_defines': ['-D', 'file_manager_extension'],
michael@0 1282 }],
michael@0 1283 ['remoting==1', {
michael@0 1284 'grit_defines': ['-D', 'remoting'],
michael@0 1285 }],
michael@0 1286 ['use_titlecase_in_grd_files==1', {
michael@0 1287 'grit_defines': ['-D', 'use_titlecase'],
michael@0 1288 }],
michael@0 1289 ['use_third_party_translations==1', {
michael@0 1290 'grit_defines': ['-D', 'use_third_party_translations'],
michael@0 1291 'locales': [
michael@0 1292 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia',
michael@0 1293 'ka', 'ku', 'kw', 'ms', 'ug'
michael@0 1294 ],
michael@0 1295 }],
michael@0 1296 ['OS=="android"', {
michael@0 1297 'grit_defines': ['-D', 'android'],
michael@0 1298 }],
michael@0 1299 ['OS=="mac"', {
michael@0 1300 'grit_defines': ['-D', 'scale_factors=2x'],
michael@0 1301 }],
michael@0 1302 ['OS == "ios"', {
michael@0 1303 'grit_defines': [
michael@0 1304 # define for iOS specific resources.
michael@0 1305 '-D', 'ios',
michael@0 1306 # iOS uses a whitelist to filter resources.
michael@0 1307 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
michael@0 1308 ],
michael@0 1309 }],
michael@0 1310 ['enable_extensions==1', {
michael@0 1311 'grit_defines': ['-D', 'enable_extensions'],
michael@0 1312 }],
michael@0 1313 ['enable_printing==1', {
michael@0 1314 'grit_defines': ['-D', 'enable_printing'],
michael@0 1315 }],
michael@0 1316 ['enable_themes==1', {
michael@0 1317 'grit_defines': ['-D', 'enable_themes'],
michael@0 1318 }],
michael@0 1319 ['use_oem_wallpaper==1', {
michael@0 1320 'grit_defines': ['-D', 'use_oem_wallpaper'],
michael@0 1321 }],
michael@0 1322 ['clang_use_chrome_plugins==1 and OS!="win"', {
michael@0 1323 'clang_chrome_plugins_flags': [
michael@0 1324 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
michael@0 1325 ],
michael@0 1326 }],
michael@0 1327
michael@0 1328 ['enable_web_intents_tag==1', {
michael@0 1329 'grit_defines': ['-D', 'enable_web_intents_tag'],
michael@0 1330 }],
michael@0 1331
michael@0 1332 ['asan==1', {
michael@0 1333 'clang%': 1,
michael@0 1334 }],
michael@0 1335 ['asan==1 and OS=="mac"', {
michael@0 1336 # See http://crbug.com/145503.
michael@0 1337 'component': "static_library",
michael@0 1338 }],
michael@0 1339 ['tsan==1', {
michael@0 1340 'clang%': 1,
michael@0 1341 }],
michael@0 1342
michael@0 1343 ['OS=="linux" and clang_type_profiler==1', {
michael@0 1344 'clang%': 1,
michael@0 1345 'clang_use_chrome_plugins%': 0,
michael@0 1346 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
michael@0 1347 }],
michael@0 1348
michael@0 1349 # On valgrind bots, override the optimizer settings so we don't inline too
michael@0 1350 # much and make the stacks harder to figure out.
michael@0 1351 #
michael@0 1352 # TODO(rnk): Kill off variables that no one else uses and just implement
michael@0 1353 # them under a build_for_tool== condition.
michael@0 1354 ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
michael@0 1355 # gcc flags
michael@0 1356 'mac_debug_optimization': '1',
michael@0 1357 'mac_release_optimization': '1',
michael@0 1358 'release_optimize': '1',
michael@0 1359 'no_gc_sections': 1,
michael@0 1360 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
michael@0 1361 '-fno-builtin -fno-optimize-sibling-calls',
michael@0 1362 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
michael@0 1363 '-fno-builtin -fno-optimize-sibling-calls',
michael@0 1364
michael@0 1365 # MSVS flags for TSan on Pin and Windows.
michael@0 1366 'win_debug_RuntimeChecks': '0',
michael@0 1367 'win_debug_disable_iterator_debugging': '1',
michael@0 1368 'win_debug_Optimization': '1',
michael@0 1369 'win_debug_InlineFunctionExpansion': '0',
michael@0 1370 'win_release_InlineFunctionExpansion': '0',
michael@0 1371 'win_release_OmitFramePointers': '0',
michael@0 1372
michael@0 1373 'linux_use_tcmalloc': 1,
michael@0 1374 'release_valgrind_build': 1,
michael@0 1375 'werror': '',
michael@0 1376 'component': 'static_library',
michael@0 1377 'use_system_zlib': 0,
michael@0 1378 }],
michael@0 1379
michael@0 1380 # Build tweaks for DrMemory.
michael@0 1381 # TODO(rnk): Combine with tsan config to share the builder.
michael@0 1382 # http://crbug.com/108155
michael@0 1383 ['build_for_tool=="drmemory"', {
michael@0 1384 # These runtime checks force initialization of stack vars which blocks
michael@0 1385 # DrMemory's uninit detection.
michael@0 1386 'win_debug_RuntimeChecks': '0',
michael@0 1387 # Iterator debugging is slow.
michael@0 1388 'win_debug_disable_iterator_debugging': '1',
michael@0 1389 # Try to disable optimizations that mess up stacks in a release build.
michael@0 1390 'win_release_InlineFunctionExpansion': '0',
michael@0 1391 'win_release_OmitFramePointers': '0',
michael@0 1392 # Ditto for debug, to support bumping win_debug_Optimization.
michael@0 1393 'win_debug_InlineFunctionExpansion': 0,
michael@0 1394 'win_debug_OmitFramePointers': 0,
michael@0 1395 # Keep the code under #ifndef NVALGRIND.
michael@0 1396 'release_valgrind_build': 1,
michael@0 1397 }],
michael@0 1398 ],
michael@0 1399
michael@0 1400 # List of default apps to install in new profiles. The first list contains
michael@0 1401 # the source files as found in svn. The second list, used only for linux,
michael@0 1402 # contains the destination location for each of the files. When a crx
michael@0 1403 # is added or removed from the list, the chrome/browser/resources/
michael@0 1404 # default_apps/external_extensions.json file must also be updated.
michael@0 1405 'default_apps_list': [
michael@0 1406 'browser/resources/default_apps/external_extensions.json',
michael@0 1407 'browser/resources/default_apps/gmail.crx',
michael@0 1408 'browser/resources/default_apps/search.crx',
michael@0 1409 'browser/resources/default_apps/youtube.crx',
michael@0 1410 'browser/resources/default_apps/drive.crx',
michael@0 1411 'browser/resources/default_apps/docs.crx',
michael@0 1412 ],
michael@0 1413 'default_apps_list_linux_dest': [
michael@0 1414 '<(PRODUCT_DIR)/default_apps/external_extensions.json',
michael@0 1415 '<(PRODUCT_DIR)/default_apps/gmail.crx',
michael@0 1416 '<(PRODUCT_DIR)/default_apps/search.crx',
michael@0 1417 '<(PRODUCT_DIR)/default_apps/youtube.crx',
michael@0 1418 '<(PRODUCT_DIR)/default_apps/drive.crx',
michael@0 1419 '<(PRODUCT_DIR)/default_apps/docs.crx',
michael@0 1420 ],
michael@0 1421 },
michael@0 1422 'target_defaults': {
michael@0 1423 'variables': {
michael@0 1424 # The condition that operates on chromium_code is in a target_conditions
michael@0 1425 # section, and will not have access to the default fallback value of
michael@0 1426 # chromium_code at the top of this file, or to the chromium_code
michael@0 1427 # variable placed at the root variables scope of .gyp files, because
michael@0 1428 # those variables are not set at target scope. As a workaround,
michael@0 1429 # if chromium_code is not set at target scope, define it in target scope
michael@0 1430 # to contain whatever value it has during early variable expansion.
michael@0 1431 # That's enough to make it available during target conditional
michael@0 1432 # processing.
michael@0 1433 'chromium_code%': '<(chromium_code)',
michael@0 1434
michael@0 1435 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
michael@0 1436 'win_release_Optimization%': '2', # 2 = /Os
michael@0 1437 'win_debug_Optimization%': '0', # 0 = /Od
michael@0 1438
michael@0 1439 # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
michael@0 1440 # Tri-state: blank is default, 1 on, 0 off
michael@0 1441 'win_release_OmitFramePointers%': '0',
michael@0 1442 # Tri-state: blank is default, 1 on, 0 off
michael@0 1443 'win_debug_OmitFramePointers%': '',
michael@0 1444
michael@0 1445 # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
michael@0 1446 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off
michael@0 1447
michael@0 1448 # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
michael@0 1449 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off,
michael@0 1450 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
michael@0 1451
michael@0 1452 # VS inserts quite a lot of extra checks to algorithms like
michael@0 1453 # std::partial_sort in Debug build which make them O(N^2)
michael@0 1454 # instead of O(N*logN). This is particularly slow under memory
michael@0 1455 # tools like ThreadSanitizer so we want it to be disablable.
michael@0 1456 # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
michael@0 1457 'win_debug_disable_iterator_debugging%': '0',
michael@0 1458
michael@0 1459 'release_extra_cflags%': '',
michael@0 1460 'debug_extra_cflags%': '',
michael@0 1461
michael@0 1462 'release_valgrind_build%': '<(release_valgrind_build)',
michael@0 1463
michael@0 1464 # the non-qualified versions are widely assumed to be *nix-only
michael@0 1465 'win_release_extra_cflags%': '',
michael@0 1466 'win_debug_extra_cflags%': '',
michael@0 1467
michael@0 1468 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
michael@0 1469 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
michael@0 1470
michael@0 1471 # Only used by Windows build for now. Can be used to build into a
michael@0 1472 # differet output directory, e.g., a build_dir_prefix of VS2010_ would
michael@0 1473 # output files in src/build/VS2010_{Debug,Release}.
michael@0 1474 'build_dir_prefix%': '',
michael@0 1475
michael@0 1476 # Targets are by default not nacl untrusted code.
michael@0 1477 'nacl_untrusted_build%': 0,
michael@0 1478
michael@0 1479 'conditions': [
michael@0 1480 ['OS=="win" and component=="shared_library"', {
michael@0 1481 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
michael@0 1482 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
michael@0 1483 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
michael@0 1484 }, {
michael@0 1485 # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
michael@0 1486 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
michael@0 1487 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
michael@0 1488 }],
michael@0 1489 ['OS=="ios"', {
michael@0 1490 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
michael@0 1491 'mac_release_optimization%': 's', # Use -Os unless overridden
michael@0 1492 'mac_debug_optimization%': '0', # Use -O0 unless overridden
michael@0 1493 }, {
michael@0 1494 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
michael@0 1495 'mac_release_optimization%': '3', # Use -O3 unless overridden
michael@0 1496 'mac_debug_optimization%': '0', # Use -O0 unless overridden
michael@0 1497 }],
michael@0 1498 ],
michael@0 1499 },
michael@0 1500 'conditions': [
michael@0 1501 ['OS=="linux" and linux_use_tcmalloc==1 and clang_type_profiler==1', {
michael@0 1502 'cflags_cc!': ['-fno-rtti'],
michael@0 1503 'cflags_cc+': [
michael@0 1504 '-frtti',
michael@0 1505 '-gline-tables-only',
michael@0 1506 '-fintercept-allocation-functions',
michael@0 1507 ],
michael@0 1508 'defines': ['TYPE_PROFILING'],
michael@0 1509 'dependencies': [
michael@0 1510 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
michael@0 1511 ],
michael@0 1512 }],
michael@0 1513 ['OS=="win" and "<(msbuild_toolset)"!=""', {
michael@0 1514 'msbuild_toolset': '<(msbuild_toolset)',
michael@0 1515 }],
michael@0 1516 ['branding=="Chrome"', {
michael@0 1517 'defines': ['GOOGLE_CHROME_BUILD'],
michael@0 1518 }, { # else: branding!="Chrome"
michael@0 1519 'defines': ['CHROMIUM_BUILD'],
michael@0 1520 }],
michael@0 1521 ['OS=="mac" and component=="shared_library"', {
michael@0 1522 'xcode_settings': {
michael@0 1523 'DYLIB_INSTALL_NAME_BASE': '@rpath',
michael@0 1524 'LD_RUNPATH_SEARCH_PATHS': [
michael@0 1525 # For unbundled binaries.
michael@0 1526 '@loader_path/.',
michael@0 1527 # For bundled binaries, to get back from Binary.app/Contents/MacOS.
michael@0 1528 '@loader_path/../../..',
michael@0 1529 ],
michael@0 1530 },
michael@0 1531 }],
michael@0 1532 ['branding=="Chrome" and (OS=="win" or OS=="mac")', {
michael@0 1533 'defines': ['ENABLE_RLZ'],
michael@0 1534 }],
michael@0 1535 ['component=="shared_library"', {
michael@0 1536 'defines': ['COMPONENT_BUILD'],
michael@0 1537 }],
michael@0 1538 ['toolkit_views==1', {
michael@0 1539 'defines': ['TOOLKIT_VIEWS=1'],
michael@0 1540 }],
michael@0 1541 ['ui_compositor_image_transport==1', {
michael@0 1542 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
michael@0 1543 }],
michael@0 1544 ['use_aura==1', {
michael@0 1545 'defines': ['USE_AURA=1'],
michael@0 1546 }],
michael@0 1547 ['use_ash==1', {
michael@0 1548 'defines': ['USE_ASH=1'],
michael@0 1549 }],
michael@0 1550 ['use_libjpeg_turbo==1', {
michael@0 1551 'defines': ['USE_LIBJPEG_TURBO=1'],
michael@0 1552 }],
michael@0 1553 ['use_nss==1', {
michael@0 1554 'defines': ['USE_NSS=1'],
michael@0 1555 }],
michael@0 1556 ['enable_one_click_signin==1', {
michael@0 1557 'defines': ['ENABLE_ONE_CLICK_SIGNIN'],
michael@0 1558 }],
michael@0 1559 ['toolkit_uses_gtk==1 and toolkit_views==0', {
michael@0 1560 # TODO(erg): We are progressively sealing up use of deprecated features
michael@0 1561 # in gtk in preparation for an eventual porting to gtk3.
michael@0 1562 'defines': ['GTK_DISABLE_SINGLE_INCLUDES=1'],
michael@0 1563 }],
michael@0 1564 ['chromeos==1', {
michael@0 1565 'defines': ['OS_CHROMEOS=1'],
michael@0 1566 }],
michael@0 1567 ['use_xi2_mt!=0', {
michael@0 1568 'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
michael@0 1569 }],
michael@0 1570 ['file_manager_extension==1', {
michael@0 1571 'defines': ['FILE_MANAGER_EXTENSION=1'],
michael@0 1572 }],
michael@0 1573 ['profiling==1', {
michael@0 1574 'defines': ['ENABLE_PROFILING=1'],
michael@0 1575 }],
michael@0 1576 ['OS=="linux" and glibcxx_debug==1', {
michael@0 1577 'defines': ['_GLIBCXX_DEBUG=1',],
michael@0 1578 'cflags_cc!': ['-fno-rtti'],
michael@0 1579 'cflags_cc+': ['-frtti', '-g'],
michael@0 1580 }],
michael@0 1581 ['OS=="linux"', {
michael@0 1582 # we need lrint(), which is ISOC99, and Xcode
michael@0 1583 # already forces -std=c99 for mac below
michael@0 1584 'defines': ['_ISOC99_SOURCE=1'],
michael@0 1585 }],
michael@0 1586 ['remoting==1', {
michael@0 1587 'defines': ['ENABLE_REMOTING=1'],
michael@0 1588 }],
michael@0 1589 ['enable_webrtc==1', {
michael@0 1590 'defines': ['ENABLE_WEBRTC=1'],
michael@0 1591 }],
michael@0 1592 ['proprietary_codecs==1', {
michael@0 1593 'defines': ['USE_PROPRIETARY_CODECS'],
michael@0 1594 }],
michael@0 1595 ['enable_pepper_threading==1', {
michael@0 1596 'defines': ['ENABLE_PEPPER_THREADING'],
michael@0 1597 }],
michael@0 1598 ['enable_viewport==1', {
michael@0 1599 'defines': ['ENABLE_VIEWPORT'],
michael@0 1600 }],
michael@0 1601 ['configuration_policy==1', {
michael@0 1602 'defines': ['ENABLE_CONFIGURATION_POLICY'],
michael@0 1603 }],
michael@0 1604 ['input_speech==1', {
michael@0 1605 'defines': ['ENABLE_INPUT_SPEECH'],
michael@0 1606 }],
michael@0 1607 ['notifications==1', {
michael@0 1608 'defines': ['ENABLE_NOTIFICATIONS'],
michael@0 1609 }],
michael@0 1610 ['enable_hidpi==1', {
michael@0 1611 'defines': ['ENABLE_HIDPI=1'],
michael@0 1612 }],
michael@0 1613 ['fastbuild!=0', {
michael@0 1614
michael@0 1615 'conditions': [
michael@0 1616 # For Windows and Mac, we don't genererate debug information.
michael@0 1617 ['OS=="win" or OS=="mac"', {
michael@0 1618 'msvs_settings': {
michael@0 1619 'VCLinkerTool': {
michael@0 1620 'GenerateDebugInformation': 'false',
michael@0 1621 },
michael@0 1622 'VCCLCompilerTool': {
michael@0 1623 'DebugInformationFormat': '0',
michael@0 1624 }
michael@0 1625 },
michael@0 1626 'xcode_settings': {
michael@0 1627 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
michael@0 1628 },
michael@0 1629 }, { # else: OS != "win", generate less debug information.
michael@0 1630 'variables': {
michael@0 1631 'debug_extra_cflags': '-g1',
michael@0 1632 },
michael@0 1633 }],
michael@0 1634 # Clang creates chubby debug information, which makes linking very
michael@0 1635 # slow. For now, don't create debug information with clang. See
michael@0 1636 # http://crbug.com/70000
michael@0 1637 ['(OS=="linux" or OS=="android") and clang==1', {
michael@0 1638 'variables': {
michael@0 1639 'debug_extra_cflags': '-g0',
michael@0 1640 },
michael@0 1641 }],
michael@0 1642 ], # conditions for fastbuild.
michael@0 1643 }], # fastbuild!=0
michael@0 1644 ['dcheck_always_on!=0', {
michael@0 1645 'defines': ['DCHECK_ALWAYS_ON=1'],
michael@0 1646 }], # dcheck_always_on!=0
michael@0 1647 ['selinux==1', {
michael@0 1648 'defines': ['CHROMIUM_SELINUX=1'],
michael@0 1649 }],
michael@0 1650 ['win_use_allocator_shim==0', {
michael@0 1651 'conditions': [
michael@0 1652 ['OS=="win"', {
michael@0 1653 'defines': ['NO_TCMALLOC'],
michael@0 1654 }],
michael@0 1655 ],
michael@0 1656 }],
michael@0 1657 ['enable_gpu==1', {
michael@0 1658 'defines': [
michael@0 1659 'ENABLE_GPU=1',
michael@0 1660 ],
michael@0 1661 }],
michael@0 1662 ['use_openssl==1', {
michael@0 1663 'defines': [
michael@0 1664 'USE_OPENSSL=1',
michael@0 1665 ],
michael@0 1666 }],
michael@0 1667 ['enable_eglimage==1', {
michael@0 1668 'defines': [
michael@0 1669 'ENABLE_EGLIMAGE=1',
michael@0 1670 ],
michael@0 1671 }],
michael@0 1672 ['use_skia==1', {
michael@0 1673 'defines': [
michael@0 1674 'USE_SKIA=1',
michael@0 1675 ],
michael@0 1676 }],
michael@0 1677 ['coverage!=0', {
michael@0 1678 'conditions': [
michael@0 1679 ['OS=="mac" or OS=="ios"', {
michael@0 1680 'xcode_settings': {
michael@0 1681 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
michael@0 1682 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
michael@0 1683 },
michael@0 1684 }],
michael@0 1685 ['OS=="mac"', {
michael@0 1686 # Add -lgcov for types executable, shared_library, and
michael@0 1687 # loadable_module; not for static_library.
michael@0 1688 # This is a delayed conditional.
michael@0 1689 'target_conditions': [
michael@0 1690 ['_type!="static_library"', {
michael@0 1691 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
michael@0 1692 }],
michael@0 1693 ],
michael@0 1694 }],
michael@0 1695 ['OS=="linux" or OS=="android"', {
michael@0 1696 'cflags': [ '-ftest-coverage',
michael@0 1697 '-fprofile-arcs' ],
michael@0 1698 'link_settings': { 'libraries': [ '-lgcov' ] },
michael@0 1699 }],
michael@0 1700 # Finally, for Windows, we simply turn on profiling.
michael@0 1701 ['OS=="win"', {
michael@0 1702 'msvs_settings': {
michael@0 1703 'VCLinkerTool': {
michael@0 1704 'Profile': 'true',
michael@0 1705 },
michael@0 1706 'VCCLCompilerTool': {
michael@0 1707 # /Z7, not /Zi, so coverage is happyb
michael@0 1708 'DebugInformationFormat': '1',
michael@0 1709 'AdditionalOptions': ['/Yd'],
michael@0 1710 }
michael@0 1711 }
michael@0 1712 }], # OS==win
michael@0 1713 ], # conditions for coverage
michael@0 1714 }], # coverage!=0
michael@0 1715 ['OS=="win"', {
michael@0 1716 'defines': [
michael@0 1717 '__STD_C',
michael@0 1718 '_CRT_SECURE_NO_DEPRECATE',
michael@0 1719 '_SCL_SECURE_NO_DEPRECATE',
michael@0 1720 ],
michael@0 1721 'include_dirs': [
michael@0 1722 '<(DEPTH)/third_party/wtl/include',
michael@0 1723 ],
michael@0 1724 'conditions': [
michael@0 1725 ['win_z7!=0', {
michael@0 1726 'msvs_settings': {
michael@0 1727 # Generates debug info when win_z7=1
michael@0 1728 # even if fastbuild=1 (that makes GenerateDebugInformation false).
michael@0 1729 'VCLinkerTool': {
michael@0 1730 'GenerateDebugInformation': 'true',
michael@0 1731 },
michael@0 1732 'VCCLCompilerTool': {
michael@0 1733 'DebugInformationFormat': '1',
michael@0 1734 }
michael@0 1735 }
michael@0 1736 }],
michael@0 1737 ], # win_z7!=0
michael@0 1738 }], # OS==win
michael@0 1739 ['enable_task_manager==1', {
michael@0 1740 'defines': [
michael@0 1741 'ENABLE_TASK_MANAGER=1',
michael@0 1742 ],
michael@0 1743 }],
michael@0 1744 ['enable_web_intents==1', {
michael@0 1745 'defines': [
michael@0 1746 'ENABLE_WEB_INTENTS=1',
michael@0 1747 ],
michael@0 1748 }],
michael@0 1749 ['enable_extensions==1', {
michael@0 1750 'defines': [
michael@0 1751 'ENABLE_EXTENSIONS=1',
michael@0 1752 ],
michael@0 1753 }],
michael@0 1754 ['OS=="win" and branding=="Chrome"', {
michael@0 1755 'defines': ['ENABLE_SWIFTSHADER'],
michael@0 1756 }],
michael@0 1757 ['enable_dart==1', {
michael@0 1758 'defines': ['WEBKIT_USING_DART=1'],
michael@0 1759 }],
michael@0 1760 ['enable_plugin_installation==1', {
michael@0 1761 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
michael@0 1762 }],
michael@0 1763 ['enable_protector_service==1', {
michael@0 1764 'defines': ['ENABLE_PROTECTOR_SERVICE=1'],
michael@0 1765 }],
michael@0 1766 ['enable_session_service==1', {
michael@0 1767 'defines': ['ENABLE_SESSION_SERVICE=1'],
michael@0 1768 }],
michael@0 1769 ['enable_themes==1', {
michael@0 1770 'defines': ['ENABLE_THEMES=1'],
michael@0 1771 }],
michael@0 1772 ['enable_background==1', {
michael@0 1773 'defines': ['ENABLE_BACKGROUND=1'],
michael@0 1774 }],
michael@0 1775 ['enable_automation==1', {
michael@0 1776 'defines': ['ENABLE_AUTOMATION=1'],
michael@0 1777 }],
michael@0 1778 ['enable_printing==1', {
michael@0 1779 'defines': ['ENABLE_PRINTING=1'],
michael@0 1780 }],
michael@0 1781 ['enable_captive_portal_detection==1', {
michael@0 1782 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
michael@0 1783 }],
michael@0 1784 ['disable_ftp_support==1', {
michael@0 1785 'defines': ['DISABLE_FTP_SUPPORT=1'],
michael@0 1786 }],
michael@0 1787 ], # conditions for 'target_defaults'
michael@0 1788 'target_conditions': [
michael@0 1789 ['enable_wexit_time_destructors==1', {
michael@0 1790 'conditions': [
michael@0 1791 [ 'clang==1', {
michael@0 1792 'cflags': [
michael@0 1793 '-Wexit-time-destructors',
michael@0 1794 ],
michael@0 1795 'xcode_settings': {
michael@0 1796 'WARNING_CFLAGS': [
michael@0 1797 '-Wexit-time-destructors',
michael@0 1798 ],
michael@0 1799 },
michael@0 1800 }],
michael@0 1801 ],
michael@0 1802 }],
michael@0 1803 ['chromium_code==0', {
michael@0 1804 'conditions': [
michael@0 1805 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
michael@0 1806 # We don't want to get warnings from third-party code,
michael@0 1807 # so remove any existing warning-enabling flags like -Wall.
michael@0 1808 'cflags!': [
michael@0 1809 '-Wall',
michael@0 1810 '-Wextra',
michael@0 1811 ],
michael@0 1812 'cflags_cc': [
michael@0 1813 # Don't warn about hash_map in third-party code.
michael@0 1814 '-Wno-deprecated',
michael@0 1815 ],
michael@0 1816 'cflags': [
michael@0 1817 # Don't warn about printf format problems.
michael@0 1818 # This is off by default in gcc but on in Ubuntu's gcc(!).
michael@0 1819 '-Wno-format',
michael@0 1820 ],
michael@0 1821 'cflags_cc!': [
michael@0 1822 # TODO(fischman): remove this.
michael@0 1823 # http://code.google.com/p/chromium/issues/detail?id=90453
michael@0 1824 '-Wsign-compare',
michael@0 1825 ]
michael@0 1826 }],
michael@0 1827 # TODO: Fix all warnings on chromeos too.
michael@0 1828 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
michael@0 1829 'cflags!': [
michael@0 1830 '-Werror',
michael@0 1831 ],
michael@0 1832 }],
michael@0 1833 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
michael@0 1834 'cflags': [
michael@0 1835 # Don't warn about ignoring the return value from e.g. close().
michael@0 1836 # This is off by default in some gccs but on by default in others.
michael@0 1837 # BSD systems do not support this option, since they are usually
michael@0 1838 # using gcc 4.2.1, which does not have this flag yet.
michael@0 1839 '-Wno-unused-result',
michael@0 1840 ],
michael@0 1841 }],
michael@0 1842 [ 'OS=="win"', {
michael@0 1843 'defines': [
michael@0 1844 '_CRT_SECURE_NO_DEPRECATE',
michael@0 1845 '_CRT_NONSTDC_NO_WARNINGS',
michael@0 1846 '_CRT_NONSTDC_NO_DEPRECATE',
michael@0 1847 '_SCL_SECURE_NO_DEPRECATE',
michael@0 1848 ],
michael@0 1849 'msvs_disabled_warnings': [4800],
michael@0 1850 'msvs_settings': {
michael@0 1851 'VCCLCompilerTool': {
michael@0 1852 'WarningLevel': '3',
michael@0 1853 'WarnAsError': '<(win_third_party_warn_as_error)',
michael@0 1854 'Detect64BitPortabilityProblems': 'false',
michael@0 1855 },
michael@0 1856 },
michael@0 1857 'conditions': [
michael@0 1858 ['buildtype=="Official"', {
michael@0 1859 'msvs_settings': {
michael@0 1860 'VCCLCompilerTool': { 'WarnAsError': 'false' },
michael@0 1861 }
michael@0 1862 }],
michael@0 1863 ],
michael@0 1864 }],
michael@0 1865 # TODO(darin): Unfortunately, some third_party code depends on base/
michael@0 1866 [ 'OS=="win" and component=="shared_library"', {
michael@0 1867 'msvs_disabled_warnings': [
michael@0 1868 4251, # class 'std::xx' needs to have dll-interface.
michael@0 1869 ],
michael@0 1870 }],
michael@0 1871 [ 'OS=="mac" or OS=="ios"', {
michael@0 1872 'xcode_settings': {
michael@0 1873 'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
michael@0 1874 },
michael@0 1875 'conditions': [
michael@0 1876 ['buildtype=="Official"', {
michael@0 1877 'xcode_settings': {
michael@0 1878 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
michael@0 1879 },
michael@0 1880 }],
michael@0 1881 ],
michael@0 1882 }],
michael@0 1883 [ 'OS=="ios"', {
michael@0 1884 'xcode_settings': {
michael@0 1885 # TODO(ios): Fix remaining warnings in third-party code, then
michael@0 1886 # remove this; the Mac cleanup didn't get everything that's
michael@0 1887 # flagged in an iOS build.
michael@0 1888 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
michael@0 1889 'RUN_CLANG_STATIC_ANALYZER': 'NO',
michael@0 1890 },
michael@0 1891 }],
michael@0 1892 ],
michael@0 1893 }, {
michael@0 1894 'includes': [
michael@0 1895 # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
michael@0 1896 'filename_rules.gypi',
michael@0 1897 ],
michael@0 1898 # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
michael@0 1899 # C99 macros on Mac and Linux.
michael@0 1900 'defines': [
michael@0 1901 '__STDC_FORMAT_MACROS',
michael@0 1902 ],
michael@0 1903 'conditions': [
michael@0 1904 ['OS=="win"', {
michael@0 1905 # turn on warnings for signed/unsigned mismatch on chromium code.
michael@0 1906 'msvs_settings': {
michael@0 1907 'VCCLCompilerTool': {
michael@0 1908 'AdditionalOptions': ['/we4389'],
michael@0 1909 },
michael@0 1910 },
michael@0 1911 }],
michael@0 1912 ['OS=="win" and component=="shared_library"', {
michael@0 1913 'msvs_disabled_warnings': [
michael@0 1914 4251, # class 'std::xx' needs to have dll-interface.
michael@0 1915 ],
michael@0 1916 }],
michael@0 1917 ],
michael@0 1918 }],
michael@0 1919 ], # target_conditions for 'target_defaults'
michael@0 1920 'default_configuration': 'Debug',
michael@0 1921 'configurations': {
michael@0 1922 # VCLinkerTool LinkIncremental values below:
michael@0 1923 # 0 == default
michael@0 1924 # 1 == /INCREMENTAL:NO
michael@0 1925 # 2 == /INCREMENTAL
michael@0 1926 # Debug links incremental, Release does not.
michael@0 1927 #
michael@0 1928 # Abstract base configurations to cover common attributes.
michael@0 1929 #
michael@0 1930 'Common_Base': {
michael@0 1931 'abstract': 1,
michael@0 1932 'msvs_configuration_attributes': {
michael@0 1933 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
michael@0 1934 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
michael@0 1935 'CharacterSet': '1',
michael@0 1936 },
michael@0 1937 },
michael@0 1938 'x86_Base': {
michael@0 1939 'abstract': 1,
michael@0 1940 'msvs_settings': {
michael@0 1941 'VCLinkerTool': {
michael@0 1942 'TargetMachine': '1',
michael@0 1943 },
michael@0 1944 },
michael@0 1945 'msvs_configuration_platform': 'Win32',
michael@0 1946 },
michael@0 1947 'x64_Base': {
michael@0 1948 'abstract': 1,
michael@0 1949 'msvs_configuration_platform': 'x64',
michael@0 1950 'msvs_settings': {
michael@0 1951 'VCLinkerTool': {
michael@0 1952 'TargetMachine': '17', # x86 - 64
michael@0 1953 'AdditionalLibraryDirectories!':
michael@0 1954 ['<(windows_sdk_path)/Lib/win8/um/x86'],
michael@0 1955 'AdditionalLibraryDirectories':
michael@0 1956 ['<(windows_sdk_path)/Lib/win8/um/x64'],
michael@0 1957 },
michael@0 1958 'VCLibrarianTool': {
michael@0 1959 'AdditionalLibraryDirectories!':
michael@0 1960 ['<(windows_sdk_path)/Lib/win8/um/x86'],
michael@0 1961 'AdditionalLibraryDirectories':
michael@0 1962 ['<(windows_sdk_path)/Lib/win8/um/x64'],
michael@0 1963 },
michael@0 1964 },
michael@0 1965 'defines': [
michael@0 1966 # Not sure if tcmalloc works on 64-bit Windows.
michael@0 1967 'NO_TCMALLOC',
michael@0 1968 ],
michael@0 1969 },
michael@0 1970 'Debug_Base': {
michael@0 1971 'abstract': 1,
michael@0 1972 'defines': [
michael@0 1973 'DYNAMIC_ANNOTATIONS_ENABLED=1',
michael@0 1974 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
michael@0 1975 ],
michael@0 1976 'xcode_settings': {
michael@0 1977 'COPY_PHASE_STRIP': 'NO',
michael@0 1978 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
michael@0 1979 'OTHER_CFLAGS': [
michael@0 1980 '<@(debug_extra_cflags)',
michael@0 1981 ],
michael@0 1982 },
michael@0 1983 'msvs_settings': {
michael@0 1984 'VCCLCompilerTool': {
michael@0 1985 'Optimization': '<(win_debug_Optimization)',
michael@0 1986 'PreprocessorDefinitions': ['_DEBUG'],
michael@0 1987 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
michael@0 1988 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
michael@0 1989 'conditions': [
michael@0 1990 # According to MSVS, InlineFunctionExpansion=0 means
michael@0 1991 # "default inlining", not "/Ob0".
michael@0 1992 # Thus, we have to handle InlineFunctionExpansion==0 separately.
michael@0 1993 ['win_debug_InlineFunctionExpansion==0', {
michael@0 1994 'AdditionalOptions': ['/Ob0'],
michael@0 1995 }],
michael@0 1996 ['win_debug_InlineFunctionExpansion!=""', {
michael@0 1997 'InlineFunctionExpansion':
michael@0 1998 '<(win_debug_InlineFunctionExpansion)',
michael@0 1999 }],
michael@0 2000 ['win_debug_disable_iterator_debugging==1', {
michael@0 2001 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
michael@0 2002 }],
michael@0 2003
michael@0 2004 # if win_debug_OmitFramePointers is blank, leave as default
michael@0 2005 ['win_debug_OmitFramePointers==1', {
michael@0 2006 'OmitFramePointers': 'true',
michael@0 2007 }],
michael@0 2008 ['win_debug_OmitFramePointers==0', {
michael@0 2009 'OmitFramePointers': 'false',
michael@0 2010 # The above is not sufficient (http://crbug.com/106711): it
michael@0 2011 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
michael@0 2012 # perform FPO regardless, so we must explicitly disable.
michael@0 2013 # We still want the false setting above to avoid having
michael@0 2014 # "/Oy /Oy-" and warnings about overriding.
michael@0 2015 'AdditionalOptions': ['/Oy-'],
michael@0 2016 }],
michael@0 2017 ],
michael@0 2018 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
michael@0 2019 },
michael@0 2020 'VCLinkerTool': {
michael@0 2021 'LinkIncremental': '<(msvs_debug_link_incremental)',
michael@0 2022 # ASLR makes debugging with windbg difficult because Chrome.exe and
michael@0 2023 # Chrome.dll share the same base name. As result, windbg will
michael@0 2024 # name the Chrome.dll module like chrome_<base address>, where
michael@0 2025 # <base address> typically changes with each launch. This in turn
michael@0 2026 # means that breakpoints in Chrome.dll don't stick from one launch
michael@0 2027 # to the next. For this reason, we turn ASLR off in debug builds.
michael@0 2028 # Note that this is a three-way bool, where 0 means to pick up
michael@0 2029 # the default setting, 1 is off and 2 is on.
michael@0 2030 'RandomizedBaseAddress': 1,
michael@0 2031 },
michael@0 2032 'VCResourceCompilerTool': {
michael@0 2033 'PreprocessorDefinitions': ['_DEBUG'],
michael@0 2034 },
michael@0 2035 },
michael@0 2036 'conditions': [
michael@0 2037 ['OS=="linux" or OS=="android"', {
michael@0 2038 'target_conditions': [
michael@0 2039 ['_toolset=="target"', {
michael@0 2040 'cflags': [
michael@0 2041 '<@(debug_extra_cflags)',
michael@0 2042 ],
michael@0 2043 }],
michael@0 2044 ],
michael@0 2045 }],
michael@0 2046 # Disabled on iOS because it was causing a crash on startup.
michael@0 2047 # TODO(michelea): investigate, create a reduced test and possibly
michael@0 2048 # submit a radar.
michael@0 2049 ['release_valgrind_build==0 and OS!="ios"', {
michael@0 2050 'xcode_settings': {
michael@0 2051 'OTHER_CFLAGS': [
michael@0 2052 '-fstack-protector-all', # Implies -fstack-protector
michael@0 2053 ],
michael@0 2054 },
michael@0 2055 }],
michael@0 2056 ],
michael@0 2057 },
michael@0 2058 'Release_Base': {
michael@0 2059 'abstract': 1,
michael@0 2060 'defines': [
michael@0 2061 'NDEBUG',
michael@0 2062 ],
michael@0 2063 'xcode_settings': {
michael@0 2064 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
michael@0 2065 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
michael@0 2066 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
michael@0 2067 },
michael@0 2068 'msvs_settings': {
michael@0 2069 'VCCLCompilerTool': {
michael@0 2070 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
michael@0 2071 'conditions': [
michael@0 2072 # In official builds, each target will self-select
michael@0 2073 # an optimization level.
michael@0 2074 ['buildtype!="Official"', {
michael@0 2075 'Optimization': '<(win_release_Optimization)',
michael@0 2076 },
michael@0 2077 ],
michael@0 2078 # According to MSVS, InlineFunctionExpansion=0 means
michael@0 2079 # "default inlining", not "/Ob0".
michael@0 2080 # Thus, we have to handle InlineFunctionExpansion==0 separately.
michael@0 2081 ['win_release_InlineFunctionExpansion==0', {
michael@0 2082 'AdditionalOptions': ['/Ob0'],
michael@0 2083 }],
michael@0 2084 ['win_release_InlineFunctionExpansion!=""', {
michael@0 2085 'InlineFunctionExpansion':
michael@0 2086 '<(win_release_InlineFunctionExpansion)',
michael@0 2087 }],
michael@0 2088
michael@0 2089 # if win_release_OmitFramePointers is blank, leave as default
michael@0 2090 ['win_release_OmitFramePointers==1', {
michael@0 2091 'OmitFramePointers': 'true',
michael@0 2092 }],
michael@0 2093 ['win_release_OmitFramePointers==0', {
michael@0 2094 'OmitFramePointers': 'false',
michael@0 2095 # The above is not sufficient (http://crbug.com/106711): it
michael@0 2096 # simply eliminates an explicit "/Oy", but both /O2 and /Ox
michael@0 2097 # perform FPO regardless, so we must explicitly disable.
michael@0 2098 # We still want the false setting above to avoid having
michael@0 2099 # "/Oy /Oy-" and warnings about overriding.
michael@0 2100 'AdditionalOptions': ['/Oy-'],
michael@0 2101 }],
michael@0 2102 ],
michael@0 2103 'AdditionalOptions': [ '<@(win_release_extra_cflags)', ],
michael@0 2104 },
michael@0 2105 'VCLinkerTool': {
michael@0 2106 # LinkIncremental is a tri-state boolean, where 0 means default
michael@0 2107 # (i.e., inherit from parent solution), 1 means false, and
michael@0 2108 # 2 means true.
michael@0 2109 'LinkIncremental': '1',
michael@0 2110 # This corresponds to the /PROFILE flag which ensures the PDB
michael@0 2111 # file contains FIXUP information (growing the PDB file by about
michael@0 2112 # 5%) but does not otherwise alter the output binary. This
michael@0 2113 # information is used by the Syzygy optimization tool when
michael@0 2114 # decomposing the release image.
michael@0 2115 'Profile': 'true',
michael@0 2116 },
michael@0 2117 },
michael@0 2118 'conditions': [
michael@0 2119 ['msvs_use_common_release', {
michael@0 2120 'includes': ['release.gypi'],
michael@0 2121 }],
michael@0 2122 ['release_valgrind_build==0', {
michael@0 2123 'defines': [
michael@0 2124 'NVALGRIND',
michael@0 2125 'DYNAMIC_ANNOTATIONS_ENABLED=0',
michael@0 2126 ],
michael@0 2127 }, {
michael@0 2128 'defines': [
michael@0 2129 'DYNAMIC_ANNOTATIONS_ENABLED=1',
michael@0 2130 'WTF_USE_DYNAMIC_ANNOTATIONS=1',
michael@0 2131 ],
michael@0 2132 }],
michael@0 2133 ['win_use_allocator_shim==0', {
michael@0 2134 'defines': ['NO_TCMALLOC'],
michael@0 2135 }],
michael@0 2136 ['OS=="linux"', {
michael@0 2137 'target_conditions': [
michael@0 2138 ['_toolset=="target"', {
michael@0 2139 'cflags': [
michael@0 2140 '<@(release_extra_cflags)',
michael@0 2141 ],
michael@0 2142 }],
michael@0 2143 ],
michael@0 2144 }],
michael@0 2145 ],
michael@0 2146 },
michael@0 2147 #
michael@0 2148 # Concrete configurations
michael@0 2149 #
michael@0 2150 'Debug': {
michael@0 2151 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
michael@0 2152 },
michael@0 2153 'Release': {
michael@0 2154 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
michael@0 2155 },
michael@0 2156 'conditions': [
michael@0 2157 [ 'OS=="win"', {
michael@0 2158 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
michael@0 2159 'Debug_x64': {
michael@0 2160 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
michael@0 2161 },
michael@0 2162 'Release_x64': {
michael@0 2163 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
michael@0 2164 },
michael@0 2165 }],
michael@0 2166 ],
michael@0 2167 },
michael@0 2168 },
michael@0 2169 'conditions': [
michael@0 2170 ['os_posix==1 and OS!="mac" and OS!="ios"', {
michael@0 2171 'target_defaults': {
michael@0 2172 # Enable -Werror by default, but put it in a variable so it can
michael@0 2173 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
michael@0 2174 'variables': {
michael@0 2175 'werror%': '-Werror',
michael@0 2176 'libraries_for_target%': '',
michael@0 2177 },
michael@0 2178 'defines': [
michael@0 2179 '_FILE_OFFSET_BITS=64',
michael@0 2180 ],
michael@0 2181 'cflags': [
michael@0 2182 '<(werror)', # See note above about the werror variable.
michael@0 2183 '-pthread',
michael@0 2184 '-fno-exceptions',
michael@0 2185 '-fno-strict-aliasing', # See http://crbug.com/32204
michael@0 2186 '-Wall',
michael@0 2187 # TODO(evan): turn this back on once all the builds work.
michael@0 2188 # '-Wextra',
michael@0 2189 # Don't warn about unused function params. We use those everywhere.
michael@0 2190 '-Wno-unused-parameter',
michael@0 2191 # Don't warn about the "struct foo f = {0};" initialization pattern.
michael@0 2192 '-Wno-missing-field-initializers',
michael@0 2193 # Don't export any symbols (for example, to plugins we dlopen()).
michael@0 2194 # Note: this is *required* to make some plugins work.
michael@0 2195 '-fvisibility=hidden',
michael@0 2196 '-pipe',
michael@0 2197 ],
michael@0 2198 'cflags_cc': [
michael@0 2199 '-fno-rtti',
michael@0 2200 '-fno-threadsafe-statics',
michael@0 2201 # Make inline functions have hidden visiblity by default.
michael@0 2202 # Surprisingly, not covered by -fvisibility=hidden.
michael@0 2203 '-fvisibility-inlines-hidden',
michael@0 2204 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
michael@0 2205 # so we specify it explicitly.
michael@0 2206 # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it.
michael@0 2207 # http://code.google.com/p/chromium/issues/detail?id=90453
michael@0 2208 '-Wsign-compare',
michael@0 2209 ],
michael@0 2210 'ldflags': [
michael@0 2211 '-pthread', '-Wl,-z,noexecstack',
michael@0 2212 ],
michael@0 2213 'libraries' : [
michael@0 2214 '<(libraries_for_target)',
michael@0 2215 ],
michael@0 2216 'configurations': {
michael@0 2217 'Debug_Base': {
michael@0 2218 'variables': {
michael@0 2219 'debug_optimize%': '0',
michael@0 2220 },
michael@0 2221 'defines': [
michael@0 2222 '_DEBUG',
michael@0 2223 ],
michael@0 2224 'cflags': [
michael@0 2225 '-O>(debug_optimize)',
michael@0 2226 '-g',
michael@0 2227 ],
michael@0 2228 'conditions' : [
michael@0 2229 ['OS=="android" and android_full_debug==0', {
michael@0 2230 # Some configurations are copied from Release_Base to reduce
michael@0 2231 # the binary size.
michael@0 2232 'variables': {
michael@0 2233 'debug_optimize%': 's',
michael@0 2234 },
michael@0 2235 'cflags': [
michael@0 2236 '-fomit-frame-pointer',
michael@0 2237 '-fdata-sections',
michael@0 2238 '-ffunction-sections',
michael@0 2239 ],
michael@0 2240 'ldflags': [
michael@0 2241 '-Wl,-O1',
michael@0 2242 '-Wl,--as-needed',
michael@0 2243 '-Wl,--gc-sections',
michael@0 2244 ],
michael@0 2245 }],
michael@0 2246 ],
michael@0 2247 },
michael@0 2248 'Release_Base': {
michael@0 2249 'variables': {
michael@0 2250 'release_optimize%': '2',
michael@0 2251 # Binaries become big and gold is unable to perform GC
michael@0 2252 # and remove unused sections for some of test targets
michael@0 2253 # on 32 bit platform.
michael@0 2254 # (This is currently observed only in chromeos valgrind bots)
michael@0 2255 # The following flag is to disable --gc-sections linker
michael@0 2256 # option for these bots.
michael@0 2257 'no_gc_sections%': 0,
michael@0 2258
michael@0 2259 # TODO(bradnelson): reexamine how this is done if we change the
michael@0 2260 # expansion of configurations
michael@0 2261 'release_valgrind_build%': 0,
michael@0 2262 },
michael@0 2263 'cflags': [
michael@0 2264 '-O<(release_optimize)',
michael@0 2265 # Don't emit the GCC version ident directives, they just end up
michael@0 2266 # in the .comment section taking up binary size.
michael@0 2267 '-fno-ident',
michael@0 2268 # Put data and code in their own sections, so that unused symbols
michael@0 2269 # can be removed at link time with --gc-sections.
michael@0 2270 '-fdata-sections',
michael@0 2271 '-ffunction-sections',
michael@0 2272 ],
michael@0 2273 'ldflags': [
michael@0 2274 # Specifically tell the linker to perform optimizations.
michael@0 2275 # See http://lwn.net/Articles/192624/ .
michael@0 2276 '-Wl,-O1',
michael@0 2277 '-Wl,--as-needed',
michael@0 2278 ],
michael@0 2279 'conditions' : [
michael@0 2280 ['no_gc_sections==0', {
michael@0 2281 'ldflags': [
michael@0 2282 '-Wl,--gc-sections',
michael@0 2283 ],
michael@0 2284 }],
michael@0 2285 ['OS=="android"', {
michael@0 2286 'variables': {
michael@0 2287 'release_optimize%': 's',
michael@0 2288 },
michael@0 2289 'cflags': [
michael@0 2290 '-fomit-frame-pointer',
michael@0 2291 ],
michael@0 2292 }],
michael@0 2293 ['clang==1', {
michael@0 2294 'cflags!': [
michael@0 2295 '-fno-ident',
michael@0 2296 ],
michael@0 2297 }],
michael@0 2298 ['profiling==1', {
michael@0 2299 'cflags': [
michael@0 2300 '-fno-omit-frame-pointer',
michael@0 2301 '-g',
michael@0 2302 ],
michael@0 2303 }],
michael@0 2304 ],
michael@0 2305 },
michael@0 2306 },
michael@0 2307 'variants': {
michael@0 2308 'coverage': {
michael@0 2309 'cflags': ['-fprofile-arcs', '-ftest-coverage'],
michael@0 2310 'ldflags': ['-fprofile-arcs'],
michael@0 2311 },
michael@0 2312 'profile': {
michael@0 2313 'cflags': ['-pg', '-g'],
michael@0 2314 'ldflags': ['-pg'],
michael@0 2315 },
michael@0 2316 'symbols': {
michael@0 2317 'cflags': ['-g'],
michael@0 2318 },
michael@0 2319 },
michael@0 2320 'conditions': [
michael@0 2321 ['target_arch=="ia32"', {
michael@0 2322 'target_conditions': [
michael@0 2323 ['_toolset=="target"', {
michael@0 2324 'asflags': [
michael@0 2325 # Needed so that libs with .s files (e.g. libicudata.a)
michael@0 2326 # are compatible with the general 32-bit-ness.
michael@0 2327 '-32',
michael@0 2328 ],
michael@0 2329 # All floating-point computations on x87 happens in 80-bit
michael@0 2330 # precision. Because the C and C++ language standards allow
michael@0 2331 # the compiler to keep the floating-point values in higher
michael@0 2332 # precision than what's specified in the source and doing so
michael@0 2333 # is more efficient than constantly rounding up to 64-bit or
michael@0 2334 # 32-bit precision as specified in the source, the compiler,
michael@0 2335 # especially in the optimized mode, tries very hard to keep
michael@0 2336 # values in x87 floating-point stack (in 80-bit precision)
michael@0 2337 # as long as possible. This has important side effects, that
michael@0 2338 # the real value used in computation may change depending on
michael@0 2339 # how the compiler did the optimization - that is, the value
michael@0 2340 # kept in 80-bit is different than the value rounded down to
michael@0 2341 # 64-bit or 32-bit. There are possible compiler options to
michael@0 2342 # make this behavior consistent (e.g. -ffloat-store would keep
michael@0 2343 # all floating-values in the memory, thus force them to be
michael@0 2344 # rounded to its original precision) but they have significant
michael@0 2345 # runtime performance penalty.
michael@0 2346 #
michael@0 2347 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
michael@0 2348 # which keep floating-point values in SSE registers in its
michael@0 2349 # native precision (32-bit for single precision, and 64-bit
michael@0 2350 # for double precision values). This means the floating-point
michael@0 2351 # value used during computation does not change depending on
michael@0 2352 # how the compiler optimized the code, since the value is
michael@0 2353 # always kept in its specified precision.
michael@0 2354 'conditions': [
michael@0 2355 ['branding=="Chromium" and disable_sse2==0', {
michael@0 2356 'cflags': [
michael@0 2357 '-march=pentium4',
michael@0 2358 '-msse2',
michael@0 2359 '-mfpmath=sse',
michael@0 2360 ],
michael@0 2361 }],
michael@0 2362 # ChromeOS targets Pinetrail, which is sse3, but most of the
michael@0 2363 # benefit comes from sse2 so this setting allows ChromeOS
michael@0 2364 # to build on other CPUs. In the future -march=atom would
michael@0 2365 # help but requires a newer compiler.
michael@0 2366 ['chromeos==1 and disable_sse2==0', {
michael@0 2367 'cflags': [
michael@0 2368 '-msse2',
michael@0 2369 ],
michael@0 2370 }],
michael@0 2371 # Install packages have started cropping up with
michael@0 2372 # different headers between the 32-bit and 64-bit
michael@0 2373 # versions, so we have to shadow those differences off
michael@0 2374 # and make sure a 32-bit-on-64-bit build picks up the
michael@0 2375 # right files.
michael@0 2376 # For android build, use NDK headers instead of host headers
michael@0 2377 ['host_arch!="ia32" and OS!="android"', {
michael@0 2378 'include_dirs+': [
michael@0 2379 '/usr/include32',
michael@0 2380 ],
michael@0 2381 }],
michael@0 2382 ],
michael@0 2383 'target_conditions': [
michael@0 2384 ['_toolset=="target" and OS!="android"', {
michael@0 2385 # -mmmx allows mmintrin.h to be used for mmx intrinsics.
michael@0 2386 # video playback is mmx and sse2 optimized.
michael@0 2387 'cflags': [
michael@0 2388 '-m32',
michael@0 2389 '-mmmx',
michael@0 2390 ],
michael@0 2391 'ldflags': [
michael@0 2392 '-m32',
michael@0 2393 ],
michael@0 2394 'cflags_mozilla': [
michael@0 2395 '-m32',
michael@0 2396 '-mmmx',
michael@0 2397 ],
michael@0 2398 }],
michael@0 2399 ],
michael@0 2400 }],
michael@0 2401 ],
michael@0 2402 }],
michael@0 2403 ['target_arch=="arm"', {
michael@0 2404 'target_conditions': [
michael@0 2405 ['_toolset=="target"', {
michael@0 2406 'cflags_cc': [
michael@0 2407 # The codesourcery arm-2009q3 toolchain warns at that the ABI
michael@0 2408 # has changed whenever it encounters a varargs function. This
michael@0 2409 # silences those warnings, as they are not helpful and
michael@0 2410 # clutter legitimate warnings.
michael@0 2411 '-Wno-abi',
michael@0 2412 ],
michael@0 2413 'conditions': [
michael@0 2414 ['arm_thumb==1', {
michael@0 2415 'cflags': [
michael@0 2416 '-mthumb',
michael@0 2417 ]
michael@0 2418 }],
michael@0 2419 ['armv7==1', {
michael@0 2420 'cflags': [
michael@0 2421 '-march=armv7-a',
michael@0 2422 '-mtune=cortex-a8',
michael@0 2423 '-mfloat-abi=<(arm_float_abi)',
michael@0 2424 ],
michael@0 2425 'conditions': [
michael@0 2426 ['arm_neon==1', {
michael@0 2427 'cflags': [ '-mfpu=neon', ],
michael@0 2428 }, {
michael@0 2429 'cflags': [ '-mfpu=<(arm_fpu)', ],
michael@0 2430 }],
michael@0 2431 ],
michael@0 2432 }],
michael@0 2433 ['OS=="android"', {
michael@0 2434 # Most of the following flags are derived from what Android
michael@0 2435 # uses by default when building for arm, reference for which
michael@0 2436 # can be found in the following file in the Android NDK:
michael@0 2437 # toolchains/arm-linux-androideabi-4.4.3/setup.mk
michael@0 2438 'cflags': [
michael@0 2439 # The tree-sra optimization (scalar replacement for
michael@0 2440 # aggregates enabling subsequent optimizations) leads to
michael@0 2441 # invalid code generation when using the Android NDK's
michael@0 2442 # compiler (r5-r7). This can be verified using
michael@0 2443 # TestWebKitAPI's WTF.Checked_int8_t test.
michael@0 2444 '-fno-tree-sra',
michael@0 2445 '-fuse-ld=gold',
michael@0 2446 '-Wno-psabi',
michael@0 2447 ],
michael@0 2448 # Android now supports .relro sections properly.
michael@0 2449 # NOTE: While these flags enable the generation of .relro
michael@0 2450 # sections, the generated libraries can still be loaded on
michael@0 2451 # older Android platform versions.
michael@0 2452 'ldflags': [
michael@0 2453 '-Wl,-z,relro',
michael@0 2454 '-Wl,-z,now',
michael@0 2455 '-fuse-ld=gold',
michael@0 2456 ],
michael@0 2457 'conditions': [
michael@0 2458 ['arm_thumb == 1', {
michael@0 2459 # Android toolchain doesn't support -mimplicit-it=thumb
michael@0 2460 'cflags!': [ '-Wa,-mimplicit-it=thumb', ],
michael@0 2461 'cflags': [ '-mthumb-interwork', ],
michael@0 2462 }],
michael@0 2463 ['armv7==0', {
michael@0 2464 # Flags suitable for Android emulator
michael@0 2465 'cflags': [
michael@0 2466 '-march=armv5te',
michael@0 2467 '-mtune=xscale',
michael@0 2468 '-msoft-float',
michael@0 2469 ],
michael@0 2470 'defines': [
michael@0 2471 '__ARM_ARCH_5__',
michael@0 2472 '__ARM_ARCH_5T__',
michael@0 2473 '__ARM_ARCH_5E__',
michael@0 2474 '__ARM_ARCH_5TE__',
michael@0 2475 ],
michael@0 2476 }],
michael@0 2477 ['clang==1', {
michael@0 2478 'cflags!': [
michael@0 2479 # Clang does not support the following options.
michael@0 2480 '-mthumb-interwork',
michael@0 2481 '-finline-limit=64',
michael@0 2482 '-fno-tree-sra',
michael@0 2483 '-fuse-ld=gold',
michael@0 2484 '-Wno-psabi',
michael@0 2485 ],
michael@0 2486 }],
michael@0 2487 ],
michael@0 2488 }],
michael@0 2489 ],
michael@0 2490 }],
michael@0 2491 ],
michael@0 2492 }],
michael@0 2493 ['linux_fpic==1', {
michael@0 2494 'cflags': [
michael@0 2495 '-fPIC',
michael@0 2496 ],
michael@0 2497 'ldflags': [
michael@0 2498 '-fPIC',
michael@0 2499 ],
michael@0 2500 }],
michael@0 2501 ['sysroot!=""', {
michael@0 2502 'target_conditions': [
michael@0 2503 ['_toolset=="target"', {
michael@0 2504 'cflags': [
michael@0 2505 '--sysroot=<(sysroot)',
michael@0 2506 ],
michael@0 2507 'ldflags': [
michael@0 2508 '--sysroot=<(sysroot)',
michael@0 2509 ],
michael@0 2510 }]]
michael@0 2511 }],
michael@0 2512 ['clang==1', {
michael@0 2513 'cflags': [
michael@0 2514 '-Wheader-hygiene',
michael@0 2515 # Clang spots more unused functions.
michael@0 2516 '-Wno-unused-function',
michael@0 2517 # Don't die on dtoa code that uses a char as an array index.
michael@0 2518 '-Wno-char-subscripts',
michael@0 2519 # Especially needed for gtest macros using enum values from Mac
michael@0 2520 # system headers.
michael@0 2521 # TODO(pkasting): In C++11 this is legal, so this should be
michael@0 2522 # removed when we change to that. (This is also why we don't
michael@0 2523 # bother fixing all these cases today.)
michael@0 2524 '-Wno-unnamed-type-template-args',
michael@0 2525 # This (rightyfully) complains about 'override', which we use
michael@0 2526 # heavily.
michael@0 2527 '-Wno-c++11-extensions',
michael@0 2528
michael@0 2529 # Warns on switches on enums that cover all enum values but
michael@0 2530 # also contain a default: branch. Chrome is full of that.
michael@0 2531 '-Wno-covered-switch-default',
michael@0 2532
michael@0 2533 # TODO(thakis): Remove this.
michael@0 2534 '-Wno-implicit-conversion-floating-point-to-bool',
michael@0 2535 ],
michael@0 2536 'cflags!': [
michael@0 2537 # Clang doesn't seem to know know this flag.
michael@0 2538 '-mfpmath=sse',
michael@0 2539 ],
michael@0 2540 }],
michael@0 2541 ['clang==1 and clang_use_chrome_plugins==1', {
michael@0 2542 'cflags': [
michael@0 2543 '<@(clang_chrome_plugins_flags)',
michael@0 2544 ],
michael@0 2545 }],
michael@0 2546 ['clang==1 and clang_load!=""', {
michael@0 2547 'cflags': [
michael@0 2548 '-Xclang', '-load', '-Xclang', '<(clang_load)',
michael@0 2549 ],
michael@0 2550 }],
michael@0 2551 ['clang==1 and clang_add_plugin!=""', {
michael@0 2552 'cflags': [
michael@0 2553 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
michael@0 2554 ],
michael@0 2555 }],
michael@0 2556 ['clang==1 and "<(GENERATOR)"=="ninja"', {
michael@0 2557 'cflags': [
michael@0 2558 # See http://crbug.com/110262
michael@0 2559 '-fcolor-diagnostics',
michael@0 2560 ],
michael@0 2561 }],
michael@0 2562 ['asan==1', {
michael@0 2563 'target_conditions': [
michael@0 2564 ['_toolset=="target"', {
michael@0 2565 'cflags': [
michael@0 2566 '-faddress-sanitizer',
michael@0 2567 '-fno-omit-frame-pointer',
michael@0 2568 ],
michael@0 2569 'ldflags': [
michael@0 2570 '-faddress-sanitizer',
michael@0 2571 ],
michael@0 2572 'defines': [
michael@0 2573 'ADDRESS_SANITIZER',
michael@0 2574 ],
michael@0 2575 }],
michael@0 2576 ],
michael@0 2577 }],
michael@0 2578 ['tsan==1', {
michael@0 2579 'target_conditions': [
michael@0 2580 ['_toolset=="target"', {
michael@0 2581 'cflags': [
michael@0 2582 '-fthread-sanitizer',
michael@0 2583 '-fno-omit-frame-pointer',
michael@0 2584 '-fPIE',
michael@0 2585 ],
michael@0 2586 'ldflags': [
michael@0 2587 '-fthread-sanitizer',
michael@0 2588 ],
michael@0 2589 'defines': [
michael@0 2590 'THREAD_SANITIZER',
michael@0 2591 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
michael@0 2592 ],
michael@0 2593 'target_conditions': [
michael@0 2594 ['_type=="executable"', {
michael@0 2595 'ldflags': [
michael@0 2596 '-pie',
michael@0 2597 ],
michael@0 2598 }],
michael@0 2599 ],
michael@0 2600 }],
michael@0 2601 ],
michael@0 2602 }],
michael@0 2603 ['order_profiling!=0 and (chromeos==1 or OS=="linux")', {
michael@0 2604 'target_conditions' : [
michael@0 2605 ['_toolset=="target"', {
michael@0 2606 'cflags': [
michael@0 2607 '-finstrument-functions',
michael@0 2608 # Allow mmx intrinsics to inline, so that the
michael@0 2609 # compiler can expand the intrinsics.
michael@0 2610 '-finstrument-functions-exclude-file-list=mmintrin.h',
michael@0 2611 ],
michael@0 2612 }],
michael@0 2613 ],
michael@0 2614 }],
michael@0 2615 ['linux_breakpad==1', {
michael@0 2616 'cflags': [ '-g' ],
michael@0 2617 'defines': ['USE_LINUX_BREAKPAD'],
michael@0 2618 }],
michael@0 2619 ['linux_use_heapchecker==1', {
michael@0 2620 'variables': {'linux_use_tcmalloc%': 1},
michael@0 2621 'defines': ['USE_HEAPCHECKER'],
michael@0 2622 }],
michael@0 2623 ['linux_use_tcmalloc==0', {
michael@0 2624 'defines': ['NO_TCMALLOC'],
michael@0 2625 }],
michael@0 2626 ['linux_keep_shadow_stacks==1', {
michael@0 2627 'defines': ['KEEP_SHADOW_STACKS'],
michael@0 2628 'cflags': [
michael@0 2629 '-finstrument-functions',
michael@0 2630 # Allow mmx intrinsics to inline, so that the compiler can expand
michael@0 2631 # the intrinsics.
michael@0 2632 '-finstrument-functions-exclude-file-list=mmintrin.h',
michael@0 2633 ],
michael@0 2634 }],
michael@0 2635 ['linux_use_gold_flags==1', {
michael@0 2636 'ldflags': [
michael@0 2637 # Experimentation found that using four linking threads
michael@0 2638 # saved ~20% of link time.
michael@0 2639 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
michael@0 2640 '-Wl,--threads',
michael@0 2641 '-Wl,--thread-count=4',
michael@0 2642 ],
michael@0 2643 'conditions': [
michael@0 2644 ['release_valgrind_build==0', {
michael@0 2645 'target_conditions': [
michael@0 2646 ['_toolset=="target"', {
michael@0 2647 'ldflags': [
michael@0 2648 # There seems to be a conflict of --icf and -pie
michael@0 2649 # in gold which can generate crashy binaries. As
michael@0 2650 # a security measure, -pie takes precendence for
michael@0 2651 # now.
michael@0 2652 #'-Wl,--icf=safe',
michael@0 2653 '-Wl,--icf=none',
michael@0 2654 ],
michael@0 2655 }],
michael@0 2656 ],
michael@0 2657 }],
michael@0 2658 ],
michael@0 2659 }],
michael@0 2660 ['linux_use_gold_binary==1', {
michael@0 2661 'variables': {
michael@0 2662 'conditions': [
michael@0 2663 ['inside_chromium_build==1', {
michael@0 2664 # We pass the path to gold to the compiler. gyp leaves
michael@0 2665 # unspecified what the cwd is when running the compiler,
michael@0 2666 # so the normal gyp path-munging fails us. This hack
michael@0 2667 # gets the right path.
michael@0 2668 'gold_path': '<(PRODUCT_DIR)/../../third_party/gold',
michael@0 2669 }, {
michael@0 2670 'gold_path': '<(PRODUCT_DIR)/../../Source/WebKit/chromium/third_party/gold',
michael@0 2671 }]
michael@0 2672 ]
michael@0 2673 },
michael@0 2674 'ldflags': [
michael@0 2675 # Put our gold binary in the search path for the linker.
michael@0 2676 '-B<(gold_path)',
michael@0 2677 ],
michael@0 2678 }],
michael@0 2679 ],
michael@0 2680 },
michael@0 2681 }],
michael@0 2682 # FreeBSD-specific options; note that most FreeBSD options are set above,
michael@0 2683 # with Linux.
michael@0 2684 ['OS=="freebsd"', {
michael@0 2685 'target_defaults': {
michael@0 2686 'ldflags': [
michael@0 2687 '-Wl,--no-keep-memory',
michael@0 2688 ],
michael@0 2689 },
michael@0 2690 }],
michael@0 2691 # Android-specific options; note that most are set above with Linux.
michael@0 2692 ['OS=="android"', {
michael@0 2693 'variables': {
michael@0 2694 # This is the id for the archived chrome symbols. Each build that
michael@0 2695 # archives symbols is assigned an id which is then added to GYP_DEFINES.
michael@0 2696 # This is written to the device log on crashes just prior to dropping a
michael@0 2697 # tombstone. Tools can determine the location of the archived symbols
michael@0 2698 # from the id.
michael@0 2699 'chrome_symbols_id%': '',
michael@0 2700 'conditions': [
michael@0 2701 # Use shared stlport library when system one used.
michael@0 2702 # Figure this out early since it needs symbols from libgcc.a, so it
michael@0 2703 # has to be before that in the set of libraries.
michael@0 2704 ['use_system_stlport==1', {
michael@0 2705 'android_stlport_library': 'stlport',
michael@0 2706 }, {
michael@0 2707 'android_stlport_library': 'stlport_static',
michael@0 2708 }],
michael@0 2709 ],
michael@0 2710
michael@0 2711 # Placing this variable here prevents from forking libvpx, used
michael@0 2712 # by remoting. Remoting is off, so it needn't built,
michael@0 2713 # so forking it's deps seems like overkill.
michael@0 2714 # But this variable need defined to properly run gyp.
michael@0 2715 # A proper solution is to have an OS==android conditional
michael@0 2716 # in third_party/libvpx/libvpx.gyp to define it.
michael@0 2717 'libvpx_path': 'lib/linux/arm',
michael@0 2718 },
michael@0 2719 'target_defaults': {
michael@0 2720 'variables': {
michael@0 2721 'release_extra_cflags%': '',
michael@0 2722 },
michael@0 2723
michael@0 2724 'target_conditions': [
michael@0 2725 # Settings for building device targets using Android's toolchain.
michael@0 2726 # These are based on the setup.mk file from the Android NDK.
michael@0 2727 #
michael@0 2728 # The NDK Android executable link step looks as follows:
michael@0 2729 # $LDFLAGS
michael@0 2730 # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o
michael@0 2731 # $(PRIVATE_OBJECTS) <-- The .o that we built
michael@0 2732 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
michael@0 2733 # $(TARGET_LIBGCC) <-- libgcc.a
michael@0 2734 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
michael@0 2735 # $(PRIVATE_LDLIBS) <-- System .so
michael@0 2736 # $(TARGET_CRTEND_O) <-- crtend.o
michael@0 2737 #
michael@0 2738 # For now the above are approximated for executables by adding
michael@0 2739 # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
michael@0 2740 # of 'libraries'.
michael@0 2741 #
michael@0 2742 # The NDK Android shared library link step looks as follows:
michael@0 2743 # $LDFLAGS
michael@0 2744 # $(PRIVATE_OBJECTS) <-- The .o that we built
michael@0 2745 # -l,--whole-archive
michael@0 2746 # $(PRIVATE_WHOLE_STATIC_LIBRARIES)
michael@0 2747 # -l,--no-whole-archive
michael@0 2748 # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built
michael@0 2749 # $(TARGET_LIBGCC) <-- libgcc.a
michael@0 2750 # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built
michael@0 2751 # $(PRIVATE_LDLIBS) <-- System .so
michael@0 2752 #
michael@0 2753 # For now, assume that whole static libraries are not needed.
michael@0 2754 #
michael@0 2755 # For both executables and shared libraries, add the proper
michael@0 2756 # libgcc.a to the start of libraries which puts it in the
michael@0 2757 # proper spot after .o and .a files get linked in.
michael@0 2758 #
michael@0 2759 # TODO: The proper thing to do longer-tem would be proper gyp
michael@0 2760 # support for a custom link command line.
michael@0 2761 ['_toolset=="target"', {
michael@0 2762 'conditions': [
michael@0 2763 ['build_with_mozilla==0', {
michael@0 2764 'cflags!': [
michael@0 2765 '-pthread', # Not supported by Android toolchain.
michael@0 2766 ],
michael@0 2767 'cflags': [
michael@0 2768 '-ffunction-sections',
michael@0 2769 '-funwind-tables',
michael@0 2770 '-g',
michael@0 2771 '-fstack-protector',
michael@0 2772 '-fno-short-enums',
michael@0 2773 '-finline-limit=64',
michael@0 2774 '-Wa,--noexecstack',
michael@0 2775 '<@(release_extra_cflags)',
michael@0 2776 ],
michael@0 2777 'ldflags!': [
michael@0 2778 '-pthread', # Not supported by Android toolchain.
michael@0 2779 ],
michael@0 2780 'ldflags': [
michael@0 2781 '-nostdlib',
michael@0 2782 '-Wl,--no-undefined',
michael@0 2783 # Don't export symbols from statically linked libraries.
michael@0 2784 '-Wl,--exclude-libs=ALL',
michael@0 2785 ],
michael@0 2786 'libraries': [
michael@0 2787 '-l<(android_stlport_library)',
michael@0 2788 # Manually link the libgcc.a that the cross compiler uses.
michael@0 2789 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
michael@0 2790 '-lc',
michael@0 2791 '-ldl',
michael@0 2792 '-lstdc++',
michael@0 2793 '-lm',
michael@0 2794 ],
michael@0 2795 'conditions': [
michael@0 2796 ['android_upstream_bringup==1', {
michael@0 2797 'defines': ['ANDROID_UPSTREAM_BRINGUP=1',],
michael@0 2798 }],
michael@0 2799 ['clang==1', {
michael@0 2800 'cflags': [
michael@0 2801 # Work around incompatibilities between bionic and clang
michael@0 2802 # headers.
michael@0 2803 '-D__compiler_offsetof=__builtin_offsetof',
michael@0 2804 '-Dnan=__builtin_nan',
michael@0 2805 ],
michael@0 2806 'conditions': [
michael@0 2807 ['target_arch=="arm"', {
michael@0 2808 'cflags': [
michael@0 2809 '-target arm-linux-androideabi',
michael@0 2810 '-mllvm -arm-enable-ehabi',
michael@0 2811 ],
michael@0 2812 'ldflags': [
michael@0 2813 '-target arm-linux-androideabi',
michael@0 2814 ],
michael@0 2815 }],
michael@0 2816 ['target_arch=="ia32"', {
michael@0 2817 'cflags': [
michael@0 2818 '-target x86-linux-androideabi',
michael@0 2819 ],
michael@0 2820 'ldflags': [
michael@0 2821 '-target x86-linux-androideabi',
michael@0 2822 ],
michael@0 2823 }],
michael@0 2824 ],
michael@0 2825 }],
michael@0 2826 ['android_build_type==0', {
michael@0 2827 'defines': [
michael@0 2828 # The NDK has these things, but doesn't define the constants
michael@0 2829 # to say that it does. Define them here instead.
michael@0 2830 'HAVE_SYS_UIO_H',
michael@0 2831 ],
michael@0 2832 'cflags': [
michael@0 2833 '--sysroot=<(android_ndk_sysroot)',
michael@0 2834 ],
michael@0 2835 'ldflags': [
michael@0 2836 '--sysroot=<(android_ndk_sysroot)',
michael@0 2837 ],
michael@0 2838 }],
michael@0 2839 ['android_build_type==1', {
michael@0 2840 'include_dirs': [
michael@0 2841 # OpenAL headers from the Android tree.
michael@0 2842 '<(android_src)/frameworks/wilhelm/include',
michael@0 2843 ],
michael@0 2844 'cflags': [
michael@0 2845 # Chromium builds its own (non-third-party) code with
michael@0 2846 # -Werror to make all warnings into errors. However, Android
michael@0 2847 # enables warnings that Chromium doesn't, so some of these
michael@0 2848 # extra warnings trip and break things.
michael@0 2849 # For now, we leave these warnings enabled but prevent them
michael@0 2850 # from being treated as errors.
michael@0 2851 #
michael@0 2852 # Things that are part of -Wextra:
michael@0 2853 '-Wno-error=extra', # Enabled by -Wextra, but no specific flag
michael@0 2854 '-Wno-error=ignored-qualifiers',
michael@0 2855 '-Wno-error=type-limits',
michael@0 2856 # Other things unrelated to -Wextra:
michael@0 2857 '-Wno-error=non-virtual-dtor',
michael@0 2858 '-Wno-error=sign-promo',
michael@0 2859 ],
michael@0 2860 'cflags_cc': [
michael@0 2861 # Disabling c++0x-compat should be handled in WebKit, but
michael@0 2862 # this currently doesn't work because gcc_version is not set
michael@0 2863 # correctly when building with the Android build system.
michael@0 2864 # TODO(torne): Fix this in WebKit.
michael@0 2865 '-Wno-error=c++0x-compat',
michael@0 2866 ],
michael@0 2867 }],
michael@0 2868 ['android_build_type==1 and chromium_code==0', {
michael@0 2869 'cflags': [
michael@0 2870 # There is a class of warning which:
michael@0 2871 # 1) Android always enables and also treats as errors
michael@0 2872 # 2) Chromium ignores in third party code
michael@0 2873 # For now, I am leaving these warnings enabled but preventing
michael@0 2874 # them from being treated as errors here.
michael@0 2875 '-Wno-error=address',
michael@0 2876 '-Wno-error=format-security',
michael@0 2877 '-Wno-error=non-virtual-dtor',
michael@0 2878 '-Wno-error=return-type',
michael@0 2879 '-Wno-error=sequence-point',
michael@0 2880 ],
michael@0 2881 }],
michael@0 2882 ['target_arch == "arm"', {
michael@0 2883 'ldflags': [
michael@0 2884 # Enable identical code folding to reduce size.
michael@0 2885 '-Wl,--icf=safe',
michael@0 2886 ],
michael@0 2887 }],
michael@0 2888 # NOTE: The stlport header include paths below are specified in
michael@0 2889 # cflags rather than include_dirs because they need to come
michael@0 2890 # after include_dirs. Think of them like system headers, but
michael@0 2891 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
michael@0 2892 # toolchain (circa Gingerbread) will exhibit strange errors.
michael@0 2893 # The include ordering here is important; change with caution.
michael@0 2894 ['use_system_stlport==1', {
michael@0 2895 'cflags': [
michael@0 2896 # For libstdc++/include, which is used by stlport.
michael@0 2897 '-I<(android_src)/bionic',
michael@0 2898 '-I<(android_src)/external/stlport/stlport',
michael@0 2899 ],
michael@0 2900 }, { # else: use_system_stlport!=1
michael@0 2901 'cflags': [
michael@0 2902 '-I<(android_ndk_root)/sources/cxx-stl/stlport/stlport',
michael@0 2903 ],
michael@0 2904 'conditions': [
michael@0 2905 ['target_arch=="arm" and armv7==1', {
michael@0 2906 'ldflags': [
michael@0 2907 '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/armeabi-v7a',
michael@0 2908 ],
michael@0 2909 }],
michael@0 2910 ['target_arch=="arm" and armv7==0', {
michael@0 2911 'ldflags': [
michael@0 2912 '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/armeabi',
michael@0 2913 ],
michael@0 2914 }],
michael@0 2915 ['target_arch=="ia32"', {
michael@0 2916 'ldflags': [
michael@0 2917 '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/x86',
michael@0 2918 ],
michael@0 2919 }],
michael@0 2920 ],
michael@0 2921 }],
michael@0 2922 ['target_arch=="ia32"', {
michael@0 2923 # The x86 toolchain currently has problems with stack-protector.
michael@0 2924 'cflags!': [
michael@0 2925 '-fstack-protector',
michael@0 2926 ],
michael@0 2927 'cflags': [
michael@0 2928 '-fno-stack-protector',
michael@0 2929 ],
michael@0 2930 }],
michael@0 2931 ],
michael@0 2932 'target_conditions': [
michael@0 2933 ['_type=="executable"', {
michael@0 2934 'ldflags': [
michael@0 2935 '-Bdynamic',
michael@0 2936 '-Wl,-dynamic-linker,/system/bin/linker',
michael@0 2937 '-Wl,--gc-sections',
michael@0 2938 '-Wl,-z,nocopyreloc',
michael@0 2939 # crtbegin_dynamic.o should be the last item in ldflags.
michael@0 2940 '<(android_ndk_lib)/crtbegin_dynamic.o',
michael@0 2941 ],
michael@0 2942 'libraries': [
michael@0 2943 # crtend_android.o needs to be the last item in libraries.
michael@0 2944 # Do not add any libraries after this!
michael@0 2945 '<(android_ndk_lib)/crtend_android.o',
michael@0 2946 ],
michael@0 2947 }],
michael@0 2948 ['_type=="shared_library" or _type=="loadable_module"', {
michael@0 2949 'ldflags': [
michael@0 2950 '-Wl,-shared,-Bsymbolic',
michael@0 2951 # crtbegin_so.o should be the last item in ldflags.
michael@0 2952 '<(android_ndk_lib)/crtbegin_so.o',
michael@0 2953 ],
michael@0 2954 'libraries': [
michael@0 2955 # crtend_so.o needs to be the last item in libraries.
michael@0 2956 # Do not add any libraries after this!
michael@0 2957 '<(android_ndk_lib)/crtend_so.o',
michael@0 2958 ],
michael@0 2959 }],
michael@0 2960 ],
michael@0 2961
michael@0 2962 }], # build_with_mozilla== 0
michael@0 2963
michael@0 2964 ],
michael@0 2965 'defines': [
michael@0 2966 'ANDROID',
michael@0 2967 '__GNU_SOURCE=1', # Necessary for clone()
michael@0 2968 'USE_STLPORT=1',
michael@0 2969 '_STLP_USE_PTR_SPECIALIZATIONS=1',
michael@0 2970 'CHROME_SYMBOLS_ID="<(chrome_symbols_id)"',
michael@0 2971 ],
michael@0 2972 }],
michael@0 2973 # Settings for building host targets using the system toolchain.
michael@0 2974 ['_toolset=="host"', {
michael@0 2975 'cflags!': [
michael@0 2976 # Due to issues in Clang build system, using ASan on 32-bit
michael@0 2977 # binaries on x86_64 host is problematic.
michael@0 2978 # TODO(eugenis): re-enable.
michael@0 2979 '-faddress-sanitizer',
michael@0 2980 ],
michael@0 2981 'ldflags!': [
michael@0 2982 '-faddress-sanitizer',
michael@0 2983 '-Wl,-z,noexecstack',
michael@0 2984 '-Wl,--gc-sections',
michael@0 2985 '-Wl,-O1',
michael@0 2986 '-Wl,--as-needed',
michael@0 2987 ],
michael@0 2988 'sources/': [
michael@0 2989 ['exclude', '_android(_unittest)?\\.cc$'],
michael@0 2990 ['exclude', '(^|/)android/']
michael@0 2991 ],
michael@0 2992 }],
michael@0 2993 ],
michael@0 2994 },
michael@0 2995 }],
michael@0 2996 ['OS=="solaris"', {
michael@0 2997 'cflags!': ['-fvisibility=hidden'],
michael@0 2998 'cflags_cc!': ['-fvisibility-inlines-hidden'],
michael@0 2999 }],
michael@0 3000 ['OS=="mac" or OS=="ios"', {
michael@0 3001 'target_defaults': {
michael@0 3002 'mac_bundle': 0,
michael@0 3003 'xcode_settings': {
michael@0 3004 'ALWAYS_SEARCH_USER_PATHS': 'NO',
michael@0 3005 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
michael@0 3006 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
michael@0 3007 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
michael@0 3008 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
michael@0 3009 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
michael@0 3010 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
michael@0 3011 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
michael@0 3012 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
michael@0 3013 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
michael@0 3014 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
michael@0 3015 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
michael@0 3016 'GCC_VERSION': '4.2',
michael@0 3017 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
michael@0 3018 'USE_HEADERMAP': 'NO',
michael@0 3019 'WARNING_CFLAGS': [
michael@0 3020 '-Wall',
michael@0 3021 '-Wendif-labels',
michael@0 3022 '-Wextra',
michael@0 3023 # Don't warn about unused function parameters.
michael@0 3024 '-Wno-unused-parameter',
michael@0 3025 # Don't warn about the "struct foo f = {0};" initialization
michael@0 3026 # pattern.
michael@0 3027 '-Wno-missing-field-initializers',
michael@0 3028 ],
michael@0 3029 'conditions': [
michael@0 3030 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
michael@0 3031 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
michael@0 3032 ],
michael@0 3033 ],
michael@0 3034 },
michael@0 3035 'target_conditions': [
michael@0 3036 ['_type!="static_library"', {
michael@0 3037 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
michael@0 3038 }],
michael@0 3039 ['_mac_bundle', {
michael@0 3040 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
michael@0 3041 }],
michael@0 3042 ], # target_conditions
michael@0 3043 }, # target_defaults
michael@0 3044 }], # OS=="mac" or OS=="ios"
michael@0 3045 ['OS=="mac"', {
michael@0 3046 'target_defaults': {
michael@0 3047 'variables': {
michael@0 3048 # These should end with %, but there seems to be a bug with % in
michael@0 3049 # variables that are intended to be set to different values in
michael@0 3050 # different targets, like these.
michael@0 3051 'mac_pie': 1, # Most executables can be position-independent.
michael@0 3052 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
michael@0 3053 # Strip debugging symbols from the target.
michael@0 3054 'mac_strip': '<(mac_strip_release)',
michael@0 3055 },
michael@0 3056 'xcode_settings': {
michael@0 3057 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
michael@0 3058 # (Equivalent to -fPIC)
michael@0 3059 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
michael@0 3060 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
michael@0 3061 # Keep pch files below xcodebuild/.
michael@0 3062 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
michael@0 3063 'OTHER_CFLAGS': [
michael@0 3064 '-fno-strict-aliasing', # See http://crbug.com/32204
michael@0 3065 ],
michael@0 3066 'conditions': [
michael@0 3067 ['clang==1', {
michael@0 3068 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
michael@0 3069 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
michael@0 3070
michael@0 3071 # Don't use -Wc++0x-extensions, which Xcode 4 enables by default
michael@0 3072 # when buliding with clang. This warning is triggered when the
michael@0 3073 # override keyword is used via the OVERRIDE macro from
michael@0 3074 # base/compiler_specific.h.
michael@0 3075 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
michael@0 3076
michael@0 3077 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
michael@0 3078 'WARNING_CFLAGS': [
michael@0 3079 '-Wheader-hygiene',
michael@0 3080 # Don't die on dtoa code that uses a char as an array index.
michael@0 3081 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
michael@0 3082 '-Wno-char-subscripts',
michael@0 3083 # Clang spots more unused functions.
michael@0 3084 '-Wno-unused-function',
michael@0 3085 # See comments on this flag higher up in this file.
michael@0 3086 '-Wno-unnamed-type-template-args',
michael@0 3087 # This (rightyfully) complains about 'override', which we use
michael@0 3088 # heavily.
michael@0 3089 '-Wno-c++11-extensions',
michael@0 3090
michael@0 3091 # Warns on switches on enums that cover all enum values but
michael@0 3092 # also contain a default: branch. Chrome is full of that.
michael@0 3093 '-Wno-covered-switch-default',
michael@0 3094
michael@0 3095 # TODO(thakis): Remove this.
michael@0 3096 '-Wno-implicit-conversion-floating-point-to-bool',
michael@0 3097 ],
michael@0 3098 }],
michael@0 3099 ['clang==1 and clang_use_chrome_plugins==1', {
michael@0 3100 'OTHER_CFLAGS': [
michael@0 3101 '<@(clang_chrome_plugins_flags)',
michael@0 3102 ],
michael@0 3103 }],
michael@0 3104 ['clang==1 and clang_load!=""', {
michael@0 3105 'OTHER_CFLAGS': [
michael@0 3106 '-Xclang', '-load', '-Xclang', '<(clang_load)',
michael@0 3107 ],
michael@0 3108 }],
michael@0 3109 ['clang==1 and clang_add_plugin!=""', {
michael@0 3110 'OTHER_CFLAGS': [
michael@0 3111 '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
michael@0 3112 ],
michael@0 3113 }],
michael@0 3114 ['clang==1 and "<(GENERATOR)"=="ninja"', {
michael@0 3115 'OTHER_CFLAGS': [
michael@0 3116 # See http://crbug.com/110262
michael@0 3117 '-fcolor-diagnostics',
michael@0 3118 ],
michael@0 3119 }],
michael@0 3120 ],
michael@0 3121 },
michael@0 3122 'conditions': [
michael@0 3123 ['clang==1', {
michael@0 3124 'variables': {
michael@0 3125 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
michael@0 3126 },
michael@0 3127 }],
michael@0 3128 ['asan==1', {
michael@0 3129 'xcode_settings': {
michael@0 3130 'OTHER_CFLAGS': [
michael@0 3131 '-faddress-sanitizer',
michael@0 3132 ],
michael@0 3133 },
michael@0 3134 'defines': [
michael@0 3135 'ADDRESS_SANITIZER',
michael@0 3136 ],
michael@0 3137 }],
michael@0 3138 ],
michael@0 3139 'target_conditions': [
michael@0 3140 ['_type!="static_library"', {
michael@0 3141 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
michael@0 3142 'conditions': [
michael@0 3143 ['asan==1', {
michael@0 3144 'xcode_settings': {
michael@0 3145 'OTHER_LDFLAGS': [
michael@0 3146 '-faddress-sanitizer',
michael@0 3147 ],
michael@0 3148 },
michael@0 3149 }],
michael@0 3150 ],
michael@0 3151 }],
michael@0 3152 ['_mac_bundle', {
michael@0 3153 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
michael@0 3154 }],
michael@0 3155 ['_type=="executable"', {
michael@0 3156 'postbuilds': [
michael@0 3157 {
michael@0 3158 # Arranges for data (heap) pages to be protected against
michael@0 3159 # code execution when running on Mac OS X 10.7 ("Lion"), and
michael@0 3160 # ensures that the position-independent executable (PIE) bit
michael@0 3161 # is set for ASLR when running on Mac OS X 10.5 ("Leopard").
michael@0 3162 'variables': {
michael@0 3163 # Define change_mach_o_flags in a variable ending in _path
michael@0 3164 # so that GYP understands it's a path and performs proper
michael@0 3165 # relativization during dict merging.
michael@0 3166 'change_mach_o_flags':
michael@0 3167 'mac/change_mach_o_flags_from_xcode.sh',
michael@0 3168 'change_mach_o_flags_options%': [
michael@0 3169 ],
michael@0 3170 'target_conditions': [
michael@0 3171 ['mac_pie==0 or release_valgrind_build==1', {
michael@0 3172 # Don't enable PIE if it's unwanted. It's unwanted if
michael@0 3173 # the target specifies mac_pie=0 or if building for
michael@0 3174 # Valgrind, because Valgrind doesn't understand slide.
michael@0 3175 # See the similar mac_pie/release_valgrind_build check
michael@0 3176 # below.
michael@0 3177 'change_mach_o_flags_options': [
michael@0 3178 '--no-pie',
michael@0 3179 ],
michael@0 3180 }],
michael@0 3181 ],
michael@0 3182 },
michael@0 3183 'postbuild_name': 'Change Mach-O Flags',
michael@0 3184 'action': [
michael@0 3185 '$(srcdir)$(os_sep)build$(os_sep)<(change_mach_o_flags)',
michael@0 3186 '>@(change_mach_o_flags_options)',
michael@0 3187 ],
michael@0 3188 },
michael@0 3189 ],
michael@0 3190 'conditions': [
michael@0 3191 ['asan==1', {
michael@0 3192 'variables': {
michael@0 3193 'asan_saves_file': 'asan.saves',
michael@0 3194 },
michael@0 3195 'xcode_settings': {
michael@0 3196 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)',
michael@0 3197 },
michael@0 3198 }],
michael@0 3199 ],
michael@0 3200 'target_conditions': [
michael@0 3201 ['mac_pie==1 and release_valgrind_build==0', {
michael@0 3202 # Turn on position-independence (ASLR) for executables. When
michael@0 3203 # PIE is on for the Chrome executables, the framework will
michael@0 3204 # also be subject to ASLR.
michael@0 3205 # Don't do this when building for Valgrind, because Valgrind
michael@0 3206 # doesn't understand slide. TODO: Make Valgrind on Mac OS X
michael@0 3207 # understand slide, and get rid of the Valgrind check.
michael@0 3208 'xcode_settings': {
michael@0 3209 'OTHER_LDFLAGS': [
michael@0 3210 '-Wl,-pie', # Position-independent executable (MH_PIE)
michael@0 3211 ],
michael@0 3212 },
michael@0 3213 }],
michael@0 3214 ],
michael@0 3215 }],
michael@0 3216 ['(_type=="executable" or _type=="shared_library" or \
michael@0 3217 _type=="loadable_module") and mac_strip!=0', {
michael@0 3218 'target_conditions': [
michael@0 3219 ['mac_real_dsym == 1', {
michael@0 3220 # To get a real .dSYM bundle produced by dsymutil, set the
michael@0 3221 # debug information format to dwarf-with-dsym. Since
michael@0 3222 # strip_from_xcode will not be used, set Xcode to do the
michael@0 3223 # stripping as well.
michael@0 3224 'configurations': {
michael@0 3225 'Release_Base': {
michael@0 3226 'xcode_settings': {
michael@0 3227 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
michael@0 3228 'DEPLOYMENT_POSTPROCESSING': 'YES',
michael@0 3229 'STRIP_INSTALLED_PRODUCT': 'YES',
michael@0 3230 'target_conditions': [
michael@0 3231 ['_type=="shared_library" or _type=="loadable_module"', {
michael@0 3232 # The Xcode default is to strip debugging symbols
michael@0 3233 # only (-S). Local symbols should be stripped as
michael@0 3234 # well, which will be handled by -x. Xcode will
michael@0 3235 # continue to insert -S when stripping even when
michael@0 3236 # additional flags are added with STRIPFLAGS.
michael@0 3237 'STRIPFLAGS': '-x',
michael@0 3238 }], # _type=="shared_library" or _type=="loadable_module"'
michael@0 3239 ], # target_conditions
michael@0 3240 }, # xcode_settings
michael@0 3241 }, # configuration "Release"
michael@0 3242 }, # configurations
michael@0 3243 }, { # mac_real_dsym != 1
michael@0 3244 # To get a fast fake .dSYM bundle, use a post-build step to
michael@0 3245 # produce the .dSYM and strip the executable. strip_from_xcode
michael@0 3246 # only operates in the Release configuration.
michael@0 3247 'postbuilds': [
michael@0 3248 {
michael@0 3249 'variables': {
michael@0 3250 # Define strip_from_xcode in a variable ending in _path
michael@0 3251 # so that gyp understands it's a path and performs proper
michael@0 3252 # relativization during dict merging.
michael@0 3253 'strip_from_xcode': 'mac/strip_from_xcode',
michael@0 3254 },
michael@0 3255 'postbuild_name': 'Strip If Needed',
michael@0 3256 'action': ['$(srcdir)$(os_sep)build$(os_sep)<(strip_from_xcode)'],
michael@0 3257 },
michael@0 3258 ], # postbuilds
michael@0 3259 }], # mac_real_dsym
michael@0 3260 ], # target_conditions
michael@0 3261 }], # (_type=="executable" or _type=="shared_library" or
michael@0 3262 # _type=="loadable_module") and mac_strip!=0
michael@0 3263 ], # target_conditions
michael@0 3264 }, # target_defaults
michael@0 3265 }], # OS=="mac"
michael@0 3266 ['OS=="ios"', {
michael@0 3267 'target_defaults': {
michael@0 3268 'xcode_settings' : {
michael@0 3269 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
michael@0 3270
michael@0 3271 # This next block is mostly common with the 'mac' section above,
michael@0 3272 # but keying off (or setting) 'clang' isn't valid for iOS as it
michael@0 3273 # also seems to mean using the custom build of clang.
michael@0 3274
michael@0 3275 # Don't use -Wc++0x-extensions, which Xcode 4 enables by default
michael@0 3276 # when buliding with clang. This warning is triggered when the
michael@0 3277 # override keyword is used via the OVERRIDE macro from
michael@0 3278 # base/compiler_specific.h.
michael@0 3279 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
michael@0 3280 'WARNING_CFLAGS': [
michael@0 3281 '-Wheader-hygiene',
michael@0 3282 # Don't die on dtoa code that uses a char as an array index.
michael@0 3283 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
michael@0 3284 '-Wno-char-subscripts',
michael@0 3285 # Clang spots more unused functions.
michael@0 3286 '-Wno-unused-function',
michael@0 3287 # See comments on this flag higher up in this file.
michael@0 3288 '-Wno-unnamed-type-template-args',
michael@0 3289 # This (rightyfully) complains about 'override', which we use
michael@0 3290 # heavily.
michael@0 3291 '-Wno-c++11-extensions',
michael@0 3292 ],
michael@0 3293 },
michael@0 3294 'target_conditions': [
michael@0 3295 ['_type=="executable"', {
michael@0 3296 'configurations': {
michael@0 3297 'Release_Base': {
michael@0 3298 'xcode_settings': {
michael@0 3299 'DEPLOYMENT_POSTPROCESSING': 'YES',
michael@0 3300 'STRIP_INSTALLED_PRODUCT': 'YES',
michael@0 3301 },
michael@0 3302 },
michael@0 3303 },
michael@0 3304 'xcode_settings': {
michael@0 3305 'conditions': [
michael@0 3306 ['chromium_ios_signing', {
michael@0 3307 # iOS SDK wants everything for device signed.
michael@0 3308 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
michael@0 3309 }, {
michael@0 3310 'CODE_SIGNING_REQUIRED': 'NO',
michael@0 3311 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
michael@0 3312 }],
michael@0 3313 ],
michael@0 3314 },
michael@0 3315 }],
michael@0 3316 ], # target_conditions
michael@0 3317 }, # target_defaults
michael@0 3318 }], # OS=="ios"
michael@0 3319 ['OS=="win"', {
michael@0 3320 'target_defaults': {
michael@0 3321 'defines': [
michael@0 3322 '_WIN32_WINNT=0x0602',
michael@0 3323 'WINVER=0x0602',
michael@0 3324 'WIN32',
michael@0 3325 '_WINDOWS',
michael@0 3326 'NOMINMAX',
michael@0 3327 'PSAPI_VERSION=1',
michael@0 3328 '_CRT_RAND_S',
michael@0 3329 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
michael@0 3330 'WIN32_LEAN_AND_MEAN',
michael@0 3331 '_ATL_NO_OPENGL',
michael@0 3332 ],
michael@0 3333 'conditions': [
michael@0 3334 ['buildtype=="Official"', {
michael@0 3335 # In official builds, targets can self-select an optimization
michael@0 3336 # level by defining a variable named 'optimize', and setting it
michael@0 3337 # to one of
michael@0 3338 # - "size", optimizes for minimal code size - the default.
michael@0 3339 # - "speed", optimizes for speed over code size.
michael@0 3340 # - "max", whole program optimization and link-time code
michael@0 3341 # generation. This is very expensive and should be used
michael@0 3342 # sparingly.
michael@0 3343 'variables': {
michael@0 3344 'optimize%': 'size',
michael@0 3345 },
michael@0 3346 'target_conditions': [
michael@0 3347 ['optimize=="size"', {
michael@0 3348 'msvs_settings': {
michael@0 3349 'VCCLCompilerTool': {
michael@0 3350 # 1, optimizeMinSpace, Minimize Size (/O1)
michael@0 3351 'Optimization': '1',
michael@0 3352 # 2, favorSize - Favor small code (/Os)
michael@0 3353 'FavorSizeOrSpeed': '2',
michael@0 3354 },
michael@0 3355 },
michael@0 3356 },
michael@0 3357 ],
michael@0 3358 ['optimize=="speed"', {
michael@0 3359 'msvs_settings': {
michael@0 3360 'VCCLCompilerTool': {
michael@0 3361 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
michael@0 3362 'Optimization': '2',
michael@0 3363 # 1, favorSpeed - Favor fast code (/Ot)
michael@0 3364 'FavorSizeOrSpeed': '1',
michael@0 3365 },
michael@0 3366 },
michael@0 3367 },
michael@0 3368 ],
michael@0 3369 ['optimize=="max"', {
michael@0 3370 'msvs_settings': {
michael@0 3371 'VCCLCompilerTool': {
michael@0 3372 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
michael@0 3373 'Optimization': '2',
michael@0 3374 # 1, favorSpeed - Favor fast code (/Ot)
michael@0 3375 'FavorSizeOrSpeed': '1',
michael@0 3376 # This implies link time code generation.
michael@0 3377 'WholeProgramOptimization': 'true',
michael@0 3378 },
michael@0 3379 },
michael@0 3380 },
michael@0 3381 ],
michael@0 3382 ],
michael@0 3383 },
michael@0 3384 ],
michael@0 3385 ['component=="static_library"', {
michael@0 3386 'defines': [
michael@0 3387 '_HAS_EXCEPTIONS=0',
michael@0 3388 ],
michael@0 3389 }],
michael@0 3390 ['MSVS_VERSION=="2008"', {
michael@0 3391 'defines': [
michael@0 3392 '_HAS_TR1=0',
michael@0 3393 ],
michael@0 3394 }],
michael@0 3395 ['secure_atl', {
michael@0 3396 'defines': [
michael@0 3397 '_SECURE_ATL',
michael@0 3398 ],
michael@0 3399 }],
michael@0 3400 ],
michael@0 3401 'msvs_system_include_dirs': [
michael@0 3402 '<(windows_sdk_path)/Include/shared',
michael@0 3403 '<(windows_sdk_path)/Include/um',
michael@0 3404 '<(windows_sdk_path)/Include/winrt',
michael@0 3405 '<(directx_sdk_path)/Include',
michael@0 3406 '$(VSInstallDir)/VC/atlmfc/include',
michael@0 3407 ],
michael@0 3408 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
michael@0 3409 'msvs_disabled_warnings': [4351, 4396, 4503, 4819,
michael@0 3410 # TODO(maruel): These warnings are level 4. They will be slowly
michael@0 3411 # removed as code is fixed.
michael@0 3412 4100, 4121, 4125, 4127, 4130, 4131, 4189, 4201, 4238, 4244, 4245,
michael@0 3413 4310, 4355, 4428, 4481, 4505, 4510, 4512, 4530, 4610, 4611, 4701,
michael@0 3414 4702, 4706,
michael@0 3415 ],
michael@0 3416 'msvs_settings': {
michael@0 3417 'VCCLCompilerTool': {
michael@0 3418 'AdditionalOptions': ['/MP'],
michael@0 3419 'MinimalRebuild': 'false',
michael@0 3420 'BufferSecurityCheck': 'true',
michael@0 3421 'EnableFunctionLevelLinking': 'true',
michael@0 3422 'RuntimeTypeInfo': 'false',
michael@0 3423 'WarningLevel': '4',
michael@0 3424 'WarnAsError': 'true',
michael@0 3425 'DebugInformationFormat': '3',
michael@0 3426 'conditions': [
michael@0 3427 ['component=="shared_library"', {
michael@0 3428 'ExceptionHandling': '1', # /EHsc
michael@0 3429 }, {
michael@0 3430 'ExceptionHandling': '0',
michael@0 3431 }],
michael@0 3432 ],
michael@0 3433 },
michael@0 3434 'VCLibrarianTool': {
michael@0 3435 'AdditionalOptions': ['/ignore:4221'],
michael@0 3436 'AdditionalLibraryDirectories': [
michael@0 3437 '<(directx_sdk_path)/Lib/x86',
michael@0 3438 '<(windows_sdk_path)/Lib/win8/um/x86',
michael@0 3439 ],
michael@0 3440 },
michael@0 3441 'VCLinkerTool': {
michael@0 3442 'AdditionalDependencies': [
michael@0 3443 'wininet.lib',
michael@0 3444 'dnsapi.lib',
michael@0 3445 'version.lib',
michael@0 3446 'msimg32.lib',
michael@0 3447 'ws2_32.lib',
michael@0 3448 'usp10.lib',
michael@0 3449 'psapi.lib',
michael@0 3450 'dbghelp.lib',
michael@0 3451 'winmm.lib',
michael@0 3452 'shlwapi.lib',
michael@0 3453 ],
michael@0 3454
michael@0 3455 'conditions': [
michael@0 3456 ['msvs_express', {
michael@0 3457 # Explicitly required when using the ATL with express
michael@0 3458 'AdditionalDependencies': [
michael@0 3459 'atlthunk.lib',
michael@0 3460 ],
michael@0 3461
michael@0 3462 # ATL 8.0 included in WDK 7.1 makes the linker to generate
michael@0 3463 # almost eight hundred LNK4254 and LNK4078 warnings:
michael@0 3464 # - warning LNK4254: section 'ATL' (50000040) merged into
michael@0 3465 # '.rdata' (40000040) with different attributes
michael@0 3466 # - warning LNK4078: multiple 'ATL' sections found with
michael@0 3467 # different attributes
michael@0 3468 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'],
michael@0 3469 }],
michael@0 3470 ['MSVS_VERSION=="2005e"', {
michael@0 3471 # Non-express versions link automatically to these
michael@0 3472 'AdditionalDependencies': [
michael@0 3473 'advapi32.lib',
michael@0 3474 'comdlg32.lib',
michael@0 3475 'ole32.lib',
michael@0 3476 'shell32.lib',
michael@0 3477 'user32.lib',
michael@0 3478 'winspool.lib',
michael@0 3479 ],
michael@0 3480 }],
michael@0 3481 ],
michael@0 3482 'AdditionalLibraryDirectories': [
michael@0 3483 '<(directx_sdk_path)/Lib/x86',
michael@0 3484 '<(windows_sdk_path)/Lib/win8/um/x86',
michael@0 3485 ],
michael@0 3486 'GenerateDebugInformation': 'true',
michael@0 3487 'MapFileName': '$(OutDir)\\$(TargetName).map',
michael@0 3488 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
michael@0 3489 'FixedBaseAddress': '1',
michael@0 3490 # SubSystem values:
michael@0 3491 # 0 == not set
michael@0 3492 # 1 == /SUBSYSTEM:CONSOLE
michael@0 3493 # 2 == /SUBSYSTEM:WINDOWS
michael@0 3494 # Most of the executables we'll ever create are tests
michael@0 3495 # and utilities with console output.
michael@0 3496 'SubSystem': '1',
michael@0 3497 },
michael@0 3498 'VCMIDLTool': {
michael@0 3499 'GenerateStublessProxies': 'true',
michael@0 3500 'TypeLibraryName': '$(InputName).tlb',
michael@0 3501 'OutputDirectory': '$(IntDir)',
michael@0 3502 'HeaderFileName': '$(InputName).h',
michael@0 3503 'DLLDataFileName': '$(InputName).dlldata.c',
michael@0 3504 'InterfaceIdentifierFileName': '$(InputName)_i.c',
michael@0 3505 'ProxyFileName': '$(InputName)_p.c',
michael@0 3506 },
michael@0 3507 'VCResourceCompilerTool': {
michael@0 3508 'Culture' : '1033',
michael@0 3509 'AdditionalIncludeDirectories': [
michael@0 3510 '<(DEPTH)',
michael@0 3511 '<(SHARED_INTERMEDIATE_DIR)',
michael@0 3512 ],
michael@0 3513 },
michael@0 3514 },
michael@0 3515 },
michael@0 3516 }],
michael@0 3517 ['disable_nacl==1', {
michael@0 3518 'target_defaults': {
michael@0 3519 'defines': [
michael@0 3520 'DISABLE_NACL',
michael@0 3521 ],
michael@0 3522 },
michael@0 3523 }],
michael@0 3524 ['OS=="win" and msvs_use_common_linker_extras', {
michael@0 3525 'target_defaults': {
michael@0 3526 'msvs_settings': {
michael@0 3527 'VCLinkerTool': {
michael@0 3528 'DelayLoadDLLs': [
michael@0 3529 'dbghelp.dll',
michael@0 3530 'dwmapi.dll',
michael@0 3531 'shell32.dll',
michael@0 3532 'uxtheme.dll',
michael@0 3533 ],
michael@0 3534 },
michael@0 3535 },
michael@0 3536 'configurations': {
michael@0 3537 'x86_Base': {
michael@0 3538 'msvs_settings': {
michael@0 3539 'VCLinkerTool': {
michael@0 3540 'AdditionalOptions': [
michael@0 3541 '/safeseh',
michael@0 3542 '/dynamicbase',
michael@0 3543 '/ignore:4199',
michael@0 3544 '/ignore:4221',
michael@0 3545 '/nxcompat',
michael@0 3546 ],
michael@0 3547 },
michael@0 3548 },
michael@0 3549 },
michael@0 3550 'x64_Base': {
michael@0 3551 'msvs_settings': {
michael@0 3552 'VCLinkerTool': {
michael@0 3553 'AdditionalOptions': [
michael@0 3554 # safeseh is not compatible with x64
michael@0 3555 '/dynamicbase',
michael@0 3556 '/ignore:4199',
michael@0 3557 '/ignore:4221',
michael@0 3558 '/nxcompat',
michael@0 3559 ],
michael@0 3560 },
michael@0 3561 },
michael@0 3562 },
michael@0 3563 },
michael@0 3564 },
michael@0 3565 }],
michael@0 3566 ['enable_new_npdevice_api==1', {
michael@0 3567 'target_defaults': {
michael@0 3568 'defines': [
michael@0 3569 'ENABLE_NEW_NPDEVICE_API',
michael@0 3570 ],
michael@0 3571 },
michael@0 3572 }],
michael@0 3573 ['clang==1', {
michael@0 3574 'conditions': [
michael@0 3575 ['OS=="android"', {
michael@0 3576 # Android could use the goma with clang.
michael@0 3577 'make_global_settings': [
michael@0 3578 ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang)'],
michael@0 3579 ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang++)'],
michael@0 3580 ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang++)'],
michael@0 3581 ['CC.host', '$(CC)'],
michael@0 3582 ['CXX.host', '$(CXX)'],
michael@0 3583 ['LINK.host', '$(LINK)'],
michael@0 3584 ],
michael@0 3585 }, {
michael@0 3586 'make_global_settings': [
michael@0 3587 ['CC', '<(make_clang_dir)/bin/clang'],
michael@0 3588 ['CXX', '<(make_clang_dir)/bin/clang++'],
michael@0 3589 ['LINK', '$(CXX)'],
michael@0 3590 ['CC.host', '$(CC)'],
michael@0 3591 ['CXX.host', '$(CXX)'],
michael@0 3592 ['LINK.host', '$(LINK)'],
michael@0 3593 ],
michael@0 3594 }],
michael@0 3595 ],
michael@0 3596 }],
michael@0 3597 ['OS=="android" and clang==0', {
michael@0 3598 # Hardcode the compiler names in the Makefile so that
michael@0 3599 # it won't depend on the environment at make time.
michael@0 3600 'make_global_settings': [
michael@0 3601 ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)'],
michael@0 3602 ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-g++)'],
michael@0 3603 ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)'],
michael@0 3604 ['CC.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which gcc))'],
michael@0 3605 ['CXX.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which g++))'],
michael@0 3606 ['LINK.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which g++))'],
michael@0 3607 ],
michael@0 3608 }],
michael@0 3609 ],
michael@0 3610 'xcode_settings': {
michael@0 3611 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
michael@0 3612 # This block adds *project-wide* configuration settings to each project
michael@0 3613 # file. It's almost always wrong to put things here. Specify your
michael@0 3614 # custom xcode_settings in target_defaults to add them to targets instead.
michael@0 3615
michael@0 3616 'conditions': [
michael@0 3617 # In an Xcode Project Info window, the "Base SDK for All Configurations"
michael@0 3618 # setting sets the SDK on a project-wide basis. In order to get the
michael@0 3619 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
michael@0 3620 # here at the project level.
michael@0 3621 ['OS=="mac"', {
michael@0 3622 'conditions': [
michael@0 3623 ['mac_sdk_path==""', {
michael@0 3624 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
michael@0 3625 }, {
michael@0 3626 'SDKROOT': '<(mac_sdk_path)', # -isysroot
michael@0 3627 }],
michael@0 3628 ],
michael@0 3629 }],
michael@0 3630 ['OS=="ios"', {
michael@0 3631 'conditions': [
michael@0 3632 ['ios_sdk_path==""', {
michael@0 3633 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot
michael@0 3634 }, {
michael@0 3635 'SDKROOT': '<(ios_sdk_path)', # -isysroot
michael@0 3636 }],
michael@0 3637 ],
michael@0 3638 }],
michael@0 3639 ['OS=="ios"', {
michael@0 3640 # Just build armv7 since iOS 4.3+ only supports armv7.
michael@0 3641 'ARCHS': '$(ARCHS_UNIVERSAL_IPHONE_OS)',
michael@0 3642 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
michael@0 3643 # Target both iPhone and iPad.
michael@0 3644 'TARGETED_DEVICE_FAMILY': '1,2',
michael@0 3645 }],
michael@0 3646 ],
michael@0 3647
michael@0 3648 # The Xcode generator will look for an xcode_settings section at the root
michael@0 3649 # of each dict and use it to apply settings on a file-wide basis. Most
michael@0 3650 # settings should not be here, they should be in target-specific
michael@0 3651 # xcode_settings sections, or better yet, should use non-Xcode-specific
michael@0 3652 # settings in target dicts. SYMROOT is a special case, because many other
michael@0 3653 # Xcode variables depend on it, including variables such as
michael@0 3654 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
michael@0 3655 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
michael@0 3656 # files to appear (when present) in the UI as actual files and not red
michael@0 3657 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
michael@0 3658 # and therefore SYMROOT, needs to be set at the project level.
michael@0 3659 'SYMROOT': '<(DEPTH)/xcodebuild',
michael@0 3660 },
michael@0 3661 }

mercurial