forked from nuttx/nuttx-update
cmake(bugfix):make sure the extra_lib only added once
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
parent
832a76542f
commit
ba56c6c102
1 changed files with 7 additions and 5 deletions
|
@ -201,12 +201,14 @@ function(nuttx_add_extra_library)
|
||||||
# define the target name of the extra library
|
# define the target name of the extra library
|
||||||
string(REGEX REPLACE "[^a-zA-Z0-9]" "_" extra_target "${extra_lib}")
|
string(REGEX REPLACE "[^a-zA-Z0-9]" "_" extra_target "${extra_lib}")
|
||||||
# set the absolute path of the library for the import target
|
# set the absolute path of the library for the import target
|
||||||
|
if(NOT TARGET ${extra_target})
|
||||||
nuttx_library_import(${extra_target} ${extra_lib})
|
nuttx_library_import(${extra_target} ${extra_lib})
|
||||||
set_property(GLOBAL APPEND PROPERTY NUTTX_EXTRA_LIBRARIES ${extra_target})
|
set_property(GLOBAL APPEND PROPERTY NUTTX_EXTRA_LIBRARIES ${extra_target})
|
||||||
if(CONFIG_BUILD_PROTECTED)
|
if(CONFIG_BUILD_PROTECTED)
|
||||||
set_property(GLOBAL APPEND PROPERTY NUTTX_USER_EXTRA_LIBRARIES
|
set_property(GLOBAL APPEND PROPERTY NUTTX_USER_EXTRA_LIBRARIES
|
||||||
${extra_target})
|
${extra_target})
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue