Skip to content

Commit

Permalink
cmake(bugfix):make sure the extra_lib only added once
Browse files Browse the repository at this point in the history
Signed-off-by: xuxin19 <[email protected]>
  • Loading branch information
xuxin930 authored and xiaoxiang781216 committed Nov 4, 2024
1 parent 832a765 commit ba56c6c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cmake/nuttx_add_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,13 @@ function(nuttx_add_extra_library)
# define the target name of the extra library
string(REGEX REPLACE "[^a-zA-Z0-9]" "_" extra_target "${extra_lib}")
# set the absolute path of the library for the import target
nuttx_library_import(${extra_target} ${extra_lib})
set_property(GLOBAL APPEND PROPERTY NUTTX_EXTRA_LIBRARIES ${extra_target})
if(CONFIG_BUILD_PROTECTED)
set_property(GLOBAL APPEND PROPERTY NUTTX_USER_EXTRA_LIBRARIES
${extra_target})
if(NOT TARGET ${extra_target})
nuttx_library_import(${extra_target} ${extra_lib})
set_property(GLOBAL APPEND PROPERTY NUTTX_EXTRA_LIBRARIES ${extra_target})
if(CONFIG_BUILD_PROTECTED)
set_property(GLOBAL APPEND PROPERTY NUTTX_USER_EXTRA_LIBRARIES
${extra_target})
endif()
endif()
endforeach()
endfunction()
Expand Down

0 comments on commit ba56c6c

Please sign in to comment.