| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/clang/clang.gni") | 5 import("//build/config/clang/clang.gni") |
| 6 import("//build/config/compiler/compiler.gni") | 6 import("//build/config/compiler/compiler.gni") |
| 7 import("//build/config/sanitizers/sanitizers.gni") | 7 import("//build/config/sanitizers/sanitizers.gni") |
| 8 import("//build/config/win/visual_studio_version.gni") | 8 import("//build/config/win/visual_studio_version.gni") |
| 9 import("//build/toolchain/toolchain.gni") | 9 import("//build/toolchain/toolchain.gni") |
| 10 | 10 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 "PSAPI_VERSION=1", | 186 "PSAPI_VERSION=1", |
| 187 "WIN32", | 187 "WIN32", |
| 188 "_SECURE_ATL", | 188 "_SECURE_ATL", |
| 189 ] | 189 ] |
| 190 | 190 |
| 191 if (!use_vs_code_analysis) { | 191 if (!use_vs_code_analysis) { |
| 192 # This is required for ATL to use XP-safe versions of its functions. | 192 # This is required for ATL to use XP-safe versions of its functions. |
| 193 # However it is prohibited when using /analyze | 193 # However it is prohibited when using /analyze |
| 194 defines += [ "_USING_V110_SDK71_" ] | 194 defines += [ "_USING_V110_SDK71_" ] |
| 195 } | 195 } |
| 196 | |
| 197 if (is_component_build) { | |
| 198 # Component mode: dynamic CRT. Since the library is shared, it requires | |
| 199 # exceptions or will give errors about things not matching, so keep | |
| 200 # exceptions on. | |
| 201 if (is_debug) { | |
| 202 cflags += [ "/MDd" ] | |
| 203 } else { | |
| 204 cflags += [ "/MD" ] | |
| 205 } | |
| 206 } else { | |
| 207 if (current_os != "win") { | |
| 208 # WindowsRT: use the dynamic CRT. | |
| 209 if (is_debug) { | |
| 210 cflags += [ "/MDd" ] | |
| 211 } else { | |
| 212 cflags += [ "/MD" ] | |
| 213 } | |
| 214 } else { | |
| 215 # Desktop Windows: static CRT. | |
| 216 if (is_debug) { | |
| 217 cflags += [ "/MTd" ] | |
| 218 } else { | |
| 219 cflags += [ "/MT" ] | |
| 220 } | |
| 221 } | |
| 222 } | |
| 223 } | 196 } |
| 224 | 197 |
| 225 # Sets the default Windows build version. This is separated because some | 198 # Sets the default Windows build version. This is separated because some |
| 226 # targets need to manually override it for their compiles. | 199 # targets need to manually override it for their compiles. |
| 227 config("winver") { | 200 config("winver") { |
| 228 defines = [ | 201 defines = [ |
| 229 "NTDDI_VERSION=0x0A000000", | 202 "NTDDI_VERSION=0x0A000000", |
| 230 "_WIN32_WINNT=0x0A00", | 203 "_WIN32_WINNT=0x0A00", |
| 231 "WINVER=0x0A00", | 204 "WINVER=0x0A00", |
| 232 ] | 205 ] |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 } | 257 } |
| 285 | 258 |
| 286 if (win_linker_timing) { | 259 if (win_linker_timing) { |
| 287 ldflags += [ | 260 ldflags += [ |
| 288 "/time", | 261 "/time", |
| 289 "/verbose:incr", | 262 "/verbose:incr", |
| 290 ] | 263 ] |
| 291 } | 264 } |
| 292 } | 265 } |
| 293 | 266 |
| 267 # CRT -------------------------------------------------------------------------- |
| 268 |
| 269 # Configures how the runtime library (CRT) is going to be used. |
| 270 # See https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx for a reference of |
| 271 # what each value does. |
| 272 config("default_crt") { |
| 273 if (is_component_build) { |
| 274 # Component mode: dynamic CRT. Since the library is shared, it requires |
| 275 # exceptions or will give errors about things not matching, so keep |
| 276 # exceptions on. |
| 277 configs = [ ":dynamic_crt" ] |
| 278 } else { |
| 279 if (current_os != "win") { |
| 280 # WindowsRT: use the dynamic CRT. |
| 281 configs = [ ":dynamic_crt" ] |
| 282 } else { |
| 283 # Desktop Windows: static CRT. |
| 284 configs = [ ":static_crt" ] |
| 285 } |
| 286 } |
| 287 } |
| 288 |
| 289 config("dynamic_crt") { |
| 290 if (is_debug) { |
| 291 cflags = [ "/MDd" ] |
| 292 } else { |
| 293 cflags = [ "/MD" ] |
| 294 } |
| 295 } |
| 296 |
| 297 config("static_crt") { |
| 298 if (is_debug) { |
| 299 cflags = [ "/MTd" ] |
| 300 } else { |
| 301 cflags = [ "/MT" ] |
| 302 } |
| 303 } |
| 304 |
| 294 # Subsystem -------------------------------------------------------------------- | 305 # Subsystem -------------------------------------------------------------------- |
| 295 | 306 |
| 296 # This is appended to the subsystem to specify a minimum version. | 307 # This is appended to the subsystem to specify a minimum version. |
| 297 if (current_cpu == "x64") { | 308 if (current_cpu == "x64") { |
| 298 # The number after the comma is the minimum required OS version. | 309 # The number after the comma is the minimum required OS version. |
| 299 # 5.02 = Windows Server 2003. | 310 # 5.02 = Windows Server 2003. |
| 300 subsystem_version_suffix = ",5.02" | 311 subsystem_version_suffix = ",5.02" |
| 301 } else { | 312 } else { |
| 302 # 5.01 = Windows XP. | 313 # 5.01 = Windows XP. |
| 303 subsystem_version_suffix = ",5.01" | 314 subsystem_version_suffix = ",5.01" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 | 407 |
| 397 # Internal stuff -------------------------------------------------------------- | 408 # Internal stuff -------------------------------------------------------------- |
| 398 | 409 |
| 399 # Config used by the MIDL template to disable warnings. | 410 # Config used by the MIDL template to disable warnings. |
| 400 config("midl_warnings") { | 411 config("midl_warnings") { |
| 401 if (is_clang) { | 412 if (is_clang) { |
| 402 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". | 413 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". |
| 403 cflags = [ "-Wno-extra-tokens" ] | 414 cflags = [ "-Wno-extra-tokens" ] |
| 404 } | 415 } |
| 405 } | 416 } |
| OLD | NEW |