diff --git a/cmake/reports/CMakeLists.txt b/cmake/reports/CMakeLists.txt index 53068587c5b..53dc3382352 100644 --- a/cmake/reports/CMakeLists.txt +++ b/cmake/reports/CMakeLists.txt @@ -17,3 +17,20 @@ foreach(report ram_report rom_report) $ ) endforeach() + +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} + $ + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + USES_TERMINAL + ) +endif()