mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-04 06:40:24 +00: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.
19 lines
202 B
Rust
19 lines
202 B
Rust
|
|
extern "C" {
|
|
fn static_foo();
|
|
fn shared_foo();
|
|
}
|
|
|
|
|
|
extern crate object;
|
|
use object::object_foo;
|
|
|
|
|
|
fn main() {
|
|
unsafe {
|
|
static_foo();
|
|
shared_foo();
|
|
}
|
|
object_foo();
|
|
}
|