mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 04:19:37 +08:00
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:
committed by
Xiang Xiao
parent
a5cb084c1f
commit
7bbb96205b
@@ -28,5 +28,10 @@ if(CONFIG_COVERAGE_MINI AND CONFIG_ARCH_TOOLCHAIN_GCC)
|
|||||||
target_compile_options(
|
target_compile_options(
|
||||||
libcoverage PRIVATE -fno-profile-arcs -fno-test-coverage
|
libcoverage PRIVATE -fno-profile-arcs -fno-test-coverage
|
||||||
-fno-stack-protector)
|
-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)
|
target_sources(libcoverage PRIVATE gcov.c)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user