Running gcov on the src files on my project doesn't work because in a CMake project the .gcno
file names are based on the object files resulting in a .cpp.gcno
suffix. I discovered through trial and error that it's possible to run gcov on the object file (i.e. gcov CMakeFiles/project.dir/src/project.cpp.o
), but I kept searching for answers because all the documentation I read said to use the original source files. I discovered from this answer that I can also run gcov on the .cpp.gcno
files.
Is there an inherent difference? Is one way more correct or prone to failure than the other? Both ways SEEM to work, but since I haven't seen any documentation on the subject it would be good to know.