Поддержка проверки покрытия кода в Clang
This commit is contained in:
parent
c2ac523d86
commit
7e50160742
@ -6,12 +6,21 @@ if(MYX_CMAKE_CODE_COVERAGE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(myx_cmake_code_coverage target)
|
function(myx_cmake_code_coverage target)
|
||||||
if(CMAKE_CXX_COMPILER_IS_GCC AND MYX_CMAKE_CODE_COVERAGE)
|
if(MYX_CMAKE_CODE_COVERAGE)
|
||||||
|
if(CMAKE_CXX_COMPILER_IS_GCC)
|
||||||
target_compile_options(${target} PUBLIC "--coverage")
|
target_compile_options(${target} PUBLIC "--coverage")
|
||||||
set_property(
|
set_property(
|
||||||
TARGET ${target}
|
TARGET ${target}
|
||||||
APPEND_STRING
|
APPEND_STRING
|
||||||
PROPERTY LINK_FLAGS " --coverage")
|
PROPERTY LINK_FLAGS " --coverage")
|
||||||
|
endif()
|
||||||
|
if(CMAKE_CXX_COMPILER_IS_CLANG)
|
||||||
|
target_compile_options(${target} PUBLIC "-fprofile-instr-generate -fcoverage-mapping")
|
||||||
|
set_property(
|
||||||
|
TARGET ${target}
|
||||||
|
APPEND_STRING
|
||||||
|
PROPERTY LINK_FLAGS " --coverage")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(LCOV_EXE)
|
if(LCOV_EXE)
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
|
Loading…
Reference in New Issue
Block a user