-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackage.swift
66 lines (60 loc) · 1.66 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 PackageDescription
let embeddedSwiftSettings: [SwiftSetting] = [
.enableExperimentalFeature("Embedded"),
.interoperabilityMode(.Cxx),
.unsafeFlags([
"-wmo", "-disable-cmo",
"-Xfrontend", "-gnone",
"-Xfrontend", "-disable-stack-protector",
"-Xfrontend", "-emit-empty-object-file"
])
]
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: "String16",
products: [
.library(name: "String16", targets: ["String16"]),
],
dependencies: [
.package(url: "https://github.com/swifweb/EmbeddedFoundation", from: "0.1.0")
],
targets: [
.target(
name: "String16",
dependencies: [
"_CString16",
.product(name: "Foundation", package: "EmbeddedFoundation")
],
cSettings: embeddedCSettings,
swiftSettings: embeddedSwiftSettings,
linkerSettings: linkerSettings
),
.target(
name: "_CString16",
cSettings: libcSettings
),
.testTarget(
name: "String16Tests",
dependencies: ["String16"]
)
]
)