PageRenderTime 71ms CodeModel.GetById 23ms app.highlight 23ms RepoModel.GetById 1ms app.codeStats 1ms

/thirdparty/breakpad/client/windows/build/common.gypi

http://github.com/tomahawk-player/tomahawk
Unknown | 1339 lines | 1288 code | 51 blank | 0 comment | 0 complexity | eb9e29b92f640aaac353c54a5d7d6112 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1# Copyright (c) 2010, Google Inc.
   2# All rights reserved.
   3#
   4# Redistribution and use in source and binary forms, with or without
   5# modification, are permitted provided that the following conditions are
   6# met:
   7#
   8#     * Redistributions of source code must retain the above copyright
   9# notice, this list of conditions and the following disclaimer.
  10#     * Redistributions in binary form must reproduce the above
  11# copyright notice, this list of conditions and the following disclaimer
  12# in the documentation and/or other materials provided with the
  13# distribution.
  14#     * Neither the name of Google Inc. nor the names of its
  15# contributors may be used to endorse or promote products derived from
  16# this software without specific prior written permission.
  17#
  18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29
  30# IMPORTANT:
  31# Please don't directly include this file if you are building via gyp_chromium,
  32# since gyp_chromium is automatically forcing its inclusion.
  33{
  34  'variables': {
  35    # .gyp files or targets should set chromium_code to 1 if they build
  36    # Chromium-specific code, as opposed to external code.  This variable is
  37    # used to control such things as the set of warnings to enable, and
  38    # whether warnings are treated as errors.
  39    'chromium_code%': 0,
  40
  41    # Variables expected to be overriden on the GYP command line (-D) or by
  42    # ~/.gyp/include.gypi.
  43
  44    # Putting a variables dict inside another variables dict looks kind of
  45    # weird.  This is done so that "branding" and "buildtype" are defined as
  46    # variables within the outer variables dict here.  This is necessary
  47    # to get these variables defined for the conditions within this variables
  48    # dict that operate on these variables.
  49    'variables': {
  50      # Override branding to select the desired branding flavor.
  51      'branding%': 'Chromium',
  52
  53      # Override buildtype to select the desired build flavor.
  54      # Dev - everyday build for development/testing
  55      # Official - release build (generally implies additional processing)
  56      # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
  57      # conversion is done), some of the things which are now controlled by
  58      # 'branding', such as symbol generation, will need to be refactored based
  59      # on 'buildtype' (i.e. we don't care about saving symbols for non-Official
  60      # builds).
  61      'buildtype%': 'Dev',
  62
  63      'variables': {
  64        # Compute the architecture that we're building on.
  65        'conditions': [
  66          [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
  67            # This handles the Linux platforms we generally deal with. Anything
  68            # else gets passed through, which probably won't work very well; such
  69            # hosts should pass an explicit target_arch to gyp.
  70            'host_arch%':
  71              '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/")',
  72          }, {  # OS!="linux"
  73            'host_arch%': 'ia32',
  74          }],
  75        ],
  76
  77        # Whether we're building a ChromeOS build.  We set the initial
  78        # value at this level of nesting so it's available for the
  79        # toolkit_views test below.
  80        'chromeos%': '0',
  81      },
  82
  83      # Set default value of toolkit_views on for Windows and Chrome OS.
  84      # We set it at this level of nesting so the value is available for
  85      # other conditionals below.
  86      'conditions': [
  87        ['OS=="win" or chromeos==1', {
  88          'toolkit_views%': 1,
  89        }, {
  90          'toolkit_views%': 0,
  91        }],
  92      ],
  93
  94      'host_arch%': '<(host_arch)',
  95
  96      # Default architecture we're building for is the architecture we're
  97      # building on.
  98      'target_arch%': '<(host_arch)',
  99
 100      # We do want to build Chromium with Breakpad support in certain
 101      # situations. I.e. for Chrome bot.
 102      'linux_chromium_breakpad%': 0,
 103      # And if we want to dump symbols.
 104      'linux_chromium_dump_symbols%': 0,
 105      # Also see linux_strip_binary below.
 106
 107      # Copy conditionally-set chromeos variable out one scope.
 108      'chromeos%': '<(chromeos)',
 109
 110      # This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are
 111      # are built under a chromium full build (1) or a webkit.org chromium
 112      # build (0).
 113      'inside_chromium_build%': 1,
 114
 115      # Set to 1 to enable fast builds. It disables debug info for fastest
 116      # compilation.
 117      'fastbuild%': 0,
 118
 119      # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
 120      # libraries on linux x86-64 and arm.
 121      'linux_fpic%': 0,
 122
 123      # Python version.
 124      'python_ver%': '2.5',
 125
 126      # Set ARM-v7 compilation flags
 127      'armv7%': 0,
 128
 129      # Set Neon compilation flags (only meaningful if armv7==1).
 130      'arm_neon%': 1,
 131
 132      # The system root for cross-compiles. Default: none.
 133      'sysroot%': '',
 134
 135      # On Linux, we build with sse2 for Chromium builds.
 136      'disable_sse2%': 0,
 137    },
 138
 139    # Define branding and buildtype on the basis of their settings within the
 140    # variables sub-dict above, unless overridden.
 141    'branding%': '<(branding)',
 142    'buildtype%': '<(buildtype)',
 143    'target_arch%': '<(target_arch)',
 144    'host_arch%': '<(host_arch)',
 145    'toolkit_views%': '<(toolkit_views)',
 146    'chromeos%': '<(chromeos)',
 147    'inside_chromium_build%': '<(inside_chromium_build)',
 148    'fastbuild%': '<(fastbuild)',
 149    'linux_fpic%': '<(linux_fpic)',
 150    'python_ver%': '<(python_ver)',
 151    'armv7%': '<(armv7)',
 152    'arm_neon%': '<(arm_neon)',
 153    'sysroot%': '<(sysroot)',
 154    'disable_sse2%': '<(disable_sse2)',
 155
 156    # The release channel that this build targets. This is used to restrict
 157    # channel-specific build options, like which installer packages to create.
 158    # The default is 'all', which does no channel-specific filtering.
 159    'channel%': 'all',
 160
 161    # Override chromium_mac_pch and set it to 0 to suppress the use of
 162    # precompiled headers on the Mac.  Prefix header injection may still be
 163    # used, but prefix headers will not be precompiled.  This is useful when
 164    # using distcc to distribute a build to compile slaves that don't
 165    # share the same compiler executable as the system driving the compilation,
 166    # because precompiled headers rely on pointers into a specific compiler
 167    # executable's image.  Setting this to 0 is needed to use an experimental
 168    # Linux-Mac cross compiler distcc farm.
 169    'chromium_mac_pch%': 1,
 170
 171    # Mac OS X SDK and deployment target support.
 172    # The SDK identifies the version of the system headers that will be used,
 173    # and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro.
 174    # "Maximum allowed" refers to the operating system version whose APIs are
 175    # available in the headers.
 176    # The deployment target identifies the minimum system version that the
 177    # built products are expected to function on.  It corresponds to the
 178    # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.
 179    # To ensure these macros are available, #include <AvailabilityMacros.h>.
 180    # Additional documentation on these macros is available at
 181    # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
 182    # Chrome normally builds with the Mac OS X 10.5 SDK and sets the
 183    # deployment target to 10.5.  Other projects, such as O3D, may override
 184    # these defaults.
 185    'mac_sdk%': '10.5',
 186    'mac_deployment_target%': '10.5',
 187
 188    # Set to 1 to enable code coverage.  In addition to build changes
 189    # (e.g. extra CFLAGS), also creates a new target in the src/chrome
 190    # project file called "coverage".
 191    # Currently ignored on Windows.
 192    'coverage%': 0,
 193
 194    # Although base/allocator lets you select a heap library via an
 195    # environment variable, the libcmt shim it uses sometimes gets in
 196    # the way.  To disable it entirely, and switch to normal msvcrt, do e.g.
 197    #  'win_use_allocator_shim': 0,
 198    #  'win_release_RuntimeLibrary': 2
 199    # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
 200    'win_use_allocator_shim%': 1, # 0 = shim allocator via libcmt; 1 = msvcrt
 201
 202    # To do a shared build on linux we need to be able to choose between type
 203    # static_library and shared_library. We default to doing a static build
 204    # but you can override this with "gyp -Dlibrary=shared_library" or you
 205    # can add the following line (without the #) to ~/.gyp/include.gypi
 206    # {'variables': {'library': 'shared_library'}}
 207    # to compile as shared by default
 208    'library%': 'static_library',
 209
 210    # Whether usage of OpenMAX is enabled.
 211    'enable_openmax%': 0,
 212
 213    # TODO(bradnelson): eliminate this when possible.
 214    # To allow local gyp files to prevent release.vsprops from being included.
 215    # Yes(1) means include release.vsprops.
 216    # Once all vsprops settings are migrated into gyp, this can go away.
 217    'msvs_use_common_release%': 1,
 218
 219    # TODO(bradnelson): eliminate this when possible.
 220    # To allow local gyp files to override additional linker options for msvs.
 221    # Yes(1) means set use the common linker options.
 222    'msvs_use_common_linker_extras%': 1,
 223
 224    # TODO(sgk): eliminate this if possible.
 225    # It would be nicer to support this via a setting in 'target_defaults'
 226    # in chrome/app/locales/locales.gypi overriding the setting in the
 227    # 'Debug' configuration in the 'target_defaults' dict below,
 228    # but that doesn't work as we'd like.
 229    'msvs_debug_link_incremental%': '2',
 230
 231    # This is the location of the sandbox binary. Chrome looks for this before
 232    # running the zygote process. If found, and SUID, it will be used to
 233    # sandbox the zygote process and, thus, all renderer processes.
 234    'linux_sandbox_path%': '',
 235
 236    # Set this to true to enable SELinux support.
 237    'selinux%': 0,
 238
 239    # Strip the binary after dumping symbols.
 240    'linux_strip_binary%': 0,
 241
 242    # Enable TCMalloc.
 243    'linux_use_tcmalloc%': 1,
 244
 245    # Disable TCMalloc's debugallocation.
 246    'linux_use_debugallocation%': 0,
 247
 248    # Disable TCMalloc's heapchecker.
 249    'linux_use_heapchecker%': 0,
 250
 251    # Set to 1 to turn on seccomp sandbox by default.
 252    # (Note: this is ignored for official builds.)
 253    'linux_use_seccomp_sandbox%': 0,
 254
 255    # Set to select the Title Case versions of strings in GRD files.
 256    'use_titlecase_in_grd_files%': 0,
 257
 258    # Used to disable Native Client at compile time, for platforms where it
 259    # isn't supported
 260    'disable_nacl%': 0,
 261
 262    # Set Thumb compilation flags.
 263    'arm_thumb%': 0,
 264
 265    # Set ARM fpu compilation flags (only meaningful if armv7==1 and
 266    # arm_neon==0).
 267    'arm_fpu%': 'vfpv3',
 268
 269    # Enable new NPDevice API.
 270    'enable_new_npdevice_api%': 0,
 271
 272    'conditions': [
 273      ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
 274        # This will set gcc_version to XY if you are running gcc X.Y.*.
 275        # This is used to tweak build flags for gcc 4.4.
 276        'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
 277        # Figure out the python architecture to decide if we build pyauto.
 278        'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/lib/libpython<(python_ver).so.1.0)',
 279        'conditions': [
 280          ['branding=="Chrome" or linux_chromium_breakpad==1', {
 281            'linux_breakpad%': 1,
 282          }, {
 283            'linux_breakpad%': 0,
 284          }],
 285          # All Chrome builds have breakpad symbols, but only process the
 286          # symbols from official builds.
 287          # TODO(mmoss) dump_syms segfaults on x64. Enable once dump_syms and
 288          # crash server handle 64-bit symbols.
 289          ['linux_chromium_dump_symbols==1 or '
 290           '(branding=="Chrome" and buildtype=="Official" and '
 291           'target_arch=="ia32")', {
 292            'linux_dump_symbols%': 1,
 293          }, {
 294            'linux_dump_symbols%': 0,
 295          }],
 296          ['toolkit_views==0', {
 297            # GTK wants Title Case strings
 298            'use_titlecase_in_grd_files%': 1,
 299          }],
 300        ],
 301      }],  # OS=="linux" or OS=="freebsd" or OS=="openbsd"
 302      ['OS=="mac"', {
 303        # Mac wants Title Case strings
 304        'use_titlecase_in_grd_files%': 1,
 305        'conditions': [
 306          # mac_product_name is set to the name of the .app bundle as it should
 307          # appear on disk.  This duplicates data from
 308          # chrome/app/theme/chromium/BRANDING and
 309          # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
 310          # these names into the build system.
 311          ['branding=="Chrome"', {
 312            'mac_product_name%': 'Google Chrome',
 313          }, { # else: branding!="Chrome"
 314            'mac_product_name%': 'Chromium',
 315          }],
 316
 317          # Feature variables for enabling Mac Breakpad and Keystone auto-update
 318          # support.  Both features are on by default in official builds with
 319          # Chrome branding.
 320          ['branding=="Chrome" and buildtype=="Official"', {
 321            'mac_breakpad%': 1,
 322            'mac_keystone%': 1,
 323          }, { # else: branding!="Chrome" or buildtype!="Official"
 324            'mac_breakpad%': 0,
 325            'mac_keystone%': 0,
 326          }],
 327        ],
 328      }],  # OS=="mac"
 329      # Whether to use multiple cores to compile with visual studio. This is
 330      # optional because it sometimes causes corruption on VS 2005.
 331      # It is on by default on VS 2008 and off on VS 2005.
 332      ['OS=="win"', {
 333        'conditions': [
 334          ['MSVS_VERSION=="2005"', {
 335            'msvs_multi_core_compile%': 0,
 336          },{
 337            'msvs_multi_core_compile%': 1,
 338          }],
 339          # Don't do incremental linking for large modules on 32-bit.
 340          ['MSVS_OS_BITS==32', {
 341            'msvs_large_module_debug_link_mode%': '1',  # No
 342          },{
 343            'msvs_large_module_debug_link_mode%': '2',  # Yes
 344          }],
 345        ],
 346        'nacl_win64_defines': [
 347          # This flag is used to minimize dependencies when building
 348          # Native Client loader for 64-bit Windows.
 349          'NACL_WIN64',
 350        ],
 351      }],
 352      # Compute based on OS and target architecture whether the GPU
 353      # plugin / process is supported.
 354      [ 'OS=="win" or (OS=="linux" and target_arch!="arm") or OS=="mac"', {
 355        # Enable a variable used elsewhere throughout the GYP files to determine
 356        # whether to compile in the sources for the GPU plugin / process.
 357        'enable_gpu%': 1,
 358      }, {  # GPU plugin not supported
 359        'enable_gpu%': 0,
 360      }],
 361      # Compute based on OS, target architecture and device whether GLES
 362      # is supported
 363      [ 'OS=="linux" and target_arch=="arm" and chromeos==1', {
 364        # Enable a variable used elsewhere throughout the GYP files to determine
 365        # whether to compile in the sources for the GLES support.
 366        'enable_gles%': 1,
 367      }, {  # GLES not supported
 368        'enable_gles%': 0,
 369      }],
 370    ],
 371
 372    # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
 373    # so Cocoa is happy (http://crbug.com/20441).
 374    'locales': [
 375      'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
 376      'en-US', 'es-419', 'es', 'et', 'fi', 'fil', 'fr', 'gu', 'he',
 377      'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
 378      'ml', 'mr', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
 379      'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
 380      'vi', 'zh-CN', 'zh-TW',
 381    ],
 382  },
 383  'target_defaults': {
 384    'variables': {
 385      # The condition that operates on chromium_code is in a target_conditions
 386      # section, and will not have access to the default fallback value of
 387      # chromium_code at the top of this file, or to the chromium_code
 388      # variable placed at the root variables scope of .gyp files, because
 389      # those variables are not set at target scope.  As a workaround,
 390      # if chromium_code is not set at target scope, define it in target scope
 391      # to contain whatever value it has during early variable expansion.
 392      # That's enough to make it available during target conditional
 393      # processing.
 394      'chromium_code%': '<(chromium_code)',
 395
 396      # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
 397      'mac_release_optimization%': '3', # Use -O3 unless overridden
 398      'mac_debug_optimization%': '0',   # Use -O0 unless overridden
 399      # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
 400      'win_release_Optimization%': '2', # 2 = /Os
 401      'win_debug_Optimization%': '0',   # 0 = /Od
 402      # See http://msdn.microsoft.com/en-us/library/aa652367(VS.71).aspx
 403      'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
 404      'win_debug_RuntimeLibrary%': '1',   # 1 = /MTd (debug static)
 405
 406      'release_extra_cflags%': '',
 407      'debug_extra_cflags%': '',
 408      'release_valgrind_build%': 0,
 409    },
 410    'conditions': [
 411      ['branding=="Chrome"', {
 412        'defines': ['GOOGLE_CHROME_BUILD'],
 413      }, {  # else: branding!="Chrome"
 414        'defines': ['CHROMIUM_BUILD'],
 415      }],
 416      ['toolkit_views==1', {
 417        'defines': ['TOOLKIT_VIEWS=1'],
 418      }],
 419      ['chromeos==1', {
 420        'defines': ['OS_CHROMEOS=1'],
 421      }],
 422      ['fastbuild!=0', {
 423        'conditions': [
 424          # Finally, for Windows, we simply turn on profiling.
 425          ['OS=="win"', {
 426            'msvs_settings': {
 427              'VCLinkerTool': {
 428                'GenerateDebugInformation': 'false',
 429              },
 430              'VCCLCompilerTool': {
 431                'DebugInformationFormat': '0',
 432              }
 433            }
 434          }, { # else: OS != "win"
 435            'cflags': [ '-g1' ],
 436          }],
 437        ],  # conditions for fastbuild.
 438      }],  # fastbuild!=0
 439      ['selinux==1', {
 440        'defines': ['CHROMIUM_SELINUX=1'],
 441      }],
 442      ['win_use_allocator_shim==0', {
 443        'conditions': [
 444          ['OS=="win"', {
 445            'defines': ['NO_TCMALLOC'],
 446          }],
 447        ],
 448      }],
 449      ['enable_gpu==1', {
 450        'defines': [
 451          'ENABLE_GPU=1',
 452        ],
 453      }],
 454      ['enable_gles==1', {
 455        'defines': [
 456          'ENABLE_GLES=1',
 457        ],
 458      }],
 459      ['coverage!=0', {
 460        'conditions': [
 461          ['OS=="mac"', {
 462            'xcode_settings': {
 463              'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES',  # -fprofile-arcs
 464              'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES',  # -ftest-coverage
 465            },
 466            # Add -lgcov for types executable, shared_library, and
 467            # loadable_module; not for static_library.
 468            # This is a delayed conditional.
 469            'target_conditions': [
 470              ['_type!="static_library"', {
 471                'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
 472              }],
 473            ],
 474          }],
 475          # Linux gyp (into scons) doesn't like target_conditions?
 476          # TODO(???): track down why 'target_conditions' doesn't work
 477          # on Linux gyp into scons like it does on Mac gyp into xcodeproj.
 478          ['OS=="linux"', {
 479            'cflags': [ '-ftest-coverage',
 480                        '-fprofile-arcs' ],
 481            'link_settings': { 'libraries': [ '-lgcov' ] },
 482          }],
 483          # Finally, for Windows, we simply turn on profiling.
 484          ['OS=="win"', {
 485            'msvs_settings': {
 486              'VCLinkerTool': {
 487                'Profile': 'true',
 488              },
 489              'VCCLCompilerTool': {
 490                # /Z7, not /Zi, so coverage is happyb
 491                'DebugInformationFormat': '1',
 492                'AdditionalOptions': ['/Yd'],
 493              }
 494            }
 495         }],  # OS==win
 496        ],  # conditions for coverage
 497      }],  # coverage!=0
 498    ],  # conditions for 'target_defaults'
 499    'target_conditions': [
 500      ['chromium_code==0', {
 501        'conditions': [
 502          [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
 503            'cflags!': [
 504              '-Wall',
 505              '-Wextra',
 506              '-Werror',
 507            ],
 508          }],
 509          [ 'OS=="win"', {
 510            'defines': [
 511              '_CRT_SECURE_NO_DEPRECATE',
 512              '_CRT_NONSTDC_NO_WARNINGS',
 513              '_CRT_NONSTDC_NO_DEPRECATE',
 514              '_SCL_SECURE_NO_DEPRECATE',
 515            ],
 516            'msvs_disabled_warnings': [4800],
 517            'msvs_settings': {
 518              'VCCLCompilerTool': {
 519                'WarnAsError': 'false',
 520                'Detect64BitPortabilityProblems': 'false',
 521              },
 522            },
 523          }],
 524          [ 'OS=="mac"', {
 525            'xcode_settings': {
 526              'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
 527              'WARNING_CFLAGS!': ['-Wall'],
 528            },
 529          }],
 530        ],
 531      }, {
 532        # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
 533        # C99 macros on Mac and Linux.
 534        'defines': [
 535          '__STDC_FORMAT_MACROS',
 536        ],
 537        'conditions': [
 538          ['OS!="win"', {
 539            'sources/': [ ['exclude', '_win(_unittest)?\\.cc$'],
 540                          ['exclude', '/win/'],
 541                          ['exclude', '/win_[^/]*\\.cc$'] ],
 542          }],
 543          ['OS!="mac"', {
 544            'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.cc$'],
 545                          ['exclude', '/(cocoa|mac)/'],
 546                          ['exclude', '\.mm?$' ] ],
 547          }],
 548          ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
 549            'sources/': [
 550              ['exclude', '_(chromeos|gtk|x|x11|xdg)(_unittest)?\\.cc$'],
 551              ['exclude', '/gtk/'],
 552              ['exclude', '/(gtk|x11)_[^/]*\\.cc$'],
 553            ],
 554          }],
 555          ['OS!="linux"', {
 556            'sources/': [
 557              ['exclude', '_linux(_unittest)?\\.cc$'],
 558              ['exclude', '/linux/'],
 559            ],
 560          }],
 561          # We use "POSIX" to refer to all non-Windows operating systems.
 562          ['OS=="win"', {
 563            'sources/': [ ['exclude', '_posix\\.cc$'] ],
 564          }],
 565          # Though Skia is conceptually shared by Linux and Windows,
 566          # the only _skia files in our tree are Linux-specific.
 567          ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
 568            'sources/': [ ['exclude', '_skia\\.cc$'] ],
 569          }],
 570          ['chromeos!=1', {
 571            'sources/': [ ['exclude', '_chromeos\\.cc$'] ]
 572          }],
 573          ['toolkit_views==0', {
 574            'sources/': [ ['exclude', '_views\\.cc$'] ]
 575          }],
 576        ],
 577      }],
 578    ],  # target_conditions for 'target_defaults'
 579    'default_configuration': 'Debug',
 580    'configurations': {
 581      # VCLinkerTool LinkIncremental values below:
 582      #   0 == default
 583      #   1 == /INCREMENTAL:NO
 584      #   2 == /INCREMENTAL
 585      # Debug links incremental, Release does not.
 586      #
 587      # Abstract base configurations to cover common
 588      # attributes.
 589      #
 590      'Common_Base': {
 591        'abstract': 1,
 592        'msvs_configuration_attributes': {
 593          'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
 594          'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
 595          'CharacterSet': '1',
 596        },
 597      },
 598      'x86_Base': {
 599        'abstract': 1,
 600        'msvs_settings': {
 601          'VCLinkerTool': {
 602            'TargetMachine': '1',
 603          },
 604        },
 605        'msvs_configuration_platform': 'Win32',
 606      },
 607      'x64_Base': {
 608        'abstract': 1,
 609        'msvs_configuration_platform': 'x64',
 610        'msvs_settings': {
 611          'VCLinkerTool': {
 612            'TargetMachine': '17', # x86 - 64
 613            'AdditionalLibraryDirectories!':
 614              ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
 615            'AdditionalLibraryDirectories':
 616              ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
 617          },
 618          'VCLibrarianTool': {
 619            'AdditionalLibraryDirectories!':
 620              ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
 621            'AdditionalLibraryDirectories':
 622              ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
 623          },
 624        },
 625        'defines': [
 626          # Not sure if tcmalloc works on 64-bit Windows.
 627          'NO_TCMALLOC',
 628        ],
 629      },
 630      'Debug_Base': {
 631        'abstract': 1,
 632        'xcode_settings': {
 633          'COPY_PHASE_STRIP': 'NO',
 634          'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
 635          'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ],
 636        },
 637        'msvs_settings': {
 638          'VCCLCompilerTool': {
 639            'Optimization': '<(win_debug_Optimization)',
 640            'PreprocessorDefinitions': ['_DEBUG'],
 641            'BasicRuntimeChecks': '3',
 642            'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
 643          },
 644          'VCLinkerTool': {
 645            'LinkIncremental': '<(msvs_debug_link_incremental)',
 646          },
 647          'VCResourceCompilerTool': {
 648            'PreprocessorDefinitions': ['_DEBUG'],
 649          },
 650        },
 651        'conditions': [
 652          ['OS=="linux"', {
 653            'cflags': [
 654              '<@(debug_extra_cflags)',
 655            ],
 656          }],
 657        ],
 658      },
 659      'Release_Base': {
 660        'abstract': 1,
 661        'defines': [
 662          'NDEBUG',
 663        ],
 664        'xcode_settings': {
 665          'DEAD_CODE_STRIPPING': 'YES',  # -Wl,-dead_strip
 666          'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
 667          'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
 668        },
 669        'msvs_settings': {
 670          'VCCLCompilerTool': {
 671            'Optimization': '<(win_release_Optimization)',
 672            'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
 673          },
 674          'VCLinkerTool': {
 675            'LinkIncremental': '1',
 676          },
 677        },
 678        'conditions': [
 679          ['release_valgrind_build==0', {
 680            'defines': ['NVALGRIND'],
 681          }],
 682          ['win_use_allocator_shim==0', {
 683            'defines': ['NO_TCMALLOC'],
 684          }],
 685          ['win_release_RuntimeLibrary==2', {
 686            # Visual C++ 2008 barfs when building anything with /MD (msvcrt):
 687            #  VC\include\typeinfo(139) : warning C4275: non dll-interface
 688            #  class 'stdext::exception' used as base for dll-interface
 689            #  class 'std::bad_cast'
 690            'msvs_disabled_warnings': [4275],
 691          }],
 692          ['OS=="linux"', {
 693            'cflags': [
 694             '<@(release_extra_cflags)',
 695            ],
 696          }],
 697        ],
 698      },
 699      'Purify_Base': {
 700        'abstract': 1,
 701        'defines': [
 702          'PURIFY',
 703          'NO_TCMALLOC',
 704        ],
 705        'msvs_settings': {
 706          'VCCLCompilerTool': {
 707            'Optimization': '0',
 708            'RuntimeLibrary': '0',
 709            'BufferSecurityCheck': 'false',
 710          },
 711          'VCLinkerTool': {
 712            'EnableCOMDATFolding': '1',
 713            'LinkIncremental': '1',
 714          },
 715        },
 716      },
 717      #
 718      # Concrete configurations
 719      #
 720      'Debug': {
 721        'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
 722      },
 723      'Release': {
 724        'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
 725        'conditions': [
 726          ['msvs_use_common_release', {
 727            'includes': ['release.gypi'],
 728          }],
 729        ]
 730      },
 731      'conditions': [
 732        [ 'OS=="win"', {
 733          # TODO(bradnelson): add a gyp mechanism to make this more graceful.
 734          'Purify': {
 735            'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base', 'Purify'],
 736          },
 737          'Debug_x64': {
 738            'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
 739          },
 740          'Release_x64': {
 741            'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
 742          },
 743          'Purify_x64': {
 744            'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base', 'Purify_Base'],
 745          },
 746        }],
 747      ],
 748    },
 749  },
 750  'conditions': [
 751    ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
 752      'target_defaults': {
 753        # Enable -Werror by default, but put it in a variable so it can
 754        # be disabled in ~/.gyp/include.gypi on the valgrind builders.
 755        'variables': {
 756          # Use -fno-strict-aliasing by default since gcc 4.4 has periodic
 757          # issues that slip through the cracks. We could do this just for
 758          # gcc 4.4 but it makes more sense to be consistent on all
 759          # compilers in use. TODO(Craig): turn this off again when
 760          # there is some 4.4 test infrastructure in place and existing
 761          # aliasing issues have been fixed.
 762          'no_strict_aliasing%': 1,
 763          'conditions': [['OS=="linux"', {'werror%': '-Werror',}],
 764                         ['OS=="freebsd"', {'werror%': '',}],
 765                         ['OS=="openbsd"', {'werror%': '',}],
 766          ],
 767        },
 768        'cflags': [
 769          '<(werror)',  # See note above about the werror variable.
 770          '-pthread',
 771          '-fno-exceptions',
 772          '-Wall',
 773          # TODO(evan): turn this back on once all the builds work.
 774          # '-Wextra',
 775          # Don't warn about unused function params.  We use those everywhere.
 776          '-Wno-unused-parameter',
 777          # Don't warn about the "struct foo f = {0};" initialization pattern.
 778          '-Wno-missing-field-initializers',
 779          '-D_FILE_OFFSET_BITS=64',
 780          # Don't export any symbols (for example, to plugins we dlopen()).
 781          # Note: this is *required* to make some plugins work.
 782          '-fvisibility=hidden',
 783        ],
 784        'cflags_cc': [
 785          '-fno-rtti',
 786          '-fno-threadsafe-statics',
 787          # Make inline functions have hidden visiblity by default.
 788          # Surprisingly, not covered by -fvisibility=hidden.
 789          '-fvisibility-inlines-hidden',
 790        ],
 791        'ldflags': [
 792          '-pthread', '-Wl,-z,noexecstack',
 793        ],
 794        'scons_variable_settings': {
 795          'LIBPATH': ['$LIB_DIR'],
 796          # Linking of large files uses lots of RAM, so serialize links
 797          # using the handy flock command from util-linux.
 798          'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
 799          'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
 800          'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
 801
 802          # We have several cases where archives depend on each other in
 803          # a cyclic fashion.  Since the GNU linker does only a single
 804          # pass over the archives we surround the libraries with
 805          # --start-group and --end-group (aka -( and -) ). That causes
 806          # ld to loop over the group until no more undefined symbols
 807          # are found. In an ideal world we would only make groups from
 808          # those libraries which we knew to be in cycles. However,
 809          # that's tough with SCons, so we bodge it by making all the
 810          # archives a group by redefining the linking command here.
 811          #
 812          # TODO:  investigate whether we still have cycles that
 813          # require --{start,end}-group.  There has been a lot of
 814          # refactoring since this was first coded, which might have
 815          # eliminated the circular dependencies.
 816          #
 817          # Note:  $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS
 818          # so that we prefer our own built libraries (e.g. -lpng) to
 819          # system versions of libraries that pkg-config might turn up.
 820          # TODO(sgk): investigate handling this not by re-ordering the
 821          # flags this way, but by adding a hook to use the SCons
 822          # ParseFlags() option on the output from pkg-config.
 823          'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET',
 824                       '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES',
 825                       '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
 826          'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET',
 827                         '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES',
 828                         '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
 829          'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET',
 830                           '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES',
 831                           '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
 832          'IMPLICIT_COMMAND_DEPENDENCIES': 0,
 833          # -rpath is only used when building with shared libraries.
 834          'conditions': [
 835            [ 'library=="shared_library"', {
 836              'RPATH': '$LIB_DIR',
 837            }],
 838          ],
 839        },
 840        'scons_import_variables': [
 841          'AS',
 842          'CC',
 843          'CXX',
 844          'LINK',
 845        ],
 846        'scons_propagate_variables': [
 847          'AS',
 848          'CC',
 849          'CCACHE_DIR',
 850          'CXX',
 851          'DISTCC_DIR',
 852          'DISTCC_HOSTS',
 853          'HOME',
 854          'INCLUDE_SERVER_ARGS',
 855          'INCLUDE_SERVER_PORT',
 856          'LINK',
 857          'CHROME_BUILD_TYPE',
 858          'CHROMIUM_BUILD',
 859          'OFFICIAL_BUILD',
 860        ],
 861        'configurations': {
 862          'Debug_Base': {
 863            'variables': {
 864              'debug_optimize%': '0',
 865            },
 866            'defines': [
 867              '_DEBUG',
 868            ],
 869            'cflags': [
 870              '-O>(debug_optimize)',
 871              '-g',
 872              # One can use '-gstabs' to enable building the debugging
 873              # information in STABS format for breakpad's dumpsyms.
 874            ],
 875            'ldflags': [
 876              '-rdynamic',  # Allows backtrace to resolve symbols.
 877            ],
 878          },
 879          'Release_Base': {
 880            'variables': {
 881              'release_optimize%': '2',
 882            },
 883            'cflags': [
 884              '-O>(release_optimize)',
 885              # Don't emit the GCC version ident directives, they just end up
 886              # in the .comment section taking up binary size.
 887              '-fno-ident',
 888              # Put data and code in their own sections, so that unused symbols
 889              # can be removed at link time with --gc-sections.
 890              '-fdata-sections',
 891              '-ffunction-sections',
 892            ],
 893            'ldflags': [
 894              '-Wl,--gc-sections',
 895            ],
 896          },
 897        },
 898        'variants': {
 899          'coverage': {
 900            'cflags': ['-fprofile-arcs', '-ftest-coverage'],
 901            'ldflags': ['-fprofile-arcs'],
 902          },
 903          'profile': {
 904            'cflags': ['-pg', '-g'],
 905            'ldflags': ['-pg'],
 906          },
 907          'symbols': {
 908            'cflags': ['-g'],
 909          },
 910        },
 911        'conditions': [
 912          [ 'target_arch=="ia32"', {
 913            'asflags': [
 914              # Needed so that libs with .s files (e.g. libicudata.a)
 915              # are compatible with the general 32-bit-ness.
 916              '-32',
 917            ],
 918            # All floating-point computations on x87 happens in 80-bit
 919            # precision.  Because the C and C++ language standards allow
 920            # the compiler to keep the floating-point values in higher
 921            # precision than what's specified in the source and doing so
 922            # is more efficient than constantly rounding up to 64-bit or
 923            # 32-bit precision as specified in the source, the compiler,
 924            # especially in the optimized mode, tries very hard to keep
 925            # values in x87 floating-point stack (in 80-bit precision)
 926            # as long as possible. This has important side effects, that
 927            # the real value used in computation may change depending on
 928            # how the compiler did the optimization - that is, the value
 929            # kept in 80-bit is different than the value rounded down to
 930            # 64-bit or 32-bit. There are possible compiler options to make
 931            # this behavior consistent (e.g. -ffloat-store would keep all
 932            # floating-values in the memory, thus force them to be rounded
 933            # to its original precision) but they have significant runtime
 934            # performance penalty.
 935            #
 936            # -mfpmath=sse -msse2 makes the compiler use SSE instructions
 937            # which keep floating-point values in SSE registers in its
 938            # native precision (32-bit for single precision, and 64-bit for
 939            # double precision values). This means the floating-point value
 940            # used during computation does not change depending on how the
 941            # compiler optimized the code, since the value is always kept
 942            # in its specified precision.
 943            'conditions': [
 944              ['branding=="Chromium" and disable_sse2==0', {
 945                'cflags': [
 946                  '-march=pentium4',
 947                  '-msse2',
 948                  '-mfpmath=sse',
 949                ],
 950              }],
 951              # ChromeOS targets Pinetrail, which is sse3, but most of the
 952              # benefit comes from sse2 so this setting allows ChromeOS
 953              # to build on other CPUs.  In the future -march=atom would help
 954              # but requires a newer compiler.
 955              ['chromeos==1 and disable_sse2==0', {
 956                'cflags': [
 957                  '-msse2',
 958                ],
 959              }],
 960            ],
 961            # -mmmx allows mmintrin.h to be used for mmx intrinsics.
 962            # video playback is mmx and sse2 optimized.
 963            'cflags': [
 964              '-m32',
 965              '-mmmx',
 966            ],
 967            'ldflags': [
 968              '-m32',
 969            ],
 970          }],
 971          ['target_arch=="arm"', {
 972            'target_conditions': [
 973              ['_toolset=="target"', {
 974                'cflags_cc': [
 975                  # The codesourcery arm-2009q3 toolchain warns at that the ABI
 976                  # has changed whenever it encounters a varargs function. This
 977                  # silences those warnings, as they are not helpful and
 978                  # clutter legitimate warnings.
 979                  '-Wno-abi',
 980                ],
 981                'conditions': [
 982                  ['arm_thumb == 1', {
 983                    'cflags': [
 984                    '-mthumb',
 985                    # TODO(piman): -Wa,-mimplicit-it=thumb is needed for
 986                    # inline assembly that uses condition codes but it's
 987                    # suboptimal. Better would be to #ifdef __thumb__ at the
 988                    # right place and have a separate thumb path.
 989                    '-Wa,-mimplicit-it=thumb',
 990                    ]
 991                  }],
 992                  ['armv7==1', {
 993                    'cflags': [
 994                      '-march=armv7-a',
 995                      '-mtune=cortex-a8',
 996                      '-mfloat-abi=softfp',
 997                    ],
 998                    'conditions': [
 999                      ['arm_neon==1', {
1000                        'cflags': [ '-mfpu=neon', ],
1001                      }, {
1002                        'cflags': [ '-mfpu=<(arm_fpu)', ],
1003                      }]
1004                    ],
1005                  }],
1006                ],
1007              }],
1008            ],
1009          }],
1010          ['linux_fpic==1', {
1011            'cflags': [
1012              '-fPIC',
1013            ],
1014          }],
1015          ['sysroot!=""', {
1016            'target_conditions': [
1017              ['_toolset=="target"', {
1018                'cflags': [
1019                  '--sysroot=<(sysroot)',
1020                ],
1021                'ldflags': [
1022                  '--sysroot=<(sysroot)',
1023                ],
1024              }]]
1025          }],
1026          ['no_strict_aliasing==1', {
1027            'cflags': [
1028              '-fno-strict-aliasing',
1029            ],
1030          }],
1031          ['linux_breakpad==1', {
1032            'cflags': [ '-gstabs' ],
1033            'defines': ['USE_LINUX_BREAKPAD'],
1034          }],
1035          ['linux_use_seccomp_sandbox==1 and buildtype!="Official"', {
1036            'defines': ['USE_SECCOMP_SANDBOX'],
1037          }],
1038          ['library=="shared_library"', {
1039            # When building with shared libraries, remove the visiblity-hiding
1040            # flag.
1041            'cflags!': [ '-fvisibility=hidden' ],
1042            'conditions': [
1043              ['target_arch=="x64" or target_arch=="arm"', {
1044                # Shared libraries need -fPIC on x86-64 and arm
1045                'cflags': ['-fPIC']
1046              }]
1047            ],
1048          }],
1049          ['linux_use_heapchecker==1', {
1050            'variables': {'linux_use_tcmalloc%': 1},
1051          }],
1052          ['linux_use_tcmalloc==0', {
1053            'defines': ['NO_TCMALLOC'],
1054          }],
1055          ['linux_use_heapchecker==0', {
1056            'defines': ['NO_HEAPCHECKER'],
1057          }],
1058        ],
1059      },
1060    }],
1061    # FreeBSD-specific options; note that most FreeBSD options are set above,
1062    # with Linux.
1063    ['OS=="freebsd"', {
1064      'target_defaults': {
1065        'ldflags': [
1066          '-Wl,--no-keep-memory',
1067        ],
1068      },
1069    }],
1070    ['OS=="solaris"', {
1071      'cflags!': ['-fvisibility=hidden'],
1072      'cflags_cc!': ['-fvisibility-inlines-hidden'],
1073    }],
1074    ['OS=="mac"', {
1075      'target_defaults': {
1076        'variables': {
1077          # This should be 'mac_real_dsym%', but there seems to be a bug
1078          # with % in variables that are intended to be set to different
1079          # values in different targets, like this one.
1080          'mac_real_dsym': 0,  # Fake .dSYMs are fine in most cases.
1081        },
1082        'mac_bundle': 0,
1083        'xcode_settings': {
1084          'ALWAYS_SEARCH_USER_PATHS': 'NO',
1085          'GCC_C_LANGUAGE_STANDARD': 'c99',         # -std=c99
1086          'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
1087          'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
1088                                                    # (Equivalent to -fPIC)
1089          'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
1090          'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
1091          'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
1092          # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
1093          'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
1094          'GCC_OBJC_CALL_CXX_CDTORS': 'YES',        # -fobjc-call-cxx-cdtors
1095          'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden
1096          'GCC_THREADSAFE_STATICS': 'NO',           # -fno-threadsafe-statics
1097          'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',    # -Werror
1098          'GCC_VERSION': '4.2',
1099          'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',  # -Wnewline-eof
1100          # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
1101          'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
1102          'PREBINDING': 'NO',                       # No -Wl,-prebind
1103          'USE_HEADERMAP': 'NO',
1104          'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'],
1105          'conditions': [
1106            ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
1107                                 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
1108            ],
1109          ],
1110        },
1111        'target_conditions': [
1112          ['_type!="static_library"', {
1113            'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
1114          }],
1115          ['_mac_bundle', {
1116            'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
1117          }],
1118          ['_type=="executable" or _type=="shared_library"', {
1119            'target_conditions': [
1120              ['mac_real_dsym == 1', {
1121                # To get a real .dSYM bundle produced by dsymutil, set the
1122                # debug information format to dwarf-with-dsym.  Since
1123                # strip_from_xcode will not be used, set Xcode to do the
1124                # stripping as well.
1125                'configurations': {
1126                  'Release_Base': {
1127                    'xcode_settings': {
1128                      'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
1129                      'DEPLOYMENT_POSTPROCESSING': 'YES',
1130                      'STRIP_INSTALLED_PRODUCT': 'YES',
1131                      'target_conditions': [
1132                        ['_type=="shared_library"', {
1133                          # The Xcode default is to strip debugging symbols
1134                          # only (-S).  Local symbols should be stripped as
1135                          # well, which will be handled by -x.  Xcode will
1136                          # continue to insert -S when stripping even when
1137                          # additional flags are added with STRIPFLAGS.
1138                          'STRIPFLAGS': '-x',
1139                        }],  # _type=="shared_library"
1140                      ],  # target_conditions
1141                    },  # xcode_settings
1142                  },  # configuration "Release"
1143                },  # configurations
1144              }, {  # mac_real_dsym != 1
1145                # To get a fast fake .dSYM bundle, use a post-build step to
1146                # produce the .dSYM and strip the executable.  strip_from_xcode
1147                # only operates in the Release configuration.
1148                'postbuilds': [
1149                  {
1150                    'variables': {
1151                      # Define strip_from_xcode in a variable ending in _path
1152                      # so that gyp understands it's a path and performs proper
1153                      # relativization during dict merging.
1154                      'strip_from_xcode_path': 'mac/strip_from_xcode',
1155                    },
1156                    'postbuild_name': 'Strip If Needed',
1157                    'action': ['<(strip_from_xcode_path)'],
1158                  },
1159                ],  # postbuilds
1160              }],  # mac_real_dsym
1161            ],  # target_conditions
1162          }],  # _type=="executable" or _type=="shared_library"
1163        ],  # target_conditions
1164      },  # target_defaults
1165    }],  # OS=="mac"
1166    ['OS=="win"', {
1167      'target_defaults': {
1168        'defines': [
1169          '_WIN32_WINNT=0x0600',
1170          'WINVER=0x0600',
1171          'WIN32',
1172          '_WINDOWS',
1173          '_HAS_EXCEPTIONS=0',
1174          'NOMINMAX',
1175          '_CRT_RAND_S',
1176          'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
1177          'WIN32_LEAN_AND_MEAN',
1178          '_SECURE_ATL',
1179          '_HAS_TR1=0',
1180        ],
1181        'msvs_system_include_dirs': [
1182          '<(DEPTH)/third_party/platformsdk_win7/files/Include',
1183          '$(VSInstallDir)/VC/atlmfc/include',
1184        ],
1185        'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
1186        'msvs_disabled_warnings': [4396, 4503, 4819],
1187        'msvs_settings': {
1188          'VCCLCompilerTool': {
1189            'MinimalRebuild': 'false',
1190            'ExceptionHandling': '0',
1191            'BufferSecurityCheck': 'true',
1192            'EnableFunctionLevelLinking': 'true',
1193            'RuntimeTypeInfo': 'false',
1194            'WarningLevel': '3',
1195            'WarnAsError': 'true',
1196            'DebugInformationFormat': '3',
1197            'conditions': [
1198              [ 'msvs_multi_core_compile', {
1199                'AdditionalOptions': ['/MP'],
1200              }],
1201            ],
1202          },
1203          'VCLibrarianTool': {
1204            'AdditionalOptions': ['/ignore:4221'],
1205            'AdditionalLibraryDirectories':
1206              ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
1207          },
1208          'VCLinkerTool': {
1209            'AdditionalDependencies': [
1210              'wininet.lib',
1211              'version.lib',
1212              'msimg32.lib',
1213              'ws2_32.lib',
1214              'usp10.lib',
1215              'psapi.lib',
1216              'dbghelp.lib',
1217            ],
1218            'AdditionalLibraryDirectories':
1219              ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
1220            'GenerateDebugInformation': 'true',
1221            'MapFileName': '$(OutDir)\\$(TargetName).map',
1222            'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
1223            'FixedBaseAddress': '1',
1224            # SubSystem values:
1225            #   0 == not set
1226            #   1 == /SUBSYSTEM:CONSOLE
1227            #   2 == /SUBSYSTEM:WINDOWS
1228            # Most of the executables we'll ever create are tests
1229            # and utilities with console output.
1230            'SubSystem': '1',
1231          },
1232          'VCMIDLTool': {
1233            'GenerateStublessProxies': 'true',
1234            'TypeLibraryName': '$(InputName).tlb',
1235            'OutputDirectory': '$(IntDir)',
1236            'HeaderFileName': '$(InputName).h',
1237            'DLLDataFileName': 'dlldata.c',
1238            'InterfaceIdentifierFileName': '$(InputName)_i.c',
1239            'ProxyFileName': '$(InputName)_p.c',
1240          },
1241          'VCResourceCompilerTool': {
1242            'Culture' : '1033',
1243            'AdditionalIncludeDirectories': ['<(DEPTH)'],
1244          },
1245        },
1246      },
1247    }],
1248    ['disable_nacl==1 or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
1249      'target_defaults': {
1250        'defines': [
1251          'DISABLE_NACL',
1252        ],
1253      },
1254    }],
1255    ['OS=="win" and msvs_use_common_linker_extras', {
1256      'target_defaults': {
1257        'msvs_settings': {
1258          'VCLinkerTool': {
1259            'DelayLoadDLLs': [
1260              'dbghelp.dll',
1261              'dwmapi.dll',
1262              'uxtheme.dll',
1263            ],
1264          },
1265        },
1266        'configurations': {
1267          'x86_Base': {
1268            'msvs_settings': {
1269              'VCLinkerTool': {
1270                'AdditionalOptions': [
1271                  '/safeseh',
1272                  '/dynamicbase',
1273                  '/ignore:4199',
1274                  '/ignore:4221',
1275                  '/nxcompat',
1276                ],
1277              },
1278            },
1279          },
1280

Large files files are truncated, but you can click here to view the full file