diff --git a/Cargo.toml b/Cargo.toml index d9edf373..1741de9f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ partial-io = "0.5" walkdir = "2.2" [features] -default = ["legacy", "arrays", "zdict_builder"] +default = ["legacy", "arrays", "zdict_builder", "bindgen-runtime"] bindgen = ["zstd-safe/bindgen"] debug = ["zstd-safe/debug"] @@ -49,6 +49,10 @@ zdict_builder = ["zstd-safe/zdict_builder"] fat-lto = ["zstd-safe/fat-lto"] thin-lto = ["zstd-safe/thin-lto"] +# bindgen non-addititive features +bindgen-runtime = ["zstd-sys/bindgen-runtime"] +bindgen-static = ["zstd-sys/bindgen-static"] + [[example]] name = "train" required-features = ["zdict_builder"] diff --git a/Readme.md b/Readme.md index 320889fb..a6799c4f 100644 --- a/Readme.md +++ b/Readme.md @@ -84,7 +84,7 @@ This library includes a pre-generated `bindings.rs` file. You can also generate new bindings at build-time, using the `bindgen` feature: ``` -cargo build --features bindgen +cargo build --features bindgen,bindgen-runtime ``` # TODO diff --git a/zstd-safe/Cargo.toml b/zstd-safe/Cargo.toml index 1843dc10..f98bca4c 100644 --- a/zstd-safe/Cargo.toml +++ b/zstd-safe/Cargo.toml @@ -41,5 +41,9 @@ seekable = ["zstd-sys/seekable"] fat-lto = ["zstd-sys/fat-lto"] thin-lto = ["zstd-sys/thin-lto"] +# bindgen non-addititive features +bindgen-runtime = ["zstd-sys/bindgen-runtime"] +bindgen-static = ["zstd-sys/bindgen-static"] + [lints.rust] non_upper_case_globals = "allow" diff --git a/zstd-safe/zstd-sys/Cargo.toml b/zstd-safe/zstd-sys/Cargo.toml index d5e41b8c..e7ea1901 100644 --- a/zstd-safe/zstd-sys/Cargo.toml +++ b/zstd-safe/zstd-sys/Cargo.toml @@ -55,7 +55,6 @@ doctest = false # Documentation is for C code, good luck testing that. optional = true version = "0.72" default-features = false -features = ["runtime"] [build-dependencies.pkg-config] version = "0.3.28" @@ -65,7 +64,7 @@ version = "1.0.45" features = ["parallel"] [features] -default = ["legacy", "zdict_builder", "bindgen"] +default = ["legacy", "zdict_builder", "bindgen", "bindgen-runtime"] debug = [] # Enable zstd debug logs experimental = [] # Expose experimental ZSTD API @@ -85,5 +84,9 @@ seekable = [] # Enable support of the seekable format fat-lto = [] # Enable fat-lto, will override thin-lto if specified thin-lto = [] # Enable thin-lto, will fallback to fat-lto if not supported +# bindgen non-addititive features +bindgen-runtime = ["bindgen/runtime"] +bindgen-static = ["bindgen/static"] + [lints.rust] non_upper_case_globals = "allow"