[PATCH] D72403: [MLIR] Fix ML IR build on Windows with Visual Studio

Stella Stamenova via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 10:11:52 PST 2020


stella.stamenova created this revision.
stella.stamenova added a reviewer: denis13.
Herald added subscribers: llvm-commits, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini, mgorny.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72403

Files:
  mlir/CMakeLists.txt


Index: mlir/CMakeLists.txt
===================================================================
--- mlir/CMakeLists.txt
+++ mlir/CMakeLists.txt
@@ -49,7 +49,7 @@
     ENDFOREACH(LIB)
   elseif(MSVC)
     FOREACH(LIB ${ARGN})
-      string(CONCAT link_flags ${link_flags} "/WHOLEARCHIVE:lib/${LIB}.lib ")
+      string(CONCAT link_flags ${link_flags} "/WHOLEARCHIVE:${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/${LIB}.lib ")
     ENDFOREACH(LIB)
   else()
     set(link_flags "-L${CMAKE_BINARY_DIR}/lib -Wl,--whole-archive,")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72403.236852.patch
Type: text/x-patch
Size: 523 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200108/112fb4fe/attachment.bin>


More information about the llvm-commits mailing list