Skip to content

Commit 511fb9e

Browse files
committed
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.
1 parent 3956679 commit 511fb9e

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

CMakeLists.txt

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -231,30 +231,27 @@ ELSE ()
231231
ADD_DEFINITIONS(-D__USE_MINGW_ANSI_STDIO=1)
232232
ENDIF ()
233233

234-
ENABLE_WARNINGS(documentation)
235-
DISABLE_WARNINGS(missing-field-initializers)
236-
ENABLE_WARNINGS(strict-aliasing)
237-
ENABLE_WARNINGS(strict-prototypes)
238-
ENABLE_WARNINGS(declaration-after-statement)
239-
ENABLE_WARNINGS(shift-count-overflow)
240-
ENABLE_WARNINGS(unused-const-variable)
241-
ENABLE_WARNINGS(unused-function)
242-
ENABLE_WARNINGS(int-conversion)
234+
enable_warnings(documentation)
235+
disable_warnings(documentation-deprecated-sync)
236+
disable_warnings(missing-field-initializers)
237+
enable_warnings(strict-aliasing)
238+
enable_warnings(strict-prototypes)
239+
enable_warnings(declaration-after-statement)
240+
enable_warnings(shift-count-overflow)
241+
enable_warnings(unused-const-variable)
242+
enable_warnings(unused-function)
243+
enable_warnings(int-conversion)
243244

244245
# MinGW uses gcc, which expects POSIX formatting for printf, but
245246
# uses the Windows C library, which uses its own format specifiers.
246247
# Disable format specifier warnings.
247-
IF(MINGW)
248-
DISABLE_WARNINGS(format)
249-
DISABLE_WARNINGS(format-security)
250-
ELSE()
251-
ENABLE_WARNINGS(format)
252-
ENABLE_WARNINGS(format-security)
253-
ENDIF()
254-
255-
IF("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
256-
DISABLE_WARNINGS(documentation-deprecated-sync)
257-
ENDIF()
248+
if(MINGW)
249+
disable_warnings(format)
250+
disable_warnings(format-security)
251+
else()
252+
enable_warnings(format)
253+
enable_warnings(format-security)
254+
endif()
258255
ENDIF()
259256

260257
# Ensure that MinGW provides the correct header files.

0 commit comments

Comments
 (0)