]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
cmake : add metal kernel to target resources when built as shared library (#403)
authorAndrei <redacted>
Sun, 23 Jul 2023 19:44:54 +0000 (15:44 -0400)
committerGitHub <redacted>
Sun, 23 Jul 2023 19:44:54 +0000 (22:44 +0300)
* Add GGML_METAL option to compile metal support.

* Add metal option

* Add metal sources

* Add current source directory

* Fix typo

src/CMakeLists.txt

index e37060794381db9a77eddb1d7f408e6cc9d6b88b..a66aceb4475b38182ec0e78ba9e29731ee2a8bab 100644 (file)
@@ -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