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