diff --git a/code-coverage.cmake b/code-coverage.cmake index d19d83d..342b2d9 100644 --- a/code-coverage.cmake +++ b/code-coverage.cmake @@ -259,7 +259,7 @@ function(target_code_coverage TARGET_NAME) elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") target_compile_options(${TARGET_NAME} ${TARGET_VISIBILITY} -fprofile-arcs - -ftest-coverage) + -ftest-coverage -fno-elide-constructors -fno-default-inline) target_link_libraries(${TARGET_NAME} ${TARGET_LINK_VISIBILITY} gcov) endif() @@ -501,7 +501,7 @@ function(add_code_coverage) add_link_options(-fprofile-instr-generate -fcoverage-mapping) elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") - add_compile_options(-fprofile-arcs -ftest-coverage) + add_compile_options(-fprofile-arcs -ftest-coverage -fno-elide-constructors -fno-default-inline) link_libraries(gcov) endif() endif()