summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2025-01-14 11:50:27 +1100
committerAngus Gratton <gus@projectgus.com>2025-01-29 11:41:32 +1100
commit22353e9e1ed5bf8bc5bad179896ca2877f7511e2 (patch)
treee1e7053f3bfe869b2a761616be5bfff608600a9e /py
parent43e3ab6131b11d7fb7409a35fe5127317ba27397 (diff)
py/mkrules: Add GIT_SUBMODULES_FAIL_IF_EMPTY flag for CMake ports.
The way CMake gathers the submodule list, it can quietly be empty if the previous step fails. This makes it an explicit error. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'py')
-rw-r--r--py/mkrules.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/py/mkrules.mk b/py/mkrules.mk
index 74978b0d1..373bda899 100644
--- a/py/mkrules.mk
+++ b/py/mkrules.mk
@@ -257,6 +257,13 @@ ifneq ($(GIT_SUBMODULES),)
$(Q)cd $(TOP) && git submodule sync $(GIT_SUBMODULES)
$(Q)cd $(TOP) && git submodule update --init --filter=blob:none $(GIT_SUBMODULES) || \
git submodule update --init $(GIT_SUBMODULES)
+else
+ifeq ($(GIT_SUBMODULES_FAIL_IF_EMPTY),1)
+ # If you see this error, it may mean the internal step run by the port's build
+ # system to find git submodules has failed. Double-check dependencies are set correctly.
+ $(ECHO) "Internal build error: The submodule list should not be empty."
+ exit 1
+endif
endif
.PHONY: submodules