Trying to use this for templates header only library. It is defined as an interface but your gcov stuff is implemented with PRIVATE. I show the following modifications get me further but I still dont see results at the end of the build..
set(options AUTO ALL EXTERNAL INTERFACE)
...
elseif(CMAKE_COMPILER_IS_GNUCXX)
if (NOT target_code_coverage_INTERFACE)
target_compile_options(${TARGET_NAME} PRIVATE -fprofile-arcs
-ftest-coverage
-fno-inline
-fno-inline-small-functions
-fno-default-inline)
target_link_libraries(${TARGET_NAME} PRIVATE gcov)
else()
target_compile_options(${TARGET_NAME} INTERFACE -fprofile-arcs
-ftest-coverage
-fno-inline
-fno-inline-small-functions
-fno-default-inline)
target_link_libraries(${TARGET_NAME} INTERFACE gcov)
endif()
endif()
Thoughts on the complete solution or should these changes do the trick? Thanks in advance.
geninfo: WARNING: cannot find an entry for #usr#include#c++#8#array.gcov in .gcno file, skipping file!
geninfo: WARNING: cannot find an entry for #usr#include#c++#8#bits#alloc_traits.h.gcov in .gcno file, skipping file!
geninfo: WARNING: cannot find an entry for #usr#include#c++#8#bits#allocator.h.gcov in .gcno file, skipping file!
geninfo: WARNING: cannot find an entry for #usr#include#c++#8#bits#basic_string.h.gcov in .gcno file, skipping file!
geninfo: WARNING: cannot find an entry for #usr#include#c++#8#bits#basic_string.tcc.gcov in .gcno file, skipping file!
geninfo: WARNING: cannot find an entry for #usr#include#c++#8#bits#char_traits.h.gcov in .gcno file, skipping file!
geninfo: WARNING: cannot find an entry for #usr#include#c++#8#bits#cpp_type_traits.h.gcov in .gcno file, skipping file!
geninfo: WARNING: cannot find an entry for #usr#include#c++#8#bits#functional_hash.h.gcov in .gcno file, skipping file!
geninfo: WARNING: cannot find an entry for #usr#include#c++#8#bits#hashtable.h.gcov in .gcno file, skipping file!
geninfo: WARNING: cannot find an entry for #usr#include#c++#8#bits#hashtable_policy.h.gcov in .gcno file, skipping file!
geninfo: WARNING: cannot find an entry for #usr#include#c++#8#bits#ios_base.h.gcov in .gcno file, skipping file!
geninfo: WARNING: cannot find an entry for #usr#include#c++#8#bits#move.h.gcov in .gcno file, skipping file!
geninfo: WARNING: cannot find an entry for #usr#include#c++#8#bits#predefined_ops.h.gcov in .gcno file, skipping file!
geninfo: WARNING: cannot find an entry for #usr#include#c++#8#bits#ptr_traits.h.gcov in .gcno file, skipping file!