Remove num_cpus dependency
available_parallelism is stable in Rust 1.59.0
This commit is contained in:
parent
52a07ed0c6
commit
2d8dd6c0a5
@ -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"] }
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user