cmake-gui: Suppress MSVC deprecation warnings from Qt headers

MSVC 14.38+ toolsets deprecate `stdext::checked_array_iterator`.
Support building with versions of Qt that have not been updated
to avoid the deprecated API.

Qt-Issue: https://bugreports.qt.io/browse/QTBUG-118993
This commit is contained in:
Brad King
2024-05-29 10:20:46 -04:00
parent fd8c782ded
commit f26e8886b3
2 changed files with 10 additions and 0 deletions

View File

@@ -48,6 +48,11 @@ if(WIN32)
endif()
endif()
if(MSVC)
# QTBUG-118993: Qt uses deprecated stdext::checked_array_iterator
add_compile_definitions(_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt${INSTALLED_QT_VERSION}Widgets_EXECUTABLE_COMPILE_FLAGS}")
if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES)

View File

@@ -2,6 +2,11 @@ include(CMakeParseArguments)
find_package(Qt5Test REQUIRED)
if(MSVC)
# QTBUG-118993: Qt uses deprecated stdext::checked_array_iterator
add_compile_definitions(_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING)
endif()
include_directories(
${CMake_SOURCE_DIR}/Source
${CMake_SOURCE_DIR}/Source/QtDialog