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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 config("console") { | 100 config("console") { |
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" ] |
| 110 incremental_linking_off_switch = [ "/INCREMENTAL:NO" ] |
| 111 |
| 112 # Applies incremental linking or not depending on the current configuration. |
| 113 config("default_incremental_linking") { |
| 114 if (is_debug) { |
| 115 ldflags = incremental_linking_on_switch |
| 116 } else { |
| 117 ldflags = incremental_linking_off_switch |
| 118 } |
| 119 } |
| 120 |
| 121 # Explicitly on or off incremental linking |
109 config("incremental_linking") { | 122 config("incremental_linking") { |
110 ldflags = [ "/INCREMENTAL" ] | 123 ldflags = incremental_linking_on_switch |
111 } | 124 } |
112 config("no_incremental_linking") { | 125 config("no_incremental_linking") { |
113 ldflags = [ "/INCREMENTAL:NO" ] | 126 ldflags = incremental_linking_off_switch |
| 127 } |
| 128 |
| 129 # 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 # when it won't work. |
| 132 config("default_large_module_incremental_linking") { |
| 133 if (!is_debug) { |
| 134 # Default is always off in release build. |
| 135 ldflags = incremental_linking_off_switch |
| 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 |
| 142 } else { |
| 143 ldflags = incremental_linking_on_switch |
| 144 } |
114 } | 145 } |
115 | 146 |
116 # Character set ---------------------------------------------------------------- | 147 # Character set ---------------------------------------------------------------- |
117 | 148 |
118 # Not including this config means "ansi" (8-bit system codepage). | 149 # Not including this config means "ansi" (8-bit system codepage). |
119 config("unicode") { | 150 config("unicode") { |
120 defines = [ | 151 defines = [ |
121 "_UNICODE", | 152 "_UNICODE", |
122 "UNICODE", | 153 "UNICODE", |
123 ] | 154 ] |
(...skipping 10 matching lines...) Expand all Loading... |
134 | 165 |
135 # Nominmax -------------------------------------------------------------------- | 166 # Nominmax -------------------------------------------------------------------- |
136 | 167 |
137 # Some third party code defines NOMINMAX before including windows.h, which | 168 # Some third party code defines NOMINMAX before including windows.h, which |
138 # then causes warnings when it's been previously defined on the command line. | 169 # then causes warnings when it's been previously defined on the command line. |
139 # For such targets, this config can be removed. | 170 # For such targets, this config can be removed. |
140 | 171 |
141 config("nominmax") { | 172 config("nominmax") { |
142 defines = [ "NOMINMAX" ] | 173 defines = [ "NOMINMAX" ] |
143 } | 174 } |
OLD | NEW |