From 28a076091e80b79395a7e8b43e0c7aa859963b14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge=20He=C3=9F?= Date: Thu, 22 Aug 2024 14:26:27 +0200 Subject: [PATCH] Add Swift 6 Package.swift Because. OK. --- Package@swift-6.swift | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/Package@swift-6.swift b/Package@swift-6.swift index bd45154..03d665f 100644 --- a/Package@swift-6.swift +++ b/Package@swift-6.swift @@ -2,10 +2,18 @@ import PackageDescription +#if swift(>=5.10) +let settings = [ SwiftSetting.enableExperimentalFeature("StrictConcurrency") ] +#else +let settings = [ SwiftSetting ]() +#endif + var package = Package( name: "Lighter", - platforms: [ .macOS(.v10_15), .iOS(.v13) ], + platforms: [ + .macOS(.v10_15), .iOS(.v13), .visionOS(.v1), .watchOS(.v7), .tvOS(.v12) + ], products: [ .library(name: "Lighter", targets: [ "Lighter" ]), @@ -19,14 +27,32 @@ var package = Package( ], targets: [ + .systemLibrary(name: "SQLite3", + path: "Sources/SQLite3-Linux", + providers: [ .apt(["libsqlite3-dev"]) ]), + // A small library used to fetch schema information from SQLite3 databases. - .target(name: "SQLite3Schema", exclude: [ "README.md" ]), + .target(name: "SQLite3Schema", + dependencies: [ + .target(name: "SQLite3", + condition: .when(platforms: [ + .linux, .android, .windows, .openbsd + ])), + ], + exclude: [ "README.md" ]), // Lighter is a shared lib providing common protocols used by Enlighter // generated models and such. // Note that Lighter isn't that useful w/o code generation (i.e. as a // standalone lib). - .target(name: "Lighter"), + .target(name: "Lighter", + dependencies: [ + .target(name: "SQLite3", + condition: .when(platforms: [ + .linux, .android, .windows, .openbsd + ])), + ], + swiftSettings: settings), // MARK: - Plugin Support @@ -35,14 +61,15 @@ var package = Package( // Swift source code. .target(name : "LighterCodeGenAST", path : "Plugins/Libraries/LighterCodeGenAST", - exclude : [ "README.md" ]), + exclude : [ "README.md" ], swiftSettings: settings), // This library contains all the code generation, to be used by different // clients. .target(name : "LighterGeneration", dependencies : [ "LighterCodeGenAST", "SQLite3Schema" ], path : "Plugins/Libraries/LighterGeneration", - exclude : [ "README.md", "LighterConfiguration/README.md" ]), + exclude : [ "README.md", "LighterConfiguration/README.md" ], + swiftSettings: settings), // MARK: - Tests @@ -113,7 +140,5 @@ var package = Package( dependencies: [ "LighterGeneration" ]), .testTarget(name: "NorthwindTests", dependencies: [ "LighterGeneration" ]) - ], - - swiftLanguageVersions: [ .v5, .v6 ] + ] )