cmake: Support coverage flags on all archs

Most arch's CMakeLists.txt contain rules to add compiler and linker
flags for coverage if CONFIG_COVERAGE is enabled, but 4 of them were
missing this.

Instead, set the coverage flags in arch/common/CMakeLists.txt which
affects all archs.

Signed-off-by: Jeremy Bettis <jbettis@chromium.org>
This commit is contained in:
Jeremy Bettis 2021-06-03 14:33:39 -06:00 committed by Anas Nashif
parent e96df40004
commit 2de4a902de
6 changed files with 5 additions and 25 deletions

View file

@ -2,11 +2,6 @@
zephyr_library()
if(CONFIG_COVERAGE)
zephyr_compile_options($<TARGET_PROPERTY:compiler,coverage>)
zephyr_link_libraries($<TARGET_PROPERTY:linker,coverage>)
endif()
zephyr_library_sources(
thread.c
thread_entry_wrapper.S

View file

@ -2,11 +2,6 @@
zephyr_library()
if (CONFIG_COVERAGE)
zephyr_compile_options($<TARGET_PROPERTY:compiler,coverage>)
zephyr_link_libraries($<TARGET_PROPERTY:linker,coverage>)
endif ()
zephyr_library_sources(
swap.c
swap_helper.S

View file

@ -2,11 +2,6 @@
zephyr_library()
if (CONFIG_COVERAGE)
zephyr_compile_options($<TARGET_PROPERTY:compiler,coverage>)
zephyr_link_libraries($<TARGET_PROPERTY:linker,coverage>)
endif ()
zephyr_library_sources(
cpu_idle.S
fatal.c

View file

@ -52,3 +52,8 @@ if (CONFIG_GEN_ISR_TABLES)
target_link_libraries(isr_tables zephyr_interface)
zephyr_library_link_libraries(isr_tables)
endif()
if(CONFIG_COVERAGE)
zephyr_compile_options($<TARGET_PROPERTY:compiler,coverage>)
zephyr_link_libraries($<TARGET_PROPERTY:linker,coverage>)
endif()

View file

@ -24,11 +24,6 @@ zephyr_compile_options($<TARGET_PROPERTY:compiler,hosted>)
zephyr_include_directories(${BOARD_DIR})
if (CONFIG_COVERAGE)
zephyr_compile_options($<TARGET_PROPERTY:compiler,coverage>)
zephyr_link_libraries($<TARGET_PROPERTY:linker,coverage>)
endif ()
if (CONFIG_ASAN)
zephyr_compile_options($<TARGET_PROPERTY:compiler,sanitize_address>)
zephyr_link_libraries($<TARGET_PROPERTY:linker,sanitize_address>)

View file

@ -3,11 +3,6 @@
zephyr_library()
if (CONFIG_COVERAGE)
zephyr_compile_options($<TARGET_PROPERTY:compiler,coverage>)
zephyr_link_libraries($<TARGET_PROPERTY:linker,coverage>)
endif ()
zephyr_library_sources(cpuhalt.c)
zephyr_library_sources(prep_c.c)
zephyr_library_sources(fatal.c)