-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPackage.swift
More file actions
97 lines (94 loc) · 3.88 KB
/
Package.swift
File metadata and controls
97 lines (94 loc) · 3.88 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// swift-tools-version: 5.9
import PackageDescription
import Foundation
// TranscriptedCore — shared library target co-hosted with Draft.
//
// Consumed by:
// 1. Draft's meeting integration via build-deps.sh
// 2. `swift test` for the TranscriptedCore smoke tests in this repo
//
// Binary dependency layout:
// deps-libs/libDraftDeps.a — prebuilt mega-library (FluidAudio 0.7.9 + MLX + deps + TranscriptedCore)
// deps-libs/libExternalDeps.a — external-only archive for SPM tests (no TranscriptedCore objects)
// deps-modules/*.swiftmodule — Swift interface files for FluidAudio et al.
// deps-modules/FastClusterWrapper — C header for fast-cluster C++ wrapper
// deps-modules/MachTaskSelfWrapper — C header for mach_task_self helper
// deps-modules/yyjson — C header for yyjson JSON parser
//
// `#filePath` resolves to Package.swift's absolute location on disk, so the -I/-L
// flags work whether swiftc is invoked from the package root (`swift test`) or from
// a consumer like Xcode's SPM integration which sets -working-directory elsewhere.
let repoRoot = URL(fileURLWithPath: #filePath).deletingLastPathComponent().path
let package = Package(
name: "TranscriptedCore",
platforms: [.macOS(.v14)],
products: [
.library(
name: "TranscriptedCore",
targets: ["TranscriptedCore"]
),
],
dependencies: [],
targets: [
.target(
name: "TranscriptedCore",
dependencies: [],
path: "Sources/TranscriptedCore",
swiftSettings: [
.unsafeFlags([
"-I", "\(repoRoot)/deps-modules",
"-I", "\(repoRoot)/deps-modules/FastClusterWrapper",
"-I", "\(repoRoot)/deps-modules/MachTaskSelfWrapper",
"-I", "\(repoRoot)/deps-modules/yyjson",
]),
],
linkerSettings: [
.unsafeFlags([
"-L\(repoRoot)/deps-libs",
"-lExternalDeps",
"-lc++",
]),
.linkedFramework("Metal"),
.linkedFramework("MetalKit"),
.linkedFramework("Accelerate"),
.linkedFramework("CoreML"),
.linkedFramework("CoreAudio"),
.linkedFramework("AVFoundation"),
.linkedFramework("AppKit"),
.linkedFramework("Network"),
]
),
.testTarget(
name: "TranscriptedCoreTests",
dependencies: ["TranscriptedCore"],
path: "Tests/TranscriptedCoreTests",
swiftSettings: [
// @testable import TranscriptedCore transitively re-exports FluidAudio/MLX
// module interfaces, so the test target needs the same -I search paths.
.unsafeFlags([
"-I", "\(repoRoot)/deps-modules",
"-I", "\(repoRoot)/deps-modules/FastClusterWrapper",
"-I", "\(repoRoot)/deps-modules/MachTaskSelfWrapper",
"-I", "\(repoRoot)/deps-modules/yyjson",
]),
],
linkerSettings: [
// Mirror Core target linker flags so the xctest binary can resolve
// FluidAudio symbols pulled in through @testable.
.unsafeFlags([
"-L\(repoRoot)/deps-libs",
"-lExternalDeps",
"-lc++",
]),
.linkedFramework("Metal"),
.linkedFramework("MetalKit"),
.linkedFramework("Accelerate"),
.linkedFramework("CoreML"),
.linkedFramework("CoreAudio"),
.linkedFramework("AVFoundation"),
.linkedFramework("AppKit"),
.linkedFramework("Network"),
]
),
]
)