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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 } | 70 } |
71 | 71 |
72 # This is included by reference in the //build/config/compiler:runtime_library | 72 # This is included by reference in the //build/config/compiler:runtime_library |
73 # config that is applied to all targets. It is here to separate out the logic | 73 # config that is applied to all targets. It is here to separate out the logic |
74 # that is Windows-only. Please see that target for advice on what should go in | 74 # that is Windows-only. Please see that target for advice on what should go in |
75 # :runtime_library vs. :compiler. | 75 # :runtime_library vs. :compiler. |
76 config("runtime_library") { | 76 config("runtime_library") { |
77 cflags = [] | 77 cflags = [] |
78 | 78 |
| 79 # Defines that set up the CRT. |
79 defines = [ | 80 defines = [ |
80 "__STD_C", | 81 "__STD_C", |
81 "_CRT_RAND_S", | 82 "_CRT_RAND_S", |
82 "_CRT_SECURE_NO_DEPRECATE", | 83 "_CRT_SECURE_NO_DEPRECATE", |
83 "_HAS_EXCEPTIONS=0", | 84 "_HAS_EXCEPTIONS=0", |
84 "_SCL_SECURE_NO_DEPRECATE", | 85 "_SCL_SECURE_NO_DEPRECATE", |
85 ] | 86 ] |
86 | 87 |
| 88 # Defines that set up the Windows SDK. |
| 89 defines += [ |
| 90 "_ATL_NO_OPENGL", |
| 91 "_WINDOWS", |
| 92 "CERT_CHAIN_PARA_HAS_EXTRA_FIELDS", |
| 93 "NTDDI_VERSION=0x06030000", |
| 94 "PSAPI_VERSION=1", |
| 95 "WIN32", |
| 96 "_SECURE_ATL", |
| 97 |
| 98 # This is required for ATL to use XP-safe versions of its functions. |
| 99 "_USING_V110_SDK71_", |
| 100 ] |
| 101 |
87 if (is_component_build) { | 102 if (is_component_build) { |
88 # Component mode: dynamic CRT. Since the library is shared, it requires | 103 # Component mode: dynamic CRT. Since the library is shared, it requires |
89 # exceptions or will give errors about things not matching, so keep | 104 # exceptions or will give errors about things not matching, so keep |
90 # exceptions on. | 105 # exceptions on. |
91 if (is_debug) { | 106 if (is_debug) { |
92 cflags += [ "/MDd" ] | 107 cflags += [ "/MDd" ] |
93 } else { | 108 } else { |
94 cflags += [ "/MD" ] | 109 cflags += [ "/MD" ] |
95 } | 110 } |
96 } else { | 111 } else { |
97 if (current_os != "win") { | 112 if (current_os != "win") { |
98 # WindowsRT: use the dynamic CRT. | 113 # WindowsRT: use the dynamic CRT. |
99 if (is_debug) { | 114 if (is_debug) { |
100 cflags += [ "/MDd" ] | 115 cflags += [ "/MDd" ] |
101 } else { | 116 } else { |
102 cflags += [ "/MD" ] | 117 cflags += [ "/MD" ] |
103 } | 118 } |
104 } else { | 119 } else { |
105 # Desktop Windows: static CRT. | 120 # Desktop Windows: static CRT. |
106 if (is_debug) { | 121 if (is_debug) { |
107 cflags += [ "/MTd" ] | 122 cflags += [ "/MTd" ] |
108 } else { | 123 } else { |
109 cflags += [ "/MT" ] | 124 cflags += [ "/MT" ] |
110 } | 125 } |
111 } | 126 } |
112 } | 127 } |
113 } | 128 } |
114 | 129 |
115 # Compiler setup for the Windows SDK. Applied to all targets. | |
116 config("sdk") { | |
117 # The include path is the stuff returned by the script. | |
118 #include_dirs = msvc_config[0] TODO(brettw) make this work. | |
119 | |
120 defines = [ | |
121 "_ATL_NO_OPENGL", | |
122 "_WINDOWS", | |
123 "CERT_CHAIN_PARA_HAS_EXTRA_FIELDS", | |
124 "NTDDI_VERSION=0x06030000", | |
125 "PSAPI_VERSION=1", | |
126 "WIN32", | |
127 "_SECURE_ATL", | |
128 | |
129 # This is required for ATL to use XP-safe versions of its functions. | |
130 "_USING_V110_SDK71_", | |
131 ] | |
132 } | |
133 | |
134 # Sets the default Windows build version. This is separated because some | 130 # Sets the default Windows build version. This is separated because some |
135 # targets need to manually override it for their compiles. | 131 # targets need to manually override it for their compiles. |
136 config("winver") { | 132 config("winver") { |
137 defines = [ | 133 defines = [ |
138 "_WIN32_WINNT=0x0603", | 134 "_WIN32_WINNT=0x0603", |
139 "WINVER=0x0603", | 135 "WINVER=0x0603", |
140 ] | 136 ] |
141 } | 137 } |
142 | 138 |
143 # Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs. | 139 # Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs. |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 301 |
306 # Internal stuff -------------------------------------------------------------- | 302 # Internal stuff -------------------------------------------------------------- |
307 | 303 |
308 # Config used by the MIDL template to disable warnings. | 304 # Config used by the MIDL template to disable warnings. |
309 config("midl_warnings") { | 305 config("midl_warnings") { |
310 if (is_clang) { | 306 if (is_clang) { |
311 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". | 307 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". |
312 cflags = [ "-Wno-extra-tokens" ] | 308 cflags = [ "-Wno-extra-tokens" ] |
313 } | 309 } |
314 } | 310 } |
OLD | NEW |