blob: dcf6c5f64b436469b6e42ae2de68994ad96f7ad8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
# SPDX-FileCopyrightText: 2025 Felix Morgner <felix.morgner@gmail.com>
# SPDX-License-Identifier: LGPL-2.1-only
function(enable_coverage TARGET)
target_compile_options("${TARGET}" PRIVATE
"$<$<AND:$<CXX_COMPILER_ID:GNU,Clang>,$<CONFIG:Debug>>:-fcondition-coverage>"
"$<$<AND:$<CXX_COMPILER_ID:GNU,Clang>,$<CONFIG:Debug>>:--coverage>"
)
target_link_libraries("${TARGET}" PRIVATE
"gcov"
)
endfunction()
|