]> granicus.if.org Git - transmission/commitdiff
Disable format warnings when building with MinGW
authorMike Gelfand <mikedld@mikedld.com>
Sat, 9 Jan 2016 18:24:43 +0000 (18:24 +0000)
committerMike Gelfand <mikedld@mikedld.com>
Sat, 9 Jan 2016 18:24:43 +0000 (18:24 +0000)
CMakeLists.txt

index 0e123635f88c1541b6802f92be4fd4c025c3a203..48f864da9524d9a42f7ca29dcd5bd31ee203473b 100644 (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