py/usermod.cmake: Check target exists in usermod_gather_sources.

Check a target exists before accessing properties.  Otherwise
usermod_gather_sources would recurse into garbage property names and break.

Signed-off-by: Phil Howard <phil@gadgetoid.com>
This commit is contained in:
Phil Howard
2024-06-28 16:01:12 +01:00
committed by Damien George
parent fa942d532f
commit 525fce7170

View File

@@ -5,6 +5,10 @@ function(usermod_gather_sources SOURCES_VARNAME INCLUDE_DIRECTORIES_VARNAME INCL
if (NOT ${LIB} IN_LIST ${INCLUDED_VARNAME})
list(APPEND ${INCLUDED_VARNAME} ${LIB})
if (NOT TARGET ${LIB})
return()
endif()
# Gather library sources
get_target_property(lib_sources ${LIB} INTERFACE_SOURCES)
if (lib_sources)