Skip to content

Commit 525fce7

Browse files
Gadgetoiddpgeorge
authored andcommitted
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>
1 parent fa942d5 commit 525fce7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

py/usermod.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ function(usermod_gather_sources SOURCES_VARNAME INCLUDE_DIRECTORIES_VARNAME INCL
55
if (NOT ${LIB} IN_LIST ${INCLUDED_VARNAME})
66
list(APPEND ${INCLUDED_VARNAME} ${LIB})
77

8+
if (NOT TARGET ${LIB})
9+
return()
10+
endif()
11+
812
# Gather library sources
913
get_target_property(lib_sources ${LIB} INTERFACE_SOURCES)
1014
if (lib_sources)

0 commit comments

Comments
 (0)