opencode/packages/cli-rs/crates/cli/build.rs
Simon Klee 6b1df0cceb
feat(cli-rs): add the native CLI and TUI (#63477)
Add packages/cli-rs, an OpenCode client written in Rust on OpenTUI's Rust crates. It is a client only.
2026-11-22 00:07:01 +01:00

11 lines
510 B
Rust

fn main() {
// A deeply nested plugin tree can exceed the Windows main thread's default 1 MiB stack in a debug build.
let stack = 8 << 20;
match std::env::var("CARGO_CFG_TARGET_ENV").as_deref() {
Ok("msvc") => println!("cargo:rustc-link-arg-bin=opencode-native=/STACK:{stack}"),
Ok("gnu") if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows") => {
println!("cargo:rustc-link-arg-bin=opencode-native=-Wl,--stack,{stack}");
}
_ => {}
}
}