Skip to content

Commit 2e654ef

Browse files
FreddyFunkStableCoder
authored andcommitted
do not inline when determining code coverage
1 parent e230a36 commit 2e654ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: code-coverage.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ function(target_code_coverage TARGET_NAME)
259259
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES
260260
"GNU")
261261
target_compile_options(${TARGET_NAME} ${TARGET_VISIBILITY} -fprofile-arcs
262-
-ftest-coverage)
262+
-ftest-coverage -fno-elide-constructors -fno-default-inline)
263263
target_link_libraries(${TARGET_NAME} ${TARGET_LINK_VISIBILITY} gcov)
264264
endif()
265265

@@ -501,7 +501,7 @@ function(add_code_coverage)
501501
add_link_options(-fprofile-instr-generate -fcoverage-mapping)
502502
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES
503503
"GNU")
504-
add_compile_options(-fprofile-arcs -ftest-coverage)
504+
add_compile_options(-fprofile-arcs -ftest-coverage -fno-elide-constructors -fno-default-inline)
505505
link_libraries(gcov)
506506
endif()
507507
endif()

0 commit comments

Comments
 (0)