Skip to content

Commit

Permalink
py/usermod.cmake: If USER_C_MODULES is a folder add micropython.cmake.
Browse files Browse the repository at this point in the history
This mirrors how it works when using a Makefile.

Signed-off-by: Andrew Leech <[email protected]>
  • Loading branch information
pi-anl authored and dpgeorge committed Nov 20, 2024
1 parent dccd206 commit 78d017f
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 @@ -42,6 +42,10 @@ endfunction()
# Include CMake files for user modules.
if (USER_C_MODULES)
foreach(USER_C_MODULE_PATH ${USER_C_MODULES})
# If a directory is given, append the micropython.cmake to it.
if (IS_DIRECTORY ${USER_C_MODULE_PATH})
set(USER_C_MODULE_PATH "${USER_C_MODULE_PATH}/micropython.cmake")
endif()
# Confirm the provided path exists, show abspath if not to make it clearer to fix.
if (NOT EXISTS ${USER_C_MODULE_PATH})
get_filename_component(USER_C_MODULES_ABS "${USER_C_MODULE_PATH}" ABSOLUTE)
Expand Down

0 comments on commit 78d017f

Please sign in to comment.