From 1911f3616990f2c71450f541cb642379630e6162 Mon Sep 17 00:00:00 2001 From: silverqx Date: Sat, 15 Jun 2024 11:05:26 +0200 Subject: [PATCH] qmake/cmake updated NTDDI_VERSION related macros --- cmake/CommonModules/TinyCommon.cmake | 28 ++++++++++++---------------- qmake/common/winconf.pri | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/cmake/CommonModules/TinyCommon.cmake b/cmake/CommonModules/TinyCommon.cmake index a705e731a..929a5bd12 100644 --- a/cmake/CommonModules/TinyCommon.cmake +++ b/cmake/CommonModules/TinyCommon.cmake @@ -51,29 +51,25 @@ ${TINY_UNPARSED_ARGUMENTS}") # Platform specific configurations # --- + # The ideal case would be not to define these and rely on what is defined + # in but Qt uses too old values for these, eg. MSYS2 patches these and + # uses the latest versions, so we have to define these manually because the original + # Qt code doesn't mantain these correctly. + # All have to be defined because of checks at the beginning of (fixed) + # WINVER, _WIN32_WINNT, NTDDI_VERSION if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - # All have to be defined because of checks at the beginning of - # WINVER, _WIN32_WINNT, NTDDI_VERSION - - # MSYS2 Qt 6 already defines these macros in the Qt6Targets.cmake Qt6::Platform - # Flipped expression of : if(MINGW AND QT_VERSION_MAJOR GREATER_EQUAL 6) - if(NOT MINGW OR NOT QT_VERSION_MAJOR GREATER_EQUAL 6) - target_compile_definitions(${target} INTERFACE - # Windows 10 1903 "19H1" - 0x0A000007 - WINVER=_WIN32_WINNT_WIN10 - _WIN32_WINNT=_WIN32_WINNT_WIN10 - ) - endif() - target_compile_definitions(${target} INTERFACE - # Windows 10 1903 "19H1" - 0x0A000007 - NTDDI_VERSION=NTDDI_WIN10_19H1 + # Windows 11 "22H2" - 0x0A00000C + WINVER=_WIN32_WINNT_WIN10 + _WIN32_WINNT=_WIN32_WINNT_WIN10 + NTDDI_VERSION=NTDDI_WIN10_NI # Internet Explorer 11 _WIN32_IE=_WIN32_IE_IE110 - UNICODE _UNICODE # Exclude unneeded header files WIN32_LEAN_AND_MEAN NOMINMAX + # Others + UNICODE _UNICODE ) endif() diff --git a/qmake/common/winconf.pri b/qmake/common/winconf.pri index acd1c0bde..517f65de3 100644 --- a/qmake/common/winconf.pri +++ b/qmake/common/winconf.pri @@ -1,10 +1,18 @@ # WinApi # --- - -# All have to be defined because of checks at the beginning of the qt_windows.h -# Windows 10 1903 "19H1" - 0x0A000007 +# For orientation in these versions, see: +# https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/ +# https://microsoft.fandom.com/wiki/List_of_Windows_codenames +# https://en.wikipedia.org/wiki/Windows_11_version_history +# https://en.wikipedia.org/wiki/Microsoft_Windows_SDK + +# The ideal case would be not to define these and rely on what is defined +# in but Qt uses too old values for these, eg. MSYS2 patches these and +# uses the latest versions and because of this we have to define these manually. +# All have to be defined because of checks at the beginning of (fixed) +# Windows 11 "22H2" - 0x0A00000C DEFINES *= WINVER=_WIN32_WINNT_WIN10 -DEFINES *= NTDDI_VERSION=NTDDI_WIN10_19H1 +DEFINES *= NTDDI_VERSION=NTDDI_WIN10_NI DEFINES *= _WIN32_WINNT=_WIN32_WINNT_WIN10 # Internet Explorer 11 DEFINES *= _WIN32_IE=_WIN32_IE_IE110