zephyr/cmake: fix llext.uuid growing from the last build

Reset the llext.uuid file so it does not start with content from the
previous build.

Fixes LLEXT incremental builds which apparently never worked (some
people like it slow?)

Fixes commit 05e69e1bb9 ("llext: update to use add_llext_target()")
and the ones before that.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2024-05-23 00:31:32 +00:00 committed by Kai Vehmanen
parent f9eaaba5ac
commit 2e6162bf78
1 changed files with 3 additions and 1 deletions

View File

@ -39,10 +39,12 @@ endfunction()
function(sof_llext_write_uuids module)
file(STRINGS ${CMAKE_CURRENT_LIST_DIR}/../${module}.toml uuids REGEX "^[ \t]*uuid *=")
set(UUIDS_LIST_FILE ${ZEPHYR_BINARY_DIR}/${module}_llext/llext.uuid)
file(REMOVE ${UUIDS_LIST_FILE})
foreach(line IN LISTS uuids)
# extract UUID value - drop the 'uuid = ' part of the assignment line
string(REGEX REPLACE "^[ \t]*uuid *= \"([0-9A-F\-]*)\"" "\\1" uuid ${line})
file(APPEND ${ZEPHYR_BINARY_DIR}/${module}_llext/llext.uuid "${uuid}\n")
file(APPEND ${UUIDS_LIST_FILE} "${uuid}\n")
endforeach()
endfunction()