0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-11-21 15:04:33 -05:00

Prevent gn/ninja downloading if already downloaded (#41)

This commit is contained in:
Ry Dahl 2019-12-05 17:03:33 -05:00 committed by GitHub
parent 1835207186
commit 0219eece69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -81,24 +81,25 @@ fn platform() -> &'static str {
fn download_gn_ninja_binaries() {
let root = env::current_dir().unwrap();
let out_dir = root.join(env::var_os("OUT_DIR").unwrap());
let status = Command::new("python")
.arg("./tools/gn_ninja_binaries.py")
.arg("--dir")
.arg(&out_dir)
.status()
.expect("gn_ninja_binaries.py download failed");
assert!(status.success());
let d = out_dir.join("gn_ninja_binaries").join(platform());
let gn = d.join("gn");
let ninja = d.join("ninja");
#[cfg(windows)]
let gn = gn.with_extension("exe");
#[cfg(windows)]
let ninja = ninja.with_extension("exe");
if !gn.exists() || !ninja.exists() {
let status = Command::new("python")
.arg("./tools/gn_ninja_binaries.py")
.arg("--dir")
.arg(&out_dir)
.status()
.expect("gn_ninja_binaries.py download failed");
assert!(status.success());
}
assert!(gn.exists());
assert!(ninja.exists());
env::set_var("GN", gn);
env::set_var("NINJA", ninja);
}