Skip to content

Commit 78d017f

Browse files
pi-anldpgeorge
authored andcommitted
py/usermod.cmake: If USER_C_MODULES is a folder add micropython.cmake.
This mirrors how it works when using a Makefile. Signed-off-by: Andrew Leech <[email protected]>
1 parent dccd206 commit 78d017f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

py/usermod.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ endfunction()
4242
# Include CMake files for user modules.
4343
if (USER_C_MODULES)
4444
foreach(USER_C_MODULE_PATH ${USER_C_MODULES})
45+
# If a directory is given, append the micropython.cmake to it.
46+
if (IS_DIRECTORY ${USER_C_MODULE_PATH})
47+
set(USER_C_MODULE_PATH "${USER_C_MODULE_PATH}/micropython.cmake")
48+
endif()
4549
# Confirm the provided path exists, show abspath if not to make it clearer to fix.
4650
if (NOT EXISTS ${USER_C_MODULE_PATH})
4751
get_filename_component(USER_C_MODULES_ABS "${USER_C_MODULE_PATH}" ABSOLUTE)

0 commit comments

Comments
 (0)