On 27-07-22, 10:57, Kent Gibson wrote:
On Fri, Jul 08, 2022 at 05:04:56PM +0530, Viresh Kumar wrote:
Add support to generate gpiosim bindings.
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org
bindings/rust/libgpiod-sys/Cargo.toml | 1 + bindings/rust/libgpiod-sys/build.rs | 19 +++++++++++++++++-- bindings/rust/libgpiod-sys/gpiosim_wrapper.h | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 bindings/rust/libgpiod-sys/gpiosim_wrapper.h
diff --git a/bindings/rust/libgpiod-sys/Cargo.toml b/bindings/rust/libgpiod-sys/Cargo.toml index 77f82719d269..73b6761d16dd 100644 --- a/bindings/rust/libgpiod-sys/Cargo.toml +++ b/bindings/rust/libgpiod-sys/Cargo.toml @@ -9,6 +9,7 @@ edition = "2018" [features] generate = [ "bindgen" ] +gpiosim = [ "generate", "bindgen" ]
Should gpiosim be a feature or a separate library/crate?
It can be. I don't have any objections to that. It will add a bit more code, i.e. a libgpiosim-sys crate in bindings/rust/ directory, but that's fine I think.
I would expect it to be a separate crate and for libgpiod to have a dev-dependency on it (it is only required for tests, right?).
Yes.
diff --git a/bindings/rust/libgpiod-sys/gpiosim_wrapper.h b/bindings/rust/libgpiod-sys/gpiosim_wrapper.h new file mode 100644 index 000000000000..47dc12a87917 --- /dev/null +++ b/bindings/rust/libgpiod-sys/gpiosim_wrapper.h @@ -0,0 +1 @@
+#include "../../../tests/gpiosim/gpiosim.h"
Why bother with this wrapper - just bindgen that header directly?
Whatever we decide for wrapper.h, will be done here as well.