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:
parent
fcffa13693
commit
f9e7afdee2
2 changed files with 7 additions and 11 deletions
|
|
@ -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',
|
||||
]
|
||||
|
|
|
|||
11
build.rs
11
build.rs
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in a new issue