From 49f9cadb52b5ef29e527b60c3881cb15a69c1625 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Thu, 25 Aug 2022 16:56:23 +0800 Subject: [PATCH] MSVC: Add WIN32 definition to the resource compiler The resource compiler may not use the same parameters as we passed to CL, and if so, there won't be any definition for WIN32, this will cause some header files think we are not building for Windows. To eliminate this uncertainty, we just pass "/DWIN32" to the resource compiler to let it have this definition unconditionally. It won't hurt in any case anyway. And this parameter is also hard-coded in vcpkg's Windows toolchain by default, so it should be safe. Change-Id: I45c42c40de8f4ab75fee219832f84d22b653af31 Reviewed-by: Oliver Wolff --- src/corelib/Qt6CoreMacros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 6d8c858ea89..800941e7767 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -1808,7 +1808,7 @@ function(_qt_internal_generate_win32_rc_file target) endif() if(MSVC) - set(extra_rc_flags "/c65001 /nologo") + set(extra_rc_flags "/c65001 /DWIN32 /nologo") else() set(extra_rc_flags) endif()