Make the root build.rs smarter
Currently we create a crate for each header we want to output. As a result there is quite a bit of super generic work that occurs when a new header is created. We could create a build script for the root crate that functions more like the main
in cbindgen that is used for their test script. This would allow us to use modules or crates (in the rare case that wee need it) to build a new header.
Example
We currently have the following
├── src
│ ├── simple
│ │ ├── Cargo.toml
│ │ ├── cbindgen.toml
│ │ ├── build.rs
│ │ └── src
│ │ └── lib.rs
│ └── complex
│ ├── Cargo.toml
│ ├── cbindgen.toml
│ ├── build.rs
│ └── src
│ ├── lib.rs
│ └── other-stuff.rs
...
If we make the root build.rs
a bit smarter. AFAIK we could have something like the following.
├── src
│ ├── simple.rs
│ ├── other.rs
│ ├── other.toml
│ └── complex
│ ├── Cargo.toml
│ ├── cbindgen.toml
│ └── src
│ ├── lib.rs
│ └── other-stuff.rs
...
Where other
needs it's own config and simple
can just use the default config.