mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
apps/cmake: Add DEPENDS for Rust-related files.
* Add `DEPENDS` to ensure staticlib rebuilds when Rust-related files change. * Uses `GLOB_RECURSE` to search for Rust-related files. Signed-off-by: Shoji Tokunaga <toku@mac.com>
This commit is contained in:
parent
ecfc1b5b61
commit
e536adaabc
1 changed files with 13 additions and 0 deletions
|
|
@ -168,6 +168,18 @@ function(nuttx_add_rust)
|
|||
# Create build directory
|
||||
file(MAKE_DIRECTORY ${RUST_BUILD_DIR})
|
||||
|
||||
# Collect Rust source files and manifests as dependencies so that changes in
|
||||
# the crate trigger a rebuild via CMake/Ninja.
|
||||
file(
|
||||
GLOB_RECURSE
|
||||
RUST_CRATE_SOURCES
|
||||
CONFIGURE_DEPENDS
|
||||
"${CRATE_PATH}/Cargo.toml"
|
||||
"${CRATE_PATH}/Cargo.lock"
|
||||
"${CRATE_PATH}/build.rs"
|
||||
"${CRATE_PATH}/src/*.rs"
|
||||
"${CRATE_PATH}/src/**/*.rs")
|
||||
|
||||
# Add a custom command to build the Rust crate
|
||||
add_custom_command(
|
||||
OUTPUT ${RUST_LIB_PATH}
|
||||
|
|
@ -178,6 +190,7 @@ function(nuttx_add_rust)
|
|||
-Zbuild-std=std,panic_abort -Zjson-target-spec --manifest-path
|
||||
${CRATE_PATH}/Cargo.toml --target ${RUST_TARGET} --target-dir
|
||||
${RUST_BUILD_DIR}
|
||||
DEPENDS ${RUST_CRATE_SOURCES}
|
||||
COMMENT "Building Rust crate ${CRATE_NAME}"
|
||||
VERBATIM)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue