Skip to content

Commit

Permalink
Use msvcrt
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuki0824 committed Oct 15, 2023
1 parent fc67af7 commit 4ccb982
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions b25-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,41 @@ fn main() {
*/
cm.profile("Release");
} else if cfg!(target_env = "gnu") {
match std::env::var("MSYSTEM") {
Ok(sys_name) if sys_name.to_lowercase().contains("mingw64") => {
cm.generator("Ninja");
println!("cargo:rustc-link-lib=msvcrt");
}
Ok(sys_name) => {
panic!("target_env:={sys_name} not supported.")
}
_ => {
// TODO
cm.generator("MinGW Makefiles");
println!("cargo:rustc-link-lib=msvcrt");
}
}
} else if cfg!(target_env = "gnullvm") {
match std::env::var("MSYSTEM") {
Ok(sys_name) if sys_name.to_lowercase().contains("ucrt") => {
cm.generator("Ninja");
println!("cargo:rustc-link-lib=ucrt");
}
Ok(sys_name) if sys_name.to_lowercase().contains("clang") => {
cm.generator("Ninja");
println!("cargo:rustc-link-lib=ucrt");
}
Ok(_) => {
cm.generator("Ninja");
println!("cargo:rustc-link-lib=vcruntime140");
Ok(sys_name) => {
panic!("target_env:={sys_name} not supported.")
}
_ => {
// UCRT Mingw-w64 only
// TODO
cm.generator("MinGW Makefiles");
println!("cargo:rustc-link-lib=ucrt");
println!("cargo:rustc-link-lib=vcruntime140");
}
}
println!("cargo:rustc-link-lib=ucrt");
// llvm-mingw
}
println!("cargo:rustc-link-search=native=C:\\Windows\\System32");
println!("cargo:rustc-link-lib=dylib=winscard");
Expand Down

0 comments on commit 4ccb982

Please sign in to comment.