Skip to content

Commit

Permalink
Add Swift 6 Package.swift
Browse files Browse the repository at this point in the history
Because. OK.
  • Loading branch information
helje5 committed Aug 22, 2024
1 parent 3ef2f36 commit 28a0760
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]),
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -113,7 +140,5 @@ var package = Package(
dependencies: [ "LighterGeneration" ]),
.testTarget(name: "NorthwindTests",
dependencies: [ "LighterGeneration" ])
],

swiftLanguageVersions: [ .v5, .v6 ]
]
)

0 comments on commit 28a0760

Please sign in to comment.