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

fix building in the presence of depot_tools (#757)

This commit is contained in:
devsnek 2021-08-21 10:21:08 -05:00 committed by GitHub
parent cb07d4f914
commit ab04be75f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -316,9 +316,18 @@ fn print_link_flags() {
} }
} }
// Chromium depot_tools contains helpers
// which delegate to the "relevant" `buildtools`
// directory when invoked, so they don't count.
fn not_in_depot_tools(p: PathBuf) -> bool {
!p.as_path().to_str().unwrap().contains("depot_tools")
}
fn need_gn_ninja_download() -> bool { fn need_gn_ninja_download() -> bool {
let has_ninja = which("ninja").is_ok() || env::var_os("NINJA").is_some(); let has_ninja = which("ninja").map_or(false, not_in_depot_tools)
let has_gn = which("gn").is_ok() || env::var_os("GN").is_some(); || env::var_os("NINJA").is_some();
let has_gn = which("gn").map_or(false, not_in_depot_tools)
|| env::var_os("GN").is_some();
!has_ninja || !has_gn !has_ninja || !has_gn
} }