I am working on a *-sys crate (and a regular crate) for a CMake project. This project has several libraries all bundled into the same repo (Note these libraries depend on each other).
In principle, I should take each of these libraries and make a separate *-sys crate for each. However this means for each of these crates, I'd need to A) clone the source repo once per library (meaning when publishing, each crate will include the entirety of the source repo), B) duplicate a lot of the build script, C) keep the build scripts in sync, etc.
Alternatively, I can have a single sys crate for the entire project. I can then use feature flags to selectively build and create bindings for these all together. The problem is my Cargo manifest can only "links" against one of these libraries. This means another crate linking against one of my libraries may not be detected as incompatible.
Question 1: is the second approach reasonable? Or is it a terrible idea that I should avoid at the fairly significant cost?
Question 2: is it reasonable/common to have multiple copies of the source repo hanging around?
Question 3: is there another solution that works better in this situation?