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. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 ldflags = [ "/SUBSYSTEM:CONSOLE" ] | 101 ldflags = [ "/SUBSYSTEM:CONSOLE" ] |
102 } | 102 } |
103 config("windowed") { | 103 config("windowed") { |
104 ldflags = [ "/SUBSYSTEM:WINDOWS" ] | 104 ldflags = [ "/SUBSYSTEM:WINDOWS" ] |
105 } | 105 } |
106 | 106 |
107 # Incremental linking ---------------------------------------------------------- | 107 # Incremental linking ---------------------------------------------------------- |
108 | 108 |
109 incremental_linking_on_switch = [ "/INCREMENTAL" ] | 109 incremental_linking_on_switch = [ "/INCREMENTAL" ] |
110 incremental_linking_off_switch = [ "/INCREMENTAL:NO" ] | 110 incremental_linking_off_switch = [ "/INCREMENTAL:NO" ] |
| 111 if (is_debug) { |
| 112 default_incremental_linking_switch = incremental_linking_on_switch |
| 113 } else { |
| 114 default_incremental_linking_switch = incremental_linking_off_switch |
| 115 } |
111 | 116 |
112 # Applies incremental linking or not depending on the current configuration. | 117 # Applies incremental linking or not depending on the current configuration. |
113 config("default_incremental_linking") { | 118 config("default_incremental_linking") { |
114 if (is_debug) { | 119 ldflags = default_incremental_linking_switch |
115 ldflags = incremental_linking_on_switch | |
116 } else { | |
117 ldflags = incremental_linking_off_switch | |
118 } | |
119 } | 120 } |
120 | 121 |
121 # Explicitly on or off incremental linking | 122 # Explicitly on or off incremental linking |
122 config("incremental_linking") { | 123 config("incremental_linking") { |
123 ldflags = incremental_linking_on_switch | 124 ldflags = incremental_linking_on_switch |
124 } | 125 } |
125 config("no_incremental_linking") { | 126 config("no_incremental_linking") { |
126 ldflags = incremental_linking_off_switch | 127 ldflags = incremental_linking_off_switch |
127 } | 128 } |
128 | 129 |
129 # Some large modules can't handle incremental linking in some situations. This | 130 # Some large modules can't handle incremental linking in some situations. This |
130 # config should be applied to large modules to turn off incremental linking | 131 # config should be applied to large modules to turn off incremental linking |
131 # when it won't work. | 132 # when it won't work. |
132 config("default_large_module_incremental_linking") { | 133 config("default_large_module_incremental_linking") { |
133 if (!is_debug) { | 134 if (symbol_level > 0 && (current_cpu == "x86" || !is_component_build)) { |
134 # Default is always off in release build. | 135 # When symbols are on, things get so large that the tools fail due to the |
135 ldflags = incremental_linking_off_switch | 136 # size of the .ilk files. |
136 } else if ((symbol_level == 0 || symbol_level == 1) && | |
137 (current_cpu == "x86" || !is_component_build)) { | |
138 # When full symbols are on, don't do incremental linking for large modules | |
139 # on 32-bit or in non-component mode as the toolchain fails due to the size | |
140 # of the .ilk files. | |
141 ldflags = incremental_linking_off_switch | 137 ldflags = incremental_linking_off_switch |
142 } else { | 138 } else { |
143 ldflags = incremental_linking_on_switch | 139 # Otherwise just do the default incremental linking for this build type. |
| 140 ldflags = default_incremental_linking_switch |
144 } | 141 } |
145 } | 142 } |
146 | 143 |
147 # Character set ---------------------------------------------------------------- | 144 # Character set ---------------------------------------------------------------- |
148 | 145 |
149 # Not including this config means "ansi" (8-bit system codepage). | 146 # Not including this config means "ansi" (8-bit system codepage). |
150 config("unicode") { | 147 config("unicode") { |
151 defines = [ | 148 defines = [ |
152 "_UNICODE", | 149 "_UNICODE", |
153 "UNICODE", | 150 "UNICODE", |
(...skipping 11 matching lines...) Expand all Loading... |
165 | 162 |
166 # Nominmax -------------------------------------------------------------------- | 163 # Nominmax -------------------------------------------------------------------- |
167 | 164 |
168 # Some third party code defines NOMINMAX before including windows.h, which | 165 # Some third party code defines NOMINMAX before including windows.h, which |
169 # then causes warnings when it's been previously defined on the command line. | 166 # then causes warnings when it's been previously defined on the command line. |
170 # For such targets, this config can be removed. | 167 # For such targets, this config can be removed. |
171 | 168 |
172 config("nominmax") { | 169 config("nominmax") { |
173 defines = [ "NOMINMAX" ] | 170 defines = [ "NOMINMAX" ] |
174 } | 171 } |
OLD | NEW |