From e547605da79fffafcd14193b25453d391c2ddf39 Mon Sep 17 00:00:00 2001 From: Antonio Maiorano Date: Tue, 23 Mar 2021 14:03:58 +0000 Subject: [PATCH] Fix msvc build and enable multiprocessor builds Disable warning C4324: 'struct_name' : structure was padded due to __declspec(align()) Multiprocessor builds are not enabled by default when using msbuild, unlike for Ninja builds. Bug: tint:665 Change-Id: I0e50c88ac91acd963c31c07cbbf2fae6b743e77d Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/45621 Reviewed-by: Ben Clayton Commit-Queue: Antonio Maiorano Kokoro: Kokoro --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d2e1bf864..373724c32d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,11 @@ if (MSVC) endif() endif() +# Enable msbuild multiprocessor builds +if (MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") +endif() + if (${TINT_CHECK_CHROMIUM_STYLE}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -add-plugin -Xclang find-bad-constructs") endif() @@ -197,6 +202,7 @@ function(tint_default_compile_options TARGET) /wd4127 /wd4244 /wd4267 + /wd4324 /wd4458 /wd4514 /wd4571