0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2025-01-21 13:31:38 -05:00

Don't build V8 if the rust language server is running (#193)

This commit is contained in:
Bert Belder 2020-01-05 19:52:23 +01:00
parent bddefbc2b2
commit 78f3577c06
No known key found for this signature in database
GPG key ID: 7A77887B2E2ED461

View file

@ -11,13 +11,22 @@ fn main() {
// Detect if trybuild tests are being compiled.
let is_trybuild = env::var_os("DENO_TRYBUILD").is_some();
// Don't build if "cargo doc" is being run. This is to support docs.rs.
// Don't build V8 if "cargo doc" is being run. This is to support docs.rs.
let is_cargo_doc = env::var_os("RUSTDOCFLAGS").is_some();
if !(is_trybuild || is_cargo_doc) {
// Don't build V8 if the rust language server (RLS) is running.
let is_rls = env::var_os("CARGO")
.map(PathBuf::from)
.as_ref()
.and_then(|p| p.file_stem())
.and_then(|f| f.to_str())
.map(|s| s.starts_with("rls"))
.unwrap_or(false);
if !(is_trybuild || is_cargo_doc | is_rls) {
build_v8()
}
if !is_cargo_doc {
if !(is_cargo_doc || is_rls) {
print_link_flags()
}
}