summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormcgrathr <mcgrathr@chromium.org>2015-10-28 17:56:14 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-29 00:57:45 +0000
commit8379ac5916cb0ef3832c1369fca6d547ed07673b (patch)
tree6e6a96f1c634eba8b8bb22a34860e5232845de0f
parentf1f30573fd0060132feee853ec26e744ed09fe11 (diff)
downloadchromium_src-8379ac5916cb0ef3832c1369fca6d547ed07673b.zip
chromium_src-8379ac5916cb0ef3832c1369fca6d547ed07673b.tar.gz
chromium_src-8379ac5916cb0ef3832c1369fca6d547ed07673b.tar.bz2
GN: Suppress MSVC "const should be initialized" warning in NaCl code
Some of the NaCl code uses a perfectly sensible code pattern that the MSVC compiler misunderstands and issues a warning for. Suppress that warning for NaCl code. BUG= 512869 R=dpranke@chromium.org Review URL: https://codereview.chromium.org/1404343004 Cr-Commit-Position: refs/heads/master@{#356712}
-rw-r--r--build/config/nacl/BUILD.gn19
1 files changed, 17 insertions, 2 deletions
diff --git a/build/config/nacl/BUILD.gn b/build/config/nacl/BUILD.gn
index 84ffc62..217494f 100644
--- a/build/config/nacl/BUILD.gn
+++ b/build/config/nacl/BUILD.gn
@@ -25,13 +25,28 @@ config("nexe_defines") {
]
}
+config("nacl_warnings") {
+ if (is_win) {
+ # Some NaCl code uses forward declarations of static const variables,
+ # with initialized definitions later on. (The alternative would be
+ # many, many more forward declarations of everything used in that
+ # const variable's initializer before the definition.) The Windows
+ # compiler is too stupid to notice that there is an initializer later
+ # in the file, and warns about the forward declaration.
+ cflags = [ "/wd4132" ]
+ }
+}
+
# The base target that all targets in the NaCl build should depend on.
# This allows configs to be modified for everything in the NaCl build, even when
# the NaCl build is composed into the Chrome build. (GN has no functionality to
-# add flags to everythin in //native_client, having a base target works around
+# add flags to everything in //native_client, having a base target works around
# that limitation.)
source_set("nacl_base") {
- public_configs = [ ":nacl_defines" ]
+ public_configs = [
+ ":nacl_defines",
+ ":nacl_warnings",
+ ]
if (current_os == "nacl") {
public_configs += [ ":nexe_defines" ]
}