msvc: Disable warnings in header file

Remove clutter from the CMakeLists file by disabling the warnings
programatically.
This commit is contained in:
Vicent Marti 2011-09-28 23:42:38 +02:00
parent d215cf2429
commit 5888860d2a
2 changed files with 11 additions and 1 deletions

View File

@ -53,7 +53,7 @@ OPTION (BUILD_CLAY "Build Tests using the Clay suite" ON)
# Platform specific compilation flags
IF (MSVC)
SET(CMAKE_C_FLAGS "/W4 /WX /nologo /Zi /wd4127")
SET(CMAKE_C_FLAGS "/W4 /nologo /Zi")
IF (STDCALL)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gz")
ENDIF ()

View File

@ -9,6 +9,16 @@
#if defined(_MSC_VER)
/*
* Disable silly MSVC warnings
*/
/* conditional expression is constant */
#pragma warning(disable: 4127)
/* nonstandard extension used : bit field types other than int */
#pragma warning(disable: 4214)
/* access() mode parameter #defines */
# define F_OK 0 /* existence check */
# define W_OK 2 /* write mode check */