forked from scandum/mth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage.swift
More file actions
95 lines (91 loc) · 2.38 KB
/
Package.swift
File metadata and controls
95 lines (91 loc) · 2.38 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
// swift-tools-version:6.0
import PackageDescription
var products: [Product] = [
.library(name: "MTH", targets: ["MTH"]),
.library(name: "MTHClient", targets: ["MTHClient"]),
.library(name: "MTHColor", targets: ["MTHColor"]),
]
var targets: [Target] = [
// Thin C wrapper exposing system zlib to Swift.
// zlib is present on macOS (SDK) and Linux (Swift toolchain dependency).
.target(
name: "CZlib",
path: "Sources/CZlib",
publicHeadersPath: "include",
linkerSettings: [.linkedLibrary("z")]
),
// Shared telnet constants, compression, and MTTS flags used by both server and client.
.target(
name: "MTHCore",
dependencies: [
"CZlib",
],
path: "Sources/SwiftMTHCore"
),
// Server-side telnet session, MSDP, MSSP, and related protocols.
.target(
name: "MTH",
dependencies: ["MTHCore"],
path: "Sources/SwiftMTH"
),
// Client-side telnet session for MUD clients.
.target(
name: "MTHClient",
dependencies: ["MTHCore"],
path: "Sources/SwiftMTHClient"
),
.target(
name: "MTHColor",
dependencies: [],
path: "Sources/SwiftMTHColor"
),
]
// C oracle targets require unix headers (sys/time.h, zlib.h) — exclude on Windows.
#if !os(Windows)
products += [
.library(name: "Cmth", targets: ["Cmth"]),
.library(name: "CmthColor", targets: ["CmthColor"]),
]
targets += [
.target(
name: "Cmth",
dependencies: [],
path: "Sources/cmth",
sources: ["msdp.c", "mth.c", "telopt.c", "mud.c"],
publicHeadersPath: "./",
cSettings: [.define("MTH_LIBRARY")]
),
.target(
name: "CmthColor",
dependencies: [],
path: "Sources/cmthcolor",
sources: ["color.c"],
publicHeadersPath: "./",
cSettings: [.define("MTH_LIBRARY")]
),
.testTarget(
name: "MTHTests",
dependencies: ["MTH", "MTHClient", "Cmth"]
),
.testTarget(
name: "MTHColorTests",
dependencies: ["MTHColor", "CmthColor"]
),
]
#else
targets += [
.testTarget(
name: "MTHTests",
dependencies: ["MTH", "MTHClient"]
),
.testTarget(
name: "MTHColorTests",
dependencies: ["MTHColor"]
),
]
#endif
let package = Package(
name: "mth",
products: products,
targets: targets
)