f4ec18d528
- build.rs: drop the stale `rerun-if-changed=src/client.rs` (the file became client/ in W7; the path never fires). - lib.rs: the crate doc's module list named 6 of ~19 modules — add the missing ones (config/error/stats/input/reject/reanchor/render_scale/ audio/wol + the quic-gated control-plane group), without intra-doc links to feature-gated modules. - quic/mod.rs: the module doc still described the deleted `msgs` module; list the actual post-split module set. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
34 lines
1.2 KiB
Rust
34 lines
1.2 KiB
Rust
//! Generate the C header (`include/punktfunk_core.h`) from the `extern "C"` surface.
|
|
//!
|
|
//! cbindgen failure is a warning, not a hard error, so the crate still builds in minimal
|
|
//! environments (e.g. a CI image without the full toolchain); the header is checked in.
|
|
|
|
use std::env;
|
|
use std::path::PathBuf;
|
|
|
|
fn main() {
|
|
println!("cargo:rerun-if-changed=src/abi.rs");
|
|
println!("cargo:rerun-if-changed=src/config.rs");
|
|
println!("cargo:rerun-if-changed=src/input.rs");
|
|
println!("cargo:rerun-if-changed=src/error.rs");
|
|
println!("cargo:rerun-if-changed=cbindgen.toml");
|
|
|
|
let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR");
|
|
// Workspace-level include/ dir: crates/punktfunk-core/ -> ../../include/
|
|
let out = PathBuf::from(&crate_dir)
|
|
.join("..")
|
|
.join("..")
|
|
.join("include")
|
|
.join("punktfunk_core.h");
|
|
|
|
match cbindgen::generate(&crate_dir) {
|
|
Ok(bindings) => {
|
|
bindings.write_to_file(&out);
|
|
println!("cargo:warning=punktfunk-core: wrote {}", out.display());
|
|
}
|
|
Err(e) => {
|
|
println!("cargo:warning=punktfunk-core: cbindgen failed ({e}); header not regenerated");
|
|
}
|
|
}
|
|
}
|