CMake: fix warnings on msvc builds

Remove /W3 from default flags, and disable a couple of warnings:

C4127: conditional expression is constant
C4458: declaration of 'identifier' hides class member

These match our warning settings of Clang/GCC more closely.
Also fix some valid warnings in some tests.

Change-Id: I46cb30b93ece74039db4aa0d6b52a675ee36859d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/44960
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Antonio Maiorano
2021-03-17 13:32:54 +00:00
committed by Commit Bot service account
parent 4f4534df3a
commit d600972e49
3 changed files with 13 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ TEST_F(BuilderTest, Discard) {
spirv::Builder& b = Build();
b.push_function(Function{});
EXPECT_EQ(b.GenerateStatement(expr), 1u) << b.error();
EXPECT_TRUE(b.GenerateStatement(expr)) << b.error();
EXPECT_EQ(DumpInstructions(b.functions()[0].instructions()), R"(OpKill
)");
}

View File

@@ -65,7 +65,8 @@ TEST_P(Decoration_StageTest, Emit) {
EXPECT_EQ(preamble[0].opcode(), spv::Op::OpEntryPoint);
ASSERT_GE(preamble[0].operands().size(), 3u);
EXPECT_EQ(preamble[0].operands()[0].to_i(), params.model);
EXPECT_EQ(preamble[0].operands()[0].to_i(),
static_cast<uint32_t>(params.model));
}
INSTANTIATE_TEST_SUITE_P(
BuilderTest,