mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
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.
5 lines
102 B
Rust
5 lines
102 B
Rust
#[no_mangle]
|
|
pub extern "C" fn rs_staticlib_greet() {
|
|
println!("Hello from a Rust staticlib!");
|
|
}
|