cmake: modules: Add zephyr_library_add_dependencies extension
Add a CMake zephyr library extension for add_dependencies, similar to the target_<func> functions. This avoids using ${ZEPHYR_CURRENT_LIBRARY} directly. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
parent
f52f76fd6b
commit
58152eb938
1 changed files with 16 additions and 0 deletions
|
@ -528,6 +528,10 @@ function(zephyr_library_cc_option)
|
|||
endforeach()
|
||||
endfunction()
|
||||
|
||||
function(zephyr_library_add_dependencies)
|
||||
add_dependencies(${ZEPHYR_CURRENT_LIBRARY} ${ARGN})
|
||||
endfunction()
|
||||
|
||||
# Add the existing CMake library 'library' to the global list of
|
||||
# Zephyr CMake libraries. This is done automatically by the
|
||||
# constructor but must be called explicitly on CMake libraries that do
|
||||
|
@ -1819,6 +1823,12 @@ function(zephyr_linker_sources_ifdef feature_toggle)
|
|||
endif()
|
||||
endfunction()
|
||||
|
||||
function(zephyr_library_add_dependencies_ifdef feature_toggle)
|
||||
if(${${feature_toggle}})
|
||||
zephyr_library_add_dependencies(${ARGN})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
macro(list_append_ifdef feature_toggle list)
|
||||
if(${${feature_toggle}})
|
||||
list(APPEND ${list} ${ARGN})
|
||||
|
@ -1965,6 +1975,12 @@ function(zephyr_linker_sources_ifndef feature_toggle)
|
|||
endif()
|
||||
endfunction()
|
||||
|
||||
function(zephyr_library_add_dependencies_ifndef feature_toggle)
|
||||
if(NOT ${feature_toggle})
|
||||
zephyr_library_add_dependencies(${ARGN})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
macro(list_append_ifndef feature_toggle list)
|
||||
if(NOT ${feature_toggle})
|
||||
list(APPEND ${list} ${ARGN})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue