5 ms·
> This is where build scripts come in. Our strategy will be for the Rust crate to use a build.rs build script and the cc crate to invoke the equivalent commands
by ridiculous_fish 7y ago
> This is where build scripts come in. Our strategy will be for the Rust crate to use a build.rs build script and the cc crate to invoke the equivalent commands to our make invocation
Yikes - port the entire build system to cargo before you write a line of Rust. Now draw the reset of the owl!
Surely's there's an incremental path for the build as well? Perhaps if you're using CMake?
- pornel 7y agoYou can build Rust code as a static library and make the C build system consume that instead. This is the approach that librsvg took. Moving C build to build.rs is not necessary. It's usually done only because people used to Cargo don't like bringing CMake along. If you were to publish this as a Rust crate, it'd be slightly easier for downstream Rust users to have one less external tool to install.
- Rusky 7y agoThere's a `cmake` crate that you could use from `build.rs` the same way, or you could go the other direction and have your existing build system invoke Cargo or rustc.