Skip to content
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

Ninja build does not work for coverage target #59

Open
ahueck opened this issue Apr 1, 2021 · 0 comments
Open

Ninja build does not work for coverage target #59

ahueck opened this issue Apr 1, 2021 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@ahueck
Copy link
Contributor

ahueck commented Apr 1, 2021

Building TypeART with ninja works but executing the (lcov) coverage targets fails (e.g., lcov-make).

Most likely this behavior comes from differences between make and ninja w.r.t. commands in add_custom_target, see https://gitlab.kitware.com/cmake/cmake/-/issues/21778

The respective targets have to be re-worked for ninja-compat.

Update

Ninja doesn't like the lcov-make target, in particular, both the fragments --no-extenal and -b ${CMAKE_SOURCE_DIR}.
What seems to work is:

add_custom_target(
  lcov-make
  COMMAND ${LCOV_COMMAND} ${GCOV_TOOL} ${GCOV_WORKAROUND} -c -d ${CMAKE_BINARY_DIR} -o typeart.coverage
  COMMAND ${LCOV_COMMAND} --remove typeart.coverage '${CMAKE_BINARY_DIR}/*' -o typeart.coverage
  # need to remove externals:
  COMMAND ${LCOV_COMMAND} --remove typeart.coverage '/usr/*' -o typeart.coverage
  COMMAND ${LCOV_COMMAND} --remove typeart.coverage '*/llvm/*' -o typeart.coverage
)
@ahueck ahueck added the bug Something isn't working label Apr 1, 2021
@ahueck ahueck added the enhancement New feature or request label Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant