Skip to content

Commit

Permalink
Use msvcrt in mingw64 msystem
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuki0824 committed Oct 15, 2023
1 parent 75adf40 commit 70fb901
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions b25-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,21 @@ fn main() {
*/
cm.profile("Release");
} else if cfg!(target_env = "gnu") {
if std::env::var("MSYSTEM").is_ok() {
cm.generator("Ninja");
// cm.configure_arg("-DCMAKE_MAKE_PROGRAM=ninja.exe");
} else {
cm.generator("MinGW Makefiles");
match std::env::var("MSYSTEM") {
Ok(sys_name) if sys_name.to_lowercase().contains("ucrt") => {
cm.generator("Ninja");
}
Ok(sys_name) if sys_name.to_lowercase().contains("clang") => {
cm.generator("Ninja");
}
Ok(_) => {
cm.generator("Ninja");
println!("cargo:rustc-link-lib=msvcrt");
}
_ => {
// UCRT Mingw-w64 only
cm.generator("MinGW Makefiles");
}
}
println!("cargo:rustc-link-lib=ucrt");
}
Expand Down

0 comments on commit 70fb901

Please sign in to comment.