-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lcov targets fail with Ninja #29
Comments
Could you provide a patch for this issue? I can reproduce the issue, but unfortunately I'm not familiar with ninja. |
Me neither :-) but I'll try. Give me a few days. |
There a number of potential issues with using the CMake-codecov library with Ninja in its current form which you might be encountering. The first is that when you perform in source builds with Ninja via CMake even if you pass paths in absolute form Ninja will convert them to relative form (this is a problem because the library in its current form generated GCov information with relative paths), see details here: https://gitlab.kitware.com/cmake/cmake/-/issues/13894 Craig Scott proposed the correct solution here: https://gitlab.kitware.com/cmake/cmake/-/issues/20001. That is the Gcc supports a flag, set(__coverageFlags --coverage)
check_cxx_compiler_flag(-fprofile-abs-path HAVE_fprofile_abs_path)
if(HAVE_fprofile_abs_path)
list(APPEND __coverageFlags -fprofile-abs-path)
endif() The next potential issue and the one it looks like you are encountering here is that geninfo will only generate info for files from the *.gcda files that it finds in the path of the If any of this is not clear or you have questions then let me know. It would be great to see these issues resolved in the library. |
The same example provided in issue #6 shows that also the support for lcov is failing when using the Ninja generator.
At least the first error (
geninfo: WARNING: could not open /home/giaco/tmp/test.cc
) can be fixed passing${CMAKE_BINARY_DIR}
instead of${CMAKE_SOURCE_DIR}
to the--base-directory
option ofgeninfo
. This because Ninja works with paths relative to the binary directory.Everything works fine with the Makefile generator, which works with absolute paths.
The text was updated successfully, but these errors were encountered: