From b65e51669a4d225f1dc4cdaf3751dbd2ced28849 Mon Sep 17 00:00:00 2001 From: Hans Date: Fri, 3 May 2024 17:35:15 +0800 Subject: [PATCH] fix: fix metal binary deploy --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9030285..92c2951 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()