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