Suppress rc.exe default output

Hide output like

  Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
  Copyright (C) Microsoft Corporation.  All rights reserved.

when building the auto-generated .rc files.

Pick-to: 6.2
Fixes: QTBUG-97729
Change-Id: Id0c32c8015ec2ac0b47b3add52d5c0f8a7a1c203
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Kai Köhne 2021-10-25 13:23:47 +02:00 committed by Joerg Bornemann
parent c0a8cfe167
commit 879e42cba8

View File

@ -1373,9 +1373,16 @@ function(_qt_internal_generate_win32_rc_file target)
return()
endif()
if(MSVC)
set(extra_rc_flags "/nologo")
else()
set(extra_rc_flags)
endif()
if (target_rc_file)
# Use the provided RC file
target_sources(${target} PRIVATE "${target_rc_file}")
set_property(SOURCE ${target_rc_file} PROPERTY COMPILE_FLAGS "${extra_rc_flags}")
else()
# Generate RC File
set(rc_file_output "${target_binary_dir}/")
@ -1563,8 +1570,9 @@ END
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${input}" "${output}"
)
# We can't rely on policy CMP0118 since user project controls it
set_source_files_properties(${output} ${scope_args}
PROPERTIES GENERATED TRUE
set_source_files_properties(${output} ${scope_args} PROPERTIES
GENERATED TRUE
COMPILE_FLAGS "${extra_rc_flags}"
)
target_sources(${end_target} PRIVATE "$<$<CONFIG:${cfg}>:${output}>")
endwhile()