From 5785363119c60b4b966d6c5b5187a992dd5b4760 Mon Sep 17 00:00:00 2001 From: silverqx Date: Wed, 10 Apr 2024 13:50:05 +0200 Subject: [PATCH] qmake/cmake suppressed msvc STL warning --- cmake/CommonModules/TinyCommon.cmake | 9 +++++++++ qmake/common/winconf.pri | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/cmake/CommonModules/TinyCommon.cmake b/cmake/CommonModules/TinyCommon.cmake index a9c8827b4..89acac742 100644 --- a/cmake/CommonModules/TinyCommon.cmake +++ b/cmake/CommonModules/TinyCommon.cmake @@ -101,6 +101,15 @@ ${TINY_UNPARSED_ARGUMENTS}") $<$:/sdl> ) + # Needed to suppress this for <=Qt5 because a lot of new warning on Qt v5, + # I will not invest more time to this to correctly fix it because Qt5 support + # will be removed soon + if(QT_VERSION_MAJOR LESS_EQUAL 5) + target_compile_definitions(${target} INTERFACE + _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING + ) + endif() + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") target_compile_options(${target} INTERFACE # Set by default by c++20 but from VS 16.11, can be removed when diff --git a/qmake/common/winconf.pri b/qmake/common/winconf.pri index bd6684a1f..6e08b1a59 100644 --- a/qmake/common/winconf.pri +++ b/qmake/common/winconf.pri @@ -12,6 +12,12 @@ DEFINES *= _WIN32_IE=_WIN32_IE_IE110 DEFINES *= WIN32_LEAN_AND_MEAN DEFINES *= NOMINMAX +# Needed to suppress this for <=Qt5 because a lot of new warning on Qt v5, I will not +# invest more time to this to correctly fix it because Qt5 support will be removed soon +if(win32-msvc|win32-clang-msvc): \ +versionAtMost(QT_MAJOR_VERSION, 5): \ + DEFINES *= _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING + # Latest qmake's msvc fixes # --- win32-msvc {