Skip to content

Commit 2ec853d

Browse files
committed
fix: Swift build tool compiling error
1 parent 40c382c commit 2ec853d

File tree

2 files changed

+83
-7
lines changed

2 files changed

+83
-7
lines changed

Package.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,7 @@ let package = Package(
5757
dependencies: [
5858
"libsmb2",
5959
],
60-
path: "AMSMB2",
61-
swiftSettings: [
62-
.unsafeFlags([
63-
"-Xfrontend", "-warn-concurrency",
64-
"-Xfrontend", "-enable-actor-data-race-checks",
65-
]),
66-
]
60+
path: "AMSMB2"
6761
),
6862
.testTarget(
6963
name: "AMSMB2Tests",

[email protected]

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// swift-tools-version:5.8
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "AMSMB2",
6+
platforms: [
7+
.iOS(.v13),
8+
.macOS(.v10_15),
9+
.macCatalyst(.v13),
10+
.tvOS(.v14),
11+
.watchOS(.v6),
12+
],
13+
products: [
14+
.library(
15+
name: "AMSMB2",
16+
type: .dynamic,
17+
targets: ["AMSMB2"]
18+
),
19+
],
20+
dependencies: [
21+
.package(url: "https://github.com/apple/swift-atomics.git", .upToNextMajor(from: "1.2.0")),
22+
],
23+
targets: [
24+
.target(
25+
name: "libsmb2",
26+
path: "Dependencies/libsmb2",
27+
exclude: [
28+
"lib/CMakeLists.txt",
29+
"lib/libsmb2.syms",
30+
"lib/Makefile.am",
31+
"lib/Makefile.DC_KOS",
32+
"lib/Makefile.PS2_EE",
33+
"lib/Makefile.PS2_IOP",
34+
"lib/Makefile.PS3_PPU",
35+
"lib/Makefile.PS4",
36+
],
37+
sources: [
38+
"lib",
39+
],
40+
publicHeadersPath: ".",
41+
cSettings: [
42+
.headerSearchPath("include"),
43+
.headerSearchPath("include/apple"),
44+
.headerSearchPath("include/smb2"),
45+
.headerSearchPath("lib"),
46+
.define("_U_", to: "__attribute__((unused))"),
47+
.define("HAVE_CONFIG_H", to: "1"),
48+
.unsafeFlags([
49+
"-Wno-everything",
50+
]),
51+
],
52+
linkerSettings: [
53+
]
54+
),
55+
.target(
56+
name: "AMSMB2",
57+
dependencies: [
58+
"libsmb2",
59+
],
60+
path: "AMSMB2"
61+
),
62+
.testTarget(
63+
name: "AMSMB2Tests",
64+
dependencies: [
65+
"AMSMB2",
66+
.product(name: "Atomics", package: "swift-atomics"),
67+
],
68+
path: "AMSMB2Tests"
69+
),
70+
],
71+
swiftLanguageVersions: [.v5]
72+
)
73+
74+
for target in package.targets {
75+
var swiftSettings: [SwiftSetting] = [
76+
.enableExperimentalFeature("StrictConcurrency=complete"),
77+
]
78+
#if swift(>=5.9)
79+
swiftSettings.append(.enableUpcomingFeature("ExistentialAny"))
80+
#endif
81+
target.swiftSettings = swiftSettings
82+
}

0 commit comments

Comments
 (0)