nuttx-apps/examples/rust/hello/Cargo.toml
Shoji Tokunaga d1202bd501 examples/rust: Avoid the infinite loop on sim for hello_rust_cargo
On the sim target (Windows/macOS/Linux), hello_rust_cargo_main() ended
with an infinite `loop {}` that never returned control to NSH, so the
example could not exit and the shell prompt hung.

Introduce a Cargo `sim` feature that is enabled only when CONFIG_ARCH_SIM
is set, and use it to compile out the trailing infinite loop and return 0
instead. Other embedded targets keep the original looping behavior.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-06-20 10:33:46 -03:00

25 lines
358 B
TOML

[package]
name = "hello"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["staticlib"]
[features]
sim = []
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"
lto = true
codegen-units = 1
opt-level = 'z'
[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1", features = ["rt"] }