Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1 | # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 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. |
| 8 | { |
| 9 | # Variables expected to be overriden on the GYP command line (-D) or by |
| 10 | # ~/.gyp/include.gypi. |
| 11 | 'variables': { |
| 12 | # Putting a variables dict inside another variables dict looks kind of |
| 13 | # weird. This is done so that 'host_arch', 'chromeos', etc are defined as |
| 14 | # variables within the outer variables dict here. This is necessary |
| 15 | # to get these variables defined for the conditions within this variables |
| 16 | # dict that operate on these variables. |
| 17 | 'variables': { |
| 18 | 'variables': { |
| 19 | 'variables': { |
| 20 | 'variables': { |
| 21 | # Whether we're building a ChromeOS build. |
| 22 | 'chromeos%': 0, |
| 23 | |
| 24 | # Whether or not we are using the Aura windowing framework. |
| 25 | 'use_aura%': 0, |
| 26 | |
| 27 | # Whether or not we are building the Ash shell. |
| 28 | 'use_ash%': 0, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 29 | |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 30 | # Whether or not we are using CRAS, the ChromeOS Audio Server. |
| 31 | 'use_cras%': 0, |
| 32 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 33 | # Use a raw surface abstraction. |
| 34 | 'use_ozone%': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 35 | }, |
| 36 | # Copy conditionally-set variables out one scope. |
| 37 | 'chromeos%': '<(chromeos)', |
| 38 | 'use_aura%': '<(use_aura)', |
| 39 | 'use_ash%': '<(use_ash)', |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 40 | 'use_cras%': '<(use_cras)', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 41 | 'use_ozone%': '<(use_ozone)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 42 | |
| 43 | # Whether we are using Views Toolkit |
| 44 | 'toolkit_views%': 0, |
| 45 | |
| 46 | # Use OpenSSL instead of NSS. Under development: see http://crbug.com/62803 |
| 47 | 'use_openssl%': 0, |
| 48 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 49 | # Disable viewport meta tag by default. |
| 50 | 'enable_viewport%': 0, |
| 51 | |
| 52 | # Enable HiDPI support. |
| 53 | 'enable_hidpi%': 0, |
| 54 | |
| 55 | # Enable touch optimized art assets and metrics. |
| 56 | 'enable_touch_ui%': 0, |
| 57 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 58 | # Override buildtype to select the desired build flavor. |
| 59 | # Dev - everyday build for development/testing |
| 60 | # Official - release build (generally implies additional processing) |
| 61 | # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp |
| 62 | # conversion is done), some of the things which are now controlled by |
| 63 | # 'branding', such as symbol generation, will need to be refactored |
| 64 | # based on 'buildtype' (i.e. we don't care about saving symbols for |
| 65 | # non-Official # builds). |
| 66 | 'buildtype%': 'Dev', |
| 67 | |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 68 | # Override branding to select the desired branding flavor. |
| 69 | 'branding%': 'Chromium', |
| 70 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 71 | 'conditions': [ |
| 72 | # ChromeOS implies ash. |
| 73 | ['chromeos==1', { |
| 74 | 'use_ash%': 1, |
| 75 | 'use_aura%': 1, |
| 76 | }], |
| 77 | |
| 78 | # For now, Windows builds that |use_aura| should also imply using |
| 79 | # ash. This rule should be removed for the future when Windows is |
| 80 | # using the aura windows without the ash interface. |
| 81 | ['use_aura==1 and OS=="win"', { |
| 82 | 'use_ash%': 1, |
| 83 | }], |
| 84 | ['use_ash==1', { |
| 85 | 'use_aura%': 1, |
| 86 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 87 | |
| 88 | # Compute the architecture that we're building on. |
| 89 | ['OS=="win" or OS=="mac" or OS=="ios"', { |
| 90 | 'host_arch%': 'ia32', |
| 91 | }, { |
| 92 | # This handles the Unix platforms for which there is some support. |
| 93 | # Anything else gets passed through, which probably won't work |
| 94 | # very well; such hosts should pass an explicit target_arch to |
| 95 | # gyp. |
| 96 | 'host_arch%': |
| 97 | '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/")', |
| 98 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 99 | ], |
| 100 | }, |
| 101 | # Copy conditionally-set variables out one scope. |
| 102 | 'chromeos%': '<(chromeos)', |
| 103 | 'use_aura%': '<(use_aura)', |
| 104 | 'use_ash%': '<(use_ash)', |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 105 | 'use_cras%': '<(use_cras)', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 106 | 'use_ozone%': '<(use_ozone)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 107 | 'use_openssl%': '<(use_openssl)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 108 | 'enable_viewport%': '<(enable_viewport)', |
| 109 | 'enable_hidpi%': '<(enable_hidpi)', |
| 110 | 'enable_touch_ui%': '<(enable_touch_ui)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 111 | 'buildtype%': '<(buildtype)', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 112 | 'branding%': '<(branding)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 113 | 'host_arch%': '<(host_arch)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 114 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 115 | # Default architecture we're building for is the architecture we're |
| 116 | # building on. |
| 117 | 'target_arch%': '<(host_arch)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 118 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 119 | # This is set when building the Android WebView inside the Android |
| 120 | # build system, using the 'android' gyp backend. The WebView code is |
| 121 | # still built when this is unset, but builds using the normal chromium |
| 122 | # build system. |
| 123 | 'android_webview_build%': 0, |
| 124 | |
| 125 | # Sets whether chrome is built for google tv device. |
| 126 | 'google_tv%': 0, |
| 127 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 128 | # Set ARM architecture version. |
| 129 | 'arm_version%': 7, |
| 130 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 131 | 'conditions': [ |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 132 | # Set default value of toolkit_views based on OS. |
| 133 | ['OS=="win" or chromeos==1 or use_aura==1', { |
| 134 | 'toolkit_views%': 1, |
| 135 | }, { |
| 136 | 'toolkit_views%': 0, |
| 137 | }], |
| 138 | |
| 139 | # Set toolkit_uses_gtk for the Chromium browser on Linux. |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 140 | ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_aura==0 and use_ozone==0', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 141 | 'toolkit_uses_gtk%': 1, |
| 142 | }, { |
| 143 | 'toolkit_uses_gtk%': 0, |
| 144 | }], |
| 145 | |
| 146 | # Enable HiDPI on Mac OS and Chrome OS. |
| 147 | ['OS=="mac" or chromeos==1', { |
| 148 | 'enable_hidpi%': 1, |
| 149 | }], |
| 150 | |
| 151 | # Enable touch UI on Metro. |
| 152 | ['OS=="win"', { |
| 153 | 'enable_touch_ui%': 1, |
| 154 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 155 | |
| 156 | # Enable App Launcher only on ChromeOS, Windows and OSX. |
| 157 | ['use_ash==1 or OS=="win" or OS=="mac"', { |
| 158 | 'enable_app_list%': 1, |
| 159 | }, { |
| 160 | 'enable_app_list%': 0, |
| 161 | }], |
| 162 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 163 | ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', { |
| 164 | 'use_default_render_theme%': 1, |
| 165 | }, { |
| 166 | 'use_default_render_theme%': 0, |
| 167 | }], |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 168 | |
| 169 | # TODO(thestig) Remove the linux_lsb_release check after all the |
| 170 | # official Ubuntu Lucid builder are gone. |
| 171 | ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', { |
| 172 | 'linux_lsb_release%': '<!(lsb_release -r -s)', |
| 173 | }, { |
| 174 | 'linux_lsb_release%': '', |
| 175 | }], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0 |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 176 | ], |
| 177 | }, |
| 178 | |
| 179 | # Copy conditionally-set variables out one scope. |
| 180 | 'chromeos%': '<(chromeos)', |
| 181 | 'host_arch%': '<(host_arch)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 182 | 'target_arch%': '<(target_arch)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 183 | 'toolkit_views%': '<(toolkit_views)', |
| 184 | 'toolkit_uses_gtk%': '<(toolkit_uses_gtk)', |
| 185 | 'use_aura%': '<(use_aura)', |
| 186 | 'use_ash%': '<(use_ash)', |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 187 | 'use_cras%': '<(use_cras)', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 188 | 'use_ozone%': '<(use_ozone)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 189 | 'use_openssl%': '<(use_openssl)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 190 | 'enable_viewport%': '<(enable_viewport)', |
| 191 | 'enable_hidpi%': '<(enable_hidpi)', |
| 192 | 'enable_touch_ui%': '<(enable_touch_ui)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 193 | 'android_webview_build%': '<(android_webview_build)', |
| 194 | 'google_tv%': '<(google_tv)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 195 | 'enable_app_list%': '<(enable_app_list)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 196 | 'use_default_render_theme%': '<(use_default_render_theme)', |
| 197 | 'buildtype%': '<(buildtype)', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 198 | 'branding%': '<(branding)', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 199 | 'arm_version%': '<(arm_version)', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 200 | 'linux_lsb_release%': '<(linux_lsb_release)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 201 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 202 | # Set to 1 to enable fast builds. Set to 2 for even faster builds |
| 203 | # (it disables debug info for fastest compilation - only for use |
| 204 | # on compile-only bots). |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 205 | 'fastbuild%': 0, |
| 206 | |
| 207 | # Set to 1 to enable dcheck in release without having to use the flag. |
| 208 | 'dcheck_always_on%': 0, |
| 209 | |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 210 | # Set to 1 to make a build that logs like an official build, but is not |
| 211 | # necessarily an official build, ie DCHECK and DLOG are disabled and |
| 212 | # removed completely in release builds, to minimize binary footprint. |
| 213 | # Note: this setting is ignored if buildtype=="Official". |
| 214 | 'logging_like_official_build%': 0, |
| 215 | |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 216 | # Set to 1 to make a build that disables unshipped tracing events. |
| 217 | # Note: this setting is ignored if buildtype=="Official". |
| 218 | 'tracing_like_official_build%': 0, |
| 219 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 220 | # Disable file manager component extension by default. |
| 221 | 'file_manager_extension%': 0, |
| 222 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 223 | # Disable image loader component extension by default. |
| 224 | 'image_loader_extension%': 0, |
| 225 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 226 | # Python version. |
| 227 | 'python_ver%': '2.6', |
| 228 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 229 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 230 | # Set NEON compilation flags. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 231 | 'arm_neon%': 1, |
| 232 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 233 | # Detect NEON support at run-time. |
| 234 | 'arm_neon_optional%': 0, |
| 235 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 236 | # The system root for cross-compiles. Default: none. |
| 237 | 'sysroot%': '', |
| 238 | |
| 239 | # The system libdir used for this ABI. |
| 240 | 'system_libdir%': 'lib', |
| 241 | |
| 242 | # On Linux, we build with sse2 for Chromium builds. |
| 243 | 'disable_sse2%': 0, |
| 244 | |
| 245 | # Use libjpeg-turbo as the JPEG codec used by Chromium. |
| 246 | 'use_libjpeg_turbo%': 1, |
| 247 | |
| 248 | # Use system libjpeg. Note that the system's libjepg will be used even if |
| 249 | # use_libjpeg_turbo is set. |
| 250 | 'use_system_libjpeg%': 0, |
| 251 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 252 | # By default, component is set to static_library and it can be overriden |
| 253 | # by the GYP command line or by ~/.gyp/include.gypi. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 254 | 'component%': 'static_library', |
| 255 | |
| 256 | # Set to select the Title Case versions of strings in GRD files. |
| 257 | 'use_titlecase_in_grd_files%': 0, |
| 258 | |
| 259 | # Use translations provided by volunteers at launchpad.net. This |
| 260 | # currently only works on Linux. |
| 261 | 'use_third_party_translations%': 0, |
| 262 | |
| 263 | # Remoting compilation is enabled by default. Set to 0 to disable. |
| 264 | 'remoting%': 1, |
| 265 | |
| 266 | # Configuration policy is enabled by default. Set to 0 to disable. |
| 267 | 'configuration_policy%': 1, |
| 268 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 269 | # Variable safe_browsing is used to control the build time configuration |
| 270 | # for safe browsing feature. Safe browsing can be compiled in 3 different |
| 271 | # levels: 0 disables it, 1 enables it fully, and 2 enables only UI and |
| 272 | # reporting features without enabling phishing and malware detection. This |
| 273 | # is useful to integrate a third party phishing/malware detection to |
| 274 | # existing safe browsing logic. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 275 | 'safe_browsing%': 1, |
| 276 | |
| 277 | # Speech input is compiled in by default. Set to 0 to disable. |
| 278 | 'input_speech%': 1, |
| 279 | |
| 280 | # Notifications are compiled in by default. Set to 0 to disable. |
| 281 | 'notifications%' : 1, |
| 282 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 283 | # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for |
| 284 | # regular builds and 1 for ASan builds. |
| 285 | 'mac_want_real_dsym%': 'default', |
| 286 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 287 | # If this is set, the clang plugins used on the buildbot will be used. |
| 288 | # Run tools/clang/scripts/update.sh to make sure they are compiled. |
| 289 | # This causes 'clang_chrome_plugins_flags' to be set. |
| 290 | # Has no effect if 'clang' is not set as well. |
| 291 | 'clang_use_chrome_plugins%': 1, |
| 292 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 293 | # Enable building with ASAN (Clang's -fsanitize=address option). |
| 294 | # -fsanitize=address only works with clang, but asan=1 implies clang=1 |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 295 | # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer |
| 296 | 'asan%': 0, |
| 297 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 298 | # Enable building with LSan (Clang's -fsanitize=leak option). |
| 299 | # -fsanitize=leak only works with clang, but lsan=1 implies clang=1 |
| 300 | # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer |
| 301 | 'lsan%': 0, |
| 302 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 303 | # Enable building with TSAN (Clang's -fsanitize=thread option). |
| 304 | # -fsanitize=thread only works with clang, but tsan=1 implies clang=1 |
| 305 | # See http://clang.llvm.org/docs/ThreadSanitizer.html |
| 306 | 'tsan%': 0, |
| 307 | 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/valgrind/tsan_v2/ignores.txt', |
| 308 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 309 | # Enable building with MSAN (Clang's -fsanitize=memory option). |
| 310 | # MemorySanitizer only works with clang, but msan=1 implies clang=1 |
| 311 | # See http://clang.llvm.org/docs/MemorySanitizer.html |
| 312 | 'msan%': 0, |
| 313 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 314 | # Use a modified version of Clang to intercept allocated types and sizes |
| 315 | # for allocated objects. clang_type_profiler=1 implies clang=1. |
| 316 | # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier |
| 317 | # TODO(dmikurube): Support mac. See http://crbug.com/123758#c11 |
| 318 | 'clang_type_profiler%': 0, |
| 319 | |
| 320 | # Set to true to instrument the code with function call logger. |
| 321 | # See src/third_party/cygprofile/cyg-profile.cc for details. |
| 322 | 'order_profiling%': 0, |
| 323 | |
| 324 | # Use the provided profiled order file to link Chrome image with it. |
| 325 | # This makes Chrome faster by better using CPU cache when executing code. |
| 326 | # This is known as PGO (profile guided optimization). |
| 327 | # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort |
| 328 | 'order_text_section%' : "", |
| 329 | |
| 330 | # Set to 1 compile with -fPIC cflag on linux. This is a must for shared |
| 331 | # libraries on linux x86-64 and arm, plus ASLR. |
| 332 | 'linux_fpic%': 1, |
| 333 | |
| 334 | # Whether one-click signin is enabled or not. |
| 335 | 'enable_one_click_signin%': 0, |
| 336 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 337 | # Enable Chrome browser extensions |
| 338 | 'enable_extensions%': 1, |
| 339 | |
| 340 | # Enable browser automation. |
| 341 | 'enable_automation%': 1, |
| 342 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 343 | # Enable Google Now. |
| 344 | 'enable_google_now%': 1, |
| 345 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 346 | # Enable printing support and UI. |
| 347 | 'enable_printing%': 1, |
| 348 | |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 349 | # Enable spell checker. |
| 350 | 'enable_spellcheck%': 1, |
| 351 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 352 | # Webrtc compilation is enabled by default. Set to 0 to disable. |
| 353 | 'enable_webrtc%': 1, |
| 354 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 355 | # Enables use of the session service, which is enabled by default. |
| 356 | # Support for disabling depends on the platform. |
| 357 | 'enable_session_service%': 1, |
| 358 | |
| 359 | # Enables theme support, which is enabled by default. Support for |
| 360 | # disabling depends on the platform. |
| 361 | 'enable_themes%': 1, |
| 362 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 363 | # Enables autofill dialog and associated features; disabled by default. |
| 364 | 'enable_autofill_dialog%' : 0, |
| 365 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 366 | # Enables support for background apps. |
| 367 | 'enable_background%': 1, |
| 368 | |
| 369 | # Enable the task manager by default. |
| 370 | 'enable_task_manager%': 1, |
| 371 | |
| 372 | # Enable FTP support by default. |
| 373 | 'disable_ftp_support%': 0, |
| 374 | |
| 375 | # XInput2 multitouch support is disabled by default (use_xi2_mt=0). |
| 376 | # Setting to non-zero value enables XI2 MT. When XI2 MT is enabled, |
| 377 | # the input value also defines the required XI2 minor minimum version. |
| 378 | # For example, use_xi2_mt=2 means XI2.2 or above version is required. |
| 379 | 'use_xi2_mt%': 0, |
| 380 | |
| 381 | # Use of precompiled headers on Windows. |
| 382 | # |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 383 | # This variable may be explicitly set to 1 (enabled) or 0 |
| 384 | # (disabled) in ~/.gyp/include.gypi or via the GYP command line. |
| 385 | # This setting will override the default. |
| 386 | # |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 387 | # See |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 388 | # http://code.google.com/p/chromium/wiki/WindowsPrecompiledHeaders |
| 389 | # for details. |
| 390 | 'chromium_win_pch%': 0, |
| 391 | |
| 392 | # Set this to true when building with Clang. |
| 393 | # See http://code.google.com/p/chromium/wiki/Clang for details. |
| 394 | 'clang%': 0, |
| 395 | |
| 396 | # Enable plug-in installation by default. |
| 397 | 'enable_plugin_installation%': 1, |
| 398 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 399 | # Enable PPAPI and NPAPI by default. |
| 400 | # TODO(nileshagrawal): Make this flag enable/disable NPAPI as well |
| 401 | # as PPAPI; see crbug.com/162667. |
| 402 | 'enable_plugins%': 1, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 403 | |
| 404 | # Specifies whether to use canvas_skia.cc in place of platform |
| 405 | # specific implementations of gfx::Canvas. Affects text drawing in the |
| 406 | # Chrome UI. |
| 407 | # TODO(asvitkine): Enable this on all platforms and delete this flag. |
| 408 | # http://crbug.com/105550 |
| 409 | 'use_canvas_skia%': 0, |
| 410 | |
| 411 | # Set to "tsan", "memcheck", or "drmemory" to configure the build to work |
| 412 | # with one of those tools. |
| 413 | 'build_for_tool%': '', |
| 414 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 415 | # If no directory is specified then a temporary directory will be used. |
| 416 | 'test_isolation_outdir%': '', |
| 417 | # True if isolate should fail if the isolate files refer to files |
| 418 | # that are missing. |
| 419 | 'test_isolation_fail_on_missing': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 420 | |
| 421 | 'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86', |
| 422 | 'wix_path%': '<(DEPTH)/third_party/wix', |
| 423 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 424 | # Managed users are enabled by default. |
| 425 | 'enable_managed_users%': 1, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 426 | |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 427 | # Platform natively supports discardable memory. |
| 428 | 'native_discardable_memory%': 0, |
| 429 | |
| 430 | # Platform sends memory pressure signals natively. |
| 431 | 'native_memory_pressure_signals%': 0, |
| 432 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 433 | 'spdy_proxy_auth_origin%' : '', |
| 434 | 'spdy_proxy_auth_property%' : '', |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 435 | 'spdy_proxy_auth_value%' : '', |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 436 | 'enable_mdns%' : 0, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 437 | |
| 438 | 'conditions': [ |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 439 | # A flag for POSIX platforms |
| 440 | ['OS=="win"', { |
| 441 | 'os_posix%': 0, |
| 442 | }, { |
| 443 | 'os_posix%': 1, |
| 444 | }], |
| 445 | |
| 446 | # A flag for BSD platforms |
| 447 | ['OS=="freebsd" or OS=="openbsd"', { |
| 448 | 'os_bsd%': 1, |
| 449 | }, { |
| 450 | 'os_bsd%': 0, |
| 451 | }], |
| 452 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 453 | # Set armv7 for backward compatibility. |
| 454 | ['arm_version==7', { |
| 455 | 'armv7': 1, |
| 456 | }, { |
| 457 | 'armv7': 0, |
| 458 | }], |
| 459 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 460 | # NSS usage. |
| 461 | ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', { |
| 462 | 'use_nss%': 1, |
| 463 | }, { |
| 464 | 'use_nss%': 0, |
| 465 | }], |
| 466 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 467 | # Flags to use X11 on non-Mac POSIX platforms. |
| 468 | ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 469 | 'use_x11%': 0, |
| 470 | }, { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 471 | 'use_x11%': 1, |
| 472 | }], |
| 473 | |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 474 | # Flags to use pango and glib on non-Mac POSIX platforms. |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 475 | ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android"', { |
| 476 | 'use_glib%': 0, |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 477 | 'use_pango%': 0, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 478 | }, { |
| 479 | 'use_glib%': 1, |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 480 | 'use_pango%': 1, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 481 | }], |
| 482 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 483 | # We always use skia text rendering in Aura on Windows, since GDI |
| 484 | # doesn't agree with our BackingStore. |
| 485 | # TODO(beng): remove once skia text rendering is on by default. |
| 486 | ['use_aura==1 and OS=="win"', { |
| 487 | 'enable_skia_text%': 1, |
| 488 | }], |
| 489 | |
| 490 | # A flag to enable or disable our compile-time dependency |
| 491 | # on gnome-keyring. If that dependency is disabled, no gnome-keyring |
| 492 | # support will be available. This option is useful |
| 493 | # for Linux distributions and for Aura. |
| 494 | ['chromeos==1 or use_aura==1', { |
| 495 | 'use_gnome_keyring%': 0, |
| 496 | }, { |
| 497 | 'use_gnome_keyring%': 1, |
| 498 | }], |
| 499 | |
| 500 | ['toolkit_uses_gtk==1 or OS=="mac" or OS=="ios"', { |
| 501 | # GTK+, Mac and iOS want Title Case strings |
| 502 | 'use_titlecase_in_grd_files%': 1, |
| 503 | }], |
| 504 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 505 | # Enable file manager and image loader extensions on Chrome OS. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 506 | ['chromeos==1', { |
| 507 | 'file_manager_extension%': 1, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 508 | 'image_loader_extension%': 1, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 509 | }, { |
| 510 | 'file_manager_extension%': 0, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 511 | 'image_loader_extension%': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 512 | }], |
| 513 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 514 | ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 515 | 'enable_one_click_signin%': 1, |
| 516 | }], |
| 517 | |
| 518 | ['OS=="android"', { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 519 | 'enable_automation%': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 520 | 'enable_extensions%': 0, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 521 | 'enable_google_now%': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 522 | 'enable_printing%': 0, |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 523 | 'enable_spellcheck%': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 524 | 'enable_themes%': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 525 | 'proprietary_codecs%': 1, |
| 526 | 'remoting%': 0, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 527 | 'arm_neon%': 0, |
| 528 | 'arm_neon_optional%': 1, |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 529 | 'native_discardable_memory%': 1, |
| 530 | 'native_memory_pressure_signals%': 1, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 531 | }], |
| 532 | |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 533 | # Enable autofill dialog for Mac and Views-enabled platforms for now. |
| 534 | ['toolkit_views==1 or OS=="mac"', { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 535 | 'enable_autofill_dialog%': 1 |
| 536 | }], |
| 537 | |
| 538 | ['OS=="android" and android_webview_build==0', { |
| 539 | 'enable_webrtc%': 1, |
| 540 | }], |
| 541 | |
| 542 | # Disable WebRTC for building WebView as part of Android system. |
| 543 | # TODO(boliu): Decide if we want WebRTC, and if so, also merge |
| 544 | # the necessary third_party repositories. |
| 545 | ['OS=="android" and android_webview_build==1', { |
| 546 | 'enable_webrtc%': 0, |
| 547 | }], |
| 548 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 549 | ['OS=="ios"', { |
| 550 | 'configuration_policy%': 0, |
| 551 | 'disable_ftp_support%': 1, |
| 552 | 'enable_automation%': 0, |
| 553 | 'enable_extensions%': 0, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 554 | 'enable_google_now%': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 555 | 'enable_printing%': 0, |
| 556 | 'enable_session_service%': 0, |
| 557 | 'enable_themes%': 0, |
| 558 | 'enable_webrtc%': 0, |
| 559 | 'notifications%': 0, |
| 560 | 'remoting%': 0, |
| 561 | 'safe_browsing%': 0, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 562 | 'enable_managed_users%': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 563 | }], |
| 564 | |
| 565 | # Use GPU accelerated cross process image transport by default |
| 566 | # on linux builds with the Aura window manager |
| 567 | ['use_aura==1 and OS=="linux"', { |
| 568 | 'ui_compositor_image_transport%': 1, |
| 569 | }, { |
| 570 | 'ui_compositor_image_transport%': 0, |
| 571 | }], |
| 572 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 573 | # Turn precompiled headers on by default. |
| 574 | ['OS=="win" and buildtype!="Official"', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 575 | 'chromium_win_pch%': 1 |
| 576 | }], |
| 577 | |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 578 | ['chromeos==1 or OS=="android" or OS=="ios"', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 579 | 'enable_plugin_installation%': 0, |
| 580 | }, { |
| 581 | 'enable_plugin_installation%': 1, |
| 582 | }], |
| 583 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 584 | ['(OS=="android" and google_tv!=1) or OS=="ios"', { |
| 585 | 'enable_plugins%': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 586 | }, { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 587 | 'enable_plugins%': 1, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 588 | }], |
| 589 | |
| 590 | # linux_use_gold_binary: whether to use the binary checked into |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 591 | # third_party/gold. Gold is not used for 32-bit linux builds |
| 592 | # as it runs out of address space. |
| 593 | ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 594 | 'linux_use_gold_binary%': 1, |
| 595 | }, { |
| 596 | 'linux_use_gold_binary%': 0, |
| 597 | }], |
| 598 | |
| 599 | # linux_use_gold_flags: whether to use build flags that rely on gold. |
| 600 | # On by default for x64 Linux. Temporarily off for ChromeOS as |
| 601 | # it failed on a buildbot. |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 602 | ['OS=="linux" and target_arch=="x64" and chromeos==0', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 603 | 'linux_use_gold_flags%': 1, |
| 604 | }, { |
| 605 | 'linux_use_gold_flags%': 0, |
| 606 | }], |
| 607 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 608 | ['chromeos==1', { |
| 609 | 'linux_use_libgps%': 1, |
| 610 | }, { # chromeos==0 |
| 611 | # Do not use libgps on desktop Linux by default, |
| 612 | # see http://crbug.com/103751. |
| 613 | 'linux_use_libgps%': 0, |
| 614 | }], |
| 615 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 616 | ['OS=="android" or OS=="ios"', { |
| 617 | 'enable_captive_portal_detection%': 0, |
| 618 | }, { |
| 619 | 'enable_captive_portal_detection%': 1, |
| 620 | }], |
| 621 | |
| 622 | # Enable Skia UI text drawing incrementally on different platforms. |
| 623 | # http://crbug.com/105550 |
| 624 | # |
| 625 | # On Aura, this allows per-tile painting to be used in the browser |
| 626 | # compositor. |
| 627 | ['OS!="mac" and OS!="android"', { |
| 628 | 'use_canvas_skia%': 1, |
| 629 | }], |
| 630 | |
| 631 | ['chromeos==1', { |
| 632 | # When building for ChromeOS we dont want Chromium to use libjpeg_turbo. |
| 633 | 'use_libjpeg_turbo%': 0, |
| 634 | }], |
| 635 | |
| 636 | ['OS=="android"', { |
| 637 | # When building as part of the Android system, use system libraries |
| 638 | # where possible to reduce ROM size. |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 639 | 'use_system_libjpeg%': '<(android_webview_build)', |
| 640 | }], |
| 641 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 642 | # Do not enable the Settings App on ChromeOS. |
| 643 | ['enable_app_list==1 and chromeos==0', { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 644 | 'enable_settings_app%': 1, |
| 645 | }, { |
| 646 | 'enable_settings_app%': 0, |
| 647 | }], |
| 648 | |
| 649 | ['OS=="linux" and target_arch=="arm" and chromeos==0', { |
| 650 | # Set some defaults for arm/linux chrome builds |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 651 | 'linux_use_tcmalloc%': 0, |
| 652 | # sysroot needs to be an absolute path otherwise it generates |
| 653 | # incorrect results when passed to pkg-config |
| 654 | 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot', |
| 655 | }], # OS=="linux" and target_arch=="arm" and chromeos==0 |
| 656 | |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 657 | ['linux_lsb_release=="12.04"', { |
| 658 | 'conditions': [ |
| 659 | ['target_arch=="x64"', { |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 660 | 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 661 | }], |
| 662 | ['target_arch=="ia32"', { |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 663 | 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 664 | }], |
| 665 | ], |
| 666 | }], # linux_lsb_release=="12.04" |
| 667 | |
Ben Murdoch | 3c54152 | 2013-06-28 19:54:20 +0100 | [diff] [blame] | 668 | ['OS=="linux" and target_arch=="mipsel"', { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 669 | 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot', |
| 670 | 'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc', |
| 671 | }], |
| 672 | |
| 673 | # Whether tests targets should be run, archived or just have the |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 674 | # dependencies verified. All the tests targets have the '_run' suffix, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 675 | # e.g. base_unittests_run runs the target base_unittests. The test |
| 676 | # target always calls tools/swarm_client/isolate.py. See the script's |
| 677 | # --help for more information and the valid --mode values. Meant to be |
| 678 | # overriden with GYP_DEFINES. |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 679 | # TODO(maruel): Remove the conditions as more configurations are |
| 680 | # supported. |
| 681 | # TODO(csharp): Remove OS!="mac" once xcode can run the isolate code |
| 682 | # again. |
| 683 | # NOTE: The check for disable_nacl==0 and component=="static_library" |
| 684 | # can't be used here because these variables are not defined yet, but it |
| 685 | # is still not supported. |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 686 | ['OS!="mac" and OS!="ios" and OS!="android" and chromeos==0', { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 687 | 'test_isolation_mode%': 'check', |
| 688 | }, { |
| 689 | 'test_isolation_mode%': 'noop', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 690 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 691 | # Whether Android ARM build uses OpenMAX DL FFT. |
| 692 | ['OS=="android" and target_arch=="arm" and android_webview_build==0', { |
| 693 | # Currently only supported on Android ARM, without webview. |
| 694 | # When enabled, this will also enable WebAudio on Android |
| 695 | # ARM. Default is enabled. |
| 696 | 'use_openmax_dl_fft%': 1, |
| 697 | }, { |
| 698 | 'use_openmax_dl_fft%': 0, |
| 699 | }], |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 700 | ['OS=="win" or OS=="linux"', { |
| 701 | 'enable_mdns%' : 1, |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 702 | }], |
| 703 | |
| 704 | # Turns on compiler optimizations in V8 in Debug build, except |
| 705 | # on android_clang, where we're hitting a weird linker error. |
| 706 | # TODO(dpranke): http://crbug.com/266155 . |
| 707 | ['OS=="android"', { |
| 708 | 'v8_optimized_debug': 1, |
| 709 | }, { |
| 710 | 'v8_optimized_debug': 2, |
| 711 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 712 | ], |
| 713 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 714 | # Set this to 1 to enable use of concatenated impulse responses |
| 715 | # for the HRTF panner in WebAudio. |
| 716 | 'use_concatenated_impulse_responses': 1, |
| 717 | |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 718 | # You can set the variable 'use_official_google_api_keys' to 1 |
| 719 | # to use the Google-internal file containing official API keys |
| 720 | # for Google Chrome even in a developer build. Setting this |
| 721 | # variable explicitly to 1 will cause your build to fail if the |
| 722 | # internal file is missing. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 723 | # |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 724 | # The variable is documented here, but not handled in this file; |
| 725 | # see //google_apis/determine_use_official_keys.gypi for the |
| 726 | # implementation. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 727 | # |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 728 | # Set the variable to 0 to not use the internal file, even when |
| 729 | # it exists in your checkout. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 730 | # |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 731 | # Leave it unset in your include.gypi to have the variable |
| 732 | # implicitly set to 1 if you have |
| 733 | # src/google_apis/internal/google_chrome_api_keys.h in your |
| 734 | # checkout, and implicitly set to 0 if not. |
| 735 | # |
| 736 | # Note that official builds always behave as if the variable |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 737 | # was explicitly set to 1, i.e. they always use official keys, |
| 738 | # and will fail to build if the internal file is missing. |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 739 | # |
| 740 | # NOTE: You MUST NOT explicitly set the variable to 2 in your |
| 741 | # include.gypi or by other means. Due to subtleties of GYP, this |
| 742 | # is not the same as leaving the variable unset, even though its |
| 743 | # default value in |
| 744 | # //google_apis/determine_use_official_keys.gypi is 2. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 745 | |
| 746 | # Set these to bake the specified API keys and OAuth client |
| 747 | # IDs/secrets into your build. |
| 748 | # |
| 749 | # If you create a build without values baked in, you can instead |
| 750 | # set environment variables to provide the keys at runtime (see |
| 751 | # src/google_apis/google_api_keys.h for details). Features that |
| 752 | # require server-side APIs may fail to work if no keys are |
| 753 | # provided. |
| 754 | # |
| 755 | # Note that if you are building an official build or if |
| 756 | # use_official_google_api_keys has been set to 1 (explicitly or |
| 757 | # implicitly), these values will be ignored and the official |
| 758 | # keys will be used instead. |
| 759 | 'google_api_key%': '', |
| 760 | 'google_default_client_id%': '', |
| 761 | 'google_default_client_secret%': '', |
| 762 | }, |
| 763 | |
| 764 | # Copy conditionally-set variables out one scope. |
| 765 | 'branding%': '<(branding)', |
| 766 | 'buildtype%': '<(buildtype)', |
| 767 | 'target_arch%': '<(target_arch)', |
| 768 | 'host_arch%': '<(host_arch)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 769 | 'toolkit_views%': '<(toolkit_views)', |
| 770 | 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)', |
| 771 | 'use_aura%': '<(use_aura)', |
| 772 | 'use_ash%': '<(use_ash)', |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 773 | 'use_cras%': '<(use_cras)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 774 | 'use_openssl%': '<(use_openssl)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 775 | 'use_nss%': '<(use_nss)', |
| 776 | 'os_bsd%': '<(os_bsd)', |
| 777 | 'os_posix%': '<(os_posix)', |
| 778 | 'use_glib%': '<(use_glib)', |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 779 | 'use_pango%': '<(use_pango)', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 780 | 'use_ozone%': '<(use_ozone)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 781 | 'toolkit_uses_gtk%': '<(toolkit_uses_gtk)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 782 | 'use_x11%': '<(use_x11)', |
| 783 | 'use_gnome_keyring%': '<(use_gnome_keyring)', |
| 784 | 'linux_fpic%': '<(linux_fpic)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 785 | 'chromeos%': '<(chromeos)', |
| 786 | 'enable_viewport%': '<(enable_viewport)', |
| 787 | 'enable_hidpi%': '<(enable_hidpi)', |
| 788 | 'enable_touch_ui%': '<(enable_touch_ui)', |
| 789 | 'use_xi2_mt%':'<(use_xi2_mt)', |
| 790 | 'file_manager_extension%': '<(file_manager_extension)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 791 | 'image_loader_extension%': '<(image_loader_extension)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 792 | 'fastbuild%': '<(fastbuild)', |
| 793 | 'dcheck_always_on%': '<(dcheck_always_on)', |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 794 | 'logging_like_official_build%': '<(logging_like_official_build)', |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 795 | 'tracing_like_official_build%': '<(tracing_like_official_build)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 796 | 'python_ver%': '<(python_ver)', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 797 | 'arm_version%': '<(arm_version)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 798 | 'armv7%': '<(armv7)', |
| 799 | 'arm_neon%': '<(arm_neon)', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 800 | 'arm_neon_optional%': '<(arm_neon_optional)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 801 | 'sysroot%': '<(sysroot)', |
| 802 | 'system_libdir%': '<(system_libdir)', |
| 803 | 'component%': '<(component)', |
| 804 | 'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)', |
| 805 | 'use_third_party_translations%': '<(use_third_party_translations)', |
| 806 | 'remoting%': '<(remoting)', |
| 807 | 'enable_one_click_signin%': '<(enable_one_click_signin)', |
| 808 | 'enable_webrtc%': '<(enable_webrtc)', |
| 809 | 'chromium_win_pch%': '<(chromium_win_pch)', |
| 810 | 'configuration_policy%': '<(configuration_policy)', |
| 811 | 'safe_browsing%': '<(safe_browsing)', |
| 812 | 'input_speech%': '<(input_speech)', |
| 813 | 'notifications%': '<(notifications)', |
| 814 | 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 815 | 'mac_want_real_dsym%': '<(mac_want_real_dsym)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 816 | 'asan%': '<(asan)', |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 817 | 'lsan%': '<(lsan)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 818 | 'msan%': '<(msan)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 819 | 'tsan%': '<(tsan)', |
| 820 | 'tsan_blacklist%': '<(tsan_blacklist)', |
| 821 | 'clang_type_profiler%': '<(clang_type_profiler)', |
| 822 | 'order_profiling%': '<(order_profiling)', |
| 823 | 'order_text_section%': '<(order_text_section)', |
| 824 | 'enable_extensions%': '<(enable_extensions)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 825 | 'enable_plugin_installation%': '<(enable_plugin_installation)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 826 | 'enable_plugins%': '<(enable_plugins)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 827 | 'enable_session_service%': '<(enable_session_service)', |
| 828 | 'enable_themes%': '<(enable_themes)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 829 | 'enable_autofill_dialog%': '<(enable_autofill_dialog)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 830 | 'enable_background%': '<(enable_background)', |
| 831 | 'linux_use_gold_binary%': '<(linux_use_gold_binary)', |
| 832 | 'linux_use_gold_flags%': '<(linux_use_gold_flags)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 833 | 'linux_use_libgps%': '<(linux_use_libgps)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 834 | 'use_canvas_skia%': '<(use_canvas_skia)', |
| 835 | 'test_isolation_mode%': '<(test_isolation_mode)', |
| 836 | 'test_isolation_outdir%': '<(test_isolation_outdir)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 837 | 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 838 | 'enable_automation%': '<(enable_automation)', |
| 839 | 'enable_printing%': '<(enable_printing)', |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 840 | 'enable_spellcheck%': '<(enable_spellcheck)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 841 | 'enable_google_now%': '<(enable_google_now)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 842 | 'enable_captive_portal_detection%': '<(enable_captive_portal_detection)', |
| 843 | 'disable_ftp_support%': '<(disable_ftp_support)', |
| 844 | 'enable_task_manager%': '<(enable_task_manager)', |
| 845 | 'sas_dll_path%': '<(sas_dll_path)', |
| 846 | 'wix_path%': '<(wix_path)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 847 | 'use_libjpeg_turbo%': '<(use_libjpeg_turbo)', |
| 848 | 'use_system_libjpeg%': '<(use_system_libjpeg)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 849 | 'android_webview_build%': '<(android_webview_build)', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 850 | 'gyp_managed_install%': 0, |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 851 | 'create_standalone_apk%': 1, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 852 | 'google_tv%': '<(google_tv)', |
| 853 | 'enable_app_list%': '<(enable_app_list)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 854 | 'use_default_render_theme%': '<(use_default_render_theme)', |
| 855 | 'enable_settings_app%': '<(enable_settings_app)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 856 | 'google_api_key%': '<(google_api_key)', |
| 857 | 'google_default_client_id%': '<(google_default_client_id)', |
| 858 | 'google_default_client_secret%': '<(google_default_client_secret)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 859 | 'enable_managed_users%': '<(enable_managed_users)', |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 860 | 'native_discardable_memory%': '<(native_discardable_memory)', |
| 861 | 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 862 | 'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)', |
| 863 | 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)', |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 864 | 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)', |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 865 | 'enable_mdns%' : '<(enable_mdns)', |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 866 | 'v8_optimized_debug': '<(v8_optimized_debug)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 867 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 868 | # Use system nspr instead of the bundled one. |
| 869 | 'use_system_nspr%': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 870 | |
| 871 | # Use system protobuf instead of bundled one. |
| 872 | 'use_system_protobuf%': 0, |
| 873 | |
| 874 | # Use system yasm instead of bundled one. |
| 875 | 'use_system_yasm%': 0, |
| 876 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 877 | # Use system ICU instead of bundled one. |
| 878 | 'use_system_icu%' : 0, |
| 879 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 880 | # Default to enabled PIE; this is important for ASLR but we may need to be |
| 881 | # able to turn it off for various reasons. |
| 882 | 'linux_disable_pie%': 0, |
| 883 | |
| 884 | # The release channel that this build targets. This is used to restrict |
| 885 | # channel-specific build options, like which installer packages to create. |
| 886 | # The default is 'all', which does no channel-specific filtering. |
| 887 | 'channel%': 'all', |
| 888 | |
| 889 | # Override chromium_mac_pch and set it to 0 to suppress the use of |
| 890 | # precompiled headers on the Mac. Prefix header injection may still be |
| 891 | # used, but prefix headers will not be precompiled. This is useful when |
| 892 | # using distcc to distribute a build to compile slaves that don't |
| 893 | # share the same compiler executable as the system driving the compilation, |
| 894 | # because precompiled headers rely on pointers into a specific compiler |
| 895 | # executable's image. Setting this to 0 is needed to use an experimental |
| 896 | # Linux-Mac cross compiler distcc farm. |
| 897 | 'chromium_mac_pch%': 1, |
| 898 | |
| 899 | # The default value for mac_strip in target_defaults. This cannot be |
| 900 | # set there, per the comment about variable% in a target_defaults. |
| 901 | 'mac_strip_release%': 1, |
| 902 | |
| 903 | # Set to 1 to enable code coverage. In addition to build changes |
| 904 | # (e.g. extra CFLAGS), also creates a new target in the src/chrome |
| 905 | # project file called "coverage". |
| 906 | # Currently ignored on Windows. |
| 907 | 'coverage%': 0, |
| 908 | |
| 909 | # Set to 1 to force Visual C++ to use legacy debug information format /Z7. |
| 910 | # This is useful for parallel compilation tools which can't support /Zi. |
| 911 | # Only used on Windows. |
| 912 | 'win_z7%' : 0, |
| 913 | |
| 914 | # Although base/allocator lets you select a heap library via an |
| 915 | # environment variable, the libcmt shim it uses sometimes gets in |
| 916 | # the way. To disable it entirely, and switch to normal msvcrt, do e.g. |
| 917 | # 'win_use_allocator_shim': 0, |
| 918 | # 'win_release_RuntimeLibrary': 2 |
| 919 | # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build. |
| 920 | 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt |
| 921 | |
| 922 | # Whether usage of OpenMAX is enabled. |
| 923 | 'enable_openmax%': 0, |
| 924 | |
| 925 | # Whether proprietary audio/video codecs are assumed to be included with |
| 926 | # this build (only meaningful if branding!=Chrome). |
| 927 | 'proprietary_codecs%': 0, |
| 928 | |
| 929 | # TODO(bradnelson): eliminate this when possible. |
| 930 | # To allow local gyp files to prevent release.vsprops from being included. |
| 931 | # Yes(1) means include release.vsprops. |
| 932 | # Once all vsprops settings are migrated into gyp, this can go away. |
| 933 | 'msvs_use_common_release%': 1, |
| 934 | |
| 935 | # TODO(bradnelson): eliminate this when possible. |
| 936 | # To allow local gyp files to override additional linker options for msvs. |
| 937 | # Yes(1) means set use the common linker options. |
| 938 | 'msvs_use_common_linker_extras%': 1, |
| 939 | |
| 940 | # TODO(sgk): eliminate this if possible. |
| 941 | # It would be nicer to support this via a setting in 'target_defaults' |
| 942 | # in chrome/app/locales/locales.gypi overriding the setting in the |
| 943 | # 'Debug' configuration in the 'target_defaults' dict below, |
| 944 | # but that doesn't work as we'd like. |
| 945 | 'msvs_debug_link_incremental%': '2', |
| 946 | |
| 947 | # Needed for some of the largest modules. |
| 948 | 'msvs_debug_link_nonincremental%': '1', |
| 949 | |
| 950 | # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows |
| 951 | # to get incremental linking to be faster in debug builds. |
| 952 | 'incremental_chrome_dll%': '0', |
| 953 | |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 954 | # Experimental setting to break chrome.dll into multiple pieces based on |
| 955 | # process type. |
| 956 | 'chrome_multiple_dll%': '0', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 957 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 958 | # The default settings for third party code for treating |
| 959 | # warnings-as-errors. Ideally, this would not be required, however there |
| 960 | # is some third party code that takes a long time to fix/roll. So, this |
| 961 | # flag allows us to have warnings as errors in general to prevent |
| 962 | # regressions in most modules, while working on the bits that are |
| 963 | # remaining. |
| 964 | 'win_third_party_warn_as_error%': 'true', |
| 965 | |
| 966 | # This is the location of the sandbox binary. Chrome looks for this before |
| 967 | # running the zygote process. If found, and SUID, it will be used to |
| 968 | # sandbox the zygote process and, thus, all renderer processes. |
| 969 | 'linux_sandbox_path%': '', |
| 970 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 971 | # Clang stuff. |
| 972 | 'clang%': '<(clang)', |
| 973 | 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts', |
| 974 | |
| 975 | # These two variables can be set in GYP_DEFINES while running |
| 976 | # |gclient runhooks| to let clang run a plugin in every compilation. |
| 977 | # Only has an effect if 'clang=1' is in GYP_DEFINES as well. |
| 978 | # Example: |
| 979 | # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks |
| 980 | |
| 981 | 'clang_load%': '', |
| 982 | 'clang_add_plugin%': '', |
| 983 | |
| 984 | # The default type of gtest. |
| 985 | 'gtest_target_type%': 'executable', |
| 986 | |
| 987 | # Enable sampling based profiler. |
| 988 | # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html |
| 989 | 'profiling%': '0', |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 990 | # Profile without optimizing out stack frames when profiling==1. |
| 991 | 'profiling_full_stack_frames%': '0', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 992 | |
| 993 | # Enable strict glibc debug mode. |
| 994 | 'glibcxx_debug%': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 995 | # And if we want to dump symbols for Breakpad-enabled builds. |
| 996 | 'linux_dump_symbols%': 0, |
| 997 | # And if we want to strip the binary after dumping symbols. |
| 998 | 'linux_strip_binary%': 0, |
| 999 | # Strip the test binaries needed for Linux reliability tests. |
| 1000 | 'linux_strip_reliability_tests%': 0, |
| 1001 | |
| 1002 | # Enable TCMalloc. |
| 1003 | 'linux_use_tcmalloc%': 1, |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1004 | 'android_use_tcmalloc%': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1005 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1006 | # Disable TCMalloc's heapchecker. |
| 1007 | 'linux_use_heapchecker%': 0, |
| 1008 | |
| 1009 | # Disable shadow stack keeping used by heapcheck to unwind the stacks |
| 1010 | # better. |
| 1011 | 'linux_keep_shadow_stacks%': 0, |
| 1012 | |
| 1013 | # Set to 1 to link against libgnome-keyring instead of using dlopen(). |
| 1014 | 'linux_link_gnome_keyring%': 0, |
| 1015 | # Set to 1 to link against gsettings APIs instead of using dlopen(). |
| 1016 | 'linux_link_gsettings%': 0, |
| 1017 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1018 | # Default arch variant for MIPS. |
| 1019 | 'mips_arch_variant%': 'mips32r2', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1020 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1021 | # Enable use of OpenMAX DL FFT routines. |
| 1022 | 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1023 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1024 | # Enable new NPDevice API. |
| 1025 | 'enable_new_npdevice_api%': 0, |
| 1026 | |
| 1027 | # Enable EGLImage support in OpenMAX |
| 1028 | 'enable_eglimage%': 1, |
| 1029 | |
| 1030 | # Enable a variable used elsewhere throughout the GYP files to determine |
| 1031 | # whether to compile in the sources for the GPU plugin / process. |
| 1032 | 'enable_gpu%': 1, |
| 1033 | |
| 1034 | # .gyp files or targets should set chromium_code to 1 if they build |
| 1035 | # Chromium-specific code, as opposed to external code. This variable is |
| 1036 | # used to control such things as the set of warnings to enable, and |
| 1037 | # whether warnings are treated as errors. |
| 1038 | 'chromium_code%': 0, |
| 1039 | |
| 1040 | 'release_valgrind_build%': 0, |
| 1041 | |
| 1042 | # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600 |
| 1043 | 'enable_wexit_time_destructors%': 0, |
| 1044 | |
| 1045 | # Set to 1 to compile with the built in pdf viewer. |
| 1046 | 'internal_pdf%': 0, |
| 1047 | |
| 1048 | # Set to 1 to compile with the OpenGL ES 2.0 conformance tests. |
| 1049 | 'internal_gles2_conform_tests%': 0, |
| 1050 | |
| 1051 | # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_' |
| 1052 | # so Cocoa is happy (http://crbug.com/20441). |
| 1053 | 'locales': [ |
| 1054 | 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', |
| 1055 | 'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he', |
| 1056 | 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1057 | 'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1058 | 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk', |
| 1059 | 'vi', 'zh-CN', 'zh-TW', |
| 1060 | ], |
| 1061 | |
| 1062 | # Pseudo locales are special locales which are used for testing and |
| 1063 | # debugging. They don't get copied to the final app. For more info, |
| 1064 | # check out https://sites.google.com/a/chromium.org/dev/Home/fake-bidi |
| 1065 | 'pseudo_locales': [ |
| 1066 | 'fake-bidi', |
| 1067 | ], |
| 1068 | |
| 1069 | 'grit_defines': [], |
| 1070 | |
| 1071 | # If debug_devtools is set to 1, JavaScript files for DevTools are |
| 1072 | # stored as is and loaded from disk. Otherwise, a concatenated file |
| 1073 | # is stored in resources.pak. It is still possible to load JS files |
| 1074 | # from disk by passing --debug-devtools cmdline switch. |
| 1075 | 'debug_devtools%': 0, |
| 1076 | |
| 1077 | # The Java Bridge is not compiled in by default. |
| 1078 | 'java_bridge%': 0, |
| 1079 | |
| 1080 | # Code signing for iOS binaries. The bots need to be able to disable this. |
| 1081 | 'chromium_ios_signing%': 1, |
| 1082 | |
| 1083 | # This flag is only used when disable_nacl==0 and disables all those |
| 1084 | # subcomponents which would require the installation of a native_client |
| 1085 | # untrusted toolchain. |
| 1086 | 'disable_nacl_untrusted%': 0, |
| 1087 | |
| 1088 | # Disable Dart by default. |
| 1089 | 'enable_dart%': 0, |
| 1090 | |
| 1091 | # The desired version of Windows SDK can be set in ~/.gyp/include.gypi. |
| 1092 | 'msbuild_toolset%': '', |
| 1093 | |
| 1094 | # Native Client is enabled by default. |
| 1095 | 'disable_nacl%': 0, |
| 1096 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1097 | # Portable Native Client is enabled by default. |
| 1098 | 'disable_pnacl%': 0, |
| 1099 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1100 | # Whether to build full debug version for Debug configuration on Android. |
| 1101 | # Compared to full debug version, the default Debug configuration on Android |
| 1102 | # has no full v8 debug, has size optimization and linker gc section, so that |
| 1103 | # we can build a debug version with acceptable size and performance. |
| 1104 | 'android_full_debug%': 0, |
| 1105 | |
| 1106 | # Sets the default version name and code for Android app, by default we |
| 1107 | # do a developer build. |
| 1108 | 'android_app_version_name%': 'Developer Build', |
| 1109 | 'android_app_version_code%': 0, |
| 1110 | |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 1111 | # Contains data about the attached devices for gyp_managed_install. |
| 1112 | 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg', |
| 1113 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1114 | 'sas_dll_exists': '<!(python <(DEPTH)/build/dir_exists.py <(sas_dll_path))', |
| 1115 | 'wix_exists': '<!(python <(DEPTH)/build/dir_exists.py <(wix_path))', |
| 1116 | |
| 1117 | 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files', |
| 1118 | 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files', |
| 1119 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1120 | # Whether we are using the rlz library or not. Platforms like Android send |
| 1121 | # rlz codes for searches but do not use the library. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1122 | 'enable_rlz%': 0, |
| 1123 | |
Ben Murdoch | 558790d | 2013-07-30 15:19:42 +0100 | [diff] [blame] | 1124 | # Turns on the i18n support in V8. |
| 1125 | 'v8_enable_i18n_support': 1, |
| 1126 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1127 | 'conditions': [ |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1128 | # The version of GCC in use, set later in platforms that use GCC and have |
| 1129 | # not explicitly chosen to build with clang. Currently, this means all |
| 1130 | # platforms except Windows, Mac and iOS. |
| 1131 | # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that |
| 1132 | # it takes effect here. |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1133 | ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0', { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1134 | 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)', |
| 1135 | }, { |
| 1136 | 'gcc_version%': 0, |
| 1137 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1138 | ['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(windows_sdk_default_path))"=="True"', { |
| 1139 | 'windows_sdk_path%': '<(windows_sdk_default_path)', |
| 1140 | }, { |
| 1141 | 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0', |
| 1142 | }], |
| 1143 | ['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(directx_sdk_default_path))"=="True"', { |
| 1144 | 'directx_sdk_path%': '<(directx_sdk_default_path)', |
| 1145 | }, { |
| 1146 | 'directx_sdk_path%': '$(DXSDK_DIR)', |
| 1147 | }], |
| 1148 | ['OS=="win"', { |
| 1149 | 'windows_driver_kit_path%': '$(WDK_DIR)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1150 | # Set the python arch to prevent conflicts with pyauto on Win64 build. |
| 1151 | # TODO(jschuh): crbug.com/177664 Investigate Win64 pyauto build. |
| 1152 | 'python_arch%': 'ia32', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1153 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1154 | ['os_posix==1 and OS!="mac" and OS!="ios"', { |
| 1155 | # Figure out the python architecture to decide if we build pyauto. |
| 1156 | 'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/<(system_libdir)/libpython<(python_ver).so.1.0)', |
| 1157 | 'conditions': [ |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1158 | ['target_arch=="mipsel"', { |
| 1159 | 'werror%': '', |
| 1160 | 'disable_nacl%': 1, |
| 1161 | 'nacl_untrusted_build%': 0, |
| 1162 | 'linux_use_tcmalloc%': 0, |
Ben Murdoch | 3c54152 | 2013-06-28 19:54:20 +0100 | [diff] [blame] | 1163 | }], |
| 1164 | ['OS=="linux" and target_arch=="mipsel"', { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1165 | 'sysroot%': '<(sysroot)', |
| 1166 | 'CXX%': '<(CXX)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1167 | }], |
| 1168 | # All Chrome builds have breakpad symbols, but only process the |
| 1169 | # symbols from official builds. |
| 1170 | ['(branding=="Chrome" and buildtype=="Official")', { |
| 1171 | 'linux_dump_symbols%': 1, |
| 1172 | }], |
| 1173 | ], |
| 1174 | }], # os_posix==1 and OS!="mac" and OS!="ios" |
| 1175 | ['OS=="ios"', { |
| 1176 | 'disable_nacl%': 1, |
| 1177 | 'enable_background%': 0, |
| 1178 | 'enable_gpu%': 0, |
| 1179 | 'enable_task_manager%': 0, |
| 1180 | 'icu_use_data_file_flag%': 1, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1181 | 'use_system_libxml%': 1, |
| 1182 | 'use_system_sqlite%': 1, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1183 | 'locales==': [ |
| 1184 | 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'fi', |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1185 | 'fr', 'he', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms', 'nb', 'nl', |
| 1186 | 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr', 'uk', 'vi', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1187 | 'zh-CN', 'zh-TW', |
| 1188 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1189 | |
| 1190 | # The Mac SDK is set for iOS builds and passed through to Mac |
| 1191 | # sub-builds. This allows the Mac sub-build SDK in an iOS build to be |
| 1192 | # overridden from the command line the same way it is for a Mac build. |
| 1193 | 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py 10.6)', |
| 1194 | |
Ben Murdoch | 3240926 | 2013-08-07 11:04:47 +0100 | [diff] [blame] | 1195 | # iOS SDK and deployment target support. The |ios_sdk| value is left |
| 1196 | # blank so that when it is set in the project files it will be the |
| 1197 | # "current" iOS SDK. Forcing a specific SDK even if it is "current" |
| 1198 | # causes Xcode to spit out a warning for every single project file for |
| 1199 | # not using the "current" SDK. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1200 | 'ios_sdk%': '', |
| 1201 | 'ios_sdk_path%': '', |
Ben Murdoch | 3240926 | 2013-08-07 11:04:47 +0100 | [diff] [blame] | 1202 | 'ios_deployment_target%': '6.0', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1203 | |
| 1204 | 'conditions': [ |
| 1205 | # ios_product_name is set to the name of the .app bundle as it should |
| 1206 | # appear on disk. |
| 1207 | ['branding=="Chrome"', { |
| 1208 | 'ios_product_name%': 'Chrome', |
| 1209 | }, { # else: branding!="Chrome" |
| 1210 | 'ios_product_name%': 'Chromium', |
| 1211 | }], |
| 1212 | ['branding=="Chrome" and buildtype=="Official"', { |
| 1213 | 'ios_breakpad%': 1, |
| 1214 | }, { # else: branding!="Chrome" or buildtype!="Official" |
| 1215 | 'ios_breakpad%': 0, |
| 1216 | }], |
| 1217 | ], |
| 1218 | }], # OS=="ios" |
| 1219 | ['OS=="android"', { |
| 1220 | # Location of Android NDK. |
| 1221 | 'variables': { |
| 1222 | 'variables': { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1223 | # Unfortuantely we have to use absolute paths to the SDK/NDK beause |
| 1224 | # they're passed to ant which uses a different relative path from |
| 1225 | # gyp. |
| 1226 | 'android_ndk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/', |
| 1227 | 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/', |
| 1228 | 'android_host_arch%': '<!(uname -m)', |
| 1229 | # Android API-level of the SDK used for compilation. |
| 1230 | 'android_sdk_version%': '17', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1231 | }, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1232 | # Copy conditionally-set variables out one scope. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1233 | 'android_ndk_root%': '<(android_ndk_root)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1234 | 'android_sdk_root%': '<(android_sdk_root)', |
| 1235 | 'android_sdk_version%': '<(android_sdk_version)', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1236 | 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1237 | |
| 1238 | 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)', |
| 1239 | |
| 1240 | # Android API level 14 is ICS (Android 4.0) which is the minimum |
| 1241 | # platform requirement for Chrome on Android, we use it for native |
| 1242 | # code compilation. |
| 1243 | 'conditions': [ |
| 1244 | ['target_arch == "ia32"', { |
| 1245 | 'android_app_abi%': 'x86', |
| 1246 | 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-x86/gdbserver/gdbserver', |
| 1247 | 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-x86', |
| 1248 | 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.6/prebuilt/<(host_os)-<(android_host_arch)/bin', |
| 1249 | }], |
| 1250 | ['target_arch=="arm"', { |
| 1251 | 'conditions': [ |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1252 | ['arm_version<7', { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1253 | 'android_app_abi%': 'armeabi', |
| 1254 | }, { |
| 1255 | 'android_app_abi%': 'armeabi-v7a', |
| 1256 | }], |
| 1257 | ], |
| 1258 | 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-arm/gdbserver/gdbserver', |
| 1259 | 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-arm', |
| 1260 | 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.6/prebuilt/<(host_os)-<(android_host_arch)/bin', |
| 1261 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1262 | ['target_arch == "mipsel"', { |
| 1263 | 'android_app_abi%': 'mips', |
| 1264 | 'android_gdbserver%': '<(android_ndk_root)/prebuilt/android-mips/gdbserver/gdbserver', |
| 1265 | 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-14/arch-mips', |
Torne (Richard Coles) | a93a17c | 2013-05-15 11:34:50 +0100 | [diff] [blame] | 1266 | 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.6/prebuilt/<(host_os)-<(android_host_arch)/bin', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1267 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1268 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1269 | }, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1270 | # Copy conditionally-set variables out one scope. |
| 1271 | 'android_app_abi%': '<(android_app_abi)', |
| 1272 | 'android_gdbserver%': '<(android_gdbserver)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1273 | 'android_ndk_root%': '<(android_ndk_root)', |
| 1274 | 'android_ndk_sysroot': '<(android_ndk_sysroot)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1275 | 'android_sdk_root%': '<(android_sdk_root)', |
| 1276 | 'android_sdk_version%': '<(android_sdk_version)', |
| 1277 | 'android_toolchain%': '<(android_toolchain)', |
| 1278 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1279 | 'android_ndk_include': '<(android_ndk_sysroot)/usr/include', |
| 1280 | 'android_ndk_lib': '<(android_ndk_sysroot)/usr/lib', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1281 | 'android_sdk_tools%': '<(android_sdk_root)/platform-tools', |
| 1282 | 'android_sdk%': '<(android_sdk)', |
| 1283 | 'android_sdk_jar%': '<(android_sdk)/android.jar', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1284 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1285 | 'android_stlport_root': '<(android_stlport_root)', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1286 | 'android_stlport_include': '<(android_stlport_root)/stlport', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1287 | 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1288 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1289 | # Location of the "strip" binary, used by both gyp and scripts. |
| 1290 | 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)', |
| 1291 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1292 | # Location of the "readelf" binary. |
| 1293 | 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)', |
| 1294 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1295 | # Provides an absolute path to PRODUCT_DIR (e.g. out/Release). Used |
| 1296 | # to specify the output directory for Ant in the Android build. |
| 1297 | 'ant_build_out': '`cd <(PRODUCT_DIR) && pwd -P`', |
| 1298 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1299 | # Determines whether we should optimize JNI generation at the cost of |
| 1300 | # breaking assumptions in the build system that when inputs have changed |
| 1301 | # the outputs should always change as well. This is meant purely for |
| 1302 | # developer builds, to avoid spurious re-linking of native files. |
| 1303 | 'optimize_jni_generation%': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1304 | |
| 1305 | # Always uses openssl. |
| 1306 | 'use_openssl%': 1, |
| 1307 | |
| 1308 | 'proprietary_codecs%': '<(proprietary_codecs)', |
| 1309 | 'enable_task_manager%': 0, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1310 | 'safe_browsing%': 2, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1311 | 'input_speech%': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1312 | 'enable_automation%': 0, |
| 1313 | 'java_bridge%': 1, |
| 1314 | 'build_ffmpegsumo%': 0, |
| 1315 | 'linux_use_tcmalloc%': 0, |
| 1316 | |
| 1317 | # Disable Native Client. |
| 1318 | 'disable_nacl%': 1, |
| 1319 | |
| 1320 | # Android does not support background apps. |
| 1321 | 'enable_background%': 0, |
| 1322 | |
| 1323 | # Sessions are store separately in the Java side. |
| 1324 | 'enable_session_service%': 0, |
| 1325 | |
| 1326 | # Set to 1 once we have a notification system for Android. |
| 1327 | # http://crbug.com/115320 |
| 1328 | 'notifications%': 0, |
| 1329 | |
| 1330 | 'p2p_apis%' : 0, |
| 1331 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1332 | 'gtest_target_type%': 'shared_library', |
| 1333 | |
| 1334 | # Uses system APIs for decoding audio and video. |
| 1335 | 'use_libffmpeg%': '0', |
| 1336 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1337 | # Always use the chromium skia. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1338 | 'use_system_skia%': '0', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1339 | |
| 1340 | # When building as part of the Android system, use system libraries |
| 1341 | # where possible to reduce ROM size. |
| 1342 | # TODO(steveblock): Investigate using the system version of sqlite. |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1343 | 'use_system_sqlite%': 0, # '<(android_webview_build)', |
| 1344 | 'use_system_expat%': '<(android_webview_build)', |
| 1345 | 'use_system_icu%': '<(android_webview_build)', |
| 1346 | 'use_system_stlport%': '<(android_webview_build)', |
| 1347 | |
| 1348 | 'enable_managed_users%': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1349 | |
| 1350 | # Copy it out one scope. |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1351 | 'android_webview_build%': '<(android_webview_build)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1352 | }], # OS=="android" |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 1353 | ['android_webview_build==1', { |
| 1354 | # When building the WebView in the Android tree, jarjar will remap all |
| 1355 | # the class names, so the JNI generator needs to know this. |
| 1356 | 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt', |
| 1357 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1358 | ['OS=="mac"', { |
Torne (Richard Coles) | a93a17c | 2013-05-15 11:34:50 +0100 | [diff] [blame] | 1359 | # Enable clang on mac by default! |
| 1360 | 'clang%': 1, |
| 1361 | }], # OS=="mac" |
| 1362 | ['OS=="mac" or OS=="ios"', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1363 | 'variables': { |
| 1364 | # Mac OS X SDK and deployment target support. The SDK identifies |
| 1365 | # the version of the system headers that will be used, and |
| 1366 | # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time |
| 1367 | # macro. "Maximum allowed" refers to the operating system version |
| 1368 | # whose APIs are available in the headers. The deployment target |
| 1369 | # identifies the minimum system version that the built products are |
| 1370 | # expected to function on. It corresponds to the |
| 1371 | # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these |
| 1372 | # macros are available, #include <AvailabilityMacros.h>. Additional |
| 1373 | # documentation on these macros is available at |
| 1374 | # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3 |
| 1375 | # Chrome normally builds with the Mac OS X 10.6 SDK and sets the |
| 1376 | # deployment target to 10.6. Other projects, such as O3D, may |
| 1377 | # override these defaults. |
| 1378 | |
| 1379 | # Normally, mac_sdk_min is used to find an SDK that Xcode knows |
| 1380 | # about that is at least the specified version. In official builds, |
| 1381 | # the SDK must match mac_sdk_min exactly. If the SDK is installed |
| 1382 | # someplace that Xcode doesn't know about, set mac_sdk_path to the |
| 1383 | # path to the SDK; when set to a non-empty string, SDK detection |
| 1384 | # based on mac_sdk_min will be bypassed entirely. |
| 1385 | 'mac_sdk_min%': '10.6', |
| 1386 | 'mac_sdk_path%': '', |
| 1387 | |
| 1388 | 'mac_deployment_target%': '10.6', |
| 1389 | }, |
| 1390 | |
| 1391 | 'mac_sdk_min': '<(mac_sdk_min)', |
| 1392 | 'mac_sdk_path': '<(mac_sdk_path)', |
| 1393 | 'mac_deployment_target': '<(mac_deployment_target)', |
| 1394 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1395 | # Compile in Breakpad support by default so that it can be |
| 1396 | # tested, even if it is not enabled by default at runtime. |
| 1397 | 'mac_breakpad_compiled_in%': 1, |
| 1398 | 'conditions': [ |
| 1399 | # mac_product_name is set to the name of the .app bundle as it should |
| 1400 | # appear on disk. This duplicates data from |
| 1401 | # chrome/app/theme/chromium/BRANDING and |
| 1402 | # chrome/app/theme/google_chrome/BRANDING, but is necessary to get |
| 1403 | # these names into the build system. |
| 1404 | ['branding=="Chrome"', { |
| 1405 | 'mac_product_name%': 'Google Chrome', |
| 1406 | }, { # else: branding!="Chrome" |
| 1407 | 'mac_product_name%': 'Chromium', |
| 1408 | }], |
| 1409 | |
| 1410 | ['branding=="Chrome" and buildtype=="Official"', { |
| 1411 | 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))', |
| 1412 | # Enable uploading crash dumps. |
| 1413 | 'mac_breakpad_uploads%': 1, |
| 1414 | # Enable dumping symbols at build time for use by Mac Breakpad. |
| 1415 | 'mac_breakpad%': 1, |
| 1416 | # Enable Keystone auto-update support. |
| 1417 | 'mac_keystone%': 1, |
| 1418 | }, { # else: branding!="Chrome" or buildtype!="Official" |
| 1419 | 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))', |
| 1420 | 'mac_breakpad_uploads%': 0, |
| 1421 | 'mac_breakpad%': 0, |
| 1422 | 'mac_keystone%': 0, |
| 1423 | }], |
| 1424 | ], |
Torne (Richard Coles) | a93a17c | 2013-05-15 11:34:50 +0100 | [diff] [blame] | 1425 | }], # OS=="mac" or OS=="ios" |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1426 | ['OS=="win"', { |
| 1427 | 'conditions': [ |
Ben Murdoch | 2385ea3 | 2013-08-06 11:01:04 +0100 | [diff] [blame] | 1428 | # This is the architecture convention used in WinSDK paths. |
| 1429 | ['target_arch=="ia32"', { |
| 1430 | 'winsdk_arch%': 'x86', |
| 1431 | },{ |
| 1432 | 'winsdk_arch%': '<(target_arch)', |
| 1433 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1434 | ['component=="shared_library"', { |
| 1435 | 'win_use_allocator_shim%': 0, |
| 1436 | }], |
| 1437 | ['component=="shared_library" and "<(GENERATOR)"=="ninja"', { |
| 1438 | # Only enabled by default for ninja because it's buggy in VS. |
| 1439 | # Not enabled for component=static_library because some targets |
| 1440 | # are too large and the toolchain fails due to the size of the |
| 1441 | # .obj files. |
| 1442 | 'incremental_chrome_dll%': 1, |
| 1443 | }], |
| 1444 | # Don't do incremental linking for large modules on 32-bit. |
| 1445 | ['MSVS_OS_BITS==32', { |
| 1446 | 'msvs_large_module_debug_link_mode%': '1', # No |
| 1447 | },{ |
| 1448 | 'msvs_large_module_debug_link_mode%': '2', # Yes |
| 1449 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1450 | ['MSVS_VERSION=="2012e" or MSVS_VERSION=="2010e"', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1451 | 'msvs_express%': 1, |
| 1452 | 'secure_atl%': 0, |
| 1453 | },{ |
| 1454 | 'msvs_express%': 0, |
| 1455 | 'secure_atl%': 1, |
| 1456 | }], |
| 1457 | ], |
| 1458 | 'nacl_win64_defines': [ |
| 1459 | # This flag is used to minimize dependencies when building |
| 1460 | # Native Client loader for 64-bit Windows. |
| 1461 | 'NACL_WIN64', |
| 1462 | ], |
| 1463 | }], |
| 1464 | |
| 1465 | ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios"', { |
| 1466 | 'use_cups%': 1, |
| 1467 | }, { |
| 1468 | 'use_cups%': 0, |
| 1469 | }], |
| 1470 | |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1471 | ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win" or google_tv==1)', { |
| 1472 | 'enable_pepper_cdms%': 1, |
| 1473 | }, { |
| 1474 | 'enable_pepper_cdms%': 0, |
| 1475 | }], |
| 1476 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1477 | # Native Client glibc toolchain is enabled |
| 1478 | # by default except on arm and mips. |
| 1479 | ['target_arch=="arm" or target_arch=="mipsel"', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1480 | 'disable_glibc%': 1, |
| 1481 | }, { |
| 1482 | 'disable_glibc%': 0, |
| 1483 | }], |
| 1484 | |
| 1485 | # Disable SSE2 when building for ARM or MIPS. |
| 1486 | ['target_arch=="arm" or target_arch=="mipsel"', { |
| 1487 | 'disable_sse2%': 1, |
| 1488 | }, { |
| 1489 | 'disable_sse2%': '<(disable_sse2)', |
| 1490 | }], |
| 1491 | |
| 1492 | # Set the relative path from this file to the GYP file of the JPEG |
| 1493 | # library used by Chromium. |
| 1494 | ['use_system_libjpeg==1 or use_libjpeg_turbo==0', { |
| 1495 | # Configuration for using the system libjeg is here. |
| 1496 | 'libjpeg_gyp_path': '../third_party/libjpeg/libjpeg.gyp', |
| 1497 | }, { |
| 1498 | 'libjpeg_gyp_path': '../third_party/libjpeg_turbo/libjpeg.gyp', |
| 1499 | }], |
| 1500 | |
| 1501 | # Options controlling the use of GConf (the classic GNOME configuration |
| 1502 | # system) and GIO, which contains GSettings (the new GNOME config system). |
| 1503 | ['chromeos==1', { |
| 1504 | 'use_gconf%': 0, |
| 1505 | 'use_gio%': 0, |
| 1506 | }, { |
| 1507 | 'use_gconf%': 1, |
| 1508 | 'use_gio%': 1, |
| 1509 | }], |
| 1510 | |
| 1511 | # Set up -D and -E flags passed into grit. |
| 1512 | ['branding=="Chrome"', { |
| 1513 | # TODO(mmoss) The .grd files look for _google_chrome, but for |
| 1514 | # consistency they should look for google_chrome_build like C++. |
| 1515 | 'grit_defines': ['-D', '_google_chrome', |
| 1516 | '-E', 'CHROMIUM_BUILD=google_chrome'], |
| 1517 | }, { |
| 1518 | 'grit_defines': ['-D', '_chromium', |
| 1519 | '-E', 'CHROMIUM_BUILD=chromium'], |
| 1520 | }], |
| 1521 | ['chromeos==1', { |
| 1522 | 'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'], |
| 1523 | }], |
| 1524 | ['toolkit_views==1', { |
| 1525 | 'grit_defines': ['-D', 'toolkit_views'], |
| 1526 | }], |
| 1527 | ['use_aura==1', { |
| 1528 | 'grit_defines': ['-D', 'use_aura'], |
| 1529 | }], |
| 1530 | ['use_ash==1', { |
| 1531 | 'grit_defines': ['-D', 'use_ash'], |
| 1532 | }], |
| 1533 | ['use_nss==1', { |
| 1534 | 'grit_defines': ['-D', 'use_nss'], |
| 1535 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1536 | ['use_ozone==1', { |
| 1537 | 'grit_defines': ['-D', 'use_ozone'], |
| 1538 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1539 | ['file_manager_extension==1', { |
| 1540 | 'grit_defines': ['-D', 'file_manager_extension'], |
| 1541 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1542 | ['image_loader_extension==1', { |
| 1543 | 'grit_defines': ['-D', 'image_loader_extension'], |
| 1544 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1545 | ['remoting==1', { |
| 1546 | 'grit_defines': ['-D', 'remoting'], |
| 1547 | }], |
| 1548 | ['use_titlecase_in_grd_files==1', { |
| 1549 | 'grit_defines': ['-D', 'use_titlecase'], |
| 1550 | }], |
| 1551 | ['use_third_party_translations==1', { |
| 1552 | 'grit_defines': ['-D', 'use_third_party_translations'], |
| 1553 | 'locales': [ |
| 1554 | 'ast', 'bs', 'ca@valencia', 'en-AU', 'eo', 'eu', 'gl', 'hy', 'ia', |
| 1555 | 'ka', 'ku', 'kw', 'ms', 'ug' |
| 1556 | ], |
| 1557 | }], |
| 1558 | ['OS=="android"', { |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1559 | 'grit_defines': ['-t', 'android', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1560 | '-E', 'ANDROID_JAVA_TAGGED_ONLY=true'], |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1561 | 'conditions': [ |
| 1562 | ['google_tv==1', { |
| 1563 | 'grit_defines': ['-D', 'google_tv'], |
| 1564 | }], |
| 1565 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1566 | }], |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 1567 | ['OS=="mac" or OS=="ios"', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1568 | 'grit_defines': ['-D', 'scale_factors=2x'], |
| 1569 | }], |
| 1570 | ['OS == "ios"', { |
| 1571 | 'grit_defines': [ |
| 1572 | # define for iOS specific resources. |
| 1573 | '-D', 'ios', |
| 1574 | # iOS uses a whitelist to filter resources. |
| 1575 | '-w', '<(DEPTH)/build/ios/grit_whitelist.txt' |
| 1576 | ], |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 1577 | |
| 1578 | # Enable clang and host builds when generating with ninja-ios. |
| 1579 | 'conditions': [ |
| 1580 | ['"<(GENERATOR)"=="ninja"', { |
| 1581 | 'clang%': 1, |
| 1582 | 'host_os%': "mac", |
| 1583 | }] |
| 1584 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1585 | }], |
| 1586 | ['enable_extensions==1', { |
| 1587 | 'grit_defines': ['-D', 'enable_extensions'], |
| 1588 | }], |
| 1589 | ['enable_printing==1', { |
| 1590 | 'grit_defines': ['-D', 'enable_printing'], |
| 1591 | }], |
| 1592 | ['enable_themes==1', { |
| 1593 | 'grit_defines': ['-D', 'enable_themes'], |
| 1594 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1595 | ['enable_app_list==1', { |
| 1596 | 'grit_defines': ['-D', 'enable_app_list'], |
| 1597 | }], |
| 1598 | ['enable_settings_app==1', { |
| 1599 | 'grit_defines': ['-D', 'enable_settings_app'], |
| 1600 | }], |
| 1601 | ['enable_google_now==1', { |
| 1602 | 'grit_defines': ['-D', 'enable_google_now'], |
| 1603 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1604 | ['use_concatenated_impulse_responses==1', { |
| 1605 | 'grit_defines': ['-D', 'use_concatenated_impulse_responses'], |
| 1606 | }], |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 1607 | ['enable_webrtc==1', { |
| 1608 | 'grit_defines': ['-D', 'enable_webrtc'], |
| 1609 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1610 | ['clang_use_chrome_plugins==1 and OS!="win"', { |
Torne (Richard Coles) | a93a17c | 2013-05-15 11:34:50 +0100 | [diff] [blame] | 1611 | 'clang_chrome_plugins_flags': [ |
| 1612 | '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)' |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1613 | ], |
| 1614 | }], |
| 1615 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1616 | ['asan==1 and OS!="win"', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1617 | 'clang%': 1, |
| 1618 | }], |
| 1619 | ['asan==1 and OS=="mac"', { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1620 | # TODO(glider): we do not strip ASan binaries until the dynamic ASan |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1621 | # runtime is fully adopted. See http://crbug.com/242503. |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1622 | 'mac_strip_release': 0, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1623 | }], |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1624 | ['lsan==1', { |
| 1625 | 'clang%': 1, |
| 1626 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1627 | ['tsan==1', { |
| 1628 | 'clang%': 1, |
| 1629 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1630 | ['msan==1', { |
| 1631 | 'clang%': 1, |
| 1632 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1633 | |
| 1634 | ['OS=="linux" and clang_type_profiler==1', { |
| 1635 | 'clang%': 1, |
| 1636 | 'clang_use_chrome_plugins%': 0, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1637 | 'conditions': [ |
| 1638 | ['host_arch=="x64"', { |
| 1639 | 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64', |
| 1640 | }], |
| 1641 | ['host_arch=="ia32"', { |
| 1642 | # 32-bit Clang is unsupported. It may not build. Put your 32-bit |
| 1643 | # Clang in this directory at your own risk if needed for some |
| 1644 | # purpose (e.g. to compare 32-bit and 64-bit behavior like memory |
| 1645 | # usage). Any failure by this compiler should not close the tree. |
| 1646 | 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_ia32', |
| 1647 | }], |
| 1648 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1649 | }], |
| 1650 | |
| 1651 | # On valgrind bots, override the optimizer settings so we don't inline too |
| 1652 | # much and make the stacks harder to figure out. |
| 1653 | # |
| 1654 | # TODO(rnk): Kill off variables that no one else uses and just implement |
| 1655 | # them under a build_for_tool== condition. |
| 1656 | ['build_for_tool=="memcheck" or build_for_tool=="tsan"', { |
| 1657 | # gcc flags |
| 1658 | 'mac_debug_optimization': '1', |
| 1659 | 'mac_release_optimization': '1', |
| 1660 | 'release_optimize': '1', |
| 1661 | 'no_gc_sections': 1, |
| 1662 | 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer ' |
| 1663 | '-fno-builtin -fno-optimize-sibling-calls', |
| 1664 | 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer ' |
| 1665 | '-fno-builtin -fno-optimize-sibling-calls', |
| 1666 | |
| 1667 | # MSVS flags for TSan on Pin and Windows. |
| 1668 | 'win_debug_RuntimeChecks': '0', |
| 1669 | 'win_debug_disable_iterator_debugging': '1', |
| 1670 | 'win_debug_Optimization': '1', |
| 1671 | 'win_debug_InlineFunctionExpansion': '0', |
| 1672 | 'win_release_InlineFunctionExpansion': '0', |
| 1673 | 'win_release_OmitFramePointers': '0', |
| 1674 | |
| 1675 | 'linux_use_tcmalloc': 1, |
| 1676 | 'release_valgrind_build': 1, |
| 1677 | 'werror': '', |
| 1678 | 'component': 'static_library', |
| 1679 | 'use_system_zlib': 0, |
| 1680 | }], |
| 1681 | |
| 1682 | # Build tweaks for DrMemory. |
| 1683 | # TODO(rnk): Combine with tsan config to share the builder. |
| 1684 | # http://crbug.com/108155 |
| 1685 | ['build_for_tool=="drmemory"', { |
| 1686 | # These runtime checks force initialization of stack vars which blocks |
| 1687 | # DrMemory's uninit detection. |
| 1688 | 'win_debug_RuntimeChecks': '0', |
| 1689 | # Iterator debugging is slow. |
| 1690 | 'win_debug_disable_iterator_debugging': '1', |
| 1691 | # Try to disable optimizations that mess up stacks in a release build. |
| 1692 | # DrM-i#1054 (http://code.google.com/p/drmemory/issues/detail?id=1054) |
| 1693 | # /O2 and /Ob0 (disable inline) cannot be used together because of a |
| 1694 | # compiler bug, so we use /Ob1 instead. |
| 1695 | 'win_release_InlineFunctionExpansion': '1', |
| 1696 | 'win_release_OmitFramePointers': '0', |
| 1697 | # Ditto for debug, to support bumping win_debug_Optimization. |
| 1698 | 'win_debug_InlineFunctionExpansion': 0, |
| 1699 | 'win_debug_OmitFramePointers': 0, |
| 1700 | # Keep the code under #ifndef NVALGRIND. |
| 1701 | 'release_valgrind_build': 1, |
| 1702 | }], |
| 1703 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1704 | # Enable RLZ on Win, Mac and ChromeOS. |
| 1705 | ['branding=="Chrome" and (OS=="win" or OS=="mac" or chromeos==1)', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1706 | 'enable_rlz%': 1, |
| 1707 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1708 | |
| 1709 | # Set default compiler flags depending on ARM version. |
| 1710 | ['arm_version==5 and android_webview_build==0', { |
| 1711 | # Flags suitable for Android emulator |
| 1712 | 'arm_arch%': 'armv5te', |
| 1713 | 'arm_tune%': 'xscale', |
| 1714 | 'arm_fpu%': '', |
| 1715 | 'arm_float_abi%': 'soft', |
| 1716 | 'arm_thumb%': 0, |
| 1717 | }], |
| 1718 | ['arm_version==6 and android_webview_build==0', { |
| 1719 | 'arm_arch%': 'armv6', |
| 1720 | 'arm_tune%': '', |
| 1721 | 'arm_fpu%': '', |
| 1722 | 'arm_float_abi%': 'soft', |
| 1723 | 'arm_thumb%': 0, |
| 1724 | }], |
| 1725 | ['arm_version==7 and android_webview_build==0', { |
| 1726 | 'arm_arch%': 'armv7-a', |
| 1727 | 'arm_tune%': 'cortex-a8', |
| 1728 | 'conditions': [ |
| 1729 | ['arm_neon==1', { |
| 1730 | 'arm_fpu%': 'neon', |
| 1731 | }, { |
| 1732 | 'arm_fpu%': 'vfpv3-d16', |
| 1733 | }], |
| 1734 | ], |
| 1735 | 'arm_float_abi%': 'softfp', |
| 1736 | 'arm_thumb%': 1, |
| 1737 | }], |
| 1738 | |
| 1739 | ['android_webview_build==1', { |
| 1740 | # The WebView build gets its cpu-specific flags from the Android build system. |
| 1741 | 'arm_arch%': '', |
| 1742 | 'arm_tune%': '', |
| 1743 | 'arm_fpu%': '', |
| 1744 | 'arm_float_abi%': '', |
| 1745 | 'arm_thumb%': 0, |
| 1746 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1747 | ], |
| 1748 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1749 | |
| 1750 | # The path to the ANGLE library. TODO(apatrick): This is to help |
| 1751 | # transition to a new version of ANGLE at a new location. After the |
| 1752 | # transition is complete, this can be removed. |
| 1753 | 'angle_path': '<(DEPTH)/third_party/angle_dx11', |
| 1754 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1755 | # List of default apps to install in new profiles. The first list contains |
| 1756 | # the source files as found in svn. The second list, used only for linux, |
| 1757 | # contains the destination location for each of the files. When a crx |
| 1758 | # is added or removed from the list, the chrome/browser/resources/ |
| 1759 | # default_apps/external_extensions.json file must also be updated. |
| 1760 | 'default_apps_list': [ |
| 1761 | 'browser/resources/default_apps/external_extensions.json', |
| 1762 | 'browser/resources/default_apps/gmail.crx', |
| 1763 | 'browser/resources/default_apps/search.crx', |
| 1764 | 'browser/resources/default_apps/youtube.crx', |
| 1765 | 'browser/resources/default_apps/drive.crx', |
| 1766 | 'browser/resources/default_apps/docs.crx', |
| 1767 | ], |
| 1768 | 'default_apps_list_linux_dest': [ |
| 1769 | '<(PRODUCT_DIR)/default_apps/external_extensions.json', |
| 1770 | '<(PRODUCT_DIR)/default_apps/gmail.crx', |
| 1771 | '<(PRODUCT_DIR)/default_apps/search.crx', |
| 1772 | '<(PRODUCT_DIR)/default_apps/youtube.crx', |
| 1773 | '<(PRODUCT_DIR)/default_apps/drive.crx', |
| 1774 | '<(PRODUCT_DIR)/default_apps/docs.crx', |
| 1775 | ], |
| 1776 | }, |
| 1777 | 'target_defaults': { |
| 1778 | 'variables': { |
| 1779 | # The condition that operates on chromium_code is in a target_conditions |
| 1780 | # section, and will not have access to the default fallback value of |
| 1781 | # chromium_code at the top of this file, or to the chromium_code |
| 1782 | # variable placed at the root variables scope of .gyp files, because |
| 1783 | # those variables are not set at target scope. As a workaround, |
| 1784 | # if chromium_code is not set at target scope, define it in target scope |
| 1785 | # to contain whatever value it has during early variable expansion. |
| 1786 | # That's enough to make it available during target conditional |
| 1787 | # processing. |
| 1788 | 'chromium_code%': '<(chromium_code)', |
| 1789 | |
| 1790 | # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx |
| 1791 | 'win_release_Optimization%': '2', # 2 = /Os |
| 1792 | 'win_debug_Optimization%': '0', # 0 = /Od |
| 1793 | |
| 1794 | # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx |
| 1795 | # Tri-state: blank is default, 1 on, 0 off |
| 1796 | 'win_release_OmitFramePointers%': '0', |
| 1797 | # Tri-state: blank is default, 1 on, 0 off |
| 1798 | 'win_debug_OmitFramePointers%': '', |
| 1799 | |
| 1800 | # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx |
| 1801 | 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off |
| 1802 | |
| 1803 | # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx |
| 1804 | 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off, |
| 1805 | 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max |
| 1806 | |
| 1807 | # VS inserts quite a lot of extra checks to algorithms like |
| 1808 | # std::partial_sort in Debug build which make them O(N^2) |
| 1809 | # instead of O(N*logN). This is particularly slow under memory |
| 1810 | # tools like ThreadSanitizer so we want it to be disablable. |
| 1811 | # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx |
| 1812 | 'win_debug_disable_iterator_debugging%': '0', |
| 1813 | |
Ben Murdoch | fb25065 | 2013-07-31 11:42:55 +0100 | [diff] [blame] | 1814 | # An application manifest fragment to declare compatibility settings for |
| 1815 | # 'executable' targets. Ignored in other target type. |
| 1816 | 'win_exe_compatibility_manifest%': |
| 1817 | '<(DEPTH)\\build\\win\\compatibility.manifest', |
| 1818 | |
| 1819 | # Set to 1 to generate external manifest instead of embedding it for |
| 1820 | # 'executable' target. Does nothing for other target type. This flag is |
| 1821 | # used to make mini_installer compatible with the component build. |
| 1822 | # See http://crbug.com/127233 |
| 1823 | 'win_use_external_manifest%': 0, |
| 1824 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1825 | 'release_extra_cflags%': '', |
| 1826 | 'debug_extra_cflags%': '', |
| 1827 | |
| 1828 | 'release_valgrind_build%': '<(release_valgrind_build)', |
| 1829 | |
| 1830 | # the non-qualified versions are widely assumed to be *nix-only |
| 1831 | 'win_release_extra_cflags%': '', |
| 1832 | 'win_debug_extra_cflags%': '', |
| 1833 | |
| 1834 | # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600 |
| 1835 | 'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)', |
| 1836 | |
| 1837 | # Only used by Windows build for now. Can be used to build into a |
| 1838 | # differet output directory, e.g., a build_dir_prefix of VS2010_ would |
| 1839 | # output files in src/build/VS2010_{Debug,Release}. |
| 1840 | 'build_dir_prefix%': '', |
| 1841 | |
| 1842 | # Targets are by default not nacl untrusted code. |
| 1843 | 'nacl_untrusted_build%': 0, |
| 1844 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1845 | 'pnacl_compile_flags': [ |
| 1846 | # pnacl uses the clang compiler so we need to supress all the |
| 1847 | # same warnings as we do for clang. |
| 1848 | # TODO(sbc): Remove these if/when they are removed from the clang |
| 1849 | # build. |
| 1850 | '-Wno-unused-function', |
| 1851 | '-Wno-char-subscripts', |
| 1852 | '-Wno-c++11-extensions', |
| 1853 | '-Wno-unnamed-type-template-args', |
| 1854 | ], |
| 1855 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1856 | 'conditions': [ |
| 1857 | ['OS=="win" and component=="shared_library"', { |
| 1858 | # See http://msdn.microsoft.com/en-us/library/aa652367.aspx |
| 1859 | 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL) |
| 1860 | 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL) |
| 1861 | }, { |
| 1862 | # See http://msdn.microsoft.com/en-us/library/aa652367.aspx |
| 1863 | 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static) |
| 1864 | 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static) |
| 1865 | }], |
| 1866 | ['OS=="ios"', { |
| 1867 | # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html |
| 1868 | 'mac_release_optimization%': 's', # Use -Os unless overridden |
| 1869 | 'mac_debug_optimization%': '0', # Use -O0 unless overridden |
| 1870 | }, { |
| 1871 | # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html |
| 1872 | 'mac_release_optimization%': '3', # Use -O3 unless overridden |
| 1873 | 'mac_debug_optimization%': '0', # Use -O0 unless overridden |
| 1874 | }], |
| 1875 | ], |
| 1876 | }, |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1877 | 'defines': [ |
| 1878 | # Set this to use the new DX11 version of ANGLE. |
| 1879 | # TODO(apatrick): Remove this when the transition is complete. |
| 1880 | 'ANGLE_DX11', |
| 1881 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1882 | 'conditions': [ |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1883 | ['(OS=="mac" or OS=="ios") and asan==1', { |
| 1884 | 'dependencies': [ |
| 1885 | '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime', |
| 1886 | ], |
| 1887 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1888 | ['OS=="linux" and linux_use_tcmalloc==1 and clang_type_profiler==1', { |
| 1889 | 'cflags_cc!': ['-fno-rtti'], |
| 1890 | 'cflags_cc+': [ |
| 1891 | '-frtti', |
| 1892 | '-gline-tables-only', |
| 1893 | '-fintercept-allocation-functions', |
| 1894 | ], |
| 1895 | 'defines': ['TYPE_PROFILING'], |
| 1896 | 'dependencies': [ |
| 1897 | '<(DEPTH)/base/allocator/allocator.gyp:type_profiler', |
| 1898 | ], |
| 1899 | }], |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 1900 | ['chrome_multiple_dll', { |
| 1901 | 'defines': ['CHROME_MULTIPLE_DLL'], |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 1902 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1903 | ['OS=="linux" and clang==1 and host_arch=="ia32"', { |
| 1904 | # TODO(dmikurube): Remove -Wno-sentinel when Clang/LLVM is fixed. |
| 1905 | # See http://crbug.com/162818. |
| 1906 | 'cflags+': ['-Wno-sentinel'], |
| 1907 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1908 | ['OS=="win" and "<(msbuild_toolset)"!=""', { |
| 1909 | 'msbuild_toolset': '<(msbuild_toolset)', |
| 1910 | }], |
| 1911 | ['branding=="Chrome"', { |
| 1912 | 'defines': ['GOOGLE_CHROME_BUILD'], |
| 1913 | }, { # else: branding!="Chrome" |
| 1914 | 'defines': ['CHROMIUM_BUILD'], |
| 1915 | }], |
| 1916 | ['OS=="mac" and component=="shared_library"', { |
| 1917 | 'xcode_settings': { |
| 1918 | 'DYLIB_INSTALL_NAME_BASE': '@rpath', |
| 1919 | 'LD_RUNPATH_SEARCH_PATHS': [ |
| 1920 | # For unbundled binaries. |
| 1921 | '@loader_path/.', |
| 1922 | # For bundled binaries, to get back from Binary.app/Contents/MacOS. |
| 1923 | '@loader_path/../../..', |
| 1924 | ], |
| 1925 | }, |
| 1926 | }], |
| 1927 | ['enable_rlz==1', { |
| 1928 | 'defines': ['ENABLE_RLZ'], |
| 1929 | }], |
| 1930 | ['component=="shared_library"', { |
| 1931 | 'defines': ['COMPONENT_BUILD'], |
| 1932 | }], |
| 1933 | ['toolkit_views==1', { |
| 1934 | 'defines': ['TOOLKIT_VIEWS=1'], |
| 1935 | }], |
| 1936 | ['ui_compositor_image_transport==1', { |
| 1937 | 'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'], |
| 1938 | }], |
| 1939 | ['use_aura==1', { |
| 1940 | 'defines': ['USE_AURA=1'], |
| 1941 | }], |
| 1942 | ['use_ash==1', { |
| 1943 | 'defines': ['USE_ASH=1'], |
| 1944 | }], |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 1945 | ['use_cras==1', { |
| 1946 | 'defines': ['USE_CRAS=1'], |
| 1947 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1948 | ['use_ozone==1', { |
| 1949 | 'defines': ['USE_OZONE=1'], |
| 1950 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1951 | ['use_default_render_theme==1', { |
| 1952 | 'defines': ['USE_DEFAULT_RENDER_THEME=1'], |
| 1953 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1954 | ['use_libjpeg_turbo==1', { |
| 1955 | 'defines': ['USE_LIBJPEG_TURBO=1'], |
| 1956 | }], |
| 1957 | ['use_nss==1', { |
| 1958 | 'defines': ['USE_NSS=1'], |
| 1959 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1960 | ['use_x11==1', { |
| 1961 | 'defines': ['USE_X11=1'], |
| 1962 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1963 | ['enable_one_click_signin==1', { |
| 1964 | 'defines': ['ENABLE_ONE_CLICK_SIGNIN'], |
| 1965 | }], |
| 1966 | ['toolkit_uses_gtk==1 and toolkit_views==0', { |
| 1967 | # TODO(erg): We are progressively sealing up use of deprecated features |
| 1968 | # in gtk in preparation for an eventual porting to gtk3. |
| 1969 | 'defines': ['GTK_DISABLE_SINGLE_INCLUDES=1'], |
| 1970 | }], |
| 1971 | ['chromeos==1', { |
| 1972 | 'defines': ['OS_CHROMEOS=1'], |
| 1973 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1974 | ['google_tv==1', { |
| 1975 | 'defines': ['GOOGLE_TV=1'], |
| 1976 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1977 | ['use_xi2_mt!=0', { |
| 1978 | 'defines': ['USE_XI2_MT=<(use_xi2_mt)'], |
| 1979 | }], |
| 1980 | ['file_manager_extension==1', { |
| 1981 | 'defines': ['FILE_MANAGER_EXTENSION=1'], |
| 1982 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1983 | ['image_loader_extension==1', { |
| 1984 | 'defines': ['IMAGE_LOADER_EXTENSION=1'], |
| 1985 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1986 | ['profiling==1', { |
| 1987 | 'defines': ['ENABLE_PROFILING=1'], |
| 1988 | }], |
| 1989 | ['OS=="linux" and glibcxx_debug==1', { |
| 1990 | 'defines': ['_GLIBCXX_DEBUG=1',], |
| 1991 | 'cflags_cc+': ['-g'], |
| 1992 | }], |
| 1993 | ['remoting==1', { |
| 1994 | 'defines': ['ENABLE_REMOTING=1'], |
| 1995 | }], |
| 1996 | ['enable_webrtc==1', { |
| 1997 | 'defines': ['ENABLE_WEBRTC=1'], |
| 1998 | }], |
| 1999 | ['proprietary_codecs==1', { |
| 2000 | 'defines': ['USE_PROPRIETARY_CODECS'], |
| 2001 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2002 | ['enable_viewport==1', { |
| 2003 | 'defines': ['ENABLE_VIEWPORT'], |
| 2004 | }], |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 2005 | ['enable_pepper_cdms==1', { |
| 2006 | 'defines': ['ENABLE_PEPPER_CDMS'], |
| 2007 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2008 | ['configuration_policy==1', { |
| 2009 | 'defines': ['ENABLE_CONFIGURATION_POLICY'], |
| 2010 | }], |
| 2011 | ['input_speech==1', { |
| 2012 | 'defines': ['ENABLE_INPUT_SPEECH'], |
| 2013 | }], |
| 2014 | ['notifications==1', { |
| 2015 | 'defines': ['ENABLE_NOTIFICATIONS'], |
| 2016 | }], |
| 2017 | ['enable_hidpi==1', { |
| 2018 | 'defines': ['ENABLE_HIDPI=1'], |
| 2019 | }], |
| 2020 | ['fastbuild!=0', { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 2021 | 'xcode_settings': { |
| 2022 | 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO', |
| 2023 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2024 | 'conditions': [ |
| 2025 | ['clang==1', { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 2026 | # Clang creates chubby debug information, which makes linking very |
| 2027 | # slow. For now, don't create debug information with clang. See |
| 2028 | # http://crbug.com/70000 |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2029 | 'conditions': [ |
| 2030 | ['OS=="linux"', { |
| 2031 | 'variables': { |
| 2032 | 'debug_extra_cflags': '-g0', |
| 2033 | }, |
| 2034 | }], |
| 2035 | # Android builds symbols on release by default, disable them. |
| 2036 | ['OS=="android"', { |
| 2037 | 'variables': { |
| 2038 | 'debug_extra_cflags': '-g0', |
| 2039 | 'release_extra_cflags': '-g0', |
| 2040 | }, |
| 2041 | }], |
| 2042 | ], |
| 2043 | }, { # else clang!=1 |
| 2044 | 'conditions': [ |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 2045 | ['OS=="win" and fastbuild==2', { |
| 2046 | # Completely disable debug information. |
| 2047 | 'msvs_settings': { |
| 2048 | 'VCLinkerTool': { |
| 2049 | 'GenerateDebugInformation': 'false', |
| 2050 | }, |
| 2051 | 'VCCLCompilerTool': { |
| 2052 | 'DebugInformationFormat': '0', |
| 2053 | }, |
| 2054 | }, |
| 2055 | }], |
| 2056 | ['OS=="win" and fastbuild==1', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2057 | 'msvs_settings': { |
| 2058 | 'VCLinkerTool': { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2059 | # This tells the linker to generate .pdbs, so that |
| 2060 | # we can get meaningful stack traces. |
| 2061 | 'GenerateDebugInformation': 'true', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2062 | }, |
| 2063 | 'VCCLCompilerTool': { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2064 | # No debug info to be generated by compiler. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2065 | 'DebugInformationFormat': '0', |
| 2066 | }, |
| 2067 | }, |
| 2068 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 2069 | ['OS=="linux" and fastbuild==2', { |
| 2070 | 'variables': { |
| 2071 | 'debug_extra_cflags': '-g0', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2072 | }, |
| 2073 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 2074 | ['OS=="linux" and fastbuild==1', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2075 | 'variables': { |
| 2076 | 'debug_extra_cflags': '-g1', |
| 2077 | }, |
| 2078 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 2079 | ['OS=="android" and fastbuild==2', { |
| 2080 | 'variables': { |
| 2081 | 'debug_extra_cflags': '-g0', |
| 2082 | 'release_extra_cflags': '-g0', |
| 2083 | }, |
| 2084 | }], |
| 2085 | ['OS=="android" and fastbuild==1', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2086 | 'variables': { |
| 2087 | 'debug_extra_cflags': '-g1', |
| 2088 | 'release_extra_cflags': '-g1', |
| 2089 | }, |
| 2090 | }], |
| 2091 | ], |
| 2092 | }], # clang!=1 |
| 2093 | ], |
| 2094 | }], # fastbuild!=0 |
| 2095 | ['dcheck_always_on!=0', { |
| 2096 | 'defines': ['DCHECK_ALWAYS_ON=1'], |
| 2097 | }], # dcheck_always_on!=0 |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 2098 | ['logging_like_official_build!=0', { |
| 2099 | 'defines': ['LOGGING_IS_OFFICIAL_BUILD=1'], |
| 2100 | }], # logging_like_official_build!=0 |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 2101 | ['tracing_like_official_build!=0', { |
| 2102 | 'defines': ['TRACING_IS_OFFICIAL_BUILD=1'], |
| 2103 | }], # tracing_like_official_build!=0 |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2104 | ['win_use_allocator_shim==0', { |
| 2105 | 'conditions': [ |
| 2106 | ['OS=="win"', { |
| 2107 | 'defines': ['NO_TCMALLOC'], |
| 2108 | }], |
| 2109 | ], |
| 2110 | }], |
| 2111 | ['enable_gpu==1', { |
| 2112 | 'defines': [ |
| 2113 | 'ENABLE_GPU=1', |
| 2114 | ], |
| 2115 | }], |
| 2116 | ['use_openssl==1', { |
| 2117 | 'defines': [ |
| 2118 | 'USE_OPENSSL=1', |
| 2119 | ], |
| 2120 | }], |
| 2121 | ['enable_eglimage==1', { |
| 2122 | 'defines': [ |
| 2123 | 'ENABLE_EGLIMAGE=1', |
| 2124 | ], |
| 2125 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2126 | ['asan==1 and OS=="win"', { |
| 2127 | # Since asan on windows uses Syzygy, we need /PROFILE turned on to |
| 2128 | # produce appropriate pdbs. |
| 2129 | 'msvs_settings': { |
| 2130 | 'VCLinkerTool': { |
| 2131 | 'Profile': 'true', |
| 2132 | }, |
| 2133 | }, |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 2134 | 'defines': [ |
| 2135 | 'ADDRESS_SANITIZER', |
| 2136 | 'MEMORY_TOOL_REPLACES_ALLOCATOR', |
| 2137 | ], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2138 | }], # asan==1 and OS=="win" |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2139 | ['coverage!=0', { |
| 2140 | 'conditions': [ |
| 2141 | ['OS=="mac" or OS=="ios"', { |
| 2142 | 'xcode_settings': { |
| 2143 | 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs |
| 2144 | 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage |
| 2145 | }, |
| 2146 | }], |
| 2147 | ['OS=="mac"', { |
| 2148 | # Add -lgcov for types executable, shared_library, and |
| 2149 | # loadable_module; not for static_library. |
| 2150 | # This is a delayed conditional. |
| 2151 | 'target_conditions': [ |
| 2152 | ['_type!="static_library"', { |
| 2153 | 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] }, |
| 2154 | }], |
| 2155 | ], |
| 2156 | }], |
| 2157 | ['OS=="linux" or OS=="android"', { |
| 2158 | 'cflags': [ '-ftest-coverage', |
| 2159 | '-fprofile-arcs' ], |
| 2160 | 'link_settings': { 'libraries': [ '-lgcov' ] }, |
| 2161 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2162 | ['OS=="win"', { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2163 | 'variables': { |
| 2164 | # Disable incremental linking for all modules. |
| 2165 | # 0: inherit, 1: disabled, 2: enabled. |
| 2166 | 'msvs_debug_link_incremental': '1', |
| 2167 | 'msvs_large_module_debug_link_mode': '1', |
| 2168 | # Disable RTC. Syzygy explicitly doesn't support RTC instrumented |
| 2169 | # binaries for now. |
| 2170 | 'win_debug_RuntimeChecks': '0', |
| 2171 | }, |
| 2172 | 'defines': [ |
| 2173 | # Disable iterator debugging (huge speed boost without any |
| 2174 | # change in coverage results). |
| 2175 | '_HAS_ITERATOR_DEBUGGING=0', |
| 2176 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2177 | 'msvs_settings': { |
| 2178 | 'VCLinkerTool': { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2179 | # Enable profile information (necessary for coverage |
| 2180 | # instrumentation). This is incompatible with incremental |
| 2181 | # linking. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2182 | 'Profile': 'true', |
| 2183 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2184 | } |
| 2185 | }], # OS==win |
| 2186 | ], # conditions for coverage |
| 2187 | }], # coverage!=0 |
| 2188 | ['OS=="win"', { |
| 2189 | 'defines': [ |
| 2190 | '__STD_C', |
| 2191 | '_CRT_SECURE_NO_DEPRECATE', |
| 2192 | '_SCL_SECURE_NO_DEPRECATE', |
| 2193 | # This define is required to pull in the new Win8 interfaces from |
| 2194 | # system headers like ShObjIdl.h. |
| 2195 | 'NTDDI_VERSION=0x06020000', |
| 2196 | ], |
| 2197 | 'include_dirs': [ |
| 2198 | '<(DEPTH)/third_party/wtl/include', |
| 2199 | ], |
| 2200 | 'conditions': [ |
| 2201 | ['win_z7!=0', { |
| 2202 | 'msvs_settings': { |
| 2203 | # Generates debug info when win_z7=1 |
| 2204 | # even if fastbuild=1 (that makes GenerateDebugInformation false). |
| 2205 | 'VCLinkerTool': { |
| 2206 | 'GenerateDebugInformation': 'true', |
| 2207 | }, |
| 2208 | 'VCCLCompilerTool': { |
| 2209 | 'DebugInformationFormat': '1', |
| 2210 | } |
| 2211 | } |
| 2212 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2213 | ['"<(GENERATOR)"=="msvs"', { |
| 2214 | 'msvs_settings': { |
| 2215 | 'VCLinkerTool': { |
| 2216 | # Make the pdb name sane. Otherwise foo.exe and foo.dll both |
| 2217 | # have foo.pdb. The ninja generator already defaults to this and |
| 2218 | # can't handle the $(TargetPath) macro. |
| 2219 | 'ProgramDatabaseFile': '$(TargetPath).pdb', |
| 2220 | } |
| 2221 | }, |
| 2222 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2223 | ], # win_z7!=0 |
| 2224 | }], # OS==win |
| 2225 | ['enable_task_manager==1', { |
| 2226 | 'defines': [ |
| 2227 | 'ENABLE_TASK_MANAGER=1', |
| 2228 | ], |
| 2229 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2230 | ['enable_extensions==1', { |
| 2231 | 'defines': [ |
| 2232 | 'ENABLE_EXTENSIONS=1', |
| 2233 | ], |
| 2234 | }], |
| 2235 | ['OS=="win" and branding=="Chrome"', { |
| 2236 | 'defines': ['ENABLE_SWIFTSHADER'], |
| 2237 | }], |
| 2238 | ['enable_dart==1', { |
| 2239 | 'defines': ['WEBKIT_USING_DART=1'], |
| 2240 | }], |
| 2241 | ['enable_plugin_installation==1', { |
| 2242 | 'defines': ['ENABLE_PLUGIN_INSTALLATION=1'], |
| 2243 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2244 | ['enable_plugins==1', { |
| 2245 | 'defines': ['ENABLE_PLUGINS=1'], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2246 | }], |
| 2247 | ['enable_session_service==1', { |
| 2248 | 'defines': ['ENABLE_SESSION_SERVICE=1'], |
| 2249 | }], |
| 2250 | ['enable_themes==1', { |
| 2251 | 'defines': ['ENABLE_THEMES=1'], |
| 2252 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2253 | ['enable_autofill_dialog==1', { |
| 2254 | 'defines': ['ENABLE_AUTOFILL_DIALOG=1'], |
| 2255 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2256 | ['enable_background==1', { |
| 2257 | 'defines': ['ENABLE_BACKGROUND=1'], |
| 2258 | }], |
| 2259 | ['enable_automation==1', { |
| 2260 | 'defines': ['ENABLE_AUTOMATION=1'], |
| 2261 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2262 | ['enable_google_now==1', { |
| 2263 | 'defines': ['ENABLE_GOOGLE_NOW=1'], |
| 2264 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2265 | ['enable_printing==1', { |
| 2266 | 'defines': ['ENABLE_PRINTING=1'], |
| 2267 | }], |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 2268 | ['enable_spellcheck==1', { |
| 2269 | 'defines': ['ENABLE_SPELLCHECK=1'], |
| 2270 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2271 | ['enable_captive_portal_detection==1', { |
| 2272 | 'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'], |
| 2273 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2274 | ['enable_app_list==1', { |
| 2275 | 'defines': ['ENABLE_APP_LIST=1'], |
| 2276 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2277 | ['enable_settings_app==1', { |
| 2278 | 'defines': ['ENABLE_SETTINGS_APP=1'], |
| 2279 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2280 | ['disable_ftp_support==1', { |
| 2281 | 'defines': ['DISABLE_FTP_SUPPORT=1'], |
| 2282 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2283 | ['enable_managed_users==1', { |
| 2284 | 'defines': ['ENABLE_MANAGED_USERS=1'], |
| 2285 | }], |
| 2286 | ['spdy_proxy_auth_origin != ""', { |
| 2287 | 'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'], |
| 2288 | }], |
| 2289 | ['spdy_proxy_auth_property != ""', { |
| 2290 | 'defines': ['SPDY_PROXY_AUTH_PROPERTY="<(spdy_proxy_auth_property)"'], |
| 2291 | }], |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 2292 | ['spdy_proxy_auth_value != ""', { |
| 2293 | 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'], |
| 2294 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 2295 | ['enable_mdns==1', { |
| 2296 | 'defines': ['ENABLE_MDNS=1'], |
| 2297 | }] |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2298 | ], # conditions for 'target_defaults' |
| 2299 | 'target_conditions': [ |
| 2300 | ['enable_wexit_time_destructors==1', { |
| 2301 | 'conditions': [ |
| 2302 | [ 'clang==1', { |
| 2303 | 'cflags': [ |
| 2304 | '-Wexit-time-destructors', |
| 2305 | ], |
| 2306 | 'xcode_settings': { |
| 2307 | 'WARNING_CFLAGS': [ |
| 2308 | '-Wexit-time-destructors', |
| 2309 | ], |
| 2310 | }, |
| 2311 | }], |
| 2312 | ], |
| 2313 | }], |
| 2314 | ['chromium_code==0', { |
| 2315 | 'conditions': [ |
| 2316 | [ 'os_posix==1 and OS!="mac" and OS!="ios"', { |
| 2317 | # We don't want to get warnings from third-party code, |
| 2318 | # so remove any existing warning-enabling flags like -Wall. |
| 2319 | 'cflags!': [ |
| 2320 | '-Wall', |
| 2321 | '-Wextra', |
| 2322 | ], |
| 2323 | 'cflags_cc': [ |
| 2324 | # Don't warn about hash_map in third-party code. |
| 2325 | '-Wno-deprecated', |
| 2326 | ], |
| 2327 | 'cflags': [ |
| 2328 | # Don't warn about printf format problems. |
| 2329 | # This is off by default in gcc but on in Ubuntu's gcc(!). |
| 2330 | '-Wno-format', |
| 2331 | ], |
| 2332 | 'cflags_cc!': [ |
| 2333 | # TODO(fischman): remove this. |
| 2334 | # http://code.google.com/p/chromium/issues/detail?id=90453 |
| 2335 | '-Wsign-compare', |
| 2336 | ] |
| 2337 | }], |
| 2338 | # TODO: Fix all warnings on chromeos too. |
| 2339 | [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', { |
| 2340 | 'cflags!': [ |
| 2341 | '-Werror', |
| 2342 | ], |
| 2343 | }], |
| 2344 | [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', { |
| 2345 | 'cflags': [ |
| 2346 | # Don't warn about ignoring the return value from e.g. close(). |
| 2347 | # This is off by default in some gccs but on by default in others. |
| 2348 | # BSD systems do not support this option, since they are usually |
| 2349 | # using gcc 4.2.1, which does not have this flag yet. |
| 2350 | '-Wno-unused-result', |
| 2351 | ], |
| 2352 | }], |
| 2353 | [ 'OS=="win"', { |
| 2354 | 'defines': [ |
| 2355 | '_CRT_SECURE_NO_DEPRECATE', |
| 2356 | '_CRT_NONSTDC_NO_WARNINGS', |
| 2357 | '_CRT_NONSTDC_NO_DEPRECATE', |
| 2358 | '_SCL_SECURE_NO_DEPRECATE', |
| 2359 | ], |
| 2360 | 'msvs_disabled_warnings': [4800], |
| 2361 | 'msvs_settings': { |
| 2362 | 'VCCLCompilerTool': { |
| 2363 | 'WarningLevel': '3', |
| 2364 | 'WarnAsError': '<(win_third_party_warn_as_error)', |
| 2365 | 'Detect64BitPortabilityProblems': 'false', |
| 2366 | }, |
| 2367 | }, |
| 2368 | 'conditions': [ |
| 2369 | ['buildtype=="Official"', { |
| 2370 | 'msvs_settings': { |
| 2371 | 'VCCLCompilerTool': { 'WarnAsError': 'false' }, |
| 2372 | } |
| 2373 | }], |
| 2374 | ], |
| 2375 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2376 | # TODO(darin): Unfortunately, some third_party code depends on base. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2377 | [ 'OS=="win" and component=="shared_library"', { |
| 2378 | 'msvs_disabled_warnings': [ |
| 2379 | 4251, # class 'std::xx' needs to have dll-interface. |
| 2380 | ], |
| 2381 | }], |
| 2382 | [ 'OS=="mac" or OS=="ios"', { |
| 2383 | 'xcode_settings': { |
| 2384 | 'WARNING_CFLAGS!': ['-Wall', '-Wextra'], |
| 2385 | }, |
| 2386 | 'conditions': [ |
| 2387 | ['buildtype=="Official"', { |
| 2388 | 'xcode_settings': { |
| 2389 | 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror |
| 2390 | }, |
| 2391 | }], |
| 2392 | ], |
| 2393 | }], |
| 2394 | [ 'OS=="ios"', { |
| 2395 | 'xcode_settings': { |
| 2396 | # TODO(ios): Fix remaining warnings in third-party code, then |
| 2397 | # remove this; the Mac cleanup didn't get everything that's |
| 2398 | # flagged in an iOS build. |
| 2399 | 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', |
| 2400 | 'RUN_CLANG_STATIC_ANALYZER': 'NO', |
| 2401 | }, |
| 2402 | }], |
| 2403 | ], |
| 2404 | }, { |
| 2405 | 'includes': [ |
| 2406 | # Rules for excluding e.g. foo_win.cc from the build on non-Windows. |
| 2407 | 'filename_rules.gypi', |
| 2408 | ], |
| 2409 | # In Chromium code, we define __STDC_foo_MACROS in order to get the |
| 2410 | # C99 macros on Mac and Linux. |
| 2411 | 'defines': [ |
| 2412 | '__STDC_CONSTANT_MACROS', |
| 2413 | '__STDC_FORMAT_MACROS', |
| 2414 | ], |
| 2415 | 'conditions': [ |
| 2416 | ['OS=="win"', { |
| 2417 | # turn on warnings for signed/unsigned mismatch on chromium code. |
| 2418 | 'msvs_settings': { |
| 2419 | 'VCCLCompilerTool': { |
| 2420 | 'AdditionalOptions': ['/we4389'], |
| 2421 | }, |
| 2422 | }, |
| 2423 | }], |
| 2424 | ['OS=="win" and component=="shared_library"', { |
| 2425 | 'msvs_disabled_warnings': [ |
| 2426 | 4251, # class 'std::xx' needs to have dll-interface. |
| 2427 | ], |
| 2428 | }], |
| 2429 | ], |
| 2430 | }], |
| 2431 | ], # target_conditions for 'target_defaults' |
| 2432 | 'default_configuration': 'Debug', |
| 2433 | 'configurations': { |
| 2434 | # VCLinkerTool LinkIncremental values below: |
| 2435 | # 0 == default |
| 2436 | # 1 == /INCREMENTAL:NO |
| 2437 | # 2 == /INCREMENTAL |
| 2438 | # Debug links incremental, Release does not. |
| 2439 | # |
| 2440 | # Abstract base configurations to cover common attributes. |
| 2441 | # |
| 2442 | 'Common_Base': { |
| 2443 | 'abstract': 1, |
| 2444 | 'msvs_configuration_attributes': { |
| 2445 | 'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)', |
| 2446 | 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', |
| 2447 | 'CharacterSet': '1', |
| 2448 | }, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2449 | # Add the default import libs. |
| 2450 | 'msvs_settings':{ |
| 2451 | 'VCLinkerTool': { |
| 2452 | 'AdditionalDependencies': [ |
| 2453 | 'kernel32.lib', |
| 2454 | 'gdi32.lib', |
| 2455 | 'winspool.lib', |
| 2456 | 'comdlg32.lib', |
| 2457 | 'advapi32.lib', |
| 2458 | 'shell32.lib', |
| 2459 | 'ole32.lib', |
| 2460 | 'oleaut32.lib', |
| 2461 | 'user32.lib', |
| 2462 | 'uuid.lib', |
| 2463 | 'odbc32.lib', |
| 2464 | 'odbccp32.lib', |
| 2465 | 'delayimp.lib', |
| 2466 | ], |
| 2467 | }, |
| 2468 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2469 | }, |
| 2470 | 'x86_Base': { |
| 2471 | 'abstract': 1, |
| 2472 | 'msvs_settings': { |
| 2473 | 'VCLinkerTool': { |
| 2474 | 'TargetMachine': '1', |
| 2475 | }, |
| 2476 | }, |
| 2477 | 'msvs_configuration_platform': 'Win32', |
| 2478 | }, |
| 2479 | 'x64_Base': { |
| 2480 | 'abstract': 1, |
| 2481 | 'msvs_configuration_platform': 'x64', |
| 2482 | 'msvs_settings': { |
| 2483 | 'VCLinkerTool': { |
| 2484 | 'TargetMachine': '17', # x86 - 64 |
| 2485 | 'AdditionalLibraryDirectories!': |
| 2486 | ['<(windows_sdk_path)/Lib/win8/um/x86'], |
| 2487 | 'AdditionalLibraryDirectories': |
| 2488 | ['<(windows_sdk_path)/Lib/win8/um/x64'], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2489 | # Doesn't exist x64 SDK. Should use oleaut32 in any case. |
| 2490 | 'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2491 | }, |
| 2492 | 'VCLibrarianTool': { |
| 2493 | 'AdditionalLibraryDirectories!': |
| 2494 | ['<(windows_sdk_path)/Lib/win8/um/x86'], |
| 2495 | 'AdditionalLibraryDirectories': |
| 2496 | ['<(windows_sdk_path)/Lib/win8/um/x64'], |
| 2497 | }, |
| 2498 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2499 | }, |
| 2500 | 'Debug_Base': { |
| 2501 | 'abstract': 1, |
| 2502 | 'defines': [ |
| 2503 | 'DYNAMIC_ANNOTATIONS_ENABLED=1', |
| 2504 | 'WTF_USE_DYNAMIC_ANNOTATIONS=1', |
| 2505 | ], |
| 2506 | 'xcode_settings': { |
| 2507 | 'COPY_PHASE_STRIP': 'NO', |
| 2508 | 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)', |
| 2509 | 'OTHER_CFLAGS': [ |
| 2510 | '<@(debug_extra_cflags)', |
| 2511 | ], |
| 2512 | }, |
| 2513 | 'msvs_settings': { |
| 2514 | 'VCCLCompilerTool': { |
| 2515 | 'Optimization': '<(win_debug_Optimization)', |
| 2516 | 'PreprocessorDefinitions': ['_DEBUG'], |
| 2517 | 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)', |
| 2518 | 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)', |
| 2519 | 'conditions': [ |
| 2520 | # According to MSVS, InlineFunctionExpansion=0 means |
| 2521 | # "default inlining", not "/Ob0". |
| 2522 | # Thus, we have to handle InlineFunctionExpansion==0 separately. |
| 2523 | ['win_debug_InlineFunctionExpansion==0', { |
| 2524 | 'AdditionalOptions': ['/Ob0'], |
| 2525 | }], |
| 2526 | ['win_debug_InlineFunctionExpansion!=""', { |
| 2527 | 'InlineFunctionExpansion': |
| 2528 | '<(win_debug_InlineFunctionExpansion)', |
| 2529 | }], |
| 2530 | ['win_debug_disable_iterator_debugging==1', { |
| 2531 | 'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'], |
| 2532 | }], |
| 2533 | |
| 2534 | # if win_debug_OmitFramePointers is blank, leave as default |
| 2535 | ['win_debug_OmitFramePointers==1', { |
| 2536 | 'OmitFramePointers': 'true', |
| 2537 | }], |
| 2538 | ['win_debug_OmitFramePointers==0', { |
| 2539 | 'OmitFramePointers': 'false', |
| 2540 | # The above is not sufficient (http://crbug.com/106711): it |
| 2541 | # simply eliminates an explicit "/Oy", but both /O2 and /Ox |
| 2542 | # perform FPO regardless, so we must explicitly disable. |
| 2543 | # We still want the false setting above to avoid having |
| 2544 | # "/Oy /Oy-" and warnings about overriding. |
| 2545 | 'AdditionalOptions': ['/Oy-'], |
| 2546 | }], |
| 2547 | ], |
| 2548 | 'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ], |
| 2549 | }, |
| 2550 | 'VCLinkerTool': { |
| 2551 | 'LinkIncremental': '<(msvs_debug_link_incremental)', |
| 2552 | # ASLR makes debugging with windbg difficult because Chrome.exe and |
| 2553 | # Chrome.dll share the same base name. As result, windbg will |
| 2554 | # name the Chrome.dll module like chrome_<base address>, where |
| 2555 | # <base address> typically changes with each launch. This in turn |
| 2556 | # means that breakpoints in Chrome.dll don't stick from one launch |
| 2557 | # to the next. For this reason, we turn ASLR off in debug builds. |
| 2558 | # Note that this is a three-way bool, where 0 means to pick up |
| 2559 | # the default setting, 1 is off and 2 is on. |
| 2560 | 'RandomizedBaseAddress': 1, |
| 2561 | }, |
| 2562 | 'VCResourceCompilerTool': { |
| 2563 | 'PreprocessorDefinitions': ['_DEBUG'], |
| 2564 | }, |
| 2565 | }, |
| 2566 | 'conditions': [ |
| 2567 | ['OS=="linux" or OS=="android"', { |
| 2568 | 'target_conditions': [ |
| 2569 | ['_toolset=="target"', { |
| 2570 | 'cflags': [ |
| 2571 | '<@(debug_extra_cflags)', |
| 2572 | ], |
| 2573 | }], |
| 2574 | ], |
| 2575 | }], |
| 2576 | # Disabled on iOS because it was causing a crash on startup. |
| 2577 | # TODO(michelea): investigate, create a reduced test and possibly |
| 2578 | # submit a radar. |
| 2579 | ['release_valgrind_build==0 and OS!="ios"', { |
| 2580 | 'xcode_settings': { |
| 2581 | 'OTHER_CFLAGS': [ |
| 2582 | '-fstack-protector-all', # Implies -fstack-protector |
| 2583 | ], |
| 2584 | }, |
| 2585 | }], |
| 2586 | ], |
| 2587 | }, |
| 2588 | 'Release_Base': { |
| 2589 | 'abstract': 1, |
| 2590 | 'defines': [ |
| 2591 | 'NDEBUG', |
| 2592 | ], |
| 2593 | 'xcode_settings': { |
| 2594 | 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip |
| 2595 | 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)', |
| 2596 | 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ], |
| 2597 | }, |
| 2598 | 'msvs_settings': { |
| 2599 | 'VCCLCompilerTool': { |
| 2600 | 'RuntimeLibrary': '<(win_release_RuntimeLibrary)', |
| 2601 | 'conditions': [ |
| 2602 | # In official builds, each target will self-select |
| 2603 | # an optimization level. |
| 2604 | ['buildtype!="Official"', { |
| 2605 | 'Optimization': '<(win_release_Optimization)', |
| 2606 | }, |
| 2607 | ], |
| 2608 | # According to MSVS, InlineFunctionExpansion=0 means |
| 2609 | # "default inlining", not "/Ob0". |
| 2610 | # Thus, we have to handle InlineFunctionExpansion==0 separately. |
| 2611 | ['win_release_InlineFunctionExpansion==0', { |
| 2612 | 'AdditionalOptions': ['/Ob0'], |
| 2613 | }], |
| 2614 | ['win_release_InlineFunctionExpansion!=""', { |
| 2615 | 'InlineFunctionExpansion': |
| 2616 | '<(win_release_InlineFunctionExpansion)', |
| 2617 | }], |
| 2618 | |
| 2619 | # if win_release_OmitFramePointers is blank, leave as default |
| 2620 | ['win_release_OmitFramePointers==1', { |
| 2621 | 'OmitFramePointers': 'true', |
| 2622 | }], |
| 2623 | ['win_release_OmitFramePointers==0', { |
| 2624 | 'OmitFramePointers': 'false', |
| 2625 | # The above is not sufficient (http://crbug.com/106711): it |
| 2626 | # simply eliminates an explicit "/Oy", but both /O2 and /Ox |
| 2627 | # perform FPO regardless, so we must explicitly disable. |
| 2628 | # We still want the false setting above to avoid having |
| 2629 | # "/Oy /Oy-" and warnings about overriding. |
| 2630 | 'AdditionalOptions': ['/Oy-'], |
| 2631 | }], |
| 2632 | ], |
| 2633 | 'AdditionalOptions': [ '<@(win_release_extra_cflags)', ], |
| 2634 | }, |
| 2635 | 'VCLinkerTool': { |
| 2636 | # LinkIncremental is a tri-state boolean, where 0 means default |
| 2637 | # (i.e., inherit from parent solution), 1 means false, and |
| 2638 | # 2 means true. |
| 2639 | 'LinkIncremental': '1', |
| 2640 | # This corresponds to the /PROFILE flag which ensures the PDB |
| 2641 | # file contains FIXUP information (growing the PDB file by about |
| 2642 | # 5%) but does not otherwise alter the output binary. This |
| 2643 | # information is used by the Syzygy optimization tool when |
| 2644 | # decomposing the release image. |
| 2645 | 'Profile': 'true', |
| 2646 | }, |
| 2647 | }, |
| 2648 | 'conditions': [ |
| 2649 | ['msvs_use_common_release', { |
| 2650 | 'includes': ['release.gypi'], |
| 2651 | }], |
| 2652 | ['release_valgrind_build==0 and tsan==0', { |
| 2653 | 'defines': [ |
| 2654 | 'NVALGRIND', |
| 2655 | 'DYNAMIC_ANNOTATIONS_ENABLED=0', |
| 2656 | ], |
| 2657 | }, { |
| 2658 | 'defines': [ |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 2659 | 'MEMORY_TOOL_REPLACES_ALLOCATOR', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2660 | 'DYNAMIC_ANNOTATIONS_ENABLED=1', |
| 2661 | 'WTF_USE_DYNAMIC_ANNOTATIONS=1', |
| 2662 | ], |
| 2663 | }], |
| 2664 | ['win_use_allocator_shim==0', { |
| 2665 | 'defines': ['NO_TCMALLOC'], |
| 2666 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2667 | ['os_posix==1 and chromium_code==1', { |
| 2668 | # Non-chromium code is not guaranteed to compile cleanly |
| 2669 | # with _FORTIFY_SOURCE. Also, fortified build may fail |
| 2670 | # when optimizations are disabled, so only do that for Release |
| 2671 | # build. |
| 2672 | 'defines': [ |
| 2673 | '_FORTIFY_SOURCE=2', |
| 2674 | ], |
| 2675 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2676 | ['OS=="linux" or OS=="android"', { |
| 2677 | 'target_conditions': [ |
| 2678 | ['_toolset=="target"', { |
| 2679 | 'cflags': [ |
| 2680 | '<@(release_extra_cflags)', |
| 2681 | ], |
| 2682 | }], |
| 2683 | ], |
| 2684 | }], |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 2685 | ['OS=="ios"', { |
| 2686 | 'defines': [ |
| 2687 | 'NS_BLOCK_ASSERTIONS=1', |
| 2688 | ], |
| 2689 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2690 | ], |
| 2691 | }, |
| 2692 | # |
| 2693 | # Concrete configurations |
| 2694 | # |
| 2695 | 'Debug': { |
| 2696 | 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'], |
| 2697 | }, |
| 2698 | 'Release': { |
| 2699 | 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'], |
| 2700 | }, |
| 2701 | 'conditions': [ |
| 2702 | [ 'OS=="win"', { |
| 2703 | # TODO(bradnelson): add a gyp mechanism to make this more graceful. |
| 2704 | 'Debug_x64': { |
| 2705 | 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'], |
| 2706 | }, |
| 2707 | 'Release_x64': { |
| 2708 | 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'], |
| 2709 | }, |
| 2710 | }], |
| 2711 | ], |
| 2712 | }, |
| 2713 | }, |
| 2714 | 'conditions': [ |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2715 | ['os_posix==1', { |
| 2716 | 'target_defaults': { |
| 2717 | 'ldflags': [ |
| 2718 | '-Wl,-z,now', |
| 2719 | '-Wl,-z,relro', |
| 2720 | ], |
| 2721 | }, |
| 2722 | }], |
| 2723 | ['os_posix==1 and chromeos==0', { |
| 2724 | # Chrome OS enables -fstack-protector-strong via its build wrapper, |
| 2725 | # and we want to avoid overriding this, so stack-protector is only |
| 2726 | # enabled when not building on Chrome OS. |
| 2727 | # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc |
| 2728 | # supports it. |
| 2729 | 'target_defaults': { |
| 2730 | 'cflags': [ |
| 2731 | '-fstack-protector', |
| 2732 | '--param=ssp-buffer-size=4', |
| 2733 | ], |
| 2734 | }, |
| 2735 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2736 | ['os_posix==1 and OS!="mac" and OS!="ios"', { |
| 2737 | 'target_defaults': { |
| 2738 | # Enable -Werror by default, but put it in a variable so it can |
| 2739 | # be disabled in ~/.gyp/include.gypi on the valgrind builders. |
| 2740 | 'variables': { |
| 2741 | 'werror%': '-Werror', |
| 2742 | 'libraries_for_target%': '', |
| 2743 | }, |
| 2744 | 'defines': [ |
| 2745 | '_FILE_OFFSET_BITS=64', |
| 2746 | ], |
| 2747 | 'cflags': [ |
| 2748 | '<(werror)', # See note above about the werror variable. |
| 2749 | '-pthread', |
| 2750 | '-fno-exceptions', |
| 2751 | '-fno-strict-aliasing', # See http://crbug.com/32204 |
| 2752 | '-Wall', |
| 2753 | # TODO(evan): turn this back on once all the builds work. |
| 2754 | # '-Wextra', |
| 2755 | # Don't warn about unused function params. We use those everywhere. |
| 2756 | '-Wno-unused-parameter', |
| 2757 | # Don't warn about the "struct foo f = {0};" initialization pattern. |
| 2758 | '-Wno-missing-field-initializers', |
| 2759 | # Don't export any symbols (for example, to plugins we dlopen()). |
| 2760 | # Note: this is *required* to make some plugins work. |
| 2761 | '-fvisibility=hidden', |
| 2762 | '-pipe', |
| 2763 | ], |
| 2764 | 'cflags_cc': [ |
| 2765 | '-fno-rtti', |
| 2766 | '-fno-threadsafe-statics', |
| 2767 | # Make inline functions have hidden visiblity by default. |
| 2768 | # Surprisingly, not covered by -fvisibility=hidden. |
| 2769 | '-fvisibility-inlines-hidden', |
| 2770 | # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't, |
| 2771 | # so we specify it explicitly. |
| 2772 | # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it. |
| 2773 | # http://code.google.com/p/chromium/issues/detail?id=90453 |
| 2774 | '-Wsign-compare', |
| 2775 | ], |
| 2776 | 'ldflags': [ |
| 2777 | '-pthread', '-Wl,-z,noexecstack', |
| 2778 | ], |
| 2779 | 'libraries' : [ |
| 2780 | '<(libraries_for_target)', |
| 2781 | ], |
| 2782 | 'configurations': { |
| 2783 | 'Debug_Base': { |
| 2784 | 'variables': { |
| 2785 | 'debug_optimize%': '0', |
| 2786 | }, |
| 2787 | 'defines': [ |
| 2788 | '_DEBUG', |
| 2789 | ], |
| 2790 | 'cflags': [ |
| 2791 | '-O>(debug_optimize)', |
| 2792 | '-g', |
| 2793 | ], |
| 2794 | 'conditions' : [ |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 2795 | ['OS=="android"', { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 2796 | 'ldflags': [ |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 2797 | '-Wl,--fatal-warnings', |
| 2798 | # Only link with needed input sections. This is to avoid |
| 2799 | # getting undefined reference to __cxa_bad_typeid in the CDU |
| 2800 | # library. |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 2801 | '-Wl,--gc-sections', |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 2802 | # Warn in case of text relocations. |
| 2803 | '-Wl,--warn-shared-textrel', |
| 2804 | ], |
| 2805 | }], |
| 2806 | ['OS=="android" and android_webview_build==1', { |
| 2807 | 'ldflags!': [ |
| 2808 | # Must not turn on --fatal-warnings or warn-shared-textrel, |
| 2809 | # see crbug.com/157326. |
| 2810 | '-Wl,--fatal-warnings', |
| 2811 | '-Wl,--warn-shared-textrel', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 2812 | ], |
| 2813 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2814 | ['OS=="android" and android_full_debug==0', { |
| 2815 | # Some configurations are copied from Release_Base to reduce |
| 2816 | # the binary size. |
| 2817 | 'variables': { |
| 2818 | 'debug_optimize%': 's', |
| 2819 | }, |
| 2820 | 'cflags': [ |
| 2821 | '-fomit-frame-pointer', |
| 2822 | '-fdata-sections', |
| 2823 | '-ffunction-sections', |
| 2824 | ], |
| 2825 | 'ldflags': [ |
| 2826 | '-Wl,-O1', |
| 2827 | '-Wl,--as-needed', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2828 | ], |
| 2829 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2830 | ['OS=="linux" and target_arch=="ia32"', { |
| 2831 | 'ldflags': [ |
| 2832 | '-Wl,--no-as-needed', |
| 2833 | ], |
| 2834 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2835 | ], |
| 2836 | }, |
| 2837 | 'Release_Base': { |
| 2838 | 'variables': { |
| 2839 | 'release_optimize%': '2', |
| 2840 | # Binaries become big and gold is unable to perform GC |
| 2841 | # and remove unused sections for some of test targets |
| 2842 | # on 32 bit platform. |
| 2843 | # (This is currently observed only in chromeos valgrind bots) |
| 2844 | # The following flag is to disable --gc-sections linker |
| 2845 | # option for these bots. |
| 2846 | 'no_gc_sections%': 0, |
| 2847 | |
| 2848 | # TODO(bradnelson): reexamine how this is done if we change the |
| 2849 | # expansion of configurations |
| 2850 | 'release_valgrind_build%': 0, |
| 2851 | }, |
| 2852 | 'cflags': [ |
| 2853 | '-O<(release_optimize)', |
| 2854 | # Don't emit the GCC version ident directives, they just end up |
| 2855 | # in the .comment section taking up binary size. |
| 2856 | '-fno-ident', |
| 2857 | # Put data and code in their own sections, so that unused symbols |
| 2858 | # can be removed at link time with --gc-sections. |
| 2859 | '-fdata-sections', |
| 2860 | '-ffunction-sections', |
| 2861 | ], |
| 2862 | 'ldflags': [ |
| 2863 | # Specifically tell the linker to perform optimizations. |
| 2864 | # See http://lwn.net/Articles/192624/ . |
| 2865 | '-Wl,-O1', |
| 2866 | '-Wl,--as-needed', |
| 2867 | ], |
| 2868 | 'conditions' : [ |
| 2869 | ['no_gc_sections==0', { |
| 2870 | 'ldflags': [ |
| 2871 | '-Wl,--gc-sections', |
| 2872 | ], |
| 2873 | }], |
| 2874 | ['OS=="android"', { |
| 2875 | 'variables': { |
| 2876 | 'release_optimize%': 's', |
| 2877 | }, |
| 2878 | 'cflags': [ |
| 2879 | '-fomit-frame-pointer', |
| 2880 | ], |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 2881 | 'ldflags': [ |
| 2882 | '-Wl,--fatal-warnings', |
| 2883 | # Warn in case of text relocations. |
| 2884 | '-Wl,--warn-shared-textrel', |
| 2885 | ], |
| 2886 | }], |
| 2887 | ['OS=="android" and android_webview_build==1', { |
| 2888 | 'ldflags!': [ |
| 2889 | # Must not turn on --fatal-warnings or |
| 2890 | # shared-text-rel, see crbug.com/157326. |
| 2891 | '-Wl,--fatal-warnings', |
| 2892 | '-Wl,--warn-shared-textrel', |
| 2893 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2894 | }], |
| 2895 | ['clang==1', { |
| 2896 | 'cflags!': [ |
| 2897 | '-fno-ident', |
| 2898 | ], |
| 2899 | }], |
| 2900 | ['profiling==1', { |
| 2901 | 'cflags': [ |
| 2902 | '-fno-omit-frame-pointer', |
| 2903 | '-g', |
| 2904 | ], |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 2905 | 'conditions' : [ |
| 2906 | ['profiling_full_stack_frames==1', { |
| 2907 | 'cflags': [ |
| 2908 | '-fno-inline', |
| 2909 | '-fno-optimize-sibling-calls', |
| 2910 | ], |
| 2911 | }], |
| 2912 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2913 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2914 | # Can be omitted to reduce output size. Does not seem to affect |
| 2915 | # crash reporting. |
| 2916 | ['target_arch=="ia32"', { |
| 2917 | 'cflags': [ |
| 2918 | '-fno-unwind-tables', |
| 2919 | '-fno-asynchronous-unwind-tables', |
| 2920 | ], |
| 2921 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2922 | ], |
| 2923 | }, |
| 2924 | }, |
| 2925 | 'variants': { |
| 2926 | 'coverage': { |
| 2927 | 'cflags': ['-fprofile-arcs', '-ftest-coverage'], |
| 2928 | 'ldflags': ['-fprofile-arcs'], |
| 2929 | }, |
| 2930 | 'profile': { |
| 2931 | 'cflags': ['-pg', '-g'], |
| 2932 | 'ldflags': ['-pg'], |
| 2933 | }, |
| 2934 | 'symbols': { |
| 2935 | 'cflags': ['-g'], |
| 2936 | }, |
| 2937 | }, |
| 2938 | 'conditions': [ |
| 2939 | ['target_arch=="ia32"', { |
| 2940 | 'target_conditions': [ |
| 2941 | ['_toolset=="target"', { |
| 2942 | 'asflags': [ |
| 2943 | # Needed so that libs with .s files (e.g. libicudata.a) |
| 2944 | # are compatible with the general 32-bit-ness. |
| 2945 | '-32', |
| 2946 | ], |
| 2947 | # All floating-point computations on x87 happens in 80-bit |
| 2948 | # precision. Because the C and C++ language standards allow |
| 2949 | # the compiler to keep the floating-point values in higher |
| 2950 | # precision than what's specified in the source and doing so |
| 2951 | # is more efficient than constantly rounding up to 64-bit or |
| 2952 | # 32-bit precision as specified in the source, the compiler, |
| 2953 | # especially in the optimized mode, tries very hard to keep |
| 2954 | # values in x87 floating-point stack (in 80-bit precision) |
| 2955 | # as long as possible. This has important side effects, that |
| 2956 | # the real value used in computation may change depending on |
| 2957 | # how the compiler did the optimization - that is, the value |
| 2958 | # kept in 80-bit is different than the value rounded down to |
| 2959 | # 64-bit or 32-bit. There are possible compiler options to |
| 2960 | # make this behavior consistent (e.g. -ffloat-store would keep |
| 2961 | # all floating-values in the memory, thus force them to be |
| 2962 | # rounded to its original precision) but they have significant |
| 2963 | # runtime performance penalty. |
| 2964 | # |
| 2965 | # -mfpmath=sse -msse2 makes the compiler use SSE instructions |
| 2966 | # which keep floating-point values in SSE registers in its |
| 2967 | # native precision (32-bit for single precision, and 64-bit |
| 2968 | # for double precision values). This means the floating-point |
| 2969 | # value used during computation does not change depending on |
| 2970 | # how the compiler optimized the code, since the value is |
| 2971 | # always kept in its specified precision. |
| 2972 | 'conditions': [ |
| 2973 | ['branding=="Chromium" and disable_sse2==0', { |
| 2974 | 'cflags': [ |
| 2975 | '-march=pentium4', |
| 2976 | '-msse2', |
| 2977 | '-mfpmath=sse', |
| 2978 | ], |
| 2979 | }], |
| 2980 | # ChromeOS targets Pinetrail, which is sse3, but most of the |
| 2981 | # benefit comes from sse2 so this setting allows ChromeOS |
| 2982 | # to build on other CPUs. In the future -march=atom would |
| 2983 | # help but requires a newer compiler. |
| 2984 | ['chromeos==1 and disable_sse2==0', { |
| 2985 | 'cflags': [ |
| 2986 | '-msse2', |
| 2987 | ], |
| 2988 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 2989 | # Use gold linker for Android ia32 target. |
| 2990 | ['OS=="android"', { |
| 2991 | 'cflags': [ |
| 2992 | '-fuse-ld=gold', |
| 2993 | ], |
| 2994 | 'ldflags': [ |
| 2995 | '-fuse-ld=gold', |
| 2996 | ], |
| 2997 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2998 | # Install packages have started cropping up with |
| 2999 | # different headers between the 32-bit and 64-bit |
| 3000 | # versions, so we have to shadow those differences off |
| 3001 | # and make sure a 32-bit-on-64-bit build picks up the |
| 3002 | # right files. |
| 3003 | # For android build, use NDK headers instead of host headers |
| 3004 | ['host_arch!="ia32" and OS!="android"', { |
| 3005 | 'include_dirs+': [ |
| 3006 | '/usr/include32', |
| 3007 | ], |
| 3008 | }], |
| 3009 | ], |
| 3010 | # -mmmx allows mmintrin.h to be used for mmx intrinsics. |
| 3011 | # video playback is mmx and sse2 optimized. |
| 3012 | 'cflags': [ |
| 3013 | '-m32', |
| 3014 | '-mmmx', |
| 3015 | ], |
| 3016 | 'ldflags': [ |
| 3017 | '-m32', |
| 3018 | ], |
| 3019 | }], |
| 3020 | ], |
| 3021 | }], |
| 3022 | ['target_arch=="arm"', { |
| 3023 | 'target_conditions': [ |
| 3024 | ['_toolset=="target"', { |
| 3025 | 'cflags_cc': [ |
| 3026 | # The codesourcery arm-2009q3 toolchain warns at that the ABI |
| 3027 | # has changed whenever it encounters a varargs function. This |
| 3028 | # silences those warnings, as they are not helpful and |
| 3029 | # clutter legitimate warnings. |
| 3030 | '-Wno-abi', |
| 3031 | ], |
| 3032 | 'conditions': [ |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3033 | ['arm_arch!=""', { |
| 3034 | 'cflags': [ |
| 3035 | '-march=<(arm_arch)', |
| 3036 | ], |
| 3037 | }], |
| 3038 | ['arm_tune!=""', { |
| 3039 | 'cflags': [ |
| 3040 | '-mtune=<(arm_tune)', |
| 3041 | ], |
| 3042 | }], |
| 3043 | ['arm_fpu!=""', { |
| 3044 | 'cflags': [ |
| 3045 | '-mfpu=<(arm_fpu)', |
| 3046 | ], |
| 3047 | }], |
| 3048 | ['arm_float_abi!=""', { |
| 3049 | 'cflags': [ |
| 3050 | '-mfloat-abi=<(arm_float_abi)', |
| 3051 | ], |
| 3052 | }], |
| 3053 | ['arm_thumb==1', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3054 | 'cflags': [ |
| 3055 | '-mthumb', |
| 3056 | ] |
| 3057 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3058 | ['OS=="android"', { |
| 3059 | # Most of the following flags are derived from what Android |
| 3060 | # uses by default when building for arm, reference for which |
| 3061 | # can be found in the following file in the Android NDK: |
| 3062 | # toolchains/arm-linux-androideabi-4.4.3/setup.mk |
| 3063 | 'cflags': [ |
| 3064 | # The tree-sra optimization (scalar replacement for |
| 3065 | # aggregates enabling subsequent optimizations) leads to |
| 3066 | # invalid code generation when using the Android NDK's |
| 3067 | # compiler (r5-r7). This can be verified using |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3068 | # webkit_unit_tests' WTF.Checked_int8_t test. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3069 | '-fno-tree-sra', |
| 3070 | '-fuse-ld=gold', |
| 3071 | '-Wno-psabi', |
| 3072 | ], |
| 3073 | # Android now supports .relro sections properly. |
| 3074 | # NOTE: While these flags enable the generation of .relro |
| 3075 | # sections, the generated libraries can still be loaded on |
| 3076 | # older Android platform versions. |
| 3077 | 'ldflags': [ |
| 3078 | '-Wl,-z,relro', |
| 3079 | '-Wl,-z,now', |
| 3080 | '-fuse-ld=gold', |
| 3081 | ], |
| 3082 | 'conditions': [ |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3083 | ['arm_thumb==1', { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3084 | 'cflags': [ '-mthumb-interwork' ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3085 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3086 | ['profiling==1', { |
| 3087 | 'cflags': [ |
| 3088 | '-marm', # Probably reduntant, but recommend by "perf" docs. |
| 3089 | '-mapcs-frame', # Seems required by -fno-omit-frame-pointer. |
| 3090 | ], |
| 3091 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3092 | ['clang==1', { |
| 3093 | 'cflags!': [ |
| 3094 | # Clang does not support the following options. |
| 3095 | '-mthumb-interwork', |
| 3096 | '-finline-limit=64', |
| 3097 | '-fno-tree-sra', |
| 3098 | '-fuse-ld=gold', |
| 3099 | '-Wno-psabi', |
| 3100 | ], |
| 3101 | }], |
| 3102 | ], |
| 3103 | }], |
| 3104 | ], |
| 3105 | }], |
| 3106 | ], |
| 3107 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3108 | ['target_arch=="mipsel"', { |
| 3109 | 'target_conditions': [ |
| 3110 | ['_toolset=="target"', { |
| 3111 | 'conditions': [ |
Ben Murdoch | e31802a | 2013-06-27 01:37:20 +0100 | [diff] [blame] | 3112 | ['android_webview_build==0 and mips_arch_variant=="mips32r2"', { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3113 | 'cflags': ['-mips32r2', '-Wa,-mips32r2'], |
Ben Murdoch | e31802a | 2013-06-27 01:37:20 +0100 | [diff] [blame] | 3114 | }], |
| 3115 | ['android_webview_build==0 and mips_arch_variant!="mips32r2"', { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3116 | 'cflags': ['-mips32', '-Wa,-mips32'], |
| 3117 | }], |
| 3118 | ], |
| 3119 | 'cflags': [ |
| 3120 | '-EL', |
| 3121 | '-mhard-float', |
| 3122 | ], |
| 3123 | 'ldflags': [ |
| 3124 | '-EL', |
| 3125 | '-Wl,--no-keep-memory' |
| 3126 | ], |
| 3127 | 'cflags_cc': [ |
| 3128 | '-Wno-uninitialized', |
| 3129 | ], |
| 3130 | }], |
| 3131 | ], |
| 3132 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3133 | ['linux_fpic==1', { |
| 3134 | 'cflags': [ |
| 3135 | '-fPIC', |
| 3136 | ], |
| 3137 | 'ldflags': [ |
| 3138 | '-fPIC', |
| 3139 | ], |
| 3140 | }], |
| 3141 | ['sysroot!=""', { |
| 3142 | 'target_conditions': [ |
| 3143 | ['_toolset=="target"', { |
| 3144 | 'cflags': [ |
| 3145 | '--sysroot=<(sysroot)', |
| 3146 | ], |
| 3147 | 'ldflags': [ |
| 3148 | '--sysroot=<(sysroot)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3149 | '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3150 | ], |
| 3151 | }]] |
| 3152 | }], |
| 3153 | ['clang==1', { |
| 3154 | 'cflags': [ |
| 3155 | '-Wheader-hygiene', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3156 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3157 | # Don't die on dtoa code that uses a char as an array index. |
| 3158 | '-Wno-char-subscripts', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3159 | |
| 3160 | # Clang spots more unused functions. |
| 3161 | '-Wno-unused-function', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3162 | |
| 3163 | # Warns on switches on enums that cover all enum values but |
| 3164 | # also contain a default: branch. Chrome is full of that. |
| 3165 | '-Wno-covered-switch-default', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3166 | |
| 3167 | # Warns when a const char[] is converted to bool. |
| 3168 | '-Wstring-conversion', |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 3169 | |
| 3170 | # C++11-related flags: |
| 3171 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3172 | # This warns on using ints as initializers for floats in |
| 3173 | # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|), |
| 3174 | # which happens in several places in chrome code. Not sure if |
| 3175 | # this is worth fixing. |
| 3176 | '-Wno-c++11-narrowing', |
| 3177 | |
Ben Murdoch | bbcdd45 | 2013-07-25 10:06:34 +0100 | [diff] [blame] | 3178 | # TODO(thakis): Remove, http://crbug.com/263960 |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3179 | '-Wno-reserved-user-defined-literal', |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 3180 | |
| 3181 | # Clang considers the `register` keyword as deprecated, but e.g. |
| 3182 | # code generated by flex (used in angle) contains that keyword. |
| 3183 | # http://crbug.com/255186 |
| 3184 | '-Wno-deprecated-register', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3185 | ], |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 3186 | 'cflags!': [ |
| 3187 | # Clang doesn't seem to know know this flag. |
| 3188 | '-mfpmath=sse', |
| 3189 | ], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3190 | 'cflags_cc': [ |
| 3191 | # See the comment in the Mac section for what it takes to move |
| 3192 | # this to -std=c++11. |
| 3193 | '-std=gnu++11', |
| 3194 | ], |
| 3195 | }], |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 3196 | ['clang==1 and OS=="android"', { |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 3197 | # Android uses stlport, whose include/new defines |
| 3198 | # `void operator delete[](void* ptr) throw();`, which |
| 3199 | # clang's -Wimplicit-exception-spec-mismatch warns about for some |
| 3200 | # reason -- http://llvm.org/PR16638. TODO(thakis): Include stlport |
| 3201 | # via -isystem instead. |
| 3202 | 'cflags_cc': [ |
| 3203 | '-Wno-implicit-exception-spec-mismatch', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3204 | ], |
| 3205 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3206 | ['clang==1 and clang_use_chrome_plugins==1', { |
| 3207 | 'cflags': [ |
| 3208 | '<@(clang_chrome_plugins_flags)', |
| 3209 | ], |
| 3210 | }], |
| 3211 | ['clang==1 and clang_load!=""', { |
| 3212 | 'cflags': [ |
| 3213 | '-Xclang', '-load', '-Xclang', '<(clang_load)', |
| 3214 | ], |
| 3215 | }], |
| 3216 | ['clang==1 and clang_add_plugin!=""', { |
| 3217 | 'cflags': [ |
| 3218 | '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)', |
| 3219 | ], |
| 3220 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3221 | ['clang==1 and target_arch=="ia32"', { |
| 3222 | 'cflags': [ |
| 3223 | # Else building libyuv gives clang's register allocator issues, |
| 3224 | # see llvm.org/PR15798 / crbug.com/233709 |
| 3225 | '-momit-leaf-frame-pointer', |
| 3226 | ], |
| 3227 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3228 | ['clang==1 and "<(GENERATOR)"=="ninja"', { |
| 3229 | 'cflags': [ |
| 3230 | # See http://crbug.com/110262 |
| 3231 | '-fcolor-diagnostics', |
| 3232 | ], |
| 3233 | }], |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 3234 | # Common options for AddressSanitizer, LeakSanitizer, |
| 3235 | # ThreadSanitizer and MemorySanitizer. |
| 3236 | ['asan==1 or lsan==1 or tsan==1 or msan==1', { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3237 | 'target_conditions': [ |
| 3238 | ['_toolset=="target"', { |
| 3239 | 'cflags': [ |
| 3240 | '-fno-omit-frame-pointer', |
| 3241 | '-gline-tables-only', |
| 3242 | ], |
| 3243 | 'ldflags!': [ |
| 3244 | # Functions interposed by the sanitizers can make ld think |
| 3245 | # that some libraries aren't needed when they actually are, |
| 3246 | # http://crbug.com/234010. As workaround, disable --as-needed. |
| 3247 | '-Wl,--as-needed', |
| 3248 | ], |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 3249 | 'defines': [ |
| 3250 | 'MEMORY_TOOL_REPLACES_ALLOCATOR', |
| 3251 | ], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3252 | }], |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 3253 | ['_toolset=="target" and OS=="linux"', { |
| 3254 | 'ldflags': [ |
| 3255 | # http://crbug.com/234010. |
| 3256 | '-lrt', |
| 3257 | ], |
| 3258 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3259 | ], |
| 3260 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3261 | ['asan==1', { |
| 3262 | 'target_conditions': [ |
| 3263 | ['_toolset=="target"', { |
| 3264 | 'cflags': [ |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3265 | '-fsanitize=address', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3266 | '-w', # http://crbug.com/162783 |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3267 | ], |
| 3268 | 'ldflags': [ |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3269 | '-fsanitize=address', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3270 | ], |
| 3271 | 'defines': [ |
| 3272 | 'ADDRESS_SANITIZER', |
| 3273 | ], |
| 3274 | }], |
| 3275 | ], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3276 | 'conditions': [ |
| 3277 | ['OS=="mac"', { |
| 3278 | 'cflags': [ |
| 3279 | '-mllvm -asan-globals=0', # http://crbug.com/196561 |
| 3280 | ], |
| 3281 | }], |
| 3282 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3283 | }], |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 3284 | ['lsan==1', { |
| 3285 | 'target_conditions': [ |
| 3286 | ['_toolset=="target"', { |
| 3287 | 'cflags': [ |
| 3288 | '-fsanitize=leak', |
| 3289 | ], |
| 3290 | 'ldflags': [ |
| 3291 | '-fsanitize=leak', |
| 3292 | ], |
| 3293 | 'defines': [ |
| 3294 | 'LEAK_SANITIZER', |
| 3295 | ], |
| 3296 | }], |
| 3297 | ], |
| 3298 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3299 | ['tsan==1', { |
| 3300 | 'target_conditions': [ |
| 3301 | ['_toolset=="target"', { |
| 3302 | 'cflags': [ |
| 3303 | '-fsanitize=thread', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3304 | '-fPIC', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3305 | '-mllvm', '-tsan-blacklist=<(tsan_blacklist)', |
| 3306 | ], |
| 3307 | 'ldflags': [ |
| 3308 | '-fsanitize=thread', |
| 3309 | ], |
| 3310 | 'defines': [ |
| 3311 | 'THREAD_SANITIZER', |
| 3312 | 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1', |
| 3313 | 'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1', |
| 3314 | ], |
| 3315 | 'target_conditions': [ |
| 3316 | ['_type=="executable"', { |
| 3317 | 'ldflags': [ |
| 3318 | '-pie', |
| 3319 | ], |
| 3320 | }], |
| 3321 | ], |
| 3322 | }], |
| 3323 | ], |
| 3324 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3325 | ['msan==1', { |
| 3326 | 'target_conditions': [ |
| 3327 | ['_toolset=="target"', { |
| 3328 | 'cflags': [ |
| 3329 | '-fsanitize=memory', |
| 3330 | '-fsanitize-memory-track-origins', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3331 | '-fPIC', |
| 3332 | ], |
| 3333 | 'ldflags': [ |
| 3334 | '-fsanitize=memory', |
| 3335 | ], |
| 3336 | 'defines': [ |
| 3337 | 'MEMORY_SANITIZER', |
| 3338 | ], |
| 3339 | 'target_conditions': [ |
| 3340 | ['_type=="executable"', { |
| 3341 | 'ldflags': [ |
| 3342 | '-pie', |
| 3343 | ], |
| 3344 | }], |
| 3345 | ], |
| 3346 | }], |
| 3347 | ], |
| 3348 | }], |
| 3349 | ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3350 | 'target_conditions' : [ |
| 3351 | ['_toolset=="target"', { |
| 3352 | 'cflags': [ |
| 3353 | '-finstrument-functions', |
| 3354 | # Allow mmx intrinsics to inline, so that the |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 3355 | #0 compiler can expand the intrinsics. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3356 | '-finstrument-functions-exclude-file-list=mmintrin.h', |
| 3357 | ], |
| 3358 | }], |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 3359 | ['_toolset=="target" and OS=="android"', { |
| 3360 | 'cflags': [ |
| 3361 | # Avoids errors with current NDK: |
| 3362 | # "third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/include/arm_neon.h:3426:3: error: argument must be a constant" |
| 3363 | '-finstrument-functions-exclude-file-list=arm_neon.h', |
| 3364 | ], |
| 3365 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3366 | ], |
| 3367 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3368 | ['linux_dump_symbols==1', { |
| 3369 | 'cflags': [ '-g' ], |
| 3370 | 'conditions': [ |
| 3371 | ['target_arch=="ia32" and OS!="android"', { |
| 3372 | 'target_conditions': [ |
| 3373 | ['_toolset=="target"', { |
| 3374 | 'ldflags': [ |
| 3375 | # Workaround for linker OOM. |
| 3376 | '-Wl,--no-keep-memory', |
| 3377 | ], |
| 3378 | }], |
| 3379 | ], |
| 3380 | }], |
| 3381 | ], |
| 3382 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3383 | ['linux_use_heapchecker==1', { |
| 3384 | 'variables': {'linux_use_tcmalloc%': 1}, |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 3385 | 'defines': [ |
| 3386 | 'USE_HEAPCHECKER', |
| 3387 | 'MEMORY_TOOL_REPLACES_ALLOCATOR', |
| 3388 | ], |
Torne (Richard Coles) | a93a17c | 2013-05-15 11:34:50 +0100 | [diff] [blame] | 3389 | 'conditions': [ |
| 3390 | ['component=="shared_library"', { |
| 3391 | # See crbug.com/112389 |
| 3392 | # TODO(glider): replace with --dynamic-list or something |
| 3393 | 'ldflags': ['-rdynamic'], |
| 3394 | }], |
| 3395 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3396 | }], |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 3397 | ['linux_use_tcmalloc==0 and android_use_tcmalloc==0', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3398 | 'defines': ['NO_TCMALLOC'], |
| 3399 | }], |
| 3400 | ['linux_keep_shadow_stacks==1', { |
| 3401 | 'defines': ['KEEP_SHADOW_STACKS'], |
| 3402 | 'cflags': [ |
| 3403 | '-finstrument-functions', |
| 3404 | # Allow mmx intrinsics to inline, so that the compiler can expand |
| 3405 | # the intrinsics. |
| 3406 | '-finstrument-functions-exclude-file-list=mmintrin.h', |
| 3407 | ], |
| 3408 | }], |
| 3409 | ['linux_use_gold_flags==1', { |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 3410 | 'target_conditions': [ |
| 3411 | ['_toolset=="target"', { |
| 3412 | 'ldflags': [ |
| 3413 | # Experimentation found that using four linking threads |
| 3414 | # saved ~20% of link time. |
| 3415 | # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36 |
| 3416 | # Only apply this to the target linker, since the host |
| 3417 | # linker might not be gold, but isn't used much anyway. |
| 3418 | '-Wl,--threads', |
| 3419 | '-Wl,--thread-count=4', |
| 3420 | ], |
| 3421 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3422 | ], |
| 3423 | 'conditions': [ |
| 3424 | ['release_valgrind_build==0', { |
| 3425 | 'target_conditions': [ |
| 3426 | ['_toolset=="target"', { |
| 3427 | 'ldflags': [ |
| 3428 | # There seems to be a conflict of --icf and -pie |
| 3429 | # in gold which can generate crashy binaries. As |
| 3430 | # a security measure, -pie takes precendence for |
| 3431 | # now. |
| 3432 | #'-Wl,--icf=safe', |
| 3433 | '-Wl,--icf=none', |
| 3434 | ], |
| 3435 | }], |
| 3436 | ], |
| 3437 | }], |
| 3438 | ], |
| 3439 | }], |
| 3440 | ['linux_use_gold_binary==1', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3441 | 'ldflags': [ |
| 3442 | # Put our gold binary in the search path for the linker. |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 3443 | # We pass the path to gold to the compiler. gyp leaves |
| 3444 | # unspecified what the cwd is when running the compiler, |
| 3445 | # so the normal gyp path-munging fails us. This hack |
| 3446 | # gets the right path. |
| 3447 | '-B<(PRODUCT_DIR)/../../third_party/gold', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3448 | ], |
| 3449 | }], |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 3450 | ['native_discardable_memory', { |
| 3451 | 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'], |
| 3452 | }], |
| 3453 | ['native_memory_pressure_signals', { |
| 3454 | 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'], |
| 3455 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3456 | ], |
| 3457 | }, |
| 3458 | }], |
| 3459 | # FreeBSD-specific options; note that most FreeBSD options are set above, |
| 3460 | # with Linux. |
| 3461 | ['OS=="freebsd"', { |
| 3462 | 'target_defaults': { |
| 3463 | 'ldflags': [ |
| 3464 | '-Wl,--no-keep-memory', |
| 3465 | ], |
| 3466 | }, |
| 3467 | }], |
| 3468 | # Android-specific options; note that most are set above with Linux. |
| 3469 | ['OS=="android"', { |
| 3470 | 'variables': { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3471 | # This is a unique identifier for a given build. It's used for |
| 3472 | # identifying various build artifacts corresponding to a particular |
| 3473 | # build of chrome (e.g. where to find archived symbols). |
| 3474 | 'chrome_build_id%': '', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3475 | 'conditions': [ |
| 3476 | # Use shared stlport library when system one used. |
| 3477 | # Figure this out early since it needs symbols from libgcc.a, so it |
| 3478 | # has to be before that in the set of libraries. |
| 3479 | ['use_system_stlport==1', { |
| 3480 | 'android_stlport_library': 'stlport', |
| 3481 | }, { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3482 | 'conditions': [ |
| 3483 | ['component=="shared_library"', { |
| 3484 | 'android_stlport_library': 'stlport_shared', |
| 3485 | }, { |
| 3486 | 'android_stlport_library': 'stlport_static', |
| 3487 | }], |
| 3488 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3489 | }], |
| 3490 | ], |
| 3491 | |
| 3492 | # Placing this variable here prevents from forking libvpx, used |
| 3493 | # by remoting. Remoting is off, so it needn't built, |
| 3494 | # so forking it's deps seems like overkill. |
| 3495 | # But this variable need defined to properly run gyp. |
| 3496 | # A proper solution is to have an OS==android conditional |
| 3497 | # in third_party/libvpx/libvpx.gyp to define it. |
| 3498 | 'libvpx_path': 'lib/linux/arm', |
| 3499 | }, |
| 3500 | 'target_defaults': { |
| 3501 | 'variables': { |
| 3502 | 'release_extra_cflags%': '', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3503 | 'conditions': [ |
| 3504 | # If we're using the components build, append "cr" to all shared |
| 3505 | # libraries to avoid naming collisions with android system library |
| 3506 | # versions with the same name (e.g. skia, icu). |
| 3507 | ['component=="shared_library"', { |
| 3508 | 'android_product_extension': 'cr.so', |
| 3509 | }, { |
| 3510 | 'android_product_extension': 'so', |
| 3511 | } ], |
| 3512 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3513 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3514 | 'target_conditions': [ |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3515 | ['_type=="shared_library"', { |
| 3516 | 'product_extension': '<(android_product_extension)', |
| 3517 | }], |
| 3518 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3519 | # Settings for building device targets using Android's toolchain. |
| 3520 | # These are based on the setup.mk file from the Android NDK. |
| 3521 | # |
| 3522 | # The NDK Android executable link step looks as follows: |
| 3523 | # $LDFLAGS |
| 3524 | # $(TARGET_CRTBEGIN_DYNAMIC_O) <-- crtbegin.o |
| 3525 | # $(PRIVATE_OBJECTS) <-- The .o that we built |
| 3526 | # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built |
| 3527 | # $(TARGET_LIBGCC) <-- libgcc.a |
| 3528 | # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built |
| 3529 | # $(PRIVATE_LDLIBS) <-- System .so |
| 3530 | # $(TARGET_CRTEND_O) <-- crtend.o |
| 3531 | # |
| 3532 | # For now the above are approximated for executables by adding |
| 3533 | # crtbegin.o to the end of the ldflags and 'crtend.o' to the end |
| 3534 | # of 'libraries'. |
| 3535 | # |
| 3536 | # The NDK Android shared library link step looks as follows: |
| 3537 | # $LDFLAGS |
| 3538 | # $(PRIVATE_OBJECTS) <-- The .o that we built |
| 3539 | # -l,--whole-archive |
| 3540 | # $(PRIVATE_WHOLE_STATIC_LIBRARIES) |
| 3541 | # -l,--no-whole-archive |
| 3542 | # $(PRIVATE_STATIC_LIBRARIES) <-- The .a that we built |
| 3543 | # $(TARGET_LIBGCC) <-- libgcc.a |
| 3544 | # $(PRIVATE_SHARED_LIBRARIES) <-- The .so that we built |
| 3545 | # $(PRIVATE_LDLIBS) <-- System .so |
| 3546 | # |
| 3547 | # For now, assume that whole static libraries are not needed. |
| 3548 | # |
| 3549 | # For both executables and shared libraries, add the proper |
| 3550 | # libgcc.a to the start of libraries which puts it in the |
| 3551 | # proper spot after .o and .a files get linked in. |
| 3552 | # |
| 3553 | # TODO: The proper thing to do longer-tem would be proper gyp |
| 3554 | # support for a custom link command line. |
| 3555 | ['_toolset=="target"', { |
| 3556 | 'cflags!': [ |
| 3557 | '-pthread', # Not supported by Android toolchain. |
| 3558 | ], |
| 3559 | 'cflags': [ |
| 3560 | '-ffunction-sections', |
| 3561 | '-funwind-tables', |
| 3562 | '-g', |
| 3563 | '-fstack-protector', |
| 3564 | '-fno-short-enums', |
| 3565 | '-finline-limit=64', |
| 3566 | '-Wa,--noexecstack', |
| 3567 | '<@(release_extra_cflags)', |
| 3568 | ], |
| 3569 | 'defines': [ |
| 3570 | 'ANDROID', |
| 3571 | '__GNU_SOURCE=1', # Necessary for clone() |
| 3572 | 'USE_STLPORT=1', |
| 3573 | '_STLP_USE_PTR_SPECIALIZATIONS=1', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3574 | 'CHROME_BUILD_ID="<(chrome_build_id)"', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3575 | ], |
| 3576 | 'ldflags!': [ |
| 3577 | '-pthread', # Not supported by Android toolchain. |
| 3578 | ], |
| 3579 | 'ldflags': [ |
| 3580 | '-nostdlib', |
| 3581 | '-Wl,--no-undefined', |
| 3582 | # Don't export symbols from statically linked libraries. |
| 3583 | '-Wl,--exclude-libs=ALL', |
| 3584 | ], |
| 3585 | 'libraries': [ |
| 3586 | '-l<(android_stlport_library)', |
| 3587 | # Manually link the libgcc.a that the cross compiler uses. |
| 3588 | '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)', |
| 3589 | '-lc', |
| 3590 | '-ldl', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3591 | '-lm', |
| 3592 | ], |
| 3593 | 'conditions': [ |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3594 | ['component=="shared_library"', { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3595 | 'ldflags!': [ |
| 3596 | '-Wl,--exclude-libs=ALL', |
| 3597 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3598 | }], |
| 3599 | ['clang==1', { |
| 3600 | 'cflags': [ |
| 3601 | # Work around incompatibilities between bionic and clang |
| 3602 | # headers. |
| 3603 | '-D__compiler_offsetof=__builtin_offsetof', |
| 3604 | '-Dnan=__builtin_nan', |
| 3605 | ], |
| 3606 | 'conditions': [ |
| 3607 | ['target_arch=="arm"', { |
| 3608 | 'cflags': [ |
| 3609 | '-target arm-linux-androideabi', |
| 3610 | '-mllvm -arm-enable-ehabi', |
| 3611 | ], |
| 3612 | 'ldflags': [ |
| 3613 | '-target arm-linux-androideabi', |
| 3614 | ], |
| 3615 | }], |
| 3616 | ['target_arch=="ia32"', { |
| 3617 | 'cflags': [ |
| 3618 | '-target x86-linux-androideabi', |
| 3619 | ], |
| 3620 | 'ldflags': [ |
| 3621 | '-target x86-linux-androideabi', |
| 3622 | ], |
| 3623 | }], |
| 3624 | ], |
| 3625 | }], |
| 3626 | ['asan==1', { |
| 3627 | 'cflags': [ |
| 3628 | # Android build relies on -Wl,--gc-sections removing |
| 3629 | # unreachable code. ASan instrumentation for globals inhibits |
| 3630 | # this and results in a library with unresolvable relocations. |
| 3631 | # TODO(eugenis): find a way to reenable this. |
| 3632 | '-mllvm -asan-globals=0', |
| 3633 | ], |
| 3634 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3635 | ['android_webview_build==0', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3636 | 'defines': [ |
| 3637 | # The NDK has these things, but doesn't define the constants |
| 3638 | # to say that it does. Define them here instead. |
| 3639 | 'HAVE_SYS_UIO_H', |
| 3640 | ], |
| 3641 | 'cflags': [ |
| 3642 | '--sysroot=<(android_ndk_sysroot)', |
| 3643 | ], |
| 3644 | 'ldflags': [ |
| 3645 | '--sysroot=<(android_ndk_sysroot)', |
| 3646 | ], |
| 3647 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3648 | ['android_webview_build==1', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3649 | 'include_dirs': [ |
| 3650 | # OpenAL headers from the Android tree. |
| 3651 | '<(android_src)/frameworks/wilhelm/include', |
| 3652 | ], |
| 3653 | 'cflags': [ |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3654 | # Android predefines this as 1; undefine it here so Chromium |
| 3655 | # can redefine it later to be 2 for chromium code and unset |
| 3656 | # for third party code. This works because cflags are added |
| 3657 | # before defines. |
| 3658 | '-U_FORTIFY_SOURCE', |
| 3659 | # Disable any additional warnings enabled by the Android build system but which |
| 3660 | # chromium does not build cleanly with (when treating warning as errors). |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3661 | # Things that are part of -Wextra: |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3662 | '-Wno-extra', # Enabled by -Wextra, but no specific flag |
| 3663 | '-Wno-ignored-qualifiers', |
| 3664 | '-Wno-type-limits', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3665 | ], |
| 3666 | 'cflags_cc': [ |
| 3667 | # Disabling c++0x-compat should be handled in WebKit, but |
| 3668 | # this currently doesn't work because gcc_version is not set |
| 3669 | # correctly when building with the Android build system. |
| 3670 | # TODO(torne): Fix this in WebKit. |
| 3671 | '-Wno-error=c++0x-compat', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3672 | # Other things unrelated to -Wextra: |
| 3673 | '-Wno-non-virtual-dtor', |
| 3674 | '-Wno-sign-promo', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3675 | ], |
| 3676 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3677 | ['android_webview_build==1 and chromium_code==0', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3678 | 'cflags': [ |
| 3679 | # There is a class of warning which: |
| 3680 | # 1) Android always enables and also treats as errors |
| 3681 | # 2) Chromium ignores in third party code |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3682 | # So we re-enable those warnings when building Android. |
| 3683 | '-Wno-address', |
| 3684 | '-Wno-format-security', |
| 3685 | '-Wno-return-type', |
| 3686 | '-Wno-sequence-point', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3687 | ], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3688 | 'cflags_cc': [ |
| 3689 | '-Wno-non-virtual-dtor', |
| 3690 | ] |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3691 | }], |
| 3692 | ['target_arch == "arm"', { |
| 3693 | 'ldflags': [ |
| 3694 | # Enable identical code folding to reduce size. |
| 3695 | '-Wl,--icf=safe', |
| 3696 | ], |
| 3697 | }], |
| 3698 | # NOTE: The stlport header include paths below are specified in |
| 3699 | # cflags rather than include_dirs because they need to come |
| 3700 | # after include_dirs. Think of them like system headers, but |
| 3701 | # don't use '-isystem' because the arm-linux-androideabi-4.4.3 |
| 3702 | # toolchain (circa Gingerbread) will exhibit strange errors. |
| 3703 | # The include ordering here is important; change with caution. |
| 3704 | ['use_system_stlport==1', { |
| 3705 | 'cflags': [ |
| 3706 | # For libstdc++/include, which is used by stlport. |
| 3707 | '-I<(android_src)/bionic', |
| 3708 | '-I<(android_src)/external/stlport/stlport', |
| 3709 | ], |
| 3710 | }, { # else: use_system_stlport!=1 |
| 3711 | 'cflags': [ |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3712 | '-I<(android_stlport_include)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3713 | ], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3714 | 'ldflags': [ |
| 3715 | '-L<(android_stlport_libs_dir)', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3716 | ], |
| 3717 | }], |
| 3718 | ['target_arch=="ia32"', { |
| 3719 | # The x86 toolchain currently has problems with stack-protector. |
| 3720 | 'cflags!': [ |
| 3721 | '-fstack-protector', |
| 3722 | ], |
| 3723 | 'cflags': [ |
| 3724 | '-fno-stack-protector', |
| 3725 | ], |
| 3726 | }], |
| 3727 | ], |
| 3728 | 'target_conditions': [ |
| 3729 | ['_type=="executable"', { |
| 3730 | 'ldflags': [ |
| 3731 | '-Bdynamic', |
| 3732 | '-Wl,-dynamic-linker,/system/bin/linker', |
| 3733 | '-Wl,--gc-sections', |
| 3734 | '-Wl,-z,nocopyreloc', |
| 3735 | # crtbegin_dynamic.o should be the last item in ldflags. |
| 3736 | '<(android_ndk_lib)/crtbegin_dynamic.o', |
| 3737 | ], |
| 3738 | 'libraries': [ |
| 3739 | # crtend_android.o needs to be the last item in libraries. |
| 3740 | # Do not add any libraries after this! |
| 3741 | '<(android_ndk_lib)/crtend_android.o', |
| 3742 | ], |
| 3743 | 'conditions': [ |
| 3744 | ['asan==1', { |
| 3745 | 'cflags': [ |
| 3746 | '-fPIE', |
| 3747 | ], |
| 3748 | 'ldflags': [ |
| 3749 | '-pie', |
| 3750 | ], |
| 3751 | }], |
| 3752 | ], |
| 3753 | }], |
| 3754 | ['_type=="shared_library" or _type=="loadable_module"', { |
| 3755 | 'ldflags': [ |
| 3756 | '-Wl,-shared,-Bsymbolic', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3757 | ], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3758 | 'conditions': [ |
| 3759 | ['android_webview_build==0', { |
| 3760 | 'ldflags': [ |
| 3761 | # crtbegin_so.o should be the last item in ldflags. |
| 3762 | '<(android_ndk_lib)/crtbegin_so.o', |
| 3763 | ], |
| 3764 | 'libraries': [ |
| 3765 | # crtend_so.o needs to be the last item in libraries. |
| 3766 | # Do not add any libraries after this! |
| 3767 | '<(android_ndk_lib)/crtend_so.o', |
| 3768 | ], |
| 3769 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3770 | ], |
| 3771 | }], |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 3772 | # ndk-build copies .a's around the filesystem, breaking |
| 3773 | # relative paths in thin archives. Disable using thin |
| 3774 | # archives to avoid problems until one of these is fixed: |
| 3775 | # http://code.google.com/p/android/issues/detail?id=40302 |
| 3776 | # http://code.google.com/p/android/issues/detail?id=40303 |
| 3777 | ['_type=="static_library"', { |
| 3778 | 'standalone_static_library': 1, |
| 3779 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3780 | ], |
| 3781 | }], |
| 3782 | # Settings for building host targets using the system toolchain. |
| 3783 | ['_toolset=="host"', { |
| 3784 | 'cflags!': [ |
| 3785 | # Due to issues in Clang build system, using ASan on 32-bit |
| 3786 | # binaries on x86_64 host is problematic. |
| 3787 | # TODO(eugenis): re-enable. |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3788 | '-fsanitize=address', |
| 3789 | '-w', # http://crbug.com/162783 |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3790 | ], |
| 3791 | 'ldflags!': [ |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3792 | '-fsanitize=address', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3793 | '-Wl,-z,noexecstack', |
| 3794 | '-Wl,--gc-sections', |
| 3795 | '-Wl,-O1', |
| 3796 | '-Wl,--as-needed', |
| 3797 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3798 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3799 | # Settings for building host targets on mac. |
| 3800 | ['_toolset=="host" and host_os=="mac"', { |
| 3801 | 'ldflags!': [ |
| 3802 | '-Wl,-z,now', |
| 3803 | '-Wl,-z,relro', |
| 3804 | ], |
| 3805 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3806 | ], |
| 3807 | }, |
| 3808 | }], |
| 3809 | ['OS=="solaris"', { |
| 3810 | 'cflags!': ['-fvisibility=hidden'], |
| 3811 | 'cflags_cc!': ['-fvisibility-inlines-hidden'], |
| 3812 | }], |
| 3813 | ['OS=="mac" or OS=="ios"', { |
| 3814 | 'target_defaults': { |
| 3815 | 'mac_bundle': 0, |
| 3816 | 'xcode_settings': { |
| 3817 | 'ALWAYS_SEARCH_USER_PATHS': 'NO', |
| 3818 | # Don't link in libarclite_macosx.a, see http://crbug.com/156530. |
| 3819 | 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime |
| 3820 | 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99 |
| 3821 | 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks |
| 3822 | 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions |
| 3823 | 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti |
| 3824 | 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings |
| 3825 | # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden |
| 3826 | 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', |
| 3827 | 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors |
| 3828 | 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden |
| 3829 | 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics |
| 3830 | 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror |
| 3831 | 'GCC_VERSION': '4.2', |
| 3832 | 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof |
| 3833 | 'USE_HEADERMAP': 'NO', |
| 3834 | 'WARNING_CFLAGS': [ |
| 3835 | '-Wall', |
| 3836 | '-Wendif-labels', |
| 3837 | '-Wextra', |
| 3838 | # Don't warn about unused function parameters. |
| 3839 | '-Wno-unused-parameter', |
| 3840 | # Don't warn about the "struct foo f = {0};" initialization |
| 3841 | # pattern. |
| 3842 | '-Wno-missing-field-initializers', |
| 3843 | ], |
| 3844 | 'conditions': [ |
| 3845 | ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'}, |
| 3846 | {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'} |
| 3847 | ], |
| 3848 | # Note that the prebuilt Clang binaries should not be used for iOS |
| 3849 | # development except for ASan builds. |
| 3850 | ['clang==1', { |
| 3851 | 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang', |
| 3852 | 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++', |
| 3853 | |
| 3854 | # Don't use -Wc++0x-extensions, which Xcode 4 enables by default |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3855 | # when building with clang. This warning is triggered when the |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3856 | # override keyword is used via the OVERRIDE macro from |
| 3857 | # base/compiler_specific.h. |
| 3858 | 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3859 | # Warn if automatic synthesis is triggered with |
| 3860 | # the -Wobjc-missing-property-synthesis flag. |
| 3861 | 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3862 | 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', |
| 3863 | 'WARNING_CFLAGS': [ |
| 3864 | '-Wheader-hygiene', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3865 | |
| 3866 | # This warns on using ints as initializers for floats in |
| 3867 | # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|), |
| 3868 | # which happens in several places in chrome code. Not sure if |
| 3869 | # this is worth fixing. |
| 3870 | '-Wno-c++11-narrowing', |
| 3871 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3872 | # Don't die on dtoa code that uses a char as an array index. |
| 3873 | # This is required solely for base/third_party/dmg_fp/dtoa.cc. |
| 3874 | '-Wno-char-subscripts', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3875 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3876 | # Clang spots more unused functions. |
| 3877 | '-Wno-unused-function', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3878 | |
| 3879 | # Warns on switches on enums that cover all enum values but |
| 3880 | # also contain a default: branch. Chrome is full of that. |
| 3881 | '-Wno-covered-switch-default', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3882 | |
| 3883 | # Warns when a const char[] is converted to bool. |
| 3884 | '-Wstring-conversion', |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 3885 | |
| 3886 | # Clang considers the `register` keyword as deprecated, but e.g. |
| 3887 | # code generated by flex (used in angle) contains that keyword. |
| 3888 | # http://crbug.com/255186 |
| 3889 | '-Wno-deprecated-register', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3890 | ], |
| 3891 | 'OTHER_CPLUSPLUSFLAGS': [ |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 3892 | # gnu++11 instead of c++11 is needed because some code uses |
| 3893 | # typeof() (a GNU extension). |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3894 | # TODO(thakis): Eventually switch this to c++11 instead of |
| 3895 | # gnu++11 (once typeof can be removed, which is blocked on c++11 |
| 3896 | # being available everywhere). |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 3897 | # TODO(thakis): Use CLANG_CXX_LANGUAGE_STANDARD instead once all |
| 3898 | # bots use xcode 4 -- http://crbug.com/147515). |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3899 | '$(inherited)', '-std=gnu++11', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3900 | ], |
| 3901 | }], |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 3902 | ['clang==1 and clang_use_chrome_plugins==1', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3903 | 'OTHER_CFLAGS': [ |
| 3904 | '<@(clang_chrome_plugins_flags)', |
| 3905 | ], |
| 3906 | }], |
| 3907 | ['clang==1 and clang_load!=""', { |
| 3908 | 'OTHER_CFLAGS': [ |
| 3909 | '-Xclang', '-load', '-Xclang', '<(clang_load)', |
| 3910 | ], |
| 3911 | }], |
| 3912 | ['clang==1 and clang_add_plugin!=""', { |
| 3913 | 'OTHER_CFLAGS': [ |
| 3914 | '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)', |
| 3915 | ], |
| 3916 | }], |
| 3917 | ['clang==1 and "<(GENERATOR)"=="ninja"', { |
| 3918 | 'OTHER_CFLAGS': [ |
| 3919 | # See http://crbug.com/110262 |
| 3920 | '-fcolor-diagnostics', |
| 3921 | ], |
| 3922 | }], |
| 3923 | ], |
| 3924 | }, |
| 3925 | 'conditions': [ |
| 3926 | ['clang==1', { |
| 3927 | 'variables': { |
| 3928 | 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin', |
| 3929 | }, |
| 3930 | }], |
| 3931 | ['asan==1', { |
| 3932 | 'xcode_settings': { |
| 3933 | 'OTHER_CFLAGS': [ |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3934 | '-fsanitize=address', |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 3935 | '-mllvm -asan-globals=0', # http://crbug.com/196561 |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3936 | '-w', # http://crbug.com/162783 |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3937 | ], |
| 3938 | }, |
| 3939 | 'defines': [ |
| 3940 | 'ADDRESS_SANITIZER', |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 3941 | 'MEMORY_TOOL_REPLACES_ALLOCATOR', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3942 | ], |
| 3943 | }], |
| 3944 | ], |
| 3945 | 'target_conditions': [ |
| 3946 | ['_type!="static_library"', { |
| 3947 | 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']}, |
| 3948 | 'conditions': [ |
| 3949 | ['asan==1', { |
| 3950 | 'xcode_settings': { |
| 3951 | 'OTHER_LDFLAGS': [ |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3952 | '-fsanitize=address', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3953 | ], |
| 3954 | }, |
| 3955 | }], |
| 3956 | ], |
| 3957 | }], |
| 3958 | ['_mac_bundle', { |
| 3959 | 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']}, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3960 | 'target_conditions': [ |
| 3961 | ['_type=="executable"', { |
| 3962 | 'conditions': [ |
| 3963 | ['asan==1', { |
| 3964 | 'postbuilds': [ |
| 3965 | { |
| 3966 | 'variables': { |
| 3967 | # Define copy_asan_dylib_path in a variable ending in |
| 3968 | # _path so that gyp understands it's a path and |
| 3969 | # performs proper relativization during dict merging. |
| 3970 | 'copy_asan_dylib_path': |
| 3971 | 'mac/copy_asan_runtime_dylib.sh', |
| 3972 | }, |
| 3973 | 'postbuild_name': 'Copy ASan runtime dylib', |
| 3974 | 'action': [ |
| 3975 | '<(copy_asan_dylib_path)', |
| 3976 | ], |
| 3977 | }, |
| 3978 | ], |
| 3979 | }], |
| 3980 | ], |
| 3981 | }], |
| 3982 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3983 | }], |
| 3984 | ], # target_conditions |
| 3985 | }, # target_defaults |
| 3986 | }], # OS=="mac" or OS=="ios" |
| 3987 | ['OS=="mac"', { |
| 3988 | 'target_defaults': { |
| 3989 | 'variables': { |
| 3990 | # These should end with %, but there seems to be a bug with % in |
| 3991 | # variables that are intended to be set to different values in |
| 3992 | # different targets, like these. |
| 3993 | 'mac_pie': 1, # Most executables can be position-independent. |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 3994 | # Strip debugging symbols from the target. |
| 3995 | 'mac_strip': '<(mac_strip_release)', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 3996 | 'conditions': [ |
| 3997 | ['asan==1', { |
| 3998 | 'conditions': [ |
| 3999 | ['mac_want_real_dsym=="default"', { |
| 4000 | 'mac_real_dsym': 1, |
| 4001 | }, { |
| 4002 | 'mac_real_dsym': '<(mac_want_real_dsym)' |
| 4003 | }], |
| 4004 | ], |
| 4005 | }, { |
| 4006 | 'conditions': [ |
| 4007 | ['mac_want_real_dsym=="default"', { |
| 4008 | 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases. |
| 4009 | }, { |
| 4010 | 'mac_real_dsym': '<(mac_want_real_dsym)' |
| 4011 | }], |
| 4012 | ], |
| 4013 | }], |
| 4014 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4015 | }, |
| 4016 | 'xcode_settings': { |
| 4017 | 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic |
| 4018 | # (Equivalent to -fPIC) |
| 4019 | # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min |
| 4020 | 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)', |
| 4021 | # Keep pch files below xcodebuild/. |
| 4022 | 'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders', |
Ben Murdoch | 558790d | 2013-07-30 15:19:42 +0100 | [diff] [blame] | 4023 | 'OTHER_CFLAGS': [ |
| 4024 | # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO' |
| 4025 | # xcode_setting, but not until all downstream projects' mac bots are |
| 4026 | # using xcode >= 4.6, because that's when the default value of the |
| 4027 | # flag in the compiler switched. Pre-4.6, the value 'NO' for that |
| 4028 | # setting is a no-op as far as xcode is concerned, but the compiler |
| 4029 | # behaves differently based on whether -fno-strict-aliasing is |
| 4030 | # specified or not. |
| 4031 | '-fno-strict-aliasing', # See http://crbug.com/32204. |
| 4032 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4033 | }, |
| 4034 | 'target_conditions': [ |
| 4035 | ['_type=="executable"', { |
| 4036 | 'postbuilds': [ |
| 4037 | { |
| 4038 | # Arranges for data (heap) pages to be protected against |
| 4039 | # code execution when running on Mac OS X 10.7 ("Lion"), and |
| 4040 | # ensures that the position-independent executable (PIE) bit |
| 4041 | # is set for ASLR when running on Mac OS X 10.5 ("Leopard"). |
| 4042 | 'variables': { |
| 4043 | # Define change_mach_o_flags in a variable ending in _path |
| 4044 | # so that GYP understands it's a path and performs proper |
| 4045 | # relativization during dict merging. |
| 4046 | 'change_mach_o_flags_path': |
| 4047 | 'mac/change_mach_o_flags_from_xcode.sh', |
| 4048 | 'change_mach_o_flags_options%': [ |
| 4049 | ], |
| 4050 | 'target_conditions': [ |
| 4051 | ['mac_pie==0 or release_valgrind_build==1', { |
| 4052 | # Don't enable PIE if it's unwanted. It's unwanted if |
| 4053 | # the target specifies mac_pie=0 or if building for |
| 4054 | # Valgrind, because Valgrind doesn't understand slide. |
| 4055 | # See the similar mac_pie/release_valgrind_build check |
| 4056 | # below. |
| 4057 | 'change_mach_o_flags_options': [ |
| 4058 | '--no-pie', |
| 4059 | ], |
| 4060 | }], |
| 4061 | ], |
| 4062 | }, |
| 4063 | 'postbuild_name': 'Change Mach-O Flags', |
| 4064 | 'action': [ |
| 4065 | '<(change_mach_o_flags_path)', |
| 4066 | '>@(change_mach_o_flags_options)', |
| 4067 | ], |
| 4068 | }, |
| 4069 | ], |
| 4070 | 'conditions': [ |
| 4071 | ['asan==1', { |
| 4072 | 'variables': { |
| 4073 | 'asan_saves_file': 'asan.saves', |
| 4074 | }, |
| 4075 | 'xcode_settings': { |
| 4076 | 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)', |
| 4077 | }, |
| 4078 | }], |
| 4079 | ], |
| 4080 | 'target_conditions': [ |
| 4081 | ['mac_pie==1 and release_valgrind_build==0', { |
| 4082 | # Turn on position-independence (ASLR) for executables. When |
| 4083 | # PIE is on for the Chrome executables, the framework will |
| 4084 | # also be subject to ASLR. |
| 4085 | # Don't do this when building for Valgrind, because Valgrind |
| 4086 | # doesn't understand slide. TODO: Make Valgrind on Mac OS X |
| 4087 | # understand slide, and get rid of the Valgrind check. |
| 4088 | 'xcode_settings': { |
| 4089 | 'OTHER_LDFLAGS': [ |
| 4090 | '-Wl,-pie', # Position-independent executable (MH_PIE) |
| 4091 | ], |
| 4092 | }, |
| 4093 | }], |
| 4094 | ], |
| 4095 | }], |
| 4096 | ['(_type=="executable" or _type=="shared_library" or \ |
| 4097 | _type=="loadable_module") and mac_strip!=0', { |
| 4098 | 'target_conditions': [ |
| 4099 | ['mac_real_dsym == 1', { |
| 4100 | # To get a real .dSYM bundle produced by dsymutil, set the |
| 4101 | # debug information format to dwarf-with-dsym. Since |
| 4102 | # strip_from_xcode will not be used, set Xcode to do the |
| 4103 | # stripping as well. |
| 4104 | 'configurations': { |
| 4105 | 'Release_Base': { |
| 4106 | 'xcode_settings': { |
| 4107 | 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', |
| 4108 | 'DEPLOYMENT_POSTPROCESSING': 'YES', |
| 4109 | 'STRIP_INSTALLED_PRODUCT': 'YES', |
| 4110 | 'target_conditions': [ |
| 4111 | ['_type=="shared_library" or _type=="loadable_module"', { |
| 4112 | # The Xcode default is to strip debugging symbols |
| 4113 | # only (-S). Local symbols should be stripped as |
| 4114 | # well, which will be handled by -x. Xcode will |
| 4115 | # continue to insert -S when stripping even when |
| 4116 | # additional flags are added with STRIPFLAGS. |
| 4117 | 'STRIPFLAGS': '-x', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 4118 | }], # _type=="shared_library" or _type=="loadable_module" |
| 4119 | ['_type=="executable"', { |
| 4120 | 'conditions': [ |
| 4121 | ['asan==1', { |
| 4122 | 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)', |
| 4123 | }] |
| 4124 | ], |
| 4125 | }], # _type=="executable" and asan==1 |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4126 | ], # target_conditions |
| 4127 | }, # xcode_settings |
| 4128 | }, # configuration "Release" |
| 4129 | }, # configurations |
| 4130 | }, { # mac_real_dsym != 1 |
| 4131 | # To get a fast fake .dSYM bundle, use a post-build step to |
| 4132 | # produce the .dSYM and strip the executable. strip_from_xcode |
| 4133 | # only operates in the Release configuration. |
| 4134 | 'postbuilds': [ |
| 4135 | { |
| 4136 | 'variables': { |
| 4137 | # Define strip_from_xcode in a variable ending in _path |
| 4138 | # so that gyp understands it's a path and performs proper |
| 4139 | # relativization during dict merging. |
| 4140 | 'strip_from_xcode_path': 'mac/strip_from_xcode', |
| 4141 | }, |
| 4142 | 'postbuild_name': 'Strip If Needed', |
| 4143 | 'action': ['<(strip_from_xcode_path)'], |
| 4144 | }, |
| 4145 | ], # postbuilds |
| 4146 | }], # mac_real_dsym |
| 4147 | ], # target_conditions |
| 4148 | }], # (_type=="executable" or _type=="shared_library" or |
| 4149 | # _type=="loadable_module") and mac_strip!=0 |
| 4150 | ], # target_conditions |
| 4151 | }, # target_defaults |
| 4152 | }], # OS=="mac" |
| 4153 | ['OS=="ios"', { |
| 4154 | 'target_defaults': { |
| 4155 | 'xcode_settings' : { |
| 4156 | 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', |
| 4157 | |
| 4158 | # This next block is mostly common with the 'mac' section above, |
| 4159 | # but keying off (or setting) 'clang' isn't valid for iOS as it |
| 4160 | # also seems to mean using the custom build of clang. |
| 4161 | |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 4162 | # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang |
| 4163 | # section above). |
| 4164 | 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4165 | # Don't use -Wc++0x-extensions, which Xcode 4 enables by default |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 4166 | # when building with clang. This warning is triggered when the |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4167 | # override keyword is used via the OVERRIDE macro from |
| 4168 | # base/compiler_specific.h. |
| 4169 | 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO', |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 4170 | # Warn if automatic synthesis is triggered with |
| 4171 | # the -Wobjc-missing-property-synthesis flag. |
| 4172 | 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4173 | 'WARNING_CFLAGS': [ |
| 4174 | '-Wheader-hygiene', |
| 4175 | # Don't die on dtoa code that uses a char as an array index. |
| 4176 | # This is required solely for base/third_party/dmg_fp/dtoa.cc. |
| 4177 | '-Wno-char-subscripts', |
| 4178 | # Clang spots more unused functions. |
| 4179 | '-Wno-unused-function', |
| 4180 | # See comments on this flag higher up in this file. |
| 4181 | '-Wno-unnamed-type-template-args', |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 4182 | # Match OS X clang C++11 warning settings. |
| 4183 | '-Wno-c++11-narrowing', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4184 | ], |
| 4185 | }, |
| 4186 | 'target_conditions': [ |
Torne (Richard Coles) | a93a17c | 2013-05-15 11:34:50 +0100 | [diff] [blame] | 4187 | ['_toolset=="host"', { |
| 4188 | 'xcode_settings': { |
| 4189 | 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot |
| 4190 | 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)', |
| 4191 | }, |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 4192 | 'conditions': [ |
| 4193 | ['"<(GENERATOR)"!="xcode"', { |
| 4194 | 'xcode_settings': { 'ARCHS': [ 'x86_64' ] }, |
| 4195 | }], |
| 4196 | ], |
Torne (Richard Coles) | a93a17c | 2013-05-15 11:34:50 +0100 | [diff] [blame] | 4197 | }], |
| 4198 | ['_toolset=="target"', { |
| 4199 | 'xcode_settings': { |
| 4200 | # This section should be for overriding host settings. But, |
| 4201 | # since we can't negate the iphone deployment target above, we |
| 4202 | # instead set it here for target only. |
| 4203 | 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)', |
| 4204 | }, |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 4205 | 'conditions': [ |
| 4206 | ['target_arch=="armv7" and "<(GENERATOR)"!="xcode"', { |
| 4207 | 'xcode_settings': { 'ARCHS': [ 'armv7' ]}, |
| 4208 | }, { |
| 4209 | 'xcode_settings': { 'ARCHS': [ 'i386' ] }, |
| 4210 | }], |
| 4211 | ], |
Torne (Richard Coles) | a93a17c | 2013-05-15 11:34:50 +0100 | [diff] [blame] | 4212 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4213 | ['_type=="executable"', { |
| 4214 | 'configurations': { |
| 4215 | 'Release_Base': { |
| 4216 | 'xcode_settings': { |
| 4217 | 'DEPLOYMENT_POSTPROCESSING': 'YES', |
| 4218 | 'STRIP_INSTALLED_PRODUCT': 'YES', |
| 4219 | }, |
| 4220 | }, |
| 4221 | 'Debug_Base': { |
| 4222 | 'xcode_settings': { |
| 4223 | # Remove dSYM to reduce build time. |
| 4224 | 'DEBUG_INFORMATION_FORMAT': 'dwarf', |
| 4225 | }, |
| 4226 | }, |
| 4227 | }, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 4228 | 'conditions': [ |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 4229 | ['"<(GENERATOR)"=="xcode"', { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 4230 | 'xcode_settings': { |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 4231 | # TODO(justincohen): ninja builds don't support signing yet. |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 4232 | 'conditions': [ |
| 4233 | ['chromium_ios_signing', { |
| 4234 | # iOS SDK wants everything for device signed. |
| 4235 | 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer', |
| 4236 | }, { |
| 4237 | 'CODE_SIGNING_REQUIRED': 'NO', |
| 4238 | 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '', |
| 4239 | }], |
| 4240 | ], |
| 4241 | }, |
| 4242 | }], |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 4243 | ['"<(GENERATOR)"=="xcode" and clang!=1', { |
| 4244 | 'xcode_settings': { |
| 4245 | # It is necessary to link with the -fobjc-arc flag to use |
| 4246 | # subscripting on iOS < 6. |
| 4247 | 'OTHER_LDFLAGS': [ |
| 4248 | '-fobjc-arc', |
| 4249 | ], |
| 4250 | }, |
| 4251 | }], |
| 4252 | ['clang==1', { |
| 4253 | 'target_conditions': [ |
| 4254 | ['_toolset=="target"', { |
| 4255 | 'variables': { |
| 4256 | 'developer_dir': '<!(xcode-select -print-path)', |
| 4257 | 'arc_toolchain_path': '<(developer_dir)/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc', |
| 4258 | }, |
| 4259 | # It is necessary to force load libarclite from Xcode for |
| 4260 | # third_party/llvm-build because libarclite_* is only |
| 4261 | # distributed by Xcode. |
| 4262 | 'conditions': [ |
| 4263 | ['"<(GENERATOR)"=="ninja" and target_arch=="armv7"', { |
| 4264 | 'xcode_settings': { |
| 4265 | 'OTHER_LDFLAGS': [ |
| 4266 | '-force_load', |
| 4267 | '<(arc_toolchain_path)/libarclite_iphoneos.a', |
| 4268 | ], |
| 4269 | }, |
| 4270 | }], |
| 4271 | ['"<(GENERATOR)"=="ninja" and target_arch!="armv7"', { |
| 4272 | 'xcode_settings': { |
| 4273 | 'OTHER_LDFLAGS': [ |
| 4274 | '-force_load', |
| 4275 | '<(arc_toolchain_path)/libarclite_iphonesimulator.a', |
| 4276 | ], |
| 4277 | }, |
| 4278 | }], |
| 4279 | # Xcode sets target_arch at compile-time. |
| 4280 | ['"<(GENERATOR)"=="xcode"', { |
| 4281 | 'xcode_settings': { |
| 4282 | 'OTHER_LDFLAGS[arch=armv7]': [ |
Torne (Richard Coles) | 5e3f23d | 2013-06-11 16:24:11 +0100 | [diff] [blame] | 4283 | '$(inherited)', |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 4284 | '-force_load', |
| 4285 | '<(arc_toolchain_path)/libarclite_iphoneos.a', |
| 4286 | ], |
| 4287 | 'OTHER_LDFLAGS[arch=i386]': [ |
Torne (Richard Coles) | 5e3f23d | 2013-06-11 16:24:11 +0100 | [diff] [blame] | 4288 | '$(inherited)', |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 4289 | '-force_load', |
| 4290 | '<(arc_toolchain_path)/libarclite_iphonesimulator.a', |
| 4291 | ], |
| 4292 | }, |
| 4293 | }], |
| 4294 | ], |
| 4295 | }], |
| 4296 | ], |
| 4297 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 4298 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4299 | }], |
| 4300 | ], # target_conditions |
| 4301 | }, # target_defaults |
| 4302 | }], # OS=="ios" |
| 4303 | ['OS=="win"', { |
| 4304 | 'target_defaults': { |
| 4305 | 'defines': [ |
| 4306 | '_WIN32_WINNT=0x0602', |
| 4307 | 'WINVER=0x0602', |
| 4308 | 'WIN32', |
| 4309 | '_WINDOWS', |
| 4310 | 'NOMINMAX', |
| 4311 | 'PSAPI_VERSION=1', |
| 4312 | '_CRT_RAND_S', |
| 4313 | 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS', |
| 4314 | 'WIN32_LEAN_AND_MEAN', |
| 4315 | '_ATL_NO_OPENGL', |
| 4316 | ], |
| 4317 | 'conditions': [ |
| 4318 | ['buildtype=="Official"', { |
| 4319 | # In official builds, targets can self-select an optimization |
| 4320 | # level by defining a variable named 'optimize', and setting it |
| 4321 | # to one of |
| 4322 | # - "size", optimizes for minimal code size - the default. |
| 4323 | # - "speed", optimizes for speed over code size. |
| 4324 | # - "max", whole program optimization and link-time code |
| 4325 | # generation. This is very expensive and should be used |
| 4326 | # sparingly. |
| 4327 | 'variables': { |
| 4328 | 'optimize%': 'size', |
| 4329 | }, |
| 4330 | 'target_conditions': [ |
| 4331 | ['optimize=="size"', { |
| 4332 | 'msvs_settings': { |
| 4333 | 'VCCLCompilerTool': { |
| 4334 | # 1, optimizeMinSpace, Minimize Size (/O1) |
| 4335 | 'Optimization': '1', |
| 4336 | # 2, favorSize - Favor small code (/Os) |
| 4337 | 'FavorSizeOrSpeed': '2', |
| 4338 | }, |
| 4339 | }, |
| 4340 | }, |
| 4341 | ], |
| 4342 | ['optimize=="speed"', { |
| 4343 | 'msvs_settings': { |
| 4344 | 'VCCLCompilerTool': { |
| 4345 | # 2, optimizeMaxSpeed, Maximize Speed (/O2) |
| 4346 | 'Optimization': '2', |
| 4347 | # 1, favorSpeed - Favor fast code (/Ot) |
| 4348 | 'FavorSizeOrSpeed': '1', |
| 4349 | }, |
| 4350 | }, |
| 4351 | }, |
| 4352 | ], |
| 4353 | ['optimize=="max"', { |
| 4354 | 'msvs_settings': { |
| 4355 | 'VCCLCompilerTool': { |
| 4356 | # 2, optimizeMaxSpeed, Maximize Speed (/O2) |
| 4357 | 'Optimization': '2', |
| 4358 | # 1, favorSpeed - Favor fast code (/Ot) |
| 4359 | 'FavorSizeOrSpeed': '1', |
| 4360 | # This implies link time code generation. |
| 4361 | 'WholeProgramOptimization': 'true', |
| 4362 | }, |
| 4363 | }, |
| 4364 | }, |
| 4365 | ], |
| 4366 | ], |
| 4367 | }, |
| 4368 | ], |
| 4369 | ['component=="static_library"', { |
| 4370 | 'defines': [ |
| 4371 | '_HAS_EXCEPTIONS=0', |
| 4372 | ], |
| 4373 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4374 | ['secure_atl', { |
| 4375 | 'defines': [ |
| 4376 | '_SECURE_ATL', |
| 4377 | ], |
| 4378 | }], |
| 4379 | ['msvs_express', { |
| 4380 | 'configurations': { |
| 4381 | 'x86_Base': { |
| 4382 | 'msvs_settings': { |
| 4383 | 'VCLinkerTool': { |
| 4384 | 'AdditionalLibraryDirectories': |
| 4385 | ['<(windows_driver_kit_path)/lib/ATL/i386'], |
| 4386 | }, |
| 4387 | 'VCLibrarianTool': { |
| 4388 | 'AdditionalLibraryDirectories': |
| 4389 | ['<(windows_driver_kit_path)/lib/ATL/i386'], |
| 4390 | }, |
| 4391 | }, |
| 4392 | }, |
| 4393 | 'x64_Base': { |
| 4394 | 'msvs_settings': { |
| 4395 | 'VCLibrarianTool': { |
| 4396 | 'AdditionalLibraryDirectories': |
| 4397 | ['<(windows_driver_kit_path)/lib/ATL/amd64'], |
| 4398 | }, |
| 4399 | 'VCLinkerTool': { |
| 4400 | 'AdditionalLibraryDirectories': |
| 4401 | ['<(windows_driver_kit_path)/lib/ATL/amd64'], |
| 4402 | }, |
| 4403 | }, |
| 4404 | }, |
| 4405 | }, |
| 4406 | 'msvs_settings': { |
| 4407 | 'VCLinkerTool': { |
| 4408 | # Explicitly required when using the ATL with express |
| 4409 | 'AdditionalDependencies': ['atlthunk.lib'], |
| 4410 | |
| 4411 | # ATL 8.0 included in WDK 7.1 makes the linker to generate |
| 4412 | # almost eight hundred LNK4254 and LNK4078 warnings: |
| 4413 | # - warning LNK4254: section 'ATL' (50000040) merged into |
| 4414 | # '.rdata' (40000040) with different attributes |
| 4415 | # - warning LNK4078: multiple 'ATL' sections found with |
| 4416 | # different attributes |
| 4417 | 'AdditionalOptions': ['/ignore:4254', '/ignore:4078'], |
| 4418 | }, |
| 4419 | }, |
| 4420 | 'msvs_system_include_dirs': [ |
| 4421 | '<(windows_driver_kit_path)/inc/atl71', |
| 4422 | '<(windows_driver_kit_path)/inc/mfc42', |
| 4423 | ], |
| 4424 | }], |
| 4425 | ], |
| 4426 | 'msvs_system_include_dirs': [ |
| 4427 | '<(windows_sdk_path)/Include/shared', |
| 4428 | '<(windows_sdk_path)/Include/um', |
| 4429 | '<(windows_sdk_path)/Include/winrt', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4430 | '$(VSInstallDir)/VC/atlmfc/include', |
| 4431 | ], |
| 4432 | 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 4433 | 'msvs_disabled_warnings': [4351, 4355, 4396, 4503, 4819, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4434 | # TODO(maruel): These warnings are level 4. They will be slowly |
| 4435 | # removed as code is fixed. |
| 4436 | 4100, 4121, 4125, 4127, 4130, 4131, 4189, 4201, 4238, 4244, 4245, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 4437 | 4310, 4428, 4481, 4505, 4510, 4512, 4530, 4610, 4611, 4701, 4702, |
| 4438 | 4706, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4439 | ], |
| 4440 | 'msvs_settings': { |
| 4441 | 'VCCLCompilerTool': { |
| 4442 | 'AdditionalOptions': ['/MP'], |
| 4443 | 'MinimalRebuild': 'false', |
| 4444 | 'BufferSecurityCheck': 'true', |
| 4445 | 'EnableFunctionLevelLinking': 'true', |
| 4446 | 'RuntimeTypeInfo': 'false', |
| 4447 | 'WarningLevel': '4', |
| 4448 | 'WarnAsError': 'true', |
| 4449 | 'DebugInformationFormat': '3', |
| 4450 | 'conditions': [ |
| 4451 | ['component=="shared_library"', { |
| 4452 | 'ExceptionHandling': '1', # /EHsc |
| 4453 | }, { |
| 4454 | 'ExceptionHandling': '0', |
| 4455 | }], |
| 4456 | ], |
| 4457 | }, |
| 4458 | 'VCLibrarianTool': { |
| 4459 | 'AdditionalOptions': ['/ignore:4221'], |
| 4460 | 'AdditionalLibraryDirectories': [ |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4461 | '<(windows_sdk_path)/Lib/win8/um/x86', |
| 4462 | ], |
| 4463 | }, |
| 4464 | 'VCLinkerTool': { |
| 4465 | 'AdditionalDependencies': [ |
| 4466 | 'wininet.lib', |
| 4467 | 'dnsapi.lib', |
| 4468 | 'version.lib', |
| 4469 | 'msimg32.lib', |
| 4470 | 'ws2_32.lib', |
| 4471 | 'usp10.lib', |
| 4472 | 'psapi.lib', |
| 4473 | 'dbghelp.lib', |
| 4474 | 'winmm.lib', |
| 4475 | 'shlwapi.lib', |
| 4476 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4477 | 'AdditionalLibraryDirectories': [ |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4478 | '<(windows_sdk_path)/Lib/win8/um/x86', |
| 4479 | ], |
| 4480 | 'GenerateDebugInformation': 'true', |
| 4481 | 'MapFileName': '$(OutDir)\\$(TargetName).map', |
| 4482 | 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib', |
| 4483 | 'FixedBaseAddress': '1', |
| 4484 | # SubSystem values: |
| 4485 | # 0 == not set |
| 4486 | # 1 == /SUBSYSTEM:CONSOLE |
| 4487 | # 2 == /SUBSYSTEM:WINDOWS |
| 4488 | # Most of the executables we'll ever create are tests |
| 4489 | # and utilities with console output. |
| 4490 | 'SubSystem': '1', |
| 4491 | }, |
| 4492 | 'VCMIDLTool': { |
| 4493 | 'GenerateStublessProxies': 'true', |
| 4494 | 'TypeLibraryName': '$(InputName).tlb', |
| 4495 | 'OutputDirectory': '$(IntDir)', |
| 4496 | 'HeaderFileName': '$(InputName).h', |
| 4497 | 'DLLDataFileName': '$(InputName).dlldata.c', |
| 4498 | 'InterfaceIdentifierFileName': '$(InputName)_i.c', |
| 4499 | 'ProxyFileName': '$(InputName)_p.c', |
| 4500 | }, |
| 4501 | 'VCResourceCompilerTool': { |
| 4502 | 'Culture' : '1033', |
| 4503 | 'AdditionalIncludeDirectories': [ |
| 4504 | '<(DEPTH)', |
| 4505 | '<(SHARED_INTERMEDIATE_DIR)', |
| 4506 | ], |
| 4507 | }, |
Ben Murdoch | fb25065 | 2013-07-31 11:42:55 +0100 | [diff] [blame] | 4508 | 'target_conditions': [ |
| 4509 | ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', { |
| 4510 | 'VCManifestTool': { |
| 4511 | 'AdditionalManifestFiles': [ |
| 4512 | '>(win_exe_compatibility_manifest)', |
| 4513 | ], |
| 4514 | }, |
| 4515 | }], |
| 4516 | ['_type=="executable" and >(win_use_external_manifest)==0', { |
| 4517 | 'VCManifestTool': { |
| 4518 | 'EmbedManifest': 'true', |
| 4519 | } |
| 4520 | }], |
| 4521 | ['_type=="executable" and >(win_use_external_manifest)==1', { |
| 4522 | 'VCManifestTool': { |
| 4523 | 'EmbedManifest': 'false', |
| 4524 | } |
| 4525 | }], |
| 4526 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4527 | }, |
| 4528 | }, |
| 4529 | }], |
| 4530 | ['disable_nacl==1', { |
| 4531 | 'target_defaults': { |
| 4532 | 'defines': [ |
| 4533 | 'DISABLE_NACL', |
| 4534 | ], |
| 4535 | }, |
| 4536 | }], |
| 4537 | ['OS=="win" and msvs_use_common_linker_extras', { |
| 4538 | 'target_defaults': { |
| 4539 | 'msvs_settings': { |
| 4540 | 'VCLinkerTool': { |
| 4541 | 'DelayLoadDLLs': [ |
| 4542 | 'dbghelp.dll', |
| 4543 | 'dwmapi.dll', |
| 4544 | 'shell32.dll', |
| 4545 | 'uxtheme.dll', |
| 4546 | ], |
| 4547 | }, |
| 4548 | }, |
| 4549 | 'configurations': { |
| 4550 | 'x86_Base': { |
| 4551 | 'msvs_settings': { |
| 4552 | 'VCLinkerTool': { |
| 4553 | 'AdditionalOptions': [ |
| 4554 | '/safeseh', |
| 4555 | '/dynamicbase', |
| 4556 | '/ignore:4199', |
| 4557 | '/ignore:4221', |
| 4558 | '/nxcompat', |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 4559 | ], |
| 4560 | 'conditions': [ |
| 4561 | ['asan==0', { |
| 4562 | 'AdditionalOptions': ['/largeaddressaware'], |
| 4563 | }], |
Ben Murdoch | 2385ea3 | 2013-08-06 11:01:04 +0100 | [diff] [blame] | 4564 | ['clang==1', { |
| 4565 | 'AdditionalOptions!': ['/safeseh'], |
| 4566 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4567 | ], |
| 4568 | }, |
| 4569 | }, |
| 4570 | }, |
| 4571 | 'x64_Base': { |
| 4572 | 'msvs_settings': { |
| 4573 | 'VCLinkerTool': { |
| 4574 | 'AdditionalOptions': [ |
| 4575 | # safeseh is not compatible with x64 |
| 4576 | '/dynamicbase', |
| 4577 | '/ignore:4199', |
| 4578 | '/ignore:4221', |
| 4579 | '/nxcompat', |
| 4580 | ], |
| 4581 | }, |
| 4582 | }, |
| 4583 | }, |
| 4584 | }, |
| 4585 | }, |
| 4586 | }], |
| 4587 | ['enable_new_npdevice_api==1', { |
| 4588 | 'target_defaults': { |
| 4589 | 'defines': [ |
| 4590 | 'ENABLE_NEW_NPDEVICE_API', |
| 4591 | ], |
| 4592 | }, |
| 4593 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 4594 | # Don't warn about the "typedef 'foo' locally defined but not used" |
| 4595 | # for gcc 4.8. |
| 4596 | # TODO: remove this flag once all builds work. See crbug.com/227506 |
| 4597 | ['gcc_version>=48', { |
| 4598 | 'target_defaults': { |
| 4599 | 'cflags': [ |
| 4600 | '-Wno-unused-local-typedefs', |
| 4601 | ], |
| 4602 | }, |
| 4603 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4604 | ['clang==1', { |
| 4605 | 'conditions': [ |
| 4606 | ['OS=="android"', { |
| 4607 | # Android could use the goma with clang. |
| 4608 | 'make_global_settings': [ |
| 4609 | ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang)'], |
| 4610 | ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang++)'], |
| 4611 | ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang++)'], |
| 4612 | ['CC.host', '$(CC)'], |
| 4613 | ['CXX.host', '$(CXX)'], |
| 4614 | ['LINK.host', '$(LINK)'], |
| 4615 | ], |
| 4616 | }, { |
| 4617 | 'make_global_settings': [ |
| 4618 | ['CC', '<(make_clang_dir)/bin/clang'], |
| 4619 | ['CXX', '<(make_clang_dir)/bin/clang++'], |
| 4620 | ['LINK', '$(CXX)'], |
| 4621 | ['CC.host', '$(CC)'], |
| 4622 | ['CXX.host', '$(CXX)'], |
| 4623 | ['LINK.host', '$(LINK)'], |
| 4624 | ], |
| 4625 | }], |
| 4626 | ], |
| 4627 | }], |
| 4628 | ['OS=="android" and clang==0', { |
| 4629 | # Hardcode the compiler names in the Makefile so that |
| 4630 | # it won't depend on the environment at make time. |
| 4631 | 'make_global_settings': [ |
| 4632 | ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)'], |
| 4633 | ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-g++)'], |
| 4634 | ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)'], |
| 4635 | ['CC.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which gcc))'], |
| 4636 | ['CXX.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which g++))'], |
| 4637 | ['LINK.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which g++))'], |
| 4638 | ], |
| 4639 | }], |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 4640 | ['OS=="linux" and target_arch=="mipsel"', { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 4641 | 'make_global_settings': [ |
| 4642 | ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'], |
| 4643 | ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'], |
| 4644 | ['LINK', '$(CXX)'], |
| 4645 | ['CC.host', '<!(which gcc)'], |
| 4646 | ['CXX.host', '<!(which g++)'], |
| 4647 | ['LINK.host', '<!(which g++)'], |
| 4648 | ], |
| 4649 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4650 | ], |
| 4651 | 'xcode_settings': { |
| 4652 | # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT! |
| 4653 | # This block adds *project-wide* configuration settings to each project |
| 4654 | # file. It's almost always wrong to put things here. Specify your |
| 4655 | # custom xcode_settings in target_defaults to add them to targets instead. |
| 4656 | |
| 4657 | 'conditions': [ |
| 4658 | # In an Xcode Project Info window, the "Base SDK for All Configurations" |
| 4659 | # setting sets the SDK on a project-wide basis. In order to get the |
| 4660 | # configured SDK to show properly in the Xcode UI, SDKROOT must be set |
| 4661 | # here at the project level. |
| 4662 | ['OS=="mac"', { |
| 4663 | 'conditions': [ |
| 4664 | ['mac_sdk_path==""', { |
| 4665 | 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot |
| 4666 | }, { |
| 4667 | 'SDKROOT': '<(mac_sdk_path)', # -isysroot |
| 4668 | }], |
| 4669 | ], |
| 4670 | }], |
| 4671 | ['OS=="ios"', { |
| 4672 | 'conditions': [ |
| 4673 | ['ios_sdk_path==""', { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 4674 | 'conditions': [ |
| 4675 | # TODO(justincohen): Ninja only supports simulator for now. |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 4676 | ['"<(GENERATOR)"=="xcode" or ("<(GENERATOR)"=="ninja" and target_arch=="armv7")', { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 4677 | 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 4678 | }, { |
| 4679 | 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 4680 | }], |
| 4681 | ], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4682 | }, { |
| 4683 | 'SDKROOT': '<(ios_sdk_path)', # -isysroot |
| 4684 | }], |
| 4685 | ], |
| 4686 | }], |
| 4687 | ['OS=="ios"', { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4688 | # Just build armv7, until armv7s is correctly tested. |
| 4689 | 'VALID_ARCHS': 'armv7 i386', |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4690 | # Target both iPhone and iPad. |
| 4691 | 'TARGETED_DEVICE_FAMILY': '1,2', |
| 4692 | }], |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 4693 | ['target_arch=="x64"', { |
| 4694 | 'ARCHS': [ |
| 4695 | 'x86_64' |
| 4696 | ], |
| 4697 | }], |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 4698 | ], |
| 4699 | |
| 4700 | # The Xcode generator will look for an xcode_settings section at the root |
| 4701 | # of each dict and use it to apply settings on a file-wide basis. Most |
| 4702 | # settings should not be here, they should be in target-specific |
| 4703 | # xcode_settings sections, or better yet, should use non-Xcode-specific |
| 4704 | # settings in target dicts. SYMROOT is a special case, because many other |
| 4705 | # Xcode variables depend on it, including variables such as |
| 4706 | # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something |
| 4707 | # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the |
| 4708 | # files to appear (when present) in the UI as actual files and not red |
| 4709 | # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, |
| 4710 | # and therefore SYMROOT, needs to be set at the project level. |
| 4711 | 'SYMROOT': '<(DEPTH)/xcodebuild', |
| 4712 | }, |
| 4713 | } |