Skip to content

Commit 282780e

Browse files
committed
Add flag to depend on zlib via pkg-config
1 parent a34b3bd commit 282780e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

zlib.cabal

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ flag non-blocking-ffi
4545
prevents other Haskell threads running. Enabling this flag
4646
avoids this unfairness, but with greater overall cost.
4747

48+
flag use-pkg-config
49+
default: False
50+
manual: True
51+
description: Use pkg-config to find foreign zlib.
52+
4853
library
4954
exposed-modules: Codec.Compression.GZip,
5055
Codec.Compression.Zlib,
@@ -70,7 +75,10 @@ library
7075
cpp-options: -DNON_BLOCKING_FFI
7176
if !os(windows)
7277
-- Normally we use the the standard system zlib:
73-
extra-libraries: z
78+
if !flag(use-pkg-config)
79+
extra-libraries: z
80+
else
81+
pkgconfig-depends: zlib
7482
else
7583
-- However for the benefit of users of Windows (which does not have zlib
7684
-- by default) we bundle a complete copy of the C sources of zlib-1.2.8

0 commit comments

Comments
 (0)