Skip to content

Commit 91787ab

Browse files
authored
use @loader_path on macos instead of $ORIGIN (#1078)
1 parent 63baa30 commit 91787ab

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

source/op/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@ if (BUILD_PY_IF)
3232
)
3333
target_include_directories(op_abi PUBLIC ${TensorFlow_INCLUDE_DIRS})
3434
target_include_directories(op_grads PUBLIC ${TensorFlow_INCLUDE_DIRS})
35+
if (APPLE)
36+
set_target_properties(
37+
op_abi
38+
PROPERTIES
39+
COMPILE_FLAGS ${OP_CXX_FLAG}
40+
INSTALL_RPATH @loader_path
41+
)
42+
set_target_properties(
43+
op_grads
44+
PROPERTIES
45+
COMPILE_FLAGS ${OP_CXX_FLAG}
46+
INSTALL_RPATH @loader_path
47+
)
48+
else()
3549
set_target_properties(
3650
op_abi
3751
PROPERTIES
@@ -44,6 +58,7 @@ if (BUILD_PY_IF)
4458
COMPILE_FLAGS ${OP_CXX_FLAG}
4559
INSTALL_RPATH $ORIGIN
4660
)
61+
endif ()
4762
endif (BUILD_PY_IF)
4863

4964
if (BUILD_CPP_IF)

0 commit comments

Comments
 (0)