diff --git a/ffmpeg-sys-the-third/Cargo.toml b/ffmpeg-sys-the-third/Cargo.toml index 49918ff..a184362 100644 --- a/ffmpeg-sys-the-third/Cargo.toml +++ b/ffmpeg-sys-the-third/Cargo.toml @@ -24,7 +24,6 @@ doctest = false libc = "0.2" [build-dependencies] -num_cpus = "1.11" cc = "1.0" pkg-config = "0.3" bindgen = { version = "0.64", default-features = false, features = ["runtime"] } diff --git a/ffmpeg-sys-the-third/build.rs b/ffmpeg-sys-the-third/build.rs index 7e43063..f84acde 100644 --- a/ffmpeg-sys-the-third/build.rs +++ b/ffmpeg-sys-the-third/build.rs @@ -1,6 +1,5 @@ extern crate bindgen; extern crate cc; -extern crate num_cpus; extern crate pkg_config; use std::env; @@ -465,10 +464,15 @@ fn build() -> io::Result<()> { )); } + let num_jobs = if let Ok(cpus) = std::thread::available_parallelism() { + cpus.to_string() + } else { + "1".to_string() + }; + // run make if !Command::new("make") - .arg("-j") - .arg(num_cpus::get().to_string()) + .arg(format!("-j{num_jobs}")) .current_dir(&source()) .status()? .success()