summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorYuhang Zhao <2546789017@qq.com>2021-10-17 11:19:48 +0800
committerYuhang Zhao <2546789017@qq.com>2021-11-10 20:31:05 +0800
commit6652bf2353d807f724f398a15cb22c188830f57c (patch)
treef3728b8e582a49ab46b2417d1f28fb2f430c2dfa /cmake
parenta8be40bd64b9258334d6936b1775bc6631fd158d (diff)
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. Pick-to: 6.2 Change-Id: Ifbc28c8f8b073866871685c020301f5f20dc9591 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBaseConfigureTests.cmake25
-rw-r--r--cmake/QtBuild.cmake2
2 files changed, 26 insertions, 1 deletions
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 <windows.h>
+ #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 b2cdd35667..a4d8c49ad1 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)