Using Meson as a wrapper for a C library written in Rust using Cargo.toml #13466
Unanswered
scott-wilson
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey, I'm writing a library that is written in Rust, but has C, C++, and Python bindings. I am interested in using Meson for the C and C++ bindings, and from my experimentation, it looks like either the Cargo.toml support isn't fully supported yet, or I'm doing something wrong.
Basically, my goals are as follows:
C API
cargo build
, and having a bit of luck with meson, except running into issues with dependencies)libfoo.so.1.0.0
->libfoo.so.1.0
->libfoo.so
), CMake config, and pkg-config all in their respective directories. I can create a bunch of scripts to do this, but would prefer if I can do this in a build system.C++ API
Right now, it sort of looks doable in Meson if I use subprojects, but the structure feels weird to me.
Example of the C bindings file structure (as I understand it):
The
foo-rs.wrap
wrap file:But, this feels like the wrong way to do this (to be fair, haven't tried it). What do you recommend to get this working? Or is my best bet to manually generate the C package with cargo + scripts, and then use something like Meson for the C++ API?
Beta Was this translation helpful? Give feedback.
All reactions