summaryrefslogtreecommitdiffstats
path: root/build/config/win
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-03-20 10:08:20 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-20 17:08:57 +0000
commit8900cf9444fc3e0adf6728926c96337ccadc9674 (patch)
tree8a29a399e0424e02409ee877f34174df9ba22eb4 /build/config/win
parentc530d30822a02500b7db6708edd538279e530089 (diff)
downloadchromium_src-8900cf9444fc3e0adf6728926c96337ccadc9674.zip
chromium_src-8900cf9444fc3e0adf6728926c96337ccadc9674.tar.gz
chromium_src-8900cf9444fc3e0adf6728926c96337ccadc9674.tar.bz2
Incremental linking setup for GN Windows build.
Makes chrome.dll on Windows not use incremental linking since the ilk files get too large. This refactors the incremental linking configuration to make it easier to change the default. BUG= Review URL: https://codereview.chromium.org/1019353004 Cr-Commit-Position: refs/heads/master@{#321585}
Diffstat (limited to 'build/config/win')
-rw-r--r--build/config/win/BUILD.gn35
1 files changed, 33 insertions, 2 deletions
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn
index 3e98c1a..4ca22f7 100644
--- a/build/config/win/BUILD.gn
+++ b/build/config/win/BUILD.gn
@@ -106,11 +106,42 @@ config("windowed") {
# Incremental linking ----------------------------------------------------------
+incremental_linking_on_switch = [ "/INCREMENTAL" ]
+incremental_linking_off_switch = [ "/INCREMENTAL:NO" ]
+
+# Applies incremental linking or not depending on the current configuration.
+config("default_incremental_linking") {
+ if (is_debug) {
+ ldflags = incremental_linking_on_switch
+ } else {
+ ldflags = incremental_linking_off_switch
+ }
+}
+
+# Explicitly on or off incremental linking
config("incremental_linking") {
- ldflags = [ "/INCREMENTAL" ]
+ ldflags = incremental_linking_on_switch
}
config("no_incremental_linking") {
- ldflags = [ "/INCREMENTAL:NO" ]
+ ldflags = incremental_linking_off_switch
+}
+
+# Some large modules can't handle incremental linking in some situations. This
+# config should be applied to large modules to turn off incremental linking
+# when it won't work.
+config("default_large_module_incremental_linking") {
+ if (!is_debug) {
+ # Default is always off in release build.
+ ldflags = incremental_linking_off_switch
+ } else if ((symbol_level == 0 || symbol_level == 1) &&
+ (current_cpu == "x86" || !is_component_build)) {
+ # When full symbols are on, don't do incremental linking for large modules
+ # on 32-bit or in non-component mode as the toolchain fails due to the size
+ # of the .ilk files.
+ ldflags = incremental_linking_off_switch
+ } else {
+ ldflags = incremental_linking_on_switch
+ }
}
# Character set ----------------------------------------------------------------