diff --git a/build.rs b/build.rs index 9946336..c451f9d 100644 --- a/build.rs +++ b/build.rs @@ -10,6 +10,16 @@ use std::io::Read; use std::path::PathBuf; fn main() { + #[cfg(windows)] + { + let stack_size = std::env::var("STACK_SIZE").unwrap_or("4194304".to_string()); + let stack_size = stack_size.parse::().unwrap(); + println!("cargo:rerun-if-env-changed=STACK_SIZE"); + #[cfg(target_env = "msvc")] + println!("cargo:rustc-link-arg=/STACK:{}", stack_size); + #[cfg(target_env = "gnu")] + println!("cargo:rustc-link-arg=-Wl,-stack,{}", stack_size); + } #[cfg(any(feature = "exif", feature = "ugoira"))] { let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());