mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
cmake(bugfix):make sure the extra lib only added once
avoid duplicate definitions of target when `nuttx_add_extra_library` is called between different models at the same time Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
@@ -201,8 +201,10 @@ 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
|
||||||
nuttx_library_import(${extra_target} ${extra_lib})
|
if(NOT TARGET ${extra_target})
|
||||||
set_property(GLOBAL APPEND PROPERTY NUTTX_EXTRA_LIBRARIES ${extra_target})
|
nuttx_library_import(${extra_target} ${extra_lib})
|
||||||
|
set_property(GLOBAL APPEND PROPERTY NUTTX_EXTRA_LIBRARIES ${extra_target})
|
||||||
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user