]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
deploy : add a Package.swift for SwiftPM support (#393)
authorJed Fox <redacted>
Tue, 28 Mar 2023 16:39:01 +0000 (11:39 -0500)
committerGitHub <redacted>
Tue, 28 Mar 2023 16:39:01 +0000 (19:39 +0300)
* Add a Package.swift for SwiftPM support

* Swap from exclusions to allowlist

.gitignore
Package.swift [new file with mode: 0644]
spm-headers/llama.h [new symlink]

index 053311fee62a4c80ab14c28050d6287033896c6a..741c6b4ea344746abee1ac8b93ff7de0dc6c75be 100644 (file)
@@ -5,6 +5,7 @@
 .vscode/
 .DS_Store
 
+.build/
 build/
 build-em/
 build-debug/
@@ -27,3 +28,7 @@ compile_commands.json
 
 .envrc
 .direnv/
+
+.venv
+__pycache__
+.swiftpm
diff --git a/Package.swift b/Package.swift
new file mode 100644 (file)
index 0000000..79d13c8
--- /dev/null
@@ -0,0 +1,20 @@
+// swift-tools-version:5.3
+
+import PackageDescription
+
+let package = Package(
+    name: "llama",
+    products: [
+        .library(name: "llama", targets: ["llama"]),
+    ],
+    targets: [
+        .target(
+            name: "llama",
+            path: ".",
+            sources: ["ggml.c", "llama.cpp"],
+            publicHeadersPath: "spm-headers",
+            cSettings: [.unsafeFlags(["-Wno-shorten-64-to-32"])]
+        ),
+    ],
+    cxxLanguageStandard: .cxx11
+)
diff --git a/spm-headers/llama.h b/spm-headers/llama.h
new file mode 120000 (symlink)
index 0000000..9acceb9
--- /dev/null
@@ -0,0 +1 @@
+../llama.h
\ No newline at end of file