summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-06-15 21:45:26 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2019-06-24 17:27:23 +0100
commit54a60ced5c456f46dcc2fcadbe286e94ab067861 (patch)
tree73c09a83f80b97549396087a11db0445eb30229a /CMakeLists.txt
parente2aba8bafce422b08507e9218ad2db32fcd40a03 (diff)
downloadlibgit2-54a60ced5c456f46dcc2fcadbe286e94ab067861.tar.gz
mingw: disable format specification warnings
MinGW uses gcc, which expects POSIX formatting for printf, but uses the Windows C library, which uses its own format specifiers. Therefore, it gets confused about format specifiers. Disable warnings for format specifiers.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 11 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e633f119..85c170e85 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -239,10 +239,18 @@ ELSE ()
ENABLE_WARNINGS(shift-count-overflow)
ENABLE_WARNINGS(unused-const-variable)
ENABLE_WARNINGS(unused-function)
- ENABLE_WARNINGS(format)
- ENABLE_WARNINGS(format-security)
ENABLE_WARNINGS(int-conversion)
- DISABLE_WARNINGS(documentation-deprecated-sync)
+
+ # MinGW uses gcc, which expects POSIX formatting for printf, but
+ # uses the Windows C library, which uses its own format specifiers.
+ # Disable format specifier warnings.
+ IF(MINGW)
+ DISABLE_WARNINGS(format)
+ DISABLE_WARNINGS(format-security)
+ ELSE()
+ ENABLE_WARNINGS(format)
+ ENABLE_WARNINGS(format-security)
+ ENDIF()
IF (PROFILE)
SET(CMAKE_C_FLAGS "-pg ${CMAKE_C_FLAGS}")