This repository has been archived by the owner on May 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackage.swift
88 lines (76 loc) · 3.01 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
// swift-tools-version:5.4
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
var targets: [Target] {
var array: [Target] = []
array.append(.target(name: "Shaders", dependencies: ["GameMath"]))
// TrueType
array.append(
.target(name: "TrueType",
cSettings: [
.unsafeFlags(["-Wno-everything"]),
.define("STB_TRUETYPE_IMPLEMENTATION"), .define("STB_RECT_PACK_IMPLEMENTATION"),
.define("extern", to: "__declspec(dllexport) extern", .when(platforms: [.windows])),
.define("_CRT_SECURE_NO_WARNINGS", .when(platforms: [.windows])), // Silence warnings
],
linkerSettings: [
// SR-14728
.linkedLibrary("swiftCore", .when(platforms: [.windows])),
])
)
// libspng
array.append(
.target(name: "libspng",
cSettings: [
.unsafeFlags(["-Wno-everything"]),
.define("SPNG_USE_MINIZ"),
.define("extern", to: "__declspec(dllexport) extern", .when(platforms: [.windows])),
.define("_CRT_SECURE_NO_WARNINGS", .when(platforms: [.windows])), // Silence warnings
],
linkerSettings: [
// SR-14728\
.linkedLibrary("swiftCore", .when(platforms: [.windows])),
])
)
// Vorbis
array.append(
.target(name: "Vorbis",
publicHeadersPath: "include",
cSettings: [
.unsafeFlags(["-Wno-everything"]),
.define("extern", to: "__declspec(dllexport) extern", .when(platforms: [.windows]))
],
swiftSettings: [
.unsafeFlags(["-wall"]),
],
linkerSettings: [
// SR-14728
.linkedLibrary("swiftCore", .when(platforms: [.windows])),
])
)
// LinuxSupport
array.append(contentsOf: [
.target(name: "LinuxSupport", dependencies: ["LinuxImports", "LinuxExtensions"]),
.target(name: "LinuxExtensions"),
.systemLibrary(name: "LinuxImports"),
])
return array
}
var products: [Product] {
var array: [Product] = []
array.append(.library(name: "Shaders", targets: ["Shaders"]))
array.append(.library(name: "libspng", targets: ["libspng"]))
array.append(.library(name: "TrueType", targets: ["TrueType"]))
array.append(.library(name: "Vorbis", targets: ["Vorbis"]))
array.append(.library(name: "LinuxSupport", targets: ["LinuxSupport"]))
return array
}
let package = Package(
name: "GateEngineDependencies",
products: products,
dependencies: [
.package(url: "https://github.com/STREGAsGate/GameMath.git", .branch("master")),
],
targets: targets,
swiftLanguageVersions: [.v5]
)