Skip to content

Commit

Permalink
feat: support linuxbrew installed zlib headers
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <rui@chenrui.dev>
  • Loading branch information
chenrui333 committed Dec 17, 2024
1 parent e0f4117 commit 29f6253
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sources/Gzip/Data+Gzip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions Sources/system-zlib/include/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
}

0 comments on commit 29f6253

Please sign in to comment.