From: Jed Fox Date: Tue, 28 Mar 2023 16:39:01 +0000 (-0500) Subject: deploy : add a Package.swift for SwiftPM support (#393) X-Git-Tag: gguf-v0.4.0~1080 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=20e1e84884376b3fb44ffbfd48d478b2934b0b5e;p=pkg%2Fggml%2Fsources%2Fllama.cpp deploy : add a Package.swift for SwiftPM support (#393) * Add a Package.swift for SwiftPM support * Swap from exclusions to allowlist --- diff --git a/.gitignore b/.gitignore index 053311fe..741c6b4e 100644 --- a/.gitignore +++ b/.gitignore @@ -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 index 00000000..79d13c82 --- /dev/null +++ b/Package.swift @@ -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 index 00000000..9acceb98 --- /dev/null +++ b/spm-headers/llama.h @@ -0,0 +1 @@ +../llama.h \ No newline at end of file