From 82c1d6e3711e96a8ff1ae002d588f623528fccf0 Mon Sep 17 00:00:00 2001 From: Alexey Gerenkov Date: Wed, 22 Feb 2023 23:19:55 +0300 Subject: [PATCH] gcov: Do not link with libgcov when Clang is used --- components/app_trace/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/app_trace/CMakeLists.txt b/components/app_trace/CMakeLists.txt index 0968a31a82..2757ca224e 100644 --- a/components/app_trace/CMakeLists.txt +++ b/components/app_trace/CMakeLists.txt @@ -66,6 +66,12 @@ idf_component_register(SRCS "${srcs}" idf_component_get_property(app_trace app_trace COMPONENT_LIB) if(CONFIG_APPTRACE_GCOV_ENABLE) + if(CMAKE_C_COMPILER_ID MATCHES "Clang") + # Coverage info is not supported when clang is used + # TODO: LLVM-214 + message(FATAL_ERROR "Coverage info is not supported when building with Clang!") + endif() + # The original Gcov library from toolchain will be objcopy with symbols redefinitions (see file gcov/io_sym.map). # This needs because ESP has no file-system onboard, and redefined functions solves this problem and transmits # output file to host PC.