forked from stackotter/galah
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackage.swift
77 lines (71 loc) · 2.25 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
// swift-tools-version: 5.9
import CompilerPluginSupport
import Foundation
import PackageDescription
let yesWasm = ProcessInfo.processInfo.environment["YES_WASM"] == "1"
let wasmTarget: Target = .executableTarget(
name: "GalahWeb",
dependencies: [
"GalahInterpreter",
"JavaScriptKit",
],
linkerSettings: [
.unsafeFlags(
[
"-Xlinker", "--export=main",
"-Xclang-linker", "-mexec-model=reactor",
]
)
]
)
let package = Package(
name: "galah",
platforms: [.macOS(.v10_15)],
products: [
.library(
name: "GalahInterpreter",
targets: ["GalahInterpreter"]
)
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.3.0"),
.package(
url: "https://github.com/swiftlang/swift-syntax.git",
from: "600.0.1"
),
.package(
url: "https://github.com/stackotter/swift-macro-toolkit",
from: "0.6.0"
),
.package(url: "https://github.com/swiftwasm/carton", from: "1.1.2")
] + (yesWasm ? [.package(url: "https://github.com/swiftwasm/JavaScriptKit", exact: "0.20.0")] : []),
targets: [
.executableTarget(
name: "galah",
dependencies: [
"GalahInterpreter",
.product(name: "ArgumentParser", package: "swift-argument-parser"),
]
),
.target(
name: "GalahInterpreter",
dependencies: [
"UtilityMacros"
]
),
.macro(
name: "UtilityMacrosPlugin",
dependencies: [
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
.product(name: "MacroToolkit", package: "swift-macro-toolkit"),
]
),
.target(name: "UtilityMacros", dependencies: ["UtilityMacrosPlugin"]),
.testTarget(
name: "GalahInterpreterTests",
dependencies: ["GalahInterpreter"]
),
] + (yesWasm ? [wasmTarget] : [])
)