Probe for ncurses BUTTON5 support at build time
Add build.rs to the cursive crate that checks the ncurses crate's generated raw_constants.rs for BUTTON5_PRESSED. The ncurses crate (v6+) already probes the system headers via C compilation and conditionally includes BUTTON5 constants. We simply read that result — no C compiler invocation needed in our build script.
If BUTTON5 constants are present, sets cfg(has_ncurses_button5); otherwise the BUTTON5 code paths in the ncurses backend are gated out.
This fixes the build failure on macOS where the system ncurses does not provide BUTTON5_* constants.
Resolves gyscos/cursive#815.
合并状态:未合并 3 条评论