From 0f8d14b8da89f99fa29bc54d5c66604f4314e391 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 14 Aug 2022 09:31:03 -0400 Subject: [PATCH] unwind: don't build dependency when building for Miri --- unwind/build.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/unwind/build.rs b/unwind/build.rs index 126e41d1e..31af39025 100644 --- a/unwind/build.rs +++ b/unwind/build.rs @@ -2,8 +2,14 @@ use std::env; fn main() { println!("cargo:rerun-if-changed=build.rs"); - let target = env::var("TARGET").expect("TARGET was not set"); + println!("cargo:rerun-if-env-changed=CARGO_CFG_MIRI"); + + if env::var_os("CARGO_CFG_MIRI").is_some() { + // Miri doesn't need the linker flags or a libunwind build. + return; + } + let target = env::var("TARGET").expect("TARGET was not set"); if target.contains("android") { let build = cc::Build::new();