diff --git a/config/win/BUILD.gn b/config/win/BUILD.gn index 95e325207..b050343a6 100644 --- a/config/win/BUILD.gn +++ b/config/win/BUILD.gn @@ -89,7 +89,11 @@ config("compiler") { # don't emit the CFG checks themselves, but this enables the functions to # be called by code that is built with those checks enabled, such as system # libraries. - cflags += [ "/guard:cf,nochecks" ] + if (!is_debug && !is_component_build) { + # CFG isn't needed on debug or component builds, adds a bit of bloat to + # .obj files, and caused link errors once - https://crbug.com/1019970 + cflags += [ "/guard:cf,nochecks" ] + } if (is_component_build) { cflags += [