This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm-ffi.git


The following commit(s) were added to refs/heads/main by this push:
     new 5dd60e6  [CMAKE] Fix tvm_ffi_testing in wheel packaging (#122)
5dd60e6 is described below

commit 5dd60e6bed7ba67d68e989b0423591ebdab92ef6
Author: Tianqi Chen <[email protected]>
AuthorDate: Tue Oct 14 21:33:02 2025 -0400

    [CMAKE] Fix tvm_ffi_testing in wheel packaging (#122)
    
    This PR updates tvm_ffi_testing to use relative path so it can find
    libtvm_ffi during wheel instaltion.
---
 CMakeLists.txt | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b268152..2a6c28e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -148,6 +148,15 @@ target_link_libraries(tvm_ffi_testing PUBLIC 
tvm_ffi_header)
 tvm_ffi_add_msvc_flags(tvm_ffi_testing)
 tvm_ffi_add_apple_dsymutil(tvm_ffi_testing)
 
+# Set the install RPATH for tvm_ffi_testing so it can find tvm_ffi.so 
relatively
+if (APPLE)
+  # macOS uses @loader_path
+  set_target_properties(tvm_ffi_testing PROPERTIES INSTALL_RPATH 
"@loader_path")
+elseif (UNIX AND NOT APPLE)
+  # Linux uses $ORIGIN
+  set_target_properties(tvm_ffi_testing PROPERTIES INSTALL_RPATH "\$ORIGIN")
+endif ()
+
 # ----------------------------------------------------------------------------
 # The following code section only is triggered when the project is the root 
and will be skipped when
 # the project is a subproject.
@@ -250,7 +259,7 @@ if (TVM_FFI_BUILD_PYTHON_MODULE)
   if (APPLE)
     # macOS uses @loader_path
     set_target_properties(tvm_ffi_cython PROPERTIES INSTALL_RPATH 
"@loader_path/lib")
-  elseif (LINUX)
+  elseif (UNIX AND NOT APPLE)
     # Linux uses $ORIGIN
     set_target_properties(tvm_ffi_cython PROPERTIES INSTALL_RPATH 
"\$ORIGIN/lib")
   endif ()

Reply via email to