fix(build): scope Windows debug stack

Apply /STACK only to the debug app binary instead of every Windows target artifact.
This commit is contained in:
Hakan Seven 2026-08-17 22:46:50 +03:00
commit f9e7afdee2
2 changed files with 7 additions and 11 deletions

View file

@ -18,10 +18,3 @@ rustflags = [
# WebAssembly stack while developing with `trunk serve`.
'-Clink-arg=-zstack-size=4194304',
]
[target.x86_64-pc-windows-msvc]
rustflags = [
# Debug builds of the host have a deeper call stack than the default 1 MiB
# Windows stack allows; increase it to avoid stack overflow on startup.
'-Clink-arg=/STACK:16777216',
]

View file

@ -33,10 +33,13 @@ fn main() {
revision
};
println!("cargo:rustc-env=OCS_GIT_REV={revision}");
println!(
"cargo:rustc-env=OCS_BUILD_PROFILE={}",
std::env::var("PROFILE").unwrap_or_else(|_| "unknown".to_string())
);
let profile = std::env::var("PROFILE").unwrap_or_else(|_| "unknown".to_string());
println!("cargo:rustc-env=OCS_BUILD_PROFILE={profile}");
if std::env::var("TARGET").ok().as_deref() == Some("x86_64-pc-windows-msvc")
&& profile == "debug"
{
println!("cargo:rustc-link-arg-bin=OpenCADStudio=/STACK:16777216");
}
let mut features: Vec<String> = std::env::vars()
.filter_map(|(name, value)| {
(value == "1")