From cd5afd140dfcb6e878fc81cd811485119eb27363 Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Mon, 11 Nov 2024 16:51:23 +1100 Subject: [PATCH 1/2] cmake: Register automatic git submodules handling. Signed-off-by: Andrew Leech --- micropython.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/micropython.cmake b/micropython.cmake index fb9a24a35..25a92163d 100644 --- a/micropython.cmake +++ b/micropython.cmake @@ -1,6 +1,12 @@ # This file is to be given as "make USER_C_MODULES=..." when building Micropython port +if(ECHO_SUBMODULES) + list(APPEND GIT_SUBMODULES ${CMAKE_CURRENT_LIST_DIR}/lvgl ${CMAKE_CURRENT_LIST_DIR}/pycparser) +elseif(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/lvgl/README.md) + message(FATAL_ERROR " lvgl not initialized.\n Run 'make BOARD=${MICROPY_BOARD} submodules'") +endif() + # Include LVGL component, ignore KCONFIG separate_arguments(LV_CFLAGS_ENV UNIX_COMMAND $ENV{LV_CFLAGS}) From 40b90ad1a91106f37158bdac1ddd005378a002ee Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Tue, 11 Nov 2025 22:30:28 +1100 Subject: [PATCH 2/2] micropython.mk: Register automatic git submodules handling. Signed-off-by: Andrew Leech --- micropython.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/micropython.mk b/micropython.mk index a884a4466..a3d7549f2 100644 --- a/micropython.mk +++ b/micropython.mk @@ -105,3 +105,12 @@ SRC_USERMOD_LIB_C += $(shell find $(LVGL_DIR)/examples -type f -name "*.c") endif SRC_USERMOD_C += $(LVGL_MPY) + +# include lvgl submodule check in the micropython submodules rule. +LVGL_SUBMODULES = lvgl pycparser +submodules: lvgl_submodule +lvgl_submodule: + $(ECHO) "Updating submodules: $(LVGL_SUBMODULES)" + $(Q)cd $(LVGL_BINDING_DIR) && git submodule sync $(LVGL_SUBMODULES) + $(Q)cd $(LVGL_BINDING_DIR) && git submodule update --init $(LVGL_SUBMODULES) +.PHONY: lvgl_submodule