Commit 511fb9e6f8e3aaeefd0cd7573e03ce5727ac6dca

Patrick Steinhardt 2020-04-03T22:53:23

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.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9b3f7cc..fb5202f 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.