# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# Include definitions for bfd as a base.
include("${ZEPHYR_BASE}/cmake/linker/ld/linker_flags.cmake")

# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# Include definitions for bfd as a base.
include("${ZEPHYR_BASE}/cmake/linker/ld/linker_flags.cmake")

set_property(TARGET linker PROPERTY coverage --coverage)

Fix the coverage property for linker/lld.
zephyr: Fix the coverage property for linker/lld.

Zephyr has a linker config for clang, but we don't use that and instead
have our own linker definition for ld.lld. If you have code coverage
enabled, the --coverage flag is missing from the link step. This fixes
that.

BUG=b:183007888
TEST=Add CONFIG_COVERAGE=y to test/base32/prj.conf and zmake.
BRANCH=none

Signed-off-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>
Change-Id: Ibb3d420cf92e48507768f916fa4792d5bc90e2d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2765150
Reviewed-by: Simon Glass <c00b0378376498bd9cd974c388df8854c0131d27@chromium.org>
