diff --git a/Cargo.toml b/Cargo.toml index 82b991a..21790ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,5 +59,8 @@ debug = true [target.'cfg(windows)'.dependencies] winapi = { version = "0.3.9", features = ["winnls", "stringapiset"] } +[target.'cfg(windows)'.build-dependencies] +parse-size = "1" + [target.'cfg(target_env = "gnu")'.dependencies] link-cplusplus = { version = "1.0", features = ["libstdc++"], optional = true } diff --git a/build.rs b/build.rs index 719ee34..2e46e24 100644 --- a/build.rs +++ b/build.rs @@ -13,7 +13,7 @@ fn main() { #[cfg(windows)] { let stack_size = std::env::var("STACK_SIZE").unwrap_or("4194304".to_string()); - let stack_size = stack_size.parse::().unwrap(); + let stack_size = parse_size::parse_size(stack_size).unwrap(); println!("cargo:rerun-if-env-changed=STACK_SIZE"); #[cfg(target_env = "msvc")] println!("cargo:rustc-link-arg=/STACK:{}", stack_size);