Skip to content

Commit

Permalink
py/usermod.cmake: Check target exists in usermod_gather_sources.
Browse files Browse the repository at this point in the history
Check a target exists before accessing properties.  Otherwise
usermod_gather_sources would recurse into garbage property names and break.

Signed-off-by: Phil Howard <[email protected]>
  • Loading branch information
Gadgetoid authored and dpgeorge committed Oct 15, 2024
1 parent fa942d5 commit 525fce7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions py/usermod.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 525fce7

Please sign in to comment.