Change(component.cmake): check for missing component_target

This commit is contained in:
gojimmypi 2024-06-20 14:32:38 +02:00
parent 0479494e7a
commit 9d1bf49497
No known key found for this signature in database
GPG Key ID: 3D684FA88DC3FAA8

View File

@ -376,10 +376,14 @@ endmacro()
function(idf_component_get_property var component property)
cmake_parse_arguments(_ "GENERATOR_EXPRESSION" "" "" ${ARGN})
__component_get_target(component_target ${component})
if(__GENERATOR_EXPRESSION)
set(val "$<TARGET_PROPERTY:${component_target},${property}>")
if("${component_target}" STREQUAL "")
message(FATAL_ERROR "Component ${component} not found")
else()
__component_get_property(val ${component_target} ${property})
if(__GENERATOR_EXPRESSION)
set(val "$<TARGET_PROPERTY:${component_target},${property}>")
else()
__component_get_property(val ${component_target} ${property})
endif()
endif()
set(${var} "${val}" PARENT_SCOPE)
endfunction()