From: Stella Stamenova Date: Wed, 8 Jan 2020 18:39:20 +0000 (-0800) Subject: [MLIR] Fix ML IR build on Windows with Visual Studio X-Git-Tag: llvmorg-11-init~634 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48b14e58abc57cfea7bcdc0d7165686f135a2ebd;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt index 1f30d68..cd4f05f 100644 --- a/mlir/CMakeLists.txt +++ b/mlir/CMakeLists.txt @@ -49,7 +49,7 @@ function(whole_archive_link target) 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,")