Skip to content

Commit 10625b3

Browse files
committed
CMake: Update hal and platform stub CMake linker options for coverage
- Armclang is not working when we add gcov as target_link_libraries, modified to pass as linker options with --coverage so it can work armclang and gcc
1 parent f096b3b commit 10625b3

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

UNITTESTS/stubs/hal/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ target_sources(mbed-stubs-hal
1717
watchdog_api_stub.c
1818
)
1919

20+
target_link_options(mbed-stubs-hal
21+
PRIVATE
22+
--coverage
23+
)
24+
2025
target_link_libraries(mbed-stubs-hal
2126
PRIVATE
2227
mbed-headers
2328
mbed-stubs-headers
24-
gcov
2529
)

UNITTESTS/stubs/platform/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ target_sources(mbed-stubs-platform
1818
randLIB_stub.cpp
1919
)
2020

21+
target_link_options(mbed-stubs-platform
22+
PRIVATE
23+
--coverage
24+
)
25+
2126
target_link_libraries(mbed-stubs-platform
2227
PRIVATE
2328
mbed-headers
2429
mbed-stubs-headers
25-
gcov
2630
)

0 commit comments

Comments
 (0)