mirror of
https://github.com/denoland/deno.git
synced 2024-11-29 16:30:56 -05:00
cargo build: skip setup.py if possible
This commit is contained in:
parent
79db3cede2
commit
ec76fbccb8
1 changed files with 12 additions and 10 deletions
8
build.rs
8
build.rs
|
@ -20,9 +20,9 @@ fn main() {
|
|||
env::var("PROFILE").unwrap()
|
||||
};
|
||||
|
||||
let gn_out_dir = env::current_dir().unwrap();
|
||||
let gn_out_dir = gn_out_dir.join(format!("target/{}", gn_mode));
|
||||
let gn_out_dir = normalize_path(gn_out_dir);
|
||||
let cwd = env::current_dir().unwrap();
|
||||
let gn_out_path = cwd.join(format!("target/{}", gn_mode));
|
||||
let gn_out_dir = normalize_path(&gn_out_path);
|
||||
|
||||
// Tell Cargo when to re-run this file. We do this first, so these directives
|
||||
// can take effect even if something goes wrong later in the build process.
|
||||
|
@ -76,6 +76,7 @@ fn main() {
|
|||
}
|
||||
}
|
||||
|
||||
if !gn_out_path.join("build.ninja").exists() {
|
||||
let status = Command::new("python")
|
||||
.env("DENO_BUILD_PATH", &gn_out_dir)
|
||||
.env("DENO_BUILD_MODE", &gn_mode)
|
||||
|
@ -83,6 +84,7 @@ fn main() {
|
|||
.status()
|
||||
.expect("setup.py failed");
|
||||
assert!(status.success());
|
||||
}
|
||||
|
||||
let status = Command::new("python")
|
||||
.env("DENO_BUILD_PATH", &gn_out_dir)
|
||||
|
|
Loading…
Reference in a new issue