From 6ea58dd5929a81f73c2416d3667f8e723fc5fa14 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 34b9d62b2..97fc4afc6 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 8fdb110719ef41e307cf44ded3af541fc67994a5 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 2df5eaf29..c417fea99 100644 --- a/micropython.mk +++ b/micropython.mk @@ -100,3 +100,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