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

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

Issue 2581893002: Use the /WX flag to have link warnings treated as errors. (Closed)
Patch Set: Restore exceptions and update comments Created 4 years 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 | « no previous file | media/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 3da27470120c5fe17c564f6f012dff4694cbc627..8885a70bf363b075056af2f88661769e5e069da7 100644
--- a/build/config/win/BUILD.gn
+++ b/build/config/win/BUILD.gn
@@ -102,7 +102,7 @@ config("compiler") {
# skipping /PROFILE because it is incompatible with /DEBUG:FASTLINK
# we should explicitly add these flags in order to avoid unintended
# consequences such as larger binaries.
- ldflags = [
+ ldflags += [
brucedawson 2016/12/21 22:22:53 This is wrong. "+=" should only be allowed if ldfl
Wez 2016/12/22 00:03:08 Done.
"/OPT:REF",
"/OPT:ICF",
"/INCREMENTAL:NO",
@@ -212,15 +212,18 @@ config("winver") {
# Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs.
config("sdk_link") {
+ # Treat linker warnings as errors, to avoid spammy build output.
+ ldflags = [ "/WX" ]
+
if (current_cpu == "x64") {
- ldflags = [ "/MACHINE:X64" ]
+ ldflags += [ "/MACHINE:X64" ]
lib_dirs = [
"$windows_sdk_path\Lib\winv6.3\um\x64",
"$visual_studio_path\VC\lib\amd64",
"$visual_studio_path\VC\atlmfc\lib\amd64",
]
} else {
- ldflags = [
+ ldflags += [
"/MACHINE:X86",
"/SAFESEH", # Not compatible with x64 so use only for x86.
"/largeaddressaware",
@@ -238,6 +241,7 @@ config("sdk_link") {
# their own.
config("common_linker_setup") {
ldflags = [
+ "/WX",
"/FIXED:NO",
"/ignore:4199",
"/ignore:4221",
« no previous file with comments | « no previous file | media/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698