From 6ef0e948efac9bb6824807223813eae62266acfb Mon Sep 17 00:00:00 2001 From: Manuel Leonhardt Date: Tue, 12 Jul 2022 22:57:16 +0200 Subject: [PATCH] Find gcov prefixed with compiler target triplet and env variable hint --- cmake/FindGcov.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmake/FindGcov.cmake b/cmake/FindGcov.cmake index db03e53..872737e 100644 --- a/cmake/FindGcov.cmake +++ b/cmake/FindGcov.cmake @@ -32,8 +32,15 @@ foreach (LANG ${ENABLED_LANGUAGES}) string(REGEX MATCH "^[0-9]+" GCC_VERSION "${CMAKE_${LANG}_COMPILER_VERSION}") - find_program(GCOV_BIN NAMES gcov-${GCC_VERSION} gcov - HINTS ${COMPILER_PATH}) + find_program(GCOV_BIN + NAMES + ${CMAKE_${LANG}_COMPILER_TARGET}-gcov + gcov-${GCC_VERSION} + gcov + HINTS + ${COMPILER_PATH} + ENV GCOV + ) elseif ("${CMAKE_${LANG}_COMPILER_ID}" MATCHES "^(Apple)?Clang$") # Some distributions like Debian ship llvm-cov with the compiler