From 4baa85633a276d3bb95fa89271b28a3551829829 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 6 May 2023 21:44:07 -0400 Subject: [PATCH] Fix build --- Package.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index b33230d12..3bc440ad7 100644 --- a/Package.swift +++ b/Package.swift @@ -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")] ), ],