cmake: extensions: Added a new macro zephyr_library_ifdef
Checks if a certain Kconfig is enabled and then do the same operation as zephyr_library. If it finds that the Kconfig is not set it will not create a new library and will stop processing the rest of the CMakeFile.txt. Usefull in processing the driver Cmake files. Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
This commit is contained in:
parent
16a8a309a3
commit
c674167fea
1 changed files with 12 additions and 0 deletions
|
@ -905,6 +905,18 @@ macro(list_append_ifdef feature_toggle list)
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
# Checks if a feature is enabled and then does the same operation as
|
||||||
|
# zephyr_library. If it finds that the feature is not set it will not
|
||||||
|
# create a new library and will stop processing the rest of
|
||||||
|
# the CMakeFile.txt
|
||||||
|
macro(zephyr_library_ifdef feature_toggle)
|
||||||
|
if(${${feature_toggle}})
|
||||||
|
zephyr_library()
|
||||||
|
else()
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
# 3.2. *_ifndef
|
# 3.2. *_ifndef
|
||||||
# See 3.1 *_ifdef
|
# See 3.1 *_ifdef
|
||||||
function(set_ifndef variable value)
|
function(set_ifndef variable value)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue