Skip to content

Commit

Permalink
fix: fix metal binary deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed May 3, 2024
1 parent 7d2a054 commit b65e516
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,15 @@ set_target_properties(
LIBRARY_OUTPUT_DIRECTORY ${PLATFORM_BINARY_DIR}
RUNTIME_OUTPUT_DIRECTORY ${PLATFORM_BINARY_DIR}
)

if (LLAMA_METAL)
# copy ${CMAKE_BINARY_DIR}/bin/default.metallib
add_custom_target(copy_metallib)
add_custom_command(
TARGET copy_metallib
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/bin/default.metallib ${PLATFORM_BINARY_DIR}/default.metallib
COMMENT "Copying default.metallib to bin folder"
)
add_dependencies(copy_metallib ggml-metal)
add_dependencies(${PROJECT_NAME} copy_metallib)
endif()

0 comments on commit b65e516

Please sign in to comment.