Skip to content

Commit e4b76bb

Browse files
authored
swift : revert compiler checks for swift package (ggml-org#4332)
1 parent 23b5e12 commit e4b76bb

File tree

1 file changed

+16
-30
lines changed

1 file changed

+16
-30
lines changed

Diff for: Package.swift

+16-30
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,45 @@
22

33
import PackageDescription
44

5-
#if arch(arm) || arch(arm64)
6-
let platforms: [SupportedPlatform]? = [
7-
.macOS(.v12),
8-
.iOS(.v14),
9-
.watchOS(.v4),
10-
.tvOS(.v14)
11-
]
12-
let exclude: [String] = []
13-
let resources: [Resource] = [
14-
.process("ggml-metal.metal")
15-
]
16-
let additionalSources: [String] = ["ggml-metal.m"]
17-
let additionalSettings: [CSetting] = [
18-
.unsafeFlags(["-fno-objc-arc"]),
19-
.define("GGML_USE_METAL")
20-
]
21-
#else
22-
let platforms: [SupportedPlatform]? = nil
23-
let exclude: [String] = ["ggml-metal.metal"]
24-
let resources: [Resource] = []
25-
let additionalSources: [String] = []
26-
let additionalSettings: [CSetting] = []
27-
#endif
28-
295
let package = Package(
306
name: "llama",
31-
platforms: platforms,
7+
platforms: [
8+
.macOS(.v12),
9+
.iOS(.v14),
10+
.watchOS(.v4),
11+
.tvOS(.v14)
12+
],
3213
products: [
3314
.library(name: "llama", targets: ["llama"]),
3415
],
3516
targets: [
3617
.target(
3718
name: "llama",
3819
path: ".",
39-
exclude: exclude,
20+
exclude: [],
4021
sources: [
4122
"ggml.c",
4223
"llama.cpp",
4324
"ggml-alloc.c",
4425
"ggml-backend.c",
4526
"ggml-quants.c",
46-
] + additionalSources,
47-
resources: resources,
27+
"ggml-metal.m",
28+
],
29+
resources: [
30+
.process("ggml-metal.metal")
31+
],
4832
publicHeadersPath: "spm-headers",
4933
cSettings: [
5034
.unsafeFlags(["-Wno-shorten-64-to-32", "-O3", "-DNDEBUG"]),
51-
.define("GGML_USE_ACCELERATE")
35+
.define("GGML_USE_ACCELERATE"),
36+
.unsafeFlags(["-fno-objc-arc"]),
37+
.define("GGML_USE_METAL"),
5238
// NOTE: NEW_LAPACK will required iOS version 16.4+
5339
// We should consider add this in the future when we drop support for iOS 14
5440
// (ref: ref: https://developer.apple.com/documentation/accelerate/1513264-cblas_sgemm?language=objc)
5541
// .define("ACCELERATE_NEW_LAPACK"),
5642
// .define("ACCELERATE_LAPACK_ILP64")
57-
] + additionalSettings,
43+
],
5844
linkerSettings: [
5945
.linkedFramework("Accelerate")
6046
]

0 commit comments

Comments
 (0)