qmake: Allow using Windows 10 API in MinGW qmake internal projects

When trying to build qt3d examples with qmake and MinGW in the CI,
compilation would fail with errors like

 In file included from
 C:/MINGW1120/mingw64/x86_64-w64-mingw32/include/windows.h:72,
 from C:\Users\qt\work\qt\qt3d\examples\qt3d\simple-cpp\main.cpp:63
 include/winuser.h:2965:72: error: 'POINTER_INPUT_TYPE' was not
 declared in this scope

What happens is that calling qmake on examples.pro loads
qt3d/.qmake.conf, which then loads qt_build_config.prf which then
defines the following definitions:

 mingw: DEFINES += WINVER=0x0601 _WIN32_WINNT=0x0601

This limits usage of Windows API up to Windows 7, with later APIs
being unavailable.

Most .qmake.conf files were removed in qt repos, but We didn't remove
the .qmake.conf file (fb656c036d) for
qt3d because it's supposed to be buildable with CMake + Qt 6 as
well as qmake + Qt 5.

Bump the defines to the same Windows 10 version we use everywhere else
when building with CMake.

Amends 6652bf2353
Relates to d57a7c4171
Relates to fb656c036d

Pick-to: 6.2 6.3
Task-number: COIN-762
Task-number: QTBUG-92271
Change-Id: I833dfb6b0832d90a76d05ea14cd3807cb0d67ca9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Alexandru Croitor 2022-01-20 14:30:21 +01:00
parent eced23b6a8
commit a585ce7056

View File

@ -112,7 +112,7 @@ unix: CONFIG += explicitlib
macos: CONFIG += testcase_no_bundle
# Override MinGW's definition in _mingw.h
mingw: DEFINES += WINVER=0x0601 _WIN32_WINNT=0x0601
mingw: DEFINES += WINVER=0x0A00 _WIN32_WINNT=0x0A00
defineTest(qtBuildPart) {
bp = $$eval($$upper($$section(_QMAKE_CONF_, /, -2, -2))_BUILD_PARTS)