diff options
author | Aaron Smith <aaron.smith@microsoft.com> | 2020-03-20 16:38:16 -0700 |
---|---|---|
committer | Aaron Smith <aaron.smith@microsoft.com> | 2020-03-20 16:38:16 -0700 |
commit | aa1e0e01d89d490fca5861efa4874ca998f6503f (patch) | |
tree | 202f0814a43816f3c5a72a6e63c4e271395b24bd /mlir/cmake | |
parent | 6aef702ab63fee39ea348dbf83be3d6f2670566b (diff) | |
download | llvm-libc-aa1e0e01d89d490fca5861efa4874ca998f6503f.tar.gz |
[MLIR] Fix Xcode build due to incorrect library path
Two MLIR examples do not link because the library path is different when using Xcode vs Makefiles.
This change adds the configuration name to the library path when building with Xcode.
i.e. LLVM_BUILD_DIR/debug/lib
Diffstat (limited to 'mlir/cmake')
-rw-r--r-- | mlir/cmake/modules/AddMLIR.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mlir/cmake/modules/AddMLIR.cmake b/mlir/cmake/modules/AddMLIR.cmake index 4e06a0e743fe..e9101ed25dca 100644 --- a/mlir/cmake/modules/AddMLIR.cmake +++ b/mlir/cmake/modules/AddMLIR.cmake @@ -11,7 +11,11 @@ function(whole_archive_link target) if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") set(link_flags "-L${CMAKE_BINARY_DIR}/lib ") FOREACH(LIB ${ARGN}) - string(CONCAT link_flags ${link_flags} "-Wl,-force_load ${CMAKE_BINARY_DIR}/lib/lib${LIB}.a ") + if("${CMAKE_GENERATOR}" STREQUAL "Xcode") + string(CONCAT link_flags ${link_flags} "-Wl,-force_load ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/lib${LIB}.a ") + else() + string(CONCAT link_flags ${link_flags} "-Wl,-force_load ${CMAKE_BINARY_DIR}/lib/lib${LIB}.a ") + endif() ENDFOREACH(LIB) elseif(MSVC) FOREACH(LIB ${ARGN}) |