2019-04-06 15:08:09 +02:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2017-10-27 15:43:34 +02:00
|
|
|
set(flag_for_ram_report -r)
|
|
|
|
set(flag_for_rom_report -F)
|
|
|
|
|
|
|
|
foreach(report ram_report rom_report)
|
|
|
|
add_custom_target(
|
|
|
|
${report}
|
|
|
|
${PYTHON_EXECUTABLE}
|
2018-01-11 15:46:44 +01:00
|
|
|
${ZEPHYR_BASE}/scripts/footprint/size_report
|
2017-10-27 15:43:34 +02:00
|
|
|
${flag_for_${report}}
|
2017-12-12 10:50:05 +01:00
|
|
|
--objdump ${CMAKE_OBJDUMP}
|
2018-01-26 13:26:21 +01:00
|
|
|
--objcopy ${CMAKE_OBJCOPY}
|
2017-12-12 10:50:05 +01:00
|
|
|
--nm ${CMAKE_NM}
|
2017-10-27 15:43:34 +02:00
|
|
|
-o ${PROJECT_BINARY_DIR}
|
|
|
|
DEPENDS ${logical_target_for_zephyr_elf}
|
2020-01-17 15:03:11 +01:00
|
|
|
$<TARGET_PROPERTY:zephyr_property_target,${report}_DEPENDENCIES>
|
2017-10-27 15:43:34 +02:00
|
|
|
)
|
|
|
|
endforeach()
|
2020-05-04 13:53:00 +02:00
|
|
|
|
|
|
|
find_program(PUNCOVER puncover)
|
|
|
|
|
|
|
|
if(NOT ${PUNCOVER} STREQUAL PUNCOVER-NOTFOUND)
|
|
|
|
add_custom_target(
|
|
|
|
puncover
|
|
|
|
${PUNCOVER}
|
|
|
|
--elf_file ${ZEPHYR_BINARY_DIR}/${KERNEL_ELF_NAME}
|
|
|
|
--gcc_tools_base ${CROSS_COMPILE}
|
|
|
|
--src_root ${ZEPHYR_BASE}
|
|
|
|
--build_dir ${CMAKE_BINARY_DIR}
|
|
|
|
DEPENDS ${logical_target_for_zephyr_elf}
|
|
|
|
$<TARGET_PROPERTY:zephyr_property_target,${report}_DEPENDENCIES>
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
USES_TERMINAL
|
|
|
|
)
|
|
|
|
endif()
|