From 7c713c4d2c176dbc4fa7eb0a670aa86e49f36716 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Sun, 17 Oct 2021 11:19:48 +0800 Subject: Bump WINVER, _WIN32_WINNT and _WIN32_IE to _WIN32_WINNT_WIN10 (0x0A00) And bump NTDDI_VERSION to 0x0A00000B (NTDDI_WIN10_CO) at the same time, to unblock the developers from accessing the latest Windows APIs. Change-Id: Ifbc28c8f8b073866871685c020301f5f20dc9591 Reviewed-by: Qt CI Bot Reviewed-by: Joerg Bornemann Reviewed-by: Thiago Macieira (cherry picked from commit 6652bf2353d807f724f398a15cb22c188830f57c) --- cmake/QtBaseConfigureTests.cmake | 25 +++++++++++++++++++++++++ cmake/QtBuild.cmake | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/QtBaseConfigureTests.cmake b/cmake/QtBaseConfigureTests.cmake index 717ea1248e..ae16e8e53b 100644 --- a/cmake/QtBaseConfigureTests.cmake +++ b/cmake/QtBaseConfigureTests.cmake @@ -138,9 +138,34 @@ VERS_1; set(TEST_ld_version_script "${HAVE_LD_VERSION_SCRIPT}" CACHE INTERNAL "linker version script support") endfunction() +function(qt_internal_ensure_latest_win_nt_api) + if(NOT WIN32) + return() + endif() + check_cxx_source_compiles([=[ + #include + #if !defined(_WIN32_WINNT) && !defined(WINVER) + #error "_WIN32_WINNT and WINVER are not defined" + #endif + #if defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x0A00) + #error "_WIN32_WINNT version too low" + #endif + #if defined(WINVER) && (WINVER < 0x0A00) + #error "WINVER version too low" + #endif + int main() { return 0; } + ]=] HAVE_WIN10_WIN32_WINNT) + if(NOT HAVE_WIN10_WIN32_WINNT) + list(APPEND QT_PLATFORM_DEFINITIONS _WIN32_WINNT=0x0A00 WINVER=0x0A00) + set(QT_PLATFORM_DEFINITIONS ${QT_PLATFORM_DEFINITIONS} + CACHE STRING "Qt platform specific pre-processor defines" FORCE) + endif() +endfunction() + function(qt_run_qtbase_config_tests) qt_run_config_test_architecture() qt_run_linker_version_script_support() + qt_internal_ensure_latest_win_nt_api() endfunction() # The qmake build of android does not perform the right architecture tests and diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 26b5c7a1a1..f4028ecc86 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -310,7 +310,7 @@ if(WIN32) endif() if (MINGW) - list(APPEND QT_DEFAULT_PLATFORM_DEFINITIONS _WIN32_WINNT=0x0601 MINGW_HAS_SECURE_API=1) + list(APPEND QT_DEFAULT_PLATFORM_DEFINITIONS MINGW_HAS_SECURE_API=1) endif() elseif(LINUX) if(GCC) -- cgit v1.2.3