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
5 changes: 4 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,10 @@ fn print_link_flags() {
if target_env == "msvc" {
// On Windows, including libcpmt[d]/msvcprt[d] explicitly links the C++
// standard library, which libc++ needs for exception_ptr internals.
if env::var("CARGO_FEATURE_CRT_STATIC").is_ok() {
let crt_static = env::var("CARGO_CFG_TARGET_FEATURE")
.unwrap_or_default()
.contains("crt-static");
if crt_static {
println!("cargo:rustc-link-lib=libcpmt");
} else {
println!("cargo:rustc-link-lib=dylib=msvcprt");
Expand Down
Loading