fix(build): fix error message for absent component

This commit is contained in:
Alexey Lapshin
2024-08-01 12:33:16 +07:00
parent e21fca42ef
commit 1608b4cde4

View File

@@ -293,9 +293,12 @@ endfunction()
#
function(__build_resolve_and_add_req var component_target req type)
__component_get_target(_req_target ${req})
__component_get_property(_component_name ${component_target} COMPONENT_NAME)
if(NOT _req_target)
message(FATAL_ERROR "Failed to resolve component '${req}' required by component '${_component_name}'.")
endif()
__component_get_property(_req_registered ${_req_target} __COMPONENT_REGISTERED)
if(NOT _req_target OR NOT _req_registered)
__component_get_property(_component_name ${component_target} COMPONENT_NAME)
if(NOT _req_registered)
message(FATAL_ERROR "Failed to resolve component '${req}' required by component '${_component_name}'.")
endif()
__component_set_property(${component_target} ${type} ${_req_target} APPEND)