Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1492)

Unified Diff: build/config/win/BUILD.gn

Issue 1019353004: Incremental linking setup for GN Windows build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: symbol level Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/BUILDCONFIG.gn ('k') | chrome/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/win/BUILD.gn
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn
index 3e98c1a871ee9bcd2ac39184127600262cbf391d..4ca22f7fa414b29f4aab6d13290a7c40dc3ba4c9 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 ----------------------------------------------------------------
« no previous file with comments | « build/config/BUILDCONFIG.gn ('k') | chrome/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698