Repository navigation
Expand file tree
/
Copy pathPackage.swift
More file actions
57 lines (55 loc) · 1.68 KB
/
Copy pathPackage.swift
File metadata and controls
57 lines (55 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// swift-tools-version: 6.2
import PackageDescription
import Foundation
let packageDir = URL(fileURLWithPath: #filePath).deletingLastPathComponent().path
let package = Package(
name: "Chirp",
platforms: [.macOS(.v15)],
products: [
.library(name: "Chirp", targets: ["Chirp"]),
],
dependencies: [],
targets: [
.target(
name: "Chirp",
dependencies: [
"CSherpaOnnx",
"COnnxRuntime",
],
path: "Sources/Chirp",
exclude: ["Info.plist", "Chirp.entitlements", "Main.swift", "AppIcon.icns"],
swiftSettings: [
.swiftLanguageMode(.v6),
],
linkerSettings: [
.linkedFramework("AVFoundation"),
.linkedFramework("ApplicationServices"),
.linkedFramework("Speech"),
.unsafeFlags([
"-L\(packageDir)/Frameworks/lib",
"-lsherpa-onnx-c-api",
"-lonnxruntime",
"-Xlinker", "-rpath", "-Xlinker", "\(packageDir)/Frameworks/lib",
], .when(platforms: [.macOS])),
]
),
.testTarget(
name: "ChirpTests",
dependencies: ["Chirp"],
path: "Tests/ChirpTests",
swiftSettings: [
.swiftLanguageMode(.v6),
]
),
.target(
name: "CSherpaOnnx",
path: "Sources/CSherpaOnnx",
publicHeadersPath: "include"
),
.target(
name: "COnnxRuntime",
path: "Sources/COnnxRuntime",
publicHeadersPath: "include"
),
]
)