Skip to content

Commit

Permalink
fix: Swift build tool compiling error
Browse files Browse the repository at this point in the history
  • Loading branch information
amosavian committed Nov 28, 2023
1 parent 40c382c commit 2ec853d
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 7 deletions.
8 changes: 1 addition & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,7 @@ let package = Package(
dependencies: [
"libsmb2",
],
path: "AMSMB2",
swiftSettings: [
.unsafeFlags([
"-Xfrontend", "-warn-concurrency",
"-Xfrontend", "-enable-actor-data-race-checks",
]),
]
path: "AMSMB2"
),
.testTarget(
name: "AMSMB2Tests",
Expand Down
82 changes: 82 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// swift-tools-version:5.8
import PackageDescription

let package = Package(
name: "AMSMB2",
platforms: [
.iOS(.v13),
.macOS(.v10_15),
.macCatalyst(.v13),
.tvOS(.v14),
.watchOS(.v6),
],
products: [
.library(
name: "AMSMB2",
type: .dynamic,
targets: ["AMSMB2"]
),
],
dependencies: [
.package(url: "https://github.com/apple/swift-atomics.git", .upToNextMajor(from: "1.2.0")),
],
targets: [
.target(
name: "libsmb2",
path: "Dependencies/libsmb2",
exclude: [
"lib/CMakeLists.txt",
"lib/libsmb2.syms",
"lib/Makefile.am",
"lib/Makefile.DC_KOS",
"lib/Makefile.PS2_EE",
"lib/Makefile.PS2_IOP",
"lib/Makefile.PS3_PPU",
"lib/Makefile.PS4",
],
sources: [
"lib",
],
publicHeadersPath: ".",
cSettings: [
.headerSearchPath("include"),
.headerSearchPath("include/apple"),
.headerSearchPath("include/smb2"),
.headerSearchPath("lib"),
.define("_U_", to: "__attribute__((unused))"),
.define("HAVE_CONFIG_H", to: "1"),
.unsafeFlags([
"-Wno-everything",
]),
],
linkerSettings: [
]
),
.target(
name: "AMSMB2",
dependencies: [
"libsmb2",
],
path: "AMSMB2"
),
.testTarget(
name: "AMSMB2Tests",
dependencies: [
"AMSMB2",
.product(name: "Atomics", package: "swift-atomics"),
],
path: "AMSMB2Tests"
),
],
swiftLanguageVersions: [.v5]
)

for target in package.targets {
var swiftSettings: [SwiftSetting] = [
.enableExperimentalFeature("StrictConcurrency=complete"),
]
#if swift(>=5.9)
swiftSettings.append(.enableUpcomingFeature("ExistentialAny"))
#endif
target.swiftSettings = swiftSettings
}

0 comments on commit 2ec853d

Please sign in to comment.