3 Commits

Author SHA1 Message Date
Baudouin Feildel
881faf67e5 Rust: Switch to building .rs files to .rlib instead of native object files
Each Rust source file given to a target is considered a separate crate
root. There's a concept of a "main crate root", which is the `.rs` file
that is given to the final linker phase in CMake. Other Rust source file
in a target are built as rlib separately.

The project can still build `.rs` files into object files by setting the
Rust_EMIT property on the desired source file.
2026-03-20 09:42:44 -04:00
Baudouin Feildel
942ddcdd36 Rust: Add support for position independent code 2026-03-19 14:25:56 -04:00
Ayush Singh
5c1b0a6b7e Rust: Add experimental support with Ninja
The TU for Rust is a crate, not per-source.  `rustc` expects entry file
to TU as input, and cannot work with object files.  So we need to have
one-step build/link in most cases, similar to what old Swift was doing.

Issue: #25492
Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2026-02-06 11:32:56 -05:00