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/win/visual_studio_version.gni") | 5 import("//build/config/win/visual_studio_version.gni") |
6 | 6 |
7 # Compiler setup for the Windows SDK. Applied to all targets. | 7 # Compiler setup for the Windows SDK. Applied to all targets. |
8 config("sdk") { | 8 config("sdk") { |
9 # The include path is the stuff returned by the script. | 9 # The include path is the stuff returned by the script. |
10 #include_dirs = msvc_config[0] TODO(brettw) make this work. | 10 #include_dirs = msvc_config[0] TODO(brettw) make this work. |
11 | 11 |
12 defines = [ | 12 defines = [ |
13 "_ATL_NO_OPENGL", | 13 "_ATL_NO_OPENGL", |
14 "_WINDOWS", | 14 "_WINDOWS", |
15 "CERT_CHAIN_PARA_HAS_EXTRA_FIELDS", | 15 "CERT_CHAIN_PARA_HAS_EXTRA_FIELDS", |
16 "NTDDI_VERSION=0x06030000", | 16 "NTDDI_VERSION=0x06030000", |
17 "PSAPI_VERSION=1", | 17 "PSAPI_VERSION=1", |
18 "WIN32", | 18 "WIN32", |
| 19 "_SECURE_ATL", |
19 ] | 20 ] |
20 | 21 |
21 include_dirs = system_include_dirs | 22 include_dirs = system_include_dirs |
22 | |
23 if (is_visual_studio_express) { | |
24 # https://code.google.com/p/chromium/issues/detail?id=372451#c20 | |
25 # Warning 4702 ("Unreachable code") should be re-enabled once Express users | |
26 # are updated to VS2013 Update 2. | |
27 cflags = [ "/wd4702" ] | |
28 } else { | |
29 # Only supported on non-Express versions. | |
30 defines += [ "_SECURE_ATL" ] | |
31 } | |
32 } | 23 } |
33 | 24 |
34 # Sets the default Windows build version. This is separated because some | 25 # Sets the default Windows build version. This is separated because some |
35 # targets need to manually override it for their compiles. | 26 # targets need to manually override it for their compiles. |
36 config("winver") { | 27 config("winver") { |
37 defines = [ | 28 defines = [ |
38 "_WIN32_WINNT=0x0603", | 29 "_WIN32_WINNT=0x0603", |
39 "WINVER=0x0603", | 30 "WINVER=0x0603", |
40 ] | 31 ] |
41 } | 32 } |
42 | 33 |
43 # Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs. | 34 # Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs. |
44 config("sdk_link") { | 35 config("sdk_link") { |
45 if (cpu_arch == "x64") { | 36 if (cpu_arch == "x64") { |
46 ldflags = [ "/MACHINE:X64" ] | 37 ldflags = [ "/MACHINE:X64" ] |
47 lib_dirs = [ | 38 lib_dirs = [ |
48 "$windows_sdk_path\Lib\winv6.3\um\x64", | 39 "$windows_sdk_path\Lib\winv6.3\um\x64", |
49 "$visual_studio_path\VC\lib\amd64", | 40 "$visual_studio_path\VC\lib\amd64", |
50 "$visual_studio_path\VC\atlmfc\lib\amd64", | 41 "$visual_studio_path\VC\atlmfc\lib\amd64", |
51 ] | 42 ] |
52 if (is_visual_studio_express) { | |
53 lib_dirs += [ "$wdk_path/lib/ATL/amd64" ] | |
54 } | |
55 } else { | 43 } else { |
56 ldflags = [ | 44 ldflags = [ |
57 "/MACHINE:X86", | 45 "/MACHINE:X86", |
58 "/SAFESEH", # Not compatible with x64 so use only for x86. | 46 "/SAFESEH", # Not compatible with x64 so use only for x86. |
59 ] | 47 ] |
60 lib_dirs = [ | 48 lib_dirs = [ |
61 "$windows_sdk_path\Lib\winv6.3\um\x86", | 49 "$windows_sdk_path\Lib\winv6.3\um\x86", |
62 "$visual_studio_path\VC\lib", | 50 "$visual_studio_path\VC\lib", |
63 "$visual_studio_path\VC\atlmfc\lib", | 51 "$visual_studio_path\VC\atlmfc\lib", |
64 ] | 52 ] |
65 if (is_visual_studio_express) { | |
66 lib_dirs += [ "$wdk_path/lib/ATL/i386" ] | |
67 } | |
68 if (!is_asan) { | 53 if (!is_asan) { |
69 ldflags += [ "/largeaddressaware" ] | 54 ldflags += [ "/largeaddressaware" ] |
70 } | 55 } |
71 } | 56 } |
72 | |
73 if (is_visual_studio_express) { | |
74 # Explicitly required when using the ATL with express. | |
75 libs = [ "atlthunk.lib" ] | |
76 | |
77 # ATL 8.0 included in WDK 7.1 makes the linker to generate almost eight | |
78 # hundred LNK4254 and LNK4078 warnings: | |
79 # - warning LNK4254: section 'ATL' (50000040) merged into '.rdata' | |
80 # (40000040) with different attributes | |
81 # - warning LNK4078: multiple 'ATL' sections found with different | |
82 # attributes | |
83 ldflags += [ "/ignore:4254", "/ignore:4078" ] | |
84 } | |
85 } | 57 } |
86 | 58 |
87 # This default linker setup is provided separately from the SDK setup so | 59 # This default linker setup is provided separately from the SDK setup so |
88 # targets who want different library configurations can remove this and specify | 60 # targets who want different library configurations can remove this and specify |
89 # their own. | 61 # their own. |
90 config("common_linker_setup") { | 62 config("common_linker_setup") { |
91 ldflags = [ | 63 ldflags = [ |
92 "/FIXED:NO", | 64 "/FIXED:NO", |
93 "/ignore:4199", | 65 "/ignore:4199", |
94 "/ignore:4221", | 66 "/ignore:4221", |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 131 |
160 # Some third party code defines NOMINMAX before including windows.h, which | 132 # Some third party code defines NOMINMAX before including windows.h, which |
161 # then causes warnings when it's been previously defined on the command line. | 133 # then causes warnings when it's been previously defined on the command line. |
162 # For such targets, this config can be removed. | 134 # For such targets, this config can be removed. |
163 | 135 |
164 config("nominmax") { | 136 config("nominmax") { |
165 defines = [ | 137 defines = [ |
166 "NOMINMAX", | 138 "NOMINMAX", |
167 ] | 139 ] |
168 } | 140 } |
OLD | NEW |