mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-11-21 20:28:58 +00:00
Default to linking against release v8 builds (#783)
Unless $V8_FORCE_DEBUG=true to speedup CI for main deno repo
This commit is contained in:
parent
b6537573c4
commit
0bd141c78d
@ -42,6 +42,13 @@ from github to get the static lib. To disable this build using the
|
||||
When making changes to rusty_v8 itself, it should be tested by build from
|
||||
source. The CI always builds from source.
|
||||
|
||||
## The `V8_FORCE_DEBUG` environment variable
|
||||
|
||||
By default `rusty_v8` will link against release builds of `v8`, if you want to
|
||||
use a debug build of `v8` set `V8_FORCE_DEBUG=true`.
|
||||
|
||||
We default to release builds of `v8` due to performance & CI reasons in `deno`.
|
||||
|
||||
## The `RUSTY_V8_MIRROR` environment variable
|
||||
|
||||
Tells the build script where to get binary builds from. Understands
|
||||
|
22
build.rs
22
build.rs
@ -206,14 +206,24 @@ fn static_lib_url() -> String {
|
||||
env::var("RUSTY_V8_MIRROR").unwrap_or_else(|_| default_base.into());
|
||||
let version = env::var("CARGO_PKG_VERSION").unwrap();
|
||||
let target = env::var("TARGET").unwrap();
|
||||
|
||||
// Note: we always use the release build on windows.
|
||||
if cfg!(target_os = "windows") {
|
||||
// Note: we always use the release build on windows.
|
||||
format!("{}/v{}/rusty_v8_release_{}.lib", base, version, target)
|
||||
} else {
|
||||
let profile = env::var("PROFILE").unwrap();
|
||||
assert!(profile == "release" || profile == "debug");
|
||||
format!("{}/v{}/librusty_v8_{}_{}.a", base, version, profile, target)
|
||||
return format!("{}/v{}/rusty_v8_release_{}.lib", base, version, target);
|
||||
}
|
||||
// Use v8 in release mode unless $V8_FORCE_DEBUG=true
|
||||
let profile = match env_bool("V8_FORCE_DEBUG") {
|
||||
true => "debug",
|
||||
_ => "release",
|
||||
};
|
||||
format!("{}/v{}/librusty_v8_{}_{}.a", base, version, profile, target)
|
||||
}
|
||||
|
||||
fn env_bool(key: &str) -> bool {
|
||||
matches!(
|
||||
env::var(key).unwrap_or_default().as_str(),
|
||||
"true" | "1" | "yes"
|
||||
)
|
||||
}
|
||||
|
||||
fn static_lib_name() -> &'static str {
|
||||
|
Loading…
Reference in New Issue
Block a user