zephyr/cmake/compiler/gcc/target_coverage.cmake
Jan Van Winkel f3eec6cba3 cmake: toolchain abstraction for coverage
Added toolchain abstraction for coverage for both gcc and clang.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-09-17 11:25:29 +02:00

20 lines
237 B
CMake

# SPDX-License-Identifier: Apache-2.0
macro(toolchain_cc_coverage)
zephyr_compile_options(
-fprofile-arcs
-ftest-coverage
-fno-inline
)
if (NOT CONFIG_COVERAGE_GCOV)
zephyr_link_libraries(
-lgcov
)
endif()
endmacro()