From 2ec853d3a735c51706fa96f8347246d15ccbc2a8 Mon Sep 17 00:00:00 2001 From: Amir Abbas Mousavian Date: Tue, 28 Nov 2023 16:59:18 +0330 Subject: [PATCH] fix: Swift build tool compiling error --- Package.swift | 8 +--- Package@swift-5.8.swift | 82 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 Package@swift-5.8.swift diff --git a/Package.swift b/Package.swift index 9c3d42d..31b5986 100644 --- a/Package.swift +++ b/Package.swift @@ -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", diff --git a/Package@swift-5.8.swift b/Package@swift-5.8.swift new file mode 100644 index 0000000..21532f6 --- /dev/null +++ b/Package@swift-5.8.swift @@ -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 +}