Skip to content

Commit 48b14e5

Browse files
committed
[MLIR] Fix ML IR build on Windows with Visual Studio
Summary: Right now the path for each lib in whole_archive_link when MSVC is used as the compiler is not a full path - and it's not even the correct path when VS is used to build. This patch sets the lib path to a full path using CMAKE_CFG_INTDIR which means the path will be correct regardless of whether ninja, make or VS is used and it will always be a full path. Reviewers: denis13, jpienaar Reviewed By: jpienaar Subscribers: mgorny, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, llvm-commits, asmith Tags: #llvm Differential Revision: https://reviews.llvm.org/D72403
1 parent 0a01ec9 commit 48b14e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function(whole_archive_link target)
4949
ENDFOREACH(LIB)
5050
elseif(MSVC)
5151
FOREACH(LIB ${ARGN})
52-
string(CONCAT link_flags ${link_flags} "/WHOLEARCHIVE:lib/${LIB}.lib ")
52+
string(CONCAT link_flags ${link_flags} "/WHOLEARCHIVE:${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/${LIB}.lib ")
5353
ENDFOREACH(LIB)
5454
else()
5555
set(link_flags "-L${CMAKE_BINARY_DIR}/lib -Wl,--whole-archive,")

0 commit comments

Comments
 (0)