diff --git a/examples/rust-gcoap/Cargo.toml b/examples/rust-gcoap/Cargo.toml index 4a0e2a7dcb..275eedaffb 100644 --- a/examples/rust-gcoap/Cargo.toml +++ b/examples/rust-gcoap/Cargo.toml @@ -14,3 +14,9 @@ riot-wrappers = { version = "^0.7.18", features = [ "set_panic_handler", "panic_ coap-message-demos = { git = "https://gitlab.com/chrysn/coap-message-demos/", default-features = false } coap-handler-implementations = "0.3" riot-coap-handler-demos = { git = "https://gitlab.com/etonomy/riot-module-examples/", features = [ "vfs" ] } + +# While currently this exmple does not use any RIOT modules implemented in +# Rust, that may change; it is best practice for any RIOT application that has +# its own top-level Rust crate to include rust_riotmodules from inside +# RIOTBASE. +rust_riotmodules = { path = "../../sys/rust_riotmodules/" } diff --git a/examples/rust-gcoap/src/lib.rs b/examples/rust-gcoap/src/lib.rs index 4fdcdbba21..301557978e 100644 --- a/examples/rust-gcoap/src/lib.rs +++ b/examples/rust-gcoap/src/lib.rs @@ -10,6 +10,8 @@ use riot_wrappers::{gcoap, thread, ztimer, gnrc}; use coap_handler_implementations::{ReportingHandlerBuilder, HandlerBuilder}; +extern crate rust_riotmodules; + riot_main!(main); fn main() { diff --git a/examples/rust-hello-world/Cargo.toml b/examples/rust-hello-world/Cargo.toml index a841f702c2..9dc05fcfd2 100644 --- a/examples/rust-hello-world/Cargo.toml +++ b/examples/rust-hello-world/Cargo.toml @@ -11,3 +11,9 @@ crate-type = ["staticlib"] [dependencies] # `default-features = false` can be removed with 0.8, and enables building on stable during the 0.7 series riot-wrappers = { version = "0.7", features = [ "set_panic_handler" ], default-features = false } + +# While currently this exmple does not use any RIOT modules implemented in +# Rust, that may change; it is best practice for any RIOT application that has +# its own top-level Rust crate to include rust_riotmodules from inside +# RIOTBASE. +rust_riotmodules = { path = "../../sys/rust_riotmodules/" } diff --git a/examples/rust-hello-world/src/lib.rs b/examples/rust-hello-world/src/lib.rs index f4ad7a8fc4..3f72a5615a 100644 --- a/examples/rust-hello-world/src/lib.rs +++ b/examples/rust-hello-world/src/lib.rs @@ -8,6 +8,8 @@ use riot_wrappers::riot_main; use riot_wrappers::println; +extern crate rust_riotmodules; + riot_main!(main); fn main() { diff --git a/tests/rust_minimal/Cargo.toml b/tests/rust_minimal/Cargo.toml index 128a03eb9f..c6b2f5f546 100644 --- a/tests/rust_minimal/Cargo.toml +++ b/tests/rust_minimal/Cargo.toml @@ -17,3 +17,8 @@ panic = "abort" [dependencies] # `default-features = false` can be removed with 0.8, and enables building on stable during the 0.7 series riot-wrappers = { version = "0.7", features = [ "set_panic_handler" ], default-features = false } + +# While currently this test does not use any RIOT modules implemented in Rust, +# that may change; it is best practice for any RIOT application that has its +# own top-level Rust crate to include rust_riotmodules from inside RIOTBASE. +rust_riotmodules = { path = "../../sys/rust_riotmodules/" } diff --git a/tests/rust_minimal/src/lib.rs b/tests/rust_minimal/src/lib.rs index 358a332ab2..6ba145d044 100644 --- a/tests/rust_minimal/src/lib.rs +++ b/tests/rust_minimal/src/lib.rs @@ -8,6 +8,8 @@ use riot_wrappers::riot_main; use riot_wrappers::println; +extern crate rust_riotmodules; + riot_main!(main); fn main() {