From 71edd2e4d86b4f52302699981868e3f466a4f97b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 4 Mar 2022 10:21:06 +0100 Subject: [PATCH] Bump QT_DEPRECATED_WARNINGS_SINCE When building Qt we should have warnings of any internal use of deprecated API, so set it to Qt7. Also added comments to clarify what the macros do. Change-Id: Ib47278fed9ab1ec4411ed9f69a9a9c0f811db02d Reviewed-by: Marc Mutz --- cmake/QtFlagHandlingHelpers.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake index 00c69b0983..f8bca02910 100644 --- a/cmake/QtFlagHandlingHelpers.cmake +++ b/cmake/QtFlagHandlingHelpers.cmake @@ -129,6 +129,9 @@ function(qt_internal_apply_intel_cet target visibility) endfunction() function(qt_internal_library_deprecation_level result) + # QT_DISABLE_DEPPRECATED_BEFORE controls which version we use as a cut-off + # compiling in to the library. E.g. if it is set to QT_VERSION then no + # code which was deprecated before QT_VERSION will be compiled in. if(WIN32) # On Windows, due to the way DLLs work, we need to export all functions, # including the inlines @@ -137,7 +140,10 @@ function(qt_internal_library_deprecation_level result) # On other platforms, Qt's own compilation goes needs to compile the Qt 5.0 API list(APPEND deprecations "QT_DISABLE_DEPRECATED_BEFORE=0x050000") endif() - list(APPEND deprecations "QT_DEPRECATED_WARNINGS_SINCE=0x060000") + # QT_DEPRECATED_WARNINGS_SINCE controls the upper-bound of deprecation + # warnings that are emitted. E.g. if it is set to 7.0 then all deprecations + # during the 6.* lifetime will be warned about in Qt builds. + list(APPEND deprecations "QT_DEPRECATED_WARNINGS_SINCE=0x070000") set("${result}" "${deprecations}" PARENT_SCOPE) endfunction()