Don't build in-tree llvm-libunwind if system-llvm-libunwind is enable

This commit is contained in:
12101111 2021-01-09 02:23:02 +08:00
parent 26438b4738
commit 5de06800c7

View File

@ -4,6 +4,10 @@ fn main() {
println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=build.rs");
let target = env::var("TARGET").expect("TARGET was not set"); let target = env::var("TARGET").expect("TARGET was not set");
if cfg!(feature = "system-llvm-libunwind") {
return;
}
if cfg!(feature = "llvm-libunwind") if cfg!(feature = "llvm-libunwind")
&& ((target.contains("linux") && !target.contains("musl")) || target.contains("fuchsia")) && ((target.contains("linux") && !target.contains("musl")) || target.contains("fuchsia"))
{ {