Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ fn print_link_flags() {
} else if target.contains("apple")
|| target.contains("freebsd")
|| target.contains("openbsd")
|| target.contains("gnullvm")
{
println!("cargo:rustc-link-lib=dylib=c++");
} else if target.contains("android") {
Expand All @@ -760,6 +761,7 @@ fn print_link_flags() {
}
}
}
let target = env::var("TARGET").unwrap();
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap();

Expand All @@ -776,6 +778,12 @@ fn print_link_flags() {
} else {
println!("cargo:rustc-link-lib=dylib=msvcprt");
}
} else if target.ends_with("windows-gnu") {
// Clang-based toolchains don't use separate atomic library
println!("cargo:rustc-link-lib=atomic")
} else if target.ends_with("windows-gnullvm") {
// Clang usually works with Win32 threads, so we need to link pthread explicitly
println!("cargo:rustc-link-lib=pthread")
}
}

Expand Down
Loading