WireGuardKit: Add swift package scaffolding
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
This commit is contained in:
parent
737f847c0d
commit
57f66f16f8
|
@ -31,6 +31,10 @@ xcuserdata
|
||||||
*.hmap
|
*.hmap
|
||||||
*.ipa
|
*.ipa
|
||||||
|
|
||||||
|
# Swift Package Manager
|
||||||
|
.swiftpm
|
||||||
|
.build/
|
||||||
|
|
||||||
# Fastlane
|
# Fastlane
|
||||||
*.app.dSYM.zip
|
*.app.dSYM.zip
|
||||||
*.mobileprovision
|
*.mobileprovision
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
// swift-tools-version:5.3
|
||||||
|
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||||
|
|
||||||
|
import PackageDescription
|
||||||
|
|
||||||
|
let package = Package(
|
||||||
|
name: "WireGuardKit",
|
||||||
|
platforms: [
|
||||||
|
.macOS(.v10_14),
|
||||||
|
.iOS(.v12)
|
||||||
|
],
|
||||||
|
products: [
|
||||||
|
.library(name: "WireGuardKit", targets: ["WireGuardKit"])
|
||||||
|
],
|
||||||
|
dependencies: [],
|
||||||
|
targets: [
|
||||||
|
.target(
|
||||||
|
name: "WireGuardKit",
|
||||||
|
dependencies: ["libwg-go"],
|
||||||
|
path: "WireGuardKit/Sources/WireGuardKit"
|
||||||
|
),
|
||||||
|
.target(
|
||||||
|
name: "libwg-go",
|
||||||
|
dependencies: [],
|
||||||
|
path: "WireGuardKit/Sources/libwg-go",
|
||||||
|
linkerSettings: [.linkedLibrary("wg-go")]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
|
@ -0,0 +1,9 @@
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
// Copyright © 2018-2019 WireGuard LLC. All Rights Reserved.
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import libwg_go
|
||||||
|
|
||||||
|
public func getWireGuardVersion() -> String {
|
||||||
|
return String(cString: wgVersion()!)
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
// Empty
|
|
@ -0,0 +1 @@
|
||||||
|
#include "../../../../wireguard-go-bridge/wireguard.h"
|
|
@ -0,0 +1,5 @@
|
||||||
|
module libwg_go {
|
||||||
|
umbrella header "include/libwg_go.h"
|
||||||
|
link "wg-go"
|
||||||
|
export *
|
||||||
|
}
|
Loading…
Reference in New Issue