Add support for tvOS
Include tvOS condition where iOS applies. Signed-off-by: Davide De Rosa <keeshux@gmail.com>
This commit is contained in:
parent
73d9152fa0
commit
b79f0f1503
|
@ -1,4 +1,4 @@
|
|||
// swift-tools-version:5.5
|
||||
// swift-tools-version:5.9
|
||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||
|
||||
import PackageDescription
|
||||
|
@ -7,7 +7,8 @@ let package = Package(
|
|||
name: "WireGuardKit",
|
||||
platforms: [
|
||||
.macOS(.v12),
|
||||
.iOS(.v15)
|
||||
.iOS(.v15),
|
||||
.tvOS(.v17)
|
||||
],
|
||||
products: [
|
||||
.library(name: "WireGuardKit", targets: ["WireGuardKit"])
|
||||
|
|
|
@ -92,7 +92,7 @@ extension DNSResolver {
|
|||
|
||||
extension Endpoint {
|
||||
func withReresolvedIP() throws -> Endpoint {
|
||||
#if os(iOS)
|
||||
#if os(iOS) || os(tvOS)
|
||||
let hostname: String
|
||||
switch host {
|
||||
case .name(let name, _):
|
||||
|
|
|
@ -116,7 +116,7 @@ class PacketTunnelSettingsGenerator {
|
|||
* add a nob, maybe, or iOS will do probing for us.
|
||||
*/
|
||||
if mtu == 0 {
|
||||
#if os(iOS)
|
||||
#if os(iOS) || os(tvOS)
|
||||
networkSettings.mtu = NSNumber(value: 1280)
|
||||
#elseif os(macOS)
|
||||
networkSettings.tunnelOverheadBytes = 80
|
||||
|
|
|
@ -420,7 +420,7 @@ public class WireGuardAdapter {
|
|||
if case .started(let handle, _) = self.state {
|
||||
wgBumpSockets(handle)
|
||||
}
|
||||
#elseif os(iOS)
|
||||
#elseif os(iOS) || os(tvOS)
|
||||
switch self.state {
|
||||
case .started(let handle, let settingsGenerator):
|
||||
if path.status.isSatisfiable {
|
||||
|
|
|
@ -24,6 +24,8 @@ GOARCH_x86_64 := amd64
|
|||
GOOS_macosx := $(if $(IS_CATALYST),ios,darwin)
|
||||
GOOS_iphoneos := ios
|
||||
GOOS_iphonesimulator := ios
|
||||
GOOS_appletvos := ios
|
||||
GOOS_appletvsimulator := ios
|
||||
|
||||
TARGET ?= $(if $(IS_CATALYST),-target arm64-apple-ios14.0-macabi,)
|
||||
|
||||
|
|
Loading…
Reference in New Issue