From 2de4a902dec97a4edbaac13bc4e93afa432e7909 Mon Sep 17 00:00:00 2001 From: Jeremy Bettis Date: Thu, 3 Jun 2021 14:33:39 -0600 Subject: [PATCH] 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 --- arch/arc/core/CMakeLists.txt | 5 ----- arch/arm/core/aarch32/CMakeLists.txt | 5 ----- arch/arm64/core/CMakeLists.txt | 5 ----- arch/common/CMakeLists.txt | 5 +++++ arch/posix/CMakeLists.txt | 5 ----- arch/x86/core/CMakeLists.txt | 5 ----- 6 files changed, 5 insertions(+), 25 deletions(-) diff --git a/arch/arc/core/CMakeLists.txt b/arch/arc/core/CMakeLists.txt index feeb9dcb28..0005aef573 100644 --- a/arch/arc/core/CMakeLists.txt +++ b/arch/arc/core/CMakeLists.txt @@ -2,11 +2,6 @@ zephyr_library() -if(CONFIG_COVERAGE) - zephyr_compile_options($) - zephyr_link_libraries($) -endif() - zephyr_library_sources( thread.c thread_entry_wrapper.S diff --git a/arch/arm/core/aarch32/CMakeLists.txt b/arch/arm/core/aarch32/CMakeLists.txt index 6c07205006..80c3e06c49 100644 --- a/arch/arm/core/aarch32/CMakeLists.txt +++ b/arch/arm/core/aarch32/CMakeLists.txt @@ -2,11 +2,6 @@ zephyr_library() -if (CONFIG_COVERAGE) - zephyr_compile_options($) - zephyr_link_libraries($) -endif () - zephyr_library_sources( swap.c swap_helper.S diff --git a/arch/arm64/core/CMakeLists.txt b/arch/arm64/core/CMakeLists.txt index e36c9a6ae7..b3d0731414 100644 --- a/arch/arm64/core/CMakeLists.txt +++ b/arch/arm64/core/CMakeLists.txt @@ -2,11 +2,6 @@ zephyr_library() -if (CONFIG_COVERAGE) - zephyr_compile_options($) - zephyr_link_libraries($) -endif () - zephyr_library_sources( cpu_idle.S fatal.c diff --git a/arch/common/CMakeLists.txt b/arch/common/CMakeLists.txt index d220ca6cf7..3f6e5984c2 100644 --- a/arch/common/CMakeLists.txt +++ b/arch/common/CMakeLists.txt @@ -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($) + zephyr_link_libraries($) +endif() diff --git a/arch/posix/CMakeLists.txt b/arch/posix/CMakeLists.txt index 664c7a3a3a..ddae0a787d 100644 --- a/arch/posix/CMakeLists.txt +++ b/arch/posix/CMakeLists.txt @@ -24,11 +24,6 @@ zephyr_compile_options($) zephyr_include_directories(${BOARD_DIR}) -if (CONFIG_COVERAGE) - zephyr_compile_options($) - zephyr_link_libraries($) -endif () - if (CONFIG_ASAN) zephyr_compile_options($) zephyr_link_libraries($) diff --git a/arch/x86/core/CMakeLists.txt b/arch/x86/core/CMakeLists.txt index e91bf735c7..66537c5547 100644 --- a/arch/x86/core/CMakeLists.txt +++ b/arch/x86/core/CMakeLists.txt @@ -3,11 +3,6 @@ zephyr_library() -if (CONFIG_COVERAGE) - zephyr_compile_options($) - zephyr_link_libraries($) -endif () - zephyr_library_sources(cpuhalt.c) zephyr_library_sources(prep_c.c) zephyr_library_sources(fatal.c)