From 0cd1ba0f9232933f8b1a61e65bfae1b45a934ebe Mon Sep 17 00:00:00 2001 From: Mx-Iris Date: Mon, 22 Jun 2026 22:40:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20sync=20LookinCore=20mirror=20=E2=80=94?= =?UTF-8?q?=20Swift=20optimization=20report=20on=20SwiftPM=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirror of the canonical LookInside-Server fix: report `swiftEnabledInLookinServer = 1` when `SPM_LOOKIN_SERVER_ENABLED` is defined, so the host no longer shows a false-positive "turn on Swift optimization" notification for SwiftPM/CocoaPods consumers (which always ship the Swift-aware server binary). --- Sources/LookinCore/LookinAppInfo.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/LookinCore/LookinAppInfo.m b/Sources/LookinCore/LookinAppInfo.m index cc41588..0ff75c9 100644 --- a/Sources/LookinCore/LookinAppInfo.m +++ b/Sources/LookinCore/LookinAppInfo.m @@ -142,7 +142,13 @@ + (LookinAppInfo *)currentInfoWithScreenshot:(BOOL)hasScreenshot icon:(BOOL)hasI LookinAppInfo *info = [[LookinAppInfo alloc] init]; info.serverReadableVersion = LOOKIN_SERVER_READABLE_VERSION; -#ifdef LOOKIN_SERVER_SWIFT_ENABLED +// Report Swift optimization as enabled whenever the Swift-aware build is +// compiled in. The CocoaPods subspec path defines LOOKIN_SERVER_SWIFT_ENABLED; +// the SwiftPM / XCFramework path defines SPM_LOOKIN_SERVER_ENABLED (which in +// turn imports LookinServerSwift and activates LOOKIN_SERVER_SWIFT_ENABLED_SUCCESSFULLY +// in LKS_TraceManager). Both imply the optimization is active, matching the +// contract documented on -swiftEnabledInLookinServer ("SPM 或 Swift Subspec → 1"). +#if defined(LOOKIN_SERVER_SWIFT_ENABLED) || defined(SPM_LOOKIN_SERVER_ENABLED) info.swiftEnabledInLookinServer = 1; #else info.swiftEnabledInLookinServer = -1;