mirror of
https://github.com/encounter/rust-ffmpeg-zmwangx.git
synced 2026-07-10 21:18:40 -07:00
build: upgrade build deps and fix try! warnings
- upgrade num_cpus from 1.0 to 1.11 - upgrade regex from 0.2 to 1.3 - replace 3 instances of try! with ? in build.rs
This commit is contained in:
committed by
Till Höppner
parent
c79443e0be
commit
7369918a62
+3
-3
@@ -15,11 +15,11 @@ keywords = ["audio", "video"]
|
||||
libc = "0.2"
|
||||
|
||||
[build-dependencies]
|
||||
num_cpus = "1.0"
|
||||
cc = "1.0"
|
||||
num_cpus = "1.11"
|
||||
cc = "1.0"
|
||||
pkg-config = "0.3"
|
||||
bindgen = "0.51.1"
|
||||
regex = "0.2"
|
||||
regex = "1.3"
|
||||
|
||||
[features]
|
||||
default = ["avcodec", "avdevice", "avfilter", "avformat", "swresample", "swscale"]
|
||||
|
||||
+8
-12
@@ -117,16 +117,14 @@ fn search() -> PathBuf {
|
||||
}
|
||||
|
||||
fn fetch() -> io::Result<()> {
|
||||
let status = try!(
|
||||
Command::new("git")
|
||||
let status = Command::new("git")
|
||||
.current_dir(&output())
|
||||
.arg("clone")
|
||||
.arg("-b")
|
||||
.arg(format!("release/{}", version()))
|
||||
.arg("https://github.com/FFmpeg/FFmpeg")
|
||||
.arg(format!("ffmpeg-{}", version()))
|
||||
.status()
|
||||
);
|
||||
.status()?;
|
||||
|
||||
if status.success() {
|
||||
Ok(())
|
||||
@@ -281,24 +279,22 @@ fn build() -> io::Result<()> {
|
||||
}
|
||||
|
||||
// run make
|
||||
if !try!(
|
||||
Command::new("make")
|
||||
if !Command::new("make")
|
||||
.arg("-j")
|
||||
.arg(num_cpus::get().to_string())
|
||||
.current_dir(&source())
|
||||
.status()
|
||||
).success()
|
||||
.status()?
|
||||
.success()
|
||||
{
|
||||
return Err(io::Error::new(io::ErrorKind::Other, "make failed"));
|
||||
}
|
||||
|
||||
// run make install
|
||||
if !try!(
|
||||
Command::new("make")
|
||||
if !Command::new("make")
|
||||
.current_dir(&source())
|
||||
.arg("install")
|
||||
.status()
|
||||
).success()
|
||||
.status()?
|
||||
.success()
|
||||
{
|
||||
return Err(io::Error::new(io::ErrorKind::Other, "make install failed"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user