From 23bf05cff265c11927b853003dab6c74b4712ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=89=A9=E5=B1=95?= <125450956+secext2022@users.noreply.github.com> Date: Mon, 18 Sep 2023 00:06:51 +0800 Subject: [PATCH] build: add an environment variable to skip cross build check (#20281) (#20533) --- cli/build.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/build.rs b/cli/build.rs index c8fca543eaf8b5..b1377485b15816 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -437,7 +437,9 @@ fn main() { // Host snapshots won't work when cross compiling. let target = env::var("TARGET").unwrap(); let host = env::var("HOST").unwrap(); - if target != host { + let skip_cross_check = + env::var("DENO_SKIP_CROSS_BUILD_CHECK").map_or(false, |v| v == "1"); + if !skip_cross_check && target != host { panic!("Cross compiling with snapshot is not supported."); }