Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ edition = "2021"
opt-level = 2

[build-dependencies]
cc = "1.1"
glob = "0.3.1"
cc = "1"
glob = "0.3"
pkg-config = "0.3.27"

[features]
default = ["std", "parallel"]
Expand All @@ -32,3 +33,4 @@ parallel = ["cc/parallel"]
neon = [] # ARM NEON SIMD (will crash on ARM CPUs without it)
sse41 = [] # x64 SSE 4.1 (will crash on x86 CPUs without it)
avx2 = [] # x64 AVX2 (will crash on x86 CPUs without it)
system-dylib = [] # Use the system-installed dylib instead of compiling a static library from the vendor
13 changes: 10 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
extern crate cc;
extern crate glob;

use std::env;
use std::path::PathBuf;

fn main() {
if cfg!(feature = "system-link") {
let lib_name = "libwebp";
let find_system_lib = pkg_config::Config::new().probe(lib_name).is_ok();

if find_system_lib {
println!("cargo:rustc-link-lib={}", lib_name);
return;
}
}

let manifest_dir =
PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR"));
let vendor = manifest_dir.join("vendor");
Expand Down
Loading