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

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

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

mercurial