From: Andrei Date: Sun, 23 Jul 2023 19:44:54 +0000 (-0400) Subject: cmake : add metal kernel to target resources when built as shared library (#403) X-Git-Tag: upstream/0.0.1642~1294 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=136a9e6e747169e58a75b6f99758fc7932a107e3;p=pkg%2Fggml%2Fsources%2Fggml cmake : add metal kernel to target resources when built as shared library (#403) * Add GGML_METAL option to compile metal support. * Add metal option * Add metal sources * Add current source directory * Fix typo --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e3706079..a66aceb4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -271,6 +271,10 @@ if (BUILD_SHARED_LIBS) target_compile_definitions(${TARGET} PRIVATE GGML_BUILD ) + + if (GGML_METAL) + set_target_properties(${TARGET} PROPERTIES RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/ggml-metal.metal") + endif() endif() target_compile_definitions(${TARGET} PUBLIC