Skip to content

Commit

Permalink
cmake:remove no need target_link_library in static target
Browse files Browse the repository at this point in the history
the link_library of the static target will cause PRIVATE to be inherited to nuttx,
resulting in duplicate linking and definition problems.
because all target static libraries will eventually be linked, there is no need to specify it explicitly.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
  • Loading branch information
xuxin930 authored and xiaoxiang781216 committed Nov 13, 2024
1 parent ec243f0 commit 3ae822c
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions cmake/nuttx_add_application.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,6 @@ function(nuttx_add_application)
# interface include and libraries
foreach(dep ${DEPENDS})
nuttx_add_dependencies(TARGET ${TARGET} DEPENDS ${dep})
if(TARGET ${dep})
get_target_property(dep_type ${dep} TYPE)
if(${dep_type} STREQUAL "STATIC_LIBRARY")
target_link_libraries(${TARGET} PRIVATE ${dep})
endif()
endif()

endforeach()
endif()
endfunction()

0 comments on commit 3ae822c

Please sign in to comment.