Skip to content

Commit 7fa9ab9

Browse files
committed
feat: accept target-suffixed RUSTY_V8_ARCHIVE
1 parent 31e543f commit 7fa9ab9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

build.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ fn main() {
2727
// probably more than what is needed, but missing an important
2828
// variable can lead to broken links when switching rusty_v8
2929
// versions.
30+
let target = env::var("TARGET").unwrap().replace("-", "_");
31+
let rusty_v8_archive_target = format!("RUSTY_V8_ARCHIVE_{target}");
3032
let envs = vec![
3133
"CCACHE",
3234
"CLANG_BASE_PATH",
@@ -39,6 +41,7 @@ fn main() {
3941
"NINJA",
4042
"OUT_DIR",
4143
"RUSTY_V8_ARCHIVE",
44+
rusty_v8_archive_target.as_str(),
4245
"RUSTY_V8_MIRROR",
4346
"RUSTY_V8_SRC_BINDING_PATH",
4447
"SCCACHE",
@@ -547,6 +550,11 @@ fn static_lib_name(suffix: &str) -> String {
547550
}
548551

549552
fn static_lib_url() -> String {
553+
let target = env::var("TARGET").unwrap();
554+
let rusty_v8_archive_target = format!("RUSTY_V8_ARCHIVE_{target}");
555+
if let Ok(custom_archive) = env::var(rusty_v8_archive_target) {
556+
return custom_archive;
557+
}
550558
if let Ok(custom_archive) = env::var("RUSTY_V8_ARCHIVE") {
551559
return custom_archive;
552560
}

0 commit comments

Comments
 (0)