mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-07-05 03:13:47 +08:00

Build Rust applictions with cargo is the most commn way, and it's more easy to cooporate with Rust ecosystem. This example shows how to use cargo to build a simple hello world application. And please notice that you need to install nighly version of rustc to support this feature, any version after https://github.com/rust-lang/rust/pull/127755 is merged, can use NuttX as cargo target directly. Build ----- To build hello_rust_cargo application, you can use any target that based on RISCV32IMAC, for example: ``` cmake -B build -DBOARD_CONFIG=rv-virt:nsh -GNinja . ``` And disable ARCH_FPU in menuconfig, since the hard coded target triple in this demo is `riscv32imac`. Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
30 lines
719 B
Plaintext
30 lines
719 B
Plaintext
#
|
|
# For a description of the syntax of this configuration file,
|
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
|
#
|
|
|
|
config EXAMPLES_HELLO_RUST_CARGO
|
|
tristate "\"Hello, Rust!\" example with Cargo"
|
|
default n
|
|
---help---
|
|
Enable the \"Hello, Rust!\" example using Cargo to build.
|
|
|
|
if EXAMPLES_HELLO_RUST_CARGO
|
|
|
|
config EXAMPLES_HELLO_RUST_CARGO_PROGNAME
|
|
string "Program name"
|
|
default "hello_rust_cargo"
|
|
---help---
|
|
This is the name of the program that will be used when the
|
|
program is installed.
|
|
|
|
config EXAMPLES_HELLO_RUST_CARGO_PRIORITY
|
|
int "Hello Rust task priority"
|
|
default 100
|
|
|
|
config EXAMPLES_HELLO_RUST_CARGO_STACKSIZE
|
|
int "Hello Rust stack size"
|
|
default DEFAULT_TASK_STACKSIZE
|
|
|
|
endif
|