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 2899f8b commit aba7286
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 @@ -97,3 +97,15 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${PROJECT_NAME}> ${PLATFORM_BINARY_DIR}/$<TARGET_FILE_NAME:${PROJECT_NAME}>
COMMENT "Copying to bin folder"
)

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 aba7286

Please sign in to comment.