The build system setup consists of five declarations in Meson. It should be doable in four, but Rust is a bit special. Ignoring the boilerplate the core business logic looks like this:
rustlib = static_library('func', 'func.rs')
link_with : rustlib,
dependencies : py3_dep)
The code is available on Github.
Compiling and running.Compiling is done using the default Meson commands:
ninja -C build
Once built the main script can be run with this command:
The script just calls into the module and prints the string it returns. The output looks like this:
Combining many languages is simple.
This line is created in C.
This line is created in FORTRAN.
This line is created in C++.
This line is created in Rust.