toolkit/crashreporter/google-breakpad/src/client/windows/build/common.gypi

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/crashreporter/google-breakpad/src/client/windows/build/common.gypi	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,1330 @@
     1.4 +# Copyright (c) 2010, Google Inc.
     1.5 +# All rights reserved.
     1.6 +#
     1.7 +# Redistribution and use in source and binary forms, with or without
     1.8 +# modification, are permitted provided that the following conditions are
     1.9 +# met:
    1.10 +#
    1.11 +#     * Redistributions of source code must retain the above copyright
    1.12 +# notice, this list of conditions and the following disclaimer.
    1.13 +#     * Redistributions in binary form must reproduce the above
    1.14 +# copyright notice, this list of conditions and the following disclaimer
    1.15 +# in the documentation and/or other materials provided with the
    1.16 +# distribution.
    1.17 +#     * Neither the name of Google Inc. nor the names of its
    1.18 +# contributors may be used to endorse or promote products derived from
    1.19 +# this software without specific prior written permission.
    1.20 +#
    1.21 +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    1.22 +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    1.23 +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    1.24 +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    1.25 +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.26 +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.27 +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    1.28 +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    1.29 +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    1.30 +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    1.31 +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.32 +
    1.33 +# IMPORTANT:
    1.34 +# Please don't directly include this file if you are building via gyp_chromium,
    1.35 +# since gyp_chromium is automatically forcing its inclusion.
    1.36 +{
    1.37 +  'variables': {
    1.38 +    # .gyp files or targets should set chromium_code to 1 if they build
    1.39 +    # Chromium-specific code, as opposed to external code.  This variable is
    1.40 +    # used to control such things as the set of warnings to enable, and
    1.41 +    # whether warnings are treated as errors.
    1.42 +    'chromium_code%': 0,
    1.43 +
    1.44 +    # Variables expected to be overriden on the GYP command line (-D) or by
    1.45 +    # ~/.gyp/include.gypi.
    1.46 +
    1.47 +    # Putting a variables dict inside another variables dict looks kind of
    1.48 +    # weird.  This is done so that "branding" and "buildtype" are defined as
    1.49 +    # variables within the outer variables dict here.  This is necessary
    1.50 +    # to get these variables defined for the conditions within this variables
    1.51 +    # dict that operate on these variables.
    1.52 +    'variables': {
    1.53 +      # Override branding to select the desired branding flavor.
    1.54 +      'branding%': 'Chromium',
    1.55 +
    1.56 +      # Override buildtype to select the desired build flavor.
    1.57 +      # Dev - everyday build for development/testing
    1.58 +      # Official - release build (generally implies additional processing)
    1.59 +      # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
    1.60 +      # conversion is done), some of the things which are now controlled by
    1.61 +      # 'branding', such as symbol generation, will need to be refactored based
    1.62 +      # on 'buildtype' (i.e. we don't care about saving symbols for non-Official
    1.63 +      # builds).
    1.64 +      'buildtype%': 'Dev',
    1.65 +
    1.66 +      'variables': {
    1.67 +        # Compute the architecture that we're building on.
    1.68 +        'conditions': [
    1.69 +          [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
    1.70 +            # This handles the Linux platforms we generally deal with. Anything
    1.71 +            # else gets passed through, which probably won't work very well; such
    1.72 +            # hosts should pass an explicit target_arch to gyp.
    1.73 +            'host_arch%':
    1.74 +              '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/")',
    1.75 +          }, {  # OS!="linux"
    1.76 +            'host_arch%': 'ia32',
    1.77 +          }],
    1.78 +        ],
    1.79 +
    1.80 +        # Whether we're building a ChromeOS build.  We set the initial
    1.81 +        # value at this level of nesting so it's available for the
    1.82 +        # toolkit_views test below.
    1.83 +        'chromeos%': '0',
    1.84 +      },
    1.85 +
    1.86 +      # Set default value of toolkit_views on for Windows and Chrome OS.
    1.87 +      # We set it at this level of nesting so the value is available for
    1.88 +      # other conditionals below.
    1.89 +      'conditions': [
    1.90 +        ['OS=="win" or chromeos==1', {
    1.91 +          'toolkit_views%': 1,
    1.92 +        }, {
    1.93 +          'toolkit_views%': 0,
    1.94 +        }],
    1.95 +      ],
    1.96 +
    1.97 +      'host_arch%': '<(host_arch)',
    1.98 +
    1.99 +      # Default architecture we're building for is the architecture we're
   1.100 +      # building on.
   1.101 +      'target_arch%': '<(host_arch)',
   1.102 +
   1.103 +      # We do want to build Chromium with Breakpad support in certain
   1.104 +      # situations. I.e. for Chrome bot.
   1.105 +      'linux_chromium_breakpad%': 0,
   1.106 +      # And if we want to dump symbols.
   1.107 +      'linux_chromium_dump_symbols%': 0,
   1.108 +      # Also see linux_strip_binary below.
   1.109 +
   1.110 +      # Copy conditionally-set chromeos variable out one scope.
   1.111 +      'chromeos%': '<(chromeos)',
   1.112 +
   1.113 +      # This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are
   1.114 +      # are built under a chromium full build (1) or a webkit.org chromium
   1.115 +      # build (0).
   1.116 +      'inside_chromium_build%': 1,
   1.117 +
   1.118 +      # Set to 1 to enable fast builds. It disables debug info for fastest
   1.119 +      # compilation.
   1.120 +      'fastbuild%': 0,
   1.121 +
   1.122 +      # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
   1.123 +      # libraries on linux x86-64 and arm.
   1.124 +      'linux_fpic%': 0,
   1.125 +
   1.126 +      # Python version.
   1.127 +      'python_ver%': '2.5',
   1.128 +
   1.129 +      # Set ARM-v7 compilation flags
   1.130 +      'armv7%': 0,
   1.131 +
   1.132 +      # Set Neon compilation flags (only meaningful if armv7==1).
   1.133 +      'arm_neon%': 1,
   1.134 +
   1.135 +      # The system root for cross-compiles. Default: none.
   1.136 +      'sysroot%': '',
   1.137 +
   1.138 +      # On Linux, we build with sse2 for Chromium builds.
   1.139 +      'disable_sse2%': 0,
   1.140 +    },
   1.141 +
   1.142 +    # Define branding and buildtype on the basis of their settings within the
   1.143 +    # variables sub-dict above, unless overridden.
   1.144 +    'branding%': '<(branding)',
   1.145 +    'buildtype%': '<(buildtype)',
   1.146 +    'target_arch%': '<(target_arch)',
   1.147 +    'host_arch%': '<(host_arch)',
   1.148 +    'toolkit_views%': '<(toolkit_views)',
   1.149 +    'chromeos%': '<(chromeos)',
   1.150 +    'inside_chromium_build%': '<(inside_chromium_build)',
   1.151 +    'fastbuild%': '<(fastbuild)',
   1.152 +    'linux_fpic%': '<(linux_fpic)',
   1.153 +    'python_ver%': '<(python_ver)',
   1.154 +    'armv7%': '<(armv7)',
   1.155 +    'arm_neon%': '<(arm_neon)',
   1.156 +    'sysroot%': '<(sysroot)',
   1.157 +    'disable_sse2%': '<(disable_sse2)',
   1.158 +
   1.159 +    # The release channel that this build targets. This is used to restrict
   1.160 +    # channel-specific build options, like which installer packages to create.
   1.161 +    # The default is 'all', which does no channel-specific filtering.
   1.162 +    'channel%': 'all',
   1.163 +
   1.164 +    # Override chromium_mac_pch and set it to 0 to suppress the use of
   1.165 +    # precompiled headers on the Mac.  Prefix header injection may still be
   1.166 +    # used, but prefix headers will not be precompiled.  This is useful when
   1.167 +    # using distcc to distribute a build to compile slaves that don't
   1.168 +    # share the same compiler executable as the system driving the compilation,
   1.169 +    # because precompiled headers rely on pointers into a specific compiler
   1.170 +    # executable's image.  Setting this to 0 is needed to use an experimental
   1.171 +    # Linux-Mac cross compiler distcc farm.
   1.172 +    'chromium_mac_pch%': 1,
   1.173 +
   1.174 +    # Mac OS X SDK and deployment target support.
   1.175 +    # The SDK identifies the version of the system headers that will be used,
   1.176 +    # and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro.
   1.177 +    # "Maximum allowed" refers to the operating system version whose APIs are
   1.178 +    # available in the headers.
   1.179 +    # The deployment target identifies the minimum system version that the
   1.180 +    # built products are expected to function on.  It corresponds to the
   1.181 +    # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.
   1.182 +    # To ensure these macros are available, #include <AvailabilityMacros.h>.
   1.183 +    # Additional documentation on these macros is available at
   1.184 +    # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
   1.185 +    # Chrome normally builds with the Mac OS X 10.5 SDK and sets the
   1.186 +    # deployment target to 10.5.  Other projects, such as O3D, may override
   1.187 +    # these defaults.
   1.188 +    'mac_sdk%': '10.5',
   1.189 +    'mac_deployment_target%': '10.5',
   1.190 +
   1.191 +    # Set to 1 to enable code coverage.  In addition to build changes
   1.192 +    # (e.g. extra CFLAGS), also creates a new target in the src/chrome
   1.193 +    # project file called "coverage".
   1.194 +    # Currently ignored on Windows.
   1.195 +    'coverage%': 0,
   1.196 +
   1.197 +    # Although base/allocator lets you select a heap library via an
   1.198 +    # environment variable, the libcmt shim it uses sometimes gets in
   1.199 +    # the way.  To disable it entirely, and switch to normal msvcrt, do e.g.
   1.200 +    #  'win_use_allocator_shim': 0,
   1.201 +    #  'win_release_RuntimeLibrary': 2
   1.202 +    # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
   1.203 +    'win_use_allocator_shim%': 1, # 0 = shim allocator via libcmt; 1 = msvcrt
   1.204 +
   1.205 +    # Whether usage of OpenMAX is enabled.
   1.206 +    'enable_openmax%': 0,
   1.207 +
   1.208 +    # TODO(bradnelson): eliminate this when possible.
   1.209 +    # To allow local gyp files to prevent release.vsprops from being included.
   1.210 +    # Yes(1) means include release.vsprops.
   1.211 +    # Once all vsprops settings are migrated into gyp, this can go away.
   1.212 +    'msvs_use_common_release%': 1,
   1.213 +
   1.214 +    # TODO(bradnelson): eliminate this when possible.
   1.215 +    # To allow local gyp files to override additional linker options for msvs.
   1.216 +    # Yes(1) means set use the common linker options.
   1.217 +    'msvs_use_common_linker_extras%': 1,
   1.218 +
   1.219 +    # TODO(sgk): eliminate this if possible.
   1.220 +    # It would be nicer to support this via a setting in 'target_defaults'
   1.221 +    # in chrome/app/locales/locales.gypi overriding the setting in the
   1.222 +    # 'Debug' configuration in the 'target_defaults' dict below,
   1.223 +    # but that doesn't work as we'd like.
   1.224 +    'msvs_debug_link_incremental%': '2',
   1.225 +
   1.226 +    # This is the location of the sandbox binary. Chrome looks for this before
   1.227 +    # running the zygote process. If found, and SUID, it will be used to
   1.228 +    # sandbox the zygote process and, thus, all renderer processes.
   1.229 +    'linux_sandbox_path%': '',
   1.230 +
   1.231 +    # Set this to true to enable SELinux support.
   1.232 +    'selinux%': 0,
   1.233 +
   1.234 +    # Strip the binary after dumping symbols.
   1.235 +    'linux_strip_binary%': 0,
   1.236 +
   1.237 +    # Enable TCMalloc.
   1.238 +    'linux_use_tcmalloc%': 1,
   1.239 +
   1.240 +    # Disable TCMalloc's debugallocation.
   1.241 +    'linux_use_debugallocation%': 0,
   1.242 +
   1.243 +    # Disable TCMalloc's heapchecker.
   1.244 +    'linux_use_heapchecker%': 0,
   1.245 +
   1.246 +    # Set to 1 to turn on seccomp sandbox by default.
   1.247 +    # (Note: this is ignored for official builds.)
   1.248 +    'linux_use_seccomp_sandbox%': 0,
   1.249 +
   1.250 +    # Set to select the Title Case versions of strings in GRD files.
   1.251 +    'use_titlecase_in_grd_files%': 0,
   1.252 +
   1.253 +    # Used to disable Native Client at compile time, for platforms where it
   1.254 +    # isn't supported
   1.255 +    'disable_nacl%': 0,
   1.256 +
   1.257 +    # Set Thumb compilation flags.
   1.258 +    'arm_thumb%': 0,
   1.259 +
   1.260 +    # Set ARM fpu compilation flags (only meaningful if armv7==1 and
   1.261 +    # arm_neon==0).
   1.262 +    'arm_fpu%': 'vfpv3',
   1.263 +
   1.264 +    # Enable new NPDevice API.
   1.265 +    'enable_new_npdevice_api%': 0,
   1.266 +
   1.267 +    'conditions': [
   1.268 +      ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
   1.269 +        # This will set gcc_version to XY if you are running gcc X.Y.*.
   1.270 +        # This is used to tweak build flags for gcc 4.4.
   1.271 +        'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
   1.272 +        # Figure out the python architecture to decide if we build pyauto.
   1.273 +        'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/lib/libpython<(python_ver).so.1.0)',
   1.274 +        'conditions': [
   1.275 +          ['branding=="Chrome" or linux_chromium_breakpad==1', {
   1.276 +            'linux_breakpad%': 1,
   1.277 +          }, {
   1.278 +            'linux_breakpad%': 0,
   1.279 +          }],
   1.280 +          # All Chrome builds have breakpad symbols, but only process the
   1.281 +          # symbols from official builds.
   1.282 +          # TODO(mmoss) dump_syms segfaults on x64. Enable once dump_syms and
   1.283 +          # crash server handle 64-bit symbols.
   1.284 +          ['linux_chromium_dump_symbols==1 or '
   1.285 +           '(branding=="Chrome" and buildtype=="Official" and '
   1.286 +           'target_arch=="ia32")', {
   1.287 +            'linux_dump_symbols%': 1,
   1.288 +          }, {
   1.289 +            'linux_dump_symbols%': 0,
   1.290 +          }],
   1.291 +          ['toolkit_views==0', {
   1.292 +            # GTK wants Title Case strings
   1.293 +            'use_titlecase_in_grd_files%': 1,
   1.294 +          }],
   1.295 +        ],
   1.296 +      }],  # OS=="linux" or OS=="freebsd" or OS=="openbsd"
   1.297 +      ['OS=="mac"', {
   1.298 +        # Mac wants Title Case strings
   1.299 +        'use_titlecase_in_grd_files%': 1,
   1.300 +        'conditions': [
   1.301 +          # mac_product_name is set to the name of the .app bundle as it should
   1.302 +          # appear on disk.  This duplicates data from
   1.303 +          # chrome/app/theme/chromium/BRANDING and
   1.304 +          # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
   1.305 +          # these names into the build system.
   1.306 +          ['branding=="Chrome"', {
   1.307 +            'mac_product_name%': 'Google Chrome',
   1.308 +          }, { # else: branding!="Chrome"
   1.309 +            'mac_product_name%': 'Chromium',
   1.310 +          }],
   1.311 +
   1.312 +          # Feature variables for enabling Mac Breakpad and Keystone auto-update
   1.313 +          # support.  Both features are on by default in official builds with
   1.314 +          # Chrome branding.
   1.315 +          ['branding=="Chrome" and buildtype=="Official"', {
   1.316 +            'mac_breakpad%': 1,
   1.317 +            'mac_keystone%': 1,
   1.318 +          }, { # else: branding!="Chrome" or buildtype!="Official"
   1.319 +            'mac_breakpad%': 0,
   1.320 +            'mac_keystone%': 0,
   1.321 +          }],
   1.322 +        ],
   1.323 +      }],  # OS=="mac"
   1.324 +      # Whether to use multiple cores to compile with visual studio. This is
   1.325 +      # optional because it sometimes causes corruption on VS 2005.
   1.326 +      # It is on by default on VS 2008 and off on VS 2005.
   1.327 +      ['OS=="win"', {
   1.328 +        'conditions': [
   1.329 +          ['MSVS_VERSION=="2005"', {
   1.330 +            'msvs_multi_core_compile%': 0,
   1.331 +          },{
   1.332 +            'msvs_multi_core_compile%': 1,
   1.333 +          }],
   1.334 +          # Don't do incremental linking for large modules on 32-bit.
   1.335 +          ['MSVS_OS_BITS==32', {
   1.336 +            'msvs_large_module_debug_link_mode%': '1',  # No
   1.337 +          },{
   1.338 +            'msvs_large_module_debug_link_mode%': '2',  # Yes
   1.339 +          }],
   1.340 +        ],
   1.341 +        'nacl_win64_defines': [
   1.342 +          # This flag is used to minimize dependencies when building
   1.343 +          # Native Client loader for 64-bit Windows.
   1.344 +          'NACL_WIN64',
   1.345 +        ],
   1.346 +      }],
   1.347 +      # Compute based on OS and target architecture whether the GPU
   1.348 +      # plugin / process is supported.
   1.349 +      [ 'OS=="win" or (OS=="linux" and target_arch!="arm") or OS=="mac"', {
   1.350 +        # Enable a variable used elsewhere throughout the GYP files to determine
   1.351 +        # whether to compile in the sources for the GPU plugin / process.
   1.352 +        'enable_gpu%': 1,
   1.353 +      }, {  # GPU plugin not supported
   1.354 +        'enable_gpu%': 0,
   1.355 +      }],
   1.356 +      # Compute based on OS, target architecture and device whether GLES
   1.357 +      # is supported
   1.358 +      [ 'OS=="linux" and target_arch=="arm" and chromeos==1', {
   1.359 +        # Enable a variable used elsewhere throughout the GYP files to determine
   1.360 +        # whether to compile in the sources for the GLES support.
   1.361 +        'enable_gles%': 1,
   1.362 +      }, {  # GLES not supported
   1.363 +        'enable_gles%': 0,
   1.364 +      }],
   1.365 +    ],
   1.366 +
   1.367 +    # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
   1.368 +    # so Cocoa is happy (http://crbug.com/20441).
   1.369 +    'locales': [
   1.370 +      'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
   1.371 +      'en-US', 'es-419', 'es', 'et', 'fi', 'fil', 'fr', 'gu', 'he',
   1.372 +      'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
   1.373 +      'ml', 'mr', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
   1.374 +      'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
   1.375 +      'vi', 'zh-CN', 'zh-TW',
   1.376 +    ],
   1.377 +  },
   1.378 +  'target_defaults': {
   1.379 +    'variables': {
   1.380 +      # The condition that operates on chromium_code is in a target_conditions
   1.381 +      # section, and will not have access to the default fallback value of
   1.382 +      # chromium_code at the top of this file, or to the chromium_code
   1.383 +      # variable placed at the root variables scope of .gyp files, because
   1.384 +      # those variables are not set at target scope.  As a workaround,
   1.385 +      # if chromium_code is not set at target scope, define it in target scope
   1.386 +      # to contain whatever value it has during early variable expansion.
   1.387 +      # That's enough to make it available during target conditional
   1.388 +      # processing.
   1.389 +      'chromium_code%': '<(chromium_code)',
   1.390 +
   1.391 +      # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
   1.392 +      'mac_release_optimization%': '3', # Use -O3 unless overridden
   1.393 +      'mac_debug_optimization%': '0',   # Use -O0 unless overridden
   1.394 +      # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
   1.395 +      'win_release_Optimization%': '2', # 2 = /Os
   1.396 +      'win_debug_Optimization%': '0',   # 0 = /Od
   1.397 +      # See http://msdn.microsoft.com/en-us/library/aa652367(VS.71).aspx
   1.398 +      'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
   1.399 +      'win_debug_RuntimeLibrary%': '1',   # 1 = /MTd (debug static)
   1.400 +
   1.401 +      'release_extra_cflags%': '',
   1.402 +      'debug_extra_cflags%': '',
   1.403 +      'release_valgrind_build%': 0,
   1.404 +    },
   1.405 +    'conditions': [
   1.406 +      ['branding=="Chrome"', {
   1.407 +        'defines': ['GOOGLE_CHROME_BUILD'],
   1.408 +      }, {  # else: branding!="Chrome"
   1.409 +        'defines': ['CHROMIUM_BUILD'],
   1.410 +      }],
   1.411 +      ['toolkit_views==1', {
   1.412 +        'defines': ['TOOLKIT_VIEWS=1'],
   1.413 +      }],
   1.414 +      ['chromeos==1', {
   1.415 +        'defines': ['OS_CHROMEOS=1'],
   1.416 +      }],
   1.417 +      ['fastbuild!=0', {
   1.418 +        'conditions': [
   1.419 +          # Finally, for Windows, we simply turn on profiling.
   1.420 +          ['OS=="win"', {
   1.421 +            'msvs_settings': {
   1.422 +              'VCLinkerTool': {
   1.423 +                'GenerateDebugInformation': 'false',
   1.424 +              },
   1.425 +              'VCCLCompilerTool': {
   1.426 +                'DebugInformationFormat': '0',
   1.427 +              }
   1.428 +            }
   1.429 +          }, { # else: OS != "win"
   1.430 +            'cflags': [ '-g1' ],
   1.431 +          }],
   1.432 +        ],  # conditions for fastbuild.
   1.433 +      }],  # fastbuild!=0
   1.434 +      ['selinux==1', {
   1.435 +        'defines': ['CHROMIUM_SELINUX=1'],
   1.436 +      }],
   1.437 +      ['win_use_allocator_shim==0', {
   1.438 +        'conditions': [
   1.439 +          ['OS=="win"', {
   1.440 +            'defines': ['NO_TCMALLOC'],
   1.441 +          }],
   1.442 +        ],
   1.443 +      }],
   1.444 +      ['enable_gpu==1', {
   1.445 +        'defines': [
   1.446 +          'ENABLE_GPU=1',
   1.447 +        ],
   1.448 +      }],
   1.449 +      ['enable_gles==1', {
   1.450 +        'defines': [
   1.451 +          'ENABLE_GLES=1',
   1.452 +        ],
   1.453 +      }],
   1.454 +      ['coverage!=0', {
   1.455 +        'conditions': [
   1.456 +          ['OS=="mac"', {
   1.457 +            'xcode_settings': {
   1.458 +              'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES',  # -fprofile-arcs
   1.459 +              'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES',  # -ftest-coverage
   1.460 +            },
   1.461 +            # Add -lgcov for types executable, shared_library, and
   1.462 +            # loadable_module; not for static_library.
   1.463 +            # This is a delayed conditional.
   1.464 +            'target_conditions': [
   1.465 +              ['_type!="static_library"', {
   1.466 +                'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
   1.467 +              }],
   1.468 +            ],
   1.469 +          }],
   1.470 +          # Linux gyp (into scons) doesn't like target_conditions?
   1.471 +          # TODO(???): track down why 'target_conditions' doesn't work
   1.472 +          # on Linux gyp into scons like it does on Mac gyp into xcodeproj.
   1.473 +          ['OS=="linux"', {
   1.474 +            'cflags': [ '-ftest-coverage',
   1.475 +                        '-fprofile-arcs' ],
   1.476 +            'link_settings': { 'libraries': [ '-lgcov' ] },
   1.477 +          }],
   1.478 +          # Finally, for Windows, we simply turn on profiling.
   1.479 +          ['OS=="win"', {
   1.480 +            'msvs_settings': {
   1.481 +              'VCLinkerTool': {
   1.482 +                'Profile': 'true',
   1.483 +              },
   1.484 +              'VCCLCompilerTool': {
   1.485 +                # /Z7, not /Zi, so coverage is happyb
   1.486 +                'DebugInformationFormat': '1',
   1.487 +                'AdditionalOptions': ['/Yd'],
   1.488 +              }
   1.489 +            }
   1.490 +         }],  # OS==win
   1.491 +        ],  # conditions for coverage
   1.492 +      }],  # coverage!=0
   1.493 +    ],  # conditions for 'target_defaults'
   1.494 +    'target_conditions': [
   1.495 +      ['chromium_code==0', {
   1.496 +        'conditions': [
   1.497 +          [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
   1.498 +            'cflags!': [
   1.499 +              '-Wall',
   1.500 +              '-Wextra',
   1.501 +              '-Werror',
   1.502 +            ],
   1.503 +          }],
   1.504 +          [ 'OS=="win"', {
   1.505 +            'defines': [
   1.506 +              '_CRT_SECURE_NO_DEPRECATE',
   1.507 +              '_CRT_NONSTDC_NO_WARNINGS',
   1.508 +              '_CRT_NONSTDC_NO_DEPRECATE',
   1.509 +            ],
   1.510 +            'msvs_disabled_warnings': [4800],
   1.511 +            'msvs_settings': {
   1.512 +              'VCCLCompilerTool': {
   1.513 +                'WarnAsError': 'false',
   1.514 +                'Detect64BitPortabilityProblems': 'false',
   1.515 +              },
   1.516 +            },
   1.517 +          }],
   1.518 +          [ 'OS=="mac"', {
   1.519 +            'xcode_settings': {
   1.520 +              'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
   1.521 +              'WARNING_CFLAGS!': ['-Wall'],
   1.522 +            },
   1.523 +          }],
   1.524 +        ],
   1.525 +      }, {
   1.526 +        # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
   1.527 +        # C99 macros on Mac and Linux.
   1.528 +        'defines': [
   1.529 +          '__STDC_FORMAT_MACROS',
   1.530 +        ],
   1.531 +        'conditions': [
   1.532 +          ['OS!="win"', {
   1.533 +            'sources/': [ ['exclude', '_win(_unittest)?\\.cc$'],
   1.534 +                          ['exclude', '/win/'],
   1.535 +                          ['exclude', '/win_[^/]*\\.cc$'] ],
   1.536 +          }],
   1.537 +          ['OS!="mac"', {
   1.538 +            'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.cc$'],
   1.539 +                          ['exclude', '/(cocoa|mac)/'],
   1.540 +                          ['exclude', '\.mm?$' ] ],
   1.541 +          }],
   1.542 +          ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
   1.543 +            'sources/': [
   1.544 +              ['exclude', '_(chromeos|gtk|x|x11|xdg)(_unittest)?\\.cc$'],
   1.545 +              ['exclude', '/gtk/'],
   1.546 +              ['exclude', '/(gtk|x11)_[^/]*\\.cc$'],
   1.547 +            ],
   1.548 +          }],
   1.549 +          ['OS!="linux"', {
   1.550 +            'sources/': [
   1.551 +              ['exclude', '_linux(_unittest)?\\.cc$'],
   1.552 +              ['exclude', '/linux/'],
   1.553 +            ],
   1.554 +          }],
   1.555 +          # We use "POSIX" to refer to all non-Windows operating systems.
   1.556 +          ['OS=="win"', {
   1.557 +            'sources/': [ ['exclude', '_posix\\.cc$'] ],
   1.558 +          }],
   1.559 +          # Though Skia is conceptually shared by Linux and Windows,
   1.560 +          # the only _skia files in our tree are Linux-specific.
   1.561 +          ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
   1.562 +            'sources/': [ ['exclude', '_skia\\.cc$'] ],
   1.563 +          }],
   1.564 +          ['chromeos!=1', {
   1.565 +            'sources/': [ ['exclude', '_chromeos\\.cc$'] ]
   1.566 +          }],
   1.567 +          ['toolkit_views==0', {
   1.568 +            'sources/': [ ['exclude', '_views\\.cc$'] ]
   1.569 +          }],
   1.570 +        ],
   1.571 +      }],
   1.572 +    ],  # target_conditions for 'target_defaults'
   1.573 +    'default_configuration': 'Debug',
   1.574 +    'configurations': {
   1.575 +      # VCLinkerTool LinkIncremental values below:
   1.576 +      #   0 == default
   1.577 +      #   1 == /INCREMENTAL:NO
   1.578 +      #   2 == /INCREMENTAL
   1.579 +      # Debug links incremental, Release does not.
   1.580 +      #
   1.581 +      # Abstract base configurations to cover common
   1.582 +      # attributes.
   1.583 +      #
   1.584 +      'Common_Base': {
   1.585 +        'abstract': 1,
   1.586 +        'msvs_configuration_attributes': {
   1.587 +          'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
   1.588 +          'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
   1.589 +          'CharacterSet': '1',
   1.590 +        },
   1.591 +      },
   1.592 +      'x86_Base': {
   1.593 +        'abstract': 1,
   1.594 +        'msvs_settings': {
   1.595 +          'VCLinkerTool': {
   1.596 +            'TargetMachine': '1',
   1.597 +          },
   1.598 +        },
   1.599 +        'msvs_configuration_platform': 'Win32',
   1.600 +      },
   1.601 +      'x64_Base': {
   1.602 +        'abstract': 1,
   1.603 +        'msvs_configuration_platform': 'x64',
   1.604 +        'msvs_settings': {
   1.605 +          'VCLinkerTool': {
   1.606 +            'TargetMachine': '17', # x86 - 64
   1.607 +            'AdditionalLibraryDirectories!':
   1.608 +              ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
   1.609 +            'AdditionalLibraryDirectories':
   1.610 +              ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
   1.611 +          },
   1.612 +          'VCLibrarianTool': {
   1.613 +            'AdditionalLibraryDirectories!':
   1.614 +              ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
   1.615 +            'AdditionalLibraryDirectories':
   1.616 +              ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
   1.617 +          },
   1.618 +        },
   1.619 +        'defines': [
   1.620 +          # Not sure if tcmalloc works on 64-bit Windows.
   1.621 +          'NO_TCMALLOC',
   1.622 +        ],
   1.623 +      },
   1.624 +      'Debug_Base': {
   1.625 +        'abstract': 1,
   1.626 +        'xcode_settings': {
   1.627 +          'COPY_PHASE_STRIP': 'NO',
   1.628 +          'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
   1.629 +          'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ],
   1.630 +        },
   1.631 +        'msvs_settings': {
   1.632 +          'VCCLCompilerTool': {
   1.633 +            'Optimization': '<(win_debug_Optimization)',
   1.634 +            'PreprocessorDefinitions': ['_DEBUG'],
   1.635 +            'BasicRuntimeChecks': '3',
   1.636 +            'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
   1.637 +          },
   1.638 +          'VCLinkerTool': {
   1.639 +            'LinkIncremental': '<(msvs_debug_link_incremental)',
   1.640 +          },
   1.641 +          'VCResourceCompilerTool': {
   1.642 +            'PreprocessorDefinitions': ['_DEBUG'],
   1.643 +          },
   1.644 +        },
   1.645 +        'conditions': [
   1.646 +          ['OS=="linux"', {
   1.647 +            'cflags': [
   1.648 +              '<@(debug_extra_cflags)',
   1.649 +            ],
   1.650 +          }],
   1.651 +        ],
   1.652 +      },
   1.653 +      'Release_Base': {
   1.654 +        'abstract': 1,
   1.655 +        'defines': [
   1.656 +          'NDEBUG',
   1.657 +        ],
   1.658 +        'xcode_settings': {
   1.659 +          'DEAD_CODE_STRIPPING': 'YES',  # -Wl,-dead_strip
   1.660 +          'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
   1.661 +          'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
   1.662 +        },
   1.663 +        'msvs_settings': {
   1.664 +          'VCCLCompilerTool': {
   1.665 +            'Optimization': '<(win_release_Optimization)',
   1.666 +            'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
   1.667 +          },
   1.668 +          'VCLinkerTool': {
   1.669 +            'LinkIncremental': '1',
   1.670 +          },
   1.671 +        },
   1.672 +        'conditions': [
   1.673 +          ['release_valgrind_build==0', {
   1.674 +            'defines': ['NVALGRIND'],
   1.675 +          }],
   1.676 +          ['win_use_allocator_shim==0', {
   1.677 +            'defines': ['NO_TCMALLOC'],
   1.678 +          }],
   1.679 +          ['win_release_RuntimeLibrary==2', {
   1.680 +            # Visual C++ 2008 barfs when building anything with /MD (msvcrt):
   1.681 +            #  VC\include\typeinfo(139) : warning C4275: non dll-interface
   1.682 +            #  class 'stdext::exception' used as base for dll-interface
   1.683 +            #  class 'std::bad_cast'
   1.684 +            'msvs_disabled_warnings': [4275],
   1.685 +          }],
   1.686 +          ['OS=="linux"', {
   1.687 +            'cflags': [
   1.688 +             '<@(release_extra_cflags)',
   1.689 +            ],
   1.690 +          }],
   1.691 +        ],
   1.692 +      },
   1.693 +      'Purify_Base': {
   1.694 +        'abstract': 1,
   1.695 +        'defines': [
   1.696 +          'PURIFY',
   1.697 +          'NO_TCMALLOC',
   1.698 +        ],
   1.699 +        'msvs_settings': {
   1.700 +          'VCCLCompilerTool': {
   1.701 +            'Optimization': '0',
   1.702 +            'RuntimeLibrary': '0',
   1.703 +            'BufferSecurityCheck': 'false',
   1.704 +          },
   1.705 +          'VCLinkerTool': {
   1.706 +            'EnableCOMDATFolding': '1',
   1.707 +            'LinkIncremental': '1',
   1.708 +          },
   1.709 +        },
   1.710 +      },
   1.711 +      #
   1.712 +      # Concrete configurations
   1.713 +      #
   1.714 +      'Debug': {
   1.715 +        'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
   1.716 +      },
   1.717 +      'Release': {
   1.718 +        'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
   1.719 +        'conditions': [
   1.720 +          ['msvs_use_common_release', {
   1.721 +            'includes': ['release.gypi'],
   1.722 +          }],
   1.723 +        ]
   1.724 +      },
   1.725 +      'conditions': [
   1.726 +        [ 'OS=="win"', {
   1.727 +          # TODO(bradnelson): add a gyp mechanism to make this more graceful.
   1.728 +          'Purify': {
   1.729 +            'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base', 'Purify'],
   1.730 +          },
   1.731 +          'Debug_x64': {
   1.732 +            'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
   1.733 +          },
   1.734 +          'Release_x64': {
   1.735 +            'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
   1.736 +          },
   1.737 +          'Purify_x64': {
   1.738 +            'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base', 'Purify_Base'],
   1.739 +          },
   1.740 +        }],
   1.741 +      ],
   1.742 +    },
   1.743 +  },
   1.744 +  'conditions': [
   1.745 +    ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
   1.746 +      'target_defaults': {
   1.747 +        # Enable -Werror by default, but put it in a variable so it can
   1.748 +        # be disabled in ~/.gyp/include.gypi on the valgrind builders.
   1.749 +        'variables': {
   1.750 +          # Use -fno-strict-aliasing by default since gcc 4.4 has periodic
   1.751 +          # issues that slip through the cracks. We could do this just for
   1.752 +          # gcc 4.4 but it makes more sense to be consistent on all
   1.753 +          # compilers in use. TODO(Craig): turn this off again when
   1.754 +          # there is some 4.4 test infrastructure in place and existing
   1.755 +          # aliasing issues have been fixed.
   1.756 +          'no_strict_aliasing%': 1,
   1.757 +          'conditions': [['OS=="linux"', {'werror%': '-Werror',}],
   1.758 +                         ['OS=="freebsd"', {'werror%': '',}],
   1.759 +                         ['OS=="openbsd"', {'werror%': '',}],
   1.760 +          ],
   1.761 +        },
   1.762 +        'cflags': [
   1.763 +          '<(werror)',  # See note above about the werror variable.
   1.764 +          '-pthread',
   1.765 +          '-fno-exceptions',
   1.766 +          '-Wall',
   1.767 +          # TODO(evan): turn this back on once all the builds work.
   1.768 +          # '-Wextra',
   1.769 +          # Don't warn about unused function params.  We use those everywhere.
   1.770 +          '-Wno-unused-parameter',
   1.771 +          # Don't warn about the "struct foo f = {0};" initialization pattern.
   1.772 +          '-Wno-missing-field-initializers',
   1.773 +          '-D_FILE_OFFSET_BITS=64',
   1.774 +          # Don't export any symbols (for example, to plugins we dlopen()).
   1.775 +          # Note: this is *required* to make some plugins work.
   1.776 +          '-fvisibility=hidden',
   1.777 +        ],
   1.778 +        'cflags_cc': [
   1.779 +          '-fno-rtti',
   1.780 +          '-fno-threadsafe-statics',
   1.781 +          # Make inline functions have hidden visiblity by default.
   1.782 +          # Surprisingly, not covered by -fvisibility=hidden.
   1.783 +          '-fvisibility-inlines-hidden',
   1.784 +        ],
   1.785 +        'ldflags': [
   1.786 +          '-pthread', '-Wl,-z,noexecstack',
   1.787 +        ],
   1.788 +        'scons_variable_settings': {
   1.789 +          'LIBPATH': ['$LIB_DIR'],
   1.790 +          # Linking of large files uses lots of RAM, so serialize links
   1.791 +          # using the handy flock command from util-linux.
   1.792 +          'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
   1.793 +          'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
   1.794 +          'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
   1.795 +
   1.796 +          # We have several cases where archives depend on each other in
   1.797 +          # a cyclic fashion.  Since the GNU linker does only a single
   1.798 +          # pass over the archives we surround the libraries with
   1.799 +          # --start-group and --end-group (aka -( and -) ). That causes
   1.800 +          # ld to loop over the group until no more undefined symbols
   1.801 +          # are found. In an ideal world we would only make groups from
   1.802 +          # those libraries which we knew to be in cycles. However,
   1.803 +          # that's tough with SCons, so we bodge it by making all the
   1.804 +          # archives a group by redefining the linking command here.
   1.805 +          #
   1.806 +          # TODO:  investigate whether we still have cycles that
   1.807 +          # require --{start,end}-group.  There has been a lot of
   1.808 +          # refactoring since this was first coded, which might have
   1.809 +          # eliminated the circular dependencies.
   1.810 +          #
   1.811 +          # Note:  $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS
   1.812 +          # so that we prefer our own built libraries (e.g. -lpng) to
   1.813 +          # system versions of libraries that pkg-config might turn up.
   1.814 +          # TODO(sgk): investigate handling this not by re-ordering the
   1.815 +          # flags this way, but by adding a hook to use the SCons
   1.816 +          # ParseFlags() option on the output from pkg-config.
   1.817 +          'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET',
   1.818 +                       '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES',
   1.819 +                       '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
   1.820 +          'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET',
   1.821 +                         '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES',
   1.822 +                         '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
   1.823 +          'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET',
   1.824 +                           '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES',
   1.825 +                           '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
   1.826 +          'IMPLICIT_COMMAND_DEPENDENCIES': 0,
   1.827 +          # -rpath is only used when building with shared libraries.
   1.828 +          'conditions': [
   1.829 +            [ 'component=="shared_library"', {
   1.830 +              'RPATH': '$LIB_DIR',
   1.831 +            }],
   1.832 +          ],
   1.833 +        },
   1.834 +        'scons_import_variables': [
   1.835 +          'AS',
   1.836 +          'CC',
   1.837 +          'CXX',
   1.838 +          'LINK',
   1.839 +        ],
   1.840 +        'scons_propagate_variables': [
   1.841 +          'AS',
   1.842 +          'CC',
   1.843 +          'CCACHE_DIR',
   1.844 +          'CXX',
   1.845 +          'DISTCC_DIR',
   1.846 +          'DISTCC_HOSTS',
   1.847 +          'HOME',
   1.848 +          'INCLUDE_SERVER_ARGS',
   1.849 +          'INCLUDE_SERVER_PORT',
   1.850 +          'LINK',
   1.851 +          'CHROME_BUILD_TYPE',
   1.852 +          'CHROMIUM_BUILD',
   1.853 +          'OFFICIAL_BUILD',
   1.854 +        ],
   1.855 +        'configurations': {
   1.856 +          'Debug_Base': {
   1.857 +            'variables': {
   1.858 +              'debug_optimize%': '0',
   1.859 +            },
   1.860 +            'defines': [
   1.861 +              '_DEBUG',
   1.862 +            ],
   1.863 +            'cflags': [
   1.864 +              '-O>(debug_optimize)',
   1.865 +              '-g',
   1.866 +              # One can use '-gstabs' to enable building the debugging
   1.867 +              # information in STABS format for breakpad's dumpsyms.
   1.868 +            ],
   1.869 +            'ldflags': [
   1.870 +              '-rdynamic',  # Allows backtrace to resolve symbols.
   1.871 +            ],
   1.872 +          },
   1.873 +          'Release_Base': {
   1.874 +            'variables': {
   1.875 +              'release_optimize%': '2',
   1.876 +            },
   1.877 +            'cflags': [
   1.878 +              '-O>(release_optimize)',
   1.879 +              # Don't emit the GCC version ident directives, they just end up
   1.880 +              # in the .comment section taking up binary size.
   1.881 +              '-fno-ident',
   1.882 +              # Put data and code in their own sections, so that unused symbols
   1.883 +              # can be removed at link time with --gc-sections.
   1.884 +              '-fdata-sections',
   1.885 +              '-ffunction-sections',
   1.886 +            ],
   1.887 +            'ldflags': [
   1.888 +              '-Wl,--gc-sections',
   1.889 +            ],
   1.890 +          },
   1.891 +        },
   1.892 +        'variants': {
   1.893 +          'coverage': {
   1.894 +            'cflags': ['-fprofile-arcs', '-ftest-coverage'],
   1.895 +            'ldflags': ['-fprofile-arcs'],
   1.896 +          },
   1.897 +          'profile': {
   1.898 +            'cflags': ['-pg', '-g'],
   1.899 +            'ldflags': ['-pg'],
   1.900 +          },
   1.901 +          'symbols': {
   1.902 +            'cflags': ['-g'],
   1.903 +          },
   1.904 +        },
   1.905 +        'conditions': [
   1.906 +          [ 'target_arch=="ia32"', {
   1.907 +            'asflags': [
   1.908 +              # Needed so that libs with .s files (e.g. libicudata.a)
   1.909 +              # are compatible with the general 32-bit-ness.
   1.910 +              '-32',
   1.911 +            ],
   1.912 +            # All floating-point computations on x87 happens in 80-bit
   1.913 +            # precision.  Because the C and C++ language standards allow
   1.914 +            # the compiler to keep the floating-point values in higher
   1.915 +            # precision than what's specified in the source and doing so
   1.916 +            # is more efficient than constantly rounding up to 64-bit or
   1.917 +            # 32-bit precision as specified in the source, the compiler,
   1.918 +            # especially in the optimized mode, tries very hard to keep
   1.919 +            # values in x87 floating-point stack (in 80-bit precision)
   1.920 +            # as long as possible. This has important side effects, that
   1.921 +            # the real value used in computation may change depending on
   1.922 +            # how the compiler did the optimization - that is, the value
   1.923 +            # kept in 80-bit is different than the value rounded down to
   1.924 +            # 64-bit or 32-bit. There are possible compiler options to make
   1.925 +            # this behavior consistent (e.g. -ffloat-store would keep all
   1.926 +            # floating-values in the memory, thus force them to be rounded
   1.927 +            # to its original precision) but they have significant runtime
   1.928 +            # performance penalty.
   1.929 +            #
   1.930 +            # -mfpmath=sse -msse2 makes the compiler use SSE instructions
   1.931 +            # which keep floating-point values in SSE registers in its
   1.932 +            # native precision (32-bit for single precision, and 64-bit for
   1.933 +            # double precision values). This means the floating-point value
   1.934 +            # used during computation does not change depending on how the
   1.935 +            # compiler optimized the code, since the value is always kept
   1.936 +            # in its specified precision.
   1.937 +            'conditions': [
   1.938 +              ['branding=="Chromium" and disable_sse2==0', {
   1.939 +                'cflags': [
   1.940 +                  '-march=pentium4',
   1.941 +                  '-msse2',
   1.942 +                  '-mfpmath=sse',
   1.943 +                ],
   1.944 +              }],
   1.945 +              # ChromeOS targets Pinetrail, which is sse3, but most of the
   1.946 +              # benefit comes from sse2 so this setting allows ChromeOS
   1.947 +              # to build on other CPUs.  In the future -march=atom would help
   1.948 +              # but requires a newer compiler.
   1.949 +              ['chromeos==1 and disable_sse2==0', {
   1.950 +                'cflags': [
   1.951 +                  '-msse2',
   1.952 +                ],
   1.953 +              }],
   1.954 +            ],
   1.955 +            # -mmmx allows mmintrin.h to be used for mmx intrinsics.
   1.956 +            # video playback is mmx and sse2 optimized.
   1.957 +            'cflags': [
   1.958 +              '-m32',
   1.959 +              '-mmmx',
   1.960 +            ],
   1.961 +            'ldflags': [
   1.962 +              '-m32',
   1.963 +            ],
   1.964 +          }],
   1.965 +          ['target_arch=="arm"', {
   1.966 +            'target_conditions': [
   1.967 +              ['_toolset=="target"', {
   1.968 +                'cflags_cc': [
   1.969 +                  # The codesourcery arm-2009q3 toolchain warns at that the ABI
   1.970 +                  # has changed whenever it encounters a varargs function. This
   1.971 +                  # silences those warnings, as they are not helpful and
   1.972 +                  # clutter legitimate warnings.
   1.973 +                  '-Wno-abi',
   1.974 +                ],
   1.975 +                'conditions': [
   1.976 +                  ['arm_thumb == 1', {
   1.977 +                    'cflags': [
   1.978 +                    '-mthumb',
   1.979 +                    # TODO(piman): -Wa,-mimplicit-it=thumb is needed for
   1.980 +                    # inline assembly that uses condition codes but it's
   1.981 +                    # suboptimal. Better would be to #ifdef __thumb__ at the
   1.982 +                    # right place and have a separate thumb path.
   1.983 +                    '-Wa,-mimplicit-it=thumb',
   1.984 +                    ]
   1.985 +                  }],
   1.986 +                  ['armv7==1', {
   1.987 +                    'cflags': [
   1.988 +                      '-march=armv7-a',
   1.989 +                      '-mtune=cortex-a8',
   1.990 +                      '-mfloat-abi=softfp',
   1.991 +                    ],
   1.992 +                    'conditions': [
   1.993 +                      ['arm_neon==1', {
   1.994 +                        'cflags': [ '-mfpu=neon', ],
   1.995 +                      }, {
   1.996 +                        'cflags': [ '-mfpu=<(arm_fpu)', ],
   1.997 +                      }]
   1.998 +                    ],
   1.999 +                  }],
  1.1000 +                ],
  1.1001 +              }],
  1.1002 +            ],
  1.1003 +          }],
  1.1004 +          ['linux_fpic==1', {
  1.1005 +            'cflags': [
  1.1006 +              '-fPIC',
  1.1007 +            ],
  1.1008 +          }],
  1.1009 +          ['sysroot!=""', {
  1.1010 +            'target_conditions': [
  1.1011 +              ['_toolset=="target"', {
  1.1012 +                'cflags': [
  1.1013 +                  '--sysroot=<(sysroot)',
  1.1014 +                ],
  1.1015 +                'ldflags': [
  1.1016 +                  '--sysroot=<(sysroot)',
  1.1017 +                ],
  1.1018 +              }]]
  1.1019 +          }],
  1.1020 +          ['no_strict_aliasing==1', {
  1.1021 +            'cflags': [
  1.1022 +              '-fno-strict-aliasing',
  1.1023 +            ],
  1.1024 +          }],
  1.1025 +          ['linux_breakpad==1', {
  1.1026 +            'cflags': [ '-gstabs' ],
  1.1027 +            'defines': ['USE_LINUX_BREAKPAD'],
  1.1028 +          }],
  1.1029 +          ['linux_use_seccomp_sandbox==1 and buildtype!="Official"', {
  1.1030 +            'defines': ['USE_SECCOMP_SANDBOX'],
  1.1031 +          }],
  1.1032 +          ['library=="shared_library"', {
  1.1033 +            # When building with shared libraries, remove the visiblity-hiding
  1.1034 +            # flag.
  1.1035 +            'cflags!': [ '-fvisibility=hidden' ],
  1.1036 +            'conditions': [
  1.1037 +              ['target_arch=="x64" or target_arch=="arm"', {
  1.1038 +                # Shared libraries need -fPIC on x86-64 and arm
  1.1039 +                'cflags': ['-fPIC']
  1.1040 +              }]
  1.1041 +            ],
  1.1042 +          }],
  1.1043 +          ['linux_use_heapchecker==1', {
  1.1044 +            'variables': {'linux_use_tcmalloc%': 1},
  1.1045 +          }],
  1.1046 +          ['linux_use_tcmalloc==0', {
  1.1047 +            'defines': ['NO_TCMALLOC'],
  1.1048 +          }],
  1.1049 +          ['linux_use_heapchecker==0', {
  1.1050 +            'defines': ['NO_HEAPCHECKER'],
  1.1051 +          }],
  1.1052 +        ],
  1.1053 +      },
  1.1054 +    }],
  1.1055 +    # FreeBSD-specific options; note that most FreeBSD options are set above,
  1.1056 +    # with Linux.
  1.1057 +    ['OS=="freebsd"', {
  1.1058 +      'target_defaults': {
  1.1059 +        'ldflags': [
  1.1060 +          '-Wl,--no-keep-memory',
  1.1061 +        ],
  1.1062 +      },
  1.1063 +    }],
  1.1064 +    ['OS=="solaris"', {
  1.1065 +      'cflags!': ['-fvisibility=hidden'],
  1.1066 +      'cflags_cc!': ['-fvisibility-inlines-hidden'],
  1.1067 +    }],
  1.1068 +    ['OS=="mac"', {
  1.1069 +      'target_defaults': {
  1.1070 +        'variables': {
  1.1071 +          # This should be 'mac_real_dsym%', but there seems to be a bug
  1.1072 +          # with % in variables that are intended to be set to different
  1.1073 +          # values in different targets, like this one.
  1.1074 +          'mac_real_dsym': 0,  # Fake .dSYMs are fine in most cases.
  1.1075 +        },
  1.1076 +        'mac_bundle': 0,
  1.1077 +        'xcode_settings': {
  1.1078 +          'ALWAYS_SEARCH_USER_PATHS': 'NO',
  1.1079 +          'GCC_C_LANGUAGE_STANDARD': 'c99',         # -std=c99
  1.1080 +          'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
  1.1081 +          'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
  1.1082 +                                                    # (Equivalent to -fPIC)
  1.1083 +          'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
  1.1084 +          'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
  1.1085 +          'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
  1.1086 +          # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
  1.1087 +          'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
  1.1088 +          'GCC_OBJC_CALL_CXX_CDTORS': 'YES',        # -fobjc-call-cxx-cdtors
  1.1089 +          'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden
  1.1090 +          'GCC_THREADSAFE_STATICS': 'NO',           # -fno-threadsafe-statics
  1.1091 +          'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',    # -Werror
  1.1092 +          'GCC_VERSION': '4.2',
  1.1093 +          'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',  # -Wnewline-eof
  1.1094 +          # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
  1.1095 +          'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
  1.1096 +          'PREBINDING': 'NO',                       # No -Wl,-prebind
  1.1097 +          'USE_HEADERMAP': 'NO',
  1.1098 +          'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'],
  1.1099 +          'conditions': [
  1.1100 +            ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
  1.1101 +                                 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
  1.1102 +            ],
  1.1103 +          ],
  1.1104 +        },
  1.1105 +        'target_conditions': [
  1.1106 +          ['_type!="static_library"', {
  1.1107 +            'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
  1.1108 +          }],
  1.1109 +          ['_mac_bundle', {
  1.1110 +            'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
  1.1111 +          }],
  1.1112 +          ['_type=="executable" or _type=="shared_library"', {
  1.1113 +            'target_conditions': [
  1.1114 +              ['mac_real_dsym == 1', {
  1.1115 +                # To get a real .dSYM bundle produced by dsymutil, set the
  1.1116 +                # debug information format to dwarf-with-dsym.  Since
  1.1117 +                # strip_from_xcode will not be used, set Xcode to do the
  1.1118 +                # stripping as well.
  1.1119 +                'configurations': {
  1.1120 +                  'Release_Base': {
  1.1121 +                    'xcode_settings': {
  1.1122 +                      'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
  1.1123 +                      'DEPLOYMENT_POSTPROCESSING': 'YES',
  1.1124 +                      'STRIP_INSTALLED_PRODUCT': 'YES',
  1.1125 +                      'target_conditions': [
  1.1126 +                        ['_type=="shared_library"', {
  1.1127 +                          # The Xcode default is to strip debugging symbols
  1.1128 +                          # only (-S).  Local symbols should be stripped as
  1.1129 +                          # well, which will be handled by -x.  Xcode will
  1.1130 +                          # continue to insert -S when stripping even when
  1.1131 +                          # additional flags are added with STRIPFLAGS.
  1.1132 +                          'STRIPFLAGS': '-x',
  1.1133 +                        }],  # _type=="shared_library"
  1.1134 +                      ],  # target_conditions
  1.1135 +                    },  # xcode_settings
  1.1136 +                  },  # configuration "Release"
  1.1137 +                },  # configurations
  1.1138 +              }, {  # mac_real_dsym != 1
  1.1139 +                # To get a fast fake .dSYM bundle, use a post-build step to
  1.1140 +                # produce the .dSYM and strip the executable.  strip_from_xcode
  1.1141 +                # only operates in the Release configuration.
  1.1142 +                'postbuilds': [
  1.1143 +                  {
  1.1144 +                    'variables': {
  1.1145 +                      # Define strip_from_xcode in a variable ending in _path
  1.1146 +                      # so that gyp understands it's a path and performs proper
  1.1147 +                      # relativization during dict merging.
  1.1148 +                      'strip_from_xcode_path': 'mac/strip_from_xcode',
  1.1149 +                    },
  1.1150 +                    'postbuild_name': 'Strip If Needed',
  1.1151 +                    'action': ['<(strip_from_xcode_path)'],
  1.1152 +                  },
  1.1153 +                ],  # postbuilds
  1.1154 +              }],  # mac_real_dsym
  1.1155 +            ],  # target_conditions
  1.1156 +          }],  # _type=="executable" or _type=="shared_library"
  1.1157 +        ],  # target_conditions
  1.1158 +      },  # target_defaults
  1.1159 +    }],  # OS=="mac"
  1.1160 +    ['OS=="win"', {
  1.1161 +      'target_defaults': {
  1.1162 +        'defines': [
  1.1163 +          '_WIN32_WINNT=0x0600',
  1.1164 +          'WINVER=0x0600',
  1.1165 +          'WIN32',
  1.1166 +          '_WINDOWS',
  1.1167 +          '_HAS_EXCEPTIONS=0',
  1.1168 +          'NOMINMAX',
  1.1169 +          '_CRT_RAND_S',
  1.1170 +          'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
  1.1171 +          'WIN32_LEAN_AND_MEAN',
  1.1172 +          '_SECURE_ATL',
  1.1173 +          '_HAS_TR1=0',
  1.1174 +        ],
  1.1175 +        'msvs_system_include_dirs': [
  1.1176 +          '<(DEPTH)/third_party/platformsdk_win7/files/Include',
  1.1177 +          '$(VSInstallDir)/VC/atlmfc/include',
  1.1178 +        ],
  1.1179 +        'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
  1.1180 +        'msvs_disabled_warnings': [4396, 4503, 4819],
  1.1181 +        'msvs_settings': {
  1.1182 +          'VCCLCompilerTool': {
  1.1183 +            'MinimalRebuild': 'false',
  1.1184 +            'ExceptionHandling': '0',
  1.1185 +            'BufferSecurityCheck': 'true',
  1.1186 +            'EnableFunctionLevelLinking': 'true',
  1.1187 +            'RuntimeTypeInfo': 'false',
  1.1188 +            'WarningLevel': '3',
  1.1189 +            'WarnAsError': 'true',
  1.1190 +            'DebugInformationFormat': '3',
  1.1191 +            'conditions': [
  1.1192 +              [ 'msvs_multi_core_compile', {
  1.1193 +                'AdditionalOptions': ['/MP'],
  1.1194 +              }],
  1.1195 +            ],
  1.1196 +          },
  1.1197 +          'VCLibrarianTool': {
  1.1198 +            'AdditionalOptions': ['/ignore:4221'],
  1.1199 +            'AdditionalLibraryDirectories':
  1.1200 +              ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
  1.1201 +          },
  1.1202 +          'VCLinkerTool': {
  1.1203 +            'AdditionalDependencies': [
  1.1204 +              'wininet.lib',
  1.1205 +              'version.lib',
  1.1206 +              'msimg32.lib',
  1.1207 +              'ws2_32.lib',
  1.1208 +              'usp10.lib',
  1.1209 +              'psapi.lib',
  1.1210 +              'dbghelp.lib',
  1.1211 +            ],
  1.1212 +            'AdditionalLibraryDirectories':
  1.1213 +              ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
  1.1214 +            'GenerateDebugInformation': 'true',
  1.1215 +            'MapFileName': '$(OutDir)\\$(TargetName).map',
  1.1216 +            'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
  1.1217 +            'FixedBaseAddress': '1',
  1.1218 +            # SubSystem values:
  1.1219 +            #   0 == not set
  1.1220 +            #   1 == /SUBSYSTEM:CONSOLE
  1.1221 +            #   2 == /SUBSYSTEM:WINDOWS
  1.1222 +            # Most of the executables we'll ever create are tests
  1.1223 +            # and utilities with console output.
  1.1224 +            'SubSystem': '1',
  1.1225 +          },
  1.1226 +          'VCMIDLTool': {
  1.1227 +            'GenerateStublessProxies': 'true',
  1.1228 +            'TypeLibraryName': '$(InputName).tlb',
  1.1229 +            'OutputDirectory': '$(IntDir)',
  1.1230 +            'HeaderFileName': '$(InputName).h',
  1.1231 +            'DLLDataFileName': 'dlldata.c',
  1.1232 +            'InterfaceIdentifierFileName': '$(InputName)_i.c',
  1.1233 +            'ProxyFileName': '$(InputName)_p.c',
  1.1234 +          },
  1.1235 +          'VCResourceCompilerTool': {
  1.1236 +            'Culture' : '1033',
  1.1237 +            'AdditionalIncludeDirectories': ['<(DEPTH)'],
  1.1238 +          },
  1.1239 +        },
  1.1240 +      },
  1.1241 +    }],
  1.1242 +    ['disable_nacl==1 or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
  1.1243 +      'target_defaults': {
  1.1244 +        'defines': [
  1.1245 +          'DISABLE_NACL',
  1.1246 +        ],
  1.1247 +      },
  1.1248 +    }],
  1.1249 +    ['OS=="win" and msvs_use_common_linker_extras', {
  1.1250 +      'target_defaults': {
  1.1251 +        'msvs_settings': {
  1.1252 +          'VCLinkerTool': {
  1.1253 +            'DelayLoadDLLs': [
  1.1254 +              'dbghelp.dll',
  1.1255 +              'dwmapi.dll',
  1.1256 +              'uxtheme.dll',
  1.1257 +            ],
  1.1258 +          },
  1.1259 +        },
  1.1260 +        'configurations': {
  1.1261 +          'x86_Base': {
  1.1262 +            'msvs_settings': {
  1.1263 +              'VCLinkerTool': {
  1.1264 +                'AdditionalOptions': [
  1.1265 +                  '/safeseh',
  1.1266 +                  '/dynamicbase',
  1.1267 +                  '/ignore:4199',
  1.1268 +                  '/ignore:4221',
  1.1269 +                  '/nxcompat',
  1.1270 +                ],
  1.1271 +              },
  1.1272 +            },
  1.1273 +          },
  1.1274 +          'x64_Base': {
  1.1275 +            'msvs_settings': {
  1.1276 +              'VCLinkerTool': {
  1.1277 +                'AdditionalOptions': [
  1.1278 +                  # safeseh is not compatible with x64
  1.1279 +                  '/dynamicbase',
  1.1280 +                  '/ignore:4199',
  1.1281 +                  '/ignore:4221',
  1.1282 +                  '/nxcompat',
  1.1283 +                ],
  1.1284 +              },
  1.1285 +            },
  1.1286 +          },
  1.1287 +        },
  1.1288 +      },
  1.1289 +    }],
  1.1290 +    ['enable_new_npdevice_api==1', {
  1.1291 +      'target_defaults': {
  1.1292 +        'defines': [
  1.1293 +          'ENABLE_NEW_NPDEVICE_API',
  1.1294 +        ],
  1.1295 +      },
  1.1296 +    }],
  1.1297 +  ],
  1.1298 +  'scons_settings': {
  1.1299 +    'sconsbuild_dir': '<(DEPTH)/sconsbuild',
  1.1300 +    'tools': ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'],
  1.1301 +  },
  1.1302 +  'xcode_settings': {
  1.1303 +    # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
  1.1304 +    # This block adds *project-wide* configuration settings to each project
  1.1305 +    # file.  It's almost always wrong to put things here.  Specify your
  1.1306 +    # custom xcode_settings in target_defaults to add them to targets instead.
  1.1307 +
  1.1308 +    # In an Xcode Project Info window, the "Base SDK for All Configurations"
  1.1309 +    # setting sets the SDK on a project-wide basis.  In order to get the
  1.1310 +    # configured SDK to show properly in the Xcode UI, SDKROOT must be set
  1.1311 +    # here at the project level.
  1.1312 +    'SDKROOT': 'macosx<(mac_sdk)',  # -isysroot
  1.1313 +
  1.1314 +    # The Xcode generator will look for an xcode_settings section at the root
  1.1315 +    # of each dict and use it to apply settings on a file-wide basis.  Most
  1.1316 +    # settings should not be here, they should be in target-specific
  1.1317 +    # xcode_settings sections, or better yet, should use non-Xcode-specific
  1.1318 +    # settings in target dicts.  SYMROOT is a special case, because many other
  1.1319 +    # Xcode variables depend on it, including variables such as
  1.1320 +    # PROJECT_DERIVED_FILE_DIR.  When a source group corresponding to something
  1.1321 +    # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
  1.1322 +    # files to appear (when present) in the UI as actual files and not red
  1.1323 +    # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
  1.1324 +    # and therefore SYMROOT, needs to be set at the project level.
  1.1325 +    'SYMROOT': '<(DEPTH)/xcodebuild',
  1.1326 +  },
  1.1327 +}
  1.1328 +
  1.1329 +# Local Variables:
  1.1330 +# tab-width:2
  1.1331 +# indent-tabs-mode:nil
  1.1332 +# End:
  1.1333 +# vim: set expandtab tabstop=2 shiftwidth=2:

mercurial