CMake: Fix link error
Bringing the code coverage option when linking may cause gcc or g++ to automatically link the libgcov.a that comes with the toolchain. Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
This commit is contained in:
parent
a5cb084c1f
commit
7bbb96205b
1 changed files with 5 additions and 0 deletions
|
|
@ -28,5 +28,10 @@ if(CONFIG_COVERAGE_MINI AND CONFIG_ARCH_TOOLCHAIN_GCC)
|
|||
target_compile_options(
|
||||
libcoverage PRIVATE -fno-profile-arcs -fno-test-coverage
|
||||
-fno-stack-protector)
|
||||
|
||||
list(REMOVE_ITEM NUTTX_EXTRA_FLAGS "-fprofile-arcs" "-ftest-coverage"
|
||||
"-fno-inline")
|
||||
set_property(GLOBAL PROPERTY NUTTX_EXTRA_FLAGS ${NUTTX_EXTRA_FLAGS})
|
||||
|
||||
target_sources(libcoverage PRIVATE gcov.c)
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue