From 29f62534648e6334678b6d7b14c6f7e618715944 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Tue, 17 Dec 2024 11:59:49 -0500 Subject: [PATCH] feat: support linuxbrew installed zlib headers Signed-off-by: Rui Chen --- Sources/Gzip/Data+Gzip.swift | 8 +++++++- Sources/system-zlib/include/module.modulemap | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Sources/Gzip/Data+Gzip.swift b/Sources/Gzip/Data+Gzip.swift index 358ef38..4bd24fd 100644 --- a/Sources/Gzip/Data+Gzip.swift +++ b/Sources/Gzip/Data+Gzip.swift @@ -29,7 +29,13 @@ import struct Foundation.Data #if os(Linux) - import zlibLinux + #if canImport(zlibLinux) + import zlibLinux + #elseif canImport(zlibHomebrew) + import zlibHomebrew + #else + import zlib + #endif #else import zlib #endif diff --git a/Sources/system-zlib/include/module.modulemap b/Sources/system-zlib/include/module.modulemap index f1ac248..79d9afc 100644 --- a/Sources/system-zlib/include/module.modulemap +++ b/Sources/system-zlib/include/module.modulemap @@ -4,3 +4,10 @@ module zlibLinux [system] { link "z" export * } + +module zlibHomebrew [system] { + header "/home/linuxbrew/.linuxbrew/include/zlib.h" + header "/home/linuxbrew/.linuxbrew/include/zconf.h" + link "z" + export * +}