cmake: Populate var CMAKE_GCOV
For each compiler, also set a CMAKE_GCOV var referencing the appropriate gcov tool. Tested with gcc and host-gcc on the ChromeOS codebase. Signed-off-by: Jeremy Bettis <jbettis@chromium.org>
This commit is contained in:
parent
e9f238889b
commit
1fee4849bc
5 changed files with 7 additions and 0 deletions
|
@ -19,6 +19,8 @@ if(NOT CMAKE_DTS_PREPROCESSOR)
|
|||
endif()
|
||||
|
||||
find_program(CMAKE_C_COMPILER ${CROSS_COMPILE}ccac PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
||||
find_program(CMAKE_LLVM_COV ${CROSS_COMPILE}llvm-cov PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
||||
set(CMAKE_GCOV "${CMAKE_LLVM_COV} gcov")
|
||||
|
||||
if(CMAKE_C_COMPILER STREQUAL CMAKE_C_COMPILER-NOTFOUND)
|
||||
message(FATAL_ERROR "Zephyr was unable to find the Metaware compiler")
|
||||
|
|
|
@ -5,4 +5,6 @@ if(DEFINED TOOLCHAIN_HOME)
|
|||
endif()
|
||||
|
||||
find_program(CMAKE_C_COMPILER clang ${find_program_clang_args})
|
||||
find_program(CMAKE_LLVM_COV llvm-cov ${find_program_clang_args})
|
||||
set(CMAKE_GCOV "${CMAKE_LLVM_COV} gcov")
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
set_ifndef(CC gcc)
|
||||
|
||||
find_program(CMAKE_C_COMPILER ${CROSS_COMPILE}${CC} PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
||||
find_program(CMAKE_GCOV ${CROSS_COMPILE}gcov PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
||||
|
||||
if(CMAKE_C_COMPILER STREQUAL CMAKE_C_COMPILER-NOTFOUND)
|
||||
message(FATAL_ERROR "Zephyr was unable to find the toolchain. Is the environment misconfigured?
|
||||
|
|
|
@ -3,3 +3,4 @@
|
|||
# Configures CMake for using GCC
|
||||
|
||||
find_program(CMAKE_C_COMPILER gcc)
|
||||
find_program(CMAKE_GCOV gcov)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
set_ifndef(CC gcc)
|
||||
|
||||
find_program(CMAKE_C_COMPILER ${CROSS_COMPILE}${CC} PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
||||
find_program(CMAKE_GCOV ${CROSS_COMPILE}gcov PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
||||
|
||||
if(CMAKE_C_COMPILER STREQUAL CMAKE_C_COMPILER-NOTFOUND)
|
||||
message(FATAL_ERROR "Zephyr was unable to find the toolchain. Is the environment misconfigured?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue