GetPrerequisites: Only recurse on resolved unseen prerequisites

I encountered an issue where not all prerequisites would be listed by
`get_prerequisites` since some of the prerequisites cannot be resolved
and are added to the list of unseen prerequisites.  This has the side
effect of clearing the list of `prerequisites_var` and thus removes some
prerequisites from the list.  Fix it.
This commit is contained in:
Guillaume Dumont 2017-05-04 14:51:39 -04:00 committed by Brad King
parent 8e2f3582eb
commit e0e414d659

View File

@ -943,7 +943,11 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
#
if(NOT list_length_before_append EQUAL list_length_after_append)
gp_resolve_item("${target}" "${item}" "${exepath}" "${dirs}" resolved_item "${rpaths}")
set(unseen_prereqs ${unseen_prereqs} "${resolved_item}")
if(EXISTS "${resolved_item}")
# Recurse only if we could resolve the item.
# Otherwise the prerequisites_var list will be cleared
set(unseen_prereqs ${unseen_prereqs} "${resolved_item}")
endif()
endif()
endif()
endif()