cmake: reports: Add support for JSON prefix

Adds support for prefixing files with the target of bl2 or tfm

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit is contained in:
Jamie McCrae 2025-01-30 12:33:13 +00:00 committed by Benjamin Cabé
commit f80446973a

View file

@ -29,7 +29,7 @@ foreach(report ram_report rom_report footprint)
) )
endforeach() endforeach()
if (CONFIG_BUILD_WITH_TFM) if(CONFIG_BUILD_WITH_TFM)
foreach(report ram_report rom_report footprint) foreach(report ram_report rom_report footprint)
add_custom_target( add_custom_target(
tfm_${report} tfm_${report}
@ -40,6 +40,7 @@ if (CONFIG_BUILD_WITH_TFM)
-o ${CMAKE_BINARY_DIR} -o ${CMAKE_BINARY_DIR}
${workspace_arg} ${workspace_arg}
-d ${report_depth} -d ${report_depth}
--json tfm_${report}.json
${flag_for_${report}} ${flag_for_${report}}
DEPENDS tfm DEPENDS tfm
USES_TERMINAL USES_TERMINAL
@ -48,22 +49,23 @@ if (CONFIG_BUILD_WITH_TFM)
endforeach() endforeach()
endif() endif()
if (CONFIG_TFM_BL2) if(CONFIG_TFM_BL2)
foreach(report ram_report rom_report footprint) foreach(report ram_report rom_report footprint)
add_custom_target( add_custom_target(
bl2_${report} bl2_${report}
${PYTHON_EXECUTABLE} ${PYTHON_EXECUTABLE}
${ZEPHYR_BASE}/scripts/footprint/size_report ${ZEPHYR_BASE}/scripts/footprint/size_report
-k $<TARGET_PROPERTY:tfm,BL2_ELF_FILE> -k $<TARGET_PROPERTY:tfm,BL2_ELF_FILE>
-z ${ZEPHYR_BASE} -z ${ZEPHYR_BASE}
-o ${CMAKE_BINARY_DIR} -o ${CMAKE_BINARY_DIR}
${workspace_arg} ${workspace_arg}
-d ${report_depth} -d ${report_depth}
${flag_for_${report}} --json bl2_${report}.json
DEPENDS tfm ${flag_for_${report}}
USES_TERMINAL DEPENDS tfm
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} USES_TERMINAL
) WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
endforeach() endforeach()
endif() endif()