Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ var products: [Product] = [
]

var targets: [Target] = [
// Thin C wrapper exposing system zlib to Swift.
// zlib is present on macOS (SDK) and Linux (Swift toolchain dependency).
// Thin C wrapper exposing system zlib to Swift. The dependency below is gated to the
// platforms we build for and know ship zlib (macOS SDK, Linux toolchain). A platform
// condition is evaluated against the build *destination*, so this stays correct under
// cross-compilation — unlike a manifest `#if os(...)`, which keys off the host. On
// any other destination (Windows, wasm) CZlib drops out of the graph and the
// `#if canImport(CZlib)`-guarded MCCP compression compiles out.
.target(
name: "CZlib",
path: "Sources/CZlib",
Expand All @@ -20,7 +24,7 @@ var targets: [Target] = [
.target(
name: "MTHCore",
dependencies: [
"CZlib",
.target(name: "CZlib", condition: .when(platforms: [.macOS, .linux])),
],
path: "Sources/SwiftMTHCore"
),
Expand Down
Loading