scripts: zspdx: Include modules as packages in zephyr.spdx

The current zephyr.spdx does not contain the modules included in the build.
This commit split the zephyr-sources package into multiple packages, one
for each modules found by zephyr_module.py.

Signed-off-by: Thomas Gagneret <tgagneret@witekio.com>
This commit is contained in:
Thomas Gagneret 2023-12-05 17:41:06 +01:00 committed by Carles Cufí
commit 7bde51bccf
3 changed files with 147 additions and 88 deletions

View file

@ -1622,18 +1622,20 @@ if(CONFIG_BUILD_OUTPUT_BIN AND CONFIG_BUILD_OUTPUT_UF2)
endif()
if(CONFIG_BUILD_OUTPUT_META)
set(KERNEL_META_PATH ${PROJECT_BINARY_DIR}/${KERNEL_META_NAME} CACHE INTERNAL "")
list(APPEND
post_build_commands
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/zephyr_module.py
${WEST_ARG}
${ZEPHYR_MODULES_ARG}
${EXTRA_ZEPHYR_MODULES_ARG}
--meta-out ${KERNEL_META_NAME}
--meta-out ${KERNEL_META_PATH}
$<$<BOOL:${CONFIG_BUILD_OUTPUT_META_STATE_PROPAGATE}>:--meta-state-propagate>
)
list(APPEND
post_build_byproducts
${KERNEL_META_NAME}
${KERNEL_META_PATH}
)
endif()