From 511fb9e6f8e3aaeefd0cd7573e03ce5727ac6dca Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 3 Apr 2020 22:53:23 +0200 Subject: [PATCH] cmake: always disable deprecation-sync warnings We currently disable deprecation synchronization warnings in case we're building with Clang. We check for Clang by doing a string comparison on the compiler identification, but this seems to have been broken by an update in macOS' image as the compiler ID has changed to "AppleClang". Let's just unconditionally disable this warning on Unix platforms. We never add the deprecated attribute anyway, so the warning doesn't help us at all. --- CMakeLists.txt | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b3f7cca1..fb5202fd1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,30 +231,27 @@ ELSE () ADD_DEFINITIONS(-D__USE_MINGW_ANSI_STDIO=1) ENDIF () - ENABLE_WARNINGS(documentation) - DISABLE_WARNINGS(missing-field-initializers) - ENABLE_WARNINGS(strict-aliasing) - ENABLE_WARNINGS(strict-prototypes) - ENABLE_WARNINGS(declaration-after-statement) - ENABLE_WARNINGS(shift-count-overflow) - ENABLE_WARNINGS(unused-const-variable) - ENABLE_WARNINGS(unused-function) - ENABLE_WARNINGS(int-conversion) + enable_warnings(documentation) + disable_warnings(documentation-deprecated-sync) + disable_warnings(missing-field-initializers) + enable_warnings(strict-aliasing) + enable_warnings(strict-prototypes) + enable_warnings(declaration-after-statement) + enable_warnings(shift-count-overflow) + enable_warnings(unused-const-variable) + enable_warnings(unused-function) + enable_warnings(int-conversion) # 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("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") - DISABLE_WARNINGS(documentation-deprecated-sync) - ENDIF() + if(MINGW) + disable_warnings(format) + disable_warnings(format-security) + else() + enable_warnings(format) + enable_warnings(format-security) + endif() ENDIF() # Ensure that MinGW provides the correct header files.