Skip to content

Commit 58e7cef

Browse files
committed
WIP no-std-check
- `cargo test --no-default-features --features=alloc` -> OK - `cargo +nightly-2022-10-22 no-std-check --no-default-features` -> FAIL
1 parent a97e448 commit 58e7cef

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Cargo.toml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ path = "./src/lib.rs"
3131

3232
[dependencies]
3333
bytemuck = { version = "1.7.0", features = ["extern_crate_alloc"] } # includes cast_vec
34-
byteorder = "1.3.2"
34+
byteorder = { version = "1.3.2", default-features = false }
3535
num-rational = { version = "0.4", default-features = false }
36-
num-traits = "0.2.0"
36+
num-traits = { version = "0.2", default-features = false }
3737
snafu = { version = "0.7", default-features = false }
38-
gif = { version = "0.12", optional = true }
38+
gif = { version = "0.12", optional = true, default-features = false }
3939
jpeg = { package = "jpeg-decoder", version = "0.3.0", default-features = false, optional = true }
4040
png = { version = "0.17.6", optional = true }
4141
scoped_threadpool = { version = "0.1", optional = true }
@@ -45,7 +45,9 @@ rgb = { version = "0.8.25", optional = true }
4545
mp4parse = { version = "0.12.0", optional = true }
4646
dav1d = { version = "0.6.0", optional = true }
4747
dcv-color-primitives = { version = "0.4.0", optional = true }
48-
color_quant = "1.1"
48+
# TODO(interstellar) no_std not supported on crate.io; need a fork/patch
49+
# NOTE: also an optional dependency of "gif"
50+
color_quant = { version = "1.1", git = "https://github.com/Interstellar-Network/color_quant.git", branch = "sgx-nostd-compat", default-features = false, optional = true }
4951
exr = { version = "1.5.0", optional = true }
5052
qoi = { version = "0.4", optional = true }
5153
libwebp = { package = "webp", version = "0.2.2", default-features = false, optional = true }
@@ -64,7 +66,7 @@ jpeg = { package = "jpeg-decoder", version = "0.3.0", default-features = false,
6466
# TODO: Add "avif" to this list while preparing for 0.24.0
6567
default = ["std", "gif", "jpeg", "ico", "png", "pnm", "tga", "tiff", "webp", "bmp", "hdr", "dxt", "dds", "farbfeld", "jpeg_rayon", "openexr", "qoi"]
6668

67-
std = ["snafu/std"]
69+
std = ["snafu/std", "num-traits/std", "byteorder/std", "gif/default", "color_quant/std"]
6870
ico = ["bmp", "png"]
6971
pnm = []
7072
tga = []
@@ -96,6 +98,8 @@ avif-decoder = ["mp4parse", "dcv-color-primitives", "dav1d"]
9698
# Requires rustc nightly for feature test.
9799
benchmarks = []
98100

101+
alloc = ["num-traits/libm", "color_quant/alloc"]
102+
99103
[[bench]]
100104
path = "benches/decode.rs"
101105
name = "decode"

0 commit comments

Comments
 (0)