Skip to content

Commit

Permalink
allow compilation with the static linux sdk (musl) (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebsto authored Jun 26, 2024
1 parent 0d4716d commit 872183b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ let package = Package(
.library(name: "AWSLambdaTesting", targets: ["AWSLambdaTesting"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.43.1")),
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.4.2")),
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.67.0")),
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.5.4")),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
],
targets: [
Expand Down
10 changes: 9 additions & 1 deletion Plugins/AWSLambdaPackager/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,16 @@ import Dispatch
import Foundation
import PackagePlugin

#if canImport(Glibc)
#if os(macOS)
import Darwin
#elseif canImport(Glibc)
import Glibc
#elseif canImport(Musl)
import Musl
#elseif os(Windows)
import ucrt
#else
#error("Unsupported platform")
#endif

@main
Expand Down
10 changes: 8 additions & 2 deletions Sources/AWSLambdaRuntimeCore/Lambda.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@
//
//===----------------------------------------------------------------------===//

#if os(Linux)
#if os(macOS)
import Darwin.C
#elseif canImport(Glibc)
import Glibc
#elseif canImport(Musl)
import Musl
#elseif os(Windows)
import ucrt
#else
import Darwin.C
#error("Unsupported platform")
#endif

#if swift(<5.9)
Expand Down

0 comments on commit 872183b

Please sign in to comment.