blob: 654637fd7bb256c9b8a36c4e7d0f04dc70df7863 [file]
//! The `amem` binary's main thread gets eight megabytes of stack on Windows, as it has on
//! Linux and macOS. Windows gives a main thread one by default, and what `main` does
//! before the commands move to a thread of their own (src/main.rs) overflowed that in a
//! debug build: `amem init` and `amem doctor` both died with "thread 'main' has
//! overflowed its stack" on the Windows runner.
fn main() {
let os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
let env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap_or_default();
if os == "windows" {
if env == "msvc" {
println!("cargo:rustc-link-arg-bins=/STACK:8388608");
} else {
println!("cargo:rustc-link-arg-bins=-Wl,--stack,8388608");
}
}
}