Make sure that -utf-8 flag only apply to MSVC

INTERFACE scope propagates the '-utf-8' flag to the target dependencies.
So if Qt is built using MSVC, but the depending targets use different
compiler this flag will break the compilation.

Guard the flag using genex.

Amends e3cc2487ce63cae42d8054b38fdb54abe8545007

Pick-to: 6.5
Task-number: QTBUG-112737
Change-Id: Ie0576667108820dd61035debfc1fcc030ef3536a
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Alexey Edelev 2023-05-12 16:23:15 +02:00
parent b7c15f7f24
commit c33427240f

View File

@ -288,7 +288,7 @@ endfunction()
function(qt_enable_utf8_sources target)
set(utf8_flags "")
if(MSVC)
list(APPEND utf8_flags "-utf-8")
list(APPEND utf8_flags "$<$<CXX_COMPILER_ID:MSVC>:-utf-8>")
endif()
if(utf8_flags)