Commit 8900cf94 authored by brettw's avatar brettw Committed by Commit bot

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}
parent c530d308
......@@ -416,15 +416,8 @@ _native_compiler_configs += [ _default_symbols_config ]
# Windows linker setup for EXEs and DLLs.
if (is_win) {
if (is_debug) {
_default_incremental_linking_config =
"//build/config/win:incremental_linking"
} else {
_default_incremental_linking_config =
"//build/config/win:no_incremental_linking"
}
_windows_linker_configs = [
_default_incremental_linking_config,
"//build/config/win:default_incremental_linking",
"//build/config/win:sdk_link",
"//build/config/win:common_linker_setup",
......
......@@ -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 ----------------------------------------------------------------
......
......@@ -189,8 +189,9 @@ shared_library("main_dll") {
#deps += [ 'chrome_user32_delay_imports' ] TODO(GYP)
}
# TODO(GYP) incremental linking flags in debug builds
#'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
# This is a large module that can't do incremental linking in some cases.
configs -= [ "//build/config/win:default_incremental_linking" ]
configs += [ "//build/config/win:default_large_module_incremental_linking" ]
# TODO(GYP) Lots of VCLinkerTool stuff on Windows.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment