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/compiler/compiler.gni") | 5 import("//build/config/compiler/compiler.gni") |
6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
7 import("//build/config/win/visual_studio_version.gni") | 7 import("//build/config/win/visual_studio_version.gni") |
8 | 8 |
9 assert(is_win) | 9 assert(is_win) |
10 | 10 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 ] | 134 ] |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
138 # This is included by reference in the //build/config/compiler:runtime_library | 138 # This is included by reference in the //build/config/compiler:runtime_library |
139 # config that is applied to all targets. It is here to separate out the logic | 139 # config that is applied to all targets. It is here to separate out the logic |
140 # that is Windows-only. Please see that target for advice on what should go in | 140 # that is Windows-only. Please see that target for advice on what should go in |
141 # :runtime_library vs. :compiler. | 141 # :runtime_library vs. :compiler. |
142 config("runtime_library") { | 142 config("runtime_library") { |
143 cflags = [] | 143 cflags = [] |
| 144 libs = [] |
144 | 145 |
145 # Defines that set up the CRT. | 146 # Defines that set up the CRT. |
146 defines = [ | 147 defines = [ |
147 "__STD_C", | 148 "__STD_C", |
148 "_CRT_RAND_S", | 149 "_CRT_RAND_S", |
149 "_CRT_SECURE_NO_DEPRECATE", | 150 "_CRT_SECURE_NO_DEPRECATE", |
150 "_HAS_EXCEPTIONS=0", | 151 "_HAS_EXCEPTIONS=0", |
151 "_SCL_SECURE_NO_DEPRECATE", | 152 "_SCL_SECURE_NO_DEPRECATE", |
152 ] | 153 ] |
153 | 154 |
154 # Defines that set up the Windows SDK. | 155 # Defines that set up the Windows SDK. |
155 defines += [ | 156 defines += [ |
156 "_ATL_NO_OPENGL", | 157 "_ATL_NO_OPENGL", |
157 "_WINDOWS", | 158 "_WINDOWS", |
158 "CERT_CHAIN_PARA_HAS_EXTRA_FIELDS", | 159 "CERT_CHAIN_PARA_HAS_EXTRA_FIELDS", |
159 "NTDDI_VERSION=0x0A000000", | 160 "NTDDI_VERSION=0x0A000000", |
160 "PSAPI_VERSION=1", | 161 "PSAPI_VERSION=1", |
161 "WIN32", | 162 "WIN32", |
162 "_SECURE_ATL", | 163 "_SECURE_ATL", |
163 ] | 164 ] |
164 | 165 |
165 if (!use_vs_code_analysis) { | 166 if (!use_vs_code_analysis) { |
166 # This is required for ATL to use XP-safe versions of its functions. | 167 # This is required for ATL to use XP-safe versions of its functions. |
167 # However it is prohibited when using /analyze | 168 # However it is prohibited when using /analyze |
168 defines += [ "_USING_V110_SDK71_" ] | 169 defines += [ "_USING_V110_SDK71_" ] |
169 } | 170 } |
170 | 171 |
| 172 vcruntime_libs = [] |
| 173 if (is_debug) { |
| 174 vcruntime_libs += [ "vcruntimed.lib" ] |
| 175 if (visual_studio_version == "2015") { |
| 176 vcruntime_libs += [ "ucrtd.lib" ] |
| 177 } |
| 178 } else { |
| 179 vcruntime_libs += [ "vcruntime.lib" ] |
| 180 if (visual_studio_version == "2015") { |
| 181 vcruntime_libs += [ "ucrt.lib" ] |
| 182 } |
| 183 } |
| 184 |
171 if (is_component_build) { | 185 if (is_component_build) { |
172 # Component mode: dynamic CRT. Since the library is shared, it requires | 186 # Component mode: dynamic CRT. Since the library is shared, it requires |
173 # exceptions or will give errors about things not matching, so keep | 187 # exceptions or will give errors about things not matching, so keep |
174 # exceptions on. | 188 # exceptions on. |
175 if (is_debug) { | 189 if (is_debug) { |
176 cflags += [ "/MDd" ] | 190 cflags += [ "/MDd" ] |
177 } else { | 191 } else { |
178 cflags += [ "/MD" ] | 192 cflags += [ "/MD" ] |
179 } | 193 } |
180 } else { | 194 } else { |
181 if (current_os != "win") { | 195 if (current_os != "win") { |
182 # WindowsRT: use the dynamic CRT. | 196 # WindowsRT: use the dynamic CRT. |
183 if (is_debug) { | 197 if (is_debug) { |
184 cflags += [ "/MDd" ] | 198 cflags += [ "/MDd" ] |
185 } else { | 199 } else { |
186 cflags += [ "/MD" ] | 200 cflags += [ "/MD" ] |
187 } | 201 } |
188 } else { | 202 } else { |
189 # Desktop Windows: static CRT. | 203 # Desktop Windows: static CRT. |
190 if (is_debug) { | 204 if (is_debug) { |
191 cflags += [ "/MTd" ] | 205 cflags += [ "/MTd" ] |
192 } else { | 206 } else { |
193 cflags += [ "/MT" ] | 207 cflags += [ "/MT" ] |
194 } | 208 } |
| 209 vcruntime_libs = [] |
195 } | 210 } |
196 } | 211 } |
| 212 libs += vcruntime_libs |
197 } | 213 } |
198 | 214 |
199 # Sets the default Windows build version. This is separated because some | 215 # Sets the default Windows build version. This is separated because some |
200 # targets need to manually override it for their compiles. | 216 # targets need to manually override it for their compiles. |
201 config("winver") { | 217 config("winver") { |
202 defines = [ | 218 defines = [ |
203 "_WIN32_WINNT=0x0A00", | 219 "_WIN32_WINNT=0x0A00", |
204 "WINVER=0x0A00", | 220 "WINVER=0x0A00", |
205 ] | 221 ] |
206 } | 222 } |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 | 386 |
371 # Internal stuff -------------------------------------------------------------- | 387 # Internal stuff -------------------------------------------------------------- |
372 | 388 |
373 # Config used by the MIDL template to disable warnings. | 389 # Config used by the MIDL template to disable warnings. |
374 config("midl_warnings") { | 390 config("midl_warnings") { |
375 if (is_clang) { | 391 if (is_clang) { |
376 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". | 392 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". |
377 cflags = [ "-Wno-extra-tokens" ] | 393 cflags = [ "-Wno-extra-tokens" ] |
378 } | 394 } |
379 } | 395 } |
OLD | NEW |