cmake: modules: Add zephyr_code_relocate_ifdef() macro
Currently zephyr_code_relocate() will exit with an error if the library does not exist. This commit adds a macro that only calls zephyr_code_relocate() when a specific Kconfig symbol is enabled. Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
This commit is contained in:
parent
db2624def4
commit
53c5897b98
1 changed files with 8 additions and 0 deletions
|
@ -1300,6 +1300,14 @@ function(zephyr_linker_sources location)
|
|||
endforeach()
|
||||
endfunction(zephyr_linker_sources)
|
||||
|
||||
# Helper macro for conditionally calling zephyr_code_relocate() when a
|
||||
# specific Kconfig symbol is enabled. See zephyr_code_relocate() description
|
||||
# for supported arguments.
|
||||
macro(zephyr_code_relocate_ifdef feature_toggle)
|
||||
if(${${feature_toggle}})
|
||||
zephyr_code_relocate(${ARGN})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Helper function for CONFIG_CODE_DATA_RELOCATION
|
||||
# This function may either be invoked with a list of files, or a library
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue