4 println!("cargo:rerun-if-changed=build.rs");
5 println!("cargo:rerun-if-env-changed=CARGO_CFG_MIRI");
7 if env::var_os("CARGO_CFG_MIRI").is_some() {
8 // Miri doesn't need the linker flags or a libunwind build.
12 let target = env::var("TARGET").expect("TARGET was not set");
13 if target.contains("android") {
14 let build = cc::Build::new();
16 // Since ndk r23 beta 3 `libgcc` was replaced with `libunwind` thus
17 // check if we have `libunwind` available and if so use it. Otherwise
18 // fall back to `libgcc` to support older ndk versions.
19 let has_unwind = build.is_flag_supported("-lunwind").expect("Unable to invoke compiler");
22 println!("cargo:rustc-cfg=feature=\"system-llvm-libunwind\"");