Build: Avoid passing unsupported flag to MSVC linker

Change-Id: Ia73aeccb824bca10ce928cb82d5ad77033521527
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Orgad Shaneh
2023-05-01 10:18:19 +03:00
committed by Orgad Shaneh
parent 2bf5cc81b5
commit 1512aaa0cd

View File

@@ -182,7 +182,7 @@ endfunction()
function(qtc_add_link_flags_no_undefined target)
# needs CheckLinkerFlags
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.18)
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.18 AND NOT MSVC)
set(no_undefined_flag "-Wl,--no-undefined")
check_linker_flag(CXX ${no_undefined_flag} QTC_LINKER_SUPPORTS_NO_UNDEFINED)
if (NOT QTC_LINKER_SUPPORTS_NO_UNDEFINED)