mirror of
https://github.com/encounter/rust-ffmpeg-zmwangx.git
synced 2026-07-10 21:18:40 -07:00
build: multi-cpu build support
This commit is contained in:
committed by
Till Höppner
parent
0c8c674bac
commit
fc15cf5926
@@ -14,6 +14,9 @@ keywords = ["audio", "video"]
|
||||
[dependencies]
|
||||
libc = "0.2"
|
||||
|
||||
[build-dependencies]
|
||||
num_cpus = "0.2.11"
|
||||
|
||||
[features]
|
||||
default = ["avcodec", "avdevice", "avfilter", "avformat", "avresample", "swresample", "swscale"]
|
||||
|
||||
|
||||
+5
-1
@@ -1,3 +1,5 @@
|
||||
extern crate num_cpus;
|
||||
|
||||
use std::env;
|
||||
use std::fs::{self, File};
|
||||
use std::io::{self, Write};
|
||||
@@ -207,7 +209,9 @@ fn build() -> io::Result<()> {
|
||||
}
|
||||
|
||||
// run make
|
||||
if !try!(Command::new("make").current_dir(&source()).status()).success() {
|
||||
if !try!(Command::new("make")
|
||||
.arg("-j").arg(num_cpus::get().to_string())
|
||||
.current_dir(&source()).status()).success() {
|
||||
return Err(io::Error::new(io::ErrorKind::Other, "make failed"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user