-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathPackage.swift
87 lines (85 loc) · 2.79 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
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
// swift-tools-version:5.7
import PackageDescription
let package = Package(
name: "UntoldEngine",
platforms: [
.macOS(.v10_15),
],
products: [
// Library product for the engine
.library(
name: "UntoldEngine",
targets: ["UntoldEngine"]
),
// Executable for the demo game
.executable(
name: "DemoGame",
targets: ["DemoGame"]
),
// Executable for the starter template
.executable(
name: "StarterGame",
targets: ["StarterGame"]
),
],
targets: [
// Library target with the engine code
.target(
name: "CShaderTypes",
path: "Sources/CShaderTypes",
publicHeadersPath: ".",
cSettings: [
.headerSearchPath("."),
]
),
.target(
name: "UntoldEngine",
dependencies: ["CShaderTypes"],
path: "Sources/UntoldEngine",
exclude: ["Shaders"],
resources: [
// Include all Metal files and other resources
.copy("UntoldEngineKernels/UntoldEngineKernels.metallib"),
.process("UntoldEngineKernels/UntoldEngineKernels.air"),
.process("UntoldEngineKernels/UntoldEngineKernels.metal"),
.process("Resources/Models"),
.process("Resources/Animations"),
.process("Resources/HDR"),
.process("Resources/ReferenceImages"),
],
swiftSettings: [
.unsafeFlags(["-framework", "Metal", "-framework", "Cocoa", "-framework", "QuartzCore"]),
]
),
// Executable target for the demo game
.executableTarget(
name: "DemoGame",
dependencies: ["UntoldEngine"],
path: "Sources/DemoGame",
swiftSettings: [
.unsafeFlags(["-framework", "Metal", "-framework", "Cocoa", "-framework", "QuartzCore"]),
]
),
// Executable target for the starter template
.executableTarget(
name: "StarterGame",
dependencies: ["UntoldEngine"],
path: "Sources/StarterGame",
swiftSettings: [
.unsafeFlags(["-framework", "Metal", "-framework", "Cocoa", "-framework", "QuartzCore"]),
]
),
// Test target for unit tests
.testTarget(
name: "UntoldEngineTests",
dependencies: ["UntoldEngine"],
path: "Tests/UntoldEngineTests"
),
// Render-specific test target
.testTarget(
name: "UntoldEngineRenderTests",
dependencies: ["UntoldEngine"],
path: "Tests/UntoldEngineRenderTests"
),
]
)