From 5d6494df9e4d399e260c2ed3f0405a858c3e8e1f Mon Sep 17 00:00:00 2001 From: Zhanwei Wang Date: Tue, 8 Oct 2024 08:49:18 +0800 Subject: [PATCH] Add code coverage to example target --- cmake/build.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/build.cmake b/cmake/build.cmake index 2119b32..0e18225 100644 --- a/cmake/build.cmake +++ b/cmake/build.cmake @@ -131,6 +131,14 @@ function(demo_add_example) if (DEMO_ENABLE_SANITIZERS AND AAL_FILES) add_sanitizers(${AAL_TARGET}) endif () + + if (ASDE_ENABLE_COVERAGE) + append_coverage_compiler_flags_to_target(${AAL_TARGET}) + + foreach (COVERAGE_TARGET IN LISTS ASDE_COVERAGE_TARGETS) + add_dependencies(${COVERAGE_TARGET} ${AAL_TARGET}) + endforeach () + endif () endfunction() if (DEMO_ENABLE_TEST)