[Mlir-commits] [mlir] e3846c0 - [mlir] [test] Fix missing SHLIB definition in standalone builds (#120907)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Dec 24 23:12:27 PST 2024


Author: Michał Górny
Date: 2024-12-25T07:12:23Z
New Revision: e3846c0fecb5992110788be18cd04f70103bc778

URL: https://github.com/llvm/llvm-project/commit/e3846c0fecb5992110788be18cd04f70103bc778
DIFF: https://github.com/llvm/llvm-project/commit/e3846c0fecb5992110788be18cd04f70103bc778.diff

LOG: [mlir] [test] Fix missing SHLIB definition in standalone builds (#120907)

Define the `LLVM_SHLIB_OUTPUT_INTDIR` variable that is used by
`configure_lit_site_cfg` to fill `SHLIBDIR`. This fixes tool tests that
would otherwise be unable to find MLIR's runtime shared libraries (e.g.
`libmlir_runner_utils.so`). The logic is copied verbatim from Clang.

Added: 
    

Modified: 
    mlir/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 0608eef15c5a4b..99ea1b70fbc4d2 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -36,6 +36,15 @@ if(MLIR_STANDALONE_BUILD)
     "${CMAKE_CURRENT_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}")
   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
 
+  # These definitions are needed to fill SHLIBDIR in tests.
+  set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
+  set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
+  if(WIN32 OR CYGWIN)
+    # DLL platform -- put DLLs into bin.
+    set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
+  else()
+    set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
+  endif()
   set(LLVM_LIT_ARGS "-sv" CACHE STRING "Default options for lit")
 endif()
 


        


More information about the Mlir-commits mailing list