From f26e8886b377757d862fd8db79715bbb0cb8740e Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 29 May 2024 10:20:46 -0400 Subject: [PATCH 1/3] 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 --- Source/QtDialog/CMakeLists.txt | 5 +++++ Tests/CMakeGUI/CMakeLists.txt | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index e6e41ec4e9..e4b53fd2e7 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -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) diff --git a/Tests/CMakeGUI/CMakeLists.txt b/Tests/CMakeGUI/CMakeLists.txt index 4e8609b854..c9f44e960c 100644 --- a/Tests/CMakeGUI/CMakeLists.txt +++ b/Tests/CMakeGUI/CMakeLists.txt @@ -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 From 41e777274a68bbaaec47a5e7def20144fbf5601d Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 29 May 2024 13:40:30 -0400 Subject: [PATCH 2/3] Tests: Update BuildDepends test for VS 17.10 The test project now rebuilds `link_depends_no_shared_exe` in `Debug` builds. MSBuild `-v:diag` shows: Source compilation required: input C:\...\DEBUG\LINK_DEPENDS_NO_SHARED_LIB.PDB is newer than output C:\...\DEBUG\LINK_DEPENDS_NO_SHARED_EXE.EXE. Use the `Release` configuration instead. --- Tests/BuildDepends/CMakeLists.txt | 35 +++++++++++++++++++------------ 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index 99418df365..2fa2bc5c04 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -12,6 +12,15 @@ project(BuildDepends) # project is built. set(CMAKE_SUPPRESS_REGENERATION 1) +if(CMAKE_GENERATOR MATCHES "Visual Studio" AND CMAKE_VS_PLATFORM_TOOLSET MATCHES "^(v90|v100|v110|v120|v140)$") + # These toolsets update 'link_depends_no_shared_lib.lib' during rebuild in Release mode. + set(config Debug) +else() + # Some toolsets update 'link_depends_no_shared_lib.pdb' during rebuild in Debug mode. + set(config Release) +endif() +set(CMAKE_TRY_COMPILE_CONFIGURATION "${config}") + # Xcode needs some help with the fancy dependencies in this test. if(XCODE AND XCODE_VERSION VERSION_LESS 5) set(HELP_XCODE 1) @@ -117,10 +126,10 @@ endif() # find and save the ninjadep executable set(ninjadep ${BuildDepends_BINARY_DIR}/Project/ninjadep${CMAKE_EXECUTABLE_SUFFIX}) if(EXISTS - "${BuildDepends_BINARY_DIR}/Project/Debug/ninjadep${CMAKE_EXECUTABLE_SUFFIX}" ) - message("found debug") + "${BuildDepends_BINARY_DIR}/Project/${config}/ninjadep${CMAKE_EXECUTABLE_SUFFIX}" ) + message("found ${config}/ninjadep${CMAKE_EXECUTABLE_SUFFIX}") set(ninjadep - "${BuildDepends_BINARY_DIR}/Project/Debug/ninjadep${CMAKE_EXECUTABLE_SUFFIX}") + "${BuildDepends_BINARY_DIR}/Project/${config}/ninjadep${CMAKE_EXECUTABLE_SUFFIX}") endif() message("Running ${ninjadep} ") execute_process(COMMAND ${ninjadep} OUTPUT_VARIABLE out RESULT_VARIABLE runResult) @@ -136,17 +145,17 @@ endif() set(bar ${BuildDepends_BINARY_DIR}/Project/bar${CMAKE_EXECUTABLE_SUFFIX}) if(EXISTS - "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}" ) - message("found debug") + "${BuildDepends_BINARY_DIR}/Project/${config}/bar${CMAKE_EXECUTABLE_SUFFIX}" ) + message("found ${config}/bar${CMAKE_EXECUTABLE_SUFFIX}") set(bar - "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}") + "${BuildDepends_BINARY_DIR}/Project/${config}/bar${CMAKE_EXECUTABLE_SUFFIX}") endif() set(zot ${BuildDepends_BINARY_DIR}/Project/zot${CMAKE_EXECUTABLE_SUFFIX}) if(EXISTS - "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}" ) - message("found debug") + "${BuildDepends_BINARY_DIR}/Project/${config}/zot${CMAKE_EXECUTABLE_SUFFIX}" ) + message("found ${config}/zot${CMAKE_EXECUTABLE_SUFFIX}") set(zot - "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}") + "${BuildDepends_BINARY_DIR}/Project/${config}/zot${CMAKE_EXECUTABLE_SUFFIX}") endif() message("Running ${bar} ") @@ -305,12 +314,12 @@ if(NOT RESULT) message(SEND_ERROR "Could not build test project (2)!") endif() if(EXISTS - "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}" ) - message("found debug") + "${BuildDepends_BINARY_DIR}/Project/${config}/bar${CMAKE_EXECUTABLE_SUFFIX}" ) + message("found ${config}/bar${CMAKE_EXECUTABLE_SUFFIX}") endif() if(EXISTS - "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}" ) - message("found debug") + "${BuildDepends_BINARY_DIR}/Project/${config}/zot${CMAKE_EXECUTABLE_SUFFIX}" ) + message("found ${config}/zot${CMAKE_EXECUTABLE_SUFFIX}") endif() message("Running ${ninjadep} ") From 0070708ae1b38eb5d396a19996c522271f7280c2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 29 May 2024 09:31:06 -0400 Subject: [PATCH 3/3] gitlab-ci: Update Windows builds to MSVC 14.40 toolset --- .gitlab/os-windows.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 1372136f94..33d0d570ea 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -35,25 +35,25 @@ variables: VCVARSALL: "${VS170COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat" VCVARSPLATFORM: "x64" - VCVARSVERSION: "14.36.32532" + VCVARSVERSION: "14.40.33807" .windows_vcvarsall_vs2022_x86: variables: VCVARSALL: "${VS170COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat" VCVARSPLATFORM: "x86" - VCVARSVERSION: "14.36.32532" + VCVARSVERSION: "14.40.33807" .windows_vcvarsall_vs2022_x64_arm64: variables: VCVARSALL: "${VS170COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat" VCVARSPLATFORM: "x64_arm64" - VCVARSVERSION: "14.36.32532" + VCVARSVERSION: "14.40.33807" .windows_arm64_vcvarsall_vs2022: variables: VCVARSALL: "${VS170COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat" VCVARSPLATFORM: "arm64" - VCVARSVERSION: "14.36.32532" + VCVARSVERSION: "14.40.33807" .windows_vs2022_x64_pch: extends: @@ -119,7 +119,7 @@ CMAKE_CONFIGURATION: windows_vs2022_x64 CMAKE_GENERATOR: "Visual Studio 17 2022" CMAKE_GENERATOR_PLATFORM: "x64" - CMAKE_GENERATOR_TOOLSET: "v143,version=14.36.32532" + CMAKE_GENERATOR_TOOLSET: "v143,version=14.40.33807" CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" .windows_vs2019_x64: @@ -282,7 +282,7 @@ CMAKE_CONFIGURATION: windows_arm64_vs2022 CMAKE_GENERATOR: "Visual Studio 17 2022" CMAKE_GENERATOR_PLATFORM: "ARM64" - CMAKE_GENERATOR_TOOLSET: "v143,version=14.36.32532" + CMAKE_GENERATOR_TOOLSET: "v143,version=14.40.33807" CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" .mingw_osdn_io: @@ -316,7 +316,7 @@ - windows-x86_64 - shell - vs2022 - - msvc-19.36 + - msvc-14.40 - nonconcurrent .windows_x86_64_tags_nonconcurrent_vs2022_arm64: @@ -325,7 +325,7 @@ - windows-x86_64 - shell - vs2022 - - msvc-19.36-arm64 + - msvc-14.40-arm64 - nonconcurrent .windows_x86_64_tags_concurrent_vs2022: @@ -334,7 +334,7 @@ - windows-x86_64 - shell - vs2022 - - msvc-19.36 + - msvc-14.40 - concurrent .windows_x86_64_tags_concurrent_vs2022_android: @@ -344,7 +344,7 @@ - shell - vs2022 - vs17-android - - msvc-19.36 + - msvc-14.40 - concurrent .windows_x86_64_tags_concurrent_vs2019_android: @@ -370,7 +370,7 @@ - windows-arm64 - shell - vs2022 - - msvc-19.36 + - msvc-14.40 - nonconcurrent .windows_arm64_tags_concurrent_vs2022: @@ -379,7 +379,7 @@ - windows-arm64 - shell - vs2022 - - msvc-19.36 + - msvc-14.40 - concurrent ## Windows-specific scripts