From 6cf20f1e0219078371161af83319d10f72f0832e Mon Sep 17 00:00:00 2001 From: Dominic Hamon Date: Thu, 13 Jan 2022 14:21:43 +0000 Subject: [PATCH] Suppress GoogleTest warnings on windows (MSVC) too. (#1320) Fixes #1209 --- cmake/GoogleTest.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/GoogleTest.cmake b/cmake/GoogleTest.cmake index 66cb9100..44adbfbe 100644 --- a/cmake/GoogleTest.cmake +++ b/cmake/GoogleTest.cmake @@ -30,7 +30,11 @@ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) include(${GOOGLETEST_PREFIX}/googletest-paths.cmake) # googletest doesn't seem to want to stay build warning clean so let's not hurt ourselves. -add_compile_options(-w) +if (MSVC) + add_compile_options(/wd4244 /wd4722) +else() + add_compile_options(-w) +endif() # Add googletest directly to our build. This defines # the gtest and gtest_main targets.