Skip to content

Commit dccd206

Browse files
pi-anldpgeorge
authored andcommitted
py/usermod.cmake: Add check that any specified USER_C_MODULES exists.
Signed-off-by: Andrew Leech <[email protected]>
1 parent b65e891 commit dccd206

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

py/usermod.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ endfunction()
4242
# Include CMake files for user modules.
4343
if (USER_C_MODULES)
4444
foreach(USER_C_MODULE_PATH ${USER_C_MODULES})
45+
# Confirm the provided path exists, show abspath if not to make it clearer to fix.
46+
if (NOT EXISTS ${USER_C_MODULE_PATH})
47+
get_filename_component(USER_C_MODULES_ABS "${USER_C_MODULE_PATH}" ABSOLUTE)
48+
message(FATAL_ERROR "USER_C_MODULES doesn't exist: ${USER_C_MODULES_ABS}")
49+
endif()
50+
4551
message("Including User C Module(s) from ${USER_C_MODULE_PATH}")
4652
include(${USER_C_MODULE_PATH})
4753
endforeach()

0 commit comments

Comments
 (0)