cmake: add zephyr_link_libraries_ifdef

Link libraries only when config is defined.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2017-11-22 08:07:12 -05:00 committed by Anas Nashif
commit 2bbe6af07c

View file

@ -679,6 +679,12 @@ function(zephyr_cc_option_ifdef feature_toggle)
endif() endif()
endfunction() endfunction()
function(zephyr_ld_option_ifdef feature_toggle)
if(${${feature_toggle}})
zephyr_ld_options(${ARGN})
endif()
endfunction()
function(zephyr_link_libraries_ifdef feature_toggle) function(zephyr_link_libraries_ifdef feature_toggle)
if(${${feature_toggle}}) if(${${feature_toggle}})
zephyr_link_libraries(${ARGN}) zephyr_link_libraries(${ARGN})