summaryrefslogtreecommitdiff
path: root/zephyr/cmake/linker/ld/gcc/linker_flags.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/cmake/linker/ld/gcc/linker_flags.cmake')
-rw-r--r--zephyr/cmake/linker/ld/gcc/linker_flags.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/zephyr/cmake/linker/ld/gcc/linker_flags.cmake b/zephyr/cmake/linker/ld/gcc/linker_flags.cmake
index f71793c431..b5ec8b05ca 100644
--- a/zephyr/cmake/linker/ld/gcc/linker_flags.cmake
+++ b/zephyr/cmake/linker/ld/gcc/linker_flags.cmake
@@ -2,6 +2,10 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+if (NOT CONFIG_COVERAGE_GCOV)
+ set_property(TARGET linker PROPERTY coverage -lgcov)
+endif()
+
# GCC 11 by default emits DWARF version 5 which cannot be parsed by
# pyelftools. Can be removed once pyelftools supports v5.
add_link_options(-gdwarf-4)