pass stack size via build script on Windows system. ( Fix #123

This commit is contained in:
2022-07-19 11:49:23 +08:00
parent 9ab8939f17
commit 6ae7608183

View File

@@ -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::<usize>().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());