[desktop][chore] Fix incorrect linker arguments on windows when using gnu linker(ld.exe)

This commit is contained in:
lvyitian 2023-06-27 16:39:19 +08:00 committed by relrelb
parent 96e3d36a6e
commit e43a9fd85f
1 changed files with 7 additions and 1 deletions

View File

@ -29,7 +29,13 @@ fn main() -> Result<(), Box<dyn Error>> {
// accommodate this (the default on Linux is high enough). We // accommodate this (the default on Linux is high enough). We
// do the same thing for wasm in web/build.rs. // do the same thing for wasm in web/build.rs.
if std::env::var("TARGET").unwrap().contains("windows") { if std::env::var("TARGET").unwrap().contains("windows") {
if std::env::var("TARGET").unwrap().contains("msvc") {
println!("cargo:rustc-link-arg=/STACK:4000000"); println!("cargo:rustc-link-arg=/STACK:4000000");
}else{
println!("cargo:rustc-link-arg=-Xlinker");
println!("cargo:rustc-link-arg=--stack");
println!("cargo:rustc-link-arg=4000000");
}
} }
Ok(()) Ok(())