返回 CodeWhale
build.rs
根目录 / crates / tui / build.rs
1 use std::path::PathBuf;
2
3 fn main() {
4 let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
5 codewhale_build_support::declare_rerun_conditions(&manifest_dir);
6 configure_windows_stack();
7 codewhale_build_support::emit_build_version(&manifest_dir, env!("CARGO_PKG_VERSION"));
8 }
9
10 fn configure_windows_stack() {
11 if std::env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("windows") {
12 return;
13 }
14
15 match std::env::var("CARGO_CFG_TARGET_ENV").as_deref() {
16 Ok("msvc") => {
17 println!("cargo:rustc-link-arg-bin=codewhale-tui=/STACK:8388608");
18 }
19 Ok("gnu") => {
20 println!("cargo:rustc-link-arg-bin=codewhale-tui=-Wl,--stack,8388608");
21 }
22 _ => {}
23 }
24 }
25
25 lines RUST