test: fix some cmake params (#3308)

This commit is contained in:
Francesco Borzì
2020-08-17 15:17:21 +02:00
committed by GitHub
parent da1725cfc3
commit da61bf3a42

View File

@@ -141,7 +141,8 @@ CU_RUN_HOOK("AFTER_SRC_LOAD")
if( UNIT_TESTS )
# we use this to get code coverage
if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
if(CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
message("Unit tests code coverage: enabling -fprofile-arcs -ftest-coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
endif()