Skip to content

Commit

Permalink
qmake/cmake suppressed msvc STL warning
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Apr 10, 2024
1 parent a176cdb commit 5785363
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmake/CommonModules/TinyCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ ${TINY_UNPARSED_ARGUMENTS}")
$<$<CONFIG:Debug>:/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
Expand Down
6 changes: 6 additions & 0 deletions qmake/common/winconf.pri
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5785363

Please sign in to comment.