-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage.swift
More file actions
120 lines (119 loc) · 5.07 KB
/
Copy pathPackage.swift
File metadata and controls
120 lines (119 loc) · 5.07 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// swift-tools-version: 6.0
import PackageDescription
// phon's Swift implementation. The package split mirrors the Rust crates and the
// "Crates and packages" section of docs/content/spec.md: a contract module
// (PhonSchema), the shared execution vocabulary (PhonIR), the backend-blind
// engine (PhonEngine), the optional copy-and-patch JIT (PhonJIT), and the
// binding/front door (Phon). Only the binding probes the Swift runtime for
// descriptors; the engine and JIT stay binding-free.
let package = Package(
name: "phon",
platforms: [
// macOS 15: native `UInt128`/`Int128` (the 128-bit value widths) and
// `String(validating:as:)` (strict UTF-8 decode).
.macOS(.v15)
],
products: [
.library(name: "Phon", targets: ["Phon"]),
.library(name: "PhonSchema", targets: ["PhonSchema"]),
// The execution vocabulary (descriptors + IR) and the backend-blind
// engine — consumed by a binding (e.g. vox-runtime) that supplies
// descriptors and drives the typed codec.
.library(name: "PhonIR", targets: ["PhonIR"]),
.library(name: "PhonEngine", targets: ["PhonEngine"]),
// The JIT is reached only by opting in to this product; the baseline is
// PhonEngine's interpreter (r[crates.jit-opt-in]).
.library(name: "PhonJIT", targets: ["PhonJIT"]),
// Cross-engine equivalence harness (tree-walk vs interpreter vs JIT), shared by
// phon's own tests and downstream consumers (vox) so the engine list lives once.
.library(name: "PhonEngineTestSupport", targets: ["PhonEngineTestSupport"]),
.library(name: "PhonEcosystemFixtures", targets: ["PhonEcosystemFixtures"]),
.library(name: "PhonDibsEcosystemFixtures", targets: ["PhonDibsEcosystemFixtures"]),
.executable(name: "PhonJITBench", targets: ["PhonJITBench"]),
],
targets: [
// Vendored portable C BLAKE3 — content-hash schema identity. Portable
// path only (the x86 SIMD sources are not vendored; arm64 excludes them).
.target(
name: "CBlake3",
path: "swift/cblake3/Sources/CBlake3",
cSettings: [
.define("BLAKE3_USE_NEON", to: "0"),
.define("BLAKE3_NO_SSE2"),
.define("BLAKE3_NO_SSE41"),
.define("BLAKE3_NO_AVX2"),
.define("BLAKE3_NO_AVX512"),
]
),
.target(
name: "PhonSchema",
dependencies: ["CBlake3"],
path: "swift/phon-schema/Sources/PhonSchema"
),
.target(
name: "PhonIR",
dependencies: ["PhonSchema"],
path: "swift/phon-ir/Sources/PhonIR"
),
.target(
name: "PhonEngine",
dependencies: ["PhonSchema", "PhonIR"],
path: "swift/phon-engine/Sources/PhonEngine"
),
.target(
name: "CPhonJITStencils",
path: "swift/cphon-jit-stencils/Sources/CPhonJITStencils",
publicHeadersPath: "include"
),
.target(
name: "PhonJIT",
dependencies: ["CPhonJITStencils", "PhonEngine", "PhonIR", "PhonSchema"],
path: "swift/phon-jit/Sources/PhonJIT"
),
.target(
name: "Phon",
dependencies: ["PhonSchema", "PhonEngine"],
path: "swift/phon/Sources/Phon"
),
.testTarget(
name: "PhonTests",
dependencies: ["Phon", "PhonSchema"],
path: "swift/phon/Tests/PhonTests"
),
.testTarget(
name: "PhonSchemaTests",
dependencies: ["PhonSchema"],
path: "swift/phon-schema/Tests/PhonSchemaTests"
),
.target(
name: "PhonEngineTestSupport",
dependencies: ["PhonEngine", "PhonIR", "PhonJIT", "PhonSchema"],
path: "swift/phon-engine-test-support/Sources/PhonEngineTestSupport"
),
.target(
name: "PhonEcosystemFixtures",
dependencies: ["PhonEngine", "PhonIR", "PhonSchema"],
path: "swift/phon-ecosystem-fixtures/Sources/PhonEcosystemFixtures"
),
.target(
name: "PhonDibsEcosystemFixtures",
dependencies: ["PhonEngine", "PhonIR", "PhonSchema"],
path: "swift/phon-dibs-ecosystem-fixtures/Sources/PhonDibsEcosystemFixtures"
),
.testTarget(
name: "PhonEngineTests",
dependencies: ["PhonDibsEcosystemFixtures", "PhonEcosystemFixtures", "PhonEngine", "PhonEngineTestSupport", "PhonIR", "PhonSchema"],
path: "swift/phon-engine/Tests/PhonEngineTests"
),
.testTarget(
name: "PhonJITTests",
dependencies: ["PhonEngine", "PhonIR", "PhonJIT", "PhonSchema"],
path: "swift/phon-jit/Tests/PhonJITTests"
),
.executableTarget(
name: "PhonJITBench",
dependencies: ["PhonDibsEcosystemFixtures", "PhonEcosystemFixtures", "PhonEngine", "PhonIR", "PhonJIT", "PhonSchema"],
path: "swift/phon-jit-bench/Sources/PhonJITBench"
),
]
)