mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
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>
25 lines
358 B
TOML
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"] }
|