llama.cpp/Package.swift
2023-05-06 21:44:07 -04:00

26 lines
813 B
Swift

// swift-tools-version:5.3
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: [
.library(name: "llama", targets: ["llama"]),
],
targets: [
.target(
name: "llama",
path: ".",
sources: ["ggml.c", "llama.cpp", "ggml-opencl.c"],
publicHeadersPath: "spm-headers",
cSettings: [.unsafeFlags(unsafeFlags)] + defines.map { .define($0) },
cxxSettings: [.unsafeFlags(unsafeFlags)] + defines.map { .define($0) },
linkerSettings: [.linkedFramework("Accelerate"), .linkedFramework("OpenCL")]
),
],
cxxLanguageStandard: .cxx11
)