How do inter-dependent sys crates get setup and consumed ? What are its best practices ? Any references to sys crates to look into that have similar situation as the following ?
Context:
- I have a system package (libfoo/foo.h + libfoo.so) and (libbar/libbar.h + libbar.so). foo.h consumes types from bar.h (foo.h includes bar.h) .
- I want to use bindgen to generate the CFFI bindings to both libfoo.so and libbar.so using bindgen as 2 separate sys crates.
Questions:
- Is there a way in bindgen to prevent types included from other headers from being codegened ?
- How do I exclude the system types(types in stdlib.h etc) from being codegened ?
- How can I instruct bindgen to prevent codegen of included types (foo.h including bar.h but bar.h has a separate sys crate, stdlib.h etc) ?
- Do I just add the libbar-sys crate as a dependency to libfoo-sys crate ?
What I tried:
I tried using the allow list feature of bindgen but I am dealing with legacy components that dont follow a std naming convention or use prefixes.