Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move crt-static and linking to build script on windows #1227

Closed
Closed
Changes from 2 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
11 changes: 11 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ fn main() {
if rustc_minor_version().expect("Failed to get rustc version") >= 30 {
println!("cargo:rustc-cfg=core_cvoid");
}

let target = env::var("TARGET").unwrap();
let linkage = env::var("CARGO_CFG_TARGET_FEATURE").unwrap();

if target.contains("msvc") {
gnzlbg marked this conversation as resolved.
Show resolved Hide resolved
if linkage.contains("crt-static") {
println!("cargo:rustc-link-lib=dylib=libcmt");
} else {
println!("cargo:rustc-link-lib=dylib=msvcrt");
}
}
}

fn rustc_minor_version() -> Option<u32> {
Expand Down