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 <oliver.wolff@qt.io>
This commit is contained in:
Yuhang Zhao 2022-08-25 16:56:23 +08:00
parent 22662d7dba
commit 49f9cadb52

View File

@ -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()