-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackage.swift
56 lines (50 loc) · 1.5 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
// swift-tools-version: 5.10
import PackageDescription
import CompilerPluginSupport
let embeddedSwiftSettings: [SwiftSetting] = [
.enableExperimentalFeature("Embedded"),
.interoperabilityMode(.Cxx),
.unsafeFlags([
"-wmo", "-disable-cmo",
"-Xfrontend", "-gnone",
"-Xfrontend", "-disable-stack-protector"
])
]
let embeddedCSettings: [CSetting] = [
.unsafeFlags(["-fdeclspec"])
]
let linkerSettings: [LinkerSetting] = [
.unsafeFlags([
"-Xclang-linker", "-nostdlib",
"-Xlinker", "--no-entry"
])
]
let libcSettings: [CSetting] = [
.define("LACKS_TIME_H"),
.define("LACKS_SYS_TYPES_H"),
.define("LACKS_STDLIB_H"),
.define("LACKS_STRING_H"),
.define("LACKS_SYS_MMAN_H"),
.define("LACKS_FCNTL_H"),
.define("NO_MALLOC_STATS", to: "1"),
.define("__wasilibc_unmodified_upstream"),
]
let package = Package(
name: "LightWebApp",
dependencies: [
.package(url: "https://github.com/swifweb/String16", branch: "0.1.0"),
.package(url: "https://github.com/swifweb/JavaScriptKit", branch: "embedded")
],
targets: [
.executableTarget(
name: "LightWebApp",
dependencies: [
.product(name: "String16", package: "String16"),
.product(name: "JavaScriptKitEmbedded", package: "JavaScriptKit")
],
cSettings: embeddedCSettings,
swiftSettings: embeddedSwiftSettings,
linkerSettings: linkerSettings
)
]
)