Files
ghostty-rs/crates/ghostty-os/build.rs
T
ddidderr 7b59457cb8 fix(os,termio): FreeBSD support, dev-profile resource precedence, docs
Final fix pass per the stopping criterion (docs/rewrite/PLAN.md),
resolving the remaining RV18 build/behaviour items (final-Z21.md):
- termio errno access uses the per-target libc accessor (__error on
  FreeBSD/DragonFly/Apple, __errno on OpenBSD/NetBSD/Android) instead of
  __errno_location everywhere, unblocking non-Linux BSD builds.
- FreeBSD resource discovery follows Zig (site-terminfo, local/share).
- Zig's Debug-only resource precedence (and the dev workspace-resources
  fallback) key off a ghostty_debug_build cfg set from PROFILE=="debug"
  instead of debug_assertions, so release builds with assertions honor
  GHOSTTY_RESOURCES_DIR first like Zig ReleaseSafe.
- KNOWN_DIFFERENCES.md lists the remaining P3 differences deliberately
  left unfixed (theme-preview editing details, a cleanup timeout edge
  case) and what cannot be verified on this machine.
- DEVIANT_FIXES.md registers the PTY-hangup output drain (35), the
  canvas BGRA conversion (36) and the dev resources fallback.

Test Plan:
- cargo test --workspace --no-fail-fast (exit 0)
- cargo check --target x86_64-unknown-freebsd -p ghostty-os
2026-10-12 16:53:27 +02:00

13 lines
521 B
Rust

//! Emits `cfg(ghostty_debug_build)` for the Cargo `dev` profile (Zig
//! `builtin.mode == .Debug`). `debug_assertions` is not equivalent: the
//! repository's `release` profile enables it, like Zig's `ReleaseSafe`.
fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-env-changed=PROFILE");
println!("cargo:rustc-check-cfg=cfg(ghostty_debug_build)");
if std::env::var("PROFILE").is_ok_and(|p| p == "debug") {
println!("cargo:rustc-cfg=ghostty_debug_build");
}
}