Skip to content

Commit

Permalink
Introduce static features
Browse files Browse the repository at this point in the history
  • Loading branch information
musicinmybrain committed Sep 13, 2024
1 parent e897ccd commit 016f73d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ lz4-sys = { path = "lz4-sys", version = "1.11.0" }

[dev-dependencies]
rand = ">=0.7, <=0.8"

[features]
# Enable this feature if you want to have a statically linked liblz4
static = ["lz4-sys/static"]
4 changes: 4 additions & 0 deletions lz4-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ libc = "0.2"
[build-dependencies]
cc = "1.1"
pkg-config = "0.3.9"

[features]
# Enable this feature if you want to have a statically linked liblz4
static = []
1 change: 1 addition & 0 deletions lz4-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fn run() -> Result<(), Box<dyn Error>> {
let target = get_from_env("TARGET")?;

if !target.contains("windows")
&& !cfg!(feature = "static")
&& pkg_config::Config::new()
.cargo_metadata(true)
.probe("liblz4")
Expand Down

0 comments on commit 016f73d

Please sign in to comment.