From bad592902060d359130e48b26334de2cb8d94c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Gonz=C3=A1lez?= Date: Sat, 13 Mar 2021 18:29:53 +0100 Subject: [PATCH] Allow using Cloudflare Zlib fork --- spng-sys/Cargo.toml | 6 +++++- spng/Cargo.toml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/spng-sys/Cargo.toml b/spng-sys/Cargo.toml index d61b780..1beb4bd 100644 --- a/spng-sys/Cargo.toml +++ b/spng-sys/Cargo.toml @@ -11,8 +11,12 @@ license = "MIT OR Apache-2.0" description = "Native bindings to libspng" [dependencies] -libz-sys = { version = "1.1.0", default-features = false, features = ["libc"] } +libz-sys = { version = "1.1.2", optional = true, default-features = false, features = ["libc"] } +cloudflare-zlib-sys = { version = "0.2.0", optional = true } libc = "0.2" [build-dependencies] cc = "1.0" + +[features] +default = ["libz-sys"] diff --git a/spng/Cargo.toml b/spng/Cargo.toml index 0105a85..3f809c8 100644 --- a/spng/Cargo.toml +++ b/spng/Cargo.toml @@ -11,6 +11,10 @@ description = "Rust bindings to libspng" readme = "../README.md" [dependencies] -spng-sys = { version = "0.1.0-alpha", path = "../spng-sys" } +spng-sys = { version = "0.1.0-alpha", path = "../spng-sys", default-features = false } bitflags = "1.0" libc = "0.2" + +[features] +default = ["spng-sys/libz-sys"] +cloudflare_zlib = ["spng-sys/cloudflare-zlib-sys"]