Fix build

This commit is contained in:
Jed Fox 2023-05-06 21:44:07 -04:00
parent 2dc7fc9491
commit 4baa85633a
No known key found for this signature in database
GPG Key ID: 0B61D18EA54B47E1

View File

@ -2,6 +2,9 @@
import PackageDescription
let unsafeFlags = ["-Wno-shorten-64-to-32", "-I/opt/homebrew/opt/clblast/include"]
let defines = ["GGML_USE_ACCELERATE", "GGML_USE_CLBLAST"]
let package = Package(
name: "llama",
products: [
@ -13,7 +16,8 @@ let package = Package(
path: ".",
sources: ["ggml.c", "llama.cpp", "ggml-opencl.c"],
publicHeadersPath: "spm-headers",
cSettings: [.unsafeFlags(["-Wno-shorten-64-to-32"]), .define("GGML_USE_ACCELERATE"), .define("GGML_USE_CLBLAST")],
cSettings: [.unsafeFlags(unsafeFlags)] + defines.map { .define($0) },
cxxSettings: [.unsafeFlags(unsafeFlags)] + defines.map { .define($0) },
linkerSettings: [.linkedFramework("Accelerate"), .linkedFramework("OpenCL")]
),
],