-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Package.swift
96 lines (86 loc) · 4.8 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
88
89
90
91
92
93
94
95
96
// swift-tools-version:5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let swiftSettings: [SwiftSetting] = [
// Use whole cross optimization in release builds
.unsafeFlags(["-cross-module-optimization"], .when(configuration: .release)),
// Remove runtime checks in release builds
.unsafeFlags(["-Ounchecked"], .when(configuration: .release)),
// This is required on Windows due to a bug
// #55127 https://github.com/apple/swift/issues/55127
.unsafeFlags(["-parse-as-library"], .when(platforms: [.windows])),
// These flags tell Windows that the executable is UI based (shows a window) and hides the command prompt
.unsafeFlags(["-Xfrontend", "-entry-point-function-name"], .when(platforms: [.windows], configuration: .release)),
.unsafeFlags(["-Xfrontend", "wWinMain"], .when(platforms: [.windows], configuration: .release)),
]
let linkerSettings: [LinkerSetting] = [
// These flags tell Windows that the executable is UI based (shows a window) and hides the command prompt
.unsafeFlags(["-Xlinker", "/SUBSYSTEM:WINDOWS"], .when(platforms: [.windows], configuration: .release)),
]
let package: Package = Package(
name: "GateEngineDemos",
platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13)],
products: [
.executable(name: "2D_01_AnimatedSprite", targets: ["2D_01_AnimatedSprite"]),
.executable(name: "2D_JRPG", targets: ["2D_JRPG"]),
.executable(name: "2D_Pong", targets: ["2D_Pong"]),
.executable(name: "3D_01_RotatingCube", targets: ["3D_01_RotatingCube"]),
.executable(name: "3D_02_SkinnedCharacter", targets: ["3D_02_SkinnedCharacter"]),
.executable(name: "3D_03_MousePicking", targets: ["3D_03_MousePicking"]),
.executable(name: "3D_FirstPerson", targets: ["3D_FirstPerson"]),
.executable(name: "G_01_UserInput", targets: ["G_01_UserInput"]),
.executable(name: "G_02_MultipleWindows", targets: ["G_02_MultipleWindows"]),
.executable(name: "G_03_SavingState", targets: ["G_03_SavingState"]),
],
dependencies: [
.package(url: "https://github.com/STREGAsGate/GateEngine.git", .upToNextMajor(from: "0.2.0")),
.package(url: "https://github.com/swiftwasm/carton", from: "1.0.0"),
],
targets: [
.executableTarget(name: "2D_01_AnimatedSprite",
dependencies: ["GateEngine"],
resources: [.copy("Resources")],
swiftSettings: swiftSettings,
linkerSettings: linkerSettings),
.executableTarget(name: "2D_JRPG",
dependencies: ["GateEngine"],
exclude: ["Source Art"],
resources: [.copy("Resources")],
swiftSettings: swiftSettings,
linkerSettings: linkerSettings),
.executableTarget(name: "2D_Pong",
dependencies: ["GateEngine"],
swiftSettings: swiftSettings,
linkerSettings: linkerSettings),
.executableTarget(name: "3D_01_RotatingCube",
dependencies: ["GateEngine"],
swiftSettings: swiftSettings,
linkerSettings: linkerSettings),
.executableTarget(name: "3D_02_SkinnedCharacter",
dependencies: ["GateEngine"],
resources: [.copy("Resources")],
swiftSettings: swiftSettings,
linkerSettings: linkerSettings),
.executableTarget(name: "3D_03_MousePicking",
dependencies: ["GateEngine"],
swiftSettings: swiftSettings,
linkerSettings: linkerSettings),
.executableTarget(name: "3D_FirstPerson",
dependencies: ["GateEngine"],
resources: [.copy("Resources")],
swiftSettings: swiftSettings,
linkerSettings: linkerSettings),
.executableTarget(name: "G_01_UserInput",
dependencies: ["GateEngine"],
swiftSettings: swiftSettings,
linkerSettings: linkerSettings),
.executableTarget(name: "G_02_MultipleWindows",
dependencies: ["GateEngine"],
swiftSettings: swiftSettings,
linkerSettings: linkerSettings),
.executableTarget(name: "G_03_SavingState",
dependencies: ["GateEngine"],
swiftSettings: swiftSettings,
linkerSettings: linkerSettings),
]
)