From f5376e98c2c94ea03d7a15cf6b0b5cce6f968dd3 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Mon, 29 Aug 2022 15:53:16 -0300 Subject: [PATCH] Lower minimum version for swift binary CMake apparently doesn't do anything with CMAKE_OSX_DEPLOYMENT_TARGET for swift, which results in a 12+ minimum version. This fixes it (albeit in a hacky way since the only apple-sanctioned way to properly set this appears to be "use xcode"). Shame on Apple, as usual. --- daemon/CMakeLists.txt | 1 + daemon/lokinet.swift | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 1701d4fb4..db864b57e 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -2,6 +2,7 @@ set(exetargets lokinet) if(APPLE) add_executable(lokinet lokinet.swift) + target_compile_options(lokinet BEFORE PRIVATE -target x86_64-apple-macos${CMAKE_OSX_DEPLOYMENT_TARGET}) else() add_executable(lokinet lokinet.cpp) endif() diff --git a/daemon/lokinet.swift b/daemon/lokinet.swift index 9e3c67f35..da946e1d6 100644 --- a/daemon/lokinet.swift +++ b/daemon/lokinet.swift @@ -87,7 +87,9 @@ class LokinetMain: NSObject, NSApplicationDelegate { providerProtocol.serverAddress = "loki.loki" // Needs to be set to some non-null dummy value providerProtocol.username = "anonymous" providerProtocol.providerBundleIdentifier = self.netextBundleId - providerProtocol.enforceRoutes = true + if #available(macOS 11, *) { + providerProtocol.enforceRoutes = true + } // macos seems to have trouble when this is true, and reports are that this breaks and // doesn't do what it says on the tin in the first place. Needs more testing. providerProtocol.includeAllNetworks = false