mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-12-25 00:29:14 -05:00
Improve ninja/gn detection (#558)
This should allow people to build without explicitly setting GN and NINJA env vars. If the tool(s) are detected, the build will continue without trying to download the binaries.
This commit is contained in:
parent
e057d096fd
commit
810c108170
2 changed files with 14 additions and 11 deletions
19
README.md
19
README.md
|
@ -91,15 +91,16 @@ install them.
|
|||
For Windows builds: the 64-bit toolchain needs to be used. 32-bit targets are
|
||||
not supported.
|
||||
|
||||
The build depends on several binary tools: `gn`, `ninja` and a recent version
|
||||
of `clang` (V8 relies on bleeding edge features). Because these are not
|
||||
generally available they are automatically downloaded during the build by default.
|
||||
It should be possible to opt out of the gn and ninja download by specifying the
|
||||
`$GN` and `$NINJA` environmental variables. The clang download can be skipped by
|
||||
providing a `$CLANG_BASE_PATH` environmental variable pointing to a recent
|
||||
`llvm`/`clang` installation (currently LLVM v8.0+ or Apple clang v11.0+).
|
||||
You could also pass in additional arguments to `gn` by setting the `$GN_ARGS`
|
||||
environmental variable.
|
||||
The build depends on several binary tools: `gn`, `ninja` and `clang`. The
|
||||
tools will automatically be downloaded, if they are not detected in the environment.
|
||||
|
||||
Specifying the `$GN` and `$NINJA` environmental variables can be used to skip
|
||||
the download of gn and ninja. The clang download can be skipped by setting
|
||||
`$CLANG_BASE_PATH` to the directory containing a `llvm`/`clang` installation.
|
||||
V8 is known to rely on bleeding edge features, so LLVM v8.0+ or Apple clang 11.0+
|
||||
is recommended.
|
||||
|
||||
Arguments can be passed to `gn` by setting the `$GN_ARGS` environmental variable.
|
||||
|
||||
Env vars used in when building from source: `SCCACHE`, `CCACHE`, `GN`, `NINJA`,
|
||||
`CLANG_BASE_PATH`, `GN_ARGS`
|
||||
|
|
6
build.rs
6
build.rs
|
@ -287,8 +287,10 @@ fn print_link_flags() {
|
|||
}
|
||||
|
||||
fn need_gn_ninja_download() -> bool {
|
||||
!((which("ninja").is_ok() || env::var_os("NINJA").is_some())
|
||||
&& env::var_os("GN").is_some())
|
||||
let has_ninja = which("ninja").is_ok() || env::var_os("NINJA").is_some();
|
||||
let has_gn = which("gn").is_ok() || env::var_os("GN").is_some();
|
||||
|
||||
return !has_ninja || !has_gn;
|
||||
}
|
||||
|
||||
// Chromiums gn arg clang_base_path is currently compatible with:
|
||||
|
|
Loading…
Reference in a new issue