Skip to content

Commit

Permalink
Make sure that -utf-8 flag only apply to MSVC
Browse files Browse the repository at this point in the history
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 e3cc248

Pick-to: 6.5
Task-number: QTBUG-112737
Change-Id: Ie0576667108820dd61035debfc1fcc030ef3536a
Reviewed-by: Lars Schmertmann <[email protected]>
Reviewed-by: Joerg Bornemann <[email protected]>
  • Loading branch information
semlanik committed May 16, 2023
1 parent b7c15f7 commit c334272
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/QtFlagHandlingHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c334272

Please sign in to comment.