forked from zeroc-ice/ice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
129 lines (124 loc) · 3.93 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// swift-tools-version: 5.9
import Foundation
import PackageDescription
let iceUtilSources: [String] = [
"src/Ice/ConsoleUtil.cpp",
"src/Ice/CtrlCHandler.cpp",
"src/Ice/Exception.cpp",
"src/Ice/FileUtil.cpp",
"src/Ice/LocalException.cpp",
"src/Ice/Options.cpp",
"src/Ice/OutputUtil.cpp",
"src/Ice/Random.cpp",
"src/Ice/StringConverter.cpp",
"src/Ice/StringUtil.cpp",
"src/Ice/UUID.cpp",
]
let package = Package(
name: "ice",
defaultLocalization: "en",
platforms: [
.macOS(.v14),
.iOS(.v17),
],
products: [
.library(name: "Ice", targets: ["Ice"]),
.library(name: "Glacier2", targets: ["Glacier2"]),
.library(name: "IceGrid", targets: ["IceGrid"]),
.library(name: "IceStorm", targets: ["IceStorm"]),
.plugin(name: "CompileSlice", targets: ["CompileSlice"]),
],
dependencies: [
.package(url: "https://github.com/zeroc-ice/mcpp.git", branch: "master"),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.1.0"),
],
targets: [
.target(
name: "Ice",
dependencies: ["IceImpl"],
path: "swift/src/Ice",
resources: [.process("slice-plugin.json")],
plugins: [.plugin(name: "CompileSlice")]
),
.target(
name: "Glacier2",
dependencies: ["Ice"],
path: "swift/src/Glacier2",
resources: [.process("slice-plugin.json")],
plugins: [.plugin(name: "CompileSlice")]
),
.target(
name: "IceGrid",
dependencies: ["Ice", "Glacier2"],
path: "swift/src/IceGrid",
resources: [.process("slice-plugin.json")],
plugins: [.plugin(name: "CompileSlice")]
),
.target(
name: "IceStorm",
dependencies: ["Ice"],
path: "swift/src/IceStorm",
resources: [.process("slice-plugin.json")],
plugins: [.plugin(name: "CompileSlice")]
),
.target(
name: "IceImpl",
dependencies: [
"IceCpp",
"IceDiscoveryCpp",
"IceLocatorDiscoveryCpp",
],
path: "swift/src/IceImpl",
cxxSettings: [
// We rely on a few private headers from Ice
.headerSearchPath("../../../cpp/src/"),
],
linkerSettings: [
.linkedLibrary("bz2"),
.linkedFramework("ExternalAccessory")
]
),
.binaryTarget(
name: "IceCpp",
path: "cpp/lib/Ice.xcframework"
),
.binaryTarget(
name: "IceDiscoveryCpp",
path: "cpp/lib/IceDiscovery.xcframework"
),
.binaryTarget(
name: "IceLocatorDiscoveryCpp",
path: "cpp/lib/IceLocatorDiscovery.xcframework"
),
.executableTarget(
name: "slice2swift",
dependencies: ["mcpp"],
path: "cpp",
exclude: [
"test",
"src/slice2swift/build",
"src/slice2swift/msbuild",
"src/slice2swift/Slice2Swift.rc",
"src/Slice/build",
"src/Slice/msbuild",
"src/Slice/Scanner.l",
"src/Slice/Grammar.y",
"src/Slice/Makefile.mk",
],
sources: ["src/slice2swift", "src/Slice"] + iceUtilSources,
publicHeadersPath: "src/slice2swift",
cxxSettings: [
.headerSearchPath("src"),
.headerSearchPath("include")
]
),
.plugin(
name: "CompileSlice",
capability: .buildTool(),
dependencies: ["slice2swift"],
path: "swift/src/CompileSlicePlugin"
),
],
swiftLanguageVersions: [SwiftVersion.v5],
cxxLanguageStandard: .cxx20
)