Add Rust build system support#356
Conversation
|
See discussion, incl. roadmap: #60 |
| /// \param a First number to add | ||
| /// \param b Second number to add | ||
| /// \return The sum of a and b | ||
| uint32_t rust_add(uint32_t a, uint32_t b); |
There was a problem hiding this comment.
This example shows a C-only interface use case.
For interfacing between C++ and Rust, would it be possible to give a more complex example, e.g. mapping between C++ class and Rust crate interface? Maybe put it on the linked agenda/Rust discussion, but we would need it at some point to support reasonably complex interfaces.
There was a problem hiding this comment.
Good point! This initial PR intentionally uses a minimal C-style interface (extern "C") to establish the basic Rust build infrastructure with Corrosion. The upcoming features in the agenda will include more interfaces between C++ and Rust.
8db8c6c to
bc26f15
Compare
christian-schilling
left a comment
There was a problem hiding this comment.
The commit message needs to be adjusted according the the guidelines.
|
Please note that if you changed the PR description, you need to change the commit message also, separately. |
|
@rolandreichweinbmw @christian-schilling, could you please proceed with resolving your review comments, if there are no other points. |
|
You still should adjust the commit message, as Christian suggested: It should not mention "OpenBSW". Also "with the following:" can be omitted. |
Enable mixed C++/Rust development. Build System: - Add BUILD_RUST CMake option (opt-in, default OFF) - Integrate Corrosion using rim (vendored in libs/3rdparty/corrosion/) - Configure cross-compilation for S32K148 (thumbv7em-none-eabihf) - Use manual C header for FFI (cbindgen installed for future use) CMake Presets: - posix-rust: POSIX platform with Rust and FreeRTOS support - s32k148-rust-gcc: S32K148 with Rust and FreeRTOS support Example Crate: - Add rustHelloWorld example crate demonstrating FFI - Use no_std for embedded compatibility - Export rust_add() function callable from C++ CI/CD: - Update Dockerfile with Rust 1.90.0, cbindgen 0.27.0, and ARM target - Add posix-rust and s32k148-rust-gcc to CI build matrix Documentation: - Add Rust setup instructions for POSIX and S32K148 builds - Pin Rust version to 1.90.0 for CI compatibility - Update NOTICE.md with Corrosion license info Change-Id: I5902e6cbb956ebe4112bdd941d9dd25d8f97721a
|
@rolandreichweinbmw Done. could you please review again if the commit message satisfies the guidelines? |
Commit message updated, approved by Roland
|
@rolandreichweinbmw, can we merge? |
Add Rust build system support
Enable mixed C++/Rust development.
Build System:
CMake Presets:
Example Crate:
CI/CD:
Documentation: