This is an automated email from the ASF dual-hosted git repository.
lupyuen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new bb7c83b01 apps:cmake: Add APPLE to a build target for sim's
configuration using CMake.
bb7c83b01 is described below
commit bb7c83b01cf7c48d8f4850b9074e3478e62ca08e
Author: Shoji Tokunaga <[email protected]>
AuthorDate: Sat May 16 14:55:38 2026 +0900
apps:cmake: Add APPLE to a build target for sim's configuration using CMake.
* Add Rust target conversion support for `aarch64` on acOS/Linux (and Linux
`arm`).
* When a Rust target is unsupported and results in an empty configuration,
trigger a CMake `FATAL_ERROR`.
Signed-off-by: Shoji Tokunaga <[email protected]>
---
cmake/nuttx_add_rust.cmake | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/cmake/nuttx_add_rust.cmake b/cmake/nuttx_add_rust.cmake
index 3a26bfd16..55fce1a8e 100644
--- a/cmake/nuttx_add_rust.cmake
+++ b/cmake/nuttx_add_rust.cmake
@@ -35,6 +35,7 @@ include(nuttx_parse_function_args)
# - riscv64: riscv64imac/imafdc-unknown-nuttx-elf
# - x86: i686-unknown-nuttx
# - x86_64: x86_64-unknown-nuttx
+# - aarch64: aarch64-apple-darwin
#
# Inputs:
# ARCHTYPE - Architecture type (e.g. thumbv7m, riscv32)
@@ -53,6 +54,10 @@ function(nuttx_rust_target_triple ARCHTYPE ABITYPE CPUTYPE
OUTPUT)
set(TARGET_TRIPLE "${APPDIR}/tools/x86_64-unknown-nuttx.json")
elseif(ARCHTYPE STREQUAL "x86")
set(TARGET_TRIPLE "${APPDIR}/tools/i486-unknown-nuttx.json")
+ elseif(ARCHTYPE STREQUAL "aarch64")
+ if(APPLE)
+ set(TARGET_TRIPLE "aarch64-apple-darwin")
+ endif()
elseif(ARCHTYPE MATCHES "thumb")
if(ARCHTYPE MATCHES "thumbv8m")
# Extract just the base architecture type (thumbv8m.main or
thumbv8m.base)
@@ -92,6 +97,13 @@ function(nuttx_rust_target_triple ARCHTYPE ABITYPE CPUTYPE
OUTPUT)
set(TARGET_TRIPLE "riscv64imac-unknown-nuttx-elf")
endif()
endif()
+
+ if(NOT TARGET_TRIPLE)
+ message(
+ FATAL_ERROR
+ "Unsupported Rust target: LLVM_ARCHTYPE=${ARCHTYPE},
LLVM_ABITYPE=${ABITYPE}, LLVM_CPUTYPE=${CPUTYPE}"
+ )
+ endif()
set(${OUTPUT}
${TARGET_TRIPLE}
PARENT_SCOPE)