Skip to content

Commit 99cdfed

Browse files
authored
Merge pull request #12106 from jacquesqiao/fix-mac-patchelf-check
add install_name_tool check on macos
2 parents 092d620 + 901d538 commit 99cdfed

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

python/CMakeLists.txt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,15 @@ install(DIRECTORY ${PADDLE_PYTHON_PACKAGE_DIR}
9292
DESTINATION opt/paddle/share/wheels
9393
)
9494

95-
find_program(PATCHELF_EXECUTABLE patchelf)
96-
if(NOT PATCHELF_EXECUTABLE)
97-
message(FATAL_ERROR "patchelf not found, please install it.\n"
98-
"For Ubuntu, the command is: apt-get install -y patchelf.")
99-
endif()
95+
if(APPLE)
96+
find_program(INSTALL_NAME_TOOL_EXECUTABLE install_name_tool)
97+
if(NOT INSTALL_NAME_TOOL_EXECUTABLE)
98+
message(FATAL_ERROR "install_name_tool not found, please check.\n")
99+
endif()
100+
else(APPLE)
101+
find_program(PATCHELF_EXECUTABLE patchelf)
102+
if(NOT PATCHELF_EXECUTABLE)
103+
message(FATAL_ERROR "patchelf not found, please install it.\n"
104+
"For Ubuntu, the command is: apt-get install -y patchelf.")
105+
endif()
106+
endif(APPLE)

0 commit comments

Comments
 (0)