From 10159208e18e92c27dd18a0b10bab8b67bdbe154 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sat, 9 Jan 2016 18:24:43 +0000 Subject: [PATCH] Disable format warnings when building with MinGW --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e123635f..48f864da9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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