Replace compile-time directives with target platform conditions (#143)
* Replace compile-time directives with target platform conditions Use Package.swift target platform conditions instead of compile-time #if directives for EventSource dependency. This leverages Swift Package Manager's native dependency support for platform-specific targets at runtime rather than compile-time. * Update reference for EventSource package --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Mattt <mattt@me.com>
This commit is contained in:
parent
e2afccdcaa
commit
778ab33d23
1 changed files with 2 additions and 7 deletions
|
|
@ -7,21 +7,16 @@ import PackageDescription
|
|||
var dependencies: [Package.Dependency] = [
|
||||
.package(url: "https://github.com/apple/swift-system.git", from: "1.0.0"),
|
||||
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.0"),
|
||||
.package(url: "https://github.com/mattt/eventsource.git", from: "1.1.0")
|
||||
]
|
||||
|
||||
// Target dependencies needed on all platforms
|
||||
var targetDependencies: [Target.Dependency] = [
|
||||
.product(name: "SystemPackage", package: "swift-system"),
|
||||
.product(name: "Logging", package: "swift-log"),
|
||||
.product(name: "EventSource", package: "eventsource", condition: .when(platforms: [.macOS, .iOS, .tvOS, .visionOS, .watchOS]))
|
||||
]
|
||||
|
||||
// Add EventSource only on Apple platforms (non-Linux)
|
||||
#if !os(Linux)
|
||||
dependencies.append(
|
||||
.package(url: "https://github.com/loopwork-ai/eventsource.git", from: "1.1.0"))
|
||||
targetDependencies.append(.product(name: "EventSource", package: "eventsource"))
|
||||
#endif
|
||||
|
||||
let package = Package(
|
||||
name: "mcp-swift-sdk",
|
||||
platforms: [
|
||||
|
|
|
|||
Loading…
Reference in a new issue