Disable format warnings when building with MinGW

This commit is contained in:
Mike Gelfand 2016-01-09 18:24:43 +00:00
parent 939b31ae3d
commit 10159208e1
1 changed files with 8 additions and 1 deletions

View File

@ -426,7 +426,6 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
-W
-Wcast-align
-Wfloat-equal
-Wformat-security
-Wmissing-format-attribute
-Wpointer-arith
-Wredundant-decls
@ -440,6 +439,14 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
-Winit-self)
endif()
if(MINGW)
# Disable excessive warnings since we're using __USE_MINGW_ANSI_STDIO
# Hopefully, any potential issues will be spotted on other platforms
list(APPEND NEEDED_COMPILER_FLAGS -Wno-format)
else()
list(APPEND NEEDED_COMPILER_FLAGS -Wformat-security)
endif()
set(NEEDED_C_COMPILER_FLAGS
${NEEDED_COMPILER_FLAGS}
-Winline