forked from swiftlang/swift-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackage.swift
91 lines (83 loc) · 2.61 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
// swift-tools-version:5.1
import PackageDescription
import class Foundation.ProcessInfo
let macOSPlatform: SupportedPlatform
if let deploymentTarget = ProcessInfo.processInfo.environment["SWIFTPM_MACOS_DEPLOYMENT_TARGET"] {
macOSPlatform = .macOS(deploymentTarget)
} else {
macOSPlatform = .macOS(.v10_10)
}
let package = Package(
name: "swift-driver",
platforms: [
macOSPlatform,
],
products: [
.executable(
name: "swift-driver",
targets: ["swift-driver"]),
.executable(
name: "swift-help",
targets: ["swift-help"]),
.library(
name: "SwiftDriver",
targets: ["SwiftDriver"]),
.library(
name: "SwiftOptions",
targets: ["SwiftOptions"]),
],
targets: [
/// The driver library.
.target(
name: "SwiftDriver",
dependencies: ["SwiftOptions", "SwiftToolsSupport-auto", "Yams"]),
.testTarget(
name: "SwiftDriverTests",
dependencies: ["SwiftDriver", "swift-driver"]),
/// The options library.
.target(
name: "SwiftOptions",
dependencies: ["SwiftToolsSupport-auto"]),
.testTarget(
name: "SwiftOptionsTests",
dependencies: ["SwiftOptions"]),
/// The primary driver executable.
.target(
name: "swift-driver",
dependencies: ["SwiftDriver"]),
/// The help executable.
.target(
name: "swift-help",
dependencies: ["SwiftOptions"]),
/// The `makeOptions` utility (for importing option definitions).
.target(
name: "makeOptions",
dependencies: []),
],
cxxLanguageStandard: .cxx14
)
if ProcessInfo.processInfo.environment["SWIFT_DRIVER_LLBUILD_FWK"] == nil {
if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
package.dependencies += [
.package(url: "https://github.com/apple/swift-llbuild.git", .branch("master")),
]
} else {
// In Swift CI, use a local path to llbuild to interoperate with tools
// like `update-checkout`, which control the sources externally.
package.dependencies += [
.package(path: "../llbuild"),
]
}
package.targets.first(where: { $0.name == "SwiftDriver" })!.dependencies += ["llbuildSwift"]
}
if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
package.dependencies += [
.package(url: "https://github.com/apple/swift-tools-support-core.git", .branch("master")),
.package(url: "https://github.com/jpsim/Yams.git", .upToNextMinor(from: "4.0.0")),
]
} else {
package.dependencies += [
.package(path: "../swiftpm/swift-tools-support-core"),
.package(path: "../yams"),
]
}