-
Notifications
You must be signed in to change notification settings - Fork 28
/
Package.swift
90 lines (90 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
88
89
90
// swift-tools-version:5.4
import PackageDescription
import Foundation
let package = Package(
name: "MacPin",
//platforms: [.macOS(.v10_15)],
// whines about a lot of unguarded calls to 10.15.4 apis
platforms: [.macOS(.v11)],
products: [
.library(name: "MacPin", type: .dynamic, targets: ["MacPin"]),
.executable(name: "MacPin_static", targets: ["MacPin_static"]),
.executable(name: "MacPin_stub", targets: ["MacPin_stub"]),
.executable(name: "iconify", targets: ["iconify"]),
],
dependencies: [
.package(path: "modules/Linenoise"),
.package(path: "modules/UTIKit"),
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"),
],
targets: [
.systemLibrary(
name: "WebKitPrivates",
path: "modules/WebKitPrivates"
),
.systemLibrary(
name: "ViewPrivates",
path: "modules/ViewPrivates"
),
.systemLibrary(
name: "UserNotificationPrivates",
path: "modules/UserNotificationPrivates"
),
.systemLibrary(
name: "JavaScriptCorePrivates",
path: "modules/JavaScriptCorePrivates"
),
]
)
if let iosvar = ProcessInfo.processInfo.environment["MACPIN_IOS"], !iosvar.isEmpty {
package.platforms = [.iOS(.v13)]
package.products = [ .executable(name: "MacPin", targets: ["MacPin"]) ]
package.targets.append(
.executableTarget(
name: "MacPin",
dependencies: [
"WebKitPrivates",
"JavaScriptCorePrivates",
"ViewPrivates",
"UserNotificationPrivates",
"Linenoise",
"UTIKit",
],
path: "Sources/MacPinIOS"
)
)
} else {
package.targets.append(contentsOf: [
.executableTarget(
name: "iconify",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
path: "Tools/iconify"
),
.target(name: "MacPin",
dependencies: [
"WebKitPrivates",
"JavaScriptCorePrivates",
"ViewPrivates",
"UserNotificationPrivates",
"Linenoise",
"UTIKit",
],
path: "Sources/MacPinOSX"
),
.executableTarget(
name: "MacPin_static",
dependencies: [
.target(name: "MacPin")
]
),
.executableTarget(
name: "MacPin_stub",
dependencies: [],
linkerSettings: [
.unsafeFlags(["-Xlinker", "-rpath", "-Xlinker", "@loader_path:@loader_path/../Frameworks"])
]
)
])
}