[Piglit] [PATCH 9/9] cmake: Tone down the MSVC warning level.

jfonseca at vmware.com jfonseca at vmware.com
Tue Apr 29 10:57:54 PDT 2014


From: José Fonseca <jfonseca at vmware.com>

Very few people are building piglit with MSVC, and the current avalanche
of insignificant warnings ends up being a disservice for those who do, as
it only ends up hiding potential problems.
---
 CMakeLists.txt | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6f45d2e..2a63b78 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -238,11 +238,12 @@ else ()
 		include_directories ("include/msvc/c99")
 	endif ()
 
-	# -Wall or (/Wall) is actually supported by MSVC and would be detected
-	# by CHECK_C_COMPILER_FLAG above, but is very pedantic, causing
-	# thousand of warnings when including windows.h.
-	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W4")
-	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W4")
+	# Adjust warnings
+	add_definitions (-W3)
+	add_definitions (-wd4018) # signed/unsigned mismatch
+	add_definitions (-wd4244) # conversion from 'type1' to 'type2', possible loss of data
+	add_definitions (-wd4305) # truncation from 'type1' to 'type2'
+	add_definitions (-wd4800) # forcing value to bool 'true' or 'false' (performance warning)
 
 	add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
 	add_definitions (-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
-- 
1.9.1



More information about the Piglit mailing list