From 98dde15c2f3e61825a73da1172019a37509af81d Mon Sep 17 00:00:00 2001 From: Seivan Date: Wed, 31 May 2023 15:30:41 +0200 Subject: [PATCH] Update README.md Fix SwiftPM example. --- README.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c3e4acb2a..35f47307f 100644 --- a/README.md +++ b/README.md @@ -61,23 +61,29 @@ will call. To get started, the simplest thing to do is to create a Swift Library Package that references the Swift Godot package, like this: -``` +```swift +// swift-tools-version: 5.8 +import PackageDescription + let package = Package( name: "MyFirstGame", products: [ - .library (name; "MyFirstGame", type: .dynamic, targets: ["MyFirstGame"]), + .library(name: "MyFirstGame", type: .dynamic, targets: ["MyFirstGame"]), ], dependencies: [ - .package (url: "https://github.com/migueldeicaza/SwiftGodot") + .package(url: "https://github.com/migueldeicaza/SwiftGodot", branch: "main") ], targets: [ - .target ( + .target( name: "MyFirstGame", dependencies: ["SwiftGodot"], - swiftSettings: [.unsafeFlags (["-suppress-warnings"])], - linkerSettings: [.unsafeFlags ( + swiftSettings: [.unsafeFlags(["-suppress-warnings"])], + linkerSettings: [.unsafeFlags( ["-Xlinker", "-undefined", - "-Xlinker", "dynamic_lookup")]]) + "-Xlinker", "dynamic_lookup"] + )] + ) + ] ) ```