-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
66 lines (63 loc) · 1.78 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
// swift-tools-version: 5.10
import Foundation
import PackageDescription
import CompilerPluginSupport
let rawMode = ProcessInfo.processInfo.environment["WACRO_RAW"] == "1"
let webkitMode = ProcessInfo.processInfo.environment["WEBKIT_RUNNER"] == "1"
let package = Package(
name: "Wacro",
platforms: [
.macOS("12.0")
],
products: [
.library(
name: "WacroPluginHost",
targets: ["WacroPluginHost"]
),
.library(
name: "WacroPluginRaw",
targets: ["WacroPluginRaw"]
),
],
dependencies: (rawMode ? [
.package(url: "https://github.com/apple/swift-syntax.git", "509.0.0"..<"999.0.0"),
] : []) + (webkitMode ? [] : [
.package(url: "https://github.com/kabiroberai/WasmKit.git", branch: "slim"),
]),
targets: [
.target(
name: "WacroPluginRaw",
dependencies: rawMode ? [
.product(name: "SwiftCompilerPluginMessageHandling", package: "swift-syntax"),
] : []
),
.target(
name: "WacroPluginHost",
dependencies: webkitMode ? [] : [
"WasmKit",
.product(name: "WASI", package: "WasmKit")
],
swiftSettings: webkitMode ? [
.define("WEBKIT_RUNNER")
] : []
),
.target(
name: "WacroTestSupport",
dependencies: [
"WacroPluginHost",
]
),
.testTarget(
name: "WacroPluginHostTests",
dependencies: [
"WacroTestSupport",
]
),
.testTarget(
name: "WacroPerformanceTests",
dependencies: [
"WacroTestSupport",
]
)
]
)