[email protected] | 225c8f5 | 2010-02-05 22:23:20 | [diff] [blame] | 1 | # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
[email protected] | 21642ab | 2009-09-15 23:52:14 | [diff] [blame] | 5 | # IMPORTANT: |
| 6 | # Please don't directly include this file if you are building via gyp_chromium, |
| 7 | # since gyp_chromium is automatically forcing its inclusion. |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 8 | { |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 9 | # Variables expected to be overriden on the GYP command line (-D) or by |
| 10 | # ~/.gyp/include.gypi. |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 11 | 'variables': { |
[email protected] | e14a9f9 | 2009-08-05 19:26:07 | [diff] [blame] | 12 | # Putting a variables dict inside another variables dict looks kind of |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 13 | # weird. This is done so that 'host_arch', 'chromeos', etc are defined as |
[email protected] | e14a9f9 | 2009-08-05 19:26:07 | [diff] [blame] | 14 | # variables within the outer variables dict here. This is necessary |
| 15 | # to get these variables defined for the conditions within this variables |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 16 | # dict that operate on these variables (e.g., for setting 'toolkit_views', |
| 17 | # we need to have 'chromeos' already set). |
[email protected] | e14a9f9 | 2009-08-05 19:26:07 | [diff] [blame] | 18 | 'variables': { |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 19 | 'variables': { |
[email protected] | bb6aba3 | 2011-01-07 19:04:43 | [diff] [blame^] | 20 | 'variables': { |
| 21 | # Whether we're building a ChromeOS build. |
| 22 | 'chromeos%': 0, |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 23 | |
[email protected] | bb6aba3 | 2011-01-07 19:04:43 | [diff] [blame^] | 24 | # Disable touch support by default. |
| 25 | 'touchui%': 0, |
| 26 | }, |
| 27 | # Copy conditionally-set variables out one scope. |
| 28 | 'chromeos%': '<(chromeos)', |
| 29 | 'touchui%': '<(touchui)', |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 30 | |
| 31 | # To do a shared build on linux we need to be able to choose between |
| 32 | # type static_library and shared_library. We default to doing a static |
| 33 | # build but you can override this with "gyp -Dlibrary=shared_library" |
| 34 | # or you can add the following line (without the #) to |
| 35 | # ~/.gyp/include.gypi {'variables': {'library': 'shared_library'}} |
| 36 | # to compile as shared by default |
| 37 | 'library%': 'static_library', |
| 38 | |
| 39 | # Compute the architecture that we're building on. |
| 40 | 'conditions': [ |
| 41 | [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', { |
| 42 | # This handles the Linux platforms we generally deal with. Anything |
| 43 | # else gets passed through, which probably won't work very well; such |
| 44 | # hosts should pass an explicit target_arch to gyp. |
| 45 | 'host_arch%': |
| 46 | '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/")', |
| 47 | }, { # OS!="linux" |
| 48 | 'host_arch%': 'ia32', |
| 49 | }], |
[email protected] | bb6aba3 | 2011-01-07 19:04:43 | [diff] [blame^] | 50 | |
| 51 | # Set default value of toolkit_views on for Windows, Chrome OS |
| 52 | # and the touch UI. |
| 53 | ['OS=="win" or chromeos==1 or touchui==1', { |
| 54 | 'toolkit_views%': 1, |
| 55 | }, { |
| 56 | 'toolkit_views%': 0, |
| 57 | }], |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 58 | ], |
| 59 | }, |
| 60 | |
| 61 | # Copy conditionally-set variables out one scope. |
| 62 | 'chromeos%': '<(chromeos)', |
| 63 | 'touchui%': '<(touchui)', |
| 64 | 'host_arch%': '<(host_arch)', |
| 65 | 'library%': '<(library)', |
[email protected] | bb6aba3 | 2011-01-07 19:04:43 | [diff] [blame^] | 66 | 'toolkit_views%': '<(toolkit_views)', |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 67 | |
[email protected] | e14a9f9 | 2009-08-05 19:26:07 | [diff] [blame] | 68 | # Override branding to select the desired branding flavor. |
| 69 | 'branding%': 'Chromium', |
| 70 | |
| 71 | # Override buildtype to select the desired build flavor. |
| 72 | # Dev - everyday build for development/testing |
| 73 | # Official - release build (generally implies additional processing) |
| 74 | # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp |
| 75 | # conversion is done), some of the things which are now controlled by |
| 76 | # 'branding', such as symbol generation, will need to be refactored based |
| 77 | # on 'buildtype' (i.e. we don't care about saving symbols for non-Official |
| 78 | # builds). |
| 79 | 'buildtype%': 'Dev', |
[email protected] | cbd5fd5 | 2009-08-26 00:14:27 | [diff] [blame] | 80 | |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 81 | # Default architecture we're building for is the architecture we're |
| 82 | # building on. |
| 83 | 'target_arch%': '<(host_arch)', |
[email protected] | b3f23ba | 2010-04-26 22:58:17 | [diff] [blame] | 84 | |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 85 | # This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are |
| 86 | # are built under a chromium full build (1) or a webkit.org chromium |
| 87 | # build (0). |
| 88 | 'inside_chromium_build%': 1, |
[email protected] | 8974e04 | 2010-06-21 18:06:52 | [diff] [blame] | 89 | |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 90 | # Set to 1 to enable fast builds. It disables debug info for fastest |
| 91 | # compilation. |
| 92 | 'fastbuild%': 0, |
[email protected] | 93012ca | 2010-08-10 20:10:49 | [diff] [blame] | 93 | |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 94 | # Python version. |
| 95 | 'python_ver%': '2.5', |
[email protected] | b3f23ba | 2010-04-26 22:58:17 | [diff] [blame] | 96 | |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 97 | # Set ARM-v7 compilation flags |
| 98 | 'armv7%': 0, |
| 99 | |
| 100 | # Set Neon compilation flags (only meaningful if armv7==1). |
| 101 | 'arm_neon%': 1, |
| 102 | |
| 103 | # The system root for cross-compiles. Default: none. |
| 104 | 'sysroot%': '', |
| 105 | |
| 106 | # On Linux, we build with sse2 for Chromium builds. |
| 107 | 'disable_sse2%': 0, |
| 108 | |
| 109 | # Use libjpeg-turbo as the JPEG codec used by Chromium. |
| 110 | 'use_libjpeg_turbo%': 0, |
| 111 | |
| 112 | # Variable 'component' is for cases where we would like to build some |
| 113 | # components as dynamic shared libraries but still need variable |
| 114 | # 'library' for static libraries. |
| 115 | # By default, component is set to whatever library is set to and |
| 116 | # it can be overriden by the GYP command line or by ~/.gyp/include.gypi. |
| 117 | 'component%': '<(library)', |
| 118 | |
[email protected] | bb6aba3 | 2011-01-07 19:04:43 | [diff] [blame^] | 119 | # Set to select the Title Case versions of strings in GRD files. |
| 120 | 'use_titlecase_in_grd_files%': 0, |
[email protected] | 6369221 | 2010-09-16 00:22:21 | [diff] [blame] | 121 | |
[email protected] | bb6aba3 | 2011-01-07 19:04:43 | [diff] [blame^] | 122 | 'conditions': [ |
[email protected] | 6369221 | 2010-09-16 00:22:21 | [diff] [blame] | 123 | # A flag to enable or disable our compile-time dependency |
| 124 | # on gnome-keyring. If that dependency is disabled, no gnome-keyring |
| 125 | # support will be available. This option is useful |
| 126 | # for Linux distributions. |
| 127 | ['chromeos==1', { |
| 128 | 'use_gnome_keyring%': 0, |
| 129 | }, { |
| 130 | 'use_gnome_keyring%': 1, |
| 131 | }], |
[email protected] | 0afe521 | 2010-10-01 18:56:11 | [diff] [blame] | 132 | |
| 133 | # Set to 1 compile with -fPIC cflag on linux. This is a must for shared |
| 134 | # libraries on linux x86-64 and arm. |
| 135 | ['host_arch=="ia32"', { |
| 136 | 'linux_fpic%': 0, |
| 137 | }, { |
| 138 | 'linux_fpic%': 1, |
| 139 | }], |
[email protected] | 1b4209f | 2011-01-07 00:25:40 | [diff] [blame] | 140 | |
[email protected] | bb6aba3 | 2011-01-07 19:04:43 | [diff] [blame^] | 141 | ['toolkit_views==0 or OS=="mac"', { |
| 142 | # GTK+ and Mac wants Title Case strings |
| 143 | 'use_titlecase_in_grd_files%': 1, |
| 144 | }], |
| 145 | |
[email protected] | 1b4209f | 2011-01-07 00:25:40 | [diff] [blame] | 146 | # Enable some hacks to support Flapper only on Chrome OS. |
| 147 | ['chromeos==1', { |
| 148 | 'enable_flapper_hacks%': 1, |
| 149 | }, { |
| 150 | 'enable_flapper_hacks%': 0, |
| 151 | }], |
[email protected] | b3f23ba | 2010-04-26 22:58:17 | [diff] [blame] | 152 | ], |
[email protected] | e14a9f9 | 2009-08-05 19:26:07 | [diff] [blame] | 153 | }, |
| 154 | |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 155 | # Copy conditionally-set variables out one scope. |
[email protected] | e14a9f9 | 2009-08-05 19:26:07 | [diff] [blame] | 156 | 'branding%': '<(branding)', |
| 157 | 'buildtype%': '<(buildtype)', |
[email protected] | e0d0014 | 2009-09-18 22:10:27 | [diff] [blame] | 158 | 'target_arch%': '<(target_arch)', |
[email protected] | cf185b3 | 2010-01-12 04:29:59 | [diff] [blame] | 159 | 'host_arch%': '<(host_arch)', |
[email protected] | c153e535 | 2009-09-22 12:37:44 | [diff] [blame] | 160 | 'toolkit_views%': '<(toolkit_views)', |
[email protected] | 6369221 | 2010-09-16 00:22:21 | [diff] [blame] | 161 | 'use_gnome_keyring%': '<(use_gnome_keyring)', |
[email protected] | 0afe521 | 2010-10-01 18:56:11 | [diff] [blame] | 162 | 'linux_fpic%': '<(linux_fpic)', |
[email protected] | 1b4209f | 2011-01-07 00:25:40 | [diff] [blame] | 163 | 'enable_flapper_hacks%': '<(enable_flapper_hacks)', |
[email protected] | c153e535 | 2009-09-22 12:37:44 | [diff] [blame] | 164 | 'chromeos%': '<(chromeos)', |
[email protected] | 93012ca | 2010-08-10 20:10:49 | [diff] [blame] | 165 | 'touchui%': '<(touchui)', |
[email protected] | b2f030c | 2009-09-24 20:36:21 | [diff] [blame] | 166 | 'inside_chromium_build%': '<(inside_chromium_build)', |
[email protected] | 9c1949e | 2009-10-02 19:59:54 | [diff] [blame] | 167 | 'fastbuild%': '<(fastbuild)', |
[email protected] | a76fe1a | 2010-03-01 23:39:36 | [diff] [blame] | 168 | 'python_ver%': '<(python_ver)', |
[email protected] | eafc0b45 | 2010-02-26 21:53:43 | [diff] [blame] | 169 | 'armv7%': '<(armv7)', |
| 170 | 'arm_neon%': '<(arm_neon)', |
[email protected] | 4d83eb7 | 2010-03-04 16:42:23 | [diff] [blame] | 171 | 'sysroot%': '<(sysroot)', |
[email protected] | ac120ff | 2010-04-28 02:14:22 | [diff] [blame] | 172 | 'disable_sse2%': '<(disable_sse2)', |
[email protected] | 8974e04 | 2010-06-21 18:06:52 | [diff] [blame] | 173 | 'library%': '<(library)', |
| 174 | 'component%': '<(component)', |
[email protected] | bb6aba3 | 2011-01-07 19:04:43 | [diff] [blame^] | 175 | 'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)', |
[email protected] | e14a9f9 | 2009-08-05 19:26:07 | [diff] [blame] | 176 | |
[email protected] | caa95c8 | 2009-11-23 22:39:32 | [diff] [blame] | 177 | # The release channel that this build targets. This is used to restrict |
| 178 | # channel-specific build options, like which installer packages to create. |
| 179 | # The default is 'all', which does no channel-specific filtering. |
| 180 | 'channel%': 'all', |
| 181 | |
[email protected] | b3fb809 | 2009-03-12 19:09:24 | [diff] [blame] | 182 | # Override chromium_mac_pch and set it to 0 to suppress the use of |
| 183 | # precompiled headers on the Mac. Prefix header injection may still be |
| 184 | # used, but prefix headers will not be precompiled. This is useful when |
| 185 | # using distcc to distribute a build to compile slaves that don't |
| 186 | # share the same compiler executable as the system driving the compilation, |
| 187 | # because precompiled headers rely on pointers into a specific compiler |
| 188 | # executable's image. Setting this to 0 is needed to use an experimental |
| 189 | # Linux-Mac cross compiler distcc farm. |
| 190 | 'chromium_mac_pch%': 1, |
| 191 | |
[email protected] | 3224dcd | 2009-09-16 17:31:25 | [diff] [blame] | 192 | # Mac OS X SDK and deployment target support. |
| 193 | # The SDK identifies the version of the system headers that will be used, |
| 194 | # and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro. |
| 195 | # "Maximum allowed" refers to the operating system version whose APIs are |
| 196 | # available in the headers. |
| 197 | # The deployment target identifies the minimum system version that the |
| 198 | # built products are expected to function on. It corresponds to the |
| 199 | # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. |
| 200 | # To ensure these macros are available, #include <AvailabilityMacros.h>. |
| 201 | # Additional documentation on these macros is available at |
| 202 | # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3 |
| 203 | # Chrome normally builds with the Mac OS X 10.5 SDK and sets the |
| 204 | # deployment target to 10.5. Other projects, such as O3D, may override |
| 205 | # these defaults. |
| 206 | 'mac_sdk%': '10.5', |
| 207 | 'mac_deployment_target%': '10.5', |
[email protected] | 9543af05 | 2009-09-15 22:42:59 | [diff] [blame] | 208 | |
[email protected] | f5ecbba1 | 2009-04-03 04:35:18 | [diff] [blame] | 209 | # Set to 1 to enable code coverage. In addition to build changes |
| 210 | # (e.g. extra CFLAGS), also creates a new target in the src/chrome |
| 211 | # project file called "coverage". |
| 212 | # Currently ignored on Windows. |
| 213 | 'coverage%': 0, |
[email protected] | 653bd5f03 | 2009-04-08 12:55:49 | [diff] [blame] | 214 | |
[email protected] | c61f643 | 2009-04-22 01:16:42 | [diff] [blame] | 215 | # Overridable specification for potential use of alternative |
| 216 | # JavaScript engines. |
| 217 | 'javascript_engine%': 'v8', |
| 218 | |
[email protected] | 7477ea6f | 2009-12-22 23:28:15 | [diff] [blame] | 219 | # Although base/allocator lets you select a heap library via an |
[email protected] | 7e0d664a | 2009-12-03 21:07:47 | [diff] [blame] | 220 | # environment variable, the libcmt shim it uses sometimes gets in |
| 221 | # the way. To disable it entirely, and switch to normal msvcrt, do e.g. |
| 222 | # 'win_use_allocator_shim': 0, |
| 223 | # 'win_release_RuntimeLibrary': 2 |
| 224 | # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build. |
[email protected] | 8974e04 | 2010-06-21 18:06:52 | [diff] [blame] | 225 | 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt |
[email protected] | 279cd421 | 2009-09-11 22:32:11 | [diff] [blame] | 226 | |
[email protected] | 95ff808 | 2009-11-13 22:21:01 | [diff] [blame] | 227 | # Whether usage of OpenMAX is enabled. |
| 228 | 'enable_openmax%': 0, |
| 229 | |
[email protected] | d01120e6 | 2010-05-10 17:04:48 | [diff] [blame] | 230 | # Whether proprietary audio/video codecs are assumed to be included with |
| 231 | # this build (only meaningful if branding!=Chrome). |
| 232 | 'proprietary_codecs%': 0, |
| 233 | |
[email protected] | e5b2eaa | 2009-04-14 01:39:12 | [diff] [blame] | 234 | # TODO(bradnelson): eliminate this when possible. |
| 235 | # To allow local gyp files to prevent release.vsprops from being included. |
| 236 | # Yes(1) means include release.vsprops. |
| 237 | # Once all vsprops settings are migrated into gyp, this can go away. |
| 238 | 'msvs_use_common_release%': 1, |
[email protected] | 606116d2 | 2009-05-06 22:38:23 | [diff] [blame] | 239 | |
[email protected] | cbd5fd5 | 2009-08-26 00:14:27 | [diff] [blame] | 240 | # TODO(bradnelson): eliminate this when possible. |
| 241 | # To allow local gyp files to override additional linker options for msvs. |
| 242 | # Yes(1) means set use the common linker options. |
[email protected] | 48c7af7 | 2009-07-03 22:00:19 | [diff] [blame] | 243 | 'msvs_use_common_linker_extras%': 1, |
| 244 | |
[email protected] | 1ffb650 | 2009-06-02 07:46:24 | [diff] [blame] | 245 | # TODO(sgk): eliminate this if possible. |
| 246 | # It would be nicer to support this via a setting in 'target_defaults' |
| 247 | # in chrome/app/locales/locales.gypi overriding the setting in the |
| 248 | # 'Debug' configuration in the 'target_defaults' dict below, |
| 249 | # but that doesn't work as we'd like. |
| 250 | 'msvs_debug_link_incremental%': '2', |
| 251 | |
[email protected] | 57313614 | 2009-07-15 22:48:37 | [diff] [blame] | 252 | # This is the location of the sandbox binary. Chrome looks for this before |
| 253 | # running the zygote process. If found, and SUID, it will be used to |
| 254 | # sandbox the zygote process and, thus, all renderer processes. |
| 255 | 'linux_sandbox_path%': '', |
| 256 | |
[email protected] | ad6d2c4 | 2009-09-15 20:13:38 | [diff] [blame] | 257 | # Set this to true to enable SELinux support. |
| 258 | 'selinux%': 0, |
[email protected] | 4c9cc6c | 2009-10-01 18:54:57 | [diff] [blame] | 259 | |
[email protected] | 58680ce | 2010-09-18 00:09:15 | [diff] [blame] | 260 | # Set this to true when building with Clang. |
| 261 | # See http://code.google.com/p/chromium/wiki/Clang for details. |
| 262 | # TODO: eventually clang should behave identically to gcc, and this |
| 263 | # won't be necessary. |
| 264 | 'clang%': 0, |
| 265 | |
[email protected] | 36532f33 | 2010-08-25 00:22:01 | [diff] [blame] | 266 | # Override whether we should use Breakpad on Linux. I.e. for Chrome bot. |
| 267 | 'linux_breakpad%': 0, |
| 268 | # And if we want to dump symbols for Breakpad-enabled builds. |
| 269 | 'linux_dump_symbols%': 0, |
| 270 | # And if we want to strip the binary after dumping symbols. |
[email protected] | 05cb696 | 2009-10-01 23:29:03 | [diff] [blame] | 271 | 'linux_strip_binary%': 0, |
[email protected] | 1d87c28 | 2010-09-15 22:24:49 | [diff] [blame] | 272 | # Strip the test binaries needed for Linux reliability tests. |
| 273 | 'linux_strip_reliability_tests%': 0, |
[email protected] | 05cb696 | 2009-10-01 23:29:03 | [diff] [blame] | 274 | |
[email protected] | 46ce5b56 | 2010-06-16 18:39:53 | [diff] [blame] | 275 | # Enable TCMalloc. |
| 276 | 'linux_use_tcmalloc%': 1, |
[email protected] | 01699e2 | 2009-11-11 19:24:24 | [diff] [blame] | 277 | |
[email protected] | 39ca7de | 2010-04-16 08:04:03 | [diff] [blame] | 278 | # Disable TCMalloc's debugallocation. |
| 279 | 'linux_use_debugallocation%': 0, |
| 280 | |
[email protected] | d8b6060 | 2010-03-26 09:41:22 | [diff] [blame] | 281 | # Disable TCMalloc's heapchecker. |
| 282 | 'linux_use_heapchecker%': 0, |
| 283 | |
[email protected] | 64e2d4a4 | 2010-08-27 10:13:21 | [diff] [blame] | 284 | # Disable shadow stack keeping used by heapcheck to unwind the stacks |
| 285 | # better. |
| 286 | 'linux_keep_shadow_stacks%': 0, |
| 287 | |
[email protected] | 6def64a | 2010-10-28 20:40:34 | [diff] [blame] | 288 | # Set to 1 to turn on seccomp sandbox by default. |
| 289 | # (Note: this is ignored for official builds.) |
| 290 | 'linux_use_seccomp_sandbox%': 0, |
[email protected] | 39c4e1a8 | 2010-03-30 19:47:41 | [diff] [blame] | 291 | |
[email protected] | 556c5d7 | 2010-06-10 05:45:01 | [diff] [blame] | 292 | # Set to 1 to link against libgnome-keyring instead of using dlopen(). |
| 293 | 'linux_link_gnome_keyring%': 0, |
| 294 | |
[email protected] | d8c7cbcc | 2009-10-02 19:00:31 | [diff] [blame] | 295 | # Used to disable Native Client at compile time, for platforms where it |
| 296 | # isn't supported |
| 297 | 'disable_nacl%': 0, |
| 298 | |
[email protected] | 77c1b2939 | 2009-12-04 06:21:29 | [diff] [blame] | 299 | # Set Thumb compilation flags. |
| 300 | 'arm_thumb%': 0, |
| 301 | |
[email protected] | 53e0f64 | 2010-03-05 01:41:56 | [diff] [blame] | 302 | # Set ARM fpu compilation flags (only meaningful if armv7==1 and |
| 303 | # arm_neon==0). |
| 304 | 'arm_fpu%': 'vfpv3', |
| 305 | |
[email protected] | 9821d0d | 2010-04-16 22:40:37 | [diff] [blame] | 306 | # Enable new NPDevice API. |
| 307 | 'enable_new_npdevice_api%': 0, |
[email protected] | ed15459 | 2010-04-29 00:18:50 | [diff] [blame] | 308 | |
| 309 | # Enable EGLImage support in OpenMAX |
| 310 | 'enable_eglimage%': 0, |
| 311 | |
[email protected] | 6f51b27e | 2010-06-22 20:43:53 | [diff] [blame] | 312 | # Enable a variable used elsewhere throughout the GYP files to determine |
| 313 | # whether to compile in the sources for the GPU plugin / process. |
| 314 | 'enable_gpu%': 1, |
| 315 | |
[email protected] | 6de53d4 | 2010-11-09 07:33:19 | [diff] [blame] | 316 | # Use GConf, the GNOME configuration system. |
| 317 | 'use_gconf%': 1, |
| 318 | |
[email protected] | 32e1dee | 2010-12-09 18:36:24 | [diff] [blame] | 319 | # Use OpenSSL instead of NSS. Under development: see http://crbug.com/62803 |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 320 | 'use_openssl%': 0, |
| 321 | |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 322 | # .gyp files or targets should set chromium_code to 1 if they build |
| 323 | # Chromium-specific code, as opposed to external code. This variable is |
| 324 | # used to control such things as the set of warnings to enable, and |
| 325 | # whether warnings are treated as errors. |
| 326 | 'chromium_code%': 0, |
| 327 | |
| 328 | # Set to 1 to compile with the built in pdf viewer. |
| 329 | 'internal_pdf%': 0, |
| 330 | |
| 331 | # This allows to use libcros from the current system, ie. /usr/lib/ |
| 332 | # The cros_api will be pulled in as a static library, and all headers |
| 333 | # from the system include dirs. |
[email protected] | bb6aba3 | 2011-01-07 19:04:43 | [diff] [blame^] | 334 | 'system_libcros%': 0, |
[email protected] | e72e55b | 2011-01-06 22:19:30 | [diff] [blame] | 335 | |
| 336 | # Remoting compilation is enabled by default. Set to 0 to disable. |
| 337 | 'remoting%': 1, |
| 338 | |
| 339 | # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_' |
| 340 | # so Cocoa is happy (http://crbug.com/20441). |
| 341 | 'locales': [ |
| 342 | 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', |
| 343 | 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he', |
| 344 | 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv', |
| 345 | 'ml', 'mr', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', |
| 346 | 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk', |
| 347 | 'vi', 'zh-CN', 'zh-TW', |
| 348 | ], |
| 349 | |
[email protected] | bb6aba3 | 2011-01-07 19:04:43 | [diff] [blame^] | 350 | 'grit_defines': [], |
| 351 | |
[email protected] | 29c2daea | 2011-01-05 20:38:50 | [diff] [blame] | 352 | # Use Harfbuzz-NG instead of Harfbuzz. |
| 353 | # Under development: http://crbug.com/68551 |
| 354 | 'use_harfbuzz_ng%': 0, |
| 355 | |
[email protected] | 912c55c | 2009-07-31 23:33:55 | [diff] [blame] | 356 | 'conditions': [ |
[email protected] | 47deeb6 | 2009-12-17 14:49:39 | [diff] [blame] | 357 | ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { |
[email protected] | 242a9e6 | 2009-11-03 17:32:10 | [diff] [blame] | 358 | # This will set gcc_version to XY if you are running gcc X.Y.*. |
| 359 | # This is used to tweak build flags for gcc 4.4. |
| 360 | 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)', |
[email protected] | 4d83eb7 | 2010-03-04 16:42:23 | [diff] [blame] | 361 | # Figure out the python architecture to decide if we build pyauto. |
[email protected] | efd6846 | 2010-03-04 17:07:54 | [diff] [blame] | 362 | 'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/lib/libpython<(python_ver).so.1.0)', |
[email protected] | cbd5fd5 | 2009-08-26 00:14:27 | [diff] [blame] | 363 | 'conditions': [ |
[email protected] | 2a77a9d | 2010-08-26 19:58:10 | [diff] [blame] | 364 | ['branding=="Chrome"', { |
[email protected] | cbd5fd5 | 2009-08-26 00:14:27 | [diff] [blame] | 365 | 'linux_breakpad%': 1, |
[email protected] | cbd5fd5 | 2009-08-26 00:14:27 | [diff] [blame] | 366 | }], |
[email protected] | 4c9cc6c | 2009-10-01 18:54:57 | [diff] [blame] | 367 | # All Chrome builds have breakpad symbols, but only process the |
| 368 | # symbols from official builds. |
[email protected] | c913cb8 | 2010-08-31 19:44:08 | [diff] [blame] | 369 | ['(branding=="Chrome" and buildtype=="Official")', { |
[email protected] | 4c9cc6c | 2009-10-01 18:54:57 | [diff] [blame] | 370 | 'linux_dump_symbols%': 1, |
[email protected] | 4c9cc6c | 2009-10-01 18:54:57 | [diff] [blame] | 371 | }], |
[email protected] | cbd5fd5 | 2009-08-26 00:14:27 | [diff] [blame] | 372 | ], |
[email protected] | 47deeb6 | 2009-12-17 14:49:39 | [diff] [blame] | 373 | }], # OS=="linux" or OS=="freebsd" or OS=="openbsd" |
[email protected] | bb6aba3 | 2011-01-07 19:04:43 | [diff] [blame^] | 374 | |
[email protected] | e14a9f9 | 2009-08-05 19:26:07 | [diff] [blame] | 375 | ['OS=="mac"', { |
[email protected] | e14a9f9 | 2009-08-05 19:26:07 | [diff] [blame] | 376 | 'conditions': [ |
| 377 | # mac_product_name is set to the name of the .app bundle as it should |
| 378 | # appear on disk. This duplicates data from |
| 379 | # chrome/app/theme/chromium/BRANDING and |
| 380 | # chrome/app/theme/google_chrome/BRANDING, but is necessary to get |
| 381 | # these names into the build system. |
| 382 | ['branding=="Chrome"', { |
| 383 | 'mac_product_name%': 'Google Chrome', |
| 384 | }, { # else: branding!="Chrome" |
| 385 | 'mac_product_name%': 'Chromium', |
| 386 | }], |
| 387 | |
| 388 | # Feature variables for enabling Mac Breakpad and Keystone auto-update |
| 389 | # support. Both features are on by default in official builds with |
| 390 | # Chrome branding. |
| 391 | ['branding=="Chrome" and buildtype=="Official"', { |
| 392 | 'mac_breakpad%': 1, |
| 393 | 'mac_keystone%': 1, |
| 394 | }, { # else: branding!="Chrome" or buildtype!="Official" |
| 395 | 'mac_breakpad%': 0, |
| 396 | 'mac_keystone%': 0, |
| 397 | }], |
| 398 | ], |
| 399 | }], # OS=="mac" |
[email protected] | bb6aba3 | 2011-01-07 19:04:43 | [diff] [blame^] | 400 | |
[email protected] | 912c55c | 2009-07-31 23:33:55 | [diff] [blame] | 401 | # Whether to use multiple cores to compile with visual studio. This is |
| 402 | # optional because it sometimes causes corruption on VS 2005. |
| 403 | # It is on by default on VS 2008 and off on VS 2005. |
| 404 | ['OS=="win"', { |
| 405 | 'conditions': [ |
[email protected] | 8974e04 | 2010-06-21 18:06:52 | [diff] [blame] | 406 | ['component=="shared_library"', { |
| 407 | 'win_use_allocator_shim%': 0, |
| 408 | }], |
[email protected] | 912c55c | 2009-07-31 23:33:55 | [diff] [blame] | 409 | ['MSVS_VERSION=="2005"', { |
[email protected] | 66979537 | 2009-08-14 17:51:13 | [diff] [blame] | 410 | 'msvs_multi_core_compile%': 0, |
[email protected] | 912c55c | 2009-07-31 23:33:55 | [diff] [blame] | 411 | },{ |
| 412 | 'msvs_multi_core_compile%': 1, |
| 413 | }], |
[email protected] | 10bb8c9 | 2009-08-07 21:16:03 | [diff] [blame] | 414 | # Don't do incremental linking for large modules on 32-bit. |
| 415 | ['MSVS_OS_BITS==32', { |
| 416 | 'msvs_large_module_debug_link_mode%': '1', # No |
| 417 | },{ |
| 418 | 'msvs_large_module_debug_link_mode%': '2', # Yes |
| 419 | }], |
[email protected] | 912c55c | 2009-07-31 23:33:55 | [diff] [blame] | 420 | ], |
[email protected] | ef4fa407 | 2009-12-04 22:46:50 | [diff] [blame] | 421 | 'nacl_win64_defines': [ |
| 422 | # This flag is used to minimize dependencies when building |
| 423 | # Native Client loader for 64-bit Windows. |
| 424 | 'NACL_WIN64', |
| 425 | ], |
[email protected] | 912c55c | 2009-07-31 23:33:55 | [diff] [blame] | 426 | }], |
[email protected] | bb6aba3 | 2011-01-07 19:04:43 | [diff] [blame^] | 427 | |
[email protected] | 6df3ebf | 2010-10-29 20:30:38 | [diff] [blame] | 428 | ['OS=="mac" or (OS=="linux" and chromeos==0 and target_arch!="arm")', { |
[email protected] | 8e553f4 | 2010-10-25 20:05:44 | [diff] [blame] | 429 | 'use_cups%': 1, |
| 430 | }, { |
| 431 | 'use_cups%': 0, |
| 432 | }], |
[email protected] | bb6aba3 | 2011-01-07 19:04:43 | [diff] [blame^] | 433 | |
[email protected] | 19fe8f0b | 2010-12-07 07:27:27 | [diff] [blame] | 434 | # Set the relative path from this file to the GYP file of the JPEG |
| 435 | # library used by Chromium. |
| 436 | ['use_libjpeg_turbo==1', { |
| 437 | 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp', |
| 438 | }, { |
| 439 | 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp', |
| 440 | }], # use_libjpeg_turbo==1 |
[email protected] | bb6aba3 | 2011-01-07 19:04:43 | [diff] [blame^] | 441 | |
| 442 | # Setup -D flags passed into grit. |
| 443 | ['chromeos==1', { |
| 444 | 'grit_defines': ['-D', 'chromeos'], |
| 445 | }], |
| 446 | ['toolkit_views==1', { |
| 447 | 'grit_defines': ['-D', 'toolkit_views'], |
| 448 | }], |
| 449 | ['touchui==1', { |
| 450 | 'grit_defines': ['-D', 'touchui'], |
| 451 | }], |
| 452 | ['use_titlecase_in_grd_files==1', { |
| 453 | 'grit_defines': ['-D', 'use_titlecase'], |
| 454 | }], |
[email protected] | 912c55c | 2009-07-31 23:33:55 | [diff] [blame] | 455 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 456 | }, |
| 457 | 'target_defaults': { |
[email protected] | 1c96609 | 2009-08-20 21:19:26 | [diff] [blame] | 458 | 'variables': { |
[email protected] | a6e2213 | 2010-02-10 20:43:18 | [diff] [blame] | 459 | # The condition that operates on chromium_code is in a target_conditions |
| 460 | # section, and will not have access to the default fallback value of |
| 461 | # chromium_code at the top of this file, or to the chromium_code |
| 462 | # variable placed at the root variables scope of .gyp files, because |
| 463 | # those variables are not set at target scope. As a workaround, |
| 464 | # if chromium_code is not set at target scope, define it in target scope |
| 465 | # to contain whatever value it has during early variable expansion. |
| 466 | # That's enough to make it available during target conditional |
| 467 | # processing. |
| 468 | 'chromium_code%': '<(chromium_code)', |
| 469 | |
[email protected] | 7e0d664a | 2009-12-03 21:07:47 | [diff] [blame] | 470 | # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html |
[email protected] | d5d593a | 2009-08-28 23:23:29 | [diff] [blame] | 471 | 'mac_release_optimization%': '3', # Use -O3 unless overridden |
[email protected] | ffd984b1 | 2009-09-11 19:37:00 | [diff] [blame] | 472 | 'mac_debug_optimization%': '0', # Use -O0 unless overridden |
[email protected] | 7e0d664a | 2009-12-03 21:07:47 | [diff] [blame] | 473 | # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx |
| 474 | 'win_release_Optimization%': '2', # 2 = /Os |
| 475 | 'win_debug_Optimization%': '0', # 0 = /Od |
[email protected] | 6b0507b | 2010-05-07 07:41:21 | [diff] [blame] | 476 | # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx |
| 477 | 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off |
| 478 | # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx |
[email protected] | 2ae6e02 | 2010-05-07 13:19:15 | [diff] [blame] | 479 | 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off, |
| 480 | 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max |
[email protected] | fac10d1 | 2010-11-08 16:00:31 | [diff] [blame] | 481 | # VS inserts quite a lot of extra checks to algorithms like |
| 482 | # std::partial_sort in Debug build which make them O(N^2) |
| 483 | # instead of O(N*logN). This is particularly slow under memory |
| 484 | # tools like ThreadSanitizer so we want it to be disablable. |
| 485 | # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx |
| 486 | 'win_debug_disable_iterator_debugging%': '0', |
[email protected] | 7e0d664a | 2009-12-03 21:07:47 | [diff] [blame] | 487 | |
[email protected] | ffd984b1 | 2009-09-11 19:37:00 | [diff] [blame] | 488 | 'release_extra_cflags%': '', |
| 489 | 'debug_extra_cflags%': '', |
[email protected] | 92822e8 | 2009-09-18 14:26:56 | [diff] [blame] | 490 | 'release_valgrind_build%': 0, |
[email protected] | 8974e04 | 2010-06-21 18:06:52 | [diff] [blame] | 491 | |
| 492 | 'conditions': [ |
| 493 | ['OS=="win" and component=="shared_library"', { |
| 494 | # See http://msdn.microsoft.com/en-us/library/aa652367.aspx |
| 495 | 'win_release_RuntimeLibrary%': '2', # 2 = /MT (nondebug DLL) |
| 496 | 'win_debug_RuntimeLibrary%': '3', # 3 = /MTd (debug DLL) |
| 497 | }, { |
| 498 | # See http://msdn.microsoft.com/en-us/library/aa652367.aspx |
| 499 | 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static) |
| 500 | 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static) |
| 501 | }], |
| 502 | ], |
[email protected] | 1c96609 | 2009-08-20 21:19:26 | [diff] [blame] | 503 | }, |
[email protected] | 32aa8cc | 2009-03-04 21:36:39 | [diff] [blame] | 504 | 'conditions': [ |
| 505 | ['branding=="Chrome"', { |
| 506 | 'defines': ['GOOGLE_CHROME_BUILD'], |
| 507 | }, { # else: branding!="Chrome" |
| 508 | 'defines': ['CHROMIUM_BUILD'], |
| 509 | }], |
[email protected] | 06c75618 | 2010-04-27 18:31:31 | [diff] [blame] | 510 | ['toolkit_views==1', { |
[email protected] | e697023 | 2009-05-12 23:51:17 | [diff] [blame] | 511 | 'defines': ['TOOLKIT_VIEWS=1'], |
| 512 | }], |
[email protected] | fdc5bed | 2010-01-09 01:16:57 | [diff] [blame] | 513 | ['chromeos==1', { |
[email protected] | 1677984 | 2009-07-08 23:45:29 | [diff] [blame] | 514 | 'defines': ['OS_CHROMEOS=1'], |
[email protected] | 2b883b9 | 2009-06-02 22:57:50 | [diff] [blame] | 515 | }], |
[email protected] | 0094fbe | 2010-07-15 21:51:43 | [diff] [blame] | 516 | ['touchui==1', { |
| 517 | 'defines': ['TOUCH_UI=1'], |
| 518 | }], |
[email protected] | 542bf24a | 2010-06-11 23:08:17 | [diff] [blame] | 519 | ['remoting==1', { |
| 520 | 'defines': ['ENABLE_REMOTING=1'], |
[email protected] | c0bac53 | 2010-06-11 00:39:00 | [diff] [blame] | 521 | }], |
[email protected] | d01120e6 | 2010-05-10 17:04:48 | [diff] [blame] | 522 | ['proprietary_codecs==1', { |
| 523 | 'defines': ['USE_PROPRIETARY_CODECS'], |
| 524 | }], |
[email protected] | 1b4209f | 2011-01-07 00:25:40 | [diff] [blame] | 525 | ['enable_flapper_hacks==1', { |
| 526 | 'defines': ['ENABLE_FLAPPER_HACKS=1'], |
| 527 | }], |
[email protected] | 9c1949e | 2009-10-02 19:59:54 | [diff] [blame] | 528 | ['fastbuild!=0', { |
| 529 | 'conditions': [ |
[email protected] | 1cc2fa7 | 2010-07-03 08:49:24 | [diff] [blame] | 530 | # For Windows, we don't genererate debug information. |
[email protected] | 9c1949e | 2009-10-02 19:59:54 | [diff] [blame] | 531 | ['OS=="win"', { |
| 532 | 'msvs_settings': { |
| 533 | 'VCLinkerTool': { |
| 534 | 'GenerateDebugInformation': 'false', |
| 535 | }, |
| 536 | 'VCCLCompilerTool': { |
| 537 | 'DebugInformationFormat': '0', |
| 538 | } |
| 539 | } |
[email protected] | 1cc2fa7 | 2010-07-03 08:49:24 | [diff] [blame] | 540 | }, { # else: OS != "win", generate less debug information. |
| 541 | 'variables': { |
| 542 | 'debug_extra_cflags': '-g1', |
| 543 | }, |
[email protected] | 37c8419 | 2010-04-14 21:37:40 | [diff] [blame] | 544 | }], |
[email protected] | 9c1949e | 2009-10-02 19:59:54 | [diff] [blame] | 545 | ], # conditions for fastbuild. |
| 546 | }], # fastbuild!=0 |
[email protected] | ad6d2c4 | 2009-09-15 20:13:38 | [diff] [blame] | 547 | ['selinux==1', { |
| 548 | 'defines': ['CHROMIUM_SELINUX=1'], |
| 549 | }], |
[email protected] | 7e0d664a | 2009-12-03 21:07:47 | [diff] [blame] | 550 | ['win_use_allocator_shim==0', { |
| 551 | 'conditions': [ |
| 552 | ['OS=="win"', { |
| 553 | 'defines': ['NO_TCMALLOC'], |
| 554 | }], |
| 555 | ], |
| 556 | }], |
[email protected] | 43f28f83 | 2010-02-03 02:28:48 | [diff] [blame] | 557 | ['enable_gpu==1', { |
[email protected] | 7477ea6f | 2009-12-22 23:28:15 | [diff] [blame] | 558 | 'defines': [ |
| 559 | 'ENABLE_GPU=1', |
| 560 | ], |
| 561 | }], |
[email protected] | b1c2a554 | 2010-10-08 12:44:40 | [diff] [blame] | 562 | ['use_openssl==1', { |
| 563 | 'defines': [ |
| 564 | 'USE_OPENSSL=1', |
| 565 | ], |
| 566 | }], |
[email protected] | ed15459 | 2010-04-29 00:18:50 | [diff] [blame] | 567 | ['enable_eglimage==1', { |
| 568 | 'defines': [ |
| 569 | 'ENABLE_EGLIMAGE=1', |
| 570 | ], |
| 571 | }], |
[email protected] | f5ecbba1 | 2009-04-03 04:35:18 | [diff] [blame] | 572 | ['coverage!=0', { |
| 573 | 'conditions': [ |
| 574 | ['OS=="mac"', { |
| 575 | 'xcode_settings': { |
[email protected] | ab295637 | 2009-08-13 18:11:04 | [diff] [blame] | 576 | 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs |
| 577 | 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage |
[email protected] | 5ae4f55e | 2009-04-13 23:19:47 | [diff] [blame] | 578 | }, |
[email protected] | e4fb84c | 2009-12-28 20:45:43 | [diff] [blame] | 579 | # Add -lgcov for types executable, shared_library, and |
[email protected] | dc259ce5 | 2010-04-13 04:03:10 | [diff] [blame] | 580 | # loadable_module; not for static_library. |
[email protected] | e4fb84c | 2009-12-28 20:45:43 | [diff] [blame] | 581 | # This is a delayed conditional. |
[email protected] | f5ecbba1 | 2009-04-03 04:35:18 | [diff] [blame] | 582 | 'target_conditions': [ |
[email protected] | e4fb84c | 2009-12-28 20:45:43 | [diff] [blame] | 583 | ['_type!="static_library"', { |
[email protected] | f5ecbba1 | 2009-04-03 04:35:18 | [diff] [blame] | 584 | 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] }, |
[email protected] | 5ae4f55e | 2009-04-13 23:19:47 | [diff] [blame] | 585 | }], |
| 586 | ], |
| 587 | }], |
[email protected] | f5ecbba1 | 2009-04-03 04:35:18 | [diff] [blame] | 588 | ['OS=="linux"', { |
| 589 | 'cflags': [ '-ftest-coverage', |
| 590 | '-fprofile-arcs' ], |
[email protected] | 7122ffd5 | 2009-04-30 23:19:00 | [diff] [blame] | 591 | 'link_settings': { 'libraries': [ '-lgcov' ] }, |
[email protected] | f5ecbba1 | 2009-04-03 04:35:18 | [diff] [blame] | 592 | }], |
[email protected] | e8f6ff4 | 2009-07-07 18:20:53 | [diff] [blame] | 593 | # Finally, for Windows, we simply turn on profiling. |
| 594 | ['OS=="win"', { |
| 595 | 'msvs_settings': { |
| 596 | 'VCLinkerTool': { |
| 597 | 'Profile': 'true', |
| 598 | }, |
[email protected] | 10bb8c9 | 2009-08-07 21:16:03 | [diff] [blame] | 599 | 'VCCLCompilerTool': { |
[email protected] | e8f6ff4 | 2009-07-07 18:20:53 | [diff] [blame] | 600 | # /Z7, not /Zi, so coverage is happyb |
| 601 | 'DebugInformationFormat': '1', |
[email protected] | 1f9471a | 2010-01-04 06:40:16 | [diff] [blame] | 602 | 'AdditionalOptions': ['/Yd'], |
[email protected] | e8f6ff4 | 2009-07-07 18:20:53 | [diff] [blame] | 603 | } |
| 604 | } |
| 605 | }], # OS==win |
| 606 | ], # conditions for coverage |
| 607 | }], # coverage!=0 |
[email protected] | 4e4d604 | 2010-08-26 18:34:38 | [diff] [blame] | 608 | ['OS=="win"', { |
| 609 | 'defines': [ |
| 610 | '__STD_C', |
| 611 | '_CRT_SECURE_NO_DEPRECATE', |
| 612 | '_SCL_SECURE_NO_DEPRECATE', |
| 613 | ], |
| 614 | 'include_dirs': [ |
| 615 | '<(DEPTH)/third_party/wtl/include', |
| 616 | ], |
| 617 | }], # OS==win |
[email protected] | a6e2213 | 2010-02-10 20:43:18 | [diff] [blame] | 618 | ], # conditions for 'target_defaults' |
| 619 | 'target_conditions': [ |
[email protected] | c14d8e77 | 2010-02-09 22:06:15 | [diff] [blame] | 620 | ['chromium_code==0', { |
[email protected] | d854331 | 2010-02-10 17:43:28 | [diff] [blame] | 621 | 'conditions': [ |
| 622 | [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', { |
| 623 | 'cflags!': [ |
| 624 | '-Wall', |
| 625 | '-Wextra', |
| 626 | '-Werror', |
| 627 | ], |
| 628 | }], |
| 629 | [ 'OS=="win"', { |
| 630 | 'defines': [ |
| 631 | '_CRT_SECURE_NO_DEPRECATE', |
| 632 | '_CRT_NONSTDC_NO_WARNINGS', |
| 633 | '_CRT_NONSTDC_NO_DEPRECATE', |
| 634 | '_SCL_SECURE_NO_DEPRECATE', |
| 635 | ], |
| 636 | 'msvs_disabled_warnings': [4800], |
| 637 | 'msvs_settings': { |
| 638 | 'VCCLCompilerTool': { |
| 639 | 'WarnAsError': 'false', |
| 640 | 'Detect64BitPortabilityProblems': 'false', |
| 641 | }, |
| 642 | }, |
| 643 | }], |
| 644 | [ 'OS=="mac"', { |
| 645 | 'xcode_settings': { |
| 646 | 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', |
[email protected] | 4c4c2e533 | 2010-06-15 11:51:06 | [diff] [blame] | 647 | 'WARNING_CFLAGS!': ['-Wall', '-Wextra'], |
[email protected] | d854331 | 2010-02-10 17:43:28 | [diff] [blame] | 648 | }, |
| 649 | }], |
[email protected] | c14d8e77 | 2010-02-09 22:06:15 | [diff] [blame] | 650 | ], |
| 651 | }, { |
| 652 | # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the |
| 653 | # C99 macros on Mac and Linux. |
| 654 | 'defines': [ |
| 655 | '__STDC_FORMAT_MACROS', |
| 656 | ], |
| 657 | 'conditions': [ |
| 658 | ['OS!="win"', { |
[email protected] | 4051959 | 2010-11-16 15:23:30 | [diff] [blame] | 659 | 'sources/': [ ['exclude', '_win(_unittest)?\\.(h|cc)$'], |
[email protected] | a316ca53 | 2010-11-15 14:08:16 | [diff] [blame] | 660 | ['exclude', '(^|/)win/'], |
[email protected] | 4051959 | 2010-11-16 15:23:30 | [diff] [blame] | 661 | ['exclude', '(^|/)win_[^/]*\\.(h|cc)$'] ], |
[email protected] | c14d8e77 | 2010-02-09 22:06:15 | [diff] [blame] | 662 | }], |
| 663 | ['OS!="mac"', { |
[email protected] | 4051959 | 2010-11-16 15:23:30 | [diff] [blame] | 664 | 'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.(h|cc)$'], |
[email protected] | a316ca53 | 2010-11-15 14:08:16 | [diff] [blame] | 665 | ['exclude', '(^|/)(cocoa|mac)/'], |
| 666 | ['exclude', '\\.mm?$' ] ], |
[email protected] | c14d8e77 | 2010-02-09 22:06:15 | [diff] [blame] | 667 | }], |
| 668 | ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', { |
| 669 | 'sources/': [ |
[email protected] | 4051959 | 2010-11-16 15:23:30 | [diff] [blame] | 670 | ['exclude', '_(chromeos|gtk|x|x11|xdg)(_unittest)?\\.(h|cc)$'], |
[email protected] | a316ca53 | 2010-11-15 14:08:16 | [diff] [blame] | 671 | ['exclude', '(^|/)gtk/'], |
[email protected] | 4051959 | 2010-11-16 15:23:30 | [diff] [blame] | 672 | ['exclude', '(^|/)(gtk|x11)_[^/]*\\.(h|cc)$'], |
[email protected] | 18cff3d | 2010-02-17 18:03:13 | [diff] [blame] | 673 | ], |
| 674 | }], |
| 675 | ['OS!="linux"', { |
| 676 | 'sources/': [ |
[email protected] | 4051959 | 2010-11-16 15:23:30 | [diff] [blame] | 677 | ['exclude', '_linux(_unittest)?\\.(h|cc)$'], |
[email protected] | a316ca53 | 2010-11-15 14:08:16 | [diff] [blame] | 678 | ['exclude', '(^|/)linux/'], |
[email protected] | 18cff3d | 2010-02-17 18:03:13 | [diff] [blame] | 679 | ], |
[email protected] | c14d8e77 | 2010-02-09 22:06:15 | [diff] [blame] | 680 | }], |
| 681 | # We use "POSIX" to refer to all non-Windows operating systems. |
| 682 | ['OS=="win"', { |
[email protected] | 4051959 | 2010-11-16 15:23:30 | [diff] [blame] | 683 | 'sources/': [ ['exclude', '_posix\\.(h|cc)$'] ], |
[email protected] | f55bd486 | 2010-05-27 15:38:07 | [diff] [blame] | 684 | # turn on warnings for signed/unsigned mismatch on chromium code. |
| 685 | 'msvs_settings': { |
| 686 | 'VCCLCompilerTool': { |
| 687 | 'AdditionalOptions': ['/we4389'], |
| 688 | }, |
| 689 | }, |
[email protected] | c14d8e77 | 2010-02-09 22:06:15 | [diff] [blame] | 690 | }], |
[email protected] | c14d8e77 | 2010-02-09 22:06:15 | [diff] [blame] | 691 | ['chromeos!=1', { |
[email protected] | 4051959 | 2010-11-16 15:23:30 | [diff] [blame] | 692 | 'sources/': [ ['exclude', '_chromeos\\.(h|cc)$'] ] |
[email protected] | c14d8e77 | 2010-02-09 22:06:15 | [diff] [blame] | 693 | }], |
[email protected] | 06c75618 | 2010-04-27 18:31:31 | [diff] [blame] | 694 | ['toolkit_views==0', { |
[email protected] | 4051959 | 2010-11-16 15:23:30 | [diff] [blame] | 695 | 'sources/': [ ['exclude', '_views\\.(h|cc)$'] ] |
[email protected] | c14d8e77 | 2010-02-09 22:06:15 | [diff] [blame] | 696 | }], |
| 697 | ], |
| 698 | }], |
[email protected] | a6e2213 | 2010-02-10 20:43:18 | [diff] [blame] | 699 | ], # target_conditions for 'target_defaults' |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 700 | 'default_configuration': 'Debug', |
| 701 | 'configurations': { |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 702 | # VCLinkerTool LinkIncremental values below: |
| 703 | # 0 == default |
| 704 | # 1 == /INCREMENTAL:NO |
| 705 | # 2 == /INCREMENTAL |
| 706 | # Debug links incremental, Release does not. |
| 707 | # |
[email protected] | 7b99801e | 2010-11-03 17:26:23 | [diff] [blame] | 708 | # Abstract base configurations to cover common attributes. |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 709 | # |
| 710 | 'Common_Base': { |
[email protected] | bb05e45 | 2009-10-29 21:24:56 | [diff] [blame] | 711 | 'abstract': 1, |
| 712 | 'msvs_configuration_attributes': { |
| 713 | 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)', |
| 714 | 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', |
| 715 | 'CharacterSet': '1', |
| 716 | }, |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 717 | }, |
| 718 | 'x86_Base': { |
| 719 | 'abstract': 1, |
[email protected] | ef4fa407 | 2009-12-04 22:46:50 | [diff] [blame] | 720 | 'msvs_settings': { |
| 721 | 'VCLinkerTool': { |
| 722 | 'TargetMachine': '1', |
| 723 | }, |
| 724 | }, |
[email protected] | 2fa4078 | 2009-11-01 21:17:34 | [diff] [blame] | 725 | 'msvs_configuration_platform': 'Win32', |
[email protected] | bb05e45 | 2009-10-29 21:24:56 | [diff] [blame] | 726 | }, |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 727 | 'x64_Base': { |
| 728 | 'abstract': 1, |
| 729 | 'msvs_configuration_platform': 'x64', |
| 730 | 'msvs_settings': { |
| 731 | 'VCLinkerTool': { |
| 732 | 'TargetMachine': '17', # x86 - 64 |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 733 | 'AdditionalLibraryDirectories!': |
| 734 | ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'], |
| 735 | 'AdditionalLibraryDirectories': |
| 736 | ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'], |
| 737 | }, |
[email protected] | d26b4418ab | 2010-03-24 22:06:35 | [diff] [blame] | 738 | 'VCLibrarianTool': { |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 739 | 'AdditionalLibraryDirectories!': |
| 740 | ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'], |
| 741 | 'AdditionalLibraryDirectories': |
| 742 | ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'], |
| 743 | }, |
| 744 | }, |
| 745 | 'defines': [ |
| 746 | # Not sure if tcmalloc works on 64-bit Windows. |
| 747 | 'NO_TCMALLOC', |
| 748 | ], |
| 749 | }, |
| 750 | 'Debug_Base': { |
| 751 | 'abstract': 1, |
[email protected] | ee85751 | 2010-05-14 08:24:42 | [diff] [blame] | 752 | 'defines': ['DYNAMIC_ANNOTATIONS_ENABLED=1'], |
[email protected] | 1c96609 | 2009-08-20 21:19:26 | [diff] [blame] | 753 | 'xcode_settings': { |
| 754 | 'COPY_PHASE_STRIP': 'NO', |
[email protected] | d5d593a | 2009-08-28 23:23:29 | [diff] [blame] | 755 | 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)', |
[email protected] | bd232ac | 2009-10-21 02:23:53 | [diff] [blame] | 756 | 'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ], |
[email protected] | 1c96609 | 2009-08-20 21:19:26 | [diff] [blame] | 757 | }, |
[email protected] | bb05e45 | 2009-10-29 21:24:56 | [diff] [blame] | 758 | 'msvs_settings': { |
| 759 | 'VCCLCompilerTool': { |
[email protected] | 7e0d664a | 2009-12-03 21:07:47 | [diff] [blame] | 760 | 'Optimization': '<(win_debug_Optimization)', |
[email protected] | bb05e45 | 2009-10-29 21:24:56 | [diff] [blame] | 761 | 'PreprocessorDefinitions': ['_DEBUG'], |
[email protected] | 6b0507b | 2010-05-07 07:41:21 | [diff] [blame] | 762 | 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)', |
[email protected] | 7e0d664a | 2009-12-03 21:07:47 | [diff] [blame] | 763 | 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)', |
[email protected] | 2ae6e02 | 2010-05-07 13:19:15 | [diff] [blame] | 764 | 'conditions': [ |
| 765 | # According to MSVS, InlineFunctionExpansion=0 means |
| 766 | # "default inlining", not "/Ob0". |
| 767 | # Thus, we have to handle InlineFunctionExpansion==0 separately. |
| 768 | ['win_debug_InlineFunctionExpansion==0', { |
| 769 | 'AdditionalOptions': ['/Ob0'], |
| 770 | }], |
| 771 | ['win_debug_InlineFunctionExpansion!=""', { |
| 772 | 'InlineFunctionExpansion': |
| 773 | '<(win_debug_InlineFunctionExpansion)', |
| 774 | }], |
[email protected] | fac10d1 | 2010-11-08 16:00:31 | [diff] [blame] | 775 | ['win_debug_disable_iterator_debugging==1', { |
| 776 | 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'], |
| 777 | }], |
[email protected] | 2ae6e02 | 2010-05-07 13:19:15 | [diff] [blame] | 778 | ], |
[email protected] | bb05e45 | 2009-10-29 21:24:56 | [diff] [blame] | 779 | }, |
| 780 | 'VCLinkerTool': { |
| 781 | 'LinkIncremental': '<(msvs_debug_link_incremental)', |
| 782 | }, |
| 783 | 'VCResourceCompilerTool': { |
| 784 | 'PreprocessorDefinitions': ['_DEBUG'], |
| 785 | }, |
| 786 | }, |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 787 | 'conditions': [ |
[email protected] | bb05e45 | 2009-10-29 21:24:56 | [diff] [blame] | 788 | ['OS=="linux"', { |
| 789 | 'cflags': [ |
| 790 | '<@(debug_extra_cflags)', |
| 791 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 792 | }], |
| 793 | ], |
| 794 | }, |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 795 | 'Release_Base': { |
| 796 | 'abstract': 1, |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 797 | 'defines': [ |
| 798 | 'NDEBUG', |
| 799 | ], |
[email protected] | 1c96609 | 2009-08-20 21:19:26 | [diff] [blame] | 800 | 'xcode_settings': { |
| 801 | 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip |
| 802 | 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)', |
[email protected] | ffd984b1 | 2009-09-11 19:37:00 | [diff] [blame] | 803 | 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ], |
[email protected] | 1c96609 | 2009-08-20 21:19:26 | [diff] [blame] | 804 | }, |
[email protected] | bb05e45 | 2009-10-29 21:24:56 | [diff] [blame] | 805 | 'msvs_settings': { |
[email protected] | 7e0d664a | 2009-12-03 21:07:47 | [diff] [blame] | 806 | 'VCCLCompilerTool': { |
| 807 | 'Optimization': '<(win_release_Optimization)', |
| 808 | 'RuntimeLibrary': '<(win_release_RuntimeLibrary)', |
[email protected] | 2ae6e02 | 2010-05-07 13:19:15 | [diff] [blame] | 809 | 'conditions': [ |
| 810 | # According to MSVS, InlineFunctionExpansion=0 means |
| 811 | # "default inlining", not "/Ob0". |
| 812 | # Thus, we have to handle InlineFunctionExpansion==0 separately. |
| 813 | ['win_release_InlineFunctionExpansion==0', { |
| 814 | 'AdditionalOptions': ['/Ob0'], |
| 815 | }], |
| 816 | ['win_release_InlineFunctionExpansion!=""', { |
| 817 | 'InlineFunctionExpansion': |
| 818 | '<(win_release_InlineFunctionExpansion)', |
| 819 | }], |
| 820 | ], |
[email protected] | 7e0d664a | 2009-12-03 21:07:47 | [diff] [blame] | 821 | }, |
[email protected] | bb05e45 | 2009-10-29 21:24:56 | [diff] [blame] | 822 | 'VCLinkerTool': { |
| 823 | 'LinkIncremental': '1', |
| 824 | }, |
| 825 | }, |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 826 | 'conditions': [ |
[email protected] | 92822e8 | 2009-09-18 14:26:56 | [diff] [blame] | 827 | ['release_valgrind_build==0', { |
[email protected] | ee85751 | 2010-05-14 08:24:42 | [diff] [blame] | 828 | 'defines': ['NVALGRIND', 'DYNAMIC_ANNOTATIONS_ENABLED=0'], |
| 829 | }, { |
| 830 | 'defines': ['DYNAMIC_ANNOTATIONS_ENABLED=1'], |
[email protected] | 92822e8 | 2009-09-18 14:26:56 | [diff] [blame] | 831 | }], |
[email protected] | 7e0d664a | 2009-12-03 21:07:47 | [diff] [blame] | 832 | ['win_use_allocator_shim==0', { |
| 833 | 'defines': ['NO_TCMALLOC'], |
| 834 | }], |
[email protected] | bb05e45 | 2009-10-29 21:24:56 | [diff] [blame] | 835 | ['OS=="linux"', { |
| 836 | 'cflags': [ |
[email protected] | ffd984b1 | 2009-09-11 19:37:00 | [diff] [blame] | 837 | '<@(release_extra_cflags)', |
[email protected] | bb05e45 | 2009-10-29 21:24:56 | [diff] [blame] | 838 | ], |
| 839 | }], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 840 | ], |
| 841 | }, |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 842 | 'Purify_Base': { |
| 843 | 'abstract': 1, |
| 844 | 'defines': [ |
| 845 | 'PURIFY', |
| 846 | 'NO_TCMALLOC', |
| 847 | ], |
| 848 | 'msvs_settings': { |
| 849 | 'VCCLCompilerTool': { |
| 850 | 'Optimization': '0', |
| 851 | 'RuntimeLibrary': '0', |
| 852 | 'BufferSecurityCheck': 'false', |
| 853 | }, |
| 854 | 'VCLinkerTool': { |
| 855 | 'EnableCOMDATFolding': '1', |
| 856 | 'LinkIncremental': '1', |
| 857 | }, |
| 858 | }, |
| 859 | }, |
| 860 | # |
| 861 | # Concrete configurations |
| 862 | # |
| 863 | 'Debug': { |
| 864 | 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'], |
| 865 | }, |
| 866 | 'Release': { |
| 867 | 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'], |
| 868 | 'conditions': [ |
| 869 | ['msvs_use_common_release', { |
[email protected] | 1f9471a | 2010-01-04 06:40:16 | [diff] [blame] | 870 | 'includes': ['release.gypi'], |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 871 | }], |
| 872 | ] |
| 873 | }, |
[email protected] | f926fa0a | 2009-08-04 22:50:13 | [diff] [blame] | 874 | 'conditions': [ |
| 875 | [ 'OS=="win"', { |
| 876 | # TODO(bradnelson): add a gyp mechanism to make this more graceful. |
| 877 | 'Purify': { |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 878 | 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base', 'Purify'], |
[email protected] | ef4fa407 | 2009-12-04 22:46:50 | [diff] [blame] | 879 | }, |
| 880 | 'Debug_x64': { |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 881 | 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'], |
[email protected] | 78263c1 | 2009-11-01 23:45:30 | [diff] [blame] | 882 | }, |
| 883 | 'Release_x64': { |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 884 | 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'], |
[email protected] | 78263c1 | 2009-11-01 23:45:30 | [diff] [blame] | 885 | }, |
| 886 | 'Purify_x64': { |
[email protected] | 1f9471a | 2010-01-04 06:40:16 | [diff] [blame] | 887 | 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base', 'Purify_Base'], |
[email protected] | 78263c1 | 2009-11-01 23:45:30 | [diff] [blame] | 888 | }, |
[email protected] | f926fa0a | 2009-08-04 22:50:13 | [diff] [blame] | 889 | }], |
| 890 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 891 | }, |
| 892 | }, |
| 893 | 'conditions': [ |
[email protected] | 93f21e4 | 2010-04-01 00:35:15 | [diff] [blame] | 894 | ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { |
[email protected] | 9d38403 | 2009-03-20 23:13:26 | [diff] [blame] | 895 | 'target_defaults': { |
[email protected] | 5315f284 | 2009-04-28 00:43:27 | [diff] [blame] | 896 | # Enable -Werror by default, but put it in a variable so it can |
| 897 | # be disabled in ~/.gyp/include.gypi on the valgrind builders. |
| 898 | 'variables': { |
[email protected] | ecf52cb8 | 2010-01-13 19:25:42 | [diff] [blame] | 899 | # Use -fno-strict-aliasing by default since gcc 4.4 has periodic |
| 900 | # issues that slip through the cracks. We could do this just for |
| 901 | # gcc 4.4 but it makes more sense to be consistent on all |
| 902 | # compilers in use. TODO(Craig): turn this off again when |
| 903 | # there is some 4.4 test infrastructure in place and existing |
| 904 | # aliasing issues have been fixed. |
| 905 | 'no_strict_aliasing%': 1, |
[email protected] | 47deeb6 | 2009-12-17 14:49:39 | [diff] [blame] | 906 | 'conditions': [['OS=="linux"', {'werror%': '-Werror',}], |
| 907 | ['OS=="freebsd"', {'werror%': '',}], |
| 908 | ['OS=="openbsd"', {'werror%': '',}], |
| 909 | ], |
[email protected] | 5315f284 | 2009-04-28 00:43:27 | [diff] [blame] | 910 | }, |
[email protected] | 9d38403 | 2009-03-20 23:13:26 | [diff] [blame] | 911 | 'cflags': [ |
[email protected] | 1bba09c | 2009-08-13 12:53:16 | [diff] [blame] | 912 | '<(werror)', # See note above about the werror variable. |
| 913 | '-pthread', |
| 914 | '-fno-exceptions', |
| 915 | '-Wall', |
[email protected] | 0fa1708 | 2010-03-26 00:48:05 | [diff] [blame] | 916 | # TODO(evan): turn this back on once all the builds work. |
| 917 | # '-Wextra', |
[email protected] | 225c8f5 | 2010-02-05 22:23:20 | [diff] [blame] | 918 | # Don't warn about unused function params. We use those everywhere. |
| 919 | '-Wno-unused-parameter', |
| 920 | # Don't warn about the "struct foo f = {0};" initialization pattern. |
| 921 | '-Wno-missing-field-initializers', |
[email protected] | 1bba09c | 2009-08-13 12:53:16 | [diff] [blame] | 922 | '-D_FILE_OFFSET_BITS=64', |
[email protected] | 3df6e3a | 2010-01-21 20:23:12 | [diff] [blame] | 923 | # Don't export any symbols (for example, to plugins we dlopen()). |
| 924 | # Note: this is *required* to make some plugins work. |
| 925 | '-fvisibility=hidden', |
[email protected] | 7ca6ce1 | 2010-09-15 23:39:35 | [diff] [blame] | 926 | '-pipe', |
[email protected] | 8a2fcba | 2009-07-29 00:52:24 | [diff] [blame] | 927 | ], |
| 928 | 'cflags_cc': [ |
[email protected] | 832d021 | 2009-10-28 19:12:22 | [diff] [blame] | 929 | '-fno-rtti', |
[email protected] | 8a2fcba | 2009-07-29 00:52:24 | [diff] [blame] | 930 | '-fno-threadsafe-statics', |
[email protected] | f5986c4 | 2009-11-17 18:39:36 | [diff] [blame] | 931 | # Make inline functions have hidden visiblity by default. |
| 932 | # Surprisingly, not covered by -fvisibility=hidden. |
| 933 | '-fvisibility-inlines-hidden', |
[email protected] | 9d38403 | 2009-03-20 23:13:26 | [diff] [blame] | 934 | ], |
[email protected] | a6cf87e | 2009-04-03 04:07:38 | [diff] [blame] | 935 | 'ldflags': [ |
[email protected] | 138241f | 2010-03-30 23:53:10 | [diff] [blame] | 936 | '-pthread', '-Wl,-z,noexecstack', |
[email protected] | 9d38403 | 2009-03-20 23:13:26 | [diff] [blame] | 937 | ], |
[email protected] | 3aacaf95 | 2009-04-02 15:34:09 | [diff] [blame] | 938 | 'configurations': { |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 939 | 'Debug_Base': { |
[email protected] | c5bdc03 | 2009-04-20 19:11:31 | [diff] [blame] | 940 | 'variables': { |
| 941 | 'debug_optimize%': '0', |
| 942 | }, |
[email protected] | 3aacaf95 | 2009-04-02 15:34:09 | [diff] [blame] | 943 | 'defines': [ |
| 944 | '_DEBUG', |
| 945 | ], |
| 946 | 'cflags': [ |
[email protected] | 22898f6 | 2009-10-26 22:14:01 | [diff] [blame] | 947 | '-O>(debug_optimize)', |
[email protected] | 3aacaf95 | 2009-04-02 15:34:09 | [diff] [blame] | 948 | '-g', |
| 949 | ], |
[email protected] | 5315f284 | 2009-04-28 00:43:27 | [diff] [blame] | 950 | }, |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 951 | 'Release_Base': { |
[email protected] | 740e2de | 2009-07-21 11:41:01 | [diff] [blame] | 952 | 'variables': { |
| 953 | 'release_optimize%': '2', |
[email protected] | 1dd52964 | 2010-05-15 01:02:51 | [diff] [blame] | 954 | # Binaries become big and gold is unable to perform GC |
| 955 | # and remove unused sections for some of test targets |
| 956 | # on 32 bit platform. |
| 957 | # (This is currently observed only in chromeos valgrind bots) |
| 958 | # The following flag is to disable --gc-sections linker |
| 959 | # option for these bots. |
| 960 | 'no_gc_sections%': 0, |
[email protected] | 740e2de | 2009-07-21 11:41:01 | [diff] [blame] | 961 | }, |
[email protected] | 3aacaf95 | 2009-04-02 15:34:09 | [diff] [blame] | 962 | 'cflags': [ |
[email protected] | 22898f6 | 2009-10-26 22:14:01 | [diff] [blame] | 963 | '-O>(release_optimize)', |
[email protected] | d8cc3a6 | 2009-04-08 18:29:53 | [diff] [blame] | 964 | # Don't emit the GCC version ident directives, they just end up |
| 965 | # in the .comment section taking up binary size. |
| 966 | '-fno-ident', |
| 967 | # Put data and code in their own sections, so that unused symbols |
| 968 | # can be removed at link time with --gc-sections. |
| 969 | '-fdata-sections', |
| 970 | '-ffunction-sections', |
[email protected] | 3aacaf95 | 2009-04-02 15:34:09 | [diff] [blame] | 971 | ], |
[email protected] | c902f2c | 2010-08-06 20:04:18 | [diff] [blame] | 972 | 'ldflags': [ |
| 973 | # Specifically tell the linker to perform optimizations. |
| 974 | # See http://lwn.net/Articles/192624/ . |
| 975 | '-Wl,-O1', |
[email protected] | 27c2e49 | 2010-08-06 22:55:22 | [diff] [blame] | 976 | '-Wl,--as-needed', |
[email protected] | c902f2c | 2010-08-06 20:04:18 | [diff] [blame] | 977 | ], |
[email protected] | 1dd52964 | 2010-05-15 01:02:51 | [diff] [blame] | 978 | 'conditions' : [ |
| 979 | ['no_gc_sections==0', { |
| 980 | 'ldflags': [ |
| 981 | '-Wl,--gc-sections', |
| 982 | ], |
| 983 | }], |
[email protected] | ecf7b648 | 2010-10-13 09:15:20 | [diff] [blame] | 984 | ['clang==1', { |
| 985 | 'cflags!': [ |
| 986 | '-fno-ident', |
| 987 | ], |
| 988 | }], |
[email protected] | 1dd52964 | 2010-05-15 01:02:51 | [diff] [blame] | 989 | ] |
[email protected] | 3aacaf95 | 2009-04-02 15:34:09 | [diff] [blame] | 990 | }, |
| 991 | }, |
[email protected] | 601b54022 | 2009-04-03 21:32:04 | [diff] [blame] | 992 | 'variants': { |
| 993 | 'coverage': { |
| 994 | 'cflags': ['-fprofile-arcs', '-ftest-coverage'], |
| 995 | 'ldflags': ['-fprofile-arcs'], |
| 996 | }, |
| 997 | 'profile': { |
| 998 | 'cflags': ['-pg', '-g'], |
| 999 | 'ldflags': ['-pg'], |
| 1000 | }, |
| 1001 | 'symbols': { |
| 1002 | 'cflags': ['-g'], |
| 1003 | }, |
| 1004 | }, |
[email protected] | 606116d2 | 2009-05-06 22:38:23 | [diff] [blame] | 1005 | 'conditions': [ |
[email protected] | 7e8eb761 | 2009-07-29 15:56:00 | [diff] [blame] | 1006 | [ 'target_arch=="ia32"', { |
[email protected] | 606116d2 | 2009-05-06 22:38:23 | [diff] [blame] | 1007 | 'asflags': [ |
| 1008 | # Needed so that libs with .s files (e.g. libicudata.a) |
| 1009 | # are compatible with the general 32-bit-ness. |
| 1010 | '-32', |
| 1011 | ], |
| 1012 | # All floating-point computations on x87 happens in 80-bit |
| 1013 | # precision. Because the C and C++ language standards allow |
| 1014 | # the compiler to keep the floating-point values in higher |
| 1015 | # precision than what's specified in the source and doing so |
| 1016 | # is more efficient than constantly rounding up to 64-bit or |
| 1017 | # 32-bit precision as specified in the source, the compiler, |
| 1018 | # especially in the optimized mode, tries very hard to keep |
| 1019 | # values in x87 floating-point stack (in 80-bit precision) |
| 1020 | # as long as possible. This has important side effects, that |
| 1021 | # the real value used in computation may change depending on |
| 1022 | # how the compiler did the optimization - that is, the value |
| 1023 | # kept in 80-bit is different than the value rounded down to |
| 1024 | # 64-bit or 32-bit. There are possible compiler options to make |
| 1025 | # this behavior consistent (e.g. -ffloat-store would keep all |
| 1026 | # floating-values in the memory, thus force them to be rounded |
| 1027 | # to its original precision) but they have significant runtime |
| 1028 | # performance penalty. |
| 1029 | # |
| 1030 | # -mfpmath=sse -msse2 makes the compiler use SSE instructions |
| 1031 | # which keep floating-point values in SSE registers in its |
| 1032 | # native precision (32-bit for single precision, and 64-bit for |
| 1033 | # double precision values). This means the floating-point value |
| 1034 | # used during computation does not change depending on how the |
| 1035 | # compiler optimized the code, since the value is always kept |
| 1036 | # in its specified precision. |
[email protected] | ffde793 | 2009-05-29 00:39:06 | [diff] [blame] | 1037 | 'conditions': [ |
[email protected] | ac120ff | 2010-04-28 02:14:22 | [diff] [blame] | 1038 | ['branding=="Chromium" and disable_sse2==0', { |
[email protected] | ffde793 | 2009-05-29 00:39:06 | [diff] [blame] | 1039 | 'cflags': [ |
| 1040 | '-march=pentium4', |
| 1041 | '-msse2', |
| 1042 | '-mfpmath=sse', |
| 1043 | ], |
| 1044 | }], |
[email protected] | 06c75618 | 2010-04-27 18:31:31 | [diff] [blame] | 1045 | # ChromeOS targets Pinetrail, which is sse3, but most of the |
[email protected] | 0183dbb | 2010-04-16 02:00:44 | [diff] [blame] | 1046 | # benefit comes from sse2 so this setting allows ChromeOS |
| 1047 | # to build on other CPUs. In the future -march=atom would help |
| 1048 | # but requires a newer compiler. |
[email protected] | ac120ff | 2010-04-28 02:14:22 | [diff] [blame] | 1049 | ['chromeos==1 and disable_sse2==0', { |
[email protected] | 0183dbb | 2010-04-16 02:00:44 | [diff] [blame] | 1050 | 'cflags': [ |
| 1051 | '-msse2', |
| 1052 | ], |
| 1053 | }], |
[email protected] | 34799f9d | 2010-07-08 17:51:33 | [diff] [blame] | 1054 | # Install packages have started cropping up with |
| 1055 | # different headers between the 32-bit and 64-bit |
| 1056 | # versions, so we have to shadow those differences off |
| 1057 | # and make sure a 32-bit-on-64-bit build picks up the |
| 1058 | # right files. |
| 1059 | ['host_arch!="ia32"', { |
| 1060 | 'include_dirs+': [ |
| 1061 | '/usr/include32', |
| 1062 | ], |
| 1063 | }], |
[email protected] | ffde793 | 2009-05-29 00:39:06 | [diff] [blame] | 1064 | ], |
[email protected] | dc259ce5 | 2010-04-13 04:03:10 | [diff] [blame] | 1065 | # -mmmx allows mmintrin.h to be used for mmx intrinsics. |
| 1066 | # video playback is mmx and sse2 optimized. |
[email protected] | 606116d2 | 2009-05-06 22:38:23 | [diff] [blame] | 1067 | 'cflags': [ |
| 1068 | '-m32', |
[email protected] | dc259ce5 | 2010-04-13 04:03:10 | [diff] [blame] | 1069 | '-mmmx', |
[email protected] | 1c6560af | 2009-07-14 11:02:16 | [diff] [blame] | 1070 | ], |
[email protected] | 606116d2 | 2009-05-06 22:38:23 | [diff] [blame] | 1071 | 'ldflags': [ |
| 1072 | '-m32', |
| 1073 | ], |
| 1074 | }], |
[email protected] | 3dda8a96 | 2009-08-10 18:58:07 | [diff] [blame] | 1075 | ['target_arch=="arm"', { |
[email protected] | 77c1b2939 | 2009-12-04 06:21:29 | [diff] [blame] | 1076 | 'target_conditions': [ |
| 1077 | ['_toolset=="target"', { |
| 1078 | 'cflags_cc': [ |
| 1079 | # The codesourcery arm-2009q3 toolchain warns at that the ABI |
| 1080 | # has changed whenever it encounters a varargs function. This |
| 1081 | # silences those warnings, as they are not helpful and |
| 1082 | # clutter legitimate warnings. |
| 1083 | '-Wno-abi', |
| 1084 | ], |
| 1085 | 'conditions': [ |
| 1086 | ['arm_thumb == 1', { |
| 1087 | 'cflags': [ |
| 1088 | '-mthumb', |
| 1089 | # TODO(piman): -Wa,-mimplicit-it=thumb is needed for |
| 1090 | # inline assembly that uses condition codes but it's |
| 1091 | # suboptimal. Better would be to #ifdef __thumb__ at the |
| 1092 | # right place and have a separate thumb path. |
| 1093 | '-Wa,-mimplicit-it=thumb', |
| 1094 | ] |
| 1095 | }], |
| 1096 | ['armv7==1', { |
[email protected] | dc9711f | 2009-11-13 19:30:25 | [diff] [blame] | 1097 | 'cflags': [ |
| 1098 | '-march=armv7-a', |
| 1099 | '-mtune=cortex-a8', |
[email protected] | dc9711f | 2009-11-13 19:30:25 | [diff] [blame] | 1100 | '-mfloat-abi=softfp', |
| 1101 | ], |
[email protected] | eafc0b45 | 2010-02-26 21:53:43 | [diff] [blame] | 1102 | 'conditions': [ |
| 1103 | ['arm_neon==1', { |
| 1104 | 'cflags': [ '-mfpu=neon', ], |
| 1105 | }, { |
[email protected] | 53e0f64 | 2010-03-05 01:41:56 | [diff] [blame] | 1106 | 'cflags': [ '-mfpu=<(arm_fpu)', ], |
[email protected] | eafc0b45 | 2010-02-26 21:53:43 | [diff] [blame] | 1107 | }] |
| 1108 | ], |
[email protected] | dc9711f | 2009-11-13 19:30:25 | [diff] [blame] | 1109 | }], |
[email protected] | 3dda8a96 | 2009-08-10 18:58:07 | [diff] [blame] | 1110 | ], |
| 1111 | }], |
| 1112 | ], |
| 1113 | }], |
[email protected] | 2fb843b | 2010-08-12 02:11:08 | [diff] [blame] | 1114 | ['linux_fpic==1', { |
[email protected] | c76723a | 2010-01-25 23:10:58 | [diff] [blame] | 1115 | 'cflags': [ |
| 1116 | '-fPIC', |
| 1117 | ], |
| 1118 | }], |
[email protected] | ee28c9f | 2009-09-04 01:53:01 | [diff] [blame] | 1119 | ['sysroot!=""', { |
[email protected] | fd36ce82 | 2009-10-28 20:13:57 | [diff] [blame] | 1120 | 'target_conditions': [ |
| 1121 | ['_toolset=="target"', { |
| 1122 | 'cflags': [ |
| 1123 | '--sysroot=<(sysroot)', |
| 1124 | ], |
| 1125 | 'ldflags': [ |
| 1126 | '--sysroot=<(sysroot)', |
| 1127 | ], |
| 1128 | }]] |
[email protected] | ee28c9f | 2009-09-04 01:53:01 | [diff] [blame] | 1129 | }], |
[email protected] | 58680ce | 2010-09-18 00:09:15 | [diff] [blame] | 1130 | ['clang==1', { |
| 1131 | 'cflags': [ |
| 1132 | # Don't warn about unused variables, due to a common pattern: |
| 1133 | # scoped_deleter unused_variable(&thing_to_delete); |
| 1134 | '-Wno-unused-variable', |
| 1135 | # Clang spots more unused functions. |
| 1136 | '-Wno-unused-function', |
| 1137 | # gtest confuses clang. |
| 1138 | '-Wno-bool-conversions', |
| 1139 | # Don't die on dtoa code that uses a char as an array index. |
| 1140 | '-Wno-char-subscripts', |
[email protected] | 0fa0fbc | 2010-10-12 04:32:05 | [diff] [blame] | 1141 | # Survive EXPECT_EQ(unnamed_enum, unsigned int) -- see |
| 1142 | # http://code.google.com/p/googletest/source/detail?r=446 . |
| 1143 | # TODO(thakis): Use -isystem instead (http://crbug.com/58751 ). |
| 1144 | '-Wno-unnamed-type-template-args', |
[email protected] | 58680ce | 2010-09-18 00:09:15 | [diff] [blame] | 1145 | ], |
| 1146 | 'cflags!': [ |
| 1147 | # Clang doesn't seem to know know this flag. |
| 1148 | '-mfpmath=sse', |
| 1149 | ], |
| 1150 | }], |
[email protected] | cc4219a | 2009-08-14 05:30:52 | [diff] [blame] | 1151 | ['no_strict_aliasing==1', { |
| 1152 | 'cflags': [ |
| 1153 | '-fno-strict-aliasing', |
| 1154 | ], |
| 1155 | }], |
[email protected] | cbd5fd5 | 2009-08-26 00:14:27 | [diff] [blame] | 1156 | ['linux_breakpad==1', { |
[email protected] | c87efd4 | 2010-08-26 18:28:17 | [diff] [blame] | 1157 | 'cflags': [ '-g' ], |
[email protected] | cbd5fd5 | 2009-08-26 00:14:27 | [diff] [blame] | 1158 | 'defines': ['USE_LINUX_BREAKPAD'], |
| 1159 | }], |
[email protected] | 7cd2afd | 2009-10-27 21:40:26 | [diff] [blame] | 1160 | ['library=="shared_library"', { |
| 1161 | # When building with shared libraries, remove the visiblity-hiding |
| 1162 | # flag. |
| 1163 | 'cflags!': [ '-fvisibility=hidden' ], |
[email protected] | 2fb843b | 2010-08-12 02:11:08 | [diff] [blame] | 1164 | 'conditions': [ |
| 1165 | ['target_arch=="x64" or target_arch=="arm"', { |
| 1166 | # Shared libraries need -fPIC on x86-64 and arm |
| 1167 | 'cflags': ['-fPIC'] |
| 1168 | }] |
| 1169 | ], |
[email protected] | f192fa99 | 2010-12-08 00:45:29 | [diff] [blame] | 1170 | 'ldflags!': [ |
| 1171 | # --as-needed confuses library interdependencies. |
| 1172 | # See http://code.google.com/p/chromium/issues/detail?id=61430 |
| 1173 | '-Wl,--as-needed', |
| 1174 | ], |
[email protected] | 7cd2afd | 2009-10-27 21:40:26 | [diff] [blame] | 1175 | }], |
[email protected] | d8b6060 | 2010-03-26 09:41:22 | [diff] [blame] | 1176 | ['linux_use_heapchecker==1', { |
| 1177 | 'variables': {'linux_use_tcmalloc%': 1}, |
| 1178 | }], |
[email protected] | 61a9b2d8 | 2010-02-26 00:31:08 | [diff] [blame] | 1179 | ['linux_use_tcmalloc==0', { |
| 1180 | 'defines': ['NO_TCMALLOC'], |
[email protected] | 01699e2 | 2009-11-11 19:24:24 | [diff] [blame] | 1181 | }], |
[email protected] | d8b6060 | 2010-03-26 09:41:22 | [diff] [blame] | 1182 | ['linux_use_heapchecker==0', { |
| 1183 | 'defines': ['NO_HEAPCHECKER'], |
| 1184 | }], |
[email protected] | 64e2d4a4 | 2010-08-27 10:13:21 | [diff] [blame] | 1185 | ['linux_keep_shadow_stacks==1', { |
| 1186 | 'defines': ['KEEP_SHADOW_STACKS'], |
| 1187 | 'cflags': ['-finstrument-functions'], |
| 1188 | }], |
[email protected] | 606116d2 | 2009-05-06 22:38:23 | [diff] [blame] | 1189 | ], |
[email protected] | 9d38403 | 2009-03-20 23:13:26 | [diff] [blame] | 1190 | }, |
| 1191 | }], |
[email protected] | c51e8d5 | 2009-12-11 20:04:06 | [diff] [blame] | 1192 | # FreeBSD-specific options; note that most FreeBSD options are set above, |
| 1193 | # with Linux. |
| 1194 | ['OS=="freebsd"', { |
| 1195 | 'target_defaults': { |
| 1196 | 'ldflags': [ |
| 1197 | '-Wl,--no-keep-memory', |
| 1198 | ], |
| 1199 | }, |
| 1200 | }], |
[email protected] | 93f21e4 | 2010-04-01 00:35:15 | [diff] [blame] | 1201 | ['OS=="solaris"', { |
| 1202 | 'cflags!': ['-fvisibility=hidden'], |
| 1203 | 'cflags_cc!': ['-fvisibility-inlines-hidden'], |
| 1204 | }], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1205 | ['OS=="mac"', { |
| 1206 | 'target_defaults': { |
[email protected] | 2470064 | 2009-06-01 16:01:20 | [diff] [blame] | 1207 | 'variables': { |
[email protected] | 9a5e7286 | 2010-09-02 16:16:58 | [diff] [blame] | 1208 | # These should be 'mac_real_dsym%' and 'mac_strip%', but there |
| 1209 | # seems to be a bug with % in variables that are intended to be |
| 1210 | # set to different values in different targets, like these two. |
| 1211 | 'mac_strip': 1, # Strip debugging symbols from the target. |
[email protected] | 2470064 | 2009-06-01 16:01:20 | [diff] [blame] | 1212 | 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases. |
| 1213 | }, |
[email protected] | d92c7c01 | 2009-03-19 19:26:42 | [diff] [blame] | 1214 | 'mac_bundle': 0, |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1215 | 'xcode_settings': { |
| 1216 | 'ALWAYS_SEARCH_USER_PATHS': 'NO', |
[email protected] | ab295637 | 2009-08-13 18:11:04 | [diff] [blame] | 1217 | 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99 |
| 1218 | 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks |
| 1219 | 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic |
| 1220 | # (Equivalent to -fPIC) |
| 1221 | 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions |
| 1222 | 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti |
| 1223 | 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings |
[email protected] | 3224dcd | 2009-09-16 17:31:25 | [diff] [blame] | 1224 | # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden |
| 1225 | 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', |
[email protected] | ab295637 | 2009-08-13 18:11:04 | [diff] [blame] | 1226 | 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors |
| 1227 | 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden |
| 1228 | 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics |
| 1229 | 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1230 | 'GCC_VERSION': '4.2', |
[email protected] | ab295637 | 2009-08-13 18:11:04 | [diff] [blame] | 1231 | 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof |
[email protected] | 3224dcd | 2009-09-16 17:31:25 | [diff] [blame] | 1232 | # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min |
| 1233 | 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)', |
[email protected] | ab295637 | 2009-08-13 18:11:04 | [diff] [blame] | 1234 | 'PREBINDING': 'NO', # No -Wl,-prebind |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1235 | 'USE_HEADERMAP': 'NO', |
[email protected] | 080e86f | 2010-06-21 15:19:04 | [diff] [blame] | 1236 | 'WARNING_CFLAGS': [ |
| 1237 | '-Wall', |
| 1238 | '-Wendif-labels', |
| 1239 | '-Wextra', |
| 1240 | # Don't warn about unused function parameters. |
| 1241 | '-Wno-unused-parameter', |
| 1242 | # Don't warn about the "struct foo f = {0};" initialization |
| 1243 | # pattern. |
| 1244 | '-Wno-missing-field-initializers', |
| 1245 | ], |
[email protected] | b3fb809 | 2009-03-12 19:09:24 | [diff] [blame] | 1246 | 'conditions': [ |
| 1247 | ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'}, |
[email protected] | 9543af05 | 2009-09-15 22:42:59 | [diff] [blame] | 1248 | {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'} |
| 1249 | ], |
[email protected] | 6673317 | 2010-09-22 00:09:28 | [diff] [blame] | 1250 | ['clang==1', { |
| 1251 | 'WARNING_CFLAGS': [ |
| 1252 | # Don't die on dtoa code that uses a char as an array index. |
| 1253 | # This is required solely for base/third_party/dmg_fp/dtoa.cc. |
| 1254 | '-Wno-char-subscripts', |
[email protected] | 25d3bb72 | 2010-11-22 14:31:45 | [diff] [blame] | 1255 | # Clang spots more unused functions. |
| 1256 | '-Wno-unused-function', |
[email protected] | 0fa0fbc | 2010-10-12 04:32:05 | [diff] [blame] | 1257 | # Survive EXPECT_EQ(unnamed_enum, unsigned int) -- see |
| 1258 | # http://code.google.com/p/googletest/source/detail?r=446 . |
| 1259 | # TODO(thakis): Use -isystem instead (http://crbug.com/58751 ). |
| 1260 | '-Wno-unnamed-type-template-args', |
[email protected] | 6673317 | 2010-09-22 00:09:28 | [diff] [blame] | 1261 | ], |
| 1262 | }], |
[email protected] | b3fb809 | 2009-03-12 19:09:24 | [diff] [blame] | 1263 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1264 | }, |
| 1265 | 'target_conditions': [ |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1266 | ['_type!="static_library"', { |
[email protected] | 5d7dc97 | 2009-04-16 15:30:46 | [diff] [blame] | 1267 | 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']}, |
| 1268 | }], |
| 1269 | ['_mac_bundle', { |
| 1270 | 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']}, |
[email protected] | 87fde4a | 2009-02-28 00:50:08 | [diff] [blame] | 1271 | }], |
[email protected] | 9a5e7286 | 2010-09-02 16:16:58 | [diff] [blame] | 1272 | ['(_type=="executable" or _type=="shared_library" or \ |
| 1273 | _type=="loadable_module") and mac_strip!=0', { |
[email protected] | 2470064 | 2009-06-01 16:01:20 | [diff] [blame] | 1274 | 'target_conditions': [ |
| 1275 | ['mac_real_dsym == 1', { |
| 1276 | # To get a real .dSYM bundle produced by dsymutil, set the |
| 1277 | # debug information format to dwarf-with-dsym. Since |
| 1278 | # strip_from_xcode will not be used, set Xcode to do the |
| 1279 | # stripping as well. |
| 1280 | 'configurations': { |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 1281 | 'Release_Base': { |
[email protected] | 2470064 | 2009-06-01 16:01:20 | [diff] [blame] | 1282 | 'xcode_settings': { |
| 1283 | 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', |
| 1284 | 'DEPLOYMENT_POSTPROCESSING': 'YES', |
| 1285 | 'STRIP_INSTALLED_PRODUCT': 'YES', |
[email protected] | e14a9f9 | 2009-08-05 19:26:07 | [diff] [blame] | 1286 | 'target_conditions': [ |
[email protected] | c211142 | 2010-06-01 18:30:25 | [diff] [blame] | 1287 | ['_type=="shared_library" or _type=="loadable_module"', { |
[email protected] | e14a9f9 | 2009-08-05 19:26:07 | [diff] [blame] | 1288 | # The Xcode default is to strip debugging symbols |
| 1289 | # only (-S). Local symbols should be stripped as |
| 1290 | # well, which will be handled by -x. Xcode will |
| 1291 | # continue to insert -S when stripping even when |
| 1292 | # additional flags are added with STRIPFLAGS. |
| 1293 | 'STRIPFLAGS': '-x', |
[email protected] | c211142 | 2010-06-01 18:30:25 | [diff] [blame] | 1294 | }], # _type=="shared_library" or _type=="loadable_module"' |
[email protected] | e14a9f9 | 2009-08-05 19:26:07 | [diff] [blame] | 1295 | ], # target_conditions |
| 1296 | }, # xcode_settings |
| 1297 | }, # configuration "Release" |
| 1298 | }, # configurations |
[email protected] | 2470064 | 2009-06-01 16:01:20 | [diff] [blame] | 1299 | }, { # mac_real_dsym != 1 |
| 1300 | # To get a fast fake .dSYM bundle, use a post-build step to |
| 1301 | # produce the .dSYM and strip the executable. strip_from_xcode |
| 1302 | # only operates in the Release configuration. |
| 1303 | 'postbuilds': [ |
| 1304 | { |
| 1305 | 'variables': { |
| 1306 | # Define strip_from_xcode in a variable ending in _path |
| 1307 | # so that gyp understands it's a path and performs proper |
| 1308 | # relativization during dict merging. |
| 1309 | 'strip_from_xcode_path': 'mac/strip_from_xcode', |
| 1310 | }, |
| 1311 | 'postbuild_name': 'Strip If Needed', |
| 1312 | 'action': ['<(strip_from_xcode_path)'], |
| 1313 | }, |
[email protected] | e14a9f9 | 2009-08-05 19:26:07 | [diff] [blame] | 1314 | ], # postbuilds |
| 1315 | }], # mac_real_dsym |
| 1316 | ], # target_conditions |
[email protected] | 9a5e7286 | 2010-09-02 16:16:58 | [diff] [blame] | 1317 | }], # (_type=="executable" or _type=="shared_library" or |
| 1318 | # _type=="loadable_module") and mac_strip!=0 |
[email protected] | e14a9f9 | 2009-08-05 19:26:07 | [diff] [blame] | 1319 | ], # target_conditions |
| 1320 | }, # target_defaults |
| 1321 | }], # OS=="mac" |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1322 | ['OS=="win"', { |
| 1323 | 'target_defaults': { |
| 1324 | 'defines': [ |
| 1325 | '_WIN32_WINNT=0x0600', |
| 1326 | 'WINVER=0x0600', |
| 1327 | 'WIN32', |
| 1328 | '_WINDOWS', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1329 | 'NOMINMAX', |
| 1330 | '_CRT_RAND_S', |
| 1331 | 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS', |
| 1332 | 'WIN32_LEAN_AND_MEAN', |
| 1333 | '_SECURE_ATL', |
[email protected] | 7a812dd6 | 2010-06-30 18:52:27 | [diff] [blame] | 1334 | '_ATL_NO_OPENGL', |
[email protected] | adfb98c | 2009-06-23 20:08:45 | [diff] [blame] | 1335 | '_HAS_TR1=0', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1336 | ], |
[email protected] | 8974e04 | 2010-06-21 18:06:52 | [diff] [blame] | 1337 | 'conditions': [ |
| 1338 | ['component=="static_library"', { |
| 1339 | 'defines': [ |
| 1340 | '_HAS_EXCEPTIONS=0', |
| 1341 | ], |
| 1342 | }], |
| 1343 | ], |
[email protected] | 5b5ca7cb | 2009-07-20 23:00:20 | [diff] [blame] | 1344 | 'msvs_system_include_dirs': [ |
[email protected] | 998b515 | 2009-12-12 22:19:52 | [diff] [blame] | 1345 | '<(DEPTH)/third_party/platformsdk_win7/files/Include', |
[email protected] | a78da50e | 2010-06-09 21:31:37 | [diff] [blame] | 1346 | '<(DEPTH)/third_party/directxsdk/files/Include', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1347 | '$(VSInstallDir)/VC/atlmfc/include', |
| 1348 | ], |
[email protected] | a8d99cef | 2009-08-26 20:47:49 | [diff] [blame] | 1349 | 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'], |
[email protected] | 365632b | 2010-06-22 02:01:57 | [diff] [blame] | 1350 | 'msvs_disabled_warnings': [4351, 4396, 4503, 4819], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1351 | 'msvs_settings': { |
| 1352 | 'VCCLCompilerTool': { |
| 1353 | 'MinimalRebuild': 'false', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1354 | 'BufferSecurityCheck': 'true', |
| 1355 | 'EnableFunctionLevelLinking': 'true', |
| 1356 | 'RuntimeTypeInfo': 'false', |
| 1357 | 'WarningLevel': '3', |
| 1358 | 'WarnAsError': 'true', |
| 1359 | 'DebugInformationFormat': '3', |
[email protected] | 3fef6e6 | 2009-07-31 19:58:58 | [diff] [blame] | 1360 | 'conditions': [ |
[email protected] | 912c55c | 2009-07-31 23:33:55 | [diff] [blame] | 1361 | [ 'msvs_multi_core_compile', { |
[email protected] | 1f9471a | 2010-01-04 06:40:16 | [diff] [blame] | 1362 | 'AdditionalOptions': ['/MP'], |
[email protected] | 912c55c | 2009-07-31 23:33:55 | [diff] [blame] | 1363 | }], |
[email protected] | 8974e04 | 2010-06-21 18:06:52 | [diff] [blame] | 1364 | ['component=="shared_library"', { |
| 1365 | 'ExceptionHandling': '1', # /EHsc |
| 1366 | }, { |
| 1367 | 'ExceptionHandling': '0', |
| 1368 | }], |
[email protected] | 3fef6e6 | 2009-07-31 19:58:58 | [diff] [blame] | 1369 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1370 | }, |
| 1371 | 'VCLibrarianTool': { |
[email protected] | 1f9471a | 2010-01-04 06:40:16 | [diff] [blame] | 1372 | 'AdditionalOptions': ['/ignore:4221'], |
[email protected] | a78da50e | 2010-06-09 21:31:37 | [diff] [blame] | 1373 | 'AdditionalLibraryDirectories': [ |
| 1374 | '<(DEPTH)/third_party/platformsdk_win7/files/Lib', |
| 1375 | '<(DEPTH)/third_party/directxsdk/files/Lib/x86', |
| 1376 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1377 | }, |
| 1378 | 'VCLinkerTool': { |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1379 | 'AdditionalDependencies': [ |
| 1380 | 'wininet.lib', |
| 1381 | 'version.lib', |
| 1382 | 'msimg32.lib', |
| 1383 | 'ws2_32.lib', |
| 1384 | 'usp10.lib', |
| 1385 | 'psapi.lib', |
[email protected] | 96fd003 | 2009-04-24 00:13:08 | [diff] [blame] | 1386 | 'dbghelp.lib', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1387 | ], |
[email protected] | a78da50e | 2010-06-09 21:31:37 | [diff] [blame] | 1388 | 'AdditionalLibraryDirectories': [ |
| 1389 | '<(DEPTH)/third_party/platformsdk_win7/files/Lib', |
| 1390 | '<(DEPTH)/third_party/directxsdk/files/Lib/x86', |
| 1391 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1392 | 'GenerateDebugInformation': 'true', |
| 1393 | 'MapFileName': '$(OutDir)\\$(TargetName).map', |
| 1394 | 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1395 | 'FixedBaseAddress': '1', |
[email protected] | 825ff8d | 2009-05-22 01:40:48 | [diff] [blame] | 1396 | # SubSystem values: |
| 1397 | # 0 == not set |
| 1398 | # 1 == /SUBSYSTEM:CONSOLE |
| 1399 | # 2 == /SUBSYSTEM:WINDOWS |
| 1400 | # Most of the executables we'll ever create are tests |
| 1401 | # and utilities with console output. |
| 1402 | 'SubSystem': '1', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1403 | }, |
| 1404 | 'VCMIDLTool': { |
| 1405 | 'GenerateStublessProxies': 'true', |
| 1406 | 'TypeLibraryName': '$(InputName).tlb', |
| 1407 | 'OutputDirectory': '$(IntDir)', |
| 1408 | 'HeaderFileName': '$(InputName).h', |
| 1409 | 'DLLDataFileName': 'dlldata.c', |
| 1410 | 'InterfaceIdentifierFileName': '$(InputName)_i.c', |
| 1411 | 'ProxyFileName': '$(InputName)_p.c', |
| 1412 | }, |
| 1413 | 'VCResourceCompilerTool': { |
| 1414 | 'Culture' : '1033', |
[email protected] | 4d91cbc | 2010-05-07 20:41:38 | [diff] [blame] | 1415 | 'AdditionalIncludeDirectories': [ |
| 1416 | '<(DEPTH)', |
| 1417 | '<(SHARED_INTERMEDIATE_DIR)', |
| 1418 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1419 | }, |
| 1420 | }, |
| 1421 | }, |
| 1422 | }], |
[email protected] | 93f21e4 | 2010-04-01 00:35:15 | [diff] [blame] | 1423 | ['disable_nacl==1 or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { |
[email protected] | d8c7cbcc | 2009-10-02 19:00:31 | [diff] [blame] | 1424 | 'target_defaults': { |
| 1425 | 'defines': [ |
| 1426 | 'DISABLE_NACL', |
| 1427 | ], |
| 1428 | }, |
| 1429 | }], |
[email protected] | cfbf9bc | 2009-12-07 22:07:56 | [diff] [blame] | 1430 | ['OS=="win" and msvs_use_common_linker_extras', { |
[email protected] | 48c7af7 | 2009-07-03 22:00:19 | [diff] [blame] | 1431 | 'target_defaults': { |
| 1432 | 'msvs_settings': { |
| 1433 | 'VCLinkerTool': { |
[email protected] | 48c7af7 | 2009-07-03 22:00:19 | [diff] [blame] | 1434 | 'DelayLoadDLLs': [ |
| 1435 | 'dbghelp.dll', |
| 1436 | 'dwmapi.dll', |
| 1437 | 'uxtheme.dll', |
| 1438 | ], |
| 1439 | }, |
| 1440 | }, |
[email protected] | ef4fa407 | 2009-12-04 22:46:50 | [diff] [blame] | 1441 | 'configurations': { |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 1442 | 'x86_Base': { |
[email protected] | ef4fa407 | 2009-12-04 22:46:50 | [diff] [blame] | 1443 | 'msvs_settings': { |
| 1444 | 'VCLinkerTool': { |
[email protected] | 1f9471a | 2010-01-04 06:40:16 | [diff] [blame] | 1445 | 'AdditionalOptions': [ |
| 1446 | '/safeseh', |
| 1447 | '/dynamicbase', |
| 1448 | '/ignore:4199', |
| 1449 | '/ignore:4221', |
| 1450 | '/nxcompat', |
| 1451 | ], |
[email protected] | ef4fa407 | 2009-12-04 22:46:50 | [diff] [blame] | 1452 | }, |
| 1453 | }, |
| 1454 | }, |
[email protected] | 5153767c | 2009-12-22 01:52:50 | [diff] [blame] | 1455 | 'x64_Base': { |
[email protected] | ef4fa407 | 2009-12-04 22:46:50 | [diff] [blame] | 1456 | 'msvs_settings': { |
| 1457 | 'VCLinkerTool': { |
[email protected] | 1f9471a | 2010-01-04 06:40:16 | [diff] [blame] | 1458 | 'AdditionalOptions': [ |
[email protected] | ef4fa407 | 2009-12-04 22:46:50 | [diff] [blame] | 1459 | # safeseh is not compatible with x64 |
[email protected] | 1f9471a | 2010-01-04 06:40:16 | [diff] [blame] | 1460 | '/dynamicbase', |
| 1461 | '/ignore:4199', |
| 1462 | '/ignore:4221', |
| 1463 | '/nxcompat', |
| 1464 | ], |
[email protected] | ef4fa407 | 2009-12-04 22:46:50 | [diff] [blame] | 1465 | }, |
| 1466 | }, |
| 1467 | }, |
| 1468 | }, |
[email protected] | 48c7af7 | 2009-07-03 22:00:19 | [diff] [blame] | 1469 | }, |
| 1470 | }], |
[email protected] | 9821d0d | 2010-04-16 22:40:37 | [diff] [blame] | 1471 | ['enable_new_npdevice_api==1', { |
| 1472 | 'target_defaults': { |
| 1473 | 'defines': [ |
| 1474 | 'ENABLE_NEW_NPDEVICE_API', |
| 1475 | ], |
| 1476 | }, |
| 1477 | }], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1478 | ], |
| 1479 | 'xcode_settings': { |
[email protected] | 0c8ab45 | 2009-11-06 21:57:50 | [diff] [blame] | 1480 | # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT! |
| 1481 | # This block adds *project-wide* configuration settings to each project |
| 1482 | # file. It's almost always wrong to put things here. Specify your |
| 1483 | # custom xcode_settings in target_defaults to add them to targets instead. |
| 1484 | |
| 1485 | # In an Xcode Project Info window, the "Base SDK for All Configurations" |
| 1486 | # setting sets the SDK on a project-wide basis. In order to get the |
| 1487 | # configured SDK to show properly in the Xcode UI, SDKROOT must be set |
| 1488 | # here at the project level. |
| 1489 | 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot |
| 1490 | |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1491 | # The Xcode generator will look for an xcode_settings section at the root |
| 1492 | # of each dict and use it to apply settings on a file-wide basis. Most |
| 1493 | # settings should not be here, they should be in target-specific |
| 1494 | # xcode_settings sections, or better yet, should use non-Xcode-specific |
| 1495 | # settings in target dicts. SYMROOT is a special case, because many other |
| 1496 | # Xcode variables depend on it, including variables such as |
| 1497 | # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something |
| 1498 | # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the |
| 1499 | # files to appear (when present) in the UI as actual files and not red |
| 1500 | # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, |
| 1501 | # and therefore SYMROOT, needs to be set at the project level. |
[email protected] | bfa24b96 | 2009-03-02 00:16:16 | [diff] [blame] | 1502 | 'SYMROOT': '<(DEPTH)/xcodebuild', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1503 | }, |
[email protected] | ee28c9f | 2009-09-04 01:53:01 | [diff] [blame] | 1504 | } |
[email protected] | f5c990c | 2009-10-06 03:02:38 | [diff] [blame] | 1505 | |
| 1506 | # Local Variables: |
| 1507 | # tab-width:2 |
| 1508 | # indent-tabs-mode:nil |
| 1509 | # End: |
| 1510 | # vim: set expandtab tabstop=2 shiftwidth=2: |