[mlir] Fix linking with LLD

The issue is that /WHOLEARCHIVE is interpreted differently in LLD, which needs the same exact path as the .lib; whereas link.exe can take the library name, withoutout a path or extension, if that was already supplied on the cmd-line. I'll write a follow-up patch to fix the issue in LLD.
This commit is contained in:
Alexandre Ganea 2019-12-31 14:04:29 -05:00
parent 2b223bd1c7
commit 316f6003ef

View file

@ -44,7 +44,7 @@ function(whole_archive_link target)
ENDFOREACH(LIB)
elseif(MSVC)
FOREACH(LIB ${ARGN})
string(CONCAT link_flags ${link_flags} "/WHOLEARCHIVE:${LIB} ")
string(CONCAT link_flags ${link_flags} "/WHOLEARCHIVE:lib/${LIB}.lib ")
ENDFOREACH(LIB)
else()
set(link_flags "-L${CMAKE_BINARY_DIR}/lib -Wl,--whole-archive,")