diff options
author | 第二扩展 <125450956+secext2022@users.noreply.github.com> | 2023-09-18 00:06:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-17 16:06:51 +0000 |
commit | 23bf05cff265c11927b853003dab6c74b4712ec8 (patch) | |
tree | 475f456c5669633a12d12ee799c460a60d115105 /cli/build.rs | |
parent | 4960b6659c9cf305ae3578957e4d45419626c9b9 (diff) |
build: add an environment variable to skip cross build check (#20281) (#20533)
Diffstat (limited to 'cli/build.rs')
-rw-r--r-- | cli/build.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/build.rs b/cli/build.rs index c8fca543e..b1377485b 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."); } |