Use the /WX flag to have link warnings treated as errors.

Link steps with warnings typically lead to working binaries, but warnings can indicate dependency issues in the codebase, slow down builds, and otherwise just make it harder to find more relevant output in build logs.

This CL also adds exceptions to ignore certain linker warnings under specific configurations and targets.

BUG=659007, 676418, 676417, 654776

Review-Url: https://codereview.chromium.org/2581893002
Cr-Original-Commit-Position: refs/heads/master@{#440600}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c868aae8f9b8d51461afff79064c75339e6ce30c
This commit is contained in:
wez 2016-12-23 00:09:04 -08:00 коммит произвёл Commit bot
Родитель 69a30f6d2c
Коммит b14095b294
2 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -833,11 +833,15 @@ config("runtime_library") {
config("default_warnings") {
cflags = []
cflags_cc = []
ldflags = []
if (is_win) {
if (treat_warnings_as_errors) {
cflags += [ "/WX" ]
}
if (fatal_linker_warnings) {
ldflags += [ "/WX" ]
}
cflags += [
# Assume UTF-8 by default to avoid code page dependencies.

Просмотреть файл

@ -238,17 +238,13 @@ config("sdk_link") {
# their own.
config("common_linker_setup") {
ldflags = [
"/fastfail",
"/FIXED:NO",
"/ignore:4199",
"/ignore:4221",
"/NXCOMPAT",
]
ldflags += [
# Tell the linker to crash on failures.
"/fastfail",
]
# ASLR makes debugging with windbg difficult because Chrome.exe and
# Chrome.dll share the same base name. As result, windbg will name the
# Chrome.dll module like chrome_<base address>, where <base address>