summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorPhil Howard <phil@gadgetoid.com>2024-06-28 16:01:12 +0100
committerDamien George <damien@micropython.org>2024-10-15 11:51:56 +1100
commit525fce717030e0be98adcd983c1df663717a74a5 (patch)
treec044236a39f73d836467ee6feb05492488d8d210 /py
parentfa942d532f326b3b8c5d4cb68439ad6669beb1e4 (diff)
downloadmicropython-525fce717030e0be98adcd983c1df663717a74a5.tar.gz
micropython-525fce717030e0be98adcd983c1df663717a74a5.zip
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>
Diffstat (limited to 'py')
-rw-r--r--py/usermod.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/usermod.cmake b/py/usermod.cmake
index 8532762837..c814369a48 100644
--- a/py/usermod.cmake
+++ b/py/usermod.cmake
@@ -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)