cmake: Ignore -Wdeprecated-declarations instead of -Wdeprecated
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 16 Dec 2020 13:11:03 +0000 (14:11 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 17 Dec 2020 13:28:13 +0000 (14:28 +0100)
Qt 5.15 introduced a bunch of deprecation warnings that are hard
to fix due to our long-term support of old Qt versions. For this
reason, we added -Wno-error=deprecated to compile flags, which
should make deprecation warnings non-fatal.

However, for some reason, GCC 10.2.1 on Debian Testing thinks that
-Wno-error=deprecated should not include -Wdeprecated-declarations,
thus failing the build with fatal warnings on. I could not reproduce
this behavior on other distros with the same compiler and Qt versions,
so maybe this is a distro-specific issue. However, we only care about
-Wdeprecated-declarations, so making only this specific warning
non-fatal makes more sense anyway.

cmake/QuasselCompileSettings.cmake

index 4493d4d..014d4b3 100644 (file)
@@ -45,7 +45,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
         -Wvla
         -Werror=return-type
         "$<$<BOOL:${FATAL_WARNINGS}>:-Werror>"
         -Wvla
         -Werror=return-type
         "$<$<BOOL:${FATAL_WARNINGS}>:-Werror>"
-        -Wno-error=deprecated  # Don't break on Qt upgrades
+        -Wno-error=deprecated-declarations  # Don't break on Qt upgrades
         -Wno-unknown-pragmas
         "$<$<NOT:$<CONFIG:Debug>>:-U_FORTIFY_SOURCE;-D_FORTIFY_SOURCE=2>"
     )
         -Wno-unknown-pragmas
         "$<$<NOT:$<CONFIG:Debug>>:-U_FORTIFY_SOURCE;-D_FORTIFY_SOURCE=2>"
     )