forked from exPHAT/SwiftWhisper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
29 lines (25 loc) · 1.05 KB
/
Package.swift
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
// swift-tools-version:5.5
import PackageDescription
var exclude: [String] = []
#if os(Linux)
// Linux doesn't support CoreML, and will attempt to import the coreml source directory
exclude.append("coreml")
#endif
let package = Package(
name: "SwiftWhisper",
products: [
.library(name: "SwiftWhisper", targets: ["SwiftWhisper"])
],
targets: [
.target(name: "SwiftWhisper", dependencies: [.target(name: "whisper_cpp")]),
.target(name: "whisper_cpp",
exclude: exclude,
cSettings: [
.define("GGML_USE_ACCELERATE", .when(platforms: [.macOS, .macCatalyst, .iOS])),
.define("WHISPER_USE_COREML", .when(platforms: [.macOS, .macCatalyst, .iOS])),
.define("WHISPER_COREML_ALLOW_FALLBACK", .when(platforms: [.macOS, .macCatalyst, .iOS]))
]),
.testTarget(name: "WhisperTests", dependencies: [.target(name: "SwiftWhisper")], resources: [.copy("TestResources/")])
],
cxxLanguageStandard: CXXLanguageStandard.cxx11
)